|
|
@@ -1,11 +1,6 @@
|
|
1
|
1
|
<template>
|
|
2
|
2
|
<div v-loading="loading">
|
|
3
|
|
- <el-form
|
|
4
|
|
- ref="ruleForm"
|
|
5
|
|
- :model="ruleForm"
|
|
6
|
|
- :rules="rules"
|
|
7
|
|
- label-width="150px"
|
|
8
|
|
- >
|
|
|
3
|
+ <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="150px">
|
|
9
|
4
|
<el-col :span="24">
|
|
10
|
5
|
<!-- <el-row v-if="wocode!=''">
|
|
11
|
6
|
<el-col :span="24">
|
|
|
@@ -31,18 +26,9 @@
|
|
31
|
26
|
</el-col>
|
|
32
|
27
|
<el-col :span="12">
|
|
33
|
28
|
<el-form-item label="申请人" prop="needman">
|
|
34
|
|
- <el-select
|
|
35
|
|
- v-model="ruleForm.needman"
|
|
36
|
|
- placeholder="请选择申请人"
|
|
37
|
|
- style="width: 100%"
|
|
38
|
|
- @change="changeRepairman"
|
|
39
|
|
- >
|
|
40
|
|
- <el-option
|
|
41
|
|
- v-for="item in repairman"
|
|
42
|
|
- :key="item.usercode"
|
|
43
|
|
- :label="item.username"
|
|
44
|
|
- :value="item.usercode"
|
|
45
|
|
- />
|
|
|
29
|
+ <el-select v-model="ruleForm.needman" placeholder="请选择申请人" style="width: 100%" @change="changeRepairman">
|
|
|
30
|
+ <el-option v-for="item in repairman" :key="item.usercode" :label="item.username"
|
|
|
31
|
+ :value="item.usercode" />
|
|
46
|
32
|
</el-select>
|
|
47
|
33
|
</el-form-item>
|
|
48
|
34
|
</el-col>
|
|
|
@@ -56,12 +42,8 @@
|
|
56
|
42
|
<el-col :span="12">
|
|
57
|
43
|
<el-form-item label="车辆要求" prop="cartype">
|
|
58
|
44
|
<el-select v-model="ruleForm.cartype" style="width: 100%">
|
|
59
|
|
- <el-option
|
|
60
|
|
- v-for="(item, index) in carArr"
|
|
61
|
|
- :key="index"
|
|
62
|
|
- :label="item.F_Name"
|
|
63
|
|
- :value="item.F_DictionaryValueId"
|
|
64
|
|
- />
|
|
|
45
|
+ <el-option v-for="(item, index) in carArr" :key="index" :label="item.F_Name"
|
|
|
46
|
+ :value="item.F_DictionaryValueId" />
|
|
65
|
47
|
</el-select>
|
|
66
|
48
|
</el-form-item>
|
|
67
|
49
|
</el-col>
|
|
|
@@ -69,36 +51,24 @@
|
|
69
|
51
|
<el-row>
|
|
70
|
52
|
<el-col :span="12">
|
|
71
|
53
|
<el-form-item label="出发地点" prop="startplace">
|
|
72
|
|
- <el-input
|
|
73
|
|
- v-model="ruleForm.startplace"
|
|
74
|
|
- placeholder="请输入出发地点"
|
|
75
|
|
- />
|
|
|
54
|
+ <el-input v-model="ruleForm.startplace" placeholder="请输入出发地点" />
|
|
76
|
55
|
</el-form-item>
|
|
77
|
56
|
</el-col>
|
|
78
|
57
|
<el-col :span="12">
|
|
79
|
58
|
<el-form-item label="目的地" prop="endplace">
|
|
80
|
|
- <el-input
|
|
81
|
|
- v-model="ruleForm.endplace"
|
|
82
|
|
- placeholder="请输入目的地"
|
|
83
|
|
- />
|
|
|
59
|
+ <el-input v-model="ruleForm.endplace" placeholder="请输入目的地" />
|
|
84
|
60
|
</el-form-item>
|
|
85
|
61
|
</el-col>
|
|
86
|
62
|
</el-row>
|
|
87
|
63
|
<el-row>
|
|
88
|
64
|
<el-col :span="24">
|
|
89
|
65
|
<el-form-item label="发车时间" prop="usertime">
|
|
90
|
|
- <el-date-picker
|
|
91
|
|
- v-model="ruleForm.usertime"
|
|
92
|
|
- style="width: 100%"
|
|
93
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
94
|
|
- format="yyyy-MM-dd HH:mm:ss"
|
|
95
|
|
- type="datetime"
|
|
96
|
|
- placeholder="选择发车时间"
|
|
97
|
|
- />
|
|
|
66
|
+ <el-date-picker v-model="ruleForm.usertime" style="width: 100%" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
67
|
+ format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="选择发车时间" />
|
|
98
|
68
|
</el-form-item>
|
|
99
|
69
|
</el-col>
|
|
100
|
70
|
</el-row>
|
|
101
|
|
- <el-row v-if="ruleForm.type2Arr[0] == 9017">
|
|
|
71
|
+ <el-row v-if=" worktypeInfo === 'cldd_xsezy'">
|
|
102
|
72
|
<el-col :span="24">
|
|
103
|
73
|
<el-form-item label="是否出生" prop="birth">
|
|
104
|
74
|
<el-radio v-model="ruleForm.birth" :label="0">否</el-radio>
|
|
|
@@ -109,11 +79,7 @@
|
|
109
|
79
|
<el-row>
|
|
110
|
80
|
<el-col :span="24">
|
|
111
|
81
|
<el-form-item label="工单内容" prop="content">
|
|
112
|
|
- <el-input
|
|
113
|
|
- v-model="ruleForm.content"
|
|
114
|
|
- type="textarea"
|
|
115
|
|
- placeholder="请输入工单内容"
|
|
116
|
|
- />
|
|
|
82
|
+ <el-input v-model="ruleForm.content" type="textarea" placeholder="请输入工单内容" />
|
|
117
|
83
|
</el-form-item>
|
|
118
|
84
|
</el-col>
|
|
119
|
85
|
</el-row>
|
|
|
@@ -137,423 +103,417 @@
|
|
137
|
103
|
</template>
|
|
138
|
104
|
|
|
139
|
105
|
<script>
|
|
140
|
|
-import {
|
|
141
|
|
- // getList,
|
|
142
|
|
- getModelDetail,
|
|
143
|
|
- getAddWorkOrder,
|
|
144
|
|
- getUpdateWorkOrder
|
|
145
|
|
-} from '@/api/vehicleDispatch/vehicleScheduling.js'
|
|
146
|
|
-import { getOrderTypeList } from '@/api/commonAPI.js'
|
|
147
|
|
-// import selectDeptTree from '@/components/context/commonSelect/selectDeptTree.vue'
|
|
148
|
|
-import { getUserMsg } from '@/api/orderManagement/orderList'
|
|
149
|
|
-import { getCartype } from '@/api/vehicleDispatch/vehicleManagement'
|
|
150
|
|
-import { GetPerson } from '@/api/commonAPI'
|
|
151
|
|
-export default {
|
|
152
|
|
- name: 'AddOrEdit',
|
|
153
|
|
- props: {
|
|
154
|
|
- orderTypeData: {
|
|
155
|
|
- type: Object,
|
|
156
|
|
- default() {
|
|
157
|
|
- return {}
|
|
158
|
|
- }
|
|
159
|
|
- },
|
|
160
|
|
- callid: {
|
|
161
|
|
- type: String,
|
|
162
|
|
- default: ''
|
|
163
|
|
- },
|
|
164
|
|
- rowid: {
|
|
165
|
|
- type: String,
|
|
166
|
|
- default: ''
|
|
167
|
|
- },
|
|
168
|
|
- wid: {
|
|
169
|
|
- type: String,
|
|
170
|
|
- default: ''
|
|
171
|
|
- },
|
|
172
|
|
- fid: {
|
|
173
|
|
- type: String,
|
|
174
|
|
- default: ''
|
|
175
|
|
- },
|
|
176
|
|
- wocode: {
|
|
177
|
|
- type: String,
|
|
178
|
|
- default: ''
|
|
179
|
|
- },
|
|
180
|
|
- layerid: {
|
|
181
|
|
- type: String,
|
|
182
|
|
- default: ''
|
|
183
|
|
- },
|
|
184
|
|
- iswomanage: {
|
|
185
|
|
- type: String,
|
|
186
|
|
- default: ''
|
|
187
|
|
- }
|
|
188
|
|
- },
|
|
189
|
|
- data() {
|
|
190
|
|
- return {
|
|
191
|
|
- cid: '',
|
|
192
|
|
- typeList: [],
|
|
193
|
|
- carArr: [],
|
|
194
|
|
- repairman: [], // 申请人数据
|
|
195
|
|
- sourceList: [
|
|
196
|
|
- {
|
|
197
|
|
- value: '电话',
|
|
198
|
|
- label: '电话'
|
|
199
|
|
- },
|
|
200
|
|
- {
|
|
201
|
|
- value: '电脑',
|
|
202
|
|
- label: '电脑'
|
|
203
|
|
- },
|
|
204
|
|
- {
|
|
205
|
|
- value: '微信',
|
|
206
|
|
- label: '微信'
|
|
|
106
|
+ import {
|
|
|
107
|
+ // getList,
|
|
|
108
|
+ getModelDetail,
|
|
|
109
|
+ getAddWorkOrder,
|
|
|
110
|
+ getUpdateWorkOrder
|
|
|
111
|
+ } from '@/api/vehicleDispatch/vehicleScheduling.js'
|
|
|
112
|
+ import {
|
|
|
113
|
+ getOrderTypeList
|
|
|
114
|
+ } from '@/api/commonAPI.js'
|
|
|
115
|
+ // import selectDeptTree from '@/components/context/commonSelect/selectDeptTree.vue'
|
|
|
116
|
+ import {
|
|
|
117
|
+ getUserMsg
|
|
|
118
|
+ } from '@/api/orderManagement/orderList'
|
|
|
119
|
+ import {
|
|
|
120
|
+ getCartype
|
|
|
121
|
+ } from '@/api/vehicleDispatch/vehicleManagement'
|
|
|
122
|
+ import {
|
|
|
123
|
+ GetPerson
|
|
|
124
|
+ } from '@/api/commonAPI'
|
|
|
125
|
+ export default {
|
|
|
126
|
+ name: 'AddOrEdit',
|
|
|
127
|
+ props: {
|
|
|
128
|
+ orderTypeData: {
|
|
|
129
|
+ type: Object,
|
|
|
130
|
+ default () {
|
|
|
131
|
+ return {}
|
|
207
|
132
|
}
|
|
208
|
|
- ],
|
|
209
|
|
- hospitalsParam: {
|
|
210
|
|
- id: 0,
|
|
211
|
|
- name: ''
|
|
212
|
133
|
},
|
|
213
|
|
- departmentsParam: {
|
|
214
|
|
- id: 0,
|
|
215
|
|
- name: ''
|
|
|
134
|
+ callid: {
|
|
|
135
|
+ type: String,
|
|
|
136
|
+ default: ''
|
|
|
137
|
+ },
|
|
|
138
|
+ rowid: {
|
|
|
139
|
+ type: String,
|
|
|
140
|
+ default: ''
|
|
|
141
|
+ },
|
|
|
142
|
+ wid: {
|
|
|
143
|
+ type: String,
|
|
|
144
|
+ default: ''
|
|
216
|
145
|
},
|
|
217
|
|
- repairmanParam: {
|
|
218
|
|
- id: 0,
|
|
219
|
|
- name: ''
|
|
|
146
|
+ fid: {
|
|
|
147
|
+ type: String,
|
|
|
148
|
+ default: ''
|
|
220
|
149
|
},
|
|
221
|
|
- rules: {
|
|
222
|
|
- type: [
|
|
|
150
|
+ wocode: {
|
|
|
151
|
+ type: String,
|
|
|
152
|
+ default: ''
|
|
|
153
|
+ },
|
|
|
154
|
+ layerid: {
|
|
|
155
|
+ type: String,
|
|
|
156
|
+ default: ''
|
|
|
157
|
+ },
|
|
|
158
|
+ iswomanage: {
|
|
|
159
|
+ type: String,
|
|
|
160
|
+ default: ''
|
|
|
161
|
+ }
|
|
|
162
|
+ },
|
|
|
163
|
+ data() {
|
|
|
164
|
+ return {
|
|
|
165
|
+ worktypeInfo: '',
|
|
|
166
|
+ cid: '',
|
|
|
167
|
+ typeList: [],
|
|
|
168
|
+ carArr: [],
|
|
|
169
|
+ repairman: [], // 申请人数据
|
|
|
170
|
+ sourceList: [{
|
|
|
171
|
+ value: '电话',
|
|
|
172
|
+ label: '电话'
|
|
|
173
|
+ },
|
|
223
|
174
|
{
|
|
224
|
|
- required: true,
|
|
225
|
|
- message: '请选择',
|
|
226
|
|
- trigger: 'change'
|
|
|
175
|
+ value: '电脑',
|
|
|
176
|
+ label: '电脑'
|
|
|
177
|
+ },
|
|
|
178
|
+ {
|
|
|
179
|
+ value: '微信',
|
|
|
180
|
+ label: '微信'
|
|
227
|
181
|
}
|
|
228
|
182
|
],
|
|
229
|
|
- deptid: [
|
|
230
|
|
- {
|
|
|
183
|
+ hospitalsParam: {
|
|
|
184
|
+ id: 0,
|
|
|
185
|
+ name: ''
|
|
|
186
|
+ },
|
|
|
187
|
+ departmentsParam: {
|
|
|
188
|
+ id: 0,
|
|
|
189
|
+ name: ''
|
|
|
190
|
+ },
|
|
|
191
|
+ repairmanParam: {
|
|
|
192
|
+ id: 0,
|
|
|
193
|
+ name: ''
|
|
|
194
|
+ },
|
|
|
195
|
+ rules: {
|
|
|
196
|
+ type: [{
|
|
231
|
197
|
required: true,
|
|
232
|
198
|
message: '请选择',
|
|
233
|
199
|
trigger: 'change'
|
|
234
|
|
- }
|
|
235
|
|
- ],
|
|
236
|
|
- needman: [
|
|
237
|
|
- {
|
|
|
200
|
+ }],
|
|
|
201
|
+ deptid: [{
|
|
238
|
202
|
required: true,
|
|
239
|
203
|
message: '请选择',
|
|
240
|
204
|
trigger: 'change'
|
|
241
|
|
- }
|
|
242
|
|
- ],
|
|
243
|
|
- cartype: [
|
|
244
|
|
- {
|
|
|
205
|
+ }],
|
|
|
206
|
+ needman: [{
|
|
245
|
207
|
required: true,
|
|
246
|
208
|
message: '请选择',
|
|
247
|
209
|
trigger: 'change'
|
|
248
|
|
- }
|
|
249
|
|
- ],
|
|
250
|
|
- // usertime: [{
|
|
251
|
|
- // type: 'string',
|
|
252
|
|
- // required: true,
|
|
253
|
|
- // message: '请选择',
|
|
254
|
|
- // trigger: 'change'
|
|
255
|
|
- // }],
|
|
256
|
|
- phon: [
|
|
257
|
|
- {
|
|
|
210
|
+ }],
|
|
|
211
|
+ cartype: [{
|
|
258
|
212
|
required: true,
|
|
259
|
|
- message: '请输入联系电话',
|
|
260
|
|
- trigger: 'blur'
|
|
261
|
|
- },
|
|
262
|
|
- {
|
|
263
|
|
- pattern: /^((0\d{2,3}-\d{5,8})|(1[345789]\d{9}))$/,
|
|
264
|
|
- message: '请输入正确的电话号码或者固话号码',
|
|
265
|
|
- trigger: 'blur'
|
|
266
|
|
- }
|
|
267
|
|
- ],
|
|
268
|
|
- startplace: [
|
|
269
|
|
- {
|
|
|
213
|
+ message: '请选择',
|
|
|
214
|
+ trigger: 'change'
|
|
|
215
|
+ }],
|
|
|
216
|
+ // usertime: [{
|
|
|
217
|
+ // type: 'string',
|
|
|
218
|
+ // required: true,
|
|
|
219
|
+ // message: '请选择',
|
|
|
220
|
+ // trigger: 'change'
|
|
|
221
|
+ // }],
|
|
|
222
|
+ phon: [{
|
|
|
223
|
+ required: true,
|
|
|
224
|
+ message: '请输入联系电话',
|
|
|
225
|
+ trigger: 'blur'
|
|
|
226
|
+ },
|
|
|
227
|
+ {
|
|
|
228
|
+ pattern: /^((0\d{2,3}-\d{5,8})|(1[345789]\d{9}))$/,
|
|
|
229
|
+ message: '请输入正确的电话号码或者固话号码',
|
|
|
230
|
+ trigger: 'blur'
|
|
|
231
|
+ }
|
|
|
232
|
+ ],
|
|
|
233
|
+ startplace: [{
|
|
270
|
234
|
required: true,
|
|
271
|
235
|
message: '请输入',
|
|
272
|
236
|
trigger: 'blur'
|
|
273
|
|
- }
|
|
274
|
|
- ],
|
|
275
|
|
- endplace: [
|
|
276
|
|
- {
|
|
|
237
|
+ }],
|
|
|
238
|
+ endplace: [{
|
|
277
|
239
|
required: true,
|
|
278
|
240
|
message: '请输入',
|
|
279
|
241
|
trigger: 'blur'
|
|
280
|
|
- }
|
|
281
|
|
- ],
|
|
282
|
|
- content: [
|
|
283
|
|
- {
|
|
|
242
|
+ }],
|
|
|
243
|
+ content: [{
|
|
284
|
244
|
required: true,
|
|
285
|
245
|
message: '请输入',
|
|
286
|
246
|
trigger: 'blur'
|
|
287
|
|
- }
|
|
288
|
|
- ]
|
|
289
|
|
- },
|
|
290
|
|
- ruleForm: {
|
|
291
|
|
- F_ID: '',
|
|
292
|
|
- startplace: '',
|
|
293
|
|
- endplace: '',
|
|
294
|
|
- source: '',
|
|
295
|
|
- hosid: '', // 院区id
|
|
296
|
|
- hosname: '', // 院区id
|
|
297
|
|
- deptid: '', // 申请科室id
|
|
298
|
|
- deptname: '', // 申请科室名称
|
|
299
|
|
- usercode: '', // 申请人编码
|
|
300
|
|
- username: '', // 申请人
|
|
301
|
|
- needman: '',
|
|
302
|
|
- birth: '',
|
|
303
|
|
- phon: '',
|
|
304
|
|
- type: '',
|
|
305
|
|
- cartype: '',
|
|
306
|
|
- F_CarMessage: '',
|
|
307
|
|
- remark: '',
|
|
308
|
|
- content: '',
|
|
309
|
|
- EmergencyTypes: '一般',
|
|
310
|
|
- type2Arr: []
|
|
311
|
|
- },
|
|
312
|
|
- deptid: [],
|
|
313
|
|
- usercodeSearch: '',
|
|
314
|
|
- loading: false
|
|
315
|
|
- }
|
|
316
|
|
- },
|
|
317
|
|
- watch: {
|
|
318
|
|
- 'orderTypeData.F_Type2': function() {
|
|
319
|
|
- console.log(this.orderTypeData.type2Arr)
|
|
320
|
|
- this.ruleForm.type2Arr = this.orderTypeData.type2Arr
|
|
321
|
|
- // this.ruleForm.F_Type2 = this.orderTypeData.F_Type2
|
|
322
|
|
- // this.ruleForm.identification = this.orderTypeData.identification
|
|
323
|
|
- }
|
|
324
|
|
- },
|
|
325
|
|
- created() {
|
|
326
|
|
- this.cid = this.callid
|
|
327
|
|
- if (!this.cid) {
|
|
328
|
|
- this.cid = window.localStorage.getItem('callidSave')
|
|
329
|
|
- }
|
|
330
|
|
- this.getTypeOrder()
|
|
331
|
|
- this.getCarlist()
|
|
332
|
|
- if (this.wocode) {
|
|
333
|
|
- this.wocode = this.wocode
|
|
334
|
|
- this.getDetail('0')
|
|
335
|
|
- }
|
|
336
|
|
- if (this.wid) {
|
|
337
|
|
- this.wocode = this.wid
|
|
338
|
|
- this.getDetail('0')
|
|
339
|
|
- }
|
|
340
|
|
- if (this.iswomanage === '1') {
|
|
341
|
|
- const dept = this.$store.getters.teamId
|
|
342
|
|
- this.deptid = this.$store.getters.deptmap[parseInt(dept)].ids
|
|
343
|
|
- this.ruleForm.hosid = this.$store.getters.deptmap[parseInt(dept)].ids[0]
|
|
344
|
|
- this.ruleForm.deptid = dept
|
|
345
|
|
- this.getRepairman(dept)
|
|
346
|
|
- this.ruleForm.needman = this.$store.getters.usercode
|
|
347
|
|
- this.ruleForm.phon = this.$store.getters.mobile
|
|
348
|
|
- }
|
|
349
|
|
- },
|
|
350
|
|
- methods: {
|
|
351
|
|
- getUserData() {
|
|
352
|
|
- const params = {
|
|
353
|
|
- usercode: this.usercodeSearch
|
|
|
247
|
+ }]
|
|
|
248
|
+ },
|
|
|
249
|
+ ruleForm: {
|
|
|
250
|
+ F_ID: '',
|
|
|
251
|
+ startplace: '',
|
|
|
252
|
+ endplace: '',
|
|
|
253
|
+ source: '',
|
|
|
254
|
+ hosid: '', // 院区id
|
|
|
255
|
+ hosname: '', // 院区id
|
|
|
256
|
+ deptid: '', // 申请科室id
|
|
|
257
|
+ deptname: '', // 申请科室名称
|
|
|
258
|
+ usercode: '', // 申请人编码
|
|
|
259
|
+ username: '', // 申请人
|
|
|
260
|
+ needman: '',
|
|
|
261
|
+ birth: '',
|
|
|
262
|
+ phon: '',
|
|
|
263
|
+ type: '',
|
|
|
264
|
+ cartype: '',
|
|
|
265
|
+ F_CarMessage: '',
|
|
|
266
|
+ remark: '',
|
|
|
267
|
+ content: '',
|
|
|
268
|
+ EmergencyTypes: '一般',
|
|
|
269
|
+ type2Arr: []
|
|
|
270
|
+ },
|
|
|
271
|
+ deptid: [],
|
|
|
272
|
+ usercodeSearch: '',
|
|
|
273
|
+ loading: false
|
|
354
|
274
|
}
|
|
355
|
|
- getUserMsg(params).then(res => {
|
|
356
|
|
- const data = res.data
|
|
357
|
|
- this.ruleForm.deptid = data.F_DeptId
|
|
358
|
|
- this.deptid = this.$store.getters.deptmap[parseInt(data.F_DeptId)].ids
|
|
359
|
|
- this.ruleForm.hosid = this.$store.getters.deptmap[parseInt(data.F_DeptId)].ids[0]
|
|
360
|
|
- this.getRepairman(data.F_DeptId)
|
|
361
|
|
- this.ruleForm.needman = data.F_UserCode
|
|
362
|
|
- this.ruleForm.phon = data.F_Telephone
|
|
363
|
|
- })
|
|
364
|
|
- },
|
|
365
|
|
- // 获取申请人数据
|
|
366
|
|
- getRepairman(id) {
|
|
367
|
|
- return new Promise((resolve) => {
|
|
368
|
|
- const params = {
|
|
369
|
|
- deptid: id // 字典管理的工单标识
|
|
370
|
|
- }
|
|
371
|
|
- GetPerson(params).then((res) => {
|
|
372
|
|
- this.repairman = res.rows
|
|
373
|
|
- })
|
|
374
|
|
- resolve()
|
|
375
|
|
- })
|
|
376
|
275
|
},
|
|
377
|
|
- // 申请人
|
|
378
|
|
- changeRepairman(data) {
|
|
379
|
|
- this.ruleForm.needman = data
|
|
380
|
|
- const user = this.repairman.find((o) => {
|
|
381
|
|
- return o.usercode === data.toString()
|
|
382
|
|
- })
|
|
383
|
|
- if (user) {
|
|
384
|
|
- this.ruleForm.phon = user.usertelphone
|
|
|
276
|
+ watch: {
|
|
|
277
|
+ 'orderTypeData.F_Type2': function() {
|
|
|
278
|
+ console.log(this.orderTypeData.type2Arr)
|
|
|
279
|
+ this.ruleForm.type2Arr = this.orderTypeData.type2Arr
|
|
|
280
|
+ this.worktypeInfo = this.$store.getters.workTypeMap[parseInt(this.orderTypeData.type2Arr[0])].tag
|
|
|
281
|
+ // this.ruleForm.F_Type2 = this.orderTypeData.F_Type2
|
|
|
282
|
+ // this.ruleForm.identification = this.orderTypeData.identification
|
|
385
|
283
|
}
|
|
386
|
284
|
},
|
|
387
|
|
- getCarlist() {
|
|
388
|
|
- const params = {
|
|
389
|
|
- Flag: 'CLLX',
|
|
390
|
|
- Name: ''
|
|
|
285
|
+ created() {
|
|
|
286
|
+ this.cid = this.callid
|
|
|
287
|
+ if (!this.cid) {
|
|
|
288
|
+ this.cid = window.localStorage.getItem('callidSave')
|
|
391
|
289
|
}
|
|
392
|
|
- getCartype(params).then((res) => {
|
|
393
|
|
- this.carArr = res.rows
|
|
394
|
|
- })
|
|
395
|
|
- },
|
|
396
|
|
- getTypeOrder() {
|
|
397
|
|
- const params = {
|
|
398
|
|
- pid: 2,
|
|
399
|
|
- typeid: 4000
|
|
|
290
|
+ this.getTypeOrder()
|
|
|
291
|
+ this.getCarlist()
|
|
|
292
|
+ if (this.wocode) {
|
|
|
293
|
+ this.wocode = this.wocode
|
|
|
294
|
+ this.getDetail('0')
|
|
|
295
|
+ }
|
|
|
296
|
+ if (this.wid) {
|
|
|
297
|
+ this.wocode = this.wid
|
|
|
298
|
+ this.getDetail('0')
|
|
|
299
|
+ }
|
|
|
300
|
+ if (this.iswomanage === '1') {
|
|
|
301
|
+ const dept = this.$store.getters.teamId
|
|
|
302
|
+ this.deptid = this.$store.getters.deptmap[parseInt(dept)].ids
|
|
|
303
|
+ this.ruleForm.hosid = this.$store.getters.deptmap[parseInt(dept)].ids[0]
|
|
|
304
|
+ this.ruleForm.deptid = dept
|
|
|
305
|
+ this.getRepairman(dept)
|
|
|
306
|
+ this.ruleForm.needman = this.$store.getters.usercode
|
|
|
307
|
+ this.ruleForm.phon = this.$store.getters.mobile
|
|
400
|
308
|
}
|
|
401
|
|
- getOrderTypeList(params.pid, params.typeid).then((res) => {
|
|
402
|
|
- this.typeList = res.rows
|
|
403
|
|
- })
|
|
404
|
|
- },
|
|
405
|
|
- getDeptid(data) {
|
|
406
|
|
- this.ruleForm.hosid = data[0]
|
|
407
|
|
- this.ruleForm.deptid = data[data.length - 1]
|
|
408
|
|
- this.deptid = data
|
|
409
|
|
- this.getRepairman(data[data.length - 1])
|
|
410
|
309
|
},
|
|
411
|
|
- submitForm() {
|
|
412
|
|
- this.$refs.ruleForm.validate((valid) => {
|
|
413
|
|
- if (valid) {
|
|
414
|
|
- // 添加
|
|
415
|
|
- if (!this.wid) {
|
|
416
|
|
- const datas = {
|
|
417
|
|
- callid: this.cid,
|
|
418
|
|
- LeaveRecordId: this.fid,
|
|
419
|
|
- type: this.orderTypeData.type2Arr[
|
|
420
|
|
- this.orderTypeData.type2Arr.length - 1
|
|
421
|
|
- ],
|
|
422
|
|
- hosid: this.ruleForm.hosid, // 院区id
|
|
423
|
|
- detpid: this.ruleForm.deptid, // 申请科室id
|
|
424
|
|
- startplace: this.ruleForm.startplace,
|
|
425
|
|
- endplace: this.ruleForm.endplace,
|
|
426
|
|
- needman: this.ruleForm.needman, // 申请人
|
|
427
|
|
- phon: this.ruleForm.phon,
|
|
428
|
|
- cartype: this.ruleForm.cartype,
|
|
429
|
|
- usertime: this.ruleForm.usertime,
|
|
430
|
|
- birth: this.ruleForm.birth,
|
|
431
|
|
- EmergencyTypes: this.ruleForm.EmergencyTypes,
|
|
432
|
|
- content: this.ruleForm.content // 备注
|
|
|
310
|
+ methods: {
|
|
|
311
|
+ getUserData() {
|
|
|
312
|
+ const params = {
|
|
|
313
|
+ usercode: this.usercodeSearch
|
|
|
314
|
+ }
|
|
|
315
|
+ getUserMsg(params).then(res => {
|
|
|
316
|
+ const data = res.data
|
|
|
317
|
+ this.ruleForm.deptid = data.F_DeptId
|
|
|
318
|
+ this.deptid = this.$store.getters.deptmap[parseInt(data.F_DeptId)].ids
|
|
|
319
|
+ this.ruleForm.hosid = this.$store.getters.deptmap[parseInt(data.F_DeptId)].ids[0]
|
|
|
320
|
+ this.getRepairman(data.F_DeptId)
|
|
|
321
|
+ this.ruleForm.needman = data.F_UserCode
|
|
|
322
|
+ this.ruleForm.phon = data.F_Telephone
|
|
|
323
|
+ })
|
|
|
324
|
+ },
|
|
|
325
|
+ // 获取申请人数据
|
|
|
326
|
+ getRepairman(id) {
|
|
|
327
|
+ return new Promise((resolve) => {
|
|
|
328
|
+ const params = {
|
|
|
329
|
+ deptid: id // 字典管理的工单标识
|
|
|
330
|
+ }
|
|
|
331
|
+ GetPerson(params).then((res) => {
|
|
|
332
|
+ this.repairman = res.rows
|
|
|
333
|
+ })
|
|
|
334
|
+ resolve()
|
|
|
335
|
+ })
|
|
|
336
|
+ },
|
|
|
337
|
+ // 申请人
|
|
|
338
|
+ changeRepairman(data) {
|
|
|
339
|
+ this.ruleForm.needman = data
|
|
|
340
|
+ const user = this.repairman.find((o) => {
|
|
|
341
|
+ return o.usercode === data.toString()
|
|
|
342
|
+ })
|
|
|
343
|
+ if (user) {
|
|
|
344
|
+ this.ruleForm.phon = user.usertelphone
|
|
|
345
|
+ }
|
|
|
346
|
+ },
|
|
|
347
|
+ getCarlist() {
|
|
|
348
|
+ const params = {
|
|
|
349
|
+ Flag: 'CLLX',
|
|
|
350
|
+ Name: ''
|
|
|
351
|
+ }
|
|
|
352
|
+ getCartype(params).then((res) => {
|
|
|
353
|
+ this.carArr = res.rows
|
|
|
354
|
+ })
|
|
|
355
|
+ },
|
|
|
356
|
+ getTypeOrder() {
|
|
|
357
|
+ const params = {
|
|
|
358
|
+ pid: 2,
|
|
|
359
|
+ typeid: 4000
|
|
|
360
|
+ }
|
|
|
361
|
+ getOrderTypeList(params.pid, params.typeid).then((res) => {
|
|
|
362
|
+ this.typeList = res.rows
|
|
|
363
|
+ })
|
|
|
364
|
+ },
|
|
|
365
|
+ getDeptid(data) {
|
|
|
366
|
+ this.ruleForm.hosid = data[0]
|
|
|
367
|
+ this.ruleForm.deptid = data[data.length - 1]
|
|
|
368
|
+ this.deptid = data
|
|
|
369
|
+ this.getRepairman(data[data.length - 1])
|
|
|
370
|
+ },
|
|
|
371
|
+ submitForm() {
|
|
|
372
|
+ this.$refs.ruleForm.validate((valid) => {
|
|
|
373
|
+ if (valid) {
|
|
|
374
|
+ // 添加
|
|
|
375
|
+ if (!this.wid) {
|
|
|
376
|
+ const datas = {
|
|
|
377
|
+ callid: this.cid,
|
|
|
378
|
+ LeaveRecordId: this.fid,
|
|
|
379
|
+ type: this.orderTypeData.type2Arr[
|
|
|
380
|
+ this.orderTypeData.type2Arr.length - 1
|
|
|
381
|
+ ],
|
|
|
382
|
+ hosid: this.ruleForm.hosid, // 院区id
|
|
|
383
|
+ detpid: this.ruleForm.deptid, // 申请科室id
|
|
|
384
|
+ startplace: this.ruleForm.startplace,
|
|
|
385
|
+ endplace: this.ruleForm.endplace,
|
|
|
386
|
+ needman: this.ruleForm.needman, // 申请人
|
|
|
387
|
+ phon: this.ruleForm.phon,
|
|
|
388
|
+ cartype: this.ruleForm.cartype,
|
|
|
389
|
+ usertime: this.ruleForm.usertime,
|
|
|
390
|
+ birth: this.ruleForm.birth,
|
|
|
391
|
+ EmergencyTypes: this.ruleForm.EmergencyTypes,
|
|
|
392
|
+ content: this.ruleForm.content // 备注
|
|
|
393
|
+ }
|
|
|
394
|
+ getAddWorkOrder(datas)
|
|
|
395
|
+ .then((response) => {
|
|
|
396
|
+ this.loading = false
|
|
|
397
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
398
|
+ this.$parent.$layer.closeAll()
|
|
|
399
|
+ // this.$parent.$layer.close(this.layerid)
|
|
|
400
|
+ // this.$parent.$parent.getList() // 重新加载父级数据
|
|
|
401
|
+ this.$message({
|
|
|
402
|
+ message: '恭喜你,添加工单成功!',
|
|
|
403
|
+ type: 'success',
|
|
|
404
|
+ duration: 1000
|
|
|
405
|
+ })
|
|
|
406
|
+ this.$refs.ruleForm.resetFields()
|
|
|
407
|
+ this.usercodeSearch = ''
|
|
|
408
|
+ this.deptid = []
|
|
|
409
|
+ }
|
|
|
410
|
+ })
|
|
|
411
|
+ .catch(() => {
|
|
|
412
|
+ this.loading = false
|
|
|
413
|
+ })
|
|
|
414
|
+ } else {
|
|
|
415
|
+ // 编辑
|
|
|
416
|
+ const datas = {
|
|
|
417
|
+ WorkOrderCode: this.wocode,
|
|
|
418
|
+ type: this.type,
|
|
|
419
|
+ hosid: this.ruleForm.hosid, // 院区id
|
|
|
420
|
+ detpid: this.ruleForm.deptid, // 申请科室id
|
|
|
421
|
+ startplace: this.ruleForm.startplace,
|
|
|
422
|
+ endplace: this.ruleForm.endplace,
|
|
|
423
|
+ needman: this.ruleForm.needman, // 申请人
|
|
|
424
|
+ phon: this.ruleForm.phon,
|
|
|
425
|
+ cartype: this.ruleForm.cartype,
|
|
|
426
|
+ usertime: this.ruleForm.usertime,
|
|
|
427
|
+ birth: this.ruleForm.birth,
|
|
|
428
|
+ EmergencyTypes: this.ruleForm.EmergencyTypes,
|
|
|
429
|
+ content: this.ruleForm.content // 备注
|
|
|
430
|
+ }
|
|
|
431
|
+ getUpdateWorkOrder(datas)
|
|
|
432
|
+ .then((response) => {
|
|
|
433
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
434
|
+ // this.$parent.$layer.closeAll()
|
|
|
435
|
+ // this.$parent.$layer.close(this.layerid)
|
|
|
436
|
+ // this.$parent.$parent.getList() // 重新加载父级数据
|
|
|
437
|
+ this.$emit('closeLayer')
|
|
|
438
|
+ this.usercodeSearch = ''
|
|
|
439
|
+ this.$message({
|
|
|
440
|
+ message: '恭喜你,编辑工单成功!',
|
|
|
441
|
+ type: 'success',
|
|
|
442
|
+ duration: 1000
|
|
|
443
|
+ })
|
|
|
444
|
+ }
|
|
|
445
|
+ })
|
|
|
446
|
+ .catch(() => {})
|
|
433
|
447
|
}
|
|
434
|
|
- getAddWorkOrder(datas)
|
|
435
|
|
- .then((response) => {
|
|
436
|
|
- this.loading = false
|
|
437
|
|
- if (response.state.toLowerCase() === 'success') {
|
|
438
|
|
- this.$parent.$layer.closeAll()
|
|
439
|
|
- // this.$parent.$layer.close(this.layerid)
|
|
440
|
|
- // this.$parent.$parent.getList() // 重新加载父级数据
|
|
441
|
|
- this.$message({
|
|
442
|
|
- message: '恭喜你,添加工单成功!',
|
|
443
|
|
- type: 'success',
|
|
444
|
|
- duration: 1000
|
|
445
|
|
- })
|
|
446
|
|
- this.$refs.ruleForm.resetFields()
|
|
447
|
|
- this.usercodeSearch = ''
|
|
448
|
|
- this.deptid = []
|
|
449
|
|
- }
|
|
450
|
|
- })
|
|
451
|
|
- .catch(() => {
|
|
452
|
|
- this.loading = false
|
|
453
|
|
- })
|
|
454
|
448
|
} else {
|
|
455
|
|
- // 编辑
|
|
456
|
|
- const datas = {
|
|
457
|
|
- WorkOrderCode: this.wocode,
|
|
458
|
|
- type: this.type,
|
|
459
|
|
- hosid: this.ruleForm.hosid, // 院区id
|
|
460
|
|
- detpid: this.ruleForm.deptid, // 申请科室id
|
|
461
|
|
- startplace: this.ruleForm.startplace,
|
|
462
|
|
- endplace: this.ruleForm.endplace,
|
|
463
|
|
- needman: this.ruleForm.needman, // 申请人
|
|
464
|
|
- phon: this.ruleForm.phon,
|
|
465
|
|
- cartype: this.ruleForm.cartype,
|
|
466
|
|
- usertime: this.ruleForm.usertime,
|
|
467
|
|
- birth: this.ruleForm.birth,
|
|
468
|
|
- EmergencyTypes: this.ruleForm.EmergencyTypes,
|
|
469
|
|
- content: this.ruleForm.content // 备注
|
|
470
|
|
- }
|
|
471
|
|
- getUpdateWorkOrder(datas)
|
|
472
|
|
- .then((response) => {
|
|
473
|
|
- if (response.state.toLowerCase() === 'success') {
|
|
474
|
|
- // this.$parent.$layer.closeAll()
|
|
475
|
|
- // this.$parent.$layer.close(this.layerid)
|
|
476
|
|
- // this.$parent.$parent.getList() // 重新加载父级数据
|
|
477
|
|
- this.$emit('closeLayer')
|
|
478
|
|
- this.usercodeSearch = ''
|
|
479
|
|
- this.$message({
|
|
480
|
|
- message: '恭喜你,编辑工单成功!',
|
|
481
|
|
- type: 'success',
|
|
482
|
|
- duration: 1000
|
|
483
|
|
- })
|
|
484
|
|
- }
|
|
485
|
|
- })
|
|
486
|
|
- .catch(() => {})
|
|
|
449
|
+ this.$message.error('请输入有效的必填项信息!')
|
|
|
450
|
+ return false
|
|
487
|
451
|
}
|
|
488
|
|
- } else {
|
|
489
|
|
- this.$message.error('请输入有效的必填项信息!')
|
|
490
|
|
- return false
|
|
491
|
|
- }
|
|
492
|
|
- })
|
|
493
|
|
- },
|
|
494
|
|
- resetForm() {
|
|
495
|
|
- this.$refs.ruleForm.resetFields()
|
|
496
|
|
- },
|
|
|
452
|
+ })
|
|
|
453
|
+ },
|
|
|
454
|
+ resetForm() {
|
|
|
455
|
+ this.$refs.ruleForm.resetFields()
|
|
|
456
|
+ },
|
|
497
|
457
|
|
|
498
|
|
- // 获取详情
|
|
499
|
|
- getDetail(num) {
|
|
500
|
|
- const params = {
|
|
501
|
|
- // orderid: this.rowid,
|
|
502
|
|
- WorkOrderCode: this.wocode,
|
|
503
|
|
- type: num
|
|
504
|
|
- }
|
|
505
|
|
- getModelDetail(params).then((response) => {
|
|
506
|
|
- if (response.state.toLowerCase() === 'success') {
|
|
507
|
|
- const res = response.model
|
|
508
|
|
- this.getRepairman(res.F_ProposerDeptId)
|
|
509
|
|
- this.ruleForm.F_ID = res.F_ID
|
|
510
|
|
- this.ruleForm.type = res.F_Type
|
|
511
|
|
- this.type = res.F_Type
|
|
512
|
|
- this.hospitalsParam.id = res.F_HosId
|
|
513
|
|
- this.hospitalsParam.name = res.HosName
|
|
514
|
|
- this.departmentsParam.id = res.F_ProposerDeptId
|
|
515
|
|
- this.departmentsParam.name = res.F_ProposerDeptName
|
|
516
|
|
- this.repairmanParam.id = res.F_ProposerCode
|
|
517
|
|
- this.repairmanParam.name = res.F_ProposerName
|
|
518
|
|
- this.ruleForm.username = res.F_ProposerName
|
|
519
|
|
- this.ruleForm.hosid = res.F_HosId
|
|
520
|
|
- this.ruleForm.hosname = res.HosName
|
|
521
|
|
- this.ruleForm.deptid = res.F_ProposerDeptId
|
|
522
|
|
- this.ruleForm.deptname = res.F_ProposerDeptName
|
|
523
|
|
- this.ruleForm.usercode = res.F_ProposerCode
|
|
524
|
|
- this.ruleForm.username = res.F_ProposerName
|
|
525
|
|
- this.ruleForm.phon = res.F_Phon
|
|
526
|
|
- this.ruleForm.cartype = res.F_CarType
|
|
527
|
|
- this.ruleForm.startplace = res.F_DepartPlace
|
|
528
|
|
- this.ruleForm.endplace = res.F_Destination
|
|
529
|
|
- this.ruleForm.F_CarMessage = res.F_CarMessage
|
|
530
|
|
- this.ruleForm.remark = res.F_Remark
|
|
531
|
|
- this.ruleForm.usertime = res.F_UseTime
|
|
532
|
|
- this.ruleForm.birth = res.F_Birth
|
|
533
|
|
- this.ruleForm.content = res.F_Content
|
|
534
|
|
- this.deptid =
|
|
535
|
|
- this.$store.getters.deptmap[parseInt(res.F_ProposerDeptId)].ids
|
|
536
|
|
- this.ruleForm.needman = res.F_ProposerCode
|
|
|
458
|
+ // 获取详情
|
|
|
459
|
+ getDetail(num) {
|
|
|
460
|
+ const params = {
|
|
|
461
|
+ // orderid: this.rowid,
|
|
|
462
|
+ WorkOrderCode: this.wocode,
|
|
|
463
|
+ type: num
|
|
537
|
464
|
}
|
|
538
|
|
- })
|
|
|
465
|
+ getModelDetail(params).then((response) => {
|
|
|
466
|
+ if (response.state.toLowerCase() === 'success') {
|
|
|
467
|
+ const res = response.model
|
|
|
468
|
+ this.getRepairman(res.F_ProposerDeptId)
|
|
|
469
|
+ this.ruleForm.F_ID = res.F_ID
|
|
|
470
|
+ this.ruleForm.type = res.F_Type
|
|
|
471
|
+ this.type = res.F_Type
|
|
|
472
|
+ this.hospitalsParam.id = res.F_HosId
|
|
|
473
|
+ this.hospitalsParam.name = res.HosName
|
|
|
474
|
+ this.departmentsParam.id = res.F_ProposerDeptId
|
|
|
475
|
+ this.departmentsParam.name = res.F_ProposerDeptName
|
|
|
476
|
+ this.repairmanParam.id = res.F_ProposerCode
|
|
|
477
|
+ this.repairmanParam.name = res.F_ProposerName
|
|
|
478
|
+ this.ruleForm.username = res.F_ProposerName
|
|
|
479
|
+ this.ruleForm.hosid = res.F_HosId
|
|
|
480
|
+ this.ruleForm.hosname = res.HosName
|
|
|
481
|
+ this.ruleForm.deptid = res.F_ProposerDeptId
|
|
|
482
|
+ this.ruleForm.deptname = res.F_ProposerDeptName
|
|
|
483
|
+ this.ruleForm.usercode = res.F_ProposerCode
|
|
|
484
|
+ this.ruleForm.username = res.F_ProposerName
|
|
|
485
|
+ this.ruleForm.phon = res.F_Phon
|
|
|
486
|
+ this.ruleForm.cartype = res.F_CarType
|
|
|
487
|
+ this.ruleForm.startplace = res.F_DepartPlace
|
|
|
488
|
+ this.ruleForm.endplace = res.F_Destination
|
|
|
489
|
+ this.ruleForm.F_CarMessage = res.F_CarMessage
|
|
|
490
|
+ this.ruleForm.remark = res.F_Remark
|
|
|
491
|
+ this.ruleForm.usertime = res.F_UseTime
|
|
|
492
|
+ this.ruleForm.birth = res.F_Birth
|
|
|
493
|
+ this.ruleForm.content = res.F_Content
|
|
|
494
|
+ this.deptid =
|
|
|
495
|
+ this.$store.getters.deptmap[parseInt(res.F_ProposerDeptId)].ids
|
|
|
496
|
+ this.ruleForm.needman = res.F_ProposerCode
|
|
|
497
|
+ }
|
|
|
498
|
+ })
|
|
|
499
|
+ }
|
|
|
500
|
+ // 科室下拉改变事件
|
|
|
501
|
+ // getDepartments(data) {
|
|
|
502
|
+ // this.ruleForm.deptid = data.value
|
|
|
503
|
+ // this.ruleForm.deptname = data.name
|
|
|
504
|
+ // },
|
|
|
505
|
+ // 院区下拉改变事件
|
|
|
506
|
+ // getHospitals(data) {
|
|
|
507
|
+ // this.ruleForm.hosid = data.value
|
|
|
508
|
+ // this.ruleForm.hosname = data.name
|
|
|
509
|
+ // },
|
|
|
510
|
+ // 申请人下拉改变事件
|
|
|
511
|
+ // getRepairman(data) {
|
|
|
512
|
+ // this.ruleForm.usercode = data.value
|
|
|
513
|
+ // this.ruleForm.username = data.name
|
|
|
514
|
+ // },
|
|
539
|
515
|
}
|
|
540
|
|
- // 科室下拉改变事件
|
|
541
|
|
- // getDepartments(data) {
|
|
542
|
|
- // this.ruleForm.deptid = data.value
|
|
543
|
|
- // this.ruleForm.deptname = data.name
|
|
544
|
|
- // },
|
|
545
|
|
- // 院区下拉改变事件
|
|
546
|
|
- // getHospitals(data) {
|
|
547
|
|
- // this.ruleForm.hosid = data.value
|
|
548
|
|
- // this.ruleForm.hosname = data.name
|
|
549
|
|
- // },
|
|
550
|
|
- // 申请人下拉改变事件
|
|
551
|
|
- // getRepairman(data) {
|
|
552
|
|
- // this.ruleForm.usercode = data.value
|
|
553
|
|
- // this.ruleForm.username = data.name
|
|
554
|
|
- // },
|
|
555
|
516
|
}
|
|
556
|
|
-}
|
|
557
|
517
|
</script>
|
|
558
|
518
|
|
|
559
|
519
|
<style rel="stylesheet/scss" lang="scss" scoped>
|