apply-clients 3.5.4-77 → 3.5.4-78

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