|
@@ -0,0 +1,805 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="global">
|
|
3
|
+ <div class="mainContainer">
|
|
4
|
+ <div class="div_parent">
|
|
5
|
+ <div class="steps">
|
|
6
|
+ <el-steps :active="stepActive" align-center direction="horizontal">
|
|
7
|
+ <el-step
|
|
8
|
+ id="el_step"
|
|
9
|
+ :title="item.step.title"
|
|
10
|
+ v-for="(item, index) in totalData"
|
|
11
|
+ :key="index"
|
|
12
|
+ @click.native="stepClick(index)"
|
|
13
|
+ >
|
|
14
|
+ <svg-icon
|
|
15
|
+ class='icon_wai'
|
|
16
|
+ slot="icon"
|
|
17
|
+ icon-class="NotStarted"
|
|
18
|
+ v-if="stepActive < index"
|
|
19
|
+ />
|
|
20
|
+ <svg-icon
|
|
21
|
+ class='icon_wai'
|
|
22
|
+ slot="icon"
|
|
23
|
+ icon-class="current"
|
|
24
|
+ v-if="stepActive == index"
|
|
25
|
+ />
|
|
26
|
+ <svg-icon
|
|
27
|
+ class='icon_wai'
|
|
28
|
+ slot="icon"
|
|
29
|
+ icon-class="finished"
|
|
30
|
+ v-if="stepActive > index"
|
|
31
|
+ />
|
|
32
|
+
|
|
33
|
+ <!-- <template>
|
|
34
|
+ <i
|
|
35
|
+ slot="icon"
|
|
36
|
+ class="iconfont iconNotStarted"
|
|
37
|
+ v-if="stepActive < index"
|
|
38
|
+ />
|
|
39
|
+ <i
|
|
40
|
+ slot="icon"
|
|
41
|
+ class="iconfont iconcurrent"
|
|
42
|
+ v-if="stepActive == index"
|
|
43
|
+ />
|
|
44
|
+ <i
|
|
45
|
+ slot="icon"
|
|
46
|
+ class="iconfont iconfinished"
|
|
47
|
+ v-if="stepActive > index"
|
|
48
|
+ />
|
|
49
|
+ </template> -->
|
|
50
|
+ </el-step>
|
|
51
|
+ </el-steps>
|
|
52
|
+ </div>
|
|
53
|
+
|
|
54
|
+ <div id="step1">
|
|
55
|
+ <el-table
|
|
56
|
+ border
|
|
57
|
+ stripe
|
|
58
|
+ highlight-current-row
|
|
59
|
+ :data="tableData"
|
|
60
|
+ :span-method="arraySpanMethod"
|
|
61
|
+ >
|
|
62
|
+ <el-table-column
|
|
63
|
+ label="序号"
|
|
64
|
+ prop="step"
|
|
65
|
+ align="center"
|
|
66
|
+ width="100px"
|
|
67
|
+ >
|
|
68
|
+ <template slot-scope="scope">
|
|
69
|
+ <div
|
|
70
|
+ v-if="
|
|
71
|
+ scope.row.hasOwnProperty('process') &&
|
|
72
|
+ scope.row.process.length != 0
|
|
73
|
+ "
|
|
74
|
+ style="height: 400px"
|
|
75
|
+ >
|
|
76
|
+ <div class="tf_title">
|
|
77
|
+ <i class="iconfont iconshu"></i>流程(熏蒸管理审批)
|
|
78
|
+ </div>
|
|
79
|
+ <el-steps direction="vertical" :active="1">
|
|
80
|
+ <el-step
|
|
81
|
+ v-for="(item, index) in scope.row.process"
|
|
82
|
+ :key="index"
|
|
83
|
+ icon="el-icon-edit"
|
|
84
|
+ >
|
|
85
|
+ <template>
|
|
86
|
+ <div
|
|
87
|
+ slot="title"
|
|
88
|
+ class="stepTitle"
|
|
89
|
+ style="display: flex; justify-content: space-between"
|
|
90
|
+ >
|
|
91
|
+ <div class="stepTitleFont">
|
|
92
|
+ {{ item.title }}
|
|
93
|
+ </div>
|
|
94
|
+
|
|
95
|
+ <div style="width: 200px">
|
|
96
|
+ <div
|
|
97
|
+ :class="{
|
|
98
|
+ active:
|
|
99
|
+ (item.auditState == null &&
|
|
100
|
+ processActive >= index) ||
|
|
101
|
+ item.auditState == 1,
|
|
102
|
+ noActive: item.auditState == 2,
|
|
103
|
+ }"
|
|
104
|
+ >
|
|
105
|
+ {{ perList[item.content] }}
|
|
106
|
+ </div>
|
|
107
|
+ <div v-if="item.auditState == 0">待审批</div>
|
|
108
|
+ <div v-if="item.auditState == 1">审批通过</div>
|
|
109
|
+ <div v-if="item.auditState == 2">审批不通过</div>
|
|
110
|
+ <div class="stepTitleFont">{{ item.auditTime }}</div>
|
|
111
|
+
|
|
112
|
+ <div style="width: 200px; display: flex">
|
|
113
|
+ <!-- <el-button
|
|
114
|
+ type="danger"
|
|
115
|
+ size="mini"
|
|
116
|
+ v-if="
|
|
117
|
+ item.content == userInfo.uid &&
|
|
118
|
+ item.auditState == 0
|
|
119
|
+ "
|
|
120
|
+ @click="noAgree(item)"
|
|
121
|
+ >审批不通过</el-button
|
|
122
|
+ >
|
|
123
|
+ <el-button
|
|
124
|
+ type="success"
|
|
125
|
+ size="mini"
|
|
126
|
+ v-if="
|
|
127
|
+ item.content == userInfo.uid &&
|
|
128
|
+ item.auditState == 0
|
|
129
|
+ "
|
|
130
|
+ @click="agree(item)"
|
|
131
|
+ >审批通过</el-button
|
|
132
|
+ > -->
|
|
133
|
+ </div>
|
|
134
|
+ </div>
|
|
135
|
+ </div>
|
|
136
|
+ </template>
|
|
137
|
+ <template>
|
|
138
|
+ <i
|
|
139
|
+ slot="icon"
|
|
140
|
+ class="iconfont iconstep_current"
|
|
141
|
+ v-if="item.auditState != 2 && processActive <= index"
|
|
142
|
+ >
|
|
143
|
+ </i>
|
|
144
|
+ <i
|
|
145
|
+ slot="icon"
|
|
146
|
+ style="color: red"
|
|
147
|
+ class="iconfont iconstep_err"
|
|
148
|
+ v-if="item.auditState == 2"
|
|
149
|
+ ></i>
|
|
150
|
+ <i
|
|
151
|
+ slot="icon"
|
|
152
|
+ style="color: green"
|
|
153
|
+ class="iconfont iconstep_complete"
|
|
154
|
+ v-if="
|
|
155
|
+ (processActive == index && item.auditState == 4) ||
|
|
156
|
+ processActive > index
|
|
157
|
+ "
|
|
158
|
+ ></i>
|
|
159
|
+ </template>
|
|
160
|
+ </el-step>
|
|
161
|
+ </el-steps>
|
|
162
|
+ </div>
|
|
163
|
+ <div v-else>{{ scope.row.step }}</div>
|
|
164
|
+ </template>
|
|
165
|
+ </el-table-column>
|
|
166
|
+ <el-table-column prop="operationTime" label="时间" align="center">
|
|
167
|
+ </el-table-column>
|
|
168
|
+
|
|
169
|
+ <el-table-column prop="title" label="工作项" align="center" />
|
|
170
|
+ <el-table-column prop="details" label="选项" align="center">
|
|
171
|
+ <template slot-scope="scope">
|
|
172
|
+ <el-radio-group
|
|
173
|
+ v-model="scope.row.subData"
|
|
174
|
+ @change="radioChange(scope.row)"
|
|
175
|
+ >
|
|
176
|
+ <el-radio :label="0" :disabled="pageType == 3 || disabled">{{
|
|
177
|
+ scope.row.details.split(",")[0]
|
|
178
|
+ }}</el-radio>
|
|
179
|
+ <el-radio :label="1" :disabled="pageType == 3 || disabled">{{
|
|
180
|
+ scope.row.details.split(",")[1]
|
|
181
|
+ }}</el-radio>
|
|
182
|
+ </el-radio-group>
|
|
183
|
+ </template>
|
|
184
|
+ </el-table-column>
|
|
185
|
+ </el-table>
|
|
186
|
+
|
|
187
|
+ <div class="btns">
|
|
188
|
+ <el-button type="cancel" @click="goBack()"
|
|
189
|
+ >返回</el-button
|
|
190
|
+ >
|
|
191
|
+ <el-button class="saveBtn" v-show="isShow" type="savebtn" @click="save()" :loading="loading">{{
|
|
192
|
+ this.button
|
|
193
|
+ }}</el-button>
|
|
194
|
+ </div>
|
|
195
|
+ </div>
|
|
196
|
+ </div>
|
|
197
|
+ </div>
|
|
198
|
+ </div>
|
|
199
|
+</template>
|
|
200
|
+<script>
|
|
201
|
+//时间格式的转化
|
|
202
|
+import { getNowFormatDate } from "@/utils"
|
|
203
|
+import { getUser } from "@/utils/auth"
|
|
204
|
+import {
|
|
205
|
+ addList,
|
|
206
|
+ getAddList,
|
|
207
|
+ getProcessList,
|
|
208
|
+ userList,
|
|
209
|
+ checkList,
|
|
210
|
+ updateList,
|
|
211
|
+} from "@/api/reservesManagement/mechanicalVentilation"
|
|
212
|
+
|
|
213
|
+import { pSelect } from "@/api/system/userManagement/approver"
|
|
214
|
+export default {
|
|
215
|
+ name: "AddMeVentilation",
|
|
216
|
+
|
|
217
|
+ data() {
|
|
218
|
+ return {
|
|
219
|
+ //进度条
|
|
220
|
+ loading:false,
|
|
221
|
+ isShow: true,
|
|
222
|
+ //初始化空对象
|
|
223
|
+ obj: {},
|
|
224
|
+ pageType: 0,
|
|
225
|
+
|
|
226
|
+ //流程id
|
|
227
|
+ processId: "",
|
|
228
|
+ //当前登录人信息
|
|
229
|
+ userInfo: {},
|
|
230
|
+ //仓房id
|
|
231
|
+ houseId: null,
|
|
232
|
+ //仓库id
|
|
233
|
+ depotId: null,
|
|
234
|
+ perList: {},
|
|
235
|
+ //人员列表
|
|
236
|
+ approverSelect: [],
|
|
237
|
+ //初始化当前登录人
|
|
238
|
+ loginPeople: "",
|
|
239
|
+ index: null,
|
|
240
|
+ //状态 3=进行中
|
|
241
|
+ auditState: 3,
|
|
242
|
+ //当前流程索引值
|
|
243
|
+ ongongstep: null,
|
|
244
|
+ //申请人
|
|
245
|
+ applyPeople: null,
|
|
246
|
+
|
|
247
|
+ //审批人id
|
|
248
|
+ //toPeople:null,
|
|
249
|
+ //提交人
|
|
250
|
+ fromPeople: null,
|
|
251
|
+ //主流程id
|
|
252
|
+ mainId: null,
|
|
253
|
+ //初始化流程高亮显示
|
|
254
|
+ processActive: 0,
|
|
255
|
+ //初始化radio是否禁用
|
|
256
|
+ disabled: false,
|
|
257
|
+ //初始化按钮的内容为空
|
|
258
|
+ button: "",
|
|
259
|
+ //初始化表格数据
|
|
260
|
+ tableData: [],
|
|
261
|
+ //初始化点击的步骤
|
|
262
|
+ step: 0,
|
|
263
|
+ //初始化步骤高亮显示到第几步
|
|
264
|
+ stepActive: 0,
|
|
265
|
+ //步骤1
|
|
266
|
+ totalData: [],
|
|
267
|
+
|
|
268
|
+ //审批流程
|
|
269
|
+ process: [],
|
|
270
|
+ //流程选项
|
|
271
|
+
|
|
272
|
+ subList: [],
|
|
273
|
+ }
|
|
274
|
+ },
|
|
275
|
+ methods: {
|
|
276
|
+ //合并列或行
|
|
277
|
+ arraySpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
278
|
+ if (this.step != 1) {
|
|
279
|
+ return
|
|
280
|
+ }
|
|
281
|
+ if (rowIndex === 1) {
|
|
282
|
+ if (columnIndex === 0) {
|
|
283
|
+ return [1, 4]
|
|
284
|
+ }
|
|
285
|
+ }
|
|
286
|
+ },
|
|
287
|
+
|
|
288
|
+ // 用户字典列表
|
|
289
|
+ getUserList() {
|
|
290
|
+ // var params = {
|
|
291
|
+ // depotId: this.depotId,
|
|
292
|
+ // }
|
|
293
|
+ userList().then((res) => {
|
|
294
|
+ if (res.code == 200) {
|
|
295
|
+ console.log(res, "用户列表。。。。。")
|
|
296
|
+ this.perList = res.data
|
|
297
|
+ }
|
|
298
|
+ })
|
|
299
|
+ },
|
|
300
|
+
|
|
301
|
+ //获取流程数据
|
|
302
|
+ processList() {
|
|
303
|
+ var type = "tf"
|
|
304
|
+ var userId = this.userInfo.uid
|
|
305
|
+ var depotId = this.userInfo.depotId
|
|
306
|
+ getProcessList(type, userId, depotId).then((res) => {
|
|
307
|
+ if (res.code == 200) {
|
|
308
|
+ for (let i = 0; i < res.data.length - 1; i++) {
|
|
309
|
+ var ele = res.data[i]
|
|
310
|
+ if (ele.auditState != null) {
|
|
311
|
+ this.processActive = i
|
|
312
|
+ }
|
|
313
|
+ console.log(ele, "ele.....")
|
|
314
|
+
|
|
315
|
+ this.process.push(ele)
|
|
316
|
+ }
|
|
317
|
+ // this.process[0].uName = this.userInfo.uname;
|
|
318
|
+ console.log(this.process, "this.process...")
|
|
319
|
+
|
|
320
|
+ if (this.process[0].content == 0) {
|
|
321
|
+ this.process[0].content = this.userInfo.uid
|
|
322
|
+ console.log(this.process[0].content, "this.process[0].content....")
|
|
323
|
+ }
|
|
324
|
+
|
|
325
|
+ //申请人
|
|
326
|
+ this.applyPeople = this.process[0].content
|
|
327
|
+ //审批人
|
|
328
|
+ // this.toPeople=this.process[1].content;
|
|
329
|
+ //提交人
|
|
330
|
+ this.fromPeople = this.process[0].content
|
|
331
|
+ }
|
|
332
|
+ })
|
|
333
|
+ },
|
|
334
|
+
|
|
335
|
+ //初始化应该显示第几步的表格、
|
|
336
|
+ tableShow() {
|
|
337
|
+ if (this.stepActive == 0) {
|
|
338
|
+ this.tableData = this.totalData[0].list
|
|
339
|
+ // this.subList = this.tableData
|
|
340
|
+ //主流程ID
|
|
341
|
+ this.mainId = this.totalData[0].step.id
|
|
342
|
+ } else if (this.stepActive == 1) {
|
|
343
|
+ this.tableData = this.totalData[1].list
|
|
344
|
+ } else if (this.stepActive == 2) {
|
|
345
|
+ this.tableData = this.totalData[2].list
|
|
346
|
+ } else if (this.stepActive == 3) {
|
|
347
|
+ this.tableData = this.totalData[3].list
|
|
348
|
+ }
|
|
349
|
+ // this.tableData = this.totalData[this.stepActive].list
|
|
350
|
+ },
|
|
351
|
+ //radio选项改变是
|
|
352
|
+ radioChange(row) {
|
|
353
|
+ console.log(getNowFormatDate())
|
|
354
|
+ row.operationTime = getNowFormatDate()
|
|
355
|
+ this.changeBtn(this.tableData)
|
|
356
|
+ },
|
|
357
|
+
|
|
358
|
+ changeBtn(arr) {
|
|
359
|
+ console.log(arr, "arrr")
|
|
360
|
+ //完成标记
|
|
361
|
+ var finish = true
|
|
362
|
+ for (var i = 0; i < arr.length; i++) {
|
|
363
|
+ if (arr[i].process == null && arr[i].subData == null) {
|
|
364
|
+ finish = false
|
|
365
|
+ break
|
|
366
|
+ }
|
|
367
|
+ }
|
|
368
|
+
|
|
369
|
+ if (finish) {
|
|
370
|
+ if (this.stepActive == 0) {
|
|
371
|
+ this.button = "保存并提交"
|
|
372
|
+ } else if (this.stepActive != 3 || this.step != 4) {
|
|
373
|
+ this.button = "保存"
|
|
374
|
+ } else {
|
|
375
|
+ this.button = "完成"
|
|
376
|
+ }
|
|
377
|
+ } else {
|
|
378
|
+ if (this.step == 1) {
|
|
379
|
+ this.button = "保存并提交"
|
|
380
|
+ } else {
|
|
381
|
+ this.button = "暂存"
|
|
382
|
+ }
|
|
383
|
+ }
|
|
384
|
+ },
|
|
385
|
+ //点击每步时
|
|
386
|
+ stepClick(index) {
|
|
387
|
+ //this.step = index + 1
|
|
388
|
+ console.log(this.step, this.stepActive + 1)
|
|
389
|
+ if (index > this.stepActive) {
|
|
390
|
+ return
|
|
391
|
+ }
|
|
392
|
+ this.step = index + 1
|
|
393
|
+
|
|
394
|
+ if (this.pageType == 2) {
|
|
395
|
+ this.isShow = true
|
|
396
|
+ } else {
|
|
397
|
+ this.isShow = false
|
|
398
|
+ }
|
|
399
|
+
|
|
400
|
+ console.log("step:" + this.step);
|
|
401
|
+
|
|
402
|
+ if (this.step == 1) {
|
|
403
|
+ this.tableData = this.totalData[0].list
|
|
404
|
+
|
|
405
|
+ this.button = "保存并提交"
|
|
406
|
+ //2修改 3查看
|
|
407
|
+
|
|
408
|
+ // if (this.pageType == 2||this.pageType ==3) {
|
|
409
|
+ // //保存按钮隐藏
|
|
410
|
+ // this.isShow = false
|
|
411
|
+ // // this.disabled=true
|
|
412
|
+ // console.log(this.disabled,"this.disabled...")
|
|
413
|
+
|
|
414
|
+ // }else{
|
|
415
|
+ // this.isShow = true
|
|
416
|
+ // }
|
|
417
|
+
|
|
418
|
+ // if(this.pageType !=3){
|
|
419
|
+ // this.disabled=false
|
|
420
|
+ // }else{
|
|
421
|
+ // this.disabled = true
|
|
422
|
+ // }
|
|
423
|
+ if (this.pageType == 1) {
|
|
424
|
+ this.disabled = false
|
|
425
|
+ this.isShow = true
|
|
426
|
+ } else if (this.pageType == 2) {
|
|
427
|
+ this.disabled = true;
|
|
428
|
+ this.isShow = false
|
|
429
|
+ } else {
|
|
430
|
+ this.disabled = true
|
|
431
|
+ this.isShow = false
|
|
432
|
+ }
|
|
433
|
+ } else if (this.step == 2) {
|
|
434
|
+ // this.isShow = true
|
|
435
|
+ this.tableData = this.totalData[1].list
|
|
436
|
+ console.log(this.tableData, "第二步")
|
|
437
|
+ this.button = "暂存"
|
|
438
|
+ this.disabled = false
|
|
439
|
+ } else if (this.step == 3) {
|
|
440
|
+ // this.isShow = true
|
|
441
|
+ this.tableData = this.totalData[2].list
|
|
442
|
+ this.button = "暂存"
|
|
443
|
+ this.disabled = false
|
|
444
|
+ } else if (this.step == 4) {
|
|
445
|
+ // this.isShow = true
|
|
446
|
+ this.tableData = this.totalData[3].list
|
|
447
|
+ this.button = "暂存"
|
|
448
|
+ this.disabled = false
|
|
449
|
+ }
|
|
450
|
+ console.log(this.tableData, "???")
|
|
451
|
+ this.changeBtn(this.tableData)
|
|
452
|
+ },
|
|
453
|
+
|
|
454
|
+ //点击返回按钮
|
|
455
|
+ goBack() {
|
|
456
|
+ this.$router.push({ path: "/reservesManagement/mechanicalVentilation" })
|
|
457
|
+ },
|
|
458
|
+ //新增时初始化页面
|
|
459
|
+ processFirst() {
|
|
460
|
+ var type = "tf"
|
|
461
|
+ getAddList(type)
|
|
462
|
+ .then((res) => {
|
|
463
|
+ if (res.code == 200) {
|
|
464
|
+ this.totalData = res.data
|
|
465
|
+
|
|
466
|
+ this.totalData[0].list.splice(1, 0, {
|
|
467
|
+ details: "是,否",
|
|
468
|
+ process: this.process,
|
|
469
|
+ })
|
|
470
|
+
|
|
471
|
+ // this.$set(this.totalData[0].list, "process", this.process)
|
|
472
|
+ this.main_id = this.totalData[0].step.id
|
|
473
|
+ console.log(this.totalData, "this.totalData..")
|
|
474
|
+ this.tableShow()
|
|
475
|
+ }
|
|
476
|
+ })
|
|
477
|
+ .catch((err) => {
|
|
478
|
+ console.log(err)
|
|
479
|
+ })
|
|
480
|
+ },
|
|
481
|
+
|
|
482
|
+ //流程新增
|
|
483
|
+ tfAdd() {
|
|
484
|
+ this.loading=true;
|
|
485
|
+ var data = {
|
|
486
|
+ //流程类型
|
|
487
|
+ type: "tf",
|
|
488
|
+ //主流程id
|
|
489
|
+ mainId: this.mainId,
|
|
490
|
+ //主流程索引
|
|
491
|
+ ongoingStep: this.stepActive,
|
|
492
|
+
|
|
493
|
+ subList: this.subList,
|
|
494
|
+ //仓房id
|
|
495
|
+ houseId: this.$store.state.houseId,
|
|
496
|
+ //库id
|
|
497
|
+ depotId: this.$store.state.depotId,
|
|
498
|
+ //发起人
|
|
499
|
+ fromPeople: this.fromPeople,
|
|
500
|
+ //申请人
|
|
501
|
+ applyPeople: this.applyPeople,
|
|
502
|
+ //审批人
|
|
503
|
+ toPeople: this.toPeople,
|
|
504
|
+ //申请时间
|
|
505
|
+ applyTime: getNowFormatDate(),
|
|
506
|
+ }
|
|
507
|
+ console.log(data, "新增数据。。。")
|
|
508
|
+ addList(data)
|
|
509
|
+ .then((res) => {
|
|
510
|
+ console.log(res.data)
|
|
511
|
+ if (res.code == 200) {
|
|
512
|
+ this.loading=true;
|
|
513
|
+ this.$router.push({
|
|
514
|
+ path: "/reservesManagement/mechanicalVentilation",
|
|
515
|
+ })
|
|
516
|
+ }
|
|
517
|
+ })
|
|
518
|
+ .catch((err) => {
|
|
519
|
+ console.log(err)
|
|
520
|
+ })
|
|
521
|
+ },
|
|
522
|
+
|
|
523
|
+ //点击保存并提交按钮时
|
|
524
|
+ save() {
|
|
525
|
+ console.log(this.tableData,"this.tableData...>>>>>")
|
|
526
|
+ if( this.totalData[0].list[0].subData == 1){
|
|
527
|
+ this.$message("只有选择是才能发起申请");
|
|
528
|
+ return;
|
|
529
|
+ }
|
|
530
|
+ this.tableData.forEach((ele) => {
|
|
531
|
+ var obj = {}
|
|
532
|
+ console.log(ele)
|
|
533
|
+ obj.subData = ele.subData
|
|
534
|
+ obj.subId = ele.id
|
|
535
|
+ obj.mainId = ele.zid
|
|
536
|
+ obj.operationTime = ele.operationTime
|
|
537
|
+ console.log(obj, "obj.....")
|
|
538
|
+ if (obj.subData != null) {
|
|
539
|
+ this.subList.push(obj)
|
|
540
|
+ }
|
|
541
|
+ })
|
|
542
|
+ console.log(this.subList, "??????")
|
|
543
|
+
|
|
544
|
+ if (this.button == "保存并提交") {
|
|
545
|
+ console.log(this.totalData, "......")
|
|
546
|
+ console.log(this.process, "process....s")
|
|
547
|
+ if (this.totalData[0].list[0].subData == null) {
|
|
548
|
+ this.$message("请先选择选项");
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+ return;
|
|
552
|
+
|
|
553
|
+ }
|
|
554
|
+
|
|
555
|
+ //判断是否选择了审批人
|
|
556
|
+ var flag = true
|
|
557
|
+ this.process.forEach((item) => {
|
|
558
|
+ if (item.content == null) {
|
|
559
|
+ this.$message("请先选择审批人")
|
|
560
|
+ flag = false
|
|
561
|
+ return
|
|
562
|
+ }
|
|
563
|
+ })
|
|
564
|
+
|
|
565
|
+ if (flag) {
|
|
566
|
+ // if(this.totalData[0].list[0].subData == 1){
|
|
567
|
+
|
|
568
|
+ // this.$message("只有选择是才能发起申请");
|
|
569
|
+
|
|
570
|
+ // return;
|
|
571
|
+ // }
|
|
572
|
+ this.tfAdd()
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+ }
|
|
576
|
+ } else {
|
|
577
|
+ //this.getUpdateList()
|
|
578
|
+ if (this.button == "暂存") {
|
|
579
|
+ this.auditState = 3
|
|
580
|
+ this.ongoingStep = this.stepActive
|
|
581
|
+ this.getUpdateList()
|
|
582
|
+ } else if (this.button == "保存" || this.button == "完成") {
|
|
583
|
+ console.log("保存。。")
|
|
584
|
+ if (this.stepActive + 1 == this.step) {
|
|
585
|
+ this.stepActive = this.stepActive + 1
|
|
586
|
+ }
|
|
587
|
+ if (this.button == "保存") {
|
|
588
|
+ this.auditState = 3
|
|
589
|
+ } else {
|
|
590
|
+ this.auditState = 4
|
|
591
|
+ }
|
|
592
|
+
|
|
593
|
+ // if (this.stepActive < this.tableData.length - 1) {
|
|
594
|
+ // this.auditState = 3
|
|
595
|
+ // this.stepActive = this.stepActive + 1
|
|
596
|
+ // } else {
|
|
597
|
+ // this.auditState = 4
|
|
598
|
+ // this.stepActive = this.stepActive + 1
|
|
599
|
+ // }
|
|
600
|
+
|
|
601
|
+ this.getUpdateList()
|
|
602
|
+ }
|
|
603
|
+ }
|
|
604
|
+ },
|
|
605
|
+
|
|
606
|
+ //查看接口
|
|
607
|
+ getCheckList() {
|
|
608
|
+ var processId = this.processId
|
|
609
|
+ checkList(processId).then((res) => {
|
|
610
|
+ console.log(res.data, "查看数据")
|
|
611
|
+ if (res.code == 200) {
|
|
612
|
+ this.tableData = res.data.process
|
|
613
|
+ this.totalData = this.tableData
|
|
614
|
+
|
|
615
|
+ for (let i = 0; i < res.data.audit.length - 1; i++) {
|
|
616
|
+ var ele = res.data.audit[i]
|
|
617
|
+ if (ele.auditState != null) {
|
|
618
|
+ this.processActive = i
|
|
619
|
+ }
|
|
620
|
+ this.process.push(ele)
|
|
621
|
+ if (this.process[0].content == 0) {
|
|
622
|
+ this.process[0].content = this.userInfo.uid
|
|
623
|
+ } else {
|
|
624
|
+ this.process[0].content = res.data.audit[0].content
|
|
625
|
+ }
|
|
626
|
+ }
|
|
627
|
+ console.log(this.process, " this.process.....")
|
|
628
|
+ console.log(this.stepActive, "this.stepActive...")
|
|
629
|
+ this.tableData = res.data.process[this.stepActive].list
|
|
630
|
+ console.log(this.tableData, "tableData.......??????")
|
|
631
|
+ this.totalData[0].list.splice(1, 0, {
|
|
632
|
+ details: "是,否",
|
|
633
|
+ process: this.process,
|
|
634
|
+ })
|
|
635
|
+ }
|
|
636
|
+ })
|
|
637
|
+ },
|
|
638
|
+
|
|
639
|
+ //每步新增/修改
|
|
640
|
+ getUpdateList() {
|
|
641
|
+ this.loading=true;
|
|
642
|
+ var data = {
|
|
643
|
+ processId: this.processId,
|
|
644
|
+ type: "tf",
|
|
645
|
+ auditState: this.auditState,
|
|
646
|
+ ongoingStep: this.stepActive,
|
|
647
|
+ subList: this.subList,
|
|
648
|
+ }
|
|
649
|
+ updateList(data).then((res) => {
|
|
650
|
+ if (res.code == 200) {
|
|
651
|
+ this.loading=false;
|
|
652
|
+ this.$router.push({
|
|
653
|
+ path: "/reservesManagement/mechanicalVentilation",
|
|
654
|
+ })
|
|
655
|
+ }
|
|
656
|
+ })
|
|
657
|
+ },
|
|
658
|
+ },
|
|
659
|
+
|
|
660
|
+ mounted() {
|
|
661
|
+ //获取当前缓存的用户信息
|
|
662
|
+ // this.userInfo = JSON.parse(localStorage.getItem("userInfo"))
|
|
663
|
+ // console.log(this.userInfo, "this.userInfo.....")
|
|
664
|
+ this.userInfo = JSON.parse(getUser())
|
|
665
|
+ console.log(this.userInfo, "this.userInfo.....?????")
|
|
666
|
+
|
|
667
|
+ console.log(this.$route.query, "route...")
|
|
668
|
+ this.pageType = this.$route.query.type
|
|
669
|
+ console.log(this.pageType, "pageType......")
|
|
670
|
+ this.step = this.stepActive + 1
|
|
671
|
+ console.log(this.stepActive, "stepActive.....")
|
|
672
|
+
|
|
673
|
+ this.getUserList()
|
|
674
|
+ // this.userInfo = JSON.parse(localStorage.getItem("userInfo"))
|
|
675
|
+ // console.log(this.userInfo, "this.userInfo.....")
|
|
676
|
+
|
|
677
|
+ if (this.$route.query.type == 1) {
|
|
678
|
+ this.isShow = true
|
|
679
|
+ this.disabled = false
|
|
680
|
+ this.processFirst()
|
|
681
|
+ this.processList()
|
|
682
|
+ } else if (this.$route.query.type == 2) {
|
|
683
|
+ this.isShow = true
|
|
684
|
+ this.disabled = false
|
|
685
|
+ this.stepActive = parseInt(this.$route.query.ongoingStep)
|
|
686
|
+ console.log(this.stepActive, "修改this.stepActive....")
|
|
687
|
+ this.processId = this.$route.query.processId
|
|
688
|
+ // this.pageType = this.$route.query.type
|
|
689
|
+ this.step = this.stepActive + 1
|
|
690
|
+
|
|
691
|
+ this.getCheckList()
|
|
692
|
+ } else if (this.$route.query.type == 3) {
|
|
693
|
+ this.isShow = false
|
|
694
|
+ this.disabled = true
|
|
695
|
+ console.log(this.$route.query.processId, "this.$route.query....")
|
|
696
|
+ //返回按钮
|
|
697
|
+ // this.pageType = this.$route.query.type
|
|
698
|
+ this.processId = this.$route.query.processId
|
|
699
|
+ //高亮显示
|
|
700
|
+ this.stepActive = parseInt(this.$route.query.ongoingStep)
|
|
701
|
+ this.step = this.stepActive + 1
|
|
702
|
+ console.log(this.processId, "this.processId...")
|
|
703
|
+ this.getCheckList()
|
|
704
|
+ }
|
|
705
|
+
|
|
706
|
+ if (this.stepActive == 0) {
|
|
707
|
+ this.button = "保存并提交"
|
|
708
|
+ } else {
|
|
709
|
+ this.button = "暂存"
|
|
710
|
+ }
|
|
711
|
+ },
|
|
712
|
+}
|
|
713
|
+</script>
|
|
714
|
+<style lang="scss" scoped>
|
|
715
|
+.mainContainer {
|
|
716
|
+ background: #fff;
|
|
717
|
+ padding: 10px;
|
|
718
|
+ height: calc(100% - 40px);
|
|
719
|
+
|
|
720
|
+ .div_parent{
|
|
721
|
+ height:100%;
|
|
722
|
+ overflow-y:auto ;
|
|
723
|
+ .steps {
|
|
724
|
+ height: 80px;
|
|
725
|
+ margin: 10px 0;
|
|
726
|
+ // line-height:80px;
|
|
727
|
+ .iconfont {
|
|
728
|
+ font-size: 55px;
|
|
729
|
+ }
|
|
730
|
+ }
|
|
731
|
+ #step1,
|
|
732
|
+ #step2,
|
|
733
|
+ #step3,
|
|
734
|
+ #step4,
|
|
735
|
+ #process {
|
|
736
|
+ display: block;
|
|
737
|
+ }
|
|
738
|
+ #process {
|
|
739
|
+ margin-top: 20px;
|
|
740
|
+ padding: 20px;
|
|
741
|
+ background: rgb(235, 233, 233);
|
|
742
|
+ .process_title {
|
|
743
|
+ margin-bottom: 20px;
|
|
744
|
+ }
|
|
745
|
+ .stepTitle {
|
|
746
|
+ display: flex;
|
|
747
|
+ justify-content: space-between;
|
|
748
|
+ }
|
|
749
|
+ }
|
|
750
|
+ .btns {
|
|
751
|
+ text-align: right;
|
|
752
|
+ margin: 20px 10px 0 0;
|
|
753
|
+ }
|
|
754
|
+ // .saveBtn{
|
|
755
|
+ // width:120px;
|
|
756
|
+ // }
|
|
757
|
+ .active {
|
|
758
|
+ color: #037d41;
|
|
759
|
+ }
|
|
760
|
+ .noActive {
|
|
761
|
+ color: red;
|
|
762
|
+ }
|
|
763
|
+ .stepTitleFont {
|
|
764
|
+ color: black;
|
|
765
|
+ }
|
|
766
|
+ .tf_title {
|
|
767
|
+ margin-bottom: 20px;
|
|
768
|
+ font-weight: 500;
|
|
769
|
+ text-align: left;
|
|
770
|
+ color: #037d41;
|
|
771
|
+ font-size: 18px;
|
|
772
|
+ }
|
|
773
|
+ .el-steps {
|
|
774
|
+ height: 330px !important;
|
|
775
|
+}
|
|
776
|
+
|
|
777
|
+.icon_wai{
|
|
778
|
+ width:3em;
|
|
779
|
+ height:3em;
|
|
780
|
+}
|
|
781
|
+
|
|
782
|
+}
|
|
783
|
+
|
|
784
|
+}
|
|
785
|
+</style>
|
|
786
|
+<style>
|
|
787
|
+.backBtn.is-plain {
|
|
788
|
+ color: #037d41;
|
|
789
|
+ background-color: #fff;
|
|
790
|
+ border-color: #037d41;
|
|
791
|
+}
|
|
792
|
+.el-step__icon.is-text{
|
|
793
|
+ width:50px;
|
|
794
|
+ height:50px;
|
|
795
|
+}
|
|
796
|
+
|
|
797
|
+.el-step.is-horizontal .el-step__line{
|
|
798
|
+ top:21px !important;
|
|
799
|
+}
|
|
800
|
+.el-step__icon.is-text{
|
|
801
|
+ border:none !important;
|
|
802
|
+}
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+</style>
|