apply-clients 3.4.63 → 3.4.65

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