apply-clients 3.5.4-81 → 3.5.4-83

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