apply-clients 7.1.36-yuchuan-58 → 7.1.36-yuchuan-60

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 (68) hide show
  1. package/android.html +27 -27
  2. package/build/dev-server.js +187 -187
  3. package/package.json +1 -1
  4. package/src/apply.js +166 -166
  5. package/src/applyAndroid.js +98 -98
  6. package/src/components/android/AppSign.vue +232 -232
  7. package/src/components/android/Ignition/VentilationIgnition.vue +409 -409
  8. package/src/components/android/Ignition/VentilationIgnitionHandle.vue +472 -472
  9. package/src/components/android/Process/AppExplorationUser.vue +454 -454
  10. package/src/components/android/Process/AppServiceControl.vue +1434 -1434
  11. package/src/components/android/Process/Processes/AppInstallationDetails.vue +1026 -1026
  12. package/src/components/android/Process/Processes/newAppInstallationDetails.vue +671 -671
  13. package/src/components/android/SealBind.vue +382 -382
  14. package/src/components/android/SealManage.vue +278 -278
  15. package/src/components/android/Sign/AppSignTask.vue +183 -183
  16. package/src/components/android/Supervisory/AppProcessSupervisory.vue +344 -344
  17. package/src/components/android/Task/Build/BuildTsak.vue +117 -117
  18. package/src/components/android/Task/BuildIgnition/BuildIgnition.vue +114 -114
  19. package/src/components/android/Task/GuanXianJianShe/AppExplorationGuanXian.vue +317 -317
  20. package/src/components/android/Task/RepairFromSend/RepairFrom.vue +124 -124
  21. package/src/components/android/Task/RepairFromSend/RepairSend.vue +124 -124
  22. package/src/components/android/Task/ShiGongXinXi/AppShowBuildUser.vue +431 -431
  23. package/src/components/android/Task/Survey/SurveyTsak.vue +141 -141
  24. package/src/components/android/Task/yiban/AppShowDone.vue +442 -442
  25. package/src/components/android/newPackage/customerServiceManager.vue +218 -218
  26. package/src/components/android/newPackage/projectPrice.vue +218 -218
  27. package/src/components/product/ApplyCharge/ApplyChargeList.vue +1101 -1101
  28. package/src/components/product/ApplyGuanXian/GuanXianCaiLiao.vue +236 -236
  29. package/src/components/product/ApplyGuanXian/GuanXianExplorationSelect.vue +325 -325
  30. package/src/components/product/ApplyGuanXian/GuanXianExplorationUser.vue +142 -142
  31. package/src/components/product/ApplyGuanXian/GuanXianExplorationsupervisory.vue +166 -166
  32. package/src/components/product/ApplyGuanXian/GuanXianSupervisoryhCart.vue +119 -119
  33. package/src/components/product/ApplyGuanXian/GuanXiansupsupervisory.vue +140 -140
  34. package/src/components/product/ApplyMap/AppMapLocation.vue +829 -829
  35. package/src/components/product/ApplyMap/ApplyMapInputSearch.vue +335 -335
  36. package/src/components/product/ChongZheng/ApplyChongZhengList.vue +417 -417
  37. package/src/components/product/Function/InstallFunction.vue +132 -132
  38. package/src/components/product/Function/InstallInfoSelect.vue +374 -374
  39. package/src/components/product/Ignition/IgnitionDispatch.vue +90 -90
  40. package/src/components/product/Ignition/IgnitionListManage.vue +604 -604
  41. package/src/components/product/Ignition/IgnitionRecord.vue +380 -380
  42. package/src/components/product/InsuranceApply/InsuranceReport.vue +188 -188
  43. package/src/components/product/List/ShowAllActivity.vue +541 -541
  44. package/src/components/product/List/ShowDevices.vue +279 -279
  45. package/src/components/product/Print/BuildOrder/buildOrderList.vue +446 -446
  46. package/src/components/product/Process/ExplorationSelect.vue +593 -593
  47. package/src/components/product/Process/ExplorationUser.vue +154 -154
  48. package/src/components/product/Process/New1ExplorationUser.vue +196 -196
  49. package/src/components/product/Process/NewExplorationSelect.vue +587 -587
  50. package/src/components/product/Process/NewExplorationUser.vue +216 -216
  51. package/src/components/product/Process/Processes/chargeManagement.vue +714 -714
  52. package/src/components/product/Process/Processes/selectApply.vue +250 -250
  53. package/src/components/product/Process/Processes/selectChaiChuUserinfo.vue +230 -230
  54. package/src/components/product/Process/Processes/selectOldUserinfo.vue +241 -241
  55. package/src/components/product/Process/Processes/selectUserinfo.vue +234 -234
  56. package/src/components/product/Process/Service/ServiceControl.vue +2223 -2223
  57. package/src/components/product/Process/Service/ShowBackReason.vue +33 -33
  58. package/src/components/product/ServiceView.vue +644 -644
  59. package/src/components/product/Stop/StopApplyList.vue +224 -224
  60. package/src/components/product/Supervisory/NewSupervisoryhCart.vue +175 -175
  61. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +593 -593
  62. package/src/components/product/Supervisory/SupervisoryControl.vue +114 -114
  63. package/src/components/product/Supervisory/SupervisoryList.vue +586 -586
  64. package/src/components/product/Supervisory/SupervisoryhCart.vue +120 -120
  65. package/src/components/product/Supervisory/YiBanSupervisoryControl.vue +111 -111
  66. package/src/components/product/Supervisory/YiBanSupervisoryList.vue +4 -0
  67. package/src/components/product/VueUtils/ApplyUpload.vue +303 -303
  68. package/src/main.js +27 -27
@@ -1,1434 +1,1434 @@
1
- <template>
2
- <div class="col-sm-12 col-xs-12 p-10">
3
- <accordion one-at-a-time="true">
4
- <panel :header="selectdata.defname" :is-open="isOpen" type="primary">
5
- <app-service-view v-ref:serviceview :data="show_data" v-if="showview"></app-service-view>
6
- </panel>
7
- <panel header='地图' :is-open="!isOpen" type="primary" v-if="selectdata.defname ==='现场勘察'">
8
- <div style="height: 85vh">
9
- <apply-map-com :selectdata="selectdata"></apply-map-com>
10
- </div>
11
- </panel>
12
- </accordion>
13
- </div>
14
- </template>
15
- <script>
16
- import Vue from 'vue'
17
- import {HttpResetClass} from 'vue-client'
18
- import {isEmpty} from '../../Util'
19
- // Date格式化
20
- Date.prototype.Format = function (fmt) {
21
- var o = {
22
- 'M+': this.getMonth() + 1, // 月份
23
- 'd+': this.getDate(), // 日
24
- 'H+': this.getHours(), // 小时
25
- 'm+': this.getMinutes(), // 分
26
- 's+': this.getSeconds(), // 秒
27
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
28
- 'S': this.getMilliseconds() // 毫秒
29
- }
30
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
31
- for (var k in o) {
32
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
33
- }
34
- return fmt
35
- }
36
- export default {
37
- title: '报建流程业务控制层',
38
- props: ['selectdata', 'title'],
39
- data() {
40
- return {
41
- json_datas: null,
42
- data: null,
43
- show_data: null,
44
- showview: false,
45
- config: {},
46
- isOpen: true
47
- }
48
- },
49
- ready() {
50
- this.refurbish()
51
- },
52
- methods: {
53
- async refurbish() {
54
- this.showview = false
55
- let title=this.title
56
- let http = new HttpResetClass()
57
- let data = {
58
- workname: this.selectdata.processname
59
- }
60
- await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyGetConfigs`, {
61
- data
62
- }, {resolveMsg: null, rejectMsg: null}).then((res) => {
63
- this.json_datas = res.data
64
- })
65
- let sum = 0
66
- let jsonData = {}
67
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
68
- this.$showMessage("网络故障,请刷新页面")
69
- return
70
- }
71
- this.json_datas.activitys.forEach(item => {
72
- if (this.selectdata.defname === '施工信息') {
73
- if (item.title === '工程施工') {
74
- jsonData = item // 拿到当前节点的json配置信息
75
- sum++ // 节点名一样的个数
76
- }
77
- }else if (this.selectdata.defname === item.title) {
78
- jsonData = item // 拿到当前节点的json配置信息
79
- sum++ // 节点名一样的个数
80
- }
81
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
82
- })
83
-
84
- if (sum === 0) {
85
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
86
- return
87
- }
88
- if (sum > 1) {
89
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
90
- return
91
- }
92
-
93
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
94
-
95
- // fields 字段填充值
96
- for (const item of this.selectdata.fields) {
97
- if (!item.value) {
98
- item.value = null
99
- }
100
-
101
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
102
- if (item.eval) {
103
- let user = Vue.user
104
- // 将PC用户信息 替换成 APP的
105
- item.value = eval(item.default.replace('this.$login.f', 'user'))
106
- } else {
107
- item.value = item.default
108
- }
109
- }
110
-
111
- if (this.selectdata[item.field]) {
112
- // 将json字符串格式化赋值给value
113
- if (String(this.selectdata[item.field]).startsWith("{")) {
114
- item.value = JSON.parse(this.selectdata[item.field])
115
- } else {
116
- item.value = this.selectdata[item.field]
117
- }
118
- }
119
- if (this.selectdata[item.field] === 0) {
120
- item.value = 0
121
- }
122
-
123
- // datepicker
124
- if (item.type === 'datepicker' && !item.value && item.default) {
125
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
126
- }
127
-
128
- // 如果配置类型为select,优先从参数列表获取options
129
- if (item.type === 'select' || item.type === 'checkbox') {
130
- if (item.param) {
131
- let temp = this.$appdata.getParam(item.label)
132
-
133
- if (temp && temp.length > 0) {
134
- item.options = temp
135
- }
136
-
137
- if (item.paramLabel) {
138
- temp = this.$appdata.getParam(item.paramLabel)
139
- if (temp && temp.length > 0) {
140
- item.options = temp
141
- }
142
- }
143
- }
144
-
145
- }
146
- if (item.ready) {
147
- item.options = await this[item.ready]()
148
- }
149
-
150
- if (item.type === 'checkbox') {
151
- if (this.selectdata[item.field]) {
152
- item.value = JSON.parse(this.selectdata[item.field])
153
- } else {
154
- item.value = []
155
- }
156
- }
157
- if(this.selectdata.defname === '施工信息'||this.title === '已办信息'){
158
- item.readonly = true
159
- item.disabled = true
160
- }
161
- }
162
-
163
- // 控制组件
164
- if (this.selectdata.components) {
165
- this.selectdata.components.forEach(item => {
166
- if (!item.mark) {
167
- item.mark = 0
168
- }
169
- })
170
- }
171
- // 控制组件
172
- if(this.selectdata.defname === '施工信息') {
173
- if (this.selectdata.components) {
174
- this.selectdata.components.forEach(item => {
175
- item.mark = 1
176
- })
177
- }
178
- }
179
-
180
- // 初始化onetomany
181
- if (this.selectdata.onetomany) {
182
- for (const item of this.selectdata.onetomany) {
183
- let res = null
184
- if (item.queryEvent) {
185
- res = this[item.queryEvent]()
186
- } else {
187
- let http = new HttpResetClass()
188
- let data = {
189
- tablename: item.tables[0],
190
- condition: `f_process_id='${this.selectdata.f_process_id}'`
191
- }
192
- res = await http.load(
193
- 'POST',
194
- `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
195
- // `rs/sql/applySingleTable`,
196
- {data: data},
197
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
198
- )
199
- }
200
-
201
- item.rows = res.data
202
-
203
- // 初始化onetomany中的fields
204
- for (const field of item.fields) {
205
- if (!field.value) {
206
- if (field.value !== 0) {
207
- field.value = null
208
- }
209
- }
210
-
211
- if (field.default || field.default === 0) {
212
- field.value = field.default
213
- }
214
-
215
- // datepicker
216
- if (field.type === 'datepicker' && !field.value && field.default) {
217
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
218
- }
219
-
220
- if (field.type === 'select') {
221
-
222
- if (field.param) {
223
- let temp = this.$appdata.getParam(field.label)
224
-
225
- if (temp && temp.length > 0) {
226
- field.options = temp
227
- }
228
-
229
- if (field.paramLabel) {
230
- temp = this.$appdata.getParam(field.paramLabel)
231
- if (temp && temp.length > 0) {
232
- item.options = temp
233
- }
234
- }
235
- }
236
-
237
- }
238
- }
239
- if(this.selectdata.defname === '施工信息'){
240
- // 隐藏所有操作
241
- item.hiddenOperate = true
242
- }
243
- }
244
- }
245
-
246
- // 初始化 buttons_fields
247
- for (const item of this.selectdata.buttons) {
248
- if (item.button_name === '下发' || item.button_name === '转派') {
249
- let data = {
250
- source: item.source,
251
- userid: Vue.user.id
252
- // userid: '51953'
253
- }
254
- if (item.sourceMethod) {
255
- data.source = this[item.sourceMethod]()
256
- }
257
- if (!data.source) {
258
- this.$showMessage("请配置获取人员表达式")
259
- return
260
- }
261
- let res = await this.$resetpost(
262
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
263
- // `rs/search`,
264
- {data: data},
265
- {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
266
- )
267
-
268
- let options = res.data.map(source => {
269
- return {
270
- "label": source.name,
271
- "value": source.id
272
- }
273
- })
274
-
275
- if (item.button_fields.length !== 1) {
276
- this.$showMessage("下发有且只能有一个字段!!!")
277
- return
278
- }
279
-
280
- item.button_fields[0].options = options
281
- }
282
- if (item.button_fields) {
283
- item.button_fields.forEach(x => {
284
- // 如果配置类型为select,优先从参数列表获取options
285
- if (x.type === 'select') {
286
-
287
- if (x.param) {
288
- let temp = this.$appdata.getParam(x.label)
289
-
290
- if (temp && temp.length > 0) {
291
- x.options = temp
292
- }
293
-
294
- if (x.paramLabel) {
295
- temp = this.$appdata.getParam(x.paramLabel)
296
- if (temp && temp.length > 0) {
297
- x.options = temp
298
- }
299
- }
300
- }
301
-
302
- }
303
- })
304
- }
305
- }
306
- if(this.selectdata.defname === '施工信息'||this.title=== '已办信息'){
307
- this.selectdata.buttons = null
308
- }
309
- if (this.selectdata.f_apply_nature === '散户' && this.selectdata.defname === '现场勘察') {
310
- for (const item of this.selectdata.fields) {
311
- if (item.label.includes('安装户数')) {
312
- item.readonly = true
313
- }
314
- }
315
- }
316
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
317
- let temp = JSON.parse(JSON.stringify(this.selectdata))
318
-
319
- this.show_data = temp
320
- this.$nextTick(() => {
321
- this.showview = true
322
- })
323
- },
324
- // 金额转大写
325
- smalltoBIG(n) {
326
- let fraction = ['角', '分'];
327
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
328
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
329
- let head = n < 0 ? '欠' : '';
330
- n = Math.abs(n);
331
-
332
- let s = '';
333
-
334
- for (var i = 0; i < fraction.length; i++) {
335
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
336
- }
337
- s = s || '整';
338
- n = Math.floor(n);
339
-
340
- for (var i = 0; i < unit[0].length && n > 0; i++) {
341
- let p = '';
342
- for (var j = 0; j < unit[1].length && n > 0; j++) {
343
- p = digit[n % 10] + unit[1][j] + p;
344
- n = Math.floor(n / 10);
345
- }
346
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
347
- }
348
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
349
- },
350
- getLableValue(label) {
351
- for (const item of this.show_data.fields) {
352
- if (item.label === label && item.type !== 'number') {
353
- return item.value || ''
354
- }
355
- if (item.label === label && item.type === 'number') {
356
- return item.value || 0
357
- }
358
- }
359
- },
360
- getLableOptions(label) {
361
- for (const item of this.show_data.fields) {
362
- if (item.label === label) {
363
- return item.options
364
- }
365
- }
366
- },
367
- setLabelValue(label, value) {
368
- for (const item of this.show_data.fields) {
369
- if (item.label === label) {
370
- item.value = value
371
- this.show_data[item.field] = value
372
- }
373
- }
374
- },
375
- setLabelOptions(label, options) {
376
- for (const item of this.show_data.fields) {
377
- if (item.label === label) {
378
- item.options = options
379
- }
380
- }
381
- },
382
- showLabels(...labels) {
383
- for (const item of this.show_data.fields) {
384
- if (labels.includes(item.label)) {
385
- item.hidden = false
386
- }
387
- }
388
- },
389
- hideLabels(...labels) {
390
- for (const item of this.show_data.fields) {
391
- if (labels.includes(item.label)) {
392
- item.hidden = true
393
- }
394
- }
395
- },
396
- showButtons(...buttons) {
397
- for (const item of this.show_data.buttons) {
398
- if (buttons.includes(item.button_name)) {
399
- item.hidden = false
400
- }
401
- }
402
- },
403
- hideButtons(...buttons) {
404
- for (const item of this.show_data.buttons) {
405
- if (buttons.includes(item.button_name)) {
406
- item.hidden = true
407
- }
408
- }
409
- },
410
- requiredLabels(...labels) {
411
- for (const item of this.show_data.fields) {
412
- if (labels.includes(item.label)) {
413
- item.required = true
414
- }
415
- }
416
- },
417
- electiveLabels(...labels) {
418
- for (const item of this.show_data.fields) {
419
- if (labels.includes(item.label)) {
420
- item.required = false
421
- }
422
- }
423
- },
424
- readonlyLabels(...labels) {
425
- for (const item of this.show_data.fields) {
426
- if (labels.includes(item.label)) {
427
- item.readonly = true
428
- item.disabled = true
429
- }
430
- }
431
- },
432
- readwriteLabels(...labels) {
433
- for (const item of this.show_data.fields) {
434
- if (labels.includes(item.label)) {
435
- item.readonly = false
436
- item.disabled = false
437
- }
438
- }
439
- },
440
- disabledButtons(...buttons) {
441
- for (const item of this.show_data.buttons) {
442
- if (buttons.includes(item.button_name)) {
443
- item.disabled = true
444
- }
445
- }
446
- },
447
- enableButtons(...buttons) {
448
- for (const item of this.show_data.buttons) {
449
- if (buttons.includes(item.button_name)) {
450
- item.disabled = false
451
- }
452
- }
453
- },
454
- showComponents(...titles) {
455
- for (const item of this.show_data.components) {
456
- if (titles.includes(item.title) && item.device === 'app') {
457
- item.hidden = false
458
- }
459
- }
460
- },
461
- hideComponents(...titles) {
462
- for (const item of this.show_data.components) {
463
- if (titles.includes(item.title) && item.device === 'app') {
464
- item.hidden = true
465
- }
466
- }
467
- },
468
- async checkDuplicate(index) {
469
- let http = new HttpResetClass()
470
- let data = {
471
- tablename: 't_apply',
472
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
473
- }
474
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`, {data: data}, {
475
- resolveMsg: null,
476
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
477
- })
478
- if (res.data.length > 0) {
479
- this.show_data.fields[index].value = null
480
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
481
- }
482
- },
483
- async breakControl() {
484
- if (this.show_data.id) {
485
- let data = {
486
- condition: `u.id = ${this.show_data.id}`,
487
- data: {
488
- userid: Vue.user.id,
489
- f_filiale: "榆林."+Vue.user.orgs
490
- }
491
- }
492
- let url =`${this.$androidUtil.getProxyUrl()}/rs/sql/checkuser`
493
- if (this.show_data.f_apply_type === '管线建设'){
494
- url =`${this.$androidUtil.getProxyUrl()}/rs/sql/getGuanXianApply`
495
- }
496
- let res = await this.$resetpost(
497
- url,
498
- {data: data},
499
- {resolveMsg: null, rejectMsg: '数据更新失败,请手查询更新!!!'}
500
- )
501
-
502
- this.selectdata = res.data[0]
503
- this.selectdata.f_building=this.show_data.f_building
504
- this.selectdata.f_unit=this.show_data.f_unit
505
- this.selectdata.f_room=this.show_data.f_room
506
- this.selectdata.pageIndex=this.show_data.pageIndex
507
- } else {
508
- this.selectdata = servicedata
509
- }
510
-
511
- this.refurbish()
512
- },
513
- // ------------------------------
514
- async getConstructionWorker() {
515
- let data = {
516
- source: 'this.getParentByType($organization$).getChildByName($建设单位$).getChildren()',
517
- userid: Vue.user.id
518
- }
519
-
520
- let res = await this.$resetpost(
521
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
522
- {data: data},
523
- {resolveMsg: null, rejectMsg: '现场负责人查询失败!!!'}
524
- )
525
-
526
- return res.data.map(item => {
527
- return {
528
- label: item.name,
529
- value: item.id
530
- }
531
- })
532
- },
533
- //获取下发人
534
- getSource () {
535
- return 'this.getParentByType($organization$).getChildByName($'+ Vue.user.f_parentname + '$).getChildren()'
536
- },
537
- async getUserName() {
538
- let data = {
539
- tablename: 't_user',
540
- condition: `id='${this.selectdata.f_construction_unit_id}'`
541
- }
542
- let res = await this.$resetpost(
543
- '${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable',
544
- {data: data},
545
- {resolveMsg: null, rejectMsg: null}
546
- )
547
- return res.data.map(item => {
548
- return {
549
- label: item.name,
550
- value: item.id
551
- }
552
- })
553
- },
554
- // 安装单位签字人
555
- async getConstructionUnitId () {
556
- let data = {
557
- source: '',
558
- userid: Vue.user.id
559
- }
560
- data.source = 'this.getParentByType($organization$).getChildByName($'+ Vue.user.f_department_name + '$).getChildren()'
561
- let res = await this.$resetpost(
562
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
563
- {data: data},
564
- {resolveMsg: null, rejectMsg: '安装单位施工班组查询失败!!!'}
565
- )
566
-
567
- return res.data.map(item => {
568
- return {
569
- label: item.name,
570
- value: item.id
571
- }
572
- })
573
- },
574
- // 安装单位负责人
575
- async getConstructionUnit() {
576
- let data = {
577
- source: 'this.getParentByType($organization$).getChildByName($工程施工队$).getChildren()',
578
- userid: Vue.user.id
579
- }
580
-
581
- let res = await this.$resetpost(
582
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
583
- {data: data},
584
- {resolveMsg: null, rejectMsg: '安装单位人员查询失败!!!'}
585
- )
586
-
587
- return res.data.map(item => {
588
- return {
589
- label: item.name,
590
- value: item.id
591
- }
592
- })
593
- },
594
- // 建设单位
595
- async getConstructOperator() {
596
- let data = {
597
- source: 'this.getParentByType($organization$).getChildByName($建设单位$).getChildren()',
598
- userid: Vue.user.id
599
- }
600
-
601
- let res = await this.$resetpost(
602
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
603
- {data: data},
604
- {resolveMsg: null, rejectMsg: '建设单位人员查询失败!!!'}
605
- )
606
-
607
- return res.data.map(item => {
608
- return {
609
- label: item.name,
610
- value: item.id
611
- }
612
- })
613
- },
614
- // 监理单位
615
- async getSupervisorOperator() {
616
- let data = {
617
- source: 'this.getParentByType($organization$).getChildByName($监理单位$).getChildren()',
618
- userid: Vue.user.id
619
- }
620
-
621
- let res = await this.$resetpost(
622
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
623
- {data: data},
624
- {resolveMsg: null, rejectMsg: '监理单位人员查询失败!!!'}
625
- )
626
- for (const item of this.selectdata.fields) {
627
- if (item.label === '监理单位') {
628
- item.value = res.data[0].id
629
- this.selectdata[item.field] = res.data[0].id
630
- }
631
- }
632
- return res.data.map(item => {
633
- return {
634
- label: item.name,
635
- value: item.id
636
- }
637
- })
638
- },
639
- // 监理现场负责人
640
- async getSupervisorOperatorId () {
641
- let data = {
642
- source: 'this.getParentByType($organization$).getChildByName($监理班组$).getChildren()',
643
- userid: Vue.user.id
644
- }
645
- let res = await this.$resetpost(
646
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
647
- {data: data},
648
- {resolveMsg: null, rejectMsg: '监理单位人员查询失败!!!'}
649
- )
650
- return res.data.map(item => {
651
- return {
652
- label: item.name,
653
- value: item.id
654
- }
655
- })
656
- },
657
- // 土建单位
658
- async getEngineeringOperator() {
659
- let data = {
660
- source: 'this.getParentByType($organization$).getChildByName($土建单位$).getChildren()',
661
- userid: Vue.user.id
662
- }
663
-
664
- let res = await this.$resetpost(
665
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
666
- {data: data},
667
- {resolveMsg: null, rejectMsg: '土建单位人员查询失败!!!'}
668
- )
669
-
670
- let result = res.data.map(item => {
671
- return {
672
- label: item.name,
673
- value: item.id
674
- }
675
- })
676
- result.push({label: '用户自理', value: '用户自理'})
677
- result.push({label:'无',value:'无'})
678
- return result
679
- },
680
- // 检测单位
681
- async getCheckOperator() {
682
- let data = {
683
- source: 'this.getParentByType($organization$).getChildByName($检测单位$).getChildren()',
684
- userid: Vue.user.id
685
- }
686
-
687
- let res = await this.$resetpost(
688
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
689
- {data: data},
690
- {resolveMsg: null, rejectMsg: '检测单位人员查询失败!!!'}
691
- )
692
-
693
- let result = res.data.map(item => {
694
- return {
695
- label: item.name,
696
- value: item.id
697
- }
698
- })
699
- result.push({label:'无',value:'无'})
700
- return result
701
- },
702
- // 获取气表品牌
703
- async getMeterBrand() {
704
- let data = {}
705
-
706
- let http = new HttpResetClass()
707
- let res = await http.load(
708
- 'POST',
709
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getMeterBrand`,
710
- {data: data},
711
- {resolveMsg: null, rejectMsg: '气表品牌查询失败!!!'}
712
- )
713
-
714
- return res.data
715
- },
716
- // 获取小区
717
- async getResidentialArea() {
718
- let data = {
719
- tablename: 't_area_address',
720
- condition: `f_filiale like '%${"榆林."+Vue.user.orgs}%' and f_area_status = '启用'`
721
- }
722
- let http = new HttpResetClass()
723
- let res = await http.load(
724
- 'POST',
725
- `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
726
- {data: data},
727
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
728
- )
729
- return res.data.map(item => {
730
- return {
731
- label: item.f_residential_area,
732
- value: item.id
733
- }
734
- })
735
- },
736
- //现场勘察
737
- async prospectingBefore() {
738
- let data = {
739
- tablename: 't_files',
740
- condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '现场勘察' and fremarks = '报装手机签字文件'`
741
- }
742
- let http = new HttpResetClass()
743
- let res = await http.load(
744
- 'POST',
745
- `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
746
- {data: data},
747
- {resolveMsg: null, rejectMsg: null}
748
- )
749
- if (res.data.length <= 0) {
750
- this.$showAlert('现场勘察未签字,无法提交!!!', 'warning', 3000)
751
- throw '现场勘察未签字,无法提交!'
752
- }
753
- },
754
- // 施工前置
755
- async constructionBefore() {
756
- await this.userSignBefore()
757
- if (this.show_data.f_apply_nature !== '分户挂表') {
758
- let http = new HttpResetClass()
759
- let data = {
760
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and f_meternumber is null and f_gasbrand_id is not null `
761
- }
762
- let res = await http.load(
763
- 'POST',
764
- `${this.$androidUtil.getProxyUrl()}/rs/sql/countApplyUserinfo`,
765
- {data: data},
766
- {
767
- resolveMsg: null,
768
- rejectMsg: '安装明细查询失败!!!'
769
- })
770
- if (res.data[0].num > 0) {
771
- this.$showAlert(`还有${res.data[0].num}户未表号未录入,无法提交`, 'warning', 3000)
772
- throw `还有${res.data[0].num}户未表号未录入,无法提交`
773
- }
774
- }
775
- },
776
- async userSignBefore() {
777
- let http = new HttpResetClass()
778
- let data = {
779
- tablename: 't_files',
780
- condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '${this.selectdata.defname}' and fremarks = '报装手机签字文件'`
781
- }
782
- let res = await http.load(
783
- 'POST',
784
- `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
785
- {data: data},
786
- {resolveMsg: null, rejectMsg: null}
787
- )
788
- if (res.data.length <= 0) {
789
- this.$showAlert('用户未签字,无法生成签字流程!!!', 'warning', 3000)
790
- throw '用户未签字,无法生成签字流程!'
791
- }
792
- },
793
- signBefore() {
794
- if (this.show_data.defname === '检测单位签字') {
795
- if (isEmpty(this.show_data.f_check_sign)) {
796
- this.$showAlert(`签字后才可提交!!!`, 'warning', 3000)
797
- throw `签字后才可提交!!!`
798
- }
799
- this.show_data.f_check_operator = Vue.user.name
800
- this.show_data.f_check_date = new Date().Format('yyyy-MM-dd HH:mm:ss')
801
- this.show_data.employeetemplate = this.show_data.f_build_operator_id
802
- }
803
- if (this.show_data.defname === '安装单位签字') {
804
- if (isEmpty(this.show_data.f_build_sign)) {
805
- this.$showAlert(`签字后才可提交!!!`, 'warning', 3000)
806
- throw `签字后才可提交!!!`
807
- }
808
- this.show_data.f_build_operator = Vue.user.name
809
- this.show_data.f_build_date = new Date().Format('yyyy-MM-dd HH:mm:ss')
810
- this.show_data.employeetemplate = this.show_data.f_engineering_operator_id
811
- if (this.show_data.f_engineering_operator_id === '用户自理' || this.show_data.f_engineering_operator_id === '无') {
812
- this.show_data.f_engineering_operator = this.show_data.f_engineering_operator_id
813
- this.show_data.f_engineering_date = new Date().Format('yyyy-MM-dd HH:mm:ss')
814
- this.show_data.employeetemplate = this.show_data.f_supervisor_operator_id
815
- }
816
- }
817
- if (this.show_data.defname === '土建单位签字') {
818
- if (isEmpty(this.show_data.f_engineering_sign)) {
819
- this.$showAlert(`签字后才可提交!!!`, 'warning', 3000)
820
- throw `签字后才可提交!!!`
821
- }
822
- this.show_data.f_engineering_operator = Vue.user.name
823
- this.show_data.f_engineering_date = new Date().Format('yyyy-MM-dd HH:mm:ss')
824
- this.show_data.employeetemplate = this.show_data.f_supervisor_operator_id
825
- }
826
- if (this.show_data.defname === '监理单位签字') {
827
- if (isEmpty(this.show_data.f_supervisor_sign)) {
828
- this.$showAlert(`签字后才可提交!!!`, 'warning', 3000)
829
- throw `签字后才可提交!!!`
830
- }
831
- this.show_data.f_supervisor_operator = Vue.user.name
832
- this.show_data.f_supervisor_date = new Date().Format('yyyy-MM-dd HH:mm:ss')
833
- this.show_data.employeetemplate = this.show_data.f_construct_operator_id
834
- }
835
- if (this.show_data.defname === '建设单位签字') {
836
- if (isEmpty(this.show_data.f_construct_sign)) {
837
- this.$showAlert(`签字后才可提交!!!`, 'warning', 3000)
838
- throw `签字后才可提交!!!`
839
- }
840
- this.show_data.f_construct_operator = Vue.user.name
841
- this.show_data.f_construct_date = new Date().Format('yyyy-MM-dd HH:mm:ss')
842
- }
843
- },
844
- //分户挂表生成安检单
845
- async getChecklist() {
846
- let http = new HttpResetClass()
847
- let data = {
848
- f_process_id: this.selectdata.f_process_id,
849
- f_userinfo_id: this.selectdata.f_userinfo_id,
850
- user: Vue.user
851
- }
852
- let res = await http.load(
853
- 'POST',
854
- `${this.$androidUtil.getProxyUrl()}/rs/logic/getChecklist`,
855
- {data: data},
856
- {resolveMsg: null, rejectMsg: null}
857
- )
858
- },
859
- //工商户验证表具类型是否需选择
860
- async meterBrandCheck() {
861
- let data = {
862
- f_process_id: this.selectdata.f_process_id,
863
- orgid:Vue.user.orgid
864
- }
865
- let http = new HttpResetClass()
866
- let res = await http.load(
867
- 'POST',
868
- `${this.$androidUtil.getProxyUrl()}/rs/sql/meterCheck`,
869
- {data: data},
870
- {resolveMsg: null, rejectMsg: null}
871
- )
872
- if (res.data[0].num > 0){
873
- this.$showAlert(`还有${res.data[0].num}处未选择表具,请选择后提交!`, 'warning', 3000)
874
- throw null
875
- }
876
- },
877
- // 安装户数
878
- async installCountCheck() {
879
- let data = {
880
- tablename: 't_userinfo',
881
- condition: `f_process_id = '${this.show_data.f_process_id}' and f_user_state != '销户'`,
882
- }
883
-
884
- let http = new HttpResetClass()
885
- let res = await http.load(
886
- 'POST',
887
- `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
888
- {data: data},
889
- {resolveMsg: null, rejectMsg: '用户数量查询失败'}
890
- )
891
- this.setLabelValue('安装户数',res.data.length)
892
- },
893
- async stopApply () {
894
- console.log('终止报建!!!!!')
895
-
896
- if (this.show_data.defname === '报建受理') {
897
- this.show_data.f_stop_reason = this.show_data.f_accept_result
898
- }
899
- if (this.show_data.defname === '现场勘察') {
900
- this.show_data.f_stop_reason = this.show_data.f_prospecting_result
901
- }
902
-
903
- let data = {
904
- apply: this.show_data,
905
- user: Vue.user
906
- }
907
-
908
- let res = await this.$resetpost(
909
- `${this.$androidUtil.getProxyUrl()}/rs/logic/stopApply`,
910
- {data: data},
911
- {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
912
- )
913
-
914
- this.$dispatch('confirm')
915
-
916
- throw '终止报建!!!'
917
- },
918
- // 户内出单日期
919
- getOutdoorsTime () {
920
- for (const item of this.selectdata.fields) {
921
- console.log('是否进入')
922
- if (item.label === '户内出单日期') {
923
- item.value = this.selectdata.f_release_date
924
- this.selectdata[item.field] = item.value
925
- console.log('当前出单时间',item.value)
926
- }else if(item.label === '庭院出单日期'){
927
- item.value = this.selectdata.f_release_date
928
- this.selectdata[item.field] = item.value
929
- }
930
- }
931
- },
932
- getGaiXianType () {
933
- return [{label: "隐患整改", value: "隐患整改"},
934
- {label: "改造工程", value: "改造工程"},
935
- {label: "改线工程", value: "改线工程"},
936
- {label: "老旧小区", value: "老旧小区"}]
937
- },
938
- //获取缴费日期
939
- async getChargeDate() {
940
- let data = {
941
- tablename: 'activityins',
942
- condition: `processid = '${this.selectdata.f_process_id}' and defname = '报装缴费'`,
943
- }
944
-
945
- let http = new HttpResetClass()
946
- let res = await http.load(
947
- 'POST',
948
- `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
949
- {data: data},
950
- {resolveMsg: null, rejectMsg: null}
951
- )
952
- for (const item of this.selectdata.fields) {
953
- if (item.label === '缴费日期') {
954
- item.value = res.data[0].finishtime
955
- this.selectdata[item.field] = item.value
956
- }
957
- }
958
- },
959
- async getSingAct() {
960
- let data = {
961
- f_process_id: this.selectdata.f_process_id
962
- }
963
- let http = new HttpResetClass()
964
- let res = await http.load(
965
- 'POST',
966
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getSingAct`,
967
- {data: data},
968
- {resolveMsg: null, rejectMsg: '签字状态查询失败!!!'}
969
- )
970
- if (res.data.length > 0) {
971
- for (const item of this.selectdata.fields) {
972
- if (item.label === '签字所在环节') {
973
- item.value = res.data[0].defname
974
- this.selectdata[item.field] = item.value
975
- }
976
- }
977
- }
978
- },
979
- getYiFang() {
980
- return [{label: '榆林榆川天然气', value: '榆林榆川天然气'},
981
- {label: this.selectdata.f_user_name, value: this.selectdata.f_user_name},
982
- {label: '无', value: '无'}]
983
- },
984
- async repair() {
985
- let data = {
986
- f_process_id: this.show_data.f_process_id
987
- }
988
- let http = new HttpResetClass()
989
- let res = await http.load(
990
- 'POST',
991
- `${this.$androidUtil.getProxyUrl()}/rs/logic/updateRepair`,
992
- {data: data},
993
- {resolveMsg: null, rejectMsg: '维修工单状态修改!!!'}
994
- )
995
- this.$dispatch('loadPage')
996
- throw ''
997
- },
998
- changeDispatch(value){
999
- if (value === '维修安检中心'){
1000
- this.hideLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位', '户内出单日期', '户内回单日期'
1001
- , '户内施工备注', '庭院出单日期', '庭院回单日期', '庭院施工备注', '是否发起签字', '签字是否完成', '签字所在环节')
1002
- this.hideButtons('签字')
1003
- this.electiveLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位', '户内出单日期', '户内回单日期'
1004
- , '户内施工备注', '庭院出单日期', '庭院回单日期', '庭院施工备注', '是否发起签字', '签字是否完成', '签字所在环节')
1005
- }
1006
- if (value === '施工工队'){
1007
- this.showLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位', '户内出单日期', '户内回单日期'
1008
- , '户内施工备注', '庭院出单日期', '庭院回单日期', '庭院施工备注', '是否发起签字', '签字是否完成', '签字所在环节')
1009
- this.requiredLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位', '现场项目负责人', '是否发起签字', '签字是否完成', '签字所在环节')
1010
- }
1011
- },
1012
- geIsOpen(){
1013
- this.isOpen = false
1014
- }
1015
- },
1016
- events: {
1017
- // 强制开关阀
1018
- async 'onOffValve'() {
1019
- let data = {
1020
- condition: `ui.f_userinfo_id = '${this.show_data.f_userinfo_id}'`
1021
- }
1022
- let http = new HttpResetClass()
1023
- let res = await http.load(
1024
- 'POST',
1025
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyUserinfo`,
1026
- {data: data},
1027
- {resolveMsg: null, rejectMsg: '档案获取失败!!!'}
1028
- )
1029
-
1030
- let userinfo = res.data[0]
1031
-
1032
- data = {
1033
- condition: `t_userfiles.f_meternumber = '${userinfo.f_meternumber}'`,
1034
- contentData: {
1035
- isOpen: this.show_data.button.button_name === '强制开阀' ? 1 : 0
1036
- },
1037
- inputtor: Vue.user.name,
1038
- instructTitle: this.show_data.button.button_name === '强制开阀' ? '开阀' : '关阀',
1039
- instructType: '阀门控制',
1040
- meterBrandName: userinfo.f_alias
1041
- }
1042
- res = await http.load(
1043
- 'POST',
1044
- `${this.$androidUtil.getProxyUrl()}/rs/logic/saveInstruct`,
1045
- {data: data},
1046
- {resolveMsg: null, rejectMsg: `${this.show_data.button.button_name}失败!!!`}
1047
- )
1048
-
1049
- data = {
1050
- f_user_id: userinfo.f_user_id,
1051
- f_userinfo_id: userinfo.f_userinfo_id,
1052
- record: {
1053
- f_filiale: "榆林."+Vue.user.orgs,
1054
- f_instruct_meta_data: this.show_data.button.button_name === '退出强制状态' ? '退出强制阀控' : '进入强制阀控',
1055
- f_instruct_title: this.show_data.button.button_name === '退出强制状态' ? '退出强制阀控' : '进入强制阀控',
1056
- f_instruct_type: '阀门控制',
1057
- f_meternumber: userinfo.f_meternumber,
1058
- f_operator: Vue.user.name,
1059
- f_outlets: userinfo.f_outlets,
1060
- f_reason: this.show_data.button.f_reason,
1061
- f_user_id: userinfo.f_user_id,
1062
- f_userinfo_id: userinfo.f_userinfo_id
1063
- },
1064
- state: this.show_data.button.button_name === '退出强制状态' ? 0 : 1,
1065
- }
1066
-
1067
- res = await http.load(
1068
- 'POST',
1069
- `${this.$androidUtil.getProxyUrl()}/rs/logic/updateNetWorkValve`,
1070
- {data: data},
1071
- {resolveMsg: '执行成功!!!', rejectMsg: `执行失败!!!`}
1072
- )
1073
-
1074
- },
1075
- // 修改用户档案
1076
- async 'updateUserinfoState'() {
1077
- let data = {
1078
- f_userinfo_id: this.show_data.f_userinfo_id
1079
- }
1080
- let http = new HttpResetClass()
1081
- let res = await http.load(
1082
- 'POST',
1083
- `${this.$androidUtil.getProxyUrl()}/rs/logic/updateUserinfoState`,
1084
- {data: data},
1085
- {resolveMsg: '该用户档案已为正常档案,可进行开关阀操作!!!', rejectMsg: '档案状态修改失败!!!'}
1086
- )
1087
-
1088
- this.showButtons('退出强制状态', '强制关阀')
1089
- this.hideButtons('转正式档案')
1090
- },
1091
- //开始签字流程
1092
- async 'startSignActivity'() {
1093
- this.hideButtons('签字')
1094
-
1095
- if(this.show_data.f_apply_type !== '管线建设'){
1096
- await this.constructionBefore()
1097
- }
1098
- let data = {
1099
- apply: this.show_data,
1100
- user: Vue.user
1101
- }
1102
-
1103
- let res = await this.$resetpost(
1104
- `${this.$androidUtil.getProxyUrl()}/rs/logic/startSignActivity`,
1105
- {data: data},
1106
- {resolveMsg: '签字流程已发起!!!', rejectMsg: '签字发起失败!!!'}
1107
- )
1108
-
1109
- this.breakControl()
1110
- },
1111
- // 工程施工初始化
1112
- async 'buildReadyEvent'() {
1113
- if (this.getLableValue('是否发起签字') === '是') {
1114
- this.hideButtons('签字')
1115
- }
1116
- let http = new HttpResetClass()
1117
- console.log("当前流程",this.show_data.f_apply_type)
1118
- if (isEmpty(this.show_data.f_meter_brand)) {
1119
- return
1120
- }else {
1121
- if (this.show_data.f_meter_brand === 'null') {
1122
- this.setLabelOptions('气表型号', [{label: '无', value: 'null'}])
1123
- return
1124
- }
1125
- let data = {
1126
- f_gasbrand_id: this.show_data.f_meter_brand
1127
- }
1128
- let res = await http.load(
1129
- 'POST',
1130
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
1131
- {data: data},
1132
- {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
1133
- )
1134
- this.setLabelOptions('气表型号', res.data)
1135
- }
1136
- if (this.show_data.f_apply_type === '分户挂表') {
1137
- let data = {
1138
- condition: `ui.f_userinfo_id = '${this.show_data.f_userinfo_id}'`
1139
- }
1140
- let http = new HttpResetClass()
1141
- let res = await http.load(
1142
- 'POST',
1143
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyUserinfo`,
1144
- {data: data},
1145
- {resolveMsg: null, rejectMsg: '档案状态获取失败!!!'}
1146
- )
1147
- setTimeout(() => {
1148
- if (res.data[0].f_meter_classify === '物联网表') {
1149
- if (res.data[0].f_user_state === '正常') {
1150
- this.showButtons('退出强制状态', '强制关阀')
1151
- this.hideButtons('转正式档案')
1152
- } else {
1153
- this.showButtons('转正式档案')
1154
- this.hideButtons('退出强制状态', '强制关阀')
1155
- }
1156
- }
1157
- }, 1000)
1158
- }
1159
- },
1160
- // 气表品牌失去焦点
1161
- async 'meterBrandChenge' (index) {
1162
- if (isEmpty(this.show_data.f_meter_brand)) {
1163
- return
1164
- }
1165
- this.setLabelValue('气表型号', null)
1166
- let data = {
1167
- f_gasbrand_id: this.show_data.f_meter_brand
1168
- }
1169
- let http = new HttpResetClass()
1170
- let res = await http.load(
1171
- 'POST',
1172
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
1173
- {data: data},
1174
- {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
1175
- )
1176
-
1177
- this.setLabelOptions('气表型号', res.data)
1178
- },
1179
- // 安装户数失去焦点
1180
- 'installCountChange'(index) {
1181
- if (isEmpty(this.show_data.f_install_count)) {
1182
- return
1183
- }
1184
- if (Number(this.show_data.f_install_count) > Number(this.show_data.f_apply_count)) {
1185
- this.$showAlert('安装数已超过申请数!!!', 'warning', 3000)
1186
- // this.setLabelValue('安装户数', null)
1187
- // this.setLabelValue('安装点数', null)
1188
- // return
1189
- }
1190
-
1191
- if (Number(this.show_data.f_install_count) <= 0) {
1192
- this.$showAlert('至少有一个用户!!!', 'warning', 3000)
1193
- this.setLabelValue('安装户数', null)
1194
- this.setLabelValue('安装点数', null)
1195
- return
1196
- }
1197
- },
1198
- 'complyInstallation'(index) {
1199
- if (this.show_data.defname === '报建受理'){
1200
- if (this.show_data.f_accept_install === '否') {
1201
- console.log("测试")
1202
- this.hideButtons('下发','提交')
1203
- this.showButtons('终止')
1204
- } else {
1205
- this.hideButtons('终止')
1206
- this.showButtons('下发','提交')
1207
- }
1208
- }
1209
- if (this.show_data.defname === '现场勘察'){
1210
- if (this.show_data.f_survey_opinion === '否') {
1211
- console.log("测试")
1212
- this.hideButtons('下发','提交')
1213
- this.showButtons('终止')
1214
- } else {
1215
- this.hideButtons('终止')
1216
- this.showButtons('下发','提交')
1217
- }
1218
- }
1219
- if (this.show_data.defname === '报建受理' || this.show_data.defname === '现场勘察'){
1220
- this.installCountCheck()
1221
- }
1222
- },
1223
- //搜索小区
1224
- 'selectArea' (val,index) {
1225
- let pcdText = `and f_residential_area like '%${val}%'`
1226
- let data = {
1227
- tablename: 't_area_address',
1228
- condition: `f_filiale like '%${"榆林."+Vue.user.orgs}%' and f_area_status = '启用' ${pcdText}`
1229
- }
1230
- new HttpResetClass().load("POST", `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`, {data:data}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
1231
- console.log('请求发送完成!!!!!'+JSON.stringify(res))
1232
- if(res.data.length>0){
1233
- this.setLabelOptions('小区/巷道', res.data.map(item => {
1234
- return {
1235
- label: item.f_residential_area,
1236
- value: item.id
1237
- }
1238
- }))
1239
- }
1240
- })
1241
- },
1242
- 'changeDispatching'(index){
1243
- if (this.show_data.fields[index].value === '安检维修中心'){
1244
- this.hideLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位')
1245
- this.electiveLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位')
1246
- }else if (this.show_data.fields[index].value === '施工工队'){
1247
- this.showLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位')
1248
- this.requiredLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位')
1249
- }
1250
- },
1251
- 'getRefund'(index){
1252
- if (this.show_data.fields[index].value === '否'){
1253
- this.hideLabels('退费金额', '退款项')
1254
- this.electiveLabels('退费金额', '退款项')
1255
- }else if (this.show_data.fields[index].value === '是'){
1256
- this.showLabels('退费金额', '退款项')
1257
- this.requiredLabels('退费金额', '退款项')
1258
- }
1259
- },
1260
- 'hasTrouble'(index) {
1261
- if (this.show_data.fields[index].value === '有纠纷'){
1262
- this.hideButtons('提交', '签字', '图纸变更')
1263
- this.showLabels('纠纷原因')
1264
- }else {
1265
- this.showButtons('提交', '签字', '图纸变更')
1266
- this.hideLabels('纠纷原因')
1267
- }
1268
- },
1269
- // ===========================================
1270
- 'initializtionView'() {
1271
- if (this.show_data.f_apply_type === '民用报建' && this.show_data.f_apply_nature === '散户') {
1272
- this.hideLabels('营业执照', '小区/巷道')
1273
- this.electiveLabels('营业执照', '购货单位识别号', '购货单位银行账号', '购货单位地址电话', '小区/巷道')
1274
- }
1275
- if (this.show_data.f_apply_type === '民用报建' && this.show_data.f_apply_nature === '小区') {
1276
- this.showLabels('营业执照', '小区/巷道', '小区名称')
1277
- this.requiredLabels( '小区/巷道')
1278
- this.hideComponents('用户花名单')
1279
- }
1280
- },
1281
- 'breakControl'() {
1282
- this.breakControl()
1283
- },
1284
- // 检查重复
1285
- 'checkRepeat'(index) {
1286
- this.checkDuplicate(index)
1287
- },
1288
- async 'button'() {
1289
- if (this.show_data.button.before) {
1290
- //判断当前环节
1291
- if(this.show_data.defname=='现场勘察'||this.show_data.defname=='工程派工' ||this.show_data.defname=='工程施工'||this.show_data.defname=='点火通气' ||this.show_data.defname=='监理单位派工' ||this.show_data.defname=='工程队派工' ||this.show_data.defname=='检测单位签字' ||this.show_data.defname=='土建单位签字' ||this.show_data.defname=='监理单位签字' ||this.show_data.defname=='建设单位签字'){
1292
- if(this.show_data.button.button_name=='提交' || this.show_data.button.button_name=='保存' || this.show_data.button.button_name=='退回' || this.show_data.button.button_name=='终止' ){
1293
- let res = await this.$showMessage('是否需要继续此次操作')
1294
- if (res === 'cancel') {
1295
- return
1296
- }else{
1297
- await this[this.show_data.button.before]()
1298
- }
1299
- }
1300
- }
1301
- }else{
1302
- //判断当前环节
1303
- if(this.show_data.defname=='现场勘察'||this.show_data.defname=='工程派工' ||this.show_data.defname=='工程施工'||this.show_data.defname=='点火通气' ||this.show_data.defname=='监理单位派工' ||this.show_data.defname=='工程队派工'){
1304
- if(this.show_data.button.button_name=='提交' || this.show_data.button.button_name=='保存' || this.show_data.button.button_name=='退回'){
1305
- let res = await this.$showMessage('是否需要继续此次操作')
1306
- if (res === 'cancel') {
1307
- return
1308
- }
1309
- }
1310
- }
1311
-
1312
- }
1313
- // 点击重置按钮就重置数据
1314
- if (this.show_data.button.button_name === '重置') {
1315
- this.$dispatch('breakControl', this.selectdata)
1316
- return
1317
- }
1318
-
1319
- this.show_data.start_activity = this.json_datas.start_activity
1320
- this.show_data.xmlfilename = this.json_datas.workflow_xmlfilename
1321
-
1322
- let data = {
1323
- apply: this.show_data,
1324
- user: Vue.user
1325
- }
1326
- console.log("当前提交数据",this.show_data)
1327
- let res = await this.$resetpost(
1328
- `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyProductService`,
1329
- {data: data},
1330
- {resolveMsg: null, rejectMsg: '数据保存失败'}
1331
- )
1332
-
1333
- if (this.show_data.button.after) {
1334
- this[this.show_data.button.after]()
1335
- }
1336
- // 返回上层
1337
- this.$dispatch('confirm')
1338
- },
1339
- 'locationclick' (res) {
1340
- console.log('/*/*/*/*/*/*/*/*/*/*/*/*/*/**/*/*/*/*')
1341
- if (res.pname){
1342
- this.setLabelValue('定位地址', res.pname + res.cityname + res.adname + res.address + res.name)
1343
- }else {
1344
- this.setLabelValue('定位地址', res.province + res.city + res.address + res.name)
1345
- }
1346
- this.show_data.f_lng = res.location.lng
1347
- this.show_data.f_lat = res.location.lat
1348
- this.isOpen = !this.isOpen
1349
- },
1350
- selectSearch (val, index) {},
1351
- // 失去焦点出触发事件
1352
- 'onchange'(index) {
1353
- },
1354
- 'onblur'(index) {
1355
- },
1356
- 'oninput'(index) {
1357
- },
1358
- async 'onchangeModal'(index, fieldIndex) {
1359
- },
1360
- async 'onblurModal'(index, fieldIndex) {
1361
-
1362
- },
1363
- async 'oninputModal'(index, fieldIndex) {
1364
-
1365
- },
1366
- async 'onetomanydelete'(index, rowIndex) {
1367
-
1368
- let http = new HttpResetClass()
1369
-
1370
- let res = await http.load(
1371
- 'DELETE',
1372
- `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1373
- null,
1374
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
1375
- )
1376
- res = await this.$resetpost(
1377
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1378
- this.show_data
1379
- )
1380
- this.breakControl()
1381
- },
1382
- async 'onetomanyupdate'(index, rowIndex) {
1383
- let data = this.show_data.onetomany[index].rows[rowIndex]
1384
-
1385
- this.show_data.onetomany[index].fields.forEach(item => {
1386
- data[item.field] = item.value
1387
- })
1388
- let res = await this.$resetpost(
1389
- `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1390
- data
1391
- )
1392
- res = await this.$resetpost(
1393
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1394
- this.show_data
1395
- )
1396
- this.breakControl()
1397
- },
1398
- async 'onetomanyadd'(index) {
1399
- let data = {
1400
- f_process_id: this.show_data.f_process_id,
1401
- f_operator_id: Vue.user.id,
1402
- f_operator: Vue.user.name,
1403
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1404
- f_orgid: Vue.user.orgid,
1405
- f_orgname: "榆林."+Vue.user.orgs
1406
- }
1407
- this.show_data.onetomany[index].fields.forEach(item => {
1408
- data[item.field] = item.value
1409
- })
1410
- let res = await this.$resetpost(
1411
- `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1412
- data
1413
- )
1414
- res = await this.$resetpost(
1415
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1416
- this.show_data
1417
- )
1418
- this.breakControl()
1419
- },
1420
- 'onbutchange'(index) {
1421
-
1422
- },
1423
- 'onbutblur'(index) {
1424
-
1425
- },
1426
- 'onbutinput'(index) {
1427
-
1428
- }
1429
- },
1430
- watch: {}
1431
- }
1432
- </script>
1433
- <style scoped>
1434
- </style>
1
+ <template>
2
+ <div class="col-sm-12 col-xs-12 p-10">
3
+ <accordion one-at-a-time="true">
4
+ <panel :header="selectdata.defname" :is-open="isOpen" type="primary">
5
+ <app-service-view v-ref:serviceview :data="show_data" v-if="showview"></app-service-view>
6
+ </panel>
7
+ <panel header='地图' :is-open="!isOpen" type="primary" v-if="selectdata.defname ==='现场勘察'">
8
+ <div style="height: 85vh">
9
+ <apply-map-com :selectdata="selectdata"></apply-map-com>
10
+ </div>
11
+ </panel>
12
+ </accordion>
13
+ </div>
14
+ </template>
15
+ <script>
16
+ import Vue from 'vue'
17
+ import {HttpResetClass} from 'vue-client'
18
+ import {isEmpty} from '../../Util'
19
+ // Date格式化
20
+ Date.prototype.Format = function (fmt) {
21
+ var o = {
22
+ 'M+': this.getMonth() + 1, // 月份
23
+ 'd+': this.getDate(), // 日
24
+ 'H+': this.getHours(), // 小时
25
+ 'm+': this.getMinutes(), // 分
26
+ 's+': this.getSeconds(), // 秒
27
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
28
+ 'S': this.getMilliseconds() // 毫秒
29
+ }
30
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
31
+ for (var k in o) {
32
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
33
+ }
34
+ return fmt
35
+ }
36
+ export default {
37
+ title: '报建流程业务控制层',
38
+ props: ['selectdata', 'title'],
39
+ data() {
40
+ return {
41
+ json_datas: null,
42
+ data: null,
43
+ show_data: null,
44
+ showview: false,
45
+ config: {},
46
+ isOpen: true
47
+ }
48
+ },
49
+ ready() {
50
+ this.refurbish()
51
+ },
52
+ methods: {
53
+ async refurbish() {
54
+ this.showview = false
55
+ let title=this.title
56
+ let http = new HttpResetClass()
57
+ let data = {
58
+ workname: this.selectdata.processname
59
+ }
60
+ await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyGetConfigs`, {
61
+ data
62
+ }, {resolveMsg: null, rejectMsg: null}).then((res) => {
63
+ this.json_datas = res.data
64
+ })
65
+ let sum = 0
66
+ let jsonData = {}
67
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
68
+ this.$showMessage("网络故障,请刷新页面")
69
+ return
70
+ }
71
+ this.json_datas.activitys.forEach(item => {
72
+ if (this.selectdata.defname === '施工信息') {
73
+ if (item.title === '工程施工') {
74
+ jsonData = item // 拿到当前节点的json配置信息
75
+ sum++ // 节点名一样的个数
76
+ }
77
+ }else if (this.selectdata.defname === item.title) {
78
+ jsonData = item // 拿到当前节点的json配置信息
79
+ sum++ // 节点名一样的个数
80
+ }
81
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
82
+ })
83
+
84
+ if (sum === 0) {
85
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
86
+ return
87
+ }
88
+ if (sum > 1) {
89
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
90
+ return
91
+ }
92
+
93
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
94
+
95
+ // fields 字段填充值
96
+ for (const item of this.selectdata.fields) {
97
+ if (!item.value) {
98
+ item.value = null
99
+ }
100
+
101
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
102
+ if (item.eval) {
103
+ let user = Vue.user
104
+ // 将PC用户信息 替换成 APP的
105
+ item.value = eval(item.default.replace('this.$login.f', 'user'))
106
+ } else {
107
+ item.value = item.default
108
+ }
109
+ }
110
+
111
+ if (this.selectdata[item.field]) {
112
+ // 将json字符串格式化赋值给value
113
+ if (String(this.selectdata[item.field]).startsWith("{")) {
114
+ item.value = JSON.parse(this.selectdata[item.field])
115
+ } else {
116
+ item.value = this.selectdata[item.field]
117
+ }
118
+ }
119
+ if (this.selectdata[item.field] === 0) {
120
+ item.value = 0
121
+ }
122
+
123
+ // datepicker
124
+ if (item.type === 'datepicker' && !item.value && item.default) {
125
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
126
+ }
127
+
128
+ // 如果配置类型为select,优先从参数列表获取options
129
+ if (item.type === 'select' || item.type === 'checkbox') {
130
+ if (item.param) {
131
+ let temp = this.$appdata.getParam(item.label)
132
+
133
+ if (temp && temp.length > 0) {
134
+ item.options = temp
135
+ }
136
+
137
+ if (item.paramLabel) {
138
+ temp = this.$appdata.getParam(item.paramLabel)
139
+ if (temp && temp.length > 0) {
140
+ item.options = temp
141
+ }
142
+ }
143
+ }
144
+
145
+ }
146
+ if (item.ready) {
147
+ item.options = await this[item.ready]()
148
+ }
149
+
150
+ if (item.type === 'checkbox') {
151
+ if (this.selectdata[item.field]) {
152
+ item.value = JSON.parse(this.selectdata[item.field])
153
+ } else {
154
+ item.value = []
155
+ }
156
+ }
157
+ if(this.selectdata.defname === '施工信息'||this.title === '已办信息'){
158
+ item.readonly = true
159
+ item.disabled = true
160
+ }
161
+ }
162
+
163
+ // 控制组件
164
+ if (this.selectdata.components) {
165
+ this.selectdata.components.forEach(item => {
166
+ if (!item.mark) {
167
+ item.mark = 0
168
+ }
169
+ })
170
+ }
171
+ // 控制组件
172
+ if(this.selectdata.defname === '施工信息') {
173
+ if (this.selectdata.components) {
174
+ this.selectdata.components.forEach(item => {
175
+ item.mark = 1
176
+ })
177
+ }
178
+ }
179
+
180
+ // 初始化onetomany
181
+ if (this.selectdata.onetomany) {
182
+ for (const item of this.selectdata.onetomany) {
183
+ let res = null
184
+ if (item.queryEvent) {
185
+ res = this[item.queryEvent]()
186
+ } else {
187
+ let http = new HttpResetClass()
188
+ let data = {
189
+ tablename: item.tables[0],
190
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
191
+ }
192
+ res = await http.load(
193
+ 'POST',
194
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
195
+ // `rs/sql/applySingleTable`,
196
+ {data: data},
197
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
198
+ )
199
+ }
200
+
201
+ item.rows = res.data
202
+
203
+ // 初始化onetomany中的fields
204
+ for (const field of item.fields) {
205
+ if (!field.value) {
206
+ if (field.value !== 0) {
207
+ field.value = null
208
+ }
209
+ }
210
+
211
+ if (field.default || field.default === 0) {
212
+ field.value = field.default
213
+ }
214
+
215
+ // datepicker
216
+ if (field.type === 'datepicker' && !field.value && field.default) {
217
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
218
+ }
219
+
220
+ if (field.type === 'select') {
221
+
222
+ if (field.param) {
223
+ let temp = this.$appdata.getParam(field.label)
224
+
225
+ if (temp && temp.length > 0) {
226
+ field.options = temp
227
+ }
228
+
229
+ if (field.paramLabel) {
230
+ temp = this.$appdata.getParam(field.paramLabel)
231
+ if (temp && temp.length > 0) {
232
+ item.options = temp
233
+ }
234
+ }
235
+ }
236
+
237
+ }
238
+ }
239
+ if(this.selectdata.defname === '施工信息'){
240
+ // 隐藏所有操作
241
+ item.hiddenOperate = true
242
+ }
243
+ }
244
+ }
245
+
246
+ // 初始化 buttons_fields
247
+ for (const item of this.selectdata.buttons) {
248
+ if (item.button_name === '下发' || item.button_name === '转派') {
249
+ let data = {
250
+ source: item.source,
251
+ userid: Vue.user.id
252
+ // userid: '51953'
253
+ }
254
+ if (item.sourceMethod) {
255
+ data.source = this[item.sourceMethod]()
256
+ }
257
+ if (!data.source) {
258
+ this.$showMessage("请配置获取人员表达式")
259
+ return
260
+ }
261
+ let res = await this.$resetpost(
262
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
263
+ // `rs/search`,
264
+ {data: data},
265
+ {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
266
+ )
267
+
268
+ let options = res.data.map(source => {
269
+ return {
270
+ "label": source.name,
271
+ "value": source.id
272
+ }
273
+ })
274
+
275
+ if (item.button_fields.length !== 1) {
276
+ this.$showMessage("下发有且只能有一个字段!!!")
277
+ return
278
+ }
279
+
280
+ item.button_fields[0].options = options
281
+ }
282
+ if (item.button_fields) {
283
+ item.button_fields.forEach(x => {
284
+ // 如果配置类型为select,优先从参数列表获取options
285
+ if (x.type === 'select') {
286
+
287
+ if (x.param) {
288
+ let temp = this.$appdata.getParam(x.label)
289
+
290
+ if (temp && temp.length > 0) {
291
+ x.options = temp
292
+ }
293
+
294
+ if (x.paramLabel) {
295
+ temp = this.$appdata.getParam(x.paramLabel)
296
+ if (temp && temp.length > 0) {
297
+ x.options = temp
298
+ }
299
+ }
300
+ }
301
+
302
+ }
303
+ })
304
+ }
305
+ }
306
+ if(this.selectdata.defname === '施工信息'||this.title=== '已办信息'){
307
+ this.selectdata.buttons = null
308
+ }
309
+ if (this.selectdata.f_apply_nature === '散户' && this.selectdata.defname === '现场勘察') {
310
+ for (const item of this.selectdata.fields) {
311
+ if (item.label.includes('安装户数')) {
312
+ item.readonly = true
313
+ }
314
+ }
315
+ }
316
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
317
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
318
+
319
+ this.show_data = temp
320
+ this.$nextTick(() => {
321
+ this.showview = true
322
+ })
323
+ },
324
+ // 金额转大写
325
+ smalltoBIG(n) {
326
+ let fraction = ['角', '分'];
327
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
328
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
329
+ let head = n < 0 ? '欠' : '';
330
+ n = Math.abs(n);
331
+
332
+ let s = '';
333
+
334
+ for (var i = 0; i < fraction.length; i++) {
335
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
336
+ }
337
+ s = s || '整';
338
+ n = Math.floor(n);
339
+
340
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
341
+ let p = '';
342
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
343
+ p = digit[n % 10] + unit[1][j] + p;
344
+ n = Math.floor(n / 10);
345
+ }
346
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
347
+ }
348
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
349
+ },
350
+ getLableValue(label) {
351
+ for (const item of this.show_data.fields) {
352
+ if (item.label === label && item.type !== 'number') {
353
+ return item.value || ''
354
+ }
355
+ if (item.label === label && item.type === 'number') {
356
+ return item.value || 0
357
+ }
358
+ }
359
+ },
360
+ getLableOptions(label) {
361
+ for (const item of this.show_data.fields) {
362
+ if (item.label === label) {
363
+ return item.options
364
+ }
365
+ }
366
+ },
367
+ setLabelValue(label, value) {
368
+ for (const item of this.show_data.fields) {
369
+ if (item.label === label) {
370
+ item.value = value
371
+ this.show_data[item.field] = value
372
+ }
373
+ }
374
+ },
375
+ setLabelOptions(label, options) {
376
+ for (const item of this.show_data.fields) {
377
+ if (item.label === label) {
378
+ item.options = options
379
+ }
380
+ }
381
+ },
382
+ showLabels(...labels) {
383
+ for (const item of this.show_data.fields) {
384
+ if (labels.includes(item.label)) {
385
+ item.hidden = false
386
+ }
387
+ }
388
+ },
389
+ hideLabels(...labels) {
390
+ for (const item of this.show_data.fields) {
391
+ if (labels.includes(item.label)) {
392
+ item.hidden = true
393
+ }
394
+ }
395
+ },
396
+ showButtons(...buttons) {
397
+ for (const item of this.show_data.buttons) {
398
+ if (buttons.includes(item.button_name)) {
399
+ item.hidden = false
400
+ }
401
+ }
402
+ },
403
+ hideButtons(...buttons) {
404
+ for (const item of this.show_data.buttons) {
405
+ if (buttons.includes(item.button_name)) {
406
+ item.hidden = true
407
+ }
408
+ }
409
+ },
410
+ requiredLabels(...labels) {
411
+ for (const item of this.show_data.fields) {
412
+ if (labels.includes(item.label)) {
413
+ item.required = true
414
+ }
415
+ }
416
+ },
417
+ electiveLabels(...labels) {
418
+ for (const item of this.show_data.fields) {
419
+ if (labels.includes(item.label)) {
420
+ item.required = false
421
+ }
422
+ }
423
+ },
424
+ readonlyLabels(...labels) {
425
+ for (const item of this.show_data.fields) {
426
+ if (labels.includes(item.label)) {
427
+ item.readonly = true
428
+ item.disabled = true
429
+ }
430
+ }
431
+ },
432
+ readwriteLabels(...labels) {
433
+ for (const item of this.show_data.fields) {
434
+ if (labels.includes(item.label)) {
435
+ item.readonly = false
436
+ item.disabled = false
437
+ }
438
+ }
439
+ },
440
+ disabledButtons(...buttons) {
441
+ for (const item of this.show_data.buttons) {
442
+ if (buttons.includes(item.button_name)) {
443
+ item.disabled = true
444
+ }
445
+ }
446
+ },
447
+ enableButtons(...buttons) {
448
+ for (const item of this.show_data.buttons) {
449
+ if (buttons.includes(item.button_name)) {
450
+ item.disabled = false
451
+ }
452
+ }
453
+ },
454
+ showComponents(...titles) {
455
+ for (const item of this.show_data.components) {
456
+ if (titles.includes(item.title) && item.device === 'app') {
457
+ item.hidden = false
458
+ }
459
+ }
460
+ },
461
+ hideComponents(...titles) {
462
+ for (const item of this.show_data.components) {
463
+ if (titles.includes(item.title) && item.device === 'app') {
464
+ item.hidden = true
465
+ }
466
+ }
467
+ },
468
+ async checkDuplicate(index) {
469
+ let http = new HttpResetClass()
470
+ let data = {
471
+ tablename: 't_apply',
472
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
473
+ }
474
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`, {data: data}, {
475
+ resolveMsg: null,
476
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
477
+ })
478
+ if (res.data.length > 0) {
479
+ this.show_data.fields[index].value = null
480
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
481
+ }
482
+ },
483
+ async breakControl() {
484
+ if (this.show_data.id) {
485
+ let data = {
486
+ condition: `u.id = ${this.show_data.id}`,
487
+ data: {
488
+ userid: Vue.user.id,
489
+ f_filiale: "榆林."+Vue.user.orgs
490
+ }
491
+ }
492
+ let url =`${this.$androidUtil.getProxyUrl()}/rs/sql/checkuser`
493
+ if (this.show_data.f_apply_type === '管线建设'){
494
+ url =`${this.$androidUtil.getProxyUrl()}/rs/sql/getGuanXianApply`
495
+ }
496
+ let res = await this.$resetpost(
497
+ url,
498
+ {data: data},
499
+ {resolveMsg: null, rejectMsg: '数据更新失败,请手查询更新!!!'}
500
+ )
501
+
502
+ this.selectdata = res.data[0]
503
+ this.selectdata.f_building=this.show_data.f_building
504
+ this.selectdata.f_unit=this.show_data.f_unit
505
+ this.selectdata.f_room=this.show_data.f_room
506
+ this.selectdata.pageIndex=this.show_data.pageIndex
507
+ } else {
508
+ this.selectdata = servicedata
509
+ }
510
+
511
+ this.refurbish()
512
+ },
513
+ // ------------------------------
514
+ async getConstructionWorker() {
515
+ let data = {
516
+ source: 'this.getParentByType($organization$).getChildByName($建设单位$).getChildren()',
517
+ userid: Vue.user.id
518
+ }
519
+
520
+ let res = await this.$resetpost(
521
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
522
+ {data: data},
523
+ {resolveMsg: null, rejectMsg: '现场负责人查询失败!!!'}
524
+ )
525
+
526
+ return res.data.map(item => {
527
+ return {
528
+ label: item.name,
529
+ value: item.id
530
+ }
531
+ })
532
+ },
533
+ //获取下发人
534
+ getSource () {
535
+ return 'this.getParentByType($organization$).getChildByName($'+ Vue.user.f_parentname + '$).getChildren()'
536
+ },
537
+ async getUserName() {
538
+ let data = {
539
+ tablename: 't_user',
540
+ condition: `id='${this.selectdata.f_construction_unit_id}'`
541
+ }
542
+ let res = await this.$resetpost(
543
+ '${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable',
544
+ {data: data},
545
+ {resolveMsg: null, rejectMsg: null}
546
+ )
547
+ return res.data.map(item => {
548
+ return {
549
+ label: item.name,
550
+ value: item.id
551
+ }
552
+ })
553
+ },
554
+ // 安装单位签字人
555
+ async getConstructionUnitId () {
556
+ let data = {
557
+ source: '',
558
+ userid: Vue.user.id
559
+ }
560
+ data.source = 'this.getParentByType($organization$).getChildByName($'+ Vue.user.f_department_name + '$).getChildren()'
561
+ let res = await this.$resetpost(
562
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
563
+ {data: data},
564
+ {resolveMsg: null, rejectMsg: '安装单位施工班组查询失败!!!'}
565
+ )
566
+
567
+ return res.data.map(item => {
568
+ return {
569
+ label: item.name,
570
+ value: item.id
571
+ }
572
+ })
573
+ },
574
+ // 安装单位负责人
575
+ async getConstructionUnit() {
576
+ let data = {
577
+ source: 'this.getParentByType($organization$).getChildByName($工程施工队$).getChildren()',
578
+ userid: Vue.user.id
579
+ }
580
+
581
+ let res = await this.$resetpost(
582
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
583
+ {data: data},
584
+ {resolveMsg: null, rejectMsg: '安装单位人员查询失败!!!'}
585
+ )
586
+
587
+ return res.data.map(item => {
588
+ return {
589
+ label: item.name,
590
+ value: item.id
591
+ }
592
+ })
593
+ },
594
+ // 建设单位
595
+ async getConstructOperator() {
596
+ let data = {
597
+ source: 'this.getParentByType($organization$).getChildByName($建设单位$).getChildren()',
598
+ userid: Vue.user.id
599
+ }
600
+
601
+ let res = await this.$resetpost(
602
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
603
+ {data: data},
604
+ {resolveMsg: null, rejectMsg: '建设单位人员查询失败!!!'}
605
+ )
606
+
607
+ return res.data.map(item => {
608
+ return {
609
+ label: item.name,
610
+ value: item.id
611
+ }
612
+ })
613
+ },
614
+ // 监理单位
615
+ async getSupervisorOperator() {
616
+ let data = {
617
+ source: 'this.getParentByType($organization$).getChildByName($监理单位$).getChildren()',
618
+ userid: Vue.user.id
619
+ }
620
+
621
+ let res = await this.$resetpost(
622
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
623
+ {data: data},
624
+ {resolveMsg: null, rejectMsg: '监理单位人员查询失败!!!'}
625
+ )
626
+ for (const item of this.selectdata.fields) {
627
+ if (item.label === '监理单位') {
628
+ item.value = res.data[0].id
629
+ this.selectdata[item.field] = res.data[0].id
630
+ }
631
+ }
632
+ return res.data.map(item => {
633
+ return {
634
+ label: item.name,
635
+ value: item.id
636
+ }
637
+ })
638
+ },
639
+ // 监理现场负责人
640
+ async getSupervisorOperatorId () {
641
+ let data = {
642
+ source: 'this.getParentByType($organization$).getChildByName($监理班组$).getChildren()',
643
+ userid: Vue.user.id
644
+ }
645
+ let res = await this.$resetpost(
646
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
647
+ {data: data},
648
+ {resolveMsg: null, rejectMsg: '监理单位人员查询失败!!!'}
649
+ )
650
+ return res.data.map(item => {
651
+ return {
652
+ label: item.name,
653
+ value: item.id
654
+ }
655
+ })
656
+ },
657
+ // 土建单位
658
+ async getEngineeringOperator() {
659
+ let data = {
660
+ source: 'this.getParentByType($organization$).getChildByName($土建单位$).getChildren()',
661
+ userid: Vue.user.id
662
+ }
663
+
664
+ let res = await this.$resetpost(
665
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
666
+ {data: data},
667
+ {resolveMsg: null, rejectMsg: '土建单位人员查询失败!!!'}
668
+ )
669
+
670
+ let result = res.data.map(item => {
671
+ return {
672
+ label: item.name,
673
+ value: item.id
674
+ }
675
+ })
676
+ result.push({label: '用户自理', value: '用户自理'})
677
+ result.push({label:'无',value:'无'})
678
+ return result
679
+ },
680
+ // 检测单位
681
+ async getCheckOperator() {
682
+ let data = {
683
+ source: 'this.getParentByType($organization$).getChildByName($检测单位$).getChildren()',
684
+ userid: Vue.user.id
685
+ }
686
+
687
+ let res = await this.$resetpost(
688
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
689
+ {data: data},
690
+ {resolveMsg: null, rejectMsg: '检测单位人员查询失败!!!'}
691
+ )
692
+
693
+ let result = res.data.map(item => {
694
+ return {
695
+ label: item.name,
696
+ value: item.id
697
+ }
698
+ })
699
+ result.push({label:'无',value:'无'})
700
+ return result
701
+ },
702
+ // 获取气表品牌
703
+ async getMeterBrand() {
704
+ let data = {}
705
+
706
+ let http = new HttpResetClass()
707
+ let res = await http.load(
708
+ 'POST',
709
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getMeterBrand`,
710
+ {data: data},
711
+ {resolveMsg: null, rejectMsg: '气表品牌查询失败!!!'}
712
+ )
713
+
714
+ return res.data
715
+ },
716
+ // 获取小区
717
+ async getResidentialArea() {
718
+ let data = {
719
+ tablename: 't_area_address',
720
+ condition: `f_filiale like '%${"榆林."+Vue.user.orgs}%' and f_area_status = '启用'`
721
+ }
722
+ let http = new HttpResetClass()
723
+ let res = await http.load(
724
+ 'POST',
725
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
726
+ {data: data},
727
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
728
+ )
729
+ return res.data.map(item => {
730
+ return {
731
+ label: item.f_residential_area,
732
+ value: item.id
733
+ }
734
+ })
735
+ },
736
+ //现场勘察
737
+ async prospectingBefore() {
738
+ let data = {
739
+ tablename: 't_files',
740
+ condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '现场勘察' and fremarks = '报装手机签字文件'`
741
+ }
742
+ let http = new HttpResetClass()
743
+ let res = await http.load(
744
+ 'POST',
745
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
746
+ {data: data},
747
+ {resolveMsg: null, rejectMsg: null}
748
+ )
749
+ if (res.data.length <= 0) {
750
+ this.$showAlert('现场勘察未签字,无法提交!!!', 'warning', 3000)
751
+ throw '现场勘察未签字,无法提交!'
752
+ }
753
+ },
754
+ // 施工前置
755
+ async constructionBefore() {
756
+ await this.userSignBefore()
757
+ if (this.show_data.f_apply_nature !== '分户挂表') {
758
+ let http = new HttpResetClass()
759
+ let data = {
760
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and f_meternumber is null and f_gasbrand_id is not null `
761
+ }
762
+ let res = await http.load(
763
+ 'POST',
764
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/countApplyUserinfo`,
765
+ {data: data},
766
+ {
767
+ resolveMsg: null,
768
+ rejectMsg: '安装明细查询失败!!!'
769
+ })
770
+ if (res.data[0].num > 0) {
771
+ this.$showAlert(`还有${res.data[0].num}户未表号未录入,无法提交`, 'warning', 3000)
772
+ throw `还有${res.data[0].num}户未表号未录入,无法提交`
773
+ }
774
+ }
775
+ },
776
+ async userSignBefore() {
777
+ let http = new HttpResetClass()
778
+ let data = {
779
+ tablename: 't_files',
780
+ condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '${this.selectdata.defname}' and fremarks = '报装手机签字文件'`
781
+ }
782
+ let res = await http.load(
783
+ 'POST',
784
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
785
+ {data: data},
786
+ {resolveMsg: null, rejectMsg: null}
787
+ )
788
+ if (res.data.length <= 0) {
789
+ this.$showAlert('用户未签字,无法生成签字流程!!!', 'warning', 3000)
790
+ throw '用户未签字,无法生成签字流程!'
791
+ }
792
+ },
793
+ signBefore() {
794
+ if (this.show_data.defname === '检测单位签字') {
795
+ if (isEmpty(this.show_data.f_check_sign)) {
796
+ this.$showAlert(`签字后才可提交!!!`, 'warning', 3000)
797
+ throw `签字后才可提交!!!`
798
+ }
799
+ this.show_data.f_check_operator = Vue.user.name
800
+ this.show_data.f_check_date = new Date().Format('yyyy-MM-dd HH:mm:ss')
801
+ this.show_data.employeetemplate = this.show_data.f_build_operator_id
802
+ }
803
+ if (this.show_data.defname === '安装单位签字') {
804
+ if (isEmpty(this.show_data.f_build_sign)) {
805
+ this.$showAlert(`签字后才可提交!!!`, 'warning', 3000)
806
+ throw `签字后才可提交!!!`
807
+ }
808
+ this.show_data.f_build_operator = Vue.user.name
809
+ this.show_data.f_build_date = new Date().Format('yyyy-MM-dd HH:mm:ss')
810
+ this.show_data.employeetemplate = this.show_data.f_engineering_operator_id
811
+ if (this.show_data.f_engineering_operator_id === '用户自理' || this.show_data.f_engineering_operator_id === '无') {
812
+ this.show_data.f_engineering_operator = this.show_data.f_engineering_operator_id
813
+ this.show_data.f_engineering_date = new Date().Format('yyyy-MM-dd HH:mm:ss')
814
+ this.show_data.employeetemplate = this.show_data.f_supervisor_operator_id
815
+ }
816
+ }
817
+ if (this.show_data.defname === '土建单位签字') {
818
+ if (isEmpty(this.show_data.f_engineering_sign)) {
819
+ this.$showAlert(`签字后才可提交!!!`, 'warning', 3000)
820
+ throw `签字后才可提交!!!`
821
+ }
822
+ this.show_data.f_engineering_operator = Vue.user.name
823
+ this.show_data.f_engineering_date = new Date().Format('yyyy-MM-dd HH:mm:ss')
824
+ this.show_data.employeetemplate = this.show_data.f_supervisor_operator_id
825
+ }
826
+ if (this.show_data.defname === '监理单位签字') {
827
+ if (isEmpty(this.show_data.f_supervisor_sign)) {
828
+ this.$showAlert(`签字后才可提交!!!`, 'warning', 3000)
829
+ throw `签字后才可提交!!!`
830
+ }
831
+ this.show_data.f_supervisor_operator = Vue.user.name
832
+ this.show_data.f_supervisor_date = new Date().Format('yyyy-MM-dd HH:mm:ss')
833
+ this.show_data.employeetemplate = this.show_data.f_construct_operator_id
834
+ }
835
+ if (this.show_data.defname === '建设单位签字') {
836
+ if (isEmpty(this.show_data.f_construct_sign)) {
837
+ this.$showAlert(`签字后才可提交!!!`, 'warning', 3000)
838
+ throw `签字后才可提交!!!`
839
+ }
840
+ this.show_data.f_construct_operator = Vue.user.name
841
+ this.show_data.f_construct_date = new Date().Format('yyyy-MM-dd HH:mm:ss')
842
+ }
843
+ },
844
+ //分户挂表生成安检单
845
+ async getChecklist() {
846
+ let http = new HttpResetClass()
847
+ let data = {
848
+ f_process_id: this.selectdata.f_process_id,
849
+ f_userinfo_id: this.selectdata.f_userinfo_id,
850
+ user: Vue.user
851
+ }
852
+ let res = await http.load(
853
+ 'POST',
854
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/getChecklist`,
855
+ {data: data},
856
+ {resolveMsg: null, rejectMsg: null}
857
+ )
858
+ },
859
+ //工商户验证表具类型是否需选择
860
+ async meterBrandCheck() {
861
+ let data = {
862
+ f_process_id: this.selectdata.f_process_id,
863
+ orgid:Vue.user.orgid
864
+ }
865
+ let http = new HttpResetClass()
866
+ let res = await http.load(
867
+ 'POST',
868
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/meterCheck`,
869
+ {data: data},
870
+ {resolveMsg: null, rejectMsg: null}
871
+ )
872
+ if (res.data[0].num > 0){
873
+ this.$showAlert(`还有${res.data[0].num}处未选择表具,请选择后提交!`, 'warning', 3000)
874
+ throw null
875
+ }
876
+ },
877
+ // 安装户数
878
+ async installCountCheck() {
879
+ let data = {
880
+ tablename: 't_userinfo',
881
+ condition: `f_process_id = '${this.show_data.f_process_id}' and f_user_state != '销户'`,
882
+ }
883
+
884
+ let http = new HttpResetClass()
885
+ let res = await http.load(
886
+ 'POST',
887
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
888
+ {data: data},
889
+ {resolveMsg: null, rejectMsg: '用户数量查询失败'}
890
+ )
891
+ this.setLabelValue('安装户数',res.data.length)
892
+ },
893
+ async stopApply () {
894
+ console.log('终止报建!!!!!')
895
+
896
+ if (this.show_data.defname === '报建受理') {
897
+ this.show_data.f_stop_reason = this.show_data.f_accept_result
898
+ }
899
+ if (this.show_data.defname === '现场勘察') {
900
+ this.show_data.f_stop_reason = this.show_data.f_prospecting_result
901
+ }
902
+
903
+ let data = {
904
+ apply: this.show_data,
905
+ user: Vue.user
906
+ }
907
+
908
+ let res = await this.$resetpost(
909
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/stopApply`,
910
+ {data: data},
911
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
912
+ )
913
+
914
+ this.$dispatch('confirm')
915
+
916
+ throw '终止报建!!!'
917
+ },
918
+ // 户内出单日期
919
+ getOutdoorsTime () {
920
+ for (const item of this.selectdata.fields) {
921
+ console.log('是否进入')
922
+ if (item.label === '户内出单日期') {
923
+ item.value = this.selectdata.f_release_date
924
+ this.selectdata[item.field] = item.value
925
+ console.log('当前出单时间',item.value)
926
+ }else if(item.label === '庭院出单日期'){
927
+ item.value = this.selectdata.f_release_date
928
+ this.selectdata[item.field] = item.value
929
+ }
930
+ }
931
+ },
932
+ getGaiXianType () {
933
+ return [{label: "隐患整改", value: "隐患整改"},
934
+ {label: "改造工程", value: "改造工程"},
935
+ {label: "改线工程", value: "改线工程"},
936
+ {label: "老旧小区", value: "老旧小区"}]
937
+ },
938
+ //获取缴费日期
939
+ async getChargeDate() {
940
+ let data = {
941
+ tablename: 'activityins',
942
+ condition: `processid = '${this.selectdata.f_process_id}' and defname = '报装缴费'`,
943
+ }
944
+
945
+ let http = new HttpResetClass()
946
+ let res = await http.load(
947
+ 'POST',
948
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`,
949
+ {data: data},
950
+ {resolveMsg: null, rejectMsg: null}
951
+ )
952
+ for (const item of this.selectdata.fields) {
953
+ if (item.label === '缴费日期') {
954
+ item.value = res.data[0].finishtime
955
+ this.selectdata[item.field] = item.value
956
+ }
957
+ }
958
+ },
959
+ async getSingAct() {
960
+ let data = {
961
+ f_process_id: this.selectdata.f_process_id
962
+ }
963
+ let http = new HttpResetClass()
964
+ let res = await http.load(
965
+ 'POST',
966
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getSingAct`,
967
+ {data: data},
968
+ {resolveMsg: null, rejectMsg: '签字状态查询失败!!!'}
969
+ )
970
+ if (res.data.length > 0) {
971
+ for (const item of this.selectdata.fields) {
972
+ if (item.label === '签字所在环节') {
973
+ item.value = res.data[0].defname
974
+ this.selectdata[item.field] = item.value
975
+ }
976
+ }
977
+ }
978
+ },
979
+ getYiFang() {
980
+ return [{label: '榆林榆川天然气', value: '榆林榆川天然气'},
981
+ {label: this.selectdata.f_user_name, value: this.selectdata.f_user_name},
982
+ {label: '无', value: '无'}]
983
+ },
984
+ async repair() {
985
+ let data = {
986
+ f_process_id: this.show_data.f_process_id
987
+ }
988
+ let http = new HttpResetClass()
989
+ let res = await http.load(
990
+ 'POST',
991
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/updateRepair`,
992
+ {data: data},
993
+ {resolveMsg: null, rejectMsg: '维修工单状态修改!!!'}
994
+ )
995
+ this.$dispatch('loadPage')
996
+ throw ''
997
+ },
998
+ changeDispatch(value){
999
+ if (value === '维修安检中心'){
1000
+ this.hideLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位', '户内出单日期', '户内回单日期'
1001
+ , '户内施工备注', '庭院出单日期', '庭院回单日期', '庭院施工备注', '是否发起签字', '签字是否完成', '签字所在环节')
1002
+ this.hideButtons('签字')
1003
+ this.electiveLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位', '户内出单日期', '户内回单日期'
1004
+ , '户内施工备注', '庭院出单日期', '庭院回单日期', '庭院施工备注', '是否发起签字', '签字是否完成', '签字所在环节')
1005
+ }
1006
+ if (value === '施工工队'){
1007
+ this.showLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位', '户内出单日期', '户内回单日期'
1008
+ , '户内施工备注', '庭院出单日期', '庭院回单日期', '庭院施工备注', '是否发起签字', '签字是否完成', '签字所在环节')
1009
+ this.requiredLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位', '现场项目负责人', '是否发起签字', '签字是否完成', '签字所在环节')
1010
+ }
1011
+ },
1012
+ geIsOpen(){
1013
+ this.isOpen = false
1014
+ }
1015
+ },
1016
+ events: {
1017
+ // 强制开关阀
1018
+ async 'onOffValve'() {
1019
+ let data = {
1020
+ condition: `ui.f_userinfo_id = '${this.show_data.f_userinfo_id}'`
1021
+ }
1022
+ let http = new HttpResetClass()
1023
+ let res = await http.load(
1024
+ 'POST',
1025
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyUserinfo`,
1026
+ {data: data},
1027
+ {resolveMsg: null, rejectMsg: '档案获取失败!!!'}
1028
+ )
1029
+
1030
+ let userinfo = res.data[0]
1031
+
1032
+ data = {
1033
+ condition: `t_userfiles.f_meternumber = '${userinfo.f_meternumber}'`,
1034
+ contentData: {
1035
+ isOpen: this.show_data.button.button_name === '强制开阀' ? 1 : 0
1036
+ },
1037
+ inputtor: Vue.user.name,
1038
+ instructTitle: this.show_data.button.button_name === '强制开阀' ? '开阀' : '关阀',
1039
+ instructType: '阀门控制',
1040
+ meterBrandName: userinfo.f_alias
1041
+ }
1042
+ res = await http.load(
1043
+ 'POST',
1044
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/saveInstruct`,
1045
+ {data: data},
1046
+ {resolveMsg: null, rejectMsg: `${this.show_data.button.button_name}失败!!!`}
1047
+ )
1048
+
1049
+ data = {
1050
+ f_user_id: userinfo.f_user_id,
1051
+ f_userinfo_id: userinfo.f_userinfo_id,
1052
+ record: {
1053
+ f_filiale: "榆林."+Vue.user.orgs,
1054
+ f_instruct_meta_data: this.show_data.button.button_name === '退出强制状态' ? '退出强制阀控' : '进入强制阀控',
1055
+ f_instruct_title: this.show_data.button.button_name === '退出强制状态' ? '退出强制阀控' : '进入强制阀控',
1056
+ f_instruct_type: '阀门控制',
1057
+ f_meternumber: userinfo.f_meternumber,
1058
+ f_operator: Vue.user.name,
1059
+ f_outlets: userinfo.f_outlets,
1060
+ f_reason: this.show_data.button.f_reason,
1061
+ f_user_id: userinfo.f_user_id,
1062
+ f_userinfo_id: userinfo.f_userinfo_id
1063
+ },
1064
+ state: this.show_data.button.button_name === '退出强制状态' ? 0 : 1,
1065
+ }
1066
+
1067
+ res = await http.load(
1068
+ 'POST',
1069
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/updateNetWorkValve`,
1070
+ {data: data},
1071
+ {resolveMsg: '执行成功!!!', rejectMsg: `执行失败!!!`}
1072
+ )
1073
+
1074
+ },
1075
+ // 修改用户档案
1076
+ async 'updateUserinfoState'() {
1077
+ let data = {
1078
+ f_userinfo_id: this.show_data.f_userinfo_id
1079
+ }
1080
+ let http = new HttpResetClass()
1081
+ let res = await http.load(
1082
+ 'POST',
1083
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/updateUserinfoState`,
1084
+ {data: data},
1085
+ {resolveMsg: '该用户档案已为正常档案,可进行开关阀操作!!!', rejectMsg: '档案状态修改失败!!!'}
1086
+ )
1087
+
1088
+ this.showButtons('退出强制状态', '强制关阀')
1089
+ this.hideButtons('转正式档案')
1090
+ },
1091
+ //开始签字流程
1092
+ async 'startSignActivity'() {
1093
+ this.hideButtons('签字')
1094
+
1095
+ if(this.show_data.f_apply_type !== '管线建设'){
1096
+ await this.constructionBefore()
1097
+ }
1098
+ let data = {
1099
+ apply: this.show_data,
1100
+ user: Vue.user
1101
+ }
1102
+
1103
+ let res = await this.$resetpost(
1104
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/startSignActivity`,
1105
+ {data: data},
1106
+ {resolveMsg: '签字流程已发起!!!', rejectMsg: '签字发起失败!!!'}
1107
+ )
1108
+
1109
+ this.breakControl()
1110
+ },
1111
+ // 工程施工初始化
1112
+ async 'buildReadyEvent'() {
1113
+ if (this.getLableValue('是否发起签字') === '是') {
1114
+ this.hideButtons('签字')
1115
+ }
1116
+ let http = new HttpResetClass()
1117
+ console.log("当前流程",this.show_data.f_apply_type)
1118
+ if (isEmpty(this.show_data.f_meter_brand)) {
1119
+ return
1120
+ }else {
1121
+ if (this.show_data.f_meter_brand === 'null') {
1122
+ this.setLabelOptions('气表型号', [{label: '无', value: 'null'}])
1123
+ return
1124
+ }
1125
+ let data = {
1126
+ f_gasbrand_id: this.show_data.f_meter_brand
1127
+ }
1128
+ let res = await http.load(
1129
+ 'POST',
1130
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
1131
+ {data: data},
1132
+ {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
1133
+ )
1134
+ this.setLabelOptions('气表型号', res.data)
1135
+ }
1136
+ if (this.show_data.f_apply_type === '分户挂表') {
1137
+ let data = {
1138
+ condition: `ui.f_userinfo_id = '${this.show_data.f_userinfo_id}'`
1139
+ }
1140
+ let http = new HttpResetClass()
1141
+ let res = await http.load(
1142
+ 'POST',
1143
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getApplyUserinfo`,
1144
+ {data: data},
1145
+ {resolveMsg: null, rejectMsg: '档案状态获取失败!!!'}
1146
+ )
1147
+ setTimeout(() => {
1148
+ if (res.data[0].f_meter_classify === '物联网表') {
1149
+ if (res.data[0].f_user_state === '正常') {
1150
+ this.showButtons('退出强制状态', '强制关阀')
1151
+ this.hideButtons('转正式档案')
1152
+ } else {
1153
+ this.showButtons('转正式档案')
1154
+ this.hideButtons('退出强制状态', '强制关阀')
1155
+ }
1156
+ }
1157
+ }, 1000)
1158
+ }
1159
+ },
1160
+ // 气表品牌失去焦点
1161
+ async 'meterBrandChenge' (index) {
1162
+ if (isEmpty(this.show_data.f_meter_brand)) {
1163
+ return
1164
+ }
1165
+ this.setLabelValue('气表型号', null)
1166
+ let data = {
1167
+ f_gasbrand_id: this.show_data.f_meter_brand
1168
+ }
1169
+ let http = new HttpResetClass()
1170
+ let res = await http.load(
1171
+ 'POST',
1172
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getGasModel`,
1173
+ {data: data},
1174
+ {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
1175
+ )
1176
+
1177
+ this.setLabelOptions('气表型号', res.data)
1178
+ },
1179
+ // 安装户数失去焦点
1180
+ 'installCountChange'(index) {
1181
+ if (isEmpty(this.show_data.f_install_count)) {
1182
+ return
1183
+ }
1184
+ if (Number(this.show_data.f_install_count) > Number(this.show_data.f_apply_count)) {
1185
+ this.$showAlert('安装数已超过申请数!!!', 'warning', 3000)
1186
+ // this.setLabelValue('安装户数', null)
1187
+ // this.setLabelValue('安装点数', null)
1188
+ // return
1189
+ }
1190
+
1191
+ if (Number(this.show_data.f_install_count) <= 0) {
1192
+ this.$showAlert('至少有一个用户!!!', 'warning', 3000)
1193
+ this.setLabelValue('安装户数', null)
1194
+ this.setLabelValue('安装点数', null)
1195
+ return
1196
+ }
1197
+ },
1198
+ 'complyInstallation'(index) {
1199
+ if (this.show_data.defname === '报建受理'){
1200
+ if (this.show_data.f_accept_install === '否') {
1201
+ console.log("测试")
1202
+ this.hideButtons('下发','提交')
1203
+ this.showButtons('终止')
1204
+ } else {
1205
+ this.hideButtons('终止')
1206
+ this.showButtons('下发','提交')
1207
+ }
1208
+ }
1209
+ if (this.show_data.defname === '现场勘察'){
1210
+ if (this.show_data.f_survey_opinion === '否') {
1211
+ console.log("测试")
1212
+ this.hideButtons('下发','提交')
1213
+ this.showButtons('终止')
1214
+ } else {
1215
+ this.hideButtons('终止')
1216
+ this.showButtons('下发','提交')
1217
+ }
1218
+ }
1219
+ if (this.show_data.defname === '报建受理' || this.show_data.defname === '现场勘察'){
1220
+ this.installCountCheck()
1221
+ }
1222
+ },
1223
+ //搜索小区
1224
+ 'selectArea' (val,index) {
1225
+ let pcdText = `and f_residential_area like '%${val}%'`
1226
+ let data = {
1227
+ tablename: 't_area_address',
1228
+ condition: `f_filiale like '%${"榆林."+Vue.user.orgs}%' and f_area_status = '启用' ${pcdText}`
1229
+ }
1230
+ new HttpResetClass().load("POST", `${this.$androidUtil.getProxyUrl()}/rs/sql/applySingleTable`, {data:data}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
1231
+ console.log('请求发送完成!!!!!'+JSON.stringify(res))
1232
+ if(res.data.length>0){
1233
+ this.setLabelOptions('小区/巷道', res.data.map(item => {
1234
+ return {
1235
+ label: item.f_residential_area,
1236
+ value: item.id
1237
+ }
1238
+ }))
1239
+ }
1240
+ })
1241
+ },
1242
+ 'changeDispatching'(index){
1243
+ if (this.show_data.fields[index].value === '安检维修中心'){
1244
+ this.hideLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位')
1245
+ this.electiveLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位')
1246
+ }else if (this.show_data.fields[index].value === '施工工队'){
1247
+ this.showLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位')
1248
+ this.requiredLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位')
1249
+ }
1250
+ },
1251
+ 'getRefund'(index){
1252
+ if (this.show_data.fields[index].value === '否'){
1253
+ this.hideLabels('退费金额', '退款项')
1254
+ this.electiveLabels('退费金额', '退款项')
1255
+ }else if (this.show_data.fields[index].value === '是'){
1256
+ this.showLabels('退费金额', '退款项')
1257
+ this.requiredLabels('退费金额', '退款项')
1258
+ }
1259
+ },
1260
+ 'hasTrouble'(index) {
1261
+ if (this.show_data.fields[index].value === '有纠纷'){
1262
+ this.hideButtons('提交', '签字', '图纸变更')
1263
+ this.showLabels('纠纷原因')
1264
+ }else {
1265
+ this.showButtons('提交', '签字', '图纸变更')
1266
+ this.hideLabels('纠纷原因')
1267
+ }
1268
+ },
1269
+ // ===========================================
1270
+ 'initializtionView'() {
1271
+ if (this.show_data.f_apply_type === '民用报建' && this.show_data.f_apply_nature === '散户') {
1272
+ this.hideLabels('营业执照', '小区/巷道')
1273
+ this.electiveLabels('营业执照', '购货单位识别号', '购货单位银行账号', '购货单位地址电话', '小区/巷道')
1274
+ }
1275
+ if (this.show_data.f_apply_type === '民用报建' && this.show_data.f_apply_nature === '小区') {
1276
+ this.showLabels('营业执照', '小区/巷道', '小区名称')
1277
+ this.requiredLabels( '小区/巷道')
1278
+ this.hideComponents('用户花名单')
1279
+ }
1280
+ },
1281
+ 'breakControl'() {
1282
+ this.breakControl()
1283
+ },
1284
+ // 检查重复
1285
+ 'checkRepeat'(index) {
1286
+ this.checkDuplicate(index)
1287
+ },
1288
+ async 'button'() {
1289
+ if (this.show_data.button.before) {
1290
+ //判断当前环节
1291
+ if(this.show_data.defname=='现场勘察'||this.show_data.defname=='工程派工' ||this.show_data.defname=='工程施工'||this.show_data.defname=='点火通气' ||this.show_data.defname=='监理单位派工' ||this.show_data.defname=='工程队派工' ||this.show_data.defname=='检测单位签字' ||this.show_data.defname=='土建单位签字' ||this.show_data.defname=='监理单位签字' ||this.show_data.defname=='建设单位签字'){
1292
+ if(this.show_data.button.button_name=='提交' || this.show_data.button.button_name=='保存' || this.show_data.button.button_name=='退回' || this.show_data.button.button_name=='终止' ){
1293
+ let res = await this.$showMessage('是否需要继续此次操作')
1294
+ if (res === 'cancel') {
1295
+ return
1296
+ }else{
1297
+ await this[this.show_data.button.before]()
1298
+ }
1299
+ }
1300
+ }
1301
+ }else{
1302
+ //判断当前环节
1303
+ if(this.show_data.defname=='现场勘察'||this.show_data.defname=='工程派工' ||this.show_data.defname=='工程施工'||this.show_data.defname=='点火通气' ||this.show_data.defname=='监理单位派工' ||this.show_data.defname=='工程队派工'){
1304
+ if(this.show_data.button.button_name=='提交' || this.show_data.button.button_name=='保存' || this.show_data.button.button_name=='退回'){
1305
+ let res = await this.$showMessage('是否需要继续此次操作')
1306
+ if (res === 'cancel') {
1307
+ return
1308
+ }
1309
+ }
1310
+ }
1311
+
1312
+ }
1313
+ // 点击重置按钮就重置数据
1314
+ if (this.show_data.button.button_name === '重置') {
1315
+ this.$dispatch('breakControl', this.selectdata)
1316
+ return
1317
+ }
1318
+
1319
+ this.show_data.start_activity = this.json_datas.start_activity
1320
+ this.show_data.xmlfilename = this.json_datas.workflow_xmlfilename
1321
+
1322
+ let data = {
1323
+ apply: this.show_data,
1324
+ user: Vue.user
1325
+ }
1326
+ console.log("当前提交数据",this.show_data)
1327
+ let res = await this.$resetpost(
1328
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyProductService`,
1329
+ {data: data},
1330
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1331
+ )
1332
+
1333
+ if (this.show_data.button.after) {
1334
+ this[this.show_data.button.after]()
1335
+ }
1336
+ // 返回上层
1337
+ this.$dispatch('confirm')
1338
+ },
1339
+ 'locationclick' (res) {
1340
+ console.log('/*/*/*/*/*/*/*/*/*/*/*/*/*/**/*/*/*/*')
1341
+ if (res.pname){
1342
+ this.setLabelValue('定位地址', res.pname + res.cityname + res.adname + res.address + res.name)
1343
+ }else {
1344
+ this.setLabelValue('定位地址', res.province + res.city + res.address + res.name)
1345
+ }
1346
+ this.show_data.f_lng = res.location.lng
1347
+ this.show_data.f_lat = res.location.lat
1348
+ this.isOpen = !this.isOpen
1349
+ },
1350
+ selectSearch (val, index) {},
1351
+ // 失去焦点出触发事件
1352
+ 'onchange'(index) {
1353
+ },
1354
+ 'onblur'(index) {
1355
+ },
1356
+ 'oninput'(index) {
1357
+ },
1358
+ async 'onchangeModal'(index, fieldIndex) {
1359
+ },
1360
+ async 'onblurModal'(index, fieldIndex) {
1361
+
1362
+ },
1363
+ async 'oninputModal'(index, fieldIndex) {
1364
+
1365
+ },
1366
+ async 'onetomanydelete'(index, rowIndex) {
1367
+
1368
+ let http = new HttpResetClass()
1369
+
1370
+ let res = await http.load(
1371
+ 'DELETE',
1372
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1373
+ null,
1374
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1375
+ )
1376
+ res = await this.$resetpost(
1377
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1378
+ this.show_data
1379
+ )
1380
+ this.breakControl()
1381
+ },
1382
+ async 'onetomanyupdate'(index, rowIndex) {
1383
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1384
+
1385
+ this.show_data.onetomany[index].fields.forEach(item => {
1386
+ data[item.field] = item.value
1387
+ })
1388
+ let res = await this.$resetpost(
1389
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1390
+ data
1391
+ )
1392
+ res = await this.$resetpost(
1393
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1394
+ this.show_data
1395
+ )
1396
+ this.breakControl()
1397
+ },
1398
+ async 'onetomanyadd'(index) {
1399
+ let data = {
1400
+ f_process_id: this.show_data.f_process_id,
1401
+ f_operator_id: Vue.user.id,
1402
+ f_operator: Vue.user.name,
1403
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1404
+ f_orgid: Vue.user.orgid,
1405
+ f_orgname: "榆林."+Vue.user.orgs
1406
+ }
1407
+ this.show_data.onetomany[index].fields.forEach(item => {
1408
+ data[item.field] = item.value
1409
+ })
1410
+ let res = await this.$resetpost(
1411
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1412
+ data
1413
+ )
1414
+ res = await this.$resetpost(
1415
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1416
+ this.show_data
1417
+ )
1418
+ this.breakControl()
1419
+ },
1420
+ 'onbutchange'(index) {
1421
+
1422
+ },
1423
+ 'onbutblur'(index) {
1424
+
1425
+ },
1426
+ 'onbutinput'(index) {
1427
+
1428
+ }
1429
+ },
1430
+ watch: {}
1431
+ }
1432
+ </script>
1433
+ <style scoped>
1434
+ </style>