|
|
@@ -10,9 +10,15 @@
|
|
10
|
10
|
</el-col>
|
|
11
|
11
|
<el-col :span="12">
|
|
12
|
12
|
<el-form-item label="申请人" prop="repairmanid">
|
|
13
|
|
- <el-select v-model="ruleForm.repairmanid" placeholder="请选择申请人" style="width: 100%;"
|
|
|
13
|
+ <el-select
|
|
|
14
|
+ v-model="ruleForm.repairmanid"
|
|
|
15
|
+ placeholder="请选择申请人"
|
|
|
16
|
+ style="width: 100%;"
|
|
14
|
17
|
@change="changeRepairman">
|
|
15
|
|
- <el-option v-for="item in repairman" :key="item.usercode" :label="item.username"
|
|
|
18
|
+ <el-option
|
|
|
19
|
+ v-for="item in repairman"
|
|
|
20
|
+ :key="item.usercode"
|
|
|
21
|
+ :label="item.username"
|
|
16
|
22
|
:value="item.usercode" />
|
|
17
|
23
|
</el-select>
|
|
18
|
24
|
</el-form-item>
|
|
|
@@ -33,7 +39,9 @@
|
|
33
|
39
|
<el-row>
|
|
34
|
40
|
<el-col :span="24">
|
|
35
|
41
|
<el-form-item label="工单类别" prop="repairOrderType">
|
|
36
|
|
- <select-order-typeTwo :orderTypeparams='ruleForm.repairOrderType' :second-order-type="secondOrderType"
|
|
|
42
|
+ <select-order-typeTwo
|
|
|
43
|
+ :order-typeparams="ruleForm.repairOrderType"
|
|
|
44
|
+ :second-order-type="secondOrderType"
|
|
37
|
45
|
@post-second-order-type="getSecondOOrderType" />
|
|
38
|
46
|
</el-form-item>
|
|
39
|
47
|
</el-col>
|
|
|
@@ -41,8 +49,13 @@
|
|
41
|
49
|
<el-row>
|
|
42
|
50
|
<el-col :span="24">
|
|
43
|
51
|
<el-form-item label="报修内容" prop="repairCenter">
|
|
44
|
|
- <el-input v-model="ruleForm.repairCenter" :autosize="{ minRows: 4, maxRows: 8}" show-word-limit
|
|
45
|
|
- maxlength="100" type="textarea" placeholder="请输入报修内容" />
|
|
|
52
|
+ <el-input
|
|
|
53
|
+ v-model="ruleForm.repairCenter"
|
|
|
54
|
+ :autosize="{ minRows: 4, maxRows: 8}"
|
|
|
55
|
+ show-word-limit
|
|
|
56
|
+ maxlength="100"
|
|
|
57
|
+ type="textarea"
|
|
|
58
|
+ placeholder="请输入报修内容" />
|
|
46
|
59
|
</el-form-item>
|
|
47
|
60
|
</el-col>
|
|
48
|
61
|
</el-row>
|
|
|
@@ -62,7 +75,10 @@
|
|
62
|
75
|
<el-col :span="12">
|
|
63
|
76
|
<el-form-item label="指派人" prop="assignMant">
|
|
64
|
77
|
<el-select v-model="ruleForm.assignMant" placeholder="请选择指派人" style="width:100%;" @change="changeUser">
|
|
65
|
|
- <el-option v-for="item in assignman" :key="item.usercode" :label="item.username"
|
|
|
78
|
+ <el-option
|
|
|
79
|
+ v-for="item in assignman"
|
|
|
80
|
+ :key="item.usercode"
|
|
|
81
|
+ :label="item.username"
|
|
66
|
82
|
:value="item.usercode" />
|
|
67
|
83
|
</el-select>
|
|
68
|
84
|
</el-form-item>
|
|
|
@@ -71,7 +87,11 @@
|
|
71
|
87
|
<el-row>
|
|
72
|
88
|
<el-col :span="24">
|
|
73
|
89
|
<el-form-item label="附件图片" prop="repairImageid">
|
|
74
|
|
- <el-upload :headers="headers" :file-list="fileList" :on-success="handle_success" :action="imgUrl"
|
|
|
90
|
+ <el-upload
|
|
|
91
|
+ :headers="headers"
|
|
|
92
|
+ :file-list="fileList"
|
|
|
93
|
+ :on-success="handle_success"
|
|
|
94
|
+ :action="imgUrl"
|
|
75
|
95
|
list-type="picture-card">
|
|
76
|
96
|
<i class="el-icon-plus" />
|
|
77
|
97
|
</el-upload>
|
|
|
@@ -88,308 +108,318 @@
|
|
88
|
108
|
</template>
|
|
89
|
109
|
|
|
90
|
110
|
<script>
|
|
91
|
|
- import selectDeptTree from '@/components/context/commonSelect/selectDeptTree.vue'
|
|
92
|
|
- import selectOrderTypeTwo from '@/components/context/commonSelect/selectOrderTypeTwo.vue'
|
|
93
|
|
- import {
|
|
94
|
|
- GetPerson
|
|
95
|
|
- } from '@/api/commonAPI'
|
|
96
|
|
- import {
|
|
97
|
|
- GetFaultRepairDetail,
|
|
98
|
|
- UpdateFaultRepair
|
|
99
|
|
- } from '@/api/orderManagement/orderList'
|
|
100
|
|
- import {
|
|
101
|
|
- getAddRepairbase
|
|
102
|
|
- } from '@/api/faultRepairManagement/faultRepair'
|
|
103
|
|
- export default {
|
|
104
|
|
- name: 'AddRepairbase',
|
|
105
|
|
- components: {
|
|
106
|
|
- selectDeptTree,
|
|
107
|
|
- selectOrderTypeTwo
|
|
|
111
|
+import selectDeptTree from '@/components/context/commonSelect/selectDeptTree.vue'
|
|
|
112
|
+import selectOrderTypeTwo from '@/components/context/commonSelect/selectOrderTypeTwo.vue'
|
|
|
113
|
+import {
|
|
|
114
|
+ GetPerson
|
|
|
115
|
+} from '@/api/commonAPI'
|
|
|
116
|
+import {
|
|
|
117
|
+ GetFaultRepairDetail,
|
|
|
118
|
+ UpdateFaultRepair
|
|
|
119
|
+} from '@/api/orderManagement/orderList'
|
|
|
120
|
+import {
|
|
|
121
|
+ getAddRepairbase
|
|
|
122
|
+} from '@/api/faultRepairManagement/faultRepair'
|
|
|
123
|
+export default {
|
|
|
124
|
+ name: 'AddRepairbase',
|
|
|
125
|
+ components: {
|
|
|
126
|
+ selectDeptTree,
|
|
|
127
|
+ selectOrderTypeTwo
|
|
|
128
|
+ },
|
|
|
129
|
+ props: {
|
|
|
130
|
+ wid: {
|
|
|
131
|
+ type: String,
|
|
|
132
|
+ default: ''
|
|
108
|
133
|
},
|
|
109
|
|
- props: {
|
|
110
|
|
- wid: {
|
|
111
|
|
- type: String,
|
|
112
|
|
- default: ''
|
|
113
|
|
- },
|
|
114
|
|
- fid: {
|
|
115
|
|
- type: String,
|
|
116
|
|
- default: ''
|
|
|
134
|
+ fid: {
|
|
|
135
|
+ type: String,
|
|
|
136
|
+ default: ''
|
|
|
137
|
+ },
|
|
|
138
|
+ layerid: {
|
|
|
139
|
+ type: String,
|
|
|
140
|
+ default: ''
|
|
|
141
|
+ },
|
|
|
142
|
+ callid: {
|
|
|
143
|
+ type: String,
|
|
|
144
|
+ default: ''
|
|
|
145
|
+ },
|
|
|
146
|
+ iswomanage: {
|
|
|
147
|
+ type: String,
|
|
|
148
|
+ default: ''
|
|
|
149
|
+ }
|
|
|
150
|
+ },
|
|
|
151
|
+ data() {
|
|
|
152
|
+ return {
|
|
|
153
|
+ secondOrderType: {
|
|
|
154
|
+ typeid: 2,
|
|
|
155
|
+ pid: 3000
|
|
117
|
156
|
},
|
|
118
|
|
- layerid: {
|
|
119
|
|
- type: String,
|
|
120
|
|
- default: ''
|
|
|
157
|
+ orderarr: [],
|
|
|
158
|
+ ordertypeArr: [],
|
|
|
159
|
+ imgUrl: this.$store.getters.serverConfig.BASE_API + 'FaultRepair/UploadFile',
|
|
|
160
|
+ fileList: [],
|
|
|
161
|
+ repairman: [], // 申请人数据
|
|
|
162
|
+ deptidArr: [], // 申请部门默认值
|
|
|
163
|
+ assignman: [], // 指派人
|
|
|
164
|
+ assignArr: [], // 默认指派部门
|
|
|
165
|
+ ruleForm: {
|
|
|
166
|
+ repairDeptid: '', // 申请部门
|
|
|
167
|
+ repairmanid: '', // 申请人
|
|
|
168
|
+ repairmanphone: '', // 申请电话
|
|
|
169
|
+ repairmanCallNumber: '', // 联系电话
|
|
|
170
|
+ repairOrderType: [], // 工单类别
|
|
|
171
|
+ repairCenter: '', // 报修内容
|
|
|
172
|
+ repairAddress: '', // 报修地点
|
|
|
173
|
+ repairImageid: '', // 附件
|
|
|
174
|
+ repairOper: '0', // 下不流程
|
|
|
175
|
+ assignDepart: '', // 指派部门
|
|
|
176
|
+ assignMant: '' // 指派人
|
|
121
|
177
|
},
|
|
122
|
|
- callid: {
|
|
123
|
|
- type: String,
|
|
124
|
|
- default: ''
|
|
|
178
|
+ headers: {
|
|
|
179
|
+ Authorization: localStorage.getItem('Admin-Token')
|
|
125
|
180
|
},
|
|
126
|
|
- iswomanage: {
|
|
127
|
|
- type: String,
|
|
128
|
|
- default: ''
|
|
|
181
|
+ imageUrl: 'http://192.168.1.37:8000/FaultRepair/UploadFile',
|
|
|
182
|
+ rules: {
|
|
|
183
|
+ repairmanphone: [{
|
|
|
184
|
+ required: true,
|
|
|
185
|
+ message: '申请电话不能为空',
|
|
|
186
|
+ trigger: 'blur'
|
|
|
187
|
+ },
|
|
|
188
|
+ {
|
|
|
189
|
+ pattern: /^((0\d{2,3}-\d{5,8})|(1[345789]\d{9}))$/,
|
|
|
190
|
+ message: '请输入正确的电话号码或者固话号码',
|
|
|
191
|
+ trigger: 'blur'
|
|
|
192
|
+ }],
|
|
|
193
|
+ repairDeptid: [{
|
|
|
194
|
+ required: true,
|
|
|
195
|
+ message: '请选择申请部门',
|
|
|
196
|
+ trigger: 'change'
|
|
|
197
|
+ }],
|
|
|
198
|
+ repairmanid: [{
|
|
|
199
|
+ required: true,
|
|
|
200
|
+ message: '请选择申请人',
|
|
|
201
|
+ trigger: 'change'
|
|
|
202
|
+ }],
|
|
|
203
|
+ repairmanCallNumber: [{
|
|
|
204
|
+ required: true,
|
|
|
205
|
+ message: '请输入联系电话',
|
|
|
206
|
+ trigger: 'blur'
|
|
|
207
|
+ }],
|
|
|
208
|
+ repairOrderType: [{
|
|
|
209
|
+ required: true,
|
|
|
210
|
+ message: '请选择工单类别',
|
|
|
211
|
+ trigger: 'change'
|
|
|
212
|
+ }],
|
|
|
213
|
+ repairCenter: [{
|
|
|
214
|
+ required: true,
|
|
|
215
|
+ message: '请输入报修内容',
|
|
|
216
|
+ trigger: 'blur'
|
|
|
217
|
+ }],
|
|
|
218
|
+ repairAddress: [{
|
|
|
219
|
+ required: true,
|
|
|
220
|
+ message: '请输入报修地点',
|
|
|
221
|
+ trigger: 'blur'
|
|
|
222
|
+ }]
|
|
129
|
223
|
}
|
|
|
224
|
+ }
|
|
|
225
|
+ },
|
|
|
226
|
+ created() {
|
|
|
227
|
+ this.ruleForm.repairDeptid = this.deptidArr[this.deptidArr.length - 1]
|
|
|
228
|
+ this.getRepairman(this.deptidArr[this.deptidArr.length - 1], 0)
|
|
|
229
|
+ // assignArr
|
|
|
230
|
+ const deptid = this.$store.getters.teamId
|
|
|
231
|
+ if (deptid) {
|
|
|
232
|
+ this.assignArr = this.$store.getters.deptmap[parseInt(deptid)].ids
|
|
|
233
|
+ this.ruleForm.assignDepart = deptid
|
|
|
234
|
+
|
|
|
235
|
+ this.getRepairman(deptid, 1)
|
|
|
236
|
+ }
|
|
|
237
|
+ this.ruleForm.assignMant = this.$store.getters.usercode
|
|
|
238
|
+ if (this.wid) {
|
|
|
239
|
+ this.getWoDetail(this.wid, '0')
|
|
|
240
|
+ }
|
|
|
241
|
+ if (this.iswomanage == 1) {
|
|
|
242
|
+ this.ruleForm.assignDepart = ''
|
|
|
243
|
+ this.ruleForm.assignMant = ''
|
|
|
244
|
+ }
|
|
|
245
|
+ },
|
|
|
246
|
+ methods: {
|
|
|
247
|
+ // 部门
|
|
|
248
|
+ getDeptid(data) {
|
|
|
249
|
+ this.ruleForm.repairDeptid = data[data.length - 1]
|
|
|
250
|
+ this.deptidArr = data
|
|
|
251
|
+ this.getRepairman(this.ruleForm.repairDeptid, 0)
|
|
130
|
252
|
},
|
|
131
|
|
- data() {
|
|
132
|
|
- return {
|
|
133
|
|
- secondOrderType: {
|
|
134
|
|
- typeid: 2,
|
|
135
|
|
- pid: 3000
|
|
136
|
|
- },
|
|
137
|
|
- orderarr: [],
|
|
138
|
|
- ordertypeArr: [],
|
|
139
|
|
- imgUrl: this.$store.getters.serverConfig.BASE_API + 'FaultRepair/UploadFile',
|
|
140
|
|
- fileList: [],
|
|
141
|
|
- repairman: [], // 申请人数据
|
|
142
|
|
- deptidArr: [], // 申请部门默认值
|
|
143
|
|
- assignman: [], // 指派人
|
|
144
|
|
- assignArr: [], // 默认指派部门
|
|
145
|
|
- ruleForm: {
|
|
146
|
|
- repairDeptid: '', // 申请部门
|
|
147
|
|
- repairmanid: '', // 申请人
|
|
148
|
|
- repairmanphone: '', // 申请电话
|
|
149
|
|
- repairmanCallNumber: '', // 联系电话
|
|
150
|
|
- repairOrderType: [], // 工单类别
|
|
151
|
|
- repairCenter: '', // 报修内容
|
|
152
|
|
- repairAddress: '', // 报修地点
|
|
153
|
|
- repairImageid: '', // 附件
|
|
154
|
|
- repairOper: '0', // 下不流程
|
|
155
|
|
- assignDepart: '', // 指派部门
|
|
156
|
|
- assignMant: '' // 指派人
|
|
157
|
|
- },
|
|
158
|
|
- headers: {
|
|
159
|
|
- Authorization: localStorage.getItem('Admin-Token')
|
|
160
|
|
- },
|
|
161
|
|
- imageUrl: 'http://192.168.1.37:8000/FaultRepair/UploadFile',
|
|
162
|
|
- rules: {
|
|
163
|
|
- repairDeptid: [{
|
|
164
|
|
- required: true,
|
|
165
|
|
- message: '请选择申请部门',
|
|
166
|
|
- trigger: 'change'
|
|
167
|
|
- }],
|
|
168
|
|
- repairmanid: [{
|
|
169
|
|
- required: true,
|
|
170
|
|
- message: '请选择申请人',
|
|
171
|
|
- trigger: 'change'
|
|
172
|
|
- }],
|
|
173
|
|
- repairmanCallNumber: [{
|
|
174
|
|
- required: true,
|
|
175
|
|
- message: '请输入联系电话',
|
|
176
|
|
- trigger: 'blur'
|
|
177
|
|
- }],
|
|
178
|
|
- repairOrderType: [{
|
|
179
|
|
- required: true,
|
|
180
|
|
- message: '请选择工单类别',
|
|
181
|
|
- trigger: 'change'
|
|
182
|
|
- }],
|
|
183
|
|
- repairCenter: [{
|
|
184
|
|
- required: true,
|
|
185
|
|
- message: '请输入报修内容',
|
|
186
|
|
- trigger: 'blur'
|
|
187
|
|
- }],
|
|
188
|
|
- repairAddress: [{
|
|
189
|
|
- required: true,
|
|
190
|
|
- message: '请输入报修地点',
|
|
191
|
|
- trigger: 'blur'
|
|
192
|
|
- }],
|
|
|
253
|
+ geAssigntDeptid(data) {
|
|
|
254
|
+ this.ruleForm.assignDepart = data[data.length - 1]
|
|
|
255
|
+ this.assignArr = data
|
|
|
256
|
+ this.getRepairman(this.ruleForm.assignDepart, 1)
|
|
|
257
|
+ },
|
|
|
258
|
+ // 获取申请人数据
|
|
|
259
|
+ getRepairman(id, state) {
|
|
|
260
|
+ return new Promise((resolve) => {
|
|
|
261
|
+ const params = {
|
|
|
262
|
+ deptid: id // 字典管理的工单标识
|
|
193
|
263
|
}
|
|
194
|
|
- }
|
|
|
264
|
+ GetPerson(params).then((res) => {
|
|
|
265
|
+ if (res.state == 'error') {
|
|
|
266
|
+ this.$message.warning(res.message)
|
|
|
267
|
+ }
|
|
|
268
|
+ if (state === 0) {
|
|
|
269
|
+ this.repairman = res.rows
|
|
|
270
|
+ } else if (state === 1) {
|
|
|
271
|
+ this.assignman = res.rows
|
|
|
272
|
+ }
|
|
|
273
|
+ })
|
|
|
274
|
+ resolve()
|
|
|
275
|
+ })
|
|
195
|
276
|
},
|
|
196
|
|
- created() {
|
|
197
|
|
- this.ruleForm.repairDeptid = this.deptidArr[this.deptidArr.length - 1]
|
|
198
|
|
- this.getRepairman(this.deptidArr[this.deptidArr.length - 1], 0)
|
|
199
|
|
- //assignArr
|
|
200
|
|
- const deptid = this.$store.getters.teamId
|
|
201
|
|
- if (deptid) {
|
|
202
|
|
- this.assignArr = this.$store.getters.deptmap[parseInt(deptid)].ids
|
|
203
|
|
- this.ruleForm.assignDepart = deptid
|
|
204
|
|
-
|
|
205
|
|
- this.getRepairman(deptid, 1)
|
|
206
|
|
- }
|
|
207
|
|
- this.ruleForm.assignMant = this.$store.getters.usercode
|
|
208
|
|
- if (this.wid) {
|
|
209
|
|
- this.getWoDetail(this.wid, '0')
|
|
210
|
|
- }
|
|
211
|
|
- if (this.iswomanage == 1) {
|
|
212
|
|
- this.ruleForm.assignDepart = ''
|
|
213
|
|
- this.ruleForm.assignMant = ''
|
|
|
277
|
+ // 申请人
|
|
|
278
|
+ changeRepairman(data) {
|
|
|
279
|
+ this.ruleForm.repairmanid = data
|
|
|
280
|
+ const user = this.repairman.find((o) => {
|
|
|
281
|
+ return o.usercode === data.toString()
|
|
|
282
|
+ })
|
|
|
283
|
+ if (user) {
|
|
|
284
|
+ this.ruleForm.repairmanphone = user.usertelphone
|
|
|
285
|
+ this.ruleForm.repairmanCallNumber = user.usertelphone
|
|
214
|
286
|
}
|
|
215
|
287
|
},
|
|
216
|
|
- methods: {
|
|
217
|
|
- // 部门
|
|
218
|
|
- getDeptid(data) {
|
|
219
|
|
- this.ruleForm.repairDeptid = data[data.length - 1]
|
|
220
|
|
- this.deptidArr = data
|
|
221
|
|
- this.getRepairman(this.ruleForm.repairDeptid, 0)
|
|
222
|
|
- },
|
|
223
|
|
- geAssigntDeptid(data) {
|
|
224
|
|
- this.ruleForm.assignDepart = data[data.length - 1]
|
|
225
|
|
- this.assignArr = data
|
|
226
|
|
- this.getRepairman(this.ruleForm.assignDepart, 1)
|
|
227
|
|
- },
|
|
228
|
|
- // 获取申请人数据
|
|
229
|
|
- getRepairman(id, state) {
|
|
230
|
|
- return new Promise((resolve) => {
|
|
231
|
|
- const params = {
|
|
232
|
|
- deptid: id // 字典管理的工单标识
|
|
|
288
|
+ changeUser(data) { // 指派人
|
|
|
289
|
+ this.ruleForm.assignMant = data
|
|
|
290
|
+ },
|
|
|
291
|
+ // 详情
|
|
|
292
|
+ getWoDetail(rid, type) {
|
|
|
293
|
+ const params = {
|
|
|
294
|
+ WorkOrderCode: rid,
|
|
|
295
|
+ type: type
|
|
|
296
|
+ }
|
|
|
297
|
+ GetFaultRepairDetail(params).then((response) => {
|
|
|
298
|
+ if (response.data[0]) {
|
|
|
299
|
+ this.deptidArr = this.$store.getters.deptmap[parseInt(response.data[0].F_ApplicationDept)].ids
|
|
|
300
|
+ console.log(this.deptidArr, '666')
|
|
|
301
|
+ if (response.data[0].F_MaintenanceDept) {
|
|
|
302
|
+ this.assignArr = this.$store.getters.deptmap[parseInt(response.data[0].F_MaintenanceDept)].ids
|
|
233
|
303
|
}
|
|
234
|
|
- GetPerson(params).then((res) => {
|
|
235
|
|
- if(res.state=='error'){
|
|
236
|
|
- this.$message.warning(res.message)
|
|
237
|
|
- }
|
|
238
|
|
- if (state === 0) {
|
|
239
|
|
- this.repairman = res.rows
|
|
240
|
|
- } else if (state === 1) {
|
|
241
|
|
- this.assignman = res.rows
|
|
|
304
|
+ this.ruleForm.repairmanid = response.data[0].F_Applicant
|
|
|
305
|
+ this.ruleForm.repairmanphone = response.data[0].F_Applicantsphone
|
|
|
306
|
+ this.ruleForm.repairmanCallNumber = response.data[0].F_Phone
|
|
|
307
|
+ this.ruleForm.repairOrderType = this.$store.getters.workTypeMap[parseInt(response.data[0]
|
|
|
308
|
+ .F_WorkOrderCategory)].ids // 工单类别
|
|
|
309
|
+ this.ruleForm.repairOrderType = this.ruleForm.repairOrderType.slice(1, this.ruleForm.repairOrderType
|
|
|
310
|
+ .length)
|
|
|
311
|
+ this.ruleForm.repairDeptid = response.data[0].F_ApplicationDept // 部门
|
|
|
312
|
+ this.ruleForm.repairCenter = response.data[0].F_Content
|
|
|
313
|
+ this.ruleForm.repairAddress = response.data[0].F_PlaceOfRepair
|
|
|
314
|
+ this.ruleForm.assignDepart = response.data[0].F_MaintenanceDept
|
|
|
315
|
+ // if (response.data[0].F_Maintenancer) {
|
|
|
316
|
+ // this.ruleForm.assignMant = this.$store.getters.response.data[0].F_Maintenancer
|
|
|
317
|
+ // }
|
|
|
318
|
+ if (response.data[0].FileUrl) {
|
|
|
319
|
+ // this.imgUrl = response.data[0].FileUrl[0].F_FileUrl
|
|
|
320
|
+ for (var i = 0; i < response.data[0].FileUrl.length; i++) {
|
|
|
321
|
+ this.ruleForm.repairImageid += response.data[0].FileUrl[i].F_FileId + ','
|
|
|
322
|
+ this.fileList.push({
|
|
|
323
|
+ name: response.data[0].FileUrl[i].F_FileName,
|
|
|
324
|
+ url: response.data[0].FileUrl[i].F_FileUrl
|
|
|
325
|
+ })
|
|
242
|
326
|
}
|
|
243
|
|
- })
|
|
244
|
|
- resolve()
|
|
245
|
|
- })
|
|
246
|
|
- },
|
|
247
|
|
- // 申请人
|
|
248
|
|
- changeRepairman(data) {
|
|
249
|
|
- this.ruleForm.repairmanid = data
|
|
250
|
|
- const user = this.repairman.find((o) => {
|
|
251
|
|
- return o.usercode === data.toString()
|
|
252
|
|
- })
|
|
253
|
|
- if (user) {
|
|
254
|
|
- this.ruleForm.repairmanphone = user.usertelphone
|
|
255
|
|
- this.ruleForm.repairmanCallNumber = user.usertelphone
|
|
256
|
|
- }
|
|
257
|
|
- },
|
|
258
|
|
- changeUser(data) { // 指派人
|
|
259
|
|
- this.ruleForm.assignMant = data
|
|
260
|
|
- },
|
|
261
|
|
- //详情
|
|
262
|
|
- getWoDetail(rid, type) {
|
|
263
|
|
- const params = {
|
|
264
|
|
- WorkOrderCode: rid,
|
|
265
|
|
- type: type
|
|
|
327
|
+ }
|
|
266
|
328
|
}
|
|
267
|
|
- GetFaultRepairDetail(params).then((response) => {
|
|
268
|
|
- if (response.data[0]) {
|
|
269
|
|
- this.deptidArr = this.$store.getters.deptmap[parseInt(response.data[0].F_ApplicationDept)].ids
|
|
270
|
|
- console.log(this.deptidArr, '666')
|
|
271
|
|
- if (response.data[0].F_MaintenanceDept) {
|
|
272
|
|
- this.assignArr = this.$store.getters.deptmap[parseInt(response.data[0].F_MaintenanceDept)].ids
|
|
273
|
|
- }
|
|
274
|
|
- this.ruleForm.repairmanid = response.data[0].F_Applicant
|
|
275
|
|
- this.ruleForm.repairmanphone = response.data[0].F_Applicantsphone
|
|
276
|
|
- this.ruleForm.repairmanCallNumber = response.data[0].F_Phone
|
|
277
|
|
- this.ruleForm.repairOrderType = this.$store.getters.workTypeMap[parseInt(response.data[0]
|
|
278
|
|
- .F_WorkOrderCategory)].ids //工单类别
|
|
279
|
|
- this.ruleForm.repairOrderType = this.ruleForm.repairOrderType.slice(1, this.ruleForm.repairOrderType
|
|
280
|
|
- .length)
|
|
281
|
|
- this.ruleForm.repairDeptid = response.data[0].F_ApplicationDept //部门
|
|
282
|
|
- this.ruleForm.repairCenter = response.data[0].F_Content
|
|
283
|
|
- this.ruleForm.repairAddress = response.data[0].F_PlaceOfRepair
|
|
284
|
|
- this.ruleForm.assignDepart = response.data[0].F_MaintenanceDept
|
|
285
|
|
- // if (response.data[0].F_Maintenancer) {
|
|
286
|
|
- // this.ruleForm.assignMant = this.$store.getters.response.data[0].F_Maintenancer
|
|
287
|
|
- // }
|
|
288
|
|
- if (response.data[0].FileUrl) {
|
|
289
|
|
- // this.imgUrl = response.data[0].FileUrl[0].F_FileUrl
|
|
290
|
|
- for (var i = 0; i < response.data[0].FileUrl.length; i++) {
|
|
291
|
|
- this.ruleForm.repairImageid += response.data[0].FileUrl[i].F_FileId + ','
|
|
292
|
|
- this.fileList.push({
|
|
293
|
|
- name: response.data[0].FileUrl[i].F_FileName,
|
|
294
|
|
- url: response.data[0].FileUrl[i].F_FileUrl
|
|
295
|
|
- })
|
|
296
|
|
- }
|
|
297
|
|
- }
|
|
|
329
|
+ })
|
|
|
330
|
+ },
|
|
|
331
|
+ // 工单类型
|
|
|
332
|
+ getSecondOOrderType(data) {
|
|
|
333
|
+ // console.log(data,'3333333')
|
|
|
334
|
+ // this.ruleForm.repairOrderType = data.value
|
|
|
335
|
+ this.ruleForm.repairOrderType = data.value
|
|
|
336
|
+ console.log(this.ruleForm.repairOrderType)
|
|
|
337
|
+ },
|
|
|
338
|
+ handle_success(res) {
|
|
|
339
|
+ this.ruleForm.repairImageid += res.data[0].F_FileId + ','
|
|
|
340
|
+ },
|
|
|
341
|
+ submitForm(formName) {
|
|
|
342
|
+ console.log(this.callid, 'callid')
|
|
|
343
|
+ console.log(this.ruleForm.repairDeptid)
|
|
|
344
|
+ this.$refs[formName].validate((valid) => {
|
|
|
345
|
+ if (valid) {
|
|
|
346
|
+ if (this.ruleForm.repairImageid === '') {
|
|
|
347
|
+ this.ruleForm.repairImageid = ''
|
|
|
348
|
+ } else {
|
|
|
349
|
+ this.ruleForm.repairImageid = this.ruleForm.repairImageid.slice(0, this.ruleForm.repairImageid
|
|
|
350
|
+ .length - 1)
|
|
298
|
351
|
}
|
|
299
|
|
- })
|
|
300
|
|
- },
|
|
301
|
|
- // 工单类型
|
|
302
|
|
- getSecondOOrderType(data) {
|
|
303
|
|
- // console.log(data,'3333333')
|
|
304
|
|
- // this.ruleForm.repairOrderType = data.value
|
|
305
|
|
- this.ruleForm.repairOrderType = data.value
|
|
306
|
|
- console.log(this.ruleForm.repairOrderType)
|
|
307
|
|
- },
|
|
308
|
|
- handle_success(res) {
|
|
309
|
|
- this.ruleForm.repairImageid += res.data[0].F_FileId + ','
|
|
310
|
|
- },
|
|
311
|
|
- submitForm(formName) {
|
|
312
|
|
- console.log(this.callid, 'callid')
|
|
313
|
|
- console.log(this.ruleForm.repairDeptid)
|
|
314
|
|
- this.$refs[formName].validate((valid) => {
|
|
315
|
|
- if (valid) {
|
|
316
|
|
- if (this.ruleForm.repairImageid === '') {
|
|
317
|
|
- this.ruleForm.repairImageid = ''
|
|
318
|
|
- } else {
|
|
319
|
|
- this.ruleForm.repairImageid = this.ruleForm.repairImageid.slice(0, this.ruleForm.repairImageid
|
|
320
|
|
- .length - 1)
|
|
321
|
|
- }
|
|
322
|
|
- this.$refs.ruleForm.validate((valid) => {
|
|
323
|
|
- if (valid) {
|
|
324
|
|
- if (this.wid) { //编辑
|
|
325
|
|
- console.log('bj')
|
|
326
|
|
- const params = {
|
|
327
|
|
- WorkOrderCode: this.wid,
|
|
328
|
|
- Applicant: this.ruleForm.repairmanid, // 申请人
|
|
329
|
|
- ApplicationDept: this.ruleForm.repairDeptid, // 申请部门
|
|
330
|
|
- Applicantsphone: this.ruleForm.repairmanphone, // 申请电话
|
|
331
|
|
- Phone: this.ruleForm.repairmanCallNumber, // 联系方式
|
|
332
|
|
- WorkOrderCategory: this.ruleForm.repairOrderType, // 工单类别
|
|
333
|
|
- Content: this.ruleForm.repairCenter, // 工单内容
|
|
334
|
|
- PlaceOfRepair: this.ruleForm.repairAddress, // 报修地点
|
|
335
|
|
- File: this.ruleForm.repairImageid, // 附件
|
|
336
|
|
- MaintenanceDept: this.ruleForm.assignDepart, // 指派部门
|
|
337
|
|
- IsEnd: '0', // 是否完结
|
|
338
|
|
- Maintenancer: this.ruleForm.assignMant // 指派人
|
|
339
|
|
- }
|
|
340
|
|
- UpdateFaultRepair(params).then((res) => {
|
|
341
|
|
- if (res.state.toLowerCase() === 'success') {
|
|
342
|
|
- // this.$parent.$layer.close(this.layerid)
|
|
343
|
|
- // this.$parent.getList()
|
|
344
|
|
- this.$message({
|
|
345
|
|
- message: '恭喜你,编辑工单成功!',
|
|
346
|
|
- type: 'success',
|
|
347
|
|
- duration: 1000
|
|
348
|
|
- })
|
|
349
|
|
- }
|
|
350
|
|
- })
|
|
|
352
|
+ this.$refs.ruleForm.validate((valid) => {
|
|
|
353
|
+ if (valid) {
|
|
|
354
|
+ if (this.wid) { // 编辑
|
|
|
355
|
+ console.log('bj')
|
|
|
356
|
+ const params = {
|
|
|
357
|
+ WorkOrderCode: this.wid,
|
|
|
358
|
+ Applicant: this.ruleForm.repairmanid, // 申请人
|
|
|
359
|
+ ApplicationDept: this.ruleForm.repairDeptid, // 申请部门
|
|
|
360
|
+ Applicantsphone: this.ruleForm.repairmanphone, // 申请电话
|
|
|
361
|
+ Phone: this.ruleForm.repairmanCallNumber, // 联系方式
|
|
|
362
|
+ WorkOrderCategory: this.ruleForm.repairOrderType, // 工单类别
|
|
|
363
|
+ Content: this.ruleForm.repairCenter, // 工单内容
|
|
|
364
|
+ PlaceOfRepair: this.ruleForm.repairAddress, // 报修地点
|
|
|
365
|
+ File: this.ruleForm.repairImageid, // 附件
|
|
|
366
|
+ MaintenanceDept: this.ruleForm.assignDepart, // 指派部门
|
|
|
367
|
+ IsEnd: '0', // 是否完结
|
|
|
368
|
+ Maintenancer: this.ruleForm.assignMant // 指派人
|
|
351
|
369
|
}
|
|
352
|
|
- if (this.wid == '') {
|
|
353
|
|
- console.log('tj')
|
|
354
|
|
- const params = {
|
|
355
|
|
- LeaveRecordId: this.fid,
|
|
356
|
|
- CallId: this.callid,
|
|
357
|
|
- Applicant: this.ruleForm.repairmanid, // 申请人
|
|
358
|
|
- ApplicationDept: this.ruleForm.repairDeptid, // 申请部门
|
|
359
|
|
- Applicantsphone: this.ruleForm.repairmanphone, // 申请电话
|
|
360
|
|
- Phone: this.ruleForm.repairmanCallNumber, // 联系方式
|
|
361
|
|
- WorkOrderCategory: this.ruleForm.repairOrderType, // 工单类别
|
|
362
|
|
- Content: this.ruleForm.repairCenter, // 工单内容
|
|
363
|
|
- PlaceOfRepair: this.ruleForm.repairAddress, // 报修地点
|
|
364
|
|
- File: this.ruleForm.repairImageid, // 附件
|
|
365
|
|
- MaintenanceDept: this.ruleForm.assignDepart, // 指派部门
|
|
366
|
|
- IsEnd: '0', // 是否完结
|
|
367
|
|
- Maintenancer: this.ruleForm.assignMant // 指派人
|
|
|
370
|
+ UpdateFaultRepair(params).then((res) => {
|
|
|
371
|
+ if (res.state.toLowerCase() === 'success') {
|
|
|
372
|
+ // this.$parent.$layer.close(this.layerid)
|
|
|
373
|
+ // this.$parent.getList()
|
|
|
374
|
+ this.$message({
|
|
|
375
|
+ message: '恭喜你,编辑工单成功!',
|
|
|
376
|
+ type: 'success',
|
|
|
377
|
+ duration: 1000
|
|
|
378
|
+ })
|
|
368
|
379
|
}
|
|
369
|
|
- getAddRepairbase(params).then((res) => {
|
|
370
|
|
- if (res.state.toLowerCase() === 'success') {
|
|
371
|
|
- this.$refs.ruleForm.resetFields();
|
|
372
|
|
- this.deptidArr = []
|
|
373
|
|
- this.$message({
|
|
374
|
|
- message: '恭喜你,添加工单成功!',
|
|
375
|
|
- type: 'success',
|
|
376
|
|
- duration: 1000
|
|
377
|
|
- })
|
|
378
|
|
- }
|
|
379
|
|
- })
|
|
|
380
|
+ })
|
|
|
381
|
+ }
|
|
|
382
|
+ if (this.wid == '') {
|
|
|
383
|
+ console.log('tj')
|
|
|
384
|
+ const params = {
|
|
|
385
|
+ LeaveRecordId: this.fid,
|
|
|
386
|
+ CallId: this.callid,
|
|
|
387
|
+ Applicant: this.ruleForm.repairmanid, // 申请人
|
|
|
388
|
+ ApplicationDept: this.ruleForm.repairDeptid, // 申请部门
|
|
|
389
|
+ Applicantsphone: this.ruleForm.repairmanphone, // 申请电话
|
|
|
390
|
+ Phone: this.ruleForm.repairmanCallNumber, // 联系方式
|
|
|
391
|
+ WorkOrderCategory: this.ruleForm.repairOrderType, // 工单类别
|
|
|
392
|
+ Content: this.ruleForm.repairCenter, // 工单内容
|
|
|
393
|
+ PlaceOfRepair: this.ruleForm.repairAddress, // 报修地点
|
|
|
394
|
+ File: this.ruleForm.repairImageid, // 附件
|
|
|
395
|
+ MaintenanceDept: this.ruleForm.assignDepart, // 指派部门
|
|
|
396
|
+ IsEnd: '0', // 是否完结
|
|
|
397
|
+ Maintenancer: this.ruleForm.assignMant // 指派人
|
|
380
|
398
|
}
|
|
381
|
|
- } else {
|
|
382
|
|
- return false
|
|
|
399
|
+ getAddRepairbase(params).then((res) => {
|
|
|
400
|
+ if (res.state.toLowerCase() === 'success') {
|
|
|
401
|
+ this.$refs.ruleForm.resetFields()
|
|
|
402
|
+ this.deptidArr = []
|
|
|
403
|
+ this.$message({
|
|
|
404
|
+ message: '恭喜你,添加工单成功!',
|
|
|
405
|
+ type: 'success',
|
|
|
406
|
+ duration: 1000
|
|
|
407
|
+ })
|
|
|
408
|
+ }
|
|
|
409
|
+ })
|
|
383
|
410
|
}
|
|
384
|
|
- })
|
|
385
|
|
- } else {
|
|
386
|
|
- console.log('error submit!!')
|
|
387
|
|
- return false
|
|
388
|
|
- }
|
|
389
|
|
- })
|
|
390
|
|
- }
|
|
|
411
|
+ } else {
|
|
|
412
|
+ return false
|
|
|
413
|
+ }
|
|
|
414
|
+ })
|
|
|
415
|
+ } else {
|
|
|
416
|
+ console.log('error submit!!')
|
|
|
417
|
+ return false
|
|
|
418
|
+ }
|
|
|
419
|
+ })
|
|
391
|
420
|
}
|
|
392
|
421
|
}
|
|
|
422
|
+}
|
|
393
|
423
|
</script>
|
|
394
|
424
|
<style rel="stylesheet/scss" lang="scss">
|
|
395
|
425
|
.order_form {
|