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