apply-clients 3.5.5-64 → 3.5.5-66

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