apply-clients 3.5.6-21 → 3.5.6-23

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 (56) hide show
  1. package/build/dev-server.js +5 -5
  2. package/package.json +1 -1
  3. package/src/components/android/Process/AppServiceControl.vue +1760 -1760
  4. package/src/components/product/Function/Service/FunctionServiceControl.vue +497 -497
  5. package/src/components/product/Install/ContractCharge.vue +210 -210
  6. package/src/filiale/dingcheng/android/AppInstallationDetails.vue +477 -477
  7. package/src/filiale/dingcheng/pc/InstallationDetails.vue +607 -607
  8. package/src/filiale/fugou/android/AppAddMaterialScience.vue +444 -444
  9. package/src/filiale/fugou/android/AppAddReplacement.vue +512 -512
  10. package/src/filiale/fugou/android/AppDevicesManagement.vue +516 -516
  11. package/src/filiale/fugou/android/AppInstallationDetails.vue +541 -541
  12. package/src/filiale/fugou/android/AppZhihuanManagement.vue +242 -242
  13. package/src/filiale/fugou/pc/AddReplacement.vue +511 -511
  14. package/src/filiale/fugou/pc/ApplyChargeList.vue +554 -554
  15. package/src/filiale/fugou/pc/Applybatchdispatch.vue +754 -754
  16. package/src/filiale/fugou/pc/InstallationDetails.vue +646 -646
  17. package/src/filiale/fugou/pc/ServiceControl.vue +1741 -1741
  18. package/src/filiale/fugou/pc/addMaterialScience.vue +481 -481
  19. package/src/filiale/fugou/pc.js +19 -19
  20. package/src/filiale/gongyi/pc/addressAndUserinfoManagement.vue +187 -187
  21. package/src/filiale/gongyi/pc/chargeManagement.vue +765 -765
  22. package/src/filiale/gongyi/pc.js +25 -25
  23. package/src/filiale/hongda/pc/addMaterialScience.vue +723 -723
  24. package/src/filiale/jinhuang/android/AppAddMaterialScience.vue +635 -635
  25. package/src/filiale/jinhuang/android/AppServiceControl.vue +1842 -1842
  26. package/src/filiale/jinhuang/android.js +7 -7
  27. package/src/filiale/jinhuang/pc/Applybatchdispatch.vue +770 -770
  28. package/src/filiale/jinhuang/pc/ContractList.vue +222 -222
  29. package/src/filiale/jinhuang/pc/ExplorationSelect.vue +511 -511
  30. package/src/filiale/jinhuang/pc/ServiceControl.vue +2016 -2016
  31. package/src/filiale/jinhuang/pc/SupervisoryList.vue +478 -478
  32. package/src/filiale/jinhuang/pc/addMaterialScience.vue +638 -638
  33. package/src/filiale/jinhuang/pc.js +13 -13
  34. package/src/filiale/qianneng/pc/Applybatchdispatch.vue +786 -786
  35. package/src/filiale/qianneng/pc/ServiceControl.vue +1387 -1387
  36. package/src/filiale/ruihua/pc/ServiceControl.vue +1973 -1973
  37. package/src/filiale/shexian/android/AppServiceControl.vue +1786 -1786
  38. package/src/filiale/shexian/android/AppSign.vue +152 -152
  39. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +527 -527
  40. package/src/filiale/yangchunboneng/android/AppContractCharge.vue +222 -222
  41. package/src/filiale/yangchunboneng/android/AppInstallationMaterial.vue +1144 -1144
  42. package/src/filiale/yangchunboneng/android/AppOtherChargeList.vue +281 -281
  43. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +1883 -1883
  44. package/src/filiale/yangchunboneng/android/MaterIialOne.vue +179 -176
  45. package/src/filiale/yangchunboneng/android.js +22 -22
  46. package/src/filiale/yangchunboneng/pc/ApplyUpload.vue +392 -392
  47. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +622 -622
  48. package/src/filiale/yangchunboneng/pc/InstallInfoSelect.vue +400 -400
  49. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +2118 -2118
  50. package/src/filiale/yangchunboneng/pc/SupervisoryControl.vue +141 -141
  51. package/src/filiale/yangchunboneng/pc/SupervisoryList.vue +652 -644
  52. package/src/filiale/yangchunboneng/pc/buildOrderList.vue +421 -421
  53. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +1060 -1060
  54. package/src/filiale/yangchunboneng/pc/printBuildOrder.vue +175 -175
  55. package/src/filiale/yangchunboneng/pc.js +29 -29
  56. package/src/main.js +3 -3
@@ -1,1973 +1,1973 @@
1
- <template>
2
- <div class="" v-if="showview">
3
- <show-back-reason :selectdata="show_data"></show-back-reason>
4
- <service-view v-ref:serviceview :data="show_data"></service-view>
5
- </div>
6
- </template>
7
- <script>
8
- import {HttpResetClass} from 'vue-client'
9
- import {isEmpty} from "../../../components/Util"
10
-
11
- // Date格式化
12
- Date.prototype.Format = function (fmt) {
13
- var o = {
14
- "M+": this.getMonth() + 1, //月份
15
- "d+": this.getDate(), //日
16
- "H+": this.getHours(), //小时
17
- "m+": this.getMinutes(), //分
18
- "s+": this.getSeconds(), //秒
19
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
20
- "S": this.getMilliseconds() //毫秒
21
- };
22
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
23
- for (var k in o)
24
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
25
- return fmt;
26
- }
27
-
28
- export default {
29
- title: '报建流程业务控制层',
30
- props: ['selectdata'],
31
- data () {
32
- return {
33
- data: null, // 数据库数据,json配置文件数据的数据集合
34
- json_datas: null, // Json配置文件集合
35
- showview: false, // 控制显示service-view组件
36
- show_data: null, // 给view层显示的数据
37
- config: {},
38
- Pricetype:''
39
- }
40
- },
41
- ready () {
42
- this.refurbish()
43
- },
44
- methods: {
45
- async servicer(){
46
- let data = {
47
- tablename: 't_user',
48
- condition: `1=1`
49
- }
50
- let http = new HttpResetClass()
51
- let res = await http.load(
52
- 'POST',
53
- `rs/sql/apply_singleTable`,
54
- {data: data},
55
- {resolveMsg: null, rejectMsg: '服务人查询失败!!!'}
56
- )
57
- this.setLabelOptions('服务人', res.data.map(item => {
58
- return {
59
- label: item.name,
60
- value: item.name
61
- }
62
- }))
63
- },
64
- async ceshi(){
65
- for (let i = 0; i < this.show_data.fields.length; i++) {
66
- if (this.show_data.defname==='报装申请' && this.show_data.fields[i].label === '合同编号') {
67
- let http2 = new HttpResetClass()
68
- let applyNum = await http2.load('POST', 'rs/logic/getProjectNo', {
69
- data: {
70
- f_filiale: this.$login.f.orgs,
71
- f_order_id: this.selectdata.f_order_id
72
- }
73
- }, {resolveMsg: null, rejectMsg: null})
74
- console.log("生成的合同编号为:" + applyNum.data)
75
- this.show_data.fields[i].value = applyNum.data
76
- }
77
- }
78
- },
79
-
80
- // 组件初始化操作
81
- async refurbish() {
82
- this.json_datas = this.$workflow_vue
83
- let sum = 0
84
- let jsonData = {}
85
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
86
- this.$showMessage("网络故障,请刷新页面")
87
- return
88
- }
89
- this.json_datas.activitys.forEach(item => {
90
- if (this.selectdata.defname === item.title) {
91
- jsonData = item // 拿到当前节点的json配置信息
92
- sum++ // 节点名一样的个数
93
- }
94
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
95
- })
96
-
97
- if (sum === 0) {
98
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
99
- return
100
- }
101
- if (sum > 1) {
102
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
103
- return
104
- }
105
-
106
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
107
-
108
- // fields 字段填充值
109
- for (const item of this.selectdata.fields) {
110
- if (!item.value) {
111
- item.value = null
112
- }
113
- if(this.selectdata.f_apply_type === '集体报建' && this.selectdata.defname === '报装缴费'){
114
- if(item.label === '未结总金额'){
115
- item.value = this.selectdata.f_due_money - this.selectdata.f_cumulative_payment_money
116
- }
117
- if(item.label === '付款比例'){
118
- item.value = (this.selectdata.f_cumulative_payment_money/this.selectdata.f_due_money * 100) + '%'
119
- }
120
- }
121
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
122
- if (item.eval) {
123
- item.value = eval(item.default)
124
- } else {
125
- item.value = item.default
126
- }
127
- }
128
-
129
- if (this.selectdata[item.field]) {
130
- // 将json字符串格式化赋值给value
131
- if (String(this.selectdata[item.field]).startsWith("{")) {
132
- item.value = JSON.parse(this.selectdata[item.field])
133
- } else {
134
- item.value = this.selectdata[item.field]
135
- }
136
- }
137
- if (this.selectdata[item.field] === 0) {
138
- item.value = 0
139
- }
140
-
141
- // datepicker
142
- if (item.type === 'datepicker' && !item.value && item.default) {
143
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
144
- }
145
- // 如果配置类型为select,优先从参数列表获取options
146
- if (item.type === 'select' || item.type === 'checkbox') {
147
- if (item.param) {
148
- let temp = this.$appdata.getParam(item.label)
149
-
150
- if (temp && temp.length > 0) {
151
- item.options = temp
152
- }
153
-
154
- if (item.paramLabel) {
155
- temp = this.$appdata.getParam(item.paramLabel)
156
- if (temp && temp.length > 0) {
157
- item.options = temp
158
- }
159
- }
160
- }
161
-
162
- if (item.ready) {
163
- console.log(item.ready)
164
- item.options = await this[item.ready]()
165
-
166
- }
167
- }
168
-
169
-
170
- if (item.type === 'checkbox') {
171
- if (this.selectdata[item.field]) {
172
- item.value = JSON.parse(this.selectdata[item.field])
173
- } else {
174
- item.value = []
175
- }
176
- }
177
-
178
- this.selectdata[item.field] = item.value
179
- }
180
-
181
- // 控制组件
182
- if (this.selectdata.components) {
183
- this.selectdata.components.forEach(item => {
184
- if (!item.mark) {
185
- item.mark = 0
186
- }
187
- })
188
- }
189
- // 初始化onetomany
190
- if (this.selectdata.onetomany) {
191
- for (const item of this.selectdata.onetomany) {
192
- let res = null
193
- if (item.queryEvent) {
194
- res = this[item.queryEvent]()
195
- } else {
196
- let data = {
197
- tablename: item.tables[0],
198
- condition: `f_process_id='${this.selectdata.f_process_id}'`
199
- }
200
- res = await this.$resetpost(
201
- 'rs/sql/apply_singleTable',
202
- {data: data},
203
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
204
- )
205
- }
206
-
207
- item.rows = res.data
208
-
209
- // 初始化onetomany中的fields
210
- for (const field of item.fields) {
211
- if (!field.value) {
212
- if (field.value !== 0) {
213
- field.value = null
214
- }
215
- }
216
-
217
- if (field.default || field.default === 0) {
218
- field.value = field.default
219
- }
220
-
221
- // datepicker
222
- if (field.type === 'datepicker' && !field.value && field.default) {
223
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
224
- }
225
-
226
- if (field.type === 'select') {
227
-
228
- let temp = this.$appdata.getParam(field.label)
229
-
230
- if (temp && temp.length > 0) {
231
- field.options = temp
232
- }
233
-
234
- if (field.paramLabel) {
235
- temp = this.$appdata.getParam(field.paramLabel)
236
- if (temp && temp.length > 0) {
237
- item.options = temp
238
- }
239
- }
240
- }
241
- }
242
- }
243
- }
244
- // 初始化 buttons_fields
245
- for (const item of this.selectdata.buttons) {
246
- if (item.button_name === '下发') {
247
-
248
- let data = {
249
- source: item.source,
250
- userid: this.$login.f.id
251
- }
252
- if (item.sourceMethod) {
253
- data.source = this[item.sourceMethod]()
254
- }
255
- if (!data.source) {
256
- this.$showMessage("请配置获取人员表达式")
257
- return
258
- }
259
-
260
- let res = await this.$resetpost(
261
- 'rs/search',
262
- {data: data},
263
- {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
264
- )
265
-
266
- let options = res.data.map(source => {
267
- return {
268
- "label": source.name,
269
- "value": source.id
270
- }
271
- })
272
-
273
- if (item.button_fields.length !== 1) {
274
- this.$showMessage("下发有且只能有一个字段!!!")
275
- return
276
- }
277
-
278
- item.button_fields[0].options = options
279
- }
280
- if (item.button_fields) {
281
- item.button_fields.forEach(x => {
282
- // 如果配置类型为select,优先从参数列表获取options
283
- if (x.type === 'select') {
284
-
285
- if (x.param) {
286
- let temp = this.$appdata.getParam(x.label)
287
-
288
- if (temp && temp.length > 0) {
289
- x.options = temp
290
- }
291
-
292
- if (x.paramLabel) {
293
- temp = this.$appdata.getParam(x.paramLabel)
294
- if (temp && temp.length > 0) {
295
- x.options = temp
296
- }
297
- }
298
- }
299
-
300
- }
301
- })
302
- }
303
- }
304
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
305
- let temp = JSON.parse(JSON.stringify(this.selectdata))
306
- console.log('打印下temp',temp)
307
- this.show_data = temp
308
- this.$nextTick(() => {
309
- this.showview = true
310
- })
311
- },
312
- // 金额转大写
313
- smalltoBIG(n) {
314
- let fraction = ['角', '分'];
315
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
316
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
317
- let head = n < 0 ? '欠' : '';
318
- n = Math.abs(n);
319
-
320
- let s = '';
321
-
322
- for (var i = 0; i < fraction.length; i++) {
323
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
324
- }
325
- s = s || '整';
326
- n = Math.floor(n);
327
-
328
- for (var i = 0; i < unit[0].length && n > 0; i++) {
329
- let p = '';
330
- for (var j = 0; j < unit[1].length && n > 0; j++) {
331
- p = digit[n % 10] + unit[1][j] + p;
332
- n = Math.floor(n / 10);
333
- }
334
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
335
- }
336
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
337
- },
338
- getLableValue(label) {
339
- for (const item of this.show_data.fields) {
340
- if (item.label === label && item.type !== 'number') {
341
- return item.value || ''
342
- }
343
- if (item.label === label && item.type === 'number') {
344
- return item.value || 0
345
- }
346
- }
347
- },
348
- getLableOptions(label) {
349
- for (const item of this.show_data.fields) {
350
- if (item.label === label) {
351
- return item.options
352
- }
353
- }
354
- },
355
- setLabelValue(label, value) {
356
- for (const item of this.show_data.fields) {
357
- if (item.label === label) {
358
- item.value = value
359
- this.show_data[item.field] = value
360
- }
361
- }
362
- },
363
- setLabelOptions(label, options) {
364
- for (const item of this.show_data.fields) {
365
- if (item.label === label) {
366
- item.options = options
367
- }
368
- }
369
- },
370
- showLabels(...labels) {
371
- for (const item of this.show_data.fields) {
372
- if (labels.includes(item.label)) {
373
- item.hidden = false
374
- }
375
- }
376
- },
377
- hideLabels(...labels) {
378
- for (const item of this.show_data.fields) {
379
- if (labels.includes(item.label)) {
380
- item.hidden = true
381
- }
382
- }
383
- },
384
- requiredLabels(...labels) {
385
- for (const item of this.show_data.fields) {
386
- if (labels.includes(item.label)) {
387
- item.required = true
388
- }
389
- }
390
- },
391
- electiveLabels(...labels) {
392
- for (const item of this.show_data.fields) {
393
- if (labels.includes(item.label)) {
394
- item.required = false
395
- }
396
- }
397
- },
398
- readonlyLabels(...labels) {
399
- for (const item of this.show_data.fields) {
400
- if (labels.includes(item.label)) {
401
- item.readonly = true
402
- item.disabled = true
403
- }
404
- }
405
- },
406
- readwriteLabels(...labels) {
407
- for (const item of this.show_data.fields) {
408
- if (labels.includes(item.label)) {
409
- item.readonly = false
410
- item.disabled = false
411
- }
412
- }
413
- },
414
- disabledButtons(...buttons) {
415
- for (const item of this.show_data.buttons) {
416
- if (buttons.includes(item.button_name)) {
417
- item.disabled = true
418
- }
419
- }
420
- },
421
- enableButtons(...buttons) {
422
- for (const item of this.show_data.buttons) {
423
- if (buttons.includes(item.button_name)) {
424
- item.disabled = false
425
- }
426
- }
427
- },
428
- showButtons(...buttons) {
429
- for (const item of this.show_data.buttons) {
430
- if (buttons.includes(item.button_name)) {
431
- item.hidden = false
432
- }
433
- }
434
- },
435
- hideButtons(...buttons) {
436
- for (const item of this.show_data.buttons) {
437
- if (buttons.includes(item.button_name)) {
438
- item.hidden = true
439
- }
440
- }
441
- },
442
- async checkDuplicate(index) {
443
- let http = new HttpResetClass()
444
- let data = {
445
- tablename: 't_apply',
446
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
447
- }
448
- let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
449
- resolveMsg: null,
450
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
451
- })
452
- if (res.data.length > 0) {
453
- this.show_data.fields[index].value = null
454
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
455
- }
456
- },
457
- // 获取片区
458
- async getSliceArea () {
459
- let data = {
460
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
461
- userid: this.$login.f.id
462
- }
463
-
464
- let http = new HttpResetClass()
465
- let res = await http.load(
466
- 'POST',
467
- `rs/search`,
468
- {data: data},
469
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
470
- )
471
-
472
- return res.data.map(item => {
473
- return {
474
- label: item.name,
475
- value: item.name
476
- }
477
- })
478
- },
479
- // 获取区县
480
- async getPcd () {
481
- let data = {
482
- tablename: 't_pcd',
483
- condition: `f_filialeid = '${this.$login.f.orgid}'`
484
- }
485
- let http = new HttpResetClass()
486
- let res = await http.load(
487
- 'POST',
488
- `rs/sql/apply_singleTable`,
489
- {data: data},
490
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
491
- )
492
-
493
- return res.data.map(item => {
494
- return {
495
- label: item.f_pcd,
496
- value: item.f_pcd
497
- }
498
- })
499
- },
500
- // 获取集收单位
501
- async getArea () {
502
- let data = {
503
- tablename: 't_area',
504
- condition: `f_filialeid = '${this.$login.f.orgid}'`
505
- }
506
- let http = new HttpResetClass()
507
- let res = await http.load(
508
- 'POST',
509
- `rs/sql/apply_singleTable`,
510
- {data: data},
511
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
512
- )
513
-
514
- return res.data.map(item => {
515
- return {
516
- label: item.f_residential_area,
517
- value: item.f_residential_area
518
- }
519
- })
520
- },
521
- async applyfore() {
522
- var num = await this.checkfile("申请表")
523
- if (num === 0) {
524
- this.$showAlert('请上传附件!!!', 'warning', 3000)
525
- throw null
526
- }
527
- },
528
- //商户报建在点火派单-检查是否导入用户
529
- async checkUser() {
530
- let http = new HttpResetClass()
531
- let data={
532
- condValue:[],
533
- condition:"1=1",
534
- data:{
535
- f_filialeid: this.$login.f.orgid,
536
- f_process_id: this.selectdata.f_process_id
537
- }
538
- }
539
- let res = await http.load('POST', 'rs/sql/getAddressAanUserinfo', {data: data}, {
540
- warnMsg: null,
541
- resolveMsg: null
542
- })
543
- if(res.data.length===0){
544
- this.$showAlert('请先导入用户信息!!!', 'warning', 3000)
545
- throw null
546
- }
547
- },
548
- //检查附件是否提交
549
- async checkfile(param) {
550
- let condition = `f_blobid= '${this.show_data.f_process_id}' and fusetype='${param}' `
551
- let http = new HttpResetClass()
552
- let data = {
553
- tablename: 't_files',
554
- condition: condition
555
- }
556
- let getFile = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
557
- warnMsg: null,
558
- resolveMsg: null
559
- })
560
- return getFile.data.length
561
- },
562
- // 缴费前置
563
- chargeBefore () {
564
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
565
- this.$showAlert('费用未结清!!!', 'warning', 3000)
566
- throw null
567
- }
568
- },
569
- // 施工前置 加表具后状态是待开通 提交后是正常 所以这里的判断条件需改正 (and uf.f_meter_classify is null and f_meternumber is null)
570
- async constructionBefore () {
571
- let http = new HttpResetClass()
572
- let data = {
573
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_meter_classify is null and f_meternumber is null`
574
- }
575
- let res = await http.load(
576
- 'POST',
577
- 'rs/sql/countApplyUserinfo',
578
- {data: data},
579
- {
580
- resolveMsg: null,
581
- rejectMsg: '安装明细查询失败!!!'
582
- })
583
- if (res.data[0].num > 0) {
584
- this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
585
- throw `还有${res.data[0].num}户未安装,无法提交`
586
- }
587
- },
588
- changePipeBuild () {
589
- if (this.selectdata.f_process_dep === '工程部') {
590
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
591
- }
592
- if (this.selectdata.f_process_dep === '运营部') {
593
- return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
594
- }
595
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
596
- },
597
- // async getDevInfo () {
598
- // let data = {
599
- // tablename: 't_dev_info',
600
- // condition: `f_orgid = '${this.$login.f.orgid}'`
601
- // }
602
- // let http = new HttpResetClass()
603
- // let res = await http.load(
604
- // 'POST',
605
- // `rs/sql/apply_singleTable`,
606
- // {data: data},
607
- // {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
608
- // )
609
- //
610
- // return res.data.map(item => {
611
- // return {
612
- // label: item.f_dev_name,
613
- // value: item.f_dev_name
614
- // }
615
- // })
616
- // },
617
- async getPrice (f_price_id) {
618
- console.log('=======================')
619
- console.log(f_price_id)
620
-
621
- let data = {
622
- condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
623
- }
624
- // if(this.Pricetype==='机表'){
625
- // data.condition=`sp.f_custom = '机表'`
626
- // }
627
- // if(this.Pricetype==='非机表'){
628
- // data.condition=`sp.f_custom = '非机表'`
629
- // }
630
-
631
- if (!isEmpty(f_price_id)) {
632
- data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
633
- }
634
- let http = new HttpResetClass()
635
- let res = await http.load(
636
- 'POST',
637
- `rs/sql/applyGetPrice`,
638
- {data: data},
639
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
640
- )
641
-
642
- let a= res.data.map(item => {
643
- return {
644
- label: item.f_price_name,
645
- value: item
646
- }
647
- })
648
- this.selectdata.fields.forEach(field => {
649
- if (field.label === '气价名称') {
650
- field.options = a}
651
- })
652
- return a
653
- },
654
- addressInitialization () {
655
- this.$getConfig(this, 'UserAddress')
656
-
657
- let f_address_type = this.show_data.f_address_type
658
-
659
- for (const item of this.show_data.fields) {
660
- if (f_address_type === '民用市区') {
661
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
662
- item.hidden = false
663
- item.required = true
664
- }
665
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
666
- item.hidden = false
667
- item.required = false
668
- }
669
- if (item.label === '地址') {
670
- item.readonly = true
671
- }
672
- }
673
- if (f_address_type === '民用乡镇') {
674
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
675
- item.hidden = false
676
- item.required = true
677
- }
678
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
679
- item.hidden = false
680
- item.required = false
681
- }
682
- if (item.label === '楼层') {
683
- item.hidden = true
684
- item.required = false
685
- }
686
- if (item.label === '地址') {
687
- item.readonly = true
688
- }
689
- }
690
- if (f_address_type === '特殊地址') {
691
- if (item.label === '区/县' || item.label === '街道/乡镇') {
692
- item.hidden = false
693
- item.required = true
694
- }
695
- if (item.label === '集收单位') {
696
- item.hidden = false
697
- if (this.show_data.f_apply_type === '工商户报建'){
698
- item.required = false
699
- } else {
700
- item.required = false
701
- }
702
-
703
- }
704
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
705
- item.hidden = true
706
- item.required = false
707
- }
708
- if (item.label === '地址') {
709
- item.readonly = false
710
- }
711
- }
712
-
713
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
714
- item.hidden = true
715
- }
716
- }
717
- },
718
- async streetChange () {
719
- if (isEmpty(this.show_data.f_street)) {
720
- return
721
- }
722
-
723
- let data = {
724
- tablename: 't_area',
725
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
726
- }
727
- let http = new HttpResetClass()
728
- let res = await http.load(
729
- 'POST',
730
- `rs/sql/apply_singleTable`,
731
- {data: data},
732
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
733
- )
734
-
735
- this.setLabelOptions('集收单位', res.data.map(item => {
736
- return {
737
- label: item.f_residential_area,
738
- value: item.f_residential_area
739
- }
740
- }))
741
- },
742
- async pcdChange () {
743
- if (isEmpty(this.show_data.f_pcd)) {
744
- return
745
- }
746
-
747
- let data = {
748
- tablename: 't_street',
749
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
750
- }
751
- let f_address_type = this.getLableValue('地址类型')
752
-
753
- if (f_address_type === '民用市区') {
754
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
755
- }
756
- if (f_address_type === '民用乡镇') {
757
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
758
- }
759
-
760
- let http = new HttpResetClass()
761
- let res = await http.load(
762
- 'POST',
763
- `rs/sql/apply_singleTable`,
764
- {data: data},
765
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
766
- )
767
-
768
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
769
- return {
770
- label: item.f_street,
771
- value: item.f_street
772
- }
773
- }))
774
- },
775
- async addressTips () {
776
- // console.log('======================='+this.show_data.f_apply_type)
777
- let res = ''
778
- if (this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') {
779
- res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
780
- }else{
781
- res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
782
- }
783
- if (res == 'confirm') {
784
- return
785
- }
786
- throw '用户信息确认!!!'
787
- },
788
- async getDesignerPeople () {
789
- let data = {
790
- source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
791
- userid: this.$login.f.id
792
- }
793
-
794
- let http = new HttpResetClass()
795
- let res = await http.load(
796
- 'POST',
797
- `rs/search`,
798
- {data: data},
799
- {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
800
- )
801
-
802
- return res.data.map(item => {
803
- return {
804
- label: item.name,
805
- value: item.id
806
- }
807
- })
808
- },
809
- async surveyStopApply () {
810
- console.log('终止报建!!!!!')
811
-
812
- this.show_data.f_stop_reason = '现场勘察不符合报装条件'
813
-
814
- let data = {
815
- data: this.show_data,
816
- user: this.$login.f
817
- }
818
-
819
- let res = await this.$resetpost(
820
- `rs/logic/surveyStopApply`,
821
- {data: data},
822
- {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
823
- )
824
-
825
- this.$dispatch('loadPage')
826
-
827
- throw '终止报建!!!'
828
- },
829
- async contract_number() {
830
- console.log("进入编号合同编号生成",this.$login.f.orgs)
831
- let f_contract_number = ''
832
- const nowDate = new Date();
833
- const date = {
834
- year: nowDate.getFullYear(),
835
- month: nowDate.getMonth() + 1,
836
- day: nowDate.getDate()
837
- }
838
-
839
- function upperCaseChars(dir) {
840
- let string = '';
841
- switch (dir){
842
- case '周口市天然气有限公司':
843
- string = 'ZK' // 当表达式的结果等于 房产 时,则执行该代码
844
- break;
845
- case '项城市天然气有限公司':
846
- string = "XC" // 当表达式的结果等于 自建房 时,则执行该代码
847
- break;
848
- case '西华县天然气有限公司':
849
- string = 'XH' // 当表达式的结果等于 商业 时,则执行该代码
850
- break;
851
- case '鹿邑县天然气有限公司':
852
- string = 'LY' // 当表达式的结果等于 工业 时,则执行该代码
853
- break;
854
- case '郸城县天然气有限公司':
855
- string = 'DC' // 当表达式的结果等于 中压 时,则执行该代码
856
- break;
857
- case '测试公司(一)':
858
- string = 'CS' // 当表达式的结果等于 中压 时,则执行该代码
859
- break;
860
- case '甘泉县丰源天然气有限责任公司':
861
- string = 'GQ' // 当表达式的结果等于 中压 时,则执行该代码
862
- break;
863
- default : 'HT'
864
- break; // 如果没有与表达式相同的公司,则执行该代码
865
- }
866
- return string;
867
- }
868
-
869
- const dir = upperCaseChars(this.$login.f.orgs) //分公司
870
-
871
- let type = 0 //类型
872
-
873
- switch (this.show_data.f_entry_type){
874
- case '城区/县城':
875
- type = 1 // 当表达式的结果等于 城区 时,则执行该代码
876
- break;
877
- case '新农村':
878
- type = 2 // 当表达式的结果等于 新农村 时,则执行该代码
879
- break;
880
- case '测试':
881
- type = 3 // 当表达式的结果等于 新农村 时,则执行该代码
882
- break;
883
- default :
884
- break; // 如果没有与表达式相同的值,则执行该代码
885
- }
886
-
887
- let nature = 0 // 性质
888
- switch (this.show_data.f_apply_nature){
889
- case '楼房':
890
- nature = 1 // 当表达式的结果等于 楼房 时,则执行该代码
891
- break;
892
- case '房产':
893
- nature = 1 // 当表达式的结果等于 房产 时,则执行该代码
894
- break;
895
- case '自建房':
896
- nature = 2 // 当表达式的结果等于 自建房 时,则执行该代码
897
- break;
898
- case '商业':
899
- nature = 3 // 当表达式的结果等于 商业 时,则执行该代码
900
- break;
901
- case '学校':
902
- nature = 3 // 当表达式的结果等于 学校 时,则执行该代码
903
- break;
904
- case '福利机构':
905
- nature = 3 // 当表达式的结果等于 福利机构 时,则执行该代码
906
- break;
907
- case '其他':
908
- nature = 3 // 当表达式的结果等于 其他 时,则执行该代码
909
- break;
910
- case '工业':
911
- nature = 4 // 当表达式的结果等于 工业 时,则执行该代码
912
- break;
913
- case '中压':
914
- nature = 5 // 当表达式的结果等于 中压 时,则执行该代码
915
- break;
916
- case '测试':
917
- nature = 6 // 当表达式的结果等于 中压 时,则执行该代码
918
- break;
919
- default :
920
- break; // 如果没有与表达式相同的值,则执行该代码
921
- }
922
-
923
- const newMonth = date.month >= 10 ? date.month : '0' + date.month //月份
924
- const dataYm = date.year + '-01-01'
925
- const newYear = date.year + 1
926
- const year = date.year.toString().substring(2,4) //年份
927
-
928
- let data = {
929
- orgid: this.$login.f.orgid
930
- }
931
-
932
- let http = new HttpResetClass()
933
- let res = await http.load('POST', 'rs/sql/contractCount', {data:data}, {
934
- resolveMsg: null,
935
- rejectMsg: null
936
- })
937
- let oldDate
938
- for (const item of res.data) {
939
- if (item.name === '合同编号最后更新日期'){
940
- oldDate = item.value
941
- }
942
- }
943
- for (const item of res.data){
944
- if (item.name === '合同编号'){
945
- if (item.value === 0 || Date.parse(oldDate) < Date.parse(dataYm)) {
946
- f_contract_number = dir + type + nature + year + newMonth + '001'
947
- console.log("触发if", f_contract_number)
948
- } else {
949
- let count = item.value
950
- f_contract_number = dir + type + nature + year + newMonth + this.PrefixInteger(count, 3)
951
- console.log("触发else", f_contract_number)
952
- }
953
- }
954
- }
955
- this.selectdata.f_contract_number = f_contract_number
956
- this.show_data.f_contract_number = f_contract_number
957
- return f_contract_number
958
- },
959
- PrefixInteger(num, n) {
960
- return (Array(n).join(0) + num).slice(-n);
961
- },
962
- // 单价失去焦点
963
- async priceSum () {
964
- if (isEmpty(this.show_data.f_price)) {
965
- return
966
- }
967
- let data = {
968
- operator: '乘',
969
- num1: this.show_data.f_price,
970
- num2: this.show_data.f_install_count
971
- }
972
- let http = new HttpResetClass()
973
- let res = await http.load(
974
- 'POST',
975
- `rs/logic/compute`,
976
- {data: data},
977
- {resolveMsg: null, rejectMsg: '工程材料费计算失败!!!'}
978
- )
979
-
980
- this.setLabelValue('工程材料费', res.data)
981
- },
982
- },
983
- events: {
984
- 'priceType'(index){
985
- this.Pricetype = this.getLableValue('所属类型')
986
- console.log('打印方法值',this.getPrice(this.show_data.f_price_id))
987
- for (const item of this.show_data.fields) {
988
- if (this.show_data.f_sprice_type !=null && this.show_data.f_sprice_type !='') {
989
- if(item.label==='气价名称'){
990
- this.getPrice().then(value =>{
991
- item.options=value
992
- })
993
- console.log('最终',item.options)
994
- }
995
- }
996
- }
997
- },
998
- 'complyInstallation' (index) {
999
- if (this.show_data.f_is_have === '否') {
1000
- this.hideButtons('提交', '出图', '缴费')
1001
- this.showButtons('终止')
1002
- }
1003
- if (this.show_data.f_is_have === '是') {
1004
- this.hideButtons('终止')
1005
- this.showButtons('提交', '出图', '缴费')
1006
- }
1007
- },
1008
- async 'igniteDispatchReadyEvent' () {
1009
- let data = {
1010
- tablename: 'activityins',
1011
- condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
1012
- }
1013
- let http = new HttpResetClass()
1014
- let res = await http.load(
1015
- 'POST',
1016
- `rs/sql/apply_singleTable`,
1017
- {data: data},
1018
- {resolveMsg: null, rejectMsg: '查询失败!!!'}
1019
- )
1020
- if (res.data.length <= 0) {
1021
- console.log('+++++++++++++++++++++++++++++')
1022
- console.log('没有施工,不能退回')
1023
- this.hideButtons('退回')
1024
- }
1025
- },
1026
- 'buildReadyEvent' () {
1027
- this.setLabelValue('施工单位', this.$login.f.name)
1028
- this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
1029
- },
1030
- // 选择材料
1031
- async materialNameChenge (index, fieldIndex) {
1032
- let material = this.show_data.onetomany[index].fields[fieldIndex].value
1033
-
1034
- this.show_data.onetomany[index].fields.forEach(item => {
1035
- if (material[item.field]) {
1036
- item.value = material[item.field]
1037
- }
1038
- })
1039
- },
1040
- // 打开模态框获取材料
1041
- async 'getMaterialName' (index) {
1042
- let data = {
1043
- condition: `1=1`
1044
- }
1045
- let http = new HttpResetClass()
1046
- let res = await http.load(
1047
- 'POST',
1048
- `rs/sql/getStockMaterial`,
1049
- {data: data},
1050
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
1051
- )
1052
-
1053
- this.show_data.onetomany[index].fields.forEach(field => {
1054
- if (field.label === '选择材料') {
1055
- field.options = res.data.map(item => {
1056
- return {
1057
- 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
1058
- 'value': item
1059
- }
1060
- })
1061
- }
1062
- })
1063
- },
1064
- // 搜索小区
1065
- async 'searchArea' (area, index) {
1066
- let data = {
1067
- tablename: 't_area',
1068
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1069
- }
1070
- let http = new HttpResetClass()
1071
- let res = await http.load(
1072
- 'POST',
1073
- `rs/sql/apply_singleTable`,
1074
- {data: data},
1075
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1076
- )
1077
-
1078
- if (res.data.length === 0) {
1079
- return
1080
- }
1081
-
1082
- this.setLabelOptions('集收单位', res.data.map(item => {
1083
- return {
1084
- label: item.f_residential_area,
1085
- value: item.f_residential_area
1086
- }
1087
- }))
1088
- },
1089
- // 搜索小区
1090
- async 'searchAreaCollective' (area, index) {
1091
- let data = {
1092
- tablename: 't_area',
1093
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${area}%'`
1094
- }
1095
- let http = new HttpResetClass()
1096
- let res = await http.load(
1097
- 'POST',
1098
- `rs/sql/apply_singleTable`,
1099
- {data: data},
1100
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1101
- )
1102
-
1103
- if (res.data.length === 0) {
1104
- return
1105
- }
1106
-
1107
- this.setLabelOptions('集收单位', res.data.map(item => {
1108
- return {
1109
- label: item.f_residential_area,
1110
- value: item.f_residential_area
1111
- }
1112
- }))
1113
- },
1114
- // 选择气价
1115
- 'priceChange' (index) {
1116
- if (isEmpty(this.show_data.stairPrice)) {
1117
- return
1118
- }
1119
-
1120
- let stairPrice = this.getLableValue('气价名称')
1121
-
1122
- this.setLabelValue('气价类型', stairPrice.f_price_type)
1123
- this.setLabelValue('用气性质', stairPrice.f_gasproperties)
1124
- this.setLabelValue('价格', stairPrice.f_price)
1125
- this.setLabelValue('客户类型', stairPrice.f_user_type)
1126
- this.show_data.f_price_id = stairPrice.id
1127
- this.show_data.f_price_name = stairPrice.f_price_name
1128
- },
1129
- // 选择开发商
1130
- // async 'devInfoChange' (index) {
1131
- // if (isEmpty(this.show_data.f_company_name)) {
1132
- // return
1133
- // }
1134
- // let data = {
1135
- // tablename: 't_dev_info',
1136
- // condition: `f_orgid = '${this.$login.f.orgid}' and f_dev_name = '${this.show_data.f_company_name}'`
1137
- // }
1138
- // let res = await this.$resetpost(
1139
- // `rs/sql/apply_singleTable`,
1140
- // {data: data},
1141
- // {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
1142
- // )
1143
- // this.show_data.f_dev_id = res.data[0].id
1144
- // this.show_data.f_dev_code = res.data[0].f_dev_code
1145
- // this.setLabelValue('法人名称', res.data[0].f_legal_person)
1146
- // this.setLabelValue('身份证', res.data[0].f_idnumber)
1147
- // this.setLabelValue('营业执照', res.data[0].f_license_num)
1148
- // },
1149
- // 退款金额
1150
- 'refundMoneyChange' (index) {
1151
- let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
1152
- let f_refund_money = this.show_data.fields[index].value
1153
-
1154
- if (f_refund_money > f_cumulative_payment_money) {
1155
- this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
1156
- this.show_data.fields[index].value = null
1157
- }
1158
- },
1159
- // 检查重复
1160
- 'checkRepeat' (index) {
1161
- this.checkDuplicate(index)
1162
- },
1163
- // 选择报建项目
1164
- 'selectApply' (row) {
1165
- this.setLabelValue('工程名称', row.f_entry_name)
1166
- this.setLabelValue('工程编号', row.f_apply_num)
1167
- this.setLabelValue('报建类型', row.f_apply_type)
1168
- this.setLabelValue('用户名称', row.f_user_name)
1169
- this.setLabelValue('用户电话', row.f_phone)
1170
- this.setLabelValue('证件类型', row.f_credentials)
1171
- this.setLabelValue('证件号码', row.f_idnumber)
1172
- this.setLabelValue('地址', row.f_address)
1173
- this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
1174
-
1175
- this.show_data.parentApply = JSON.parse(JSON.stringify(row))
1176
-
1177
- delete row.id
1178
- delete row.actid
1179
- delete row.defid
1180
- delete row.defname
1181
- delete row.version
1182
- delete row.f_apply_num
1183
- delete row.f_sub_state
1184
- delete row.f_apply_type
1185
- delete row.f_process_id
1186
-
1187
- this.show_data = Object.assign({}, this.show_data, row)
1188
-
1189
- this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
1190
- },
1191
- // 是否终止
1192
- 'isStopChange' (index) {
1193
- let f_is_stop = this.show_data.f_is_stop
1194
-
1195
- for (const item of this.show_data.fields) {
1196
- if (f_is_stop === '是') {
1197
- if (item.label === '终止原因') {
1198
- item.hidden = false
1199
- item.required = true
1200
- }
1201
- } else {
1202
- if (item.label === '终止原因') {
1203
- item.hidden = true
1204
- item.required = false
1205
- }
1206
- }
1207
- }
1208
- },
1209
- // 终止报建初始化
1210
- async 'stopApplyReadyEvent' () {
1211
-
1212
- let f_is_stop = this.getLableValue('是否终止')
1213
-
1214
- for (const item of this.show_data.fields) {
1215
- if (f_is_stop === '是') {
1216
- if (item.label === '终止原因') {
1217
- item.hidden = false
1218
- item.required = true
1219
- }
1220
- } else {
1221
- if (item.label === '终止原因') {
1222
- item.hidden = true
1223
- item.required = false
1224
- }
1225
- }
1226
- }
1227
-
1228
- if (isEmpty(this.show_data.f_parent_process_id)) {
1229
- return
1230
- }
1231
- let data = {
1232
- condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
1233
- data: {
1234
- id: this.$login.f.id,
1235
- orgid: this.$login.f.orgid
1236
- }
1237
- }
1238
- let res = await this.$resetpost(
1239
- `rs/sql/supervisory`,
1240
- {data: data},
1241
- {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
1242
- )
1243
- this.show_data.parentApply = res.data[0]
1244
- },
1245
- // 选择用户档案信息
1246
- 'selectUserinfo' (row) {
1247
- this.setLabelValue('用户编号', row.f_userinfo_code)
1248
- this.setLabelValue('用户名称', row.f_user_name)
1249
- this.setLabelValue('用户电话', row.f_user_phone)
1250
- this.setLabelValue('证件类型', row.f_credentials)
1251
- this.setLabelValue('证件号码', row.f_idnumber)
1252
- this.setLabelValue('地址', row.f_address)
1253
-
1254
- this.show_data.f_userinfo_id = row.f_userinfo_id
1255
- this.show_data.f_userinfo_code = row.f_userinfo_code
1256
- },
1257
- // 是否购买保险
1258
- async 'isInsureChange' (index) {
1259
- if (!this.show_data.f_is_insure) {
1260
- return
1261
- }
1262
- let f_is_insure = this.show_data.f_is_insure
1263
- for (const item of this.show_data.fields) {
1264
- if (f_is_insure === '是') {
1265
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1266
- item.hidden = false
1267
- item.required = true
1268
- }
1269
- if (item.label === '保险备注') {
1270
- item.hidden = false
1271
- }
1272
- } else {
1273
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1274
- item.hidden = true
1275
- item.required = false
1276
- }
1277
- }
1278
- }
1279
- },
1280
- // 通气点火初始化
1281
- async 'gasReadyEvent' () {
1282
- // 是否有气价信息
1283
- if (!isEmpty(this.show_data.f_price_id)) {
1284
- let priceList = await this.getPrice(this.show_data.f_price_id)
1285
- this.setLabelValue('气价名称', priceList[0].value)
1286
- }
1287
-
1288
- let data = {
1289
- tablename: 't_userfees',
1290
- condition: `f_orgid = '${this.$login.f.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
1291
- }
1292
- let http = new HttpResetClass()
1293
- let res = await http.load(
1294
- 'POST',
1295
- `rs/sql/apply_singleTable`,
1296
- {data: data},
1297
- {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
1298
- )
1299
- if (res.data.length > 0) {
1300
- this.setLabelValue('待执行保险', '是')
1301
- for (const item of this.show_data.fields) {
1302
- if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1303
- item.hidden = true
1304
- item.required = false
1305
- item.value = null
1306
- }
1307
- }
1308
- } else {
1309
- this.setLabelValue('待执行保险', '否')
1310
- for (const item of this.show_data.fields) {
1311
- if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1312
- item.hidden = false
1313
- item.required = true
1314
- }
1315
- }
1316
- }
1317
-
1318
- // 保险初始化显示内容
1319
- let f_is_insure = this.getLableValue('是否购买保险')
1320
- for (const item of this.show_data.fields) {
1321
- if (f_is_insure === '是') {
1322
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1323
- item.hidden = false
1324
- item.required = true
1325
- }
1326
- if (item.label === '保险备注') {
1327
- item.hidden = false
1328
- }
1329
- // 本期保费到期时间默认一年
1330
- if (isEmpty(this.selectdata.f_ins_expiration_date)) {
1331
- let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
1332
- this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
1333
- }
1334
- }
1335
- if (f_is_insure === '否') {
1336
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1337
- item.hidden = true
1338
- item.required = false
1339
- }
1340
- }
1341
- }
1342
- },
1343
- // 合同金额失去焦点
1344
- async 'contractMoneyChange' (index) {
1345
- let data = {
1346
- operator: '加',
1347
- num1: this.show_data.f_contract_money || 0,
1348
- num2: this.getLableValue('追加金额') || 0
1349
- }
1350
- let res = await this.$resetpost(
1351
- `rs/logic/compute`,
1352
- {data: data},
1353
- {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1354
- )
1355
-
1356
- this.setLabelValue('应交金额', res.data)
1357
- },
1358
- // 街道失去焦点
1359
- async 'streetChange' (index) {
1360
- if (isEmpty(this.show_data.f_street)) {
1361
- return
1362
- }
1363
-
1364
- this.setLabelValue('集收单位', null)
1365
-
1366
- let data = {
1367
- tablename: 't_area',
1368
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1369
- }
1370
- let http = new HttpResetClass()
1371
- let res = await http.load(
1372
- 'POST',
1373
- `rs/sql/apply_singleTable`,
1374
- {data: data},
1375
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1376
- )
1377
-
1378
- this.setLabelOptions('集收单位', res.data.map(item => {
1379
- return {
1380
- label: item.f_residential_area,
1381
- value: item.f_residential_area
1382
- }
1383
- }))
1384
- },
1385
- // 区县失去焦点
1386
- async 'pcdChange' (index) {
1387
- if (isEmpty(this.show_data.f_pcd)) {
1388
- return
1389
- }
1390
-
1391
- this.setLabelValue('街道/乡镇', null)
1392
- this.setLabelValue('集收单位', null)
1393
-
1394
-
1395
-
1396
- let data = {
1397
- tablename: 't_street',
1398
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1399
- }
1400
- let f_address_type = this.getLableValue('地址类型')
1401
-
1402
- if (f_address_type === '民用市区') {
1403
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1404
- }
1405
- if (f_address_type === '民用乡镇') {
1406
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1407
- }
1408
-
1409
- let http = new HttpResetClass()
1410
- let res = await http.load(
1411
- 'POST',
1412
- `rs/sql/apply_singleTable`,
1413
- {data: data},
1414
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1415
- )
1416
-
1417
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
1418
- return {
1419
- label: item.f_street,
1420
- value: item.f_street
1421
- }
1422
- }))
1423
- },
1424
- // 地址类型失去焦点
1425
- 'addressTypeChange' (index) {
1426
- this.setLabelValue('街道/乡镇', null)
1427
- this.setLabelValue('集收单位', null)
1428
- let f_address_type = this.show_data.fields[index].value
1429
- for (const item of this.show_data.fields) {
1430
- if (f_address_type === '民用市区') {
1431
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1432
- item.hidden = false
1433
- item.required = true
1434
- item.value = null
1435
- }
1436
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1437
- item.hidden = false
1438
- item.required = false
1439
- item.value = null
1440
- }
1441
- if (item.label === '地址') {
1442
- item.readonly = true
1443
- item.value = null
1444
- }
1445
- }
1446
- if (f_address_type === '民用乡镇') {
1447
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1448
- item.hidden = false
1449
- item.required = true
1450
- item.value = null
1451
- }
1452
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1453
- item.hidden = false
1454
- item.required = false
1455
- item.value = null
1456
- }
1457
- if (item.label === '楼层') {
1458
- item.hidden = true
1459
- item.required = false
1460
- item.value = null
1461
- }
1462
- if (item.label === '地址') {
1463
- item.readonly = true
1464
- item.value = null
1465
- }
1466
- }
1467
- if (f_address_type === '特殊地址') {
1468
- if (item.label === '区/县' || item.label === '街道/乡镇') {
1469
- item.hidden = false
1470
- item.required = true
1471
- item.value = null
1472
- }
1473
- if (item.label === '集收单位') {
1474
- item.hidden = false
1475
- item.required = false
1476
- item.value = null
1477
- }
1478
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1479
- item.hidden = true
1480
- item.required = false
1481
- item.value = null
1482
- }
1483
- if (item.label === '地址') {
1484
- item.readonly = false
1485
- item.value = null
1486
- }
1487
- }
1488
- }
1489
- },
1490
- // 团购转散户初始化
1491
- 'apply2ReadyEvent' () {
1492
- if (this.show_data.f_apply_source === '线下发起') {
1493
- this.addressInitialization()
1494
- this.hideLabels('用户编号')
1495
- this.electiveLabels('用户编号')
1496
- this.showLabels('片区', '地址类型')
1497
- this.requiredLabels('片区', '地址类型')
1498
- }
1499
- if (this.show_data.f_apply_source === '自动发起') {
1500
- this.hideLabels('片区', '地址类型')
1501
- this.electiveLabels('片区', '地址类型',)
1502
- }
1503
- },
1504
- // 申请节点初始化
1505
- 'applyReadyEvent' () {
1506
- this.addressInitialization()
1507
- this.pcdChange()
1508
- this.streetChange()
1509
- },
1510
- // ===========================================
1511
- async 'button'() {
1512
- if (this.show_data.button.before) {
1513
- if (Array.isArray(this.show_data.button.before)) {
1514
- for (let i = 0; i < this.show_data.button.before.length; i++) {
1515
- await this[this.show_data.button.before[i]]()
1516
- }
1517
- } else {
1518
- await this[this.show_data.button.before]();
1519
- }
1520
- }
1521
- // 点击重置按钮就重置数据
1522
- if (this.show_data.button.button_name === '重置') {
1523
- this.$dispatch('breakControl', this.selectdata)
1524
- return
1525
- }
1526
-
1527
- this.show_data.user = this.$login.f
1528
- this.show_data.start_activity = this.$workflow_vue.start_activity
1529
- this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1530
-
1531
- if ((this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') && this.show_data.defname === '工程施工' && this.show_data.f_sub_state !='完工' && this.show_data.button.button_name === '完工'){
1532
- //判断是否添加报警器材料
1533
- let bjqlag = false
1534
- let datatemp = {
1535
- 'bjqid':"",
1536
- 'fprocessid':"",
1537
- 'sqvalue':"",
1538
- 'f_bjq_sid':"",
1539
- 'f_material_code':"",
1540
- 'f_bjq_baidu_lng':"",
1541
- 'f_bjq_baidu_lat':"",
1542
- 'f_bjq_gaode_lng':"",
1543
- 'f_bjq_gaode_lat':""
1544
- }
1545
-
1546
- let bjqststedata = {
1547
- "sid":"",
1548
- "bjqtype":"",
1549
- "f_process_id":"",
1550
- "bjqstate":"",
1551
- "f_userinfo_code":""
1552
- }
1553
- let numOne = [];
1554
-
1555
- let http = new HttpResetClass()
1556
- let data = {
1557
- tablename: `t_material_apply`,
1558
- condition: `f_process_id='${this.show_data.f_process_id}'`
1559
- }
1560
- let res = await http.load(
1561
- 'POST',
1562
- `rs/sql/apply_singleTable`,
1563
- {data: data},
1564
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
1565
- )
1566
- res.data.forEach(item => {
1567
- if (item.f_material_name.substr(0,3) === '报警器'){
1568
- var bjname = item.f_material_name.split("-")
1569
- bjqststedata.sid = item.f_bjq_sid
1570
- bjqststedata.f_process_id = item.f_process_id
1571
- bjqststedata.bjqtype = bjname[1]
1572
- //====================================
1573
- bjqlag = true
1574
- datatemp.bjqid = item.id
1575
- datatemp.fprocessid = item.f_process_id
1576
- datatemp.f_bjq_sid = item.f_bjq_sid
1577
- datatemp.f_material_code = item.f_material_code
1578
- datatemp.f_bjq_lng = item.f_bjq_lng
1579
- datatemp.f_bjq_lat = item.f_bjq_lat
1580
- datatemp.f_bjq_gaode_lng = item.f_bjq_gaode_lng
1581
- datatemp.f_bjq_gaode_lat = item.f_bjq_gaode_lng
1582
- datatemp.f_bjq_baidu_lng = item.f_bjq_baidu_lng
1583
- datatemp.f_bjq_baidu_lat = item.f_bjq_baidu_lat
1584
- numOne.push(item.f_bjq_sid)
1585
- }
1586
- })
1587
-
1588
- // this.show_data.onetomany.forEach(item=>{
1589
- // console.log("查看报警器材料",item)
1590
- // item.rows.forEach(i=>{
1591
- // if (i.f_material_name.substr(0,3) === '报警器'){
1592
- // var bjname = i.f_material_name.split("-")
1593
- // bjqststedata.sid = i.f_bjq_sid
1594
- // bjqststedata.f_process_id = i.f_process_id
1595
- // bjqststedata.bjqtype = bjname[1]
1596
- // //====================================
1597
- // bjqlag = true
1598
- // datatemp.bjqid = i.id
1599
- // datatemp.fprocessid = i.f_process_id
1600
- // datatemp.f_bjq_sid = i.f_bjq_sid
1601
- // datatemp.f_material_code = i.f_material_code
1602
- // numOne.push(i.f_bjq_sid)
1603
- // }
1604
- // })
1605
- // })
1606
- if (!bjqlag){
1607
- this.$showMessage('请添加报警器物料信息!!!')
1608
- return
1609
- }
1610
- if (numOne.length > 1){
1611
- this.$showMessage("暂时支持单个报警器物料安装!!!")
1612
- return
1613
- }
1614
- datatemp.sqvalue = this.show_data.areaData.sqvalue
1615
- datatemp.f_bjq_baidu_lng = this.show_data.templatlng.baidutemplng
1616
- datatemp.f_bjq_baidu_lat = this.show_data.templatlng.baidutemplat
1617
- datatemp.f_bjq_gaode_lng = this.show_data.templatlng.gaodetemplng
1618
- datatemp.f_bjq_gaode_lat = this.show_data.templatlng.gaodetemplat
1619
- datatemp.f_bjq_lng = this.show_data.templatlng.baidutemplng
1620
- datatemp.f_bjq_lat = this.show_data.templatlng.baidutemplat
1621
-
1622
- bjqststedata.f_userinfo_code = this.show_data.f_userinfo_code
1623
-
1624
- //判断是否推送 及推送的状态
1625
- //查询是否存在, 以型号及厂家判断
1626
- let bjqres = await this.$resetpost(
1627
- `rs/logic/getbjqsyncinfo`,
1628
- bjqststedata
1629
- )
1630
- if (bjqres.data.bjqstate != "成功"){
1631
- //区域地址存入材料记录表
1632
- let areares = await this.$resetpost(
1633
- `rs/logic/saveArea`,
1634
- {data: datatemp},
1635
- {resolveMsg: null, rejectMsg: '区域地址保存失败'}
1636
- )
1637
-
1638
- //完工之后推送数据到汉威
1639
- let adddata = {
1640
- f_bjq_sid : datatemp.f_bjq_sid,
1641
- f_material_code : datatemp.f_material_code,
1642
- f_bjq_address: this.show_data.areaData.sqvalue,
1643
- f_user_name: this.show_data.f_user_name,
1644
- f_address: this.show_data.f_address,
1645
- f_user_phone: this.show_data.f_phone,
1646
- f_userinfo_code: this.show_data.f_userinfo_code,
1647
- installtime: this.show_data.f_construction_date,
1648
- f_orgid : this.show_data.f_orgid,
1649
- f_bjq_lng: datatemp.f_bjq_baidu_lng,
1650
- f_bjq_lat: datatemp.f_bjq_baidu_lat
1651
- }
1652
- let res = await this.$resetpost(
1653
- `ncc/rs/logic/bjqadduser`,
1654
- // `rs/logic/bjqadduser`,
1655
- adddata
1656
- )
1657
- if (res.data.code != 200){
1658
- if (bjqres.data.bjqstate.length == 0){
1659
- bjqststedata.bjqstate = "失败"
1660
- let bjqres3 = await this.$resetpost(
1661
- `rs/logic/addbjqsyncinfo`,
1662
- bjqststedata
1663
- )
1664
- }
1665
- this.$showMessage(res.data.msg)
1666
- return
1667
- }
1668
- //更改记录表状态
1669
- if (bjqres.data.bjqstate === "失败"){
1670
- bjqststedata.bjqstate = "成功"
1671
- let bjqres1 = await this.$resetpost(
1672
- `rs/logic/updatebjqsyncinfo`,
1673
- bjqststedata
1674
- )
1675
- }else{
1676
- bjqststedata.bjqstate = "成功"
1677
- let bjqres2 = await this.$resetpost(
1678
- `rs/logic/addbjqsyncinfo`,
1679
- bjqststedata
1680
- )
1681
- }
1682
- }
1683
- }
1684
- if ((this.show_data.f_apply_type === '工商户报建' || this.show_data.f_apply_type === '团购报建')
1685
- && (this.show_data.defname === '报装申请') && this.show_data.button.button_name === '提交'){
1686
- await this.contract_number()
1687
- }
1688
- // if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && (this.show_data.button.button_name === '保存'||this.show_data.button.button_name === '提交')){
1689
- // let dataz = {
1690
- // condition: `u.id = ${this.show_data.id}`,
1691
- // data: {
1692
- // id: this.$login.f.id,
1693
- // orgid: this.$login.f.orgid
1694
- // }
1695
- // }
1696
- // let http = new HttpResetClass()
1697
- // let restpz = await http.load(
1698
- // 'POST',
1699
- // `rs/sql/checkuser`,
1700
- // {data: dataz},
1701
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1702
- // )
1703
- // this.show_data.actid=restpz.data[0].actid
1704
- // }
1705
- let res = await this.$resetpost(
1706
- `rs/logic/ApplyProductService`,
1707
- {data: this.show_data},
1708
- {resolveMsg: null, rejectMsg: '数据保存失败'}
1709
- )
1710
-
1711
-
1712
- if (this.show_data.button.after) {
1713
- this[this.show_data.button.after]()
1714
- }
1715
- // // 改管报建 增容报建 优化
1716
- // if((this.show_data.f_apply_type === '改管报建'||this.show_data.f_apply_type === '增容报建') && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '缴费'){
1717
- // let datagg = {
1718
- // condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1719
- // }
1720
- // let http = new HttpResetClass()
1721
- // let restgg = await http.load(
1722
- // 'POST',
1723
- // `rs/sql/checkusertwo`,
1724
- // {data: datagg},
1725
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1726
- // )
1727
- // debugger
1728
- // if(this.show_data.f_apply_type === '改管报建'){
1729
- // restgg.data[0].processname = '改管报建流程'
1730
- // restgg.data[0].defname = '报装缴费'
1731
- // }else{
1732
- // restgg.data[0].processname = '增容报建流程'
1733
- // restgg.data[0].defname = '报装缴费'
1734
- // }
1735
- // restgg.data[0].actid = restgg.data[0].actid + 1
1736
- // this.$dispatch('apply',restgg.data[0])
1737
- //
1738
- // }
1739
- //
1740
- // // 退款报建 优化
1741
- // if(this.show_data.f_apply_type === '退款报建' && this.show_data.defname === '终止报建' && this.show_data.button.button_name === '提交'){
1742
- // let datatk = {
1743
- // condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1744
- // }
1745
- // let http = new HttpResetClass()
1746
- // let resttk = await http.load(
1747
- // 'POST',
1748
- // `rs/sql/checkusertwo`,
1749
- // {data: datatk},
1750
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1751
- // )
1752
- // debugger
1753
- // resttk.data[0].processname = '退款报建流程'
1754
- // resttk.data[0].defname = '退款'
1755
- // this.$dispatch('apply',resttk.data[0])
1756
- //
1757
- // }
1758
- //
1759
- //
1760
- // if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '合同'){
1761
- // let data = {
1762
- // tablename: 't_apply',
1763
- // condition: `f_process_id='${this.show_data.f_process_id}'`
1764
- // }
1765
- // let http = new HttpResetClass()
1766
- // let restp = await http.load(
1767
- // 'POST',
1768
- // `rs/sql/apply_singleTable`,
1769
- // {data: data},
1770
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1771
- // )
1772
- // debugger
1773
- // restp.data[0].processname = '散户报建流程'
1774
- // restp.data[0].defname = '合同签订'
1775
- // this.$dispatch('apply',restp.data[0])
1776
- //
1777
- // } else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && this.show_data.button.button_name === '提交'){
1778
- // let data2 = {
1779
- // condition: `u.id = ${this.show_data.id}`,
1780
- // data: {
1781
- // id: this.$login.f.id,
1782
- // orgid: this.$login.f.orgid
1783
- // }
1784
- // }
1785
- // let http = new HttpResetClass()
1786
- // let restp1 = await http.load(
1787
- // 'POST',
1788
- // `rs/sql/checkuser`,
1789
- // {data: data2},
1790
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1791
- // )
1792
- // debugger
1793
- // console.log('有没有发请求打印查询的内容restp1',restp1)
1794
- // // restp1.data[0].processname = '散户报建流程'
1795
- // // restp1.data[0].defname = '报装缴费'
1796
- // this.$dispatch('apply',restp1.data[0])
1797
- // }else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装缴费' && this.show_data.button.button_name === '提交'){
1798
- // let data3 = {
1799
- // condition: `u.id = ${this.show_data.id}`,
1800
- // data: {
1801
- // id: this.$login.f.id,
1802
- // orgid: this.$login.f.orgid
1803
- // }
1804
- // }
1805
- // let http = new HttpResetClass()
1806
- // let restp2 = await http.load(
1807
- // 'POST',
1808
- // `rs/sql/checkuser`,
1809
- // {data: data3},
1810
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1811
- // )
1812
- // debugger
1813
- // console.log('打印查询的内容',restp2)
1814
- // if(restp2.length>0){
1815
- // this.$dispatch('apply',restp2.data[0])
1816
- // }else{
1817
- // debugger
1818
- // this.$dispatch('loadPage')
1819
- // }
1820
- // }
1821
- // else{
1822
- // this.$dispatch('loadPage')
1823
- // }
1824
- this.$dispatch('loadPage')
1825
- },
1826
- // 失去焦点出触发事件
1827
- 'onchange' (index) {
1828
- if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1829
- let f_user_name = this.getLableValue('用户名称')
1830
- this.setLabelValue("用户名称", f_user_name.trim())
1831
- if (
1832
- this.show_data.fields[index].label === '区/县' ||
1833
- this.show_data.fields[index].label === '街道/乡镇' ||
1834
- this.show_data.fields[index].label === '集收单位' ||
1835
- this.show_data.fields[index].label === '楼号/组' ||
1836
- this.show_data.fields[index].label === '单元/排' ||
1837
- this.show_data.fields[index].label === '楼层' ||
1838
- this.show_data.fields[index].label === '门牌号'
1839
- ) {
1840
-
1841
- let f_pcd = this.getLableValue('区/县') || ''
1842
- let f_street = this.getLableValue('街道/乡镇') || ''
1843
- let f_residential_area = this.getLableValue('集收单位') || ''
1844
- let f_building = this.getLableValue('楼号/组') || ''
1845
- // let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1846
- let f_building_suffix = f_building ? '号楼' : ''
1847
- let f_unit = this.getLableValue('单元/排') || ''
1848
- // let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1849
- let f_unit_suffix = f_unit ? '单元' : ''
1850
- let f_floor = this.getLableValue('楼层') || ''
1851
- // let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1852
- let f_floor_suffix = f_floor ? '层' : ''
1853
- let f_room = this.getLableValue('门牌号') || ''
1854
- // let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1855
- let f_room_suffix = f_room ? '室' : ''
1856
-
1857
- let f_address = f_pcd + f_street + f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
1858
- this.setLabelValue("地址", f_address)
1859
- }
1860
- }
1861
- },
1862
- selectSearch (val, index) {},
1863
- 'onblur' (index) {},
1864
- 'oninput' (index) {},
1865
- 'initializtionView' () {},
1866
- async 'onchangeModal' (index, fieldIndex) {
1867
- },
1868
- async 'onblurModal' (index, fieldIndex) {
1869
-
1870
- },
1871
- async 'oninputModal' (index, fieldIndex) {
1872
-
1873
- },
1874
- async 'onetomanydelete' (index, rowIndex) {
1875
-
1876
- let http = new HttpResetClass()
1877
-
1878
- let res = await http.load(
1879
- 'DELETE',
1880
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1881
- null,
1882
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
1883
- )
1884
-
1885
- res = await this.$resetpost(
1886
- 'rs/entity/t_apply',
1887
- this.show_data
1888
- )
1889
-
1890
- this.$dispatch('breakControl', this.show_data)
1891
- },
1892
- async 'onetomanyupdate' (index, rowIndex) {
1893
- let data = this.show_data.onetomany[index].rows[rowIndex]
1894
-
1895
- this.show_data.onetomany[index].fields.forEach(item => {
1896
- data[item.field] = item.value
1897
- })
1898
- let res = await this.$resetpost(
1899
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1900
- data
1901
- )
1902
-
1903
- res = await this.$resetpost(
1904
- 'rs/entity/t_apply',
1905
- this.show_data
1906
- )
1907
-
1908
- this.$dispatch('breakControl', this.show_data)
1909
- },
1910
- async 'onetomanyadd' (index) {
1911
- let data = {
1912
- f_process_id : this.show_data.f_process_id,
1913
- f_operator_id: this.$login.f.id,
1914
- f_operator: this.$login.f.name,
1915
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1916
- f_orgid: this.$login.f.orgid,
1917
- f_orgname: this.$login.f.orgs
1918
- }
1919
- this.show_data.onetomany[index].fields.forEach(item => {
1920
- data[item.field] = item.value
1921
- })
1922
- let res = await this.$resetpost(
1923
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1924
- data
1925
- )
1926
-
1927
- res = await this.$resetpost(
1928
- 'rs/entity/t_apply',
1929
- this.show_data
1930
- )
1931
-
1932
- this.$dispatch('breakControl', this.show_data)
1933
- },
1934
- async 'importEvent' (index, table, configName, filepath) {
1935
- let data = {
1936
- selectdata: this.show_data,
1937
- table: table,
1938
- filepath: filepath,
1939
- configName: configName,
1940
- user: this.$login.f
1941
- }
1942
-
1943
- let res = await this.$resetpost(
1944
- `rs/logic/importEvent`,
1945
- data
1946
- )
1947
-
1948
- this.$dispatch('breakControl', this.show_data)
1949
- },
1950
- 'onbutchange' (index) {
1951
-
1952
- },
1953
- 'onbutblur' (index) {
1954
-
1955
- },
1956
- 'onbutinput' (index) {
1957
-
1958
-
1959
- }
1960
- },
1961
- watch: {
1962
- }
1963
- }
1964
- </script>
1965
- <style scoped>
1966
- /*清除model中的浮动*/
1967
- .clearfix:after,.clearfix:before{
1968
- display: table;
1969
- }
1970
- .clearfix:after{
1971
- clear: both;
1972
- }
1973
- </style>
1
+ <template>
2
+ <div class="" v-if="showview">
3
+ <show-back-reason :selectdata="show_data"></show-back-reason>
4
+ <service-view v-ref:serviceview :data="show_data"></service-view>
5
+ </div>
6
+ </template>
7
+ <script>
8
+ import {HttpResetClass} from 'vue-client'
9
+ import {isEmpty} from "../../../components/Util"
10
+
11
+ // Date格式化
12
+ Date.prototype.Format = function (fmt) {
13
+ var o = {
14
+ "M+": this.getMonth() + 1, //月份
15
+ "d+": this.getDate(), //日
16
+ "H+": this.getHours(), //小时
17
+ "m+": this.getMinutes(), //分
18
+ "s+": this.getSeconds(), //秒
19
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
20
+ "S": this.getMilliseconds() //毫秒
21
+ };
22
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
23
+ for (var k in o)
24
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
25
+ return fmt;
26
+ }
27
+
28
+ export default {
29
+ title: '报建流程业务控制层',
30
+ props: ['selectdata'],
31
+ data () {
32
+ return {
33
+ data: null, // 数据库数据,json配置文件数据的数据集合
34
+ json_datas: null, // Json配置文件集合
35
+ showview: false, // 控制显示service-view组件
36
+ show_data: null, // 给view层显示的数据
37
+ config: {},
38
+ Pricetype:''
39
+ }
40
+ },
41
+ ready () {
42
+ this.refurbish()
43
+ },
44
+ methods: {
45
+ async servicer(){
46
+ let data = {
47
+ tablename: 't_user',
48
+ condition: `1=1`
49
+ }
50
+ let http = new HttpResetClass()
51
+ let res = await http.load(
52
+ 'POST',
53
+ `rs/sql/apply_singleTable`,
54
+ {data: data},
55
+ {resolveMsg: null, rejectMsg: '服务人查询失败!!!'}
56
+ )
57
+ this.setLabelOptions('服务人', res.data.map(item => {
58
+ return {
59
+ label: item.name,
60
+ value: item.name
61
+ }
62
+ }))
63
+ },
64
+ async ceshi(){
65
+ for (let i = 0; i < this.show_data.fields.length; i++) {
66
+ if (this.show_data.defname==='报装申请' && this.show_data.fields[i].label === '合同编号') {
67
+ let http2 = new HttpResetClass()
68
+ let applyNum = await http2.load('POST', 'rs/logic/getProjectNo', {
69
+ data: {
70
+ f_filiale: this.$login.f.orgs,
71
+ f_order_id: this.selectdata.f_order_id
72
+ }
73
+ }, {resolveMsg: null, rejectMsg: null})
74
+ console.log("生成的合同编号为:" + applyNum.data)
75
+ this.show_data.fields[i].value = applyNum.data
76
+ }
77
+ }
78
+ },
79
+
80
+ // 组件初始化操作
81
+ async refurbish() {
82
+ this.json_datas = this.$workflow_vue
83
+ let sum = 0
84
+ let jsonData = {}
85
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
86
+ this.$showMessage("网络故障,请刷新页面")
87
+ return
88
+ }
89
+ this.json_datas.activitys.forEach(item => {
90
+ if (this.selectdata.defname === item.title) {
91
+ jsonData = item // 拿到当前节点的json配置信息
92
+ sum++ // 节点名一样的个数
93
+ }
94
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
95
+ })
96
+
97
+ if (sum === 0) {
98
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
99
+ return
100
+ }
101
+ if (sum > 1) {
102
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
103
+ return
104
+ }
105
+
106
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
107
+
108
+ // fields 字段填充值
109
+ for (const item of this.selectdata.fields) {
110
+ if (!item.value) {
111
+ item.value = null
112
+ }
113
+ if(this.selectdata.f_apply_type === '集体报建' && this.selectdata.defname === '报装缴费'){
114
+ if(item.label === '未结总金额'){
115
+ item.value = this.selectdata.f_due_money - this.selectdata.f_cumulative_payment_money
116
+ }
117
+ if(item.label === '付款比例'){
118
+ item.value = (this.selectdata.f_cumulative_payment_money/this.selectdata.f_due_money * 100) + '%'
119
+ }
120
+ }
121
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
122
+ if (item.eval) {
123
+ item.value = eval(item.default)
124
+ } else {
125
+ item.value = item.default
126
+ }
127
+ }
128
+
129
+ if (this.selectdata[item.field]) {
130
+ // 将json字符串格式化赋值给value
131
+ if (String(this.selectdata[item.field]).startsWith("{")) {
132
+ item.value = JSON.parse(this.selectdata[item.field])
133
+ } else {
134
+ item.value = this.selectdata[item.field]
135
+ }
136
+ }
137
+ if (this.selectdata[item.field] === 0) {
138
+ item.value = 0
139
+ }
140
+
141
+ // datepicker
142
+ if (item.type === 'datepicker' && !item.value && item.default) {
143
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
144
+ }
145
+ // 如果配置类型为select,优先从参数列表获取options
146
+ if (item.type === 'select' || item.type === 'checkbox') {
147
+ if (item.param) {
148
+ let temp = this.$appdata.getParam(item.label)
149
+
150
+ if (temp && temp.length > 0) {
151
+ item.options = temp
152
+ }
153
+
154
+ if (item.paramLabel) {
155
+ temp = this.$appdata.getParam(item.paramLabel)
156
+ if (temp && temp.length > 0) {
157
+ item.options = temp
158
+ }
159
+ }
160
+ }
161
+
162
+ if (item.ready) {
163
+ console.log(item.ready)
164
+ item.options = await this[item.ready]()
165
+
166
+ }
167
+ }
168
+
169
+
170
+ if (item.type === 'checkbox') {
171
+ if (this.selectdata[item.field]) {
172
+ item.value = JSON.parse(this.selectdata[item.field])
173
+ } else {
174
+ item.value = []
175
+ }
176
+ }
177
+
178
+ this.selectdata[item.field] = item.value
179
+ }
180
+
181
+ // 控制组件
182
+ if (this.selectdata.components) {
183
+ this.selectdata.components.forEach(item => {
184
+ if (!item.mark) {
185
+ item.mark = 0
186
+ }
187
+ })
188
+ }
189
+ // 初始化onetomany
190
+ if (this.selectdata.onetomany) {
191
+ for (const item of this.selectdata.onetomany) {
192
+ let res = null
193
+ if (item.queryEvent) {
194
+ res = this[item.queryEvent]()
195
+ } else {
196
+ let data = {
197
+ tablename: item.tables[0],
198
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
199
+ }
200
+ res = await this.$resetpost(
201
+ 'rs/sql/apply_singleTable',
202
+ {data: data},
203
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
204
+ )
205
+ }
206
+
207
+ item.rows = res.data
208
+
209
+ // 初始化onetomany中的fields
210
+ for (const field of item.fields) {
211
+ if (!field.value) {
212
+ if (field.value !== 0) {
213
+ field.value = null
214
+ }
215
+ }
216
+
217
+ if (field.default || field.default === 0) {
218
+ field.value = field.default
219
+ }
220
+
221
+ // datepicker
222
+ if (field.type === 'datepicker' && !field.value && field.default) {
223
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
224
+ }
225
+
226
+ if (field.type === 'select') {
227
+
228
+ let temp = this.$appdata.getParam(field.label)
229
+
230
+ if (temp && temp.length > 0) {
231
+ field.options = temp
232
+ }
233
+
234
+ if (field.paramLabel) {
235
+ temp = this.$appdata.getParam(field.paramLabel)
236
+ if (temp && temp.length > 0) {
237
+ item.options = temp
238
+ }
239
+ }
240
+ }
241
+ }
242
+ }
243
+ }
244
+ // 初始化 buttons_fields
245
+ for (const item of this.selectdata.buttons) {
246
+ if (item.button_name === '下发') {
247
+
248
+ let data = {
249
+ source: item.source,
250
+ userid: this.$login.f.id
251
+ }
252
+ if (item.sourceMethod) {
253
+ data.source = this[item.sourceMethod]()
254
+ }
255
+ if (!data.source) {
256
+ this.$showMessage("请配置获取人员表达式")
257
+ return
258
+ }
259
+
260
+ let res = await this.$resetpost(
261
+ 'rs/search',
262
+ {data: data},
263
+ {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
264
+ )
265
+
266
+ let options = res.data.map(source => {
267
+ return {
268
+ "label": source.name,
269
+ "value": source.id
270
+ }
271
+ })
272
+
273
+ if (item.button_fields.length !== 1) {
274
+ this.$showMessage("下发有且只能有一个字段!!!")
275
+ return
276
+ }
277
+
278
+ item.button_fields[0].options = options
279
+ }
280
+ if (item.button_fields) {
281
+ item.button_fields.forEach(x => {
282
+ // 如果配置类型为select,优先从参数列表获取options
283
+ if (x.type === 'select') {
284
+
285
+ if (x.param) {
286
+ let temp = this.$appdata.getParam(x.label)
287
+
288
+ if (temp && temp.length > 0) {
289
+ x.options = temp
290
+ }
291
+
292
+ if (x.paramLabel) {
293
+ temp = this.$appdata.getParam(x.paramLabel)
294
+ if (temp && temp.length > 0) {
295
+ x.options = temp
296
+ }
297
+ }
298
+ }
299
+
300
+ }
301
+ })
302
+ }
303
+ }
304
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
305
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
306
+ console.log('打印下temp',temp)
307
+ this.show_data = temp
308
+ this.$nextTick(() => {
309
+ this.showview = true
310
+ })
311
+ },
312
+ // 金额转大写
313
+ smalltoBIG(n) {
314
+ let fraction = ['角', '分'];
315
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
316
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
317
+ let head = n < 0 ? '欠' : '';
318
+ n = Math.abs(n);
319
+
320
+ let s = '';
321
+
322
+ for (var i = 0; i < fraction.length; i++) {
323
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
324
+ }
325
+ s = s || '整';
326
+ n = Math.floor(n);
327
+
328
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
329
+ let p = '';
330
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
331
+ p = digit[n % 10] + unit[1][j] + p;
332
+ n = Math.floor(n / 10);
333
+ }
334
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
335
+ }
336
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
337
+ },
338
+ getLableValue(label) {
339
+ for (const item of this.show_data.fields) {
340
+ if (item.label === label && item.type !== 'number') {
341
+ return item.value || ''
342
+ }
343
+ if (item.label === label && item.type === 'number') {
344
+ return item.value || 0
345
+ }
346
+ }
347
+ },
348
+ getLableOptions(label) {
349
+ for (const item of this.show_data.fields) {
350
+ if (item.label === label) {
351
+ return item.options
352
+ }
353
+ }
354
+ },
355
+ setLabelValue(label, value) {
356
+ for (const item of this.show_data.fields) {
357
+ if (item.label === label) {
358
+ item.value = value
359
+ this.show_data[item.field] = value
360
+ }
361
+ }
362
+ },
363
+ setLabelOptions(label, options) {
364
+ for (const item of this.show_data.fields) {
365
+ if (item.label === label) {
366
+ item.options = options
367
+ }
368
+ }
369
+ },
370
+ showLabels(...labels) {
371
+ for (const item of this.show_data.fields) {
372
+ if (labels.includes(item.label)) {
373
+ item.hidden = false
374
+ }
375
+ }
376
+ },
377
+ hideLabels(...labels) {
378
+ for (const item of this.show_data.fields) {
379
+ if (labels.includes(item.label)) {
380
+ item.hidden = true
381
+ }
382
+ }
383
+ },
384
+ requiredLabels(...labels) {
385
+ for (const item of this.show_data.fields) {
386
+ if (labels.includes(item.label)) {
387
+ item.required = true
388
+ }
389
+ }
390
+ },
391
+ electiveLabels(...labels) {
392
+ for (const item of this.show_data.fields) {
393
+ if (labels.includes(item.label)) {
394
+ item.required = false
395
+ }
396
+ }
397
+ },
398
+ readonlyLabels(...labels) {
399
+ for (const item of this.show_data.fields) {
400
+ if (labels.includes(item.label)) {
401
+ item.readonly = true
402
+ item.disabled = true
403
+ }
404
+ }
405
+ },
406
+ readwriteLabels(...labels) {
407
+ for (const item of this.show_data.fields) {
408
+ if (labels.includes(item.label)) {
409
+ item.readonly = false
410
+ item.disabled = false
411
+ }
412
+ }
413
+ },
414
+ disabledButtons(...buttons) {
415
+ for (const item of this.show_data.buttons) {
416
+ if (buttons.includes(item.button_name)) {
417
+ item.disabled = true
418
+ }
419
+ }
420
+ },
421
+ enableButtons(...buttons) {
422
+ for (const item of this.show_data.buttons) {
423
+ if (buttons.includes(item.button_name)) {
424
+ item.disabled = false
425
+ }
426
+ }
427
+ },
428
+ showButtons(...buttons) {
429
+ for (const item of this.show_data.buttons) {
430
+ if (buttons.includes(item.button_name)) {
431
+ item.hidden = false
432
+ }
433
+ }
434
+ },
435
+ hideButtons(...buttons) {
436
+ for (const item of this.show_data.buttons) {
437
+ if (buttons.includes(item.button_name)) {
438
+ item.hidden = true
439
+ }
440
+ }
441
+ },
442
+ async checkDuplicate(index) {
443
+ let http = new HttpResetClass()
444
+ let data = {
445
+ tablename: 't_apply',
446
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
447
+ }
448
+ let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
449
+ resolveMsg: null,
450
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
451
+ })
452
+ if (res.data.length > 0) {
453
+ this.show_data.fields[index].value = null
454
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
455
+ }
456
+ },
457
+ // 获取片区
458
+ async getSliceArea () {
459
+ let data = {
460
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
461
+ userid: this.$login.f.id
462
+ }
463
+
464
+ let http = new HttpResetClass()
465
+ let res = await http.load(
466
+ 'POST',
467
+ `rs/search`,
468
+ {data: data},
469
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
470
+ )
471
+
472
+ return res.data.map(item => {
473
+ return {
474
+ label: item.name,
475
+ value: item.name
476
+ }
477
+ })
478
+ },
479
+ // 获取区县
480
+ async getPcd () {
481
+ let data = {
482
+ tablename: 't_pcd',
483
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
484
+ }
485
+ let http = new HttpResetClass()
486
+ let res = await http.load(
487
+ 'POST',
488
+ `rs/sql/apply_singleTable`,
489
+ {data: data},
490
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
491
+ )
492
+
493
+ return res.data.map(item => {
494
+ return {
495
+ label: item.f_pcd,
496
+ value: item.f_pcd
497
+ }
498
+ })
499
+ },
500
+ // 获取集收单位
501
+ async getArea () {
502
+ let data = {
503
+ tablename: 't_area',
504
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
505
+ }
506
+ let http = new HttpResetClass()
507
+ let res = await http.load(
508
+ 'POST',
509
+ `rs/sql/apply_singleTable`,
510
+ {data: data},
511
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
512
+ )
513
+
514
+ return res.data.map(item => {
515
+ return {
516
+ label: item.f_residential_area,
517
+ value: item.f_residential_area
518
+ }
519
+ })
520
+ },
521
+ async applyfore() {
522
+ var num = await this.checkfile("申请表")
523
+ if (num === 0) {
524
+ this.$showAlert('请上传附件!!!', 'warning', 3000)
525
+ throw null
526
+ }
527
+ },
528
+ //商户报建在点火派单-检查是否导入用户
529
+ async checkUser() {
530
+ let http = new HttpResetClass()
531
+ let data={
532
+ condValue:[],
533
+ condition:"1=1",
534
+ data:{
535
+ f_filialeid: this.$login.f.orgid,
536
+ f_process_id: this.selectdata.f_process_id
537
+ }
538
+ }
539
+ let res = await http.load('POST', 'rs/sql/getAddressAanUserinfo', {data: data}, {
540
+ warnMsg: null,
541
+ resolveMsg: null
542
+ })
543
+ if(res.data.length===0){
544
+ this.$showAlert('请先导入用户信息!!!', 'warning', 3000)
545
+ throw null
546
+ }
547
+ },
548
+ //检查附件是否提交
549
+ async checkfile(param) {
550
+ let condition = `f_blobid= '${this.show_data.f_process_id}' and fusetype='${param}' `
551
+ let http = new HttpResetClass()
552
+ let data = {
553
+ tablename: 't_files',
554
+ condition: condition
555
+ }
556
+ let getFile = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
557
+ warnMsg: null,
558
+ resolveMsg: null
559
+ })
560
+ return getFile.data.length
561
+ },
562
+ // 缴费前置
563
+ chargeBefore () {
564
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
565
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
566
+ throw null
567
+ }
568
+ },
569
+ // 施工前置 加表具后状态是待开通 提交后是正常 所以这里的判断条件需改正 (and uf.f_meter_classify is null and f_meternumber is null)
570
+ async constructionBefore () {
571
+ let http = new HttpResetClass()
572
+ let data = {
573
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_meter_classify is null and f_meternumber is null`
574
+ }
575
+ let res = await http.load(
576
+ 'POST',
577
+ 'rs/sql/countApplyUserinfo',
578
+ {data: data},
579
+ {
580
+ resolveMsg: null,
581
+ rejectMsg: '安装明细查询失败!!!'
582
+ })
583
+ if (res.data[0].num > 0) {
584
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
585
+ throw `还有${res.data[0].num}户未安装,无法提交`
586
+ }
587
+ },
588
+ changePipeBuild () {
589
+ if (this.selectdata.f_process_dep === '工程部') {
590
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
591
+ }
592
+ if (this.selectdata.f_process_dep === '运营部') {
593
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
594
+ }
595
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
596
+ },
597
+ // async getDevInfo () {
598
+ // let data = {
599
+ // tablename: 't_dev_info',
600
+ // condition: `f_orgid = '${this.$login.f.orgid}'`
601
+ // }
602
+ // let http = new HttpResetClass()
603
+ // let res = await http.load(
604
+ // 'POST',
605
+ // `rs/sql/apply_singleTable`,
606
+ // {data: data},
607
+ // {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
608
+ // )
609
+ //
610
+ // return res.data.map(item => {
611
+ // return {
612
+ // label: item.f_dev_name,
613
+ // value: item.f_dev_name
614
+ // }
615
+ // })
616
+ // },
617
+ async getPrice (f_price_id) {
618
+ console.log('=======================')
619
+ console.log(f_price_id)
620
+
621
+ let data = {
622
+ condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
623
+ }
624
+ // if(this.Pricetype==='机表'){
625
+ // data.condition=`sp.f_custom = '机表'`
626
+ // }
627
+ // if(this.Pricetype==='非机表'){
628
+ // data.condition=`sp.f_custom = '非机表'`
629
+ // }
630
+
631
+ if (!isEmpty(f_price_id)) {
632
+ data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
633
+ }
634
+ let http = new HttpResetClass()
635
+ let res = await http.load(
636
+ 'POST',
637
+ `rs/sql/applyGetPrice`,
638
+ {data: data},
639
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
640
+ )
641
+
642
+ let a= res.data.map(item => {
643
+ return {
644
+ label: item.f_price_name,
645
+ value: item
646
+ }
647
+ })
648
+ this.selectdata.fields.forEach(field => {
649
+ if (field.label === '气价名称') {
650
+ field.options = a}
651
+ })
652
+ return a
653
+ },
654
+ addressInitialization () {
655
+ this.$getConfig(this, 'UserAddress')
656
+
657
+ let f_address_type = this.show_data.f_address_type
658
+
659
+ for (const item of this.show_data.fields) {
660
+ if (f_address_type === '民用市区') {
661
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
662
+ item.hidden = false
663
+ item.required = true
664
+ }
665
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
666
+ item.hidden = false
667
+ item.required = false
668
+ }
669
+ if (item.label === '地址') {
670
+ item.readonly = true
671
+ }
672
+ }
673
+ if (f_address_type === '民用乡镇') {
674
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
675
+ item.hidden = false
676
+ item.required = true
677
+ }
678
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
679
+ item.hidden = false
680
+ item.required = false
681
+ }
682
+ if (item.label === '楼层') {
683
+ item.hidden = true
684
+ item.required = false
685
+ }
686
+ if (item.label === '地址') {
687
+ item.readonly = true
688
+ }
689
+ }
690
+ if (f_address_type === '特殊地址') {
691
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
692
+ item.hidden = false
693
+ item.required = true
694
+ }
695
+ if (item.label === '集收单位') {
696
+ item.hidden = false
697
+ if (this.show_data.f_apply_type === '工商户报建'){
698
+ item.required = false
699
+ } else {
700
+ item.required = false
701
+ }
702
+
703
+ }
704
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
705
+ item.hidden = true
706
+ item.required = false
707
+ }
708
+ if (item.label === '地址') {
709
+ item.readonly = false
710
+ }
711
+ }
712
+
713
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
714
+ item.hidden = true
715
+ }
716
+ }
717
+ },
718
+ async streetChange () {
719
+ if (isEmpty(this.show_data.f_street)) {
720
+ return
721
+ }
722
+
723
+ let data = {
724
+ tablename: 't_area',
725
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
726
+ }
727
+ let http = new HttpResetClass()
728
+ let res = await http.load(
729
+ 'POST',
730
+ `rs/sql/apply_singleTable`,
731
+ {data: data},
732
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
733
+ )
734
+
735
+ this.setLabelOptions('集收单位', res.data.map(item => {
736
+ return {
737
+ label: item.f_residential_area,
738
+ value: item.f_residential_area
739
+ }
740
+ }))
741
+ },
742
+ async pcdChange () {
743
+ if (isEmpty(this.show_data.f_pcd)) {
744
+ return
745
+ }
746
+
747
+ let data = {
748
+ tablename: 't_street',
749
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
750
+ }
751
+ let f_address_type = this.getLableValue('地址类型')
752
+
753
+ if (f_address_type === '民用市区') {
754
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
755
+ }
756
+ if (f_address_type === '民用乡镇') {
757
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
758
+ }
759
+
760
+ let http = new HttpResetClass()
761
+ let res = await http.load(
762
+ 'POST',
763
+ `rs/sql/apply_singleTable`,
764
+ {data: data},
765
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
766
+ )
767
+
768
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
769
+ return {
770
+ label: item.f_street,
771
+ value: item.f_street
772
+ }
773
+ }))
774
+ },
775
+ async addressTips () {
776
+ // console.log('======================='+this.show_data.f_apply_type)
777
+ let res = ''
778
+ if (this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') {
779
+ res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
780
+ }else{
781
+ res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
782
+ }
783
+ if (res == 'confirm') {
784
+ return
785
+ }
786
+ throw '用户信息确认!!!'
787
+ },
788
+ async getDesignerPeople () {
789
+ let data = {
790
+ source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
791
+ userid: this.$login.f.id
792
+ }
793
+
794
+ let http = new HttpResetClass()
795
+ let res = await http.load(
796
+ 'POST',
797
+ `rs/search`,
798
+ {data: data},
799
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
800
+ )
801
+
802
+ return res.data.map(item => {
803
+ return {
804
+ label: item.name,
805
+ value: item.id
806
+ }
807
+ })
808
+ },
809
+ async surveyStopApply () {
810
+ console.log('终止报建!!!!!')
811
+
812
+ this.show_data.f_stop_reason = '现场勘察不符合报装条件'
813
+
814
+ let data = {
815
+ data: this.show_data,
816
+ user: this.$login.f
817
+ }
818
+
819
+ let res = await this.$resetpost(
820
+ `rs/logic/surveyStopApply`,
821
+ {data: data},
822
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
823
+ )
824
+
825
+ this.$dispatch('loadPage')
826
+
827
+ throw '终止报建!!!'
828
+ },
829
+ async contract_number() {
830
+ console.log("进入编号合同编号生成",this.$login.f.orgs)
831
+ let f_contract_number = ''
832
+ const nowDate = new Date();
833
+ const date = {
834
+ year: nowDate.getFullYear(),
835
+ month: nowDate.getMonth() + 1,
836
+ day: nowDate.getDate()
837
+ }
838
+
839
+ function upperCaseChars(dir) {
840
+ let string = '';
841
+ switch (dir){
842
+ case '周口市天然气有限公司':
843
+ string = 'ZK' // 当表达式的结果等于 房产 时,则执行该代码
844
+ break;
845
+ case '项城市天然气有限公司':
846
+ string = "XC" // 当表达式的结果等于 自建房 时,则执行该代码
847
+ break;
848
+ case '西华县天然气有限公司':
849
+ string = 'XH' // 当表达式的结果等于 商业 时,则执行该代码
850
+ break;
851
+ case '鹿邑县天然气有限公司':
852
+ string = 'LY' // 当表达式的结果等于 工业 时,则执行该代码
853
+ break;
854
+ case '郸城县天然气有限公司':
855
+ string = 'DC' // 当表达式的结果等于 中压 时,则执行该代码
856
+ break;
857
+ case '测试公司(一)':
858
+ string = 'CS' // 当表达式的结果等于 中压 时,则执行该代码
859
+ break;
860
+ case '甘泉县丰源天然气有限责任公司':
861
+ string = 'GQ' // 当表达式的结果等于 中压 时,则执行该代码
862
+ break;
863
+ default : 'HT'
864
+ break; // 如果没有与表达式相同的公司,则执行该代码
865
+ }
866
+ return string;
867
+ }
868
+
869
+ const dir = upperCaseChars(this.$login.f.orgs) //分公司
870
+
871
+ let type = 0 //类型
872
+
873
+ switch (this.show_data.f_entry_type){
874
+ case '城区/县城':
875
+ type = 1 // 当表达式的结果等于 城区 时,则执行该代码
876
+ break;
877
+ case '新农村':
878
+ type = 2 // 当表达式的结果等于 新农村 时,则执行该代码
879
+ break;
880
+ case '测试':
881
+ type = 3 // 当表达式的结果等于 新农村 时,则执行该代码
882
+ break;
883
+ default :
884
+ break; // 如果没有与表达式相同的值,则执行该代码
885
+ }
886
+
887
+ let nature = 0 // 性质
888
+ switch (this.show_data.f_apply_nature){
889
+ case '楼房':
890
+ nature = 1 // 当表达式的结果等于 楼房 时,则执行该代码
891
+ break;
892
+ case '房产':
893
+ nature = 1 // 当表达式的结果等于 房产 时,则执行该代码
894
+ break;
895
+ case '自建房':
896
+ nature = 2 // 当表达式的结果等于 自建房 时,则执行该代码
897
+ break;
898
+ case '商业':
899
+ nature = 3 // 当表达式的结果等于 商业 时,则执行该代码
900
+ break;
901
+ case '学校':
902
+ nature = 3 // 当表达式的结果等于 学校 时,则执行该代码
903
+ break;
904
+ case '福利机构':
905
+ nature = 3 // 当表达式的结果等于 福利机构 时,则执行该代码
906
+ break;
907
+ case '其他':
908
+ nature = 3 // 当表达式的结果等于 其他 时,则执行该代码
909
+ break;
910
+ case '工业':
911
+ nature = 4 // 当表达式的结果等于 工业 时,则执行该代码
912
+ break;
913
+ case '中压':
914
+ nature = 5 // 当表达式的结果等于 中压 时,则执行该代码
915
+ break;
916
+ case '测试':
917
+ nature = 6 // 当表达式的结果等于 中压 时,则执行该代码
918
+ break;
919
+ default :
920
+ break; // 如果没有与表达式相同的值,则执行该代码
921
+ }
922
+
923
+ const newMonth = date.month >= 10 ? date.month : '0' + date.month //月份
924
+ const dataYm = date.year + '-01-01'
925
+ const newYear = date.year + 1
926
+ const year = date.year.toString().substring(2,4) //年份
927
+
928
+ let data = {
929
+ orgid: this.$login.f.orgid
930
+ }
931
+
932
+ let http = new HttpResetClass()
933
+ let res = await http.load('POST', 'rs/sql/contractCount', {data:data}, {
934
+ resolveMsg: null,
935
+ rejectMsg: null
936
+ })
937
+ let oldDate
938
+ for (const item of res.data) {
939
+ if (item.name === '合同编号最后更新日期'){
940
+ oldDate = item.value
941
+ }
942
+ }
943
+ for (const item of res.data){
944
+ if (item.name === '合同编号'){
945
+ if (item.value === 0 || Date.parse(oldDate) < Date.parse(dataYm)) {
946
+ f_contract_number = dir + type + nature + year + newMonth + '001'
947
+ console.log("触发if", f_contract_number)
948
+ } else {
949
+ let count = item.value
950
+ f_contract_number = dir + type + nature + year + newMonth + this.PrefixInteger(count, 3)
951
+ console.log("触发else", f_contract_number)
952
+ }
953
+ }
954
+ }
955
+ this.selectdata.f_contract_number = f_contract_number
956
+ this.show_data.f_contract_number = f_contract_number
957
+ return f_contract_number
958
+ },
959
+ PrefixInteger(num, n) {
960
+ return (Array(n).join(0) + num).slice(-n);
961
+ },
962
+ // 单价失去焦点
963
+ async priceSum () {
964
+ if (isEmpty(this.show_data.f_price)) {
965
+ return
966
+ }
967
+ let data = {
968
+ operator: '乘',
969
+ num1: this.show_data.f_price,
970
+ num2: this.show_data.f_install_count
971
+ }
972
+ let http = new HttpResetClass()
973
+ let res = await http.load(
974
+ 'POST',
975
+ `rs/logic/compute`,
976
+ {data: data},
977
+ {resolveMsg: null, rejectMsg: '工程材料费计算失败!!!'}
978
+ )
979
+
980
+ this.setLabelValue('工程材料费', res.data)
981
+ },
982
+ },
983
+ events: {
984
+ 'priceType'(index){
985
+ this.Pricetype = this.getLableValue('所属类型')
986
+ console.log('打印方法值',this.getPrice(this.show_data.f_price_id))
987
+ for (const item of this.show_data.fields) {
988
+ if (this.show_data.f_sprice_type !=null && this.show_data.f_sprice_type !='') {
989
+ if(item.label==='气价名称'){
990
+ this.getPrice().then(value =>{
991
+ item.options=value
992
+ })
993
+ console.log('最终',item.options)
994
+ }
995
+ }
996
+ }
997
+ },
998
+ 'complyInstallation' (index) {
999
+ if (this.show_data.f_is_have === '否') {
1000
+ this.hideButtons('提交', '出图', '缴费')
1001
+ this.showButtons('终止')
1002
+ }
1003
+ if (this.show_data.f_is_have === '是') {
1004
+ this.hideButtons('终止')
1005
+ this.showButtons('提交', '出图', '缴费')
1006
+ }
1007
+ },
1008
+ async 'igniteDispatchReadyEvent' () {
1009
+ let data = {
1010
+ tablename: 'activityins',
1011
+ condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
1012
+ }
1013
+ let http = new HttpResetClass()
1014
+ let res = await http.load(
1015
+ 'POST',
1016
+ `rs/sql/apply_singleTable`,
1017
+ {data: data},
1018
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
1019
+ )
1020
+ if (res.data.length <= 0) {
1021
+ console.log('+++++++++++++++++++++++++++++')
1022
+ console.log('没有施工,不能退回')
1023
+ this.hideButtons('退回')
1024
+ }
1025
+ },
1026
+ 'buildReadyEvent' () {
1027
+ this.setLabelValue('施工单位', this.$login.f.name)
1028
+ this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
1029
+ },
1030
+ // 选择材料
1031
+ async materialNameChenge (index, fieldIndex) {
1032
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
1033
+
1034
+ this.show_data.onetomany[index].fields.forEach(item => {
1035
+ if (material[item.field]) {
1036
+ item.value = material[item.field]
1037
+ }
1038
+ })
1039
+ },
1040
+ // 打开模态框获取材料
1041
+ async 'getMaterialName' (index) {
1042
+ let data = {
1043
+ condition: `1=1`
1044
+ }
1045
+ let http = new HttpResetClass()
1046
+ let res = await http.load(
1047
+ 'POST',
1048
+ `rs/sql/getStockMaterial`,
1049
+ {data: data},
1050
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
1051
+ )
1052
+
1053
+ this.show_data.onetomany[index].fields.forEach(field => {
1054
+ if (field.label === '选择材料') {
1055
+ field.options = res.data.map(item => {
1056
+ return {
1057
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
1058
+ 'value': item
1059
+ }
1060
+ })
1061
+ }
1062
+ })
1063
+ },
1064
+ // 搜索小区
1065
+ async 'searchArea' (area, index) {
1066
+ let data = {
1067
+ tablename: 't_area',
1068
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1069
+ }
1070
+ let http = new HttpResetClass()
1071
+ let res = await http.load(
1072
+ 'POST',
1073
+ `rs/sql/apply_singleTable`,
1074
+ {data: data},
1075
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1076
+ )
1077
+
1078
+ if (res.data.length === 0) {
1079
+ return
1080
+ }
1081
+
1082
+ this.setLabelOptions('集收单位', res.data.map(item => {
1083
+ return {
1084
+ label: item.f_residential_area,
1085
+ value: item.f_residential_area
1086
+ }
1087
+ }))
1088
+ },
1089
+ // 搜索小区
1090
+ async 'searchAreaCollective' (area, index) {
1091
+ let data = {
1092
+ tablename: 't_area',
1093
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${area}%'`
1094
+ }
1095
+ let http = new HttpResetClass()
1096
+ let res = await http.load(
1097
+ 'POST',
1098
+ `rs/sql/apply_singleTable`,
1099
+ {data: data},
1100
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1101
+ )
1102
+
1103
+ if (res.data.length === 0) {
1104
+ return
1105
+ }
1106
+
1107
+ this.setLabelOptions('集收单位', res.data.map(item => {
1108
+ return {
1109
+ label: item.f_residential_area,
1110
+ value: item.f_residential_area
1111
+ }
1112
+ }))
1113
+ },
1114
+ // 选择气价
1115
+ 'priceChange' (index) {
1116
+ if (isEmpty(this.show_data.stairPrice)) {
1117
+ return
1118
+ }
1119
+
1120
+ let stairPrice = this.getLableValue('气价名称')
1121
+
1122
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
1123
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
1124
+ this.setLabelValue('价格', stairPrice.f_price)
1125
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
1126
+ this.show_data.f_price_id = stairPrice.id
1127
+ this.show_data.f_price_name = stairPrice.f_price_name
1128
+ },
1129
+ // 选择开发商
1130
+ // async 'devInfoChange' (index) {
1131
+ // if (isEmpty(this.show_data.f_company_name)) {
1132
+ // return
1133
+ // }
1134
+ // let data = {
1135
+ // tablename: 't_dev_info',
1136
+ // condition: `f_orgid = '${this.$login.f.orgid}' and f_dev_name = '${this.show_data.f_company_name}'`
1137
+ // }
1138
+ // let res = await this.$resetpost(
1139
+ // `rs/sql/apply_singleTable`,
1140
+ // {data: data},
1141
+ // {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
1142
+ // )
1143
+ // this.show_data.f_dev_id = res.data[0].id
1144
+ // this.show_data.f_dev_code = res.data[0].f_dev_code
1145
+ // this.setLabelValue('法人名称', res.data[0].f_legal_person)
1146
+ // this.setLabelValue('身份证', res.data[0].f_idnumber)
1147
+ // this.setLabelValue('营业执照', res.data[0].f_license_num)
1148
+ // },
1149
+ // 退款金额
1150
+ 'refundMoneyChange' (index) {
1151
+ let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
1152
+ let f_refund_money = this.show_data.fields[index].value
1153
+
1154
+ if (f_refund_money > f_cumulative_payment_money) {
1155
+ this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
1156
+ this.show_data.fields[index].value = null
1157
+ }
1158
+ },
1159
+ // 检查重复
1160
+ 'checkRepeat' (index) {
1161
+ this.checkDuplicate(index)
1162
+ },
1163
+ // 选择报建项目
1164
+ 'selectApply' (row) {
1165
+ this.setLabelValue('工程名称', row.f_entry_name)
1166
+ this.setLabelValue('工程编号', row.f_apply_num)
1167
+ this.setLabelValue('报建类型', row.f_apply_type)
1168
+ this.setLabelValue('用户名称', row.f_user_name)
1169
+ this.setLabelValue('用户电话', row.f_phone)
1170
+ this.setLabelValue('证件类型', row.f_credentials)
1171
+ this.setLabelValue('证件号码', row.f_idnumber)
1172
+ this.setLabelValue('地址', row.f_address)
1173
+ this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
1174
+
1175
+ this.show_data.parentApply = JSON.parse(JSON.stringify(row))
1176
+
1177
+ delete row.id
1178
+ delete row.actid
1179
+ delete row.defid
1180
+ delete row.defname
1181
+ delete row.version
1182
+ delete row.f_apply_num
1183
+ delete row.f_sub_state
1184
+ delete row.f_apply_type
1185
+ delete row.f_process_id
1186
+
1187
+ this.show_data = Object.assign({}, this.show_data, row)
1188
+
1189
+ this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
1190
+ },
1191
+ // 是否终止
1192
+ 'isStopChange' (index) {
1193
+ let f_is_stop = this.show_data.f_is_stop
1194
+
1195
+ for (const item of this.show_data.fields) {
1196
+ if (f_is_stop === '是') {
1197
+ if (item.label === '终止原因') {
1198
+ item.hidden = false
1199
+ item.required = true
1200
+ }
1201
+ } else {
1202
+ if (item.label === '终止原因') {
1203
+ item.hidden = true
1204
+ item.required = false
1205
+ }
1206
+ }
1207
+ }
1208
+ },
1209
+ // 终止报建初始化
1210
+ async 'stopApplyReadyEvent' () {
1211
+
1212
+ let f_is_stop = this.getLableValue('是否终止')
1213
+
1214
+ for (const item of this.show_data.fields) {
1215
+ if (f_is_stop === '是') {
1216
+ if (item.label === '终止原因') {
1217
+ item.hidden = false
1218
+ item.required = true
1219
+ }
1220
+ } else {
1221
+ if (item.label === '终止原因') {
1222
+ item.hidden = true
1223
+ item.required = false
1224
+ }
1225
+ }
1226
+ }
1227
+
1228
+ if (isEmpty(this.show_data.f_parent_process_id)) {
1229
+ return
1230
+ }
1231
+ let data = {
1232
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
1233
+ data: {
1234
+ id: this.$login.f.id,
1235
+ orgid: this.$login.f.orgid
1236
+ }
1237
+ }
1238
+ let res = await this.$resetpost(
1239
+ `rs/sql/supervisory`,
1240
+ {data: data},
1241
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
1242
+ )
1243
+ this.show_data.parentApply = res.data[0]
1244
+ },
1245
+ // 选择用户档案信息
1246
+ 'selectUserinfo' (row) {
1247
+ this.setLabelValue('用户编号', row.f_userinfo_code)
1248
+ this.setLabelValue('用户名称', row.f_user_name)
1249
+ this.setLabelValue('用户电话', row.f_user_phone)
1250
+ this.setLabelValue('证件类型', row.f_credentials)
1251
+ this.setLabelValue('证件号码', row.f_idnumber)
1252
+ this.setLabelValue('地址', row.f_address)
1253
+
1254
+ this.show_data.f_userinfo_id = row.f_userinfo_id
1255
+ this.show_data.f_userinfo_code = row.f_userinfo_code
1256
+ },
1257
+ // 是否购买保险
1258
+ async 'isInsureChange' (index) {
1259
+ if (!this.show_data.f_is_insure) {
1260
+ return
1261
+ }
1262
+ let f_is_insure = this.show_data.f_is_insure
1263
+ for (const item of this.show_data.fields) {
1264
+ if (f_is_insure === '是') {
1265
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1266
+ item.hidden = false
1267
+ item.required = true
1268
+ }
1269
+ if (item.label === '保险备注') {
1270
+ item.hidden = false
1271
+ }
1272
+ } else {
1273
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1274
+ item.hidden = true
1275
+ item.required = false
1276
+ }
1277
+ }
1278
+ }
1279
+ },
1280
+ // 通气点火初始化
1281
+ async 'gasReadyEvent' () {
1282
+ // 是否有气价信息
1283
+ if (!isEmpty(this.show_data.f_price_id)) {
1284
+ let priceList = await this.getPrice(this.show_data.f_price_id)
1285
+ this.setLabelValue('气价名称', priceList[0].value)
1286
+ }
1287
+
1288
+ let data = {
1289
+ tablename: 't_userfees',
1290
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
1291
+ }
1292
+ let http = new HttpResetClass()
1293
+ let res = await http.load(
1294
+ 'POST',
1295
+ `rs/sql/apply_singleTable`,
1296
+ {data: data},
1297
+ {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
1298
+ )
1299
+ if (res.data.length > 0) {
1300
+ this.setLabelValue('待执行保险', '是')
1301
+ for (const item of this.show_data.fields) {
1302
+ if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1303
+ item.hidden = true
1304
+ item.required = false
1305
+ item.value = null
1306
+ }
1307
+ }
1308
+ } else {
1309
+ this.setLabelValue('待执行保险', '否')
1310
+ for (const item of this.show_data.fields) {
1311
+ if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1312
+ item.hidden = false
1313
+ item.required = true
1314
+ }
1315
+ }
1316
+ }
1317
+
1318
+ // 保险初始化显示内容
1319
+ let f_is_insure = this.getLableValue('是否购买保险')
1320
+ for (const item of this.show_data.fields) {
1321
+ if (f_is_insure === '是') {
1322
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1323
+ item.hidden = false
1324
+ item.required = true
1325
+ }
1326
+ if (item.label === '保险备注') {
1327
+ item.hidden = false
1328
+ }
1329
+ // 本期保费到期时间默认一年
1330
+ if (isEmpty(this.selectdata.f_ins_expiration_date)) {
1331
+ let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
1332
+ this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
1333
+ }
1334
+ }
1335
+ if (f_is_insure === '否') {
1336
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1337
+ item.hidden = true
1338
+ item.required = false
1339
+ }
1340
+ }
1341
+ }
1342
+ },
1343
+ // 合同金额失去焦点
1344
+ async 'contractMoneyChange' (index) {
1345
+ let data = {
1346
+ operator: '加',
1347
+ num1: this.show_data.f_contract_money || 0,
1348
+ num2: this.getLableValue('追加金额') || 0
1349
+ }
1350
+ let res = await this.$resetpost(
1351
+ `rs/logic/compute`,
1352
+ {data: data},
1353
+ {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1354
+ )
1355
+
1356
+ this.setLabelValue('应交金额', res.data)
1357
+ },
1358
+ // 街道失去焦点
1359
+ async 'streetChange' (index) {
1360
+ if (isEmpty(this.show_data.f_street)) {
1361
+ return
1362
+ }
1363
+
1364
+ this.setLabelValue('集收单位', null)
1365
+
1366
+ let data = {
1367
+ tablename: 't_area',
1368
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1369
+ }
1370
+ let http = new HttpResetClass()
1371
+ let res = await http.load(
1372
+ 'POST',
1373
+ `rs/sql/apply_singleTable`,
1374
+ {data: data},
1375
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1376
+ )
1377
+
1378
+ this.setLabelOptions('集收单位', res.data.map(item => {
1379
+ return {
1380
+ label: item.f_residential_area,
1381
+ value: item.f_residential_area
1382
+ }
1383
+ }))
1384
+ },
1385
+ // 区县失去焦点
1386
+ async 'pcdChange' (index) {
1387
+ if (isEmpty(this.show_data.f_pcd)) {
1388
+ return
1389
+ }
1390
+
1391
+ this.setLabelValue('街道/乡镇', null)
1392
+ this.setLabelValue('集收单位', null)
1393
+
1394
+
1395
+
1396
+ let data = {
1397
+ tablename: 't_street',
1398
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1399
+ }
1400
+ let f_address_type = this.getLableValue('地址类型')
1401
+
1402
+ if (f_address_type === '民用市区') {
1403
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1404
+ }
1405
+ if (f_address_type === '民用乡镇') {
1406
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1407
+ }
1408
+
1409
+ let http = new HttpResetClass()
1410
+ let res = await http.load(
1411
+ 'POST',
1412
+ `rs/sql/apply_singleTable`,
1413
+ {data: data},
1414
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1415
+ )
1416
+
1417
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
1418
+ return {
1419
+ label: item.f_street,
1420
+ value: item.f_street
1421
+ }
1422
+ }))
1423
+ },
1424
+ // 地址类型失去焦点
1425
+ 'addressTypeChange' (index) {
1426
+ this.setLabelValue('街道/乡镇', null)
1427
+ this.setLabelValue('集收单位', null)
1428
+ let f_address_type = this.show_data.fields[index].value
1429
+ for (const item of this.show_data.fields) {
1430
+ if (f_address_type === '民用市区') {
1431
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1432
+ item.hidden = false
1433
+ item.required = true
1434
+ item.value = null
1435
+ }
1436
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1437
+ item.hidden = false
1438
+ item.required = false
1439
+ item.value = null
1440
+ }
1441
+ if (item.label === '地址') {
1442
+ item.readonly = true
1443
+ item.value = null
1444
+ }
1445
+ }
1446
+ if (f_address_type === '民用乡镇') {
1447
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1448
+ item.hidden = false
1449
+ item.required = true
1450
+ item.value = null
1451
+ }
1452
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1453
+ item.hidden = false
1454
+ item.required = false
1455
+ item.value = null
1456
+ }
1457
+ if (item.label === '楼层') {
1458
+ item.hidden = true
1459
+ item.required = false
1460
+ item.value = null
1461
+ }
1462
+ if (item.label === '地址') {
1463
+ item.readonly = true
1464
+ item.value = null
1465
+ }
1466
+ }
1467
+ if (f_address_type === '特殊地址') {
1468
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
1469
+ item.hidden = false
1470
+ item.required = true
1471
+ item.value = null
1472
+ }
1473
+ if (item.label === '集收单位') {
1474
+ item.hidden = false
1475
+ item.required = false
1476
+ item.value = null
1477
+ }
1478
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1479
+ item.hidden = true
1480
+ item.required = false
1481
+ item.value = null
1482
+ }
1483
+ if (item.label === '地址') {
1484
+ item.readonly = false
1485
+ item.value = null
1486
+ }
1487
+ }
1488
+ }
1489
+ },
1490
+ // 团购转散户初始化
1491
+ 'apply2ReadyEvent' () {
1492
+ if (this.show_data.f_apply_source === '线下发起') {
1493
+ this.addressInitialization()
1494
+ this.hideLabels('用户编号')
1495
+ this.electiveLabels('用户编号')
1496
+ this.showLabels('片区', '地址类型')
1497
+ this.requiredLabels('片区', '地址类型')
1498
+ }
1499
+ if (this.show_data.f_apply_source === '自动发起') {
1500
+ this.hideLabels('片区', '地址类型')
1501
+ this.electiveLabels('片区', '地址类型',)
1502
+ }
1503
+ },
1504
+ // 申请节点初始化
1505
+ 'applyReadyEvent' () {
1506
+ this.addressInitialization()
1507
+ this.pcdChange()
1508
+ this.streetChange()
1509
+ },
1510
+ // ===========================================
1511
+ async 'button'() {
1512
+ if (this.show_data.button.before) {
1513
+ if (Array.isArray(this.show_data.button.before)) {
1514
+ for (let i = 0; i < this.show_data.button.before.length; i++) {
1515
+ await this[this.show_data.button.before[i]]()
1516
+ }
1517
+ } else {
1518
+ await this[this.show_data.button.before]();
1519
+ }
1520
+ }
1521
+ // 点击重置按钮就重置数据
1522
+ if (this.show_data.button.button_name === '重置') {
1523
+ this.$dispatch('breakControl', this.selectdata)
1524
+ return
1525
+ }
1526
+
1527
+ this.show_data.user = this.$login.f
1528
+ this.show_data.start_activity = this.$workflow_vue.start_activity
1529
+ this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1530
+
1531
+ if ((this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') && this.show_data.defname === '工程施工' && this.show_data.f_sub_state !='完工' && this.show_data.button.button_name === '完工'){
1532
+ //判断是否添加报警器材料
1533
+ let bjqlag = false
1534
+ let datatemp = {
1535
+ 'bjqid':"",
1536
+ 'fprocessid':"",
1537
+ 'sqvalue':"",
1538
+ 'f_bjq_sid':"",
1539
+ 'f_material_code':"",
1540
+ 'f_bjq_baidu_lng':"",
1541
+ 'f_bjq_baidu_lat':"",
1542
+ 'f_bjq_gaode_lng':"",
1543
+ 'f_bjq_gaode_lat':""
1544
+ }
1545
+
1546
+ let bjqststedata = {
1547
+ "sid":"",
1548
+ "bjqtype":"",
1549
+ "f_process_id":"",
1550
+ "bjqstate":"",
1551
+ "f_userinfo_code":""
1552
+ }
1553
+ let numOne = [];
1554
+
1555
+ let http = new HttpResetClass()
1556
+ let data = {
1557
+ tablename: `t_material_apply`,
1558
+ condition: `f_process_id='${this.show_data.f_process_id}'`
1559
+ }
1560
+ let res = await http.load(
1561
+ 'POST',
1562
+ `rs/sql/apply_singleTable`,
1563
+ {data: data},
1564
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
1565
+ )
1566
+ res.data.forEach(item => {
1567
+ if (item.f_material_name.substr(0,3) === '报警器'){
1568
+ var bjname = item.f_material_name.split("-")
1569
+ bjqststedata.sid = item.f_bjq_sid
1570
+ bjqststedata.f_process_id = item.f_process_id
1571
+ bjqststedata.bjqtype = bjname[1]
1572
+ //====================================
1573
+ bjqlag = true
1574
+ datatemp.bjqid = item.id
1575
+ datatemp.fprocessid = item.f_process_id
1576
+ datatemp.f_bjq_sid = item.f_bjq_sid
1577
+ datatemp.f_material_code = item.f_material_code
1578
+ datatemp.f_bjq_lng = item.f_bjq_lng
1579
+ datatemp.f_bjq_lat = item.f_bjq_lat
1580
+ datatemp.f_bjq_gaode_lng = item.f_bjq_gaode_lng
1581
+ datatemp.f_bjq_gaode_lat = item.f_bjq_gaode_lng
1582
+ datatemp.f_bjq_baidu_lng = item.f_bjq_baidu_lng
1583
+ datatemp.f_bjq_baidu_lat = item.f_bjq_baidu_lat
1584
+ numOne.push(item.f_bjq_sid)
1585
+ }
1586
+ })
1587
+
1588
+ // this.show_data.onetomany.forEach(item=>{
1589
+ // console.log("查看报警器材料",item)
1590
+ // item.rows.forEach(i=>{
1591
+ // if (i.f_material_name.substr(0,3) === '报警器'){
1592
+ // var bjname = i.f_material_name.split("-")
1593
+ // bjqststedata.sid = i.f_bjq_sid
1594
+ // bjqststedata.f_process_id = i.f_process_id
1595
+ // bjqststedata.bjqtype = bjname[1]
1596
+ // //====================================
1597
+ // bjqlag = true
1598
+ // datatemp.bjqid = i.id
1599
+ // datatemp.fprocessid = i.f_process_id
1600
+ // datatemp.f_bjq_sid = i.f_bjq_sid
1601
+ // datatemp.f_material_code = i.f_material_code
1602
+ // numOne.push(i.f_bjq_sid)
1603
+ // }
1604
+ // })
1605
+ // })
1606
+ if (!bjqlag){
1607
+ this.$showMessage('请添加报警器物料信息!!!')
1608
+ return
1609
+ }
1610
+ if (numOne.length > 1){
1611
+ this.$showMessage("暂时支持单个报警器物料安装!!!")
1612
+ return
1613
+ }
1614
+ datatemp.sqvalue = this.show_data.areaData.sqvalue
1615
+ datatemp.f_bjq_baidu_lng = this.show_data.templatlng.baidutemplng
1616
+ datatemp.f_bjq_baidu_lat = this.show_data.templatlng.baidutemplat
1617
+ datatemp.f_bjq_gaode_lng = this.show_data.templatlng.gaodetemplng
1618
+ datatemp.f_bjq_gaode_lat = this.show_data.templatlng.gaodetemplat
1619
+ datatemp.f_bjq_lng = this.show_data.templatlng.baidutemplng
1620
+ datatemp.f_bjq_lat = this.show_data.templatlng.baidutemplat
1621
+
1622
+ bjqststedata.f_userinfo_code = this.show_data.f_userinfo_code
1623
+
1624
+ //判断是否推送 及推送的状态
1625
+ //查询是否存在, 以型号及厂家判断
1626
+ let bjqres = await this.$resetpost(
1627
+ `rs/logic/getbjqsyncinfo`,
1628
+ bjqststedata
1629
+ )
1630
+ if (bjqres.data.bjqstate != "成功"){
1631
+ //区域地址存入材料记录表
1632
+ let areares = await this.$resetpost(
1633
+ `rs/logic/saveArea`,
1634
+ {data: datatemp},
1635
+ {resolveMsg: null, rejectMsg: '区域地址保存失败'}
1636
+ )
1637
+
1638
+ //完工之后推送数据到汉威
1639
+ let adddata = {
1640
+ f_bjq_sid : datatemp.f_bjq_sid,
1641
+ f_material_code : datatemp.f_material_code,
1642
+ f_bjq_address: this.show_data.areaData.sqvalue,
1643
+ f_user_name: this.show_data.f_user_name,
1644
+ f_address: this.show_data.f_address,
1645
+ f_user_phone: this.show_data.f_phone,
1646
+ f_userinfo_code: this.show_data.f_userinfo_code,
1647
+ installtime: this.show_data.f_construction_date,
1648
+ f_orgid : this.show_data.f_orgid,
1649
+ f_bjq_lng: datatemp.f_bjq_baidu_lng,
1650
+ f_bjq_lat: datatemp.f_bjq_baidu_lat
1651
+ }
1652
+ let res = await this.$resetpost(
1653
+ `ncc/rs/logic/bjqadduser`,
1654
+ // `rs/logic/bjqadduser`,
1655
+ adddata
1656
+ )
1657
+ if (res.data.code != 200){
1658
+ if (bjqres.data.bjqstate.length == 0){
1659
+ bjqststedata.bjqstate = "失败"
1660
+ let bjqres3 = await this.$resetpost(
1661
+ `rs/logic/addbjqsyncinfo`,
1662
+ bjqststedata
1663
+ )
1664
+ }
1665
+ this.$showMessage(res.data.msg)
1666
+ return
1667
+ }
1668
+ //更改记录表状态
1669
+ if (bjqres.data.bjqstate === "失败"){
1670
+ bjqststedata.bjqstate = "成功"
1671
+ let bjqres1 = await this.$resetpost(
1672
+ `rs/logic/updatebjqsyncinfo`,
1673
+ bjqststedata
1674
+ )
1675
+ }else{
1676
+ bjqststedata.bjqstate = "成功"
1677
+ let bjqres2 = await this.$resetpost(
1678
+ `rs/logic/addbjqsyncinfo`,
1679
+ bjqststedata
1680
+ )
1681
+ }
1682
+ }
1683
+ }
1684
+ if ((this.show_data.f_apply_type === '工商户报建' || this.show_data.f_apply_type === '团购报建')
1685
+ && (this.show_data.defname === '报装申请') && this.show_data.button.button_name === '提交'){
1686
+ await this.contract_number()
1687
+ }
1688
+ // if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && (this.show_data.button.button_name === '保存'||this.show_data.button.button_name === '提交')){
1689
+ // let dataz = {
1690
+ // condition: `u.id = ${this.show_data.id}`,
1691
+ // data: {
1692
+ // id: this.$login.f.id,
1693
+ // orgid: this.$login.f.orgid
1694
+ // }
1695
+ // }
1696
+ // let http = new HttpResetClass()
1697
+ // let restpz = await http.load(
1698
+ // 'POST',
1699
+ // `rs/sql/checkuser`,
1700
+ // {data: dataz},
1701
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1702
+ // )
1703
+ // this.show_data.actid=restpz.data[0].actid
1704
+ // }
1705
+ let res = await this.$resetpost(
1706
+ `rs/logic/ApplyProductService`,
1707
+ {data: this.show_data},
1708
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1709
+ )
1710
+
1711
+
1712
+ if (this.show_data.button.after) {
1713
+ this[this.show_data.button.after]()
1714
+ }
1715
+ // // 改管报建 增容报建 优化
1716
+ // if((this.show_data.f_apply_type === '改管报建'||this.show_data.f_apply_type === '增容报建') && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '缴费'){
1717
+ // let datagg = {
1718
+ // condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1719
+ // }
1720
+ // let http = new HttpResetClass()
1721
+ // let restgg = await http.load(
1722
+ // 'POST',
1723
+ // `rs/sql/checkusertwo`,
1724
+ // {data: datagg},
1725
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1726
+ // )
1727
+ // debugger
1728
+ // if(this.show_data.f_apply_type === '改管报建'){
1729
+ // restgg.data[0].processname = '改管报建流程'
1730
+ // restgg.data[0].defname = '报装缴费'
1731
+ // }else{
1732
+ // restgg.data[0].processname = '增容报建流程'
1733
+ // restgg.data[0].defname = '报装缴费'
1734
+ // }
1735
+ // restgg.data[0].actid = restgg.data[0].actid + 1
1736
+ // this.$dispatch('apply',restgg.data[0])
1737
+ //
1738
+ // }
1739
+ //
1740
+ // // 退款报建 优化
1741
+ // if(this.show_data.f_apply_type === '退款报建' && this.show_data.defname === '终止报建' && this.show_data.button.button_name === '提交'){
1742
+ // let datatk = {
1743
+ // condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1744
+ // }
1745
+ // let http = new HttpResetClass()
1746
+ // let resttk = await http.load(
1747
+ // 'POST',
1748
+ // `rs/sql/checkusertwo`,
1749
+ // {data: datatk},
1750
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1751
+ // )
1752
+ // debugger
1753
+ // resttk.data[0].processname = '退款报建流程'
1754
+ // resttk.data[0].defname = '退款'
1755
+ // this.$dispatch('apply',resttk.data[0])
1756
+ //
1757
+ // }
1758
+ //
1759
+ //
1760
+ // if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '合同'){
1761
+ // let data = {
1762
+ // tablename: 't_apply',
1763
+ // condition: `f_process_id='${this.show_data.f_process_id}'`
1764
+ // }
1765
+ // let http = new HttpResetClass()
1766
+ // let restp = await http.load(
1767
+ // 'POST',
1768
+ // `rs/sql/apply_singleTable`,
1769
+ // {data: data},
1770
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1771
+ // )
1772
+ // debugger
1773
+ // restp.data[0].processname = '散户报建流程'
1774
+ // restp.data[0].defname = '合同签订'
1775
+ // this.$dispatch('apply',restp.data[0])
1776
+ //
1777
+ // } else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && this.show_data.button.button_name === '提交'){
1778
+ // let data2 = {
1779
+ // condition: `u.id = ${this.show_data.id}`,
1780
+ // data: {
1781
+ // id: this.$login.f.id,
1782
+ // orgid: this.$login.f.orgid
1783
+ // }
1784
+ // }
1785
+ // let http = new HttpResetClass()
1786
+ // let restp1 = await http.load(
1787
+ // 'POST',
1788
+ // `rs/sql/checkuser`,
1789
+ // {data: data2},
1790
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1791
+ // )
1792
+ // debugger
1793
+ // console.log('有没有发请求打印查询的内容restp1',restp1)
1794
+ // // restp1.data[0].processname = '散户报建流程'
1795
+ // // restp1.data[0].defname = '报装缴费'
1796
+ // this.$dispatch('apply',restp1.data[0])
1797
+ // }else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装缴费' && this.show_data.button.button_name === '提交'){
1798
+ // let data3 = {
1799
+ // condition: `u.id = ${this.show_data.id}`,
1800
+ // data: {
1801
+ // id: this.$login.f.id,
1802
+ // orgid: this.$login.f.orgid
1803
+ // }
1804
+ // }
1805
+ // let http = new HttpResetClass()
1806
+ // let restp2 = await http.load(
1807
+ // 'POST',
1808
+ // `rs/sql/checkuser`,
1809
+ // {data: data3},
1810
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1811
+ // )
1812
+ // debugger
1813
+ // console.log('打印查询的内容',restp2)
1814
+ // if(restp2.length>0){
1815
+ // this.$dispatch('apply',restp2.data[0])
1816
+ // }else{
1817
+ // debugger
1818
+ // this.$dispatch('loadPage')
1819
+ // }
1820
+ // }
1821
+ // else{
1822
+ // this.$dispatch('loadPage')
1823
+ // }
1824
+ this.$dispatch('loadPage')
1825
+ },
1826
+ // 失去焦点出触发事件
1827
+ 'onchange' (index) {
1828
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1829
+ let f_user_name = this.getLableValue('用户名称')
1830
+ this.setLabelValue("用户名称", f_user_name.trim())
1831
+ if (
1832
+ this.show_data.fields[index].label === '区/县' ||
1833
+ this.show_data.fields[index].label === '街道/乡镇' ||
1834
+ this.show_data.fields[index].label === '集收单位' ||
1835
+ this.show_data.fields[index].label === '楼号/组' ||
1836
+ this.show_data.fields[index].label === '单元/排' ||
1837
+ this.show_data.fields[index].label === '楼层' ||
1838
+ this.show_data.fields[index].label === '门牌号'
1839
+ ) {
1840
+
1841
+ let f_pcd = this.getLableValue('区/县') || ''
1842
+ let f_street = this.getLableValue('街道/乡镇') || ''
1843
+ let f_residential_area = this.getLableValue('集收单位') || ''
1844
+ let f_building = this.getLableValue('楼号/组') || ''
1845
+ // let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1846
+ let f_building_suffix = f_building ? '号楼' : ''
1847
+ let f_unit = this.getLableValue('单元/排') || ''
1848
+ // let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1849
+ let f_unit_suffix = f_unit ? '单元' : ''
1850
+ let f_floor = this.getLableValue('楼层') || ''
1851
+ // let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1852
+ let f_floor_suffix = f_floor ? '层' : ''
1853
+ let f_room = this.getLableValue('门牌号') || ''
1854
+ // let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1855
+ let f_room_suffix = f_room ? '室' : ''
1856
+
1857
+ let f_address = f_pcd + f_street + f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
1858
+ this.setLabelValue("地址", f_address)
1859
+ }
1860
+ }
1861
+ },
1862
+ selectSearch (val, index) {},
1863
+ 'onblur' (index) {},
1864
+ 'oninput' (index) {},
1865
+ 'initializtionView' () {},
1866
+ async 'onchangeModal' (index, fieldIndex) {
1867
+ },
1868
+ async 'onblurModal' (index, fieldIndex) {
1869
+
1870
+ },
1871
+ async 'oninputModal' (index, fieldIndex) {
1872
+
1873
+ },
1874
+ async 'onetomanydelete' (index, rowIndex) {
1875
+
1876
+ let http = new HttpResetClass()
1877
+
1878
+ let res = await http.load(
1879
+ 'DELETE',
1880
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1881
+ null,
1882
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1883
+ )
1884
+
1885
+ res = await this.$resetpost(
1886
+ 'rs/entity/t_apply',
1887
+ this.show_data
1888
+ )
1889
+
1890
+ this.$dispatch('breakControl', this.show_data)
1891
+ },
1892
+ async 'onetomanyupdate' (index, rowIndex) {
1893
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1894
+
1895
+ this.show_data.onetomany[index].fields.forEach(item => {
1896
+ data[item.field] = item.value
1897
+ })
1898
+ let res = await this.$resetpost(
1899
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1900
+ data
1901
+ )
1902
+
1903
+ res = await this.$resetpost(
1904
+ 'rs/entity/t_apply',
1905
+ this.show_data
1906
+ )
1907
+
1908
+ this.$dispatch('breakControl', this.show_data)
1909
+ },
1910
+ async 'onetomanyadd' (index) {
1911
+ let data = {
1912
+ f_process_id : this.show_data.f_process_id,
1913
+ f_operator_id: this.$login.f.id,
1914
+ f_operator: this.$login.f.name,
1915
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1916
+ f_orgid: this.$login.f.orgid,
1917
+ f_orgname: this.$login.f.orgs
1918
+ }
1919
+ this.show_data.onetomany[index].fields.forEach(item => {
1920
+ data[item.field] = item.value
1921
+ })
1922
+ let res = await this.$resetpost(
1923
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1924
+ data
1925
+ )
1926
+
1927
+ res = await this.$resetpost(
1928
+ 'rs/entity/t_apply',
1929
+ this.show_data
1930
+ )
1931
+
1932
+ this.$dispatch('breakControl', this.show_data)
1933
+ },
1934
+ async 'importEvent' (index, table, configName, filepath) {
1935
+ let data = {
1936
+ selectdata: this.show_data,
1937
+ table: table,
1938
+ filepath: filepath,
1939
+ configName: configName,
1940
+ user: this.$login.f
1941
+ }
1942
+
1943
+ let res = await this.$resetpost(
1944
+ `rs/logic/importEvent`,
1945
+ data
1946
+ )
1947
+
1948
+ this.$dispatch('breakControl', this.show_data)
1949
+ },
1950
+ 'onbutchange' (index) {
1951
+
1952
+ },
1953
+ 'onbutblur' (index) {
1954
+
1955
+ },
1956
+ 'onbutinput' (index) {
1957
+
1958
+
1959
+ }
1960
+ },
1961
+ watch: {
1962
+ }
1963
+ }
1964
+ </script>
1965
+ <style scoped>
1966
+ /*清除model中的浮动*/
1967
+ .clearfix:after,.clearfix:before{
1968
+ display: table;
1969
+ }
1970
+ .clearfix:after{
1971
+ clear: both;
1972
+ }
1973
+ </style>