apply-clients 3.5.4-68 → 3.5.4-69

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