apply-clients 3.4.89-21 → 3.4.89-22

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