apply-clients 3.4.93 → 3.4.95

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