apply-clients 3.5.1 → 3.5.2

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