apply-clients 3.5.5-45 → 3.5.5-46

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 (38) hide show
  1. package/build/dev-server.js +7 -6
  2. package/package.json +1 -1
  3. package/src/App.vue +2 -2
  4. package/src/components/android/AppCheckTakePic.vue +168 -168
  5. package/src/components/android/Process/AppServiceControl.vue +1755 -1755
  6. package/src/components/product/PcZhihuanManagement.vue +160 -160
  7. package/src/components/product/Print/BuildOrder/buildOrderList.vue +339 -339
  8. package/src/components/product/Process/Processes/selectApply.vue +251 -251
  9. package/src/components/product/Process/Processes/selectBcakApply.vue +250 -250
  10. package/src/filiale/fugou/android/AppAddMaterialScience.vue +444 -444
  11. package/src/filiale/fugou/android/AppAddReplacement.vue +341 -341
  12. package/src/filiale/fugou/android/AppChargeManagement.vue +739 -739
  13. package/src/filiale/fugou/android/AppDevicesManagement.vue +521 -521
  14. package/src/filiale/fugou/android/AppExplorationUser.vue +508 -508
  15. package/src/filiale/fugou/android/AppInstallationDetails.vue +542 -542
  16. package/src/filiale/fugou/android/AppServiceControl.vue +1840 -1840
  17. package/src/filiale/fugou/pc/AddReplacement.vue +340 -340
  18. package/src/filiale/fugou/pc/ApplyChargeList.vue +484 -484
  19. package/src/filiale/fugou/pc/ExplorationSelect.vue +524 -524
  20. package/src/filiale/fugou/pc/ServiceControl.vue +1712 -1712
  21. package/src/filiale/fugou/pc/StopApplyList.vue +291 -291
  22. package/src/filiale/fugou/pc/addMaterialScience.vue +481 -481
  23. package/src/filiale/fugou/pc/addressAndUserinfoManagement.vue +216 -216
  24. package/src/filiale/fugou/pc/chargeReport.vue +215 -215
  25. package/src/filiale/fugou/pc/devicesManagement.vue +484 -484
  26. package/src/filiale/fugou/pc.js +18 -18
  27. package/src/filiale/qianneng/android/AppServiceView.vue +795 -795
  28. package/src/filiale/qianneng/pc/ApplyMaterialDetailed.vue +261 -261
  29. package/src/filiale/qianneng/pc/FunctionServiceControl.vue +749 -743
  30. package/src/filiale/qianneng/pc/ServiceControl.vue +1387 -1382
  31. package/src/filiale/yangchunboneng/pc/ApplyChargeList.vue +645 -645
  32. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +598 -598
  33. package/src/filiale/yangchunboneng/pc/SupervisoryList.vue +608 -608
  34. package/src/filiale/yangchunboneng/pc/SupervisoryListNew.vue +687 -687
  35. package/src/main.js +23 -22
  36. package/src/test/SessionTestServlet.java +0 -69
  37. package/webapp/WEB-INF/web.xml +0 -52
  38. package/webapp/session-test.jsp +0 -59
@@ -1,743 +1,749 @@
1
- <template>
2
- <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
3
- </template>
4
- <script>
5
- import {HttpResetClass} from 'vue-client'
6
- import Vue from 'vue'
7
- import {isEmpty} from "../../../components/Util";
8
- export default {
9
- title: '报建功能业务控制层',
10
- props: ['selectdata'],
11
- data () {
12
- return {
13
- show_data: null, // 给通用页面显示的数据
14
- showview: false, // 控制通用页面
15
- config: {}
16
- }
17
- },
18
- ready () {
19
- this.show_data = this.selectdata
20
- this.refurbish()
21
- },
22
- methods: {
23
- // 获取区县
24
- // 地址类型发生改变,获取对应的街道/乡镇
25
- async pcdChange () {
26
- if (isEmpty(this.show_data.f_pcd)) {
27
- return
28
- }
29
-
30
- let data = {
31
- tablename: 't_street',
32
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
33
- }
34
-
35
- let http = new HttpResetClass()
36
- let res = await http.load(
37
- 'POST',
38
- `rs/sql/apply_singleTable`,
39
- {data: data},
40
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
41
- )
42
-
43
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
44
- return {
45
- label: item.f_street,
46
- value: item.f_street
47
- }
48
- }))
49
- },
50
- async getPcd () {
51
- let data = {
52
- tablename: 't_pcd',
53
- condition: `f_filialeid = '${this.$login.f.orgid}'`
54
- }
55
- let http = new HttpResetClass()
56
- let res = await http.load(
57
- 'POST',
58
- `rs/sql/apply_singleTable`,
59
- {data: data},
60
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
61
- )
62
-
63
- return res.data.map(item => {
64
- return {
65
- label: item.f_pcd,
66
- value: item.f_pcd
67
- }
68
- })
69
- },
70
- async streetChange () {
71
- if (isEmpty(this.selectdata.f_street)) {
72
- return
73
- }
74
-
75
- let data = {
76
- tablename: 't_area',
77
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.selectdata.f_street}'`
78
- }
79
- let http = new HttpResetClass()
80
- let res = await http.load(
81
- 'POST',
82
- `rs/sql/apply_singleTable`,
83
- {data: data},
84
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
85
- )
86
-
87
- this.setLabelOptions('小区', res.data.map(item => {
88
- return {
89
- label: item.f_residential_area,
90
- value: item.f_residential_area
91
- }
92
- }))
93
- },
94
- async searchbuilding () {
95
- if (isEmpty(this.show_data.f_residential_area)) {
96
- return
97
- }
98
- let data = {
99
- tablename: 't_building',
100
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${this.show_data.f_residential_area}%'`
101
- }
102
- let http = new HttpResetClass()
103
- let res = await http.load(
104
- 'POST',
105
- `rs/sql/apply_singleTable`,
106
- {data: data},
107
- {resolveMsg: null, rejectMsg: '楼号查询失败!!!'}
108
- )
109
-
110
- if (res.data.length === 0) {
111
- return
112
- }
113
-
114
- this.setLabelOptions('楼号/组', res.data.map(item => {
115
- return {
116
- label: item.f_building,
117
- value: item.f_building
118
- }
119
- }))
120
- },
121
-
122
- //将千分位金额转换为数字
123
- parseCurrency(str) {
124
- // 用正则表达式移除千分位分隔符,并转换为数字
125
- return parseFloat(str.replace(/,/g, ''));
126
- },
127
- //将金额转换为千分位
128
- formatCurrency(number, decimalPlaces) {
129
- var num = parseFloat(number);
130
- if (!isNaN(num)) {
131
- num = num.toFixed(decimalPlaces || 0); // 将金额保留指定位数,四舍五入
132
- num = num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 按照千分位进行分隔
133
- return num;
134
- } else {
135
- return ''; // 如果输入框中的值不是数字,则返回空字符串
136
- }
137
- },
138
- async refurbish () {
139
- // fields 字段填充值
140
- for (const item of this.selectdata.fields) {
141
- if(item.label==='用气设备' && (this.selectdata.f_apply_type == '非居用户报建') ){
142
- item.type= 'textarea'
143
- item.rows= 2
144
- }
145
- if(
146
- (
147
- item.label==='区/县'||item.label==='街道/乡镇'||item.label==='小区'||item.label==='楼号/组' ||
148
- item.label==='单元/排'||item.label==='楼层'||item.label==='门牌号'||item.label==='地址杂项' || item.label==='地址'
149
- ) && (this.selectdata.f_apply_type == '其他报建') ){
150
- item.readonly= true
151
- item.disabled= true
152
- }
153
- if (!item.value) {
154
- item.value = null
155
- }
156
-
157
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
158
- if (item.eval) {
159
- item.value = eval(item.default)
160
- } else {
161
- item.value = item.default
162
- }
163
- }
164
-
165
- if (this.selectdata[item.field]) {
166
- // 将json字符串格式化赋值给value
167
- if (String(this.selectdata[item.field]).startsWith("{")) {
168
- item.value = JSON.parse(this.selectdata[item.field])
169
- } else {
170
- item.value = this.selectdata[item.field]
171
- }
172
- }
173
- if (this.selectdata[item.field] === 0) {
174
- item.value = 0
175
- }
176
-
177
- // datepicker
178
- if (item.type === 'datepicker' && !item.value && item.default) {
179
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
180
- }
181
-
182
- // 如果配置类型为select,优先从参数列表获取options
183
- if (item.type === 'select' || item.type === 'checkbox') {
184
- if (item.param) {
185
- let temp = this.$appdata.getParam(item.label)
186
-
187
- if (temp && temp.length > 0) {
188
- item.options = temp
189
- }
190
-
191
- if (item.paramLabel) {
192
- temp = this.$appdata.getParam(item.paramLabel)
193
- if (temp && temp.length > 0) {
194
- item.options = temp
195
- }
196
- }
197
- }
198
-
199
- if (item.ready) {
200
- item.options = await this[item.ready]()
201
- }
202
- }
203
-
204
-
205
- if (item.type === 'checkbox') {
206
- if (this.selectdata[item.field]) {
207
- item.value = JSON.parse(this.selectdata[item.field])
208
- } else {
209
- item.value = []
210
- }
211
- }
212
- //金额千分位
213
- if (item.percentiles) {
214
- let amount = item.value
215
- if (amount > 0) {
216
- let amounts = this.formatCurrency(amount, 2)
217
- console.log('金额千分位', amounts)
218
- item.value = amounts
219
- console.log('金额千分位1', item.value)
220
- }
221
- this.selectdata[item.field] = item.value
222
- }
223
- }
224
-
225
- // 控制组件
226
- if (this.selectdata.components) {
227
- this.selectdata.components.forEach(item => {
228
- item.mark = 2
229
- })
230
- }
231
-
232
- // 初始化onetomany
233
- if (this.selectdata.onetomany) {
234
- for (const item of this.selectdata.onetomany) {
235
- let res = null
236
- if (item.queryEvent) {
237
- res = this[item.queryEvent]()
238
- } else {
239
- let data = {
240
- tablename: item.tables[0],
241
- condition: `f_process_id='${this.selectdata.f_process_id}'`
242
- }
243
- res = await this.$resetpost(
244
- 'rs/sql/apply_singleTable',
245
- {data: data},
246
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
247
- )
248
- }
249
-
250
- item.rows = res.data
251
-
252
- // 初始化onetomany中的fields
253
- for (const field of item.fields) {
254
- if (!field.value) {
255
- if (field.value !== 0) {
256
- field.value = null
257
- }
258
- }
259
-
260
- if (field.default || field.default === 0) {
261
- field.value = field.default
262
- }
263
-
264
- // datepicker
265
- if (field.type === 'datepicker' && !field.value && field.default) {
266
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
267
- }
268
-
269
- if (field.type === 'select') {
270
- let temp = this.$appdata.getParam(field.label)
271
-
272
- if (temp && temp.length > 0) {
273
- field.options = temp
274
- }
275
-
276
- if (field.paramLabel) {
277
- temp = this.$appdata.getParam(field.paramLabel)
278
- if (temp && temp.length > 0) {
279
- item.options = temp
280
- }
281
- }
282
- }
283
- }
284
- }
285
- }
286
-
287
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
288
- let temp = JSON.parse(JSON.stringify(this.selectdata))
289
- this.show_data = temp
290
- for (const item of this.show_data.fields) {
291
- if(item.label==='气价名称'){
292
- item.value=this.show_data.f_price_name
293
- }
294
- if (this.show_data.f_apply_source === '线下发起' && (item.label === '预约地址' || item.label === '预约单号')) {
295
- item.hidden = true
296
- }
297
- }
298
- if (this.show_data.f_apply_type == '居民团体用户报建' ){
299
- if (this.show_data.f_apply_nature == '整体小区'){
300
- this.showLabels('楼房总户数')
301
- this.showLabels('楼房总栋数')
302
- this.showLabels('别墅总户数')
303
- this.hideLabels('总户数')
304
- }
305
- if (this.show_data.f_apply_nature == '整体村庄'){
306
- this.showLabels('总户数')
307
- this.hideLabels('楼房总户数')
308
- this.hideLabels('楼房总栋数')
309
- this.hideLabels('别墅总户数')
310
- }
311
- }
312
- this.$nextTick(() => {
313
- this.showview = true
314
- })
315
- },
316
- getLableValue(label) {
317
- for (const item of this.show_data.fields) {
318
- if (item.label === label && item.type !== 'number') {
319
- return item.value || ''
320
- }
321
- if (item.label === label && item.type === 'number') {
322
- return item.value || 0
323
- }
324
- }
325
- },
326
- getLableOptions(label) {
327
- for (const item of this.show_data.fields) {
328
- if (item.label === label) {
329
- return item.options
330
- }
331
- }
332
- },
333
- setLabelValue(label, value) {
334
- for (const item of this.show_data.fields) {
335
- if (item.label === label) {
336
- item.value = value
337
- this.show_data[item.field] = value
338
- }
339
- }
340
- },
341
- setLabelOptions(label, options) {
342
- for (const item of this.show_data.fields) {
343
- if (item.label === label) {
344
- item.options = options
345
- }
346
- }
347
- },
348
- showLabels(...labels) {
349
- for (const item of this.show_data.fields) {
350
- if (labels.includes(item.label)) {
351
- item.hidden = false
352
- }
353
- }
354
- },
355
- hideLabels(...labels) {
356
- for (const item of this.show_data.fields) {
357
- if (labels.includes(item.label)) {
358
- item.hidden = true
359
- }
360
- }
361
- },
362
- requiredLabels(...labels) {
363
- for (const item of this.show_data.fields) {
364
- if (labels.includes(item.label)) {
365
- item.required = true
366
- }
367
- }
368
- },
369
- electiveLabels(...labels) {
370
- for (const item of this.show_data.fields) {
371
- if (labels.includes(item.label)) {
372
- item.required = false
373
- }
374
- }
375
- },
376
- readonlyLabels(...labels) {
377
- for (const item of this.show_data.fields) {
378
- if (labels.includes(item.label)) {
379
- item.readonly = true
380
- item.disabled = true
381
- }
382
- }
383
- },
384
- readwriteLabels(...labels) {
385
- for (const item of this.show_data.fields) {
386
- if (labels.includes(item.label)) {
387
- item.readonly = false
388
- item.disabled = false
389
- }
390
- }
391
- },
392
- async getPrice (f_price_id) {
393
- console.log('=======================')
394
- console.log(f_price_id)
395
-
396
- let data = {
397
- condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
398
- }
399
- // if(this.Pricetype==='机表'){
400
- // data.condition=`sp.f_custom = '机表'`
401
- // }
402
- // if(this.Pricetype==='非机表'){
403
- // data.condition=`sp.f_custom = '非机表'`
404
- // }
405
-
406
- if (!isEmpty(f_price_id)) {
407
- data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
408
- }
409
- let http = new HttpResetClass()
410
- let res = await http.load(
411
- 'POST',
412
- `rs/sql/applyGetPrice`,
413
- {data: data},
414
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
415
- )
416
-
417
- let a= res.data.map(item => {
418
- return {
419
- label: item.f_price_name,
420
- value: item
421
- }
422
- })
423
- this.selectdata.fields.forEach(field => {
424
- if (field.label === '气价名称') {
425
- field.options = a}
426
- })
427
- return a
428
- },
429
- },
430
- events: {
431
- // 街道失去焦点
432
- async 'streetChange' (index) {
433
- if (isEmpty(this.show_data.f_street)) {
434
- return
435
- }
436
-
437
- this.setLabelValue('小区', null)
438
-
439
- let data = {
440
- tablename: 't_area',
441
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
442
- }
443
- let http = new HttpResetClass()
444
- let res = await http.load(
445
- 'POST',
446
- `rs/sql/apply_singleTable`,
447
- {data: data},
448
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
449
- )
450
-
451
- this.setLabelOptions('小区', res.data.map(item => {
452
- return {
453
- label: item.f_residential_area,
454
- value: item.f_residential_area
455
- }
456
- }))
457
- },
458
- // 区县失去焦点
459
- async 'pcdChange' (index) {
460
- if (isEmpty(this.show_data.f_pcd)) {
461
- return
462
- }
463
-
464
- this.setLabelValue('街道/乡镇', null)
465
- this.setLabelValue('小区', null)
466
-
467
-
468
-
469
- let data = {
470
- tablename: 't_street',
471
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
472
- }
473
- let f_address_type = this.getLableValue('地址类型')
474
-
475
- if (f_address_type === '民用市区') {
476
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
477
- }
478
- if (f_address_type === '民用乡镇') {
479
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
480
- }
481
-
482
- let http = new HttpResetClass()
483
- let res = await http.load(
484
- 'POST',
485
- `rs/sql/apply_singleTable`,
486
- {data: data},
487
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
488
- )
489
-
490
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
491
- return {
492
- label: item.f_street,
493
- value: item.f_street
494
- }
495
- }))
496
- },
497
- // 选择气价
498
- 'priceChange' (index) {
499
- if (isEmpty(this.show_data.stairPrice)) {
500
- return
501
- }
502
-
503
- let stairPrice = this.getLableValue('气价名称')
504
-
505
- this.setLabelValue('气价类型', stairPrice.f_price_type)
506
- this.setLabelValue('用气性质', stairPrice.f_gasproperties)
507
- this.setLabelValue('价格', stairPrice.f_price)
508
- this.setLabelValue('客户类型', stairPrice.f_user_type)
509
- this.show_data.f_price_id = stairPrice.id
510
- this.show_data.f_price_name = stairPrice.f_price_name
511
- },
512
- // 信息修改初始化
513
- 'modifyInfoReadyEvent' () {
514
- this.$getConfig(this, 'UserAddress')
515
- this.pcdChange()
516
- this.streetChange()
517
- this.searchbuilding()
518
- },
519
- // 信息修改
520
- async 'modifyInfo' () {
521
- let data = this.show_data
522
- data.username= this.$login.f.name
523
- let res = await this.$resetpost(
524
- `rs/logic/modifyUserInfo`,
525
- data,
526
- {resolveMsg: null, rejectMsg: '用户信息修改失败!!!'}
527
- )
528
- if(res.data===200){
529
- this.$showMessage('信息修改成功!!!')
530
- }else{
531
- this.$showMessage('信息修改失败!!!')
532
-
533
- }
534
- this.$dispatch('loadPage')
535
- },
536
- async 'stopApply' () {
537
- let data1 = {
538
- tablename: 't_charge_record',
539
- condition: `f_process_id = '${this.show_data.f_process_id}' and f_charge_status = '有效'`
540
- }
541
- let http = new HttpResetClass()
542
- await http.load(
543
- 'POST',
544
- `rs/sql/apply_singleTable`,
545
- {data: data1},
546
- {resolveMsg: null, rejectMsg: '收费查询失败!!!'}
547
- ).then(res=>{
548
- if (res.data.length > 0){
549
- this.$showMessage('该单子有收费有效的记录,请先冲正!!!')
550
- }else {
551
- let data = {
552
- data: this.show_data,
553
- user: this.$login.f
554
- }
555
- let res = this.$resetpost(
556
- `rs/logic/stopApply`,
557
- {data: data},
558
- {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
559
- )
560
- this.$dispatch('loadPage')
561
- }
562
- })
563
- },
564
- // 搜索楼号
565
- async 'searchbuilding' (index) {
566
- this.setLabelValue('楼号/组', null)
567
- this.selectdata.f_residential_area = this.getLableValue('小区')
568
- let data = {
569
- tablename: 't_building',
570
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${this.selectdata.f_residential_area}%'`
571
- }
572
- let http = new HttpResetClass()
573
- let res = await http.load(
574
- 'POST',
575
- `rs/sql/apply_singleTable`,
576
- {data: data},
577
- {resolveMsg: null, rejectMsg: '楼号查询失败!!!'}
578
- )
579
-
580
- if (res.data.length === 0) {
581
- return
582
- }
583
-
584
- this.setLabelOptions('楼号/组', res.data.map(item => {
585
- return {
586
- label: item.f_building,
587
- value: item.f_building
588
- }
589
- }))
590
- },
591
- async 'pauseApply' () {
592
-
593
- let data = {
594
- data: this.show_data,
595
- user: this.$login.f
596
- }
597
-
598
- let res = await this.$resetpost(
599
- `rs/logic/pauseApply`,
600
- {data: data},
601
- {resolveMsg: null, rejectMsg: '暂停报建失败!!!'}
602
- )
603
-
604
- this.$dispatch('loadPage')
605
- },
606
- // 获取view层button事件
607
- async 'button' (){
608
-
609
- let res = await this.$resetpost(
610
- `rs/entity/t_apply`,
611
- this.show_data,
612
- {resolveMsg: null, rejectMsg: '数据保存失败!!!'}
613
- )
614
-
615
- this.$dispatch('loadPage')
616
- },
617
- // 失去焦点出触发事件
618
- 'onchange' (index) {
619
- if (this.show_data.title === '信息修改') {
620
- if (
621
- this.show_data.fields[index].label === '区/县' ||
622
- this.show_data.fields[index].label === '街道/乡镇' ||
623
- this.show_data.fields[index].label === '小区' ||
624
- this.show_data.fields[index].label === '楼号/组' ||
625
- this.show_data.fields[index].label === '单元/排' ||
626
- this.show_data.fields[index].label === '楼层' ||
627
- this.show_data.fields[index].label === '门牌号'||
628
- this.show_data.fields[index].label === '地址杂项'
629
- ) {
630
-
631
- let f_pcd = this.getLableValue('区/县') || ''
632
- let f_street = this.getLableValue('街道/乡镇') || ''
633
- let f_residential_area = this.getLableValue('小区') || ''
634
- let f_building = this.getLableValue('楼号/组') || ''
635
- let f_building_suffix = f_building ? this.config.f_building_suffix : ''
636
- let f_unit = this.getLableValue('单元/排') || ''
637
- let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
638
- let f_floor = this.getLableValue('楼层') || ''
639
- let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
640
- let f_room = this.getLableValue('门牌号') || ''
641
- let f_room_suffix = this.getLableValue('地址杂项') || ''
642
-
643
- let f_address = f_pcd + f_street + f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
644
- this.setLabelValue("地址", f_address)
645
- }
646
- }
647
- if (this.show_data.fields[index].label == '派工数') {
648
- if (parseInt(this.show_data.f_installed_households) > parseInt(this.show_data.f_apply_count) ){
649
- this.$showMessage('派工数不能大于总户数!!!')
650
- this.show_data.fields[index].value = ''
651
- }
652
- }
653
- },
654
- 'onblur' (index) {},
655
- 'oninput' (index) {
656
- let http = new HttpResetClass()
657
- if (this.show_data.fields[index].label == '入户证号'){
658
- let data = {
659
- tablename: `t_apply`,
660
- condition: `f_entry_number='${this.show_data.fields[index].value}' and f_sub_state in ('正在进行','完工')`
661
- }
662
- http.load('post','rs/sql/apply_singleTable',{data: data},
663
- {resolveMsg: null, rejectMsg: '查询失败'}).then(row=>{
664
- if (row.data.length > 0){
665
- this.$showMessage('请注意入户证号重复!!!')
666
- }
667
- })
668
- }
669
- },
670
- 'initializtionView' () {},
671
- async 'onchangeModal' (index, fieldIndex) {
672
- },
673
- async 'onblurModal' (index, fieldIndex) {
674
-
675
- },
676
- async 'oninputModal' (index, fieldIndex) {
677
-
678
- },
679
- async 'onetomanydelete' (index, rowIndex) {
680
-
681
- let http = new HttpResetClass()
682
-
683
- let res = await http.load(
684
- 'DELETE',
685
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
686
- null,
687
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
688
- )
689
-
690
- res = await this.$resetpost(
691
- 'rs/entity/t_apply',
692
- this.show_data
693
- )
694
-
695
- this.$dispatch('breakControl', this.show_data)
696
- },
697
- async 'onetomanyupdate' (index, rowIndex) {
698
- let data = this.show_data.onetomany[index].rows[rowIndex]
699
-
700
- this.show_data.onetomany[index].fields.forEach(item => {
701
- data[item.field] = item.value
702
- })
703
- let res = await this.$resetpost(
704
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
705
- data
706
- )
707
-
708
- res = await this.$resetpost(
709
- 'rs/entity/t_apply',
710
- this.show_data
711
- )
712
-
713
- this.$dispatch('breakControl', this.show_data)
714
- },
715
- async 'onetomanyadd' (index) {
716
- let data = {
717
- f_process_id : this.show_data.f_process_id,
718
- f_operator_id: this.$login.f.id,
719
- f_operator: this.$login.f.name,
720
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
721
- f_orgid: this.$login.f.orgid,
722
- f_orgname: this.$login.f.orgs
723
- }
724
- this.show_data.onetomany[index].fields.forEach(item => {
725
- data[item.field] = item.value
726
- })
727
- let res = await this.$resetpost(
728
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
729
- data
730
- )
731
-
732
- res = await this.$resetpost(
733
- 'rs/entity/t_apply',
734
- this.show_data
735
- )
736
-
737
- this.$dispatch('breakControl', this.show_data)
738
- }
739
- },
740
- watch:{
741
- }
742
- }
743
- </script>
1
+ <template>
2
+ <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
3
+ </template>
4
+ <script>
5
+ import {HttpResetClass} from 'vue-client'
6
+ import Vue from 'vue'
7
+ import {isEmpty} from "../../../components/Util";
8
+ export default {
9
+ title: '报建功能业务控制层',
10
+ props: ['selectdata'],
11
+ data () {
12
+ return {
13
+ show_data: null, // 给通用页面显示的数据
14
+ showview: false, // 控制通用页面
15
+ config: {}
16
+ }
17
+ },
18
+ ready () {
19
+ this.show_data = this.selectdata
20
+ this.refurbish()
21
+ },
22
+ methods: {
23
+ // 获取区县
24
+ // 地址类型发生改变,获取对应的街道/乡镇
25
+ async pcdChange () {
26
+ if (isEmpty(this.show_data.f_pcd)) {
27
+ return
28
+ }
29
+
30
+ let data = {
31
+ tablename: 't_street',
32
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
33
+ }
34
+
35
+ let http = new HttpResetClass()
36
+ let res = await http.load(
37
+ 'POST',
38
+ `rs/sql/apply_singleTable`,
39
+ {data: data},
40
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
41
+ )
42
+
43
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
44
+ return {
45
+ label: item.f_street,
46
+ value: item.f_street
47
+ }
48
+ }))
49
+ },
50
+ async getPcd () {
51
+ let data = {
52
+ tablename: 't_pcd',
53
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
54
+ }
55
+ let http = new HttpResetClass()
56
+ let res = await http.load(
57
+ 'POST',
58
+ `rs/sql/apply_singleTable`,
59
+ {data: data},
60
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
61
+ )
62
+
63
+ return res.data.map(item => {
64
+ return {
65
+ label: item.f_pcd,
66
+ value: item.f_pcd
67
+ }
68
+ })
69
+ },
70
+ async streetChange () {
71
+ if (isEmpty(this.selectdata.f_street)) {
72
+ return
73
+ }
74
+
75
+ let data = {
76
+ tablename: 't_area',
77
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.selectdata.f_street}'`
78
+ }
79
+ let http = new HttpResetClass()
80
+ let res = await http.load(
81
+ 'POST',
82
+ `rs/sql/apply_singleTable`,
83
+ {data: data},
84
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
85
+ )
86
+
87
+ this.setLabelOptions('小区', res.data.map(item => {
88
+ return {
89
+ label: item.f_residential_area,
90
+ value: item.f_residential_area
91
+ }
92
+ }))
93
+ },
94
+ async searchbuilding () {
95
+ if (isEmpty(this.show_data.f_residential_area)) {
96
+ return
97
+ }
98
+ let data = {
99
+ tablename: 't_building',
100
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${this.show_data.f_residential_area}%'`
101
+ }
102
+ let http = new HttpResetClass()
103
+ let res = await http.load(
104
+ 'POST',
105
+ `rs/sql/apply_singleTable`,
106
+ {data: data},
107
+ {resolveMsg: null, rejectMsg: '楼号查询失败!!!'}
108
+ )
109
+
110
+ if (res.data.length === 0) {
111
+ return
112
+ }
113
+
114
+ this.setLabelOptions('楼号/组', res.data.map(item => {
115
+ return {
116
+ label: item.f_building,
117
+ value: item.f_building
118
+ }
119
+ }))
120
+ },
121
+
122
+ //将千分位金额转换为数字
123
+ parseCurrency(str) {
124
+ // 用正则表达式移除千分位分隔符,并转换为数字
125
+ return parseFloat(str.replace(/,/g, ''));
126
+ },
127
+ //将金额转换为千分位
128
+ formatCurrency(number, decimalPlaces) {
129
+ var num = parseFloat(number);
130
+ if (!isNaN(num)) {
131
+ num = num.toFixed(decimalPlaces || 0); // 将金额保留指定位数,四舍五入
132
+ num = num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 按照千分位进行分隔
133
+ return num;
134
+ } else {
135
+ return ''; // 如果输入框中的值不是数字,则返回空字符串
136
+ }
137
+ },
138
+ async refurbish () {
139
+ // fields 字段填充值
140
+ for (const item of this.selectdata.fields) {
141
+ if(item.label==='用气设备' && (this.selectdata.f_apply_type == '非居用户报建') ){
142
+ item.type= 'textarea'
143
+ item.rows= 2
144
+ }
145
+ if(
146
+ (
147
+ item.label==='区/县'||item.label==='街道/乡镇'||item.label==='小区'||item.label==='楼号/组' ||
148
+ item.label==='单元/排'||item.label==='楼层'||item.label==='门牌号'||item.label==='地址杂项' || item.label==='地址'
149
+ ) && (this.selectdata.f_apply_type == '其他报建') ){
150
+ item.readonly= true
151
+ item.disabled= true
152
+ }
153
+ if (!item.value) {
154
+ item.value = null
155
+ }
156
+
157
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
158
+ if (item.eval) {
159
+ item.value = eval(item.default)
160
+ } else {
161
+ item.value = item.default
162
+ }
163
+ }
164
+
165
+ if (this.selectdata[item.field]) {
166
+ // 将json字符串格式化赋值给value
167
+ if (String(this.selectdata[item.field]).startsWith("{")) {
168
+ item.value = JSON.parse(this.selectdata[item.field])
169
+ } else {
170
+ item.value = this.selectdata[item.field]
171
+ }
172
+ }
173
+ if (this.selectdata[item.field] === 0) {
174
+ item.value = 0
175
+ }
176
+
177
+ // datepicker
178
+ if (item.type === 'datepicker' && !item.value && item.default) {
179
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
180
+ }
181
+
182
+ // 如果配置类型为select,优先从参数列表获取options
183
+ if (item.type === 'select' || item.type === 'checkbox') {
184
+ if (item.param) {
185
+ let temp = this.$appdata.getParam(item.label)
186
+
187
+ if (temp && temp.length > 0) {
188
+ item.options = temp
189
+ }
190
+
191
+ if (item.paramLabel) {
192
+ temp = this.$appdata.getParam(item.paramLabel)
193
+ if (temp && temp.length > 0) {
194
+ item.options = temp
195
+ }
196
+ }
197
+ }
198
+
199
+ if (item.ready) {
200
+ item.options = await this[item.ready]()
201
+ }
202
+ }
203
+
204
+
205
+ if (item.type === 'checkbox') {
206
+ if (this.selectdata[item.field]) {
207
+ item.value = JSON.parse(this.selectdata[item.field])
208
+ } else {
209
+ item.value = []
210
+ }
211
+ }
212
+ //金额千分位
213
+ if (item.percentiles) {
214
+ let amount = item.value
215
+ if (amount > 0) {
216
+ let amounts = this.formatCurrency(amount, 2)
217
+ console.log('金额千分位', amounts)
218
+ item.value = amounts
219
+ console.log('金额千分位1', item.value)
220
+ }
221
+ this.selectdata[item.field] = item.value
222
+ }
223
+ }
224
+
225
+ // 控制组件
226
+ if (this.selectdata.components) {
227
+ this.selectdata.components.forEach(item => {
228
+ item.mark = 2
229
+ })
230
+ }
231
+
232
+ // 初始化onetomany
233
+ if (this.selectdata.onetomany) {
234
+ for (const item of this.selectdata.onetomany) {
235
+ let res = null
236
+ if (item.queryEvent) {
237
+ res = this[item.queryEvent]()
238
+ } else {
239
+ let data = {
240
+ tablename: item.tables[0],
241
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
242
+ }
243
+ res = await this.$resetpost(
244
+ 'rs/sql/apply_singleTable',
245
+ {data: data},
246
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
247
+ )
248
+ }
249
+
250
+ item.rows = res.data
251
+
252
+ // 初始化onetomany中的fields
253
+ for (const field of item.fields) {
254
+ if (!field.value) {
255
+ if (field.value !== 0) {
256
+ field.value = null
257
+ }
258
+ }
259
+
260
+ if (field.default || field.default === 0) {
261
+ field.value = field.default
262
+ }
263
+
264
+ // datepicker
265
+ if (field.type === 'datepicker' && !field.value && field.default) {
266
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
267
+ }
268
+
269
+ if (field.type === 'select') {
270
+ let temp = this.$appdata.getParam(field.label)
271
+
272
+ if (temp && temp.length > 0) {
273
+ field.options = temp
274
+ }
275
+
276
+ if (field.paramLabel) {
277
+ temp = this.$appdata.getParam(field.paramLabel)
278
+ if (temp && temp.length > 0) {
279
+ item.options = temp
280
+ }
281
+ }
282
+ }
283
+ }
284
+ }
285
+ }
286
+
287
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
288
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
289
+ this.show_data = temp
290
+ for (const item of this.show_data.fields) {
291
+ if(item.label==='气价名称'){
292
+ item.value=this.show_data.f_price_name
293
+ }
294
+ if (this.show_data.f_apply_source === '线下发起' && (item.label === '预约地址' || item.label === '预约单号')) {
295
+ item.hidden = true
296
+ }
297
+ }
298
+ if (this.show_data.f_apply_type == '居民团体用户报建' ){
299
+ if (this.show_data.f_apply_nature == '整体小区'){
300
+ this.showLabels('楼房总户数')
301
+ this.showLabels('楼房总栋数')
302
+ this.showLabels('别墅总户数')
303
+ this.hideLabels('总户数')
304
+ }
305
+ if (this.show_data.f_apply_nature == '整体村庄'){
306
+ this.showLabels('总户数')
307
+ this.hideLabels('楼房总户数')
308
+ this.hideLabels('楼房总栋数')
309
+ this.hideLabels('别墅总户数')
310
+ }
311
+ }
312
+ this.$nextTick(() => {
313
+ this.showview = true
314
+ })
315
+ },
316
+ getLableValue(label) {
317
+ for (const item of this.show_data.fields) {
318
+ if (item.label === label && item.type !== 'number') {
319
+ return item.value || ''
320
+ }
321
+ if (item.label === label && item.type === 'number') {
322
+ return item.value || 0
323
+ }
324
+ }
325
+ },
326
+ getLableOptions(label) {
327
+ for (const item of this.show_data.fields) {
328
+ if (item.label === label) {
329
+ return item.options
330
+ }
331
+ }
332
+ },
333
+ setLabelValue(label, value) {
334
+ for (const item of this.show_data.fields) {
335
+ if (item.label === label) {
336
+ item.value = value
337
+ this.show_data[item.field] = value
338
+ }
339
+ }
340
+ },
341
+ setLabelOptions(label, options) {
342
+ for (const item of this.show_data.fields) {
343
+ if (item.label === label) {
344
+ item.options = options
345
+ }
346
+ }
347
+ },
348
+ showLabels(...labels) {
349
+ for (const item of this.show_data.fields) {
350
+ if (labels.includes(item.label)) {
351
+ item.hidden = false
352
+ }
353
+ }
354
+ },
355
+ hideLabels(...labels) {
356
+ for (const item of this.show_data.fields) {
357
+ if (labels.includes(item.label)) {
358
+ item.hidden = true
359
+ }
360
+ }
361
+ },
362
+ requiredLabels(...labels) {
363
+ for (const item of this.show_data.fields) {
364
+ if (labels.includes(item.label)) {
365
+ item.required = true
366
+ }
367
+ }
368
+ },
369
+ electiveLabels(...labels) {
370
+ for (const item of this.show_data.fields) {
371
+ if (labels.includes(item.label)) {
372
+ item.required = false
373
+ }
374
+ }
375
+ },
376
+ readonlyLabels(...labels) {
377
+ for (const item of this.show_data.fields) {
378
+ if (labels.includes(item.label)) {
379
+ item.readonly = true
380
+ item.disabled = true
381
+ }
382
+ }
383
+ },
384
+ readwriteLabels(...labels) {
385
+ for (const item of this.show_data.fields) {
386
+ if (labels.includes(item.label)) {
387
+ item.readonly = false
388
+ item.disabled = false
389
+ }
390
+ }
391
+ },
392
+ async getPrice (f_price_id) {
393
+ console.log('=======================')
394
+ console.log(f_price_id)
395
+
396
+ let data = {
397
+ condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
398
+ }
399
+ // if(this.Pricetype==='机表'){
400
+ // data.condition=`sp.f_custom = '机表'`
401
+ // }
402
+ // if(this.Pricetype==='非机表'){
403
+ // data.condition=`sp.f_custom = '非机表'`
404
+ // }
405
+
406
+ if (!isEmpty(f_price_id)) {
407
+ data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
408
+ }
409
+ let http = new HttpResetClass()
410
+ let res = await http.load(
411
+ 'POST',
412
+ `rs/sql/applyGetPrice`,
413
+ {data: data},
414
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
415
+ )
416
+
417
+ let a= res.data.map(item => {
418
+ return {
419
+ label: item.f_price_name,
420
+ value: item
421
+ }
422
+ })
423
+ this.selectdata.fields.forEach(field => {
424
+ if (field.label === '气价名称') {
425
+ field.options = a}
426
+ })
427
+ return a
428
+ },
429
+ },
430
+ events: {
431
+ // 街道失去焦点
432
+ async 'streetChange' (index) {
433
+ if (isEmpty(this.show_data.f_street)) {
434
+ return
435
+ }
436
+
437
+ this.setLabelValue('小区', null)
438
+
439
+ let data = {
440
+ tablename: 't_area',
441
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
442
+ }
443
+ let http = new HttpResetClass()
444
+ let res = await http.load(
445
+ 'POST',
446
+ `rs/sql/apply_singleTable`,
447
+ {data: data},
448
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
449
+ )
450
+
451
+ this.setLabelOptions('小区', res.data.map(item => {
452
+ return {
453
+ label: item.f_residential_area,
454
+ value: item.f_residential_area
455
+ }
456
+ }))
457
+ },
458
+ // 区县失去焦点
459
+ async 'pcdChange' (index) {
460
+ if (isEmpty(this.show_data.f_pcd)) {
461
+ return
462
+ }
463
+
464
+ this.setLabelValue('街道/乡镇', null)
465
+ this.setLabelValue('小区', null)
466
+
467
+
468
+
469
+ let data = {
470
+ tablename: 't_street',
471
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
472
+ }
473
+ let f_address_type = this.getLableValue('地址类型')
474
+
475
+ if (f_address_type === '民用市区') {
476
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
477
+ }
478
+ if (f_address_type === '民用乡镇') {
479
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
480
+ }
481
+
482
+ let http = new HttpResetClass()
483
+ let res = await http.load(
484
+ 'POST',
485
+ `rs/sql/apply_singleTable`,
486
+ {data: data},
487
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
488
+ )
489
+
490
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
491
+ return {
492
+ label: item.f_street,
493
+ value: item.f_street
494
+ }
495
+ }))
496
+ },
497
+ // 选择气价
498
+ 'priceChange' (index) {
499
+ if (isEmpty(this.show_data.stairPrice)) {
500
+ return
501
+ }
502
+
503
+ let stairPrice = this.getLableValue('气价名称')
504
+
505
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
506
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
507
+ this.setLabelValue('价格', stairPrice.f_price)
508
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
509
+ this.show_data.f_price_id = stairPrice.id
510
+ this.show_data.f_price_name = stairPrice.f_price_name
511
+ },
512
+ // 信息修改初始化
513
+ 'modifyInfoReadyEvent' () {
514
+ this.$getConfig(this, 'UserAddress')
515
+ this.pcdChange()
516
+ this.streetChange()
517
+ this.searchbuilding()
518
+ },
519
+ // 信息修改
520
+ async 'modifyInfo' () {
521
+ let data = this.show_data
522
+ data.username= this.$login.f.name
523
+ let res = await this.$resetpost(
524
+ `rs/logic/modifyUserInfo`,
525
+ data,
526
+ {resolveMsg: null, rejectMsg: '用户信息修改失败!!!'}
527
+ )
528
+ if(res.data===200){
529
+ this.$showMessage('信息修改成功!!!')
530
+ }else{
531
+ this.$showMessage('信息修改失败!!!')
532
+
533
+ }
534
+ this.$dispatch('loadPage')
535
+ },
536
+ async 'stopApply' () {
537
+ let data1 = {
538
+ tablename: 't_charge_record',
539
+ condition: `f_process_id = '${this.show_data.f_process_id}' and f_charge_status = '有效'`
540
+ }
541
+ let http = new HttpResetClass()
542
+ await http.load(
543
+ 'POST',
544
+ `rs/sql/apply_singleTable`,
545
+ {data: data1},
546
+ {resolveMsg: null, rejectMsg: '收费查询失败!!!'}
547
+ ).then(res=>{
548
+ if (res.data.length > 0){
549
+ this.$showMessage('该单子有收费有效的记录,请先冲正!!!')
550
+ }else {
551
+ let data = {
552
+ data: this.show_data,
553
+ user: this.$login.f
554
+ }
555
+ let res = this.$resetpost(
556
+ `rs/logic/stopApply`,
557
+ {data: data},
558
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
559
+ )
560
+ this.$dispatch('loadPage')
561
+ }
562
+ })
563
+ },
564
+ // 搜索楼号
565
+ async 'searchbuilding' (index) {
566
+ this.setLabelValue('楼号/组', null)
567
+ this.selectdata.f_residential_area = this.getLableValue('小区')
568
+ this.selectdata.f_street = this.getLableValue('街道/乡镇')
569
+ if (isEmpty(this.selectdata.f_residential_area)){
570
+ return
571
+ }
572
+ let data = {
573
+ items:'b.f_building',
574
+ orderitem: 'b.id',
575
+ tablename: 't_building b left join t_area a on b.f_residential_area_id = a.id',
576
+ condition: `b.f_filialeid = '${this.$login.f.orgid}' and b.f_residential_area like '%${this.selectdata.f_residential_area}' and a.f_street = '${this.selectdata.f_street}'`
577
+ }
578
+ let http = new HttpResetClass()
579
+ let res = await http.load(
580
+ 'POST',
581
+ `rs/sql/tel_singleTable_OrderBy`,
582
+ {data: data},
583
+ {resolveMsg: null, rejectMsg: '楼号查询失败!!!'}
584
+ )
585
+
586
+ if (res.data.length === 0) {
587
+ return
588
+ }
589
+
590
+ this.setLabelOptions('楼号/组', res.data.map(item => {
591
+ return {
592
+ label: item.f_building,
593
+ value: item.f_building
594
+ }
595
+ }))
596
+ },
597
+ async 'pauseApply' () {
598
+
599
+ let data = {
600
+ data: this.show_data,
601
+ user: this.$login.f
602
+ }
603
+
604
+ let res = await this.$resetpost(
605
+ `rs/logic/pauseApply`,
606
+ {data: data},
607
+ {resolveMsg: null, rejectMsg: '暂停报建失败!!!'}
608
+ )
609
+
610
+ this.$dispatch('loadPage')
611
+ },
612
+ // 获取view层button事件
613
+ async 'button' (){
614
+
615
+ let res = await this.$resetpost(
616
+ `rs/entity/t_apply`,
617
+ this.show_data,
618
+ {resolveMsg: null, rejectMsg: '数据保存失败!!!'}
619
+ )
620
+
621
+ this.$dispatch('loadPage')
622
+ },
623
+ // 失去焦点出触发事件
624
+ 'onchange' (index) {
625
+ if (this.show_data.title === '信息修改') {
626
+ if (
627
+ this.show_data.fields[index].label === '区/县' ||
628
+ this.show_data.fields[index].label === '街道/乡镇' ||
629
+ this.show_data.fields[index].label === '小区' ||
630
+ this.show_data.fields[index].label === '楼号/组' ||
631
+ this.show_data.fields[index].label === '单元/排' ||
632
+ this.show_data.fields[index].label === '楼层' ||
633
+ this.show_data.fields[index].label === '门牌号'||
634
+ this.show_data.fields[index].label === '地址杂项'
635
+ ) {
636
+
637
+ let f_pcd = this.getLableValue('区/县') || ''
638
+ let f_street = this.getLableValue('街道/乡镇') || ''
639
+ let f_residential_area = this.getLableValue('小区') || ''
640
+ let f_building = this.getLableValue('楼号/组') || ''
641
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
642
+ let f_unit = this.getLableValue('单元/排') || ''
643
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
644
+ let f_floor = this.getLableValue('楼层') || ''
645
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
646
+ let f_room = this.getLableValue('门牌号') || ''
647
+ let f_room_suffix = this.getLableValue('地址杂项') || ''
648
+
649
+ let f_address = f_pcd + f_street + f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
650
+ this.setLabelValue("地址", f_address)
651
+ }
652
+ }
653
+ if (this.show_data.fields[index].label == '派工数') {
654
+ if (parseInt(this.show_data.f_installed_households) > parseInt(this.show_data.f_apply_count) ){
655
+ this.$showMessage('派工数不能大于总户数!!!')
656
+ this.show_data.fields[index].value = ''
657
+ }
658
+ }
659
+ },
660
+ 'onblur' (index) {},
661
+ 'oninput' (index) {
662
+ let http = new HttpResetClass()
663
+ if (this.show_data.fields[index].label == '入户证号'){
664
+ let data = {
665
+ tablename: `t_apply`,
666
+ condition: `f_entry_number='${this.show_data.fields[index].value}' and f_sub_state in ('正在进行','完工')`
667
+ }
668
+ http.load('post','rs/sql/apply_singleTable',{data: data},
669
+ {resolveMsg: null, rejectMsg: '查询失败'}).then(row=>{
670
+ if (row.data.length > 0){
671
+ this.$showMessage('请注意入户证号重复!!!')
672
+ }
673
+ })
674
+ }
675
+ },
676
+ 'initializtionView' () {},
677
+ async 'onchangeModal' (index, fieldIndex) {
678
+ },
679
+ async 'onblurModal' (index, fieldIndex) {
680
+
681
+ },
682
+ async 'oninputModal' (index, fieldIndex) {
683
+
684
+ },
685
+ async 'onetomanydelete' (index, rowIndex) {
686
+
687
+ let http = new HttpResetClass()
688
+
689
+ let res = await http.load(
690
+ 'DELETE',
691
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
692
+ null,
693
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
694
+ )
695
+
696
+ res = await this.$resetpost(
697
+ 'rs/entity/t_apply',
698
+ this.show_data
699
+ )
700
+
701
+ this.$dispatch('breakControl', this.show_data)
702
+ },
703
+ async 'onetomanyupdate' (index, rowIndex) {
704
+ let data = this.show_data.onetomany[index].rows[rowIndex]
705
+
706
+ this.show_data.onetomany[index].fields.forEach(item => {
707
+ data[item.field] = item.value
708
+ })
709
+ let res = await this.$resetpost(
710
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
711
+ data
712
+ )
713
+
714
+ res = await this.$resetpost(
715
+ 'rs/entity/t_apply',
716
+ this.show_data
717
+ )
718
+
719
+ this.$dispatch('breakControl', this.show_data)
720
+ },
721
+ async 'onetomanyadd' (index) {
722
+ let data = {
723
+ f_process_id : this.show_data.f_process_id,
724
+ f_operator_id: this.$login.f.id,
725
+ f_operator: this.$login.f.name,
726
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
727
+ f_orgid: this.$login.f.orgid,
728
+ f_orgname: this.$login.f.orgs
729
+ }
730
+ this.show_data.onetomany[index].fields.forEach(item => {
731
+ data[item.field] = item.value
732
+ })
733
+ let res = await this.$resetpost(
734
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
735
+ data
736
+ )
737
+
738
+ res = await this.$resetpost(
739
+ 'rs/entity/t_apply',
740
+ this.show_data
741
+ )
742
+
743
+ this.$dispatch('breakControl', this.show_data)
744
+ }
745
+ },
746
+ watch:{
747
+ }
748
+ }
749
+ </script>