apply-clients 3.4.94 → 3.4.96

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,1734 @@
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_charge_money
553
+ if (Number(f_due_money) > Number(cumulative)) {
554
+ this.$showAlert(`当前${defname}环节,应缴金额为:${f_due_money},费用未结清`, 'warning', 3000)
555
+ throw null
556
+ }
557
+ }
558
+ let res1 = await http.load(
559
+ 'POST',
560
+ `rs/sql/getfeeconfirmation`,
561
+ {data: data},
562
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
563
+ )
564
+ for (let i =0;i<res1.data.length;i++){
565
+ if (isEmpty(res1.data[i].f_confirm_person) || isEmpty(res1.data[i].f_auditor_person)){
566
+ this.$showAlert(`当前${defname}环节,费用未收费确认和审核,请仔细检查并点击保存`, 'warning', 3000)
567
+ throw null
568
+ }
569
+ }
570
+ if (defname=='合同签订'){
571
+ let num = 0
572
+ let data = {
573
+ condition: `f_process_id = '${this.selectdata.f_process_id}'`
574
+ }
575
+ let res1 = await new HttpResetClass().load('POST', 'rs/sql/getContractCharge', {data: data}
576
+ , {resolveMsg: null, rejectMsg: null})
577
+ if (res1.data.length > 0){
578
+ for (let i= 0; i<res1.data.length;i++){
579
+ num += parseInt(res1.data[i].f_payment_ratio)
580
+ }
581
+ }
582
+ if (num!=100){
583
+ this.$showAlert(`当前${defname}环节,缴费比例必须设置为100%!!`, 'warning', 3000)
584
+ throw null
585
+ }
586
+ }
587
+ },
588
+ //阳春博能
589
+ //收费确认环节,如果有未确认的收费, 不能进行下一步
590
+ async confirmCharges() {
591
+ var processId = this.show_data.f_process_id
592
+ let data = {
593
+ condition: `f_process_id = '${processId}'`
594
+ }
595
+ let http = new HttpResetClass()
596
+ let res = await http.load(
597
+ 'POST',
598
+ `rs/sql/confirmCharges`,
599
+ {data: data},
600
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
601
+ )
602
+ if (res.data.length !== 0) {
603
+ var total = res.data[0].total //总收费记录
604
+ var confirmtotal = res.data[0].confirmtotal //确认收费记录
605
+ var num = Number(total) - Number(confirmtotal)
606
+ if (Number(total) > Number(confirmtotal)) {
607
+ this.$showAlert(`有${num}条收费记录未确认收款,请确认`, 'warning', 3000)
608
+ throw null
609
+ }
610
+ }
611
+ },
612
+ // 施工前置 加表具后状态是待开通 提交后是正常 所以这里的判断条件需改正 (and uf.f_meter_classify is null and f_meternumber is null)
613
+ async constructionBefore () {
614
+ let http = new HttpResetClass()
615
+ let data = {
616
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_meter_classify is null and f_meternumber is null`
617
+ }
618
+ let res = await http.load(
619
+ 'POST',
620
+ 'rs/sql/countApplyUserinfo',
621
+ {data: data},
622
+ {
623
+ resolveMsg: null,
624
+ rejectMsg: '安装明细查询失败!!!'
625
+ })
626
+ if (res.data[0].num > 0) {
627
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
628
+ throw `还有${res.data[0].num}户未安装,无法提交`
629
+ }
630
+ },
631
+ changePipeBuild () {
632
+ if (this.selectdata.f_process_dep === '工程部') {
633
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
634
+ }
635
+ if (this.selectdata.f_process_dep === '运营部') {
636
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
637
+ }
638
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
639
+ },
640
+ // async getDevInfo () {
641
+ // let data = {
642
+ // tablename: 't_dev_info',
643
+ // condition: `f_orgid = '${this.$login.f.orgid}'`
644
+ // }
645
+ // let http = new HttpResetClass()
646
+ // let res = await http.load(
647
+ // 'POST',
648
+ // `rs/sql/apply_singleTable`,
649
+ // {data: data},
650
+ // {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
651
+ // )
652
+ //
653
+ // return res.data.map(item => {
654
+ // return {
655
+ // label: item.f_dev_name,
656
+ // value: item.f_dev_name
657
+ // }
658
+ // })
659
+ // },
660
+ async getPrice (f_price_id) {
661
+ console.log('=======================')
662
+ console.log(f_price_id)
663
+
664
+ let data = {
665
+ condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
666
+ }
667
+ // if(this.Pricetype==='机表'){
668
+ // data.condition=`sp.f_custom = '机表'`
669
+ // }
670
+ // if(this.Pricetype==='非机表'){
671
+ // data.condition=`sp.f_custom = '非机表'`
672
+ // }
673
+
674
+ if (!isEmpty(f_price_id)) {
675
+ data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
676
+ }
677
+ let http = new HttpResetClass()
678
+ let res = await http.load(
679
+ 'POST',
680
+ `rs/sql/applyGetPrice`,
681
+ {data: data},
682
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
683
+ )
684
+
685
+ let a= res.data.map(item => {
686
+ return {
687
+ label: item.f_price_name,
688
+ value: item
689
+ }
690
+ })
691
+ this.selectdata.fields.forEach(field => {
692
+ if (field.label === '气价名称') {
693
+ field.options = a}
694
+ })
695
+ return a
696
+ },
697
+ addressInitialization () {
698
+ this.$getConfig(this, 'UserAddress')
699
+
700
+ let f_address_type = this.show_data.f_address_type
701
+
702
+ for (const item of this.show_data.fields) {
703
+ if (f_address_type === '民用市区') {
704
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
705
+ item.hidden = false
706
+ item.required = true
707
+ }
708
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
709
+ item.hidden = false
710
+ item.required = false
711
+ }
712
+ if (item.label === '地址') {
713
+ item.readonly = true
714
+ }
715
+ }
716
+ if (f_address_type === '民用乡镇') {
717
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
718
+ item.hidden = false
719
+ item.required = true
720
+ }
721
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
722
+ item.hidden = false
723
+ item.required = false
724
+ }
725
+ if (item.label === '楼层') {
726
+ item.hidden = true
727
+ item.required = false
728
+ }
729
+ if (item.label === '地址') {
730
+ item.readonly = true
731
+ }
732
+ }
733
+ if (f_address_type === '特殊地址') {
734
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
735
+ item.hidden = false
736
+ item.required = true
737
+ }
738
+ if (item.label === '集收单位') {
739
+ item.hidden = false
740
+ if (this.show_data.f_apply_type === '工商户报建'){
741
+ item.required = false
742
+ } else {
743
+ item.required = false
744
+ }
745
+
746
+ }
747
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
748
+ item.hidden = true
749
+ item.required = false
750
+ }
751
+ if (item.label === '地址') {
752
+ item.readonly = false
753
+ }
754
+ }
755
+
756
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
757
+ item.hidden = true
758
+ }
759
+ }
760
+ },
761
+ async streetChange () {
762
+ if (isEmpty(this.show_data.f_street)) {
763
+ return
764
+ }
765
+
766
+ let data = {
767
+ tablename: 't_area',
768
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
769
+ }
770
+ let http = new HttpResetClass()
771
+ let res = await http.load(
772
+ 'POST',
773
+ `rs/sql/apply_singleTable`,
774
+ {data: data},
775
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
776
+ )
777
+
778
+ this.setLabelOptions('集收单位', res.data.map(item => {
779
+ return {
780
+ label: item.f_residential_area,
781
+ value: item.f_residential_area
782
+ }
783
+ }))
784
+ },
785
+ async pcdChange () {
786
+ if (isEmpty(this.show_data.f_pcd)) {
787
+ return
788
+ }
789
+
790
+ let data = {
791
+ tablename: 't_street',
792
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
793
+ }
794
+ let f_address_type = this.getLableValue('地址类型')
795
+
796
+ if (f_address_type === '民用市区') {
797
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
798
+ }
799
+ if (f_address_type === '民用乡镇') {
800
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
801
+ }
802
+
803
+ let http = new HttpResetClass()
804
+ let res = await http.load(
805
+ 'POST',
806
+ `rs/sql/apply_singleTable`,
807
+ {data: data},
808
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
809
+ )
810
+
811
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
812
+ return {
813
+ label: item.f_street,
814
+ value: item.f_street
815
+ }
816
+ }))
817
+ },
818
+ async addressTips () {
819
+ // console.log('======================='+this.show_data.f_apply_type)
820
+ let res = ''
821
+ if (this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') {
822
+ res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
823
+ }else{
824
+ res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
825
+ }
826
+ if (res == 'confirm') {
827
+ return
828
+ }
829
+ throw '用户信息确认!!!'
830
+ },
831
+ // 获取当前分公司下拥有role角色的人员
832
+ async getDesignerPeople (role) {
833
+ let data = {
834
+ source: 'this.getParentByType($organization$).getChildByName($'+role+"$).getChildren()",
835
+ userid: this.$login.f.id
836
+ }
837
+
838
+ let http = new HttpResetClass()
839
+ let res = await http.load(
840
+ 'POST',
841
+ `rs/search`,
842
+ {data: data},
843
+ {resolveMsg: null, rejectMsg: '人员查询失败!!!'}
844
+ )
845
+
846
+ return res.data.map(item => {
847
+ return {
848
+ label: item.name,
849
+ value: item.name
850
+ }
851
+ })
852
+ },
853
+ async surveyStopApply () {
854
+ console.log('终止报建!!!!!')
855
+
856
+ this.show_data.f_stop_reason = '现场勘察不符合报装条件'
857
+
858
+ let data = {
859
+ data: this.show_data,
860
+ user: this.$login.f
861
+ }
862
+
863
+ let res = await this.$resetpost(
864
+ `rs/logic/surveyStopApply`,
865
+ {data: data},
866
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
867
+ )
868
+
869
+ this.$dispatch('loadPage')
870
+
871
+ throw '终止报建!!!'
872
+ },
873
+ async contract_number() {
874
+ console.log("进入编号合同编号生成",this.$login.f.orgs)
875
+ let f_contract_number = ''
876
+ const nowDate = new Date();
877
+ const date = {
878
+ year: nowDate.getFullYear(),
879
+ month: nowDate.getMonth() + 1,
880
+ day: nowDate.getDate()
881
+ }
882
+
883
+ function upperCaseChars(dir) {
884
+ let string = '';
885
+ switch (dir){
886
+ case '周口市天然气有限公司':
887
+ string = 'ZK' // 当表达式的结果等于 房产 时,则执行该代码
888
+ break;
889
+ case '项城市天然气有限公司':
890
+ string = "XC" // 当表达式的结果等于 自建房 时,则执行该代码
891
+ break;
892
+ case '西华县天然气有限公司':
893
+ string = 'XH' // 当表达式的结果等于 商业 时,则执行该代码
894
+ break;
895
+ case '鹿邑县天然气有限公司':
896
+ string = 'LY' // 当表达式的结果等于 工业 时,则执行该代码
897
+ break;
898
+ case '郸城县天然气有限公司':
899
+ string = 'DC' // 当表达式的结果等于 中压 时,则执行该代码
900
+ break;
901
+ case '测试公司(一)':
902
+ string = 'CS' // 当表达式的结果等于 中压 时,则执行该代码
903
+ break;
904
+ case '甘泉县丰源天然气有限责任公司':
905
+ string = 'GQ' // 当表达式的结果等于 中压 时,则执行该代码
906
+ break;
907
+ default : 'HT'
908
+ break; // 如果没有与表达式相同的公司,则执行该代码
909
+ }
910
+ return string;
911
+ }
912
+
913
+ const dir = upperCaseChars(this.$login.f.orgs) //分公司
914
+
915
+ let type = 0 //类型
916
+
917
+ switch (this.show_data.f_entry_type){
918
+ case '城区/县城':
919
+ type = 1 // 当表达式的结果等于 城区 时,则执行该代码
920
+ break;
921
+ case '新农村':
922
+ type = 2 // 当表达式的结果等于 新农村 时,则执行该代码
923
+ break;
924
+ case '测试':
925
+ type = 3 // 当表达式的结果等于 新农村 时,则执行该代码
926
+ break;
927
+ default :
928
+ break; // 如果没有与表达式相同的值,则执行该代码
929
+ }
930
+
931
+ let nature = 0 // 性质
932
+ switch (this.show_data.f_apply_nature){
933
+ case '楼房':
934
+ nature = 1 // 当表达式的结果等于 楼房 时,则执行该代码
935
+ break;
936
+ case '房产':
937
+ nature = 1 // 当表达式的结果等于 房产 时,则执行该代码
938
+ break;
939
+ case '自建房':
940
+ nature = 2 // 当表达式的结果等于 自建房 时,则执行该代码
941
+ break;
942
+ case '商业':
943
+ nature = 3 // 当表达式的结果等于 商业 时,则执行该代码
944
+ break;
945
+ case '学校':
946
+ nature = 3 // 当表达式的结果等于 学校 时,则执行该代码
947
+ break;
948
+ case '福利机构':
949
+ nature = 3 // 当表达式的结果等于 福利机构 时,则执行该代码
950
+ break;
951
+ case '其他':
952
+ nature = 3 // 当表达式的结果等于 其他 时,则执行该代码
953
+ break;
954
+ case '工业':
955
+ nature = 4 // 当表达式的结果等于 工业 时,则执行该代码
956
+ break;
957
+ case '中压':
958
+ nature = 5 // 当表达式的结果等于 中压 时,则执行该代码
959
+ break;
960
+ case '测试':
961
+ nature = 6 // 当表达式的结果等于 中压 时,则执行该代码
962
+ break;
963
+ default :
964
+ break; // 如果没有与表达式相同的值,则执行该代码
965
+ }
966
+
967
+ const newMonth = date.month >= 10 ? date.month : '0' + date.month //月份
968
+ const dataYm = date.year + '-01-01'
969
+ const newYear = date.year + 1
970
+ const year = date.year.toString().substring(2,4) //年份
971
+
972
+ let data = {
973
+ orgid: this.$login.f.orgid
974
+ }
975
+
976
+ let http = new HttpResetClass()
977
+ let res = await http.load('POST', 'rs/sql/contractCount', {data:data}, {
978
+ resolveMsg: null,
979
+ rejectMsg: null
980
+ })
981
+ let oldDate
982
+ for (const item of res.data) {
983
+ if (item.name === '合同编号最后更新日期'){
984
+ oldDate = item.value
985
+ }
986
+ }
987
+ for (const item of res.data){
988
+ if (item.name === '合同编号'){
989
+ if (item.value === 0 || Date.parse(oldDate) < Date.parse(dataYm)) {
990
+ f_contract_number = dir + type + nature + year + newMonth + '001'
991
+ console.log("触发if", f_contract_number)
992
+ } else {
993
+ let count = item.value
994
+ f_contract_number = dir + type + nature + year + newMonth + this.PrefixInteger(count, 3)
995
+ console.log("触发else", f_contract_number)
996
+ }
997
+ }
998
+ }
999
+ this.selectdata.f_contract_number = f_contract_number
1000
+ this.show_data.f_contract_number = f_contract_number
1001
+ return f_contract_number
1002
+ },
1003
+ PrefixInteger(num, n) {
1004
+ return (Array(n).join(0) + num).slice(-n);
1005
+ },
1006
+ // 单价失去焦点
1007
+ async priceSum () {
1008
+ if (isEmpty(this.show_data.f_price)) {
1009
+ return
1010
+ }
1011
+ let data = {
1012
+ operator: '*',
1013
+ num1: this.show_data.f_price,
1014
+ num2: this.show_data.f_install_count
1015
+ }
1016
+ let http = new HttpResetClass()
1017
+ let res = await http.load(
1018
+ 'POST',
1019
+ `rs/logic/compute`,
1020
+ {data: data},
1021
+ {resolveMsg: null, rejectMsg: '工程材料费计算失败!!!'}
1022
+ )
1023
+
1024
+ this.setLabelValue('工程材料费', res.data)
1025
+ },
1026
+ },
1027
+ events: {
1028
+ 'priceType'(index){
1029
+ this.Pricetype = this.getLableValue('所属类型')
1030
+ console.log('打印方法值',this.getPrice(this.show_data.f_price_id))
1031
+ for (const item of this.show_data.fields) {
1032
+ if (this.show_data.f_sprice_type !=null && this.show_data.f_sprice_type !='') {
1033
+ if(item.label==='气价名称'){
1034
+ this.getPrice().then(value =>{
1035
+ item.options=value
1036
+ })
1037
+ console.log('最终',item.options)
1038
+ }
1039
+ }
1040
+ }
1041
+ },
1042
+ 'complyInstallation' (index) {
1043
+ if (this.show_data.f_is_have === '') {
1044
+ this.hideButtons('提交', '出图', '缴费')
1045
+ this.showButtons('终止')
1046
+ }
1047
+ if (this.show_data.f_is_have === '是') {
1048
+ this.hideButtons('终止')
1049
+ this.showButtons('提交', '出图', '缴费')
1050
+ }
1051
+ },
1052
+ async 'igniteDispatchReadyEvent' () {
1053
+ let data = {
1054
+ tablename: 'activityins',
1055
+ condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
1056
+ }
1057
+ let http = new HttpResetClass()
1058
+ let res = await http.load(
1059
+ 'POST',
1060
+ `rs/sql/apply_singleTable`,
1061
+ {data: data},
1062
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
1063
+ )
1064
+ if (res.data.length <= 0) {
1065
+ console.log('+++++++++++++++++++++++++++++')
1066
+ console.log('没有施工,不能退回')
1067
+ this.hideButtons('退回')
1068
+ }
1069
+ },
1070
+ 'buildReadyEvent' () {
1071
+ this.setLabelValue('施工单位', this.$login.f.name)
1072
+ this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
1073
+ },
1074
+ // 选择材料
1075
+ async materialNameChenge (index, fieldIndex) {
1076
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
1077
+
1078
+ this.show_data.onetomany[index].fields.forEach(item => {
1079
+ if (material[item.field]) {
1080
+ item.value = material[item.field]
1081
+ }
1082
+ })
1083
+ },
1084
+ // 打开模态框获取材料
1085
+ async 'getMaterialName' (index) {
1086
+ let data = {
1087
+ condition: `1=1`
1088
+ }
1089
+ let http = new HttpResetClass()
1090
+ let res = await http.load(
1091
+ 'POST',
1092
+ `rs/sql/getStockMaterial`,
1093
+ {data: data},
1094
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
1095
+ )
1096
+
1097
+ this.show_data.onetomany[index].fields.forEach(field => {
1098
+ if (field.label === '选择材料') {
1099
+ field.options = res.data.map(item => {
1100
+ return {
1101
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
1102
+ 'value': item
1103
+ }
1104
+ })
1105
+ }
1106
+ })
1107
+ },
1108
+ // 搜索小区
1109
+ async 'searchArea' (area, index) {
1110
+ let data = {
1111
+ tablename: 't_area',
1112
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1113
+ }
1114
+ let http = new HttpResetClass()
1115
+ let res = await http.load(
1116
+ 'POST',
1117
+ `rs/sql/apply_singleTable`,
1118
+ {data: data},
1119
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1120
+ )
1121
+
1122
+ if (res.data.length === 0) {
1123
+ return
1124
+ }
1125
+
1126
+ this.setLabelOptions('集收单位', res.data.map(item => {
1127
+ return {
1128
+ label: item.f_residential_area,
1129
+ value: item.f_residential_area
1130
+ }
1131
+ }))
1132
+ },
1133
+ // 搜索小区
1134
+ async 'searchAreaCollective' (area, index) {
1135
+ let data = {
1136
+ tablename: 't_area',
1137
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${area}%'`
1138
+ }
1139
+ let http = new HttpResetClass()
1140
+ let res = await http.load(
1141
+ 'POST',
1142
+ `rs/sql/apply_singleTable`,
1143
+ {data: data},
1144
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1145
+ )
1146
+
1147
+ if (res.data.length === 0) {
1148
+ return
1149
+ }
1150
+
1151
+ this.setLabelOptions('集收单位', res.data.map(item => {
1152
+ return {
1153
+ label: item.f_residential_area,
1154
+ value: item.f_residential_area
1155
+ }
1156
+ }))
1157
+ },
1158
+ // 选择气价
1159
+ 'priceChange' (index) {
1160
+ if (isEmpty(this.show_data.stairPrice)) {
1161
+ return
1162
+ }
1163
+
1164
+ let stairPrice = this.getLableValue('气价名称')
1165
+
1166
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
1167
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
1168
+ this.setLabelValue('价格', stairPrice.f_price)
1169
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
1170
+ this.show_data.f_price_id = stairPrice.id
1171
+ this.show_data.f_price_name = stairPrice.f_price_name
1172
+ },
1173
+ // 选择开发商
1174
+ // async 'devInfoChange' (index) {
1175
+ // if (isEmpty(this.show_data.f_company_name)) {
1176
+ // return
1177
+ // }
1178
+ // let data = {
1179
+ // tablename: 't_dev_info',
1180
+ // condition: `f_orgid = '${this.$login.f.orgid}' and f_dev_name = '${this.show_data.f_company_name}'`
1181
+ // }
1182
+ // let res = await this.$resetpost(
1183
+ // `rs/sql/apply_singleTable`,
1184
+ // {data: data},
1185
+ // {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
1186
+ // )
1187
+ // this.show_data.f_dev_id = res.data[0].id
1188
+ // this.show_data.f_dev_code = res.data[0].f_dev_code
1189
+ // this.setLabelValue('法人名称', res.data[0].f_legal_person)
1190
+ // this.setLabelValue('身份证', res.data[0].f_idnumber)
1191
+ // this.setLabelValue('营业执照', res.data[0].f_license_num)
1192
+ // },
1193
+ // 退款金额
1194
+ 'refundMoneyChange' (index) {
1195
+ let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
1196
+ let f_refund_money = this.show_data.fields[index].value
1197
+
1198
+ if (f_refund_money > f_cumulative_payment_money) {
1199
+ this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
1200
+ this.show_data.fields[index].value = null
1201
+ }
1202
+ },
1203
+ // 检查重复
1204
+ 'checkRepeat' (index) {
1205
+ this.checkDuplicate(index)
1206
+ },
1207
+ // 选择报建项目
1208
+ 'selectApply' (row) {
1209
+ this.setLabelValue('工程名称', row.f_entry_name)
1210
+ this.setLabelValue('工程编号', row.f_apply_num)
1211
+ this.setLabelValue('报建类型', row.f_apply_type)
1212
+ this.setLabelValue('用户名称', row.f_user_name)
1213
+ this.setLabelValue('用户电话', row.f_phone)
1214
+ this.setLabelValue('证件类型', row.f_credentials)
1215
+ this.setLabelValue('证件号码', row.f_idnumber)
1216
+ this.setLabelValue('地址', row.f_address)
1217
+ this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
1218
+
1219
+ this.show_data.parentApply = JSON.parse(JSON.stringify(row))
1220
+
1221
+ delete row.id
1222
+ delete row.actid
1223
+ delete row.defid
1224
+ delete row.defname
1225
+ delete row.version
1226
+ delete row.f_apply_num
1227
+ delete row.f_sub_state
1228
+ delete row.f_apply_type
1229
+ delete row.f_process_id
1230
+
1231
+ this.show_data = Object.assign({}, this.show_data, row)
1232
+
1233
+ this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
1234
+ },
1235
+ // 是否终止
1236
+ 'isStopChange' (index) {
1237
+ let f_is_stop = this.show_data.f_is_stop
1238
+
1239
+ for (const item of this.show_data.fields) {
1240
+ if (f_is_stop === '是') {
1241
+ if (item.label === '终止原因') {
1242
+ item.hidden = false
1243
+ item.required = true
1244
+ }
1245
+ } else {
1246
+ if (item.label === '终止原因') {
1247
+ item.hidden = true
1248
+ item.required = false
1249
+ }
1250
+ }
1251
+ }
1252
+ },
1253
+ // 终止报建初始化
1254
+ async 'stopApplyReadyEvent' () {
1255
+
1256
+ let f_is_stop = this.getLableValue('是否终止')
1257
+
1258
+ for (const item of this.show_data.fields) {
1259
+ if (f_is_stop === '是') {
1260
+ if (item.label === '终止原因') {
1261
+ item.hidden = false
1262
+ item.required = true
1263
+ }
1264
+ } else {
1265
+ if (item.label === '终止原因') {
1266
+ item.hidden = true
1267
+ item.required = false
1268
+ }
1269
+ }
1270
+ }
1271
+
1272
+ if (isEmpty(this.show_data.f_parent_process_id)) {
1273
+ return
1274
+ }
1275
+ let data = {
1276
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
1277
+ data: {
1278
+ id: this.$login.f.id,
1279
+ orgid: this.$login.f.orgid
1280
+ }
1281
+ }
1282
+ let res = await this.$resetpost(
1283
+ `rs/sql/supervisory`,
1284
+ {data: data},
1285
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
1286
+ )
1287
+ this.show_data.parentApply = res.data[0]
1288
+ },
1289
+ // 选择用户档案信息
1290
+ 'selectUserinfo' (row) {
1291
+ this.setLabelValue('用户编号', row.f_userinfo_code)
1292
+ this.setLabelValue('用户名称', row.f_user_name)
1293
+ this.setLabelValue('用户电话', row.f_user_phone)
1294
+ this.setLabelValue('用户电话1', row.f_rent_phone)
1295
+ this.setLabelValue('用户电话2', row.f_rent_phone1)
1296
+ this.setLabelValue('证件类型', row.f_credentials)
1297
+ this.setLabelValue('证件号码', row.f_idnumber)
1298
+ this.setLabelValue('地址', row.f_address)
1299
+
1300
+ this.show_data.f_userinfo_id = row.f_userinfo_id
1301
+ this.show_data.f_userinfo_code = row.f_userinfo_code
1302
+ },
1303
+ // 是否购买保险
1304
+ async 'isInsureChange' (index) {
1305
+ if (!this.show_data.f_is_insure) {
1306
+ return
1307
+ }
1308
+ let f_is_insure = this.show_data.f_is_insure
1309
+ for (const item of this.show_data.fields) {
1310
+ if (f_is_insure === '是') {
1311
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1312
+ item.hidden = false
1313
+ item.required = true
1314
+ }
1315
+ if (item.label === '保险备注') {
1316
+ item.hidden = false
1317
+ }
1318
+ } else {
1319
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1320
+ item.hidden = true
1321
+ item.required = false
1322
+ }
1323
+ }
1324
+ }
1325
+ },
1326
+ // 通气点火初始化
1327
+ async 'gasReadyEvent' () {
1328
+ // 是否有气价信息
1329
+ if (!isEmpty(this.show_data.f_price_id)) {
1330
+ let priceList = await this.getPrice(this.show_data.f_price_id)
1331
+ this.setLabelValue('气价名称', priceList[0].value)
1332
+ }
1333
+
1334
+ let data = {
1335
+ tablename: 't_userfees',
1336
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
1337
+ }
1338
+ let http = new HttpResetClass()
1339
+ let res = await http.load(
1340
+ 'POST',
1341
+ `rs/sql/apply_singleTable`,
1342
+ {data: data},
1343
+ {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
1344
+ )
1345
+ if (res.data.length > 0) {
1346
+ this.setLabelValue('待执行保险', '是')
1347
+ for (const item of this.show_data.fields) {
1348
+ if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1349
+ item.hidden = true
1350
+ item.required = false
1351
+ item.value = null
1352
+ }
1353
+ }
1354
+ } else {
1355
+ this.setLabelValue('待执行保险', '否')
1356
+ for (const item of this.show_data.fields) {
1357
+ if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1358
+ item.hidden = false
1359
+ item.required = true
1360
+ }
1361
+ }
1362
+ }
1363
+
1364
+ // 保险初始化显示内容
1365
+ let f_is_insure = this.getLableValue('是否购买保险')
1366
+ for (const item of this.show_data.fields) {
1367
+ if (f_is_insure === '') {
1368
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1369
+ item.hidden = false
1370
+ item.required = true
1371
+ }
1372
+ if (item.label === '保险备注') {
1373
+ item.hidden = false
1374
+ }
1375
+ // 本期保费到期时间默认一年
1376
+ if (isEmpty(this.selectdata.f_ins_expiration_date)) {
1377
+ let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
1378
+ this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
1379
+ }
1380
+ }
1381
+ if (f_is_insure === '') {
1382
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1383
+ item.hidden = true
1384
+ item.required = false
1385
+ }
1386
+ }
1387
+ }
1388
+ },
1389
+ // 合同金额失去焦点
1390
+ async 'contractMoneyChange' (index) {
1391
+ let yingjiao = parseFloat(
1392
+ parseFloat(this.show_data.f_contract_money || 0 ).toFixed(2) +
1393
+ parseFloat(this.getLableValue('追加金额') || 0 ).toFixed(2)
1394
+
1395
+ ).toFixed(2)
1396
+ let leiji = parseFloat(this.getLableValue('累计缴费金额') || 0 ).toFixed(2)
1397
+ let weijie = parseFloat(yingjiao - leiji ).toFixed(2)
1398
+ let fkbl = parseFloat(leiji/yingjiao).toFixed(2) * 100 + "%"
1399
+ this.setLabelValue('应交金额', yingjiao)
1400
+ this.setLabelValue('累计缴费金额', leiji)
1401
+ this.setLabelValue('未结总金额', weijie)
1402
+ this.setLabelValue('付款比列', fkbl)
1403
+ },
1404
+ // 街道失去焦点
1405
+ async 'streetChange' (index) {
1406
+ if (isEmpty(this.show_data.f_street)) {
1407
+ return
1408
+ }
1409
+
1410
+ this.setLabelValue('集收单位', null)
1411
+
1412
+ let data = {
1413
+ tablename: 't_area',
1414
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1415
+ }
1416
+ let http = new HttpResetClass()
1417
+ let res = await http.load(
1418
+ 'POST',
1419
+ `rs/sql/apply_singleTable`,
1420
+ {data: data},
1421
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1422
+ )
1423
+
1424
+ this.setLabelOptions('集收单位', res.data.map(item => {
1425
+ return {
1426
+ label: item.f_residential_area,
1427
+ value: item.f_residential_area
1428
+ }
1429
+ }))
1430
+ },
1431
+ // 区县失去焦点
1432
+ async 'pcdChange' (index) {
1433
+ if (isEmpty(this.show_data.f_pcd)) {
1434
+ return
1435
+ }
1436
+
1437
+ this.setLabelValue('街道/乡镇', null)
1438
+ this.setLabelValue('集收单位', null)
1439
+
1440
+
1441
+
1442
+ let data = {
1443
+ tablename: 't_street',
1444
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1445
+ }
1446
+ let f_address_type = this.getLableValue('地址类型')
1447
+
1448
+ if (f_address_type === '民用市区') {
1449
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1450
+ }
1451
+ if (f_address_type === '民用乡镇') {
1452
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1453
+ }
1454
+
1455
+ let http = new HttpResetClass()
1456
+ let res = await http.load(
1457
+ 'POST',
1458
+ `rs/sql/apply_singleTable`,
1459
+ {data: data},
1460
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1461
+ )
1462
+
1463
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
1464
+ return {
1465
+ label: item.f_street,
1466
+ value: item.f_street
1467
+ }
1468
+ }))
1469
+ },
1470
+ // 地址类型失去焦点
1471
+ 'addressTypeChange' (index) {
1472
+ this.setLabelValue('街道/乡镇', null)
1473
+ this.setLabelValue('集收单位', null)
1474
+ let f_address_type = this.show_data.fields[index].value
1475
+ for (const item of this.show_data.fields) {
1476
+ if (f_address_type === '民用市区') {
1477
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1478
+ item.hidden = false
1479
+ item.required = true
1480
+ item.value = null
1481
+ }
1482
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1483
+ item.hidden = false
1484
+ item.required = false
1485
+ item.value = null
1486
+ }
1487
+ if (item.label === '地址') {
1488
+ item.readonly = true
1489
+ item.value = null
1490
+ }
1491
+ }
1492
+ if (f_address_type === '民用乡镇') {
1493
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1494
+ item.hidden = false
1495
+ item.required = true
1496
+ item.value = null
1497
+ }
1498
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1499
+ item.hidden = false
1500
+ item.required = false
1501
+ item.value = null
1502
+ }
1503
+ if (item.label === '楼层') {
1504
+ item.hidden = true
1505
+ item.required = false
1506
+ item.value = null
1507
+ }
1508
+ if (item.label === '地址') {
1509
+ item.readonly = true
1510
+ item.value = null
1511
+ }
1512
+ }
1513
+ if (f_address_type === '特殊地址') {
1514
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
1515
+ item.hidden = false
1516
+ item.required = true
1517
+ item.value = null
1518
+ }
1519
+ if (item.label === '集收单位') {
1520
+ item.hidden = false
1521
+ item.required = false
1522
+ item.value = null
1523
+ }
1524
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1525
+ item.hidden = true
1526
+ item.required = false
1527
+ item.value = null
1528
+ }
1529
+ if (item.label === '地址') {
1530
+ item.readonly = false
1531
+ item.value = null
1532
+ }
1533
+ }
1534
+ }
1535
+ },
1536
+ // 团购转散户初始化
1537
+ 'apply2ReadyEvent' () {
1538
+ if (this.show_data.f_apply_source === '线下发起') {
1539
+ this.addressInitialization()
1540
+ this.hideLabels('用户编号')
1541
+ this.electiveLabels('用户编号')
1542
+ this.showLabels('片区', '地址类型')
1543
+ this.requiredLabels('片区', '地址类型')
1544
+ }
1545
+ if (this.show_data.f_apply_source === '自动发起') {
1546
+ this.hideLabels('片区', '地址类型')
1547
+ this.electiveLabels('片区', '地址类型',)
1548
+ }
1549
+ },
1550
+ // 申请节点初始化
1551
+ 'applyReadyEvent' () {
1552
+ this.addressInitialization()
1553
+ this.pcdChange()
1554
+ this.streetChange()
1555
+ },
1556
+ // ===========================================
1557
+ async 'button'() {
1558
+ if (this.show_data.button.before) {
1559
+ await this[this.show_data.button.before]()
1560
+ }
1561
+ // 点击重置按钮就重置数据
1562
+ if (this.show_data.button.button_name === '重置') {
1563
+ this.$dispatch('breakControl', this.selectdata)
1564
+ return
1565
+ }
1566
+
1567
+ this.show_data.user = this.$login.f
1568
+ this.show_data.start_activity = this.$workflow_vue.start_activity
1569
+ this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1570
+
1571
+
1572
+ 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%"){
1573
+ this.show_data.button.button_name = '跳过'
1574
+ }
1575
+
1576
+ let res = await this.$resetpost(
1577
+ `rs/logic/ApplyProductService`,
1578
+ {data: this.show_data},
1579
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1580
+ )
1581
+
1582
+
1583
+ if (this.show_data.button.after) {
1584
+ this[this.show_data.button.after]()
1585
+ }
1586
+ this.$dispatch('loadPage')
1587
+ },
1588
+ // 失去焦点出触发事件
1589
+ 'onchange' (index) {
1590
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1591
+
1592
+ if (
1593
+ this.show_data.fields[index].label === '区/县' ||
1594
+ this.show_data.fields[index].label === '街道/乡镇' ||
1595
+ this.show_data.fields[index].label === '集收单位' ||
1596
+ this.show_data.fields[index].label === '楼号/组' ||
1597
+ this.show_data.fields[index].label === '单元/排' ||
1598
+ this.show_data.fields[index].label === '楼层' ||
1599
+ this.show_data.fields[index].label === '门牌号'
1600
+ ) {
1601
+
1602
+ let f_pcd = this.getLableValue('区/县') || ''
1603
+ let f_street = this.getLableValue('街道/乡镇') || ''
1604
+ let f_residential_area = this.getLableValue('集收单位') || ''
1605
+ let f_building = this.getLableValue('楼号/组') || ''
1606
+ // let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1607
+ let f_building_suffix = f_building ? '号楼' : ''
1608
+ let f_unit = this.getLableValue('单元/排') || ''
1609
+ // let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1610
+ let f_unit_suffix = f_unit ? '单元' : ''
1611
+ let f_floor = this.getLableValue('楼层') || ''
1612
+ // let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1613
+ let f_floor_suffix = f_floor ? '层' : ''
1614
+ let f_room = this.getLableValue('门牌号') || ''
1615
+ // let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1616
+ let f_room_suffix = f_room ? '' : ''
1617
+
1618
+ 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
1619
+ this.setLabelValue("地址", f_address)
1620
+ }
1621
+ }
1622
+ },
1623
+ selectSearch (val, index) {},
1624
+ 'onblur' (index) {},
1625
+ 'oninput' (index) {},
1626
+ 'initializtionView' () {},
1627
+ async 'onchangeModal' (index, fieldIndex) {
1628
+ },
1629
+ async 'onblurModal' (index, fieldIndex) {
1630
+
1631
+ },
1632
+ async 'oninputModal' (index, fieldIndex) {
1633
+
1634
+ },
1635
+ async 'onetomanydelete' (index, rowIndex) {
1636
+
1637
+ let http = new HttpResetClass()
1638
+
1639
+ let res = await http.load(
1640
+ 'DELETE',
1641
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1642
+ null,
1643
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1644
+ )
1645
+
1646
+ res = await this.$resetpost(
1647
+ 'rs/entity/t_apply',
1648
+ this.show_data
1649
+ )
1650
+
1651
+ this.$dispatch('breakControl', this.show_data)
1652
+ },
1653
+ async 'onetomanyupdate' (index, rowIndex) {
1654
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1655
+
1656
+ this.show_data.onetomany[index].fields.forEach(item => {
1657
+ data[item.field] = item.value
1658
+ })
1659
+ let res = await this.$resetpost(
1660
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1661
+ data
1662
+ )
1663
+
1664
+ res = await this.$resetpost(
1665
+ 'rs/entity/t_apply',
1666
+ this.show_data
1667
+ )
1668
+
1669
+ this.$dispatch('breakControl', this.show_data)
1670
+ },
1671
+ async 'onetomanyadd' (index) {
1672
+ let data = {
1673
+ f_process_id : this.show_data.f_process_id,
1674
+ f_operator_id: this.$login.f.id,
1675
+ f_operator: this.$login.f.name,
1676
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1677
+ f_orgid: this.$login.f.orgid,
1678
+ f_orgname: this.$login.f.orgs
1679
+ }
1680
+ this.show_data.onetomany[index].fields.forEach(item => {
1681
+ data[item.field] = item.value
1682
+ })
1683
+ let res = await this.$resetpost(
1684
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1685
+ data
1686
+ )
1687
+
1688
+ res = await this.$resetpost(
1689
+ 'rs/entity/t_apply',
1690
+ this.show_data
1691
+ )
1692
+
1693
+ this.$dispatch('breakControl', this.show_data)
1694
+ },
1695
+ async 'importEvent' (index, table, configName, filepath) {
1696
+ let data = {
1697
+ selectdata: this.show_data,
1698
+ table: table,
1699
+ filepath: filepath,
1700
+ configName: configName,
1701
+ user: this.$login.f
1702
+ }
1703
+
1704
+ let res = await this.$resetpost(
1705
+ `rs/logic/importEvent`,
1706
+ data
1707
+ )
1708
+
1709
+ this.$dispatch('breakControl', this.show_data)
1710
+ },
1711
+ 'onbutchange' (index) {
1712
+
1713
+ },
1714
+ 'onbutblur' (index) {
1715
+
1716
+ },
1717
+ 'onbutinput' (index) {
1718
+
1719
+
1720
+ }
1721
+ },
1722
+ watch: {
1723
+ }
1724
+ }
1725
+ </script>
1726
+ <style scoped>
1727
+ /*清除model中的浮动*/
1728
+ .clearfix:after,.clearfix:before{
1729
+ display: table;
1730
+ }
1731
+ .clearfix:after{
1732
+ clear: both;
1733
+ }
1734
+ </style>