apply-clients 7.1.36-yuchuan-2 → 7.1.36-yuchuan-3

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