apply-clients 3.5.6-21 → 3.5.6-23

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