apply-clients 3.4.8 → 3.4.10

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.
@@ -0,0 +1,1988 @@
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 "../../../../../components/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
+ Pricetype:''
40
+ }
41
+ },
42
+ ready () {
43
+ this.refurbish()
44
+ // this.ceshi()
45
+ },
46
+ methods: {
47
+ async ceshi(){
48
+ for (let i = 0; i < this.show_data.fields.length; i++) {
49
+ //新用户时处理逻辑
50
+ if (this.selectdata.f_apply_type == '新用户') {
51
+ this.show_data.fields[i].required = false
52
+ }
53
+
54
+ //对勘察时间进行转换
55
+ /* if (this.selectdata.defname == '现场勘察') {
56
+ if (this.show_data.fields[i].label === '勘察时间') {
57
+ this.show_data.fields[i].value = new Date().Format("yyyy-MM-dd HH:mm:ss")
58
+ }
59
+ } */
60
+
61
+
62
+ //所属公司和自动生成项目编号
63
+ debugger
64
+ if (this.selectdata.defname == '用户建档') {
65
+ if (this.show_data.fields[i].label === '所属公司') {
66
+ this.show_data.fields[i].value = this.$login.f.orgs
67
+ }
68
+ console.log("预约的id为:"+this.selectdata.f_order_id)
69
+ console.dir("推送的数据:"+JSON.stringify(this.selectdata))
70
+ if (this.show_data.fields[i].label === '项目编号') {
71
+
72
+ if(this.selectdata.f_order_id !=''&&this.selectdata.f_order_id !=null ){
73
+ console.log("生成的项目编号为:" + this.selectdata.f_entry_num)
74
+ this.show_data.fields[i].value = this.selectdata.f_entry_num
75
+ }else{
76
+ let http2 = new HttpResetClass()
77
+ let entryNum = await http2.load('POST', 'rs/logic/getProjectNo', {
78
+ data: {
79
+ f_filiale: this.$login.f.orgs,
80
+ f_order_id: this.selectdata.f_order_id
81
+ }
82
+ }, {resolveMsg: null, rejectMsg: null})
83
+ console.log("生成的项目编号为:" + entryNum.data)
84
+ this.show_data.fields[i].value = entryNum.data
85
+ }
86
+
87
+
88
+ }
89
+ if (this.show_data.fields[i].label === '报建编号') {
90
+ if(this.selectdata.f_order_id !=''&&this.selectdata.f_order_id !=null ){
91
+ console.log("生成的报建编号为:" + this.selectdata.f_apply_num)
92
+ this.show_data.fields[i].value = this.selectdata.f_apply_num
93
+ }else{
94
+ let http2 = new HttpResetClass()
95
+ let applyNum = await http2.load('POST', 'rs/logic/getConstructionNo', {
96
+ data: {
97
+ f_filiale: this.$login.f.orgs,
98
+ f_order_id: this.selectdata.f_order_id
99
+ }
100
+ }, {resolveMsg: null, rejectMsg: null})
101
+ console.log("生成的报建编号为:" + applyNum.data)
102
+ this.show_data.fields[i].value = applyNum.data
103
+ }
104
+
105
+
106
+ }
107
+ //placeholder required
108
+ if (this.selectdata.f_apply_type == '新用户') {
109
+ if (this.show_data.fields[i].label === '项目名称' ||
110
+ this.show_data.fields[i].label === '营业所' ||
111
+ this.show_data.fields[i].label === '项目编号' ||
112
+ this.show_data.fields[i].label === '用气性质' ||
113
+ this.show_data.fields[i].label === '项目类型' ||
114
+ this.show_data.fields[i].label === '花名册') {
115
+ this.show_data.fields[i].required = true
116
+ }
117
+ }
118
+
119
+ }
120
+
121
+ //如果报建类型是新用户到了核对时的逻辑
122
+ // if (this.selectdata.f_apply_type == '新用户' && this.selectdata.defname == '核对'
123
+ // && this.show_data.fields[i].label != '用气性质' && this.show_data.fields[i].label != '报建类型'
124
+ // && this.show_data.fields[i].label != '项目名称' && this.show_data.fields[i].label != '项目编号'
125
+ // && this.show_data.fields[i].label != '所属公司' && this.selectdata.f_roster == '有') {
126
+ // this.show_data.fields[i].hidden = true
127
+ // }
128
+ // if (this.selectdata.f_apply_type == '新用户' && this.selectdata.defname == '核对' && this.selectdata.f_roster == '有'
129
+ // && this.show_data.fields[i].label == '应交金额合计') {
130
+ // this.show_data.fields[i].value = this.sum.toFixed(2)
131
+ // this.show_data.fields[i].hidden = false
132
+ // }
133
+ // if (this.selectdata.f_apply_type == '新用户' && this.selectdata.defname == '核对' && this.selectdata.f_roster == '有'
134
+ // && this.show_data.fields[i].label == '累计交费金额合计') {
135
+ // this.show_data.fields[i].value = this.$refs.charge.f_cumulative_money_sum()
136
+ // console.log(this.show_data.fields[i].value + "-------------------------累计交费金额合计-------------------------:" + this.$refs.charge.f_cumulative_money_sum())
137
+ // this.show_data.fields[i].hidden = false
138
+ // }
139
+ // 工商业处理逻辑
140
+ if (this.selectdata.defname == '报建缴费' && this.selectdata.f_apply_type == '工商业') {
141
+ if (this.show_data.fields[i].label == '超长距离' || this.show_data.fields[i].label != '超长费') {
142
+ this.show_data.fields[i].required = false
143
+ }
144
+ }
145
+ // if (this.selectdata.defname == '核对' && this.selectdata.f_apply_type == '工商业') {
146
+ // if (this.show_data.fields[i].label == '超长距离' || this.show_data.fields[i].label != '超长费') {
147
+ // this.show_data.fields[i].required = false
148
+ // this.show_data.fields[i].readonly = false
149
+ // }
150
+ // }
151
+
152
+
153
+ }},
154
+ // async servicer(){
155
+ // debugger
156
+ // let data = {
157
+ // tablename: 't_user',
158
+ // condition: `1=1`
159
+ // }
160
+ // let http = new HttpResetClass()
161
+ // let res = await http.load(
162
+ // 'POST',
163
+ // `rs/sql/singleTable`,
164
+ // {data: data},
165
+ // {resolveMsg: null, rejectMsg: '服务人查询失败!!!'}
166
+ // )
167
+ // debugger
168
+ // this.setLabelOptions('服务人', res.data.map(item => {
169
+ // return {
170
+ // label: item.name,
171
+ // value: item.name
172
+ // }
173
+ // }))
174
+ // },
175
+ // 组件初始化操作
176
+ async refurbish() {
177
+ this.json_datas = this.$workflow_vue
178
+ let sum = 0
179
+ let jsonData = {}
180
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
181
+ this.$showMessage("网络故障,请刷新页面")
182
+ return
183
+ }
184
+ this.json_datas.activitys.forEach(item => {
185
+ if (this.selectdata.defname === item.title) {
186
+ jsonData = item // 拿到当前节点的json配置信息
187
+ sum++ // 节点名一样的个数
188
+ }
189
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
190
+ })
191
+
192
+ if (sum === 0) {
193
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
194
+ return
195
+ }
196
+ if (sum > 1) {
197
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
198
+ return
199
+ }
200
+
201
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
202
+
203
+ // fields 字段填充值
204
+ for (const item of this.selectdata.fields) {
205
+ if (!item.value) {
206
+ item.value = null
207
+ }
208
+
209
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
210
+ if (item.eval) {
211
+ item.value = eval(item.default)
212
+ } else {
213
+ item.value = item.default
214
+ }
215
+ }
216
+
217
+ if (this.selectdata[item.field]) {
218
+ // 将json字符串格式化赋值给value
219
+ if (String(this.selectdata[item.field]).startsWith("{")) {
220
+ item.value = JSON.parse(this.selectdata[item.field])
221
+ } else {
222
+ item.value = this.selectdata[item.field]
223
+ }
224
+ }
225
+ if (this.selectdata[item.field] === 0) {
226
+ item.value = 0
227
+ }
228
+
229
+ // datepicker
230
+ if (item.type === 'datepicker' && !item.value && item.default) {
231
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
232
+ }
233
+
234
+ // 如果配置类型为select,优先从参数列表获取options
235
+ if (item.type === 'select' || item.type === 'checkbox') {
236
+ if (item.param) {
237
+ let temp = this.$appdata.getParam(item.label)
238
+
239
+ if (temp && temp.length > 0) {
240
+ item.options = temp
241
+ }
242
+
243
+ if (item.paramLabel) {
244
+ temp = this.$appdata.getParam(item.paramLabel)
245
+ if (temp && temp.length > 0) {
246
+ item.options = temp
247
+ }
248
+ }
249
+ }
250
+
251
+ if (item.ready) {
252
+ item.options = await this[item.ready]()
253
+ }
254
+ }
255
+
256
+
257
+ if (item.type === 'checkbox') {
258
+ if (this.selectdata[item.field]) {
259
+ item.value = JSON.parse(this.selectdata[item.field])
260
+ } else {
261
+ item.value = []
262
+ }
263
+ }
264
+
265
+ this.selectdata[item.field] = item.value
266
+ }
267
+
268
+ // 控制组件
269
+ if (this.selectdata.components) {
270
+ this.selectdata.components.forEach(item => {
271
+ if (!item.mark) {
272
+ item.mark = 0
273
+ }
274
+ })
275
+ }
276
+
277
+ // 初始化onetomany
278
+ if (this.selectdata.onetomany) {
279
+ for (const item of this.selectdata.onetomany) {
280
+ let res = null
281
+ if (item.queryEvent) {
282
+ res = this[item.queryEvent]()
283
+ } else {
284
+ let data = {
285
+ tablename: item.tables[0],
286
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
287
+ }
288
+ res = await this.$resetpost(
289
+ 'rs/sql/singleTable',
290
+ {data: data},
291
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
292
+ )
293
+ }
294
+
295
+ item.rows = res.data
296
+
297
+ // 初始化onetomany中的fields
298
+ for (const field of item.fields) {
299
+ if (!field.value) {
300
+ if (field.value !== 0) {
301
+ field.value = null
302
+ }
303
+ }
304
+
305
+ if (field.default || field.default === 0) {
306
+ field.value = field.default
307
+ }
308
+
309
+ // datepicker
310
+ if (field.type === 'datepicker' && !field.value && field.default) {
311
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
312
+ }
313
+
314
+ if (field.type === 'select') {
315
+
316
+ let temp = this.$appdata.getParam(field.label)
317
+
318
+ if (temp && temp.length > 0) {
319
+ field.options = temp
320
+ }
321
+
322
+ if (field.paramLabel) {
323
+ temp = this.$appdata.getParam(field.paramLabel)
324
+ if (temp && temp.length > 0) {
325
+ item.options = temp
326
+ }
327
+ }
328
+ }
329
+ }
330
+ }
331
+ }
332
+
333
+ // 初始化 buttons_fields
334
+ for (const item of this.selectdata.buttons) {
335
+ if (item.button_name === '下发') {
336
+
337
+ let data = {
338
+ source: item.source,
339
+ userid: this.$login.f.id
340
+ }
341
+ if (item.sourceMethod) {
342
+ data.source = this[item.sourceMethod]()
343
+ }
344
+ if (!data.source) {
345
+ this.$showMessage("请配置获取人员表达式")
346
+ return
347
+ }
348
+
349
+ let res = await this.$resetpost(
350
+ 'rs/search',
351
+ {data: data},
352
+ {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
353
+ )
354
+
355
+ let options = res.data.map(source => {
356
+ return {
357
+ "label": source.name,
358
+ "value": source.id
359
+ }
360
+ })
361
+
362
+ if (item.button_fields.length !== 1) {
363
+ this.$showMessage("下发有且只能有一个字段!!!")
364
+ return
365
+ }
366
+
367
+ item.button_fields[0].options = options
368
+ }
369
+ if (item.button_fields) {
370
+ item.button_fields.forEach(x => {
371
+ // 如果配置类型为select,优先从参数列表获取options
372
+ if (x.type === 'select') {
373
+
374
+ if (x.param) {
375
+ let temp = this.$appdata.getParam(x.label)
376
+
377
+ if (temp && temp.length > 0) {
378
+ x.options = temp
379
+ }
380
+
381
+ if (x.paramLabel) {
382
+ temp = this.$appdata.getParam(x.paramLabel)
383
+ if (temp && temp.length > 0) {
384
+ x.options = temp
385
+ }
386
+ }
387
+ }
388
+
389
+ }
390
+ })
391
+ }
392
+ }
393
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
394
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
395
+ console.log('打印下temp',temp)
396
+ this.show_data = temp
397
+ this.$nextTick(() => {
398
+ this.showview = true
399
+ })
400
+ },
401
+ // 金额转大写
402
+ smalltoBIG(n) {
403
+ let fraction = ['角', '分'];
404
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
405
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
406
+ let head = n < 0 ? '欠' : '';
407
+ n = Math.abs(n);
408
+
409
+ let s = '';
410
+
411
+ for (var i = 0; i < fraction.length; i++) {
412
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
413
+ }
414
+ s = s || '整';
415
+ n = Math.floor(n);
416
+
417
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
418
+ let p = '';
419
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
420
+ p = digit[n % 10] + unit[1][j] + p;
421
+ n = Math.floor(n / 10);
422
+ }
423
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
424
+ }
425
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
426
+ },
427
+ getLableValue(label) {
428
+ for (const item of this.show_data.fields) {
429
+ if (item.label === label && item.type !== 'number') {
430
+ return item.value || ''
431
+ }
432
+ if (item.label === label && item.type === 'number') {
433
+ return item.value || 0
434
+ }
435
+ }
436
+ },
437
+ getLableOptions(label) {
438
+ for (const item of this.show_data.fields) {
439
+ if (item.label === label) {
440
+ return item.options
441
+ }
442
+ }
443
+ },
444
+ setLabelValue(label, value) {
445
+ for (const item of this.show_data.fields) {
446
+ if (item.label === label) {
447
+ item.value = value
448
+ this.show_data[item.field] = value
449
+ }
450
+ }
451
+ },
452
+ setLabelOptions(label, options) {
453
+ for (const item of this.show_data.fields) {
454
+ if (item.label === label) {
455
+ item.options = options
456
+ }
457
+ }
458
+ },
459
+ showLabels(...labels) {
460
+ for (const item of this.show_data.fields) {
461
+ if (labels.includes(item.label)) {
462
+ item.hidden = false
463
+ }
464
+ }
465
+ },
466
+ hideLabels(...labels) {
467
+ for (const item of this.show_data.fields) {
468
+ if (labels.includes(item.label)) {
469
+ item.hidden = true
470
+ }
471
+ }
472
+ },
473
+ requiredLabels(...labels) {
474
+ for (const item of this.show_data.fields) {
475
+ if (labels.includes(item.label)) {
476
+ item.required = true
477
+ }
478
+ }
479
+ },
480
+ electiveLabels(...labels) {
481
+ for (const item of this.show_data.fields) {
482
+ if (labels.includes(item.label)) {
483
+ item.required = false
484
+ }
485
+ }
486
+ },
487
+ readonlyLabels(...labels) {
488
+ for (const item of this.show_data.fields) {
489
+ if (labels.includes(item.label)) {
490
+ item.readonly = true
491
+ item.disabled = true
492
+ }
493
+ }
494
+ },
495
+ readwriteLabels(...labels) {
496
+ for (const item of this.show_data.fields) {
497
+ if (labels.includes(item.label)) {
498
+ item.readonly = false
499
+ item.disabled = false
500
+ }
501
+ }
502
+ },
503
+ disabledButtons(...buttons) {
504
+ for (const item of this.show_data.buttons) {
505
+ if (buttons.includes(item.button_name)) {
506
+ item.disabled = true
507
+ }
508
+ }
509
+ },
510
+ enableButtons(...buttons) {
511
+ for (const item of this.show_data.buttons) {
512
+ if (buttons.includes(item.button_name)) {
513
+ item.disabled = false
514
+ }
515
+ }
516
+ },
517
+ showButtons(...buttons) {
518
+ for (const item of this.show_data.buttons) {
519
+ if (buttons.includes(item.button_name)) {
520
+ item.hidden = false
521
+ }
522
+ }
523
+ },
524
+ hideButtons(...buttons) {
525
+ for (const item of this.show_data.buttons) {
526
+ if (buttons.includes(item.button_name)) {
527
+ item.hidden = true
528
+ }
529
+ }
530
+ },
531
+ async checkDuplicate(index) {
532
+ let http = new HttpResetClass()
533
+ let data = {
534
+ tablename: 't_apply',
535
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
536
+ }
537
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
538
+ resolveMsg: null,
539
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
540
+ })
541
+ if (res.data.length > 0) {
542
+ this.show_data.fields[index].value = null
543
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
544
+ }
545
+ },
546
+ // 获取片区
547
+ async getSliceArea () {
548
+ let data = {
549
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
550
+ userid: this.$login.f.id
551
+ }
552
+
553
+ let http = new HttpResetClass()
554
+ let res = await http.load(
555
+ 'POST',
556
+ `rs/search`,
557
+ {data: data},
558
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
559
+ )
560
+
561
+ return res.data.map(item => {
562
+ return {
563
+ label: item.name,
564
+ value: item.name
565
+ }
566
+ })
567
+ },
568
+ // 获取区县
569
+ async getPcd () {
570
+ let data = {
571
+ tablename: 't_pcd',
572
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
573
+ }
574
+ let http = new HttpResetClass()
575
+ let res = await http.load(
576
+ 'POST',
577
+ `rs/sql/singleTable`,
578
+ {data: data},
579
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
580
+ )
581
+
582
+ return res.data.map(item => {
583
+ return {
584
+ label: item.f_pcd,
585
+ value: item.f_pcd
586
+ }
587
+ })
588
+ },
589
+ // 获取集收单位
590
+ async getArea () {
591
+ let data = {
592
+ tablename: 't_area',
593
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
594
+ }
595
+ let http = new HttpResetClass()
596
+ let res = await http.load(
597
+ 'POST',
598
+ `rs/sql/singleTable`,
599
+ {data: data},
600
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
601
+ )
602
+
603
+ return res.data.map(item => {
604
+ return {
605
+ label: item.f_residential_area,
606
+ value: item.f_residential_area
607
+ }
608
+ })
609
+ },
610
+ // 缴费前置
611
+ chargeBefore () {
612
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
613
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
614
+ throw null
615
+ }
616
+ },
617
+ // 施工前置 加表具后状态是待开通 提交后是正常 所以这里的判断条件需改正 (and uf.f_meter_classify is null and f_meternumber is null)
618
+ async constructionBefore () {
619
+ let http = new HttpResetClass()
620
+ let data = {
621
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_meter_classify is null and f_meternumber is null`
622
+ }
623
+ let res = await http.load(
624
+ 'POST',
625
+ 'rs/sql/countApplyUserinfo',
626
+ {data: data},
627
+ {
628
+ resolveMsg: null,
629
+ rejectMsg: '安装明细查询失败!!!'
630
+ })
631
+ if (res.data[0].num > 0) {
632
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
633
+ throw `还有${res.data[0].num}户未安装,无法提交`
634
+ }
635
+ },
636
+ changePipeBuild () {
637
+ if (this.selectdata.f_process_dep === '工程部') {
638
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
639
+ }
640
+ if (this.selectdata.f_process_dep === '运营部') {
641
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
642
+ }
643
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
644
+ },
645
+ async getDevInfo () {
646
+ let data = {
647
+ tablename: 't_dev_info',
648
+ condition: `f_orgid = '${this.$login.f.orgid}'`
649
+ }
650
+ let http = new HttpResetClass()
651
+ let res = await http.load(
652
+ 'POST',
653
+ `rs/sql/singleTable`,
654
+ {data: data},
655
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
656
+ )
657
+
658
+ return res.data.map(item => {
659
+ return {
660
+ label: item.f_dev_name,
661
+ value: item.f_dev_name
662
+ }
663
+ })
664
+ },
665
+ async getPrice (f_price_id) {
666
+ console.log('=======================')
667
+ console.log(f_price_id)
668
+
669
+ let data = {
670
+ condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
671
+ }
672
+ if(this.Pricetype==='机表'){
673
+ data.condition=`sp.f_custom = '机表'`
674
+ }
675
+ if(this.Pricetype==='非机表'){
676
+ data.condition=`sp.f_custom = '非机表'`
677
+ }
678
+
679
+ if (!isEmpty(f_price_id)) {
680
+ data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
681
+ }
682
+ let http = new HttpResetClass()
683
+ let res = await http.load(
684
+ 'POST',
685
+ `rs/sql/applyGetPrice`,
686
+ {data: data},
687
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
688
+ )
689
+
690
+ let a= res.data.map(item => {
691
+ return {
692
+ label: item.f_price_name,
693
+ value: item
694
+ }
695
+ })
696
+ this.selectdata.fields.forEach(field => {
697
+ if (field.label === '气价名称') {
698
+ field.options = a}
699
+ })
700
+ return a
701
+ },
702
+ addressInitialization () {
703
+ this.$getConfig(this, 'UserAddress')
704
+
705
+ let f_address_type = this.show_data.f_address_type
706
+
707
+ for (const item of this.show_data.fields) {
708
+ if (f_address_type === '民用市区') {
709
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
710
+ item.hidden = false
711
+ item.required = true
712
+ }
713
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
714
+ item.hidden = false
715
+ item.required = false
716
+ }
717
+ if (item.label === '地址') {
718
+ item.readonly = true
719
+ }
720
+ }
721
+ if (f_address_type === '民用乡镇') {
722
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
723
+ item.hidden = false
724
+ item.required = true
725
+ }
726
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
727
+ item.hidden = false
728
+ item.required = false
729
+ }
730
+ if (item.label === '楼层') {
731
+ item.hidden = true
732
+ item.required = false
733
+ }
734
+ if (item.label === '地址') {
735
+ item.readonly = true
736
+ }
737
+ }
738
+ if (f_address_type === '特殊地址') {
739
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
740
+ item.hidden = false
741
+ item.required = true
742
+ }
743
+ if (item.label === '集收单位') {
744
+ item.hidden = false
745
+ if (this.show_data.f_apply_type === '工商户报建'){
746
+ item.required = false
747
+ } else {
748
+ item.required = false
749
+ }
750
+
751
+ }
752
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
753
+ item.hidden = true
754
+ item.required = false
755
+ }
756
+ if (item.label === '地址') {
757
+ item.readonly = false
758
+ }
759
+ }
760
+
761
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
762
+ item.hidden = true
763
+ }
764
+ }
765
+ },
766
+ async streetChange () {
767
+ if (isEmpty(this.show_data.f_street)) {
768
+ return
769
+ }
770
+
771
+ let data = {
772
+ tablename: 't_area',
773
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
774
+ }
775
+ let http = new HttpResetClass()
776
+ let res = await http.load(
777
+ 'POST',
778
+ `rs/sql/singleTable`,
779
+ {data: data},
780
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
781
+ )
782
+
783
+ this.setLabelOptions('集收单位', res.data.map(item => {
784
+ return {
785
+ label: item.f_residential_area,
786
+ value: item.f_residential_area
787
+ }
788
+ }))
789
+ },
790
+ async pcdChange () {
791
+ if (isEmpty(this.show_data.f_pcd)) {
792
+ return
793
+ }
794
+
795
+ let data = {
796
+ tablename: 't_street',
797
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
798
+ }
799
+ let f_address_type = this.getLableValue('地址类型')
800
+
801
+ if (f_address_type === '民用市区') {
802
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
803
+ }
804
+ if (f_address_type === '民用乡镇') {
805
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
806
+ }
807
+
808
+ let http = new HttpResetClass()
809
+ let res = await http.load(
810
+ 'POST',
811
+ `rs/sql/singleTable`,
812
+ {data: data},
813
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
814
+ )
815
+
816
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
817
+ return {
818
+ label: item.f_street,
819
+ value: item.f_street
820
+ }
821
+ }))
822
+ },
823
+ async addressTips () {
824
+ // console.log('======================='+this.show_data.f_apply_type)
825
+ let res = ''
826
+ if (this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') {
827
+ res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
828
+ }else{
829
+ res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
830
+ }
831
+ if (res == 'confirm') {
832
+ return
833
+ }
834
+ throw '用户信息确认!!!'
835
+ },
836
+ // async getDesignerPeople () {
837
+ // let data = {
838
+ // source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
839
+ // userid: this.$login.f.id
840
+ // }
841
+ //
842
+ // let http = new HttpResetClass()
843
+ // let res = await http.load(
844
+ // 'POST',
845
+ // `rs/search`,
846
+ // {data: data},
847
+ // {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
848
+ // )
849
+ //
850
+ // return res.data.map(item => {
851
+ // return {
852
+ // label: item.name,
853
+ // value: item.id
854
+ // }
855
+ // })
856
+ // },
857
+ async surveyStopApply () {
858
+ console.log('终止报建!!!!!')
859
+
860
+ this.show_data.f_stop_reason = '现场勘察不符合报装条件'
861
+
862
+ let data = {
863
+ data: this.show_data,
864
+ user: this.$login.f
865
+ }
866
+
867
+ let res = await this.$resetpost(
868
+ `rs/logic/surveyStopApply`,
869
+ {data: data},
870
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
871
+ )
872
+
873
+ this.$dispatch('loadPage')
874
+
875
+ throw '终止报建!!!'
876
+ },
877
+ async contract_number() {
878
+ console.log("进入编号合同编号生成",this.$login.f.orgs)
879
+ let f_contract_number = ''
880
+ const nowDate = new Date();
881
+ const date = {
882
+ year: nowDate.getFullYear(),
883
+ month: nowDate.getMonth() + 1,
884
+ day: nowDate.getDate()
885
+ }
886
+
887
+ function upperCaseChars(dir) {
888
+ let string = '';
889
+ switch (dir){
890
+ case '周口市天然气有限公司':
891
+ string = 'ZK' // 当表达式的结果等于 房产 时,则执行该代码
892
+ break;
893
+ case '项城市天然气有限公司':
894
+ string = "XC" // 当表达式的结果等于 自建房 时,则执行该代码
895
+ break;
896
+ case '西华县天然气有限公司':
897
+ string = 'XH' // 当表达式的结果等于 商业 时,则执行该代码
898
+ break;
899
+ case '鹿邑县天然气有限公司':
900
+ string = 'LY' // 当表达式的结果等于 工业 时,则执行该代码
901
+ break;
902
+ case '郸城县天然气有限公司':
903
+ string = 'DC' // 当表达式的结果等于 中压 时,则执行该代码
904
+ break;
905
+ case '测试公司(一)':
906
+ string = 'CS' // 当表达式的结果等于 中压 时,则执行该代码
907
+ break;
908
+ default :
909
+ break; // 如果没有与表达式相同的值,则执行该代码
910
+ }
911
+ return string;
912
+ }
913
+
914
+ const dir = upperCaseChars(this.$login.f.orgs) //分公司
915
+
916
+ let type = 0 //类型
917
+
918
+ switch (this.show_data.f_entry_type){
919
+ case '城区/县城':
920
+ type = 1 // 当表达式的结果等于 城区 时,则执行该代码
921
+ break;
922
+ case '新农村':
923
+ type = 2 // 当表达式的结果等于 新农村 时,则执行该代码
924
+ break;
925
+ case '测试':
926
+ type = 3 // 当表达式的结果等于 新农村 时,则执行该代码
927
+ break;
928
+ default :
929
+ break; // 如果没有与表达式相同的值,则执行该代码
930
+ }
931
+
932
+ let nature = 0 // 性质
933
+ switch (this.show_data.f_apply_nature){
934
+ case '楼房':
935
+ nature = 1 // 当表达式的结果等于 楼房 时,则执行该代码
936
+ break;
937
+ case '房产':
938
+ nature = 1 // 当表达式的结果等于 房产 时,则执行该代码
939
+ break;
940
+ case '自建房':
941
+ nature = 2 // 当表达式的结果等于 自建房 时,则执行该代码
942
+ break;
943
+ case '商业':
944
+ nature = 3 // 当表达式的结果等于 商业 时,则执行该代码
945
+ break;
946
+ case '学校':
947
+ nature = 3 // 当表达式的结果等于 学校 时,则执行该代码
948
+ break;
949
+ case '福利机构':
950
+ nature = 3 // 当表达式的结果等于 福利机构 时,则执行该代码
951
+ break;
952
+ case '其他':
953
+ nature = 3 // 当表达式的结果等于 其他 时,则执行该代码
954
+ break;
955
+ case '工业':
956
+ nature = 4 // 当表达式的结果等于 工业 时,则执行该代码
957
+ break;
958
+ case '中压':
959
+ nature = 5 // 当表达式的结果等于 中压 时,则执行该代码
960
+ break;
961
+ case '测试':
962
+ nature = 6 // 当表达式的结果等于 中压 时,则执行该代码
963
+ break;
964
+ default :
965
+ break; // 如果没有与表达式相同的值,则执行该代码
966
+ }
967
+
968
+ const newMonth = date.month >= 10 ? date.month : '0' + date.month //月份
969
+ const dataYm = date.year + '-01-01'
970
+ const newYear = date.year + 1
971
+ const year = date.year.toString().substring(2,4) //年份
972
+
973
+ let data = {
974
+ orgid: this.$login.f.orgid
975
+ }
976
+
977
+ let http = new HttpResetClass()
978
+ let res = await http.load('POST', 'rs/sql/contractCount', {data:data}, {
979
+ resolveMsg: null,
980
+ rejectMsg: null
981
+ })
982
+ let oldDate
983
+ for (const item of res.data) {
984
+ if (item.name === '合同编号最后更新日期'){
985
+ oldDate = item.value
986
+ }
987
+ }
988
+ for (const item of res.data){
989
+ if (item.name === '合同编号'){
990
+ if (item.value === 0 || Date.parse(oldDate) < Date.parse(dataYm)) {
991
+ f_contract_number = dir + type + nature + year + newMonth + '001'
992
+ console.log("触发if", f_contract_number)
993
+ } else {
994
+ let count = item.value
995
+ f_contract_number = dir + type + nature + year + newMonth + this.PrefixInteger(count, 3)
996
+ console.log("触发else", f_contract_number)
997
+ }
998
+ }
999
+ }
1000
+ this.selectdata.f_contract_number = f_contract_number
1001
+ this.show_data.f_contract_number = f_contract_number
1002
+ return f_contract_number
1003
+ },
1004
+ PrefixInteger(num, n) {
1005
+ return (Array(n).join(0) + num).slice(-n);
1006
+ }
1007
+ },
1008
+ events: {
1009
+ 'priceType'(index){
1010
+ this.Pricetype = this.getLableValue('所属类型')
1011
+ console.log('打印方法值',this.getPrice(this.show_data.f_price_id))
1012
+ for (const item of this.show_data.fields) {
1013
+ if (this.show_data.f_sprice_type !=null && this.show_data.f_sprice_type !='') {
1014
+ if(item.label==='气价名称'){
1015
+ this.getPrice(this.show_data.f_price_id).then(value =>{
1016
+ item.options=value
1017
+ })
1018
+ console.log('最终',item.options)
1019
+ }
1020
+ }
1021
+ }
1022
+ },
1023
+ 'complyInstallation' (index) {
1024
+ if (this.show_data.f_is_have === '否') {
1025
+ this.hideButtons('提交', '出图', '缴费')
1026
+ this.showButtons('终止')
1027
+ }
1028
+ if (this.show_data.f_is_have === '是') {
1029
+ this.hideButtons('终止')
1030
+ this.showButtons('提交', '出图', '缴费')
1031
+ }
1032
+ },
1033
+ async 'igniteDispatchReadyEvent' () {
1034
+ let data = {
1035
+ tablename: 'activityins',
1036
+ condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
1037
+ }
1038
+ let http = new HttpResetClass()
1039
+ let res = await http.load(
1040
+ 'POST',
1041
+ `rs/sql/singleTable`,
1042
+ {data: data},
1043
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
1044
+ )
1045
+ if (res.data.length <= 0) {
1046
+ console.log('+++++++++++++++++++++++++++++')
1047
+ console.log('没有施工,不能退回')
1048
+ this.hideButtons('退回')
1049
+ }
1050
+ },
1051
+ 'buildReadyEvent' () {
1052
+ this.setLabelValue('施工单位', this.$login.f.name)
1053
+ this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
1054
+ },
1055
+ // 选择材料
1056
+ async materialNameChenge (index, fieldIndex) {
1057
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
1058
+
1059
+ this.show_data.onetomany[index].fields.forEach(item => {
1060
+ if (material[item.field]) {
1061
+ item.value = material[item.field]
1062
+ }
1063
+ })
1064
+ },
1065
+ // 打开模态框获取材料
1066
+ async 'getMaterialName' (index) {
1067
+ let data = {
1068
+ condition: `1=1`
1069
+ }
1070
+ let http = new HttpResetClass()
1071
+ let res = await http.load(
1072
+ 'POST',
1073
+ `rs/sql/getStockMaterial`,
1074
+ {data: data},
1075
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
1076
+ )
1077
+
1078
+ this.show_data.onetomany[index].fields.forEach(field => {
1079
+ if (field.label === '选择材料') {
1080
+ field.options = res.data.map(item => {
1081
+ return {
1082
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
1083
+ 'value': item
1084
+ }
1085
+ })
1086
+ }
1087
+ })
1088
+ },
1089
+ // 搜索小区
1090
+ async 'searchArea' (area, index) {
1091
+ let data = {
1092
+ tablename: 't_area',
1093
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1094
+ }
1095
+ let http = new HttpResetClass()
1096
+ let res = await http.load(
1097
+ 'POST',
1098
+ `rs/sql/singleTable`,
1099
+ {data: data},
1100
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1101
+ )
1102
+
1103
+ if (res.data.length === 0) {
1104
+ return
1105
+ }
1106
+
1107
+ this.setLabelOptions('集收单位', res.data.map(item => {
1108
+ return {
1109
+ label: item.f_residential_area,
1110
+ value: item.f_residential_area
1111
+ }
1112
+ }))
1113
+ },
1114
+ // 搜索小区
1115
+ async 'searchAreaCollective' (area, index) {
1116
+ let data = {
1117
+ tablename: 't_area',
1118
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${area}%'`
1119
+ }
1120
+ let http = new HttpResetClass()
1121
+ let res = await http.load(
1122
+ 'POST',
1123
+ `rs/sql/singleTable`,
1124
+ {data: data},
1125
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1126
+ )
1127
+
1128
+ if (res.data.length === 0) {
1129
+ return
1130
+ }
1131
+
1132
+ this.setLabelOptions('集收单位', res.data.map(item => {
1133
+ return {
1134
+ label: item.f_residential_area,
1135
+ value: item.f_residential_area
1136
+ }
1137
+ }))
1138
+ },
1139
+ // 选择气价
1140
+ 'priceChange' (index) {
1141
+ debugger
1142
+ if (isEmpty(this.show_data.stairPrice)) {
1143
+ return
1144
+ }
1145
+
1146
+ let stairPrice = this.getLableValue('气价名称')
1147
+
1148
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
1149
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
1150
+ this.setLabelValue('价格', stairPrice.f_price)
1151
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
1152
+
1153
+ this.show_data.f_price_id = stairPrice.f_price_id
1154
+ this.show_data.f_price_name = stairPrice.f_price_name
1155
+ },
1156
+ // 选择开发商
1157
+ async 'devInfoChange' (index) {
1158
+ if (isEmpty(this.show_data.f_company_name)) {
1159
+ return
1160
+ }
1161
+ let data = {
1162
+ tablename: 't_dev_info',
1163
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_dev_name = '${this.show_data.f_company_name}'`
1164
+ }
1165
+ let res = await this.$resetpost(
1166
+ `rs/sql/singleTable`,
1167
+ {data: data},
1168
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
1169
+ )
1170
+ this.show_data.f_dev_id = res.data[0].id
1171
+ this.show_data.f_dev_code = res.data[0].f_dev_code
1172
+ this.setLabelValue('法人名称', res.data[0].f_legal_person)
1173
+ this.setLabelValue('身份证', res.data[0].f_idnumber)
1174
+ this.setLabelValue('营业执照', res.data[0].f_license_num)
1175
+ },
1176
+ // 退款金额
1177
+ 'refundMoneyChange' (index) {
1178
+ let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
1179
+ let f_refund_money = this.show_data.fields[index].value
1180
+
1181
+ if (f_refund_money > f_cumulative_payment_money) {
1182
+ this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
1183
+ this.show_data.fields[index].value = null
1184
+ }
1185
+ },
1186
+ // 检查重复
1187
+ 'checkRepeat' (index) {
1188
+ this.checkDuplicate(index)
1189
+ },
1190
+ // 选择报建项目
1191
+ 'selectApply' (row) {
1192
+ this.setLabelValue('工程名称', row.f_entry_name)
1193
+ this.setLabelValue('工程编号', row.f_apply_num)
1194
+ this.setLabelValue('报建类型', row.f_apply_type)
1195
+ this.setLabelValue('用户名称', row.f_user_name)
1196
+ this.setLabelValue('用户电话', row.f_phone)
1197
+ this.setLabelValue('证件类型', row.f_credentials)
1198
+ this.setLabelValue('证件号码', row.f_idnumber)
1199
+ this.setLabelValue('地址', row.f_address)
1200
+ this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
1201
+
1202
+ this.show_data.parentApply = JSON.parse(JSON.stringify(row))
1203
+
1204
+ delete row.id
1205
+ delete row.actid
1206
+ delete row.defid
1207
+ delete row.defname
1208
+ delete row.version
1209
+ delete row.f_apply_num
1210
+ delete row.f_sub_state
1211
+ delete row.f_apply_type
1212
+ delete row.f_process_id
1213
+
1214
+ this.show_data = Object.assign({}, this.show_data, row)
1215
+
1216
+ this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
1217
+ },
1218
+ // 是否终止
1219
+ 'isStopChange' (index) {
1220
+ let f_is_stop = this.show_data.f_is_stop
1221
+
1222
+ for (const item of this.show_data.fields) {
1223
+ if (f_is_stop === '是') {
1224
+ if (item.label === '终止原因') {
1225
+ item.hidden = false
1226
+ item.required = true
1227
+ }
1228
+ } else {
1229
+ if (item.label === '终止原因') {
1230
+ item.hidden = true
1231
+ item.required = false
1232
+ }
1233
+ }
1234
+ }
1235
+ },
1236
+ // 终止报建初始化
1237
+ async 'stopApplyReadyEvent' () {
1238
+
1239
+ let f_is_stop = this.getLableValue('是否终止')
1240
+
1241
+ for (const item of this.show_data.fields) {
1242
+ if (f_is_stop === '是') {
1243
+ if (item.label === '终止原因') {
1244
+ item.hidden = false
1245
+ item.required = true
1246
+ }
1247
+ } else {
1248
+ if (item.label === '终止原因') {
1249
+ item.hidden = true
1250
+ item.required = false
1251
+ }
1252
+ }
1253
+ }
1254
+
1255
+ if (isEmpty(this.show_data.f_parent_process_id)) {
1256
+ return
1257
+ }
1258
+ let data = {
1259
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
1260
+ data: {
1261
+ id: this.$login.f.id,
1262
+ orgid: this.$login.f.orgid
1263
+ }
1264
+ }
1265
+ let res = await this.$resetpost(
1266
+ `rs/sql/supervisory`,
1267
+ {data: data},
1268
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
1269
+ )
1270
+ this.show_data.parentApply = res.data[0]
1271
+ },
1272
+ // 选择用户档案信息
1273
+ 'selectUserinfo' (row) {
1274
+ this.setLabelValue('用户编号', row.f_userinfo_code)
1275
+ this.setLabelValue('用户名称', row.f_user_name)
1276
+ this.setLabelValue('用户电话', row.f_user_phone)
1277
+ this.setLabelValue('证件类型', row.f_credentials)
1278
+ this.setLabelValue('证件号码', row.f_idnumber)
1279
+ this.setLabelValue('地址', row.f_address)
1280
+
1281
+ this.show_data.f_userinfo_id = row.f_userinfo_id
1282
+ this.show_data.f_userinfo_code = row.f_userinfo_code
1283
+ },
1284
+ // 是否购买保险
1285
+ async 'isInsureChange' (index) {
1286
+ if (!this.show_data.f_is_insure) {
1287
+ return
1288
+ }
1289
+ let f_is_insure = this.show_data.f_is_insure
1290
+ for (const item of this.show_data.fields) {
1291
+ if (f_is_insure === '是') {
1292
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1293
+ item.hidden = false
1294
+ item.required = true
1295
+ }
1296
+ if (item.label === '保险备注') {
1297
+ item.hidden = false
1298
+ }
1299
+ } else {
1300
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1301
+ item.hidden = true
1302
+ item.required = false
1303
+ }
1304
+ }
1305
+ }
1306
+ },
1307
+ // 通气点火初始化
1308
+ async 'gasReadyEvent' () {
1309
+ // 是否有气价信息
1310
+ if (!isEmpty(this.show_data.f_price_id)) {
1311
+ let priceList = await this.getPrice(this.show_data.f_price_id)
1312
+ this.setLabelValue('气价名称', priceList[0].value)
1313
+ }
1314
+
1315
+ let data = {
1316
+ tablename: 't_userfees',
1317
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
1318
+ }
1319
+ let http = new HttpResetClass()
1320
+ let res = await http.load(
1321
+ 'POST',
1322
+ `rs/sql/singleTable`,
1323
+ {data: data},
1324
+ {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
1325
+ )
1326
+ if (res.data.length > 0) {
1327
+ this.setLabelValue('待执行保险', '是')
1328
+ for (const item of this.show_data.fields) {
1329
+ if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1330
+ item.hidden = true
1331
+ item.required = false
1332
+ item.value = null
1333
+ }
1334
+ }
1335
+ } else {
1336
+ this.setLabelValue('待执行保险', '否')
1337
+ for (const item of this.show_data.fields) {
1338
+ if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1339
+ item.hidden = false
1340
+ item.required = true
1341
+ }
1342
+ }
1343
+ }
1344
+
1345
+ // 保险初始化显示内容
1346
+ let f_is_insure = this.getLableValue('是否购买保险')
1347
+ for (const item of this.show_data.fields) {
1348
+ if (f_is_insure === '是') {
1349
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1350
+ item.hidden = false
1351
+ item.required = true
1352
+ }
1353
+ if (item.label === '保险备注') {
1354
+ item.hidden = false
1355
+ }
1356
+ // 本期保费到期时间默认一年
1357
+ if (isEmpty(this.selectdata.f_ins_expiration_date)) {
1358
+ let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
1359
+ this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
1360
+ }
1361
+ }
1362
+ if (f_is_insure === '否') {
1363
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1364
+ item.hidden = true
1365
+ item.required = false
1366
+ }
1367
+ }
1368
+ }
1369
+ },
1370
+ // 合同金额失去焦点
1371
+ async 'contractMoneyChange' (index) {
1372
+ let data = {
1373
+ operator: '+',
1374
+ num1: this.show_data.f_contract_money || 0,
1375
+ num2: this.getLableValue('追加金额') || 0
1376
+ }
1377
+ let res = await this.$resetpost(
1378
+ `rs/logic/compute`,
1379
+ {data: data},
1380
+ {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1381
+ )
1382
+
1383
+ this.setLabelValue('应交金额', res.data)
1384
+ },
1385
+ // 街道失去焦点
1386
+ async 'streetChange' (index) {
1387
+ if (isEmpty(this.show_data.f_street)) {
1388
+ return
1389
+ }
1390
+
1391
+ this.setLabelValue('集收单位', null)
1392
+
1393
+ let data = {
1394
+ tablename: 't_area',
1395
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1396
+ }
1397
+ let http = new HttpResetClass()
1398
+ let res = await http.load(
1399
+ 'POST',
1400
+ `rs/sql/singleTable`,
1401
+ {data: data},
1402
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1403
+ )
1404
+
1405
+ this.setLabelOptions('集收单位', res.data.map(item => {
1406
+ return {
1407
+ label: item.f_residential_area,
1408
+ value: item.f_residential_area
1409
+ }
1410
+ }))
1411
+ },
1412
+ // 区县失去焦点
1413
+ async 'pcdChange' (index) {
1414
+ if (isEmpty(this.show_data.f_pcd)) {
1415
+ return
1416
+ }
1417
+
1418
+ this.setLabelValue('街道/乡镇', null)
1419
+ this.setLabelValue('集收单位', null)
1420
+
1421
+
1422
+
1423
+ let data = {
1424
+ tablename: 't_street',
1425
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1426
+ }
1427
+ let f_address_type = this.getLableValue('地址类型')
1428
+
1429
+ if (f_address_type === '民用市区') {
1430
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1431
+ }
1432
+ if (f_address_type === '民用乡镇') {
1433
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1434
+ }
1435
+
1436
+ let http = new HttpResetClass()
1437
+ let res = await http.load(
1438
+ 'POST',
1439
+ `rs/sql/singleTable`,
1440
+ {data: data},
1441
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1442
+ )
1443
+
1444
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
1445
+ return {
1446
+ label: item.f_street,
1447
+ value: item.f_street
1448
+ }
1449
+ }))
1450
+ },
1451
+ // 地址类型失去焦点
1452
+ 'addressTypeChange' (index) {
1453
+ this.setLabelValue('街道/乡镇', null)
1454
+ this.setLabelValue('集收单位', null)
1455
+ let f_address_type = this.show_data.fields[index].value
1456
+ for (const item of this.show_data.fields) {
1457
+ if (f_address_type === '民用市区') {
1458
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1459
+ item.hidden = false
1460
+ item.required = true
1461
+ item.value = null
1462
+ }
1463
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1464
+ item.hidden = false
1465
+ item.required = false
1466
+ item.value = null
1467
+ }
1468
+ if (item.label === '地址') {
1469
+ item.readonly = true
1470
+ item.value = null
1471
+ }
1472
+ }
1473
+ if (f_address_type === '民用乡镇') {
1474
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1475
+ item.hidden = false
1476
+ item.required = true
1477
+ item.value = null
1478
+ }
1479
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1480
+ item.hidden = false
1481
+ item.required = false
1482
+ item.value = null
1483
+ }
1484
+ if (item.label === '楼层') {
1485
+ item.hidden = true
1486
+ item.required = false
1487
+ item.value = null
1488
+ }
1489
+ if (item.label === '地址') {
1490
+ item.readonly = true
1491
+ item.value = null
1492
+ }
1493
+ }
1494
+ if (f_address_type === '特殊地址') {
1495
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
1496
+ item.hidden = false
1497
+ item.required = true
1498
+ item.value = null
1499
+ }
1500
+ if (item.label === '集收单位') {
1501
+ item.hidden = false
1502
+ item.required = false
1503
+ item.value = null
1504
+ }
1505
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1506
+ item.hidden = true
1507
+ item.required = false
1508
+ item.value = null
1509
+ }
1510
+ if (item.label === '地址') {
1511
+ item.readonly = false
1512
+ item.value = null
1513
+ }
1514
+ }
1515
+ }
1516
+ },
1517
+ // 团购转散户初始化
1518
+ 'apply2ReadyEvent' () {
1519
+ if (this.show_data.f_apply_source === '线下发起') {
1520
+ this.addressInitialization()
1521
+ this.hideLabels('用户编号')
1522
+ this.electiveLabels('用户编号')
1523
+ this.showLabels('片区', '地址类型')
1524
+ this.requiredLabels('片区', '地址类型')
1525
+ }
1526
+ if (this.show_data.f_apply_source === '自动发起') {
1527
+ this.hideLabels('片区', '地址类型')
1528
+ this.electiveLabels('片区', '地址类型',)
1529
+ }
1530
+ },
1531
+ // 申请节点初始化
1532
+ 'applyReadyEvent' () {
1533
+ this.addressInitialization()
1534
+ this.pcdChange()
1535
+ this.streetChange()
1536
+ },
1537
+ // ===========================================
1538
+ async 'button'() {
1539
+ if (this.show_data.button.before) {
1540
+ await this[this.show_data.button.before]()
1541
+ }
1542
+ // 点击重置按钮就重置数据
1543
+ if (this.show_data.button.button_name === '重置') {
1544
+ this.$dispatch('breakControl', this.selectdata)
1545
+ return
1546
+ }
1547
+
1548
+ this.show_data.user = this.$login.f
1549
+ this.show_data.start_activity = this.$workflow_vue.start_activity
1550
+ this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1551
+
1552
+ if ((this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') && this.show_data.defname === '工程施工' && this.show_data.f_sub_state !='完工' && this.show_data.button.button_name === '完工'){
1553
+ //判断是否添加报警器材料
1554
+ let bjqlag = false
1555
+ let datatemp = {
1556
+ 'bjqid':"",
1557
+ 'fprocessid':"",
1558
+ 'sqvalue':"",
1559
+ 'f_bjq_sid':"",
1560
+ 'f_material_code':"",
1561
+ 'f_bjq_baidu_lng':"",
1562
+ 'f_bjq_baidu_lat':"",
1563
+ 'f_bjq_gaode_lng':"",
1564
+ 'f_bjq_gaode_lat':""
1565
+ }
1566
+
1567
+ let bjqststedata = {
1568
+ "sid":"",
1569
+ "bjqtype":"",
1570
+ "f_process_id":"",
1571
+ "bjqstate":"",
1572
+ "f_userinfo_code":""
1573
+ }
1574
+ let numOne = [];
1575
+
1576
+ let http = new HttpResetClass()
1577
+ let data = {
1578
+ tablename: `t_material_apply`,
1579
+ condition: `f_process_id='${this.show_data.f_process_id}'`
1580
+ }
1581
+ let res = await http.load(
1582
+ 'POST',
1583
+ `rs/sql/singleTable`,
1584
+ {data: data},
1585
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
1586
+ )
1587
+ res.data.forEach(item => {
1588
+ if (item.f_material_name.substr(0,3) === '报警器'){
1589
+ var bjname = item.f_material_name.split("-")
1590
+ bjqststedata.sid = item.f_bjq_sid
1591
+ bjqststedata.f_process_id = item.f_process_id
1592
+ bjqststedata.bjqtype = bjname[1]
1593
+ //====================================
1594
+ bjqlag = true
1595
+ datatemp.bjqid = item.id
1596
+ datatemp.fprocessid = item.f_process_id
1597
+ datatemp.f_bjq_sid = item.f_bjq_sid
1598
+ datatemp.f_material_code = item.f_material_code
1599
+ datatemp.f_bjq_lng = item.f_bjq_lng
1600
+ datatemp.f_bjq_lat = item.f_bjq_lat
1601
+ datatemp.f_bjq_gaode_lng = item.f_bjq_gaode_lng
1602
+ datatemp.f_bjq_gaode_lat = item.f_bjq_gaode_lng
1603
+ datatemp.f_bjq_baidu_lng = item.f_bjq_baidu_lng
1604
+ datatemp.f_bjq_baidu_lat = item.f_bjq_baidu_lat
1605
+ numOne.push(item.f_bjq_sid)
1606
+ }
1607
+ })
1608
+
1609
+ // this.show_data.onetomany.forEach(item=>{
1610
+ // console.log("查看报警器材料",item)
1611
+ // item.rows.forEach(i=>{
1612
+ // if (i.f_material_name.substr(0,3) === '报警器'){
1613
+ // var bjname = i.f_material_name.split("-")
1614
+ // bjqststedata.sid = i.f_bjq_sid
1615
+ // bjqststedata.f_process_id = i.f_process_id
1616
+ // bjqststedata.bjqtype = bjname[1]
1617
+ // //====================================
1618
+ // bjqlag = true
1619
+ // datatemp.bjqid = i.id
1620
+ // datatemp.fprocessid = i.f_process_id
1621
+ // datatemp.f_bjq_sid = i.f_bjq_sid
1622
+ // datatemp.f_material_code = i.f_material_code
1623
+ // numOne.push(i.f_bjq_sid)
1624
+ // }
1625
+ // })
1626
+ // })
1627
+ if (!bjqlag){
1628
+ this.$showMessage('请添加报警器物料信息!!!')
1629
+ return
1630
+ }
1631
+ if (numOne.length > 1){
1632
+ this.$showMessage("暂时支持单个报警器物料安装!!!")
1633
+ return
1634
+ }
1635
+ datatemp.sqvalue = this.show_data.areaData.sqvalue
1636
+ datatemp.f_bjq_baidu_lng = this.show_data.templatlng.baidutemplng
1637
+ datatemp.f_bjq_baidu_lat = this.show_data.templatlng.baidutemplat
1638
+ datatemp.f_bjq_gaode_lng = this.show_data.templatlng.gaodetemplng
1639
+ datatemp.f_bjq_gaode_lat = this.show_data.templatlng.gaodetemplat
1640
+ datatemp.f_bjq_lng = this.show_data.templatlng.baidutemplng
1641
+ datatemp.f_bjq_lat = this.show_data.templatlng.baidutemplat
1642
+
1643
+ bjqststedata.f_userinfo_code = this.show_data.f_userinfo_code
1644
+
1645
+ //判断是否推送 及推送的状态
1646
+ //查询是否存在, 以型号及厂家判断
1647
+ let bjqres = await this.$resetpost(
1648
+ `rs/logic/getbjqsyncinfo`,
1649
+ bjqststedata
1650
+ )
1651
+ if (bjqres.data.bjqstate != "成功"){
1652
+ //区域地址存入材料记录表
1653
+ let areares = await this.$resetpost(
1654
+ `rs/logic/saveArea`,
1655
+ {data: datatemp},
1656
+ {resolveMsg: null, rejectMsg: '区域地址保存失败'}
1657
+ )
1658
+
1659
+ //完工之后推送数据到汉威
1660
+ let adddata = {
1661
+ f_bjq_sid : datatemp.f_bjq_sid,
1662
+ f_material_code : datatemp.f_material_code,
1663
+ f_bjq_address: this.show_data.areaData.sqvalue,
1664
+ f_user_name: this.show_data.f_user_name,
1665
+ f_address: this.show_data.f_address,
1666
+ f_user_phone: this.show_data.f_phone,
1667
+ f_userinfo_code: this.show_data.f_userinfo_code,
1668
+ installtime: this.show_data.f_construction_date,
1669
+ f_orgid : this.show_data.f_orgid,
1670
+ f_bjq_lng: datatemp.f_bjq_baidu_lng,
1671
+ f_bjq_lat: datatemp.f_bjq_baidu_lat
1672
+ }
1673
+ let res = await this.$resetpost(
1674
+ `ncc/rs/logic/bjqadduser`,
1675
+ // `rs/logic/bjqadduser`,
1676
+ adddata
1677
+ )
1678
+ if (res.data.code != 200){
1679
+ if (bjqres.data.bjqstate.length == 0){
1680
+ bjqststedata.bjqstate = "失败"
1681
+ let bjqres3 = await this.$resetpost(
1682
+ `rs/logic/addbjqsyncinfo`,
1683
+ bjqststedata
1684
+ )
1685
+ }
1686
+ this.$showMessage(res.data.msg)
1687
+ return
1688
+ }
1689
+ //更改记录表状态
1690
+ if (bjqres.data.bjqstate === "失败"){
1691
+ bjqststedata.bjqstate = "成功"
1692
+ let bjqres1 = await this.$resetpost(
1693
+ `rs/logic/updatebjqsyncinfo`,
1694
+ bjqststedata
1695
+ )
1696
+ }else{
1697
+ bjqststedata.bjqstate = "成功"
1698
+ let bjqres2 = await this.$resetpost(
1699
+ `rs/logic/addbjqsyncinfo`,
1700
+ bjqststedata
1701
+ )
1702
+ }
1703
+ }
1704
+ }
1705
+ if ((this.show_data.f_apply_type === '工商户报建' || this.show_data.f_apply_type === '团购报建')
1706
+ && (this.show_data.defname === '报装申请') && this.show_data.button.button_name === '提交'){
1707
+ await this.contract_number()
1708
+ }
1709
+ if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && (this.show_data.button.button_name === '保存'||this.show_data.button.button_name === '提交')){
1710
+ let dataz = {
1711
+ condition: `u.id = ${this.show_data.id}`,
1712
+ data: {
1713
+ id: this.$login.f.id,
1714
+ orgid: this.$login.f.orgid
1715
+ }
1716
+ }
1717
+ let http = new HttpResetClass()
1718
+ let restpz = await http.load(
1719
+ 'POST',
1720
+ `rs/sql/checkuser`,
1721
+ {data: dataz},
1722
+ {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1723
+ )
1724
+ this.show_data.actid=restpz.data[0].actid
1725
+ }
1726
+ let res = await this.$resetpost(
1727
+ `rs/logic/ApplyProductService`,
1728
+ {data: this.show_data},
1729
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1730
+ )
1731
+
1732
+
1733
+ if (this.show_data.button.after) {
1734
+ this[this.show_data.button.after]()
1735
+ }
1736
+ // 改管报建 增容报建 优化
1737
+ if((this.show_data.f_apply_type === '改管报建'||this.show_data.f_apply_type === '增容报建') && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '缴费'){
1738
+ let datagg = {
1739
+ condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1740
+ }
1741
+ let http = new HttpResetClass()
1742
+ let restgg = await http.load(
1743
+ 'POST',
1744
+ `rs/sql/checkusertwo`,
1745
+ {data: datagg},
1746
+ {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1747
+ )
1748
+ debugger
1749
+ if(this.show_data.f_apply_type === '改管报建'){
1750
+ restgg.data[0].processname = '改管报建流程'
1751
+ restgg.data[0].defname = '报装缴费'
1752
+ }else{
1753
+ restgg.data[0].processname = '增容报建流程'
1754
+ restgg.data[0].defname = '报装缴费'
1755
+ }
1756
+ restgg.data[0].actid = restgg.data[0].actid + 1
1757
+ this.$dispatch('apply',restgg.data[0])
1758
+
1759
+ }
1760
+
1761
+ // 退款报建 优化
1762
+ if(this.show_data.f_apply_type === '退款报建' && this.show_data.defname === '终止报建' && this.show_data.button.button_name === '提交'){
1763
+ let datatk = {
1764
+ condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1765
+ }
1766
+ let http = new HttpResetClass()
1767
+ let resttk = await http.load(
1768
+ 'POST',
1769
+ `rs/sql/checkusertwo`,
1770
+ {data: datatk},
1771
+ {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1772
+ )
1773
+ debugger
1774
+ resttk.data[0].processname = '退款报建流程'
1775
+ resttk.data[0].defname = '退款'
1776
+ this.$dispatch('apply',resttk.data[0])
1777
+
1778
+ }
1779
+
1780
+
1781
+ if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '合同'){
1782
+ let data = {
1783
+ tablename: 't_apply',
1784
+ condition: `f_process_id='${this.show_data.f_process_id}'`
1785
+ }
1786
+ let http = new HttpResetClass()
1787
+ let restp = await http.load(
1788
+ 'POST',
1789
+ `rs/sql/singleTable`,
1790
+ {data: data},
1791
+ {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1792
+ )
1793
+ debugger
1794
+ restp.data[0].processname = '散户报建流程'
1795
+ restp.data[0].defname = '合同签订'
1796
+ this.$dispatch('apply',restp.data[0])
1797
+
1798
+ } else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && this.show_data.button.button_name === '提交'){
1799
+ let data2 = {
1800
+ condition: `u.id = ${this.show_data.id}`,
1801
+ data: {
1802
+ id: this.$login.f.id,
1803
+ orgid: this.$login.f.orgid
1804
+ }
1805
+ }
1806
+ let http = new HttpResetClass()
1807
+ let restp1 = await http.load(
1808
+ 'POST',
1809
+ `rs/sql/checkuser`,
1810
+ {data: data2},
1811
+ {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1812
+ )
1813
+ debugger
1814
+ console.log('有没有发请求打印查询的内容restp1',restp1)
1815
+ // restp1.data[0].processname = '散户报建流程'
1816
+ // restp1.data[0].defname = '报装缴费'
1817
+ this.$dispatch('apply',restp1.data[0])
1818
+ }else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装缴费' && this.show_data.button.button_name === '提交'){
1819
+ let data3 = {
1820
+ condition: `u.id = ${this.show_data.id}`,
1821
+ data: {
1822
+ id: this.$login.f.id,
1823
+ orgid: this.$login.f.orgid
1824
+ }
1825
+ }
1826
+ let http = new HttpResetClass()
1827
+ let restp2 = await http.load(
1828
+ 'POST',
1829
+ `rs/sql/checkuser`,
1830
+ {data: data3},
1831
+ {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1832
+ )
1833
+ debugger
1834
+ console.log('打印查询的内容',restp2)
1835
+ if(restp2.length>0){
1836
+ this.$dispatch('apply',restp2.data[0])
1837
+ }else{
1838
+ debugger
1839
+ this.$dispatch('loadPage')
1840
+ }
1841
+ }
1842
+ else{
1843
+ this.$dispatch('loadPage')
1844
+ }
1845
+
1846
+ },
1847
+ // 失去焦点出触发事件
1848
+ 'onchange' (index) {
1849
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1850
+ if (
1851
+ this.show_data.fields[index].label === '区/县' ||
1852
+ this.show_data.fields[index].label === '街道/乡镇' ||
1853
+ this.show_data.fields[index].label === '集收单位' ||
1854
+ this.show_data.fields[index].label === '楼号/组' ||
1855
+ this.show_data.fields[index].label === '单元/排' ||
1856
+ this.show_data.fields[index].label === '楼层' ||
1857
+ this.show_data.fields[index].label === '门牌号'
1858
+ ) {
1859
+
1860
+ let f_pcd = this.getLableValue('区/县') || ''
1861
+ let f_street = this.getLableValue('街道/乡镇') || ''
1862
+ let f_residential_area = this.getLableValue('集收单位') || ''
1863
+ let f_building = this.getLableValue('楼号/组') || ''
1864
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1865
+ let f_unit = this.getLableValue('单元/排') || ''
1866
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1867
+ let f_floor = this.getLableValue('楼层') || ''
1868
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1869
+ let f_room = this.getLableValue('门牌号') || ''
1870
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1871
+
1872
+ 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
1873
+ this.setLabelValue("地址", f_address)
1874
+ }
1875
+ }
1876
+ },
1877
+ selectSearch (val, index) {},
1878
+ 'onblur' (index) {},
1879
+ 'oninput' (index) {},
1880
+ 'initializtionView' () {},
1881
+ async 'onchangeModal' (index, fieldIndex) {
1882
+ },
1883
+ async 'onblurModal' (index, fieldIndex) {
1884
+
1885
+ },
1886
+ async 'oninputModal' (index, fieldIndex) {
1887
+
1888
+ },
1889
+ async 'onetomanydelete' (index, rowIndex) {
1890
+
1891
+ let http = new HttpResetClass()
1892
+
1893
+ let res = await http.load(
1894
+ 'DELETE',
1895
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1896
+ null,
1897
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1898
+ )
1899
+
1900
+ res = await this.$resetpost(
1901
+ 'rs/entity/t_apply',
1902
+ this.show_data
1903
+ )
1904
+
1905
+ this.$dispatch('breakControl', this.show_data)
1906
+ },
1907
+ async 'onetomanyupdate' (index, rowIndex) {
1908
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1909
+
1910
+ this.show_data.onetomany[index].fields.forEach(item => {
1911
+ data[item.field] = item.value
1912
+ })
1913
+ let res = await this.$resetpost(
1914
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1915
+ data
1916
+ )
1917
+
1918
+ res = await this.$resetpost(
1919
+ 'rs/entity/t_apply',
1920
+ this.show_data
1921
+ )
1922
+
1923
+ this.$dispatch('breakControl', this.show_data)
1924
+ },
1925
+ async 'onetomanyadd' (index) {
1926
+ let data = {
1927
+ f_process_id : this.show_data.f_process_id,
1928
+ f_operator_id: this.$login.f.id,
1929
+ f_operator: this.$login.f.name,
1930
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1931
+ f_orgid: this.$login.f.orgid,
1932
+ f_orgname: this.$login.f.orgs
1933
+ }
1934
+ this.show_data.onetomany[index].fields.forEach(item => {
1935
+ data[item.field] = item.value
1936
+ })
1937
+ let res = await this.$resetpost(
1938
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1939
+ data
1940
+ )
1941
+
1942
+ res = await this.$resetpost(
1943
+ 'rs/entity/t_apply',
1944
+ this.show_data
1945
+ )
1946
+
1947
+ this.$dispatch('breakControl', this.show_data)
1948
+ },
1949
+ async 'importEvent' (index, table, configName, filepath) {
1950
+ let data = {
1951
+ selectdata: this.show_data,
1952
+ table: table,
1953
+ filepath: filepath,
1954
+ configName: configName,
1955
+ user: this.$login.f
1956
+ }
1957
+
1958
+ let res = await this.$resetpost(
1959
+ `rs/logic/importEvent`,
1960
+ data
1961
+ )
1962
+
1963
+ this.$dispatch('breakControl', this.show_data)
1964
+ },
1965
+ 'onbutchange' (index) {
1966
+
1967
+ },
1968
+ 'onbutblur' (index) {
1969
+
1970
+ },
1971
+ 'onbutinput' (index) {
1972
+
1973
+
1974
+ }
1975
+ },
1976
+ watch: {
1977
+ }
1978
+ }
1979
+ </script>
1980
+ <style scoped>
1981
+ /*清除model中的浮动*/
1982
+ .clearfix:after,.clearfix:before{
1983
+ display: table;
1984
+ }
1985
+ .clearfix:after{
1986
+ clear: both;
1987
+ }
1988
+ </style>