apply-clients 3.4.72 → 3.4.74

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