apply-clients 3.4.71 → 3.4.72

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