apply-clients 3.5.4-73 → 3.5.4-75

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