|
@@ -62,16 +62,6 @@
|
62
|
62
|
</el-link>
|
63
|
63
|
</el-radio-group>
|
64
|
64
|
</template>
|
65
|
|
- <!-- <template slot-scope="scope">
|
66
|
|
- <el-radio-group
|
67
|
|
- v-model="scope.row.enumOrder"
|
68
|
|
- @change.native="showClick(scope.$index, scope.row)"
|
69
|
|
- :disabled="isDetail"
|
70
|
|
- >
|
71
|
|
- <el-radio :label="1">是</el-radio>
|
72
|
|
- <el-radio :label="0">否</el-radio>
|
73
|
|
- </el-radio-group>
|
74
|
|
- </template> -->
|
75
|
65
|
</el-table-column>
|
76
|
66
|
</el-table>
|
77
|
67
|
</div>
|
|
@@ -132,21 +122,11 @@
|
132
|
122
|
</el-link>
|
133
|
123
|
</el-radio-group>
|
134
|
124
|
</template>
|
135
|
|
- <!-- <template slot-scope="scope">
|
136
|
|
- <el-radio-group
|
137
|
|
- v-model="scope.row.enumOrder"
|
138
|
|
- @change.native="showClick(scope.$index, scope.row)"
|
139
|
|
- :disabled="isDetail"
|
140
|
|
- >
|
141
|
|
- <el-radio :label="1">是</el-radio>
|
142
|
|
- <el-radio :label="0">否</el-radio>
|
143
|
|
- </el-radio-group>
|
144
|
|
- </template> -->
|
145
|
125
|
</el-table-column>
|
146
|
126
|
</el-table>
|
147
|
127
|
</div>
|
148
|
128
|
<div class="btns">
|
149
|
|
- <el-button type="cancel" @click="cancel()"> 返回 </el-button>
|
|
129
|
+ <el-button type="cancel" @click="back()"> 返回 </el-button>
|
150
|
130
|
|
151
|
131
|
<el-button
|
152
|
132
|
type="savebtn"
|
|
@@ -164,10 +144,6 @@
|
164
|
144
|
@click="saveInfo"
|
165
|
145
|
>保存</el-button
|
166
|
146
|
>
|
167
|
|
-
|
168
|
|
- <!-- <div v-if='type="1" || type="3"'>
|
169
|
|
-
|
170
|
|
- </div> -->
|
171
|
147
|
</div>
|
172
|
148
|
|
173
|
149
|
<!-- 新增虫害异常 -->
|
|
@@ -203,7 +179,7 @@
|
203
|
179
|
</el-form-item>
|
204
|
180
|
</el-form>
|
205
|
181
|
<div slot="footer" class="dialog-footer">
|
206
|
|
- <el-button @click="dialogFormVisible = false" type="cancel"
|
|
182
|
+ <el-button @click="cancel('abnormalPest')" type="cancel"
|
207
|
183
|
>取 消</el-button
|
208
|
184
|
>
|
209
|
185
|
<el-button type="savebtn" @click="saveFormData()">确 定</el-button>
|
|
@@ -224,7 +200,7 @@
|
224
|
200
|
></el-input>
|
225
|
201
|
</el-form>
|
226
|
202
|
<div slot="footer" class="dialog-footer">
|
227
|
|
- <el-button @click="dialogFormVisible1 = false" type="cancel"
|
|
203
|
+ <el-button @click="cancel('abnormalWater')" type="cancel"
|
228
|
204
|
>取 消</el-button
|
229
|
205
|
>
|
230
|
206
|
<el-button type="savebtn" @click="dialogFormVisible1 = false"
|
|
@@ -248,7 +224,7 @@
|
248
|
224
|
</el-form-item>
|
249
|
225
|
</el-form>
|
250
|
226
|
<div slot="footer" class="dialog-footer">
|
251
|
|
- <el-button @click="dialogFormVisible2 = false" type="cancel"
|
|
227
|
+ <el-button @click="cancel('abnormalGrain')" type="cancel"
|
252
|
228
|
>取 消</el-button
|
253
|
229
|
>
|
254
|
230
|
<el-button type="savebtn" @click="saveForm">确 定</el-button>
|
|
@@ -375,14 +351,14 @@ export default {
|
375
|
351
|
mounted() {
|
376
|
352
|
// 初始化的时候把参数拼接到要传输的数据里
|
377
|
353
|
let routeParams = this.$route.query
|
378
|
|
- console.log(routeParams, "routeParams")
|
379
|
|
- 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")
|
380
|
356
|
this.userInfo = JSON.parse(localStorage.getItem("userInfo"))
|
381
|
357
|
this.uid = this.userInfo.uid
|
382
|
358
|
|
383
|
|
- if(routeParams.type ==3){
|
384
|
|
- this.data5.grainConditionRecord = routeParams.data
|
385
|
|
- }
|
|
359
|
+ if (routeParams.type == 3) {
|
|
360
|
+ this.data5.grainConditionRecord = routeParams.data
|
|
361
|
+ }
|
386
|
362
|
|
387
|
363
|
this.data5.grainConditionRecord.checkPerson = this.userInfo.uid
|
388
|
364
|
this.data5.grainConditionRecord.enumId = routeParams.data.enumId
|
|
@@ -395,18 +371,14 @@ export default {
|
395
|
371
|
this.id = routeParams.data.id
|
396
|
372
|
// console.log(this.id,'this.id')
|
397
|
373
|
this.type = routeParams.type
|
398
|
|
- console.log(this.type, "this.type....")
|
|
374
|
+ // console.log(this.type, "this.type....")
|
399
|
375
|
// this.checkPerson = routeParams.data.checkPerson
|
400
|
376
|
// this.data = routeParams
|
401
|
377
|
// this.describe = JSON.parse(routeParams.data.checkDescribe)
|
402
|
|
- // this.data3.checkTime = routeParams.data.checkTime
|
403
|
|
- // this.data3.checkPerson = routeParams.data.checkPerson
|
404
|
|
- // this.data3.recordStatus = routeParams.data.recordStatus
|
405
|
|
- // this.data3.anomalousStatus = routeParams.data.anomalousStatus
|
406
|
378
|
|
407
|
379
|
// 获取用户的库id和仓房id
|
408
|
380
|
let userinfo = JSON.parse(localStorage.getItem("userInfo"))
|
409
|
|
- console.log(userinfo, "userinfo............")
|
|
381
|
+ // console.log(userinfo, "userinfo............")
|
410
|
382
|
// this.depot_id = this.$store.state.depotId
|
411
|
383
|
// this.house_id = userinfo.houseId
|
412
|
384
|
// console.log(routeParams.data,'routeParams.data')
|
|
@@ -414,21 +386,18 @@ export default {
|
414
|
386
|
this.show = false
|
415
|
387
|
} else if (this.type == 3) {
|
416
|
388
|
if (Object.getOwnPropertyNames(this.describe).length - 1 == 14) {
|
417
|
|
- console.log(Object.getOwnPropertyNames(this.describe).length, "0.0.0.")
|
|
389
|
+ // console.log(Object.getOwnPropertyNames(this.describe).length, "0.0.0.")
|
418
|
390
|
this.flag = true
|
419
|
391
|
}
|
420
|
392
|
}
|
421
|
|
- /* if(this.type !==2 && Object.getOwnPropertyNames(this.describe).length-1 ==14){
|
422
|
|
- // console.log('this.flag')
|
423
|
|
- this.flag = true
|
424
|
|
- } */
|
|
393
|
+
|
425
|
394
|
// 新增初始化数据
|
426
|
395
|
this.getinfo()
|
427
|
396
|
},
|
428
|
397
|
|
429
|
398
|
methods: {
|
430
|
399
|
showHandler(val) {
|
431
|
|
- // console.log(val,'val...')
|
|
400
|
+ // console.log(val, "val...")
|
432
|
401
|
if (val.enumId == 189) {
|
433
|
402
|
this.dialogFormVisible = true
|
434
|
403
|
} else if (val.enumId == 190) {
|
|
@@ -441,15 +410,32 @@ export default {
|
441
|
410
|
// 目前只有一页,在前端写死了请求参数
|
442
|
411
|
// 在内部判断是新增修改还是查看
|
443
|
412
|
|
444
|
|
- console.log(this.type, "type...")
|
|
413
|
+ // console.log(this.type, "type...")
|
445
|
414
|
if (this.type == 2) {
|
446
|
|
- console.log("新增页面初始化")
|
|
415
|
+ // console.log("新增页面初始化")
|
447
|
416
|
getGrainItems(19)
|
448
|
417
|
.then(res => {
|
449
|
418
|
if (res.code == 200) {
|
450
|
|
- console.log(res, "res字典19")
|
|
419
|
+ // console.log(res, "res字典19")
|
451
|
420
|
this.tbdata = res.data
|
452
|
|
- console.log(this.tbdata, "tbdata.......")
|
|
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
|
+ // )
|
453
|
439
|
}
|
454
|
440
|
})
|
455
|
441
|
.catch(err => {
|
|
@@ -462,111 +448,134 @@ export default {
|
462
|
448
|
.then(res => {
|
463
|
449
|
if (res.code == 200) {
|
464
|
450
|
this.tbdata = res.data
|
465
|
|
- console.log(this.tbdata, "tbdata.......")
|
466
|
|
- }
|
467
|
|
- })
|
468
|
|
- .catch(err => {
|
469
|
|
- console.log(err)
|
470
|
|
- })
|
471
|
|
- this.isDetail = true
|
472
|
|
- //获取查看数据
|
473
|
|
- checkGrainInfo(this.id)
|
474
|
|
- .then(res => {
|
475
|
|
- if (res.code == 200) {
|
476
|
|
- console.log(res, "获取查看数据")
|
477
|
|
- for (let i = 0; i < this.tbdata.length; i++) {
|
478
|
|
- for (let j = 0; j < res.data.length; j++) {
|
479
|
|
- if (this.tbdata[i].enumId == res.data[j].enumId) {
|
480
|
|
- // console.log(this.tbdata.indexOf(this.tbdata[i]),"this.tbdata[i]的index" )
|
481
|
|
- // console.log( res.data.indexOf(res.data[j]),"res.data.indexOf(res.data[j])")
|
482
|
|
- // var itemIndex = this.tbdata.indexOf(this.tbdata[i])
|
483
|
|
- if (
|
484
|
|
- this.tbdata[i].enumId == 189 ||
|
485
|
|
- this.tbdata[i].enumId == 190 ||
|
486
|
|
- this.tbdata[i].enumId == 191
|
487
|
|
- ) {
|
488
|
|
- // console.log(this.tbdata[i].enumName)
|
489
|
|
- this.tbdata[i].createDate = res.data[j].operationTime
|
490
|
|
- this.tbdata[i].enumOrder = String(
|
491
|
|
- res.data[j].anomalousStatus
|
492
|
|
- )
|
493
|
|
- //如果有异常项,就把异常项的值赋值给form数据源
|
494
|
|
- this.form = JSON.parse(res.data[j].errorDescribed)
|
495
|
|
- } else {
|
496
|
|
- this.tbdata[i].createDate = res.data[j].operationTime
|
497
|
|
- this.tbdata[i].enumOrder = String(
|
498
|
|
- res.data[j].anomalousStatus
|
499
|
|
- )
|
|
451
|
+ // this.data5.grainConditionRecordChildren = JSON.parse(JSON.stringify(res.data))
|
|
452
|
+ // console.log(this.tbdata, "tbdata.......")
|
|
453
|
+ //获取查看数据
|
|
454
|
+ checkGrainInfo(this.id)
|
|
455
|
+ .then(res => {
|
|
456
|
+ if (res.code == 200) {
|
|
457
|
+ // console.log(res, "获取查看数据")
|
|
458
|
+
|
|
459
|
+ for (let i = 0; i < this.tbdata.length; i++) {
|
|
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
|
+ }
|
|
494
|
+ }
|
500
|
495
|
}
|
501
|
496
|
}
|
502
|
|
- }
|
503
|
|
- }
|
|
497
|
+ })
|
|
498
|
+ .catch(err => {
|
|
499
|
+ console.log(err, "获取查看数据失败信息")
|
|
500
|
+ })
|
504
|
501
|
}
|
505
|
502
|
})
|
506
|
503
|
.catch(err => {
|
507
|
|
- console.log(err, "获取查看数据失败信息")
|
|
504
|
+ console.log(err)
|
508
|
505
|
})
|
|
506
|
+ this.isDetail = true
|
509
|
507
|
} else if (this.type == "3") {
|
510
|
508
|
//修改
|
511
|
509
|
// 检查项初始化
|
512
|
510
|
getGrainItems(19)
|
513
|
511
|
.then(res => {
|
514
|
512
|
if (res.code == 200) {
|
|
513
|
+ // console.log(res, "res修改数据")
|
515
|
514
|
this.tbdata = res.data
|
516
|
|
- console.log(this.tbdata, "tbdata.......")
|
517
|
|
- }
|
518
|
|
- })
|
519
|
|
- .catch(err => {
|
520
|
|
- console.log(err)
|
521
|
|
- })
|
522
|
|
- // this.isDetail = true
|
523
|
|
- //获取查看数据
|
524
|
|
- checkGrainInfo(this.id)
|
525
|
|
- .then(res => {
|
526
|
|
- if (res.code == 200) {
|
527
|
|
- console.log(res, "获取修改数据")
|
528
|
|
- /* res.data.forEach(item =>{
|
|
515
|
+ // console.log(this.tbdata, "tbdata.......")
|
|
516
|
+ //获取数据
|
|
517
|
+ checkGrainInfo(this.id)
|
|
518
|
+ .then(res => {
|
|
519
|
+ if (res.code == 200) {
|
|
520
|
+ // console.log(res, "获取修改数据")
|
|
521
|
+ /* res.data.forEach(item =>{
|
529
|
522
|
delete item.parentId
|
530
|
523
|
}) */
|
531
|
|
- this.data5.grainConditionRecordChildren = res.data
|
532
|
|
- for (let i = 0; i < this.tbdata.length; i++) {
|
533
|
|
- for (let j = 0; j < res.data.length; j++) {
|
534
|
|
- if (this.tbdata[i].enumId == res.data[j].enumId) {
|
535
|
|
- if (
|
536
|
|
- this.tbdata[i].enumId == 189 ||
|
537
|
|
- this.tbdata[i].enumId == 190 ||
|
538
|
|
- this.tbdata[i].enumId == 191
|
539
|
|
- ) {
|
540
|
|
- // console.log(this.tbdata[i].enumName)
|
541
|
|
- this.tbdata[i].createDate = res.data[j].operationTime
|
542
|
|
- this.tbdata[i].enumOrder = String(
|
543
|
|
- res.data[j].anomalousStatus
|
544
|
|
- )
|
545
|
|
- //如果有异常项,就把异常项的值赋值给form数据源
|
546
|
|
- this.form = JSON.parse(res.data[j].errorDescribed)
|
547
|
|
- console.log(this.form,'this.form')
|
548
|
|
- // this.data5.grainConditionRecordChildren.push(res.data[i])
|
549
|
|
- } else {
|
550
|
|
- this.tbdata[i].createDate = res.data[j].operationTime
|
551
|
|
- // this.tbdata[i].enumOrder = res.data[j].anomalousStatus
|
552
|
|
- this.tbdata[i].enumOrder = String(
|
553
|
|
- res.data[j].anomalousStatus
|
554
|
|
- )
|
555
|
|
- // this.data5.grainConditionRecordChildren.push(res.data[i])
|
|
524
|
+ // this.data5.grainConditionRecordChildren = JSON.parse(JSON.stringify(res.data))
|
|
525
|
+
|
|
526
|
+ this.data5.grainConditionRecordChildren = res.data
|
|
527
|
+ for (let i = 0; i < this.tbdata.length; i++) {
|
|
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
|
+ }
|
|
562
|
+ }
|
556
|
563
|
}
|
|
564
|
+ // console.log(
|
|
565
|
+ // this.data5.grainConditionRecordChildren,
|
|
566
|
+ // "this.data5.grainConditionRecordChildren"
|
|
567
|
+ // )
|
557
|
568
|
}
|
558
|
|
- }
|
559
|
|
- }
|
560
|
|
- console.log(
|
561
|
|
- this.data5.grainConditionRecordChildren,
|
562
|
|
- "this.data5.grainConditionRecordChildren"
|
563
|
|
- )
|
|
569
|
+ })
|
|
570
|
+ .catch(err => {
|
|
571
|
+ console.log(err, "获取查看数据失败信息")
|
|
572
|
+ })
|
564
|
573
|
}
|
565
|
574
|
})
|
566
|
575
|
.catch(err => {
|
567
|
|
- console.log(err, "获取查看数据失败信息")
|
|
576
|
+ console.log(err)
|
568
|
577
|
})
|
569
|
|
-
|
|
578
|
+ // this.isDetail = true
|
570
|
579
|
}
|
571
|
580
|
},
|
572
|
581
|
|
|
@@ -587,12 +596,13 @@ export default {
|
587
|
596
|
// 通过判断单选按钮的选择,弹出异常表单
|
588
|
597
|
showClick(index, val) {
|
589
|
598
|
this.isExist = false
|
590
|
|
- console.log(this.tbdata, "this.tbdata")
|
591
|
|
- console.log(index, "-index", val, "--val....")
|
592
|
|
- console.log(
|
593
|
|
- this.data5.grainConditionRecordChildren,
|
594
|
|
- "this.data5.grainConditionRecordChildren"
|
595
|
|
- )
|
|
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
|
+ // )
|
596
|
606
|
let time = getDateTimeNow()
|
597
|
607
|
// 重构--时间字段名称改变
|
598
|
608
|
this.tbdata[index].createDate = time
|
|
@@ -600,55 +610,62 @@ export default {
|
600
|
610
|
// this.data5.grainConditionRecordChildren
|
601
|
611
|
|
602
|
612
|
// 判断当前数组长度是否为0,若为0 则直接新增数据,否则进行遍历看当前是否存在
|
603
|
|
- console.log(this.data5.grainConditionRecordChildren.length,'length...')
|
|
613
|
+ // console.log(this.data5.grainConditionRecordChildren.length, "length...")
|
604
|
614
|
if (this.data5.grainConditionRecordChildren.length == 0) {
|
605
|
|
- console.log("此时数组为空,可以直接新增")
|
|
615
|
+ // console.log("此时数组为空,可以直接新增")
|
606
|
616
|
this.data5.grainConditionRecordChildren.push({
|
607
|
|
- anomalousStatus : Number(val.enumOrder), //是否异常_选项(0:否,1:是)
|
608
|
|
- enumId : val.enumId,
|
609
|
|
- id : null,
|
610
|
|
- operationTime : val.createDate
|
|
617
|
+ anomalousStatus: Number(val.enumOrder), //是否异常_选项(0:否,1:是)
|
|
618
|
+ enumId: val.enumId,
|
|
619
|
+ id: val.id,
|
|
620
|
+ operationTime: val.createDate
|
611
|
621
|
})
|
612
|
622
|
} else {
|
613
|
|
- // 数组部位空时遍历数组,判断数组中是否已存在该项数据
|
614
|
|
- console.log('判断数据是否已存在')
|
615
|
|
- for(const i in this.data5.grainConditionRecordChildren){
|
616
|
|
- console.log(i,'i')
|
617
|
|
- if(this.data5.grainConditionRecordChildren[i].enumId ==val.enumId){
|
|
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) {
|
618
|
628
|
// 数组中存在该项数据,则更新该数据
|
619
|
|
- this.data5.grainConditionRecordChildren[i].anomalousStatus = Number(val.enumOrder)
|
620
|
|
- this.data5.grainConditionRecordChildren[i].operationTime = val.createDate
|
|
629
|
+ this.data5.grainConditionRecordChildren[i].anomalousStatus = Number(
|
|
630
|
+ val.enumOrder
|
|
631
|
+ )
|
|
632
|
+ this.data5.grainConditionRecordChildren[i].operationTime =
|
|
633
|
+ val.createDate
|
621
|
634
|
// this.data5.grainConditionRecordChildren[i].anomalousStatus = Number(val.enumOrder)
|
622
|
635
|
this.isExist = true
|
623
|
|
- console.log(this.isExist,'this.isExist')
|
|
636
|
+ // console.log(this.isExist, "this.isExist")
|
624
|
637
|
break
|
625
|
638
|
}
|
626
|
639
|
}
|
627
|
|
- console.log(this.isExist,'isexist')
|
628
|
|
- if(!this.isExist){
|
629
|
|
- console.log('数组中无此元素,可以新增')
|
|
640
|
+ /* console.log(this.isExist, "isexist")
|
|
641
|
+ if (!this.isExist) {
|
|
642
|
+ console.log("数组中无此元素,可以新增")
|
630
|
643
|
this.data5.grainConditionRecordChildren.push({
|
631
|
|
- anomalousStatus : Number(val.enumOrder), //是否异常_选项(0:否,1:是)
|
632
|
|
- enumId : val.enumId,
|
633
|
|
- id : null,
|
634
|
|
- operationTime : val.createDate
|
635
|
|
- })
|
636
|
|
- }
|
637
|
|
- }
|
638
|
|
-
|
|
644
|
+ anomalousStatus: Number(val.enumOrder), //是否异常_选项(0:否,1:是)
|
|
645
|
+ enumId: val.enumId,
|
|
646
|
+ id: val.id,
|
|
647
|
+ operationTime: val.createDate
|
|
648
|
+ })
|
|
649
|
+ } */
|
|
650
|
+ }
|
639
|
651
|
|
640
|
|
- console.log(
|
641
|
|
- this.data5.grainConditionRecordChildren,
|
642
|
|
- "this.data5.grainConditionRecordChildren....."
|
643
|
|
- )
|
|
652
|
+ // console.log(
|
|
653
|
+ // this.data5.grainConditionRecordChildren,
|
|
654
|
+ // "this.data5.grainConditionRecordChildren....."
|
|
655
|
+ // )
|
644
|
656
|
// console.log(this.data5,'this.data5------')
|
645
|
657
|
// enumId: 189(虫害异常)、190(水分检测异常)、191(异常粮情)
|
646
|
|
-
|
647
|
|
- // console.log(this.data5.grainConditionRecordChildren.length,'length====')
|
648
|
|
- let len = this.data5.grainConditionRecordChildren.length
|
|
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
|
649
|
666
|
// console.log(len,'len............')
|
650
|
667
|
//判断数组的长度,改变暂存按钮的状态
|
651
|
|
- if (len < 14) {
|
|
668
|
+ if (count < 14) {
|
652
|
669
|
this.flag = false
|
653
|
670
|
this.data5.grainConditionRecord.recordStatus = 0
|
654
|
671
|
// this.data3.recordStatus = 0
|
|
@@ -686,7 +703,7 @@ export default {
|
686
|
703
|
if (this.type == "2") {
|
687
|
704
|
this.data5.grainConditionRecord.depotId = this.depot_id
|
688
|
705
|
this.data5.grainConditionRecord.houseId = this.house_id
|
689
|
|
- console.log(this.house_id, "house_id")
|
|
706
|
+ // console.log(this.house_id, "house_id")
|
690
|
707
|
// console.log(this.data3.houseId, "this.data3.houseId...")
|
691
|
708
|
// this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
|
692
|
709
|
// 如果有异常项,则分别给异常项赋值对应的字典表id
|
|
@@ -711,10 +728,10 @@ export default {
|
711
|
728
|
this.data5.grainConditionRecord.anomalousStatus == null
|
712
|
729
|
) {
|
713
|
730
|
this.data5.grainConditionRecord.anomalousStatus = 1
|
714
|
|
- console.log(
|
715
|
|
- this.data5.grainConditionRecord.anomalousStatus,
|
716
|
|
- "触发异常"
|
717
|
|
- )
|
|
731
|
+ // console.log(
|
|
732
|
+ // this.data5.grainConditionRecord.anomalousStatus,
|
|
733
|
+ // "触发异常"
|
|
734
|
+ // )
|
718
|
735
|
}
|
719
|
736
|
} /* else if(this.data5.grainConditionRecord.anomalousStatus == 1){
|
720
|
737
|
this.data5.grainConditionRecord.anomalousStatus = 0
|
|
@@ -730,7 +747,7 @@ export default {
|
730
|
747
|
|
731
|
748
|
if (res.code == 200) {
|
732
|
749
|
// console.log(res,'res=200')
|
733
|
|
- console.log("新增成功........")
|
|
750
|
+ // console.log("新增成功........")
|
734
|
751
|
this.loading = false
|
735
|
752
|
this.$message({
|
736
|
753
|
message: "新增成功!",
|
|
@@ -749,7 +766,7 @@ export default {
|
749
|
766
|
//当选项全部被选中后调用接口
|
750
|
767
|
let auditState = 4 //4 是已完成
|
751
|
768
|
//判断是否切换仓房,或者仓房发生改变
|
752
|
|
- console.log(this.house_id, this.data2.houseId, "houseId")
|
|
769
|
+ // console.log(this.house_id, this.data2.houseId, "houseId")
|
753
|
770
|
if (this.house_id == this.data2.houseId) {
|
754
|
771
|
haveDone(this.data2.id, auditState)
|
755
|
772
|
.then(res => {
|
|
@@ -788,11 +805,10 @@ export default {
|
788
|
805
|
console.log(err, "新增错误信息")
|
789
|
806
|
})
|
790
|
807
|
} else if (this.type == "1" || this.type == "3") {
|
791
|
|
-
|
792
|
808
|
// this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
|
793
|
809
|
this.data5.grainConditionRecord.depotId = this.depot_id
|
794
|
810
|
this.data5.grainConditionRecord.houseId = this.house_id
|
795
|
|
- console.log(this.house_id, "house_id")
|
|
811
|
+ // console.log(this.house_id, "house_id")
|
796
|
812
|
// console.log(this.data3.houseId, "this.data3.houseId...")
|
797
|
813
|
// this.data3.checkDescribe = JSON.stringify(this.data3.checkDescribe)
|
798
|
814
|
// 如果有异常项,则分别给异常项赋值对应的字典表id
|
|
@@ -817,10 +833,10 @@ export default {
|
817
|
833
|
this.data5.grainConditionRecord.anomalousStatus == null
|
818
|
834
|
) {
|
819
|
835
|
this.data5.grainConditionRecord.anomalousStatus = 1
|
820
|
|
- console.log(
|
821
|
|
- this.data5.grainConditionRecord.anomalousStatus,
|
822
|
|
- "触发异常"
|
823
|
|
- )
|
|
836
|
+ // console.log(
|
|
837
|
+ // this.data5.grainConditionRecord.anomalousStatus,
|
|
838
|
+ // "触发异常"
|
|
839
|
+ // )
|
824
|
840
|
}
|
825
|
841
|
} /* else if(this.data5.grainConditionRecord.anomalousStatus == 1){
|
826
|
842
|
this.data5.grainConditionRecord.anomalousStatus = 0
|
|
@@ -828,7 +844,7 @@ export default {
|
828
|
844
|
} */
|
829
|
845
|
})
|
830
|
846
|
console.log(JSON.parse(JSON.stringify(this.data5)), "this.data5----")
|
831
|
|
- console.log(this.data5,'xiugai hou 的data5')
|
|
847
|
+ console.log(this.data5, "xiugai hou 的data5")
|
832
|
848
|
editGrainInfo(this.data5)
|
833
|
849
|
.then(res => {
|
834
|
850
|
this.loading = true
|
|
@@ -851,7 +867,29 @@ export default {
|
851
|
867
|
}
|
852
|
868
|
},
|
853
|
869
|
// 取消按钮
|
854
|
|
- 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() {
|
855
|
893
|
// 判断一下是从最新粮情进的新增还是从全部粮情的查看修改进来的
|
856
|
894
|
if (this.type == "2") {
|
857
|
895
|
this.$router.push({
|