apply-clients 3.5.1 → 3.5.2

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