apply-clients 3.5.4-97 → 3.5.4-98

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