|
@@ -1,7 +1,7 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div>
|
3
|
3
|
<el-row class="row">
|
4
|
|
- <el-col :span="4">
|
|
4
|
+ <el-col :span="5">
|
5
|
5
|
<span class="machineClass">机号:</span>
|
6
|
6
|
<el-select style="width:100px" v-model="forms.bed">
|
7
|
7
|
<el-option
|
|
@@ -12,7 +12,7 @@
|
12
|
12
|
></el-option>
|
13
|
13
|
</el-select>
|
14
|
14
|
</el-col>
|
15
|
|
- <el-col :span="11">
|
|
15
|
+ <el-col :span="12">
|
16
|
16
|
<span class="machineClass">日期查询:</span>
|
17
|
17
|
<el-date-picker
|
18
|
18
|
v-model="forms.start_time"
|
|
@@ -22,8 +22,7 @@
|
22
|
22
|
format="yyyy-MM-dd"
|
23
|
23
|
value-format="yyyy-MM-dd"
|
24
|
24
|
style="width:150px"
|
25
|
|
- ></el-date-picker
|
26
|
|
- >-
|
|
25
|
+ ></el-date-picker>-
|
27
|
26
|
<el-date-picker
|
28
|
27
|
v-model="forms.end_time"
|
29
|
28
|
prefix-icon="none"
|
|
@@ -38,13 +37,11 @@
|
38
|
37
|
<el-button @click="queryRepair()">查询</el-button>
|
39
|
38
|
</el-col>
|
40
|
39
|
</el-row>
|
41
|
|
- <el-row>
|
42
|
|
- <el-col :span="2">
|
43
|
|
- <el-checkbox v-model="checkAllStatus" @change="changeCheck"
|
44
|
|
- >全选</el-checkbox
|
45
|
|
- >
|
|
40
|
+ <el-row style="display: flex;align-items: center;">
|
|
41
|
+ <el-col :span="2">
|
|
42
|
+ <el-checkbox v-model="checkAllStatus" @change="changeCheck">全选</el-checkbox>
|
46
|
43
|
</el-col>
|
47
|
|
- <el-col :span="2" class="a">
|
|
44
|
+ <el-col :span="2">
|
48
|
45
|
<el-button size="small" @click="BatchDelete">批量删除</el-button>
|
49
|
46
|
</el-col>
|
50
|
47
|
</el-row>
|
|
@@ -52,121 +49,80 @@
|
52
|
49
|
<el-table
|
53
|
50
|
ref="multipleTable"
|
54
|
51
|
@selection-change="handleSelectionChange"
|
55
|
|
- :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
|
|
52
|
+ :row-style="{ color: '#303133' }"
|
|
53
|
+ :header-cell-style="{
|
|
54
|
+ backgroundColor: 'rgb(245, 247, 250)',
|
|
55
|
+ color: '#606266'
|
|
56
|
+ }"
|
56
|
57
|
:data="tableData"
|
57
|
58
|
border
|
58
|
59
|
fit
|
59
|
60
|
highlight-current-row
|
60
|
61
|
style="width: 100%;margin-top: 10px;"
|
61
|
62
|
>
|
62
|
|
- <el-table-column
|
63
|
|
- align="center"
|
64
|
|
- type="selection"
|
65
|
|
- width="55"
|
66
|
|
- ></el-table-column>
|
|
63
|
+ <el-table-column align="center" type="selection" width="55"></el-table-column>
|
67
|
64
|
<el-table-column prop="date" label="机号" width="80" align="center">
|
68
|
65
|
<template slot-scope="scope">{{ scope.row.bed_number }}</template>
|
69
|
66
|
</el-table-column>
|
70
|
|
- <el-table-column
|
71
|
|
- prop="name"
|
72
|
|
- label="保修时间"
|
73
|
|
- width="100"
|
74
|
|
- align="center"
|
75
|
|
- >
|
76
|
|
- <template slot-scope="scope">{{
|
|
67
|
+ <el-table-column prop="name" label="保修时间" width="100" align="center">
|
|
68
|
+ <template slot-scope="scope">
|
|
69
|
+ {{
|
77
|
70
|
getTime(scope.row.guarantee_date)
|
78
|
|
- }}</template>
|
|
71
|
+ }}
|
|
72
|
+ </template>
|
79
|
73
|
</el-table-column>
|
80
|
|
- <el-table-column
|
81
|
|
- prop="address"
|
82
|
|
- label="出发时间"
|
83
|
|
- width="100"
|
84
|
|
- align="center"
|
85
|
|
- >
|
86
|
|
- <template slot-scope="scope">{{
|
|
74
|
+ <el-table-column prop="address" label="出发时间" width="100" align="center">
|
|
75
|
+ <template slot-scope="scope">
|
|
76
|
+ {{
|
87
|
77
|
getTimes(scope.row.start_time)
|
88
|
|
- }}</template>
|
|
78
|
+ }}
|
|
79
|
+ </template>
|
89
|
80
|
</el-table-column>
|
90
|
|
- <el-table-column
|
91
|
|
- prop="address"
|
92
|
|
- label="到达时间"
|
93
|
|
- width="100"
|
94
|
|
- align="center"
|
95
|
|
- >
|
96
|
|
- <template slot-scope="scope">{{
|
|
81
|
+ <el-table-column prop="address" label="到达时间" width="100" align="center">
|
|
82
|
+ <template slot-scope="scope">
|
|
83
|
+ {{
|
97
|
84
|
getTimes(scope.row.arrive_time)
|
98
|
|
- }}</template>
|
|
85
|
+ }}
|
|
86
|
+ </template>
|
99
|
87
|
</el-table-column>
|
100
|
|
- <el-table-column
|
101
|
|
- prop="address"
|
102
|
|
- label="完成时间"
|
103
|
|
- width="100"
|
104
|
|
- align="center"
|
105
|
|
- >
|
106
|
|
- <template slot-scope="scope">{{
|
|
88
|
+ <el-table-column prop="address" label="完成时间" width="100" align="center">
|
|
89
|
+ <template slot-scope="scope">
|
|
90
|
+ {{
|
107
|
91
|
getTimes(scope.row.finish_time)
|
108
|
|
- }}</template>
|
|
92
|
+ }}
|
|
93
|
+ </template>
|
109
|
94
|
</el-table-column>
|
110
|
|
- <el-table-column
|
111
|
|
- prop="address"
|
112
|
|
- label="总路程(公里)"
|
113
|
|
- width="110"
|
114
|
|
- align="center"
|
115
|
|
- >
|
|
95
|
+ <el-table-column prop="address" label="总路程(公里)" width="110" align="center">
|
116
|
96
|
<template slot-scope="scope">{{ scope.row.total_distance }}</template>
|
117
|
97
|
</el-table-column>
|
118
|
|
- <el-table-column
|
119
|
|
- prop="address"
|
120
|
|
- label="故障发生阶段"
|
121
|
|
- width="110"
|
122
|
|
- align="center"
|
123
|
|
- >
|
|
98
|
+ <el-table-column prop="address" label="故障发生阶段" width="110" align="center">
|
124
|
99
|
<template slot-scope="scope">{{ scope.row.failure_stage }}</template>
|
125
|
100
|
</el-table-column>
|
126
|
|
- <el-table-column
|
127
|
|
- prop="address"
|
128
|
|
- label="故障提示信息及代码"
|
129
|
|
- width="120"
|
130
|
|
- align="center"
|
131
|
|
- >
|
132
|
|
- <template slot-scope="scope">{{
|
|
101
|
+ <el-table-column prop="address" label="故障提示信息及代码" width="120" align="center">
|
|
102
|
+ <template slot-scope="scope">
|
|
103
|
+ {{
|
133
|
104
|
scope.row.code_information
|
134
|
|
- }}</template>
|
|
105
|
+ }}
|
|
106
|
+ </template>
|
135
|
107
|
</el-table-column>
|
136
|
|
- <el-table-column
|
137
|
|
- prop="address"
|
138
|
|
- label="故障描述"
|
139
|
|
- width="100"
|
140
|
|
- align="center"
|
141
|
|
- >
|
142
|
|
- <template slot-scope="scope">{{
|
|
108
|
+ <el-table-column prop="address" label="故障描述" width="100" align="center">
|
|
109
|
+ <template slot-scope="scope">
|
|
110
|
+ {{
|
143
|
111
|
scope.row.fault_description
|
144
|
|
- }}</template>
|
|
112
|
+ }}
|
|
113
|
+ </template>
|
145
|
114
|
</el-table-column>
|
146
|
|
- <el-table-column
|
147
|
|
- prop="address"
|
148
|
|
- label="原因分析"
|
149
|
|
- width="100"
|
150
|
|
- align="center"
|
151
|
|
- >
|
|
115
|
+ <el-table-column prop="address" label="原因分析" width="100" align="center">
|
152
|
116
|
<template slot-scope="scope">{{ scope.row.cause_analysis }}</template>
|
153
|
117
|
</el-table-column>
|
154
|
|
- <el-table-column
|
155
|
|
- prop="address"
|
156
|
|
- label="处理过程"
|
157
|
|
- width="100"
|
158
|
|
- align="center"
|
159
|
|
- >
|
160
|
|
- <template slot-scope="scope">{{
|
|
118
|
+ <el-table-column prop="address" label="处理过程" width="100" align="center">
|
|
119
|
+ <template slot-scope="scope">
|
|
120
|
+ {{
|
161
|
121
|
scope.row.treatment_process
|
162
|
|
- }}</template>
|
|
122
|
+ }}
|
|
123
|
+ </template>
|
163
|
124
|
</el-table-column>
|
164
|
|
- <el-table-column
|
165
|
|
- prop="address"
|
166
|
|
- label="故障是否排除"
|
167
|
|
- width="110"
|
168
|
|
- align="center"
|
169
|
|
- >
|
|
125
|
+ <el-table-column prop="address" label="故障是否排除" width="110" align="center">
|
170
|
126
|
<template slot-scope="scope">{{ scope.row.exclude }}</template>
|
171
|
127
|
</el-table-column>
|
172
|
128
|
<el-table-column prop="address" label="原因" width="80" align="center">
|
|
@@ -174,12 +130,7 @@
|
174
|
130
|
</el-table-column>
|
175
|
131
|
<el-table-column label="操作" align="center" min-width="150px">
|
176
|
132
|
<template slot-scope="scope">
|
177
|
|
- <el-tooltip
|
178
|
|
- class="item"
|
179
|
|
- effect="dark"
|
180
|
|
- content="编辑"
|
181
|
|
- placement="top"
|
182
|
|
- >
|
|
133
|
+ <el-tooltip class="item" effect="dark" content="编辑" placement="top">
|
183
|
134
|
<el-button
|
184
|
135
|
size="mini"
|
185
|
136
|
type="primary"
|
|
@@ -190,15 +141,10 @@
|
190
|
141
|
></el-button>
|
191
|
142
|
</el-tooltip>
|
192
|
143
|
|
193
|
|
- <el-tooltip
|
194
|
|
- class="item"
|
195
|
|
- effect="dark"
|
196
|
|
- content="删除"
|
197
|
|
- placement="top"
|
198
|
|
- >
|
|
144
|
+ <el-tooltip class="item" effect="dark" content="删除" placement="top">
|
199
|
145
|
<el-button
|
200
|
146
|
size="mini"
|
201
|
|
- type="primary"
|
|
147
|
+ type="danger"
|
202
|
148
|
icon="el-icon-delete"
|
203
|
149
|
@click="DeleteRepairs(scope.row.id, scope.$index)"
|
204
|
150
|
></el-button>
|
|
@@ -219,12 +165,7 @@
|
219
|
165
|
</el-row>
|
220
|
166
|
|
221
|
167
|
<!-- 编辑维修记录 -->
|
222
|
|
- <el-dialog
|
223
|
|
- title="编辑维修记录"
|
224
|
|
- :visible.sync="dialogVisible"
|
225
|
|
- width="65%"
|
226
|
|
- center
|
227
|
|
- >
|
|
168
|
+ <el-dialog title="编辑维修记录" :visible.sync="dialogVisible" width="65%" center>
|
228
|
169
|
<el-form :model="guaForm" ref="guaForm" :rules="repirRules">
|
229
|
170
|
<el-row>
|
230
|
171
|
<el-col :span="8">
|
|
@@ -280,10 +221,7 @@
|
280
|
221
|
</el-col>
|
281
|
222
|
<el-col :span="8">
|
282
|
223
|
<el-form-item label="总路程:(公里)">
|
283
|
|
- <el-input
|
284
|
|
- style="width:200px"
|
285
|
|
- v-model="guaForm.total_distance"
|
286
|
|
- ></el-input>
|
|
224
|
+ <el-input style="width:200px" v-model="guaForm.total_distance"></el-input>
|
287
|
225
|
</el-form-item>
|
288
|
226
|
</el-col>
|
289
|
227
|
</el-row>
|
|
@@ -296,8 +234,7 @@
|
296
|
234
|
:value="gender.id"
|
297
|
235
|
v-for="(gender, index) in faultPhase"
|
298
|
236
|
:key="index"
|
299
|
|
- >{{ gender.name }}</el-radio
|
300
|
|
- >
|
|
237
|
+ >{{ gender.name }}</el-radio>
|
301
|
238
|
</el-radio-group>
|
302
|
239
|
</el-form-item>
|
303
|
240
|
</el-col>
|
|
@@ -366,9 +303,9 @@
|
366
|
303
|
</el-upload>
|
367
|
304
|
</el-form-item>
|
368
|
305
|
<a class="el-upload-list__item-name">
|
369
|
|
- <i
|
370
|
|
- ><a @click="toLink()">{{ filename }}</a></i
|
371
|
|
- >
|
|
306
|
+ <i>
|
|
307
|
+ <a @click="toLink()">{{ filename }}</a>
|
|
308
|
+ </i>
|
372
|
309
|
</a>
|
373
|
310
|
</el-col>
|
374
|
311
|
</el-row>
|
|
@@ -381,8 +318,7 @@
|
381
|
318
|
:value="gender.id"
|
382
|
319
|
v-for="(gender, index) in breakDown"
|
383
|
320
|
:key="index"
|
384
|
|
- >{{ gender.name }}</el-radio
|
385
|
|
- >
|
|
321
|
+ >{{ gender.name }}</el-radio>
|
386
|
322
|
</el-radio-group>
|
387
|
323
|
</el-form-item>
|
388
|
324
|
</el-col>
|
|
@@ -403,9 +339,7 @@
|
403
|
339
|
</el-form>
|
404
|
340
|
<span slot="footer" class="dialog-footer">
|
405
|
341
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
406
|
|
- <el-button type="primary" @click="UpdateRepair('guaForm')"
|
407
|
|
- >保存</el-button
|
408
|
|
- >
|
|
342
|
+ <el-button type="primary" @click="UpdateRepair('guaForm')">保存</el-button>
|
409
|
343
|
</span>
|
410
|
344
|
</el-dialog>
|
411
|
345
|
</div>
|
|
@@ -420,141 +354,141 @@ import {
|
420
|
354
|
DeleteRepair,
|
421
|
355
|
queryRepair,
|
422
|
356
|
DeleteRepairs
|
423
|
|
-} from '@/api/manage'
|
424
|
|
-import { uParseTime } from '@/utils/tools'
|
425
|
|
-import { getFileExtension } from '@/utils/tools'
|
|
357
|
+} from "@/api/manage";
|
|
358
|
+import { uParseTime } from "@/utils/tools";
|
|
359
|
+import { getFileExtension } from "@/utils/tools";
|
426
|
360
|
export default {
|
427
|
|
- name: 'RepairForm',
|
|
361
|
+ name: "RepairForm",
|
428
|
362
|
data() {
|
429
|
363
|
return {
|
430
|
364
|
dialogVisible: false,
|
431
|
365
|
selectCulture: [],
|
432
|
366
|
forms: {
|
433
|
|
- bed: '',
|
|
367
|
+ bed: "",
|
434
|
368
|
sename: 1,
|
435
|
|
- start_time: '',
|
436
|
|
- end_time: ''
|
|
369
|
+ start_time: "",
|
|
370
|
+ end_time: ""
|
437
|
371
|
},
|
438
|
372
|
guaForm: {
|
439
|
|
- id: '',
|
440
|
|
- guarantee_date: '',
|
441
|
|
- start_time: '',
|
442
|
|
- arrive_time: '',
|
443
|
|
- finish_time: '',
|
444
|
|
- total_distance: '',
|
445
|
|
- failure_stage: '',
|
446
|
|
- fault_description: '',
|
447
|
|
- cause_analysis: '',
|
448
|
|
- treatment_process: '',
|
449
|
|
- images: '',
|
450
|
|
- exclude: '',
|
451
|
|
- reason: '',
|
452
|
|
- code_information: '',
|
453
|
|
- image_name: ''
|
|
373
|
+ id: "",
|
|
374
|
+ guarantee_date: "",
|
|
375
|
+ start_time: "",
|
|
376
|
+ arrive_time: "",
|
|
377
|
+ finish_time: "",
|
|
378
|
+ total_distance: "",
|
|
379
|
+ failure_stage: "",
|
|
380
|
+ fault_description: "",
|
|
381
|
+ cause_analysis: "",
|
|
382
|
+ treatment_process: "",
|
|
383
|
+ images: "",
|
|
384
|
+ exclude: "",
|
|
385
|
+ reason: "",
|
|
386
|
+ code_information: "",
|
|
387
|
+ image_name: ""
|
454
|
388
|
},
|
455
|
389
|
isIndeterminate: false,
|
456
|
390
|
checkAllStatus: false,
|
457
|
391
|
bedNumber: [],
|
458
|
392
|
tableData: [],
|
459
|
|
- qiniuDomain: 'https://images.shengws.com/',
|
460
|
|
- uploadFileData: { token: '', key: '' },
|
|
393
|
+ qiniuDomain: "https://images.shengws.com/",
|
|
394
|
+ uploadFileData: { token: "", key: "" },
|
461
|
395
|
faultPhase: [
|
462
|
|
- { id: 1, name: '开机启动' },
|
463
|
|
- { id: 2, name: '自检' },
|
464
|
|
- { id: 3, name: '准备' },
|
465
|
|
- { id: 4, name: '治疗' },
|
466
|
|
- { id: 5, name: '消毒' }
|
|
396
|
+ { id: 1, name: "开机启动" },
|
|
397
|
+ { id: 2, name: "自检" },
|
|
398
|
+ { id: 3, name: "准备" },
|
|
399
|
+ { id: 4, name: "治疗" },
|
|
400
|
+ { id: 5, name: "消毒" }
|
467
|
401
|
],
|
468
|
402
|
breakDown: [
|
469
|
|
- { id: 1, name: '是' },
|
470
|
|
- { id: 2, name: '待观察' },
|
471
|
|
- { id: 3, name: '未解决' }
|
|
403
|
+ { id: 1, name: "是" },
|
|
404
|
+ { id: 2, name: "待观察" },
|
|
405
|
+ { id: 3, name: "未解决" }
|
472
|
406
|
],
|
473
|
407
|
repirRules: {
|
474
|
|
- guarantee_date: [{ required: true, message: '请填写保修日期' }],
|
475
|
|
- fault_description: [{ required: true, message: '请填写故障描述' }]
|
|
408
|
+ guarantee_date: [{ required: true, message: "请填写保修日期" }],
|
|
409
|
+ fault_description: [{ required: true, message: "请填写故障描述" }]
|
476
|
410
|
},
|
477
|
|
- filename: '',
|
|
411
|
+ filename: "",
|
478
|
412
|
limit: 10,
|
479
|
413
|
page: 1,
|
480
|
414
|
total: 0,
|
481
|
|
- filename: ''
|
482
|
|
- }
|
|
415
|
+ filename: ""
|
|
416
|
+ };
|
483
|
417
|
},
|
484
|
418
|
methods: {
|
485
|
419
|
changeCheck() {
|
486
|
|
- this.$refs.multipleTable.clearSelection()
|
|
420
|
+ this.$refs.multipleTable.clearSelection();
|
487
|
421
|
if (this.checkAllStatus) {
|
488
|
|
- this.$refs.multipleTable.toggleAllSelection()
|
|
422
|
+ this.$refs.multipleTable.toggleAllSelection();
|
489
|
423
|
}
|
490
|
424
|
},
|
491
|
425
|
getAllSubregion() {
|
492
|
426
|
getAllSubregion().then(response => {
|
493
|
|
- var zones = response.data.data.zones
|
494
|
|
- var numbers = response.data.data.numbers
|
495
|
|
- var number = [{ id: 0, number: '全部' }]
|
|
427
|
+ var zones = response.data.data.zones;
|
|
428
|
+ var numbers = response.data.data.numbers;
|
|
429
|
+ var number = [{ id: 0, number: "全部" }];
|
496
|
430
|
for (let index = 0; index < numbers.length; index++) {
|
497
|
|
- const item = numbers[index]
|
498
|
|
- number.push({ id: item.id, number: item.number })
|
|
431
|
+ const item = numbers[index];
|
|
432
|
+ number.push({ id: item.id, number: item.number });
|
499
|
433
|
}
|
500
|
|
- this.bedNumber = number
|
501
|
|
- })
|
|
434
|
+ this.bedNumber = number;
|
|
435
|
+ });
|
502
|
436
|
},
|
503
|
437
|
handleSelectionChange(val) {
|
504
|
|
- this.selectCulture = val
|
|
438
|
+ this.selectCulture = val;
|
505
|
439
|
},
|
506
|
440
|
getAllRepair() {
|
507
|
441
|
getAllRepair(this.limit, this.page).then(response => {
|
508
|
442
|
if (response.data.state === 1) {
|
509
|
|
- var repair = response.data.data.repair
|
|
443
|
+ var repair = response.data.data.repair;
|
510
|
444
|
// console.log('repair是', repair)
|
511
|
445
|
// eslint-disable-next-line no-unused-vars
|
512
|
|
- var total = response.data.data.total
|
513
|
|
- this.total = total
|
|
446
|
+ var total = response.data.data.total;
|
|
447
|
+ this.total = total;
|
514
|
448
|
for (let index = 0; index < repair.length; index++) {
|
515
|
449
|
if (repair[index].failure_stage === 0) {
|
516
|
|
- repair[index].failure_stage = ''
|
|
450
|
+ repair[index].failure_stage = "";
|
517
|
451
|
}
|
518
|
452
|
|
519
|
453
|
if (repair[index].failure_stage === 1) {
|
520
|
|
- repair[index].failure_stage = '开机启动'
|
|
454
|
+ repair[index].failure_stage = "开机启动";
|
521
|
455
|
}
|
522
|
456
|
if (repair[index].failure_stage === 2) {
|
523
|
|
- repair[index].failure_stage = '自检'
|
|
457
|
+ repair[index].failure_stage = "自检";
|
524
|
458
|
}
|
525
|
459
|
if (repair[index].failure_stage === 3) {
|
526
|
|
- repair[index].failure_stage = '准备'
|
|
460
|
+ repair[index].failure_stage = "准备";
|
527
|
461
|
}
|
528
|
462
|
if (repair[index].failure_stage === 4) {
|
529
|
|
- repair[index].failure_stage = '治疗'
|
|
463
|
+ repair[index].failure_stage = "治疗";
|
530
|
464
|
}
|
531
|
465
|
if (repair[index].failure_stage === 5) {
|
532
|
|
- repair[index].failure_stage = '消毒'
|
|
466
|
+ repair[index].failure_stage = "消毒";
|
533
|
467
|
}
|
534
|
468
|
|
535
|
469
|
if (repair[index].exclude === 0) {
|
536
|
|
- repair[index].exclude = ''
|
|
470
|
+ repair[index].exclude = "";
|
537
|
471
|
}
|
538
|
472
|
|
539
|
473
|
if (repair[index].exclude === 1) {
|
540
|
|
- repair[index].exclude = '是'
|
|
474
|
+ repair[index].exclude = "是";
|
541
|
475
|
}
|
542
|
476
|
if (repair[index].exclude === 2) {
|
543
|
|
- repair[index].exclude = '待观察'
|
|
477
|
+ repair[index].exclude = "待观察";
|
544
|
478
|
}
|
545
|
479
|
if (repair[index].exclude === 3) {
|
546
|
|
- repair[index].exclude = '未解决'
|
|
480
|
+ repair[index].exclude = "未解决";
|
547
|
481
|
}
|
548
|
482
|
}
|
549
|
|
- this.tableData = repair
|
|
483
|
+ this.tableData = repair;
|
550
|
484
|
}
|
551
|
|
- })
|
|
485
|
+ });
|
552
|
486
|
},
|
553
|
487
|
getTime(time) {
|
554
|
|
- return uParseTime(time, '{y}-{m}-{d}')
|
|
488
|
+ return uParseTime(time, "{y}-{m}-{d}");
|
555
|
489
|
},
|
556
|
490
|
getTimes(time) {
|
557
|
|
- return uParseTime(time, '{y}-{m}-{d} {h}:{i}')
|
|
491
|
+ return uParseTime(time, "{y}-{m}-{d} {h}:{i}");
|
558
|
492
|
},
|
559
|
493
|
handleExceed(file) {
|
560
|
494
|
// console.log(file)
|
|
@@ -563,62 +497,62 @@ export default {
|
563
|
497
|
// console.log(file)
|
564
|
498
|
},
|
565
|
499
|
EditRepair(id) {
|
566
|
|
- this.dialogVisible = true
|
|
500
|
+ this.dialogVisible = true;
|
567
|
501
|
EditRepair(id).then(response => {
|
568
|
502
|
if (response.data.state === 1) {
|
569
|
|
- var repair = response.data.data.repair
|
570
|
|
- console.log('repair', repair)
|
|
503
|
+ var repair = response.data.data.repair;
|
|
504
|
+ console.log("repair", repair);
|
571
|
505
|
this.guaForm.guarantee_date = uParseTime(
|
572
|
506
|
repair.guarantee_date,
|
573
|
|
- '{y}-{m}-{d}'
|
574
|
|
- )
|
|
507
|
+ "{y}-{m}-{d}"
|
|
508
|
+ );
|
575
|
509
|
this.guaForm.start_time = uParseTime(
|
576
|
510
|
repair.start_time,
|
577
|
|
- '{y}-{m}-{d} {h}:{i}'
|
578
|
|
- )
|
|
511
|
+ "{y}-{m}-{d} {h}:{i}"
|
|
512
|
+ );
|
579
|
513
|
this.guaForm.arrive_time = uParseTime(
|
580
|
514
|
repair.arrive_time,
|
581
|
|
- '{y}-{m}-{d} {h}:{i}'
|
582
|
|
- )
|
|
515
|
+ "{y}-{m}-{d} {h}:{i}"
|
|
516
|
+ );
|
583
|
517
|
this.guaForm.finish_time = uParseTime(
|
584
|
518
|
repair.finish_time,
|
585
|
|
- '{y}-{m}-{d} {h}:{i}'
|
586
|
|
- )
|
587
|
|
- this.guaForm.total_distance = repair.total_distance
|
588
|
|
- this.guaForm.failure_stage = repair.failure_stage
|
589
|
|
- this.guaForm.fault_description = repair.fault_description
|
590
|
|
- this.guaForm.cause_analysis = repair.cause_analysis
|
591
|
|
- this.guaForm.treatment_process = repair.treatment_process
|
592
|
|
- this.guaForm.images = repair.images
|
593
|
|
- this.guaForm.exclude = repair.exclude
|
594
|
|
- this.guaForm.reason = repair.reason
|
595
|
|
- this.guaForm.code_information = repair.code_information
|
596
|
|
- this.guaForm.id = repair.id
|
597
|
|
- this.filename = repair.image_name
|
|
519
|
+ "{y}-{m}-{d} {h}:{i}"
|
|
520
|
+ );
|
|
521
|
+ this.guaForm.total_distance = repair.total_distance;
|
|
522
|
+ this.guaForm.failure_stage = repair.failure_stage;
|
|
523
|
+ this.guaForm.fault_description = repair.fault_description;
|
|
524
|
+ this.guaForm.cause_analysis = repair.cause_analysis;
|
|
525
|
+ this.guaForm.treatment_process = repair.treatment_process;
|
|
526
|
+ this.guaForm.images = repair.images;
|
|
527
|
+ this.guaForm.exclude = repair.exclude;
|
|
528
|
+ this.guaForm.reason = repair.reason;
|
|
529
|
+ this.guaForm.code_information = repair.code_information;
|
|
530
|
+ this.guaForm.id = repair.id;
|
|
531
|
+ this.filename = repair.image_name;
|
598
|
532
|
}
|
599
|
|
- })
|
|
533
|
+ });
|
600
|
534
|
},
|
601
|
535
|
handleSuccess(res, file, fileList) {
|
602
|
|
- this.guaForm.images = this.qiniuDomain + res.url
|
603
|
|
- console.log('图片上传', this.guaForm.images)
|
604
|
|
- this.$refs.upload.clearFiles()
|
605
|
|
- this.filename = file.name
|
606
|
|
- this.guaForm.image_name = file.name
|
|
536
|
+ this.guaForm.images = this.qiniuDomain + res.url;
|
|
537
|
+ console.log("图片上传", this.guaForm.images);
|
|
538
|
+ this.$refs.upload.clearFiles();
|
|
539
|
+ this.filename = file.name;
|
|
540
|
+ this.guaForm.image_name = file.name;
|
607
|
541
|
},
|
608
|
542
|
beforeUploadFile(file) {
|
609
|
|
- this.filename = file.name
|
610
|
|
- this.guaForm.image_name = file.name
|
611
|
|
- const isLt2M = file.size / 1024 / 1024 <= 2048
|
612
|
|
- console.log('filename', file)
|
|
543
|
+ this.filename = file.name;
|
|
544
|
+ this.guaForm.image_name = file.name;
|
|
545
|
+ const isLt2M = file.size / 1024 / 1024 <= 2048;
|
|
546
|
+ console.log("filename", file);
|
613
|
547
|
// console.log('视频大小', file.size / 1024 / 1024)
|
614
|
548
|
// console.log('isLt2M是什么', isLt2M)
|
615
|
549
|
|
616
|
550
|
if (!isLt2M) {
|
617
|
|
- this.$message.error('上传视频大小不能超过 2G!')
|
618
|
|
- return false
|
|
551
|
+ this.$message.error("上传视频大小不能超过 2G!");
|
|
552
|
+ return false;
|
619
|
553
|
}
|
620
|
|
- var date = new Date()
|
621
|
|
- var ext = getFileExtension(file.name)
|
|
554
|
+ var date = new Date();
|
|
555
|
+ var ext = getFileExtension(file.name);
|
622
|
556
|
var key =
|
623
|
557
|
date.getFullYear() +
|
624
|
558
|
(date.getMonth() + 1) +
|
|
@@ -626,104 +560,104 @@ export default {
|
626
|
560
|
date.getHours() +
|
627
|
561
|
date.getMinutes() +
|
628
|
562
|
date.getSeconds() +
|
629
|
|
- '_o_' +
|
|
563
|
+ "_o_" +
|
630
|
564
|
file.uid +
|
631
|
|
- '.' +
|
632
|
|
- ext
|
633
|
|
- const _self = this
|
|
565
|
+ "." +
|
|
566
|
+ ext;
|
|
567
|
+ const _self = this;
|
634
|
568
|
return new Promise((resolve, reject) => {
|
635
|
569
|
// eslint-disable-next-line no-undef
|
636
|
570
|
getToken()
|
637
|
571
|
.then(response => {
|
638
|
|
- const token = response.data.data.uptoken
|
639
|
|
- console.log('token2是什么?', token)
|
640
|
|
- _self._data.uploadFileData.token = token
|
641
|
|
- _self._data.uploadFileData.key = key
|
642
|
|
- resolve(true)
|
|
572
|
+ const token = response.data.data.uptoken;
|
|
573
|
+ console.log("token2是什么?", token);
|
|
574
|
+ _self._data.uploadFileData.token = token;
|
|
575
|
+ _self._data.uploadFileData.key = key;
|
|
576
|
+ resolve(true);
|
643
|
577
|
})
|
644
|
578
|
// eslint-disable-next-line handle-callback-err
|
645
|
579
|
.catch(err => {
|
646
|
|
- reject(false)
|
647
|
|
- })
|
648
|
|
- })
|
|
580
|
+ reject(false);
|
|
581
|
+ });
|
|
582
|
+ });
|
649
|
583
|
},
|
650
|
584
|
toLink() {
|
651
|
|
- window.location.href = this.guaForm.images
|
|
585
|
+ window.location.href = this.guaForm.images;
|
652
|
586
|
},
|
653
|
587
|
UpdateRepair(formName) {
|
654
|
588
|
this.$refs[formName].validate(valid => {
|
655
|
589
|
this.guaForm.start_time = uParseTime(
|
656
|
590
|
this.guaForm.start_time,
|
657
|
|
- '{y}-{m}-{d} {h}:{i}'
|
658
|
|
- )
|
|
591
|
+ "{y}-{m}-{d} {h}:{i}"
|
|
592
|
+ );
|
659
|
593
|
this.guaForm.arrive_time = uParseTime(
|
660
|
594
|
this.guaForm.arrive_time,
|
661
|
|
- '{y}-{m}-{d} {h}:{i}'
|
662
|
|
- )
|
|
595
|
+ "{y}-{m}-{d} {h}:{i}"
|
|
596
|
+ );
|
663
|
597
|
this.guaForm.finish_time = uParseTime(
|
664
|
598
|
this.guaForm.finish_time,
|
665
|
|
- '{y}-{m}-{d} {h}:{i}'
|
666
|
|
- )
|
|
599
|
+ "{y}-{m}-{d} {h}:{i}"
|
|
600
|
+ );
|
667
|
601
|
|
668
|
|
- if (this.guaForm.failure_stage === '') {
|
669
|
|
- this.guaForm.failure_stage = 0
|
|
602
|
+ if (this.guaForm.failure_stage === "") {
|
|
603
|
+ this.guaForm.failure_stage = 0;
|
670
|
604
|
}
|
671
|
605
|
|
672
|
|
- var failurestages = this.guaForm.failure_stage
|
673
|
|
- var falur = parseInt(failurestages)
|
674
|
|
- this.guaForm.failure_stage = falur
|
|
606
|
+ var failurestages = this.guaForm.failure_stage;
|
|
607
|
+ var falur = parseInt(failurestages);
|
|
608
|
+ this.guaForm.failure_stage = falur;
|
675
|
609
|
|
676
|
|
- if (this.guaForm.exclude === '') {
|
677
|
|
- this.guaForm.exclude = 0
|
|
610
|
+ if (this.guaForm.exclude === "") {
|
|
611
|
+ this.guaForm.exclude = 0;
|
678
|
612
|
}
|
679
|
|
- var excludes = this.guaForm.exclude
|
680
|
|
- var exclude = parseInt(excludes)
|
681
|
|
- this.guaForm.exclude = exclude
|
|
613
|
+ var excludes = this.guaForm.exclude;
|
|
614
|
+ var exclude = parseInt(excludes);
|
|
615
|
+ this.guaForm.exclude = exclude;
|
682
|
616
|
if (valid) {
|
683
|
617
|
UpdateRepair(this.guaForm).then(response => {
|
684
|
618
|
if (response.data.state === 1) {
|
685
|
|
- var repair = response.data.data.repair
|
686
|
|
- this.dialogVisible = false
|
687
|
|
- this.$message.success('修改成功')
|
|
619
|
+ var repair = response.data.data.repair;
|
|
620
|
+ this.dialogVisible = false;
|
|
621
|
+ this.$message.success("修改成功");
|
688
|
622
|
}
|
689
|
|
- })
|
|
623
|
+ });
|
690
|
624
|
}
|
691
|
|
- })
|
|
625
|
+ });
|
692
|
626
|
},
|
693
|
627
|
BatchDelete() {
|
694
|
628
|
if (this.selectCulture.length == 0) {
|
695
|
|
- this.$message.error('请选择要删除的信息')
|
696
|
|
- return false
|
|
629
|
+ this.$message.error("请选择要删除的信息");
|
|
630
|
+ return false;
|
697
|
631
|
}
|
698
|
632
|
this.$confirm(
|
699
|
|
- '确认要删除所选记录吗? <br>删除后,信息将无法恢复',
|
700
|
|
- '删除提示',
|
|
633
|
+ "确认要删除所选记录吗? <br>删除后,信息将无法恢复",
|
|
634
|
+ "删除提示",
|
701
|
635
|
{
|
702
|
636
|
dangerouslyUseHTMLString: true,
|
703
|
|
- confirmButtonText: '确定',
|
704
|
|
- cancelButtonText: '取消',
|
705
|
|
- type: 'warning'
|
|
637
|
+ confirmButtonText: "确定",
|
|
638
|
+ cancelButtonText: "取消",
|
|
639
|
+ type: "warning"
|
706
|
640
|
}
|
707
|
641
|
).then(() => {
|
708
|
|
- var ids = []
|
709
|
|
- var idMap = {}
|
|
642
|
+ var ids = [];
|
|
643
|
+ var idMap = {};
|
710
|
644
|
for (const index in this.selectCulture) {
|
711
|
|
- ids.push(this.selectCulture[index].id)
|
712
|
|
- idMap[this.selectCulture[index].id] = this.selectCulture[index].id
|
|
645
|
+ ids.push(this.selectCulture[index].id);
|
|
646
|
+ idMap[this.selectCulture[index].id] = this.selectCulture[index].id;
|
713
|
647
|
}
|
714
|
648
|
DeleteRepair({ ids: ids }).then(response => {
|
715
|
649
|
if (response.data.state === 1) {
|
716
|
|
- var msg = response.data.data.msg
|
717
|
|
- var planDataLength = this.tableData.length
|
|
650
|
+ var msg = response.data.data.msg;
|
|
651
|
+ var planDataLength = this.tableData.length;
|
718
|
652
|
for (let index = planDataLength - 1; index >= 0; index--) {
|
719
|
653
|
if (this.tableData[index].id in idMap) {
|
720
|
|
- this.tableData.splice(index, 1)
|
|
654
|
+ this.tableData.splice(index, 1);
|
721
|
655
|
}
|
722
|
656
|
}
|
723
|
|
- this.$message.success('删除成功')
|
|
657
|
+ this.$message.success("删除成功");
|
724
|
658
|
}
|
725
|
|
- })
|
726
|
|
- })
|
|
659
|
+ });
|
|
660
|
+ });
|
727
|
661
|
},
|
728
|
662
|
queryRepair() {
|
729
|
663
|
queryRepair(
|
|
@@ -732,48 +666,48 @@ export default {
|
732
|
666
|
this.forms.end_time
|
733
|
667
|
).then(response => {
|
734
|
668
|
if (response.data.state === 1) {
|
735
|
|
- var repair = response.data.data.repair
|
736
|
|
- this.tableData = repair
|
|
669
|
+ var repair = response.data.data.repair;
|
|
670
|
+ this.tableData = repair;
|
737
|
671
|
}
|
738
|
|
- })
|
|
672
|
+ });
|
739
|
673
|
},
|
740
|
674
|
handleSizeChange(limit) {
|
741
|
|
- this.limit = limit
|
742
|
|
- this.getAllRepair()
|
|
675
|
+ this.limit = limit;
|
|
676
|
+ this.getAllRepair();
|
743
|
677
|
},
|
744
|
678
|
handleCurrentChange(page) {
|
745
|
|
- this.page = page
|
746
|
|
- this.getAllRepair()
|
|
679
|
+ this.page = page;
|
|
680
|
+ this.getAllRepair();
|
747
|
681
|
},
|
748
|
682
|
DeleteRepairs(id, index) {
|
749
|
683
|
this.$confirm(
|
750
|
|
- '确认要删除所选记录吗? <br>删除后,信息将无法恢复',
|
751
|
|
- '删除提示',
|
|
684
|
+ "确认要删除所选记录吗? <br>删除后,信息将无法恢复",
|
|
685
|
+ "删除提示",
|
752
|
686
|
{
|
753
|
687
|
dangerouslyUseHTMLString: true,
|
754
|
|
- confirmButtonText: '确定',
|
755
|
|
- cancelButtonText: '取消',
|
756
|
|
- type: 'warning'
|
|
688
|
+ confirmButtonText: "确定",
|
|
689
|
+ cancelButtonText: "取消",
|
|
690
|
+ type: "warning"
|
757
|
691
|
}
|
758
|
692
|
).then(() => {
|
759
|
693
|
DeleteRepairs(id, index).then(response => {
|
760
|
694
|
if (response.data.state === 1) {
|
761
|
|
- var msg = response.data.data.msg
|
762
|
|
- this.tableData.splice(index, 1)
|
|
695
|
+ var msg = response.data.data.msg;
|
|
696
|
+ this.tableData.splice(index, 1);
|
763
|
697
|
}
|
764
|
|
- })
|
765
|
|
- })
|
|
698
|
+ });
|
|
699
|
+ });
|
766
|
700
|
}
|
767
|
701
|
},
|
768
|
702
|
created() {
|
769
|
|
- this.getAllSubregion()
|
770
|
|
- this.getAllRepair()
|
|
703
|
+ this.getAllSubregion();
|
|
704
|
+ this.getAllRepair();
|
771
|
705
|
}
|
772
|
|
-}
|
|
706
|
+};
|
773
|
707
|
</script>
|
774
|
708
|
|
775
|
709
|
<style scoped>
|
776
|
|
- .row{
|
777
|
|
- margin-bottom:10px;
|
778
|
|
- }
|
|
710
|
+.row {
|
|
711
|
+ margin-bottom: 10px;
|
|
712
|
+}
|
779
|
713
|
</style>
|