apply-clients 3.5.4-5 → 3.5.4-8

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,1383 +1,1384 @@
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
- //将千分位金额转换为数字
47
- parseCurrency(str) {
48
- if(typeof str == 'string'){
49
- return parseFloat(str.replace(/,/g, ''))
50
- }
51
- // 用正则表达式移除千分位分隔符,并转换为数字
52
- return str
53
- },
54
- //将金额转换为千分位
55
- formatCurrency(number, decimalPlaces) {
56
- var num = parseFloat(number);
57
- if (!isNaN(num)) {
58
- num = num.toFixed(decimalPlaces || 0); // 将金额保留指定位数,四舍五入
59
- num = num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 按照千分位进行分隔
60
- return num;
61
- } else {
62
- return ''; // 如果输入框中的值不是数字,则返回空字符串
63
- }
64
- },
65
- // 组件初始化操作
66
- async refurbish() {
67
- this.json_datas = this.$workflow_vue
68
- let sum = 0
69
- let jsonData = {}
70
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
71
- this.$showMessage("网络故障,请刷新页面")
72
- return
73
- }
74
- this.json_datas.activitys.forEach(item => {
75
- if (this.selectdata.defname === item.title) {
76
- jsonData = item // 拿到当前节点的json配置信息
77
- sum++ // 节点名一样的个数
78
- }
79
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
80
- })
81
-
82
- if (sum === 0) {
83
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
84
- return
85
- }
86
- if (sum > 1) {
87
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
88
- return
89
- }
90
-
91
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
92
-
93
- // fields 字段填充值
94
- for (const item of this.selectdata.fields) {
95
- if (!item.value) {
96
- item.value = null
97
- }
98
- // 如果配置类型为select,优先从参数列表获取options
99
- if (item.type === 'select' || item.type === 'checkbox') {
100
- if (item.param) {
101
- let temp = this.$appdata.getParam(item.label)
102
-
103
- if (temp && temp.length > 0) {
104
- item.options = temp
105
- }
106
-
107
- if (item.paramLabel) {
108
- temp = this.$appdata.getParam(item.paramLabel)
109
- if (temp && temp.length > 0) {
110
- item.options = temp
111
- }
112
- }
113
- }
114
-
115
- if (item.ready) {
116
- console.log(item.ready)
117
- item.options = await this[item.ready]()
118
-
119
- }
120
- if (!isEmpty(item.role)){
121
- console.log('获取对应角色的人员信息',item.role)
122
- item.options = await this.getDesignerPeople(item.role)
123
- }
124
- if (item.multiple && !isEmpty(this.selectdata[item.field])){
125
- this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
126
- }
127
- }
128
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
129
- if (item.eval) {
130
- item.value = eval(item.default)
131
- } else {
132
- item.value = item.default
133
- }
134
- }
135
-
136
- if (this.selectdata[item.field]) {
137
- // 将json字符串格式化赋值给value
138
- if (String(this.selectdata[item.field]).startsWith("{")) {
139
- item.value = JSON.parse(this.selectdata[item.field])
140
- } else {
141
- item.value = this.selectdata[item.field]
142
- }
143
- }
144
- if (this.selectdata[item.field] === 0) {
145
- item.value = 0
146
- }
147
-
148
- // datepicker
149
- if (item.type === 'datepicker' && !item.value && item.default) {
150
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
151
- }
152
-
153
- if (item.type === 'checkbox') {
154
- if (this.selectdata[item.field]) {
155
- item.value = JSON.parse(this.selectdata[item.field])
156
- } else {
157
- item.value = []
158
- }
159
- }
160
- //金额千分位
161
- if (item.percentiles) {
162
- let amount = item.value
163
- if (amount > 0) {
164
- let amounts = this.formatCurrency(amount, 2)
165
- console.log('金额千分位', amounts)
166
- item.value = amounts
167
- console.log('金额千分位1', item.value)
168
- }
169
- }
170
- this.selectdata[item.field] = item.value
171
- }
172
-
173
- // 控制组件
174
- if (this.selectdata.components) {
175
- this.selectdata.components.forEach(item => {
176
- if (!item.mark) {
177
- item.mark = 0
178
- }
179
- })
180
- }
181
- // 初始化onetomany
182
- if (this.selectdata.onetomany) {
183
- for (const item of this.selectdata.onetomany) {
184
- let res = null
185
- if (item.queryEvent) {
186
- res = this[item.queryEvent]()
187
- } else {
188
- let data = {
189
- tablename: item.tables[0],
190
- condition: `f_process_id='${this.selectdata.f_process_id}'`
191
- }
192
- res = await this.$resetpost(
193
- 'rs/sql/apply_singleTable',
194
- {data: data},
195
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
196
- )
197
- }
198
-
199
- item.rows = res.data
200
-
201
- // 初始化onetomany中的fields
202
- for (const field of item.fields) {
203
- if (!field.value) {
204
- if (field.value !== 0) {
205
- field.value = null
206
- }
207
- }
208
-
209
- if (field.default || field.default === 0) {
210
- field.value = field.default
211
- }
212
-
213
- // datepicker
214
- if (field.type === 'datepicker' && !field.value && field.default) {
215
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
216
- }
217
-
218
- if (field.type === 'select') {
219
-
220
- let temp = this.$appdata.getParam(field.label)
221
-
222
- if (temp && temp.length > 0) {
223
- field.options = temp
224
- }
225
-
226
- if (field.paramLabel) {
227
- temp = this.$appdata.getParam(field.paramLabel)
228
- if (temp && temp.length > 0) {
229
- item.options = temp
230
- }
231
- }
232
- }
233
- }
234
- }
235
- }
236
- // 初始化 buttons_fields
237
- for (const item of this.selectdata.buttons) {
238
- if (item.button_name === '下发') {
239
-
240
- let data = {
241
- source: item.source,
242
- userid: this.$login.f.id
243
- }
244
- if (item.sourceMethod) {
245
- data.source = this[item.sourceMethod]()
246
- }
247
- if (!data.source) {
248
- this.$showMessage("请配置获取人员表达式")
249
- return
250
- }
251
-
252
- let res = await this.$resetpost(
253
- 'rs/search',
254
- {data: data},
255
- {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
256
- )
257
-
258
- let options = res.data.map(source => {
259
- return {
260
- "label": source.name,
261
- "value": source.id
262
- }
263
- })
264
-
265
- if (item.button_fields.length !== 1) {
266
- this.$showMessage("下发有且只能有一个字段!!!")
267
- return
268
- }
269
-
270
- item.button_fields[0].options = options
271
- }
272
- if (item.button_fields) {
273
- item.button_fields.forEach(x => {
274
- // 如果配置类型为select,优先从参数列表获取options
275
- if (x.type === 'select') {
276
-
277
- if (x.param) {
278
- let temp = this.$appdata.getParam(x.label)
279
-
280
- if (temp && temp.length > 0) {
281
- x.options = temp
282
- }
283
-
284
- if (x.paramLabel) {
285
- temp = this.$appdata.getParam(x.paramLabel)
286
- if (temp && temp.length > 0) {
287
- x.options = temp
288
- }
289
- }
290
- }
291
-
292
- }
293
- })
294
- }
295
- }
296
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
297
- let temp = JSON.parse(JSON.stringify(this.selectdata))
298
- console.log('打印下temp',temp)
299
- this.show_data = temp
300
- for (const item of this.show_data.fields) {
301
- if(item.label=='气价名称' && !isEmpty(this.show_data.f_price_name)){
302
- if(item.label==='气价名称'){
303
- item.value=this.show_data.f_price_name
304
- }
305
- }
306
- if (this.show_data.f_apply_source === '线下发起' && (item.label === '预约地址' || item.label === '预约单号')) {
307
- item.hidden = true
308
- }
309
- }
310
- if (this.show_data.f_apply_type == '居民团体用户报建' ){
311
- if (this.show_data.f_apply_nature == '整体小区'){
312
- this.showLabels('楼房总户数')
313
- this.showLabels('楼房总栋数')
314
- this.showLabels('别墅总户数')
315
- this.hideLabels('总户数')
316
- }
317
- if (this.show_data.f_apply_nature == '整体村庄'){
318
- this.showLabels('总户数')
319
- this.hideLabels('楼房总户数')
320
- this.hideLabels('楼房总栋数')
321
- this.hideLabels('别墅总户数')
322
- }
323
- }
324
- if (this.show_data.defname == '市场部审核' || this.show_data.defname == '财务审核'){
325
- let f_due_money = this.parseCurrency(this.show_data.f_due_money)
326
- let f_cumulative_payment_money = this.parseCurrency(this.show_data.f_due_money)
327
- let f_surplus_money = this.parseCurrency(this.show_data.f_surplus_money)
328
- if (Number(f_due_money) > Number(f_cumulative_payment_money) || Number(f_surplus_money) > 0) {
329
- this.$showAlert('费用未结清!!!', 'warning', 3000)
330
- }
331
- }
332
- this.$nextTick(() => {
333
- this.showview = true
334
- })
335
- },
336
- // 金额转大写
337
- smalltoBIG(n) {
338
- let fraction = ['角', '分'];
339
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
340
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
341
- let head = n < 0 ? '欠' : '';
342
- n = Math.abs(n);
343
-
344
- let s = '';
345
-
346
- for (var i = 0; i < fraction.length; i++) {
347
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
348
- }
349
- s = s || '整';
350
- n = Math.floor(n);
351
-
352
- for (var i = 0; i < unit[0].length && n > 0; i++) {
353
- let p = '';
354
- for (var j = 0; j < unit[1].length && n > 0; j++) {
355
- p = digit[n % 10] + unit[1][j] + p;
356
- n = Math.floor(n / 10);
357
- }
358
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
359
- }
360
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
361
- },
362
- // 获取对应label的值
363
- getLableValue(label) {
364
- for (const item of this.show_data.fields) {
365
- if (item.label === label && item.type !== 'number') {
366
- return item.value || ''
367
- }
368
- if (item.label === label && item.type === 'number') {
369
- return item.value || 0
370
- }
371
- }
372
- },
373
- // 获取对应label中options的值
374
- getLableOptions(label) {
375
- for (const item of this.show_data.fields) {
376
- if (item.label === label) {
377
- return item.options
378
- }
379
- }
380
- },
381
- // 给对应label放置value值
382
- setLabelValue(label, value) {
383
- for (const item of this.show_data.fields) {
384
- if (item.label === label) {
385
- item.value = value
386
- this.show_data[item.field] = value
387
- }
388
- }
389
- },
390
- // 给对应label的options放置value值
391
- setLabelOptions(label, options) {
392
- for (const item of this.show_data.fields) {
393
- if (item.label === label) {
394
- item.options = options
395
- }
396
- }
397
- },
398
- // 显示包含labels的文本
399
- showLabels(...labels) {
400
- for (const item of this.show_data.fields) {
401
- if (labels.includes(item.label)) {
402
- item.hidden = false
403
- }
404
- }
405
- },
406
- // 隐藏包含labels的文本
407
- hideLabels(...labels) {
408
- for (const item of this.show_data.fields) {
409
- if (labels.includes(item.label)) {
410
- item.hidden = true
411
- }
412
- }
413
- },
414
- // 给对应labels的值设置为必填
415
- requiredLabels(...labels) {
416
- for (const item of this.show_data.fields) {
417
- if (labels.includes(item.label)) {
418
- item.required = true
419
- }
420
- }
421
- },
422
- // 给对应labels的值设置为不必填
423
- electiveLabels(...labels) {
424
- for (const item of this.show_data.fields) {
425
- if (labels.includes(item.label)) {
426
- item.required = false
427
- }
428
- }
429
- },
430
- // 给对应labels的值设置为只读和禁用
431
- readonlyLabels(...labels) {
432
- for (const item of this.show_data.fields) {
433
- if (labels.includes(item.label)) {
434
- item.readonly = true
435
- item.disabled = true
436
- }
437
- }
438
- },
439
- // 给对应labels的值设置为不只读和不禁用
440
- readwriteLabels(...labels) {
441
- for (const item of this.show_data.fields) {
442
- if (labels.includes(item.label)) {
443
- item.readonly = false
444
- item.disabled = false
445
- }
446
- }
447
- },
448
- // 给对应labels的值设置为禁用
449
- disabledButtons(...buttons) {
450
- for (const item of this.show_data.buttons) {
451
- if (buttons.includes(item.button_name)) {
452
- item.disabled = true
453
- }
454
- }
455
- },
456
- // 给对应labels的值设置为不禁用
457
- enableButtons(...buttons) {
458
- for (const item of this.show_data.buttons) {
459
- if (buttons.includes(item.button_name)) {
460
- item.disabled = false
461
- }
462
- }
463
- },
464
- // 显示对应按钮
465
- showButtons(...buttons) {
466
- for (const item of this.show_data.buttons) {
467
- if (buttons.includes(item.button_name)) {
468
- item.hidden = false
469
- }
470
- }
471
- },
472
- // 隐藏对应按钮
473
- hideButtons(...buttons) {
474
- for (const item of this.show_data.buttons) {
475
- if (buttons.includes(item.button_name)) {
476
- item.hidden = true
477
- }
478
- }
479
- },
480
- // 检查t_apply对应字段的值是否重复
481
- async checkDuplicate(index) {
482
- let http = new HttpResetClass()
483
- let data = {
484
- tablename: 't_apply',
485
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
486
- }
487
- let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
488
- resolveMsg: null,
489
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
490
- })
491
- if (res.data.length > 0) {
492
- this.show_data.fields[index].value = null
493
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
494
- }
495
- },
496
- // 获取片区
497
- async getSliceArea () {
498
- let data = {
499
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
500
- userid: this.$login.f.id
501
- }
502
-
503
- let http = new HttpResetClass()
504
- let res = await http.load(
505
- 'POST',
506
- `rs/search`,
507
- {data: data},
508
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
509
- )
510
-
511
- return res.data.map(item => {
512
- return {
513
- label: item.name,
514
- value: item.name
515
- }
516
- })
517
- },
518
- // 获取区县
519
- async getPcd () {
520
- let data = {
521
- tablename: 't_pcd',
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_pcd,
535
- value: item.f_pcd
536
- }
537
- })
538
- },
539
- // 获取小区
540
- async getArea () {
541
- let data = {
542
- tablename: 't_area',
543
- condition: `f_filialeid = '${this.$login.f.orgid}'`
544
- }
545
- let http = new HttpResetClass()
546
- let res = await http.load(
547
- 'POST',
548
- `rs/sql/apply_singleTable`,
549
- {data: data},
550
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
551
- )
552
-
553
- return res.data.map(item => {
554
- return {
555
- label: item.f_residential_area,
556
- value: item.f_residential_area
557
- }
558
- })
559
- },
560
- // 缴费前置
561
- chargeBefore () {
562
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
563
- this.$showAlert('费用未结清!!!', 'warning', 3000)
564
- throw null
565
- }
566
- },
567
- // 附件上传必传
568
- async uploadBefore () {
569
- let condition = `f_blobid= '${this.selectdata.f_process_id}' `
570
- let http = new HttpResetClass()
571
- let data = {
572
- tablename: 't_files',
573
- condition: condition + ` order by f_uploaddate desc `
574
- }
575
- let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
576
- warnMsg: null,
577
- resolveMsg: null
578
- })
579
- if (res.data.length = 0) {
580
- this.$showAlert('请上传附件!!!', 'warning', 3000)
581
- throw null
582
- }
583
- },
584
- // 施工前置 加表具后状态是待开通 提交后是正常 所以这里的判断条件需改正 (and uf.f_meter_classify is null and f_meternumber is null)
585
- async constructionBefore () {
586
- let http = new HttpResetClass()
587
- let data = {
588
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_meter_classify is null and f_meternumber is null`
589
- }
590
- let res = await http.load(
591
- 'POST',
592
- 'rs/sql/countApplyUserinfo',
593
- {data: data},
594
- {
595
- resolveMsg: null,
596
- rejectMsg: '安装明细查询失败!!!'
597
- })
598
- if (res.data[0].num > 0) {
599
- this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
600
- throw `还有${res.data[0].num}户未安装,无法提交`
601
- }
602
- },
603
- // 获取对应气价id的数组
604
- async getPrice (f_price_id) {
605
- console.log('=======================')
606
- console.log(f_price_id)
607
- let data = {
608
- condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
609
- }
610
- if (!isEmpty(f_price_id)) {
611
- data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
612
- }
613
- let http = new HttpResetClass()
614
- let res = await http.load(
615
- 'POST',
616
- `rs/sql/applyGetPrice`,
617
- {data: data},
618
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
619
- )
620
-
621
- let a= res.data.map(item => {
622
- return {
623
- label: item.f_price_name,
624
- value: item
625
- }
626
- })
627
- this.selectdata.fields.forEach(field => {
628
- if (field.label === '气价名称') {
629
- field.options = a}
630
- })
631
- return a
632
- },
633
- // 地址操作
634
- addressInitialization () {
635
- this.$getConfig(this, 'UserAddress')
636
-
637
- },
638
- // 街道发生改变,获取对应街道下的小区
639
- async streetChange () {
640
- if (isEmpty(this.show_data.f_street)) {
641
- return
642
- }
643
-
644
- let data = {
645
- tablename: 't_area',
646
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
647
- }
648
- let http = new HttpResetClass()
649
- let res = await http.load(
650
- 'POST',
651
- `rs/sql/apply_singleTable`,
652
- {data: data},
653
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
654
- )
655
-
656
- this.setLabelOptions('小区', res.data.map(item => {
657
- return {
658
- label: item.f_residential_area,
659
- value: item.f_residential_area
660
- }
661
- }))
662
- },
663
- async searchbuilding () {
664
- if (isEmpty(this.show_data.f_residential_area)) {
665
- return
666
- }
667
- let data = {
668
- tablename: 't_building',
669
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${this.show_data.f_residential_area}%'`
670
- }
671
- let http = new HttpResetClass()
672
- let res = await http.load(
673
- 'POST',
674
- `rs/sql/apply_singleTable`,
675
- {data: data},
676
- {resolveMsg: null, rejectMsg: '楼号查询失败!!!'}
677
- )
678
-
679
- if (res.data.length === 0) {
680
- return
681
- }
682
-
683
- this.setLabelOptions('楼号/组', res.data.map(item => {
684
- return {
685
- label: item.f_building,
686
- value: item.f_building
687
- }
688
- }))
689
- },
690
- // 地址类型发生改变,获取对应的街道/乡镇
691
- async pcdChange () {
692
- if (isEmpty(this.show_data.f_pcd)) {
693
- return
694
- }
695
-
696
- let data = {
697
- tablename: 't_street',
698
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
699
- }
700
-
701
- let http = new HttpResetClass()
702
- let res = await http.load(
703
- 'POST',
704
- `rs/sql/apply_singleTable`,
705
- {data: data},
706
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
707
- )
708
-
709
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
710
- return {
711
- label: item.f_street,
712
- value: item.f_street
713
- }
714
- }))
715
- },
716
- // 获取当前分公司下拥有role角色的人员
717
- async getDesignerPeople (role) {
718
- let data = {
719
- source: 'this.getParentByType($organization$).getChildByName($'+role+"$).getChildren()",
720
- userid: this.$login.f.id
721
- }
722
-
723
- let http = new HttpResetClass()
724
- let res = await http.load(
725
- 'POST',
726
- `rs/search`,
727
- {data: data},
728
- {resolveMsg: null, rejectMsg: '人员查询失败!!!'}
729
- )
730
-
731
- return res.data.map(item => {
732
- return {
733
- label: item.name,
734
- value: item.name
735
- }
736
- })
737
- },
738
- // 终止报建 reason--终止原因
739
- async surveyStopApply (reason) {
740
- console.log('终止报建!!!!!')
741
-
742
- this.show_data.f_stop_reason = reason
743
-
744
- let data = {
745
- data: this.show_data,
746
- user: this.$login.f
747
- }
748
-
749
- let res = await this.$resetpost(
750
- `rs/logic/surveyStopApply`,
751
- {data: data},
752
- {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
753
- )
754
-
755
- this.$dispatch('loadPage')
756
-
757
- throw '终止报建!!!'
758
- },
759
-
760
- PrefixInteger(num, n) {
761
- return (Array(n).join(0) + num).slice(-n);
762
- }
763
- },
764
- events: {
765
- 'priceType'(index){
766
- this.Pricetype = this.getLableValue('所属类型')
767
- console.log('打印方法值',this.getPrice(this.show_data.f_price_id))
768
- for (const item of this.show_data.fields) {
769
- if (this.show_data.f_sprice_type !=null && this.show_data.f_sprice_type !='') {
770
- if(item.label==='气价名称'){
771
- this.getPrice().then(value =>{
772
- item.options=value
773
- })
774
- console.log('最终',item.options)
775
- }
776
- }
777
- }
778
- },
779
- 'complyInstallation' (index) {
780
- if (this.show_data.f_apply_type == '居民团体用户报建' ){
781
- if (this.show_data.f_apply_nature == '整体小区'){
782
- this.showLabels('楼房总户数')
783
- this.showLabels('楼房总栋数')
784
- this.showLabels('别墅总户数')
785
- this.hideLabels('总户数')
786
- }
787
- if (this.show_data.f_apply_nature == '整体村庄'){
788
- this.showLabels('总户数')
789
- this.hideLabels('楼房总户数')
790
- this.hideLabels('楼房总栋数')
791
- this.hideLabels('别墅总户数')
792
- }
793
- }
794
- },
795
- async 'igniteDispatchReadyEvent' () {
796
- let data = {
797
- tablename: 'activityins',
798
- condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
799
- }
800
- let http = new HttpResetClass()
801
- let res = await http.load(
802
- 'POST',
803
- `rs/sql/apply_singleTable`,
804
- {data: data},
805
- {resolveMsg: null, rejectMsg: '查询失败!!!'}
806
- )
807
- if (res.data.length <= 0) {
808
- console.log('+++++++++++++++++++++++++++++')
809
- console.log('没有施工,不能退回')
810
- this.hideButtons('退回')
811
- }
812
- },
813
- 'buildReadyEvent' () {
814
- },
815
- // 选择材料
816
- async materialNameChenge (index, fieldIndex) {
817
- let material = this.show_data.onetomany[index].fields[fieldIndex].value
818
-
819
- this.show_data.onetomany[index].fields.forEach(item => {
820
- if (material[item.field]) {
821
- item.value = material[item.field]
822
- }
823
- })
824
- },
825
- // 打开模态框获取材料
826
- async 'getMaterialName' (index) {
827
- let data = {
828
- condition: `1=1`
829
- }
830
- let http = new HttpResetClass()
831
- let res = await http.load(
832
- 'POST',
833
- `rs/sql/getStockMaterial`,
834
- {data: data},
835
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
836
- )
837
-
838
- this.show_data.onetomany[index].fields.forEach(field => {
839
- if (field.label === '选择材料') {
840
- field.options = res.data.map(item => {
841
- return {
842
- 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
843
- 'value': item
844
- }
845
- })
846
- }
847
- })
848
- },
849
- // 搜索小区
850
- async 'searchArea' (area, index) {
851
- let data = {
852
- tablename: 't_area',
853
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
854
- }
855
- let http = new HttpResetClass()
856
- let res = await http.load(
857
- 'POST',
858
- `rs/sql/apply_singleTable`,
859
- {data: data},
860
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
861
- )
862
-
863
- if (res.data.length === 0) {
864
- return
865
- }
866
-
867
- this.setLabelOptions('小区', res.data.map(item => {
868
- return {
869
- label: item.f_residential_area,
870
- value: item.f_residential_area
871
- }
872
- }))
873
- },
874
- // 搜索小区
875
- async 'searchAreaCollective' (area, index) {
876
- let data = {
877
- tablename: 't_area',
878
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${area}%'`
879
- }
880
- let http = new HttpResetClass()
881
- let res = await http.load(
882
- 'POST',
883
- `rs/sql/apply_singleTable`,
884
- {data: data},
885
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
886
- )
887
-
888
- if (res.data.length === 0) {
889
- return
890
- }
891
-
892
- this.setLabelOptions('小区', res.data.map(item => {
893
- return {
894
- label: item.f_residential_area,
895
- value: item.f_residential_area
896
- }
897
- }))
898
- },
899
- // 选择气价
900
- 'priceChange' (index) {
901
- if (isEmpty(this.show_data.stairPrice)) {
902
- return
903
- }
904
-
905
- let stairPrice = this.getLableValue('气价名称')
906
-
907
- this.setLabelValue('气价类型', stairPrice.f_price_type)
908
- this.setLabelValue('用气性质', stairPrice.f_gasproperties)
909
- this.setLabelValue('价格', stairPrice.f_price)
910
- this.setLabelValue('客户类型', stairPrice.f_user_type)
911
- this.show_data.f_price_id = stairPrice.id
912
- this.show_data.f_price_name = stairPrice.f_price_name
913
- },
914
- // 退款金额
915
- 'refundMoneyChange' (index) {
916
- let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
917
- let f_refund_money = this.show_data.fields[index].value
918
-
919
- if (f_refund_money > f_cumulative_payment_money) {
920
- this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
921
- this.show_data.fields[index].value = null
922
- }
923
- },
924
- // 检查重复
925
- 'checkRepeat' (index) {
926
- this.checkDuplicate(index)
927
- },
928
- // 选择报建项目
929
- 'selectApply' (row) {
930
- this.setLabelValue('工程名称', row.f_entry_name)
931
- this.setLabelValue('工程编号', row.f_apply_num)
932
- this.setLabelValue('报建类型', row.f_apply_type)
933
- this.setLabelValue('客户名称', row.f_user_name)
934
- this.setLabelValue('客户电话', row.f_phone)
935
- this.setLabelValue('证件类型', row.f_credentials)
936
- this.setLabelValue('证件号码', row.f_idnumber)
937
- this.setLabelValue('地址', row.f_address)
938
- this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
939
-
940
- this.show_data.parentApply = JSON.parse(JSON.stringify(row))
941
-
942
- delete row.id
943
- delete row.actid
944
- delete row.defid
945
- delete row.defname
946
- delete row.version
947
- delete row.f_apply_num
948
- delete row.f_sub_state
949
- delete row.f_apply_type
950
- delete row.f_process_id
951
-
952
- this.show_data = Object.assign({}, this.show_data, row)
953
-
954
- this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
955
- },
956
- // 是否终止
957
- 'isStopChange' (index) {
958
- let f_is_stop = this.show_data.f_is_stop
959
-
960
- for (const item of this.show_data.fields) {
961
- if (f_is_stop === '是') {
962
- if (item.label === '终止原因') {
963
- item.hidden = false
964
- item.required = true
965
- }
966
- } else {
967
- if (item.label === '终止原因') {
968
- item.hidden = true
969
- item.required = false
970
- }
971
- }
972
- }
973
- },
974
- // 终止报建初始化
975
- async 'stopApplyReadyEvent' () {
976
-
977
- let f_is_stop = this.getLableValue('是否终止')
978
-
979
- for (const item of this.show_data.fields) {
980
- if (f_is_stop === '是') {
981
- if (item.label === '终止原因') {
982
- item.hidden = false
983
- item.required = true
984
- }
985
- } else {
986
- if (item.label === '终止原因') {
987
- item.hidden = true
988
- item.required = false
989
- }
990
- }
991
- }
992
-
993
- if (isEmpty(this.show_data.f_parent_process_id)) {
994
- return
995
- }
996
- let data = {
997
- condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
998
- data: {
999
- id: this.$login.f.id,
1000
- orgid: this.$login.f.orgid
1001
- }
1002
- }
1003
- let res = await this.$resetpost(
1004
- `rs/sql/supervisory`,
1005
- {data: data},
1006
- {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
1007
- )
1008
- this.show_data.parentApply = res.data[0]
1009
- },
1010
- // 选择客户档案信息
1011
- 'selectUserinfo' (row) {
1012
- this.setLabelValue('客户编号', row.f_userinfo_code)
1013
- this.setLabelValue('客户名称', row.f_user_name)
1014
- this.setLabelValue('客户电话', row.f_user_phone)
1015
- this.setLabelValue('证件类型', row.f_credentials)
1016
- this.setLabelValue('证件号码', row.f_idnumber)
1017
- this.setLabelValue('地址', row.f_address)
1018
-
1019
- this.show_data.f_userinfo_id = row.f_userinfo_id
1020
- this.show_data.f_userinfo_code = row.f_userinfo_code
1021
- this.show_data.f_entry_number = row.f_enter_number
1022
- this.show_data.f_pcd = row.f_pcd
1023
- this.show_data.f_street = row.f_street
1024
- this.show_data.f_residential_area = row.f_residential_area
1025
- this.show_data.f_building = row.f_building
1026
- this.show_data.f_unit = row.f_unit
1027
- this.show_data.f_floor = row.f_floor
1028
- this.show_data.f_room = row.f_room
1029
- this.show_data.f_room_suffix = row.f_room_suffix
1030
- },
1031
- // 通气点火初始化
1032
- async 'gasReadyEvent' () {
1033
- // 是否有气价信息
1034
- if (!isEmpty(this.show_data.f_price_id)) {
1035
- let priceList = await this.getPrice(this.show_data.f_price_id)
1036
- this.setLabelValue('气价名称', priceList[0].value)
1037
- }
1038
- },
1039
- // 合同金额失去焦点
1040
- async 'contractMoneyChange' (index) {
1041
- let data = {
1042
- operator: '+',
1043
- num1: this.show_data.f_contract_money || 0,
1044
- num2: this.getLableValue('追加金额') || 0
1045
- }
1046
- let res = await this.$resetpost(
1047
- `rs/logic/compute`,
1048
- {data: data},
1049
- {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1050
- )
1051
- //转成千分位
1052
- let money= this.formatCurrency(res.data,2)
1053
- this.setLabelValue('应交金额', money)
1054
- //合同金额
1055
- let contract= this.formatCurrency( this.show_data.f_contract_money,2)
1056
- this.setLabelValue('合同金额', contract)
1057
- },
1058
- // 街道失去焦点
1059
- async 'streetChange' (index) {
1060
- if (isEmpty(this.show_data.f_street)) {
1061
- return
1062
- }
1063
-
1064
- this.setLabelValue('小区', null)
1065
-
1066
- let data = {
1067
- tablename: 't_area',
1068
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1069
- }
1070
- let http = new HttpResetClass()
1071
- let res = await http.load(
1072
- 'POST',
1073
- `rs/sql/apply_singleTable`,
1074
- {data: data},
1075
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
1076
- )
1077
-
1078
- this.setLabelOptions('小区', res.data.map(item => {
1079
- return {
1080
- label: item.f_residential_area,
1081
- value: item.f_residential_area
1082
- }
1083
- }))
1084
- },
1085
- // 区县失去焦点
1086
- async 'pcdChange' (index) {
1087
- if (isEmpty(this.show_data.f_pcd)) {
1088
- return
1089
- }
1090
-
1091
- this.setLabelValue('街道/乡镇', null)
1092
- this.setLabelValue('小区', null)
1093
-
1094
-
1095
-
1096
- let data = {
1097
- tablename: 't_street',
1098
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1099
- }
1100
- let f_address_type = this.getLableValue('地址类型')
1101
-
1102
- if (f_address_type === '民用市区') {
1103
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1104
- }
1105
- if (f_address_type === '民用乡镇') {
1106
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1107
- }
1108
-
1109
- let http = new HttpResetClass()
1110
- let res = await http.load(
1111
- 'POST',
1112
- `rs/sql/apply_singleTable`,
1113
- {data: data},
1114
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1115
- )
1116
-
1117
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
1118
- return {
1119
- label: item.f_street,
1120
- value: item.f_street
1121
- }
1122
- }))
1123
- },
1124
- // 搜索楼号
1125
- async 'searchbuilding' (index) {
1126
- this.setLabelValue('楼号/组', null)
1127
- let data = {
1128
- tablename: 't_building',
1129
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${this.show_data.f_residential_area}%'`
1130
- }
1131
- let http = new HttpResetClass()
1132
- let res = await http.load(
1133
- 'POST',
1134
- `rs/sql/apply_singleTable`,
1135
- {data: data},
1136
- {resolveMsg: null, rejectMsg: '楼号查询失败!!!'}
1137
- )
1138
-
1139
- if (res.data.length === 0) {
1140
- return
1141
- }
1142
-
1143
- this.setLabelOptions('楼号/组', res.data.map(item => {
1144
- return {
1145
- label: item.f_building,
1146
- value: item.f_building
1147
- }
1148
- }))
1149
- },
1150
- // 地址类型失去焦点
1151
- 'addressTypeChange' (index) {
1152
- },
1153
- // 居民团体单户报建初始化
1154
- 'apply2ReadyEvent' () {
1155
- if (this.show_data.f_apply_source === '线下发起') {
1156
- this.addressInitialization()
1157
- this.hideLabels('客户编号')
1158
- this.electiveLabels('客户编号')
1159
- this.showLabels('片区', '地址类型')
1160
- this.requiredLabels('片区', '地址类型')
1161
- }
1162
- if (this.show_data.f_apply_source === '自动发起') {
1163
- this.hideLabels('片区', '地址类型')
1164
- this.electiveLabels('片区', '地址类型',)
1165
- }
1166
- },
1167
- // 申请节点初始化
1168
- 'applyReadyEvent' () {
1169
- this.addressInitialization()
1170
- this.pcdChange()
1171
- this.streetChange()
1172
- this.searchbuilding()
1173
- },
1174
- // ===========================================
1175
- async 'button'() {
1176
- if (this.show_data.button.before) {
1177
- await this[this.show_data.button.before]()
1178
- }
1179
- // 点击重置按钮就重置数据
1180
- if (this.show_data.button.button_name === '重置') {
1181
- this.$dispatch('breakControl', this.selectdata)
1182
- return
1183
- }
1184
- if ((this.show_data.f_apply_type == '居民用户报建' || this.show_data.f_apply_type == '非居用户报建' || this.show_data.f_apply_type == '其他报建' ) && this.show_data.defname == '报装申请' && this.show_data.f_is_have == '否' && this.show_data.button.button_name == '提交' ){
1185
- this.show_data.button.button_name = '跳过'
1186
- }
1187
- this.show_data.user = this.$login.f
1188
- this.show_data.start_activity = this.$workflow_vue.start_activity
1189
- this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1190
- //将千分位金额转成数字
1191
- for (const item of this.show_data.fields) {
1192
- if (item.percentiles) {
1193
- if(item.value.includes(",")){
1194
- let Money=this.parseCurrency(item.value)
1195
- this.show_data[item.field]=Money
1196
- debugger
1197
- }else{
1198
- //转为数字
1199
- let Money= Number(item.value)
1200
- this.show_data[item.field]=Money
1201
- debugger
1202
- }
1203
- }
1204
- }
1205
- let res = await this.$resetpost(
1206
- `rs/logic/ApplyProductService`,
1207
- {data: this.show_data},
1208
- {resolveMsg: null, rejectMsg: '数据保存失败'}
1209
- )
1210
-
1211
- if (this.show_data.button.after) {
1212
- this[this.show_data.button.after]()
1213
- }
1214
- this.$dispatch('loadPage')
1215
- },
1216
- // 失去焦点出触发事件
1217
- 'onchange' (index) {
1218
- let http = new HttpResetClass()
1219
- if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1220
-
1221
- if (
1222
- this.show_data.fields[index].label === '区/县' ||
1223
- this.show_data.fields[index].label === '街道/乡镇' ||
1224
- this.show_data.fields[index].label === '小区' ||
1225
- this.show_data.fields[index].label === '楼号/组' ||
1226
- this.show_data.fields[index].label === '单元/排' ||
1227
- this.show_data.fields[index].label === '楼层' ||
1228
- this.show_data.fields[index].label === '门牌号' ||
1229
- this.show_data.fields[index].label === '地址杂项'
1230
- ) {
1231
- if (this.show_data.fields[index].label === '单元/排' || this.show_data.fields[index].label === '楼层' || this.show_data.fields[index].label === '门牌号'){
1232
- if (this.show_data.fields[index].value.length == 1){
1233
- this.show_data.fields[index].value = '0'+ this.show_data.fields[index].value
1234
- }
1235
- }
1236
- console.log('地址参数',this.config)
1237
- let f_pcd = this.getLableValue('区/县') || ''
1238
- let f_street = this.getLableValue('街道/乡镇') || ''
1239
- let f_residential_area = this.getLableValue('小区') || ''
1240
- let f_building = this.getLableValue('楼号/组') || ''
1241
- let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1242
- //let f_building_suffix = f_building ? '号楼' : ''
1243
- let f_unit = this.getLableValue('单元/排') || ''
1244
- let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1245
- //let f_unit_suffix = f_unit ? '单元' : ''
1246
- let f_floor = this.getLableValue('楼层') || ''
1247
- let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1248
- //let f_floor_suffix = f_floor ? '层' : ''
1249
- let f_room = this.getLableValue('门牌号') || ''
1250
- //let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1251
- //let f_room_suffix = f_room ? '室' : ''
1252
- let f_room_suffix = this.getLableValue('地址杂项') || ''
1253
-
1254
- 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
1255
- this.setLabelValue("地址", f_address)
1256
- }
1257
- }
1258
- if (this.show_data.fields[index].label == '入户证号'){
1259
- let data = {
1260
- tablename: `t_apply`,
1261
- condition: `f_entry_number='${this.show_data.fields[index].value}' and f_sub_state in ('正在进行','完工')`
1262
- }
1263
- http.load('post','rs/sql/apply_singleTable',{data: data},
1264
- {resolveMsg: null, rejectMsg: '查询失败'}).then(row=>{
1265
- if (row.data.length > 0){
1266
- this.$showMessage('请注意入户证号重复!!!')
1267
- }
1268
- })
1269
- }
1270
- },
1271
- selectSearch (val, index) {},
1272
- 'onblur' (index) {},
1273
- 'oninput' (index) {
1274
- },
1275
- 'initializtionView' () {},
1276
- async 'onchangeModal' (index, fieldIndex) {
1277
- },
1278
- async 'onblurModal' (index, fieldIndex) {
1279
-
1280
- },
1281
- async 'oninputModal' (index, fieldIndex) {
1282
-
1283
- },
1284
- async 'onetomanydelete' (index, rowIndex) {
1285
-
1286
- let http = new HttpResetClass()
1287
-
1288
- let res = await http.load(
1289
- 'DELETE',
1290
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1291
- null,
1292
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
1293
- )
1294
-
1295
- res = await this.$resetpost(
1296
- 'rs/entity/t_apply',
1297
- this.show_data
1298
- )
1299
-
1300
- this.$dispatch('breakControl', this.show_data)
1301
- },
1302
- async 'onetomanyupdate' (index, rowIndex) {
1303
- let data = this.show_data.onetomany[index].rows[rowIndex]
1304
-
1305
- this.show_data.onetomany[index].fields.forEach(item => {
1306
- data[item.field] = item.value
1307
- })
1308
- let res = await this.$resetpost(
1309
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1310
- data
1311
- )
1312
-
1313
- res = await this.$resetpost(
1314
- 'rs/entity/t_apply',
1315
- this.show_data
1316
- )
1317
-
1318
- this.$dispatch('breakControl', this.show_data)
1319
- },
1320
- async 'onetomanyadd' (index) {
1321
- let data = {
1322
- f_process_id : this.show_data.f_process_id,
1323
- f_operator_id: this.$login.f.id,
1324
- f_operator: this.$login.f.name,
1325
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1326
- f_orgid: this.$login.f.orgid,
1327
- f_orgname: this.$login.f.orgs
1328
- }
1329
- this.show_data.onetomany[index].fields.forEach(item => {
1330
- data[item.field] = item.value
1331
- })
1332
- let res = await this.$resetpost(
1333
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1334
- data
1335
- )
1336
-
1337
- res = await this.$resetpost(
1338
- 'rs/entity/t_apply',
1339
- this.show_data
1340
- )
1341
-
1342
- this.$dispatch('breakControl', this.show_data)
1343
- },
1344
- async 'importEvent' (index, table, configName, filepath) {
1345
- let data = {
1346
- selectdata: this.show_data,
1347
- table: table,
1348
- filepath: filepath,
1349
- configName: configName,
1350
- user: this.$login.f
1351
- }
1352
-
1353
- let res = await this.$resetpost(
1354
- `rs/logic/importEvent`,
1355
- data
1356
- )
1357
-
1358
- this.$dispatch('breakControl', this.show_data)
1359
- },
1360
- 'onbutchange' (index) {
1361
-
1362
- },
1363
- 'onbutblur' (index) {
1364
-
1365
- },
1366
- 'onbutinput' (index) {
1367
-
1368
-
1369
- }
1370
- },
1371
- watch: {
1372
- }
1373
- }
1374
- </script>
1375
- <style scoped>
1376
- /*清除model中的浮动*/
1377
- .clearfix:after,.clearfix:before{
1378
- display: table;
1379
- }
1380
- .clearfix:after{
1381
- clear: both;
1382
- }
1383
- </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
+ //将千分位金额转换为数字
47
+ parseCurrency(str) {
48
+ if(typeof str == 'string'){
49
+ return parseFloat(str.replace(/,/g, ''))
50
+ }
51
+ // 用正则表达式移除千分位分隔符,并转换为数字
52
+ return str
53
+ },
54
+ //将金额转换为千分位
55
+ formatCurrency(number, decimalPlaces) {
56
+ var num = parseFloat(number);
57
+ if (!isNaN(num)) {
58
+ num = num.toFixed(decimalPlaces || 0); // 将金额保留指定位数,四舍五入
59
+ num = num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 按照千分位进行分隔
60
+ return num;
61
+ } else {
62
+ return ''; // 如果输入框中的值不是数字,则返回空字符串
63
+ }
64
+ },
65
+ // 组件初始化操作
66
+ async refurbish() {
67
+ this.json_datas = this.$workflow_vue
68
+ let sum = 0
69
+ let jsonData = {}
70
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
71
+ this.$showMessage("网络故障,请刷新页面")
72
+ return
73
+ }
74
+ this.json_datas.activitys.forEach(item => {
75
+ if (this.selectdata.defname === item.title) {
76
+ jsonData = item // 拿到当前节点的json配置信息
77
+ sum++ // 节点名一样的个数
78
+ }
79
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
80
+ })
81
+
82
+ if (sum === 0) {
83
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
84
+ return
85
+ }
86
+ if (sum > 1) {
87
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
88
+ return
89
+ }
90
+
91
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
92
+
93
+ // fields 字段填充值
94
+ for (const item of this.selectdata.fields) {
95
+ if (!item.value) {
96
+ item.value = null
97
+ }
98
+ // 如果配置类型为select,优先从参数列表获取options
99
+ if (item.type === 'select' || item.type === 'checkbox') {
100
+ if (item.param) {
101
+ let temp = this.$appdata.getParam(item.label)
102
+
103
+ if (temp && temp.length > 0) {
104
+ item.options = temp
105
+ }
106
+
107
+ if (item.paramLabel) {
108
+ temp = this.$appdata.getParam(item.paramLabel)
109
+ if (temp && temp.length > 0) {
110
+ item.options = temp
111
+ }
112
+ }
113
+ }
114
+
115
+ if (item.ready) {
116
+ console.log(item.ready)
117
+ item.options = await this[item.ready]()
118
+
119
+ }
120
+ if (!isEmpty(item.role)){
121
+ console.log('获取对应角色的人员信息',item.role)
122
+ item.options = await this.getDesignerPeople(item.role)
123
+ }
124
+ if (item.multiple && !isEmpty(this.selectdata[item.field])){
125
+ this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
126
+ }
127
+ }
128
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
129
+ if (item.eval) {
130
+ item.value = eval(item.default)
131
+ } else {
132
+ item.value = item.default
133
+ }
134
+ }
135
+
136
+ if (this.selectdata[item.field]) {
137
+ // 将json字符串格式化赋值给value
138
+ if (String(this.selectdata[item.field]).startsWith("{")) {
139
+ item.value = JSON.parse(this.selectdata[item.field])
140
+ } else {
141
+ item.value = this.selectdata[item.field]
142
+ }
143
+ }
144
+ if (this.selectdata[item.field] === 0) {
145
+ item.value = 0
146
+ }
147
+
148
+ // datepicker
149
+ if (item.type === 'datepicker' && !item.value && item.default) {
150
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
151
+ }
152
+
153
+ if (item.type === 'checkbox') {
154
+ if (this.selectdata[item.field]) {
155
+ item.value = JSON.parse(this.selectdata[item.field])
156
+ } else {
157
+ item.value = []
158
+ }
159
+ }
160
+ //金额千分位
161
+ if (item.percentiles) {
162
+ let amount = item.value
163
+ if (amount > 0) {
164
+ let amounts = this.formatCurrency(amount, 2)
165
+ console.log('金额千分位', amounts)
166
+ item.value = amounts
167
+ console.log('金额千分位1', item.value)
168
+ }
169
+ }
170
+ this.selectdata[item.field] = item.value
171
+ }
172
+
173
+ // 控制组件
174
+ if (this.selectdata.components) {
175
+ this.selectdata.components.forEach(item => {
176
+ if (!item.mark) {
177
+ item.mark = 0
178
+ }
179
+ })
180
+ }
181
+ // 初始化onetomany
182
+ if (this.selectdata.onetomany) {
183
+ for (const item of this.selectdata.onetomany) {
184
+ let res = null
185
+ if (item.queryEvent) {
186
+ res = this[item.queryEvent]()
187
+ } else {
188
+ let data = {
189
+ tablename: item.tables[0],
190
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
191
+ }
192
+ res = await this.$resetpost(
193
+ 'rs/sql/apply_singleTable',
194
+ {data: data},
195
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
196
+ )
197
+ }
198
+
199
+ item.rows = res.data
200
+
201
+ // 初始化onetomany中的fields
202
+ for (const field of item.fields) {
203
+ if (!field.value) {
204
+ if (field.value !== 0) {
205
+ field.value = null
206
+ }
207
+ }
208
+
209
+ if (field.default || field.default === 0) {
210
+ field.value = field.default
211
+ }
212
+
213
+ // datepicker
214
+ if (field.type === 'datepicker' && !field.value && field.default) {
215
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
216
+ }
217
+
218
+ if (field.type === 'select') {
219
+
220
+ let temp = this.$appdata.getParam(field.label)
221
+
222
+ if (temp && temp.length > 0) {
223
+ field.options = temp
224
+ }
225
+
226
+ if (field.paramLabel) {
227
+ temp = this.$appdata.getParam(field.paramLabel)
228
+ if (temp && temp.length > 0) {
229
+ item.options = temp
230
+ }
231
+ }
232
+ }
233
+ }
234
+ }
235
+ }
236
+ // 初始化 buttons_fields
237
+ for (const item of this.selectdata.buttons) {
238
+ if (item.button_name === '下发') {
239
+
240
+ let data = {
241
+ source: item.source,
242
+ userid: this.$login.f.id
243
+ }
244
+ if (item.sourceMethod) {
245
+ data.source = this[item.sourceMethod]()
246
+ }
247
+ if (!data.source) {
248
+ this.$showMessage("请配置获取人员表达式")
249
+ return
250
+ }
251
+
252
+ let res = await this.$resetpost(
253
+ 'rs/search',
254
+ {data: data},
255
+ {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
256
+ )
257
+
258
+ let options = res.data.map(source => {
259
+ return {
260
+ "label": source.name,
261
+ "value": source.id
262
+ }
263
+ })
264
+
265
+ if (item.button_fields.length !== 1) {
266
+ this.$showMessage("下发有且只能有一个字段!!!")
267
+ return
268
+ }
269
+
270
+ item.button_fields[0].options = options
271
+ }
272
+ if (item.button_fields) {
273
+ item.button_fields.forEach(x => {
274
+ // 如果配置类型为select,优先从参数列表获取options
275
+ if (x.type === 'select') {
276
+
277
+ if (x.param) {
278
+ let temp = this.$appdata.getParam(x.label)
279
+
280
+ if (temp && temp.length > 0) {
281
+ x.options = temp
282
+ }
283
+
284
+ if (x.paramLabel) {
285
+ temp = this.$appdata.getParam(x.paramLabel)
286
+ if (temp && temp.length > 0) {
287
+ x.options = temp
288
+ }
289
+ }
290
+ }
291
+
292
+ }
293
+ })
294
+ }
295
+ }
296
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
297
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
298
+ console.log('打印下temp',temp)
299
+ this.show_data = temp
300
+ for (const item of this.show_data.fields) {
301
+ if(item.label=='气价名称' && !isEmpty(this.show_data.f_price_name)){
302
+ if(item.label==='气价名称'){
303
+ item.value=this.show_data.f_price_name
304
+ }
305
+ }
306
+ if (this.show_data.f_apply_source === '线下发起' && (item.label === '预约地址' || item.label === '预约单号')) {
307
+ item.hidden = true
308
+ }
309
+ }
310
+ if (this.show_data.f_apply_type == '居民团体用户报建' ){
311
+ if (this.show_data.f_apply_nature == '整体小区'){
312
+ this.showLabels('楼房总户数')
313
+ this.showLabels('楼房总栋数')
314
+ this.showLabels('别墅总户数')
315
+ this.hideLabels('总户数')
316
+ }
317
+ if (this.show_data.f_apply_nature == '整体村庄'){
318
+ this.showLabels('总户数')
319
+ this.hideLabels('楼房总户数')
320
+ this.hideLabels('楼房总栋数')
321
+ this.hideLabels('别墅总户数')
322
+ }
323
+ }
324
+ if (this.show_data.defname == '市场部审核' || this.show_data.defname == '财务审核'){
325
+ let f_due_money = this.parseCurrency(this.show_data.f_due_money)
326
+ let f_cumulative_payment_money = this.parseCurrency(this.show_data.f_due_money)
327
+ let f_surplus_money = this.parseCurrency(this.show_data.f_surplus_money)
328
+ if (Number(f_due_money) > Number(f_cumulative_payment_money) || Number(f_surplus_money) > 0) {
329
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
330
+ }
331
+ }
332
+ this.$nextTick(() => {
333
+ this.showview = true
334
+ })
335
+ },
336
+ // 金额转大写
337
+ smalltoBIG(n) {
338
+ let fraction = ['角', '分'];
339
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
340
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
341
+ let head = n < 0 ? '欠' : '';
342
+ n = Math.abs(n);
343
+
344
+ let s = '';
345
+
346
+ for (var i = 0; i < fraction.length; i++) {
347
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
348
+ }
349
+ s = s || '整';
350
+ n = Math.floor(n);
351
+
352
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
353
+ let p = '';
354
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
355
+ p = digit[n % 10] + unit[1][j] + p;
356
+ n = Math.floor(n / 10);
357
+ }
358
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
359
+ }
360
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
361
+ },
362
+ // 获取对应label的值
363
+ getLableValue(label) {
364
+ for (const item of this.show_data.fields) {
365
+ if (item.label === label && item.type !== 'number') {
366
+ return item.value || ''
367
+ }
368
+ if (item.label === label && item.type === 'number') {
369
+ return item.value || 0
370
+ }
371
+ }
372
+ },
373
+ // 获取对应label中options的值
374
+ getLableOptions(label) {
375
+ for (const item of this.show_data.fields) {
376
+ if (item.label === label) {
377
+ return item.options
378
+ }
379
+ }
380
+ },
381
+ // 给对应label放置value值
382
+ setLabelValue(label, value) {
383
+ for (const item of this.show_data.fields) {
384
+ if (item.label === label) {
385
+ item.value = value
386
+ this.show_data[item.field] = value
387
+ }
388
+ }
389
+ },
390
+ // 给对应label的options放置value值
391
+ setLabelOptions(label, options) {
392
+ for (const item of this.show_data.fields) {
393
+ if (item.label === label) {
394
+ item.options = options
395
+ }
396
+ }
397
+ },
398
+ // 显示包含labels的文本
399
+ showLabels(...labels) {
400
+ for (const item of this.show_data.fields) {
401
+ if (labels.includes(item.label)) {
402
+ item.hidden = false
403
+ }
404
+ }
405
+ },
406
+ // 隐藏包含labels的文本
407
+ hideLabels(...labels) {
408
+ for (const item of this.show_data.fields) {
409
+ if (labels.includes(item.label)) {
410
+ item.hidden = true
411
+ }
412
+ }
413
+ },
414
+ // 给对应labels的值设置为必填
415
+ requiredLabels(...labels) {
416
+ for (const item of this.show_data.fields) {
417
+ if (labels.includes(item.label)) {
418
+ item.required = true
419
+ }
420
+ }
421
+ },
422
+ // 给对应labels的值设置为不必填
423
+ electiveLabels(...labels) {
424
+ for (const item of this.show_data.fields) {
425
+ if (labels.includes(item.label)) {
426
+ item.required = false
427
+ }
428
+ }
429
+ },
430
+ // 给对应labels的值设置为只读和禁用
431
+ readonlyLabels(...labels) {
432
+ for (const item of this.show_data.fields) {
433
+ if (labels.includes(item.label)) {
434
+ item.readonly = true
435
+ item.disabled = true
436
+ }
437
+ }
438
+ },
439
+ // 给对应labels的值设置为不只读和不禁用
440
+ readwriteLabels(...labels) {
441
+ for (const item of this.show_data.fields) {
442
+ if (labels.includes(item.label)) {
443
+ item.readonly = false
444
+ item.disabled = false
445
+ }
446
+ }
447
+ },
448
+ // 给对应labels的值设置为禁用
449
+ disabledButtons(...buttons) {
450
+ for (const item of this.show_data.buttons) {
451
+ if (buttons.includes(item.button_name)) {
452
+ item.disabled = true
453
+ }
454
+ }
455
+ },
456
+ // 给对应labels的值设置为不禁用
457
+ enableButtons(...buttons) {
458
+ for (const item of this.show_data.buttons) {
459
+ if (buttons.includes(item.button_name)) {
460
+ item.disabled = false
461
+ }
462
+ }
463
+ },
464
+ // 显示对应按钮
465
+ showButtons(...buttons) {
466
+ for (const item of this.show_data.buttons) {
467
+ if (buttons.includes(item.button_name)) {
468
+ item.hidden = false
469
+ }
470
+ }
471
+ },
472
+ // 隐藏对应按钮
473
+ hideButtons(...buttons) {
474
+ for (const item of this.show_data.buttons) {
475
+ if (buttons.includes(item.button_name)) {
476
+ item.hidden = true
477
+ }
478
+ }
479
+ },
480
+ // 检查t_apply对应字段的值是否重复
481
+ async checkDuplicate(index) {
482
+ let http = new HttpResetClass()
483
+ let data = {
484
+ tablename: 't_apply',
485
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
486
+ }
487
+ let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
488
+ resolveMsg: null,
489
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
490
+ })
491
+ if (res.data.length > 0) {
492
+ this.show_data.fields[index].value = null
493
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
494
+ }
495
+ },
496
+ // 获取片区
497
+ async getSliceArea () {
498
+ let data = {
499
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
500
+ userid: this.$login.f.id
501
+ }
502
+
503
+ let http = new HttpResetClass()
504
+ let res = await http.load(
505
+ 'POST',
506
+ `rs/search`,
507
+ {data: data},
508
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
509
+ )
510
+
511
+ return res.data.map(item => {
512
+ return {
513
+ label: item.name,
514
+ value: item.name
515
+ }
516
+ })
517
+ },
518
+ // 获取区县
519
+ async getPcd () {
520
+ let data = {
521
+ tablename: 't_pcd',
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_pcd,
535
+ value: item.f_pcd
536
+ }
537
+ })
538
+ },
539
+ // 获取小区
540
+ async getArea () {
541
+ let data = {
542
+ tablename: 't_area',
543
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
544
+ }
545
+ let http = new HttpResetClass()
546
+ let res = await http.load(
547
+ 'POST',
548
+ `rs/sql/apply_singleTable`,
549
+ {data: data},
550
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
551
+ )
552
+
553
+ return res.data.map(item => {
554
+ return {
555
+ label: item.f_residential_area,
556
+ value: item.f_residential_area
557
+ }
558
+ })
559
+ },
560
+ // 缴费前置
561
+ chargeBefore () {
562
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
563
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
564
+ throw null
565
+ }
566
+ },
567
+ // 附件上传必传
568
+ async uploadBefore () {
569
+ let condition = `f_blobid= '${this.selectdata.f_process_id}' `
570
+ let http = new HttpResetClass()
571
+ let data = {
572
+ tablename: 't_files',
573
+ condition: condition + ` order by f_uploaddate desc `
574
+ }
575
+ let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
576
+ warnMsg: null,
577
+ resolveMsg: null
578
+ })
579
+ if (res.data.length = 0) {
580
+ this.$showAlert('请上传附件!!!', 'warning', 3000)
581
+ throw null
582
+ }
583
+ },
584
+ // 施工前置 加表具后状态是待开通 提交后是正常 所以这里的判断条件需改正 (and uf.f_meter_classify is null and f_meternumber is null)
585
+ async constructionBefore () {
586
+ let http = new HttpResetClass()
587
+ let data = {
588
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_meter_classify is null and f_meternumber is null`
589
+ }
590
+ let res = await http.load(
591
+ 'POST',
592
+ 'rs/sql/countApplyUserinfo',
593
+ {data: data},
594
+ {
595
+ resolveMsg: null,
596
+ rejectMsg: '安装明细查询失败!!!'
597
+ })
598
+ if (res.data[0].num > 0) {
599
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
600
+ throw `还有${res.data[0].num}户未安装,无法提交`
601
+ }
602
+ },
603
+ // 获取对应气价id的数组
604
+ async getPrice (f_price_id) {
605
+ console.log('=======================')
606
+ console.log(f_price_id)
607
+ let data = {
608
+ condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
609
+ }
610
+ if (!isEmpty(f_price_id)) {
611
+ data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
612
+ }
613
+ let http = new HttpResetClass()
614
+ let res = await http.load(
615
+ 'POST',
616
+ `rs/sql/applyGetPrice`,
617
+ {data: data},
618
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
619
+ )
620
+
621
+ let a= res.data.map(item => {
622
+ return {
623
+ label: item.f_price_name,
624
+ value: item
625
+ }
626
+ })
627
+ this.selectdata.fields.forEach(field => {
628
+ if (field.label === '气价名称') {
629
+ field.options = a}
630
+ })
631
+ return a
632
+ },
633
+ // 地址操作
634
+ addressInitialization () {
635
+ this.$getConfig(this, 'UserAddress')
636
+
637
+ },
638
+ // 街道发生改变,获取对应街道下的小区
639
+ async streetChange () {
640
+ if (isEmpty(this.show_data.f_street)) {
641
+ return
642
+ }
643
+
644
+ let data = {
645
+ tablename: 't_area',
646
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
647
+ }
648
+ let http = new HttpResetClass()
649
+ let res = await http.load(
650
+ 'POST',
651
+ `rs/sql/apply_singleTable`,
652
+ {data: data},
653
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
654
+ )
655
+
656
+ this.setLabelOptions('小区', res.data.map(item => {
657
+ return {
658
+ label: item.f_residential_area,
659
+ value: item.f_residential_area
660
+ }
661
+ }))
662
+ },
663
+ async searchbuilding () {
664
+ if (isEmpty(this.show_data.f_residential_area)) {
665
+ return
666
+ }
667
+ let data = {
668
+ tablename: 't_building',
669
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${this.show_data.f_residential_area}%'`
670
+ }
671
+ let http = new HttpResetClass()
672
+ let res = await http.load(
673
+ 'POST',
674
+ `rs/sql/apply_singleTable`,
675
+ {data: data},
676
+ {resolveMsg: null, rejectMsg: '楼号查询失败!!!'}
677
+ )
678
+
679
+ if (res.data.length === 0) {
680
+ return
681
+ }
682
+
683
+ this.setLabelOptions('楼号/组', res.data.map(item => {
684
+ return {
685
+ label: item.f_building,
686
+ value: item.f_building
687
+ }
688
+ }))
689
+ },
690
+ // 地址类型发生改变,获取对应的街道/乡镇
691
+ async pcdChange () {
692
+ if (isEmpty(this.show_data.f_pcd)) {
693
+ return
694
+ }
695
+
696
+ let data = {
697
+ tablename: 't_street',
698
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
699
+ }
700
+
701
+ let http = new HttpResetClass()
702
+ let res = await http.load(
703
+ 'POST',
704
+ `rs/sql/apply_singleTable`,
705
+ {data: data},
706
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
707
+ )
708
+
709
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
710
+ return {
711
+ label: item.f_street,
712
+ value: item.f_street
713
+ }
714
+ }))
715
+ },
716
+ // 获取当前分公司下拥有role角色的人员
717
+ async getDesignerPeople (role) {
718
+ let data = {
719
+ source: 'this.getParentByType($organization$).getChildByName($'+role+"$).getChildren()",
720
+ userid: this.$login.f.id
721
+ }
722
+
723
+ let http = new HttpResetClass()
724
+ let res = await http.load(
725
+ 'POST',
726
+ `rs/search`,
727
+ {data: data},
728
+ {resolveMsg: null, rejectMsg: '人员查询失败!!!'}
729
+ )
730
+
731
+ return res.data.map(item => {
732
+ return {
733
+ label: item.name,
734
+ value: item.name
735
+ }
736
+ })
737
+ },
738
+ // 终止报建 reason--终止原因
739
+ async surveyStopApply (reason) {
740
+ console.log('终止报建!!!!!')
741
+
742
+ this.show_data.f_stop_reason = reason
743
+
744
+ let data = {
745
+ data: this.show_data,
746
+ user: this.$login.f
747
+ }
748
+
749
+ let res = await this.$resetpost(
750
+ `rs/logic/surveyStopApply`,
751
+ {data: data},
752
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
753
+ )
754
+
755
+ this.$dispatch('loadPage')
756
+
757
+ throw '终止报建!!!'
758
+ },
759
+
760
+ PrefixInteger(num, n) {
761
+ return (Array(n).join(0) + num).slice(-n);
762
+ }
763
+ },
764
+ events: {
765
+ 'priceType'(index){
766
+ this.Pricetype = this.getLableValue('所属类型')
767
+ console.log('打印方法值',this.getPrice(this.show_data.f_price_id))
768
+ for (const item of this.show_data.fields) {
769
+ if (this.show_data.f_sprice_type !=null && this.show_data.f_sprice_type !='') {
770
+ if(item.label==='气价名称'){
771
+ this.getPrice().then(value =>{
772
+ item.options=value
773
+ })
774
+ console.log('最终',item.options)
775
+ }
776
+ }
777
+ }
778
+ },
779
+ 'complyInstallation' (index) {
780
+ if (this.show_data.f_apply_type == '居民团体用户报建' ){
781
+ if (this.show_data.f_apply_nature == '整体小区'){
782
+ this.showLabels('楼房总户数')
783
+ this.showLabels('楼房总栋数')
784
+ this.showLabels('别墅总户数')
785
+ this.hideLabels('总户数')
786
+ }
787
+ if (this.show_data.f_apply_nature == '整体村庄'){
788
+ this.showLabels('总户数')
789
+ this.hideLabels('楼房总户数')
790
+ this.hideLabels('楼房总栋数')
791
+ this.hideLabels('别墅总户数')
792
+ }
793
+ }
794
+ },
795
+ async 'igniteDispatchReadyEvent' () {
796
+ let data = {
797
+ tablename: 'activityins',
798
+ condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
799
+ }
800
+ let http = new HttpResetClass()
801
+ let res = await http.load(
802
+ 'POST',
803
+ `rs/sql/apply_singleTable`,
804
+ {data: data},
805
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
806
+ )
807
+ if (res.data.length <= 0) {
808
+ console.log('+++++++++++++++++++++++++++++')
809
+ console.log('没有施工,不能退回')
810
+ this.hideButtons('退回')
811
+ }
812
+ },
813
+ 'buildReadyEvent' () {
814
+ },
815
+ // 选择材料
816
+ async materialNameChenge (index, fieldIndex) {
817
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
818
+
819
+ this.show_data.onetomany[index].fields.forEach(item => {
820
+ if (material[item.field]) {
821
+ item.value = material[item.field]
822
+ }
823
+ })
824
+ },
825
+ // 打开模态框获取材料
826
+ async 'getMaterialName' (index) {
827
+ let data = {
828
+ condition: `1=1`
829
+ }
830
+ let http = new HttpResetClass()
831
+ let res = await http.load(
832
+ 'POST',
833
+ `rs/sql/getStockMaterial`,
834
+ {data: data},
835
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
836
+ )
837
+
838
+ this.show_data.onetomany[index].fields.forEach(field => {
839
+ if (field.label === '选择材料') {
840
+ field.options = res.data.map(item => {
841
+ return {
842
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
843
+ 'value': item
844
+ }
845
+ })
846
+ }
847
+ })
848
+ },
849
+ // 搜索小区
850
+ async 'searchArea' (area, index) {
851
+ let data = {
852
+ tablename: 't_area',
853
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
854
+ }
855
+ let http = new HttpResetClass()
856
+ let res = await http.load(
857
+ 'POST',
858
+ `rs/sql/apply_singleTable`,
859
+ {data: data},
860
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
861
+ )
862
+
863
+ if (res.data.length === 0) {
864
+ return
865
+ }
866
+
867
+ this.setLabelOptions('小区', res.data.map(item => {
868
+ return {
869
+ label: item.f_residential_area,
870
+ value: item.f_residential_area
871
+ }
872
+ }))
873
+ },
874
+ // 搜索小区
875
+ async 'searchAreaCollective' (area, index) {
876
+ let data = {
877
+ tablename: 't_area',
878
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${area}%'`
879
+ }
880
+ let http = new HttpResetClass()
881
+ let res = await http.load(
882
+ 'POST',
883
+ `rs/sql/apply_singleTable`,
884
+ {data: data},
885
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
886
+ )
887
+
888
+ if (res.data.length === 0) {
889
+ return
890
+ }
891
+
892
+ this.setLabelOptions('小区', res.data.map(item => {
893
+ return {
894
+ label: item.f_residential_area,
895
+ value: item.f_residential_area
896
+ }
897
+ }))
898
+ },
899
+ // 选择气价
900
+ 'priceChange' (index) {
901
+ if (isEmpty(this.show_data.stairPrice)) {
902
+ return
903
+ }
904
+
905
+ let stairPrice = this.getLableValue('气价名称')
906
+
907
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
908
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
909
+ this.setLabelValue('价格', stairPrice.f_price)
910
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
911
+ this.show_data.f_price_id = stairPrice.id
912
+ this.show_data.f_price_name = stairPrice.f_price_name
913
+ },
914
+ // 退款金额
915
+ 'refundMoneyChange' (index) {
916
+ let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
917
+ let f_refund_money = this.show_data.fields[index].value
918
+
919
+ if (f_refund_money > f_cumulative_payment_money) {
920
+ this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
921
+ this.show_data.fields[index].value = null
922
+ }
923
+ },
924
+ // 检查重复
925
+ 'checkRepeat' (index) {
926
+ this.checkDuplicate(index)
927
+ },
928
+ // 选择报建项目
929
+ 'selectApply' (row) {
930
+ this.setLabelValue('工程名称', row.f_entry_name)
931
+ this.setLabelValue('工程编号', row.f_apply_num)
932
+ this.setLabelValue('报建类型', row.f_apply_type)
933
+ this.setLabelValue('客户名称', row.f_user_name)
934
+ this.setLabelValue('客户电话', row.f_phone)
935
+ this.setLabelValue('证件类型', row.f_credentials)
936
+ this.setLabelValue('证件号码', row.f_idnumber)
937
+ this.setLabelValue('地址', row.f_address)
938
+ this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
939
+
940
+ this.show_data.parentApply = JSON.parse(JSON.stringify(row))
941
+
942
+ delete row.id
943
+ delete row.actid
944
+ delete row.defid
945
+ delete row.defname
946
+ delete row.version
947
+ delete row.f_apply_num
948
+ delete row.f_sub_state
949
+ delete row.f_apply_type
950
+ delete row.f_process_id
951
+
952
+ this.show_data = Object.assign({}, this.show_data, row)
953
+
954
+ this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
955
+ },
956
+ // 是否终止
957
+ 'isStopChange' (index) {
958
+ let f_is_stop = this.show_data.f_is_stop
959
+
960
+ for (const item of this.show_data.fields) {
961
+ if (f_is_stop === '是') {
962
+ if (item.label === '终止原因') {
963
+ item.hidden = false
964
+ item.required = true
965
+ }
966
+ } else {
967
+ if (item.label === '终止原因') {
968
+ item.hidden = true
969
+ item.required = false
970
+ }
971
+ }
972
+ }
973
+ },
974
+ // 终止报建初始化
975
+ async 'stopApplyReadyEvent' () {
976
+
977
+ let f_is_stop = this.getLableValue('是否终止')
978
+
979
+ for (const item of this.show_data.fields) {
980
+ if (f_is_stop === '是') {
981
+ if (item.label === '终止原因') {
982
+ item.hidden = false
983
+ item.required = true
984
+ }
985
+ } else {
986
+ if (item.label === '终止原因') {
987
+ item.hidden = true
988
+ item.required = false
989
+ }
990
+ }
991
+ }
992
+
993
+ if (isEmpty(this.show_data.f_parent_process_id)) {
994
+ return
995
+ }
996
+ let data = {
997
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
998
+ data: {
999
+ id: this.$login.f.id,
1000
+ orgid: this.$login.f.orgid
1001
+ }
1002
+ }
1003
+ let res = await this.$resetpost(
1004
+ `rs/sql/supervisory`,
1005
+ {data: data},
1006
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
1007
+ )
1008
+ this.show_data.parentApply = res.data[0]
1009
+ },
1010
+ // 选择客户档案信息
1011
+ 'selectUserinfo' (row) {
1012
+ this.setLabelValue('客户编号', row.f_userinfo_code)
1013
+ this.setLabelValue('入户证号', row.f_entry_number)
1014
+ this.setLabelValue('客户名称', row.f_user_name)
1015
+ this.setLabelValue('客户电话', row.f_user_phone)
1016
+ this.setLabelValue('证件类型', row.f_credentials)
1017
+ this.setLabelValue('证件号码', row.f_idnumber)
1018
+ this.setLabelValue('地址', row.f_address)
1019
+
1020
+ this.show_data.f_userinfo_id = row.f_userinfo_id
1021
+ this.show_data.f_userinfo_code = row.f_userinfo_code
1022
+ this.show_data.f_entry_number = row.f_enter_number
1023
+ this.show_data.f_pcd = row.f_pcd
1024
+ this.show_data.f_street = row.f_street
1025
+ this.show_data.f_residential_area = row.f_residential_area
1026
+ this.show_data.f_building = row.f_building
1027
+ this.show_data.f_unit = row.f_unit
1028
+ this.show_data.f_floor = row.f_floor
1029
+ this.show_data.f_room = row.f_room
1030
+ this.show_data.f_room_suffix = row.f_room_suffix
1031
+ },
1032
+ // 通气点火初始化
1033
+ async 'gasReadyEvent' () {
1034
+ // 是否有气价信息
1035
+ if (!isEmpty(this.show_data.f_price_id)) {
1036
+ let priceList = await this.getPrice(this.show_data.f_price_id)
1037
+ this.setLabelValue('气价名称', priceList[0].value)
1038
+ }
1039
+ },
1040
+ // 合同金额失去焦点
1041
+ async 'contractMoneyChange' (index) {
1042
+ let data = {
1043
+ operator: '+',
1044
+ num1: this.show_data.f_contract_money || 0,
1045
+ num2: this.getLableValue('追加金额') || 0
1046
+ }
1047
+ let res = await this.$resetpost(
1048
+ `rs/logic/compute`,
1049
+ {data: data},
1050
+ {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1051
+ )
1052
+ //转成千分位
1053
+ let money= this.formatCurrency(res.data,2)
1054
+ this.setLabelValue('应交金额', money)
1055
+ //合同金额
1056
+ let contract= this.formatCurrency( this.show_data.f_contract_money,2)
1057
+ this.setLabelValue('合同金额', contract)
1058
+ },
1059
+ // 街道失去焦点
1060
+ async 'streetChange' (index) {
1061
+ if (isEmpty(this.show_data.f_street)) {
1062
+ return
1063
+ }
1064
+
1065
+ this.setLabelValue('小区', null)
1066
+
1067
+ let data = {
1068
+ tablename: 't_area',
1069
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1070
+ }
1071
+ let http = new HttpResetClass()
1072
+ let res = await http.load(
1073
+ 'POST',
1074
+ `rs/sql/apply_singleTable`,
1075
+ {data: data},
1076
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
1077
+ )
1078
+
1079
+ this.setLabelOptions('小区', res.data.map(item => {
1080
+ return {
1081
+ label: item.f_residential_area,
1082
+ value: item.f_residential_area
1083
+ }
1084
+ }))
1085
+ },
1086
+ // 区县失去焦点
1087
+ async 'pcdChange' (index) {
1088
+ if (isEmpty(this.show_data.f_pcd)) {
1089
+ return
1090
+ }
1091
+
1092
+ this.setLabelValue('街道/乡镇', null)
1093
+ this.setLabelValue('小区', null)
1094
+
1095
+
1096
+
1097
+ let data = {
1098
+ tablename: 't_street',
1099
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1100
+ }
1101
+ let f_address_type = this.getLableValue('地址类型')
1102
+
1103
+ if (f_address_type === '民用市区') {
1104
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1105
+ }
1106
+ if (f_address_type === '民用乡镇') {
1107
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1108
+ }
1109
+
1110
+ let http = new HttpResetClass()
1111
+ let res = await http.load(
1112
+ 'POST',
1113
+ `rs/sql/apply_singleTable`,
1114
+ {data: data},
1115
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1116
+ )
1117
+
1118
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
1119
+ return {
1120
+ label: item.f_street,
1121
+ value: item.f_street
1122
+ }
1123
+ }))
1124
+ },
1125
+ // 搜索楼号
1126
+ async 'searchbuilding' (index) {
1127
+ this.setLabelValue('楼号/组', null)
1128
+ let data = {
1129
+ tablename: 't_building',
1130
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${this.show_data.f_residential_area}%'`
1131
+ }
1132
+ let http = new HttpResetClass()
1133
+ let res = await http.load(
1134
+ 'POST',
1135
+ `rs/sql/apply_singleTable`,
1136
+ {data: data},
1137
+ {resolveMsg: null, rejectMsg: '楼号查询失败!!!'}
1138
+ )
1139
+
1140
+ if (res.data.length === 0) {
1141
+ return
1142
+ }
1143
+
1144
+ this.setLabelOptions('楼号/组', res.data.map(item => {
1145
+ return {
1146
+ label: item.f_building,
1147
+ value: item.f_building
1148
+ }
1149
+ }))
1150
+ },
1151
+ // 地址类型失去焦点
1152
+ 'addressTypeChange' (index) {
1153
+ },
1154
+ // 居民团体单户报建初始化
1155
+ 'apply2ReadyEvent' () {
1156
+ if (this.show_data.f_apply_source === '线下发起') {
1157
+ this.addressInitialization()
1158
+ this.hideLabels('客户编号')
1159
+ this.electiveLabels('客户编号')
1160
+ this.showLabels('片区', '地址类型')
1161
+ this.requiredLabels('片区', '地址类型')
1162
+ }
1163
+ if (this.show_data.f_apply_source === '自动发起') {
1164
+ this.hideLabels('片区', '地址类型')
1165
+ this.electiveLabels('片区', '地址类型',)
1166
+ }
1167
+ },
1168
+ // 申请节点初始化
1169
+ 'applyReadyEvent' () {
1170
+ this.addressInitialization()
1171
+ this.pcdChange()
1172
+ this.streetChange()
1173
+ this.searchbuilding()
1174
+ },
1175
+ // ===========================================
1176
+ async 'button'() {
1177
+ if (this.show_data.button.before) {
1178
+ await this[this.show_data.button.before]()
1179
+ }
1180
+ // 点击重置按钮就重置数据
1181
+ if (this.show_data.button.button_name === '重置') {
1182
+ this.$dispatch('breakControl', this.selectdata)
1183
+ return
1184
+ }
1185
+ if ((this.show_data.f_apply_type == '居民用户报建' || this.show_data.f_apply_type == '非居用户报建' || this.show_data.f_apply_type == '其他报建' ) && this.show_data.defname == '报装申请' && this.show_data.f_is_have == '否' && this.show_data.button.button_name == '提交' ){
1186
+ this.show_data.button.button_name = '跳过'
1187
+ }
1188
+ this.show_data.user = this.$login.f
1189
+ this.show_data.start_activity = this.$workflow_vue.start_activity
1190
+ this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1191
+ //将千分位金额转成数字
1192
+ for (const item of this.show_data.fields) {
1193
+ if (item.percentiles) {
1194
+ if(item.value.includes(",")){
1195
+ let Money=this.parseCurrency(item.value)
1196
+ this.show_data[item.field]=Money
1197
+ debugger
1198
+ }else{
1199
+ //转为数字
1200
+ let Money= Number(item.value)
1201
+ this.show_data[item.field]=Money
1202
+ debugger
1203
+ }
1204
+ }
1205
+ }
1206
+ let res = await this.$resetpost(
1207
+ `rs/logic/ApplyProductService`,
1208
+ {data: this.show_data},
1209
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1210
+ )
1211
+
1212
+ if (this.show_data.button.after) {
1213
+ this[this.show_data.button.after]()
1214
+ }
1215
+ this.$dispatch('loadPage')
1216
+ },
1217
+ // 失去焦点出触发事件
1218
+ 'onchange' (index) {
1219
+ let http = new HttpResetClass()
1220
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1221
+
1222
+ if (
1223
+ this.show_data.fields[index].label === '区/县' ||
1224
+ this.show_data.fields[index].label === '街道/乡镇' ||
1225
+ this.show_data.fields[index].label === '小区' ||
1226
+ this.show_data.fields[index].label === '楼号/组' ||
1227
+ this.show_data.fields[index].label === '单元/排' ||
1228
+ this.show_data.fields[index].label === '楼层' ||
1229
+ this.show_data.fields[index].label === '门牌号' ||
1230
+ this.show_data.fields[index].label === '地址杂项'
1231
+ ) {
1232
+ if (this.show_data.fields[index].label === '单元/排' || this.show_data.fields[index].label === '楼层' || this.show_data.fields[index].label === '门牌号'){
1233
+ if (this.show_data.fields[index].value.length == 1){
1234
+ this.show_data.fields[index].value = '0'+ this.show_data.fields[index].value
1235
+ }
1236
+ }
1237
+ console.log('地址参数',this.config)
1238
+ let f_pcd = this.getLableValue('区/县') || ''
1239
+ let f_street = this.getLableValue('街道/乡镇') || ''
1240
+ let f_residential_area = this.getLableValue('小区') || ''
1241
+ let f_building = this.getLableValue('楼号/组') || ''
1242
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1243
+ //let f_building_suffix = f_building ? '号楼' : ''
1244
+ let f_unit = this.getLableValue('单元/排') || ''
1245
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1246
+ //let f_unit_suffix = f_unit ? '单元' : ''
1247
+ let f_floor = this.getLableValue('楼层') || ''
1248
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1249
+ //let f_floor_suffix = f_floor ? '' : ''
1250
+ let f_room = this.getLableValue('门牌号') || ''
1251
+ //let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1252
+ //let f_room_suffix = f_room ? '' : ''
1253
+ let f_room_suffix = this.getLableValue('地址杂项') || ''
1254
+
1255
+ 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
1256
+ this.setLabelValue("地址", f_address)
1257
+ }
1258
+ }
1259
+ if (this.show_data.fields[index].label == '入户证号'){
1260
+ let data = {
1261
+ tablename: `t_apply`,
1262
+ condition: `f_entry_number='${this.show_data.fields[index].value}' and f_sub_state in ('正在进行','完工')`
1263
+ }
1264
+ http.load('post','rs/sql/apply_singleTable',{data: data},
1265
+ {resolveMsg: null, rejectMsg: '查询失败'}).then(row=>{
1266
+ if (row.data.length > 0){
1267
+ this.$showMessage('请注意入户证号重复!!!')
1268
+ }
1269
+ })
1270
+ }
1271
+ },
1272
+ selectSearch (val, index) {},
1273
+ 'onblur' (index) {},
1274
+ 'oninput' (index) {
1275
+ },
1276
+ 'initializtionView' () {},
1277
+ async 'onchangeModal' (index, fieldIndex) {
1278
+ },
1279
+ async 'onblurModal' (index, fieldIndex) {
1280
+
1281
+ },
1282
+ async 'oninputModal' (index, fieldIndex) {
1283
+
1284
+ },
1285
+ async 'onetomanydelete' (index, rowIndex) {
1286
+
1287
+ let http = new HttpResetClass()
1288
+
1289
+ let res = await http.load(
1290
+ 'DELETE',
1291
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1292
+ null,
1293
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1294
+ )
1295
+
1296
+ res = await this.$resetpost(
1297
+ 'rs/entity/t_apply',
1298
+ this.show_data
1299
+ )
1300
+
1301
+ this.$dispatch('breakControl', this.show_data)
1302
+ },
1303
+ async 'onetomanyupdate' (index, rowIndex) {
1304
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1305
+
1306
+ this.show_data.onetomany[index].fields.forEach(item => {
1307
+ data[item.field] = item.value
1308
+ })
1309
+ let res = await this.$resetpost(
1310
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1311
+ data
1312
+ )
1313
+
1314
+ res = await this.$resetpost(
1315
+ 'rs/entity/t_apply',
1316
+ this.show_data
1317
+ )
1318
+
1319
+ this.$dispatch('breakControl', this.show_data)
1320
+ },
1321
+ async 'onetomanyadd' (index) {
1322
+ let data = {
1323
+ f_process_id : this.show_data.f_process_id,
1324
+ f_operator_id: this.$login.f.id,
1325
+ f_operator: this.$login.f.name,
1326
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1327
+ f_orgid: this.$login.f.orgid,
1328
+ f_orgname: this.$login.f.orgs
1329
+ }
1330
+ this.show_data.onetomany[index].fields.forEach(item => {
1331
+ data[item.field] = item.value
1332
+ })
1333
+ let res = await this.$resetpost(
1334
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1335
+ data
1336
+ )
1337
+
1338
+ res = await this.$resetpost(
1339
+ 'rs/entity/t_apply',
1340
+ this.show_data
1341
+ )
1342
+
1343
+ this.$dispatch('breakControl', this.show_data)
1344
+ },
1345
+ async 'importEvent' (index, table, configName, filepath) {
1346
+ let data = {
1347
+ selectdata: this.show_data,
1348
+ table: table,
1349
+ filepath: filepath,
1350
+ configName: configName,
1351
+ user: this.$login.f
1352
+ }
1353
+
1354
+ let res = await this.$resetpost(
1355
+ `rs/logic/importEvent`,
1356
+ data
1357
+ )
1358
+
1359
+ this.$dispatch('breakControl', this.show_data)
1360
+ },
1361
+ 'onbutchange' (index) {
1362
+
1363
+ },
1364
+ 'onbutblur' (index) {
1365
+
1366
+ },
1367
+ 'onbutinput' (index) {
1368
+
1369
+
1370
+ }
1371
+ },
1372
+ watch: {
1373
+ }
1374
+ }
1375
+ </script>
1376
+ <style scoped>
1377
+ /*清除model中的浮动*/
1378
+ .clearfix:after,.clearfix:before{
1379
+ display: table;
1380
+ }
1381
+ .clearfix:after{
1382
+ clear: both;
1383
+ }
1384
+ </style>