|
|
@@ -2,7 +2,11 @@
|
|
2
|
2
|
<div>
|
|
3
|
3
|
<div class="table">
|
|
4
|
4
|
<!-- (data.length ==0 ||data ==null) ?newGrainData : -->
|
|
5
|
|
- <el-table border :header-cell-style="{background:'#f8f8f8'}" :data="sortData" highlight-current-row
|
|
|
5
|
+ <el-table
|
|
|
6
|
+ border
|
|
|
7
|
+ :header-cell-style="{ background: '#f8f8f8' }"
|
|
|
8
|
+ :data="sortData"
|
|
|
9
|
+ highlight-current-row
|
|
6
|
10
|
>
|
|
7
|
11
|
<el-table-column
|
|
8
|
12
|
type="index"
|
|
|
@@ -11,10 +15,14 @@
|
|
11
|
15
|
width="50px"
|
|
12
|
16
|
sortable
|
|
13
|
17
|
/>
|
|
14
|
|
- <el-table-column prop="checkPerson" label="检查类型" align="center"
|
|
15
|
|
- />
|
|
|
18
|
+ <el-table-column prop="checkPerson" label="检查类型" align="center" />
|
|
16
|
19
|
<el-table-column prop="checkTime" label="最后记录时间" align="center" />
|
|
17
|
|
- <el-table-column prop="recordStatus" label="状态" align="center" width='100px'>
|
|
|
20
|
+ <el-table-column
|
|
|
21
|
+ prop="recordStatus"
|
|
|
22
|
+ label="状态"
|
|
|
23
|
+ align="center"
|
|
|
24
|
+
|
|
|
25
|
+ >
|
|
18
|
26
|
<template slot-scope="scope">
|
|
19
|
27
|
<!-- <div disable-transitions>
|
|
20
|
28
|
{{
|
|
|
@@ -29,12 +37,28 @@
|
|
29
|
37
|
scope.row.recordStatus == '' || scope.row.recordStatus == null
|
|
30
|
38
|
"
|
|
31
|
39
|
></div>
|
|
32
|
|
- <div class="yellow" disable-transitions v-if="scope.row.recordStatus == '0'">
|
|
|
40
|
+ <!-- <div
|
|
|
41
|
+ class="yellow"
|
|
|
42
|
+ disable-transitions
|
|
|
43
|
+ v-if="scope.row.recordStatus == '0'"
|
|
|
44
|
+ >
|
|
33
|
45
|
进行中
|
|
34
|
|
- </div>
|
|
35
|
|
- <div class="green" disable-transitions v-if="scope.row.recordStatus == '1'">
|
|
|
46
|
+ </div> -->
|
|
|
47
|
+ <!-- <div class="green" disable-transitions v-if="scope.row.recordStatus == '1'">
|
|
36
|
48
|
已完成
|
|
37
|
|
- </div>
|
|
|
49
|
+ </div> -->
|
|
|
50
|
+ <p
|
|
|
51
|
+ v-if="scope.row.recordStatus == '1'"
|
|
|
52
|
+ style="height:45px;line-height:45px;margin:0 ; padding-top:7px;"
|
|
|
53
|
+ >
|
|
|
54
|
+ <span class="colorspano">已完成</span>
|
|
|
55
|
+ </p>
|
|
|
56
|
+ <p
|
|
|
57
|
+ v-if="scope.row.recordStatus == '0'"
|
|
|
58
|
+ style="height:45px;line-height:45px;margin:0 ; padding-top:7px;"
|
|
|
59
|
+ >
|
|
|
60
|
+ <span class="colorspant">进行中</span>
|
|
|
61
|
+ </p>
|
|
38
|
62
|
</template>
|
|
39
|
63
|
</el-table-column>
|
|
40
|
64
|
<!-- :formatter="formatterColumn" -->
|
|
|
@@ -72,7 +96,11 @@
|
|
72
|
96
|
fixed="right"
|
|
73
|
97
|
>
|
|
74
|
98
|
<template slot-scope="scope">
|
|
75
|
|
- <el-button size="mini" style="border:1px solid seagreen;color:seagreen" @click="add(2, scope.$index, scope.row)" :disabled='flag'
|
|
|
99
|
+ <el-button
|
|
|
100
|
+ size="mini"
|
|
|
101
|
+ style="border:1px solid seagreen;color:seagreen"
|
|
|
102
|
+ @click="add(2, scope.$index, scope.row)"
|
|
|
103
|
+ :disabled="flag"
|
|
76
|
104
|
>新增</el-button
|
|
77
|
105
|
>
|
|
78
|
106
|
<!-- <el-button size="mini" @click="add(2, scope.$index, scope.row)" :disabled='flag'
|
|
|
@@ -105,7 +133,7 @@ export default {
|
|
105
|
133
|
return {
|
|
106
|
134
|
activeName: "NewGrain",
|
|
107
|
135
|
userInfo: "",
|
|
108
|
|
- uid:'',
|
|
|
136
|
+ uid: "",
|
|
109
|
137
|
//库id
|
|
110
|
138
|
depotId: "",
|
|
111
|
139
|
// 仓房id
|
|
|
@@ -113,12 +141,12 @@ export default {
|
|
113
|
141
|
// 最新粮情数据
|
|
114
|
142
|
abnormalItems: [],
|
|
115
|
143
|
data: [],
|
|
116
|
|
- sortData:[],
|
|
|
144
|
+ sortData: [],
|
|
117
|
145
|
data2: {},
|
|
118
|
146
|
// back:'',
|
|
119
|
147
|
//待办跳转过来改变其他的选项的新增按钮不能点击
|
|
120
|
148
|
flag: false,
|
|
121
|
|
- /* newGrainData: [
|
|
|
149
|
+ /* newGrainData: [
|
|
122
|
150
|
{
|
|
123
|
151
|
checkPerson: "保管员每周检查粮情",
|
|
124
|
152
|
checkTime: "",
|
|
|
@@ -185,7 +213,7 @@ export default {
|
|
185
|
213
|
this.data2 = this.$route.query
|
|
186
|
214
|
// console.log(this.houseId,'本页面仓房号')
|
|
187
|
215
|
|
|
188
|
|
- if(Object.keys(this.data2).length !== 0){
|
|
|
216
|
+ if (Object.keys(this.data2).length !== 0) {
|
|
189
|
217
|
//路由跳转改变默认的仓房号
|
|
190
|
218
|
// this.flag =true
|
|
191
|
219
|
this.$store.state.houseId = this.data2.houseId
|
|
|
@@ -196,7 +224,6 @@ export default {
|
|
196
|
224
|
}else {
|
|
197
|
225
|
this.flag = false
|
|
198
|
226
|
} */
|
|
199
|
|
-
|
|
200
|
227
|
}
|
|
201
|
228
|
// this.id = this.$route.query.id
|
|
202
|
229
|
|
|
|
@@ -237,7 +264,7 @@ export default {
|
|
237
|
264
|
}
|
|
238
|
265
|
getNewGrainInfo(data)
|
|
239
|
266
|
.then(res => {
|
|
240
|
|
- console.log(res.data,'res000')
|
|
|
267
|
+ console.log(res.data, "res000")
|
|
241
|
268
|
this.data = res.data
|
|
242
|
269
|
this.sort()
|
|
243
|
270
|
})
|
|
|
@@ -246,31 +273,31 @@ export default {
|
|
246
|
273
|
})
|
|
247
|
274
|
},
|
|
248
|
275
|
//按照角色设置 默认排序
|
|
249
|
|
- sort(){
|
|
|
276
|
+ sort() {
|
|
250
|
277
|
var sortdata = this.data
|
|
251
|
278
|
// 如果sortData是空的,使用splice进行排序,不准确
|
|
252
|
|
- this.sortData = [0,0,0,0]
|
|
253
|
|
- if(sortdata.length !==0){
|
|
254
|
|
- for(let i=0;i<sortdata.length;i++){
|
|
255
|
|
- if(sortdata[i].checkPerson =='总经理每季检查粮情'){
|
|
256
|
|
- console.log(sortdata[i],'总经理 ')
|
|
257
|
|
- this.sortData.splice(0,1,sortdata[i])
|
|
|
279
|
+ this.sortData = [0, 0, 0, 0]
|
|
|
280
|
+ if (sortdata.length !== 0) {
|
|
|
281
|
+ for (let i = 0; i < sortdata.length; i++) {
|
|
|
282
|
+ if (sortdata[i].checkPerson == "总经理每季检查粮情") {
|
|
|
283
|
+ console.log(sortdata[i], "总经理 ")
|
|
|
284
|
+ this.sortData.splice(0, 1, sortdata[i])
|
|
258
|
285
|
}
|
|
259
|
|
- if(sortdata[i].checkPerson =='分管副总每月检查粮情'){
|
|
260
|
|
- console.log(this.data[i],'分管副总')
|
|
261
|
|
- this.sortData.splice(1,1,sortdata[i])
|
|
|
286
|
+ if (sortdata[i].checkPerson == "分管副总每月检查粮情") {
|
|
|
287
|
+ console.log(this.data[i], "分管副总")
|
|
|
288
|
+ this.sortData.splice(1, 1, sortdata[i])
|
|
262
|
289
|
}
|
|
263
|
|
- if(sortdata[i].checkPerson ==='主管科长每2周检查粮情'){
|
|
264
|
|
- console.log(this.data[i],'主管科长')
|
|
265
|
|
- this.sortData.splice(2,1,sortdata[i])
|
|
|
290
|
+ if (sortdata[i].checkPerson === "主管科长每2周检查粮情") {
|
|
|
291
|
+ console.log(this.data[i], "主管科长")
|
|
|
292
|
+ this.sortData.splice(2, 1, sortdata[i])
|
|
266
|
293
|
}
|
|
267
|
|
- if(sortdata[i].checkPerson =='保管员每周检查粮情'){
|
|
268
|
|
- console.log(this.data[i],'保管员')
|
|
269
|
|
- this.sortData.splice(3,1,sortdata[i])
|
|
|
294
|
+ if (sortdata[i].checkPerson == "保管员每周检查粮情") {
|
|
|
295
|
+ console.log(this.data[i], "保管员")
|
|
|
296
|
+ this.sortData.splice(3, 1, sortdata[i])
|
|
270
|
297
|
}
|
|
271
|
298
|
}
|
|
272
|
299
|
}
|
|
273
|
|
- console.log(this.sortData,'this.sortData.....')
|
|
|
300
|
+ console.log(this.sortData, "this.sortData.....")
|
|
274
|
301
|
},
|
|
275
|
302
|
// 状态改成图标
|
|
276
|
303
|
formatterColumn(row, column) {
|
|
|
@@ -300,7 +327,7 @@ export default {
|
|
300
|
327
|
]), */
|
|
301
|
328
|
center: true,
|
|
302
|
329
|
showCancelButton: true,
|
|
303
|
|
- confirmButtonClass:'el-button--success is-plain',
|
|
|
330
|
+ confirmButtonClass: "el-button--success is-plain",
|
|
304
|
331
|
confirmButtonText: "确定",
|
|
305
|
332
|
cancelButtonText: "取消",
|
|
306
|
333
|
beforeClose: (action, instance, done) => {
|
|
|
@@ -324,26 +351,30 @@ export default {
|
|
324
|
351
|
addInfo(val)
|
|
325
|
352
|
.then(res => {
|
|
326
|
353
|
if (res.code == 200) {
|
|
327
|
|
- console.log(this.houseId,'this.houseId')
|
|
328
|
|
- console.log(this.data2.houseId,'this.data2.houseId')
|
|
329
|
|
- let auditState =4 //4 是已完成
|
|
330
|
|
- console.log(this.data2.houseId,'this.data2.houseId')
|
|
|
354
|
+ console.log(this.houseId, "this.houseId")
|
|
|
355
|
+ console.log(this.data2.houseId, "this.data2.houseId")
|
|
|
356
|
+ let auditState = 4 //4 是已完成
|
|
|
357
|
+ console.log(this.data2.houseId, "this.data2.houseId")
|
|
331
|
358
|
//判断是否切换仓房,或者仓房发生改变
|
|
332
|
|
- if(this.data2.houseId == this.houseId){
|
|
333
|
|
- haveDone(this.data2.id,auditState).then(res =>{
|
|
334
|
|
- // console.log(res,'res.......')
|
|
335
|
|
- }).catch(err =>{
|
|
336
|
|
- console.log(err)
|
|
337
|
|
- })
|
|
338
|
|
- }else {
|
|
|
359
|
+ if (this.data2.houseId == this.houseId) {
|
|
|
360
|
+ haveDone(this.data2.id, auditState)
|
|
|
361
|
+ .then(res => {
|
|
|
362
|
+ // console.log(res,'res.......')
|
|
|
363
|
+ })
|
|
|
364
|
+ .catch(err => {
|
|
|
365
|
+ console.log(err)
|
|
|
366
|
+ })
|
|
|
367
|
+ } else {
|
|
339
|
368
|
let userId = this.uid
|
|
340
|
369
|
let type = this.data2.type
|
|
341
|
370
|
|
|
342
|
|
- haveDone1(userId,type,this.depotId,this.houseId,auditState).then(res =>{
|
|
343
|
|
- console.log(res,'仓房改变时调用此接口')
|
|
344
|
|
- }).catch(err =>{
|
|
345
|
|
- console.log(err,'01.')
|
|
346
|
|
- })
|
|
|
371
|
+ haveDone1(userId, type, this.depotId, this.houseId, auditState)
|
|
|
372
|
+ .then(res => {
|
|
|
373
|
+ console.log(res, "仓房改变时调用此接口")
|
|
|
374
|
+ })
|
|
|
375
|
+ .catch(err => {
|
|
|
376
|
+ console.log(err, "01.")
|
|
|
377
|
+ })
|
|
347
|
378
|
}
|
|
348
|
379
|
console.log(res, "新增成功")
|
|
349
|
380
|
}
|
|
|
@@ -371,7 +402,7 @@ export default {
|
|
371
|
402
|
// console.log(this.data2,' back: this.data2')
|
|
372
|
403
|
this.$router.push({
|
|
373
|
404
|
path: "/grainCheck/addNewGrain",
|
|
374
|
|
- query: { type: type, pid: row.id, data: row},
|
|
|
405
|
+ query: { type: type, pid: row.id, data: row }
|
|
375
|
406
|
})
|
|
376
|
407
|
} else {
|
|
377
|
408
|
console.log("科长,副总,总经理")
|
|
|
@@ -386,19 +417,23 @@ export default {
|
|
386
|
417
|
if (row.checkPerson == "保管员每周检查粮情") {
|
|
387
|
418
|
// console.log(this.data2.workName,'this.data2.workName')
|
|
388
|
419
|
// console.log(row.checkPerson,'row.checkPerson')
|
|
389
|
|
- if (this.data2.workName=='保管员每周粮情检查') {
|
|
|
420
|
+ if (this.data2.workName == "保管员每周粮情检查") {
|
|
390
|
421
|
//保管员待办
|
|
391
|
422
|
row.checkTime = getDateTimeNow()
|
|
392
|
423
|
this.$router.push({
|
|
393
|
424
|
path: "/grainCheck/addNewGrain",
|
|
394
|
|
- query: { type: type, pid: row.id, data: row, daibanObj: this.data2 }
|
|
395
|
|
-
|
|
|
425
|
+ query: {
|
|
|
426
|
+ type: type,
|
|
|
427
|
+ pid: row.id,
|
|
|
428
|
+ data: row,
|
|
|
429
|
+ daibanObj: this.data2
|
|
|
430
|
+ }
|
|
396
|
431
|
})
|
|
397
|
432
|
}
|
|
398
|
433
|
// console.log('保管员')
|
|
399
|
434
|
/* console.log(row, "row....")
|
|
400
|
435
|
console.log(this.data, "data111") */
|
|
401
|
|
- /* row.checkTime = getDateTimeNow()
|
|
|
436
|
+ /* row.checkTime = getDateTimeNow()
|
|
402
|
437
|
// console.log(row.checkTime,'time')
|
|
403
|
438
|
this.$router.push({
|
|
404
|
439
|
path: "/grainCheck/addNewGrain",
|
|
|
@@ -446,20 +481,44 @@ export default {
|
|
446
|
481
|
.yellow {
|
|
447
|
482
|
// width: 100px;
|
|
448
|
483
|
display: block;
|
|
449
|
|
- height:25px;
|
|
450
|
|
- background-color:#E3A512;
|
|
|
484
|
+ height: 25px;
|
|
|
485
|
+ background-color: #e3a512;
|
|
451
|
486
|
color: azure;
|
|
452
|
|
- font-size:13px;
|
|
|
487
|
+ font-size: 13px;
|
|
453
|
488
|
// text-align: center;
|
|
454
|
489
|
}
|
|
455
|
|
-.green{
|
|
|
490
|
+.green {
|
|
456
|
491
|
display: block;
|
|
457
|
492
|
// width: 80%;
|
|
458
|
493
|
height: 25px;
|
|
459
|
|
- background-color: #037D41;
|
|
|
494
|
+ background-color: #037d41;
|
|
460
|
495
|
color: #fff;
|
|
461
|
|
- border-radius:2px;
|
|
462
|
|
- font-size:13px;
|
|
463
|
|
-
|
|
|
496
|
+ border-radius: 2px;
|
|
|
497
|
+ font-size: 13px;
|
|
|
498
|
+}
|
|
|
499
|
+.colorspano {
|
|
|
500
|
+ width: 140px;
|
|
|
501
|
+ height: 30px;
|
|
|
502
|
+ background-color: #199856;
|
|
|
503
|
+ display: inline-block;
|
|
|
504
|
+ border-radius: 5px;
|
|
|
505
|
+ color:#FFF;
|
|
|
506
|
+ line-height: 30px;
|
|
|
507
|
+}
|
|
|
508
|
+.colorspant {
|
|
|
509
|
+ width: 140px;
|
|
|
510
|
+ height: 30px;
|
|
|
511
|
+ background-color: #ffff00;
|
|
|
512
|
+ display: inline-block;
|
|
|
513
|
+ border-radius: 5px;
|
|
|
514
|
+ color:#FFF;
|
|
|
515
|
+ line-height: 30px;
|
|
|
516
|
+}
|
|
|
517
|
+.colorspanr {
|
|
|
518
|
+ width: 140px;
|
|
|
519
|
+ height: 30px;
|
|
|
520
|
+ background-color: #ff9933;
|
|
|
521
|
+ display: inline-block;
|
|
|
522
|
+ border-radius: 5px;
|
|
464
|
523
|
}
|
|
465
|
524
|
</style>
|