apply-clients 3.4.84 → 3.4.85

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