apply-clients 3.4.85 → 3.4.88

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,902 @@
1
+ <template>
2
+ <div class="auto clearfix">
3
+ <show-back-reason :selectdata="show_data"></show-back-reason>
4
+ </div>
5
+ <service-view v-ref:service_show :data="show_data" v-if="showview"></service-view>
6
+ </template>
7
+ <script>
8
+ import Vue from 'vue'
9
+ import {HttpResetClass} from 'vue-client'
10
+ import {isEmpty} from "../../../components/Util";
11
+ // Date格式化
12
+ Date.prototype.Format = function (fmt) {
13
+ var o = {
14
+ 'M+': this.getMonth() + 1, // 月份
15
+ 'd+': this.getDate(), // 日
16
+ 'H+': this.getHours(), // 小时
17
+ 'm+': this.getMinutes(), // 分
18
+ 's+': this.getSeconds(), // 秒
19
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
20
+ 'S': this.getMilliseconds() // 毫秒
21
+ }
22
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
23
+ for (var k in o) {
24
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
25
+ }
26
+ return fmt
27
+ }
28
+ export default {
29
+ title: '报建监控控制层',
30
+ props: {
31
+ selectdata: {
32
+ type: Object
33
+ },
34
+ nodeSnapshot: {
35
+ type: Boolean,
36
+ default: false
37
+ }
38
+ },
39
+ data() {
40
+ return {
41
+ data: null, // 展示的数据
42
+ json_datas: null, // json配置数据结构
43
+ showview: false, // 控制显示层显示
44
+ show_data: null,
45
+ config: {}
46
+ }
47
+ },
48
+ created () {
49
+ this.refurbish()
50
+ },
51
+ methods: {
52
+ //获取堪察人员
53
+ async getReconnaissancePeople(){
54
+ let data = {
55
+ source: 'this.getParentByType($organization$).getChildByName($发展员$).getChildren()',
56
+ userid: this.$login.f.id
57
+ }
58
+
59
+ let http = new HttpResetClass()
60
+ let res = await http.load(
61
+ 'POST',
62
+ `rs/search`,
63
+ {data: data},
64
+ {resolveMsg: null, rejectMsg: '勘察人员查询失败!!!'}
65
+ )
66
+
67
+ return res.data.map(item => {
68
+ return {
69
+ label: item.name,
70
+ value: item.name
71
+ }
72
+ })
73
+ },
74
+ // 初始化模块
75
+ async refurbish() {
76
+ this.json_datas = this.$workflow_vue
77
+ let sum = 0
78
+ let jsonData = {}
79
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
80
+ this.$showMessage("网络故障,请刷新页面")
81
+ return
82
+ }
83
+ this.json_datas.activitys.forEach(item => {
84
+ if (this.selectdata.defname === item.title) {
85
+ jsonData = item // 拿到当前节点的json配置信息
86
+ sum++ // 节点名一样的个数
87
+ }
88
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
89
+ })
90
+
91
+ if (sum === 0) {
92
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
93
+ return
94
+ }
95
+ if (sum > 1) {
96
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
97
+ return
98
+ }
99
+
100
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
101
+
102
+ // fields 字段填充值
103
+ for (const item of this.selectdata.fields) {
104
+ if (!item.value) {
105
+ item.value = null
106
+ }
107
+
108
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
109
+ if (item.eval) {
110
+ item.value = eval(item.default)
111
+ } else {
112
+ item.value = item.default
113
+ }
114
+ }
115
+
116
+ if (this.selectdata[item.field]) {
117
+ // 将json字符串格式化赋值给value
118
+ if (String(this.selectdata[item.field]).startsWith("{")) {
119
+ item.value = JSON.parse(this.selectdata[item.field])
120
+ } else {
121
+ item.value = this.selectdata[item.field]
122
+ }
123
+ }
124
+ if (this.selectdata[item.field] === 0) {
125
+ item.value = 0
126
+ }
127
+
128
+ // datepicker
129
+ if (item.type === 'datepicker' && !item.value && item.default) {
130
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
131
+ }
132
+
133
+ // 如果配置类型为select,优先从参数列表获取options
134
+ if (item.type === 'select' || item.type === 'checkbox') {
135
+ if (item.param) {
136
+ let temp = this.$appdata.getParam(item.label)
137
+
138
+ if (temp && temp.length > 0) {
139
+ item.options = temp
140
+ }
141
+
142
+ if (item.paramLabel) {
143
+ temp = this.$appdata.getParam(item.paramLabel)
144
+ if (temp && temp.length > 0) {
145
+ item.options = temp
146
+ }
147
+ }
148
+ }
149
+ if (item.ready) {
150
+ item.options = await this[item.ready]()
151
+ }
152
+ }
153
+
154
+
155
+ if (item.type === 'checkbox') {
156
+ if (this.selectdata[item.field]) {
157
+ item.value = JSON.parse(this.selectdata[item.field])
158
+ } else {
159
+ item.value = []
160
+ }
161
+ }
162
+
163
+ this.selectdata[item.field] = item.value
164
+
165
+ item.readonly = true
166
+ item.disabled = true
167
+ }
168
+
169
+ // 控制组件
170
+ if (this.selectdata.components) {
171
+ this.selectdata.components.forEach(item => {
172
+ item.mark = 1
173
+ if (item.supervisory && this[item.supervisory]()) {
174
+ item.mark = 0
175
+ }
176
+ })
177
+ }
178
+
179
+ // 初始化onetomany
180
+ if (this.selectdata.onetomany) {
181
+ for (const item of this.selectdata.onetomany) {
182
+ let res = null
183
+ if (item.queryEvent) {
184
+ res = this[item.queryEvent]()
185
+ } else {
186
+ let data = {
187
+ tablename: item.tables[0],
188
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
189
+ }
190
+ res = await this.$resetpost(
191
+ 'rs/sql/apply_singleTable',
192
+ {data: data},
193
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
194
+ )
195
+ }
196
+
197
+ item.rows = res.data
198
+
199
+ // 初始化onetomany中的fields
200
+ for (const field of item.fields) {
201
+ if (!field.value) {
202
+ if (field.value !== 0) {
203
+ field.value = null
204
+ }
205
+ }
206
+
207
+ if (field.default || field.default === 0) {
208
+ field.value = field.default
209
+ }
210
+
211
+ // datepicker
212
+ if (field.type === 'datepicker' && !field.value && field.default) {
213
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
214
+ }
215
+
216
+ if (field.type === 'select') {
217
+
218
+ let temp = this.$appdata.getParam(field.label)
219
+
220
+ if (temp && temp.length > 0) {
221
+ field.options = temp
222
+ }
223
+
224
+ if (field.paramLabel) {
225
+ temp = this.$appdata.getParam(field.paramLabel)
226
+ if (temp && temp.length > 0) {
227
+ item.options = temp
228
+ }
229
+ }
230
+
231
+ }
232
+ }
233
+
234
+ // 隐藏所有操作
235
+ item.hiddenOperate = true
236
+ if (item.supervisory && this[item.supervisory]()) {
237
+ item.hiddenOperate = false
238
+ }
239
+ }
240
+ }
241
+
242
+ // 去除button
243
+ this.selectdata.buttons = null
244
+
245
+ // 完成时间和完成人,部门,分公司
246
+ if (this.selectdata.state === '结束') {
247
+ let http = new HttpResetClass()
248
+ let res = await http.load('POST', 'rs/search', {
249
+ source: 'this.getInfo()',
250
+ userid: this.selectdata.userid
251
+ }, {resolveMsg: null, rejectMsg: '处理人员获取失败!!!'})
252
+ let user = res.data
253
+ this.selectdata.operate_date = new Date(this.selectdata.finishtime).Format('yyyy-MM-dd')
254
+ this.selectdata.operator = this.selectdata.person
255
+ this.selectdata.orgs = user.orgs
256
+ this.selectdata.parentname = user.deps
257
+ }
258
+
259
+ // 未结束且是下发查看指定人员
260
+ if (this.selectdata.state !== '结束' && this.selectdata.actorexpression !== null && this.selectdata.actorexpression.indexOf('PI') === 0) {
261
+ let http = new HttpResetClass()
262
+ let res = await http.load('POST', 'rs/search', {
263
+ source: 'this',
264
+ userid: this.selectdata.actorexpression.substring(3, this.selectdata.actorexpression.length-1)
265
+ }, {resolveMsg: null, rejectMsg: '处理人员获取失败!!!'})
266
+ let user = res.data
267
+ this.selectdata.operate_date = new Date().Format('yyyy-MM-dd')
268
+ this.selectdata.operator = user.name
269
+ this.selectdata.orgs = user.orgs
270
+ this.selectdata.parentname = user.f_department_name
271
+ }
272
+
273
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
274
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
275
+
276
+ this.show_data = temp
277
+ for (const item of this.show_data.fields) {
278
+ if(item.label==='气价名称'){
279
+ item.value=this.show_data.f_price_name
280
+ }
281
+ }
282
+ this.$nextTick(() => {
283
+ this.showview = true
284
+ })
285
+ },
286
+ // 金额转大写
287
+ smalltoBIG(n) {
288
+ let fraction = ['角', '分'];
289
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
290
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
291
+ let head = n < 0 ? '欠' : '';
292
+ n = Math.abs(n);
293
+
294
+ let s = '';
295
+
296
+ for (var i = 0; i < fraction.length; i++) {
297
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
298
+ }
299
+ s = s || '整';
300
+ n = Math.floor(n);
301
+
302
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
303
+ let p = '';
304
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
305
+ p = digit[n % 10] + unit[1][j] + p;
306
+ n = Math.floor(n / 10);
307
+ }
308
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
309
+ }
310
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
311
+ },
312
+ getLableValue(label) {
313
+ for (const item of this.show_data.fields) {
314
+ if (item.label === label && item.type !== 'number') {
315
+ return item.value || ''
316
+ }
317
+ if (item.label === label && item.type === 'number') {
318
+ return item.value || 0
319
+ }
320
+ }
321
+ },
322
+ getLableOptions(label) {
323
+ for (const item of this.show_data.fields) {
324
+ if (item.label === label) {
325
+ return item.options
326
+ }
327
+ }
328
+ },
329
+ setLabelValue(label, value) {
330
+ for (const item of this.show_data.fields) {
331
+ if (item.label === label) {
332
+ item.value = value
333
+ this.show_data[item.field] = value
334
+ }
335
+ }
336
+ },
337
+ setLabelOptions(label, options) {
338
+ for (const item of this.show_data.fields) {
339
+ if (item.label === label) {
340
+ item.options = options
341
+ }
342
+ }
343
+ },
344
+ showLabels(...labels) {
345
+ for (const item of this.show_data.fields) {
346
+ if (labels.includes(item.label)) {
347
+ item.hidden = false
348
+ }
349
+ }
350
+ },
351
+ hideLabels(...labels) {
352
+ for (const item of this.show_data.fields) {
353
+ if (labels.includes(item.label)) {
354
+ item.hidden = true
355
+ }
356
+ }
357
+ },
358
+ requiredLabels(...labels) {
359
+ for (const item of this.show_data.fields) {
360
+ if (labels.includes(item.label)) {
361
+ item.required = true
362
+ }
363
+ }
364
+ },
365
+ electiveLabels(...labels) {
366
+ for (const item of this.show_data.fields) {
367
+ if (labels.includes(item.label)) {
368
+ item.required = false
369
+ }
370
+ }
371
+ },
372
+ readonlyLabels(...labels) {
373
+ for (const item of this.show_data.fields) {
374
+ if (labels.includes(item.label)) {
375
+ item.readonly = true
376
+ item.disabled = true
377
+ }
378
+ }
379
+ },
380
+ readwriteLabels(...labels) {
381
+ for (const item of this.show_data.fields) {
382
+ if (labels.includes(item.label)) {
383
+ item.readonly = false
384
+ item.disabled = false
385
+ }
386
+ }
387
+ },
388
+ disabledButtons(...buttons) {
389
+ for (const item of this.show_data.buttons) {
390
+ if (buttons.includes(item.button_name)) {
391
+ item.disabled = true
392
+ }
393
+ }
394
+ },
395
+ enableButtons(...buttons) {
396
+ for (const item of this.show_data.buttons) {
397
+ if (buttons.includes(item.button_name)) {
398
+ item.disabled = false
399
+ }
400
+ }
401
+ },
402
+ showButtons(...buttons) {
403
+ for (const item of this.show_data.buttons) {
404
+ if (buttons.includes(item.button_name)) {
405
+ item.hidden = false
406
+ }
407
+ }
408
+ },
409
+ hideButtons(...buttons) {
410
+ for (const item of this.show_data.buttons) {
411
+ if (buttons.includes(item.button_name)) {
412
+ item.hidden = true
413
+ }
414
+ }
415
+ },
416
+ async checkDuplicate(index) {
417
+ let http = new HttpResetClass()
418
+ let data = {
419
+ tablename: 't_apply',
420
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
421
+ }
422
+ let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
423
+ resolveMsg: null,
424
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
425
+ })
426
+ if (res.data.length > 0) {
427
+ this.show_data.fields[index].value = null
428
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
429
+ }
430
+ },
431
+ // 获取片区
432
+ async getSliceArea () {
433
+ let data = {
434
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
435
+ userid: this.$login.f.id
436
+ }
437
+
438
+ let res = await this.$resetpost(
439
+ `rs/search`,
440
+ {data: data},
441
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
442
+ )
443
+
444
+ return res.data.map(item => {
445
+ return {
446
+ label: item.name,
447
+ value: item.name
448
+ }
449
+ })
450
+ },
451
+ // 获取区县
452
+ async getPcd () {
453
+ let data = {
454
+ tablename: 't_pcd',
455
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
456
+ }
457
+ let res = await this.$resetpost(
458
+ `rs/sql/apply_singleTable`,
459
+ {data: data},
460
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
461
+ )
462
+
463
+ return res.data.map(item => {
464
+ return {
465
+ label: item.f_pcd,
466
+ value: item.f_pcd
467
+ }
468
+ })
469
+ },
470
+ // 缴费前置
471
+ chargeBefore () {
472
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
473
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
474
+ throw null
475
+ }
476
+ },
477
+ // 施工前置
478
+ async constructionBefore () {
479
+ let http = new HttpResetClass()
480
+ let data = {
481
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
482
+ }
483
+ let res = await http.load(
484
+ 'POST',
485
+ 'rs/sql/countApplyUserinfo',
486
+ {data: data},
487
+ {
488
+ resolveMsg: null,
489
+ rejectMsg: '安装明细查询失败!!!'
490
+ })
491
+ if (res.data[0].num > 0) {
492
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
493
+ throw `还有${res.data[0].num}户未安装,无法提交`
494
+ }
495
+ },
496
+ changePipeBuild () {
497
+ if (this.selectdata.f_process_dep === '工程部') {
498
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
499
+ }
500
+ if (this.selectdata.f_process_dep === '运营部') {
501
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
502
+ }
503
+ },
504
+ async getDevInfo () {
505
+ let data = {
506
+ tablename: 't_dev_info',
507
+ condition: `f_orgid = '${this.$login.f.orgid}'`
508
+ }
509
+ let res = await this.$resetpost(
510
+ `rs/sql/apply_singleTable`,
511
+ {data: data},
512
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
513
+ )
514
+
515
+ return res.data.map(item => {
516
+ return {
517
+ label: item.f_dev_name,
518
+ value: item.f_dev_name
519
+ }
520
+ })
521
+ },
522
+ async getPrice (f_price_id) {
523
+ /* console.log('=======================')
524
+ console.log(f_price_id)
525
+
526
+ let data = {
527
+ condition: `sp.f_orgid = '${this.$login.f.orgid}'`
528
+ }
529
+
530
+ if (!isEmpty(f_price_id)) {
531
+ data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
532
+ }
533
+ let http = new HttpResetClass()
534
+ let res = await http.load(
535
+ 'POST',
536
+ `rs/sql/applyGetPrice`,
537
+ {data: data},
538
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
539
+ )
540
+
541
+ return res.data.map(item => {
542
+ return {
543
+ label: item.f_price_name,
544
+ value: item
545
+ }
546
+ })*/
547
+ },
548
+ materialSupervisory () {
549
+ if (this.selectdata.userid === this.$login.f.id) {
550
+ return true
551
+ }
552
+ return false
553
+ },
554
+ async getDesignerPeople () {
555
+ let data = {
556
+ source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
557
+ userid: this.$login.f.id
558
+ }
559
+
560
+ let http = new HttpResetClass()
561
+ let res = await http.load(
562
+ 'POST',
563
+ `rs/search`,
564
+ {data: data},
565
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
566
+ )
567
+
568
+ return res.data.map(item => {
569
+ return {
570
+ label: item.name,
571
+ value: item.id
572
+ }
573
+ })
574
+ },
575
+ // 获取区县
576
+ async getArea () {
577
+ let data = {
578
+ tablename: 't_area',
579
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
580
+ }
581
+ let http = new HttpResetClass()
582
+ let res = await http.load(
583
+ 'POST',
584
+ `rs/sql/apply_singleTable`,
585
+ {data: data},
586
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
587
+ )
588
+
589
+ return res.data.map(item => {
590
+ return {
591
+ label: item.f_residential_area,
592
+ value: item.f_residential_area
593
+ }
594
+ })
595
+ }
596
+ },
597
+ events:{
598
+ 'complyInstallation' (index) {
599
+ },
600
+ // 选择材料
601
+ async materialNameChenge (index, fieldIndex) {
602
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
603
+
604
+ this.show_data.onetomany[index].fields.forEach(item => {
605
+ if (material[item.field]) {
606
+ item.value = material[item.field]
607
+ }
608
+ })
609
+ },
610
+ // 打开模态框获取材料
611
+ async 'getMaterialName' (index) {
612
+ let data = {
613
+ condition: `1=1`
614
+ }
615
+ let http = new HttpResetClass()
616
+ let res = await http.load(
617
+ 'POST',
618
+ `rs/sql/getStockMaterial`,
619
+ {data: data},
620
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
621
+ )
622
+
623
+ this.show_data.onetomany[index].fields.forEach(field => {
624
+ if (field.label === '选择材料') {
625
+ field.options = res.data.map(item => {
626
+ return {
627
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
628
+ 'value': item
629
+ }
630
+ })
631
+ }
632
+ })
633
+ },
634
+ // 终止报建初始化·
635
+ async 'stopApplyReadyEvent' () {
636
+
637
+ let f_is_stop = this.getLableValue('是否终止')
638
+
639
+ for (const item of this.show_data.fields) {
640
+ if (f_is_stop === '是') {
641
+ if (item.label === '终止原因') {
642
+ item.hidden = false
643
+ item.required = true
644
+ }
645
+ } else {
646
+ if (item.label === '终止原因') {
647
+ item.hidden = true
648
+ item.required = false
649
+ }
650
+ }
651
+ }
652
+
653
+ if (isEmpty(this.show_data.f_parent_process_id)) {
654
+ return
655
+ }
656
+ let data = {
657
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
658
+ data: {
659
+ id: this.$login.f.id,
660
+ orgid: this.$login.f.orgid
661
+ }
662
+ }
663
+ let res = await this.$resetpost(
664
+ `rs/sql/supervisory`,
665
+ {data: data},
666
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
667
+ )
668
+ this.show_data.parentApply = res.data[0]
669
+ },
670
+ // 通气点火初始化
671
+ async 'gasReadyEvent' () {
672
+ /*if (!isEmpty(this.show_data.f_price_id)) {
673
+ let priceList = await this.getPrice(this.show_data.f_price_id)
674
+ this.setLabelValue('气价名称', priceList[0].value)
675
+ }*/
676
+
677
+
678
+ // 保险初始化显示内容
679
+ let f_is_insure = this.getLableValue('是否购买保险')
680
+ for (const item of this.show_data.fields) {
681
+ if (f_is_insure === '是') {
682
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
683
+ item.hidden = false
684
+ item.required = true
685
+ }
686
+ if (item.label === '保险备注') {
687
+ item.hidden = false
688
+ }
689
+ } else {
690
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
691
+ item.hidden = true
692
+ item.required = false
693
+ }
694
+ if (item.label === '保险备注') {
695
+ item.hidden = true
696
+ }
697
+ }
698
+ }
699
+ },
700
+ // 申请节点初始化
701
+ 'applyReadyEvent' () {
702
+ this.$getConfig(this, 'UserAddress')
703
+
704
+ let f_address_type = this.show_data.f_address_type
705
+
706
+ for (const item of this.show_data.fields) {
707
+ if (f_address_type === '民用市区') {
708
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
709
+ item.hidden = false
710
+ item.required = true
711
+ }
712
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
713
+ item.hidden = false
714
+ item.required = false
715
+ }
716
+ if (item.label === '地址') {
717
+ item.readonly = true
718
+ }
719
+ }
720
+ if (f_address_type === '民用乡镇') {
721
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
722
+ item.hidden = false
723
+ item.required = true
724
+ }
725
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
726
+ item.hidden = false
727
+ item.required = false
728
+ }
729
+ if (item.label === '楼层') {
730
+ item.hidden = true
731
+ item.required = false
732
+ }
733
+ if (item.label === '地址') {
734
+ item.readonly = true
735
+ }
736
+ }
737
+ if (f_address_type === '特殊地址') {
738
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
739
+ item.hidden = false
740
+ item.required = true
741
+ }
742
+ if (item.label === '集收单位') {
743
+ item.hidden = false
744
+ item.required = false
745
+ }
746
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
747
+ item.hidden = true
748
+ item.required = false
749
+ }
750
+ if (item.label === '地址') {
751
+ item.readonly = false
752
+ }
753
+ }
754
+
755
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
756
+ item.hidden = true
757
+ }
758
+ }
759
+ },
760
+ // 失去焦点出触发事件
761
+ 'onchange' (index) {
762
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
763
+ if (
764
+ this.show_data.fields[index].label === '区/县' ||
765
+ this.show_data.fields[index].label === '街道/乡镇' ||
766
+ this.show_data.fields[index].label === '集收单位' ||
767
+ this.show_data.fields[index].label === '楼号/组' ||
768
+ this.show_data.fields[index].label === '单元/排' ||
769
+ this.show_data.fields[index].label === '楼层' ||
770
+ this.show_data.fields[index].label === '门牌号'
771
+ ) {
772
+
773
+ let f_pcd = this.getLableValue('区/县') || ''
774
+ let f_street = this.getLableValue('街道/乡镇') || ''
775
+ let f_residential_area = this.getLableValue('集收单位') || ''
776
+ let f_building = this.getLableValue('楼号/组') || ''
777
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
778
+ let f_unit = this.getLableValue('单元/排') || ''
779
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
780
+ let f_floor = this.getLableValue('楼层') || ''
781
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
782
+ let f_room = this.getLableValue('门牌号') || ''
783
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
784
+
785
+ 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
786
+ this.setLabelValue("地址", f_address)
787
+ }
788
+ }
789
+ },
790
+ // =============================
791
+ selectSearch (val, index) {},
792
+ 'onblur' (index) {},
793
+ 'oninput' (index) {},
794
+ 'initializtionView' () {},
795
+ async 'onchangeModal' (index, fieldIndex) {
796
+ },
797
+ async 'onblurModal' (index, fieldIndex) {
798
+
799
+ },
800
+ async 'oninputModal' (index, fieldIndex) {
801
+
802
+ },
803
+ async 'onetomanydelete' (index, rowIndex) {
804
+
805
+ let http = new HttpResetClass()
806
+
807
+ let res = await http.load(
808
+ 'DELETE',
809
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
810
+ null,
811
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
812
+ )
813
+
814
+ res = await this.$resetpost(
815
+ 'rs/entity/t_apply',
816
+ this.show_data
817
+ )
818
+
819
+ this.$dispatch('breakControl', this.show_data)
820
+ },
821
+ async 'onetomanyupdate' (index, rowIndex) {
822
+ let data = this.show_data.onetomany[index].rows[rowIndex]
823
+
824
+ this.show_data.onetomany[index].fields.forEach(item => {
825
+ data[item.field] = item.value
826
+ })
827
+ let res = await this.$resetpost(
828
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
829
+ data
830
+ )
831
+
832
+ res = await this.$resetpost(
833
+ 'rs/entity/t_apply',
834
+ this.show_data
835
+ )
836
+
837
+ this.$dispatch('breakControl', this.show_data)
838
+ },
839
+ async 'onetomanyadd' (index) {
840
+ let data = {
841
+ f_process_id : this.show_data.f_process_id,
842
+ f_operator_id: this.$login.f.id,
843
+ f_operator: this.$login.f.name,
844
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
845
+ f_orgid: this.$login.f.orgid,
846
+ f_orgname: this.$login.f.orgs
847
+ }
848
+ this.show_data.onetomany[index].fields.forEach(item => {
849
+ data[item.field] = item.value
850
+ })
851
+ let res = await this.$resetpost(
852
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
853
+ data
854
+ )
855
+
856
+ res = await this.$resetpost(
857
+ 'rs/entity/t_apply',
858
+ this.show_data
859
+ )
860
+
861
+ this.$dispatch('breakControl', this.show_data)
862
+ },
863
+ async 'importEvent' (index, table, configName, filepath) {
864
+ let data = {
865
+ selectdata: this.show_data,
866
+ table: table,
867
+ filepath: filepath,
868
+ configName: configName,
869
+ user: this.$login.f
870
+ }
871
+
872
+ let res = await this.$resetpost(
873
+ `rs/logic/importEvent`,
874
+ data
875
+ )
876
+
877
+ this.$dispatch('breakControl', this.show_data)
878
+ },
879
+ 'onbutchange' (index) {
880
+
881
+ },
882
+ 'onbutblur' (index) {
883
+
884
+ },
885
+ 'onbutinput' (index) {
886
+
887
+ }
888
+ },
889
+ watch: {
890
+ deep: true
891
+ }
892
+ }
893
+ </script>
894
+ <style scoped>
895
+ /*清除model中的浮动*/
896
+ .clearfix:after,.clearfix:before{
897
+ display: table;
898
+ }
899
+ .clearfix:after{
900
+ clear: both;
901
+ }
902
+ </style>