apply-clients 3.5.1 → 3.5.2

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