apply-clients 3.3.92 → 3.3.95

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.
@@ -1,1430 +1,1430 @@
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
- disabledButtons(...buttons) {
375
- for (const item of this.show_data.buttons) {
376
- if (buttons.includes(item.button_name)) {
377
- item.disabled = true
378
- }
379
- }
380
- },
381
- enableButtons(...buttons) {
382
- for (const item of this.show_data.buttons) {
383
- if (buttons.includes(item.button_name)) {
384
- item.disabled = false
385
- }
386
- }
387
- },
388
- showButtons(...buttons) {
389
- for (const item of this.show_data.buttons) {
390
- if (buttons.includes(item.button_name)) {
391
- item.hidden = false
392
- }
393
- }
394
- },
395
- hideButtons(...buttons) {
396
- for (const item of this.show_data.buttons) {
397
- if (buttons.includes(item.button_name)) {
398
- item.hidden = true
399
- }
400
- }
401
- },
402
- async checkDuplicate(index) {
403
- let http = new HttpResetClass()
404
- let data = {
405
- tablename: 't_apply',
406
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
407
- }
408
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
409
- resolveMsg: null,
410
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
411
- })
412
- if (res.data.length > 0) {
413
- this.show_data.fields[index].value = null
414
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
415
- }
416
- },
417
- // 获取片区
418
- async getSliceArea () {
419
- let data = {
420
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
421
- userid: this.$login.f.id
422
- }
423
-
424
- let http = new HttpResetClass()
425
- let res = await http.load(
426
- 'POST',
427
- `rs/search`,
428
- {data: data},
429
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
430
- )
431
-
432
- return res.data.map(item => {
433
- return {
434
- label: item.name,
435
- value: item.name
436
- }
437
- })
438
- },
439
- // 获取区县
440
- async getPcd () {
441
- let data = {
442
- tablename: 't_pcd',
443
- condition: `f_filialeid = '${this.$login.f.orgid}'`
444
- }
445
- let http = new HttpResetClass()
446
- let res = await http.load(
447
- 'POST',
448
- `rs/sql/singleTable`,
449
- {data: data},
450
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
451
- )
452
-
453
- return res.data.map(item => {
454
- return {
455
- label: item.f_pcd,
456
- value: item.f_pcd
457
- }
458
- })
459
- },
460
- // 缴费前置
461
- chargeBefore () {
462
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
463
- this.$showAlert('费用未结清!!!', 'warning', 3000)
464
- throw null
465
- }
466
- },
467
- // 施工前置
468
- async constructionBefore () {
469
- let http = new HttpResetClass()
470
- let data = {
471
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
472
- }
473
- let res = await http.load(
474
- 'POST',
475
- 'rs/sql/countApplyUserinfo',
476
- {data: data},
477
- {
478
- resolveMsg: null,
479
- rejectMsg: '安装明细查询失败!!!'
480
- })
481
- if (res.data[0].num > 0) {
482
- this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
483
- throw `还有${res.data[0].num}户未安装,无法提交`
484
- }
485
- },
486
- changePipeBuild () {
487
- if (this.selectdata.f_process_dep === '工程部') {
488
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
489
- }
490
- if (this.selectdata.f_process_dep === '运营部') {
491
- return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
492
- }
493
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
494
- },
495
- async getDevInfo () {
496
- let data = {
497
- tablename: 't_dev_info',
498
- condition: `f_orgid = '${this.$login.f.orgid}'`
499
- }
500
- let http = new HttpResetClass()
501
- let res = await http.load(
502
- 'POST',
503
- `rs/sql/singleTable`,
504
- {data: data},
505
- {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
506
- )
507
-
508
- return res.data.map(item => {
509
- return {
510
- label: item.f_dev_name,
511
- value: item.f_dev_name
512
- }
513
- })
514
- },
515
- async getPrice (f_price_id) {
516
- console.log('=======================')
517
- console.log(f_price_id)
518
-
519
- let data = {
520
- condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
521
- }
522
-
523
- if (!isEmpty(f_price_id)) {
524
- data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
525
- }
526
- let http = new HttpResetClass()
527
- let res = await http.load(
528
- 'POST',
529
- `rs/sql/applyGetPrice`,
530
- {data: data},
531
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
532
- )
533
-
534
- return res.data.map(item => {
535
- return {
536
- label: item.f_price_name,
537
- value: item
538
- }
539
- })
540
- },
541
- addressInitialization () {
542
- this.$getConfig(this, 'UserAddress')
543
-
544
- let f_address_type = this.show_data.f_address_type
545
-
546
- for (const item of this.show_data.fields) {
547
- if (f_address_type === '民用市区') {
548
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
549
- item.hidden = false
550
- item.required = true
551
- }
552
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
553
- item.hidden = false
554
- item.required = false
555
- }
556
- if (item.label === '地址') {
557
- item.readonly = true
558
- }
559
- }
560
- if (f_address_type === '民用乡镇') {
561
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
562
- item.hidden = false
563
- item.required = true
564
- }
565
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
566
- item.hidden = false
567
- item.required = false
568
- }
569
- if (item.label === '楼层') {
570
- item.hidden = true
571
- item.required = false
572
- }
573
- if (item.label === '地址') {
574
- item.readonly = true
575
- }
576
- }
577
- if (f_address_type === '特殊地址') {
578
- if (item.label === '区/县' || item.label === '街道/乡镇') {
579
- item.hidden = false
580
- item.required = true
581
- }
582
- if (item.label === '集收单位') {
583
- item.hidden = false
584
- item.required = false
585
- }
586
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
587
- item.hidden = true
588
- item.required = false
589
- }
590
- if (item.label === '地址') {
591
- item.readonly = false
592
- }
593
- }
594
-
595
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
596
- item.hidden = true
597
- }
598
- }
599
- },
600
- async streetChange () {
601
- if (isEmpty(this.show_data.f_street)) {
602
- return
603
- }
604
-
605
- let data = {
606
- tablename: 't_area',
607
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
608
- }
609
- let http = new HttpResetClass()
610
- let res = await http.load(
611
- 'POST',
612
- `rs/sql/singleTable`,
613
- {data: data},
614
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
615
- )
616
-
617
- this.setLabelOptions('集收单位', res.data.map(item => {
618
- return {
619
- label: item.f_residential_area,
620
- value: item.f_residential_area
621
- }
622
- }))
623
- },
624
- async pcdChange () {
625
- if (isEmpty(this.show_data.f_pcd)) {
626
- return
627
- }
628
-
629
- let data = {
630
- tablename: 't_street',
631
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
632
- }
633
- let f_address_type = this.getLableValue('地址类型')
634
-
635
- if (f_address_type === '民用市区') {
636
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
637
- }
638
- if (f_address_type === '民用乡镇') {
639
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
640
- }
641
-
642
- let http = new HttpResetClass()
643
- let res = await http.load(
644
- 'POST',
645
- `rs/sql/singleTable`,
646
- {data: data},
647
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
648
- )
649
-
650
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
651
- return {
652
- label: item.f_street,
653
- value: item.f_street
654
- }
655
- }))
656
- },
657
- async addressTips () {
658
- // console.log('======================='+this.show_data.f_apply_type)
659
- let res = ''
660
- if (this.show_data.f_apply_type === '报警器报建') {
661
- res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
662
- }else{
663
- res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
664
- }
665
- if (res == 'confirm') {
666
- return
667
- }
668
- throw '用户信息确认!!!'
669
- },
670
- async getDesignerPeople () {
671
- let data = {
672
- source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
673
- userid: this.$login.f.id
674
- }
675
-
676
- let http = new HttpResetClass()
677
- let res = await http.load(
678
- 'POST',
679
- `rs/search`,
680
- {data: data},
681
- {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
682
- )
683
-
684
- return res.data.map(item => {
685
- return {
686
- label: item.name,
687
- value: item.id
688
- }
689
- })
690
- },
691
- async surveyStopApply () {
692
- console.log('终止报建!!!!!')
693
-
694
- this.show_data.f_stop_reason = '现场勘察不符合报装条件'
695
-
696
- let data = {
697
- data: this.show_data,
698
- user: this.$login.f
699
- }
700
-
701
- let res = await this.$resetpost(
702
- `rs/logic/surveyStopApply`,
703
- {data: data},
704
- {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
705
- )
706
-
707
- this.$dispatch('loadPage')
708
-
709
- throw '终止报建!!!'
710
- }
711
- },
712
- events: {
713
- 'complyInstallation' (index) {
714
- if (this.show_data.f_is_have === '否') {
715
- this.hideButtons('提交', '出图', '缴费')
716
- this.showButtons('终止')
717
- }
718
- if (this.show_data.f_is_have === '是') {
719
- this.hideButtons('终止')
720
- this.showButtons('提交', '出图', '缴费')
721
- }
722
- },
723
- async 'igniteDispatchReadyEvent' () {
724
- let data = {
725
- tablename: 'activityins',
726
- condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
727
- }
728
- let http = new HttpResetClass()
729
- let res = await http.load(
730
- 'POST',
731
- `rs/sql/singleTable`,
732
- {data: data},
733
- {resolveMsg: null, rejectMsg: '查询失败!!!'}
734
- )
735
- if (res.data.length <= 0) {
736
- console.log('+++++++++++++++++++++++++++++')
737
- console.log('没有施工,不能退回')
738
- this.hideButtons('退回')
739
- }
740
- },
741
- 'buildReadyEvent' () {
742
- this.setLabelValue('施工单位', this.$login.f.name)
743
- this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
744
- },
745
- // 选择材料
746
- async materialNameChenge (index, fieldIndex) {
747
- let material = this.show_data.onetomany[index].fields[fieldIndex].value
748
-
749
- this.show_data.onetomany[index].fields.forEach(item => {
750
- if (material[item.field]) {
751
- item.value = material[item.field]
752
- }
753
- })
754
- },
755
- // 打开模态框获取材料
756
- async 'getMaterialName' (index) {
757
- let data = {
758
- condition: `1=1`
759
- }
760
- let http = new HttpResetClass()
761
- let res = await http.load(
762
- 'POST',
763
- `rs/sql/getStockMaterial`,
764
- {data: data},
765
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
766
- )
767
-
768
- this.show_data.onetomany[index].fields.forEach(field => {
769
- if (field.label === '选择材料') {
770
- field.options = res.data.map(item => {
771
- return {
772
- 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
773
- 'value': item
774
- }
775
- })
776
- }
777
- })
778
- },
779
- // 搜索小区
780
- async 'searchArea' (area, index) {
781
- let data = {
782
- tablename: 't_area',
783
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
784
- }
785
- let http = new HttpResetClass()
786
- let res = await http.load(
787
- 'POST',
788
- `rs/sql/singleTable`,
789
- {data: data},
790
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
791
- )
792
-
793
- if (res.data.length === 0) {
794
- return
795
- }
796
-
797
- this.setLabelOptions('集收单位', res.data.map(item => {
798
- return {
799
- label: item.f_residential_area,
800
- value: item.f_residential_area
801
- }
802
- }))
803
- },
804
- // 选择气价
805
- 'priceChange' (index) {
806
- if (isEmpty(this.show_data.stairPrice)) {
807
- return
808
- }
809
-
810
- let stairPrice = this.getLableValue('气价名称')
811
-
812
- this.setLabelValue('气价类型', stairPrice.f_price_type)
813
- this.setLabelValue('用气性质', stairPrice.f_gasproperties)
814
- this.setLabelValue('价格', stairPrice.f_price)
815
- this.setLabelValue('客户类型', stairPrice.f_user_type)
816
-
817
- this.show_data.f_price_id = stairPrice.f_price_id
818
- this.show_data.f_price_name = stairPrice.f_price_name
819
- },
820
- // 选择开发商
821
- async 'devInfoChange' (index) {
822
- if (isEmpty(this.show_data.f_company_name)) {
823
- return
824
- }
825
- let data = {
826
- tablename: 't_dev_info',
827
- condition: `f_orgid = '${this.$login.f.orgid}' and f_dev_name = '${this.show_data.f_company_name}'`
828
- }
829
- let res = await this.$resetpost(
830
- `rs/sql/singleTable`,
831
- {data: data},
832
- {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
833
- )
834
- this.show_data.f_dev_id = res.data[0].id
835
- this.show_data.f_dev_code = res.data[0].f_dev_code
836
- this.setLabelValue('法人名称', res.data[0].f_legal_person)
837
- this.setLabelValue('身份证', res.data[0].f_idnumber)
838
- this.setLabelValue('营业执照', res.data[0].f_license_num)
839
- },
840
- // 退款金额
841
- 'refundMoneyChange' (index) {
842
- let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
843
- let f_refund_money = this.show_data.fields[index].value
844
-
845
- if (f_refund_money > f_cumulative_payment_money) {
846
- this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
847
- this.show_data.fields[index].value = null
848
- }
849
- },
850
- // 检查重复
851
- 'checkRepeat' (index) {
852
- this.checkDuplicate(index)
853
- },
854
- // 选择报建项目
855
- 'selectApply' (row) {
856
- this.setLabelValue('工程名称', row.f_entry_name)
857
- this.setLabelValue('工程编号', row.f_apply_num)
858
- this.setLabelValue('报建类型', row.f_apply_type)
859
- this.setLabelValue('用户名称', row.f_user_name)
860
- this.setLabelValue('用户电话', row.f_phone)
861
- this.setLabelValue('证件类型', row.f_credentials)
862
- this.setLabelValue('证件号码', row.f_idnumber)
863
- this.setLabelValue('地址', row.f_address)
864
- this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
865
-
866
- this.show_data.parentApply = JSON.parse(JSON.stringify(row))
867
-
868
- delete row.id
869
- delete row.actid
870
- delete row.defid
871
- delete row.defname
872
- delete row.version
873
- delete row.f_apply_num
874
- delete row.f_sub_state
875
- delete row.f_apply_type
876
- delete row.f_process_id
877
-
878
- this.show_data = Object.assign({}, this.show_data, row)
879
-
880
- this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
881
- },
882
- // 是否终止
883
- 'isStopChange' (index) {
884
- let f_is_stop = this.show_data.f_is_stop
885
-
886
- for (const item of this.show_data.fields) {
887
- if (f_is_stop === '是') {
888
- if (item.label === '终止原因') {
889
- item.hidden = false
890
- item.required = true
891
- }
892
- } else {
893
- if (item.label === '终止原因') {
894
- item.hidden = true
895
- item.required = false
896
- }
897
- }
898
- }
899
- },
900
- // 终止报建初始化
901
- async 'stopApplyReadyEvent' () {
902
-
903
- let f_is_stop = this.getLableValue('是否终止')
904
-
905
- for (const item of this.show_data.fields) {
906
- if (f_is_stop === '是') {
907
- if (item.label === '终止原因') {
908
- item.hidden = false
909
- item.required = true
910
- }
911
- } else {
912
- if (item.label === '终止原因') {
913
- item.hidden = true
914
- item.required = false
915
- }
916
- }
917
- }
918
-
919
- if (isEmpty(this.show_data.f_parent_process_id)) {
920
- return
921
- }
922
- let data = {
923
- condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
924
- data: {
925
- id: this.$login.f.id,
926
- orgid: this.$login.f.orgid
927
- }
928
- }
929
- let res = await this.$resetpost(
930
- `rs/sql/supervisory`,
931
- {data: data},
932
- {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
933
- )
934
- this.show_data.parentApply = res.data[0]
935
- },
936
- // 选择用户档案信息
937
- 'selectUserinfo' (row) {
938
- this.setLabelValue('用户编号', row.f_userinfo_code)
939
- this.setLabelValue('用户名称', row.f_user_name)
940
- this.setLabelValue('用户电话', row.f_user_phone)
941
- this.setLabelValue('证件类型', row.f_credentials)
942
- this.setLabelValue('证件号码', row.f_idnumber)
943
- this.setLabelValue('地址', row.f_address)
944
-
945
- this.show_data.f_userinfo_id = row.f_userinfo_id
946
- this.show_data.f_userinfo_code = row.f_userinfo_code
947
- },
948
- // 是否购买保险
949
- async 'isInsureChange' (index) {
950
- if (!this.show_data.f_is_insure) {
951
- return
952
- }
953
- let f_is_insure = this.show_data.f_is_insure
954
- for (const item of this.show_data.fields) {
955
- if (f_is_insure === '是') {
956
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
957
- item.hidden = false
958
- item.required = true
959
- }
960
- if (item.label === '保险备注') {
961
- item.hidden = false
962
- }
963
- } else {
964
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
965
- item.hidden = true
966
- item.required = false
967
- }
968
- }
969
- }
970
- },
971
- // 通气点火初始化
972
- async 'gasReadyEvent' () {
973
- // 是否有气价信息
974
- if (!isEmpty(this.show_data.f_price_id)) {
975
- let priceList = await this.getPrice(this.show_data.f_price_id)
976
- this.setLabelValue('气价名称', priceList[0].value)
977
- }
978
-
979
- let data = {
980
- tablename: 't_userfees',
981
- condition: `f_orgid = '${this.$login.f.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
982
- }
983
- let http = new HttpResetClass()
984
- let res = await http.load(
985
- 'POST',
986
- `rs/sql/singleTable`,
987
- {data: data},
988
- {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
989
- )
990
- if (res.data.length > 0) {
991
- this.setLabelValue('待执行保险', '是')
992
- for (const item of this.show_data.fields) {
993
- if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
994
- item.hidden = true
995
- item.required = false
996
- item.value = null
997
- }
998
- }
999
- } else {
1000
- this.setLabelValue('待执行保险', '否')
1001
- for (const item of this.show_data.fields) {
1002
- if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1003
- item.hidden = false
1004
- item.required = true
1005
- }
1006
- }
1007
- }
1008
-
1009
- // 保险初始化显示内容
1010
- let f_is_insure = this.getLableValue('是否购买保险')
1011
- for (const item of this.show_data.fields) {
1012
- if (f_is_insure === '是') {
1013
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1014
- item.hidden = false
1015
- item.required = true
1016
- }
1017
- if (item.label === '保险备注') {
1018
- item.hidden = false
1019
- }
1020
- // 本期保费到期时间默认一年
1021
- if (isEmpty(this.selectdata.f_ins_expiration_date)) {
1022
- let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
1023
- this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
1024
- }
1025
- }
1026
- if (f_is_insure === '否') {
1027
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1028
- item.hidden = true
1029
- item.required = false
1030
- }
1031
- }
1032
- }
1033
- },
1034
- // 合同金额失去焦点
1035
- async 'contractMoneyChange' (index) {
1036
- let data = {
1037
- operator: '+',
1038
- num1: this.show_data.f_contract_money || 0,
1039
- num2: this.getLableValue('追加金额') || 0
1040
- }
1041
- let res = await this.$resetpost(
1042
- `rs/logic/compute`,
1043
- {data: data},
1044
- {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1045
- )
1046
-
1047
- this.setLabelValue('应交金额', res.data)
1048
- },
1049
- // 街道失去焦点
1050
- async 'streetChange' (index) {
1051
- if (isEmpty(this.show_data.f_street)) {
1052
- return
1053
- }
1054
-
1055
- this.setLabelValue('集收单位', null)
1056
-
1057
- let data = {
1058
- tablename: 't_area',
1059
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1060
- }
1061
- let http = new HttpResetClass()
1062
- let res = await http.load(
1063
- 'POST',
1064
- `rs/sql/singleTable`,
1065
- {data: data},
1066
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1067
- )
1068
-
1069
- this.setLabelOptions('集收单位', res.data.map(item => {
1070
- return {
1071
- label: item.f_residential_area,
1072
- value: item.f_residential_area
1073
- }
1074
- }))
1075
- },
1076
- // 区县失去焦点
1077
- async 'pcdChange' (index) {
1078
- if (isEmpty(this.show_data.f_pcd)) {
1079
- return
1080
- }
1081
-
1082
- this.setLabelValue('街道/乡镇', null)
1083
- this.setLabelValue('集收单位', null)
1084
-
1085
-
1086
-
1087
- let data = {
1088
- tablename: 't_street',
1089
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1090
- }
1091
- let f_address_type = this.getLableValue('地址类型')
1092
-
1093
- if (f_address_type === '民用市区') {
1094
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1095
- }
1096
- if (f_address_type === '民用乡镇') {
1097
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1098
- }
1099
-
1100
- let http = new HttpResetClass()
1101
- let res = await http.load(
1102
- 'POST',
1103
- `rs/sql/singleTable`,
1104
- {data: data},
1105
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1106
- )
1107
-
1108
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
1109
- return {
1110
- label: item.f_street,
1111
- value: item.f_street
1112
- }
1113
- }))
1114
- },
1115
- // 地址类型失去焦点
1116
- 'addressTypeChange' (index) {
1117
- this.setLabelValue('街道/乡镇', null)
1118
- this.setLabelValue('集收单位', null)
1119
- let f_address_type = this.show_data.fields[index].value
1120
- for (const item of this.show_data.fields) {
1121
- if (f_address_type === '民用市区') {
1122
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1123
- item.hidden = false
1124
- item.required = true
1125
- item.value = null
1126
- }
1127
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1128
- item.hidden = false
1129
- item.required = false
1130
- item.value = null
1131
- }
1132
- if (item.label === '地址') {
1133
- item.readonly = true
1134
- item.value = null
1135
- }
1136
- }
1137
- if (f_address_type === '民用乡镇') {
1138
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1139
- item.hidden = false
1140
- item.required = true
1141
- item.value = null
1142
- }
1143
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1144
- item.hidden = false
1145
- item.required = false
1146
- item.value = null
1147
- }
1148
- if (item.label === '楼层') {
1149
- item.hidden = true
1150
- item.required = false
1151
- item.value = null
1152
- }
1153
- if (item.label === '地址') {
1154
- item.readonly = true
1155
- item.value = null
1156
- }
1157
- }
1158
- if (f_address_type === '特殊地址') {
1159
- if (item.label === '区/县' || item.label === '街道/乡镇') {
1160
- item.hidden = false
1161
- item.required = true
1162
- item.value = null
1163
- }
1164
- if (item.label === '集收单位') {
1165
- item.hidden = false
1166
- item.required = false
1167
- item.value = null
1168
- }
1169
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1170
- item.hidden = true
1171
- item.required = false
1172
- item.value = null
1173
- }
1174
- if (item.label === '地址') {
1175
- item.readonly = false
1176
- item.value = null
1177
- }
1178
- }
1179
- }
1180
- },
1181
- // 团购转散户初始化
1182
- 'apply2ReadyEvent' () {
1183
- if (this.show_data.f_apply_source === '线下发起') {
1184
- this.addressInitialization()
1185
- this.hideLabels('用户编号')
1186
- this.electiveLabels('用户编号')
1187
- this.showLabels('片区', '地址类型')
1188
- this.requiredLabels('片区', '地址类型')
1189
- }
1190
- if (this.show_data.f_apply_source === '自动发起') {
1191
- this.hideLabels('片区', '地址类型')
1192
- this.electiveLabels('片区', '地址类型',)
1193
- }
1194
- },
1195
- // 申请节点初始化
1196
- 'applyReadyEvent' () {
1197
- this.addressInitialization()
1198
-
1199
- this.pcdChange()
1200
- this.streetChange()
1201
- },
1202
- // ===========================================
1203
- async 'button'() {
1204
- if (this.show_data.button.before) {
1205
- await this[this.show_data.button.before]()
1206
- }
1207
- // 点击重置按钮就重置数据
1208
- if (this.show_data.button.button_name === '重置') {
1209
- this.$dispatch('breakControl', this.selectdata)
1210
- return
1211
- }
1212
-
1213
- this.show_data.user = this.$login.f
1214
- this.show_data.start_activity = this.$workflow_vue.start_activity
1215
- this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1216
-
1217
- if (this.show_data.f_apply_type === '报警器报建' && this.show_data.defname === '工程施工' && this.show_data.f_sub_state !='完工'){
1218
- //判断是否添加报警器材料
1219
- let bjqlag = false
1220
- let datatemp = {
1221
- 'bjqid':"",
1222
- 'fprocessid':"",
1223
- 'sqvalue':"",
1224
- 'f_bjq_sid':"",
1225
- 'f_material_code':""
1226
- }
1227
- let numOne = [];
1228
- this.show_data.onetomany.forEach(item=>{
1229
- item.rows.forEach(i=>{
1230
- if (i.f_material_name.substr(0,3) === '报警器'){
1231
- bjqlag = true
1232
- datatemp.bjqid = i.id
1233
- datatemp.fprocessid = i.f_process_id
1234
- datatemp.f_bjq_sid = i.f_bjq_sid
1235
- datatemp.f_material_code = i.f_material_code
1236
- numOne.push(i.f_bjq_sid)
1237
- }
1238
- })
1239
- })
1240
- if (!bjqlag){
1241
- this.$showMessage('请添加报警器物料信息!!!')
1242
- return
1243
- }
1244
- if (numOne.length > 1){
1245
- this.$showMessage("暂时支持单个报警器物料安装!!!")
1246
- return
1247
- }
1248
- datatemp.sqvalue = this.show_data.areaData.sqvalue
1249
- //区域地址存入材料记录表
1250
- let areares = await this.$resetpost(
1251
- `rs/logic/saveArea`,
1252
- {data: datatemp},
1253
- {resolveMsg: null, rejectMsg: '区域地址保存失败'}
1254
- )
1255
-
1256
- //完工之后推送数据到汉威
1257
- let adddata = {
1258
- f_bjq_sid : datatemp.f_bjq_sid,
1259
- f_material_code : datatemp.f_material_code,
1260
- f_bjq_address: this.show_data.areaData.sqvalue,
1261
- f_user_name: this.show_data.f_user_name,
1262
- f_address: this.show_data.f_address,
1263
- f_user_phone: this.show_data.f_phone,
1264
- f_userinfo_code: this.show_data.f_userinfo_code,
1265
- installtime: this.show_data.f_construction_date,
1266
- }
1267
- let res = await this.$resetpost(
1268
- `ncc/rs/logic/bjqadduser`,
1269
- // `rs/logic/bjqadduser`,
1270
- adddata
1271
- )
1272
- if (res.data.code != 200){
1273
- this.$showMessage(res.data.msg)
1274
- return
1275
- }
1276
- }
1277
-
1278
- let res = await this.$resetpost(
1279
- `rs/logic/ApplyProductService`,
1280
- {data: this.show_data},
1281
- {resolveMsg: null, rejectMsg: '数据保存失败'}
1282
- )
1283
-
1284
-
1285
- if (this.show_data.button.after) {
1286
- this[this.show_data.button.after]()
1287
- }
1288
- this.$dispatch('loadPage')
1289
- },
1290
- // 失去焦点出触发事件
1291
- 'onchange' (index) {
1292
- if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1293
- if (
1294
- this.show_data.fields[index].label === '区/县' ||
1295
- this.show_data.fields[index].label === '街道/乡镇' ||
1296
- this.show_data.fields[index].label === '集收单位' ||
1297
- this.show_data.fields[index].label === '楼号/组' ||
1298
- this.show_data.fields[index].label === '单元/排' ||
1299
- this.show_data.fields[index].label === '楼层' ||
1300
- this.show_data.fields[index].label === '门牌号'
1301
- ) {
1302
-
1303
- let f_pcd = this.getLableValue('区/县') || ''
1304
- let f_street = this.getLableValue('街道/乡镇') || ''
1305
- let f_residential_area = this.getLableValue('集收单位') || ''
1306
- let f_building = this.getLableValue('楼号/组') || ''
1307
- let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1308
- let f_unit = this.getLableValue('单元/排') || ''
1309
- let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1310
- let f_floor = this.getLableValue('楼层') || ''
1311
- let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1312
- let f_room = this.getLableValue('门牌号') || ''
1313
- let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1314
-
1315
- 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
1316
- this.setLabelValue("地址", f_address)
1317
- }
1318
- }
1319
- },
1320
- selectSearch (val, index) {},
1321
- 'onblur' (index) {},
1322
- 'oninput' (index) {},
1323
- 'initializtionView' () {},
1324
- async 'onchangeModal' (index, fieldIndex) {
1325
- },
1326
- async 'onblurModal' (index, fieldIndex) {
1327
-
1328
- },
1329
- async 'oninputModal' (index, fieldIndex) {
1330
-
1331
- },
1332
- async 'onetomanydelete' (index, rowIndex) {
1333
-
1334
- let http = new HttpResetClass()
1335
-
1336
- let res = await http.load(
1337
- 'DELETE',
1338
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1339
- null,
1340
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
1341
- )
1342
-
1343
- res = await this.$resetpost(
1344
- 'rs/entity/t_apply',
1345
- this.show_data
1346
- )
1347
-
1348
- this.$dispatch('breakControl', this.show_data)
1349
- },
1350
- async 'onetomanyupdate' (index, rowIndex) {
1351
- let data = this.show_data.onetomany[index].rows[rowIndex]
1352
-
1353
- this.show_data.onetomany[index].fields.forEach(item => {
1354
- data[item.field] = item.value
1355
- })
1356
- let res = await this.$resetpost(
1357
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1358
- data
1359
- )
1360
-
1361
- res = await this.$resetpost(
1362
- 'rs/entity/t_apply',
1363
- this.show_data
1364
- )
1365
-
1366
- this.$dispatch('breakControl', this.show_data)
1367
- },
1368
- async 'onetomanyadd' (index) {
1369
- let data = {
1370
- f_process_id : this.show_data.f_process_id,
1371
- f_operator_id: this.$login.f.id,
1372
- f_operator: this.$login.f.name,
1373
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1374
- f_orgid: this.$login.f.orgid,
1375
- f_orgname: this.$login.f.orgs
1376
- }
1377
- this.show_data.onetomany[index].fields.forEach(item => {
1378
- data[item.field] = item.value
1379
- })
1380
- let res = await this.$resetpost(
1381
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1382
- data
1383
- )
1384
-
1385
- res = await this.$resetpost(
1386
- 'rs/entity/t_apply',
1387
- this.show_data
1388
- )
1389
-
1390
- this.$dispatch('breakControl', this.show_data)
1391
- },
1392
- async 'importEvent' (index, table, configName, filepath) {
1393
- let data = {
1394
- selectdata: this.show_data,
1395
- table: table,
1396
- filepath: filepath,
1397
- configName: configName,
1398
- user: this.$login.f
1399
- }
1400
-
1401
- let res = await this.$resetpost(
1402
- `rs/logic/importEvent`,
1403
- data
1404
- )
1405
-
1406
- this.$dispatch('breakControl', this.show_data)
1407
- },
1408
- 'onbutchange' (index) {
1409
-
1410
- },
1411
- 'onbutblur' (index) {
1412
-
1413
- },
1414
- 'onbutinput' (index) {
1415
-
1416
- }
1417
- },
1418
- watch: {
1419
- }
1420
- }
1421
- </script>
1422
- <style scoped>
1423
- /*清除model中的浮动*/
1424
- .clearfix:after,.clearfix:before{
1425
- display: table;
1426
- }
1427
- .clearfix:after{
1428
- clear: both;
1429
- }
1430
- </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
+ disabledButtons(...buttons) {
375
+ for (const item of this.show_data.buttons) {
376
+ if (buttons.includes(item.button_name)) {
377
+ item.disabled = true
378
+ }
379
+ }
380
+ },
381
+ enableButtons(...buttons) {
382
+ for (const item of this.show_data.buttons) {
383
+ if (buttons.includes(item.button_name)) {
384
+ item.disabled = false
385
+ }
386
+ }
387
+ },
388
+ showButtons(...buttons) {
389
+ for (const item of this.show_data.buttons) {
390
+ if (buttons.includes(item.button_name)) {
391
+ item.hidden = false
392
+ }
393
+ }
394
+ },
395
+ hideButtons(...buttons) {
396
+ for (const item of this.show_data.buttons) {
397
+ if (buttons.includes(item.button_name)) {
398
+ item.hidden = true
399
+ }
400
+ }
401
+ },
402
+ async checkDuplicate(index) {
403
+ let http = new HttpResetClass()
404
+ let data = {
405
+ tablename: 't_apply',
406
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
407
+ }
408
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
409
+ resolveMsg: null,
410
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
411
+ })
412
+ if (res.data.length > 0) {
413
+ this.show_data.fields[index].value = null
414
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
415
+ }
416
+ },
417
+ // 获取片区
418
+ async getSliceArea () {
419
+ let data = {
420
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
421
+ userid: this.$login.f.id
422
+ }
423
+
424
+ let http = new HttpResetClass()
425
+ let res = await http.load(
426
+ 'POST',
427
+ `rs/search`,
428
+ {data: data},
429
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
430
+ )
431
+
432
+ return res.data.map(item => {
433
+ return {
434
+ label: item.name,
435
+ value: item.name
436
+ }
437
+ })
438
+ },
439
+ // 获取区县
440
+ async getPcd () {
441
+ let data = {
442
+ tablename: 't_pcd',
443
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
444
+ }
445
+ let http = new HttpResetClass()
446
+ let res = await http.load(
447
+ 'POST',
448
+ `rs/sql/singleTable`,
449
+ {data: data},
450
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
451
+ )
452
+
453
+ return res.data.map(item => {
454
+ return {
455
+ label: item.f_pcd,
456
+ value: item.f_pcd
457
+ }
458
+ })
459
+ },
460
+ // 缴费前置
461
+ chargeBefore () {
462
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
463
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
464
+ throw null
465
+ }
466
+ },
467
+ // 施工前置
468
+ async constructionBefore () {
469
+ let http = new HttpResetClass()
470
+ let data = {
471
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
472
+ }
473
+ let res = await http.load(
474
+ 'POST',
475
+ 'rs/sql/countApplyUserinfo',
476
+ {data: data},
477
+ {
478
+ resolveMsg: null,
479
+ rejectMsg: '安装明细查询失败!!!'
480
+ })
481
+ if (res.data[0].num > 0) {
482
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
483
+ throw `还有${res.data[0].num}户未安装,无法提交`
484
+ }
485
+ },
486
+ changePipeBuild () {
487
+ if (this.selectdata.f_process_dep === '工程部') {
488
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
489
+ }
490
+ if (this.selectdata.f_process_dep === '运营部') {
491
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
492
+ }
493
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
494
+ },
495
+ async getDevInfo () {
496
+ let data = {
497
+ tablename: 't_dev_info',
498
+ condition: `f_orgid = '${this.$login.f.orgid}'`
499
+ }
500
+ let http = new HttpResetClass()
501
+ let res = await http.load(
502
+ 'POST',
503
+ `rs/sql/singleTable`,
504
+ {data: data},
505
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
506
+ )
507
+
508
+ return res.data.map(item => {
509
+ return {
510
+ label: item.f_dev_name,
511
+ value: item.f_dev_name
512
+ }
513
+ })
514
+ },
515
+ async getPrice (f_price_id) {
516
+ console.log('=======================')
517
+ console.log(f_price_id)
518
+
519
+ let data = {
520
+ condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
521
+ }
522
+
523
+ if (!isEmpty(f_price_id)) {
524
+ data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
525
+ }
526
+ let http = new HttpResetClass()
527
+ let res = await http.load(
528
+ 'POST',
529
+ `rs/sql/applyGetPrice`,
530
+ {data: data},
531
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
532
+ )
533
+
534
+ return res.data.map(item => {
535
+ return {
536
+ label: item.f_price_name,
537
+ value: item
538
+ }
539
+ })
540
+ },
541
+ addressInitialization () {
542
+ this.$getConfig(this, 'UserAddress')
543
+
544
+ let f_address_type = this.show_data.f_address_type
545
+
546
+ for (const item of this.show_data.fields) {
547
+ if (f_address_type === '民用市区') {
548
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
549
+ item.hidden = false
550
+ item.required = true
551
+ }
552
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
553
+ item.hidden = false
554
+ item.required = false
555
+ }
556
+ if (item.label === '地址') {
557
+ item.readonly = true
558
+ }
559
+ }
560
+ if (f_address_type === '民用乡镇') {
561
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
562
+ item.hidden = false
563
+ item.required = true
564
+ }
565
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
566
+ item.hidden = false
567
+ item.required = false
568
+ }
569
+ if (item.label === '楼层') {
570
+ item.hidden = true
571
+ item.required = false
572
+ }
573
+ if (item.label === '地址') {
574
+ item.readonly = true
575
+ }
576
+ }
577
+ if (f_address_type === '特殊地址') {
578
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
579
+ item.hidden = false
580
+ item.required = true
581
+ }
582
+ if (item.label === '集收单位') {
583
+ item.hidden = false
584
+ item.required = false
585
+ }
586
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
587
+ item.hidden = true
588
+ item.required = false
589
+ }
590
+ if (item.label === '地址') {
591
+ item.readonly = false
592
+ }
593
+ }
594
+
595
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
596
+ item.hidden = true
597
+ }
598
+ }
599
+ },
600
+ async streetChange () {
601
+ if (isEmpty(this.show_data.f_street)) {
602
+ return
603
+ }
604
+
605
+ let data = {
606
+ tablename: 't_area',
607
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
608
+ }
609
+ let http = new HttpResetClass()
610
+ let res = await http.load(
611
+ 'POST',
612
+ `rs/sql/singleTable`,
613
+ {data: data},
614
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
615
+ )
616
+
617
+ this.setLabelOptions('集收单位', res.data.map(item => {
618
+ return {
619
+ label: item.f_residential_area,
620
+ value: item.f_residential_area
621
+ }
622
+ }))
623
+ },
624
+ async pcdChange () {
625
+ if (isEmpty(this.show_data.f_pcd)) {
626
+ return
627
+ }
628
+
629
+ let data = {
630
+ tablename: 't_street',
631
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
632
+ }
633
+ let f_address_type = this.getLableValue('地址类型')
634
+
635
+ if (f_address_type === '民用市区') {
636
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
637
+ }
638
+ if (f_address_type === '民用乡镇') {
639
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
640
+ }
641
+
642
+ let http = new HttpResetClass()
643
+ let res = await http.load(
644
+ 'POST',
645
+ `rs/sql/singleTable`,
646
+ {data: data},
647
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
648
+ )
649
+
650
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
651
+ return {
652
+ label: item.f_street,
653
+ value: item.f_street
654
+ }
655
+ }))
656
+ },
657
+ async addressTips () {
658
+ // console.log('======================='+this.show_data.f_apply_type)
659
+ let res = ''
660
+ if (this.show_data.f_apply_type === '报警器报建') {
661
+ res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
662
+ }else{
663
+ res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
664
+ }
665
+ if (res == 'confirm') {
666
+ return
667
+ }
668
+ throw '用户信息确认!!!'
669
+ },
670
+ async getDesignerPeople () {
671
+ let data = {
672
+ source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
673
+ userid: this.$login.f.id
674
+ }
675
+
676
+ let http = new HttpResetClass()
677
+ let res = await http.load(
678
+ 'POST',
679
+ `rs/search`,
680
+ {data: data},
681
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
682
+ )
683
+
684
+ return res.data.map(item => {
685
+ return {
686
+ label: item.name,
687
+ value: item.id
688
+ }
689
+ })
690
+ },
691
+ async surveyStopApply () {
692
+ console.log('终止报建!!!!!')
693
+
694
+ this.show_data.f_stop_reason = '现场勘察不符合报装条件'
695
+
696
+ let data = {
697
+ data: this.show_data,
698
+ user: this.$login.f
699
+ }
700
+
701
+ let res = await this.$resetpost(
702
+ `rs/logic/surveyStopApply`,
703
+ {data: data},
704
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
705
+ )
706
+
707
+ this.$dispatch('loadPage')
708
+
709
+ throw '终止报建!!!'
710
+ }
711
+ },
712
+ events: {
713
+ 'complyInstallation' (index) {
714
+ if (this.show_data.f_is_have === '否') {
715
+ this.hideButtons('提交', '出图', '缴费')
716
+ this.showButtons('终止')
717
+ }
718
+ if (this.show_data.f_is_have === '是') {
719
+ this.hideButtons('终止')
720
+ this.showButtons('提交', '出图', '缴费')
721
+ }
722
+ },
723
+ async 'igniteDispatchReadyEvent' () {
724
+ let data = {
725
+ tablename: 'activityins',
726
+ condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
727
+ }
728
+ let http = new HttpResetClass()
729
+ let res = await http.load(
730
+ 'POST',
731
+ `rs/sql/singleTable`,
732
+ {data: data},
733
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
734
+ )
735
+ if (res.data.length <= 0) {
736
+ console.log('+++++++++++++++++++++++++++++')
737
+ console.log('没有施工,不能退回')
738
+ this.hideButtons('退回')
739
+ }
740
+ },
741
+ 'buildReadyEvent' () {
742
+ this.setLabelValue('施工单位', this.$login.f.name)
743
+ this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
744
+ },
745
+ // 选择材料
746
+ async materialNameChenge (index, fieldIndex) {
747
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
748
+
749
+ this.show_data.onetomany[index].fields.forEach(item => {
750
+ if (material[item.field]) {
751
+ item.value = material[item.field]
752
+ }
753
+ })
754
+ },
755
+ // 打开模态框获取材料
756
+ async 'getMaterialName' (index) {
757
+ let data = {
758
+ condition: `1=1`
759
+ }
760
+ let http = new HttpResetClass()
761
+ let res = await http.load(
762
+ 'POST',
763
+ `rs/sql/getStockMaterial`,
764
+ {data: data},
765
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
766
+ )
767
+
768
+ this.show_data.onetomany[index].fields.forEach(field => {
769
+ if (field.label === '选择材料') {
770
+ field.options = res.data.map(item => {
771
+ return {
772
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
773
+ 'value': item
774
+ }
775
+ })
776
+ }
777
+ })
778
+ },
779
+ // 搜索小区
780
+ async 'searchArea' (area, index) {
781
+ let data = {
782
+ tablename: 't_area',
783
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
784
+ }
785
+ let http = new HttpResetClass()
786
+ let res = await http.load(
787
+ 'POST',
788
+ `rs/sql/singleTable`,
789
+ {data: data},
790
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
791
+ )
792
+
793
+ if (res.data.length === 0) {
794
+ return
795
+ }
796
+
797
+ this.setLabelOptions('集收单位', res.data.map(item => {
798
+ return {
799
+ label: item.f_residential_area,
800
+ value: item.f_residential_area
801
+ }
802
+ }))
803
+ },
804
+ // 选择气价
805
+ 'priceChange' (index) {
806
+ if (isEmpty(this.show_data.stairPrice)) {
807
+ return
808
+ }
809
+
810
+ let stairPrice = this.getLableValue('气价名称')
811
+
812
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
813
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
814
+ this.setLabelValue('价格', stairPrice.f_price)
815
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
816
+
817
+ this.show_data.f_price_id = stairPrice.f_price_id
818
+ this.show_data.f_price_name = stairPrice.f_price_name
819
+ },
820
+ // 选择开发商
821
+ async 'devInfoChange' (index) {
822
+ if (isEmpty(this.show_data.f_company_name)) {
823
+ return
824
+ }
825
+ let data = {
826
+ tablename: 't_dev_info',
827
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_dev_name = '${this.show_data.f_company_name}'`
828
+ }
829
+ let res = await this.$resetpost(
830
+ `rs/sql/singleTable`,
831
+ {data: data},
832
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
833
+ )
834
+ this.show_data.f_dev_id = res.data[0].id
835
+ this.show_data.f_dev_code = res.data[0].f_dev_code
836
+ this.setLabelValue('法人名称', res.data[0].f_legal_person)
837
+ this.setLabelValue('身份证', res.data[0].f_idnumber)
838
+ this.setLabelValue('营业执照', res.data[0].f_license_num)
839
+ },
840
+ // 退款金额
841
+ 'refundMoneyChange' (index) {
842
+ let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
843
+ let f_refund_money = this.show_data.fields[index].value
844
+
845
+ if (f_refund_money > f_cumulative_payment_money) {
846
+ this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
847
+ this.show_data.fields[index].value = null
848
+ }
849
+ },
850
+ // 检查重复
851
+ 'checkRepeat' (index) {
852
+ this.checkDuplicate(index)
853
+ },
854
+ // 选择报建项目
855
+ 'selectApply' (row) {
856
+ this.setLabelValue('工程名称', row.f_entry_name)
857
+ this.setLabelValue('工程编号', row.f_apply_num)
858
+ this.setLabelValue('报建类型', row.f_apply_type)
859
+ this.setLabelValue('用户名称', row.f_user_name)
860
+ this.setLabelValue('用户电话', row.f_phone)
861
+ this.setLabelValue('证件类型', row.f_credentials)
862
+ this.setLabelValue('证件号码', row.f_idnumber)
863
+ this.setLabelValue('地址', row.f_address)
864
+ this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
865
+
866
+ this.show_data.parentApply = JSON.parse(JSON.stringify(row))
867
+
868
+ delete row.id
869
+ delete row.actid
870
+ delete row.defid
871
+ delete row.defname
872
+ delete row.version
873
+ delete row.f_apply_num
874
+ delete row.f_sub_state
875
+ delete row.f_apply_type
876
+ delete row.f_process_id
877
+
878
+ this.show_data = Object.assign({}, this.show_data, row)
879
+
880
+ this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
881
+ },
882
+ // 是否终止
883
+ 'isStopChange' (index) {
884
+ let f_is_stop = this.show_data.f_is_stop
885
+
886
+ for (const item of this.show_data.fields) {
887
+ if (f_is_stop === '是') {
888
+ if (item.label === '终止原因') {
889
+ item.hidden = false
890
+ item.required = true
891
+ }
892
+ } else {
893
+ if (item.label === '终止原因') {
894
+ item.hidden = true
895
+ item.required = false
896
+ }
897
+ }
898
+ }
899
+ },
900
+ // 终止报建初始化
901
+ async 'stopApplyReadyEvent' () {
902
+
903
+ let f_is_stop = this.getLableValue('是否终止')
904
+
905
+ for (const item of this.show_data.fields) {
906
+ if (f_is_stop === '是') {
907
+ if (item.label === '终止原因') {
908
+ item.hidden = false
909
+ item.required = true
910
+ }
911
+ } else {
912
+ if (item.label === '终止原因') {
913
+ item.hidden = true
914
+ item.required = false
915
+ }
916
+ }
917
+ }
918
+
919
+ if (isEmpty(this.show_data.f_parent_process_id)) {
920
+ return
921
+ }
922
+ let data = {
923
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
924
+ data: {
925
+ id: this.$login.f.id,
926
+ orgid: this.$login.f.orgid
927
+ }
928
+ }
929
+ let res = await this.$resetpost(
930
+ `rs/sql/supervisory`,
931
+ {data: data},
932
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
933
+ )
934
+ this.show_data.parentApply = res.data[0]
935
+ },
936
+ // 选择用户档案信息
937
+ 'selectUserinfo' (row) {
938
+ this.setLabelValue('用户编号', row.f_userinfo_code)
939
+ this.setLabelValue('用户名称', row.f_user_name)
940
+ this.setLabelValue('用户电话', row.f_user_phone)
941
+ this.setLabelValue('证件类型', row.f_credentials)
942
+ this.setLabelValue('证件号码', row.f_idnumber)
943
+ this.setLabelValue('地址', row.f_address)
944
+
945
+ this.show_data.f_userinfo_id = row.f_userinfo_id
946
+ this.show_data.f_userinfo_code = row.f_userinfo_code
947
+ },
948
+ // 是否购买保险
949
+ async 'isInsureChange' (index) {
950
+ if (!this.show_data.f_is_insure) {
951
+ return
952
+ }
953
+ let f_is_insure = this.show_data.f_is_insure
954
+ for (const item of this.show_data.fields) {
955
+ if (f_is_insure === '是') {
956
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
957
+ item.hidden = false
958
+ item.required = true
959
+ }
960
+ if (item.label === '保险备注') {
961
+ item.hidden = false
962
+ }
963
+ } else {
964
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
965
+ item.hidden = true
966
+ item.required = false
967
+ }
968
+ }
969
+ }
970
+ },
971
+ // 通气点火初始化
972
+ async 'gasReadyEvent' () {
973
+ // 是否有气价信息
974
+ if (!isEmpty(this.show_data.f_price_id)) {
975
+ let priceList = await this.getPrice(this.show_data.f_price_id)
976
+ this.setLabelValue('气价名称', priceList[0].value)
977
+ }
978
+
979
+ let data = {
980
+ tablename: 't_userfees',
981
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
982
+ }
983
+ let http = new HttpResetClass()
984
+ let res = await http.load(
985
+ 'POST',
986
+ `rs/sql/singleTable`,
987
+ {data: data},
988
+ {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
989
+ )
990
+ if (res.data.length > 0) {
991
+ this.setLabelValue('待执行保险', '是')
992
+ for (const item of this.show_data.fields) {
993
+ if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
994
+ item.hidden = true
995
+ item.required = false
996
+ item.value = null
997
+ }
998
+ }
999
+ } else {
1000
+ this.setLabelValue('待执行保险', '否')
1001
+ for (const item of this.show_data.fields) {
1002
+ if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1003
+ item.hidden = false
1004
+ item.required = true
1005
+ }
1006
+ }
1007
+ }
1008
+
1009
+ // 保险初始化显示内容
1010
+ let f_is_insure = this.getLableValue('是否购买保险')
1011
+ for (const item of this.show_data.fields) {
1012
+ if (f_is_insure === '是') {
1013
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1014
+ item.hidden = false
1015
+ item.required = true
1016
+ }
1017
+ if (item.label === '保险备注') {
1018
+ item.hidden = false
1019
+ }
1020
+ // 本期保费到期时间默认一年
1021
+ if (isEmpty(this.selectdata.f_ins_expiration_date)) {
1022
+ let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
1023
+ this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
1024
+ }
1025
+ }
1026
+ if (f_is_insure === '否') {
1027
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1028
+ item.hidden = true
1029
+ item.required = false
1030
+ }
1031
+ }
1032
+ }
1033
+ },
1034
+ // 合同金额失去焦点
1035
+ async 'contractMoneyChange' (index) {
1036
+ let data = {
1037
+ operator: '+',
1038
+ num1: this.show_data.f_contract_money || 0,
1039
+ num2: this.getLableValue('追加金额') || 0
1040
+ }
1041
+ let res = await this.$resetpost(
1042
+ `rs/logic/compute`,
1043
+ {data: data},
1044
+ {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1045
+ )
1046
+
1047
+ this.setLabelValue('应交金额', res.data)
1048
+ },
1049
+ // 街道失去焦点
1050
+ async 'streetChange' (index) {
1051
+ if (isEmpty(this.show_data.f_street)) {
1052
+ return
1053
+ }
1054
+
1055
+ this.setLabelValue('集收单位', null)
1056
+
1057
+ let data = {
1058
+ tablename: 't_area',
1059
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1060
+ }
1061
+ let http = new HttpResetClass()
1062
+ let res = await http.load(
1063
+ 'POST',
1064
+ `rs/sql/singleTable`,
1065
+ {data: data},
1066
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1067
+ )
1068
+
1069
+ this.setLabelOptions('集收单位', res.data.map(item => {
1070
+ return {
1071
+ label: item.f_residential_area,
1072
+ value: item.f_residential_area
1073
+ }
1074
+ }))
1075
+ },
1076
+ // 区县失去焦点
1077
+ async 'pcdChange' (index) {
1078
+ if (isEmpty(this.show_data.f_pcd)) {
1079
+ return
1080
+ }
1081
+
1082
+ this.setLabelValue('街道/乡镇', null)
1083
+ this.setLabelValue('集收单位', null)
1084
+
1085
+
1086
+
1087
+ let data = {
1088
+ tablename: 't_street',
1089
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1090
+ }
1091
+ let f_address_type = this.getLableValue('地址类型')
1092
+
1093
+ if (f_address_type === '民用市区') {
1094
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1095
+ }
1096
+ if (f_address_type === '民用乡镇') {
1097
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1098
+ }
1099
+
1100
+ let http = new HttpResetClass()
1101
+ let res = await http.load(
1102
+ 'POST',
1103
+ `rs/sql/singleTable`,
1104
+ {data: data},
1105
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1106
+ )
1107
+
1108
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
1109
+ return {
1110
+ label: item.f_street,
1111
+ value: item.f_street
1112
+ }
1113
+ }))
1114
+ },
1115
+ // 地址类型失去焦点
1116
+ 'addressTypeChange' (index) {
1117
+ this.setLabelValue('街道/乡镇', null)
1118
+ this.setLabelValue('集收单位', null)
1119
+ let f_address_type = this.show_data.fields[index].value
1120
+ for (const item of this.show_data.fields) {
1121
+ if (f_address_type === '民用市区') {
1122
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1123
+ item.hidden = false
1124
+ item.required = true
1125
+ item.value = null
1126
+ }
1127
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1128
+ item.hidden = false
1129
+ item.required = false
1130
+ item.value = null
1131
+ }
1132
+ if (item.label === '地址') {
1133
+ item.readonly = true
1134
+ item.value = null
1135
+ }
1136
+ }
1137
+ if (f_address_type === '民用乡镇') {
1138
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1139
+ item.hidden = false
1140
+ item.required = true
1141
+ item.value = null
1142
+ }
1143
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1144
+ item.hidden = false
1145
+ item.required = false
1146
+ item.value = null
1147
+ }
1148
+ if (item.label === '楼层') {
1149
+ item.hidden = true
1150
+ item.required = false
1151
+ item.value = null
1152
+ }
1153
+ if (item.label === '地址') {
1154
+ item.readonly = true
1155
+ item.value = null
1156
+ }
1157
+ }
1158
+ if (f_address_type === '特殊地址') {
1159
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
1160
+ item.hidden = false
1161
+ item.required = true
1162
+ item.value = null
1163
+ }
1164
+ if (item.label === '集收单位') {
1165
+ item.hidden = false
1166
+ item.required = false
1167
+ item.value = null
1168
+ }
1169
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1170
+ item.hidden = true
1171
+ item.required = false
1172
+ item.value = null
1173
+ }
1174
+ if (item.label === '地址') {
1175
+ item.readonly = false
1176
+ item.value = null
1177
+ }
1178
+ }
1179
+ }
1180
+ },
1181
+ // 团购转散户初始化
1182
+ 'apply2ReadyEvent' () {
1183
+ if (this.show_data.f_apply_source === '线下发起') {
1184
+ this.addressInitialization()
1185
+ this.hideLabels('用户编号')
1186
+ this.electiveLabels('用户编号')
1187
+ this.showLabels('片区', '地址类型')
1188
+ this.requiredLabels('片区', '地址类型')
1189
+ }
1190
+ if (this.show_data.f_apply_source === '自动发起') {
1191
+ this.hideLabels('片区', '地址类型')
1192
+ this.electiveLabels('片区', '地址类型',)
1193
+ }
1194
+ },
1195
+ // 申请节点初始化
1196
+ 'applyReadyEvent' () {
1197
+ this.addressInitialization()
1198
+
1199
+ this.pcdChange()
1200
+ this.streetChange()
1201
+ },
1202
+ // ===========================================
1203
+ async 'button'() {
1204
+ if (this.show_data.button.before) {
1205
+ await this[this.show_data.button.before]()
1206
+ }
1207
+ // 点击重置按钮就重置数据
1208
+ if (this.show_data.button.button_name === '重置') {
1209
+ this.$dispatch('breakControl', this.selectdata)
1210
+ return
1211
+ }
1212
+
1213
+ this.show_data.user = this.$login.f
1214
+ this.show_data.start_activity = this.$workflow_vue.start_activity
1215
+ this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1216
+
1217
+ if (this.show_data.f_apply_type === '报警器报建' && this.show_data.defname === '工程施工' && this.show_data.f_sub_state !='完工'){
1218
+ //判断是否添加报警器材料
1219
+ let bjqlag = false
1220
+ let datatemp = {
1221
+ 'bjqid':"",
1222
+ 'fprocessid':"",
1223
+ 'sqvalue':"",
1224
+ 'f_bjq_sid':"",
1225
+ 'f_material_code':""
1226
+ }
1227
+ let numOne = [];
1228
+ this.show_data.onetomany.forEach(item=>{
1229
+ item.rows.forEach(i=>{
1230
+ if (i.f_material_name.substr(0,3) === '报警器'){
1231
+ bjqlag = true
1232
+ datatemp.bjqid = i.id
1233
+ datatemp.fprocessid = i.f_process_id
1234
+ datatemp.f_bjq_sid = i.f_bjq_sid
1235
+ datatemp.f_material_code = i.f_material_code
1236
+ numOne.push(i.f_bjq_sid)
1237
+ }
1238
+ })
1239
+ })
1240
+ if (!bjqlag){
1241
+ this.$showMessage('请添加报警器物料信息!!!')
1242
+ return
1243
+ }
1244
+ if (numOne.length > 1){
1245
+ this.$showMessage("暂时支持单个报警器物料安装!!!")
1246
+ return
1247
+ }
1248
+ datatemp.sqvalue = this.show_data.areaData.sqvalue
1249
+ //区域地址存入材料记录表
1250
+ let areares = await this.$resetpost(
1251
+ `rs/logic/saveArea`,
1252
+ {data: datatemp},
1253
+ {resolveMsg: null, rejectMsg: '区域地址保存失败'}
1254
+ )
1255
+
1256
+ //完工之后推送数据到汉威
1257
+ let adddata = {
1258
+ f_bjq_sid : datatemp.f_bjq_sid,
1259
+ f_material_code : datatemp.f_material_code,
1260
+ f_bjq_address: this.show_data.areaData.sqvalue,
1261
+ f_user_name: this.show_data.f_user_name,
1262
+ f_address: this.show_data.f_address,
1263
+ f_user_phone: this.show_data.f_phone,
1264
+ f_userinfo_code: this.show_data.f_userinfo_code,
1265
+ installtime: this.show_data.f_construction_date,
1266
+ }
1267
+ let res = await this.$resetpost(
1268
+ `ncc/rs/logic/bjqadduser`,
1269
+ // `rs/logic/bjqadduser`,
1270
+ adddata
1271
+ )
1272
+ if (res.data.code != 200){
1273
+ this.$showMessage(res.data.msg)
1274
+ return
1275
+ }
1276
+ }
1277
+
1278
+ let res = await this.$resetpost(
1279
+ `rs/logic/ApplyProductService`,
1280
+ {data: this.show_data},
1281
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1282
+ )
1283
+
1284
+
1285
+ if (this.show_data.button.after) {
1286
+ this[this.show_data.button.after]()
1287
+ }
1288
+ this.$dispatch('loadPage')
1289
+ },
1290
+ // 失去焦点出触发事件
1291
+ 'onchange' (index) {
1292
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1293
+ if (
1294
+ this.show_data.fields[index].label === '区/县' ||
1295
+ this.show_data.fields[index].label === '街道/乡镇' ||
1296
+ this.show_data.fields[index].label === '集收单位' ||
1297
+ this.show_data.fields[index].label === '楼号/组' ||
1298
+ this.show_data.fields[index].label === '单元/排' ||
1299
+ this.show_data.fields[index].label === '楼层' ||
1300
+ this.show_data.fields[index].label === '门牌号'
1301
+ ) {
1302
+
1303
+ let f_pcd = this.getLableValue('区/县') || ''
1304
+ let f_street = this.getLableValue('街道/乡镇') || ''
1305
+ let f_residential_area = this.getLableValue('集收单位') || ''
1306
+ let f_building = this.getLableValue('楼号/组') || ''
1307
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1308
+ let f_unit = this.getLableValue('单元/排') || ''
1309
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1310
+ let f_floor = this.getLableValue('楼层') || ''
1311
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1312
+ let f_room = this.getLableValue('门牌号') || ''
1313
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1314
+
1315
+ 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
1316
+ this.setLabelValue("地址", f_address)
1317
+ }
1318
+ }
1319
+ },
1320
+ selectSearch (val, index) {},
1321
+ 'onblur' (index) {},
1322
+ 'oninput' (index) {},
1323
+ 'initializtionView' () {},
1324
+ async 'onchangeModal' (index, fieldIndex) {
1325
+ },
1326
+ async 'onblurModal' (index, fieldIndex) {
1327
+
1328
+ },
1329
+ async 'oninputModal' (index, fieldIndex) {
1330
+
1331
+ },
1332
+ async 'onetomanydelete' (index, rowIndex) {
1333
+
1334
+ let http = new HttpResetClass()
1335
+
1336
+ let res = await http.load(
1337
+ 'DELETE',
1338
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1339
+ null,
1340
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1341
+ )
1342
+
1343
+ res = await this.$resetpost(
1344
+ 'rs/entity/t_apply',
1345
+ this.show_data
1346
+ )
1347
+
1348
+ this.$dispatch('breakControl', this.show_data)
1349
+ },
1350
+ async 'onetomanyupdate' (index, rowIndex) {
1351
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1352
+
1353
+ this.show_data.onetomany[index].fields.forEach(item => {
1354
+ data[item.field] = item.value
1355
+ })
1356
+ let res = await this.$resetpost(
1357
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1358
+ data
1359
+ )
1360
+
1361
+ res = await this.$resetpost(
1362
+ 'rs/entity/t_apply',
1363
+ this.show_data
1364
+ )
1365
+
1366
+ this.$dispatch('breakControl', this.show_data)
1367
+ },
1368
+ async 'onetomanyadd' (index) {
1369
+ let data = {
1370
+ f_process_id : this.show_data.f_process_id,
1371
+ f_operator_id: this.$login.f.id,
1372
+ f_operator: this.$login.f.name,
1373
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1374
+ f_orgid: this.$login.f.orgid,
1375
+ f_orgname: this.$login.f.orgs
1376
+ }
1377
+ this.show_data.onetomany[index].fields.forEach(item => {
1378
+ data[item.field] = item.value
1379
+ })
1380
+ let res = await this.$resetpost(
1381
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1382
+ data
1383
+ )
1384
+
1385
+ res = await this.$resetpost(
1386
+ 'rs/entity/t_apply',
1387
+ this.show_data
1388
+ )
1389
+
1390
+ this.$dispatch('breakControl', this.show_data)
1391
+ },
1392
+ async 'importEvent' (index, table, configName, filepath) {
1393
+ let data = {
1394
+ selectdata: this.show_data,
1395
+ table: table,
1396
+ filepath: filepath,
1397
+ configName: configName,
1398
+ user: this.$login.f
1399
+ }
1400
+
1401
+ let res = await this.$resetpost(
1402
+ `rs/logic/importEvent`,
1403
+ data
1404
+ )
1405
+
1406
+ this.$dispatch('breakControl', this.show_data)
1407
+ },
1408
+ 'onbutchange' (index) {
1409
+
1410
+ },
1411
+ 'onbutblur' (index) {
1412
+
1413
+ },
1414
+ 'onbutinput' (index) {
1415
+
1416
+ }
1417
+ },
1418
+ watch: {
1419
+ }
1420
+ }
1421
+ </script>
1422
+ <style scoped>
1423
+ /*清除model中的浮动*/
1424
+ .clearfix:after,.clearfix:before{
1425
+ display: table;
1426
+ }
1427
+ .clearfix:after{
1428
+ clear: both;
1429
+ }
1430
+ </style>