apply-clients 3.5.1 → 3.5.3

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 +142 -133
  2. package/package.json +118 -118
  3. package/src/App.vue +26 -21
  4. package/src/applyAndroid.js +58 -58
  5. package/src/components/android/AppSign.vue +152 -152
  6. package/src/components/android/AppTakePic.vue +181 -181
  7. package/src/components/android/Process/AppChargeList.vue +224 -224
  8. package/src/components/android/Process/AppExplorationUser.vue +508 -508
  9. package/src/components/android/Process/AppOtherChargeList.vue +255 -219
  10. package/src/components/product/Install/ContractCharge.vue +210 -210
  11. package/src/filiale/fugou/android/AppChargeManagement.vue +625 -625
  12. package/src/filiale/hongda/pc/FunctionServiceControl.vue +526 -525
  13. package/src/filiale/qianneng/android/AppExplorationUser.vue +441 -441
  14. package/src/filiale/qianneng/android/AppServiceControl.vue +1608 -1608
  15. package/src/filiale/qianneng/pc/Applybatchdispatch.vue +685 -685
  16. package/src/filiale/qianneng/pc/ExplorationSelect.vue +492 -492
  17. package/src/filiale/qianneng/pc/FunctionServiceControl.vue +521 -521
  18. package/src/filiale/qianneng/pc/InstallInfoSelect.vue +392 -392
  19. package/src/filiale/qianneng/pc/InstallationDetails.vue +561 -561
  20. package/src/filiale/qianneng/pc/ServiceControl.vue +1351 -1340
  21. package/src/filiale/qianneng/pc/SupervisoryList.vue +344 -344
  22. package/src/filiale/qianneng/pc/SupervisoryServiceControl.vue +871 -871
  23. package/src/filiale/qianneng/pc/chargeManagement.vue +656 -656
  24. package/src/filiale/qianneng/pc/printactivatecard.vue +295 -295
  25. package/src/filiale/qianneng/pc/supplementalAgreement.vue +344 -344
  26. package/src/filiale/yangchunboneng/android/AppAddMaterialScience.vue +390 -390
  27. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +120 -120
  28. package/src/filiale/yangchunboneng/android/AppDevicesManagement.vue +552 -552
  29. package/src/filiale/yangchunboneng/android/AppExplorationUser.vue +507 -507
  30. package/src/filiale/yangchunboneng/android/AppInstallationDetails.vue +492 -492
  31. package/src/filiale/yangchunboneng/android/AppOtherChargeManagement.vue +116 -116
  32. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +1552 -1552
  33. package/src/filiale/yangchunboneng/android/AppTakePic.vue +181 -181
  34. package/src/filiale/yangchunboneng/android/chargesList.vue +170 -170
  35. package/src/filiale/yangchunboneng/android.js +16 -16
  36. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +496 -496
  37. package/src/filiale/yangchunboneng/pc/InstallationDetails.vue +609 -609
  38. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +1782 -1782
  39. package/src/filiale/yangchunboneng/pc/ServiceView.vue +1005 -1005
  40. package/src/filiale/yangchunboneng/pc/addMaterialScience.vue +374 -374
  41. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +960 -960
  42. package/src/filiale/yangchunboneng/pc/devicesManagement.vue +511 -511
  43. package/src/filiale/yangchunboneng/pc/otherchargeManagement.vue +214 -214
  44. package/src/filiale/yangchunboneng/pc.js +17 -17
  45. package/src/main.js +23 -23
@@ -1,521 +1,521 @@
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.refurbish()
20
- },
21
- methods: {
22
- //将千分位金额转换为数字
23
- parseCurrency(str) {
24
- // 用正则表达式移除千分位分隔符,并转换为数字
25
- return parseFloat(str.replace(/,/g, ''));
26
- },
27
- //将金额转换为千分位
28
- formatCurrency(number, decimalPlaces) {
29
- var num = parseFloat(number);
30
- if (!isNaN(num)) {
31
- num = num.toFixed(decimalPlaces || 0); // 将金额保留指定位数,四舍五入
32
- num = num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 按照千分位进行分隔
33
- return num;
34
- } else {
35
- return ''; // 如果输入框中的值不是数字,则返回空字符串
36
- }
37
- },
38
- async refurbish () {
39
- // fields 字段填充值
40
- for (const item of this.selectdata.fields) {
41
- if (!item.value) {
42
- item.value = null
43
- }
44
-
45
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
46
- if (item.eval) {
47
- item.value = eval(item.default)
48
- } else {
49
- item.value = item.default
50
- }
51
- }
52
-
53
- if (this.selectdata[item.field]) {
54
- // 将json字符串格式化赋值给value
55
- if (String(this.selectdata[item.field]).startsWith("{")) {
56
- item.value = JSON.parse(this.selectdata[item.field])
57
- } else {
58
- item.value = this.selectdata[item.field]
59
- }
60
- }
61
- if (this.selectdata[item.field] === 0) {
62
- item.value = 0
63
- }
64
-
65
- // datepicker
66
- if (item.type === 'datepicker' && !item.value && item.default) {
67
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
68
- }
69
-
70
- // 如果配置类型为select,优先从参数列表获取options
71
- if (item.type === 'select' || item.type === 'checkbox') {
72
- if (item.param) {
73
- let temp = this.$appdata.getParam(item.label)
74
-
75
- if (temp && temp.length > 0) {
76
- item.options = temp
77
- }
78
-
79
- if (item.paramLabel) {
80
- temp = this.$appdata.getParam(item.paramLabel)
81
- if (temp && temp.length > 0) {
82
- item.options = temp
83
- }
84
- }
85
- }
86
-
87
- if (item.ready) {
88
- item.options = await this[item.ready]()
89
- }
90
- }
91
-
92
-
93
- if (item.type === 'checkbox') {
94
- if (this.selectdata[item.field]) {
95
- item.value = JSON.parse(this.selectdata[item.field])
96
- } else {
97
- item.value = []
98
- }
99
- }
100
- //金额千分位
101
- if (item.percentiles) {
102
- let amount = item.value
103
- if (amount > 0) {
104
- let amounts = this.formatCurrency(amount, 2)
105
- console.log('金额千分位', amounts)
106
- item.value = amounts
107
- console.log('金额千分位1', item.value)
108
- }
109
- this.selectdata[item.field] = item.value
110
- }
111
- }
112
-
113
- // 控制组件
114
- if (this.selectdata.components) {
115
- this.selectdata.components.forEach(item => {
116
- item.mark = 2
117
- })
118
- }
119
-
120
- // 初始化onetomany
121
- if (this.selectdata.onetomany) {
122
- for (const item of this.selectdata.onetomany) {
123
- let res = null
124
- if (item.queryEvent) {
125
- res = this[item.queryEvent]()
126
- } else {
127
- let data = {
128
- tablename: item.tables[0],
129
- condition: `f_process_id='${this.selectdata.f_process_id}'`
130
- }
131
- res = await this.$resetpost(
132
- 'rs/sql/apply_singleTable',
133
- {data: data},
134
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
135
- )
136
- }
137
-
138
- item.rows = res.data
139
-
140
- // 初始化onetomany中的fields
141
- for (const field of item.fields) {
142
- if (!field.value) {
143
- if (field.value !== 0) {
144
- field.value = null
145
- }
146
- }
147
-
148
- if (field.default || field.default === 0) {
149
- field.value = field.default
150
- }
151
-
152
- // datepicker
153
- if (field.type === 'datepicker' && !field.value && field.default) {
154
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
155
- }
156
-
157
- if (field.type === 'select') {
158
- let temp = this.$appdata.getParam(field.label)
159
-
160
- if (temp && temp.length > 0) {
161
- field.options = temp
162
- }
163
-
164
- if (field.paramLabel) {
165
- temp = this.$appdata.getParam(field.paramLabel)
166
- if (temp && temp.length > 0) {
167
- item.options = temp
168
- }
169
- }
170
- }
171
- }
172
- }
173
- }
174
-
175
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
176
- let temp = JSON.parse(JSON.stringify(this.selectdata))
177
- this.show_data = temp
178
- for (const item of this.show_data.fields) {
179
- if(item.label==='气价名称'){
180
- item.value=this.show_data.f_price_name
181
- }
182
- if (this.show_data.f_apply_source === '线下发起' && (item.label === '预约地址' || item.label === '预约单号')) {
183
- item.hidden = true
184
- }
185
- }
186
- if (this.show_data.f_apply_type == '居民团体用户报建' ){
187
- if (this.show_data.f_apply_nature == '整体小区'){
188
- this.showLabels('楼房总户数')
189
- this.showLabels('楼房总栋数')
190
- this.showLabels('别墅总户数')
191
- this.hideLabels('总户数')
192
- }
193
- if (this.show_data.f_apply_nature == '整体村庄'){
194
- this.showLabels('总户数')
195
- this.hideLabels('楼房总户数')
196
- this.hideLabels('楼房总栋数')
197
- this.hideLabels('别墅总户数')
198
- }
199
- }
200
- this.$nextTick(() => {
201
- this.showview = true
202
- })
203
- },
204
- getLableValue(label) {
205
- for (const item of this.show_data.fields) {
206
- if (item.label === label && item.type !== 'number') {
207
- return item.value || ''
208
- }
209
- if (item.label === label && item.type === 'number') {
210
- return item.value || 0
211
- }
212
- }
213
- },
214
- getLableOptions(label) {
215
- for (const item of this.show_data.fields) {
216
- if (item.label === label) {
217
- return item.options
218
- }
219
- }
220
- },
221
- setLabelValue(label, value) {
222
- for (const item of this.show_data.fields) {
223
- if (item.label === label) {
224
- item.value = value
225
- this.show_data[item.field] = value
226
- }
227
- }
228
- },
229
- setLabelOptions(label, options) {
230
- for (const item of this.show_data.fields) {
231
- if (item.label === label) {
232
- item.options = options
233
- }
234
- }
235
- },
236
- showLabels(...labels) {
237
- for (const item of this.show_data.fields) {
238
- if (labels.includes(item.label)) {
239
- item.hidden = false
240
- }
241
- }
242
- },
243
- hideLabels(...labels) {
244
- for (const item of this.show_data.fields) {
245
- if (labels.includes(item.label)) {
246
- item.hidden = true
247
- }
248
- }
249
- },
250
- requiredLabels(...labels) {
251
- for (const item of this.show_data.fields) {
252
- if (labels.includes(item.label)) {
253
- item.required = true
254
- }
255
- }
256
- },
257
- electiveLabels(...labels) {
258
- for (const item of this.show_data.fields) {
259
- if (labels.includes(item.label)) {
260
- item.required = false
261
- }
262
- }
263
- },
264
- readonlyLabels(...labels) {
265
- for (const item of this.show_data.fields) {
266
- if (labels.includes(item.label)) {
267
- item.readonly = true
268
- item.disabled = true
269
- }
270
- }
271
- },
272
- readwriteLabels(...labels) {
273
- for (const item of this.show_data.fields) {
274
- if (labels.includes(item.label)) {
275
- item.readonly = false
276
- item.disabled = false
277
- }
278
- }
279
- },
280
- async getPrice (f_price_id) {
281
- console.log('=======================')
282
- console.log(f_price_id)
283
-
284
- let data = {
285
- condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
286
- }
287
- // if(this.Pricetype==='机表'){
288
- // data.condition=`sp.f_custom = '机表'`
289
- // }
290
- // if(this.Pricetype==='非机表'){
291
- // data.condition=`sp.f_custom = '非机表'`
292
- // }
293
-
294
- if (!isEmpty(f_price_id)) {
295
- data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
296
- }
297
- let http = new HttpResetClass()
298
- let res = await http.load(
299
- 'POST',
300
- `rs/sql/applyGetPrice`,
301
- {data: data},
302
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
303
- )
304
-
305
- let a= res.data.map(item => {
306
- return {
307
- label: item.f_price_name,
308
- value: item
309
- }
310
- })
311
- this.selectdata.fields.forEach(field => {
312
- if (field.label === '气价名称') {
313
- field.options = a}
314
- })
315
- return a
316
- },
317
- },
318
- events: {
319
- // 选择气价
320
- 'priceChange' (index) {
321
- if (isEmpty(this.show_data.stairPrice)) {
322
- return
323
- }
324
-
325
- let stairPrice = this.getLableValue('气价名称')
326
-
327
- this.setLabelValue('气价类型', stairPrice.f_price_type)
328
- this.setLabelValue('用气性质', stairPrice.f_gasproperties)
329
- this.setLabelValue('价格', stairPrice.f_price)
330
- this.setLabelValue('客户类型', stairPrice.f_user_type)
331
- this.show_data.f_price_id = stairPrice.id
332
- this.show_data.f_price_name = stairPrice.f_price_name
333
- },
334
- // 信息修改初始化
335
- 'modifyInfoReadyEvent' () {
336
- this.$getConfig(this, 'UserAddress')
337
- },
338
- // 信息修改
339
- async 'modifyInfo' () {
340
- let data = this.show_data
341
- data.username= this.$login.f.name
342
- let res = await this.$resetpost(
343
- `rs/logic/modifyUserInfo`,
344
- data,
345
- {resolveMsg: null, rejectMsg: '用户信息修改失败!!!'}
346
- )
347
- if(res.data===200){
348
- this.$showMessage('信息修改成功!!!')
349
- }else{
350
- this.$showMessage('信息修改失败!!!')
351
-
352
- }
353
- this.$dispatch('loadPage')
354
- },
355
- async 'stopApply' () {
356
-
357
- let data = {
358
- data: this.show_data,
359
- user: this.$login.f
360
- }
361
-
362
- let res = await this.$resetpost(
363
- `rs/logic/stopApply`,
364
- {data: data},
365
- {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
366
- )
367
-
368
- this.$dispatch('loadPage')
369
- },
370
- async 'pauseApply' () {
371
-
372
- let data = {
373
- data: this.show_data,
374
- user: this.$login.f
375
- }
376
-
377
- let res = await this.$resetpost(
378
- `rs/logic/pauseApply`,
379
- {data: data},
380
- {resolveMsg: null, rejectMsg: '暂停报建失败!!!'}
381
- )
382
-
383
- this.$dispatch('loadPage')
384
- },
385
- // 获取view层button事件
386
- async 'button' (){
387
-
388
- let res = await this.$resetpost(
389
- `rs/entity/t_apply`,
390
- this.show_data,
391
- {resolveMsg: null, rejectMsg: '数据保存失败!!!'}
392
- )
393
-
394
- this.$dispatch('loadPage')
395
- },
396
- // 失去焦点出触发事件
397
- 'onchange' (index) {
398
- if (this.show_data.title === '信息修改') {
399
- if (
400
- this.show_data.fields[index].label === '区/县' ||
401
- this.show_data.fields[index].label === '街道/乡镇' ||
402
- this.show_data.fields[index].label === '小区' ||
403
- this.show_data.fields[index].label === '楼号/组' ||
404
- this.show_data.fields[index].label === '单元/排' ||
405
- this.show_data.fields[index].label === '楼层' ||
406
- this.show_data.fields[index].label === '门牌号'
407
- ) {
408
-
409
- let f_pcd = this.getLableValue('区/县') || ''
410
- let f_street = this.getLableValue('街道/乡镇') || ''
411
- let f_residential_area = this.getLableValue('小区') || ''
412
- let f_building = this.getLableValue('楼号/组') || ''
413
- let f_building_suffix = f_building ? this.config.f_building_suffix : ''
414
- let f_unit = this.getLableValue('单元/排') || ''
415
- let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
416
- let f_floor = this.getLableValue('楼层') || ''
417
- let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
418
- let f_room = this.getLableValue('门牌号') || ''
419
- let f_room_suffix = f_room ? this.config.f_room_suffix : ''
420
-
421
- 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
422
- this.setLabelValue("地址", f_address)
423
- }
424
- }
425
- if (this.show_data.fields[index].label == '派工数') {
426
- if (parseInt(this.show_data.f_installed_households) > parseInt(this.show_data.f_apply_count) ){
427
- this.$showMessage('派工数不能大于总户数!!!')
428
- this.show_data.fields[index].value = ''
429
- }
430
- }
431
- },
432
- 'onblur' (index) {},
433
- 'oninput' (index) {
434
- let http = new HttpResetClass()
435
- if (this.show_data.fields[index].label == '入户证号'){
436
- let data = {
437
- tablename: `t_apply`,
438
- condition: `f_entry_number='${this.show_data.fields[index].value}' and f_sub_state in ('正在进行','完工')`
439
- }
440
- http.load('post','rs/sql/apply_singleTable',{data: data},
441
- {resolveMsg: null, rejectMsg: '查询失败'}).then(row=>{
442
- if (row.data.length > 0){
443
- this.$showMessage('请注意入户证号重复!!!')
444
- }
445
- })
446
- }
447
- },
448
- 'initializtionView' () {},
449
- async 'onchangeModal' (index, fieldIndex) {
450
- },
451
- async 'onblurModal' (index, fieldIndex) {
452
-
453
- },
454
- async 'oninputModal' (index, fieldIndex) {
455
-
456
- },
457
- async 'onetomanydelete' (index, rowIndex) {
458
-
459
- let http = new HttpResetClass()
460
-
461
- let res = await http.load(
462
- 'DELETE',
463
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
464
- null,
465
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
466
- )
467
-
468
- res = await this.$resetpost(
469
- 'rs/entity/t_apply',
470
- this.show_data
471
- )
472
-
473
- this.$dispatch('breakControl', this.show_data)
474
- },
475
- async 'onetomanyupdate' (index, rowIndex) {
476
- let data = this.show_data.onetomany[index].rows[rowIndex]
477
-
478
- this.show_data.onetomany[index].fields.forEach(item => {
479
- data[item.field] = item.value
480
- })
481
- let res = await this.$resetpost(
482
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
483
- data
484
- )
485
-
486
- res = await this.$resetpost(
487
- 'rs/entity/t_apply',
488
- this.show_data
489
- )
490
-
491
- this.$dispatch('breakControl', this.show_data)
492
- },
493
- async 'onetomanyadd' (index) {
494
- let data = {
495
- f_process_id : this.show_data.f_process_id,
496
- f_operator_id: this.$login.f.id,
497
- f_operator: this.$login.f.name,
498
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
499
- f_orgid: this.$login.f.orgid,
500
- f_orgname: this.$login.f.orgs
501
- }
502
- this.show_data.onetomany[index].fields.forEach(item => {
503
- data[item.field] = item.value
504
- })
505
- let res = await this.$resetpost(
506
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
507
- data
508
- )
509
-
510
- res = await this.$resetpost(
511
- 'rs/entity/t_apply',
512
- this.show_data
513
- )
514
-
515
- this.$dispatch('breakControl', this.show_data)
516
- }
517
- },
518
- watch:{
519
- }
520
- }
521
- </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.refurbish()
20
+ },
21
+ methods: {
22
+ //将千分位金额转换为数字
23
+ parseCurrency(str) {
24
+ // 用正则表达式移除千分位分隔符,并转换为数字
25
+ return parseFloat(str.replace(/,/g, ''));
26
+ },
27
+ //将金额转换为千分位
28
+ formatCurrency(number, decimalPlaces) {
29
+ var num = parseFloat(number);
30
+ if (!isNaN(num)) {
31
+ num = num.toFixed(decimalPlaces || 0); // 将金额保留指定位数,四舍五入
32
+ num = num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 按照千分位进行分隔
33
+ return num;
34
+ } else {
35
+ return ''; // 如果输入框中的值不是数字,则返回空字符串
36
+ }
37
+ },
38
+ async refurbish () {
39
+ // fields 字段填充值
40
+ for (const item of this.selectdata.fields) {
41
+ if (!item.value) {
42
+ item.value = null
43
+ }
44
+
45
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
46
+ if (item.eval) {
47
+ item.value = eval(item.default)
48
+ } else {
49
+ item.value = item.default
50
+ }
51
+ }
52
+
53
+ if (this.selectdata[item.field]) {
54
+ // 将json字符串格式化赋值给value
55
+ if (String(this.selectdata[item.field]).startsWith("{")) {
56
+ item.value = JSON.parse(this.selectdata[item.field])
57
+ } else {
58
+ item.value = this.selectdata[item.field]
59
+ }
60
+ }
61
+ if (this.selectdata[item.field] === 0) {
62
+ item.value = 0
63
+ }
64
+
65
+ // datepicker
66
+ if (item.type === 'datepicker' && !item.value && item.default) {
67
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
68
+ }
69
+
70
+ // 如果配置类型为select,优先从参数列表获取options
71
+ if (item.type === 'select' || item.type === 'checkbox') {
72
+ if (item.param) {
73
+ let temp = this.$appdata.getParam(item.label)
74
+
75
+ if (temp && temp.length > 0) {
76
+ item.options = temp
77
+ }
78
+
79
+ if (item.paramLabel) {
80
+ temp = this.$appdata.getParam(item.paramLabel)
81
+ if (temp && temp.length > 0) {
82
+ item.options = temp
83
+ }
84
+ }
85
+ }
86
+
87
+ if (item.ready) {
88
+ item.options = await this[item.ready]()
89
+ }
90
+ }
91
+
92
+
93
+ if (item.type === 'checkbox') {
94
+ if (this.selectdata[item.field]) {
95
+ item.value = JSON.parse(this.selectdata[item.field])
96
+ } else {
97
+ item.value = []
98
+ }
99
+ }
100
+ //金额千分位
101
+ if (item.percentiles) {
102
+ let amount = item.value
103
+ if (amount > 0) {
104
+ let amounts = this.formatCurrency(amount, 2)
105
+ console.log('金额千分位', amounts)
106
+ item.value = amounts
107
+ console.log('金额千分位1', item.value)
108
+ }
109
+ this.selectdata[item.field] = item.value
110
+ }
111
+ }
112
+
113
+ // 控制组件
114
+ if (this.selectdata.components) {
115
+ this.selectdata.components.forEach(item => {
116
+ item.mark = 2
117
+ })
118
+ }
119
+
120
+ // 初始化onetomany
121
+ if (this.selectdata.onetomany) {
122
+ for (const item of this.selectdata.onetomany) {
123
+ let res = null
124
+ if (item.queryEvent) {
125
+ res = this[item.queryEvent]()
126
+ } else {
127
+ let data = {
128
+ tablename: item.tables[0],
129
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
130
+ }
131
+ res = await this.$resetpost(
132
+ 'rs/sql/apply_singleTable',
133
+ {data: data},
134
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
135
+ )
136
+ }
137
+
138
+ item.rows = res.data
139
+
140
+ // 初始化onetomany中的fields
141
+ for (const field of item.fields) {
142
+ if (!field.value) {
143
+ if (field.value !== 0) {
144
+ field.value = null
145
+ }
146
+ }
147
+
148
+ if (field.default || field.default === 0) {
149
+ field.value = field.default
150
+ }
151
+
152
+ // datepicker
153
+ if (field.type === 'datepicker' && !field.value && field.default) {
154
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
155
+ }
156
+
157
+ if (field.type === 'select') {
158
+ let temp = this.$appdata.getParam(field.label)
159
+
160
+ if (temp && temp.length > 0) {
161
+ field.options = temp
162
+ }
163
+
164
+ if (field.paramLabel) {
165
+ temp = this.$appdata.getParam(field.paramLabel)
166
+ if (temp && temp.length > 0) {
167
+ item.options = temp
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }
173
+ }
174
+
175
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
176
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
177
+ this.show_data = temp
178
+ for (const item of this.show_data.fields) {
179
+ if(item.label==='气价名称'){
180
+ item.value=this.show_data.f_price_name
181
+ }
182
+ if (this.show_data.f_apply_source === '线下发起' && (item.label === '预约地址' || item.label === '预约单号')) {
183
+ item.hidden = true
184
+ }
185
+ }
186
+ if (this.show_data.f_apply_type == '居民团体用户报建' ){
187
+ if (this.show_data.f_apply_nature == '整体小区'){
188
+ this.showLabels('楼房总户数')
189
+ this.showLabels('楼房总栋数')
190
+ this.showLabels('别墅总户数')
191
+ this.hideLabels('总户数')
192
+ }
193
+ if (this.show_data.f_apply_nature == '整体村庄'){
194
+ this.showLabels('总户数')
195
+ this.hideLabels('楼房总户数')
196
+ this.hideLabels('楼房总栋数')
197
+ this.hideLabels('别墅总户数')
198
+ }
199
+ }
200
+ this.$nextTick(() => {
201
+ this.showview = true
202
+ })
203
+ },
204
+ getLableValue(label) {
205
+ for (const item of this.show_data.fields) {
206
+ if (item.label === label && item.type !== 'number') {
207
+ return item.value || ''
208
+ }
209
+ if (item.label === label && item.type === 'number') {
210
+ return item.value || 0
211
+ }
212
+ }
213
+ },
214
+ getLableOptions(label) {
215
+ for (const item of this.show_data.fields) {
216
+ if (item.label === label) {
217
+ return item.options
218
+ }
219
+ }
220
+ },
221
+ setLabelValue(label, value) {
222
+ for (const item of this.show_data.fields) {
223
+ if (item.label === label) {
224
+ item.value = value
225
+ this.show_data[item.field] = value
226
+ }
227
+ }
228
+ },
229
+ setLabelOptions(label, options) {
230
+ for (const item of this.show_data.fields) {
231
+ if (item.label === label) {
232
+ item.options = options
233
+ }
234
+ }
235
+ },
236
+ showLabels(...labels) {
237
+ for (const item of this.show_data.fields) {
238
+ if (labels.includes(item.label)) {
239
+ item.hidden = false
240
+ }
241
+ }
242
+ },
243
+ hideLabels(...labels) {
244
+ for (const item of this.show_data.fields) {
245
+ if (labels.includes(item.label)) {
246
+ item.hidden = true
247
+ }
248
+ }
249
+ },
250
+ requiredLabels(...labels) {
251
+ for (const item of this.show_data.fields) {
252
+ if (labels.includes(item.label)) {
253
+ item.required = true
254
+ }
255
+ }
256
+ },
257
+ electiveLabels(...labels) {
258
+ for (const item of this.show_data.fields) {
259
+ if (labels.includes(item.label)) {
260
+ item.required = false
261
+ }
262
+ }
263
+ },
264
+ readonlyLabels(...labels) {
265
+ for (const item of this.show_data.fields) {
266
+ if (labels.includes(item.label)) {
267
+ item.readonly = true
268
+ item.disabled = true
269
+ }
270
+ }
271
+ },
272
+ readwriteLabels(...labels) {
273
+ for (const item of this.show_data.fields) {
274
+ if (labels.includes(item.label)) {
275
+ item.readonly = false
276
+ item.disabled = false
277
+ }
278
+ }
279
+ },
280
+ async getPrice (f_price_id) {
281
+ console.log('=======================')
282
+ console.log(f_price_id)
283
+
284
+ let data = {
285
+ condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
286
+ }
287
+ // if(this.Pricetype==='机表'){
288
+ // data.condition=`sp.f_custom = '机表'`
289
+ // }
290
+ // if(this.Pricetype==='非机表'){
291
+ // data.condition=`sp.f_custom = '非机表'`
292
+ // }
293
+
294
+ if (!isEmpty(f_price_id)) {
295
+ data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
296
+ }
297
+ let http = new HttpResetClass()
298
+ let res = await http.load(
299
+ 'POST',
300
+ `rs/sql/applyGetPrice`,
301
+ {data: data},
302
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
303
+ )
304
+
305
+ let a= res.data.map(item => {
306
+ return {
307
+ label: item.f_price_name,
308
+ value: item
309
+ }
310
+ })
311
+ this.selectdata.fields.forEach(field => {
312
+ if (field.label === '气价名称') {
313
+ field.options = a}
314
+ })
315
+ return a
316
+ },
317
+ },
318
+ events: {
319
+ // 选择气价
320
+ 'priceChange' (index) {
321
+ if (isEmpty(this.show_data.stairPrice)) {
322
+ return
323
+ }
324
+
325
+ let stairPrice = this.getLableValue('气价名称')
326
+
327
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
328
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
329
+ this.setLabelValue('价格', stairPrice.f_price)
330
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
331
+ this.show_data.f_price_id = stairPrice.id
332
+ this.show_data.f_price_name = stairPrice.f_price_name
333
+ },
334
+ // 信息修改初始化
335
+ 'modifyInfoReadyEvent' () {
336
+ this.$getConfig(this, 'UserAddress')
337
+ },
338
+ // 信息修改
339
+ async 'modifyInfo' () {
340
+ let data = this.show_data
341
+ data.username= this.$login.f.name
342
+ let res = await this.$resetpost(
343
+ `rs/logic/modifyUserInfo`,
344
+ data,
345
+ {resolveMsg: null, rejectMsg: '用户信息修改失败!!!'}
346
+ )
347
+ if(res.data===200){
348
+ this.$showMessage('信息修改成功!!!')
349
+ }else{
350
+ this.$showMessage('信息修改失败!!!')
351
+
352
+ }
353
+ this.$dispatch('loadPage')
354
+ },
355
+ async 'stopApply' () {
356
+
357
+ let data = {
358
+ data: this.show_data,
359
+ user: this.$login.f
360
+ }
361
+
362
+ let res = await this.$resetpost(
363
+ `rs/logic/stopApply`,
364
+ {data: data},
365
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
366
+ )
367
+
368
+ this.$dispatch('loadPage')
369
+ },
370
+ async 'pauseApply' () {
371
+
372
+ let data = {
373
+ data: this.show_data,
374
+ user: this.$login.f
375
+ }
376
+
377
+ let res = await this.$resetpost(
378
+ `rs/logic/pauseApply`,
379
+ {data: data},
380
+ {resolveMsg: null, rejectMsg: '暂停报建失败!!!'}
381
+ )
382
+
383
+ this.$dispatch('loadPage')
384
+ },
385
+ // 获取view层button事件
386
+ async 'button' (){
387
+
388
+ let res = await this.$resetpost(
389
+ `rs/entity/t_apply`,
390
+ this.show_data,
391
+ {resolveMsg: null, rejectMsg: '数据保存失败!!!'}
392
+ )
393
+
394
+ this.$dispatch('loadPage')
395
+ },
396
+ // 失去焦点出触发事件
397
+ 'onchange' (index) {
398
+ if (this.show_data.title === '信息修改') {
399
+ if (
400
+ this.show_data.fields[index].label === '区/县' ||
401
+ this.show_data.fields[index].label === '街道/乡镇' ||
402
+ this.show_data.fields[index].label === '小区' ||
403
+ this.show_data.fields[index].label === '楼号/组' ||
404
+ this.show_data.fields[index].label === '单元/排' ||
405
+ this.show_data.fields[index].label === '楼层' ||
406
+ this.show_data.fields[index].label === '门牌号'
407
+ ) {
408
+
409
+ let f_pcd = this.getLableValue('区/县') || ''
410
+ let f_street = this.getLableValue('街道/乡镇') || ''
411
+ let f_residential_area = this.getLableValue('小区') || ''
412
+ let f_building = this.getLableValue('楼号/组') || ''
413
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
414
+ let f_unit = this.getLableValue('单元/排') || ''
415
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
416
+ let f_floor = this.getLableValue('楼层') || ''
417
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
418
+ let f_room = this.getLableValue('门牌号') || ''
419
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
420
+
421
+ 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
422
+ this.setLabelValue("地址", f_address)
423
+ }
424
+ }
425
+ if (this.show_data.fields[index].label == '派工数') {
426
+ if (parseInt(this.show_data.f_installed_households) > parseInt(this.show_data.f_apply_count) ){
427
+ this.$showMessage('派工数不能大于总户数!!!')
428
+ this.show_data.fields[index].value = ''
429
+ }
430
+ }
431
+ },
432
+ 'onblur' (index) {},
433
+ 'oninput' (index) {
434
+ let http = new HttpResetClass()
435
+ if (this.show_data.fields[index].label == '入户证号'){
436
+ let data = {
437
+ tablename: `t_apply`,
438
+ condition: `f_entry_number='${this.show_data.fields[index].value}' and f_sub_state in ('正在进行','完工')`
439
+ }
440
+ http.load('post','rs/sql/apply_singleTable',{data: data},
441
+ {resolveMsg: null, rejectMsg: '查询失败'}).then(row=>{
442
+ if (row.data.length > 0){
443
+ this.$showMessage('请注意入户证号重复!!!')
444
+ }
445
+ })
446
+ }
447
+ },
448
+ 'initializtionView' () {},
449
+ async 'onchangeModal' (index, fieldIndex) {
450
+ },
451
+ async 'onblurModal' (index, fieldIndex) {
452
+
453
+ },
454
+ async 'oninputModal' (index, fieldIndex) {
455
+
456
+ },
457
+ async 'onetomanydelete' (index, rowIndex) {
458
+
459
+ let http = new HttpResetClass()
460
+
461
+ let res = await http.load(
462
+ 'DELETE',
463
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
464
+ null,
465
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
466
+ )
467
+
468
+ res = await this.$resetpost(
469
+ 'rs/entity/t_apply',
470
+ this.show_data
471
+ )
472
+
473
+ this.$dispatch('breakControl', this.show_data)
474
+ },
475
+ async 'onetomanyupdate' (index, rowIndex) {
476
+ let data = this.show_data.onetomany[index].rows[rowIndex]
477
+
478
+ this.show_data.onetomany[index].fields.forEach(item => {
479
+ data[item.field] = item.value
480
+ })
481
+ let res = await this.$resetpost(
482
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
483
+ data
484
+ )
485
+
486
+ res = await this.$resetpost(
487
+ 'rs/entity/t_apply',
488
+ this.show_data
489
+ )
490
+
491
+ this.$dispatch('breakControl', this.show_data)
492
+ },
493
+ async 'onetomanyadd' (index) {
494
+ let data = {
495
+ f_process_id : this.show_data.f_process_id,
496
+ f_operator_id: this.$login.f.id,
497
+ f_operator: this.$login.f.name,
498
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
499
+ f_orgid: this.$login.f.orgid,
500
+ f_orgname: this.$login.f.orgs
501
+ }
502
+ this.show_data.onetomany[index].fields.forEach(item => {
503
+ data[item.field] = item.value
504
+ })
505
+ let res = await this.$resetpost(
506
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
507
+ data
508
+ )
509
+
510
+ res = await this.$resetpost(
511
+ 'rs/entity/t_apply',
512
+ this.show_data
513
+ )
514
+
515
+ this.$dispatch('breakControl', this.show_data)
516
+ }
517
+ },
518
+ watch:{
519
+ }
520
+ }
521
+ </script>