apply-clients 3.4.66 → 3.4.68

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