apply-clients 3.4.98-2 → 3.4.98-21

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