apply-clients 3.5.4-97 → 3.5.4-98

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