|
@@ -5,8 +5,8 @@
|
5
|
5
|
<span>粮情检测类型:</span>
|
6
|
6
|
<span>{{ checkPerson }}</span>
|
7
|
7
|
</div>
|
8
|
|
-
|
9
|
|
- <div class="table">
|
|
8
|
+ <!-- 2新增3修改 -->
|
|
9
|
+ <div class="table" v-show="type == 2 || type == 3">
|
10
|
10
|
<el-table
|
11
|
11
|
border
|
12
|
12
|
:header-cell-style="{ background: '#f8f8f8' }"
|
|
@@ -23,53 +23,110 @@
|
23
|
23
|
label="序号"
|
24
|
24
|
width="50px"
|
25
|
25
|
/>
|
|
26
|
+ <el-table-column prop="createDate" label="检查时间" align="center">
|
|
27
|
+ <template slot-scope="scope">
|
|
28
|
+ <span>{{
|
|
29
|
+ scope.row.createDate == null
|
|
30
|
+ ? scope.row.createDate
|
|
31
|
+ : scope.row.createDate.slice(0, 16)
|
|
32
|
+ }}</span>
|
|
33
|
+ </template>
|
|
34
|
+ </el-table-column>
|
26
|
35
|
<el-table-column
|
27
|
|
- prop="createTime"
|
28
|
|
- label="检查时间"
|
|
36
|
+ prop="fieldValue"
|
|
37
|
+ label="检查项对应名称"
|
29
|
38
|
align="center"
|
30
|
|
- /><el-table-column
|
|
39
|
+ v-if="false"
|
|
40
|
+ />
|
|
41
|
+ <el-table-column prop="enumName" label="检查项" align="center" />
|
|
42
|
+ <el-table-column prop="enumOrder" label="选项" align="center">
|
|
43
|
+ <template slot-scope="scope">
|
|
44
|
+ <el-radio-group
|
|
45
|
+ v-model="scope.row.enumOrder"
|
|
46
|
+ @change.native="showClick(scope.$index, scope.row)"
|
|
47
|
+ :disabled="isDetail"
|
|
48
|
+ >
|
|
49
|
+ <el-radio label="1">是</el-radio>
|
|
50
|
+ <el-radio label="0">否</el-radio>
|
|
51
|
+ <el-link
|
|
52
|
+ :underline="false"
|
|
53
|
+ class="spike"
|
|
54
|
+ id="spike"
|
|
55
|
+ v-if="
|
|
56
|
+ scope.row.enumOrder == 1 &&
|
|
57
|
+ scope.row.enumName.indexOf('异常') != -1
|
|
58
|
+ "
|
|
59
|
+ @click="showHandler(scope.row)"
|
|
60
|
+ >
|
|
61
|
+ {{ scope.row.enumName + " >>" }}
|
|
62
|
+ </el-link>
|
|
63
|
+ </el-radio-group>
|
|
64
|
+ </template>
|
|
65
|
+ </el-table-column>
|
|
66
|
+ </el-table>
|
|
67
|
+ </div>
|
|
68
|
+ <!-- 1查看 -->
|
|
69
|
+ <div class="table" v-show="type == 1">
|
|
70
|
+ <el-table
|
|
71
|
+ border
|
|
72
|
+ :header-cell-style="{ background: '#f8f8f8' }"
|
|
73
|
+ ref="orderTable"
|
|
74
|
+ highlight-current-row
|
|
75
|
+ :data="tbdata"
|
|
76
|
+ height="631"
|
|
77
|
+ row-key="index"
|
|
78
|
+ @current-change="handleCurrentChange"
|
|
79
|
+ >
|
|
80
|
+ <el-table-column
|
|
81
|
+ type="index"
|
|
82
|
+ align="center"
|
|
83
|
+ label="序号"
|
|
84
|
+ width="50px"
|
|
85
|
+ />
|
|
86
|
+ <el-table-column prop="createDate" label="检查时间" align="center">
|
|
87
|
+ <template slot-scope="scope">
|
|
88
|
+ <span>{{
|
|
89
|
+ scope.row.createDate == null
|
|
90
|
+ ? scope.row.createDate
|
|
91
|
+ : scope.row.createDate.slice(0, 16)
|
|
92
|
+ }}</span>
|
|
93
|
+ </template>
|
|
94
|
+ </el-table-column>
|
|
95
|
+ <el-table-column
|
31
|
96
|
prop="fieldValue"
|
32
|
97
|
label="检查项对应名称"
|
33
|
98
|
align="center"
|
34
|
99
|
v-if="false"
|
35
|
100
|
/>
|
36
|
|
- <el-table-column prop="fieldDetail" label="检查项" align="center" />
|
37
|
|
- <el-table-column prop="whether" label="选项" align="center">
|
|
101
|
+ <el-table-column prop="enumName" label="检查项" align="center" />
|
|
102
|
+ <el-table-column prop="enumOrder" label="选项" align="center">
|
38
|
103
|
<template slot-scope="scope">
|
39
|
104
|
<el-radio-group
|
40
|
|
- v-model="scope.row.whether.radio"
|
|
105
|
+ v-model="scope.row.enumOrder"
|
41
|
106
|
@change.native="showClick(scope.$index, scope.row)"
|
42
|
107
|
:disabled="isDetail"
|
43
|
108
|
>
|
44
|
|
- <el-radio label="1">{{ scope.row.whether.status1 }}</el-radio>
|
45
|
|
- <el-radio label="0">{{ scope.row.whether.status2 }}</el-radio>
|
46
|
|
- <!-- <div v-if="type == '2' ">
|
47
|
|
- <el-button>新增显示</el-button>
|
48
|
|
- </div> -->
|
49
|
|
- <!-- <div v-if="type == '1' || type == '3'"> -->
|
|
109
|
+ <el-radio label="1">是</el-radio>
|
|
110
|
+ <el-radio label="0">否</el-radio>
|
50
|
111
|
<el-link
|
51
|
112
|
:underline="false"
|
52
|
113
|
class="spike"
|
53
|
114
|
id="spike"
|
54
|
115
|
v-if="
|
55
|
|
- scope.row.whether.radio == 1 &&
|
56
|
|
- scope.row.fieldDetail.indexOf('异常') != -1
|
|
116
|
+ scope.row.enumOrder == 1 &&
|
|
117
|
+ scope.row.enumName.indexOf('异常') != -1
|
57
|
118
|
"
|
58
|
119
|
@click="showHandler(scope.row)"
|
59
|
120
|
>
|
60
|
|
- {{ scope.row.fieldDetail + " >>" }}
|
|
121
|
+ {{ scope.row.enumName + " >>" }}
|
61
|
122
|
</el-link>
|
62
|
|
- <!-- </div> -->
|
63
|
|
-
|
64
|
|
- <!-- <el-button v-if='scope.row.whether.radio ==1 && scope.row.fieldDetail.indexOf("异常") != -1'>{{scope.row.fieldDetail + ' >>'}}</el-button> -->
|
65
|
123
|
</el-radio-group>
|
66
|
124
|
</template>
|
67
|
125
|
</el-table-column>
|
68
|
126
|
</el-table>
|
69
|
127
|
</div>
|
70
|
|
-
|
71
|
128
|
<div class="btns">
|
72
|
|
- <el-button type="cancel" @click="cancel()"> 返回 </el-button>
|
|
129
|
+ <el-button type="cancel" @click="back()"> 返回 </el-button>
|
73
|
130
|
|
74
|
131
|
<el-button
|
75
|
132
|
type="savebtn"
|
|
@@ -87,10 +144,6 @@
|
87
|
144
|
@click="saveInfo"
|
88
|
145
|
>保存</el-button
|
89
|
146
|
>
|
90
|
|
-
|
91
|
|
- <!-- <div v-if='type="1" || type="3"'>
|
92
|
|
-
|
93
|
|
- </div> -->
|
94
|
147
|
</div>
|
95
|
148
|
|
96
|
149
|
<!-- 新增虫害异常 -->
|
|
@@ -126,7 +179,7 @@
|
126
|
179
|
</el-form-item>
|
127
|
180
|
</el-form>
|
128
|
181
|
<div slot="footer" class="dialog-footer">
|
129
|
|
- <el-button @click="dialogFormVisible = false" type="cancel"
|
|
182
|
+ <el-button @click="cancel('abnormalPest')" type="cancel"
|
130
|
183
|
>取 消</el-button
|
131
|
184
|
>
|
132
|
185
|
<el-button type="savebtn" @click="saveFormData()">确 定</el-button>
|
|
@@ -147,7 +200,7 @@
|
147
|
200
|
></el-input>
|
148
|
201
|
</el-form>
|
149
|
202
|
<div slot="footer" class="dialog-footer">
|
150
|
|
- <el-button @click="dialogFormVisible1 = false" type="cancel"
|
|
203
|
+ <el-button @click="cancel('abnormalWater')" type="cancel"
|
151
|
204
|
>取 消</el-button
|
152
|
205
|
>
|
153
|
206
|
<el-button type="savebtn" @click="dialogFormVisible1 = false"
|
|
@@ -171,7 +224,7 @@
|
171
|
224
|
</el-form-item>
|
172
|
225
|
</el-form>
|
173
|
226
|
<div slot="footer" class="dialog-footer">
|
174
|
|
- <el-button @click="dialogFormVisible2 = false" type="cancel"
|
|
227
|
+ <el-button @click="cancel('abnormalGrain')" type="cancel"
|
175
|
228
|
>取 消</el-button
|
176
|
229
|
>
|
177
|
230
|
<el-button type="savebtn" @click="saveForm">确 定</el-button>
|
|
@@ -190,7 +243,8 @@ import {
|
190
|
243
|
addInfo,
|
191
|
244
|
getDateTimeNow,
|
192
|
245
|
haveDone, //处理待办
|
193
|
|
- haveDone1
|
|
246
|
+ haveDone1,
|
|
247
|
+ getGrainItems
|
194
|
248
|
} from "@/api/grainCheck/index"
|
195
|
249
|
export default {
|
196
|
250
|
name: "AddNewGrain",
|
|
@@ -217,7 +271,7 @@ export default {
|
217
|
271
|
pestDensity: "", // 虫害密度
|
218
|
272
|
occurArea: "", //发生面积
|
219
|
273
|
occurPosition: "", // 发生部位
|
220
|
|
- pestType: " ", // 虫害种类
|
|
274
|
+ pestType: "", // 虫害种类
|
221
|
275
|
abnormalGrain: "", // 粮情异常描述
|
222
|
276
|
abnormalWater: "" // 水分检测异常描述
|
223
|
277
|
},
|
|
@@ -230,8 +284,9 @@ export default {
|
230
|
284
|
// 每行id
|
231
|
285
|
id: "",
|
232
|
286
|
// 按钮类型
|
233
|
|
- type: "",
|
|
287
|
+ type: "", // 2:新增 1:查看 3:修改
|
234
|
288
|
show: "true", //查看时不显示改为false
|
|
289
|
+ isExist: false, //点击选项时判断是否存在该项数据,存在更新,不存在新增
|
235
|
290
|
// 检查类型
|
236
|
291
|
checkPerson: "",
|
237
|
292
|
data2: {}, //待办传参过来的数据
|
|
@@ -261,27 +316,52 @@ export default {
|
261
|
316
|
// pestOccurArea: "",
|
262
|
317
|
pestType: ""
|
263
|
318
|
}
|
|
319
|
+ },
|
|
320
|
+ // 重构后的新增数据模板
|
|
321
|
+ data5: {
|
|
322
|
+ grainConditionRecord: {
|
|
323
|
+ anomalousStatus: 0, //异常状态(0无异常,1有异常)
|
|
324
|
+ checkPerson: 0, //检查人
|
|
325
|
+ checkYear: 0, //检查年份(用于粮情异常等,做年统计)
|
|
326
|
+ checkYearWeek: 0, //检查所在年第几周
|
|
327
|
+ depotId: 0, //库id
|
|
328
|
+ enumId: 0, //检查类型
|
|
329
|
+ enumOrder: 0, //用于同公共枚举同步顺序
|
|
330
|
+ houseId: 0, //仓房id
|
|
331
|
+ id: 0, //粮情检测记录id
|
|
332
|
+ operationTime: "", //检查(操作)时间
|
|
333
|
+ recordStatus: 0, //记录状态(0进行中,1完成)
|
|
334
|
+ grainError: null, //粮情异常,值为对应的enumId
|
|
335
|
+ insectPestError: null, //虫害异常 值为对应的enumId
|
|
336
|
+ wetCheckError: null //水分检测异常 值为对应的enumId
|
|
337
|
+ },
|
|
338
|
+ grainConditionRecordChildren: [
|
|
339
|
+ /* {
|
|
340
|
+ anomalousStatus: 0, //是否异常_选项(0:否,1:是)
|
|
341
|
+ enumId: 0, //检查类型
|
|
342
|
+ id: 0, //粮情检查新增检查项
|
|
343
|
+ operationTime: "string", //操作时间
|
|
344
|
+ parentId: 0 //关联主表id(检查人id-保管员或总经理等)
|
|
345
|
+ } */
|
|
346
|
+ ]
|
264
|
347
|
}
|
265
|
348
|
}
|
266
|
349
|
},
|
267
|
|
- /* created(){
|
268
|
|
- this.$nextTick(() => {
|
269
|
|
-
|
270
|
|
- if (this.$route.query.type == '1') {
|
271
|
|
- this.reast()
|
272
|
|
- this.pageTitle = '查看'
|
273
|
|
- this.isDetail = true
|
274
|
|
- this.detailInfo()
|
275
|
|
- }
|
276
|
|
- }, */
|
277
|
350
|
|
278
|
351
|
mounted() {
|
279
|
352
|
// 初始化的时候把参数拼接到要传输的数据里
|
280
|
353
|
let routeParams = this.$route.query
|
281
|
|
- /* console.log(routeParams,'routeParams')
|
282
|
|
- console.log(this.$store.state.depotId,'this.$store.state.depotId') */
|
|
354
|
+ // console.log(routeParams, "routeParams")
|
|
355
|
+ // console.log(this.$store.state.depotId, "this.$store.state.depotId")
|
283
|
356
|
this.userInfo = JSON.parse(localStorage.getItem("userInfo"))
|
284
|
357
|
this.uid = this.userInfo.uid
|
|
358
|
+
|
|
359
|
+ if (routeParams.type == 3) {
|
|
360
|
+ this.data5.grainConditionRecord = routeParams.data
|
|
361
|
+ }
|
|
362
|
+
|
|
363
|
+ this.data5.grainConditionRecord.checkPerson = this.userInfo.uid
|
|
364
|
+ this.data5.grainConditionRecord.enumId = routeParams.data.enumId
|
285
|
365
|
// console.log(this.$route.query.daibanObj,'this.$route.query.daibanObj')
|
286
|
366
|
//待办数据
|
287
|
367
|
this.data2 = this.$route.query.daibanObj
|
|
@@ -291,17 +371,14 @@ export default {
|
291
|
371
|
this.id = routeParams.data.id
|
292
|
372
|
// console.log(this.id,'this.id')
|
293
|
373
|
this.type = routeParams.type
|
294
|
|
- this.checkPerson = routeParams.data.checkPerson
|
295
|
|
- this.data = routeParams
|
296
|
|
- this.describe = JSON.parse(routeParams.data.checkDescribe)
|
297
|
|
- this.data3.checkTime = routeParams.data.checkTime
|
298
|
|
- this.data3.checkPerson = routeParams.data.checkPerson
|
299
|
|
- this.data3.recordStatus = routeParams.data.recordStatus
|
300
|
|
- this.data3.anomalousStatus = routeParams.data.anomalousStatus
|
|
374
|
+ // console.log(this.type, "this.type....")
|
|
375
|
+ // this.checkPerson = routeParams.data.checkPerson
|
|
376
|
+ // this.data = routeParams
|
|
377
|
+ // this.describe = JSON.parse(routeParams.data.checkDescribe)
|
301
|
378
|
|
302
|
379
|
// 获取用户的库id和仓房id
|
303
|
380
|
let userinfo = JSON.parse(localStorage.getItem("userInfo"))
|
304
|
|
- console.log(userinfo, "userinfo............")
|
|
381
|
+ // console.log(userinfo, "userinfo............")
|
305
|
382
|
// this.depot_id = this.$store.state.depotId
|
306
|
383
|
// this.house_id = userinfo.houseId
|
307
|
384
|
// console.log(routeParams.data,'routeParams.data')
|
|
@@ -309,144 +386,196 @@ export default {
|
309
|
386
|
this.show = false
|
310
|
387
|
} else if (this.type == 3) {
|
311
|
388
|
if (Object.getOwnPropertyNames(this.describe).length - 1 == 14) {
|
312
|
|
- console.log(Object.getOwnPropertyNames(this.describe).length, "0.0.0.")
|
|
389
|
+ // console.log(Object.getOwnPropertyNames(this.describe).length, "0.0.0.")
|
313
|
390
|
this.flag = true
|
314
|
391
|
}
|
315
|
392
|
}
|
316
|
|
- /* if(this.type !==2 && Object.getOwnPropertyNames(this.describe).length-1 ==14){
|
317
|
|
- // console.log('this.flag')
|
318
|
|
- this.flag = true
|
319
|
|
- } */
|
|
393
|
+
|
320
|
394
|
// 新增初始化数据
|
321
|
395
|
this.getinfo()
|
322
|
396
|
},
|
323
|
397
|
|
324
|
398
|
methods: {
|
325
|
399
|
showHandler(val) {
|
326
|
|
- // console.log(val,'val...')
|
327
|
|
- if (val.fieldValue == "pest_abnormal") {
|
|
400
|
+ // console.log(val, "val...")
|
|
401
|
+ if (val.enumId == 189) {
|
328
|
402
|
this.dialogFormVisible = true
|
329
|
|
- } else if (val.fieldValue == "water_abnormal") {
|
|
403
|
+ } else if (val.enumId == 190) {
|
330
|
404
|
this.dialogFormVisible1 = true
|
331
|
|
- } else if (val.fieldValue == "grain_abnormal") {
|
|
405
|
+ } else if (val.enumId == 191) {
|
332
|
406
|
this.dialogFormVisible2 = true
|
333
|
407
|
}
|
334
|
408
|
},
|
335
|
409
|
getinfo() {
|
336
|
410
|
// 目前只有一页,在前端写死了请求参数
|
337
|
411
|
// 在内部判断是新增修改还是查看
|
338
|
|
- let condition = {
|
339
|
|
- table_name: "grain_condition_record",
|
340
|
|
- field_name: "check_list"
|
341
|
|
- }
|
342
|
|
- let data1 = {
|
343
|
|
- pageIndex: 1,
|
344
|
|
- pageSize: 30,
|
345
|
|
- condition: JSON.stringify(condition)
|
346
|
|
- }
|
347
|
|
- // console.log(this.type,'type...')
|
348
|
|
- if (this.type == "2") {
|
349
|
|
- getAddInfo(data1)
|
|
412
|
+
|
|
413
|
+ // console.log(this.type, "type...")
|
|
414
|
+ if (this.type == 2) {
|
|
415
|
+ // console.log("新增页面初始化")
|
|
416
|
+ getGrainItems(19)
|
350
|
417
|
.then(res => {
|
351
|
|
- //新增初始化
|
352
|
|
- this.tbdata = res.data.records
|
353
|
|
- this.depot_id = this.$store.state.depotId
|
354
|
|
- /* console.log(this.$store.state.houseId,'this.$store.state.houseId')
|
355
|
|
- console.log(this.$store.state.depotId,'this.$store.state.depotId')
|
356
|
|
- console.log(this.data2,'this.data2')
|
357
|
|
- console.log(this.userInfo.depotId,'this.userInfo.depotId') */
|
|
418
|
+ if (res.code == 200) {
|
|
419
|
+ // console.log(res, "res字典19")
|
|
420
|
+ this.tbdata = res.data
|
|
421
|
+ // 新增时把检查项数据给保存下来
|
|
422
|
+ this.data5.grainConditionRecordChildren = JSON.parse(
|
|
423
|
+ JSON.stringify(res.data)
|
|
424
|
+ )
|
|
425
|
+ this.data5.grainConditionRecordChildren.map(item => {
|
|
426
|
+ item.id = null
|
|
427
|
+ delete item.delFlag
|
|
428
|
+ delete item.parentId
|
|
429
|
+ delete item.remark
|
|
430
|
+ delete item.enumName
|
|
431
|
+ delete item.enumOrder
|
|
432
|
+ delete item.createDate
|
|
433
|
+ })
|
|
434
|
+ // console.log(this.tbdata, "tbdata.......")
|
|
435
|
+ // console.log(
|
|
436
|
+ // this.data5.grainConditionRecordChildren,
|
|
437
|
+ // " this.data5.grainConditionRecordChildren......."
|
|
438
|
+ // )
|
|
439
|
+ }
|
358
|
440
|
})
|
359
|
441
|
.catch(err => {
|
360
|
442
|
console.log(err)
|
361
|
443
|
})
|
362
|
444
|
} else if (this.type == "1") {
|
363
|
445
|
//查看
|
364
|
|
- this.isDetail = true
|
365
|
|
- getAddInfo(data1)
|
|
446
|
+ // 检查项初始化
|
|
447
|
+ getGrainItems(19)
|
366
|
448
|
.then(res => {
|
367
|
|
- // console.log(res)
|
368
|
|
- this.tbdata = res.data.records
|
369
|
|
- // console.log("产看修改初始化")
|
370
|
449
|
if (res.code == 200) {
|
371
|
|
- // 如果成功,就再次调用查看接口
|
|
450
|
+ this.tbdata = res.data
|
|
451
|
+ // this.data5.grainConditionRecordChildren = JSON.parse(JSON.stringify(res.data))
|
|
452
|
+ // console.log(this.tbdata, "tbdata.......")
|
|
453
|
+ //获取查看数据
|
372
|
454
|
checkGrainInfo(this.id)
|
373
|
455
|
.then(res => {
|
374
|
|
- this.describe = JSON.parse(res.data.checkDescribe)
|
375
|
|
- //如果有异常项,就把异常项的值赋值给form数据源
|
376
|
|
- this.form.pestDensity = this.data.data.grainAbnormalDescribe.pestDensity
|
377
|
|
- this.form.occurArea = this.data.data.grainAbnormalDescribe.occurArea
|
378
|
|
- this.form.occurPosition = this.data.data.grainAbnormalDescribe.occurPosition
|
379
|
|
- this.form.pestType = this.data.data.grainAbnormalDescribe.pestType
|
380
|
|
- this.form.abnormalGrain = this.data.data.grainAbnormalDescribe.abnormalGrain
|
381
|
|
- this.form.abnormalWater = this.data.data.grainAbnormalDescribe.abnormalWater
|
382
|
|
-
|
383
|
|
- /* 遍历this.describe的key跟初始化时的每一项的fieldValue匹配,
|
384
|
|
- 匹配成功则把时间跟choose赋值给数据源tbdata */
|
|
456
|
+ if (res.code == 200) {
|
|
457
|
+ // console.log(res, "获取查看数据")
|
385
|
458
|
|
386
|
|
- for (const key in this.describe) {
|
387
|
459
|
for (let i = 0; i < this.tbdata.length; i++) {
|
388
|
|
- if (key == this.tbdata[i].fieldValue) {
|
389
|
|
- this.tbdata[i].createTime = this.describe[key].time
|
390
|
|
- this.tbdata[i].whether.radio = this.describe[key].choose
|
|
460
|
+ for (let j = 0; j < res.data.length; j++) {
|
|
461
|
+ if (this.tbdata[i].enumId == res.data[j].enumId) {
|
|
462
|
+ // console.log(this.tbdata.indexOf(this.tbdata[i]),"this.tbdata[i]的index" )
|
|
463
|
+ // console.log( res.data.indexOf(res.data[j]),"res.data.indexOf(res.data[j])")
|
|
464
|
+ // var itemIndex = this.tbdata.indexOf(this.tbdata[i])
|
|
465
|
+ if (
|
|
466
|
+ this.tbdata[i].enumId == 189 ||
|
|
467
|
+ this.tbdata[i].enumId == 190 ||
|
|
468
|
+ this.tbdata[i].enumId == 191
|
|
469
|
+ ) {
|
|
470
|
+ // console.log(this.tbdata[i].enumName)
|
|
471
|
+ this.tbdata[i].createDate =
|
|
472
|
+ res.data[j].operationTime
|
|
473
|
+ this.tbdata[i].enumOrder = String(
|
|
474
|
+ res.data[j].anomalousStatus
|
|
475
|
+ )
|
|
476
|
+ //如果有异常项,就把异常项的值赋值给form数据源
|
|
477
|
+
|
|
478
|
+ if (res.data[j].anomalousStatus == 1) {
|
|
479
|
+ this.form = JSON.parse(res.data[j].errorDescribed)
|
|
480
|
+ // console.log(this.form, "this.form")
|
|
481
|
+ // console.log(
|
|
482
|
+ // res.data[j].errorDescribed,
|
|
483
|
+ // "res.data[j].errorDescribed"
|
|
484
|
+ // )
|
|
485
|
+ }
|
|
486
|
+ } else {
|
|
487
|
+ this.tbdata[i].createDate =
|
|
488
|
+ res.data[j].operationTime
|
|
489
|
+ this.tbdata[i].enumOrder = String(
|
|
490
|
+ res.data[j].anomalousStatus
|
|
491
|
+ )
|
|
492
|
+ }
|
|
493
|
+ }
|
391
|
494
|
}
|
392
|
495
|
}
|
393
|
|
- // if(key ==this.)
|
394
|
496
|
}
|
395
|
497
|
})
|
396
|
498
|
.catch(err => {
|
397
|
|
- console.log(err)
|
|
499
|
+ console.log(err, "获取查看数据失败信息")
|
398
|
500
|
})
|
399
|
501
|
}
|
400
|
502
|
})
|
401
|
503
|
.catch(err => {
|
402
|
504
|
console.log(err)
|
403
|
505
|
})
|
|
506
|
+ this.isDetail = true
|
404
|
507
|
} else if (this.type == "3") {
|
405
|
508
|
//修改
|
406
|
|
- getAddInfo(data1)
|
|
509
|
+ // 检查项初始化
|
|
510
|
+ getGrainItems(19)
|
407
|
511
|
.then(res => {
|
408
|
|
- // console.log(res,'修改接口获取到的数据')
|
409
|
|
- this.tbdata = res.data.records
|
410
|
|
- // console.log("产看修改初始化")
|
411
|
512
|
if (res.code == 200) {
|
412
|
|
- // 如果成功,就再次调用查看接口
|
|
513
|
+ // console.log(res, "res修改数据")
|
|
514
|
+ this.tbdata = res.data
|
|
515
|
+ // console.log(this.tbdata, "tbdata.......")
|
|
516
|
+ //获取数据
|
413
|
517
|
checkGrainInfo(this.id)
|
414
|
518
|
.then(res => {
|
415
|
|
- console.log(res.data, "修改查看res")
|
416
|
|
- this.data3 = res.data
|
417
|
|
- // this.data3.checkDescribe = JSON.parse(res.data.checkDescribe)
|
418
|
|
- this.describe = JSON.parse(res.data.checkDescribe)
|
419
|
|
- this.data3.checkDescribe = this.describe
|
420
|
|
-
|
421
|
|
- //如果有异常项,就把异常项的值赋值给form数据源
|
422
|
|
- this.form.pestDensity = this.data.data.grainAbnormalDescribe.pestDensity
|
423
|
|
- this.form.occurArea = this.data.data.grainAbnormalDescribe.occurArea
|
424
|
|
- this.form.occurPosition = this.data.data.grainAbnormalDescribe.occurPosition
|
425
|
|
- this.form.pestType = this.data.data.grainAbnormalDescribe.pestType
|
426
|
|
- this.form.abnormalGrain = this.data.data.grainAbnormalDescribe.abnormalGrain
|
427
|
|
- this.form.abnormalWater = this.data.data.grainAbnormalDescribe.abnormalWater
|
428
|
|
- // console.log(this.form,'this.form............')
|
429
|
|
- /* 遍历this.describe的key跟初始化时的每一项的fieldValue匹配,
|
430
|
|
- 匹配成功则把时间跟choose赋值给数据源tbdata */
|
|
519
|
+ if (res.code == 200) {
|
|
520
|
+ // console.log(res, "获取修改数据")
|
|
521
|
+ /* res.data.forEach(item =>{
|
|
522
|
+ delete item.parentId
|
|
523
|
+ }) */
|
|
524
|
+ // this.data5.grainConditionRecordChildren = JSON.parse(JSON.stringify(res.data))
|
431
|
525
|
|
432
|
|
- for (const key in this.describe) {
|
|
526
|
+ this.data5.grainConditionRecordChildren = res.data
|
433
|
527
|
for (let i = 0; i < this.tbdata.length; i++) {
|
434
|
|
- if (key == this.tbdata[i].fieldValue) {
|
435
|
|
- this.tbdata[i].createTime = this.describe[key].time
|
436
|
|
- this.tbdata[i].whether.radio = this.describe[key].choose
|
|
528
|
+ for (let j = 0; j < res.data.length; j++) {
|
|
529
|
+ if (this.tbdata[i].enumId == res.data[j].enumId) {
|
|
530
|
+ if (
|
|
531
|
+ this.tbdata[i].enumId == 189 ||
|
|
532
|
+ this.tbdata[i].enumId == 190 ||
|
|
533
|
+ this.tbdata[i].enumId == 191
|
|
534
|
+ ) {
|
|
535
|
+ // console.log(this.tbdata[i].enumName)
|
|
536
|
+ this.tbdata[i].createDate =
|
|
537
|
+ res.data[j].operationTime
|
|
538
|
+ this.tbdata[i].enumOrder = String(
|
|
539
|
+ res.data[j].anomalousStatus
|
|
540
|
+ )
|
|
541
|
+ //如果有异常项,就把异常项的值赋值给form数据源
|
|
542
|
+ if (res.data[j].anomalousStatus == 1) {
|
|
543
|
+ this.form = JSON.parse(res.data[j].errorDescribed)
|
|
544
|
+ // console.log(this.form, "this.form")
|
|
545
|
+ // console.log(
|
|
546
|
+ // res.data[j].errorDescribed,
|
|
547
|
+ // "res.data[j].errorDescribed"
|
|
548
|
+ // )
|
|
549
|
+ }
|
|
550
|
+
|
|
551
|
+ // this.data5.grainConditionRecordChildren.push(res.data[i])
|
|
552
|
+ } else {
|
|
553
|
+ this.tbdata[i].createDate =
|
|
554
|
+ res.data[j].operationTime
|
|
555
|
+ // this.tbdata[i].enumOrder = res.data[j].anomalousStatus
|
|
556
|
+ this.tbdata[i].enumOrder = String(
|
|
557
|
+ res.data[j].anomalousStatus
|
|
558
|
+ )
|
|
559
|
+ // this.data5.grainConditionRecordChildren.push(res.data[i])
|
|
560
|
+ }
|
|
561
|
+ }
|
437
|
562
|
}
|
438
|
563
|
}
|
439
|
|
- // if(key ==this.)
|
|
564
|
+ // console.log(
|
|
565
|
+ // this.data5.grainConditionRecordChildren,
|
|
566
|
+ // "this.data5.grainConditionRecordChildren"
|
|
567
|
+ // )
|
440
|
568
|
}
|
441
|
569
|
})
|
442
|
570
|
.catch(err => {
|
443
|
|
- console.log(err)
|
|
571
|
+ console.log(err, "获取查看数据失败信息")
|
444
|
572
|
})
|
445
|
573
|
}
|
446
|
574
|
})
|
447
|
575
|
.catch(err => {
|
448
|
576
|
console.log(err)
|
449
|
577
|
})
|
|
578
|
+ // this.isDetail = true
|
450
|
579
|
}
|
451
|
580
|
},
|
452
|
581
|
|
|
@@ -466,87 +595,167 @@ export default {
|
466
|
595
|
handleCurrentChange() {},
|
467
|
596
|
// 通过判断单选按钮的选择,弹出异常表单
|
468
|
597
|
showClick(index, val) {
|
469
|
|
- console.log(this.tbdata,'this.tbdata')
|
470
|
|
- console.log(index,'-index',val,'--val....')
|
|
598
|
+ this.isExist = false
|
|
599
|
+ // console.log(this.tbdata, "this.tbdata000...")
|
|
600
|
+ // var arr = this.tbdata
|
|
601
|
+ // console.log(index, "-index", val, "--val....")
|
|
602
|
+ // console.log(
|
|
603
|
+ // this.data5.grainConditionRecordChildren,
|
|
604
|
+ // "this.data5.grainConditionRecordChildren"
|
|
605
|
+ // )
|
471
|
606
|
let time = getDateTimeNow()
|
472
|
|
- this.tbdata[index].createTime = time
|
473
|
|
- // 动态的把当前检查项作为对象名称保存到checkDescribe
|
474
|
|
- this.data3.checkDescribe[this.tbdata[index].fieldValue] = {
|
475
|
|
- choose: this.tbdata[index].whether.radio,
|
476
|
|
- time: this.tbdata[index].createTime
|
477
|
|
- }
|
478
|
|
- if (
|
479
|
|
- this.tbdata[6].fieldValue == "pest_abnormal" && this.tbdata[6].whether.radio == 1 ||
|
480
|
|
- this.tbdata[7].fieldValue == "water_abnormal" && this.tbdata[7].whether.radio == 1 ||
|
481
|
|
- this.tbdata[8].fieldValue == "grain_abnormal" && this.tbdata[8].whether.radio == 1
|
482
|
|
- ) {
|
483
|
|
- this.data3.anomalousStatus = 1
|
484
|
|
- console.log(this.data3.anomalousStatus,'异常触发')
|
485
|
|
- }else if(
|
486
|
|
- (this.tbdata[6].fieldValue == "pest_abnormal" && this.tbdata[6].whether.radio == 0) &&
|
487
|
|
- (this.tbdata[7].fieldValue == "water_abnormal" && this.tbdata[7].whether.radio == 0) &&
|
488
|
|
- (this.tbdata[8].fieldValue == "grain_abnormal" && this.tbdata[8].whether.radio == 0)
|
489
|
|
- ){
|
490
|
|
- this.data3.anomalousStatus = 0
|
491
|
|
- console.log(this.data3.anomalousStatus,'this.data3.anomalousStatus')
|
|
607
|
+ // 重构--时间字段名称改变
|
|
608
|
+ this.tbdata[index].createDate = time
|
|
609
|
+ // 动态的把当前检查项作为对象名称保存到grainConditionRecordChildren
|
|
610
|
+ // this.data5.grainConditionRecordChildren
|
492
|
611
|
|
|
612
|
+ // 判断当前数组长度是否为0,若为0 则直接新增数据,否则进行遍历看当前是否存在
|
|
613
|
+ // console.log(this.data5.grainConditionRecordChildren.length, "length...")
|
|
614
|
+ if (this.data5.grainConditionRecordChildren.length == 0) {
|
|
615
|
+ // console.log("此时数组为空,可以直接新增")
|
|
616
|
+ this.data5.grainConditionRecordChildren.push({
|
|
617
|
+ anomalousStatus: Number(val.enumOrder), //是否异常_选项(0:否,1:是)
|
|
618
|
+ enumId: val.enumId,
|
|
619
|
+ id: val.id,
|
|
620
|
+ operationTime: val.createDate
|
|
621
|
+ })
|
|
622
|
+ } else {
|
|
623
|
+ // 数组不为空时遍历数组,判断数组中是否已存在该项数据
|
|
624
|
+ // console.log("判断数据是否已存在")
|
|
625
|
+ for (const i in this.data5.grainConditionRecordChildren) {
|
|
626
|
+ // console.log(i, "i")
|
|
627
|
+ if (this.data5.grainConditionRecordChildren[i].enumId == val.enumId) {
|
|
628
|
+ // 数组中存在该项数据,则更新该数据
|
|
629
|
+ this.data5.grainConditionRecordChildren[i].anomalousStatus = Number(
|
|
630
|
+ val.enumOrder
|
|
631
|
+ )
|
|
632
|
+ this.data5.grainConditionRecordChildren[i].operationTime =
|
|
633
|
+ val.createDate
|
|
634
|
+ // this.data5.grainConditionRecordChildren[i].anomalousStatus = Number(val.enumOrder)
|
|
635
|
+ this.isExist = true
|
|
636
|
+ // console.log(this.isExist, "this.isExist")
|
|
637
|
+ break
|
|
638
|
+ }
|
493
|
639
|
}
|
|
640
|
+ /* console.log(this.isExist, "isexist")
|
|
641
|
+ if (!this.isExist) {
|
|
642
|
+ console.log("数组中无此元素,可以新增")
|
|
643
|
+ this.data5.grainConditionRecordChildren.push({
|
|
644
|
+ anomalousStatus: Number(val.enumOrder), //是否异常_选项(0:否,1:是)
|
|
645
|
+ enumId: val.enumId,
|
|
646
|
+ id: val.id,
|
|
647
|
+ operationTime: val.createDate
|
|
648
|
+ })
|
|
649
|
+ } */
|
|
650
|
+ }
|
494
|
651
|
|
495
|
|
- // console.log(this.data3.checkDescribe,'this.data3.checkDescribe....')
|
496
|
|
- let len = Object.getOwnPropertyNames(this.data3.checkDescribe).length - 1
|
|
652
|
+ // console.log(
|
|
653
|
+ // this.data5.grainConditionRecordChildren,
|
|
654
|
+ // "this.data5.grainConditionRecordChildren....."
|
|
655
|
+ // )
|
|
656
|
+ // console.log(this.data5,'this.data5------')
|
|
657
|
+ // enumId: 189(虫害异常)、190(水分检测异常)、191(异常粮情)
|
|
658
|
+ var count = 0
|
|
659
|
+ this.data5.grainConditionRecordChildren.forEach(item => {
|
|
660
|
+ if (item.anomalousStatus != undefined) {
|
|
661
|
+ count += 1
|
|
662
|
+ // console.log(count,'count')
|
|
663
|
+ }
|
|
664
|
+ })
|
|
665
|
+ // let len = this.data5.grainConditionRecordChildren.length
|
497
|
666
|
// console.log(len,'len............')
|
498
|
|
- //判断map对象的长度,改变暂存按钮的状态
|
499
|
|
- if (len < 14) {
|
|
667
|
+ //判断数组的长度,改变暂存按钮的状态
|
|
668
|
+ if (count < 14) {
|
500
|
669
|
this.flag = false
|
501
|
|
- this.data3.recordStatus = 0
|
|
670
|
+ this.data5.grainConditionRecord.recordStatus = 0
|
|
671
|
+ // this.data3.recordStatus = 0
|
502
|
672
|
} else {
|
503
|
673
|
this.flag = true
|
504
|
|
- this.data3.recordStatus = 1
|
|
674
|
+ this.data5.grainConditionRecord.recordStatus = 1
|
|
675
|
+ // this.data3.recordStatus = 1
|
505
|
676
|
}
|
506
|
677
|
// console.log(val.whether.radio)
|
507
|
678
|
// 通过判断radio值是否为1,控制异常项弹出框 (单选框1:是 0:否)
|
508
|
|
- if (val.whether.radio == 1) {
|
509
|
|
- if (val.fieldValue == "pest_abnormal") {
|
510
|
|
- this.dialogFormVisible = true
|
511
|
|
- }
|
512
|
|
- if (val.fieldValue == "water_abnormal") {
|
513
|
|
- this.dialogFormVisible1 = true
|
514
|
|
- }
|
515
|
|
- if (val.fieldValue == "grain_abnormal") {
|
516
|
|
- // console.log("进了粮情异常表单")
|
517
|
|
- this.dialogFormVisible2 = true
|
518
|
|
- }
|
519
|
|
-
|
|
679
|
+ if (val.enumId == 189 && val.enumOrder == 1) {
|
|
680
|
+ // console.log('触发虫害异常')
|
|
681
|
+ this.dialogFormVisible = true
|
|
682
|
+ }
|
|
683
|
+ if (val.enumId == 190 && val.enumOrder == 1) {
|
|
684
|
+ // console.log('触发水分异常')
|
|
685
|
+ this.dialogFormVisible1 = true
|
|
686
|
+ }
|
|
687
|
+ if (val.enumId == 191 && val.enumOrder == 1) {
|
|
688
|
+ // console.log('触发粮情异常')
|
|
689
|
+ this.dialogFormVisible2 = true
|
520
|
690
|
}
|
|
691
|
+
|
521
|
692
|
//判断异常项是否被选中是,选中则改变异常状态
|
522
|
693
|
},
|
523
|
694
|
// 暂存或者保存
|
524
|
695
|
saveInfo() {
|
525
|
|
- this.data3.grainAbnormalDescribe = this.form
|
526
|
|
- this.data3.checkTime = getDateTimeNow()
|
|
696
|
+ // this.data3.grainAbnormalDescribe = this.form
|
|
697
|
+ // this.data3.checkTime = getDateTimeNow()
|
|
698
|
+ this.data5.grainConditionRecord.operationTime = getDateTimeNow()
|
|
699
|
+ /* this.data5.grainConditionRecord.depotId = this.depot_id
|
|
700
|
+ this.data5.grainConditionRecord.houseId = this.house_id */
|
527
|
701
|
// console.log(this.data3.checkTime,'this.data3.checkTime')
|
528
|
702
|
this.loading = true
|
529
|
703
|
if (this.type == "2") {
|
530
|
|
- this.data3.depotId = this.depot_id
|
531
|
|
- this.data3.houseId = this.house_id
|
532
|
|
- console.log(this.house_id, "house_id")
|
533
|
|
- console.log(this.data3.houseId, "this.data3.houseId...")
|
534
|
|
- this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
|
|
704
|
+ this.data5.grainConditionRecord.depotId = this.depot_id
|
|
705
|
+ this.data5.grainConditionRecord.houseId = this.house_id
|
|
706
|
+ // console.log(this.house_id, "house_id")
|
|
707
|
+ // console.log(this.data3.houseId, "this.data3.houseId...")
|
|
708
|
+ // this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
|
|
709
|
+ // 如果有异常项,则分别给异常项赋值对应的字典表id
|
|
710
|
+ this.data5.grainConditionRecordChildren.forEach(ele => {
|
|
711
|
+ if (ele.enumId == 189 && ele.anomalousStatus == 1) {
|
|
712
|
+ this.data5.grainConditionRecord.insectPestError = ele.enumId
|
|
713
|
+ } else if (ele.enumId == 190 && ele.anomalousStatus == 1) {
|
|
714
|
+ this.data5.grainConditionRecord.wetCheckError = ele.enumId
|
|
715
|
+ } else if (ele.enumId == 191 && ele.anomalousStatus == 1) {
|
|
716
|
+ this.data5.grainConditionRecord.grainError = ele.enumId
|
|
717
|
+ }
|
|
718
|
+ // 判断异常项是否被选中 '是'
|
|
719
|
+ if (
|
|
720
|
+ (ele.enumId == 189 && ele.anomalousStatus == 1) ||
|
|
721
|
+ (ele.enumId == 190 && ele.anomalousStatus == 1) ||
|
|
722
|
+ (ele.enumId == 191 && ele.anomalousStatus == 1)
|
|
723
|
+ ) {
|
|
724
|
+ ele.errorDescribed = JSON.stringify(this.form)
|
|
725
|
+ // console.log(ele,'ele.............')
|
|
726
|
+ if (
|
|
727
|
+ this.data5.grainConditionRecord.anomalousStatus == 0 ||
|
|
728
|
+ this.data5.grainConditionRecord.anomalousStatus == null
|
|
729
|
+ ) {
|
|
730
|
+ this.data5.grainConditionRecord.anomalousStatus = 1
|
|
731
|
+ // console.log(
|
|
732
|
+ // this.data5.grainConditionRecord.anomalousStatus,
|
|
733
|
+ // "触发异常"
|
|
734
|
+ // )
|
|
735
|
+ }
|
|
736
|
+ } /* else if(this.data5.grainConditionRecord.anomalousStatus == 1){
|
|
737
|
+ this.data5.grainConditionRecord.anomalousStatus = 0
|
|
738
|
+ console.log(this.data5.grainConditionRecord.anomalousStatus,'异常解除')
|
|
739
|
+ } */
|
|
740
|
+ })
|
|
741
|
+ console.log(JSON.parse(JSON.stringify(this.data5)), "this.data5----")
|
535
|
742
|
|
536
|
|
- addInfo(this.data3)
|
|
743
|
+ addInfo(JSON.parse(JSON.stringify(this.data5)))
|
537
|
744
|
.then(res => {
|
538
|
|
- console.log(this.data3, "this.data3")
|
539
|
|
- console.log(res,'res222111...')
|
540
|
|
- console.log('新增成功........')
|
|
745
|
+ // console.log(this.data3, "this.data3")
|
|
746
|
+ // console.log(res, "res222111...")
|
|
747
|
+
|
|
748
|
+ if (res.code == 200) {
|
|
749
|
+ // console.log(res,'res=200')
|
|
750
|
+ // console.log("新增成功........")
|
541
|
751
|
this.loading = false
|
542
|
752
|
this.$message({
|
543
|
|
- message: "新增成功!",
|
544
|
|
- type: "success"
|
545
|
|
- })
|
546
|
|
- this.$router.push({
|
547
|
|
- path: "/reservesManagement/grainCheck/newGrain"
|
548
|
|
- })
|
549
|
|
- if (res.code == 200) {
|
|
753
|
+ message: "新增成功!",
|
|
754
|
+ type: "success"
|
|
755
|
+ })
|
|
756
|
+ this.$router.push({
|
|
757
|
+ path: "/reservesManagement/grainCheck/newGrain"
|
|
758
|
+ })
|
550
|
759
|
|
551
|
760
|
if (!(JSON.stringify(this.data2) == {})) {
|
552
|
761
|
if (
|
|
@@ -557,14 +766,14 @@ export default {
|
557
|
766
|
//当选项全部被选中后调用接口
|
558
|
767
|
let auditState = 4 //4 是已完成
|
559
|
768
|
//判断是否切换仓房,或者仓房发生改变
|
560
|
|
- console.log(this.house_id,this.data2.houseId,'houseId')
|
|
769
|
+ // console.log(this.house_id, this.data2.houseId, "houseId")
|
561
|
770
|
if (this.house_id == this.data2.houseId) {
|
562
|
771
|
haveDone(this.data2.id, auditState)
|
563
|
772
|
.then(res => {
|
564
|
773
|
console.log(res, "res.......")
|
565
|
774
|
})
|
566
|
775
|
.catch(err => {
|
567
|
|
- console.log(err)
|
|
776
|
+ console.log(err, "654213")
|
568
|
777
|
})
|
569
|
778
|
} else {
|
570
|
779
|
let userId = this.uid
|
|
@@ -589,18 +798,54 @@ export default {
|
589
|
798
|
}
|
590
|
799
|
}
|
591
|
800
|
}
|
592
|
|
-
|
593
|
801
|
}
|
594
|
|
-
|
595
|
802
|
})
|
596
|
803
|
.catch(err => {
|
597
|
804
|
this.loading = false
|
598
|
|
- console.log(err, "获取不到仓房houseId")
|
|
805
|
+ console.log(err, "新增错误信息")
|
599
|
806
|
})
|
600
|
807
|
} else if (this.type == "1" || this.type == "3") {
|
601
|
|
- this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
|
602
|
|
- // console.log(this.data3,'xiugai hou 的data3')
|
603
|
|
- editGrainInfo(this.data3)
|
|
808
|
+ // this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
|
|
809
|
+ this.data5.grainConditionRecord.depotId = this.depot_id
|
|
810
|
+ this.data5.grainConditionRecord.houseId = this.house_id
|
|
811
|
+ // console.log(this.house_id, "house_id")
|
|
812
|
+ // console.log(this.data3.houseId, "this.data3.houseId...")
|
|
813
|
+ // this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
|
|
814
|
+ // 如果有异常项,则分别给异常项赋值对应的字典表id
|
|
815
|
+ this.data5.grainConditionRecordChildren.forEach(ele => {
|
|
816
|
+ if (ele.enumId == 189 && ele.anomalousStatus == 1) {
|
|
817
|
+ this.data5.grainConditionRecord.insectPestError = ele.enumId
|
|
818
|
+ } else if (ele.enumId == 190 && ele.anomalousStatus == 1) {
|
|
819
|
+ this.data5.grainConditionRecord.wetCheckError = ele.enumId
|
|
820
|
+ } else if (ele.enumId == 191 && ele.anomalousStatus == 1) {
|
|
821
|
+ this.data5.grainConditionRecord.grainError = ele.enumId
|
|
822
|
+ }
|
|
823
|
+ // 判断异常项是否被选中 '是'
|
|
824
|
+ if (
|
|
825
|
+ (ele.enumId == 189 && ele.anomalousStatus == 1) ||
|
|
826
|
+ (ele.enumId == 190 && ele.anomalousStatus == 1) ||
|
|
827
|
+ (ele.enumId == 191 && ele.anomalousStatus == 1)
|
|
828
|
+ ) {
|
|
829
|
+ ele.errorDescribed = JSON.stringify(this.form)
|
|
830
|
+ // console.log(ele,'ele.............')
|
|
831
|
+ if (
|
|
832
|
+ this.data5.grainConditionRecord.anomalousStatus == 0 ||
|
|
833
|
+ this.data5.grainConditionRecord.anomalousStatus == null
|
|
834
|
+ ) {
|
|
835
|
+ this.data5.grainConditionRecord.anomalousStatus = 1
|
|
836
|
+ // console.log(
|
|
837
|
+ // this.data5.grainConditionRecord.anomalousStatus,
|
|
838
|
+ // "触发异常"
|
|
839
|
+ // )
|
|
840
|
+ }
|
|
841
|
+ } /* else if(this.data5.grainConditionRecord.anomalousStatus == 1){
|
|
842
|
+ this.data5.grainConditionRecord.anomalousStatus = 0
|
|
843
|
+ console.log(this.data5.grainConditionRecord.anomalousStatus,'异常解除')
|
|
844
|
+ } */
|
|
845
|
+ })
|
|
846
|
+ console.log(JSON.parse(JSON.stringify(this.data5)), "this.data5----")
|
|
847
|
+ console.log(this.data5, "xiugai hou 的data5")
|
|
848
|
+ editGrainInfo(this.data5)
|
604
|
849
|
.then(res => {
|
605
|
850
|
this.loading = true
|
606
|
851
|
// console.log(res,'修改后的数据...')
|
|
@@ -622,7 +867,29 @@ export default {
|
622
|
867
|
}
|
623
|
868
|
},
|
624
|
869
|
// 取消按钮
|
625
|
|
- cancel() {
|
|
870
|
+ cancel(a) {
|
|
871
|
+ if (a == "abnormalPest") {
|
|
872
|
+ // 虫害异常
|
|
873
|
+ /* console.log(this.form.pestDensity,'pestDensity')
|
|
874
|
+ console.log(this.form.occurPosition,'occurPosition')
|
|
875
|
+ console.log(this.form.occurArea,'occurArea')
|
|
876
|
+ console.log(this.form.pestType,'pestType') */
|
|
877
|
+
|
|
878
|
+ this.dialogFormVisible = false
|
|
879
|
+ } else if (a == "abnormalWater") {
|
|
880
|
+ // 水分检测异常
|
|
881
|
+ // console.log(this.form.abnormalWater,'abnormalWater')
|
|
882
|
+
|
|
883
|
+ this.dialogFormVisible1 = false
|
|
884
|
+ } else if (a == "abnormalGrain") {
|
|
885
|
+ // 粮情异常
|
|
886
|
+ // console.log(this.form.abnormalGrain,'abnormalGrain')
|
|
887
|
+
|
|
888
|
+ this.dialogFormVisible2 = false
|
|
889
|
+ }
|
|
890
|
+ },
|
|
891
|
+ // 返回按钮
|
|
892
|
+ back() {
|
626
|
893
|
// 判断一下是从最新粮情进的新增还是从全部粮情的查看修改进来的
|
627
|
894
|
if (this.type == "2") {
|
628
|
895
|
this.$router.push({
|