apply-clients 3.3.49 → 3.3.50

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 (38) hide show
  1. package/build/dev-server.js +131 -130
  2. package/package.json +1 -1
  3. package/src/AndroidApp.vue +35 -35
  4. package/src/apply.js +93 -93
  5. package/src/applyAndroid.js +31 -31
  6. package/src/components/android/AppOnetomany.vue +301 -301
  7. package/src/components/android/AppServiceView.vue +566 -566
  8. package/src/components/android/AppSign.vue +142 -142
  9. package/src/components/android/Function/AppInstallFunction.vue +366 -366
  10. package/src/components/android/Process/AppExplorationUser.vue +340 -340
  11. package/src/components/android/Process/AppServiceControl.vue +761 -761
  12. package/src/components/android/Process/Processes/AppBuildSign.vue +46 -46
  13. package/src/components/android/Supervisory/AppProcessSupervisory.vue +300 -300
  14. package/src/components/android/Supervisory/AppSupervisoryCart.vue +119 -119
  15. package/src/components/product/ApplyCharge/ApplyChargeList.vue +11 -1
  16. package/src/components/product/Function/InstallFunction.vue +132 -132
  17. package/src/components/product/Function/InstallInfoSelect.vue +320 -310
  18. package/src/components/product/Function/Service/FunctionServiceControl.vue +445 -445
  19. package/src/components/product/Material/MaterialDetailed.vue +235 -235
  20. package/src/components/product/OldApply/Monitor/MonitorApply.vue +329 -329
  21. package/src/components/product/OldApply/OldApply.vue +150 -150
  22. package/src/components/product/Onetomany.vue +377 -377
  23. package/src/components/product/Print/BuildOrder/buildOrderList.vue +264 -264
  24. package/src/components/product/Print/BuildOrder/printBuildOrder.vue +153 -153
  25. package/src/components/product/Process/ExplorationSelect.vue +457 -457
  26. package/src/components/product/Process/ExplorationUser.vue +147 -147
  27. package/src/components/product/Process/Processes/InstallationDetails.vue +592 -592
  28. package/src/components/product/Process/Processes/Print/printCharge.vue +142 -142
  29. package/src/components/product/Process/Processes/Print/printRefund.vue +196 -196
  30. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +207 -207
  31. package/src/components/product/Process/Processes/chargeManagement.vue +656 -656
  32. package/src/components/product/Process/Service/ServiceControl.vue +1265 -1265
  33. package/src/components/product/ServiceView.vue +631 -631
  34. package/src/components/product/Supervisory/SupervisoryControl.vue +137 -137
  35. package/src/components/product/Supervisory/SupervisoryList.vue +296 -296
  36. package/src/components/product/Supervisory/SupervisoryhCart.vue +130 -130
  37. package/src/components/product/VueUtils/ApplyUpload.vue +273 -273
  38. package/src/components/product/VueUtils/HighMeter.vue +208 -208
@@ -1,1265 +1,1265 @@
1
- <template>
2
- <div class="" v-if="showview">
3
- <show-back-reason :selectdata="show_data"></show-back-reason>
4
- <service-view v-ref:serviceview :data="show_data"></service-view>
5
- </div>
6
- </template>
7
- <script>
8
- import Vue from 'vue'
9
- import {HttpResetClass} from 'vue-client'
10
- import {isEmpty} from "../../../Util";
11
-
12
- // Date格式化
13
- Date.prototype.Format = function (fmt) {
14
- var o = {
15
- "M+": this.getMonth() + 1, //月份
16
- "d+": this.getDate(), //日
17
- "H+": this.getHours(), //小时
18
- "m+": this.getMinutes(), //分
19
- "s+": this.getSeconds(), //秒
20
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
21
- "S": this.getMilliseconds() //毫秒
22
- };
23
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
24
- for (var k in o)
25
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
26
- return fmt;
27
- }
28
-
29
- export default {
30
- title: '报建流程业务控制层',
31
- props: ['selectdata'],
32
- data () {
33
- return {
34
- data: null, // 数据库数据,json配置文件数据的数据集合
35
- json_datas: null, // Json配置文件集合
36
- showview: false, // 控制显示service-view组件
37
- show_data: null, // 给view层显示的数据
38
- config: {}
39
- }
40
- },
41
- ready () {
42
- this.refurbish()
43
- },
44
- methods: {
45
- // 组件初始化操作
46
- async refurbish() {
47
- this.json_datas = this.$workflow_vue
48
- let sum = 0
49
- let jsonData = {}
50
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
51
- this.$showMessage("网络故障,请刷新页面")
52
- return
53
- }
54
- this.json_datas.activitys.forEach(item => {
55
- if (this.selectdata.defname === item.title) {
56
- jsonData = item // 拿到当前节点的json配置信息
57
- sum++ // 节点名一样的个数
58
- }
59
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
60
- })
61
-
62
- if (sum === 0) {
63
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
64
- return
65
- }
66
- if (sum > 1) {
67
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
68
- return
69
- }
70
-
71
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
72
-
73
- // fields 字段填充值
74
- for (const item of this.selectdata.fields) {
75
- if (!item.value) {
76
- item.value = null
77
- }
78
-
79
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
80
- if (item.eval) {
81
- item.value = eval(item.default)
82
- } else {
83
- item.value = item.default
84
- }
85
- }
86
-
87
- if (this.selectdata[item.field]) {
88
- // 将json字符串格式化赋值给value
89
- if (String(this.selectdata[item.field]).startsWith("{")) {
90
- item.value = JSON.parse(this.selectdata[item.field])
91
- } else {
92
- item.value = this.selectdata[item.field]
93
- }
94
- }
95
- if (this.selectdata[item.field] === 0) {
96
- item.value = 0
97
- }
98
-
99
- // datepicker
100
- if (item.type === 'datepicker' && !item.value && item.default) {
101
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
102
- }
103
-
104
- // 如果配置类型为select,优先从参数列表获取options
105
- if (item.type === 'select' || item.type === 'checkbox') {
106
- if (item.param) {
107
- let temp = this.$appdata.getParam(item.label)
108
-
109
- if (temp && temp.length > 0) {
110
- item.options = temp
111
- }
112
-
113
- if (item.paramLabel) {
114
- temp = this.$appdata.getParam(item.paramLabel)
115
- if (temp && temp.length > 0) {
116
- item.options = temp
117
- }
118
- }
119
- }
120
-
121
- if (item.ready) {
122
- item.options = await this[item.ready]()
123
- }
124
- }
125
-
126
-
127
- if (item.type === 'checkbox') {
128
- if (this.selectdata[item.field]) {
129
- item.value = JSON.parse(this.selectdata[item.field])
130
- } else {
131
- item.value = []
132
- }
133
- }
134
-
135
- this.selectdata[item.field] = item.value
136
- }
137
-
138
- // 控制组件
139
- if (this.selectdata.components) {
140
- this.selectdata.components.forEach(item => {
141
- if (!item.mark) {
142
- item.mark = 0
143
- }
144
- })
145
- }
146
-
147
- // 初始化onetomany
148
- if (this.selectdata.onetomany) {
149
- for (const item of this.selectdata.onetomany) {
150
- let res = null
151
- if (item.queryEvent) {
152
- res = this[item.queryEvent]()
153
- } else {
154
- let data = {
155
- tablename: item.tables[0],
156
- condition: `f_process_id='${this.selectdata.f_process_id}'`
157
- }
158
- res = await this.$resetpost(
159
- 'rs/sql/singleTable',
160
- {data: data},
161
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
162
- )
163
- }
164
-
165
- item.rows = res.data
166
-
167
- // 初始化onetomany中的fields
168
- for (const field of item.fields) {
169
- if (!field.value) {
170
- if (field.value !== 0) {
171
- field.value = null
172
- }
173
- }
174
-
175
- if (field.default || field.default === 0) {
176
- field.value = field.default
177
- }
178
-
179
- // datepicker
180
- if (field.type === 'datepicker' && !field.value && field.default) {
181
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
182
- }
183
-
184
- if (field.type === 'select') {
185
-
186
- let temp = this.$appdata.getParam(field.label)
187
-
188
- if (temp && temp.length > 0) {
189
- field.options = temp
190
- }
191
-
192
- if (field.paramLabel) {
193
- temp = this.$appdata.getParam(field.paramLabel)
194
- if (temp && temp.length > 0) {
195
- item.options = temp
196
- }
197
- }
198
- }
199
- }
200
- }
201
- }
202
-
203
- // 初始化 buttons_fields
204
- for (const item of this.selectdata.buttons) {
205
- if (item.button_name === '下发') {
206
-
207
- let data = {
208
- source: item.source,
209
- userid: this.$login.f.id
210
- }
211
- if (item.sourceMethod) {
212
- data.source = this[item.sourceMethod]()
213
- }
214
- if (!data.source) {
215
- this.$showMessage("请配置获取人员表达式")
216
- return
217
- }
218
-
219
- let res = await this.$resetpost(
220
- 'rs/search',
221
- {data: data},
222
- {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
223
- )
224
-
225
- let options = res.data.map(source => {
226
- return {
227
- "label": source.name,
228
- "value": source.id
229
- }
230
- })
231
-
232
- if (item.button_fields.length !== 1) {
233
- this.$showMessage("下发有且只能有一个字段!!!")
234
- return
235
- }
236
-
237
- item.button_fields[0].options = options
238
- }
239
- if (item.button_fields) {
240
- item.button_fields.forEach(x => {
241
- // 如果配置类型为select,优先从参数列表获取options
242
- if (x.type === 'select') {
243
-
244
- if (x.param) {
245
- let temp = this.$appdata.getParam(x.label)
246
-
247
- if (temp && temp.length > 0) {
248
- x.options = temp
249
- }
250
-
251
- if (x.paramLabel) {
252
- temp = this.$appdata.getParam(x.paramLabel)
253
- if (temp && temp.length > 0) {
254
- x.options = temp
255
- }
256
- }
257
- }
258
-
259
- }
260
- })
261
- }
262
- }
263
-
264
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
265
- let temp = JSON.parse(JSON.stringify(this.selectdata))
266
-
267
- this.show_data = temp
268
- this.$nextTick(() => {
269
- this.showview = true
270
- })
271
- },
272
- // 金额转大写
273
- smalltoBIG(n) {
274
- let fraction = ['角', '分'];
275
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
276
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
277
- let head = n < 0 ? '欠' : '';
278
- n = Math.abs(n);
279
-
280
- let s = '';
281
-
282
- for (var i = 0; i < fraction.length; i++) {
283
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
284
- }
285
- s = s || '整';
286
- n = Math.floor(n);
287
-
288
- for (var i = 0; i < unit[0].length && n > 0; i++) {
289
- let p = '';
290
- for (var j = 0; j < unit[1].length && n > 0; j++) {
291
- p = digit[n % 10] + unit[1][j] + p;
292
- n = Math.floor(n / 10);
293
- }
294
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
295
- }
296
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
297
- },
298
- getLableValue(label) {
299
- for (const item of this.show_data.fields) {
300
- if (item.label === label && item.type !== 'number') {
301
- return item.value || ''
302
- }
303
- if (item.label === label && item.type === 'number') {
304
- return item.value || 0
305
- }
306
- }
307
- },
308
- getLableOptions(label) {
309
- for (const item of this.show_data.fields) {
310
- if (item.label === label) {
311
- return item.options
312
- }
313
- }
314
- },
315
- setLabelValue(label, value) {
316
- for (const item of this.show_data.fields) {
317
- if (item.label === label) {
318
- item.value = value
319
- this.show_data[item.field] = value
320
- }
321
- }
322
- },
323
- setLabelOptions(label, options) {
324
- for (const item of this.show_data.fields) {
325
- if (item.label === label) {
326
- item.options = options
327
- }
328
- }
329
- },
330
- showLabels(...labels) {
331
- for (const item of this.show_data.fields) {
332
- if (labels.includes(item.label)) {
333
- item.hidden = false
334
- }
335
- }
336
- },
337
- hideLabels(...labels) {
338
- for (const item of this.show_data.fields) {
339
- if (labels.includes(item.label)) {
340
- item.hidden = true
341
- }
342
- }
343
- },
344
- requiredLabels(...labels) {
345
- for (const item of this.show_data.fields) {
346
- if (labels.includes(item.label)) {
347
- item.required = true
348
- }
349
- }
350
- },
351
- electiveLabels(...labels) {
352
- for (const item of this.show_data.fields) {
353
- if (labels.includes(item.label)) {
354
- item.required = false
355
- }
356
- }
357
- },
358
- readonlyLabels(...labels) {
359
- for (const item of this.show_data.fields) {
360
- if (labels.includes(item.label)) {
361
- item.readonly = true
362
- item.disabled = true
363
- }
364
- }
365
- },
366
- readwriteLabels(...labels) {
367
- for (const item of this.show_data.fields) {
368
- if (labels.includes(item.label)) {
369
- item.readonly = false
370
- item.disabled = false
371
- }
372
- }
373
- },
374
- async checkDuplicate(index) {
375
- let http = new HttpResetClass()
376
- let data = {
377
- tablename: 't_apply',
378
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
379
- }
380
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
381
- resolveMsg: null,
382
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
383
- })
384
- if (res.data.length > 0) {
385
- this.show_data.fields[index].value = null
386
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
387
- }
388
- },
389
- // 获取片区
390
- async getSliceArea () {
391
- let data = {
392
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
393
- userid: this.$login.f.id
394
- }
395
-
396
- let http = new HttpResetClass()
397
- let res = await http.load(
398
- 'POST',
399
- `rs/search`,
400
- {data: data},
401
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
402
- )
403
-
404
- return res.data.map(item => {
405
- return {
406
- label: item.name,
407
- value: item.name
408
- }
409
- })
410
- },
411
- // 获取区县
412
- async getPcd () {
413
- let data = {
414
- tablename: 't_pcd',
415
- condition: `f_filialeid = '${this.$login.f.orgid}'`
416
- }
417
- let http = new HttpResetClass()
418
- let res = await http.load(
419
- 'POST',
420
- `rs/sql/singleTable`,
421
- {data: data},
422
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
423
- )
424
-
425
- return res.data.map(item => {
426
- return {
427
- label: item.f_pcd,
428
- value: item.f_pcd
429
- }
430
- })
431
- },
432
- // 缴费前置
433
- chargeBefore () {
434
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
435
- this.$showAlert('费用未结清!!!', 'warning', 3000)
436
- throw null
437
- }
438
- },
439
- // 施工前置
440
- async constructionBefore () {
441
- let http = new HttpResetClass()
442
- let data = {
443
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
444
- }
445
- let res = await http.load(
446
- 'POST',
447
- 'rs/sql/countApplyUserinfo',
448
- {data: data},
449
- {
450
- resolveMsg: null,
451
- rejectMsg: '安装明细查询失败!!!'
452
- })
453
- if (res.data[0].num > 0) {
454
- this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
455
- throw `还有${res.data[0].num}户未安装,无法提交`
456
- }
457
- },
458
- changePipeBuild () {
459
- if (this.selectdata.f_process_dep === '工程部') {
460
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
461
- }
462
- if (this.selectdata.f_process_dep === '运营部') {
463
- return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
464
- }
465
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
466
- },
467
- async getDevInfo () {
468
- let data = {
469
- tablename: 't_dev_info',
470
- condition: `f_orgid = '${this.$login.f.orgid}'`
471
- }
472
- let http = new HttpResetClass()
473
- let res = await http.load(
474
- 'POST',
475
- `rs/sql/singleTable`,
476
- {data: data},
477
- {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
478
- )
479
-
480
- return res.data.map(item => {
481
- return {
482
- label: item.f_dev_name,
483
- value: item.f_dev_name
484
- }
485
- })
486
- },
487
- async getPrice (f_price_id) {
488
- console.log('=======================')
489
- console.log(f_price_id)
490
-
491
- let data = {
492
- condition: `sp.f_orgid = '${this.$login.f.orgid}'`
493
- }
494
-
495
- if (!isEmpty(f_price_id)) {
496
- data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
497
- }
498
- let http = new HttpResetClass()
499
- let res = await http.load(
500
- 'POST',
501
- `rs/sql/applyGetPrice`,
502
- {data: data},
503
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
504
- )
505
-
506
- return res.data.map(item => {
507
- return {
508
- label: item.f_price_name,
509
- value: item
510
- }
511
- })
512
- },
513
- addressInitialization () {
514
- this.$getConfig(this, 'UserAddress')
515
-
516
- let f_address_type = this.show_data.f_address_type
517
-
518
- for (const item of this.show_data.fields) {
519
- if (f_address_type === '民用市区') {
520
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
521
- item.hidden = false
522
- item.required = true
523
- }
524
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
525
- item.hidden = false
526
- item.required = false
527
- }
528
- if (item.label === '地址') {
529
- item.readonly = true
530
- }
531
- }
532
- if (f_address_type === '民用乡镇') {
533
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
534
- item.hidden = false
535
- item.required = true
536
- }
537
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
538
- item.hidden = false
539
- item.required = false
540
- }
541
- if (item.label === '楼层') {
542
- item.hidden = true
543
- item.required = false
544
- }
545
- if (item.label === '地址') {
546
- item.readonly = true
547
- }
548
- }
549
- if (f_address_type === '特殊地址') {
550
- if (item.label === '区/县' || item.label === '街道/乡镇') {
551
- item.hidden = false
552
- item.required = true
553
- }
554
- if (item.label === '集收单位') {
555
- item.hidden = false
556
- item.required = false
557
- }
558
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
559
- item.hidden = true
560
- item.required = false
561
- }
562
- if (item.label === '地址') {
563
- item.readonly = false
564
- }
565
- }
566
-
567
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
568
- item.hidden = true
569
- }
570
- }
571
- },
572
- async streetChange () {
573
- if (isEmpty(this.show_data.f_street)) {
574
- return
575
- }
576
-
577
- let data = {
578
- tablename: 't_area',
579
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
580
- }
581
- let http = new HttpResetClass()
582
- let res = await http.load(
583
- 'POST',
584
- `rs/sql/singleTable`,
585
- {data: data},
586
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
587
- )
588
-
589
- this.setLabelOptions('集收单位', res.data.map(item => {
590
- return {
591
- label: item.f_residential_area,
592
- value: item.f_residential_area
593
- }
594
- }))
595
- },
596
- async pcdChange () {
597
- if (isEmpty(this.show_data.f_pcd)) {
598
- return
599
- }
600
-
601
- let data = {
602
- tablename: 't_street',
603
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
604
- }
605
- let f_address_type = this.getLableValue('地址类型')
606
-
607
- if (f_address_type === '民用市区') {
608
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
609
- }
610
- if (f_address_type === '民用乡镇') {
611
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
612
- }
613
-
614
- let http = new HttpResetClass()
615
- let res = await http.load(
616
- 'POST',
617
- `rs/sql/singleTable`,
618
- {data: data},
619
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
620
- )
621
-
622
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
623
- return {
624
- label: item.f_street,
625
- value: item.f_street
626
- }
627
- }))
628
- },
629
- async addressTips () {
630
- let res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
631
- if (res == 'confirm') {
632
- return
633
- }
634
- throw '用户信息确认!!!'
635
- }
636
- },
637
- events: {
638
- 'buildReadyEvent' () {
639
- this.setLabelValue('施工单位', this.$login.f.name)
640
- this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
641
- },
642
- // 选择材料
643
- async materialNameChenge (index, fieldIndex) {
644
- let material = this.show_data.onetomany[index].fields[fieldIndex].value
645
-
646
- this.show_data.onetomany[index].fields.forEach(item => {
647
- if (material[item.field]) {
648
- item.value = material[item.field]
649
- }
650
- })
651
- },
652
- // 打开模态框获取材料
653
- async 'getMaterialName' (index) {
654
- let data = {
655
- condition: `1=1`
656
- }
657
- let http = new HttpResetClass()
658
- let res = await http.load(
659
- 'POST',
660
- `rs/sql/getStockMaterial`,
661
- {data: data},
662
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
663
- )
664
-
665
- this.show_data.onetomany[index].fields.forEach(field => {
666
- if (field.label === '选择材料') {
667
- field.options = res.data.map(item => {
668
- return {
669
- 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
670
- 'value': item
671
- }
672
- })
673
- }
674
- })
675
- },
676
- // 搜索小区
677
- async 'searchArea' (area, index) {
678
- let data = {
679
- tablename: 't_area',
680
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
681
- }
682
- let http = new HttpResetClass()
683
- let res = await http.load(
684
- 'POST',
685
- `rs/sql/singleTable`,
686
- {data: data},
687
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
688
- )
689
-
690
- if (res.data.length === 0) {
691
- return
692
- }
693
-
694
- this.setLabelOptions('集收单位', res.data.map(item => {
695
- return {
696
- label: item.f_residential_area,
697
- value: item.f_residential_area
698
- }
699
- }))
700
- },
701
- // 选择气价
702
- 'priceChange' (index) {
703
- if (isEmpty(this.show_data.stairPrice)) {
704
- return
705
- }
706
-
707
- let stairPrice = this.getLableValue('气价名称')
708
-
709
- this.setLabelValue('气价类型', stairPrice.f_price_type)
710
- this.setLabelValue('用气性质', stairPrice.f_gasproperties)
711
- this.setLabelValue('价格', stairPrice.f_price)
712
- this.setLabelValue('客户类型', stairPrice.f_user_type)
713
-
714
- this.show_data.f_price_id = stairPrice.f_price_id
715
- this.show_data.f_price_name = stairPrice.f_price_name
716
- },
717
- // 选择开发商
718
- async 'devInfoChange' (index) {
719
- if (isEmpty(this.show_data.f_company_name)) {
720
- return
721
- }
722
- let data = {
723
- tablename: 't_dev_info',
724
- condition: `f_orgid = '${this.$login.f.orgid}' and f_dev_name = '${this.show_data.f_company_name}'`
725
- }
726
- let res = await this.$resetpost(
727
- `rs/sql/singleTable`,
728
- {data: data},
729
- {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
730
- )
731
- this.show_data.f_dev_id = res.data[0].id
732
- this.show_data.f_dev_code = res.data[0].f_dev_code
733
- this.setLabelValue('法人名称', res.data[0].f_legal_person)
734
- this.setLabelValue('身份证', res.data[0].f_idnumber)
735
- this.setLabelValue('营业执照', res.data[0].f_license_num)
736
- },
737
- // 退款金额
738
- 'refundMoneyChange' (index) {
739
- let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
740
- let f_refund_money = this.show_data.fields[index].value
741
-
742
- if (f_refund_money > f_cumulative_payment_money) {
743
- this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
744
- this.show_data.fields[index].value = null
745
- }
746
- },
747
- // 检查重复
748
- 'checkRepeat' (index) {
749
- this.checkDuplicate(index)
750
- },
751
- // 选择报建项目
752
- 'selectApply' (row) {
753
- this.setLabelValue('工程名称', row.f_entry_name)
754
- this.setLabelValue('工程编号', row.f_apply_num)
755
- this.setLabelValue('报建类型', row.f_apply_type)
756
- this.setLabelValue('用户名称', row.f_user_name)
757
- this.setLabelValue('用户电话', row.f_phone)
758
- this.setLabelValue('证件类型', row.f_credentials)
759
- this.setLabelValue('证件号码', row.f_idnumber)
760
- this.setLabelValue('地址', row.f_address)
761
- this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
762
-
763
- this.show_data.parentApply = JSON.parse(JSON.stringify(row))
764
-
765
- delete row.id
766
- delete row.actid
767
- delete row.defid
768
- delete row.defname
769
- delete row.version
770
- delete row.f_apply_num
771
- delete row.f_sub_state
772
- delete row.f_apply_type
773
- delete row.f_process_id
774
-
775
- this.show_data = Object.assign({}, this.show_data, row)
776
-
777
- this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
778
- },
779
- // 是否终止
780
- 'isStopChange' (index) {
781
- let f_is_stop = this.show_data.f_is_stop
782
-
783
- for (const item of this.show_data.fields) {
784
- if (f_is_stop === '是') {
785
- if (item.label === '终止原因') {
786
- item.hidden = false
787
- item.required = true
788
- }
789
- } else {
790
- if (item.label === '终止原因') {
791
- item.hidden = true
792
- item.required = false
793
- }
794
- }
795
- }
796
- },
797
- // 终止报建初始化
798
- async 'stopApplyReadyEvent' () {
799
-
800
- let f_is_stop = this.getLableValue('是否终止')
801
-
802
- for (const item of this.show_data.fields) {
803
- if (f_is_stop === '是') {
804
- if (item.label === '终止原因') {
805
- item.hidden = false
806
- item.required = true
807
- }
808
- } else {
809
- if (item.label === '终止原因') {
810
- item.hidden = true
811
- item.required = false
812
- }
813
- }
814
- }
815
-
816
- if (isEmpty(this.show_data.f_parent_process_id)) {
817
- return
818
- }
819
- let data = {
820
- condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
821
- data: {
822
- id: this.$login.f.id,
823
- orgid: this.$login.f.orgid
824
- }
825
- }
826
- let res = await this.$resetpost(
827
- `rs/sql/supervisory`,
828
- {data: data},
829
- {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
830
- )
831
- this.show_data.parentApply = res.data[0]
832
- },
833
- // 选择用户档案信息
834
- 'selectUserinfo' (row) {
835
- this.setLabelValue('用户编号', row.f_userinfo_code)
836
- this.setLabelValue('用户名称', row.f_user_name)
837
- this.setLabelValue('用户电话', row.f_user_phone)
838
- this.setLabelValue('证件类型', row.f_credentials)
839
- this.setLabelValue('证件号码', row.f_idnumber)
840
- this.setLabelValue('地址', row.f_address)
841
-
842
- this.show_data.f_userinfo_id = row.f_userinfo_id
843
- this.show_data.f_userinfo_code = row.f_userinfo_code
844
- },
845
- // 是否购买保险
846
- async 'isInsureChange' (index) {
847
- if (!this.show_data.f_is_insure) {
848
- return
849
- }
850
- let f_is_insure = this.show_data.f_is_insure
851
- for (const item of this.show_data.fields) {
852
- if (f_is_insure === '是') {
853
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
854
- item.hidden = false
855
- item.required = true
856
- }
857
- if (item.label === '保险备注') {
858
- item.hidden = false
859
- }
860
- } else {
861
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
862
- item.hidden = true
863
- item.required = false
864
- }
865
- }
866
- }
867
- },
868
- // 通气点火初始化
869
- async 'gasReadyEvent' () {
870
- // 是否有气价信息
871
- if (!isEmpty(this.show_data.f_price_id)) {
872
- let priceList = await this.getPrice(this.show_data.f_price_id)
873
- this.setLabelValue('气价名称', priceList[0].value)
874
- }
875
-
876
- let data = {
877
- tablename: 't_userfees',
878
- condition: `f_orgid = '${this.$login.f.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
879
- }
880
- let http = new HttpResetClass()
881
- let res = await http.load(
882
- 'POST',
883
- `rs/sql/singleTable`,
884
- {data: data},
885
- {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
886
- )
887
- if (res.data.length > 0) {
888
- this.setLabelValue('待执行保险', '是')
889
- for (const item of this.show_data.fields) {
890
- if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
891
- item.hidden = true
892
- item.required = false
893
- item.value = null
894
- }
895
- }
896
- } else {
897
- this.setLabelValue('待执行保险', '否')
898
- for (const item of this.show_data.fields) {
899
- if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
900
- item.hidden = false
901
- item.required = true
902
- }
903
- }
904
- }
905
-
906
- // 保险初始化显示内容
907
- let f_is_insure = this.getLableValue('是否购买保险')
908
- for (const item of this.show_data.fields) {
909
- if (f_is_insure === '是') {
910
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
911
- item.hidden = false
912
- item.required = true
913
- }
914
- if (item.label === '保险备注') {
915
- item.hidden = false
916
- }
917
- // 本期保费到期时间默认一年
918
- if (isEmpty(this.selectdata.f_ins_expiration_date)) {
919
- let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
920
- this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
921
- }
922
- }
923
- if (f_is_insure === '否') {
924
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
925
- item.hidden = true
926
- item.required = false
927
- }
928
- }
929
- }
930
- },
931
- // 合同金额失去焦点
932
- async 'contractMoneyChange' (index) {
933
- let data = {
934
- operator: '+',
935
- num1: this.show_data.f_contract_money || 0,
936
- num2: this.getLableValue('追加金额') || 0
937
- }
938
- let res = await this.$resetpost(
939
- `rs/logic/compute`,
940
- {data: data},
941
- {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
942
- )
943
-
944
- this.setLabelValue('应交金额', res.data)
945
- },
946
- // 街道失去焦点
947
- async 'streetChange' (index) {
948
- if (isEmpty(this.show_data.f_street)) {
949
- return
950
- }
951
-
952
- this.setLabelValue('集收单位', null)
953
-
954
- let data = {
955
- tablename: 't_area',
956
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
957
- }
958
- let http = new HttpResetClass()
959
- let res = await http.load(
960
- 'POST',
961
- `rs/sql/singleTable`,
962
- {data: data},
963
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
964
- )
965
-
966
- this.setLabelOptions('集收单位', res.data.map(item => {
967
- return {
968
- label: item.f_residential_area,
969
- value: item.f_residential_area
970
- }
971
- }))
972
- },
973
- // 区县失去焦点
974
- async 'pcdChange' (index) {
975
- if (isEmpty(this.show_data.f_pcd)) {
976
- return
977
- }
978
-
979
- this.setLabelValue('街道/乡镇', null)
980
- this.setLabelValue('集收单位', null)
981
-
982
-
983
-
984
- let data = {
985
- tablename: 't_street',
986
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
987
- }
988
- let f_address_type = this.getLableValue('地址类型')
989
-
990
- if (f_address_type === '民用市区') {
991
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
992
- }
993
- if (f_address_type === '民用乡镇') {
994
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
995
- }
996
-
997
- let http = new HttpResetClass()
998
- let res = await http.load(
999
- 'POST',
1000
- `rs/sql/singleTable`,
1001
- {data: data},
1002
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1003
- )
1004
-
1005
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
1006
- return {
1007
- label: item.f_street,
1008
- value: item.f_street
1009
- }
1010
- }))
1011
- },
1012
- // 地址类型失去焦点
1013
- 'addressTypeChange' (index) {
1014
- this.setLabelValue('街道/乡镇', null)
1015
- this.setLabelValue('集收单位', null)
1016
- let f_address_type = this.show_data.fields[index].value
1017
- for (const item of this.show_data.fields) {
1018
- if (f_address_type === '民用市区') {
1019
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1020
- item.hidden = false
1021
- item.required = true
1022
- item.value = null
1023
- }
1024
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1025
- item.hidden = false
1026
- item.required = false
1027
- item.value = null
1028
- }
1029
- if (item.label === '地址') {
1030
- item.readonly = true
1031
- item.value = null
1032
- }
1033
- }
1034
- if (f_address_type === '民用乡镇') {
1035
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1036
- item.hidden = false
1037
- item.required = true
1038
- item.value = null
1039
- }
1040
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1041
- item.hidden = false
1042
- item.required = false
1043
- item.value = null
1044
- }
1045
- if (item.label === '楼层') {
1046
- item.hidden = true
1047
- item.required = false
1048
- item.value = null
1049
- }
1050
- if (item.label === '地址') {
1051
- item.readonly = true
1052
- item.value = null
1053
- }
1054
- }
1055
- if (f_address_type === '特殊地址') {
1056
- if (item.label === '区/县' || item.label === '街道/乡镇') {
1057
- item.hidden = false
1058
- item.required = true
1059
- item.value = null
1060
- }
1061
- if (item.label === '集收单位') {
1062
- item.hidden = false
1063
- item.required = false
1064
- item.value = null
1065
- }
1066
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1067
- item.hidden = true
1068
- item.required = false
1069
- item.value = null
1070
- }
1071
- if (item.label === '地址') {
1072
- item.readonly = false
1073
- item.value = null
1074
- }
1075
- }
1076
- }
1077
- },
1078
- // 团购转散户初始化
1079
- 'apply2ReadyEvent' () {
1080
- if (this.show_data.f_apply_source === '线下发起') {
1081
- this.addressInitialization()
1082
- this.hideLabels('用户编号')
1083
- this.electiveLabels('用户编号')
1084
- this.showLabels('片区', '地址类型')
1085
- this.requiredLabels('片区', '地址类型')
1086
- }
1087
- if (this.show_data.f_apply_source === '自动发起') {
1088
- this.hideLabels('片区', '地址类型')
1089
- this.electiveLabels('片区', '地址类型',)
1090
- }
1091
- },
1092
- // 申请节点初始化
1093
- 'applyReadyEvent' () {
1094
- this.addressInitialization()
1095
-
1096
- this.pcdChange()
1097
- this.streetChange()
1098
- },
1099
- // ===========================================
1100
- async 'button'() {
1101
- if (this.show_data.button.before) {
1102
- await this[this.show_data.button.before]()
1103
- }
1104
- // 点击重置按钮就重置数据
1105
- if (this.show_data.button.button_name === '重置') {
1106
- this.$dispatch('breakControl', this.selectdata)
1107
- return
1108
- }
1109
-
1110
- this.show_data.user = this.$login.f
1111
- this.show_data.start_activity = this.$workflow_vue.start_activity
1112
- this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1113
-
1114
- let res = await this.$resetpost(
1115
- `rs/logic/ApplyProductService`,
1116
- {data: this.show_data},
1117
- {resolveMsg: null, rejectMsg: '数据保存失败'}
1118
- )
1119
-
1120
- if (this.show_data.button.after) {
1121
- this[this.show_data.button.after]()
1122
- }
1123
- this.$dispatch('loadPage')
1124
- },
1125
- // 失去焦点出触发事件
1126
- 'onchange' (index) {
1127
- if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1128
- if (
1129
- this.show_data.fields[index].label === '区/县' ||
1130
- this.show_data.fields[index].label === '街道/乡镇' ||
1131
- this.show_data.fields[index].label === '集收单位' ||
1132
- this.show_data.fields[index].label === '楼号/组' ||
1133
- this.show_data.fields[index].label === '单元/排' ||
1134
- this.show_data.fields[index].label === '楼层' ||
1135
- this.show_data.fields[index].label === '门牌号'
1136
- ) {
1137
-
1138
- let f_pcd = this.getLableValue('区/县') || ''
1139
- let f_street = this.getLableValue('街道/乡镇') || ''
1140
- let f_residential_area = this.getLableValue('集收单位') || ''
1141
- let f_building = this.getLableValue('楼号/组') || ''
1142
- let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1143
- let f_unit = this.getLableValue('单元/排') || ''
1144
- let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1145
- let f_floor = this.getLableValue('楼层') || ''
1146
- let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1147
- let f_room = this.getLableValue('门牌号') || ''
1148
- let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1149
-
1150
- let f_address = f_pcd + f_street + f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
1151
- this.setLabelValue("地址", f_address)
1152
- }
1153
- }
1154
- },
1155
- selectSearch (val, index) {},
1156
- 'onblur' (index) {},
1157
- 'oninput' (index) {},
1158
- 'initializtionView' () {},
1159
- async 'onchangeModal' (index, fieldIndex) {
1160
- },
1161
- async 'onblurModal' (index, fieldIndex) {
1162
-
1163
- },
1164
- async 'oninputModal' (index, fieldIndex) {
1165
-
1166
- },
1167
- async 'onetomanydelete' (index, rowIndex) {
1168
-
1169
- let http = new HttpResetClass()
1170
-
1171
- let res = await http.load(
1172
- 'DELETE',
1173
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1174
- null,
1175
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
1176
- )
1177
-
1178
- res = await this.$resetpost(
1179
- 'rs/entity/t_apply',
1180
- this.show_data
1181
- )
1182
-
1183
- this.$dispatch('breakControl', this.show_data)
1184
- },
1185
- async 'onetomanyupdate' (index, rowIndex) {
1186
- let data = this.show_data.onetomany[index].rows[rowIndex]
1187
-
1188
- this.show_data.onetomany[index].fields.forEach(item => {
1189
- data[item.field] = item.value
1190
- })
1191
- let res = await this.$resetpost(
1192
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1193
- data
1194
- )
1195
-
1196
- res = await this.$resetpost(
1197
- 'rs/entity/t_apply',
1198
- this.show_data
1199
- )
1200
-
1201
- this.$dispatch('breakControl', this.show_data)
1202
- },
1203
- async 'onetomanyadd' (index) {
1204
- let data = {
1205
- f_process_id : this.show_data.f_process_id,
1206
- f_operator_id: this.$login.f.id,
1207
- f_operator: this.$login.f.name,
1208
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1209
- f_orgid: this.$login.f.orgid,
1210
- f_orgname: this.$login.f.orgs
1211
- }
1212
- this.show_data.onetomany[index].fields.forEach(item => {
1213
- data[item.field] = item.value
1214
- })
1215
- let res = await this.$resetpost(
1216
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1217
- data
1218
- )
1219
-
1220
- res = await this.$resetpost(
1221
- 'rs/entity/t_apply',
1222
- this.show_data
1223
- )
1224
-
1225
- this.$dispatch('breakControl', this.show_data)
1226
- },
1227
- async 'importEvent' (index, table, configName, filepath) {
1228
- let data = {
1229
- selectdata: this.show_data,
1230
- table: table,
1231
- filepath: filepath,
1232
- configName: configName,
1233
- user: this.$login.f
1234
- }
1235
-
1236
- let res = await this.$resetpost(
1237
- `rs/logic/importEvent`,
1238
- data
1239
- )
1240
-
1241
- this.$dispatch('breakControl', this.show_data)
1242
- },
1243
- 'onbutchange' (index) {
1244
-
1245
- },
1246
- 'onbutblur' (index) {
1247
-
1248
- },
1249
- 'onbutinput' (index) {
1250
-
1251
- }
1252
- },
1253
- watch: {
1254
- }
1255
- }
1256
- </script>
1257
- <style scoped>
1258
- /*清除model中的浮动*/
1259
- .clearfix:after,.clearfix:before{
1260
- display: table;
1261
- }
1262
- .clearfix:after{
1263
- clear: both;
1264
- }
1265
- </style>
1
+ <template>
2
+ <div class="" v-if="showview">
3
+ <show-back-reason :selectdata="show_data"></show-back-reason>
4
+ <service-view v-ref:serviceview :data="show_data"></service-view>
5
+ </div>
6
+ </template>
7
+ <script>
8
+ import Vue from 'vue'
9
+ import {HttpResetClass} from 'vue-client'
10
+ import {isEmpty} from "../../../Util";
11
+
12
+ // Date格式化
13
+ Date.prototype.Format = function (fmt) {
14
+ var o = {
15
+ "M+": this.getMonth() + 1, //月份
16
+ "d+": this.getDate(), //日
17
+ "H+": this.getHours(), //小时
18
+ "m+": this.getMinutes(), //分
19
+ "s+": this.getSeconds(), //秒
20
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
21
+ "S": this.getMilliseconds() //毫秒
22
+ };
23
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
24
+ for (var k in o)
25
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
26
+ return fmt;
27
+ }
28
+
29
+ export default {
30
+ title: '报建流程业务控制层',
31
+ props: ['selectdata'],
32
+ data () {
33
+ return {
34
+ data: null, // 数据库数据,json配置文件数据的数据集合
35
+ json_datas: null, // Json配置文件集合
36
+ showview: false, // 控制显示service-view组件
37
+ show_data: null, // 给view层显示的数据
38
+ config: {}
39
+ }
40
+ },
41
+ ready () {
42
+ this.refurbish()
43
+ },
44
+ methods: {
45
+ // 组件初始化操作
46
+ async refurbish() {
47
+ this.json_datas = this.$workflow_vue
48
+ let sum = 0
49
+ let jsonData = {}
50
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
51
+ this.$showMessage("网络故障,请刷新页面")
52
+ return
53
+ }
54
+ this.json_datas.activitys.forEach(item => {
55
+ if (this.selectdata.defname === item.title) {
56
+ jsonData = item // 拿到当前节点的json配置信息
57
+ sum++ // 节点名一样的个数
58
+ }
59
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
60
+ })
61
+
62
+ if (sum === 0) {
63
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
64
+ return
65
+ }
66
+ if (sum > 1) {
67
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
68
+ return
69
+ }
70
+
71
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
72
+
73
+ // fields 字段填充值
74
+ for (const item of this.selectdata.fields) {
75
+ if (!item.value) {
76
+ item.value = null
77
+ }
78
+
79
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
80
+ if (item.eval) {
81
+ item.value = eval(item.default)
82
+ } else {
83
+ item.value = item.default
84
+ }
85
+ }
86
+
87
+ if (this.selectdata[item.field]) {
88
+ // 将json字符串格式化赋值给value
89
+ if (String(this.selectdata[item.field]).startsWith("{")) {
90
+ item.value = JSON.parse(this.selectdata[item.field])
91
+ } else {
92
+ item.value = this.selectdata[item.field]
93
+ }
94
+ }
95
+ if (this.selectdata[item.field] === 0) {
96
+ item.value = 0
97
+ }
98
+
99
+ // datepicker
100
+ if (item.type === 'datepicker' && !item.value && item.default) {
101
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
102
+ }
103
+
104
+ // 如果配置类型为select,优先从参数列表获取options
105
+ if (item.type === 'select' || item.type === 'checkbox') {
106
+ if (item.param) {
107
+ let temp = this.$appdata.getParam(item.label)
108
+
109
+ if (temp && temp.length > 0) {
110
+ item.options = temp
111
+ }
112
+
113
+ if (item.paramLabel) {
114
+ temp = this.$appdata.getParam(item.paramLabel)
115
+ if (temp && temp.length > 0) {
116
+ item.options = temp
117
+ }
118
+ }
119
+ }
120
+
121
+ if (item.ready) {
122
+ item.options = await this[item.ready]()
123
+ }
124
+ }
125
+
126
+
127
+ if (item.type === 'checkbox') {
128
+ if (this.selectdata[item.field]) {
129
+ item.value = JSON.parse(this.selectdata[item.field])
130
+ } else {
131
+ item.value = []
132
+ }
133
+ }
134
+
135
+ this.selectdata[item.field] = item.value
136
+ }
137
+
138
+ // 控制组件
139
+ if (this.selectdata.components) {
140
+ this.selectdata.components.forEach(item => {
141
+ if (!item.mark) {
142
+ item.mark = 0
143
+ }
144
+ })
145
+ }
146
+
147
+ // 初始化onetomany
148
+ if (this.selectdata.onetomany) {
149
+ for (const item of this.selectdata.onetomany) {
150
+ let res = null
151
+ if (item.queryEvent) {
152
+ res = this[item.queryEvent]()
153
+ } else {
154
+ let data = {
155
+ tablename: item.tables[0],
156
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
157
+ }
158
+ res = await this.$resetpost(
159
+ 'rs/sql/singleTable',
160
+ {data: data},
161
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
162
+ )
163
+ }
164
+
165
+ item.rows = res.data
166
+
167
+ // 初始化onetomany中的fields
168
+ for (const field of item.fields) {
169
+ if (!field.value) {
170
+ if (field.value !== 0) {
171
+ field.value = null
172
+ }
173
+ }
174
+
175
+ if (field.default || field.default === 0) {
176
+ field.value = field.default
177
+ }
178
+
179
+ // datepicker
180
+ if (field.type === 'datepicker' && !field.value && field.default) {
181
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
182
+ }
183
+
184
+ if (field.type === 'select') {
185
+
186
+ let temp = this.$appdata.getParam(field.label)
187
+
188
+ if (temp && temp.length > 0) {
189
+ field.options = temp
190
+ }
191
+
192
+ if (field.paramLabel) {
193
+ temp = this.$appdata.getParam(field.paramLabel)
194
+ if (temp && temp.length > 0) {
195
+ item.options = temp
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ }
202
+
203
+ // 初始化 buttons_fields
204
+ for (const item of this.selectdata.buttons) {
205
+ if (item.button_name === '下发') {
206
+
207
+ let data = {
208
+ source: item.source,
209
+ userid: this.$login.f.id
210
+ }
211
+ if (item.sourceMethod) {
212
+ data.source = this[item.sourceMethod]()
213
+ }
214
+ if (!data.source) {
215
+ this.$showMessage("请配置获取人员表达式")
216
+ return
217
+ }
218
+
219
+ let res = await this.$resetpost(
220
+ 'rs/search',
221
+ {data: data},
222
+ {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
223
+ )
224
+
225
+ let options = res.data.map(source => {
226
+ return {
227
+ "label": source.name,
228
+ "value": source.id
229
+ }
230
+ })
231
+
232
+ if (item.button_fields.length !== 1) {
233
+ this.$showMessage("下发有且只能有一个字段!!!")
234
+ return
235
+ }
236
+
237
+ item.button_fields[0].options = options
238
+ }
239
+ if (item.button_fields) {
240
+ item.button_fields.forEach(x => {
241
+ // 如果配置类型为select,优先从参数列表获取options
242
+ if (x.type === 'select') {
243
+
244
+ if (x.param) {
245
+ let temp = this.$appdata.getParam(x.label)
246
+
247
+ if (temp && temp.length > 0) {
248
+ x.options = temp
249
+ }
250
+
251
+ if (x.paramLabel) {
252
+ temp = this.$appdata.getParam(x.paramLabel)
253
+ if (temp && temp.length > 0) {
254
+ x.options = temp
255
+ }
256
+ }
257
+ }
258
+
259
+ }
260
+ })
261
+ }
262
+ }
263
+
264
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
265
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
266
+
267
+ this.show_data = temp
268
+ this.$nextTick(() => {
269
+ this.showview = true
270
+ })
271
+ },
272
+ // 金额转大写
273
+ smalltoBIG(n) {
274
+ let fraction = ['角', '分'];
275
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
276
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
277
+ let head = n < 0 ? '欠' : '';
278
+ n = Math.abs(n);
279
+
280
+ let s = '';
281
+
282
+ for (var i = 0; i < fraction.length; i++) {
283
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
284
+ }
285
+ s = s || '整';
286
+ n = Math.floor(n);
287
+
288
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
289
+ let p = '';
290
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
291
+ p = digit[n % 10] + unit[1][j] + p;
292
+ n = Math.floor(n / 10);
293
+ }
294
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
295
+ }
296
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
297
+ },
298
+ getLableValue(label) {
299
+ for (const item of this.show_data.fields) {
300
+ if (item.label === label && item.type !== 'number') {
301
+ return item.value || ''
302
+ }
303
+ if (item.label === label && item.type === 'number') {
304
+ return item.value || 0
305
+ }
306
+ }
307
+ },
308
+ getLableOptions(label) {
309
+ for (const item of this.show_data.fields) {
310
+ if (item.label === label) {
311
+ return item.options
312
+ }
313
+ }
314
+ },
315
+ setLabelValue(label, value) {
316
+ for (const item of this.show_data.fields) {
317
+ if (item.label === label) {
318
+ item.value = value
319
+ this.show_data[item.field] = value
320
+ }
321
+ }
322
+ },
323
+ setLabelOptions(label, options) {
324
+ for (const item of this.show_data.fields) {
325
+ if (item.label === label) {
326
+ item.options = options
327
+ }
328
+ }
329
+ },
330
+ showLabels(...labels) {
331
+ for (const item of this.show_data.fields) {
332
+ if (labels.includes(item.label)) {
333
+ item.hidden = false
334
+ }
335
+ }
336
+ },
337
+ hideLabels(...labels) {
338
+ for (const item of this.show_data.fields) {
339
+ if (labels.includes(item.label)) {
340
+ item.hidden = true
341
+ }
342
+ }
343
+ },
344
+ requiredLabels(...labels) {
345
+ for (const item of this.show_data.fields) {
346
+ if (labels.includes(item.label)) {
347
+ item.required = true
348
+ }
349
+ }
350
+ },
351
+ electiveLabels(...labels) {
352
+ for (const item of this.show_data.fields) {
353
+ if (labels.includes(item.label)) {
354
+ item.required = false
355
+ }
356
+ }
357
+ },
358
+ readonlyLabels(...labels) {
359
+ for (const item of this.show_data.fields) {
360
+ if (labels.includes(item.label)) {
361
+ item.readonly = true
362
+ item.disabled = true
363
+ }
364
+ }
365
+ },
366
+ readwriteLabels(...labels) {
367
+ for (const item of this.show_data.fields) {
368
+ if (labels.includes(item.label)) {
369
+ item.readonly = false
370
+ item.disabled = false
371
+ }
372
+ }
373
+ },
374
+ async checkDuplicate(index) {
375
+ let http = new HttpResetClass()
376
+ let data = {
377
+ tablename: 't_apply',
378
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
379
+ }
380
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
381
+ resolveMsg: null,
382
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
383
+ })
384
+ if (res.data.length > 0) {
385
+ this.show_data.fields[index].value = null
386
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
387
+ }
388
+ },
389
+ // 获取片区
390
+ async getSliceArea () {
391
+ let data = {
392
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
393
+ userid: this.$login.f.id
394
+ }
395
+
396
+ let http = new HttpResetClass()
397
+ let res = await http.load(
398
+ 'POST',
399
+ `rs/search`,
400
+ {data: data},
401
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
402
+ )
403
+
404
+ return res.data.map(item => {
405
+ return {
406
+ label: item.name,
407
+ value: item.name
408
+ }
409
+ })
410
+ },
411
+ // 获取区县
412
+ async getPcd () {
413
+ let data = {
414
+ tablename: 't_pcd',
415
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
416
+ }
417
+ let http = new HttpResetClass()
418
+ let res = await http.load(
419
+ 'POST',
420
+ `rs/sql/singleTable`,
421
+ {data: data},
422
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
423
+ )
424
+
425
+ return res.data.map(item => {
426
+ return {
427
+ label: item.f_pcd,
428
+ value: item.f_pcd
429
+ }
430
+ })
431
+ },
432
+ // 缴费前置
433
+ chargeBefore () {
434
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
435
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
436
+ throw null
437
+ }
438
+ },
439
+ // 施工前置
440
+ async constructionBefore () {
441
+ let http = new HttpResetClass()
442
+ let data = {
443
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
444
+ }
445
+ let res = await http.load(
446
+ 'POST',
447
+ 'rs/sql/countApplyUserinfo',
448
+ {data: data},
449
+ {
450
+ resolveMsg: null,
451
+ rejectMsg: '安装明细查询失败!!!'
452
+ })
453
+ if (res.data[0].num > 0) {
454
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
455
+ throw `还有${res.data[0].num}户未安装,无法提交`
456
+ }
457
+ },
458
+ changePipeBuild () {
459
+ if (this.selectdata.f_process_dep === '工程部') {
460
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
461
+ }
462
+ if (this.selectdata.f_process_dep === '运营部') {
463
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
464
+ }
465
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
466
+ },
467
+ async getDevInfo () {
468
+ let data = {
469
+ tablename: 't_dev_info',
470
+ condition: `f_orgid = '${this.$login.f.orgid}'`
471
+ }
472
+ let http = new HttpResetClass()
473
+ let res = await http.load(
474
+ 'POST',
475
+ `rs/sql/singleTable`,
476
+ {data: data},
477
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
478
+ )
479
+
480
+ return res.data.map(item => {
481
+ return {
482
+ label: item.f_dev_name,
483
+ value: item.f_dev_name
484
+ }
485
+ })
486
+ },
487
+ async getPrice (f_price_id) {
488
+ console.log('=======================')
489
+ console.log(f_price_id)
490
+
491
+ let data = {
492
+ condition: `sp.f_orgid = '${this.$login.f.orgid}'`
493
+ }
494
+
495
+ if (!isEmpty(f_price_id)) {
496
+ data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
497
+ }
498
+ let http = new HttpResetClass()
499
+ let res = await http.load(
500
+ 'POST',
501
+ `rs/sql/applyGetPrice`,
502
+ {data: data},
503
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
504
+ )
505
+
506
+ return res.data.map(item => {
507
+ return {
508
+ label: item.f_price_name,
509
+ value: item
510
+ }
511
+ })
512
+ },
513
+ addressInitialization () {
514
+ this.$getConfig(this, 'UserAddress')
515
+
516
+ let f_address_type = this.show_data.f_address_type
517
+
518
+ for (const item of this.show_data.fields) {
519
+ if (f_address_type === '民用市区') {
520
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
521
+ item.hidden = false
522
+ item.required = true
523
+ }
524
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
525
+ item.hidden = false
526
+ item.required = false
527
+ }
528
+ if (item.label === '地址') {
529
+ item.readonly = true
530
+ }
531
+ }
532
+ if (f_address_type === '民用乡镇') {
533
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
534
+ item.hidden = false
535
+ item.required = true
536
+ }
537
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
538
+ item.hidden = false
539
+ item.required = false
540
+ }
541
+ if (item.label === '楼层') {
542
+ item.hidden = true
543
+ item.required = false
544
+ }
545
+ if (item.label === '地址') {
546
+ item.readonly = true
547
+ }
548
+ }
549
+ if (f_address_type === '特殊地址') {
550
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
551
+ item.hidden = false
552
+ item.required = true
553
+ }
554
+ if (item.label === '集收单位') {
555
+ item.hidden = false
556
+ item.required = false
557
+ }
558
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
559
+ item.hidden = true
560
+ item.required = false
561
+ }
562
+ if (item.label === '地址') {
563
+ item.readonly = false
564
+ }
565
+ }
566
+
567
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
568
+ item.hidden = true
569
+ }
570
+ }
571
+ },
572
+ async streetChange () {
573
+ if (isEmpty(this.show_data.f_street)) {
574
+ return
575
+ }
576
+
577
+ let data = {
578
+ tablename: 't_area',
579
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
580
+ }
581
+ let http = new HttpResetClass()
582
+ let res = await http.load(
583
+ 'POST',
584
+ `rs/sql/singleTable`,
585
+ {data: data},
586
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
587
+ )
588
+
589
+ this.setLabelOptions('集收单位', res.data.map(item => {
590
+ return {
591
+ label: item.f_residential_area,
592
+ value: item.f_residential_area
593
+ }
594
+ }))
595
+ },
596
+ async pcdChange () {
597
+ if (isEmpty(this.show_data.f_pcd)) {
598
+ return
599
+ }
600
+
601
+ let data = {
602
+ tablename: 't_street',
603
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
604
+ }
605
+ let f_address_type = this.getLableValue('地址类型')
606
+
607
+ if (f_address_type === '民用市区') {
608
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
609
+ }
610
+ if (f_address_type === '民用乡镇') {
611
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
612
+ }
613
+
614
+ let http = new HttpResetClass()
615
+ let res = await http.load(
616
+ 'POST',
617
+ `rs/sql/singleTable`,
618
+ {data: data},
619
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
620
+ )
621
+
622
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
623
+ return {
624
+ label: item.f_street,
625
+ value: item.f_street
626
+ }
627
+ }))
628
+ },
629
+ async addressTips () {
630
+ let res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
631
+ if (res == 'confirm') {
632
+ return
633
+ }
634
+ throw '用户信息确认!!!'
635
+ }
636
+ },
637
+ events: {
638
+ 'buildReadyEvent' () {
639
+ this.setLabelValue('施工单位', this.$login.f.name)
640
+ this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
641
+ },
642
+ // 选择材料
643
+ async materialNameChenge (index, fieldIndex) {
644
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
645
+
646
+ this.show_data.onetomany[index].fields.forEach(item => {
647
+ if (material[item.field]) {
648
+ item.value = material[item.field]
649
+ }
650
+ })
651
+ },
652
+ // 打开模态框获取材料
653
+ async 'getMaterialName' (index) {
654
+ let data = {
655
+ condition: `1=1`
656
+ }
657
+ let http = new HttpResetClass()
658
+ let res = await http.load(
659
+ 'POST',
660
+ `rs/sql/getStockMaterial`,
661
+ {data: data},
662
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
663
+ )
664
+
665
+ this.show_data.onetomany[index].fields.forEach(field => {
666
+ if (field.label === '选择材料') {
667
+ field.options = res.data.map(item => {
668
+ return {
669
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
670
+ 'value': item
671
+ }
672
+ })
673
+ }
674
+ })
675
+ },
676
+ // 搜索小区
677
+ async 'searchArea' (area, index) {
678
+ let data = {
679
+ tablename: 't_area',
680
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
681
+ }
682
+ let http = new HttpResetClass()
683
+ let res = await http.load(
684
+ 'POST',
685
+ `rs/sql/singleTable`,
686
+ {data: data},
687
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
688
+ )
689
+
690
+ if (res.data.length === 0) {
691
+ return
692
+ }
693
+
694
+ this.setLabelOptions('集收单位', res.data.map(item => {
695
+ return {
696
+ label: item.f_residential_area,
697
+ value: item.f_residential_area
698
+ }
699
+ }))
700
+ },
701
+ // 选择气价
702
+ 'priceChange' (index) {
703
+ if (isEmpty(this.show_data.stairPrice)) {
704
+ return
705
+ }
706
+
707
+ let stairPrice = this.getLableValue('气价名称')
708
+
709
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
710
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
711
+ this.setLabelValue('价格', stairPrice.f_price)
712
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
713
+
714
+ this.show_data.f_price_id = stairPrice.f_price_id
715
+ this.show_data.f_price_name = stairPrice.f_price_name
716
+ },
717
+ // 选择开发商
718
+ async 'devInfoChange' (index) {
719
+ if (isEmpty(this.show_data.f_company_name)) {
720
+ return
721
+ }
722
+ let data = {
723
+ tablename: 't_dev_info',
724
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_dev_name = '${this.show_data.f_company_name}'`
725
+ }
726
+ let res = await this.$resetpost(
727
+ `rs/sql/singleTable`,
728
+ {data: data},
729
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
730
+ )
731
+ this.show_data.f_dev_id = res.data[0].id
732
+ this.show_data.f_dev_code = res.data[0].f_dev_code
733
+ this.setLabelValue('法人名称', res.data[0].f_legal_person)
734
+ this.setLabelValue('身份证', res.data[0].f_idnumber)
735
+ this.setLabelValue('营业执照', res.data[0].f_license_num)
736
+ },
737
+ // 退款金额
738
+ 'refundMoneyChange' (index) {
739
+ let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
740
+ let f_refund_money = this.show_data.fields[index].value
741
+
742
+ if (f_refund_money > f_cumulative_payment_money) {
743
+ this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
744
+ this.show_data.fields[index].value = null
745
+ }
746
+ },
747
+ // 检查重复
748
+ 'checkRepeat' (index) {
749
+ this.checkDuplicate(index)
750
+ },
751
+ // 选择报建项目
752
+ 'selectApply' (row) {
753
+ this.setLabelValue('工程名称', row.f_entry_name)
754
+ this.setLabelValue('工程编号', row.f_apply_num)
755
+ this.setLabelValue('报建类型', row.f_apply_type)
756
+ this.setLabelValue('用户名称', row.f_user_name)
757
+ this.setLabelValue('用户电话', row.f_phone)
758
+ this.setLabelValue('证件类型', row.f_credentials)
759
+ this.setLabelValue('证件号码', row.f_idnumber)
760
+ this.setLabelValue('地址', row.f_address)
761
+ this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
762
+
763
+ this.show_data.parentApply = JSON.parse(JSON.stringify(row))
764
+
765
+ delete row.id
766
+ delete row.actid
767
+ delete row.defid
768
+ delete row.defname
769
+ delete row.version
770
+ delete row.f_apply_num
771
+ delete row.f_sub_state
772
+ delete row.f_apply_type
773
+ delete row.f_process_id
774
+
775
+ this.show_data = Object.assign({}, this.show_data, row)
776
+
777
+ this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
778
+ },
779
+ // 是否终止
780
+ 'isStopChange' (index) {
781
+ let f_is_stop = this.show_data.f_is_stop
782
+
783
+ for (const item of this.show_data.fields) {
784
+ if (f_is_stop === '是') {
785
+ if (item.label === '终止原因') {
786
+ item.hidden = false
787
+ item.required = true
788
+ }
789
+ } else {
790
+ if (item.label === '终止原因') {
791
+ item.hidden = true
792
+ item.required = false
793
+ }
794
+ }
795
+ }
796
+ },
797
+ // 终止报建初始化
798
+ async 'stopApplyReadyEvent' () {
799
+
800
+ let f_is_stop = this.getLableValue('是否终止')
801
+
802
+ for (const item of this.show_data.fields) {
803
+ if (f_is_stop === '是') {
804
+ if (item.label === '终止原因') {
805
+ item.hidden = false
806
+ item.required = true
807
+ }
808
+ } else {
809
+ if (item.label === '终止原因') {
810
+ item.hidden = true
811
+ item.required = false
812
+ }
813
+ }
814
+ }
815
+
816
+ if (isEmpty(this.show_data.f_parent_process_id)) {
817
+ return
818
+ }
819
+ let data = {
820
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
821
+ data: {
822
+ id: this.$login.f.id,
823
+ orgid: this.$login.f.orgid
824
+ }
825
+ }
826
+ let res = await this.$resetpost(
827
+ `rs/sql/supervisory`,
828
+ {data: data},
829
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
830
+ )
831
+ this.show_data.parentApply = res.data[0]
832
+ },
833
+ // 选择用户档案信息
834
+ 'selectUserinfo' (row) {
835
+ this.setLabelValue('用户编号', row.f_userinfo_code)
836
+ this.setLabelValue('用户名称', row.f_user_name)
837
+ this.setLabelValue('用户电话', row.f_user_phone)
838
+ this.setLabelValue('证件类型', row.f_credentials)
839
+ this.setLabelValue('证件号码', row.f_idnumber)
840
+ this.setLabelValue('地址', row.f_address)
841
+
842
+ this.show_data.f_userinfo_id = row.f_userinfo_id
843
+ this.show_data.f_userinfo_code = row.f_userinfo_code
844
+ },
845
+ // 是否购买保险
846
+ async 'isInsureChange' (index) {
847
+ if (!this.show_data.f_is_insure) {
848
+ return
849
+ }
850
+ let f_is_insure = this.show_data.f_is_insure
851
+ for (const item of this.show_data.fields) {
852
+ if (f_is_insure === '是') {
853
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
854
+ item.hidden = false
855
+ item.required = true
856
+ }
857
+ if (item.label === '保险备注') {
858
+ item.hidden = false
859
+ }
860
+ } else {
861
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
862
+ item.hidden = true
863
+ item.required = false
864
+ }
865
+ }
866
+ }
867
+ },
868
+ // 通气点火初始化
869
+ async 'gasReadyEvent' () {
870
+ // 是否有气价信息
871
+ if (!isEmpty(this.show_data.f_price_id)) {
872
+ let priceList = await this.getPrice(this.show_data.f_price_id)
873
+ this.setLabelValue('气价名称', priceList[0].value)
874
+ }
875
+
876
+ let data = {
877
+ tablename: 't_userfees',
878
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
879
+ }
880
+ let http = new HttpResetClass()
881
+ let res = await http.load(
882
+ 'POST',
883
+ `rs/sql/singleTable`,
884
+ {data: data},
885
+ {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
886
+ )
887
+ if (res.data.length > 0) {
888
+ this.setLabelValue('待执行保险', '是')
889
+ for (const item of this.show_data.fields) {
890
+ if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
891
+ item.hidden = true
892
+ item.required = false
893
+ item.value = null
894
+ }
895
+ }
896
+ } else {
897
+ this.setLabelValue('待执行保险', '否')
898
+ for (const item of this.show_data.fields) {
899
+ if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
900
+ item.hidden = false
901
+ item.required = true
902
+ }
903
+ }
904
+ }
905
+
906
+ // 保险初始化显示内容
907
+ let f_is_insure = this.getLableValue('是否购买保险')
908
+ for (const item of this.show_data.fields) {
909
+ if (f_is_insure === '是') {
910
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
911
+ item.hidden = false
912
+ item.required = true
913
+ }
914
+ if (item.label === '保险备注') {
915
+ item.hidden = false
916
+ }
917
+ // 本期保费到期时间默认一年
918
+ if (isEmpty(this.selectdata.f_ins_expiration_date)) {
919
+ let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
920
+ this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
921
+ }
922
+ }
923
+ if (f_is_insure === '否') {
924
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
925
+ item.hidden = true
926
+ item.required = false
927
+ }
928
+ }
929
+ }
930
+ },
931
+ // 合同金额失去焦点
932
+ async 'contractMoneyChange' (index) {
933
+ let data = {
934
+ operator: '+',
935
+ num1: this.show_data.f_contract_money || 0,
936
+ num2: this.getLableValue('追加金额') || 0
937
+ }
938
+ let res = await this.$resetpost(
939
+ `rs/logic/compute`,
940
+ {data: data},
941
+ {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
942
+ )
943
+
944
+ this.setLabelValue('应交金额', res.data)
945
+ },
946
+ // 街道失去焦点
947
+ async 'streetChange' (index) {
948
+ if (isEmpty(this.show_data.f_street)) {
949
+ return
950
+ }
951
+
952
+ this.setLabelValue('集收单位', null)
953
+
954
+ let data = {
955
+ tablename: 't_area',
956
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
957
+ }
958
+ let http = new HttpResetClass()
959
+ let res = await http.load(
960
+ 'POST',
961
+ `rs/sql/singleTable`,
962
+ {data: data},
963
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
964
+ )
965
+
966
+ this.setLabelOptions('集收单位', res.data.map(item => {
967
+ return {
968
+ label: item.f_residential_area,
969
+ value: item.f_residential_area
970
+ }
971
+ }))
972
+ },
973
+ // 区县失去焦点
974
+ async 'pcdChange' (index) {
975
+ if (isEmpty(this.show_data.f_pcd)) {
976
+ return
977
+ }
978
+
979
+ this.setLabelValue('街道/乡镇', null)
980
+ this.setLabelValue('集收单位', null)
981
+
982
+
983
+
984
+ let data = {
985
+ tablename: 't_street',
986
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
987
+ }
988
+ let f_address_type = this.getLableValue('地址类型')
989
+
990
+ if (f_address_type === '民用市区') {
991
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
992
+ }
993
+ if (f_address_type === '民用乡镇') {
994
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
995
+ }
996
+
997
+ let http = new HttpResetClass()
998
+ let res = await http.load(
999
+ 'POST',
1000
+ `rs/sql/singleTable`,
1001
+ {data: data},
1002
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1003
+ )
1004
+
1005
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
1006
+ return {
1007
+ label: item.f_street,
1008
+ value: item.f_street
1009
+ }
1010
+ }))
1011
+ },
1012
+ // 地址类型失去焦点
1013
+ 'addressTypeChange' (index) {
1014
+ this.setLabelValue('街道/乡镇', null)
1015
+ this.setLabelValue('集收单位', null)
1016
+ let f_address_type = this.show_data.fields[index].value
1017
+ for (const item of this.show_data.fields) {
1018
+ if (f_address_type === '民用市区') {
1019
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1020
+ item.hidden = false
1021
+ item.required = true
1022
+ item.value = null
1023
+ }
1024
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1025
+ item.hidden = false
1026
+ item.required = false
1027
+ item.value = null
1028
+ }
1029
+ if (item.label === '地址') {
1030
+ item.readonly = true
1031
+ item.value = null
1032
+ }
1033
+ }
1034
+ if (f_address_type === '民用乡镇') {
1035
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1036
+ item.hidden = false
1037
+ item.required = true
1038
+ item.value = null
1039
+ }
1040
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1041
+ item.hidden = false
1042
+ item.required = false
1043
+ item.value = null
1044
+ }
1045
+ if (item.label === '楼层') {
1046
+ item.hidden = true
1047
+ item.required = false
1048
+ item.value = null
1049
+ }
1050
+ if (item.label === '地址') {
1051
+ item.readonly = true
1052
+ item.value = null
1053
+ }
1054
+ }
1055
+ if (f_address_type === '特殊地址') {
1056
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
1057
+ item.hidden = false
1058
+ item.required = true
1059
+ item.value = null
1060
+ }
1061
+ if (item.label === '集收单位') {
1062
+ item.hidden = false
1063
+ item.required = false
1064
+ item.value = null
1065
+ }
1066
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1067
+ item.hidden = true
1068
+ item.required = false
1069
+ item.value = null
1070
+ }
1071
+ if (item.label === '地址') {
1072
+ item.readonly = false
1073
+ item.value = null
1074
+ }
1075
+ }
1076
+ }
1077
+ },
1078
+ // 团购转散户初始化
1079
+ 'apply2ReadyEvent' () {
1080
+ if (this.show_data.f_apply_source === '线下发起') {
1081
+ this.addressInitialization()
1082
+ this.hideLabels('用户编号')
1083
+ this.electiveLabels('用户编号')
1084
+ this.showLabels('片区', '地址类型')
1085
+ this.requiredLabels('片区', '地址类型')
1086
+ }
1087
+ if (this.show_data.f_apply_source === '自动发起') {
1088
+ this.hideLabels('片区', '地址类型')
1089
+ this.electiveLabels('片区', '地址类型',)
1090
+ }
1091
+ },
1092
+ // 申请节点初始化
1093
+ 'applyReadyEvent' () {
1094
+ this.addressInitialization()
1095
+
1096
+ this.pcdChange()
1097
+ this.streetChange()
1098
+ },
1099
+ // ===========================================
1100
+ async 'button'() {
1101
+ if (this.show_data.button.before) {
1102
+ await this[this.show_data.button.before]()
1103
+ }
1104
+ // 点击重置按钮就重置数据
1105
+ if (this.show_data.button.button_name === '重置') {
1106
+ this.$dispatch('breakControl', this.selectdata)
1107
+ return
1108
+ }
1109
+
1110
+ this.show_data.user = this.$login.f
1111
+ this.show_data.start_activity = this.$workflow_vue.start_activity
1112
+ this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1113
+
1114
+ let res = await this.$resetpost(
1115
+ `rs/logic/ApplyProductService`,
1116
+ {data: this.show_data},
1117
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1118
+ )
1119
+
1120
+ if (this.show_data.button.after) {
1121
+ this[this.show_data.button.after]()
1122
+ }
1123
+ this.$dispatch('loadPage')
1124
+ },
1125
+ // 失去焦点出触发事件
1126
+ 'onchange' (index) {
1127
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1128
+ if (
1129
+ this.show_data.fields[index].label === '区/县' ||
1130
+ this.show_data.fields[index].label === '街道/乡镇' ||
1131
+ this.show_data.fields[index].label === '集收单位' ||
1132
+ this.show_data.fields[index].label === '楼号/组' ||
1133
+ this.show_data.fields[index].label === '单元/排' ||
1134
+ this.show_data.fields[index].label === '楼层' ||
1135
+ this.show_data.fields[index].label === '门牌号'
1136
+ ) {
1137
+
1138
+ let f_pcd = this.getLableValue('区/县') || ''
1139
+ let f_street = this.getLableValue('街道/乡镇') || ''
1140
+ let f_residential_area = this.getLableValue('集收单位') || ''
1141
+ let f_building = this.getLableValue('楼号/组') || ''
1142
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1143
+ let f_unit = this.getLableValue('单元/排') || ''
1144
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1145
+ let f_floor = this.getLableValue('楼层') || ''
1146
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1147
+ let f_room = this.getLableValue('门牌号') || ''
1148
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1149
+
1150
+ let f_address = f_pcd + f_street + f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
1151
+ this.setLabelValue("地址", f_address)
1152
+ }
1153
+ }
1154
+ },
1155
+ selectSearch (val, index) {},
1156
+ 'onblur' (index) {},
1157
+ 'oninput' (index) {},
1158
+ 'initializtionView' () {},
1159
+ async 'onchangeModal' (index, fieldIndex) {
1160
+ },
1161
+ async 'onblurModal' (index, fieldIndex) {
1162
+
1163
+ },
1164
+ async 'oninputModal' (index, fieldIndex) {
1165
+
1166
+ },
1167
+ async 'onetomanydelete' (index, rowIndex) {
1168
+
1169
+ let http = new HttpResetClass()
1170
+
1171
+ let res = await http.load(
1172
+ 'DELETE',
1173
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1174
+ null,
1175
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1176
+ )
1177
+
1178
+ res = await this.$resetpost(
1179
+ 'rs/entity/t_apply',
1180
+ this.show_data
1181
+ )
1182
+
1183
+ this.$dispatch('breakControl', this.show_data)
1184
+ },
1185
+ async 'onetomanyupdate' (index, rowIndex) {
1186
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1187
+
1188
+ this.show_data.onetomany[index].fields.forEach(item => {
1189
+ data[item.field] = item.value
1190
+ })
1191
+ let res = await this.$resetpost(
1192
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1193
+ data
1194
+ )
1195
+
1196
+ res = await this.$resetpost(
1197
+ 'rs/entity/t_apply',
1198
+ this.show_data
1199
+ )
1200
+
1201
+ this.$dispatch('breakControl', this.show_data)
1202
+ },
1203
+ async 'onetomanyadd' (index) {
1204
+ let data = {
1205
+ f_process_id : this.show_data.f_process_id,
1206
+ f_operator_id: this.$login.f.id,
1207
+ f_operator: this.$login.f.name,
1208
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1209
+ f_orgid: this.$login.f.orgid,
1210
+ f_orgname: this.$login.f.orgs
1211
+ }
1212
+ this.show_data.onetomany[index].fields.forEach(item => {
1213
+ data[item.field] = item.value
1214
+ })
1215
+ let res = await this.$resetpost(
1216
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1217
+ data
1218
+ )
1219
+
1220
+ res = await this.$resetpost(
1221
+ 'rs/entity/t_apply',
1222
+ this.show_data
1223
+ )
1224
+
1225
+ this.$dispatch('breakControl', this.show_data)
1226
+ },
1227
+ async 'importEvent' (index, table, configName, filepath) {
1228
+ let data = {
1229
+ selectdata: this.show_data,
1230
+ table: table,
1231
+ filepath: filepath,
1232
+ configName: configName,
1233
+ user: this.$login.f
1234
+ }
1235
+
1236
+ let res = await this.$resetpost(
1237
+ `rs/logic/importEvent`,
1238
+ data
1239
+ )
1240
+
1241
+ this.$dispatch('breakControl', this.show_data)
1242
+ },
1243
+ 'onbutchange' (index) {
1244
+
1245
+ },
1246
+ 'onbutblur' (index) {
1247
+
1248
+ },
1249
+ 'onbutinput' (index) {
1250
+
1251
+ }
1252
+ },
1253
+ watch: {
1254
+ }
1255
+ }
1256
+ </script>
1257
+ <style scoped>
1258
+ /*清除model中的浮动*/
1259
+ .clearfix:after,.clearfix:before{
1260
+ display: table;
1261
+ }
1262
+ .clearfix:after{
1263
+ clear: both;
1264
+ }
1265
+ </style>