|
@@ -1,23 +1,6 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="global">
|
3
|
3
|
<div class="mainContainer">
|
4
|
|
- <div class="top">
|
5
|
|
- <el-form :inline="true">
|
6
|
|
- <el-form-item label="设备类别:">{{'粮油输送设备'}}</el-form-item>
|
7
|
|
- <el-form-item label="设备名称:">{{'移动式水平输送机'}}</el-form-item>
|
8
|
|
- <el-form-item label="设备编号:">{{'103007000012'}}</el-form-item>
|
9
|
|
- <el-form-item label="设备状态:">
|
10
|
|
- <el-select v-model="SBstatus" placeholder="请选择">
|
11
|
|
- <el-option
|
12
|
|
- v-for="item in SBstatusList"
|
13
|
|
- :key="item.value"
|
14
|
|
- :label="item.label"
|
15
|
|
- :value="item.value">
|
16
|
|
- </el-option>
|
17
|
|
- </el-select>
|
18
|
|
- </el-form-item>
|
19
|
|
- </el-form>
|
20
|
|
- </div>
|
21
|
4
|
<div class="div_parent">
|
22
|
5
|
<div class="steps">
|
23
|
6
|
<el-steps :active="stepActive" align-center direction="horizontal">
|
|
@@ -47,11 +30,15 @@
|
47
|
30
|
</template>
|
48
|
31
|
</el-table-column>
|
49
|
32
|
</el-table>
|
50
|
|
- <div v-if="tableDataAudit && tableDataAudit.length" style="height: 400px">
|
|
33
|
+ <div v-if="tableDataAudit && tableDataAudit.length" style="height: 400px;margin-top:10px">
|
51
|
34
|
<div class="tf_title">
|
52
|
35
|
<i class="iconfont iconshu"></i>
|
53
|
|
- <span v-if="stepActive == 0 || step == 1">流程(熏蒸计划审批)</span>
|
54
|
|
- <span v-if="stepActive == 3 || step == 4">流程(熏蒸散气申请审批)</span>
|
|
36
|
+ <span v-if="stepActive == 0 || step == 1">流程(设施维修计划审批)</span>
|
|
37
|
+ <span v-if="stepActive == 1 || step == 2">流程(设施维修预算审批)</span>
|
|
38
|
+ </div>
|
|
39
|
+ <div class="tf_title_right">
|
|
40
|
+ <span style="margin-right:10px">提交给总经理和分公司审批</span>
|
|
41
|
+ <el-switch v-model="isAudit" :disabled="disabled" :active-value="activevalue" :inactive-value="inactivevalue" @change="isAuditFn"></el-switch>
|
55
|
42
|
</div>
|
56
|
43
|
<el-steps direction="vertical" :active="processActive">
|
57
|
44
|
<el-step v-for="(item, index) in tableDataAudit" :key="index" icon="el-icon-edit">
|
|
@@ -175,9 +162,10 @@ export default {
|
175
|
162
|
|
176
|
163
|
subList: [],
|
177
|
164
|
tableDataAudit:[],
|
178
|
|
-
|
179
|
|
- SBstatus:'',
|
180
|
|
- SBstatusList:[]
|
|
165
|
+ activevalue:1,
|
|
166
|
+ inactivevalue:0,
|
|
167
|
+ isAudit:1,
|
|
168
|
+ tableDataAuditCopy:[]
|
181
|
169
|
}
|
182
|
170
|
},
|
183
|
171
|
methods: {
|
|
@@ -186,11 +174,11 @@ export default {
|
186
|
174
|
if (this.step != 1) {
|
187
|
175
|
return
|
188
|
176
|
}
|
189
|
|
- if (rowIndex === 1) {
|
190
|
|
- if (columnIndex === 0) {
|
191
|
|
- return [1, 4]
|
192
|
|
- }
|
193
|
|
- }
|
|
177
|
+ // if (rowIndex === 1) {
|
|
178
|
+ // if (columnIndex === 0) {
|
|
179
|
+ // return [1, 4]
|
|
180
|
+ // }
|
|
181
|
+ // }
|
194
|
182
|
},
|
195
|
183
|
|
196
|
184
|
// 用户字典列表
|
|
@@ -205,10 +193,10 @@ export default {
|
205
|
193
|
//获取流程数据
|
206
|
194
|
processList() {
|
207
|
195
|
var type = null;
|
208
|
|
- if(this.stepActive == 0 || this.stepActive == 1 || this.stepActive == 2){
|
209
|
|
- type = "xzjh"
|
210
|
|
- }else if(this.stepActive == 3 || this.stepActive == 4){
|
211
|
|
- type = "xzsq"
|
|
196
|
+ if(this.stepActive == 0){
|
|
197
|
+ type = "sswxjh"
|
|
198
|
+ }else if(this.stepActive == 1){
|
|
199
|
+ type = "sswxys"
|
212
|
200
|
}
|
213
|
201
|
var userId = this.userInfo.uid
|
214
|
202
|
var depotId = this.userInfo.depotId
|
|
@@ -225,7 +213,7 @@ export default {
|
225
|
213
|
this.process[0].content = this.userInfo.uid
|
226
|
214
|
}
|
227
|
215
|
this.tableDataAudit = this.process
|
228
|
|
-
|
|
216
|
+ this.tableDataAuditCopy = JSON.parse(JSON.stringify(this.tableDataAudit))
|
229
|
217
|
//申请人
|
230
|
218
|
this.applyPeople = this.process[0].content
|
231
|
219
|
//审批人
|
|
@@ -237,10 +225,10 @@ export default {
|
237
|
225
|
},
|
238
|
226
|
detailProcessList() {
|
239
|
227
|
var type = null;
|
240
|
|
- if(this.stepActive == 0 || this.stepActive == 1 || this.stepActive == 2){
|
241
|
|
- type = "xzjh"
|
242
|
|
- }else if(this.stepActive == 3 || this.stepActive == 4){
|
243
|
|
- type = "xzsq"
|
|
228
|
+ if(this.stepActive == 0){
|
|
229
|
+ type = "sswxjh"
|
|
230
|
+ }else if(this.stepActive == 1){
|
|
231
|
+ type = "sswxys"
|
244
|
232
|
}
|
245
|
233
|
var userId = this.userInfo.uid
|
246
|
234
|
var depotId = this.userInfo.depotId
|
|
@@ -306,15 +294,13 @@ export default {
|
306
|
294
|
}
|
307
|
295
|
|
308
|
296
|
if (finish) {
|
309
|
|
- if (this.stepActive == 0 || this.stepActive == 3) {
|
|
297
|
+ if (this.stepActive == 0 || this.stepActive == 1) {
|
310
|
298
|
this.button = "保存并提交"
|
311
|
|
- } else if (this.stepActive == 1 || this.stepActive == 2) {
|
312
|
|
- this.button = "保存"
|
313
|
299
|
} else {
|
314
|
300
|
this.button = "完成"
|
315
|
301
|
}
|
316
|
302
|
} else {
|
317
|
|
- if (this.step == 1) {
|
|
303
|
+ if (this.step == 1 || this.step == 2) {
|
318
|
304
|
this.button = "保存并提交"
|
319
|
305
|
} else {
|
320
|
306
|
this.button = "暂存"
|
|
@@ -344,7 +330,12 @@ export default {
|
344
|
330
|
console.log(this.totalData)
|
345
|
331
|
this.tableData = this.totalData[0].list
|
346
|
332
|
console.log(this.tableData)
|
347
|
|
- this.tableDataAudit = this.totalData[0].audit
|
|
333
|
+ this.isAudit = this.totalData[0].step.isAudit
|
|
334
|
+ if(this.isAudit == 1){
|
|
335
|
+ this.tableDataAudit = JSON.parse(JSON.stringify(this.totalData[0].audit))
|
|
336
|
+ }else if(this.isAudit == 0){
|
|
337
|
+ this.tableDataAudit = JSON.parse(JSON.stringify(this.totalData[0].audit)).slice(0,3)
|
|
338
|
+ }
|
348
|
339
|
for (let i = 0; i < this.tableDataAudit.length; i++) {
|
349
|
340
|
var ele = this.tableDataAudit[i]
|
350
|
341
|
if (ele.auditState == 0) {
|
|
@@ -355,14 +346,31 @@ export default {
|
355
|
346
|
}
|
356
|
347
|
this.button = "保存并提交"
|
357
|
348
|
} else if (this.step == 2) {
|
358
|
|
- // this.isShow = true
|
|
349
|
+ console.log(this.totalData)
|
359
|
350
|
this.tableData = this.totalData[1].list
|
360
|
|
- this.tableDataAudit = []
|
361
|
|
- console.log(this.tableData, "第二步")
|
362
|
|
- this.button = "暂存"
|
|
351
|
+ console.log(this.tableData)
|
|
352
|
+ this.isAudit = this.totalData[1].step.isAudit
|
|
353
|
+ if(!this.isAudit && this.isAudit != 0){
|
|
354
|
+ this.isAudit = 1
|
|
355
|
+ }
|
|
356
|
+ if(this.isAudit == 1){
|
|
357
|
+ this.tableDataAudit = JSON.parse(JSON.stringify(this.totalData[1].audit))
|
|
358
|
+ }else if(this.isAudit == 0){
|
|
359
|
+ this.tableDataAudit = JSON.parse(JSON.stringify(this.totalData[1].audit)).slice(0,3)
|
|
360
|
+ }
|
|
361
|
+ for (let i = 0; i < this.tableDataAudit.length; i++) {
|
|
362
|
+ var ele = this.tableDataAudit[i]
|
|
363
|
+ if (ele.auditState == 0) {
|
|
364
|
+ this.processActive = i
|
|
365
|
+ }else{
|
|
366
|
+ this.processActive = this.tableDataAudit.length
|
|
367
|
+ }
|
|
368
|
+ }
|
|
369
|
+ this.button = "保存并提交"
|
363
|
370
|
} else if (this.step == 3) {
|
364
|
371
|
// this.isShow = true
|
365
|
372
|
this.tableData = this.totalData[2].list
|
|
373
|
+ this.isAudit = this.totalData[2].step.isAudit
|
366
|
374
|
this.tableDataAudit = []
|
367
|
375
|
this.button = "暂存"
|
368
|
376
|
} else if (this.step == 4) {
|
|
@@ -392,11 +400,11 @@ export default {
|
392
|
400
|
|
393
|
401
|
//点击返回按钮
|
394
|
402
|
goBack() {
|
395
|
|
- this.$router.push({ path: "/reservesManagement/fumigationManagement" })
|
|
403
|
+ this.$router.push({ path: "/facilitiesEquipment/facilitiesManagement/maintenance" })
|
396
|
404
|
},
|
397
|
405
|
//新增时初始化页面
|
398
|
406
|
processFirst() {
|
399
|
|
- var type = "xz"
|
|
407
|
+ var type = "sswx"
|
400
|
408
|
getAddList(type)
|
401
|
409
|
.then((res) => {
|
402
|
410
|
if (res.code == 200) {
|
|
@@ -420,10 +428,10 @@ export default {
|
420
|
428
|
tfAdd() {
|
421
|
429
|
this.loading=true;
|
422
|
430
|
let type = null;
|
423
|
|
- if(this.stepActive == 0 || this.stepActive == 1 || this.stepActive == 2){
|
424
|
|
- type = "xzjh"
|
425
|
|
- }else if(this.stepActive == 3 || this.stepActive == 4){
|
426
|
|
- type = "xzsq"
|
|
431
|
+ if(this.stepActive == 0){
|
|
432
|
+ type = "sswxjh"
|
|
433
|
+ }else if(this.stepActive == 1){
|
|
434
|
+ type = "sswxys"
|
427
|
435
|
}
|
428
|
436
|
var data = {
|
429
|
437
|
//流程类型
|
|
@@ -435,7 +443,7 @@ export default {
|
435
|
443
|
|
436
|
444
|
subList: this.subList,
|
437
|
445
|
//仓房id
|
438
|
|
- houseId: Number(this.$store.state.houseId),
|
|
446
|
+ // houseId: Number(this.$store.state.houseId),
|
439
|
447
|
//库id
|
440
|
448
|
depotId: this.$store.state.depotId,
|
441
|
449
|
//发起人
|
|
@@ -446,6 +454,7 @@ export default {
|
446
|
454
|
toPeople: this.toPeople,
|
447
|
455
|
//申请时间
|
448
|
456
|
applyTime: getNowFormatDate(),
|
|
457
|
+ isAudit: this.isAudit
|
449
|
458
|
}
|
450
|
459
|
console.log(data, "新增数据。。。")
|
451
|
460
|
addList(data)
|
|
@@ -455,7 +464,7 @@ export default {
|
455
|
464
|
this.loading=true;
|
456
|
465
|
this.$message.success(res.msg);
|
457
|
466
|
this.$router.push({
|
458
|
|
- path: "/reservesManagement/fumigationManagement",
|
|
467
|
+ path: "/facilitiesEquipment/facilitiesManagement/maintenance",
|
459
|
468
|
})
|
460
|
469
|
}else{
|
461
|
470
|
this.$message.error(res.msg);
|
|
@@ -471,58 +480,66 @@ export default {
|
471
|
480
|
|
472
|
481
|
//点击保存并提交按钮时
|
473
|
482
|
save() {
|
474
|
|
- if( this.totalData[this.stepActive].list[0].subData == 1){
|
475
|
|
- this.$message("只有选择是才能发起申请");
|
476
|
|
- return;
|
|
483
|
+ let status = 0
|
|
484
|
+ if(this.stepActive == 0 || this.stepActive == 1){
|
|
485
|
+ this.totalData[this.stepActive].list.forEach(item => {
|
|
486
|
+ if( item.subData == 1){
|
|
487
|
+ this.$message("只有选择是才能发起申请");
|
|
488
|
+ status = 1
|
|
489
|
+ return;
|
|
490
|
+ }
|
|
491
|
+ })
|
477
|
492
|
}
|
478
|
|
- this.tableData.forEach((ele) => {
|
479
|
|
- var obj = {}
|
480
|
|
- console.log(ele)
|
481
|
|
- obj.subData = ele.subData
|
482
|
|
- obj.subId = ele.id
|
483
|
|
- obj.mainId = ele.zid
|
484
|
|
- obj.operationTime = ele.operationTime
|
485
|
|
- obj.processId = ''
|
486
|
|
- if(this.$route.query && this.$route.query.processId){
|
487
|
|
- obj.processId = this.$route.query.processId
|
488
|
|
- }
|
489
|
|
- if (obj.subData != null) {
|
490
|
|
- this.subList.push(obj)
|
491
|
|
- }
|
492
|
|
- })
|
493
|
|
- if (this.button == "保存并提交") {
|
494
|
|
- if (this.totalData[this.stepActive].list[0].subData == null) {
|
495
|
|
- this.$message("请先选择选项");
|
496
|
|
- return;
|
497
|
|
- }
|
498
|
|
- //判断是否选择了审批人
|
499
|
|
- var flag = true
|
500
|
|
- this.process.forEach((item) => {
|
501
|
|
- if (item.content == null) {
|
502
|
|
- this.$message("请先选择审批人")
|
503
|
|
- flag = false
|
504
|
|
- return
|
|
493
|
+ if(status == 0){
|
|
494
|
+ this.tableData.forEach((ele) => {
|
|
495
|
+ var obj = {}
|
|
496
|
+ console.log(ele)
|
|
497
|
+ obj.subData = ele.subData
|
|
498
|
+ obj.subId = ele.id
|
|
499
|
+ obj.mainId = ele.zid
|
|
500
|
+ obj.operationTime = ele.operationTime
|
|
501
|
+ obj.processId = ''
|
|
502
|
+ if(this.$route.query && this.$route.query.processId){
|
|
503
|
+ obj.processId = this.$route.query.processId
|
|
504
|
+ }
|
|
505
|
+ if (obj.subData != null) {
|
|
506
|
+ this.subList.push(obj)
|
505
|
507
|
}
|
506
|
508
|
})
|
507
|
|
- if (flag) {
|
508
|
|
- this.tfAdd()
|
509
|
|
- }
|
510
|
|
- } else {
|
511
|
|
- if (this.button == "暂存") {
|
512
|
|
- this.auditState = 3
|
513
|
|
- this.ongoingStep = this.stepActive
|
514
|
|
- this.getUpdateList()
|
515
|
|
- } else if (this.button == "保存" || this.button == "完成") {
|
516
|
|
- console.log("保存。。")
|
517
|
|
- // if (this.stepActive + 1 == this.step) {
|
518
|
|
- // this.stepActive = this.stepActive + 1
|
519
|
|
- // }
|
520
|
|
- if (this.button == "保存") {
|
|
509
|
+ if (this.button == "保存并提交") {
|
|
510
|
+ if (this.totalData[this.stepActive].list[0].subData == null) {
|
|
511
|
+ this.$message("请先选择选项");
|
|
512
|
+ return;
|
|
513
|
+ }
|
|
514
|
+ //判断是否选择了审批人
|
|
515
|
+ var flag = true
|
|
516
|
+ this.process.forEach((item) => {
|
|
517
|
+ if (item.content == null) {
|
|
518
|
+ this.$message("请先选择审批人")
|
|
519
|
+ flag = false
|
|
520
|
+ return
|
|
521
|
+ }
|
|
522
|
+ })
|
|
523
|
+ if (flag) {
|
|
524
|
+ this.tfAdd()
|
|
525
|
+ }
|
|
526
|
+ } else {
|
|
527
|
+ if (this.button == "暂存") {
|
521
|
528
|
this.auditState = 3
|
522
|
|
- } else {
|
523
|
|
- this.auditState = 4
|
|
529
|
+ this.ongoingStep = this.stepActive
|
|
530
|
+ this.getUpdateList()
|
|
531
|
+ } else if (this.button == "保存" || this.button == "完成") {
|
|
532
|
+ console.log("保存。。")
|
|
533
|
+ // if (this.stepActive + 1 == this.step) {
|
|
534
|
+ // this.stepActive = this.stepActive + 1
|
|
535
|
+ // }
|
|
536
|
+ if (this.button == "保存") {
|
|
537
|
+ this.auditState = 3
|
|
538
|
+ } else {
|
|
539
|
+ this.auditState = 4
|
|
540
|
+ }
|
|
541
|
+ this.getUpdateList()
|
524
|
542
|
}
|
525
|
|
- this.getUpdateList()
|
526
|
543
|
}
|
527
|
544
|
}
|
528
|
545
|
},
|
|
@@ -536,6 +553,10 @@ export default {
|
536
|
553
|
this.totalData = res.data.process
|
537
|
554
|
let ongoingStep = this.stepActive
|
538
|
555
|
this.tableData = res.data.process[ongoingStep].list
|
|
556
|
+ this.isAudit = res.data.process[ongoingStep].step.isAudit
|
|
557
|
+ if(!this.isAudit && this.isAudit != 0){
|
|
558
|
+ this.isAudit = 1
|
|
559
|
+ }
|
539
|
560
|
if(res.data.process[ongoingStep].audit){
|
540
|
561
|
// this.tableDataAudit = res.data.process[ongoingStep].audit
|
541
|
562
|
for (let i = 0; i < res.data.process[ongoingStep].audit.length; i++) {
|
|
@@ -550,7 +571,12 @@ export default {
|
550
|
571
|
} else {
|
551
|
572
|
this.process[0].content = res.data.process[ongoingStep].audit[0].content
|
552
|
573
|
}
|
553
|
|
- this.tableDataAudit = this.process
|
|
574
|
+ this.tableDataAuditCopy = this.process
|
|
575
|
+ if(this.isAudit == 1){
|
|
576
|
+ this.tableDataAudit = JSON.parse(JSON.stringify(this.tableDataAuditCopy))
|
|
577
|
+ }else if(this.isAudit == 0){
|
|
578
|
+ this.tableDataAudit = JSON.parse(JSON.stringify(this.tableDataAuditCopy)).slice(0,3)
|
|
579
|
+ }
|
554
|
580
|
this.detailProcessList()
|
555
|
581
|
this.tableShow()
|
556
|
582
|
}
|
|
@@ -566,10 +592,10 @@ export default {
|
566
|
592
|
getUpdateList() {
|
567
|
593
|
this.loading=true;
|
568
|
594
|
let type = null;
|
569
|
|
- if(this.stepActive == 0 || this.stepActive == 1 || this.stepActive == 2){
|
570
|
|
- type = "xzjh"
|
571
|
|
- }else if(this.stepActive == 3 || this.stepActive == 4){
|
572
|
|
- type = "xzsq"
|
|
595
|
+ if(this.stepActive == 0){
|
|
596
|
+ type = "sswxjh"
|
|
597
|
+ }else if(this.stepActive == 1 || this.stepActive == 2){
|
|
598
|
+ type = "sswxys"
|
573
|
599
|
}
|
574
|
600
|
let ongoingStepNum = null
|
575
|
601
|
if(this.stepActive < 4 && this.button !== "暂存"){
|
|
@@ -583,6 +609,7 @@ export default {
|
583
|
609
|
auditState: this.auditState,
|
584
|
610
|
ongoingStep: ongoingStepNum,
|
585
|
611
|
subList: this.subList,
|
|
612
|
+ isAudit: this.isAudit
|
586
|
613
|
}
|
587
|
614
|
updateList(data).then((res) => {
|
588
|
615
|
if (res.code == 200) {
|
|
@@ -598,15 +625,23 @@ export default {
|
598
|
625
|
this.getCheckList()
|
599
|
626
|
}else{
|
600
|
627
|
this.$router.push({
|
601
|
|
- path: "/reservesManagement/fumigationManagement",
|
|
628
|
+ path: "/facilitiesEquipment/facilitiesManagement/maintenance",
|
602
|
629
|
})
|
603
|
630
|
}
|
604
|
631
|
// this.$router.push({
|
605
|
|
- // path: "/reservesManagement/fumigationManagement",
|
|
632
|
+ // path: "/facilitiesEquipment/facilitiesManagement/maintenance",
|
606
|
633
|
// })
|
607
|
634
|
}
|
608
|
635
|
})
|
609
|
636
|
},
|
|
637
|
+
|
|
638
|
+ isAuditFn() {
|
|
639
|
+ if(this.isAudit == 1){
|
|
640
|
+ this.tableDataAudit = JSON.parse(JSON.stringify(this.tableDataAuditCopy))
|
|
641
|
+ }else if(this.isAudit == 0){
|
|
642
|
+ this.tableDataAudit = JSON.parse(JSON.stringify(this.tableDataAuditCopy)).slice(0,3)
|
|
643
|
+ }
|
|
644
|
+ }
|
610
|
645
|
},
|
611
|
646
|
|
612
|
647
|
mounted() {
|
|
@@ -702,6 +737,11 @@ export default {
|
702
|
737
|
text-align: left;
|
703
|
738
|
color: #037d41;
|
704
|
739
|
font-size: 18px;
|
|
740
|
+ display: inline-block;
|
|
741
|
+ }
|
|
742
|
+ .tf_title_right{
|
|
743
|
+ display: inline-block;
|
|
744
|
+ float: right;
|
705
|
745
|
}
|
706
|
746
|
.el-steps {
|
707
|
747
|
// height: 330px !important;
|