apply-clients 3.5.4-99 → 3.5.5-1

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