apply-clients 3.5.5-73 → 3.5.5-74

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