|
@@ -0,0 +1,628 @@
|
|
1
|
+<template>
|
|
2
|
+ <el-dialog title="编辑设备" width="854px" top="15vh" :visible.sync="visible" :before-close="_close">
|
|
3
|
+ <div>
|
|
4
|
+ <div class="main">
|
|
5
|
+ <!-- 第一行 -->
|
|
6
|
+ <el-row>
|
|
7
|
+ <el-col :span="8">
|
|
8
|
+ <div class="col_div">
|
|
9
|
+ <el-col :span="layout.first_line_label">
|
|
10
|
+ <span class="col_label_span"><span class="required_span">* </span>序列号:</span>
|
|
11
|
+ </el-col>
|
|
12
|
+ <el-col :span="layout.first_line_content">
|
|
13
|
+ <el-input size="small" v-model="form.serial_number"></el-input>
|
|
14
|
+ </el-col>
|
|
15
|
+ </div>
|
|
16
|
+ </el-col>
|
|
17
|
+ <el-col :span="8">
|
|
18
|
+ <div class="col_div">
|
|
19
|
+ <el-col :span="layout.second_line_label">
|
|
20
|
+ <span class="col_label_span"><span class="required_span">* </span>设备类型:</span>
|
|
21
|
+ </el-col>
|
|
22
|
+ <el-col :span="layout.second_line_content" >
|
|
23
|
+ <el-select v-model="form.device_type" size="small" :disabled="device_id != 0" style="width:100%;">
|
|
24
|
+ <el-option v-for="item in device_types" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
25
|
+ </el-select>
|
|
26
|
+ </el-col>
|
|
27
|
+ </div>
|
|
28
|
+ </el-col>
|
|
29
|
+ <el-col :span="8">
|
|
30
|
+ <div class="col_div">
|
|
31
|
+ <el-col :span="layout.third_line_label">
|
|
32
|
+ <span class="col_label_span">床位号:</span>
|
|
33
|
+ </el-col>
|
|
34
|
+ <el-col :span="layout.third_line_content">
|
|
35
|
+ <el-select v-model="form.device_number_id" clearable size="small" style="width:100%;">
|
|
36
|
+ <el-option v-for="item in device_numbers" :key="item.id" :label="item.number" :value="item.id"></el-option>
|
|
37
|
+ </el-select>
|
|
38
|
+ </el-col>
|
|
39
|
+ </div>
|
|
40
|
+ </el-col>
|
|
41
|
+ </el-row>
|
|
42
|
+ <!-- 第二行 -->
|
|
43
|
+ <el-row>
|
|
44
|
+ <el-col :span="8">
|
|
45
|
+ <div class="col_div">
|
|
46
|
+ <el-col :span="layout.first_line_label">
|
|
47
|
+ <span class="col_label_span"><span class="required_span">* </span>设备名称:</span>
|
|
48
|
+ </el-col>
|
|
49
|
+ <el-col :span="layout.first_line_content">
|
|
50
|
+ <el-input size="small" v-model="form.name"></el-input>
|
|
51
|
+ </el-col>
|
|
52
|
+ </div>
|
|
53
|
+ </el-col>
|
|
54
|
+ <el-col :span="8">
|
|
55
|
+ <div class="col_div">
|
|
56
|
+ <el-col :span="layout.second_line_label">
|
|
57
|
+ <span class="col_label_span">生产厂家:</span>
|
|
58
|
+ </el-col>
|
|
59
|
+ <el-col :span="layout.second_line_content">
|
|
60
|
+ <el-input size="small" v-model="form.manufacturer"></el-input>
|
|
61
|
+ </el-col>
|
|
62
|
+ </div>
|
|
63
|
+ </el-col>
|
|
64
|
+ <el-col :span="8">
|
|
65
|
+ <div class="col_div">
|
|
66
|
+ <el-col :span="layout.third_line_label">
|
|
67
|
+ <span class="col_label_span">维修厂家:</span>
|
|
68
|
+ </el-col>
|
|
69
|
+ <el-col :span="layout.third_line_content">
|
|
70
|
+ <el-input size="small" v-model="form.repair_factory"></el-input>
|
|
71
|
+ </el-col>
|
|
72
|
+ </div>
|
|
73
|
+ </el-col>
|
|
74
|
+ </el-row>
|
|
75
|
+ <!-- 第三行 -->
|
|
76
|
+ <el-row>
|
|
77
|
+ <el-col :span="8">
|
|
78
|
+ <div class="col_div">
|
|
79
|
+ <el-col :span="layout.first_line_label">
|
|
80
|
+ <span class="col_label_span">设备型号:</span>
|
|
81
|
+ </el-col>
|
|
82
|
+ <el-col :span="layout.first_line_content">
|
|
83
|
+ <el-input size="small" v-model="form.model"></el-input>
|
|
84
|
+ </el-col>
|
|
85
|
+ </div>
|
|
86
|
+ </el-col>
|
|
87
|
+ <el-col :span="8">
|
|
88
|
+ <div class="col_div">
|
|
89
|
+ <el-col :span="layout.second_line_label">
|
|
90
|
+ <span class="col_label_span">使用科室:</span>
|
|
91
|
+ </el-col>
|
|
92
|
+ <el-col :span="layout.second_line_content">
|
|
93
|
+ <el-input size="small" v-model="form.department"></el-input>
|
|
94
|
+ </el-col>
|
|
95
|
+ </div>
|
|
96
|
+ </el-col>
|
|
97
|
+ <el-col :span="8">
|
|
98
|
+ <div class="col_div">
|
|
99
|
+ <el-col :span="layout.third_line_label">
|
|
100
|
+ <span class="col_label_span">科室编号:</span>
|
|
101
|
+ </el-col>
|
|
102
|
+ <el-col :span="layout.third_line_content">
|
|
103
|
+ <el-input size="small" v-model="form.department_number"></el-input>
|
|
104
|
+ </el-col>
|
|
105
|
+ </div>
|
|
106
|
+ </el-col>
|
|
107
|
+ </el-row>
|
|
108
|
+ <!-- 第四行 -->
|
|
109
|
+ <el-row>
|
|
110
|
+ <el-col :span="8">
|
|
111
|
+ <div class="col_div">
|
|
112
|
+ <el-col :span="layout.first_line_label">
|
|
113
|
+ <span class="col_label_span">购买日期:</span>
|
|
114
|
+ </el-col>
|
|
115
|
+ <el-col :span="layout.first_line_content">
|
|
116
|
+ <el-date-picker v-model="form.purchase_date" type="date" value-format="timestamp" size="small" style="width: 100%;"></el-date-picker>
|
|
117
|
+ </el-col>
|
|
118
|
+ </div>
|
|
119
|
+ </el-col>
|
|
120
|
+ <el-col :span="8">
|
|
121
|
+ <div class="col_div">
|
|
122
|
+ <el-col :span="layout.second_line_label">
|
|
123
|
+ <span class="col_label_span">安装日期:</span>
|
|
124
|
+ </el-col>
|
|
125
|
+ <el-col :span="layout.second_line_content">
|
|
126
|
+ <el-date-picker v-model="form.install_date" type="date" value-format="timestamp" size="small" style="width: 100%;"></el-date-picker>
|
|
127
|
+ </el-col>
|
|
128
|
+ </div>
|
|
129
|
+ </el-col>
|
|
130
|
+ <el-col :span="8">
|
|
131
|
+ <div class="col_div">
|
|
132
|
+ <el-col :span="layout.third_line_label">
|
|
133
|
+ <span class="col_label_span">启用日期:</span>
|
|
134
|
+ </el-col>
|
|
135
|
+ <el-col :span="layout.third_line_content">
|
|
136
|
+ <el-date-picker v-model="form.commissioning_date" value-format="timestamp" type="date" size="small" style="width: 100%;"></el-date-picker>
|
|
137
|
+ </el-col>
|
|
138
|
+ </div>
|
|
139
|
+ </el-col>
|
|
140
|
+ </el-row>
|
|
141
|
+ <!-- 第五行 -->
|
|
142
|
+ <el-row>
|
|
143
|
+ <el-col :span="8">
|
|
144
|
+ <div class="col_div">
|
|
145
|
+ <el-col :span="layout.first_line_label">
|
|
146
|
+ <span class="col_label_span">维修工程师:</span>
|
|
147
|
+ </el-col>
|
|
148
|
+ <el-col :span="layout.first_line_content">
|
|
149
|
+ <el-input size="small" v-model="form.maintainer"></el-input>
|
|
150
|
+ </el-col>
|
|
151
|
+ </div>
|
|
152
|
+ </el-col>
|
|
153
|
+ <el-col :span="8">
|
|
154
|
+ <div class="col_div">
|
|
155
|
+ <el-col :span="layout.second_line_label">
|
|
156
|
+ <span class="col_label_span">联系电话:</span>
|
|
157
|
+ </el-col>
|
|
158
|
+ <el-col :span="layout.second_line_content">
|
|
159
|
+ <el-input size="small" v-model="form.maintenance_call"></el-input>
|
|
160
|
+ </el-col>
|
|
161
|
+ </div>
|
|
162
|
+ </el-col>
|
|
163
|
+ <el-col :span="8">
|
|
164
|
+ <div class="col_div">
|
|
165
|
+ <el-col :span="layout.third_line_label">
|
|
166
|
+ <span class="col_label_span">保修期限:</span>
|
|
167
|
+ </el-col>
|
|
168
|
+ <el-col :span="layout.third_line_content">
|
|
169
|
+ <el-input size="small" v-model="form.warranty_period"></el-input>
|
|
170
|
+ </el-col>
|
|
171
|
+ </div>
|
|
172
|
+ </el-col>
|
|
173
|
+ </el-row>
|
|
174
|
+ <!-- 第六行 -->
|
|
175
|
+ <!-- <el-row>
|
|
176
|
+ <el-col :span="8">
|
|
177
|
+ <div class="col_div">
|
|
178
|
+ <el-col :span="9">
|
|
179
|
+ <span class="col_label_span">机器状态:</span>
|
|
180
|
+ </el-col>
|
|
181
|
+ <el-col :span="15">
|
|
182
|
+ <el-select v-model="form.device_status" clearable size="small">
|
|
183
|
+ <el-option v-for="item in device_states" :key="item.state" :label="item.name" :value="item.state"></el-option>
|
|
184
|
+ </el-select>
|
|
185
|
+ </el-col>
|
|
186
|
+ </div>
|
|
187
|
+ </el-col>
|
|
188
|
+ <el-col :span="8">
|
|
189
|
+ <div class="col_div">
|
|
190
|
+ <el-col :span="10">
|
|
191
|
+ <span class="col_label_span">初始使用次数:</span>
|
|
192
|
+ </el-col>
|
|
193
|
+ <el-col :span="14">
|
|
194
|
+ <el-input v-model="form.initial_use_times" style="width: 100%;"></el-input>
|
|
195
|
+ </el-col>
|
|
196
|
+ </div>
|
|
197
|
+ </el-col>
|
|
198
|
+ <el-col :span="8">
|
|
199
|
+ <div class="col_div">
|
|
200
|
+ <el-col :span="7">
|
|
201
|
+ <span class="col_label_span">备 注:</span>
|
|
202
|
+ </el-col>
|
|
203
|
+ <el-col :span="17">
|
|
204
|
+ <el-input size="small" v-model="form.mark"></el-input>
|
|
205
|
+ </el-col>
|
|
206
|
+ </div>
|
|
207
|
+ </el-col>
|
|
208
|
+ </el-row> -->
|
|
209
|
+ <!-- 第七行 -->
|
|
210
|
+ <!-- <el-row>
|
|
211
|
+ <el-col :span="7">
|
|
212
|
+ <div class="col_div">
|
|
213
|
+ <el-col :span="8">
|
|
214
|
+ <span class="col_label_span">报废日期:</span>
|
|
215
|
+ </el-col>
|
|
216
|
+ <el-col :span="16">
|
|
217
|
+ <el-date-picker v-model="form.retirement_date" type="date" value-format="timestamp" size="small" style="width: 140px;"></el-date-picker>
|
|
218
|
+ </el-col>
|
|
219
|
+ </div>
|
|
220
|
+ </el-col>
|
|
221
|
+ <el-col :span="7">
|
|
222
|
+ <div class="col_div">
|
|
223
|
+ <el-col :span="8">
|
|
224
|
+ <span class="col_label_span">报废原因:</span>
|
|
225
|
+ </el-col>
|
|
226
|
+ <el-col :span="16">
|
|
227
|
+ <el-select v-model="form.retirement_reason" clearable size="small">
|
|
228
|
+ <el-option v-for="item in retirement_reasons" :key="item.id" :label="item.reason" :value="item.reason"></el-option>
|
|
229
|
+ </el-select>
|
|
230
|
+ </el-col>
|
|
231
|
+ </div>
|
|
232
|
+ </el-col>
|
|
233
|
+ <el-col :span="5">
|
|
234
|
+ <div class="col_div">
|
|
235
|
+ <el-col :span="15">
|
|
236
|
+ <span class="col_label_span">使用年限(年):</span>
|
|
237
|
+ </el-col>
|
|
238
|
+ <el-col :span="9">
|
|
239
|
+ <el-input size="small" v-model="form.service_life"></el-input>
|
|
240
|
+ </el-col>
|
|
241
|
+ </div>
|
|
242
|
+ </el-col>
|
|
243
|
+ <el-col :span="5">
|
|
244
|
+ <div class="col_div">
|
|
245
|
+ <el-col :span="14">
|
|
246
|
+ <span class="col_label_span">工作时长(h):</span>
|
|
247
|
+ </el-col>
|
|
248
|
+ <el-col :span="10">
|
|
249
|
+ <el-input size="small" v-model="form.working_time"></el-input>
|
|
250
|
+ </el-col>
|
|
251
|
+ </div>
|
|
252
|
+ </el-col>
|
|
253
|
+ </el-row> -->
|
|
254
|
+ <!-- 治疗模式 -->
|
|
255
|
+ <el-row v-show="false && form.device_type === 1">
|
|
256
|
+ <el-col :span="24">
|
|
257
|
+ <div class="col_div">
|
|
258
|
+ <el-col :span="3">
|
|
259
|
+ <div style="padding-left: 5px;">
|
|
260
|
+ <span class="col_label_span" style="line-height: auto; padding-left: 0; text-align: left;">治疗模式:</span>
|
|
261
|
+ <el-checkbox label="全选"></el-checkbox>
|
|
262
|
+ </div>
|
|
263
|
+ </el-col>
|
|
264
|
+ <el-col :span="21">
|
|
265
|
+ <div style="margin-top: 6px;"></div>
|
|
266
|
+ <el-checkbox-group v-model="form.treatment_mode">
|
|
267
|
+ <el-checkbox v-for="item in cure_types" :label="item.id" :key="item.id" :value="item.id">{{ item.name }}</el-checkbox>
|
|
268
|
+ </el-checkbox-group>
|
|
269
|
+ </el-col>
|
|
270
|
+ </div>
|
|
271
|
+ </el-col>
|
|
272
|
+ </el-row>
|
|
273
|
+ <!-- 反渗模式 -->
|
|
274
|
+ <el-row v-show="false && form.device_type === 2">
|
|
275
|
+ <el-col :span="8">
|
|
276
|
+ <div class="col_div">
|
|
277
|
+ <el-col :span="layout.first_line_label">
|
|
278
|
+ <span class="col_label_span">反渗模式:</span>
|
|
279
|
+ </el-col>
|
|
280
|
+ <el-col :span="layout.first_line_content">
|
|
281
|
+ <el-select v-model="form.reverse_osmosis_mode" clearable size="small">
|
|
282
|
+ <el-option v-for="item in reverse_osmosises" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
283
|
+ </el-select>
|
|
284
|
+ </el-col>
|
|
285
|
+ </div>
|
|
286
|
+ </el-col>
|
|
287
|
+ </el-row>
|
|
288
|
+ </div>
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+ <div style="text-align: right; padding-right: 25px; padding-top: 10px; padding-bottom: 10px;">
|
|
294
|
+ <el-button type="primary" :disabled="$store.getters.xt_user.subscibe.state==3?true:false" @click="update_device_submit">保 存</el-button>
|
|
295
|
+ </div>
|
|
296
|
+ </div>
|
|
297
|
+ </el-dialog>
|
|
298
|
+</template>
|
|
299
|
+
|
|
300
|
+<script>
|
|
301
|
+ import DeviceInfoPane from './device_info/device_info_pane'
|
|
302
|
+ import DeviceInfoForm from './device_info/device_info_form'
|
|
303
|
+ import EditDeviceInfoForm from './device_info/edit_device_info_form'
|
|
304
|
+ import {getDeviceBaseInfo, createDevice, modifyDeviceBaseInfo} from '@/api/device/device'
|
|
305
|
+
|
|
306
|
+ export default {
|
|
307
|
+ name: "EditDeviceDialog",
|
|
308
|
+ components: {
|
|
309
|
+ EditDeviceInfoForm,
|
|
310
|
+ DeviceInfoForm,
|
|
311
|
+ DeviceInfoPane
|
|
312
|
+
|
|
313
|
+ },
|
|
314
|
+ data() {
|
|
315
|
+ return {
|
|
316
|
+ visible: false,
|
|
317
|
+ layout: {
|
|
318
|
+ first_line_label: 8,
|
|
319
|
+ first_line_content: 16,
|
|
320
|
+ second_line_label: 8,
|
|
321
|
+ second_line_content: 16,
|
|
322
|
+ third_line_label: 8,
|
|
323
|
+ third_line_content: 16,
|
|
324
|
+ },
|
|
325
|
+ device_id: 0,
|
|
326
|
+ form: {
|
|
327
|
+ device_type: 1,
|
|
328
|
+ serial_number: '',
|
|
329
|
+ name: '',
|
|
330
|
+ device_number_id: '',
|
|
331
|
+ manufacturer: '',
|
|
332
|
+ repair_factory: '',
|
|
333
|
+ model: '',
|
|
334
|
+ department: '',
|
|
335
|
+ department_number: '',
|
|
336
|
+ purchase_date: '',
|
|
337
|
+ install_date: '',
|
|
338
|
+ commissioning_date: '',
|
|
339
|
+ maintainer: '',
|
|
340
|
+ maintenance_call: '',
|
|
341
|
+ warranty_period: '',
|
|
342
|
+ device_status: '',
|
|
343
|
+ initial_use_times: '',
|
|
344
|
+ mark: '',
|
|
345
|
+ retirement_date: '',
|
|
346
|
+ retirement_reason: '',
|
|
347
|
+ service_life: '',
|
|
348
|
+ working_time: '',
|
|
349
|
+ treatment_mode: [], // 治疗模式
|
|
350
|
+ reverse_osmosis_mode: '', // 反渗模式
|
|
351
|
+ },
|
|
352
|
+ device_types: [
|
|
353
|
+ { id: 1, name: "透析机" },
|
|
354
|
+ // { id: 2, name: "水处理机" },
|
|
355
|
+ ],
|
|
356
|
+ cure_types: [ // 治疗模式
|
|
357
|
+ // { id:1, name: "HD" },
|
|
358
|
+ // { id:2, name: "HDF" },
|
|
359
|
+ // { id:3, name: "HD+HP" },
|
|
360
|
+ // { id:4, name: "HP" },
|
|
361
|
+ // { id:5, name: "HF" },
|
|
362
|
+ // { id:10, name: "HD" },
|
|
363
|
+ // { id:20, name: "HDF" },
|
|
364
|
+ // { id:30, name: "HD+HP" },
|
|
365
|
+ // { id:40, name: "HP" },
|
|
366
|
+ // { id:50, name: "HF" },
|
|
367
|
+ // { id:300, name: "HD+HP" },
|
|
368
|
+ ],
|
|
369
|
+ reverse_osmosises: [ // 反渗模式
|
|
370
|
+ // { id:1, name: "单级反渗" }
|
|
371
|
+ ],
|
|
372
|
+ device_states: [
|
|
373
|
+ { state: 1, name: '使用机' },
|
|
374
|
+ { state: 2, name: '备用机' },
|
|
375
|
+ { state: 3, name: '急诊机' },
|
|
376
|
+ { state: 4, name: '报废机' },
|
|
377
|
+ ],
|
|
378
|
+ retirement_reasons: [
|
|
379
|
+ { id: 1, reason: '报废原因1' },
|
|
380
|
+ { id: 2, reason: '报废原因2' },
|
|
381
|
+ { id: 3, reason: '报废原因3' },
|
|
382
|
+ { id: 4, reason: '报废原因4' },
|
|
383
|
+ { id: 5, reason: '其他' },
|
|
384
|
+ ]
|
|
385
|
+ }
|
|
386
|
+ },
|
|
387
|
+ props: {
|
|
388
|
+ device_numbers: {
|
|
389
|
+ type: Array,
|
|
390
|
+ require: true,
|
|
391
|
+ }
|
|
392
|
+ },
|
|
393
|
+ methods: {
|
|
394
|
+ _close: function(done) {
|
|
395
|
+ this.clear()
|
|
396
|
+ done()
|
|
397
|
+ },
|
|
398
|
+ clear: function() {
|
|
399
|
+
|
|
400
|
+ },
|
|
401
|
+ show() {
|
|
402
|
+ this.clear()
|
|
403
|
+ this.visible = true
|
|
404
|
+ },
|
|
405
|
+ hide() {
|
|
406
|
+ this.clear()
|
|
407
|
+ this.visible = false
|
|
408
|
+ }, clear() {
|
|
409
|
+ this.device_id = 0
|
|
410
|
+ this.form.device_type = 1
|
|
411
|
+ this.form.serial_number = ''
|
|
412
|
+ this.form.name = ''
|
|
413
|
+ this.form.device_number_id = ''
|
|
414
|
+ this.form.manufacturer = ''
|
|
415
|
+ this.form.repair_factory = ''
|
|
416
|
+ this.form.model = ''
|
|
417
|
+ this.form.department = ''
|
|
418
|
+ this.form.department_number = ''
|
|
419
|
+ this.form.purchase_date = 0
|
|
420
|
+ this.form.install_date = 0
|
|
421
|
+ this.form.commissioning_date = 0
|
|
422
|
+ this.form.maintainer = ''
|
|
423
|
+ this.form.maintenance_call = ''
|
|
424
|
+ this.form.warranty_period = ''
|
|
425
|
+ this.form.device_status = ''
|
|
426
|
+ this.form.initial_use_times = ''
|
|
427
|
+ this.form.mark = ''
|
|
428
|
+ this.form.retirement_date = 0
|
|
429
|
+ this.form.retirement_reason = ''
|
|
430
|
+ this.form.service_life = ''
|
|
431
|
+ this.form.working_time = ''
|
|
432
|
+ this.form.treatment_mode = []
|
|
433
|
+ this.form.reverse_osmosis_mode = ''
|
|
434
|
+ },
|
|
435
|
+ set_device_id: function(device_id) {
|
|
436
|
+ if (device_id > 0) {
|
|
437
|
+ this.device_id = device_id
|
|
438
|
+ getDeviceBaseInfo(device_id).then(rs => {
|
|
439
|
+ var resp = rs.data
|
|
440
|
+ if (resp.state === 1) {
|
|
441
|
+ this.form.device_type = resp.data.device_type
|
|
442
|
+ this.form.device_number_id = resp.data.device_number_id == 0 ? '' : resp.data.device_number_id
|
|
443
|
+
|
|
444
|
+ var device_info = resp.data.device_info
|
|
445
|
+ this.form.serial_number = device_info.serial_number
|
|
446
|
+ this.form.name = device_info.name
|
|
447
|
+ this.form.manufacturer = device_info.manufacturer
|
|
448
|
+ this.form.repair_factory = device_info.repair_factory
|
|
449
|
+ this.form.model = device_info.model
|
|
450
|
+ this.form.department = device_info.department
|
|
451
|
+ this.form.department_number = device_info.department_number
|
|
452
|
+ this.form.purchase_date = device_info.purchase_date == 0 ? '' : (device_info.purchase_date * 1000)
|
|
453
|
+ this.form.install_date = device_info.install_date == 0 ? '' : (device_info.install_date * 1000)
|
|
454
|
+ this.form.commissioning_date = device_info.commissioning_date == 0 ? '' : (device_info.commissioning_date * 1000)
|
|
455
|
+ this.form.maintainer = device_info.maintainer
|
|
456
|
+ this.form.maintenance_call = device_info.maintenance_call
|
|
457
|
+ this.form.warranty_period = device_info.warranty_period
|
|
458
|
+ this.form.device_status = device_info.device_status == 0 ? '' : device_info.device_status
|
|
459
|
+ this.form.initial_use_times = device_info.initial_use_times == 0 ? '' : device_info.initial_use_times
|
|
460
|
+ this.form.mark = device_info.mark
|
|
461
|
+ this.form.retirement_date = device_info.retirement_date == 0 ? '' : (device_info.retirement_date * 1000)
|
|
462
|
+ this.form.retirement_reason = device_info.retirement_reason
|
|
463
|
+ this.form.service_life = device_info.service_life == 0 ? '' : device_info.service_life
|
|
464
|
+ this.form.working_time = device_info.working_time == 0 ? '' : device_info.working_time
|
|
465
|
+ if (this.form.device_type == 1) {
|
|
466
|
+ // treatment_mode: []
|
|
467
|
+
|
|
468
|
+ } else if (this.form.device_type == 2) {
|
|
469
|
+ // reverse_osmosis_mode: ''
|
|
470
|
+ }
|
|
471
|
+
|
|
472
|
+ } else {
|
|
473
|
+ this.$message.error(resp.msg)
|
|
474
|
+ }
|
|
475
|
+ })
|
|
476
|
+
|
|
477
|
+ } else {
|
|
478
|
+ this.clear()
|
|
479
|
+ }
|
|
480
|
+ },
|
|
481
|
+ create_device_submit() {
|
|
482
|
+ var checkErr = this._check_submit()
|
|
483
|
+ if (checkErr.length > 0) {
|
|
484
|
+ this.$message.error(checkErr)
|
|
485
|
+ return
|
|
486
|
+ }
|
|
487
|
+
|
|
488
|
+ var params = new Object()
|
|
489
|
+ params.type = this.form.device_type
|
|
490
|
+ params.serial_number = this.form.serial_number
|
|
491
|
+ params.name = this.form.name
|
|
492
|
+ params.device_number_id = this.form.device_number_id
|
|
493
|
+ params.manufacturer = this.form.manufacturer
|
|
494
|
+ params.repair_factory = this.form.repair_factory
|
|
495
|
+ params.model = this.form.model
|
|
496
|
+ params.department = this.form.department
|
|
497
|
+ params.department_number = this.form.department_number
|
|
498
|
+ params.purchase_date = typeof this.form.purchase_date == 'string' ? 0 : (this.form.purchase_date / 1000)
|
|
499
|
+ params.install_date = typeof this.form.install_date == 'string' ? 0 : (this.form.install_date / 1000)
|
|
500
|
+ params.commissioning_date = typeof this.form.commissioning_date == 'string' ? 0 : (this.form.commissioning_date / 1000)
|
|
501
|
+ params.maintainer = this.form.maintainer
|
|
502
|
+ params.maintenance_call = this.form.maintenance_call
|
|
503
|
+ params.warranty_period = this.form.warranty_period
|
|
504
|
+ params.device_status = this.form.device_status
|
|
505
|
+ params.initial_use_times = this.form.initial_use_times
|
|
506
|
+ params.mark = this.form.mark
|
|
507
|
+ params.retirement_date = typeof this.form.retirement_date == 'string' ? 0 : (this.form.retirement_date / 1000)
|
|
508
|
+ params.retirement_reason = this.form.retirement_reason
|
|
509
|
+ params.service_life = this.form.service_life
|
|
510
|
+ params.working_time = this.form.working_time
|
|
511
|
+ // params.treatment_mode = this.form.treatment_mode
|
|
512
|
+ // params.reverse_osmosis_mode = this.form.reverse_osmosis_mode
|
|
513
|
+ createDevice(params).then(rs => {
|
|
514
|
+ var resp = rs.data
|
|
515
|
+ if (resp.state === 1) {
|
|
516
|
+ var device = resp.data.device
|
|
517
|
+ this.$emit('did_create', device)
|
|
518
|
+ this.$message({message: "创建成功", type: "success"})
|
|
519
|
+
|
|
520
|
+ } else {
|
|
521
|
+ this.$message.error(resp.msg)
|
|
522
|
+ }
|
|
523
|
+ })
|
|
524
|
+ },
|
|
525
|
+ update_device_submit() {
|
|
526
|
+ var checkErr = this._check_submit()
|
|
527
|
+ if (checkErr.length > 0) {
|
|
528
|
+ this.$message.error(checkErr)
|
|
529
|
+ return
|
|
530
|
+ }
|
|
531
|
+
|
|
532
|
+ var params = new Object()
|
|
533
|
+ params.device_id = this.device_id
|
|
534
|
+ params.serial_number = this.form.serial_number
|
|
535
|
+ params.name = this.form.name
|
|
536
|
+ params.device_number_id = this.form.device_number_id
|
|
537
|
+ params.manufacturer = this.form.manufacturer
|
|
538
|
+ params.repair_factory = this.form.repair_factory
|
|
539
|
+ params.model = this.form.model
|
|
540
|
+ params.department = this.form.department
|
|
541
|
+ params.department_number = this.form.department_number
|
|
542
|
+ params.purchase_date = typeof this.form.purchase_date == 'string' ? 0 : (this.form.purchase_date / 1000)
|
|
543
|
+ params.install_date = typeof this.form.install_date == 'string' ? 0 : (this.form.install_date / 1000)
|
|
544
|
+ params.commissioning_date = typeof this.form.commissioning_date == 'string' ? 0 : (this.form.commissioning_date / 1000)
|
|
545
|
+ params.maintainer = this.form.maintainer
|
|
546
|
+ params.maintenance_call = this.form.maintenance_call
|
|
547
|
+ params.warranty_period = this.form.warranty_period
|
|
548
|
+ params.device_status = this.form.device_status
|
|
549
|
+ params.initial_use_times = this.form.initial_use_times
|
|
550
|
+ params.mark = this.form.mark
|
|
551
|
+ params.retirement_date = typeof this.form.retirement_date == 'string' ? 0 : (this.form.retirement_date / 1000)
|
|
552
|
+ params.retirement_reason = this.form.retirement_reason
|
|
553
|
+ params.service_life = this.form.service_life
|
|
554
|
+ params.working_time = this.form.working_time
|
|
555
|
+ // params.treatment_mode = this.form.treatment_mode
|
|
556
|
+ // params.reverse_osmosis_mode = this.form.reverse_osmosis_mode
|
|
557
|
+ modifyDeviceBaseInfo(params).then(rs => {
|
|
558
|
+ var resp = rs.data
|
|
559
|
+ if (resp.state === 1) {
|
|
560
|
+ var device = resp.data.device
|
|
561
|
+ this.$emit('did_update', device)
|
|
562
|
+ this.$message({message: "保存成功", type: "success"})
|
|
563
|
+
|
|
564
|
+ } else {
|
|
565
|
+ this.$message.error(resp.msg)
|
|
566
|
+ }
|
|
567
|
+ })
|
|
568
|
+ },
|
|
569
|
+ _check_submit() {
|
|
570
|
+ if (this.form.serial_number.length == 0) {
|
|
571
|
+ return "请填写设备序列号"
|
|
572
|
+ }
|
|
573
|
+ if (this.form.device_type !== 1 && this.form.device_type !== 2) {
|
|
574
|
+ return "请选择设备类型"
|
|
575
|
+ }
|
|
576
|
+ if (this.form.name.length == 0) {
|
|
577
|
+ return "请填写设备名"
|
|
578
|
+ }
|
|
579
|
+ if (this.form.maintenance_call.length > 0) {
|
|
580
|
+ if (/^(0\d{2,3}-?\d{7,8}$)|(1\d{10}$)/.test(this.form.maintenance_call) == false) {
|
|
581
|
+ return "联系电话格式错误"
|
|
582
|
+ }
|
|
583
|
+ }
|
|
584
|
+ return ""
|
|
585
|
+ }
|
|
586
|
+
|
|
587
|
+ }
|
|
588
|
+ }
|
|
589
|
+
|
|
590
|
+</script>
|
|
591
|
+
|
|
592
|
+<style scoped>
|
|
593
|
+ .main {
|
|
594
|
+ width: 100%;
|
|
595
|
+ }
|
|
596
|
+ .main .el-row {
|
|
597
|
+ /* border-bottom: 1px solid rgb(233, 233, 233); */
|
|
598
|
+ /* padding-left: 5px; */
|
|
599
|
+ padding-right: 5px;
|
|
600
|
+ padding-top: 10px;
|
|
601
|
+ padding-bottom: 10px;
|
|
602
|
+ }
|
|
603
|
+ .col_div {
|
|
604
|
+ width: 100%;
|
|
605
|
+ }
|
|
606
|
+ .col_label_span {
|
|
607
|
+ padding-left: 0px;
|
|
608
|
+ padding-right: 5px;
|
|
609
|
+ font-size: 14px;
|
|
610
|
+ height: 32px;
|
|
611
|
+ line-height: 32px;
|
|
612
|
+ /* display: block; */
|
|
613
|
+ display: inline-block;
|
|
614
|
+ width: 100%;
|
|
615
|
+ text-align: right;
|
|
616
|
+ /* padding-right: 5px; */
|
|
617
|
+ }
|
|
618
|
+ .required_span {
|
|
619
|
+ color: red;
|
|
620
|
+ }
|
|
621
|
+
|
|
622
|
+ .el-checkbox {
|
|
623
|
+ margin-bottom: 5px;
|
|
624
|
+ }
|
|
625
|
+ .el-checkbox+.el-checkbox {
|
|
626
|
+ margin-left: 15px;
|
|
627
|
+ }
|
|
628
|
+</style>
|