apply-clients 3.5.4-83 → 3.5.4-85

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 (51) hide show
  1. package/build/dev-server.js +5 -9
  2. package/package.json +3 -3
  3. package/src/App.vue +25 -25
  4. package/src/applyAndroid.js +72 -72
  5. package/src/components/android/AppTakePic.vue +182 -181
  6. package/src/components/android/Process/Processes/AppChargeManagement.vue +635 -635
  7. package/src/components/android/Process/Processes/AppChargeManagementNew.vue +630 -635
  8. package/src/components/android/Process/Processes/AppInstallationDetails.vue +1 -1
  9. package/src/components/product/Material/MaterialDetailed.vue +268 -268
  10. package/src/components/product/Process/ExplorationSelect.vue +497 -497
  11. package/src/components/product/Process/Processes/InstallationDetails.vue +1 -1
  12. package/src/components/product/Process/Processes/chargeManagement.vue +656 -656
  13. package/src/filiale/baiyin/android/ByDeviceManagement.vue +916 -916
  14. package/src/filiale/fugou/android/AppAddMaterialScience.vue +448 -448
  15. package/src/filiale/fugou/android/AppDevicesManagement.vue +519 -519
  16. package/src/filiale/fugou/android/AppInstallationDetails.vue +541 -541
  17. package/src/filiale/fugou/android/AppServiceControl.vue +1845 -1843
  18. package/src/filiale/fugou/android/AppZhihuanManagement.vue +197 -191
  19. package/src/filiale/fugou/android/printCharge.vue +162 -0
  20. package/src/filiale/fugou/android.js +16 -15
  21. package/src/filiale/fugou/pc/ExplorationSelect.vue +525 -525
  22. package/src/filiale/fugou/pc/ServiceControl.vue +1705 -1703
  23. package/src/filiale/fugou/pc/ServiceView.vue +941 -941
  24. package/src/filiale/fugou/pc/devicesManagement.vue +483 -483
  25. package/src/filiale/fugou/pc/printChargepc.vue +148 -0
  26. package/src/filiale/fugou/pc.js +14 -13
  27. package/src/filiale/gongyi/android/AppAddMaterialScience.vue +493 -493
  28. package/src/filiale/jinhuang/pc/ServiceControl.vue +1925 -1925
  29. package/src/filiale/jinhuang/pc/addressAndUserinfoManagement.vue +203 -203
  30. package/src/filiale/jinhuang/pc/chargeManagementNew.vue +589 -589
  31. package/src/filiale/jinhuang/pc.js +8 -8
  32. package/src/filiale/qianneng/android/AppChargeManagement.vue +686 -686
  33. package/src/filiale/qianneng/android.js +15 -15
  34. package/src/filiale/qianneng/pc/ApplyMaterialDetailed.vue +261 -0
  35. package/src/filiale/qianneng/pc/Applydetail.vue +378 -378
  36. package/src/filiale/qianneng/pc/InstallFunction.vue +188 -188
  37. package/src/filiale/qianneng/pc.js +29 -28
  38. package/src/filiale/siyangRH/android/AppAddMaterialScience.vue +466 -466
  39. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +527 -527
  40. package/src/filiale/yangchunboneng/android/AppDevicesManagement.vue +639 -639
  41. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +1681 -1681
  42. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +548 -548
  43. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +2075 -2075
  44. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +1059 -1059
  45. package/src/filiale/yongzhouch/pc/ApplyUpload.vue +327 -327
  46. package/src/filiale/yongzhouch/pc/ExplorationSelect.vue +490 -490
  47. package/src/filiale/yongzhouch/pc/InstallationDetails.vue +610 -610
  48. package/src/filiale/yongzhouch/pc/ServiceControl.vue +1943 -1943
  49. package/src/filiale/yongzhouch/pc/devicesManagement.vue +488 -488
  50. package/src/filiale/yongzhouch/pc.js +10 -10
  51. package/src/main.js +23 -23
@@ -1,1681 +1,1681 @@
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="true" type="primary">
5
- <work-busy :is-busy="excessive"></work-busy>
6
- <app-service-view v-ref:serviceview :data="show_data" v-if="showview"></app-service-view>
7
- </panel>
8
- <panel header="拍照" :is-open="false" type="primary" v-if="selectdata.f_process_id">
9
- <app-take-pic :blobid="selectdata.f_process_id" :defname="selectdata.defname" :isdelete="true" :istakepic="true" :istype="true"></app-take-pic>
10
- </panel>
11
- <panel header="签字" :is-open="false" type="primary" v-if="selectdata.f_process_id">
12
- <app-sign :blobid="selectdata.f_process_id" :defname="selectdata.defname" @sign-success="signSuccess" :file-path="selectdata.f_process_id"@sign-clean="signClean"></app-sign>
13
- </panel>
14
- <panel header="附件" :is-open="false" type="primary" v-if="selectdata.f_process_id">
15
- <app-upload :blobid="selectdata.f_process_id" :pblobid="selectdata.f_parent_process_id" :isdelete="true" :defname="selectdata.defname"></app-upload>
16
- </panel>
17
- </accordion>
18
- </div>
19
- </template>
20
- <script>
21
- import Vue from 'vue'
22
- import {HttpResetClass} from 'vue-client'
23
- import {isEmpty} from "../../../components/Util";
24
- // Date格式化
25
- Date.prototype.Format = function (fmt) {
26
- var o = {
27
- 'M+': this.getMonth() + 1, // 月份
28
- 'd+': this.getDate(), // 日
29
- 'H+': this.getHours(), // 小时
30
- 'm+': this.getMinutes(), // 分
31
- 's+': this.getSeconds(), // 秒
32
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
33
- 'S': this.getMilliseconds() // 毫秒
34
- }
35
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
36
- for (var k in o) {
37
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
38
- }
39
- return fmt
40
- }
41
- export default {
42
- title: '报建流程业务控制层',
43
- props: ['selectdata'],
44
- data () {
45
- return {
46
- json_datas: null,
47
- data: null,
48
- show_data: null,
49
- showview: false,
50
- config: {},
51
- excessive:false
52
- }
53
- },
54
- ready () {
55
- this.refurbish()
56
- },
57
- methods: {
58
- //阳春博能
59
- //收费确认环节,如果有未确认的收费, 不能进行下一步
60
- async confirmCharges() {
61
- var processId = this.show_data.f_process_id
62
- let data = {
63
- condition: `f_process_id = '${processId}'`
64
- }
65
- let http = new HttpResetClass()
66
- let res = await http.load(
67
- 'POST',
68
- `${this.$androidUtil.getProxyUrl()}/rs/sql/confirmCharges`,
69
- {data: data},
70
- {resolveMsg: null, rejectMsg: '查询失败!!!'}
71
- )
72
- if (res.data.length !== 0) {
73
- var total = res.data[0].total //总收费记录
74
- var confirmtotal = res.data[0].confirmtotal //确认收费记录
75
- var num = Number(total) - Number(confirmtotal)
76
- if (Number(total) > Number(confirmtotal)) {
77
- this.$showMessage(`有${num}条收费记录未确认收款,请确认`, 'warning', 3000)
78
- throw null
79
- }
80
- }
81
- },
82
- async refurbish() {
83
- let data = {
84
- workname: this.selectdata.processname
85
- }
86
-
87
- let res = await this.$resetpost(
88
- `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyGetConfigs`,
89
- {data: data},
90
- {resolveMsg: null, rejectMsg: '配置数据获取失败!!!'}
91
- )
92
-
93
- this.json_datas = res.data
94
-
95
- let sum = 0
96
- let jsonData = {}
97
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
98
- this.$showMessage("网络故障,请刷新页面")
99
- return
100
- }
101
- this.json_datas.activitys.forEach(item => {
102
- if (this.selectdata.defname === item.title) {
103
- jsonData = item // 拿到当前节点的json配置信息
104
- sum++ // 节点名一样的个数
105
- }
106
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
107
- })
108
-
109
- if (sum === 0) {
110
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
111
- return
112
- }
113
- if (sum > 1) {
114
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
115
- return
116
- }
117
-
118
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
119
-
120
- // fields 字段填充值
121
- for (const item of this.selectdata.fields) {
122
- if (!item.value) {
123
- item.value = null
124
- }
125
-
126
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
127
- if (item.eval) {
128
- let user = Vue.user
129
- // 将PC用户信息 替换成 APP的
130
- item.value = eval(item.default.replace('this.$login.f', 'user'))
131
- } else {
132
- item.value = item.default
133
- }
134
- }
135
-
136
- if (this.selectdata[item.field]) {
137
- // 将json字符串格式化赋值给value
138
- if (String(this.selectdata[item.field]).startsWith("{")) {
139
- item.value = JSON.parse(this.selectdata[item.field])
140
- } else {
141
- item.value = this.selectdata[item.field]
142
- }
143
- }
144
- if (this.selectdata[item.field] === 0) {
145
- item.value = 0
146
- }
147
-
148
- // datepicker
149
- if (item.type === 'datepicker' && !item.value && item.default) {
150
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
151
- }
152
-
153
- // 如果配置类型为select,优先从参数列表获取options
154
- if (item.type === 'select' || item.type === 'checkbox') {
155
- if (item.param) {
156
- let temp = this.$appdata.getParam(item.label)
157
-
158
- if (temp && temp.length > 0) {
159
- item.options = temp
160
- }
161
-
162
- if (item.paramLabel) {
163
- temp = this.$appdata.getParam(item.paramLabel)
164
- if (temp && temp.length > 0) {
165
- item.options = temp
166
- }
167
- }
168
- }
169
- console.log("item.ready"+item.ready)
170
- if (item.ready) {
171
- console.log(item.ready)
172
- item.options = await this[item.ready]()
173
-
174
- }
175
- if (!isEmpty(item.role)){
176
- console.log('获取对应角色的人员信息',item.role)
177
- item.options = await this.getDesignerPeople(item.role)
178
- item.optionsid = await this.getDesignerPeopleid(item.role)
179
- }
180
- if (item.multiple && !isEmpty(this.selectdata[item.field])){
181
- this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
182
- item.value = JSON.parse(item.value)
183
- }
184
- }
185
-
186
-
187
- if (item.type === 'checkbox') {
188
- if (this.selectdata[item.field]) {
189
- item.value = JSON.parse(this.selectdata[item.field])
190
- } else {
191
- item.value = []
192
- }
193
- }
194
-
195
- this.selectdata[item.field] = item.value
196
- }
197
-
198
- // 控制组件
199
- if (this.selectdata.components) {
200
- this.selectdata.components.forEach(item => {
201
- if (!item.mark) {
202
- item.mark = 0
203
- }
204
- })
205
- }
206
-
207
- // 初始化onetomany
208
- if (this.selectdata.onetomany) {
209
- for (const item of this.selectdata.onetomany) {
210
- let res = null
211
- if (item.queryEvent) {
212
- res = this[item.queryEvent]()
213
- } else {
214
- let http = new HttpResetClass()
215
- let data = {
216
- tablename: item.tables[0],
217
- condition: `f_process_id='${this.selectdata.f_process_id}'`
218
- }
219
- res = await http.load(
220
- 'POST',
221
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
222
- // `rs/sql/apply_singleTable`,
223
- {data: data},
224
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
225
- )
226
- }
227
-
228
- item.rows = res.data
229
-
230
- // 初始化onetomany中的fields
231
- for (const field of item.fields) {
232
- if (!field.value) {
233
- if (field.value !== 0) {
234
- field.value = null
235
- }
236
- }
237
-
238
- if (field.default || field.default === 0) {
239
- field.value = field.default
240
- }
241
-
242
- // datepicker
243
- if (field.type === 'datepicker' && !field.value && field.default) {
244
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
245
- }
246
-
247
- if (field.type === 'select') {
248
-
249
- if (field.param) {
250
- let temp = this.$appdata.getParam(field.label)
251
-
252
- if (temp && temp.length > 0) {
253
- field.options = temp
254
- }
255
-
256
- if (field.paramLabel) {
257
- temp = this.$appdata.getParam(field.paramLabel)
258
- if (temp && temp.length > 0) {
259
- item.options = temp
260
- }
261
- }
262
- }
263
-
264
- }
265
- }
266
- }
267
- }
268
-
269
- // 初始化 buttons_fields
270
- for (const item of this.selectdata.buttons) {
271
- if (item.button_name === '下发') {
272
- let data = {
273
- source: item.source,
274
- userid: Vue.user.id
275
- // userid: '51953'
276
- }
277
- if (item.sourceMethod) {
278
- data.source = this[item.sourceMethod]()
279
- }
280
- if (!data.source) {
281
- this.$showMessage("请配置获取人员表达式")
282
- return
283
- }
284
- let res = await this.$resetpost(
285
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
286
- // `rs/search`,
287
- {data: data},
288
- {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
289
- )
290
-
291
- let options = res.data.map(source => {
292
- return {
293
- "label": source.name,
294
- "value": source.id
295
- }
296
- })
297
-
298
- if (item.button_fields.length !== 1) {
299
- this.$showMessage("下发有且只能有一个字段!!!")
300
- return
301
- }
302
-
303
- item.button_fields[0].options = options
304
- }
305
- if (item.button_fields) {
306
- item.button_fields.forEach(x => {
307
- // 如果配置类型为select,优先从参数列表获取options
308
- if (x.type === 'select') {
309
-
310
- if (x.param) {
311
- let temp = this.$appdata.getParam(x.label)
312
-
313
- if (temp && temp.length > 0) {
314
- x.options = temp
315
- }
316
-
317
- if (x.paramLabel) {
318
- temp = this.$appdata.getParam(x.paramLabel)
319
- if (temp && temp.length > 0) {
320
- x.options = temp
321
- }
322
- }
323
- }
324
-
325
- }
326
- })
327
- }
328
- }
329
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
330
- let temp = JSON.parse(JSON.stringify(this.selectdata))
331
- this.show_data = temp
332
- /*for (const item of this.show_data.fields) {
333
- if(item.label=='气价名称' && !isEmpty(this.show_data.f_price_name)){
334
- item.options.forEach(x=>{
335
- if(x.label==this.show_data.f_price_name){
336
- item.value=x.value
337
- }
338
- })
339
- }
340
- }*/
341
- if(!this.show_data.showfei){
342
- this.$set('show_data.showfei', '未收费')
343
- }
344
- //this.show_data.showfei=false
345
-
346
- this.$nextTick(() => {
347
- this.showview = true
348
- })
349
- },
350
- signClean () {
351
- this.selectdata.f_construction_sign = null
352
- },
353
- signSuccess (fileUrl) {
354
- console.log('==============签字回调==================')
355
- console.log(fileUrl)
356
- this.selectdata.f_construction_sign = fileUrl
357
- },
358
- // 金额转大写
359
- smalltoBIG(n) {
360
- let fraction = ['角', '分'];
361
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
362
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
363
- let head = n < 0 ? '欠' : '';
364
- n = Math.abs(n);
365
-
366
- let s = '';
367
-
368
- for (var i = 0; i < fraction.length; i++) {
369
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
370
- }
371
- s = s || '整';
372
- n = Math.floor(n);
373
-
374
- for (var i = 0; i < unit[0].length && n > 0; i++) {
375
- let p = '';
376
- for (var j = 0; j < unit[1].length && n > 0; j++) {
377
- p = digit[n % 10] + unit[1][j] + p;
378
- n = Math.floor(n / 10);
379
- }
380
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
381
- }
382
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
383
- },
384
- getLableValue(label) {
385
- for (const item of this.show_data.fields) {
386
- if (item.label === label && item.type !== 'number') {
387
- return item.value || ''
388
- }
389
- if (item.label === label && item.type === 'number') {
390
- return item.value || 0
391
- }
392
- }
393
- },
394
- getLableOptions(label) {
395
- for (const item of this.show_data.fields) {
396
- if (item.label === label) {
397
- return item.options
398
- }
399
- }
400
- },
401
- hideLabels(...labels) {
402
- for (const item of this.show_data.fields) {
403
- if (labels.includes(item.label)) {
404
- item.hidden = true
405
- }
406
- }
407
- },
408
- requiredLabels(...labels) {
409
- for (const item of this.show_data.fields) {
410
- if (labels.includes(item.label)) {
411
- item.required = true
412
- }
413
- }
414
- },
415
- electiveLabels(...labels) {
416
- for (const item of this.show_data.fields) {
417
- if (labels.includes(item.label)) {
418
- item.required = false
419
- }
420
- }
421
- },
422
- showLabels(...labels) {
423
- for (const item of this.show_data.fields) {
424
- if (labels.includes(item.label)) {
425
- item.hidden = false
426
- }
427
- }
428
- },
429
- setLabelValue(label, value) {
430
- for (const item of this.show_data.fields) {
431
- if (item.label === label) {
432
- item.value = value
433
- this.show_data[item.field] = value
434
- }
435
- }
436
- },
437
- setLabelOptions(label, options) {
438
- for (const item of this.show_data.fields) {
439
- if (item.label === label) {
440
- item.options = options
441
- }
442
- }
443
- },
444
- disabledButtons(...buttons) {
445
- for (const item of this.show_data.buttons) {
446
- if (buttons.includes(item.button_name)) {
447
- item.disabled = true
448
- }
449
- }
450
- },
451
- enableButtons(...buttons) {
452
- for (const item of this.show_data.buttons) {
453
- if (buttons.includes(item.button_name)) {
454
- item.disabled = false
455
- }
456
- }
457
- },
458
- showButtons(...buttons) {
459
- for (const item of this.show_data.buttons) {
460
- if (buttons.includes(item.button_name)) {
461
- item.hidden = false
462
- }
463
- }
464
- },
465
- hideButtons(...buttons) {
466
- for (const item of this.show_data.buttons) {
467
- if (buttons.includes(item.button_name)) {
468
- item.hidden = true
469
- }
470
- }
471
- },
472
- async streetChange () {
473
- if (isEmpty(this.show_data.f_street)) {
474
- return
475
- }
476
-
477
- let data = {
478
- tablename: 't_area',
479
- // condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
480
- condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}'`
481
- }
482
- let http = new HttpResetClass()
483
- let res = await http.load(
484
- 'POST',
485
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
486
- {data: data},
487
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
488
- )
489
-
490
- this.setLabelOptions('小区', res.data.map(item => {
491
- return {
492
- label: item.f_residential_area,
493
- value: item.f_residential_area
494
- }
495
- }))
496
- },
497
- // 获取小区
498
- async getArea () {
499
- let data = {
500
- tablename: 't_area',
501
- condition: `f_filialeid = '${Vue.user.orgid}'`
502
- }
503
- let http = new HttpResetClass()
504
- let res = await http.load(
505
- 'POST',
506
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
507
- {data: data},
508
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
509
- )
510
-
511
- return res.data.map(item => {
512
- return {
513
- label: item.f_residential_area,
514
- value: item.f_residential_area
515
- }
516
- })
517
- },
518
- async pcdChange () {
519
- if (isEmpty(this.show_data.f_pcd)) {
520
- return
521
- }
522
-
523
- let data = {
524
- tablename: 't_street',
525
- // condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
526
- condition: `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
527
- }
528
- let f_address_type = this.getLableValue('地址类型')
529
-
530
- if (f_address_type === '民用市区') {
531
- // data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
532
- data.condition = `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
533
- }
534
- if (f_address_type === '民用乡镇') {
535
- // data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
536
- data.condition = `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
537
- }
538
-
539
- let http = new HttpResetClass()
540
- let res = await http.load(
541
- 'POST',
542
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
543
- {data: data},
544
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
545
- )
546
-
547
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
548
- return {
549
- label: item.f_street,
550
- value: item.f_street
551
- }
552
- }))
553
- },
554
- async addressInitialization () {
555
- //this.$getConfig(this, 'UserAddress')
556
- //获取地址配置文件
557
- try {
558
- let res = await new HttpResetClass().load('get',`${this.$androidUtil.getProxyUrl()}/rs/vue/UserAddress.json`,null,{resolveMsg: null, rejectMsg: null})
559
- Object.assign(this.config, res.data)
560
- } catch (error) {
561
- console.log("未获取到地址信息")
562
- }
563
- console.log("???????????不走了吗!")
564
- let f_address_type = this.show_data.f_address_type
565
-
566
- for (const item of this.show_data.fields) {
567
- if (f_address_type === '民用市区') {
568
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '小区' || item.label === '门牌号') {
569
- item.hidden = false
570
- item.required = true
571
- }
572
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
573
- item.hidden = false
574
- item.required = false
575
- }
576
- if (item.label === '地址') {
577
- item.readonly = true
578
- }
579
- }
580
- if (f_address_type === '民用乡镇') {
581
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '小区' || item.label === '门牌号') {
582
- item.hidden = false
583
- item.required = true
584
- }
585
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
586
- item.hidden = false
587
- item.required = false
588
- }
589
- if (item.label === '楼层') {
590
- item.hidden = true
591
- item.required = false
592
- }
593
- if (item.label === '地址') {
594
- item.readonly = true
595
- }
596
- }
597
- if (f_address_type === '特殊地址') {
598
- if (item.label === '区/县' || item.label === '街道/乡镇') {
599
- item.hidden = false
600
- item.required = true
601
- }
602
- if (item.label === '小区') {
603
- item.hidden = false
604
- item.required = false
605
- }
606
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
607
- item.hidden = true
608
- item.required = false
609
- }
610
- if (item.label === '地址') {
611
- item.readonly = false
612
- }
613
- }
614
-
615
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
616
- item.hidden = true
617
- }
618
- }
619
- },
620
-
621
- async checkDuplicate(index) {
622
- let http = new HttpResetClass()
623
- let data = {
624
- tablename: 't_apply',
625
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
626
- }
627
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`, {data: data}, {
628
- resolveMsg: null,
629
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
630
- })
631
- if (res.data.length > 0) {
632
- this.show_data.fields[index].value = null
633
- this.$showMessage(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
634
- }
635
- },
636
- async breakControl () {
637
- if (this.show_data.id) {
638
- let data = {
639
- condition: `u.id = ${this.show_data.id}`,
640
- data: {
641
- id: Vue.user.id,
642
- orgid: Vue.user.orgid
643
- // id: '51953',
644
- // orgid: '10101'
645
- }
646
- }
647
- let res = await this.$resetpost(
648
- `${this.$androidUtil.getProxyUrl()}/rs/sql/checkuser`,
649
- // `rs/sql/checkuser`,
650
- {data: data},
651
- {resolveMsg: null, rejectMsg: '数据更新失败,请手查询更新!!!'}
652
- )
653
-
654
- this.selectdata = res.data[0]
655
- } else {
656
- this.selectdata = servicedata
657
- }
658
-
659
- this.refurbish()
660
- },
661
- async addressTips () {
662
- let res = ''
663
- if (this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') {
664
- res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
665
- }else{
666
- res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
667
- }
668
- if (res == 'confirm') {
669
- return
670
- }
671
- throw '用户信息确认!!!'
672
- },
673
- //通气前置,添加设备
674
- async addDeviceBefore () {
675
- let http = new HttpResetClass()
676
- var condition1=`f_userinfo_id = '${this.selectdata.f_userinfo_id}'`
677
- let data = {
678
- condition: condition1
679
- }
680
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getUserFilesAndDevicesAmount`, {data:data}, {
681
- resolveMsg: null,
682
- rejectMsg: '获取表具失败!!!'
683
- })
684
- if (res.data.amount===0) {
685
- this.$showMessage('请添加设备!!!', 'warning', 3000)
686
- throw null
687
- }
688
- },
689
- // 缴费前置
690
- async chargeBefore () {
691
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
692
- this.$showMessage('费用未结清!!!', 'warning', 3000)
693
- throw null
694
- }
695
- if (this.show_data.defname === '通气施工' && this.show_data.f_apply_type === '启封通气'){
696
- let http = new HttpResetClass()
697
- let data = {
698
- condition: `ui.f_userinfo_id = '${this.show_data.f_userinfo_id}' and (uf.f_meter_classify is null or f_meternumber is null or f_meternumber='' or uf.f_gasbrand_id is null or uf.f_gasmodel_id is null )`
699
- }
700
- let res = await http.load(
701
- 'POST',
702
- `${this.$androidUtil.getProxyUrl()}/rs/sql/countApplyUserinfo`,
703
- {data: data},
704
- {
705
- resolveMsg: null,
706
- rejectMsg: '安装明细查询失败!!!'
707
- })
708
- if (res.data[0].num > 0) {
709
- this.$showMessage(`还有${res.data[0].num}户表具未安装,无法提交`, 'warning', 3000)
710
- throw `还有${res.data[0].num}户表具未安装,无法提交`
711
- }
712
- let condition1=''
713
- if(this.selectdata.f_sub_state ==='完工'){
714
- condition1=`f_userinfo_id = '${this.selectdata.f_userinfo_id}' and f_table_state='正常'`
715
- }else{
716
- condition1=`f_userinfo_id = '${this.selectdata.f_userinfo_id}' and f_table_state='待开通'`
717
- }
718
- data = {
719
- condition: condition1
720
- }
721
- let res1 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getUserFilesAndDevicesAmount`, {data:data}, {
722
- resolveMsg: null,
723
- rejectMsg: '获取设备失败!!!'
724
- })
725
- if (res1.data[0].amount < 2) {
726
- this.$showMessage(`设备必须添加2个,否则无法提交`, 'warning', 3000)
727
- throw `设备必须添加2个,否则无法提交`
728
- }
729
- }
730
- },
731
- // 施工前置
732
- async constructionBefore () {
733
- let http = new HttpResetClass()
734
- let data = {
735
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_meter_classify is null and f_meternumber is null`
736
- }
737
- let res = await http.load(
738
- 'POST',
739
- `${this.$androidUtil.getProxyUrl()}/rs/sql/countApplyUserinfo`,
740
- {data: data},
741
- {
742
- resolveMsg: null,
743
- rejectMsg: '安装明细查询失败!!!'
744
- })
745
- if (res.data[0].num > 0) {
746
- this.$showMessage(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
747
- throw `还有${res.data[0].num}户未安装,无法提交`
748
- }
749
- },
750
- changePipeBuild () {
751
- if (this.selectdata.f_process_dep === '工程部') {
752
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
753
- }
754
- if (this.selectdata.f_process_dep === '运营部') {
755
- return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
756
- }
757
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
758
- },
759
- async getPrice (f_price_id) {
760
- console.log('=======================')
761
- console.log(f_price_id)
762
-
763
- let data = {
764
- condition: `sp.f_filialeid = '${Vue.user.orgid}'`
765
- }
766
-
767
- if (!isEmpty(f_price_id)) {
768
- data.condition = `sp.f_filialeid = '${Vue.user.orgid}' and sp.f_price_id = ${f_price_id}`
769
- }
770
- let http = new HttpResetClass()
771
- let res = await http.load(
772
- 'POST',
773
- `${this.$androidUtil.getProxyUrl()}/rs/sql/applyGetPrice`,
774
- {data: data},
775
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
776
- )
777
-
778
- return res.data.map(item => {
779
- return {
780
- label: item.f_price_name,
781
- value: item
782
- }
783
- })
784
- },
785
- //获取抄表册
786
- async getMeterBook () {
787
- let data = {
788
- tablename: 't_meter_book',
789
- condition: `f_book_state='有效' `
790
- }
791
- let http = new HttpResetClass()
792
- let res = await http.load(
793
- 'POST',
794
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
795
- {data: data},
796
- {resolveMsg: null, rejectMsg: '抄表册查询失败!!!'}
797
- )
798
- return res.data.map(item => {
799
- return {
800
- label: item.f_book_name,
801
- value: item.f_book_code
802
- }
803
- })
804
- },
805
- // 获取当前分公司下拥有role角色的人员
806
- async getDesignerPeople (role) {
807
- let data = {
808
- source: 'this.getParentByType($organization$).getChildByName($'+role+'$).getChildren()',
809
- userid: Vue.user.id
810
- }
811
-
812
- let http = new HttpResetClass()
813
- let res = await http.load(
814
- 'POST',
815
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
816
- {data: data},
817
- {resolveMsg: null, rejectMsg: '人员查询失败!!!'}
818
- )
819
-
820
- return res.data.map(item => {
821
- return {
822
- label: item.name,
823
- value: item.name
824
- }
825
- })
826
- },
827
- // 获取当前分公司下拥有role角色的人员的id
828
- async getDesignerPeopleid (role) {
829
- let data = {
830
- source: 'this.getParentByType($organization$).getChildByName($'+role+'$).getChildren()',
831
- userid: Vue.user.id
832
- }
833
-
834
- let http = new HttpResetClass()
835
- let res = await http.load(
836
- 'POST',
837
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
838
- {data: data},
839
- {resolveMsg: null, rejectMsg: '人员查询失败!!!'}
840
- )
841
-
842
- return res.data.map(item => {
843
- return {
844
- label: item.name,
845
- value: item.id
846
- }
847
- })
848
- },
849
- async surveyStopApply () {
850
- console.log('终止报建!!!!!')
851
-
852
- this.show_data.f_stop_reason = '现场勘察不符合报装条件'
853
-
854
- let data = {
855
- data: this.show_data,
856
- user: Vue.user
857
- }
858
-
859
- let res = await this.$resetpost(
860
- `${this.$androidUtil.getProxyUrl()}/rs/logic/surveyStopApply`,
861
- {data: data},
862
- {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
863
- )
864
- if(res.data==200){
865
- this.$dispatch('loadPage')
866
- this.$showMessage('终止报建成功!!!')
867
- this.$back()
868
- throw '终止报建!!!'
869
- }else{
870
- this.$showMessage('终止报建失败!!!')
871
- }
872
- },
873
- async getDevInfo () {
874
- let data = {
875
- tablename: 't_dev_info',
876
- condition: `f_orgid = '${Vue.user.orgid}'`
877
- }
878
- let http = new HttpResetClass()
879
- let res = await http.load(
880
- 'POST',
881
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
882
- {data: data},
883
- {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
884
- )
885
-
886
- return res.data.map(item => {
887
- return {
888
- label: item.f_dev_name,
889
- value: item.f_dev_name
890
- }
891
- })
892
- },
893
- // 获取片区
894
- async getSliceArea () {
895
- let data = {
896
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
897
- userid: Vue.user.id
898
- }
899
-
900
- let http = new HttpResetClass()
901
- let res = await http.load(
902
- 'POST',
903
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
904
- {data: data},
905
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
906
- )
907
-
908
- return res.data.map(item => {
909
- return {
910
- label: item.name,
911
- value: item.name
912
- }
913
- })
914
- },
915
- // 获取区县
916
- async getPcd () {
917
- let data = {
918
- tablename: 't_pcd',
919
- condition: `f_filialeid = '${Vue.user.orgid}'`
920
- }
921
- let http = new HttpResetClass()
922
- let res = await http.load(
923
- 'POST',
924
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
925
- {data: data},
926
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
927
- )
928
-
929
- return res.data.map(item => {
930
- return {
931
- label: item.f_pcd,
932
- value: item.f_pcd
933
- }
934
- })
935
- },
936
- //收费时添加 预算的 流程节点,如果 当前节点费用未 缴清, 不能进行下一步流程
937
- async confirmBefore() {
938
- var defname = this.show_data.defname
939
- var processId = this.show_data.f_process_id
940
- let data = {
941
- condition: `tc.f_process_id = '${processId}' and tc.defname = '${defname}'`
942
- }
943
- let http = new HttpResetClass()
944
- let res = await http.load(
945
- 'POST',
946
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getPaymentRatio`,
947
- {data: data},
948
- {resolveMsg: null, rejectMsg: '查询失败!!!'}
949
- )
950
- if(res.data.length!==0){
951
- var f_due_money= res.data[0].f_due_money
952
- var cumulative= res.data[0].f_charge_money
953
- if (Number(f_due_money) > Number(cumulative)) {
954
- this.$showMessage(`当前${defname}环节,应缴金额为:${f_due_money},费用未结清`, 'warning', 3000)
955
- throw null
956
- }
957
- }
958
- let res1 = await http.load(
959
- 'POST',
960
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getfeeconfirmation`,
961
- {data: data},
962
- {resolveMsg: null, rejectMsg: '查询失败!!!'}
963
- )
964
- for (let i =0;i<res1.data.length;i++){
965
- if (isEmpty(res1.data[i].f_confirm_person)){
966
- this.$showMessage(`当前${defname}环节,费用未收费确认,请仔细检查并点击保存`, 'warning', 3000)
967
- throw null
968
- }
969
- }
970
- if (defname=='合同签订'){
971
- let num = 0
972
- let data = {
973
- condition: `f_process_id = '${this.selectdata.f_process_id}'`
974
- }
975
- let res1 = await new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getContractCharge`, {data: data}
976
- , {resolveMsg: null, rejectMsg: null})
977
- if (res1.data.length > 0){
978
- for (let i= 0; i<res1.data.length;i++){
979
- num += parseInt(res1.data[i].f_payment_ratio)
980
- }
981
- }
982
- if (num!=100){
983
- this.$showMessage(`当前${defname}环节,缴费比例必须设置为100%!!`, 'warning', 3000)
984
- throw null
985
- }
986
- }
987
- },
988
-
989
- },
990
- events: {
991
- 'complyInstallation' (index) {
992
- if (this.show_data.f_is_have === '否') {
993
- this.hideButtons('提交', '出图', '缴费')
994
- this.showButtons('终止')
995
- }
996
- if (this.show_data.f_is_have === '是') {
997
- this.hideButtons('终止')
998
- this.showButtons('提交', '出图', '缴费')
999
- }
1000
- },
1001
- async 'igniteDispatchReadyEvent' () {
1002
- let data = {
1003
- tablename: 'activityins',
1004
- condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
1005
- }
1006
- let http = new HttpResetClass()
1007
- let res = await http.load(
1008
- 'POST',
1009
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
1010
- {data: data},
1011
- {resolveMsg: null, rejectMsg: '查询失败!!!'}
1012
- )
1013
- if (res.data.length <= 0) {
1014
- console.log('+++++++++++++++++++++++++++++')
1015
- console.log('没有施工,不能退回')
1016
- this.hideButtons('退回')
1017
- }
1018
- },
1019
- 'breakControl' (val) {
1020
- this.breakControl(val)
1021
- },
1022
- // 检查重复
1023
- 'checkRepeat' (index) {
1024
- this.checkDuplicate(index)
1025
- },
1026
- 'buildReadyEvent' () {
1027
- this.setLabelValue('施工单位', Vue.user.name)
1028
- this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
1029
- },
1030
- // 选择材料
1031
- async materialNameChenge (index, fieldIndex) {
1032
- let material = this.show_data.onetomany[index].fields[fieldIndex].value
1033
-
1034
- this.show_data.onetomany[index].fields.forEach(item => {
1035
- if (material[item.field]) {
1036
- item.value = material[item.field]
1037
- }
1038
- })
1039
- },
1040
- // 打开模态框获取材料
1041
- async 'getMaterialName' (index) {
1042
- let data = {
1043
- condition: `1=1`
1044
- }
1045
- let http = new HttpResetClass()
1046
- let res = await http.load(
1047
- 'POST',
1048
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getStockMaterial`,
1049
- {data: data},
1050
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
1051
- )
1052
-
1053
- this.show_data.onetomany[index].fields.forEach(field => {
1054
- if (field.label === '选择材料') {
1055
- field.options = res.data.map(item => {
1056
- return {
1057
- 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
1058
- 'value': item
1059
- }
1060
- })
1061
- }
1062
- })
1063
- },
1064
- // 选择气价
1065
- 'priceChange' (index) {
1066
- if (isEmpty(this.show_data.stairPrice)) {
1067
- return
1068
- }
1069
-
1070
- let stairPrice = this.getLableValue('气价名称')
1071
-
1072
- this.setLabelValue('气价类型', stairPrice.f_price_type)
1073
- this.setLabelValue('用气性质', stairPrice.f_gasproperties)
1074
- this.setLabelValue('价格', stairPrice.f_price)
1075
- this.setLabelValue('客户类型', stairPrice.f_user_type)
1076
- this.show_data.f_price_id = stairPrice.id
1077
- this.show_data.f_price_name = stairPrice.f_price_name
1078
- },
1079
- // 是否购买保险
1080
- isInsureChange (index) {
1081
- let f_is_insure = this.getLableValue('是否购买保险')
1082
- for (const item of this.show_data.fields) {
1083
- if (f_is_insure === '是') {
1084
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1085
- item.hidden = false
1086
- item.required = true
1087
- }
1088
- if (item.label === '保险备注') {
1089
- item.hidden = false
1090
- }
1091
- } else {
1092
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1093
- item.hidden = true
1094
- item.required = false
1095
- }
1096
- }
1097
- }
1098
- },
1099
- // 通气点火初始化
1100
- async 'gasReadyEvent' () {
1101
- console.log('----通气点火初始化----')
1102
- if (!isEmpty(this.show_data.f_price_id)) {
1103
- let priceList = await this.getPrice(this.show_data.f_price_id)
1104
- this.setLabelValue('气价名称', priceList[0].value)
1105
- }
1106
-
1107
- let data = {
1108
- tablename: 't_userfees',
1109
- condition: `f_orgid = '${Vue.user.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
1110
- }
1111
-
1112
- console.log('---------查询是否有待执行保险-----------')
1113
- let http = new HttpResetClass()
1114
- let res = await http.load(
1115
- 'POST',
1116
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
1117
- {data: data},
1118
- {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
1119
- )
1120
- if (res.data.length > 0) {
1121
- console.log('----------具有待执行保险------------')
1122
- this.setLabelValue('待执行保险', '是')
1123
- for (const item of this.show_data.fields) {
1124
- if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1125
- item.hidden = true
1126
- item.required = false
1127
- item.value = null
1128
- }
1129
- }
1130
- console.log('----------具有待执行保险------------')
1131
- } else {
1132
- console.log('----------不有待执行保险------------')
1133
- this.setLabelValue('待执行保险', '否')
1134
- for (const item of this.show_data.fields) {
1135
- if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1136
- item.hidden = false
1137
- item.required = true
1138
- }
1139
- }
1140
- console.log('----------具有待执行保险------------')
1141
- }
1142
-
1143
- // 初始化显示内容
1144
- let f_is_insure = this.getLableValue('是否购买保险')
1145
- for (const item of this.show_data.fields) {
1146
- if (f_is_insure === '是') {
1147
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1148
- item.hidden = false
1149
- item.required = true
1150
- }
1151
- if (item.label === '保险备注') {
1152
- item.hidden = false
1153
- }
1154
- // 本期保费到期时间默认一年
1155
- if (isEmpty(this.selectdata.f_ins_expiration_date)) {
1156
- let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
1157
- this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
1158
- }
1159
- }
1160
- if (f_is_insure === '否') {
1161
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1162
- item.hidden = true
1163
- item.required = false
1164
- }
1165
- }
1166
- }
1167
- },
1168
- // 合同金额失去焦点
1169
- async 'contractMoneyChange' (index) {
1170
- let yingjiao = parseFloat(
1171
- parseFloat(this.show_data.f_contract_money || 0 ).toFixed(2) +
1172
- parseFloat(this.getLableValue('追加金额') || 0 ).toFixed(2)
1173
-
1174
- ).toFixed(2)
1175
- let leiji = parseFloat(this.getLableValue('累计缴费金额') || 0 ).toFixed(2)
1176
- let weijie = parseFloat(yingjiao - leiji ).toFixed(2)
1177
- let fkbl = parseFloat(leiji/yingjiao).toFixed(2) * 100 + "%"
1178
- this.setLabelValue('应交金额', yingjiao)
1179
- this.setLabelValue('累计缴费金额', leiji)
1180
- this.setLabelValue('未结总金额', weijie)
1181
- this.setLabelValue('付款比列', fkbl)
1182
- },
1183
- //报建性质改变合同类型
1184
- 'changehetong'(index){
1185
- let nextindex = parseInt(index) + 1
1186
- this.setLabelValue(this.show_data.fields[nextindex].label, this.$appdata.getSingleValue(this.show_data.fields[index].value)?this.$appdata.getSingleValue(this.show_data.fields[index].value):'')
1187
- },
1188
- //合同类型改变合同代码
1189
- 'contracttypes'(index){
1190
- let num = ''
1191
- if (this.show_data.fields[index].value == '民用合同' && this.show_data.f_apply_type == '民用散户报建流程'){
1192
- num = 'MS'
1193
- }else if (this.show_data.fields[index].value == '民用合同' && this.show_data.f_apply_type != '民用散户报建流程'){
1194
- num = 'MD'
1195
- }else if (this.show_data.fields[index].value == '工业合同' ){
1196
- num = 'GY'
1197
- }else if (this.show_data.fields[index].value == '商业合同' ){
1198
- num = 'SK'
1199
- }else if (this.show_data.fields[index].value == '整改合同' ){
1200
- num = 'RZ'
1201
- }else if (this.show_data.fields[index].value == '公福合同' ){
1202
- num = 'GA'
1203
- }else if (this.show_data.fields[index].value == '内投合同' ){
1204
- num = 'NT'
1205
- }
1206
- this.setLabelValue('性质代码', num)
1207
- },
1208
- // ===========================================
1209
- async 'button'() {
1210
- if (this.show_data.button.before) {
1211
- await this[this.show_data.button.before]()
1212
- }
1213
- // 点击重置按钮就重置数据
1214
- if (this.show_data.button.button_name === '重置') {
1215
- this.$dispatch('breakControl', this.selectdata)
1216
- return
1217
- }
1218
-
1219
- this.show_data.user = Vue.user
1220
- this.show_data.start_activity = this.json_datas.start_activity
1221
- this.show_data.xmlfilename = this.json_datas.workflow_xmlfilename
1222
-
1223
-
1224
- if (((this.show_data.defname === '工程审批' && (this.show_data.f_apply_type === '民用散户报建流程'|| this.show_data.f_apply_type === '民用预留户报建流程'))|| (this.show_data.defname === '工程决算')) && this.show_data.button.button_name === '提交' && this.show_data.f_payment_ratio == "100%"){
1225
- this.show_data.button.button_name = '跳过'
1226
- }
1227
- if (this.show_data.defname === '通气申请' && this.show_data.f_apply_type === '启封通气'&& this.show_data.button.button_name === '提交' && this.show_data.f_apply_source !== '线下发起' && this.show_data.f_apply_nature !== '预留户'){
1228
- this.show_data.button.button_name = '跳过'
1229
- }
1230
- if(this.show_data.defname === '工程派工' && this.show_data.button.button_name === '提交'){
1231
- this.show_data.f_budget_peoples = []
1232
- for (const item of this.show_data.fields) {
1233
- if (item.label === '施工人') {
1234
- for (let row of item.optionsid){
1235
- item.value.forEach(item => {
1236
- if (item === row.label) {
1237
- this.show_data.f_budget_peoples.push({
1238
- label: row.label,
1239
- value: row.value
1240
- })
1241
- }
1242
- })
1243
- }
1244
- }
1245
- }
1246
- }
1247
- if(this.show_data.defname === '工程验收' && this.show_data.button.button_name === '提交'){
1248
- this.show_data.acceptances = await this.getDesignerPeopleid('报装验收审批')
1249
- }
1250
- if(this.show_data.f_apply_type != '验收审批' && this.show_data.defname === '验收审批' && this.show_data.button.button_name === '提交'){
1251
- const http = new HttpResetClass()
1252
- let data = {
1253
- tablename: 't_apply',
1254
- condition: `f_parent_process_id = '${this.show_data.f_process_id}' and f_apply_type = '验收审批' and f_sub_state != '完工'`
1255
- }
1256
- const res = await http.load('post',`${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,{data: data},{rejectMsg:null,resolveMsg:null})
1257
- if (res.data.length > 0){
1258
- this.$showMessage('该报建单子下还有未完工的验收审批流程,无法提交!!!')
1259
- return
1260
- }
1261
- }
1262
- let res = await this.$resetpost(
1263
- `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyProductService`,
1264
- {data: this.show_data},
1265
- {resolveMsg: null, rejectMsg: '数据保存失败'}
1266
- )
1267
- if(this.show_data.f_apply_type == '验收审批' && this.show_data.defname === '验收审批' && this.show_data.button.button_name === '提交'){
1268
- const http = new HttpResetClass()
1269
- let data = {
1270
- tablename: 't_apply',
1271
- condition: `f_parent_process_id = '${this.show_data.f_parent_process_id}' and f_apply_type = '验收审批' and f_sub_state != '完工'`
1272
- }
1273
- await http.load('post',`${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,{data: data},{rejectMsg:null,resolveMsg:null}).then( res=>{
1274
- if (res.data.length == 0){
1275
- http.load('post',`${this.$androidUtil.getProxyUrl()}/rs/sql/checkuser`,{data: {condition:` f_process_id= '${this.show_data.f_parent_process_id}'`, data: {id: Vue.user.id,orgid: Vue.user.orgid}}},{resolveMsg:null,rejectMsg:null}).then(row=>{
1276
- const show_data = row.data[0]
1277
- show_data.user = Vue.user
1278
- show_data.start_activity ='报装申请'
1279
- show_data.xmlfilename = show_data.f_apply_type
1280
- show_data.button = {button_name:'提交'}
1281
- show_data.tables = ["t_apply"]
1282
- this.$resetpost(
1283
- `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyProductService`,
1284
- {data: show_data},
1285
- {resolveMsg: null, rejectMsg: null}
1286
- )
1287
- })
1288
- }
1289
- })
1290
- }
1291
-
1292
- if (this.show_data.button.after) {
1293
- this[this.show_data.button.after]()
1294
- }
1295
- this.$dispatch('confirm')
1296
- },
1297
- // 失去焦点出触发事件
1298
- 'onchange' (index) {
1299
- if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1300
-
1301
- if (
1302
- this.show_data.fields[index].label === '区/县' ||
1303
- this.show_data.fields[index].label === '街道/乡镇' ||
1304
- this.show_data.fields[index].label === '小区' ||
1305
- this.show_data.fields[index].label === '楼号/组' ||
1306
- this.show_data.fields[index].label === '单元/排' ||
1307
- this.show_data.fields[index].label === '楼层' ||
1308
- this.show_data.fields[index].label === '门牌号'
1309
- ) {
1310
- let f_pcd = this.getLableValue('区/县') || ''
1311
- let f_street = this.getLableValue('街道/乡镇') || ''
1312
- let f_residential_area = this.getLableValue('小区') || ''
1313
- let f_building = this.getLableValue('楼号/组') || ''
1314
- let f_building_suffix = f_building ? '号楼' : ''
1315
- let f_unit = this.getLableValue('单元/排') || ''
1316
- let f_unit_suffix = f_unit ? '单元' : ''
1317
- let f_floor = this.getLableValue('楼层') || ''
1318
- let f_floor_suffix = f_floor ? '层' : ''
1319
- let f_room = this.getLableValue('门牌号') || ''
1320
- let f_room_suffix = f_room ? '' : ''
1321
-
1322
- let f_address = f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
1323
- this.setLabelValue("地址", f_address)
1324
- }
1325
- }
1326
- },
1327
- async 'getDesignerPeople' () {
1328
- let data = {
1329
- source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
1330
- userid: Vue.user.id
1331
- }
1332
-
1333
- let http = new HttpResetClass()
1334
- let res = await http.load(
1335
- 'POST',
1336
- `rs/search`,
1337
- {data: data},
1338
- {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
1339
- )
1340
-
1341
- return res.data.map(item => {
1342
- return {
1343
- label: item.name,
1344
- value: item.id
1345
- }
1346
- })
1347
- },
1348
- // 申请节点初始化
1349
- 'applyReadyEvent' () {
1350
- this.addressInitialization()
1351
-
1352
- this.pcdChange()
1353
- this.streetChange()
1354
- },
1355
- // 街道失去焦点
1356
- async 'streetChange' (index) {
1357
- if (isEmpty(this.show_data.f_street)) {
1358
- return
1359
- }
1360
-
1361
- this.setLabelValue('小区', null)
1362
-
1363
- let data = {
1364
- tablename: 't_area',
1365
- condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}'`
1366
- }
1367
- let http = new HttpResetClass()
1368
- let res = await http.load(
1369
- 'POST',
1370
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
1371
- {data: data},
1372
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
1373
- )
1374
-
1375
- this.setLabelOptions('小区', res.data.map(item => {
1376
- return {
1377
- label: item.f_residential_area,
1378
- value: item.f_residential_area
1379
- }
1380
- }))
1381
- },
1382
- // 选择报建项目
1383
- 'selectApply' (row) {
1384
- this.setLabelValue('工程名称', row.f_entry_name)
1385
- this.setLabelValue('工程编号', row.f_apply_num)
1386
- this.setLabelValue('报建类型', row.f_apply_type)
1387
- this.setLabelValue('用户名称', row.f_user_name)
1388
- this.setLabelValue('用户电话', row.f_phone)
1389
- this.setLabelValue('证件类型', row.f_credentials)
1390
- this.setLabelValue('证件号码', row.f_idnumber)
1391
- this.setLabelValue('地址', row.f_address)
1392
- this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
1393
-
1394
- this.show_data.parentApply = JSON.parse(JSON.stringify(row))
1395
-
1396
- delete row.id
1397
- delete row.actid
1398
- delete row.defid
1399
- delete row.defname
1400
- delete row.version
1401
- delete row.f_apply_num
1402
- delete row.f_sub_state
1403
- delete row.f_apply_type
1404
- delete row.f_process_id
1405
-
1406
- this.show_data = Object.assign({}, this.show_data, row)
1407
-
1408
- this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
1409
- },
1410
- // 区县失去焦点
1411
- async 'pcdChange' (index) {
1412
- if (isEmpty(this.show_data.f_pcd)) {
1413
- return
1414
- }
1415
-
1416
- this.setLabelValue('街道/乡镇', null)
1417
- this.setLabelValue('小区', null)
1418
-
1419
-
1420
-
1421
- let data = {
1422
- tablename: 't_street',
1423
- condition: `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1424
- }
1425
- let f_address_type = this.getLableValue('地址类型')
1426
-
1427
- if (f_address_type === '民用市区') {
1428
- data.condition = `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1429
- }
1430
- if (f_address_type === '民用乡镇') {
1431
- data.condition = `f_filialeid = '${Vue.user.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1432
- }
1433
-
1434
- let http = new HttpResetClass()
1435
- let res = await http.load(
1436
- 'POST',
1437
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
1438
- {data: data},
1439
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1440
- )
1441
-
1442
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
1443
- return {
1444
- label: item.f_street,
1445
- value: item.f_street
1446
- }
1447
- }))
1448
- },
1449
- // 选择用户档案信息
1450
- 'selectUserinfo' (row) {
1451
- this.setLabelValue('用户编号', row.f_userinfo_code)
1452
- this.setLabelValue('用户名称', row.f_user_name)
1453
- this.setLabelValue('用户电话', row.f_user_phone)
1454
- this.setLabelValue('证件类型', row.f_credentials)
1455
- this.setLabelValue('证件号码', row.f_idnumber)
1456
- this.setLabelValue('地址', row.f_address)
1457
-
1458
- this.show_data.f_userinfo_id = row.f_userinfo_id
1459
- this.show_data.f_userinfo_code = row.f_userinfo_code
1460
- },
1461
- // 地址类型失去焦点
1462
- 'addressTypeChange' (index) {
1463
- this.setLabelValue('街道/乡镇', null)
1464
- this.setLabelValue('小区', null)
1465
- let f_address_type = this.show_data.fields[index].value
1466
- for (const item of this.show_data.fields) {
1467
- if (f_address_type === '民用市区') {
1468
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '小区' || item.label === '门牌号') {
1469
- item.hidden = false
1470
- item.required = true
1471
- item.value = null
1472
- }
1473
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1474
- item.hidden = false
1475
- item.required = false
1476
- item.value = null
1477
- }
1478
- if (item.label === '地址') {
1479
- item.readonly = true
1480
- item.value = null
1481
- }
1482
- }
1483
- if (f_address_type === '民用乡镇') {
1484
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '小区' || item.label === '门牌号') {
1485
- item.hidden = false
1486
- item.required = true
1487
- item.value = null
1488
- }
1489
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1490
- item.hidden = false
1491
- item.required = false
1492
- item.value = null
1493
- }
1494
- if (item.label === '楼层') {
1495
- item.hidden = true
1496
- item.required = false
1497
- item.value = null
1498
- }
1499
- if (item.label === '地址') {
1500
- item.readonly = true
1501
- item.value = null
1502
- }
1503
- }
1504
- if (f_address_type === '特殊地址') {
1505
- if (item.label === '区/县' || item.label === '街道/乡镇') {
1506
- item.hidden = false
1507
- item.required = true
1508
- item.value = null
1509
- }
1510
- if (item.label === '小区') {
1511
- item.hidden = false
1512
- item.required = false
1513
- item.value = null
1514
- }
1515
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1516
- item.hidden = true
1517
- item.required = false
1518
- item.value = null
1519
- }
1520
- if (item.label === '地址') {
1521
- item.readonly = false
1522
- item.value = null
1523
- }
1524
- }
1525
- }
1526
- },
1527
- // 搜索小区
1528
- async 'searchArea' (area, index) {
1529
- let data = {
1530
- tablename: 't_area',
1531
- condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1532
- }
1533
- let http = new HttpResetClass()
1534
- let res = await http.load(
1535
- 'POST',
1536
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
1537
- {data: data},
1538
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
1539
- )
1540
-
1541
- if (res.data.length === 0) {
1542
- return
1543
- }
1544
-
1545
- this.setLabelOptions('小区', res.data.map(item => {
1546
- return {
1547
- label: item.f_residential_area,
1548
- value: item.f_residential_area
1549
- }
1550
- }))
1551
- },
1552
- // 搜索小区
1553
- async 'searchAreaCollective' (area, index) {
1554
- let data = {
1555
- tablename: 't_area',
1556
- condition: `f_filialeid = '${Vue.user.orgid}' and f_residential_area like '%${area}%'`
1557
- }
1558
- let http = new HttpResetClass()
1559
- let res = await http.load(
1560
- 'POST',
1561
- `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
1562
- {data: data},
1563
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
1564
- )
1565
-
1566
- if (res.data.length === 0) {
1567
- return
1568
- }
1569
-
1570
- this.setLabelOptions('小区', res.data.map(item => {
1571
- return {
1572
- label: item.f_residential_area,
1573
- value: item.f_residential_area
1574
- }
1575
- }))
1576
- },
1577
- // 团购转散户初始化
1578
- 'apply2ReadyEvent' () {
1579
- if (this.show_data.f_apply_source === '线下发起') {
1580
- this.addressInitialization()
1581
- this.hideLabels('用户编号')
1582
- this.electiveLabels('用户编号')
1583
- this.showLabels('片区', '地址类型')
1584
- this.requiredLabels('片区', '地址类型')
1585
- }
1586
- if (this.show_data.f_apply_source === '自动发起') {
1587
- this.hideLabels('片区', '地址类型')
1588
- this.electiveLabels('片区', '地址类型',)
1589
- }
1590
- },
1591
- 'onblur' (index) {},
1592
- 'oninput' (index) {},
1593
- 'initializtionView' () {},
1594
- async 'onchangeModal' (index, fieldIndex) {
1595
- },
1596
- async 'onblurModal' (index, fieldIndex) {
1597
-
1598
- },
1599
- async 'oninputModal' (index, fieldIndex) {
1600
-
1601
- },
1602
- async 'onetomanydelete' (index, rowIndex) {
1603
-
1604
- let http = new HttpResetClass()
1605
-
1606
- let res = await http.load(
1607
- 'DELETE',
1608
- `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1609
- null,
1610
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
1611
- )
1612
- res = await this.$resetpost(
1613
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1614
- this.show_data
1615
- )
1616
- this.breakControl()
1617
- },
1618
- async 'onetomanyupdate' (index, rowIndex) {
1619
- let data = this.show_data.onetomany[index].rows[rowIndex]
1620
-
1621
- this.show_data.onetomany[index].fields.forEach(item => {
1622
- data[item.field] = item.value
1623
- })
1624
- let res = await this.$resetpost(
1625
- `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1626
- data
1627
- )
1628
- res = await this.$resetpost(
1629
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1630
- this.show_data
1631
- )
1632
- this.breakControl()
1633
- },
1634
- async 'onetomanyadd' (index) {
1635
- let data = {
1636
- f_process_id : this.show_data.f_process_id,
1637
- f_operator_id: Vue.user.id,
1638
- f_operator: Vue.user.name,
1639
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1640
- f_orgid: Vue.user.orgid,
1641
- f_orgname: Vue.user.orgs
1642
- }
1643
- this.show_data.onetomany[index].fields.forEach(item => {
1644
- data[item.field] = item.value
1645
- })
1646
- let res = await this.$resetpost(
1647
- `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1648
- data
1649
- )
1650
- res = await this.$resetpost(
1651
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1652
- this.show_data
1653
- )
1654
- this.breakControl()
1655
- },
1656
- 'onbutchange' (index) {
1657
-
1658
- },
1659
- 'onbutblur' (index) {
1660
-
1661
- },
1662
- 'onbutinput' (index) {
1663
-
1664
- },
1665
- 'changeShowfei' (val) {
1666
- console.log('回调修改父组件属性----'+val)
1667
- this.show_data.showfei=val
1668
- }
1669
- },
1670
- watch: {
1671
- /*async 'show_data.showfei' (val) {
1672
- console.log(`支付成功!!!!!!${val}`)
1673
- if(this.show_data.showfei=='已付款'){
1674
- await this.buttonCommit()
1675
- }
1676
- }*/
1677
- }
1678
- }
1679
- </script>
1680
- <style scoped>
1681
- </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="true" type="primary">
5
+ <work-busy :is-busy="excessive"></work-busy>
6
+ <app-service-view v-ref:serviceview :data="show_data" v-if="showview"></app-service-view>
7
+ </panel>
8
+ <panel header="拍照" :is-open="false" type="primary" v-if="selectdata.f_process_id">
9
+ <app-take-pic :blobid="selectdata.f_process_id" :defname="selectdata.defname" :isdelete="true" :istakepic="true" :istype="true"></app-take-pic>
10
+ </panel>
11
+ <panel header="签字" :is-open="false" type="primary" v-if="selectdata.f_process_id">
12
+ <app-sign :blobid="selectdata.f_process_id" :defname="selectdata.defname" @sign-success="signSuccess" :file-path="selectdata.f_process_id"@sign-clean="signClean"></app-sign>
13
+ </panel>
14
+ <panel header="附件" :is-open="false" type="primary" v-if="selectdata.f_process_id">
15
+ <app-upload :blobid="selectdata.f_process_id" :pblobid="selectdata.f_parent_process_id" :isdelete="true" :defname="selectdata.defname"></app-upload>
16
+ </panel>
17
+ </accordion>
18
+ </div>
19
+ </template>
20
+ <script>
21
+ import Vue from 'vue'
22
+ import {HttpResetClass} from 'vue-client'
23
+ import {isEmpty} from "../../../components/Util";
24
+ // Date格式化
25
+ Date.prototype.Format = function (fmt) {
26
+ var o = {
27
+ 'M+': this.getMonth() + 1, // 月份
28
+ 'd+': this.getDate(), // 日
29
+ 'H+': this.getHours(), // 小时
30
+ 'm+': this.getMinutes(), // 分
31
+ 's+': this.getSeconds(), // 秒
32
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
33
+ 'S': this.getMilliseconds() // 毫秒
34
+ }
35
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
36
+ for (var k in o) {
37
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
38
+ }
39
+ return fmt
40
+ }
41
+ export default {
42
+ title: '报建流程业务控制层',
43
+ props: ['selectdata'],
44
+ data () {
45
+ return {
46
+ json_datas: null,
47
+ data: null,
48
+ show_data: null,
49
+ showview: false,
50
+ config: {},
51
+ excessive:false
52
+ }
53
+ },
54
+ ready () {
55
+ this.refurbish()
56
+ },
57
+ methods: {
58
+ //阳春博能
59
+ //收费确认环节,如果有未确认的收费, 不能进行下一步
60
+ async confirmCharges() {
61
+ var processId = this.show_data.f_process_id
62
+ let data = {
63
+ condition: `f_process_id = '${processId}'`
64
+ }
65
+ let http = new HttpResetClass()
66
+ let res = await http.load(
67
+ 'POST',
68
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/confirmCharges`,
69
+ {data: data},
70
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
71
+ )
72
+ if (res.data.length !== 0) {
73
+ var total = res.data[0].total //总收费记录
74
+ var confirmtotal = res.data[0].confirmtotal //确认收费记录
75
+ var num = Number(total) - Number(confirmtotal)
76
+ if (Number(total) > Number(confirmtotal)) {
77
+ this.$showMessage(`有${num}条收费记录未确认收款,请确认`, 'warning', 3000)
78
+ throw null
79
+ }
80
+ }
81
+ },
82
+ async refurbish() {
83
+ let data = {
84
+ workname: this.selectdata.processname
85
+ }
86
+
87
+ let res = await this.$resetpost(
88
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyGetConfigs`,
89
+ {data: data},
90
+ {resolveMsg: null, rejectMsg: '配置数据获取失败!!!'}
91
+ )
92
+
93
+ this.json_datas = res.data
94
+
95
+ let sum = 0
96
+ let jsonData = {}
97
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
98
+ this.$showMessage("网络故障,请刷新页面")
99
+ return
100
+ }
101
+ this.json_datas.activitys.forEach(item => {
102
+ if (this.selectdata.defname === item.title) {
103
+ jsonData = item // 拿到当前节点的json配置信息
104
+ sum++ // 节点名一样的个数
105
+ }
106
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
107
+ })
108
+
109
+ if (sum === 0) {
110
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
111
+ return
112
+ }
113
+ if (sum > 1) {
114
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
115
+ return
116
+ }
117
+
118
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
119
+
120
+ // fields 字段填充值
121
+ for (const item of this.selectdata.fields) {
122
+ if (!item.value) {
123
+ item.value = null
124
+ }
125
+
126
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
127
+ if (item.eval) {
128
+ let user = Vue.user
129
+ // 将PC用户信息 替换成 APP的
130
+ item.value = eval(item.default.replace('this.$login.f', 'user'))
131
+ } else {
132
+ item.value = item.default
133
+ }
134
+ }
135
+
136
+ if (this.selectdata[item.field]) {
137
+ // 将json字符串格式化赋值给value
138
+ if (String(this.selectdata[item.field]).startsWith("{")) {
139
+ item.value = JSON.parse(this.selectdata[item.field])
140
+ } else {
141
+ item.value = this.selectdata[item.field]
142
+ }
143
+ }
144
+ if (this.selectdata[item.field] === 0) {
145
+ item.value = 0
146
+ }
147
+
148
+ // datepicker
149
+ if (item.type === 'datepicker' && !item.value && item.default) {
150
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
151
+ }
152
+
153
+ // 如果配置类型为select,优先从参数列表获取options
154
+ if (item.type === 'select' || item.type === 'checkbox') {
155
+ if (item.param) {
156
+ let temp = this.$appdata.getParam(item.label)
157
+
158
+ if (temp && temp.length > 0) {
159
+ item.options = temp
160
+ }
161
+
162
+ if (item.paramLabel) {
163
+ temp = this.$appdata.getParam(item.paramLabel)
164
+ if (temp && temp.length > 0) {
165
+ item.options = temp
166
+ }
167
+ }
168
+ }
169
+ console.log("item.ready"+item.ready)
170
+ if (item.ready) {
171
+ console.log(item.ready)
172
+ item.options = await this[item.ready]()
173
+
174
+ }
175
+ if (!isEmpty(item.role)){
176
+ console.log('获取对应角色的人员信息',item.role)
177
+ item.options = await this.getDesignerPeople(item.role)
178
+ item.optionsid = await this.getDesignerPeopleid(item.role)
179
+ }
180
+ if (item.multiple && !isEmpty(this.selectdata[item.field])){
181
+ this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
182
+ item.value = JSON.parse(item.value)
183
+ }
184
+ }
185
+
186
+
187
+ if (item.type === 'checkbox') {
188
+ if (this.selectdata[item.field]) {
189
+ item.value = JSON.parse(this.selectdata[item.field])
190
+ } else {
191
+ item.value = []
192
+ }
193
+ }
194
+
195
+ this.selectdata[item.field] = item.value
196
+ }
197
+
198
+ // 控制组件
199
+ if (this.selectdata.components) {
200
+ this.selectdata.components.forEach(item => {
201
+ if (!item.mark) {
202
+ item.mark = 0
203
+ }
204
+ })
205
+ }
206
+
207
+ // 初始化onetomany
208
+ if (this.selectdata.onetomany) {
209
+ for (const item of this.selectdata.onetomany) {
210
+ let res = null
211
+ if (item.queryEvent) {
212
+ res = this[item.queryEvent]()
213
+ } else {
214
+ let http = new HttpResetClass()
215
+ let data = {
216
+ tablename: item.tables[0],
217
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
218
+ }
219
+ res = await http.load(
220
+ 'POST',
221
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
222
+ // `rs/sql/apply_singleTable`,
223
+ {data: data},
224
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
225
+ )
226
+ }
227
+
228
+ item.rows = res.data
229
+
230
+ // 初始化onetomany中的fields
231
+ for (const field of item.fields) {
232
+ if (!field.value) {
233
+ if (field.value !== 0) {
234
+ field.value = null
235
+ }
236
+ }
237
+
238
+ if (field.default || field.default === 0) {
239
+ field.value = field.default
240
+ }
241
+
242
+ // datepicker
243
+ if (field.type === 'datepicker' && !field.value && field.default) {
244
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
245
+ }
246
+
247
+ if (field.type === 'select') {
248
+
249
+ if (field.param) {
250
+ let temp = this.$appdata.getParam(field.label)
251
+
252
+ if (temp && temp.length > 0) {
253
+ field.options = temp
254
+ }
255
+
256
+ if (field.paramLabel) {
257
+ temp = this.$appdata.getParam(field.paramLabel)
258
+ if (temp && temp.length > 0) {
259
+ item.options = temp
260
+ }
261
+ }
262
+ }
263
+
264
+ }
265
+ }
266
+ }
267
+ }
268
+
269
+ // 初始化 buttons_fields
270
+ for (const item of this.selectdata.buttons) {
271
+ if (item.button_name === '下发') {
272
+ let data = {
273
+ source: item.source,
274
+ userid: Vue.user.id
275
+ // userid: '51953'
276
+ }
277
+ if (item.sourceMethod) {
278
+ data.source = this[item.sourceMethod]()
279
+ }
280
+ if (!data.source) {
281
+ this.$showMessage("请配置获取人员表达式")
282
+ return
283
+ }
284
+ let res = await this.$resetpost(
285
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
286
+ // `rs/search`,
287
+ {data: data},
288
+ {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
289
+ )
290
+
291
+ let options = res.data.map(source => {
292
+ return {
293
+ "label": source.name,
294
+ "value": source.id
295
+ }
296
+ })
297
+
298
+ if (item.button_fields.length !== 1) {
299
+ this.$showMessage("下发有且只能有一个字段!!!")
300
+ return
301
+ }
302
+
303
+ item.button_fields[0].options = options
304
+ }
305
+ if (item.button_fields) {
306
+ item.button_fields.forEach(x => {
307
+ // 如果配置类型为select,优先从参数列表获取options
308
+ if (x.type === 'select') {
309
+
310
+ if (x.param) {
311
+ let temp = this.$appdata.getParam(x.label)
312
+
313
+ if (temp && temp.length > 0) {
314
+ x.options = temp
315
+ }
316
+
317
+ if (x.paramLabel) {
318
+ temp = this.$appdata.getParam(x.paramLabel)
319
+ if (temp && temp.length > 0) {
320
+ x.options = temp
321
+ }
322
+ }
323
+ }
324
+
325
+ }
326
+ })
327
+ }
328
+ }
329
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
330
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
331
+ this.show_data = temp
332
+ /*for (const item of this.show_data.fields) {
333
+ if(item.label=='气价名称' && !isEmpty(this.show_data.f_price_name)){
334
+ item.options.forEach(x=>{
335
+ if(x.label==this.show_data.f_price_name){
336
+ item.value=x.value
337
+ }
338
+ })
339
+ }
340
+ }*/
341
+ if(!this.show_data.showfei){
342
+ this.$set('show_data.showfei', '未收费')
343
+ }
344
+ //this.show_data.showfei=false
345
+
346
+ this.$nextTick(() => {
347
+ this.showview = true
348
+ })
349
+ },
350
+ signClean () {
351
+ this.selectdata.f_construction_sign = null
352
+ },
353
+ signSuccess (fileUrl) {
354
+ console.log('==============签字回调==================')
355
+ console.log(fileUrl)
356
+ this.selectdata.f_construction_sign = fileUrl
357
+ },
358
+ // 金额转大写
359
+ smalltoBIG(n) {
360
+ let fraction = ['角', '分'];
361
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
362
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
363
+ let head = n < 0 ? '欠' : '';
364
+ n = Math.abs(n);
365
+
366
+ let s = '';
367
+
368
+ for (var i = 0; i < fraction.length; i++) {
369
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
370
+ }
371
+ s = s || '整';
372
+ n = Math.floor(n);
373
+
374
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
375
+ let p = '';
376
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
377
+ p = digit[n % 10] + unit[1][j] + p;
378
+ n = Math.floor(n / 10);
379
+ }
380
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
381
+ }
382
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
383
+ },
384
+ getLableValue(label) {
385
+ for (const item of this.show_data.fields) {
386
+ if (item.label === label && item.type !== 'number') {
387
+ return item.value || ''
388
+ }
389
+ if (item.label === label && item.type === 'number') {
390
+ return item.value || 0
391
+ }
392
+ }
393
+ },
394
+ getLableOptions(label) {
395
+ for (const item of this.show_data.fields) {
396
+ if (item.label === label) {
397
+ return item.options
398
+ }
399
+ }
400
+ },
401
+ hideLabels(...labels) {
402
+ for (const item of this.show_data.fields) {
403
+ if (labels.includes(item.label)) {
404
+ item.hidden = true
405
+ }
406
+ }
407
+ },
408
+ requiredLabels(...labels) {
409
+ for (const item of this.show_data.fields) {
410
+ if (labels.includes(item.label)) {
411
+ item.required = true
412
+ }
413
+ }
414
+ },
415
+ electiveLabels(...labels) {
416
+ for (const item of this.show_data.fields) {
417
+ if (labels.includes(item.label)) {
418
+ item.required = false
419
+ }
420
+ }
421
+ },
422
+ showLabels(...labels) {
423
+ for (const item of this.show_data.fields) {
424
+ if (labels.includes(item.label)) {
425
+ item.hidden = false
426
+ }
427
+ }
428
+ },
429
+ setLabelValue(label, value) {
430
+ for (const item of this.show_data.fields) {
431
+ if (item.label === label) {
432
+ item.value = value
433
+ this.show_data[item.field] = value
434
+ }
435
+ }
436
+ },
437
+ setLabelOptions(label, options) {
438
+ for (const item of this.show_data.fields) {
439
+ if (item.label === label) {
440
+ item.options = options
441
+ }
442
+ }
443
+ },
444
+ disabledButtons(...buttons) {
445
+ for (const item of this.show_data.buttons) {
446
+ if (buttons.includes(item.button_name)) {
447
+ item.disabled = true
448
+ }
449
+ }
450
+ },
451
+ enableButtons(...buttons) {
452
+ for (const item of this.show_data.buttons) {
453
+ if (buttons.includes(item.button_name)) {
454
+ item.disabled = false
455
+ }
456
+ }
457
+ },
458
+ showButtons(...buttons) {
459
+ for (const item of this.show_data.buttons) {
460
+ if (buttons.includes(item.button_name)) {
461
+ item.hidden = false
462
+ }
463
+ }
464
+ },
465
+ hideButtons(...buttons) {
466
+ for (const item of this.show_data.buttons) {
467
+ if (buttons.includes(item.button_name)) {
468
+ item.hidden = true
469
+ }
470
+ }
471
+ },
472
+ async streetChange () {
473
+ if (isEmpty(this.show_data.f_street)) {
474
+ return
475
+ }
476
+
477
+ let data = {
478
+ tablename: 't_area',
479
+ // condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
480
+ condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}'`
481
+ }
482
+ let http = new HttpResetClass()
483
+ let res = await http.load(
484
+ 'POST',
485
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
486
+ {data: data},
487
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
488
+ )
489
+
490
+ this.setLabelOptions('小区', res.data.map(item => {
491
+ return {
492
+ label: item.f_residential_area,
493
+ value: item.f_residential_area
494
+ }
495
+ }))
496
+ },
497
+ // 获取小区
498
+ async getArea () {
499
+ let data = {
500
+ tablename: 't_area',
501
+ condition: `f_filialeid = '${Vue.user.orgid}'`
502
+ }
503
+ let http = new HttpResetClass()
504
+ let res = await http.load(
505
+ 'POST',
506
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
507
+ {data: data},
508
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
509
+ )
510
+
511
+ return res.data.map(item => {
512
+ return {
513
+ label: item.f_residential_area,
514
+ value: item.f_residential_area
515
+ }
516
+ })
517
+ },
518
+ async pcdChange () {
519
+ if (isEmpty(this.show_data.f_pcd)) {
520
+ return
521
+ }
522
+
523
+ let data = {
524
+ tablename: 't_street',
525
+ // condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
526
+ condition: `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
527
+ }
528
+ let f_address_type = this.getLableValue('地址类型')
529
+
530
+ if (f_address_type === '民用市区') {
531
+ // data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
532
+ data.condition = `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
533
+ }
534
+ if (f_address_type === '民用乡镇') {
535
+ // data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
536
+ data.condition = `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
537
+ }
538
+
539
+ let http = new HttpResetClass()
540
+ let res = await http.load(
541
+ 'POST',
542
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
543
+ {data: data},
544
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
545
+ )
546
+
547
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
548
+ return {
549
+ label: item.f_street,
550
+ value: item.f_street
551
+ }
552
+ }))
553
+ },
554
+ async addressInitialization () {
555
+ //this.$getConfig(this, 'UserAddress')
556
+ //获取地址配置文件
557
+ try {
558
+ let res = await new HttpResetClass().load('get',`${this.$androidUtil.getProxyUrl()}/rs/vue/UserAddress.json`,null,{resolveMsg: null, rejectMsg: null})
559
+ Object.assign(this.config, res.data)
560
+ } catch (error) {
561
+ console.log("未获取到地址信息")
562
+ }
563
+ console.log("???????????不走了吗!")
564
+ let f_address_type = this.show_data.f_address_type
565
+
566
+ for (const item of this.show_data.fields) {
567
+ if (f_address_type === '民用市区') {
568
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '小区' || item.label === '门牌号') {
569
+ item.hidden = false
570
+ item.required = true
571
+ }
572
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
573
+ item.hidden = false
574
+ item.required = false
575
+ }
576
+ if (item.label === '地址') {
577
+ item.readonly = true
578
+ }
579
+ }
580
+ if (f_address_type === '民用乡镇') {
581
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '小区' || item.label === '门牌号') {
582
+ item.hidden = false
583
+ item.required = true
584
+ }
585
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
586
+ item.hidden = false
587
+ item.required = false
588
+ }
589
+ if (item.label === '楼层') {
590
+ item.hidden = true
591
+ item.required = false
592
+ }
593
+ if (item.label === '地址') {
594
+ item.readonly = true
595
+ }
596
+ }
597
+ if (f_address_type === '特殊地址') {
598
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
599
+ item.hidden = false
600
+ item.required = true
601
+ }
602
+ if (item.label === '小区') {
603
+ item.hidden = false
604
+ item.required = false
605
+ }
606
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
607
+ item.hidden = true
608
+ item.required = false
609
+ }
610
+ if (item.label === '地址') {
611
+ item.readonly = false
612
+ }
613
+ }
614
+
615
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
616
+ item.hidden = true
617
+ }
618
+ }
619
+ },
620
+
621
+ async checkDuplicate(index) {
622
+ let http = new HttpResetClass()
623
+ let data = {
624
+ tablename: 't_apply',
625
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
626
+ }
627
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`, {data: data}, {
628
+ resolveMsg: null,
629
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
630
+ })
631
+ if (res.data.length > 0) {
632
+ this.show_data.fields[index].value = null
633
+ this.$showMessage(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
634
+ }
635
+ },
636
+ async breakControl () {
637
+ if (this.show_data.id) {
638
+ let data = {
639
+ condition: `u.id = ${this.show_data.id}`,
640
+ data: {
641
+ id: Vue.user.id,
642
+ orgid: Vue.user.orgid
643
+ // id: '51953',
644
+ // orgid: '10101'
645
+ }
646
+ }
647
+ let res = await this.$resetpost(
648
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/checkuser`,
649
+ // `rs/sql/checkuser`,
650
+ {data: data},
651
+ {resolveMsg: null, rejectMsg: '数据更新失败,请手查询更新!!!'}
652
+ )
653
+
654
+ this.selectdata = res.data[0]
655
+ } else {
656
+ this.selectdata = servicedata
657
+ }
658
+
659
+ this.refurbish()
660
+ },
661
+ async addressTips () {
662
+ let res = ''
663
+ if (this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') {
664
+ res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
665
+ }else{
666
+ res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
667
+ }
668
+ if (res == 'confirm') {
669
+ return
670
+ }
671
+ throw '用户信息确认!!!'
672
+ },
673
+ //通气前置,添加设备
674
+ async addDeviceBefore () {
675
+ let http = new HttpResetClass()
676
+ var condition1=`f_userinfo_id = '${this.selectdata.f_userinfo_id}'`
677
+ let data = {
678
+ condition: condition1
679
+ }
680
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getUserFilesAndDevicesAmount`, {data:data}, {
681
+ resolveMsg: null,
682
+ rejectMsg: '获取表具失败!!!'
683
+ })
684
+ if (res.data.amount===0) {
685
+ this.$showMessage('请添加设备!!!', 'warning', 3000)
686
+ throw null
687
+ }
688
+ },
689
+ // 缴费前置
690
+ async chargeBefore () {
691
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
692
+ this.$showMessage('费用未结清!!!', 'warning', 3000)
693
+ throw null
694
+ }
695
+ if (this.show_data.defname === '通气施工' && this.show_data.f_apply_type === '启封通气'){
696
+ let http = new HttpResetClass()
697
+ let data = {
698
+ condition: `ui.f_userinfo_id = '${this.show_data.f_userinfo_id}' and (uf.f_meter_classify is null or f_meternumber is null or f_meternumber='' or uf.f_gasbrand_id is null or uf.f_gasmodel_id is null )`
699
+ }
700
+ let res = await http.load(
701
+ 'POST',
702
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/countApplyUserinfo`,
703
+ {data: data},
704
+ {
705
+ resolveMsg: null,
706
+ rejectMsg: '安装明细查询失败!!!'
707
+ })
708
+ if (res.data[0].num > 0) {
709
+ this.$showMessage(`还有${res.data[0].num}户表具未安装,无法提交`, 'warning', 3000)
710
+ throw `还有${res.data[0].num}户表具未安装,无法提交`
711
+ }
712
+ let condition1=''
713
+ if(this.selectdata.f_sub_state ==='完工'){
714
+ condition1=`f_userinfo_id = '${this.selectdata.f_userinfo_id}' and f_table_state='正常'`
715
+ }else{
716
+ condition1=`f_userinfo_id = '${this.selectdata.f_userinfo_id}' and f_table_state='待开通'`
717
+ }
718
+ data = {
719
+ condition: condition1
720
+ }
721
+ let res1 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getUserFilesAndDevicesAmount`, {data:data}, {
722
+ resolveMsg: null,
723
+ rejectMsg: '获取设备失败!!!'
724
+ })
725
+ if (res1.data[0].amount < 2) {
726
+ this.$showMessage(`设备必须添加2个,否则无法提交`, 'warning', 3000)
727
+ throw `设备必须添加2个,否则无法提交`
728
+ }
729
+ }
730
+ },
731
+ // 施工前置
732
+ async constructionBefore () {
733
+ let http = new HttpResetClass()
734
+ let data = {
735
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_meter_classify is null and f_meternumber is null`
736
+ }
737
+ let res = await http.load(
738
+ 'POST',
739
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/countApplyUserinfo`,
740
+ {data: data},
741
+ {
742
+ resolveMsg: null,
743
+ rejectMsg: '安装明细查询失败!!!'
744
+ })
745
+ if (res.data[0].num > 0) {
746
+ this.$showMessage(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
747
+ throw `还有${res.data[0].num}户未安装,无法提交`
748
+ }
749
+ },
750
+ changePipeBuild () {
751
+ if (this.selectdata.f_process_dep === '工程部') {
752
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
753
+ }
754
+ if (this.selectdata.f_process_dep === '运营部') {
755
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
756
+ }
757
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
758
+ },
759
+ async getPrice (f_price_id) {
760
+ console.log('=======================')
761
+ console.log(f_price_id)
762
+
763
+ let data = {
764
+ condition: `sp.f_filialeid = '${Vue.user.orgid}'`
765
+ }
766
+
767
+ if (!isEmpty(f_price_id)) {
768
+ data.condition = `sp.f_filialeid = '${Vue.user.orgid}' and sp.f_price_id = ${f_price_id}`
769
+ }
770
+ let http = new HttpResetClass()
771
+ let res = await http.load(
772
+ 'POST',
773
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/applyGetPrice`,
774
+ {data: data},
775
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
776
+ )
777
+
778
+ return res.data.map(item => {
779
+ return {
780
+ label: item.f_price_name,
781
+ value: item
782
+ }
783
+ })
784
+ },
785
+ //获取抄表册
786
+ async getMeterBook () {
787
+ let data = {
788
+ tablename: 't_meter_book',
789
+ condition: `f_book_state='有效' `
790
+ }
791
+ let http = new HttpResetClass()
792
+ let res = await http.load(
793
+ 'POST',
794
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
795
+ {data: data},
796
+ {resolveMsg: null, rejectMsg: '抄表册查询失败!!!'}
797
+ )
798
+ return res.data.map(item => {
799
+ return {
800
+ label: item.f_book_name,
801
+ value: item.f_book_code
802
+ }
803
+ })
804
+ },
805
+ // 获取当前分公司下拥有role角色的人员
806
+ async getDesignerPeople (role) {
807
+ let data = {
808
+ source: 'this.getParentByType($organization$).getChildByName($'+role+'$).getChildren()',
809
+ userid: Vue.user.id
810
+ }
811
+
812
+ let http = new HttpResetClass()
813
+ let res = await http.load(
814
+ 'POST',
815
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
816
+ {data: data},
817
+ {resolveMsg: null, rejectMsg: '人员查询失败!!!'}
818
+ )
819
+
820
+ return res.data.map(item => {
821
+ return {
822
+ label: item.name,
823
+ value: item.name
824
+ }
825
+ })
826
+ },
827
+ // 获取当前分公司下拥有role角色的人员的id
828
+ async getDesignerPeopleid (role) {
829
+ let data = {
830
+ source: 'this.getParentByType($organization$).getChildByName($'+role+'$).getChildren()',
831
+ userid: Vue.user.id
832
+ }
833
+
834
+ let http = new HttpResetClass()
835
+ let res = await http.load(
836
+ 'POST',
837
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
838
+ {data: data},
839
+ {resolveMsg: null, rejectMsg: '人员查询失败!!!'}
840
+ )
841
+
842
+ return res.data.map(item => {
843
+ return {
844
+ label: item.name,
845
+ value: item.id
846
+ }
847
+ })
848
+ },
849
+ async surveyStopApply () {
850
+ console.log('终止报建!!!!!')
851
+
852
+ this.show_data.f_stop_reason = '现场勘察不符合报装条件'
853
+
854
+ let data = {
855
+ data: this.show_data,
856
+ user: Vue.user
857
+ }
858
+
859
+ let res = await this.$resetpost(
860
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/surveyStopApply`,
861
+ {data: data},
862
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
863
+ )
864
+ if(res.data==200){
865
+ this.$dispatch('loadPage')
866
+ this.$showMessage('终止报建成功!!!')
867
+ this.$back()
868
+ throw '终止报建!!!'
869
+ }else{
870
+ this.$showMessage('终止报建失败!!!')
871
+ }
872
+ },
873
+ async getDevInfo () {
874
+ let data = {
875
+ tablename: 't_dev_info',
876
+ condition: `f_orgid = '${Vue.user.orgid}'`
877
+ }
878
+ let http = new HttpResetClass()
879
+ let res = await http.load(
880
+ 'POST',
881
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
882
+ {data: data},
883
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
884
+ )
885
+
886
+ return res.data.map(item => {
887
+ return {
888
+ label: item.f_dev_name,
889
+ value: item.f_dev_name
890
+ }
891
+ })
892
+ },
893
+ // 获取片区
894
+ async getSliceArea () {
895
+ let data = {
896
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
897
+ userid: Vue.user.id
898
+ }
899
+
900
+ let http = new HttpResetClass()
901
+ let res = await http.load(
902
+ 'POST',
903
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
904
+ {data: data},
905
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
906
+ )
907
+
908
+ return res.data.map(item => {
909
+ return {
910
+ label: item.name,
911
+ value: item.name
912
+ }
913
+ })
914
+ },
915
+ // 获取区县
916
+ async getPcd () {
917
+ let data = {
918
+ tablename: 't_pcd',
919
+ condition: `f_filialeid = '${Vue.user.orgid}'`
920
+ }
921
+ let http = new HttpResetClass()
922
+ let res = await http.load(
923
+ 'POST',
924
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
925
+ {data: data},
926
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
927
+ )
928
+
929
+ return res.data.map(item => {
930
+ return {
931
+ label: item.f_pcd,
932
+ value: item.f_pcd
933
+ }
934
+ })
935
+ },
936
+ //收费时添加 预算的 流程节点,如果 当前节点费用未 缴清, 不能进行下一步流程
937
+ async confirmBefore() {
938
+ var defname = this.show_data.defname
939
+ var processId = this.show_data.f_process_id
940
+ let data = {
941
+ condition: `tc.f_process_id = '${processId}' and tc.defname = '${defname}'`
942
+ }
943
+ let http = new HttpResetClass()
944
+ let res = await http.load(
945
+ 'POST',
946
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getPaymentRatio`,
947
+ {data: data},
948
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
949
+ )
950
+ if(res.data.length!==0){
951
+ var f_due_money= res.data[0].f_due_money
952
+ var cumulative= res.data[0].f_charge_money
953
+ if (Number(f_due_money) > Number(cumulative)) {
954
+ this.$showMessage(`当前${defname}环节,应缴金额为:${f_due_money},费用未结清`, 'warning', 3000)
955
+ throw null
956
+ }
957
+ }
958
+ let res1 = await http.load(
959
+ 'POST',
960
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getfeeconfirmation`,
961
+ {data: data},
962
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
963
+ )
964
+ for (let i =0;i<res1.data.length;i++){
965
+ if (isEmpty(res1.data[i].f_confirm_person)){
966
+ this.$showMessage(`当前${defname}环节,费用未收费确认,请仔细检查并点击保存`, 'warning', 3000)
967
+ throw null
968
+ }
969
+ }
970
+ if (defname=='合同签订'){
971
+ let num = 0
972
+ let data = {
973
+ condition: `f_process_id = '${this.selectdata.f_process_id}'`
974
+ }
975
+ let res1 = await new HttpResetClass().load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/getContractCharge`, {data: data}
976
+ , {resolveMsg: null, rejectMsg: null})
977
+ if (res1.data.length > 0){
978
+ for (let i= 0; i<res1.data.length;i++){
979
+ num += parseInt(res1.data[i].f_payment_ratio)
980
+ }
981
+ }
982
+ if (num!=100){
983
+ this.$showMessage(`当前${defname}环节,缴费比例必须设置为100%!!`, 'warning', 3000)
984
+ throw null
985
+ }
986
+ }
987
+ },
988
+
989
+ },
990
+ events: {
991
+ 'complyInstallation' (index) {
992
+ if (this.show_data.f_is_have === '否') {
993
+ this.hideButtons('提交', '出图', '缴费')
994
+ this.showButtons('终止')
995
+ }
996
+ if (this.show_data.f_is_have === '是') {
997
+ this.hideButtons('终止')
998
+ this.showButtons('提交', '出图', '缴费')
999
+ }
1000
+ },
1001
+ async 'igniteDispatchReadyEvent' () {
1002
+ let data = {
1003
+ tablename: 'activityins',
1004
+ condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
1005
+ }
1006
+ let http = new HttpResetClass()
1007
+ let res = await http.load(
1008
+ 'POST',
1009
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
1010
+ {data: data},
1011
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
1012
+ )
1013
+ if (res.data.length <= 0) {
1014
+ console.log('+++++++++++++++++++++++++++++')
1015
+ console.log('没有施工,不能退回')
1016
+ this.hideButtons('退回')
1017
+ }
1018
+ },
1019
+ 'breakControl' (val) {
1020
+ this.breakControl(val)
1021
+ },
1022
+ // 检查重复
1023
+ 'checkRepeat' (index) {
1024
+ this.checkDuplicate(index)
1025
+ },
1026
+ 'buildReadyEvent' () {
1027
+ this.setLabelValue('施工单位', Vue.user.name)
1028
+ this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
1029
+ },
1030
+ // 选择材料
1031
+ async materialNameChenge (index, fieldIndex) {
1032
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
1033
+
1034
+ this.show_data.onetomany[index].fields.forEach(item => {
1035
+ if (material[item.field]) {
1036
+ item.value = material[item.field]
1037
+ }
1038
+ })
1039
+ },
1040
+ // 打开模态框获取材料
1041
+ async 'getMaterialName' (index) {
1042
+ let data = {
1043
+ condition: `1=1`
1044
+ }
1045
+ let http = new HttpResetClass()
1046
+ let res = await http.load(
1047
+ 'POST',
1048
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getStockMaterial`,
1049
+ {data: data},
1050
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
1051
+ )
1052
+
1053
+ this.show_data.onetomany[index].fields.forEach(field => {
1054
+ if (field.label === '选择材料') {
1055
+ field.options = res.data.map(item => {
1056
+ return {
1057
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
1058
+ 'value': item
1059
+ }
1060
+ })
1061
+ }
1062
+ })
1063
+ },
1064
+ // 选择气价
1065
+ 'priceChange' (index) {
1066
+ if (isEmpty(this.show_data.stairPrice)) {
1067
+ return
1068
+ }
1069
+
1070
+ let stairPrice = this.getLableValue('气价名称')
1071
+
1072
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
1073
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
1074
+ this.setLabelValue('价格', stairPrice.f_price)
1075
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
1076
+ this.show_data.f_price_id = stairPrice.id
1077
+ this.show_data.f_price_name = stairPrice.f_price_name
1078
+ },
1079
+ // 是否购买保险
1080
+ isInsureChange (index) {
1081
+ let f_is_insure = this.getLableValue('是否购买保险')
1082
+ for (const item of this.show_data.fields) {
1083
+ if (f_is_insure === '是') {
1084
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1085
+ item.hidden = false
1086
+ item.required = true
1087
+ }
1088
+ if (item.label === '保险备注') {
1089
+ item.hidden = false
1090
+ }
1091
+ } else {
1092
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1093
+ item.hidden = true
1094
+ item.required = false
1095
+ }
1096
+ }
1097
+ }
1098
+ },
1099
+ // 通气点火初始化
1100
+ async 'gasReadyEvent' () {
1101
+ console.log('----通气点火初始化----')
1102
+ if (!isEmpty(this.show_data.f_price_id)) {
1103
+ let priceList = await this.getPrice(this.show_data.f_price_id)
1104
+ this.setLabelValue('气价名称', priceList[0].value)
1105
+ }
1106
+
1107
+ let data = {
1108
+ tablename: 't_userfees',
1109
+ condition: `f_orgid = '${Vue.user.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
1110
+ }
1111
+
1112
+ console.log('---------查询是否有待执行保险-----------')
1113
+ let http = new HttpResetClass()
1114
+ let res = await http.load(
1115
+ 'POST',
1116
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
1117
+ {data: data},
1118
+ {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
1119
+ )
1120
+ if (res.data.length > 0) {
1121
+ console.log('----------具有待执行保险------------')
1122
+ this.setLabelValue('待执行保险', '是')
1123
+ for (const item of this.show_data.fields) {
1124
+ if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1125
+ item.hidden = true
1126
+ item.required = false
1127
+ item.value = null
1128
+ }
1129
+ }
1130
+ console.log('----------具有待执行保险------------')
1131
+ } else {
1132
+ console.log('----------不有待执行保险------------')
1133
+ this.setLabelValue('待执行保险', '否')
1134
+ for (const item of this.show_data.fields) {
1135
+ if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1136
+ item.hidden = false
1137
+ item.required = true
1138
+ }
1139
+ }
1140
+ console.log('----------具有待执行保险------------')
1141
+ }
1142
+
1143
+ // 初始化显示内容
1144
+ let f_is_insure = this.getLableValue('是否购买保险')
1145
+ for (const item of this.show_data.fields) {
1146
+ if (f_is_insure === '是') {
1147
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1148
+ item.hidden = false
1149
+ item.required = true
1150
+ }
1151
+ if (item.label === '保险备注') {
1152
+ item.hidden = false
1153
+ }
1154
+ // 本期保费到期时间默认一年
1155
+ if (isEmpty(this.selectdata.f_ins_expiration_date)) {
1156
+ let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
1157
+ this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
1158
+ }
1159
+ }
1160
+ if (f_is_insure === '否') {
1161
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1162
+ item.hidden = true
1163
+ item.required = false
1164
+ }
1165
+ }
1166
+ }
1167
+ },
1168
+ // 合同金额失去焦点
1169
+ async 'contractMoneyChange' (index) {
1170
+ let yingjiao = parseFloat(
1171
+ parseFloat(this.show_data.f_contract_money || 0 ).toFixed(2) +
1172
+ parseFloat(this.getLableValue('追加金额') || 0 ).toFixed(2)
1173
+
1174
+ ).toFixed(2)
1175
+ let leiji = parseFloat(this.getLableValue('累计缴费金额') || 0 ).toFixed(2)
1176
+ let weijie = parseFloat(yingjiao - leiji ).toFixed(2)
1177
+ let fkbl = parseFloat(leiji/yingjiao).toFixed(2) * 100 + "%"
1178
+ this.setLabelValue('应交金额', yingjiao)
1179
+ this.setLabelValue('累计缴费金额', leiji)
1180
+ this.setLabelValue('未结总金额', weijie)
1181
+ this.setLabelValue('付款比列', fkbl)
1182
+ },
1183
+ //报建性质改变合同类型
1184
+ 'changehetong'(index){
1185
+ let nextindex = parseInt(index) + 1
1186
+ this.setLabelValue(this.show_data.fields[nextindex].label, this.$appdata.getSingleValue(this.show_data.fields[index].value)?this.$appdata.getSingleValue(this.show_data.fields[index].value):'')
1187
+ },
1188
+ //合同类型改变合同代码
1189
+ 'contracttypes'(index){
1190
+ let num = ''
1191
+ if (this.show_data.fields[index].value == '民用合同' && this.show_data.f_apply_type == '民用散户报建流程'){
1192
+ num = 'MS'
1193
+ }else if (this.show_data.fields[index].value == '民用合同' && this.show_data.f_apply_type != '民用散户报建流程'){
1194
+ num = 'MD'
1195
+ }else if (this.show_data.fields[index].value == '工业合同' ){
1196
+ num = 'GY'
1197
+ }else if (this.show_data.fields[index].value == '商业合同' ){
1198
+ num = 'SK'
1199
+ }else if (this.show_data.fields[index].value == '整改合同' ){
1200
+ num = 'RZ'
1201
+ }else if (this.show_data.fields[index].value == '公福合同' ){
1202
+ num = 'GA'
1203
+ }else if (this.show_data.fields[index].value == '内投合同' ){
1204
+ num = 'NT'
1205
+ }
1206
+ this.setLabelValue('性质代码', num)
1207
+ },
1208
+ // ===========================================
1209
+ async 'button'() {
1210
+ if (this.show_data.button.before) {
1211
+ await this[this.show_data.button.before]()
1212
+ }
1213
+ // 点击重置按钮就重置数据
1214
+ if (this.show_data.button.button_name === '重置') {
1215
+ this.$dispatch('breakControl', this.selectdata)
1216
+ return
1217
+ }
1218
+
1219
+ this.show_data.user = Vue.user
1220
+ this.show_data.start_activity = this.json_datas.start_activity
1221
+ this.show_data.xmlfilename = this.json_datas.workflow_xmlfilename
1222
+
1223
+
1224
+ if (((this.show_data.defname === '工程审批' && (this.show_data.f_apply_type === '民用散户报建流程'|| this.show_data.f_apply_type === '民用预留户报建流程'))|| (this.show_data.defname === '工程决算')) && this.show_data.button.button_name === '提交' && this.show_data.f_payment_ratio == "100%"){
1225
+ this.show_data.button.button_name = '跳过'
1226
+ }
1227
+ if (this.show_data.defname === '通气申请' && this.show_data.f_apply_type === '启封通气'&& this.show_data.button.button_name === '提交' && this.show_data.f_apply_source !== '线下发起' && this.show_data.f_apply_nature !== '预留户'){
1228
+ this.show_data.button.button_name = '跳过'
1229
+ }
1230
+ if(this.show_data.defname === '工程派工' && this.show_data.button.button_name === '提交'){
1231
+ this.show_data.f_budget_peoples = []
1232
+ for (const item of this.show_data.fields) {
1233
+ if (item.label === '施工人') {
1234
+ for (let row of item.optionsid){
1235
+ item.value.forEach(item => {
1236
+ if (item === row.label) {
1237
+ this.show_data.f_budget_peoples.push({
1238
+ label: row.label,
1239
+ value: row.value
1240
+ })
1241
+ }
1242
+ })
1243
+ }
1244
+ }
1245
+ }
1246
+ }
1247
+ if(this.show_data.defname === '工程验收' && this.show_data.button.button_name === '提交'){
1248
+ this.show_data.acceptances = await this.getDesignerPeopleid('报装验收审批')
1249
+ }
1250
+ if(this.show_data.f_apply_type != '验收审批' && this.show_data.defname === '验收审批' && this.show_data.button.button_name === '提交'){
1251
+ const http = new HttpResetClass()
1252
+ let data = {
1253
+ tablename: 't_apply',
1254
+ condition: `f_parent_process_id = '${this.show_data.f_process_id}' and f_apply_type = '验收审批' and f_sub_state != '完工'`
1255
+ }
1256
+ const res = await http.load('post',`${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,{data: data},{rejectMsg:null,resolveMsg:null})
1257
+ if (res.data.length > 0){
1258
+ this.$showMessage('该报建单子下还有未完工的验收审批流程,无法提交!!!')
1259
+ return
1260
+ }
1261
+ }
1262
+ let res = await this.$resetpost(
1263
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyProductService`,
1264
+ {data: this.show_data},
1265
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1266
+ )
1267
+ if(this.show_data.f_apply_type == '验收审批' && this.show_data.defname === '验收审批' && this.show_data.button.button_name === '提交'){
1268
+ const http = new HttpResetClass()
1269
+ let data = {
1270
+ tablename: 't_apply',
1271
+ condition: `f_parent_process_id = '${this.show_data.f_parent_process_id}' and f_apply_type = '验收审批' and f_sub_state != '完工'`
1272
+ }
1273
+ await http.load('post',`${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,{data: data},{rejectMsg:null,resolveMsg:null}).then( res=>{
1274
+ if (res.data.length == 0){
1275
+ http.load('post',`${this.$androidUtil.getProxyUrl()}/rs/sql/checkuser`,{data: {condition:` f_process_id= '${this.show_data.f_parent_process_id}'`, data: {id: Vue.user.id,orgid: Vue.user.orgid}}},{resolveMsg:null,rejectMsg:null}).then(row=>{
1276
+ const show_data = row.data[0]
1277
+ show_data.user = Vue.user
1278
+ show_data.start_activity ='报装申请'
1279
+ show_data.xmlfilename = show_data.f_apply_type
1280
+ show_data.button = {button_name:'提交'}
1281
+ show_data.tables = ["t_apply"]
1282
+ this.$resetpost(
1283
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyProductService`,
1284
+ {data: show_data},
1285
+ {resolveMsg: null, rejectMsg: null}
1286
+ )
1287
+ })
1288
+ }
1289
+ })
1290
+ }
1291
+
1292
+ if (this.show_data.button.after) {
1293
+ this[this.show_data.button.after]()
1294
+ }
1295
+ this.$dispatch('confirm')
1296
+ },
1297
+ // 失去焦点出触发事件
1298
+ 'onchange' (index) {
1299
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1300
+
1301
+ if (
1302
+ this.show_data.fields[index].label === '区/县' ||
1303
+ this.show_data.fields[index].label === '街道/乡镇' ||
1304
+ this.show_data.fields[index].label === '小区' ||
1305
+ this.show_data.fields[index].label === '楼号/组' ||
1306
+ this.show_data.fields[index].label === '单元/排' ||
1307
+ this.show_data.fields[index].label === '楼层' ||
1308
+ this.show_data.fields[index].label === '门牌号'
1309
+ ) {
1310
+ let f_pcd = this.getLableValue('区/县') || ''
1311
+ let f_street = this.getLableValue('街道/乡镇') || ''
1312
+ let f_residential_area = this.getLableValue('小区') || ''
1313
+ let f_building = this.getLableValue('楼号/组') || ''
1314
+ let f_building_suffix = f_building ? '号楼' : ''
1315
+ let f_unit = this.getLableValue('单元/排') || ''
1316
+ let f_unit_suffix = f_unit ? '单元' : ''
1317
+ let f_floor = this.getLableValue('楼层') || ''
1318
+ let f_floor_suffix = f_floor ? '层' : ''
1319
+ let f_room = this.getLableValue('门牌号') || ''
1320
+ let f_room_suffix = f_room ? '' : ''
1321
+
1322
+ let f_address = f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
1323
+ this.setLabelValue("地址", f_address)
1324
+ }
1325
+ }
1326
+ },
1327
+ async 'getDesignerPeople' () {
1328
+ let data = {
1329
+ source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
1330
+ userid: Vue.user.id
1331
+ }
1332
+
1333
+ let http = new HttpResetClass()
1334
+ let res = await http.load(
1335
+ 'POST',
1336
+ `rs/search`,
1337
+ {data: data},
1338
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
1339
+ )
1340
+
1341
+ return res.data.map(item => {
1342
+ return {
1343
+ label: item.name,
1344
+ value: item.id
1345
+ }
1346
+ })
1347
+ },
1348
+ // 申请节点初始化
1349
+ 'applyReadyEvent' () {
1350
+ this.addressInitialization()
1351
+
1352
+ this.pcdChange()
1353
+ this.streetChange()
1354
+ },
1355
+ // 街道失去焦点
1356
+ async 'streetChange' (index) {
1357
+ if (isEmpty(this.show_data.f_street)) {
1358
+ return
1359
+ }
1360
+
1361
+ this.setLabelValue('小区', null)
1362
+
1363
+ let data = {
1364
+ tablename: 't_area',
1365
+ condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}'`
1366
+ }
1367
+ let http = new HttpResetClass()
1368
+ let res = await http.load(
1369
+ 'POST',
1370
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
1371
+ {data: data},
1372
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
1373
+ )
1374
+
1375
+ this.setLabelOptions('小区', res.data.map(item => {
1376
+ return {
1377
+ label: item.f_residential_area,
1378
+ value: item.f_residential_area
1379
+ }
1380
+ }))
1381
+ },
1382
+ // 选择报建项目
1383
+ 'selectApply' (row) {
1384
+ this.setLabelValue('工程名称', row.f_entry_name)
1385
+ this.setLabelValue('工程编号', row.f_apply_num)
1386
+ this.setLabelValue('报建类型', row.f_apply_type)
1387
+ this.setLabelValue('用户名称', row.f_user_name)
1388
+ this.setLabelValue('用户电话', row.f_phone)
1389
+ this.setLabelValue('证件类型', row.f_credentials)
1390
+ this.setLabelValue('证件号码', row.f_idnumber)
1391
+ this.setLabelValue('地址', row.f_address)
1392
+ this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
1393
+
1394
+ this.show_data.parentApply = JSON.parse(JSON.stringify(row))
1395
+
1396
+ delete row.id
1397
+ delete row.actid
1398
+ delete row.defid
1399
+ delete row.defname
1400
+ delete row.version
1401
+ delete row.f_apply_num
1402
+ delete row.f_sub_state
1403
+ delete row.f_apply_type
1404
+ delete row.f_process_id
1405
+
1406
+ this.show_data = Object.assign({}, this.show_data, row)
1407
+
1408
+ this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
1409
+ },
1410
+ // 区县失去焦点
1411
+ async 'pcdChange' (index) {
1412
+ if (isEmpty(this.show_data.f_pcd)) {
1413
+ return
1414
+ }
1415
+
1416
+ this.setLabelValue('街道/乡镇', null)
1417
+ this.setLabelValue('小区', null)
1418
+
1419
+
1420
+
1421
+ let data = {
1422
+ tablename: 't_street',
1423
+ condition: `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1424
+ }
1425
+ let f_address_type = this.getLableValue('地址类型')
1426
+
1427
+ if (f_address_type === '民用市区') {
1428
+ data.condition = `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1429
+ }
1430
+ if (f_address_type === '民用乡镇') {
1431
+ data.condition = `f_filialeid = '${Vue.user.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1432
+ }
1433
+
1434
+ let http = new HttpResetClass()
1435
+ let res = await http.load(
1436
+ 'POST',
1437
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
1438
+ {data: data},
1439
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1440
+ )
1441
+
1442
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
1443
+ return {
1444
+ label: item.f_street,
1445
+ value: item.f_street
1446
+ }
1447
+ }))
1448
+ },
1449
+ // 选择用户档案信息
1450
+ 'selectUserinfo' (row) {
1451
+ this.setLabelValue('用户编号', row.f_userinfo_code)
1452
+ this.setLabelValue('用户名称', row.f_user_name)
1453
+ this.setLabelValue('用户电话', row.f_user_phone)
1454
+ this.setLabelValue('证件类型', row.f_credentials)
1455
+ this.setLabelValue('证件号码', row.f_idnumber)
1456
+ this.setLabelValue('地址', row.f_address)
1457
+
1458
+ this.show_data.f_userinfo_id = row.f_userinfo_id
1459
+ this.show_data.f_userinfo_code = row.f_userinfo_code
1460
+ },
1461
+ // 地址类型失去焦点
1462
+ 'addressTypeChange' (index) {
1463
+ this.setLabelValue('街道/乡镇', null)
1464
+ this.setLabelValue('小区', null)
1465
+ let f_address_type = this.show_data.fields[index].value
1466
+ for (const item of this.show_data.fields) {
1467
+ if (f_address_type === '民用市区') {
1468
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '小区' || item.label === '门牌号') {
1469
+ item.hidden = false
1470
+ item.required = true
1471
+ item.value = null
1472
+ }
1473
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1474
+ item.hidden = false
1475
+ item.required = false
1476
+ item.value = null
1477
+ }
1478
+ if (item.label === '地址') {
1479
+ item.readonly = true
1480
+ item.value = null
1481
+ }
1482
+ }
1483
+ if (f_address_type === '民用乡镇') {
1484
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '小区' || item.label === '门牌号') {
1485
+ item.hidden = false
1486
+ item.required = true
1487
+ item.value = null
1488
+ }
1489
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1490
+ item.hidden = false
1491
+ item.required = false
1492
+ item.value = null
1493
+ }
1494
+ if (item.label === '楼层') {
1495
+ item.hidden = true
1496
+ item.required = false
1497
+ item.value = null
1498
+ }
1499
+ if (item.label === '地址') {
1500
+ item.readonly = true
1501
+ item.value = null
1502
+ }
1503
+ }
1504
+ if (f_address_type === '特殊地址') {
1505
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
1506
+ item.hidden = false
1507
+ item.required = true
1508
+ item.value = null
1509
+ }
1510
+ if (item.label === '小区') {
1511
+ item.hidden = false
1512
+ item.required = false
1513
+ item.value = null
1514
+ }
1515
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1516
+ item.hidden = true
1517
+ item.required = false
1518
+ item.value = null
1519
+ }
1520
+ if (item.label === '地址') {
1521
+ item.readonly = false
1522
+ item.value = null
1523
+ }
1524
+ }
1525
+ }
1526
+ },
1527
+ // 搜索小区
1528
+ async 'searchArea' (area, index) {
1529
+ let data = {
1530
+ tablename: 't_area',
1531
+ condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1532
+ }
1533
+ let http = new HttpResetClass()
1534
+ let res = await http.load(
1535
+ 'POST',
1536
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
1537
+ {data: data},
1538
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
1539
+ )
1540
+
1541
+ if (res.data.length === 0) {
1542
+ return
1543
+ }
1544
+
1545
+ this.setLabelOptions('小区', res.data.map(item => {
1546
+ return {
1547
+ label: item.f_residential_area,
1548
+ value: item.f_residential_area
1549
+ }
1550
+ }))
1551
+ },
1552
+ // 搜索小区
1553
+ async 'searchAreaCollective' (area, index) {
1554
+ let data = {
1555
+ tablename: 't_area',
1556
+ condition: `f_filialeid = '${Vue.user.orgid}' and f_residential_area like '%${area}%'`
1557
+ }
1558
+ let http = new HttpResetClass()
1559
+ let res = await http.load(
1560
+ 'POST',
1561
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/apply_singleTable`,
1562
+ {data: data},
1563
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
1564
+ )
1565
+
1566
+ if (res.data.length === 0) {
1567
+ return
1568
+ }
1569
+
1570
+ this.setLabelOptions('小区', res.data.map(item => {
1571
+ return {
1572
+ label: item.f_residential_area,
1573
+ value: item.f_residential_area
1574
+ }
1575
+ }))
1576
+ },
1577
+ // 团购转散户初始化
1578
+ 'apply2ReadyEvent' () {
1579
+ if (this.show_data.f_apply_source === '线下发起') {
1580
+ this.addressInitialization()
1581
+ this.hideLabels('用户编号')
1582
+ this.electiveLabels('用户编号')
1583
+ this.showLabels('片区', '地址类型')
1584
+ this.requiredLabels('片区', '地址类型')
1585
+ }
1586
+ if (this.show_data.f_apply_source === '自动发起') {
1587
+ this.hideLabels('片区', '地址类型')
1588
+ this.electiveLabels('片区', '地址类型',)
1589
+ }
1590
+ },
1591
+ 'onblur' (index) {},
1592
+ 'oninput' (index) {},
1593
+ 'initializtionView' () {},
1594
+ async 'onchangeModal' (index, fieldIndex) {
1595
+ },
1596
+ async 'onblurModal' (index, fieldIndex) {
1597
+
1598
+ },
1599
+ async 'oninputModal' (index, fieldIndex) {
1600
+
1601
+ },
1602
+ async 'onetomanydelete' (index, rowIndex) {
1603
+
1604
+ let http = new HttpResetClass()
1605
+
1606
+ let res = await http.load(
1607
+ 'DELETE',
1608
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1609
+ null,
1610
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1611
+ )
1612
+ res = await this.$resetpost(
1613
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1614
+ this.show_data
1615
+ )
1616
+ this.breakControl()
1617
+ },
1618
+ async 'onetomanyupdate' (index, rowIndex) {
1619
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1620
+
1621
+ this.show_data.onetomany[index].fields.forEach(item => {
1622
+ data[item.field] = item.value
1623
+ })
1624
+ let res = await this.$resetpost(
1625
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1626
+ data
1627
+ )
1628
+ res = await this.$resetpost(
1629
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1630
+ this.show_data
1631
+ )
1632
+ this.breakControl()
1633
+ },
1634
+ async 'onetomanyadd' (index) {
1635
+ let data = {
1636
+ f_process_id : this.show_data.f_process_id,
1637
+ f_operator_id: Vue.user.id,
1638
+ f_operator: Vue.user.name,
1639
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1640
+ f_orgid: Vue.user.orgid,
1641
+ f_orgname: Vue.user.orgs
1642
+ }
1643
+ this.show_data.onetomany[index].fields.forEach(item => {
1644
+ data[item.field] = item.value
1645
+ })
1646
+ let res = await this.$resetpost(
1647
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1648
+ data
1649
+ )
1650
+ res = await this.$resetpost(
1651
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1652
+ this.show_data
1653
+ )
1654
+ this.breakControl()
1655
+ },
1656
+ 'onbutchange' (index) {
1657
+
1658
+ },
1659
+ 'onbutblur' (index) {
1660
+
1661
+ },
1662
+ 'onbutinput' (index) {
1663
+
1664
+ },
1665
+ 'changeShowfei' (val) {
1666
+ console.log('回调修改父组件属性----'+val)
1667
+ this.show_data.showfei=val
1668
+ }
1669
+ },
1670
+ watch: {
1671
+ /*async 'show_data.showfei' (val) {
1672
+ console.log(`支付成功!!!!!!${val}`)
1673
+ if(this.show_data.showfei=='已付款'){
1674
+ await this.buttonCommit()
1675
+ }
1676
+ }*/
1677
+ }
1678
+ }
1679
+ </script>
1680
+ <style scoped>
1681
+ </style>