safecheck-client 4.0.0-52 → 4.0.0-53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/package.json +1 -1
  2. package/src/App.vue +31 -31
  3. package/src/components/NewDefectList/DefectListNew.vue +663 -663
  4. package/src/components/Util/SafecheckUpload.vue +281 -281
  5. package/src/components/android/AndroidDefectDetails.vue +725 -725
  6. package/src/components/android/PhoneUpUserinfo.vue +1249 -1249
  7. package/src/components/android/SafecheckDevices.vue +1340 -1339
  8. package/src/components/pc/AddToCheckBook.vue +237 -237
  9. package/src/components/pc/CheckBook.vue +303 -303
  10. package/src/components/pc/CheckBookArea.vue +146 -146
  11. package/src/components/pc/CheckBookCompany.vue +144 -144
  12. package/src/components/pc/CheckBookDetails.vue +161 -161
  13. package/src/components/pc/CheckBookEntry.vue +60 -60
  14. package/src/components/pc/CheckBookList.vue +366 -366
  15. package/src/components/pc/CheckBookSearchArea.vue +560 -560
  16. package/src/components/pc/CheckBookSearchUnit.vue +229 -229
  17. package/src/components/pc/CheckBookSearchUser.vue +659 -659
  18. package/src/components/pc/CheckBookSearchUserList.vue +674 -674
  19. package/src/components/pc/CheckBookUser.vue +333 -333
  20. package/src/components/pc/DefectDeal.vue +1007 -1007
  21. package/src/filiale/meihekou/android/AreaPlan.vue +569 -569
  22. package/src/filiale/meihekou/android/CheckPlanList.vue +198 -198
  23. package/src/filiale/meihekou/android/CheckPlanListArea.vue +190 -190
  24. package/src/filiale/meihekou/android/CurrentCreate.vue +1087 -1087
  25. package/src/filiale/meihekou/android/MeterReading.vue +106 -106
  26. package/src/filiale/meihekou/android/SafecheckOrderV.vue +2346 -2346
  27. package/src/filiale/meihekou/android/SafecheckUserInfo.vue +787 -787
  28. package/src/filiale/meihekou/android.js +19 -19
  29. package/src/filiale/meihekou/pc.js +12 -12
@@ -1,663 +1,663 @@
1
- <template>
2
- <div>
3
- <div :style="{'height':needRepair?'60%':'100%'}">
4
- <criteria-paged :model="model" :pager="false" v-ref:paged>
5
- <criteria partial='criteria'>
6
- <div partial>
7
- <ul class="nav nav-tabs">
8
- <li role="presentation" class="active"><a style=" color: #5ac0d9 !important;">隐患明细</a></li>
9
- </ul>
10
- </div>
11
- </criteria>
12
- <data-grid :model="model" partial='list' class="table_sy">
13
- <template partial='head'>
14
- <tr>
15
- <!-- <th>-->
16
- <!-- <nobr>隐患设备</nobr>-->
17
- <!-- </th>-->
18
- <th>
19
- <nobr>隐患项</nobr>
20
- </th>
21
- <th>
22
- <nobr>隐患原因</nobr>
23
- </th>
24
- <th>
25
- <nobr>隐患处理方式</nobr>
26
- </th>
27
- <th>
28
- <nobr>处理结果</nobr>
29
- </th>
30
- <th v-if="$parent.$parent.$parent.checkDefect=='是'">
31
- <nobr>审核结果</nobr>
32
- </th>
33
- <th>
34
- <nobr>操作</nobr>
35
- </th>
36
- </tr>
37
- </template>
38
- <template partial='body'>
39
- <!-- <td style="text-align: center">-->
40
- <!-- <nobr>{{row.f_device_type}}</nobr>-->
41
- <!-- </td>-->
42
- <td style="text-align: center">
43
- <nobr>{{row.f_item_name}}</nobr>
44
- </td>
45
- <td style="text-align: center">
46
- <nobr>{{row.f_item_value}}</nobr>
47
- </td>
48
- <td style="text-align: center">
49
- <nobr>{{row.f_repaire_type}}</nobr>
50
- </td>
51
- <td style="text-align: center">
52
- <nobr>{{row.f_repaire_state}}</nobr>
53
- </td>
54
- <td style="text-align: center" v-if="$parent.$parent.$parent.checkDefect=='是'">
55
- <nobr>{{row.f_audit_results?row.f_audit_results:'暂无审核结果'}}</nobr>
56
- </td>
57
- <td style="text-align: center">
58
- <div>
59
- <!-- <img-button v-if="row.f_repaire_type != '无隐患' && row.f_repaire_type != '维修已处理' && row.f_path" :src="'/rs/image/file/'+row.f_path" :value="'隐患图片'"></img-button>-->
60
- <!-- <button style="margin-top: 3px" v-if="row.f_repaire_type == '维修已处理'" class="button_new-1 button_spacing" @click="$parent.$parent.$parent.solveDefect( row, 'view')">处理详情</button>-->
61
- <button style="margin-top: 3px" class="button_new-1 button_spacing" @click="$parent.$parent.$parent.solveDefect(row, row.f_repaire_type)">处理详情</button>
62
- <button style="margin-top: 3px" v-if="row.f_repaire_type == '隐患未处理' && $parent.$parent.$parent.showHandleDefectButton === '是'" class="button_spacing button_search-1" @click="$parent.$parent.$parent.solveDefect(row, 'solve')">处理隐患</button>
63
- </div>
64
- </td>
65
- </template>
66
- </data-grid>
67
- </criteria-paged>
68
- </div>
69
-
70
- <div style="overflow-y: scroll;height: 40%" v-if="needRepair">
71
- <div class="form-horizontal auto">
72
- <ul class="nav nav-tabs">
73
- <li role="presentation" class="active"><a style=" color: #000 !important;font-size: 14px">转维修</a></li>
74
- </ul>
75
- <validator name='v' @valid="valid = true" @invalid="valid = false">
76
- <div class="row">
77
- <div class="col-sm-4" :class="[$v.dispatchtype.required ? 'select-error' : '']">
78
- <label for="dispatchtype" class="font_normal_body">派发类型</label>
79
- <input id="dispatchtype" type="text" v-show="false" v-model="$refs.dispatchtype.selectedItems" v-validate:dispatchtype='{required: true }'>
80
- <v-select :value.sync="toRepairModal.preData.dispatchType" v-model="toRepairModal.preData.dispatchType"
81
- :options='toRepairModal.preData.dispatchTypeOptions' placeholder='派发类型'
82
- close-on-select v-ref:dispatchtype>
83
- </v-select>
84
- </div>
85
- <div class="col-sm-4 " v-if="toRepairModal.preData.dispatchType == '派发给站点'">
86
- <label class="font_normal_body">站&nbsp;&nbsp;点</label>
87
- <right-tree
88
- islist
89
- :userid="$login.f.id"
90
- :source="'dep=this.getParentByType($organization$).getSpecialResByType($department$),tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))'"
91
- @re-res="getSiteRes">
92
- </right-tree>
93
- </div>
94
- <div class="col-sm-4 " v-if="toRepairModal.preData.dispatchType == '派发给维修员'" :class="[$v.f_repairman.required ? 'select-error' : '']">
95
- <input type="text" v-show="false" v-model="toRepairModal.preData.f_repairman" v-validate:f_repairman='{required: true }'>
96
- <label class="font_normal_body">维修员</label>
97
- <v-select
98
- :value.sync="toRepairModal.preData.f_repairman"
99
- :value-single="true"
100
- :options='toRepairModal.preData.repairers'
101
- placeholder='请选择维修员'
102
- close-on-select></v-select>
103
- </div>
104
- <div class="col-sm-4" :class="[$v.f_repairtype.required ? 'select-error' : '']">
105
- <input type="text" v-show="false" v-model="toRepairModal.preData.f_repairtype" v-validate:f_repairtype='{required: true }'>
106
- <label class="font_normal_body">报修类型</label>
107
- <v-select :value.sync="toRepairModal.preData.f_repairtype" style="width:60%"
108
- class="select select_list"
109
- :value-single="true"
110
- :options='toRepairModal.preData.repairTypeOptions'
111
- close-on-select>
112
- </v-select>
113
- </div>
114
- </div>
115
- <div class="row">
116
- <div class="col-sm-8 form-group">
117
- <label class="font_normal_body" >备&emsp;&emsp;注</label>
118
- <input class="input_search" style="width: 60%" type="text" v-model="toRepairModal.preData.f_remarks" placeholder="备注">
119
-
120
- </div>
121
- <div class="col-sm-4" style="margin-top: 1%">
122
- <button class="button_search" :disabled="!valid" @click="confirm">转维修</button>
123
- </div>
124
- </div>
125
- </validator>
126
- </div>
127
- </div>
128
- <modal :show.sync="showSolveModal" v-ref:solveModal>
129
- <div slot="modal-header" class="modal-header">
130
- <h4 class="modal-title">
131
- {{solveModal.preData.type == 'view'?'处理详情':'处理隐患'}}
132
- </h4>
133
- </div>
134
- <div slot="modal-body" class="modal-body">
135
- <div style="width: 100%;height: 36px;background-color: #f1f8ff;float: left">
136
- <div style="width: 8px;height: 100%;background-color: #6aa6e2;margin-right: 20px;float: left"></div>
137
- <div style="width: auto;height:100%;float: left;"><p class="title-font" style="margin-top: 5px">处理前</p></div>
138
- </div>
139
-
140
- <div class="col-sm-6" style="margin-top: 10px">
141
- <label class="font_normal_body">安&nbsp;检&nbsp;员</label>
142
- <input class="input_search" style="width: 60%" type="text" disabled="true" v-model="check.f_checker_name" placeholder="安检员">
143
- </div>
144
- <div class="col-sm-6" style="margin-top: 10px">
145
- <label class="font_normal_body">安检时间</label>
146
- <input class="input_search" style="width: 60%" type="text" disabled="true" v-model="check.f_offsite_time" placeholder="安检时间">
147
- </div>
148
- <div class="col-sm-12" style="margin-bottom: 10px" v-if="solveModal.preData.defectImg">
149
- <label class="font_normal_body">隐患图片</label>
150
- <img-self :width="200" :height="200" :src="solveModal.preData.defectImg"></img-self>
151
- </div>
152
- <div class="col-sm-12" style="margin-bottom: 10px" v-show="solveModal.preData.defectImg1">
153
- <label class="font_normal_body">隐患图片</label>
154
- <img-self :width="200" :height="200" :src="solveModal.preData.defectImg1"></img-self>
155
- </div>
156
- <div class="col-sm-12" style="margin-bottom: 10px" v-show="solveModal.preData.defectImg2">
157
- <label class="font_normal_body">隐患图片</label>
158
- <img-self :width="200" :height="200" :src="solveModal.preData.defectImg2"></img-self>
159
- </div>
160
- <div class="col-sm-12" style="margin-bottom: 10px" v-show="solveModal.preData.defectImg3">
161
- <label class="font_normal_body">隐患图片</label>
162
- <img-self :width="200" :height="200" :src="solveModal.preData.defectImg3"></img-self>
163
- </div>
164
-
165
- <div style="width: 100%;height: 36px;background-color: #f1f8ff;float: left" v-show="solveModal.preData.state == '已处理' || solveModal.preData.type != 'solve'">
166
- <div style="width: 8px;height: 100%;background-color: #6aa6e2;margin-right: 20px;float: left"></div>
167
- <div style="width: auto;height:100%;float: left;"><p class="title-font" style="margin-top: 5px">处理后</p></div>
168
- </div>
169
- <div class="col-sm-6" style="margin-top: 10px" v-show="solveModal.preData.state == '已处理'">
170
- <label class="font_normal_body">处&nbsp;理&nbsp;人</label>
171
- <input v-if="solveModal.preData.type != 'solve'" class="input_search" style="width: 60%" disabled="true" type="text" v-model="solveModal.uploadData.f_repairman" placeholder="处理人">
172
- <v-select
173
- v-if="solveModal.preData.type == 'solve'"
174
- :value.sync="solveModal.uploadData.f_repairman"
175
- :value-single="true"
176
- :options='toRepairModal.preData.repairers'
177
- placeholder='请选择维修员'
178
- close-on-select></v-select>
179
- </div>
180
- <div class="col-sm-6" style="margin-top: 10px" v-show="solveModal.preData.state == '已处理'">
181
- <label class="font_normal_body">处理时间</label>
182
- <datepicker
183
- :disabled="solveModal.preData.type == 'view'"
184
- placeholder='处理时间' style="width:60%"
185
- :disabled-days-of-week="[]"
186
- :format="'yyyy-MM-dd'"
187
- :show-rest-button="reset"
188
- :value.sync="solveModal.uploadData.f_repair_date">
189
- </datepicker>
190
- </div>
191
- <div v-if="solveModal.preData.type == 'solve'" class="col-sm-12" style="margin-bottom: 10px">
192
- <label class="font_normal_body">处理后图片</label>
193
- <safecheck-file-upload
194
- :issearch="false"
195
- :isupload="true"
196
- :blodid="check.id"
197
- :isdelete="true"
198
- flag="safeCheck"
199
- @filename="getfile"
200
- ></safecheck-file-upload>
201
- </div>
202
- <div v-if="solveModal.preData.state == '已处理'" class="col-sm-12" style="margin-bottom: 10px">
203
- <p> <label class="font_normal_body">处理后图片</label></p>
204
- <P></P>
205
- <div class="col-sm-12">
206
- <div class="col-sm-6" v-for="item in fileInfoData">
207
- <!-- <img :src="item.f_downloadURL">-->
208
- <img-self :width="200" :height="200" :src="item.f_downloadURL" style="margin-left: 10px"></img-self>
209
- </div>
210
- <div class="col-sm-6" v-if="solveModal.preData.repairedImg">
211
- <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg" style="margin-left: 10px"></img-self>
212
- </div>
213
- <div class="col-sm-6" v-if="solveModal.preData.repairedImg1">
214
- <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg1" style="margin-left: 10px"></img-self>
215
- </div>
216
- <div class="col-sm-6" v-if="solveModal.preData.repairedImg2">
217
- <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg2" style="margin-left: 10px"></img-self>
218
- </div>
219
- <div class="col-sm-6" v-if="solveModal.preData.repairedImg2">
220
- <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg2" style="margin-left: 10px"></img-self>
221
- </div>
222
- <div class="col-sm-6" v-if="solveModal.preData.repairedImg3">
223
- <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg3" style="margin-left: 10px"></img-self>
224
- </div>
225
- <div class="col-sm-6" v-if="solveModal.preData.repairedImg4">
226
- <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg4" style="margin-left: 10px"></img-self>
227
- </div>
228
- <div class="col-sm-6" v-if="solveModal.preData.repairedImg5">
229
- <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg5" style="margin-left: 10px"></img-self>
230
- </div>
231
-
232
- </div>
233
- </div>
234
- </div>
235
- <div slot="modal-footer" class="modal-footer" style="text-align: center">
236
- <button class="button_search" v-if="checkDefect=='是' && solveModal.preData.type == 'view'" @click="auditsure('通过')" v-if="solveModal.preData.type == 'view' && !solveModal.f_audit_results">审核通过</button>
237
- <button class="button_search" v-if="checkDefect=='是' && solveModal.preData.type == 'view'" @click="auditsure('不通过')" v-if="solveModal.preData.type == 'view' && !solveModal.f_audit_results">审核不通过</button>
238
- <button class="button_search" v-if="solveModal.preData.type == 'solve'" @click="ok">确认</button>
239
- <button class="button_search" @click="cancel">取消</button>
240
- </div>
241
- </modal>
242
-
243
- </div>
244
- </template>
245
-
246
- <script>
247
- import {PagedList, HttpResetClass} from 'vue-client'
248
- import * as Util from '../../components/Util'
249
- import co from 'co'
250
- import Vue from "vue";
251
-
252
- const upSolveDefect = function * (self) {
253
- let uploadData = self.solveModal.uploadData
254
- //tag)
255
- self.$resetpost('/api/af-safecheck/logic/pcRepairDefectNew', self.solveModal.uploadData, {resolveMsg: null, rejectMsg: null})
256
- .then(res => {
257
- if (res.data.code === 200) {
258
- self.$showMessage('隐患已处理。')
259
- self.showSolveModal = false
260
- self.model.search('f_repaire_type != \'无隐患\'', {})
261
- self.solveModal.uploadData={
262
- id: '',
263
- f_repairman: self.$login.f.name,
264
- f_repair_date: Util.getNowDate().substr(0, 10),
265
- f_repair_path: '',
266
- imgSrc: '',
267
- filename: '',
268
- f_defect_remark:''
269
- }
270
- }
271
- })
272
- }
273
-
274
- const sendRepair = function* (self) {
275
- let preData = self.toRepairModal.preData
276
- let uploadData = self.toRepairModal.uploadData
277
-
278
- if (preData.dispatchType == '派发给站点') {
279
- uploadData.model.serviceacitivity[0].f_meetunit = preData.f_meetunit
280
- uploadData.model.serviceacitivity[0].f_reciever = preData.f_reciever
281
- uploadData.model.f_meetunit = preData.f_meetunit
282
- uploadData.model.f_orgstr = preData.f_reciever
283
- uploadData.model.f_outlets = preData.f_outlets
284
- } else if (preData.dispatchType == '派发给维修员') {
285
- uploadData.model.serviceacitivity[0].f_reciever = preData.f_repairman
286
- // uploadData.model.f_meetunit = self.$login.f.orgpathnames
287
- // uploadData.model.f_orgstr = self.$login.f.orgpathstr
288
- // uploadData.model.f_outlets = self.$login.f.f_parentname
289
- uploadData.model.f_meetunit = self.$login.f.deps
290
- uploadData.model.f_orgid = self.$login.f.orgid
291
- uploadData.model.f_filiale = self.$login.f.org
292
- uploadData.model.f_outlets = self.$login.f.deps
293
- uploadData.model.f_filiale_id = self.$login.f.orgid
294
- uploadData.toRepair = '一级派单'
295
- }
296
- uploadData.model.f_handlingtype = preData.dispatchType
297
- let res = yield self.$resetpost('/api/af-safecheck/sql/GetUserForRepaireNew', {data: {f_userinfo_id: self.check.f_userinfo_id}})
298
- preData.userInfo = res.data[0]
299
- uploadData.model = Object.assign(uploadData.model, preData.userInfo)
300
- uploadData.user.f_userinfo_id = preData.userInfo.f_userinfo_id
301
- uploadData.model.f_repair_date = Util.getNowDate()
302
- uploadData.model.f_repairtype = preData.f_repairtype
303
- uploadData.model.f_remarks = preData.f_remarks
304
- uploadData.model.f_paper_id = self.check.id
305
- // 拼接failure
306
- let failure = []
307
- self.model.rows.forEach(row => {
308
- if (row.f_repaire_type == '隐患未处理') {
309
- failure.push({
310
- f_failure_type: row.f_item_name,
311
- failurecase: row.f_item_value?row.f_item_value.split(','):''
312
- })
313
- }
314
- })
315
- uploadData.model.failure = failure
316
- // 拼接repairitems
317
- let rows = JSON.parse(JSON.stringify(self.model.rows))
318
- let repairitems = {
319
- data: []
320
- }
321
- let safecheckOptions = [{"data": "已处理"}, {"data": "未处理"}]
322
- // 取隐患未处理的
323
- rows = rows.filter(row => row.f_repaire_type == '隐患未处理')
324
- //tag)
325
- // 开始拼接
326
- rows.forEach(row => {
327
- let existIndex = -1
328
- // 判断该设备是否已经存在
329
- for (let i = 0; i < repairitems.data.length; i++) {
330
- if (repairitems.data[i].f_type == row.f_device_type) {
331
- existIndex = i
332
- break
333
- }
334
- }
335
- if (existIndex == -1) {
336
- // 不存在则新建
337
- let newItem = {
338
- f_type: row.f_device_type,
339
- details: [{
340
- f_defect_id: row.id,
341
- f_project: `${row.f_item_name}:${row.f_item_value}`,
342
- type: 'selector',
343
- options: safecheckOptions
344
- }]
345
- }
346
- repairitems.data.push(newItem)
347
- } else {
348
- // 存在则追加
349
- repairitems.data[existIndex].details.push({
350
- f_defect_id: row.id,
351
- f_project: `${row.f_item_name}:${row.f_item_value}`,
352
- type: 'selector',
353
- options: safecheckOptions
354
- })
355
- }
356
- })
357
- uploadData.model.f_repairitems = repairitems
358
- //tag)
359
- // 调工单接口
360
- let result = yield self.$resetpost('/af-telephone/rs/logic/callerSend', uploadData)
361
- //tag)
362
- if (result.data.f_service_id) {
363
- const data = {
364
- f_paper_id: rows[0].f_paper_id,
365
- f_service_id: result.data.f_service_id,
366
- itemsId: self.$login.convertToIn(rows.map(row => row.id))
367
- }
368
- //tag
369
- let updateRes = yield self.$resetpost('/api/af-safecheck/logic/updateDefectStateNew', data)
370
- if (updateRes.data.code == 200) {
371
- self.$showMessage('隐患已转维修。')
372
- self.model.search(`f_repaire_type != '无隐患'`, {})
373
- }
374
- }
375
- }
376
-
377
- export default {
378
- title: '隐患项列表',
379
- data() {
380
- return {
381
- model: new PagedList('api/af-safecheck/sql/GetDefectByPaperIdNew', 100, {
382
- f_paper_id: 'this.f_paper_id',f_item_value: 'this.f_item_value'
383
- }),
384
- fileInfoData:[],
385
- showSolveModal: false,
386
- showToRepairModal: false,
387
- showDefectModal: false,
388
- valid: false,
389
- checkDefect:null,
390
- needRepair: false,
391
- solveModal: {
392
- preData: {
393
- type: '',
394
- defectImg: '',
395
- defectImg1:'',
396
- defectImg2:'',
397
- defectImg3:'',
398
- repairedImg: '',
399
- repairedImg1: '',
400
- repairedImg2: '',
401
- repairedImg3: '',
402
- repairedImg4: '',
403
- repairedImg5: '',
404
- state: ''
405
- },
406
- uploadData: {
407
- id: '',
408
- f_repairman: this.$login.f.name,
409
- f_repair_date: Util.getNowDate().substr(0, 10),
410
- f_repair_path: '',
411
- imgSrc: '',
412
- filename: ''
413
- }
414
- },
415
- toRepairModal: {
416
- preData: {
417
- dispatchTypeOptions: [{label: '派发给站点', value: '派发给站点'}, {label: '派发给维修员', value: '派发给维修员'}],
418
- repairTypeOptions: this.$appdata.getParam('报修类型'),
419
- dispatchType: '',
420
- f_repairman: '',
421
- f_repairtype: '',
422
- f_remarks: '',
423
- f_meetunit: '',
424
- f_reciever: '',
425
- f_outlets: '',
426
- userInfo: {},
427
- repairers: []
428
- },
429
- uploadData: {
430
- model: {
431
- serviceacitivity: [{
432
- f_service_acitivity_type: '派单'
433
- }],
434
- f_repairitems: {},
435
- failure: '',
436
- f_source: '安检',
437
- f_service_id: '',
438
- f_contact_phone: '',
439
- f_meetunit: '',
440
- f_phone: '',
441
- f_user_name: '',
442
- f_address: '',
443
- f_repair_date: '',
444
- f_reciever: '',
445
- f_remarks: '',
446
- f_user_type: '',
447
- f_area: '',
448
- f_unit_name: '',
449
- f_street: '',
450
- f_residential_area: '',
451
- f_building: '',
452
- f_unit: '',
453
- f_floor: '',
454
- f_room: '',
455
- aState: '',
456
- f_repairtype: '',
457
- f_userinfo_id: '',
458
- f_userinfo_code: '',
459
- f_orgstr: '',
460
- f_outlets: '',
461
- f_attendant: this.$login.f.name
462
- },
463
- loginUser: {
464
- name: this.$login.f.name,
465
- ename: this.$login.f.ename
466
- },
467
- user: {
468
- f_userinfo_id: ''
469
- },
470
- callObj: null
471
- }
472
- },
473
- showHandleDefectButton: null
474
- }
475
- },
476
- props: ['check'],
477
- ready() {
478
- this.checkDefect=Vue.$appdata.getSingleValue('安检隐患维修后审核')
479
- this.showHandleDefectButton = Vue.$appdata.getSingleValue('隐患查看处理隐患')
480
- this.model.f_item_value = `(SELECT stuff(( SELECT ',' + f_item_value FROM t_devices_items_lists WHERE ( f_is_defect = 'true' OR di.f_is_defect = 'true') AND f_item_id = di.id FOR xml path ( '' ) ),1,1,'' ) )`
481
- if (this.check) {
482
- this.model.f_paper_id = this.check.id
483
- this.model.search(`f_repaire_type != '无隐患'`, {})
484
- }
485
- this.getEmp()
486
- },
487
- methods: {
488
- getfile(res){
489
- this.solveModal.uploadData.filename=res.f_filename
490
- },
491
- //审核通过
492
- auditsure(info){
493
- // 拿到t_devices_items 的ID,给f_audit_results中存入通过 如果未通过,需要可以再次派单,对隐患进行处理
494
- var data = {
495
- id: this.solveModal.uploadData.id,
496
- info:info
497
- }
498
- let http = new HttpResetClass()
499
- http.load('POST', 'api/af-safecheck/logic/DefectAuditUpdate', data, {resolveMsg: null, rejectMsg: null}).then((res) => {
500
- if(res.data.code == 200){
501
- this.model.search(`f_repaire_type != '无隐患'`, {})
502
- this.showSolveModal = false
503
- this.showToRepairModal = false
504
- this.$showMessage('提交成功')
505
- }else{
506
- this.$showMessage('提交失败,请重试')
507
- }
508
- })
509
- },
510
- async solveDefect(row, type) {
511
- console.log(row)
512
- this.fileInfoData = []
513
- await this.getrelafile(this.check.id)
514
- this.solveModal.preData.defectImg = ''
515
- this.solveModal.preData.f_repair_path = ''
516
- this.solveModal.preData.repairedImg = ''
517
- this.solveModal.preData.repairedImg1 = ''
518
- this.solveModal.preData.repairedImg2 = ''
519
- this.solveModal.preData.repairedImg3 = ''
520
- this.solveModal.preData.repairedImg4 = ''
521
- this.solveModal.preData.repairedImg5 = ''
522
- this.solveModal.preData.defectImg = row.f_path ? '/rs/image/file/' + row.f_path : ''
523
- this.solveModal.preData.defectImg1 = row.f_p1_path ? '/rs/image/file/' + row.f_p1_path : ''
524
- this.solveModal.preData.defectImg2 = row.f_p2_path ? '/rs/image/file/' + row.f_p2_path : ''
525
- this.solveModal.preData.defectImg3 = row.f_p3_path ? '/rs/image/file/' + row.f_p3_path : ''
526
- this.solveModal.uploadData.id = row.id
527
- this.solveModal.preData.type = type
528
- this.solveModal.preData.state = row.f_repaire_state
529
- this.solveModal.preData.source = row.f_repair_path_source
530
- if (row.f_repaire_state === '已处理') {
531
- if (row.f_repair_path_source === '微信') {
532
- this.solveModal.preData.f_repair_path = row.f_repair_path
533
- this.solveModal.preData.repairedImg = row.f_repair_path
534
- this.solveModal.preData.repairedImg1 = row.f_repair1_path
535
- } else {
536
- this.solveModal.preData.f_repair_path = row.f_repair_path? '/rs/image/file/' + row.f_repair_path:null
537
- this.solveModal.preData.repairedImg = row.f_repair_path? '/rs/image/file/' + row.f_repair_path:null
538
- this.solveModal.preData.repairedImg1 = row.f_other_dealpath1 ? '/rs/image/file/' + row.f_other_dealpath1 : null
539
- this.solveModal.preData.repairedImg2 = row.f_other_dealpath2 ? '/rs/image/file/' + row.f_other_dealpath2 : null
540
- this.solveModal.preData.repairedImg3 = row.f_repair2_path ? ('/rs/image/file/' + row.f_repair2_path) : ''
541
- this.solveModal.preData.repairedImg4 = row.f_repair3_path ? ('/rs/image/file/' + row.f_repair3_path) : ''
542
- this.solveModal.preData.repairedImg5 = row.f_repair4_path ? ('/rs/image/file/' + row.f_repair4_path) : ''
543
- }
544
- if (type === '现场已处理') {
545
- this.solveModal.uploadData.f_repairman = this.check.f_checker_name
546
- this.solveModal.uploadData.f_repair_date = this.check.f_offsite_time
547
- } else {
548
- this.solveModal.uploadData.f_repairman = row.f_repairman
549
- this.solveModal.uploadData.f_repair_date = row.f_repair_date
550
- this.$set('solveModal.f_audit_results', row.f_audit_results)
551
- }
552
- } else {
553
- this.solveModal.uploadData.f_repairman = this.$login.f.name
554
- this.solveModal.uploadData.f_repair_date = Util.getNowDate().substr(0, 10)
555
- }
556
- this.showSolveModal = !this.showSolveModal
557
- },
558
- async getrelafile(id) {
559
- let http = new HttpResetClass()
560
- let condition = `f_blobid= '${id}' and fusetype ='safeCheck'`
561
- let data = {
562
- items: '*',
563
- tablename: 't_files',
564
- condition: condition,
565
- orderitem: 'id'
566
- }
567
- let getFile = await http.load('POST', 'api/af-safecheck/sql/safe_singleTable_OrderBy', {data: data}, {
568
- warnMsg: null,
569
- resolveMsg: null
570
- })
571
- for (var i = 0; i < getFile.data.length; i++) {
572
- // 如果使用类型包含导入字样,则是execl文件导入的,不做显示
573
- if (getFile.data[i].fusetype && (getFile.data[i].fusetype.includes('execl导入'))) {
574
- getFile.data.splice(i, 1)
575
- i--
576
- continue
577
- }
578
- this.fileInfoData = []
579
- if( getFile.data.length>0){
580
- let temp = getFile.data[i].f_downloadpath
581
- getFile.data[i].f_downloadURL = temp
582
- this.fileInfoData = getFile.data
583
- }
584
- }
585
- },
586
- ok() {
587
- if (!(this.solveModal.uploadData.filename && this.solveModal.uploadData.filename.length > 0)) {
588
- this.$showMessage('请录入处理后照片')
589
- return
590
- }
591
- co(upSolveDefect(this))
592
- },
593
- cancel() {
594
- this.showSolveModal = false
595
- this.showToRepairModal = false
596
- },
597
- toRepair() {
598
- this.showToRepairModal = !this.showToRepairModal
599
- },
600
- getSiteRes(obj) {
601
- //tag
602
- //tag
603
- if(obj.resids[0]){
604
- this.toRepairModal.preData.f_meetunit = obj.res.join('.')
605
- this.toRepairModal.preData.f_reciever = obj.resids.join('.')
606
- }else {
607
- this.toRepairModal.preData.f_meetunit = ''
608
- this.toRepairModal.preData.f_reciever = ''
609
- this.toRepairModal.preData.f_outlets = ''
610
- }
611
- },
612
- // 获取维修员
613
- getEmp() {
614
- let val = {source: 'this.getParentByType($organization$).getChildByName($维修员$).getUsers()', userid: `${this.$login.f.id}`}
615
- let http = new HttpResetClass()
616
- http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
617
- res.data.forEach((item) => {
618
- let http1 = new HttpResetClass()
619
- http1.load('POST', 'api/af-safecheck/sql/safe_singleTable_OrderBy', {
620
- data: {
621
- items: 'f_user_telephone',
622
- tablename: 't_user',
623
- condition: `id = ${item.id}`,
624
- orderitem: 'id'
625
- }
626
- }, {resolveMsg: null, rejectMsg: null}).then((ress) => {
627
- this.toRepairModal.preData.repairers.push({label: `${item.name}:${ress.data[0].f_user_telephone}`, value: item.name})
628
- })
629
- })
630
- })
631
- },
632
- confirm() {
633
- if (this.toRepairModal.preData.dispatchType == '派发给站点' && !this.toRepairModal.preData.f_meetunit) {
634
- this.$showMessage('请选择站点。')
635
- return
636
- }
637
- co(sendRepair(this))
638
- }
639
- },
640
- watch: {
641
- 'check'() {
642
- this.model.f_paper_id = this.check.id
643
- this.model.search(`f_repaire_type != '无隐患'`, {})
644
- },
645
- 'model.rows'() {
646
- if (this.model.rows.length > 0) {
647
- if (this.model.rows[0].f_repaire_type == '隐患未处理') {
648
- this.needRepair = true
649
- return
650
- }
651
- }
652
- this.needRepair = false
653
- }
654
- }
655
- }
656
- </script>
657
- <style lang="less" scoped>
658
- .select-error {
659
- button {
660
- border-bottom: 1px solid #a94442 !important;
661
- }
662
- }
663
- </style>
1
+ <template>
2
+ <div>
3
+ <div :style="{'height':needRepair?'60%':'100%'}">
4
+ <criteria-paged :model="model" :pager="false" v-ref:paged>
5
+ <criteria partial='criteria'>
6
+ <div partial>
7
+ <ul class="nav nav-tabs">
8
+ <li role="presentation" class="active"><a style=" color: #5ac0d9 !important;">隐患明细</a></li>
9
+ </ul>
10
+ </div>
11
+ </criteria>
12
+ <data-grid :model="model" partial='list' class="table_sy">
13
+ <template partial='head'>
14
+ <tr>
15
+ <!-- <th>-->
16
+ <!-- <nobr>隐患设备</nobr>-->
17
+ <!-- </th>-->
18
+ <th>
19
+ <nobr>隐患项</nobr>
20
+ </th>
21
+ <th>
22
+ <nobr>隐患原因</nobr>
23
+ </th>
24
+ <th>
25
+ <nobr>隐患处理方式</nobr>
26
+ </th>
27
+ <th>
28
+ <nobr>处理结果</nobr>
29
+ </th>
30
+ <th v-if="$parent.$parent.$parent.checkDefect=='是'">
31
+ <nobr>审核结果</nobr>
32
+ </th>
33
+ <th>
34
+ <nobr>操作</nobr>
35
+ </th>
36
+ </tr>
37
+ </template>
38
+ <template partial='body'>
39
+ <!-- <td style="text-align: center">-->
40
+ <!-- <nobr>{{row.f_device_type}}</nobr>-->
41
+ <!-- </td>-->
42
+ <td style="text-align: center">
43
+ <nobr>{{row.f_item_name}}</nobr>
44
+ </td>
45
+ <td style="text-align: center">
46
+ <nobr>{{row.f_item_value}}</nobr>
47
+ </td>
48
+ <td style="text-align: center">
49
+ <nobr>{{row.f_repaire_type}}</nobr>
50
+ </td>
51
+ <td style="text-align: center">
52
+ <nobr>{{row.f_repaire_state}}</nobr>
53
+ </td>
54
+ <td style="text-align: center" v-if="$parent.$parent.$parent.checkDefect=='是'">
55
+ <nobr>{{row.f_audit_results?row.f_audit_results:'暂无审核结果'}}</nobr>
56
+ </td>
57
+ <td style="text-align: center">
58
+ <div>
59
+ <!-- <img-button v-if="row.f_repaire_type != '无隐患' && row.f_repaire_type != '维修已处理' && row.f_path" :src="'/rs/image/file/'+row.f_path" :value="'隐患图片'"></img-button>-->
60
+ <!-- <button style="margin-top: 3px" v-if="row.f_repaire_type == '维修已处理'" class="button_new-1 button_spacing" @click="$parent.$parent.$parent.solveDefect( row, 'view')">处理详情</button>-->
61
+ <button style="margin-top: 3px" class="button_new-1 button_spacing" @click="$parent.$parent.$parent.solveDefect(row, row.f_repaire_type)">处理详情</button>
62
+ <button style="margin-top: 3px" v-if="row.f_repaire_type == '隐患未处理' && $parent.$parent.$parent.showHandleDefectButton === '是'" class="button_spacing button_search-1" @click="$parent.$parent.$parent.solveDefect(row, 'solve')">处理隐患</button>
63
+ </div>
64
+ </td>
65
+ </template>
66
+ </data-grid>
67
+ </criteria-paged>
68
+ </div>
69
+
70
+ <div style="overflow-y: scroll;height: 40%" v-if="needRepair">
71
+ <div class="form-horizontal auto">
72
+ <ul class="nav nav-tabs">
73
+ <li role="presentation" class="active"><a style=" color: #000 !important;font-size: 14px">转维修</a></li>
74
+ </ul>
75
+ <validator name='v' @valid="valid = true" @invalid="valid = false">
76
+ <div class="row">
77
+ <div class="col-sm-4" :class="[$v.dispatchtype.required ? 'select-error' : '']">
78
+ <label for="dispatchtype" class="font_normal_body">派发类型</label>
79
+ <input id="dispatchtype" type="text" v-show="false" v-model="$refs.dispatchtype.selectedItems" v-validate:dispatchtype='{required: true }'>
80
+ <v-select :value.sync="toRepairModal.preData.dispatchType" v-model="toRepairModal.preData.dispatchType"
81
+ :options='toRepairModal.preData.dispatchTypeOptions' placeholder='派发类型'
82
+ close-on-select v-ref:dispatchtype>
83
+ </v-select>
84
+ </div>
85
+ <div class="col-sm-4 " v-if="toRepairModal.preData.dispatchType == '派发给站点'">
86
+ <label class="font_normal_body">站&nbsp;&nbsp;点</label>
87
+ <right-tree
88
+ islist
89
+ :userid="$login.f.id"
90
+ :source="'dep=this.getParentByType($organization$).getSpecialResByType($department$),tool.getFullTree(dep.where(row.hasSpecialRole($派单员$)))'"
91
+ @re-res="getSiteRes">
92
+ </right-tree>
93
+ </div>
94
+ <div class="col-sm-4 " v-if="toRepairModal.preData.dispatchType == '派发给维修员'" :class="[$v.f_repairman.required ? 'select-error' : '']">
95
+ <input type="text" v-show="false" v-model="toRepairModal.preData.f_repairman" v-validate:f_repairman='{required: true }'>
96
+ <label class="font_normal_body">维修员</label>
97
+ <v-select
98
+ :value.sync="toRepairModal.preData.f_repairman"
99
+ :value-single="true"
100
+ :options='toRepairModal.preData.repairers'
101
+ placeholder='请选择维修员'
102
+ close-on-select></v-select>
103
+ </div>
104
+ <div class="col-sm-4" :class="[$v.f_repairtype.required ? 'select-error' : '']">
105
+ <input type="text" v-show="false" v-model="toRepairModal.preData.f_repairtype" v-validate:f_repairtype='{required: true }'>
106
+ <label class="font_normal_body">报修类型</label>
107
+ <v-select :value.sync="toRepairModal.preData.f_repairtype" style="width:60%"
108
+ class="select select_list"
109
+ :value-single="true"
110
+ :options='toRepairModal.preData.repairTypeOptions'
111
+ close-on-select>
112
+ </v-select>
113
+ </div>
114
+ </div>
115
+ <div class="row">
116
+ <div class="col-sm-8 form-group">
117
+ <label class="font_normal_body" >备&emsp;&emsp;注</label>
118
+ <input class="input_search" style="width: 60%" type="text" v-model="toRepairModal.preData.f_remarks" placeholder="备注">
119
+
120
+ </div>
121
+ <div class="col-sm-4" style="margin-top: 1%">
122
+ <button class="button_search" :disabled="!valid" @click="confirm">转维修</button>
123
+ </div>
124
+ </div>
125
+ </validator>
126
+ </div>
127
+ </div>
128
+ <modal :show.sync="showSolveModal" v-ref:solveModal>
129
+ <div slot="modal-header" class="modal-header">
130
+ <h4 class="modal-title">
131
+ {{solveModal.preData.type == 'view'?'处理详情':'处理隐患'}}
132
+ </h4>
133
+ </div>
134
+ <div slot="modal-body" class="modal-body">
135
+ <div style="width: 100%;height: 36px;background-color: #f1f8ff;float: left">
136
+ <div style="width: 8px;height: 100%;background-color: #6aa6e2;margin-right: 20px;float: left"></div>
137
+ <div style="width: auto;height:100%;float: left;"><p class="title-font" style="margin-top: 5px">处理前</p></div>
138
+ </div>
139
+
140
+ <div class="col-sm-6" style="margin-top: 10px">
141
+ <label class="font_normal_body">安&nbsp;检&nbsp;员</label>
142
+ <input class="input_search" style="width: 60%" type="text" disabled="true" v-model="check.f_checker_name" placeholder="安检员">
143
+ </div>
144
+ <div class="col-sm-6" style="margin-top: 10px">
145
+ <label class="font_normal_body">安检时间</label>
146
+ <input class="input_search" style="width: 60%" type="text" disabled="true" v-model="check.f_offsite_time" placeholder="安检时间">
147
+ </div>
148
+ <div class="col-sm-12" style="margin-bottom: 10px" v-if="solveModal.preData.defectImg">
149
+ <label class="font_normal_body">隐患图片</label>
150
+ <img-self :width="200" :height="200" :src="solveModal.preData.defectImg"></img-self>
151
+ </div>
152
+ <div class="col-sm-12" style="margin-bottom: 10px" v-show="solveModal.preData.defectImg1">
153
+ <label class="font_normal_body">隐患图片</label>
154
+ <img-self :width="200" :height="200" :src="solveModal.preData.defectImg1"></img-self>
155
+ </div>
156
+ <div class="col-sm-12" style="margin-bottom: 10px" v-show="solveModal.preData.defectImg2">
157
+ <label class="font_normal_body">隐患图片</label>
158
+ <img-self :width="200" :height="200" :src="solveModal.preData.defectImg2"></img-self>
159
+ </div>
160
+ <div class="col-sm-12" style="margin-bottom: 10px" v-show="solveModal.preData.defectImg3">
161
+ <label class="font_normal_body">隐患图片</label>
162
+ <img-self :width="200" :height="200" :src="solveModal.preData.defectImg3"></img-self>
163
+ </div>
164
+
165
+ <div style="width: 100%;height: 36px;background-color: #f1f8ff;float: left" v-show="solveModal.preData.state == '已处理' || solveModal.preData.type != 'solve'">
166
+ <div style="width: 8px;height: 100%;background-color: #6aa6e2;margin-right: 20px;float: left"></div>
167
+ <div style="width: auto;height:100%;float: left;"><p class="title-font" style="margin-top: 5px">处理后</p></div>
168
+ </div>
169
+ <div class="col-sm-6" style="margin-top: 10px" v-show="solveModal.preData.state == '已处理'">
170
+ <label class="font_normal_body">处&nbsp;理&nbsp;人</label>
171
+ <input v-if="solveModal.preData.type != 'solve'" class="input_search" style="width: 60%" disabled="true" type="text" v-model="solveModal.uploadData.f_repairman" placeholder="处理人">
172
+ <v-select
173
+ v-if="solveModal.preData.type == 'solve'"
174
+ :value.sync="solveModal.uploadData.f_repairman"
175
+ :value-single="true"
176
+ :options='toRepairModal.preData.repairers'
177
+ placeholder='请选择维修员'
178
+ close-on-select></v-select>
179
+ </div>
180
+ <div class="col-sm-6" style="margin-top: 10px" v-show="solveModal.preData.state == '已处理'">
181
+ <label class="font_normal_body">处理时间</label>
182
+ <datepicker
183
+ :disabled="solveModal.preData.type == 'view'"
184
+ placeholder='处理时间' style="width:60%"
185
+ :disabled-days-of-week="[]"
186
+ :format="'yyyy-MM-dd'"
187
+ :show-rest-button="reset"
188
+ :value.sync="solveModal.uploadData.f_repair_date">
189
+ </datepicker>
190
+ </div>
191
+ <div v-if="solveModal.preData.type == 'solve'" class="col-sm-12" style="margin-bottom: 10px">
192
+ <label class="font_normal_body">处理后图片</label>
193
+ <safecheck-file-upload
194
+ :issearch="false"
195
+ :isupload="true"
196
+ :blodid="check.id"
197
+ :isdelete="true"
198
+ flag="safeCheck"
199
+ @filename="getfile"
200
+ ></safecheck-file-upload>
201
+ </div>
202
+ <div v-if="solveModal.preData.state == '已处理'" class="col-sm-12" style="margin-bottom: 10px">
203
+ <p> <label class="font_normal_body">处理后图片</label></p>
204
+ <P></P>
205
+ <div class="col-sm-12">
206
+ <div class="col-sm-6" v-for="item in fileInfoData">
207
+ <!-- <img :src="item.f_downloadURL">-->
208
+ <img-self :width="200" :height="200" :src="item.f_downloadURL" style="margin-left: 10px"></img-self>
209
+ </div>
210
+ <div class="col-sm-6" v-if="solveModal.preData.repairedImg">
211
+ <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg" style="margin-left: 10px"></img-self>
212
+ </div>
213
+ <div class="col-sm-6" v-if="solveModal.preData.repairedImg1">
214
+ <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg1" style="margin-left: 10px"></img-self>
215
+ </div>
216
+ <div class="col-sm-6" v-if="solveModal.preData.repairedImg2">
217
+ <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg2" style="margin-left: 10px"></img-self>
218
+ </div>
219
+ <div class="col-sm-6" v-if="solveModal.preData.repairedImg2">
220
+ <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg2" style="margin-left: 10px"></img-self>
221
+ </div>
222
+ <div class="col-sm-6" v-if="solveModal.preData.repairedImg3">
223
+ <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg3" style="margin-left: 10px"></img-self>
224
+ </div>
225
+ <div class="col-sm-6" v-if="solveModal.preData.repairedImg4">
226
+ <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg4" style="margin-left: 10px"></img-self>
227
+ </div>
228
+ <div class="col-sm-6" v-if="solveModal.preData.repairedImg5">
229
+ <img-self :width="200" :height="200" :src="solveModal.preData.repairedImg5" style="margin-left: 10px"></img-self>
230
+ </div>
231
+
232
+ </div>
233
+ </div>
234
+ </div>
235
+ <div slot="modal-footer" class="modal-footer" style="text-align: center">
236
+ <button class="button_search" v-if="checkDefect=='是' && solveModal.preData.type == 'view'" @click="auditsure('通过')" v-if="solveModal.preData.type == 'view' && !solveModal.f_audit_results">审核通过</button>
237
+ <button class="button_search" v-if="checkDefect=='是' && solveModal.preData.type == 'view'" @click="auditsure('不通过')" v-if="solveModal.preData.type == 'view' && !solveModal.f_audit_results">审核不通过</button>
238
+ <button class="button_search" v-if="solveModal.preData.type == 'solve'" @click="ok">确认</button>
239
+ <button class="button_search" @click="cancel">取消</button>
240
+ </div>
241
+ </modal>
242
+
243
+ </div>
244
+ </template>
245
+
246
+ <script>
247
+ import {PagedList, HttpResetClass} from 'vue-client'
248
+ import * as Util from '../../components/Util'
249
+ import co from 'co'
250
+ import Vue from "vue";
251
+
252
+ const upSolveDefect = function * (self) {
253
+ let uploadData = self.solveModal.uploadData
254
+ //tag)
255
+ self.$resetpost('/api/af-safecheck/logic/pcRepairDefectNew', self.solveModal.uploadData, {resolveMsg: null, rejectMsg: null})
256
+ .then(res => {
257
+ if (res.data.code === 200) {
258
+ self.$showMessage('隐患已处理。')
259
+ self.showSolveModal = false
260
+ self.model.search('f_repaire_type != \'无隐患\'', {})
261
+ self.solveModal.uploadData={
262
+ id: '',
263
+ f_repairman: self.$login.f.name,
264
+ f_repair_date: Util.getNowDate().substr(0, 10),
265
+ f_repair_path: '',
266
+ imgSrc: '',
267
+ filename: '',
268
+ f_defect_remark:''
269
+ }
270
+ }
271
+ })
272
+ }
273
+
274
+ const sendRepair = function* (self) {
275
+ let preData = self.toRepairModal.preData
276
+ let uploadData = self.toRepairModal.uploadData
277
+
278
+ if (preData.dispatchType == '派发给站点') {
279
+ uploadData.model.serviceacitivity[0].f_meetunit = preData.f_meetunit
280
+ uploadData.model.serviceacitivity[0].f_reciever = preData.f_reciever
281
+ uploadData.model.f_meetunit = preData.f_meetunit
282
+ uploadData.model.f_orgstr = preData.f_reciever
283
+ uploadData.model.f_outlets = preData.f_outlets
284
+ } else if (preData.dispatchType == '派发给维修员') {
285
+ uploadData.model.serviceacitivity[0].f_reciever = preData.f_repairman
286
+ // uploadData.model.f_meetunit = self.$login.f.orgpathnames
287
+ // uploadData.model.f_orgstr = self.$login.f.orgpathstr
288
+ // uploadData.model.f_outlets = self.$login.f.f_parentname
289
+ uploadData.model.f_meetunit = self.$login.f.deps
290
+ uploadData.model.f_orgid = self.$login.f.orgid
291
+ uploadData.model.f_filiale = self.$login.f.org
292
+ uploadData.model.f_outlets = self.$login.f.deps
293
+ uploadData.model.f_filiale_id = self.$login.f.orgid
294
+ uploadData.toRepair = '一级派单'
295
+ }
296
+ uploadData.model.f_handlingtype = preData.dispatchType
297
+ let res = yield self.$resetpost('/api/af-safecheck/sql/GetUserForRepaireNew', {data: {f_userinfo_id: self.check.f_userinfo_id}})
298
+ preData.userInfo = res.data[0]
299
+ uploadData.model = Object.assign(uploadData.model, preData.userInfo)
300
+ uploadData.user.f_userinfo_id = preData.userInfo.f_userinfo_id
301
+ uploadData.model.f_repair_date = Util.getNowDate()
302
+ uploadData.model.f_repairtype = preData.f_repairtype
303
+ uploadData.model.f_remarks = preData.f_remarks
304
+ uploadData.model.f_paper_id = self.check.id
305
+ // 拼接failure
306
+ let failure = []
307
+ self.model.rows.forEach(row => {
308
+ if (row.f_repaire_type == '隐患未处理') {
309
+ failure.push({
310
+ f_failure_type: row.f_item_name,
311
+ failurecase: row.f_item_value?row.f_item_value.split(','):''
312
+ })
313
+ }
314
+ })
315
+ uploadData.model.failure = failure
316
+ // 拼接repairitems
317
+ let rows = JSON.parse(JSON.stringify(self.model.rows))
318
+ let repairitems = {
319
+ data: []
320
+ }
321
+ let safecheckOptions = [{"data": "已处理"}, {"data": "未处理"}]
322
+ // 取隐患未处理的
323
+ rows = rows.filter(row => row.f_repaire_type == '隐患未处理')
324
+ //tag)
325
+ // 开始拼接
326
+ rows.forEach(row => {
327
+ let existIndex = -1
328
+ // 判断该设备是否已经存在
329
+ for (let i = 0; i < repairitems.data.length; i++) {
330
+ if (repairitems.data[i].f_type == row.f_device_type) {
331
+ existIndex = i
332
+ break
333
+ }
334
+ }
335
+ if (existIndex == -1) {
336
+ // 不存在则新建
337
+ let newItem = {
338
+ f_type: row.f_device_type,
339
+ details: [{
340
+ f_defect_id: row.id,
341
+ f_project: `${row.f_item_name}:${row.f_item_value}`,
342
+ type: 'selector',
343
+ options: safecheckOptions
344
+ }]
345
+ }
346
+ repairitems.data.push(newItem)
347
+ } else {
348
+ // 存在则追加
349
+ repairitems.data[existIndex].details.push({
350
+ f_defect_id: row.id,
351
+ f_project: `${row.f_item_name}:${row.f_item_value}`,
352
+ type: 'selector',
353
+ options: safecheckOptions
354
+ })
355
+ }
356
+ })
357
+ uploadData.model.f_repairitems = repairitems
358
+ //tag)
359
+ // 调工单接口
360
+ let result = yield self.$resetpost('/af-telephone/rs/logic/callerSend', uploadData)
361
+ //tag)
362
+ if (result.data.f_service_id) {
363
+ const data = {
364
+ f_paper_id: rows[0].f_paper_id,
365
+ f_service_id: result.data.f_service_id,
366
+ itemsId: self.$login.convertToIn(rows.map(row => row.id))
367
+ }
368
+ //tag
369
+ let updateRes = yield self.$resetpost('/api/af-safecheck/logic/updateDefectStateNew', data)
370
+ if (updateRes.data.code == 200) {
371
+ self.$showMessage('隐患已转维修。')
372
+ self.model.search(`f_repaire_type != '无隐患'`, {})
373
+ }
374
+ }
375
+ }
376
+
377
+ export default {
378
+ title: '隐患项列表',
379
+ data() {
380
+ return {
381
+ model: new PagedList('api/af-safecheck/sql/GetDefectByPaperIdNew', 100, {
382
+ f_paper_id: 'this.f_paper_id',f_item_value: 'this.f_item_value'
383
+ }),
384
+ fileInfoData:[],
385
+ showSolveModal: false,
386
+ showToRepairModal: false,
387
+ showDefectModal: false,
388
+ valid: false,
389
+ checkDefect:null,
390
+ needRepair: false,
391
+ solveModal: {
392
+ preData: {
393
+ type: '',
394
+ defectImg: '',
395
+ defectImg1:'',
396
+ defectImg2:'',
397
+ defectImg3:'',
398
+ repairedImg: '',
399
+ repairedImg1: '',
400
+ repairedImg2: '',
401
+ repairedImg3: '',
402
+ repairedImg4: '',
403
+ repairedImg5: '',
404
+ state: ''
405
+ },
406
+ uploadData: {
407
+ id: '',
408
+ f_repairman: this.$login.f.name,
409
+ f_repair_date: Util.getNowDate().substr(0, 10),
410
+ f_repair_path: '',
411
+ imgSrc: '',
412
+ filename: ''
413
+ }
414
+ },
415
+ toRepairModal: {
416
+ preData: {
417
+ dispatchTypeOptions: [{label: '派发给站点', value: '派发给站点'}, {label: '派发给维修员', value: '派发给维修员'}],
418
+ repairTypeOptions: this.$appdata.getParam('报修类型'),
419
+ dispatchType: '',
420
+ f_repairman: '',
421
+ f_repairtype: '',
422
+ f_remarks: '',
423
+ f_meetunit: '',
424
+ f_reciever: '',
425
+ f_outlets: '',
426
+ userInfo: {},
427
+ repairers: []
428
+ },
429
+ uploadData: {
430
+ model: {
431
+ serviceacitivity: [{
432
+ f_service_acitivity_type: '派单'
433
+ }],
434
+ f_repairitems: {},
435
+ failure: '',
436
+ f_source: '安检',
437
+ f_service_id: '',
438
+ f_contact_phone: '',
439
+ f_meetunit: '',
440
+ f_phone: '',
441
+ f_user_name: '',
442
+ f_address: '',
443
+ f_repair_date: '',
444
+ f_reciever: '',
445
+ f_remarks: '',
446
+ f_user_type: '',
447
+ f_area: '',
448
+ f_unit_name: '',
449
+ f_street: '',
450
+ f_residential_area: '',
451
+ f_building: '',
452
+ f_unit: '',
453
+ f_floor: '',
454
+ f_room: '',
455
+ aState: '',
456
+ f_repairtype: '',
457
+ f_userinfo_id: '',
458
+ f_userinfo_code: '',
459
+ f_orgstr: '',
460
+ f_outlets: '',
461
+ f_attendant: this.$login.f.name
462
+ },
463
+ loginUser: {
464
+ name: this.$login.f.name,
465
+ ename: this.$login.f.ename
466
+ },
467
+ user: {
468
+ f_userinfo_id: ''
469
+ },
470
+ callObj: null
471
+ }
472
+ },
473
+ showHandleDefectButton: null
474
+ }
475
+ },
476
+ props: ['check'],
477
+ ready() {
478
+ this.checkDefect=Vue.$appdata.getSingleValue('安检隐患维修后审核')
479
+ this.showHandleDefectButton = Vue.$appdata.getSingleValue('隐患查看处理隐患')
480
+ this.model.f_item_value = `(SELECT stuff(( SELECT ',' + f_item_value FROM t_devices_items_lists WHERE ( f_is_defect = 'true' OR di.f_is_defect = 'true') AND f_item_id = di.id FOR xml path ( '' ) ),1,1,'' ) )`
481
+ if (this.check) {
482
+ this.model.f_paper_id = this.check.id
483
+ this.model.search(`f_repaire_type != '无隐患'`, {})
484
+ }
485
+ this.getEmp()
486
+ },
487
+ methods: {
488
+ getfile(res){
489
+ this.solveModal.uploadData.filename=res.f_filename
490
+ },
491
+ //审核通过
492
+ auditsure(info){
493
+ // 拿到t_devices_items 的ID,给f_audit_results中存入通过 如果未通过,需要可以再次派单,对隐患进行处理
494
+ var data = {
495
+ id: this.solveModal.uploadData.id,
496
+ info:info
497
+ }
498
+ let http = new HttpResetClass()
499
+ http.load('POST', 'api/af-safecheck/logic/DefectAuditUpdate', data, {resolveMsg: null, rejectMsg: null}).then((res) => {
500
+ if(res.data.code == 200){
501
+ this.model.search(`f_repaire_type != '无隐患'`, {})
502
+ this.showSolveModal = false
503
+ this.showToRepairModal = false
504
+ this.$showMessage('提交成功')
505
+ }else{
506
+ this.$showMessage('提交失败,请重试')
507
+ }
508
+ })
509
+ },
510
+ async solveDefect(row, type) {
511
+ console.log(row)
512
+ this.fileInfoData = []
513
+ await this.getrelafile(this.check.id)
514
+ this.solveModal.preData.defectImg = ''
515
+ this.solveModal.preData.f_repair_path = ''
516
+ this.solveModal.preData.repairedImg = ''
517
+ this.solveModal.preData.repairedImg1 = ''
518
+ this.solveModal.preData.repairedImg2 = ''
519
+ this.solveModal.preData.repairedImg3 = ''
520
+ this.solveModal.preData.repairedImg4 = ''
521
+ this.solveModal.preData.repairedImg5 = ''
522
+ this.solveModal.preData.defectImg = row.f_path ? '/rs/image/file/' + row.f_path : ''
523
+ this.solveModal.preData.defectImg1 = row.f_p1_path ? '/rs/image/file/' + row.f_p1_path : ''
524
+ this.solveModal.preData.defectImg2 = row.f_p2_path ? '/rs/image/file/' + row.f_p2_path : ''
525
+ this.solveModal.preData.defectImg3 = row.f_p3_path ? '/rs/image/file/' + row.f_p3_path : ''
526
+ this.solveModal.uploadData.id = row.id
527
+ this.solveModal.preData.type = type
528
+ this.solveModal.preData.state = row.f_repaire_state
529
+ this.solveModal.preData.source = row.f_repair_path_source
530
+ if (row.f_repaire_state === '已处理') {
531
+ if (row.f_repair_path_source === '微信') {
532
+ this.solveModal.preData.f_repair_path = row.f_repair_path
533
+ this.solveModal.preData.repairedImg = row.f_repair_path
534
+ this.solveModal.preData.repairedImg1 = row.f_repair1_path
535
+ } else {
536
+ this.solveModal.preData.f_repair_path = row.f_repair_path? '/rs/image/file/' + row.f_repair_path:null
537
+ this.solveModal.preData.repairedImg = row.f_repair_path? '/rs/image/file/' + row.f_repair_path:null
538
+ this.solveModal.preData.repairedImg1 = row.f_other_dealpath1 ? '/rs/image/file/' + row.f_other_dealpath1 : null
539
+ this.solveModal.preData.repairedImg2 = row.f_other_dealpath2 ? '/rs/image/file/' + row.f_other_dealpath2 : null
540
+ this.solveModal.preData.repairedImg3 = row.f_repair2_path ? ('/rs/image/file/' + row.f_repair2_path) : ''
541
+ this.solveModal.preData.repairedImg4 = row.f_repair3_path ? ('/rs/image/file/' + row.f_repair3_path) : ''
542
+ this.solveModal.preData.repairedImg5 = row.f_repair4_path ? ('/rs/image/file/' + row.f_repair4_path) : ''
543
+ }
544
+ if (type === '现场已处理') {
545
+ this.solveModal.uploadData.f_repairman = this.check.f_checker_name
546
+ this.solveModal.uploadData.f_repair_date = this.check.f_offsite_time
547
+ } else {
548
+ this.solveModal.uploadData.f_repairman = row.f_repairman
549
+ this.solveModal.uploadData.f_repair_date = row.f_repair_date
550
+ this.$set('solveModal.f_audit_results', row.f_audit_results)
551
+ }
552
+ } else {
553
+ this.solveModal.uploadData.f_repairman = this.$login.f.name
554
+ this.solveModal.uploadData.f_repair_date = Util.getNowDate().substr(0, 10)
555
+ }
556
+ this.showSolveModal = !this.showSolveModal
557
+ },
558
+ async getrelafile(id) {
559
+ let http = new HttpResetClass()
560
+ let condition = `f_blobid= '${id}' and fusetype ='safeCheck'`
561
+ let data = {
562
+ items: '*',
563
+ tablename: 't_files',
564
+ condition: condition,
565
+ orderitem: 'id'
566
+ }
567
+ let getFile = await http.load('POST', 'api/af-safecheck/sql/safe_singleTable_OrderBy', {data: data}, {
568
+ warnMsg: null,
569
+ resolveMsg: null
570
+ })
571
+ for (var i = 0; i < getFile.data.length; i++) {
572
+ // 如果使用类型包含导入字样,则是execl文件导入的,不做显示
573
+ if (getFile.data[i].fusetype && (getFile.data[i].fusetype.includes('execl导入'))) {
574
+ getFile.data.splice(i, 1)
575
+ i--
576
+ continue
577
+ }
578
+ this.fileInfoData = []
579
+ if( getFile.data.length>0){
580
+ let temp = getFile.data[i].f_downloadpath
581
+ getFile.data[i].f_downloadURL = temp
582
+ this.fileInfoData = getFile.data
583
+ }
584
+ }
585
+ },
586
+ ok() {
587
+ if (!(this.solveModal.uploadData.filename && this.solveModal.uploadData.filename.length > 0)) {
588
+ this.$showMessage('请录入处理后照片')
589
+ return
590
+ }
591
+ co(upSolveDefect(this))
592
+ },
593
+ cancel() {
594
+ this.showSolveModal = false
595
+ this.showToRepairModal = false
596
+ },
597
+ toRepair() {
598
+ this.showToRepairModal = !this.showToRepairModal
599
+ },
600
+ getSiteRes(obj) {
601
+ //tag
602
+ //tag
603
+ if(obj.resids[0]){
604
+ this.toRepairModal.preData.f_meetunit = obj.res.join('.')
605
+ this.toRepairModal.preData.f_reciever = obj.resids.join('.')
606
+ }else {
607
+ this.toRepairModal.preData.f_meetunit = ''
608
+ this.toRepairModal.preData.f_reciever = ''
609
+ this.toRepairModal.preData.f_outlets = ''
610
+ }
611
+ },
612
+ // 获取维修员
613
+ getEmp() {
614
+ let val = {source: 'this.getParentByType($organization$).getChildByName($维修员$).getUsers()', userid: `${this.$login.f.id}`}
615
+ let http = new HttpResetClass()
616
+ http.load('POST', '/rs/search', {data: val}, {resolveMsg: null, rejectMsg: null}).then((res) => {
617
+ res.data.forEach((item) => {
618
+ let http1 = new HttpResetClass()
619
+ http1.load('POST', 'api/af-safecheck/sql/safe_singleTable_OrderBy', {
620
+ data: {
621
+ items: 'f_user_telephone',
622
+ tablename: 't_user',
623
+ condition: `id = ${item.id}`,
624
+ orderitem: 'id'
625
+ }
626
+ }, {resolveMsg: null, rejectMsg: null}).then((ress) => {
627
+ this.toRepairModal.preData.repairers.push({label: `${item.name}:${ress.data[0].f_user_telephone}`, value: item.name})
628
+ })
629
+ })
630
+ })
631
+ },
632
+ confirm() {
633
+ if (this.toRepairModal.preData.dispatchType == '派发给站点' && !this.toRepairModal.preData.f_meetunit) {
634
+ this.$showMessage('请选择站点。')
635
+ return
636
+ }
637
+ co(sendRepair(this))
638
+ }
639
+ },
640
+ watch: {
641
+ 'check'() {
642
+ this.model.f_paper_id = this.check.id
643
+ this.model.search(`f_repaire_type != '无隐患'`, {})
644
+ },
645
+ 'model.rows'() {
646
+ if (this.model.rows.length > 0) {
647
+ if (this.model.rows[0].f_repaire_type == '隐患未处理') {
648
+ this.needRepair = true
649
+ return
650
+ }
651
+ }
652
+ this.needRepair = false
653
+ }
654
+ }
655
+ }
656
+ </script>
657
+ <style lang="less" scoped>
658
+ .select-error {
659
+ button {
660
+ border-bottom: 1px solid #a94442 !important;
661
+ }
662
+ }
663
+ </style>