apply-clients 7.1.36-yuchuan-67 → 7.1.36-yuchuan-69

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 (29) hide show
  1. package/build/dev-server.js +3 -6
  2. package/package.json +1 -1
  3. package/src/components/android/AppServiceView.vue +603 -603
  4. package/src/components/android/Process/AppServiceControl.vue +1434 -1434
  5. package/src/components/android/Process/Processes/AppInstallationDetails.vue +1029 -1029
  6. package/src/components/android/Process/Processes/newAppInstallationDetails.vue +671 -671
  7. package/src/components/android/SealBind.vue +405 -405
  8. package/src/components/product/ApplyGaiXianCharge/ApplyGaiXianChargeList.vue +211 -211
  9. package/src/components/product/ApplyGuanXian/GuanXianExplorationSelect.vue +325 -325
  10. package/src/components/product/Function/Service/FunctionServiceControl.vue +581 -581
  11. package/src/components/product/Ignition/IgnitionListManage.vue +604 -604
  12. package/src/components/product/List/OldShowDevices.vue +272 -272
  13. package/src/components/product/List/ShowAllActivity.vue +540 -540
  14. package/src/components/product/Print/BuildOrder/buildOrderList.vue +446 -446
  15. package/src/components/product/Process/ExplorationSelect.vue +593 -593
  16. package/src/components/product/Process/NewExplorationSelect.vue +587 -587
  17. package/src/components/product/Process/Processes/InstallationDetails.vue +1166 -1166
  18. package/src/components/product/Process/Processes/Print/printCharge.vue +250 -250
  19. package/src/components/product/Process/Processes/Print/printGaiXianCharge.vue +244 -244
  20. package/src/components/product/Process/Processes/newInstallationDetails.vue +683 -683
  21. package/src/components/product/Process/Processes/supplementalAgreement.vue +298 -298
  22. package/src/components/product/Process/Service/ServiceControl.vue +2230 -2222
  23. package/src/components/product/ServiceView.vue +650 -650
  24. package/src/components/product/Supervisory/ExportExcel.vue +359 -359
  25. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +592 -592
  26. package/src/components/product/Supervisory/SupervisoryList.vue +585 -585
  27. package/src/components/product/Supervisory/YiBanSupervisoryList.vue +543 -543
  28. package/src/components/product/VueUtils/ApplyUpload.vue +302 -302
  29. package/src/components/product/VueUtils/HighMeter.vue +208 -208
@@ -1,2222 +1,2230 @@
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 {HttpResetClass} from 'vue-client'
9
- import {isEmpty} from '../../../Util'
10
- import Vue from "vue";
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
- area: {}, // 小区详细
39
- config: {}
40
- }
41
- },
42
- ready () {
43
- this.refurbish()
44
- },
45
- methods: {
46
- // 组件初始化操作
47
- async refurbish() {
48
- this.json_datas = Vue.prototype.$workflow_vue
49
- let sum = 0
50
- let jsonData = {}
51
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
52
- this.$showMessage("网络故障,请刷新页面")
53
- return
54
- }
55
- this.json_datas.activitys.forEach(item => {
56
- if (this.selectdata.defname === item.title) {
57
- jsonData = item // 拿到当前节点的json配置信息
58
- sum++ // 节点名一样的个数
59
- }
60
- })
61
-
62
- if (sum === 0) {
63
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
64
- return
65
- }
66
- if (sum > 1) {
67
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
68
- return
69
- }
70
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
71
-
72
- // fields 字段填充值
73
- for (const item of this.selectdata.fields) {
74
- if (!item.value) {
75
- item.value = null
76
- }
77
-
78
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
79
- if (item.eval) {
80
- item.value = eval(item.default)
81
- } else {
82
- item.value = item.default
83
- }
84
- }
85
-
86
- if (this.selectdata[item.field]) {
87
- // 将json字符串格式化赋值给value
88
- if (String(this.selectdata[item.field]).startsWith("{")) {
89
- item.value = JSON.parse(this.selectdata[item.field])
90
- } else {
91
- item.value = this.selectdata[item.field]
92
- }
93
- }
94
- if (this.selectdata[item.field] === 0) {
95
- item.value = 0
96
- }
97
-
98
- // datepicker
99
- if (item.type === 'datepicker' && !item.value && item.default) {
100
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
101
- }
102
-
103
- // 如果配置类型为select,优先从参数列表获取options
104
- if (item.type === 'select' || item.type === 'checkbox') {
105
- if (item.param) {
106
- let temp = this.$appdata.getParam(item.label)
107
-
108
- if (temp && temp.length > 0) {
109
- item.options = temp
110
- }
111
-
112
- if (item.paramLabel) {
113
- temp = this.$appdata.getParam(item.paramLabel)
114
- if (temp && temp.length > 0) {
115
- item.options = temp
116
- }
117
- }
118
- }
119
- }
120
- if (item.ready) {
121
- item.options = await this[item.ready]()
122
- }
123
- if (item.type === 'checkbox') {
124
- if (this.selectdata[item.field]) {
125
- item.value = JSON.parse(this.selectdata[item.field])
126
- } else {
127
- item.value = []
128
- }
129
- }
130
- if(this.selectdata.state === '结束'){
131
- item.readonly = true
132
- item.disabled = true
133
- console.log('当前defname'+this.selectdata.defname+'当前title'+this.selectdata.title)
134
- }
135
- this.selectdata[item.field] = item.value
136
- }
137
-
138
- // 控制组件
139
- if (this.selectdata.components) {
140
- this.selectdata.components.forEach(item => {
141
- if (!item.mark) {
142
- item.mark = 0
143
- }
144
- if(this.selectdata.state === '结束'){
145
- item.mark = 1
146
- }
147
- })
148
- }
149
-
150
- // 初始化onetomany
151
- if (this.selectdata.onetomany) {
152
- for (const item of this.selectdata.onetomany) {
153
- let res = null
154
- if (item.queryEvent) {
155
- res = this[item.queryEvent]()
156
- } else {
157
- let data = {
158
- tablename: item.tables[0],
159
- condition: `f_process_id='${this.selectdata.f_process_id}'`
160
- }
161
- let http = new HttpResetClass()
162
- res = await http.load(
163
- 'POST',
164
- 'rs/sql/applySingleTable',
165
- {data: data},
166
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
167
- )
168
- }
169
- item.rows = res.data
170
- // 初始化onetomany中的fields
171
- for (const field of item.fields) {
172
- if (!field.value) {
173
- if (field.value !== 0) {
174
- field.value = null
175
- }
176
- }
177
-
178
- if (field.default || field.default === 0) {
179
- field.value = field.default
180
- }
181
-
182
- // datepicker
183
- if (field.type === 'datepicker' && !field.value && field.default) {
184
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
185
- }
186
-
187
- if (field.type === 'select') {
188
-
189
- let temp = this.$appdata.getParam(field.label)
190
-
191
- if (temp && temp.length > 0) {
192
- field.options = temp
193
- }
194
-
195
- if (field.paramLabel) {
196
- temp = this.$appdata.getParam(field.paramLabel)
197
- if (temp && temp.length > 0) {
198
- item.options = temp
199
- }
200
- }
201
- }
202
- }
203
- }
204
- }
205
-
206
- // 初始化 buttons_fields
207
- for (const item of this.selectdata.buttons) {
208
- if (item.button_name === '下发' || item.button_name === '转派') {
209
-
210
- let data = {
211
- source: item.source,
212
- userid: this.$login.f.id
213
- }
214
- if (item.sourceMethod) {
215
- data.source = this[item.sourceMethod]()
216
- }
217
- if (!data.source) {
218
- this.$showMessage("请配置获取人员表达式")
219
- return
220
- }
221
- let http = new HttpResetClass()
222
- let res = await http.load(
223
- 'POST',
224
- 'rs/search',
225
- {data: data},
226
- {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
227
- )
228
- let options = res.data.map(source => {
229
- return {
230
- "label": source.name,
231
- "value": source.id
232
- }
233
- })
234
- if (item.button_fields.length !== 1) {
235
- this.$showMessage("下发有且只能有一个字段!!!")
236
- return
237
- }
238
- item.button_fields[0].options = options
239
- }
240
- if (item.button_fields) {
241
- item.button_fields.forEach(x => {
242
- // 如果配置类型为select,优先从参数列表获取options
243
- if (x.type === 'select') {
244
-
245
- if (x.param) {
246
- let temp = this.$appdata.getParam(x.label)
247
-
248
- if (temp && temp.length > 0) {
249
- x.options = temp
250
- }
251
-
252
- if (x.paramLabel) {
253
- temp = this.$appdata.getParam(x.paramLabel)
254
- if (temp && temp.length > 0) {
255
- x.options = temp
256
- }
257
- }
258
- }
259
-
260
- }
261
- })
262
- }
263
- if(this.selectdata.state === '结束'){
264
- item.hidden = true
265
- }
266
- }
267
-
268
- if (this.selectdata.f_apply_nature === '散户' && this.selectdata.defname === '现场勘察') {
269
- for (const item of this.selectdata.fields) {
270
- if (item.label.includes('安装户数')) {
271
- item.readonly = true
272
- }
273
- }
274
- }
275
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
276
- let temp = JSON.parse(JSON.stringify(this.selectdata))
277
- this.show_data = temp
278
- if ((this.selectdata.f_apply_type =='非民用报建' || this.selectdata.f_apply_type =='民用报建' || this.selectdata.f_apply_type =='设备变更')&&this.selectdata.defname === '报装缴费'){
279
- let num = Number(this.$appdata.getSingleValue('税率'))
280
- let f_due_money =Number(this.selectdata.f_due_money)
281
- let tem = ( f_due_money - (f_due_money/(1+num)).toFixed(2)).toFixed(2)
282
- this.show_data.f_budget_money = tem
283
- this.setLabelValue('税额',tem)
284
- }
285
- this.$nextTick(() => {
286
- this.showview = true
287
- })
288
-
289
- },
290
- // 金额转大写
291
- smalltoBIG(n) {
292
- let fraction = ['角', '分'];
293
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
294
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
295
- let head = n < 0 ? '欠' : '';
296
- n = Math.abs(n);
297
-
298
- let s = '';
299
-
300
- for (var i = 0; i < fraction.length; i++) {
301
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
302
- }
303
- s = s || '';
304
- n = Math.floor(n);
305
-
306
- for (var i = 0; i < unit[0].length && n > 0; i++) {
307
- let p = '';
308
- for (var j = 0; j < unit[1].length && n > 0; j++) {
309
- p = digit[n % 10] + unit[1][j] + p;
310
- n = Math.floor(n / 10);
311
- }
312
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '') + unit[0][i] + s;
313
- }
314
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
315
- },
316
- getLableValue(label) {
317
- for (const item of this.show_data.fields) {
318
- if (item.label === label && item.type !== 'number') {
319
- return item.value || ''
320
- }
321
- if (item.label === label && item.type === 'number') {
322
- return item.value || 0
323
- }
324
- }
325
- },
326
- getLableOptions(label) {
327
- for (const item of this.show_data.fields) {
328
- if (item.label === label) {
329
- return item.options
330
- }
331
- }
332
- },
333
- setLabelValue(label, value) {
334
- for (const item of this.show_data.fields) {
335
- if (item.label === label) {
336
- item.value = value
337
- this.show_data[item.field] = value
338
- }
339
- }
340
- },
341
- setLabelOptions(label, options) {
342
- for (const item of this.show_data.fields) {
343
- if (item.label === label) {
344
- item.options = options
345
- }
346
- }
347
- },
348
- showLabels(...labels) {
349
- for (const item of this.show_data.fields) {
350
- if (labels.includes(item.label)) {
351
- item.hidden = false
352
- }
353
- }
354
- },
355
- hideLabels(...labels) {
356
- for (const item of this.show_data.fields) {
357
- if (labels.includes(item.label)) {
358
- item.hidden = true
359
- }
360
- }
361
- },
362
- showButtons(...buttons) {
363
- for (const item of this.show_data.buttons) {
364
- if (buttons.includes(item.button_name)) {
365
- item.hidden = false
366
- }
367
- }
368
- },
369
- hideButtons(...buttons) {
370
- for (const item of this.show_data.buttons) {
371
- if (buttons.includes(item.button_name)) {
372
- item.hidden = true
373
- }
374
- }
375
- },
376
- requiredLabels(...labels) {
377
- for (const item of this.show_data.fields) {
378
- if (labels.includes(item.label)) {
379
- item.required = true
380
- }
381
- }
382
- },
383
- electiveLabels(...labels) {
384
- for (const item of this.show_data.fields) {
385
- if (labels.includes(item.label)) {
386
- item.required = false
387
- }
388
- }
389
- },
390
- readonlyLabels(...labels) {
391
- for (const item of this.show_data.fields) {
392
- if (labels.includes(item.label)) {
393
- item.readonly = true
394
- item.disabled = true
395
- }
396
- }
397
- },
398
- readwriteLabels(...labels) {
399
- for (const item of this.show_data.fields) {
400
- if (labels.includes(item.label)) {
401
- item.readonly = false
402
- item.disabled = false
403
- }
404
- }
405
- },
406
- disabledButtons(...buttons) {
407
- for (const item of this.show_data.buttons) {
408
- if (buttons.includes(item.button_name)) {
409
- item.disabled = true
410
- }
411
- }
412
- },
413
- enableButtons(...buttons) {
414
- for (const item of this.show_data.buttons) {
415
- if (buttons.includes(item.button_name)) {
416
- item.disabled = false
417
- }
418
- }
419
- },
420
- showComponents(...titles) {
421
- for (const item of this.show_data.components) {
422
- if (titles.includes(item.title) && item.device === 'pc') {
423
- item.hidden = false
424
- }
425
- }
426
- },
427
- hideComponents(...titles) {
428
- for (const item of this.show_data.components) {
429
- if (titles.includes(item.title) && item.device === 'pc') {
430
- item.hidden = true
431
- }
432
- }
433
- },
434
- async checkDuplicate(index) {
435
- let http = new HttpResetClass()
436
- let data = {
437
- tablename: 't_apply',
438
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
439
- }
440
- let res = await http.load('POST', 'rs/sql/applySingleTable', {data: data}, {
441
- resolveMsg: null,
442
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
443
- })
444
- if (res.data.length > 0) {
445
- this.show_data.fields[index].value = null
446
- this.$showMessage(`${this.show_data.fields[index].label}已存在!!!`)
447
- }
448
- },
449
- // 获取片区
450
- async getSliceArea () {
451
- let data = {
452
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
453
- userid: this.$login.f.id
454
- }
455
-
456
- let http = new HttpResetClass()
457
- let res = await http.load(
458
- 'POST',
459
- `rs/search`,
460
- {data: data},
461
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
462
- )
463
-
464
- return res.data.map(item => {
465
- return {
466
- label: item.name,
467
- value: item.name
468
- }
469
- })
470
- },
471
- // 获取区县
472
- async getPcd () {
473
- let data = {
474
- tablename: 't_pcd',
475
- condition: `f_filialeid = '${this.$login.f.orgid}'`
476
- }
477
- let http = new HttpResetClass()
478
- let res = await http.load(
479
- 'POST',
480
- `rs/sql/applySingleTable`,
481
- {data: data},
482
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
483
- )
484
-
485
- return res.data.map(item => {
486
- return {
487
- label: item.f_pcd,
488
- value: item.f_pcd
489
- }
490
- })
491
- },
492
- // 缴费前置
493
- chargeBefore () {
494
- if ((this.show_data.f_apply_type === '民用报建' && this.show_data.f_apply_nature === '小区') || this.show_data.f_apply_type === '非民用报建') {
495
- return
496
- }
497
- if (this.show_data.f_house_type === '旧报建导入'){
498
- return
499
- }
500
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
501
- this.$showMessage('费用未结清!!!')
502
- throw null
503
- }
504
- },
505
- // 缴费流程退回前置
506
- async backBefore() {
507
- let data = {
508
- tablename: 't_apply',
509
- condition: `f_process_id = '${this.selectdata.f_process_id}'`
510
- }
511
- let http = new HttpResetClass()
512
- let res = await http.load(
513
- 'POST',
514
- `rs/sql/applySingleTable`,
515
- {data: data},
516
- {resolveMsg: null, rejectMsg: null}
517
- )
518
- if (res.data.length > 0 && res.data[0].f_surplus_money !== res.data[0].f_due_money) {
519
- this.$showMessage('用户已缴费,无法退回!!!')
520
- }
521
- },
522
- // 获取设计人员
523
- async getDesignerPeople () {
524
- let data = {
525
- source: 'this.getParentByType($organization$).getChildByName($设计人员$).getChildren()',
526
- userid: this.$login.f.id
527
- }
528
-
529
- let http = new HttpResetClass()
530
- let res = await http.load(
531
- 'POST',
532
- 'rs/search',
533
- {data: data},
534
- {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
535
- )
536
- return res.data.map(item => {
537
- return {
538
- label: item.name,
539
- value: item.name
540
- }
541
- })
542
- },
543
- //现场勘察
544
- async prospectingBefore() {
545
- let data = {
546
- tablename: 't_files',
547
- condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '现场勘察' and fremarks = '报装手机签字文件'`
548
- }
549
- let http = new HttpResetClass()
550
- let res = await http.load(
551
- 'POST',
552
- `rs/sql/applySingleTable`,
553
- {data: data},
554
- {resolveMsg: null, rejectMsg: null}
555
- )
556
- if (res.data.length <= 0) {
557
- this.$showMessage('现场勘察未签字,无法提交!!!')
558
- throw '现场勘察未签字,无法提交!'
559
- }
560
- },
561
- //报建受理下发,对基本信息进行校验
562
- checkSpaces(){
563
- let name=this.getLableValue('用户名称')
564
- //如果用户名称中包含空格,提示用户名称中不能包含空格
565
- if(name.indexOf(' ')>=0){
566
- this.$showMessage('用户名称中不能包含空格!!!')
567
- throw '用户名称中不能包含空格!!!'
568
- }
569
- let Contact= this.getLableValue('联系人')
570
- if(Contact.indexOf(' ')>=0){
571
- this.$showMessage('联系人中不能包含空格!!!')
572
- throw '联系人中不能包含空格!!!'
573
- }
574
- let phone= this.getLableValue('用户电话')
575
- if(phone.indexOf(' ')>=0){
576
- this.$showMessage('用户电话中不能包含空格!!!')
577
- throw '用户电话中不能包含空格!!!'
578
- }
579
- let ifnumber= this.getLableValue('证件号码')
580
- if(ifnumber.indexOf(' ')>=0){
581
- this.$showMessage('证件号码中不能包含空格!!!')
582
- throw '证件号码中不能包含空格!!!'
583
- }
584
- },
585
- //合同签订提交
586
- async contractSigningBefore() {
587
- let http = new HttpResetClass()
588
- let data = {
589
- tablename: 't_contract',
590
- condition: `f_process_id = '${this.selectdata.f_process_id}' and f_sign_state <> '签订完成'`
591
- }
592
- let res = await http.load(
593
- 'POST',
594
- `rs/sql/applySingleTable`,
595
- {data: data},
596
- {resolveMsg: null, rejectMsg: null}
597
- )
598
- if(res.data.length<=0){
599
- let data = {
600
- tablename: 't_files',
601
- condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '${this.selectdata.defname}' and fusetype = '纸质合同'`
602
- }
603
- let res = await http.load(
604
- 'POST',
605
- `rs/sql/applySingleTable`,
606
- {data: data},
607
- {resolveMsg: null, rejectMsg: null}
608
- )
609
- if (res.data.length <= 0) {
610
- this.$showMessage('纸质合同未上传,无法提交!')
611
- throw '纸质合同未上传,无法提交!'
612
- }
613
- }
614
- if (res.data.length > 0) {
615
- let data = {
616
- tablename: 't_files',
617
- condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '${this.selectdata.defname}' and fusetype = '纸质合同'`
618
- }
619
- let res = await http.load(
620
- 'POST',
621
- `rs/sql/applySingleTable`,
622
- {data: data},
623
- {resolveMsg: null, rejectMsg: null}
624
- )
625
- if (res.data.length <= 0) {
626
- this.$showMessage('合同未签订完成且纸质合同未上传,无法提交!!!')
627
- throw '合同未签订完成且纸质合同未上传,无法提交!!!'
628
- }
629
- }
630
- },
631
- async otherAuthentication() {
632
- console.log("当前数据", this.selectdata)
633
- this.$showMessage(`请确认是否进行重新认证,确认前请保证身份信息正确!!!`, ['confirm']).then(async (res) => {
634
- if (res === 'confirm') {
635
- let http = new HttpResetClass()
636
- let data = {
637
- apply: this.selectdata
638
- }
639
- let result = await http.load(
640
- 'POST',
641
- 'rs/logic/anotherLegalize',
642
- {data: data},
643
- {
644
- resolveMsg: '重新发起实名认证成功!',
645
- rejectMsg: '重新发起实名认证失败!'
646
- }).then((res)=>{
647
- if(res.data === 200){
648
- this.$dispatch('loadPage')
649
- }
650
- })
651
- }
652
- })
653
- throw '重新发起实名认证!!!'
654
- },
655
- async otherSigned() {
656
- console.log("当前数据", this.selectdata)
657
- this.$showMessage(`请确认是否进行重新发送签署短信!!!`, ['confirm']).then(async (res) => {
658
- if (res === 'confirm') {
659
- let http = new HttpResetClass()
660
- let data = {
661
- apply: this.selectdata
662
- }
663
- let result = await http.load(
664
- 'POST',
665
- 'rs/logic/anotherMAS',
666
- {data: data},
667
- {
668
- resolveMsg: '重新发送签署短信成功!',
669
- rejectMsg: '重新发送签署短信失败!'
670
- }).then((res)=>{
671
- if(res.data === 200){
672
- this.$dispatch('loadPage')
673
- }
674
- })
675
- }
676
- })
677
- throw '重新发送签署短信!!!'
678
- },
679
- // 施工前置
680
- async constructionBefore () {
681
- await this.userSignBefore()
682
- if (this.show_data.f_apply_nature !== '分户挂表') {
683
- let http = new HttpResetClass()
684
- let data = {
685
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and f_meternumber is null and f_gasbrand_id is not null `
686
- }
687
- let res = await http.load(
688
- 'POST',
689
- 'rs/sql/countApplyUserinfo',
690
- {data: data},
691
- {
692
- resolveMsg: null,
693
- rejectMsg: '安装明细查询失败!!!'
694
- })
695
- if (res.data[0].num > 0) {
696
- this.$showMessage(`还有${res.data[0].num}户未安装,无法提交`)
697
- throw `还有${res.data[0].num}户未安装,无法提交`
698
- }
699
- }
700
- },
701
- async userSignBefore() {
702
- let http = new HttpResetClass()
703
- let data = {
704
- tablename: 't_files',
705
- condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '${this.selectdata.defname}' and fremarks = '报装手机签字文件'`
706
- }
707
- let res = await http.load(
708
- 'POST',
709
- `rs/sql/applySingleTable`,
710
- {data: data},
711
- {resolveMsg: null, rejectMsg: null}
712
- )
713
- if (res.data.length <= 0) {
714
- this.$showMessage('用户未签字,无法提交!!!')
715
- throw '用户未签字,无法提交!'
716
- }
717
- },
718
- addressInitialization () {
719
- this.$getConfig(this, 'UserAddress')
720
-
721
- let f_address_type = this.show_data.f_address_type
722
-
723
- for (const item of this.show_data.fields) {
724
- if (f_address_type === '民用市区') {
725
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
726
- item.hidden = false
727
- item.required = true
728
- }
729
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
730
- item.hidden = false
731
- item.required = false
732
- }
733
- if (item.label === '地址') {
734
- item.readonly = true
735
- }
736
- }
737
- if (f_address_type === '民用乡镇') {
738
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
739
- item.hidden = false
740
- item.required = true
741
- }
742
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
743
- item.hidden = false
744
- item.required = false
745
- }
746
- if (item.label === '楼层') {
747
- item.hidden = true
748
- item.required = false
749
- }
750
- if (item.label === '地址') {
751
- item.readonly = true
752
- }
753
- }
754
- if (f_address_type === '特殊地址') {
755
- if (item.label === '区/县' || item.label === '街道/乡镇') {
756
- item.hidden = false
757
- item.required = true
758
- }
759
- if (item.label === '集收单位') {
760
- item.hidden = false
761
- item.required = false
762
- }
763
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
764
- item.hidden = true
765
- item.required = false
766
- }
767
- if (item.label === '地址') {
768
- item.readonly = false
769
- }
770
- }
771
-
772
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
773
- item.hidden = true
774
- }
775
- }
776
- },
777
- async streetChange () {
778
- if (isEmpty(this.show_data.f_street)) {
779
- return
780
- }
781
-
782
- let data = {
783
- tablename: 't_area',
784
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
785
- }
786
- let http = new HttpResetClass()
787
- let res = await http.load(
788
- 'POST',
789
- `rs/sql/applySingleTable`,
790
- {data: data},
791
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
792
- )
793
-
794
- this.setLabelOptions('集收单位', res.data.map(item => {
795
- return {
796
- label: item.f_residential_area,
797
- value: item.f_residential_area
798
- }
799
- }))
800
- },
801
- async pcdChange () {
802
- if (isEmpty(this.show_data.f_pcd)) {
803
- return
804
- }
805
-
806
- let data = {
807
- tablename: 't_street',
808
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
809
- }
810
- let f_address_type = this.getLableValue('地址类型')
811
-
812
- if (f_address_type === '民用市区') {
813
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
814
- }
815
- if (f_address_type === '民用乡镇') {
816
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
817
- }
818
-
819
- let http = new HttpResetClass()
820
- let res = await http.load(
821
- 'POST',
822
- `rs/sql/applySingleTable`,
823
- {data: data},
824
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
825
- )
826
-
827
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
828
- return {
829
- label: item.f_street,
830
- value: item.f_street
831
- }
832
- }))
833
- },
834
- //查询现场负责人
835
- async getConstructionWorker(){
836
- let data = {
837
- source: 'this.getParentByType($organization$).getChildByName($建设单位$).getChildren()',
838
- userid: this.$login.f.id
839
- }
840
- let http = new HttpResetClass()
841
- let res = await http.load(
842
- 'POST',
843
- `rs/search`,
844
- {data: data},
845
- {resolveMsg: null, rejectMsg: '现场负责人查询失败!!!'}
846
- )
847
- return res.data.map(item => {
848
- return {
849
- label: item.name,
850
- value: item.id
851
- }
852
- })
853
- },
854
- //获取下发人(当前操作人所属部门下的所有人)
855
- getSource () {
856
- return 'this.getParentByType($organization$).getChildByName($'+ this.$login.f.f_department_name + '$).getChildren()'
857
- },
858
- async getUserName() {
859
- if(this.selectdata.f_construction_unit_id){
860
- let data = {
861
- tablename: 't_user',
862
- condition: `id='${this.selectdata.f_construction_unit_id}'`
863
- }
864
- let http = new HttpResetClass()
865
- let res = await http.load(
866
- 'POST',
867
- `rs/sql/applySingleTable`,
868
- {data: data},
869
- {resolveMsg: null, rejectMsg: null}
870
- )
871
- return res.data.map(item => {
872
- return {
873
- label: item.name,
874
- value: item.id
875
- }
876
- })
877
- }
878
- return
879
- },
880
- // 安装单位签字人
881
- async getConstructionUnitId () {
882
- let data = {
883
- source: '',
884
- userid: this.$login.f.id
885
- }
886
- data.source = 'this.getParentByType($organization$).getChildByName($'+ this.$login.f.f_department_name + '$).getChildren()'
887
- let http = new HttpResetClass()
888
- let res = await http.load(
889
- 'POST',
890
- `rs/search`,
891
- {data: data},
892
- {resolveMsg: null, rejectMsg: '安装单位施工班组查询失败!!!'}
893
- )
894
- return res.data.map(item => {
895
- return {
896
- label: item.name,
897
- value: item.id
898
- }
899
- })
900
- },
901
- // 安装单位负责人
902
- async getConstructionUnit () {
903
- let data = {
904
- source: 'this.getParentByType($organization$).getChildByName($工程施工队$).getChildren()',
905
- userid: this.$login.f.id
906
- }
907
- let http = new HttpResetClass()
908
- let res = await http.load(
909
- 'POST',
910
- `rs/search`,
911
- {data: data},
912
- {resolveMsg: null, rejectMsg: '安装单位负责人查询失败!!!'}
913
- )
914
- console.log("显示返回值",res)
915
- let constructionUnit = res.data.map(item => {
916
- return {
917
- label: item.name,
918
- value: item.id
919
- }
920
- })
921
- constructionUnit = constructionUnit.sort((a,b) => a.value - b.value)
922
- console.log("显示返回值1",constructionUnit)
923
- return constructionUnit
924
- },
925
- // 管线施工单位
926
- async getGuanXianBuildUnit () {
927
- let data = {
928
- source: 'this.getParentByType($organization$).getChildByName($工程施工队$).getChildren()',
929
- userid: this.$login.f.id
930
- }
931
- let http = new HttpResetClass()
932
- let res = await http.load(
933
- 'POST',
934
- `rs/search`,
935
- {data: data},
936
- {resolveMsg: null, rejectMsg: '安装单位负责人查询失败!!!'}
937
- )
938
- return res.data.map(item => {
939
- return {
940
- label: item.name,
941
- value: item.name
942
- }
943
- })
944
- },
945
- // 建设单位
946
- async getConstructOperator () {
947
- let data = {
948
- source: 'this.getParentByType($organization$).getChildByName($建设单位$).getChildren()',
949
- userid: this.$login.f.id
950
- }
951
- let http = new HttpResetClass()
952
- let res = await http.load(
953
- 'POST',
954
- `rs/search`,
955
- {data: data},
956
- {resolveMsg: null, rejectMsg: '建设单位人员查询失败!!!'}
957
- )
958
- return res.data.map(item => {
959
- return {
960
- label: item.name,
961
- value: item.id
962
- }
963
- })
964
- },
965
- // 监理单位
966
- async getSupervisorOperator () {
967
- let data = {
968
- source: 'this.getParentByType($organization$).getChildByName($监理单位$).getChildren()',
969
- userid: this.$login.f.id
970
- }
971
- let http = new HttpResetClass()
972
- let res = await http.load(
973
- 'POST',
974
- `rs/search`,
975
- {data: data},
976
- {resolveMsg: null, rejectMsg: '监理单位人员查询失败!!!'}
977
- )
978
- for (const item of this.selectdata.fields) {
979
- if (item.label === '监理单位') {
980
- item.value = res.data[0].id
981
- this.selectdata[item.field] = res.data[0].id
982
- }
983
- }
984
- return res.data.map(item => {
985
- return {
986
- label: item.name,
987
- value: item.id
988
- }
989
- })
990
- },
991
- // 管线监理单位
992
- async getSupervisorName () {
993
- let data = {
994
- source: 'this.getParentByType($organization$).getChildByName($监理单位$).getChildren()',
995
- userid: this.$login.f.id
996
- }
997
- let http = new HttpResetClass()
998
- let res = await http.load(
999
- 'POST',
1000
- `rs/search`,
1001
- {data: data},
1002
- {resolveMsg: null, rejectMsg: '监理单位人员查询失败!!!'}
1003
- )
1004
- return res.data.map(item => {
1005
- return {
1006
- label: item.name,
1007
- value: item.name
1008
- }
1009
- })
1010
- },
1011
-
1012
- // 监理现场负责人
1013
- async getSupervisorOperatorId () {
1014
- let data = {
1015
- source: 'this.getParentByType($organization$).getChildByName($监理班组$).getChildren()',
1016
- userid: this.$login.f.id
1017
- }
1018
- let http = new HttpResetClass()
1019
- let res = await http.load(
1020
- 'POST',
1021
- `rs/search`,
1022
- {data: data},
1023
- {resolveMsg: null, rejectMsg: '监理单位人员查询失败!!!'}
1024
- )
1025
- return res.data.map(item => {
1026
- return {
1027
- label: item.name,
1028
- value: item.id
1029
- }
1030
- })
1031
- },
1032
- // 土建单位
1033
- async getEngineeringOperator () {
1034
- let data = {
1035
- source: 'this.getParentByType($organization$).getChildByName($土建单位$).getChildren()',
1036
- userid: this.$login.f.id
1037
- }
1038
- let http = new HttpResetClass()
1039
- let res = await http.load(
1040
- 'POST',
1041
- `rs/search`,
1042
- {data: data},
1043
- {resolveMsg: null, rejectMsg: '土建单位人员查询失败!!!'}
1044
- )
1045
- let result = res.data.map(item => {
1046
- return {
1047
- label: item.name,
1048
- value: item.id
1049
- }
1050
- })
1051
- result.push({label:'用户自理',value:'用户自理'})
1052
- result.push({label:'无',value:'无'})
1053
- return result
1054
- },
1055
- // 管线土建单位
1056
- async getEngineeringName () {
1057
- let data = {
1058
- source: 'this.getParentByType($organization$).getChildByName($土建单位$).getChildren()',
1059
- userid: this.$login.f.id
1060
- }
1061
- let http = new HttpResetClass()
1062
- let res = await http.load(
1063
- 'POST',
1064
- `rs/search`,
1065
- {data: data},
1066
- {resolveMsg: null, rejectMsg: '土建单位人员查询失败!!!'}
1067
- )
1068
- let result = res.data.map(item => {
1069
- return {
1070
- label: item.name,
1071
- value: item.name
1072
- }
1073
- })
1074
- result.push({label:'用户自理',value:'用户自理'})
1075
- result.push({label:'无',value:'无'})
1076
- return result
1077
- },
1078
- // 检测单位
1079
- async getCheckOperator () {
1080
- let data = {
1081
- source: 'this.getParentByType($organization$).getChildByName($检测单位$).getChildren()',
1082
- userid: this.$login.f.id
1083
- }
1084
- let http = new HttpResetClass()
1085
- let res = await http.load(
1086
- 'POST',
1087
- `rs/search`,
1088
- {data: data},
1089
- {resolveMsg: null, rejectMsg: '检测单位人员查询失败!!!'}
1090
- )
1091
-
1092
- let result = res.data.map(item => {
1093
- return {
1094
- label: item.name,
1095
- value: item.id
1096
- }
1097
- })
1098
- result.push({label:'无',value:'无'})
1099
- return result
1100
- },
1101
- // 管线检测单位
1102
- async getCheckName () {
1103
- let data = {
1104
- source: 'this.getParentByType($organization$).getChildByName($检测单位$).getChildren()',
1105
- userid: this.$login.f.id
1106
- }
1107
- let http = new HttpResetClass()
1108
- let res = await http.load(
1109
- 'POST',
1110
- `rs/search`,
1111
- {data: data},
1112
- {resolveMsg: null, rejectMsg: '检测单位人员查询失败!!!'}
1113
- )
1114
-
1115
- let result = res.data.map(item => {
1116
- return {
1117
- label: item.name,
1118
- value: item.name
1119
- }
1120
- })
1121
- result.push({label:'无',value:'无'})
1122
- return result
1123
- },
1124
- // 获取气表品牌
1125
- async getMeterBrand () {
1126
- let data = {
1127
- }
1128
-
1129
- let http = new HttpResetClass()
1130
- let res = await http.load(
1131
- 'POST',
1132
- `rs/sql/getMeterBrand`,
1133
- {data: data},
1134
- {resolveMsg: null, rejectMsg: '气表品牌查询失败!!!'}
1135
- )
1136
-
1137
- return res.data
1138
- },
1139
- async stopApply () {
1140
- console.log('终止报建!!!!!')
1141
- if (this.show_data.defname === '报建受理') {
1142
- this.show_data.f_stop_reason = this.show_data.f_accept_result
1143
- }
1144
- if (this.show_data.defname === '现场勘察') {
1145
- this.show_data.f_stop_reason = this.show_data.f_prospecting_result
1146
- }
1147
-
1148
- let data = {
1149
- apply: this.show_data,
1150
- user: this.$login.f
1151
- }
1152
-
1153
- let res = await this.$resetpost(
1154
- `rs/logic/stopApply`,
1155
- {data: data},
1156
- {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
1157
- )
1158
-
1159
- this.$dispatch('loadPage')
1160
-
1161
- throw '终止报建!!!'
1162
- },
1163
- // 获取小区
1164
- async getResidentialArea () {
1165
- let data = {
1166
- tablename: 't_area_address',
1167
- condition: `f_filiale like '%${"榆林."+this.$login.f.orgs}%' and f_area_status = '启用'`
1168
- }
1169
- let http = new HttpResetClass()
1170
- let res = await http.load(
1171
- 'POST',
1172
- `rs/sql/applySingleTable`,
1173
- {data: data},
1174
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
1175
- )
1176
- return res.data.map(item => {
1177
- return {
1178
- label: item.f_residential_area,
1179
- value: item.id
1180
- }
1181
- })
1182
- },
1183
- //获取燃气公司内部签署人
1184
- async getContractSignatory () {
1185
- let data = {
1186
- condition: `asj.f_type = '内部' and asj.f_subject_type = '企业' and asj.f_state = '有效' and asj.f_auth_state = '审核通过' and asg.f_state = '有效' and asg.f_sign_state = '签章成功'`
1187
- }
1188
- let http = new HttpResetClass()
1189
- let res = await http.load(
1190
- 'POST',
1191
- `rs/sql/getAuthSubjectList`,
1192
- {data: data},
1193
- {resolveMsg: null, rejectMsg: '签署人查询失败!!!'}
1194
- )
1195
- return res.data.map(item => {
1196
- return {
1197
- label: item.f_subject_name,
1198
- value: `${item.id}`
1199
- }
1200
- })
1201
- },
1202
- async setContractSignatory () {
1203
- let data = {
1204
- condition: `asj.f_type = '内部' and asj.f_subject_type = '企业' and asj.f_state = '有效' and asj.f_auth_state = '审核通过' and asg.f_state = '有效' and asg.f_sign_state = '签章成功'`
1205
- }
1206
- let http = new HttpResetClass()
1207
- let res = await http.load(
1208
- 'POST',
1209
- `rs/sql/getAuthSubjectList`,
1210
- {data: data},
1211
- {resolveMsg: null, rejectMsg: '签署人查询失败!!!'}
1212
- )
1213
- this.setLabelOptions('签署人',res.data.map(item => {
1214
- return {
1215
- label: item.f_subject_name,
1216
- value: `${item.id}`
1217
- }
1218
- }))
1219
- this.setLabelValue('签署人',res.data[0].id)
1220
- },
1221
- // 地址拼接
1222
- addressSplicing () {
1223
- let f_area = this.getLableValue('区/县') ? this.getLableValue('区/县') + '-' : ''
1224
- let f_slice_area = this.getLableValue('片区') ? this.getLableValue('片区') + '-' : ''
1225
- let f_street = this.getLableValue('街道') || ''
1226
- let f_address_detail = this.getLableValue('详细地址') || ''
1227
-
1228
- let f_address = f_area + f_slice_area + f_street + f_address_detail
1229
- this.setLabelValue("地址", f_address)
1230
- },
1231
- // 小区地址拼接
1232
- areaAddressSplicing () {
1233
- let f_area = this.area.f_area || ''
1234
- let f_slice_area = this.area.f_slice_area || ''
1235
- let f_street = this.area.f_street || ''
1236
- let f_residential_area = this.area.f_residential_area || ''
1237
-
1238
- let f_address = f_area + f_slice_area + f_street + f_residential_area
1239
- this.setLabelValue("地址", f_address)
1240
- },
1241
- //分户挂表生成安检单
1242
- async getChecklist() {
1243
- let http = new HttpResetClass()
1244
- let data = {
1245
- f_process_id: this.selectdata.f_process_id,
1246
- f_userinfo_id: this.selectdata.f_userinfo_id,
1247
- user: this.$login.f.user
1248
- }
1249
- let res = await http.load(
1250
- 'POST',
1251
- `rs/logic/getChecklist`,
1252
- {data: data},
1253
- {resolveMsg: null, rejectMsg: null}
1254
- )
1255
- },
1256
- // 生成合同编号(已作废)
1257
- async getContractNumber() {
1258
- const nowDate = new Date()
1259
- let year = nowDate.getFullYear()
1260
- let nature = ''
1261
- if (this.show_data.f_apply_type === '民用报建') {
1262
- nature = 'J'
1263
- } else if (this.show_data.f_apply_type === '非民用报建') {
1264
- nature = 'F'
1265
- }
1266
- let shiGong = 'S'
1267
- let gongQi = 'G'
1268
-
1269
- let lastyYear = year - 1
1270
- let http = new HttpResetClass()
1271
- let data = {
1272
- user: this.$login.f.user,
1273
- startDate: year + '-01-01 00:00:00',
1274
- endDate: year + '-12-31 23:59:59'
1275
- }
1276
- let res = await http.load(
1277
- 'POST',
1278
- `rs/sql/getContractCount`,
1279
- {data: data},
1280
- {resolveMsg: null, rejectMsg: null}
1281
- )
1282
- let count = res.data[0].count + 1
1283
-
1284
-
1285
- let shiGongContractNumber = year + nature + shiGong + '-' + count
1286
- let gongQiContractNumber = year + nature + gongQi + '-' + count
1287
- if (!this.getLableValue('委托合同编号')){
1288
- this.setLabelValue('委托合同编号',shiGongContractNumber)
1289
- this.setLabelValue('供气合同编号',gongQiContractNumber)
1290
- }
1291
- },
1292
- //获取气价列表
1293
- async getPrice (index) {
1294
- if (isEmpty(this.show_data.f_gas_nature) || isEmpty(this.show_data.f_price_type)) {
1295
- return
1296
- }
1297
-
1298
- if (index) {
1299
- this.setLabelValue('气价名称', null)
1300
- }
1301
-
1302
- if (this.show_data.f_price_type === '混合气价') {
1303
- this.showLabels('比率')
1304
- } else {
1305
- this.setLabelValue('比率', null)
1306
- this.hideLabels('比率')
1307
- }
1308
-
1309
- let data = {
1310
- condition: `sp.f_filiale like '%${"榆林."+this.$login.f.orgs}%' and sp.f_price_type = '${this.show_data.f_price_type}' and f_gasproperties = '${this.show_data.f_gas_nature}'`
1311
- }
1312
-
1313
- if (this.show_data.f_apply_type === '民用报建') {
1314
- data.condition += `and f_user_type = '民用'`
1315
- }
1316
- if (this.show_data.f_apply_type === '非民用报建') {
1317
- data.condition += `and f_user_type = '非民用'`
1318
- }
1319
-
1320
-
1321
- let http = new HttpResetClass()
1322
- let res = await http.load(
1323
- 'POST',
1324
- `rs/sql/applyGetPrice`,
1325
- {data: data},
1326
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
1327
- )
1328
- let priceLoptions = res.data.map(item => {
1329
- return {
1330
- label: item.f_price_name,
1331
- value: `${item.id}`
1332
- }
1333
- })
1334
- this.setLabelOptions('气价名称', priceLoptions)
1335
- },
1336
- // 单价失去焦点
1337
- async priceChange () {
1338
- if (isEmpty(this.show_data.f_price)) {
1339
- return
1340
- }
1341
- let data = {
1342
- operator: '*',
1343
- num1: this.show_data.f_price,
1344
- num2: this.show_data.f_install_count
1345
- }
1346
- let http = new HttpResetClass()
1347
- let res = await http.load(
1348
- 'POST',
1349
- `rs/logic/compute`,
1350
- {data: data},
1351
- {resolveMsg: null, rejectMsg: '工程材料费计算失败!!!'}
1352
- )
1353
-
1354
- this.setLabelValue('工程材料费', res.data)
1355
- },
1356
- //工商户验证表具类型是否需选择
1357
- async meterBrandCheck() {
1358
- let data = {
1359
- f_process_id: this.show_data.f_process_id,
1360
- orgid:this.$login.f.orgid
1361
- }
1362
- let http = new HttpResetClass()
1363
- let res = await http.load(
1364
- 'POST',
1365
- `rs/sql/meterCheck`,
1366
- {data: data},
1367
- {resolveMsg: null, rejectMsg: null}
1368
- )
1369
- if (res.data[0].num > 0){
1370
- this.$showMessage(`还有${res.data[0].num}处未选择表具,请选择后提交!`)
1371
- throw null
1372
- }
1373
- },
1374
- // 安装户数
1375
- async installCountCheck() {
1376
- let data = {
1377
- tablename: 't_userinfo',
1378
- condition: `f_process_id = '${this.show_data.f_process_id}' and f_user_state != '销户'`,
1379
- }
1380
-
1381
- let http = new HttpResetClass()
1382
- let res = await http.load(
1383
- 'POST',
1384
- `rs/sql/applySingleTable`,
1385
- {data: data},
1386
- {resolveMsg: null, rejectMsg: '用户数量查询失败'}
1387
- )
1388
- this.setLabelValue('安装户数',res.data.length)
1389
- },
1390
- // 户内出单日期
1391
- getOutdoorsTime () {
1392
- for (const item of this.selectdata.fields) {
1393
- console.log('是否进入')
1394
- if (item.label === '户内出单日期') {
1395
- item.value = this.selectdata.f_release_date
1396
- this.selectdata[item.field] = item.value
1397
- console.log('当前出单时间',item.value)
1398
- }else if(item.label === '庭院出单日期'){
1399
- item.value = this.selectdata.f_release_date
1400
- this.selectdata[item.field] = item.value
1401
- }else if(item.label === '出单日期'){
1402
- item.value = this.selectdata.f_release_date
1403
- this.selectdata[item.field] = item.value
1404
- }
1405
- }
1406
- },
1407
- //获取缴费日期
1408
- async getChargeDate() {
1409
- let data = {
1410
- tablename: 'activityins',
1411
- condition: `processid = '${this.selectdata.f_process_id}' and defname = '报装缴费'`,
1412
- }
1413
-
1414
- let http = new HttpResetClass()
1415
- let res = await http.load(
1416
- 'POST',
1417
- `rs/sql/applySingleTable`,
1418
- {data: data},
1419
- {resolveMsg: null, rejectMsg: null}
1420
- )
1421
- if (res.data[0]) {
1422
- for (const item of this.selectdata.fields) {
1423
- if (item.label === '缴费日期') {
1424
- item.value = res.data[0].finishtime
1425
- this.selectdata[item.field] = item.value
1426
- }
1427
- }
1428
- }
1429
- },
1430
- //获取工程施工时各部门当前签字环节
1431
- async getSingAct() {
1432
- let data = {
1433
- f_process_id: this.selectdata.f_process_id
1434
- }
1435
- let http = new HttpResetClass()
1436
- let res = await http.load(
1437
- 'POST',
1438
- `rs/sql/getSingAct`,
1439
- {data: data},
1440
- {resolveMsg: null, rejectMsg: '签字状态查询失败!!!'}
1441
- )
1442
- if (res.data.length > 0) {
1443
- for (const item of this.selectdata.fields) {
1444
- if (item.label === '签字所在环节') {
1445
- item.value = res.data[0].defname
1446
- this.selectdata[item.field] = item.value
1447
- }
1448
- }
1449
- }
1450
- },
1451
- //获取土建的乙方
1452
- getYiFang() {
1453
- return [{label: '榆林榆川天然气', value: '榆林榆川天然气'},
1454
- {label: this.selectdata.f_user_name, value: this.selectdata.f_user_name},
1455
- {label: '无', value: '无'}]
1456
- },
1457
- getGaiXianType () {
1458
- return [{label: "隐患整改", value: "隐患整改"},
1459
- {label: "改造工程", value: "改造工程"},
1460
- {label: "改线工程", value: "改线工程"},
1461
- {label: "老旧小区", value: "老旧小区"}]
1462
- },
1463
- async checkIsUser() {
1464
- let data = {
1465
- items: 'count(*) num' ,
1466
- tablename: 't_userinfo',
1467
- condition: `f_process_id = '${this.show_data.f_process_id}' and f_user_state <> '销户'`
1468
- }
1469
-
1470
- let http = new HttpResetClass()
1471
- let res = await http.load(
1472
- 'POST',
1473
- `rs/sql/applySingleTable`,
1474
- {data: data},
1475
- {resolveMsg: null, rejectMsg: '是否存在用户!!!'}
1476
- )
1477
- if (res.data[0].num <= 0){
1478
- this.$showMessage(`未添加设备,请添加后提交!`)
1479
- throw null
1480
- }
1481
- },
1482
- async repair() {
1483
- let data = {
1484
- f_process_id: this.show_data.f_process_id
1485
- }
1486
- let http = new HttpResetClass()
1487
- let res = await http.load(
1488
- 'POST',
1489
- `rs/logic/updateRepair`,
1490
- {data: data},
1491
- {resolveMsg: null, rejectMsg: '维修工单状态修改!!!'}
1492
- )
1493
- this.$dispatch('loadPage')
1494
- },
1495
- changeDispatch(value){
1496
- if (value === '维修安检中心'){
1497
- this.hideLabels('现场项目负责人', '安装单位', '安装单位现场负责人', '建设单位', '监理单位', '土建单位', '检测单位', '户内出单日期', '户内回单日期'
1498
- , '户内施工备注', '庭院出单日期', '庭院回单日期', '庭院施工备注', '是否发起签字', '签字是否完成', '签字所在环节')
1499
- this.hideButtons('签字')
1500
- this.electiveLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位', '户内出单日期', '户内回单日期'
1501
- , '户内施工备注', '庭院出单日期', '庭院回单日期', '庭院施工备注', '是否发起签字', '签字是否完成', '签字所在环节')
1502
- }
1503
- if (value === '施工工队'){
1504
- this.showLabels('现场项目负责人', '安装单位', '安装单位现场负责人','建设单位', '监理单位', '土建单位', '检测单位', '户内出单日期', '户内回单日期'
1505
- , '户内施工备注', '庭院出单日期', '庭院回单日期', '庭院施工备注', '是否发起签字', '签字是否完成', '签字所在环节')
1506
- this.requiredLabels('现场项目负责人', '安装单位', '安装单位现场负责人','建设单位', '监理单位', '土建单位', '检测单位', '现场项目负责人', '是否发起签字', '签字是否完成', '签字所在环节')
1507
- }
1508
- },
1509
- //拆除流程核对气量提交
1510
- async gasCheckBefore() {
1511
- let http = new HttpResetClass()
1512
- let data = {
1513
- tablename: 't_files',
1514
- condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '${this.selectdata.defname}' and fusetype = '气量核对单'`
1515
- }
1516
- let res = await http.load(
1517
- 'POST',
1518
- `rs/sql/applySingleTable`,
1519
- {data: data},
1520
- {resolveMsg: null, rejectMsg: null}
1521
- )
1522
- if (res.data.length <= 0) {
1523
- this.$showMessage('气量核对单未上传,无法提交!!!')
1524
- throw '气量核对单未上传,无法提交!'
1525
- }
1526
- },
1527
- },
1528
- events: {
1529
- // 强制开关阀
1530
- async 'onOffValve' () {
1531
- let data = {
1532
- condition: `ui.f_userinfo_id = '${this.show_data.f_userinfo_id}'`
1533
- }
1534
- let http = new HttpResetClass()
1535
- let res = await http.load(
1536
- 'POST',
1537
- `rs/sql/getApplyUserinfo`,
1538
- {data: data},
1539
- {resolveMsg: null, rejectMsg: '档案获取失败!!!'}
1540
- )
1541
-
1542
- let userinfo = res.data[0]
1543
-
1544
- if (this.show_data.button.button_name !== '退出强制状态') {
1545
- data = {
1546
- condition: `t_userfiles.f_meternumber = '${userinfo.f_meternumber}'`,
1547
- contentData: {
1548
- isOpen: this.show_data.button.button_name === '强制开阀' ? 1 : 0
1549
- },
1550
- inputtor: this.$login.f.name,
1551
- instructTitle: this.show_data.button.button_name === '强制开阀' ? '开阀' : '关阀',
1552
- instructType: '阀门控制',
1553
- meterBrandName: userinfo.f_alias
1554
- }
1555
- res = await http.load(
1556
- 'POST',
1557
- `rs/logic/saveInstruct`,
1558
- {data: data},
1559
- {resolveMsg: null, rejectMsg: `${this.show_data.button.button_name}失败!!!`}
1560
- )
1561
- }
1562
-
1563
- data = {
1564
- f_user_id: userinfo.f_user_id,
1565
- f_userinfo_id: userinfo.f_userinfo_id,
1566
- record: {
1567
- f_filiale: "榆林."+this.$login.f.orgs,
1568
- f_instruct_meta_data: this.show_data.button.button_name === '退出强制状态' ? '退出强制阀控' : '进入强制阀控',
1569
- f_instruct_title: this.show_data.button.button_name === '退出强制状态' ? '退出强制阀控' : '进入强制阀控',
1570
- f_instruct_type: '阀门控制',
1571
- f_meternumber: userinfo.f_meternumber,
1572
- f_operator: this.$login.f.name,
1573
- f_outlets: userinfo.f_outlets,
1574
- f_reason: this.show_data.button.f_reason,
1575
- f_user_id: userinfo.f_user_id,
1576
- f_userinfo_id: userinfo.f_userinfo_id
1577
- },
1578
- state: this.show_data.button.button_name === '退出强制状态' ? 0 : 1
1579
- }
1580
-
1581
- res = await http.load(
1582
- 'POST',
1583
- `rs/logic/updateNetWorkValve`,
1584
- {data: data},
1585
- {resolveMsg: '执行成功!!!', rejectMsg: `执行失败!!!`}
1586
- )
1587
-
1588
- },
1589
- // 修改用户档案
1590
- async 'updateUserinfoState' () {
1591
- let data = {
1592
- f_userinfo_id: this.show_data.f_userinfo_id
1593
- }
1594
- let http = new HttpResetClass()
1595
- let res = await http.load(
1596
- 'POST',
1597
- `rs/logic/updateUserinfoState`,
1598
- {data: data},
1599
- {resolveMsg: '该用户档案已为正常档案,可进行开关阀操作!!!', rejectMsg: '档案状态修改失败!!!'}
1600
- )
1601
-
1602
- this.showButtons('强制开阀','强制关阀')
1603
- this.hideButtons('转正式档案')
1604
- },
1605
- // 选择用户
1606
- async 'selectUserinfo' (row) {
1607
- this.setLabelValue('用户编号', row.f_userinfo_id)
1608
- this.setLabelValue('用户名称', row.f_user_name)
1609
- this.setLabelValue('用户电话', row.f_user_phone)
1610
- this.setLabelValue('证件类型', row.f_credentials)
1611
- this.setLabelValue('证件号码', row.f_idnumber)
1612
- this.setLabelValue('地址', row.f_address)
1613
- this.setLabelValue('定位地址', row.f_location_address)
1614
- this.setLabelValue('购货单位识别号', row.f_taxpayer_id)
1615
- this.setLabelValue('购货单位名称', row.f_paper_name)
1616
- this.setLabelValue('购货单位开户行及银行账号', row.f_paper_account)
1617
- this.setLabelValue('购货单位地址电话', row.f_address_phone)
1618
- this.setLabelValue('联系人', row.f_petitionuser)
1619
- this.setLabelValue('区/县', row.f_area)
1620
- this.setLabelValue('片区', row.f_slice_area)
1621
- this.setLabelValue('街道', row.f_street)
1622
- if (row.f_address_detail){
1623
- this.setLabelValue('详细地址', row.f_address_detail)
1624
- }
1625
- if (this.show_data.f_apply_type === '改线业务'){
1626
- this.setLabelValue('工程名称', row.f_user_name)
1627
- this.setLabelValue('联系电话', row.f_user_phone)
1628
- }
1629
- this.show_data.f_address_detail = row.f_address_detail
1630
- this.show_data.f_residential_area = row.f_residential_area
1631
- this.show_data.unit = row.unit
1632
- this.show_data.f_building = row.f_building
1633
- this.show_data.f_floor = row.f_floor
1634
- this.show_data.f_taxpayer_id = row.f_taxpayer_id //购货单位识别号
1635
- this.show_data.f_address_phone = row.f_address_phone //购货单位地址电话
1636
- this.show_data.f_paper_name = row.f_paper_name //购货单位名称
1637
- this.show_data.f_paper_account = row.f_paper_account
1638
- this.show_data.f_userinfo_id = row.f_userinfo_id
1639
- console.log("当前数据",this.show_data)
1640
- if (this.show_data.f_apply_type === '设备拆除'){
1641
- let data = {
1642
- userinfo: row,
1643
- apply: this.show_data,
1644
- loginUser: this.$login.f
1645
- }
1646
- let res = await this.$resetpost(
1647
- `rs/logic/addChaiChuUser`,
1648
- {data: data},
1649
- {resolveMsg: '添加拆除用户成功!!!', rejectMsg: '添加拆除用户失败!!!'}
1650
- )
1651
- this.$dispatch('breakControl', this.show_data)
1652
- }
1653
- },
1654
- async 'priceReadEvent' (index) {
1655
- await this.setContractSignatory()
1656
- // await this.getContractNumber()
1657
- await this.getPrice(index)
1658
- await this.priceChange()
1659
- },
1660
- async 'getPrice' (index) {
1661
- if (isEmpty(this.show_data.f_gas_nature) || isEmpty(this.show_data.f_price_type)) {
1662
- return
1663
- }
1664
-
1665
- if (index) {
1666
- this.setLabelValue('气价名称', null)
1667
- }
1668
-
1669
- if (this.show_data.f_price_type === '混合气价') {
1670
- this.showLabels('比率')
1671
- } else {
1672
- this.setLabelValue('比率', null)
1673
- this.hideLabels('比率')
1674
- }
1675
-
1676
- let data = {
1677
- condition: `sp.f_filiale like '%${"榆林."+this.$login.f.orgs}%' and sp.f_price_type = '${this.show_data.f_price_type}' and f_gasproperties = '${this.show_data.f_gas_nature}'`
1678
- }
1679
-
1680
- if (this.show_data.f_apply_type === '民用报建') {
1681
- data.condition += `and f_user_type = '民用'`
1682
- }
1683
- if (this.show_data.f_apply_type === '非民用报建') {
1684
- data.condition += `and f_user_type = '非民用'`
1685
- }
1686
-
1687
-
1688
- let http = new HttpResetClass()
1689
- let res = await http.load(
1690
- 'POST',
1691
- `rs/sql/applyGetPrice`,
1692
- {data: data},
1693
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
1694
- )
1695
-
1696
- let priceLoptions = res.data.map(item => {
1697
- return {
1698
- label: item.f_price_name,
1699
- value: `${item.id}`
1700
- }
1701
- })
1702
- this.setLabelOptions('气价名称',priceLoptions)
1703
- },
1704
- // 街道失去焦点
1705
- async changStreet () {
1706
- if (isEmpty(this.show_data.f_street)) {
1707
- return
1708
- }
1709
- this.addressSplicing()
1710
- },
1711
-
1712
- 'changAddressDetail'(){
1713
- if (isEmpty(this.show_data.f_address_detail)) {
1714
- return
1715
- }
1716
- this.addressSplicing()
1717
- },
1718
- 'changAddress'(){
1719
- if (isEmpty(this.show_data.f_address_detail)) {
1720
- return
1721
- }
1722
- let f_address = this.show_data.f_address + this.show_data.f_address_detail
1723
- this.setLabelValue("地址", f_address)
1724
- },
1725
- // 片区失去焦点
1726
- async 'changSliceArea' () {
1727
- if (isEmpty(this.show_data.f_area) || isEmpty(this.show_data.f_slice_area)) {
1728
- return
1729
- }
1730
-
1731
- let data = {
1732
- items: 'f_street label,f_street value',
1733
- tablename: 't_area_address',
1734
- condition: `f_area = '${this.show_data.f_area}' and f_slice_area = '${this.show_data.f_slice_area}'`,
1735
- groupitem: 'f_street'
1736
- }
1737
-
1738
- let http = new HttpResetClass()
1739
- let res = await http.load(
1740
- 'POST',
1741
- `rs/sql/applySingleTable`,
1742
- {data: data},
1743
- {resolveMsg: null, rejectMsg: '签字状态查询失败!!!'}
1744
- )
1745
- this.setLabelOptions('街道', res.data)
1746
-
1747
- this.addressSplicing()
1748
- },
1749
- // 区县失去焦点
1750
- 'changeArea' () {
1751
- if (isEmpty(this.show_data.f_area)) {
1752
- return
1753
- }
1754
- this.setLabelValue('片区', null)
1755
- this.setLabelValue('街道', null)
1756
- this.setLabelOptions('片区', this.$appdata.getParam(`${this.show_data.f_area}片区`))
1757
- this.setLabelOptions('街道', [])
1758
-
1759
- this.addressSplicing()
1760
- },
1761
- // 开启签字
1762
- async 'startSignActivity' () {
1763
- this.hideButtons('签字')
1764
- if(this.show_data.f_apply_type !== '管线建设'){
1765
- await this.constructionBefore()
1766
- }
1767
- let data = {
1768
- apply: this.show_data,
1769
- user: this.$login.f
1770
- }
1771
-
1772
- let res = await this.$resetpost(
1773
- `rs/logic/startSignActivity`,
1774
- {data: data},
1775
- {resolveMsg: '签字流程已发起!!!', rejectMsg: '签字发起失败!!!'}
1776
- )
1777
-
1778
- this.$dispatch('breakControl', this.show_data)
1779
- },
1780
- // 工程施工初始化
1781
- async 'buildReadyEvent' () {
1782
- // this.changeDispatch(this.getLableValue('派工类型'))
1783
- if(this.getLableValue('是否发起签字') === '') {
1784
- this.hideButtons('签字')
1785
- }
1786
- let http = new HttpResetClass()
1787
- if (isEmpty(this.show_data.f_meter_brand)) {
1788
- return
1789
- }else {
1790
- if (this.show_data.f_meter_brand === 'null') {
1791
- this.setLabelOptions('气表型号', [{label: '', value: 'null'}])
1792
- return
1793
- }
1794
- let data = {
1795
- f_gasbrand_id: this.show_data.f_meter_brand
1796
- }
1797
- let res = await http.load(
1798
- 'POST',
1799
- `rs/sql/getGasModel`,
1800
- {data: data},
1801
- {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
1802
- )
1803
- this.setLabelOptions('气表型号', res.data)
1804
- }
1805
-
1806
- if (this.show_data.f_apply_type === '分户挂表') {
1807
- let data = {
1808
- condition: `ui.f_userinfo_id = '${this.show_data.f_userinfo_id}'`
1809
- }
1810
- let http = new HttpResetClass()
1811
- let res = await http.load(
1812
- 'POST',
1813
- `rs/sql/getApplyUserinfo`,
1814
- {data: data},
1815
- {resolveMsg: null, rejectMsg: '档案状态获取失败!!!'}
1816
- )
1817
- console.log("f_meter_classif11y",res.data[0].f_meter_classify)
1818
- if (!res.data[0].f_meter_brand.includes('物联网表')) {
1819
- return
1820
- }
1821
- console.log("f_user_state11",res.data[0].f_user_state)
1822
- if (res.data[0].f_user_state === '正常') {
1823
- this.showButtons('退出强制状态','强制关阀')
1824
- this.hideButtons('转正式档案')
1825
- } else {
1826
- this.showButtons('转正式档案')
1827
- this.hideButtons('退出强制状态','强制关阀')
1828
- }
1829
- }
1830
- },
1831
- // 工程派工初始化
1832
- async 'dispatchReadyEvent' () {
1833
- if (isEmpty(this.show_data.f_meter_brand)) {
1834
- return
1835
- }
1836
- let data = {
1837
- f_gasbrand_id: this.show_data.f_meter_brand
1838
- }
1839
- let http = new HttpResetClass()
1840
- let res = await http.load(
1841
- 'POST',
1842
- `rs/sql/getGasModel`,
1843
- {data: data},
1844
- {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
1845
- )
1846
-
1847
- this.setLabelOptions('气表型号', res.data)
1848
- },
1849
- // 气表品牌失去焦点
1850
- async 'meterBrandChenge' (index) {
1851
- if (isEmpty(this.show_data.f_meter_brand)) {
1852
- return
1853
- }
1854
- this.setLabelValue('气表型号', null)
1855
- let data = {
1856
- f_gasbrand_id: this.show_data.f_meter_brand
1857
- }
1858
- let http = new HttpResetClass()
1859
- let res = await http.load(
1860
- 'POST',
1861
- `rs/sql/getGasModel`,
1862
- {data: data},
1863
- {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
1864
- )
1865
-
1866
- this.setLabelOptions('气表型号', res.data)
1867
- },
1868
- // 单价失去焦点
1869
- async 'priceChange' (index) {
1870
- if (isEmpty(this.show_data.f_price)) {
1871
- return
1872
- }
1873
- let data = {
1874
- operator: '*',
1875
- num1: this.show_data.f_price,
1876
- num2: this.show_data.f_install_count
1877
- }
1878
- let http = new HttpResetClass()
1879
- let res = await http.load(
1880
- 'POST',
1881
- `rs/logic/compute`,
1882
- {data: data},
1883
- {resolveMsg: null, rejectMsg: '工程材料费计算失败!!!'}
1884
- )
1885
-
1886
- this.setLabelValue('工程材料费', res.data)
1887
- },
1888
- // 安装户数失去焦点
1889
- 'installCountChange' (index) {
1890
- if (isEmpty(this.show_data.f_install_count)) {
1891
- return
1892
- }
1893
- if (Number(this.show_data.f_install_count) > Number(this.show_data.f_apply_count)) {
1894
- this.$showMessage('安装数已超过申请数!!!')
1895
- // this.setLabelValue('安装户数', null)
1896
- // this.setLabelValue('安装点数', null)
1897
- // return
1898
- }
1899
-
1900
- if (Number(this.show_data.f_install_count) <= 0) {
1901
- this.$showMessage('至少有一个用户!!!')
1902
- this.setLabelValue('安装户数', null)
1903
- this.setLabelValue('安装点数', null)
1904
- return
1905
- }
1906
- },
1907
- // 土建单位失去焦点
1908
- 'judgmentEngineering' (index) {
1909
- if (this.show_data.f_engineering_operator_id === '' && this.show_data.f_civil_engineering !== "无") {
1910
- this.$showMessage('土建工程派单与实际选择不符,请仔细核对后再次提交')
1911
- throw null
1912
- }
1913
- },
1914
- // 报建性质失去焦点
1915
- 'applyNatureChange' (index) {
1916
- if (this.show_data.f_apply_nature === '散户') {
1917
- //绑定票据类型为电子票
1918
- this.setLabelValue('票据类型', '电子票')
1919
- this.hideLabels('营业执照')
1920
- this.electiveLabels('营业执照', '购货单位识别号', '购货单位银行账号', '购货单位地址电话')
1921
- }
1922
- if (this.show_data.f_apply_nature === '小区') {
1923
- //票据类型为专票
1924
- this.setLabelValue('票据类型', '专票')
1925
- this.showLabels('营业执照', '小区/巷道')
1926
- this.requiredLabels('小区/巷道')
1927
- }
1928
- },
1929
- // 票据类型失去焦点
1930
- 'applyPaperChange' (index) {
1931
- console.log("测试是否进入")
1932
- if (this.show_data.f_paper_type === '专票') {
1933
- this.requiredLabels('购货单位名称','购货单位识别号', '购货单位银行账号', '购货单位地址电话')
1934
- }else {
1935
- this.electiveLabels( '购货单位识别号', '购货单位银行账号', '购货单位地址电话')
1936
- }
1937
- },
1938
- 'chargeAfter'(index){
1939
- if (this.show_data.f_surplus_money !== this.show_data.f_due_money){
1940
- this.hideButtons('退回')
1941
- }else {
1942
- this.showButtons('退回')
1943
- }
1944
- },
1945
- //购货单位识别号失去焦点
1946
- 'getAuthenticationMethod' (index){
1947
- if (isEmpty(this.show_data.f_taxpayer_id)) {
1948
- this.setLabelValue('认证类型','个人认证')
1949
- }else {
1950
- this.setLabelValue('认证类型','企业认证')
1951
- }
1952
- },
1953
- //搜索小区
1954
- 'selectArea' (val,index) {
1955
- let pcdText = `and f_residential_area like '%${val}%'`
1956
- let data = {
1957
- tablename: 't_area_address',
1958
- condition: `f_filiale like '%${"榆林."+this.$login.f.orgs}%' and f_area_status = '启用' ${pcdText}`
1959
- }
1960
- new HttpResetClass().load("POST", `rs/sql/applySingleTable`, {data:data}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
1961
- console.log('请求发送完成!!!!!'+JSON.stringify(res))
1962
- if(res.data.length>0){
1963
- this.setLabelOptions('小区/巷道', res.data.map(item => {
1964
- return {
1965
- label: item.f_residential_area,
1966
- value: item.id
1967
- }
1968
- }))
1969
- }
1970
- })
1971
- },
1972
- //身份证号码校验
1973
- 'checkIdnumber' (index) {
1974
- if(this.show_data.f_credentials === '身份证'){
1975
- var verify = /^[1-9]\d{5}(18|19|20|21)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
1976
- if (!verify.test(this.show_data.fields[index].value)){
1977
- this.show_data.fields[index].value = null
1978
- this.$showMessage('身份证号码格式错误请重新输入!!!')
1979
- }
1980
- }
1981
- },
1982
- //电话号码校验
1983
- 'checkPhone' (index) {
1984
- var verify = /^([1][0-9]{10})$/
1985
- if (!verify.test(this.show_data.fields[index].value)){
1986
- this.show_data.fields[index].value = null
1987
- this.$showMessage('电话号码格式错误请重新输入!!!')
1988
- }
1989
- },
1990
- 'changeDispatching'(index){
1991
- if (this.show_data.fields[index].value === '安检维修中心'){
1992
- this.hideLabels('现场项目负责人', '安装单位', '安装单位现场负责人','建设单位', '监理单位', '土建单位', '检测单位')
1993
- this.electiveLabels('现场项目负责人', '安装单位', '安装单位现场负责人','建设单位', '监理单位', '土建单位', '检测单位')
1994
- }else if (this.show_data.fields[index].value === '施工工队'){
1995
- this.showLabels('现场项目负责人', '安装单位', '安装单位现场负责人','建设单位', '监理单位', '土建单位', '检测单位')
1996
- this.requiredLabels('现场项目负责人', '安装单位', '安装单位现场负责人','建设单位', '监理单位', '土建单位', '检测单位')
1997
- }
1998
- },
1999
- 'getRefund'(index){
2000
- if (this.show_data.fields[index].value === ''){
2001
- this.hideLabels('退费金额', '退款项')
2002
- this.electiveLabels('退费金额', '退款项')
2003
- }else if (this.show_data.fields[index].value === ''){
2004
- this.showLabels('退费金额', '退款项')
2005
- this.requiredLabels('退费金额', '退款项')
2006
- }
2007
- },
2008
- 'hasTrouble'(index) {
2009
- if (this.show_data.fields[index].value === '有纠纷'){
2010
- this.hideButtons('提交', '签字', '图纸变更')
2011
- this.showLabels('纠纷原因')
2012
- }else {
2013
- this.showButtons('提交', '签字', '图纸变更')
2014
- this.hideLabels('纠纷原因')
2015
- }
2016
- },
2017
- //金额大小写转换
2018
- 'applyCapitalizedAmount' (index){
2019
- // 通过正则过滤小数点后两位
2020
- let money = (this.show_data.fields[index].value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
2021
- this.setLabelValue('应交金额大写',this.smalltoBIG(money))
2022
- },
2023
-
2024
- // ===========================================
2025
- 'initializtionView' () {
2026
- if (this.show_data.f_apply_nature === '散户') {
2027
- this.hideLabels('营业执照')
2028
- this.electiveLabels('营业执照', '购货单位识别号', '购货单位银行账号', '购货单位地址电话')
2029
- }
2030
- if (this.show_data.f_apply_nature === '小区') {
2031
- this.showLabels('营业执照', '小区/巷道', '小区名称')
2032
- this.requiredLabels('小区/巷道')
2033
- // this.hideComponents('用户花名单')
2034
- }
2035
- },
2036
- // 检查重复
2037
- 'checkRepeat' (index) {
2038
- this.checkDuplicate(index)
2039
- },
2040
- async 'button'() {
2041
- if (this.show_data.button.before) {
2042
- await this[this.show_data.button.before]()
2043
- }
2044
- // 点击重置按钮就重置数据
2045
- if (this.show_data.button.button_name === '重置') {
2046
- this.$dispatch('breakControl', this.selectdata)
2047
- return
2048
- }
2049
- this.show_data.start_activity = this.$workflow_vue.start_activity
2050
- this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
2051
- let data = {
2052
- apply: this.show_data,
2053
- user: this.$login.f
2054
- }
2055
- let http = new HttpResetClass()
2056
- let res = await http.load(
2057
- 'POST',
2058
- `rs/logic/ApplyProductService`,
2059
- {data: data},
2060
- {resolveMsg: null, rejectMsg: '数据保存失败'}
2061
- )
2062
- if (this.show_data.button.after) {
2063
- this[this.show_data.button.after]()
2064
- }
2065
- this.$dispatch('loadPage')
2066
- },
2067
- // 失去焦点出触发事件
2068
- 'onchange' (index) {
2069
- },
2070
- selectSearch (val, index) {},
2071
- 'onblur' (index) {},
2072
- 'oninput' (index) {},
2073
- async 'onchangeModal' (index, fieldIndex) {
2074
- },
2075
- async 'onblurModal' (index, fieldIndex) {
2076
-
2077
- },
2078
- async 'oninputModal' (index, fieldIndex) {
2079
-
2080
- },
2081
- async 'onetomanydelete' (index, rowIndex) {
2082
-
2083
- let http = new HttpResetClass()
2084
-
2085
- let res = await http.load(
2086
- 'DELETE',
2087
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
2088
- null,
2089
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
2090
- )
2091
-
2092
- res = await this.$resetpost(
2093
- 'rs/entity/t_apply',
2094
- this.show_data
2095
- )
2096
-
2097
- this.$dispatch('breakControl', this.show_data)
2098
- },
2099
- async 'onetomanyupdate' (index, rowIndex) {
2100
- let data = this.show_data.onetomany[index].rows[rowIndex]
2101
-
2102
- this.show_data.onetomany[index].fields.forEach(item => {
2103
- data[item.field] = item.value
2104
- })
2105
- let res = await this.$resetpost(
2106
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
2107
- data
2108
- )
2109
-
2110
- res = await this.$resetpost(
2111
- 'rs/entity/t_apply',
2112
- this.show_data
2113
- )
2114
-
2115
- this.$dispatch('breakControl', this.show_data)
2116
- },
2117
- async 'onetomanyadd' (index) {
2118
- let data = {
2119
- f_process_id : this.show_data.f_process_id,
2120
- f_operator_id: this.$login.f.id,
2121
- f_operator: this.$login.f.name,
2122
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
2123
- f_orgid: this.$login.f.orgid,
2124
- f_orgname: "榆林."+this.$login.f.orgs
2125
- }
2126
- this.show_data.onetomany[index].fields.forEach(item => {
2127
- data[item.field] = item.value
2128
- })
2129
- let res = await this.$resetpost(
2130
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
2131
- data
2132
- )
2133
-
2134
- res = await this.$resetpost(
2135
- 'rs/entity/t_apply',
2136
- this.show_data
2137
- )
2138
-
2139
- this.$dispatch('breakControl', this.show_data)
2140
- },
2141
- 'complyInstallation' (index) {
2142
- if (this.show_data.defname === '报建受理'){
2143
- if (this.show_data.f_accept_install === '') {
2144
- console.log("测试")
2145
- this.hideButtons('下发','提交')
2146
- this.showButtons('终止')
2147
- } else {
2148
- this.hideButtons('终止')
2149
- this.showButtons('下发','提交')
2150
- }
2151
- }
2152
- if (this.show_data.defname === '现场勘察'){
2153
- if (this.show_data.f_survey_opinion === '') {
2154
- console.log("测试")
2155
- this.hideButtons('下发','提交')
2156
- this.showButtons('终止')
2157
- } else {
2158
- this.hideButtons('终止')
2159
- this.showButtons('下发','提交')
2160
- }
2161
- }
2162
- if (this.show_data.defname === '报建受理' || this.show_data.defname === '现场勘察'){
2163
- this.installCountCheck()
2164
- }
2165
- },
2166
- async 'saveData'(index) {
2167
- if (this.show_data.f_residential_area_id) {
2168
- let data = {
2169
- tablename: 't_area_address',
2170
- condition: `id = '${this.show_data.f_residential_area_id}'`
2171
- }
2172
- let http = new HttpResetClass()
2173
- let res = await http.load(
2174
- 'POST',
2175
- `rs/sql/applySingleTable`,
2176
- {data: data},
2177
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
2178
- )
2179
-
2180
- this.area = res.data[0]
2181
- }
2182
- this.areaAddressSplicing()
2183
- },
2184
- async 'importEvent' (index, table, configName, filepath) {
2185
- let data = {
2186
- selectdata: this.show_data,
2187
- table: table,
2188
- filepath: filepath,
2189
- configName: configName,
2190
- user: this.$login.f
2191
- }
2192
-
2193
- let res = await this.$resetpost(
2194
- `rs/logic/importEvent`,
2195
- data
2196
- )
2197
-
2198
- this.$dispatch('breakControl', this.show_data)
2199
- },
2200
- 'onbutchange' (index) {
2201
-
2202
- },
2203
- 'onbutblur' (index) {
2204
-
2205
- },
2206
- 'onbutinput' (index) {
2207
-
2208
- }
2209
- },
2210
- watch: {
2211
- }
2212
- }
2213
- </script>
2214
- <style scoped>
2215
- /*清除model中的浮动*/
2216
- .clearfix:after,.clearfix:before{
2217
- display: table;
2218
- }
2219
- .clearfix:after{
2220
- clear: both;
2221
- }
2222
- </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 {HttpResetClass} from 'vue-client'
9
+ import {isEmpty} from '../../../Util'
10
+ import Vue from "vue";
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
+ area: {}, // 小区详细
39
+ config: {}
40
+ }
41
+ },
42
+ ready () {
43
+ this.refurbish()
44
+ },
45
+ methods: {
46
+ // 组件初始化操作
47
+ async refurbish() {
48
+ this.json_datas = Vue.prototype.$workflow_vue
49
+ let sum = 0
50
+ let jsonData = {}
51
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
52
+ this.$showMessage("网络故障,请刷新页面")
53
+ return
54
+ }
55
+ this.json_datas.activitys.forEach(item => {
56
+ if (this.selectdata.defname === item.title) {
57
+ jsonData = item // 拿到当前节点的json配置信息
58
+ sum++ // 节点名一样的个数
59
+ }
60
+ })
61
+
62
+ if (sum === 0) {
63
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
64
+ return
65
+ }
66
+ if (sum > 1) {
67
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
68
+ return
69
+ }
70
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
71
+
72
+ // fields 字段填充值
73
+ for (const item of this.selectdata.fields) {
74
+ if (!item.value) {
75
+ item.value = null
76
+ }
77
+
78
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
79
+ if (item.eval) {
80
+ item.value = eval(item.default)
81
+ } else {
82
+ item.value = item.default
83
+ }
84
+ }
85
+
86
+ if (this.selectdata[item.field]) {
87
+ // 将json字符串格式化赋值给value
88
+ if (String(this.selectdata[item.field]).startsWith("{")) {
89
+ item.value = JSON.parse(this.selectdata[item.field])
90
+ } else {
91
+ item.value = this.selectdata[item.field]
92
+ }
93
+ }
94
+ if (this.selectdata[item.field] === 0) {
95
+ item.value = 0
96
+ }
97
+
98
+ // datepicker
99
+ if (item.type === 'datepicker' && !item.value && item.default) {
100
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
101
+ }
102
+
103
+ // 如果配置类型为select,优先从参数列表获取options
104
+ if (item.type === 'select' || item.type === 'checkbox') {
105
+ if (item.param) {
106
+ let temp = this.$appdata.getParam(item.label)
107
+
108
+ if (temp && temp.length > 0) {
109
+ item.options = temp
110
+ }
111
+
112
+ if (item.paramLabel) {
113
+ temp = this.$appdata.getParam(item.paramLabel)
114
+ if (temp && temp.length > 0) {
115
+ item.options = temp
116
+ }
117
+ }
118
+ }
119
+ }
120
+ if (item.ready) {
121
+ item.options = await this[item.ready]()
122
+ }
123
+ if (item.type === 'checkbox') {
124
+ if (this.selectdata[item.field]) {
125
+ item.value = JSON.parse(this.selectdata[item.field])
126
+ } else {
127
+ item.value = []
128
+ }
129
+ }
130
+ if(this.selectdata.state === '结束'){
131
+ item.readonly = true
132
+ item.disabled = true
133
+ console.log('当前defname'+this.selectdata.defname+'当前title'+this.selectdata.title)
134
+ }
135
+ this.selectdata[item.field] = item.value
136
+ }
137
+
138
+ // 控制组件
139
+ if (this.selectdata.components) {
140
+ this.selectdata.components.forEach(item => {
141
+ if (!item.mark) {
142
+ item.mark = 0
143
+ }
144
+ if(this.selectdata.state === '结束'){
145
+ item.mark = 1
146
+ }
147
+ })
148
+ }
149
+
150
+ // 初始化onetomany
151
+ if (this.selectdata.onetomany) {
152
+ for (const item of this.selectdata.onetomany) {
153
+ let res = null
154
+ if (item.queryEvent) {
155
+ res = this[item.queryEvent]()
156
+ } else {
157
+ let data = {
158
+ tablename: item.tables[0],
159
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
160
+ }
161
+ let http = new HttpResetClass()
162
+ res = await http.load(
163
+ 'POST',
164
+ 'rs/sql/applySingleTable',
165
+ {data: data},
166
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
167
+ )
168
+ }
169
+ item.rows = res.data
170
+ // 初始化onetomany中的fields
171
+ for (const field of item.fields) {
172
+ if (!field.value) {
173
+ if (field.value !== 0) {
174
+ field.value = null
175
+ }
176
+ }
177
+
178
+ if (field.default || field.default === 0) {
179
+ field.value = field.default
180
+ }
181
+
182
+ // datepicker
183
+ if (field.type === 'datepicker' && !field.value && field.default) {
184
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
185
+ }
186
+
187
+ if (field.type === 'select') {
188
+
189
+ let temp = this.$appdata.getParam(field.label)
190
+
191
+ if (temp && temp.length > 0) {
192
+ field.options = temp
193
+ }
194
+
195
+ if (field.paramLabel) {
196
+ temp = this.$appdata.getParam(field.paramLabel)
197
+ if (temp && temp.length > 0) {
198
+ item.options = temp
199
+ }
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
205
+
206
+ // 初始化 buttons_fields
207
+ for (const item of this.selectdata.buttons) {
208
+ if (item.button_name === '下发' || item.button_name === '转派') {
209
+
210
+ let data = {
211
+ source: item.source,
212
+ userid: this.$login.f.id
213
+ }
214
+ if (item.sourceMethod) {
215
+ data.source = this[item.sourceMethod]()
216
+ }
217
+ if (!data.source) {
218
+ this.$showMessage("请配置获取人员表达式")
219
+ return
220
+ }
221
+ let http = new HttpResetClass()
222
+ let res = await http.load(
223
+ 'POST',
224
+ 'rs/search',
225
+ {data: data},
226
+ {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
227
+ )
228
+ let options = res.data.map(source => {
229
+ return {
230
+ "label": source.name,
231
+ "value": source.id
232
+ }
233
+ })
234
+ if (item.button_fields.length !== 1) {
235
+ this.$showMessage("下发有且只能有一个字段!!!")
236
+ return
237
+ }
238
+ item.button_fields[0].options = options
239
+ }
240
+ if (item.button_fields) {
241
+ item.button_fields.forEach(x => {
242
+ // 如果配置类型为select,优先从参数列表获取options
243
+ if (x.type === 'select') {
244
+
245
+ if (x.param) {
246
+ let temp = this.$appdata.getParam(x.label)
247
+
248
+ if (temp && temp.length > 0) {
249
+ x.options = temp
250
+ }
251
+
252
+ if (x.paramLabel) {
253
+ temp = this.$appdata.getParam(x.paramLabel)
254
+ if (temp && temp.length > 0) {
255
+ x.options = temp
256
+ }
257
+ }
258
+ }
259
+
260
+ }
261
+ })
262
+ }
263
+ if(this.selectdata.state === '结束'){
264
+ item.hidden = true
265
+ }
266
+ }
267
+
268
+ if (this.selectdata.f_apply_nature === '散户' && this.selectdata.defname === '现场勘察') {
269
+ for (const item of this.selectdata.fields) {
270
+ if (item.label.includes('安装户数')) {
271
+ item.readonly = true
272
+ }
273
+ }
274
+ }
275
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
276
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
277
+ this.show_data = temp
278
+ if ((this.selectdata.f_apply_type =='非民用报建' || this.selectdata.f_apply_type =='民用报建' || this.selectdata.f_apply_type =='设备变更')&&this.selectdata.defname === '报装缴费'){
279
+ let num = Number(this.$appdata.getSingleValue('税率'))
280
+ let f_due_money =Number(this.selectdata.f_due_money)
281
+ let tem = ( f_due_money - (f_due_money/(1+num)).toFixed(2)).toFixed(2)
282
+ this.show_data.f_budget_money = tem
283
+ this.setLabelValue('税额',tem)
284
+ }
285
+ if ((this.selectdata.f_apply_type =='非民用报建' || this.selectdata.f_apply_type =='民用报建' || this.selectdata.f_apply_type =='设备变更')&&this.selectdata.defname === '收费标准'){
286
+ let str = '项目名称:天然气安装工程;项目地址:'+ this.show_data.f_address
287
+ this.show_data.f_paper_remarks = str
288
+ this.setLabelValue('发票备注',str)
289
+ }
290
+ this.$nextTick(() => {
291
+ this.showview = true
292
+ })
293
+
294
+ },
295
+ // 金额转大写
296
+ smalltoBIG(n) {
297
+ let fraction = ['角', '分'];
298
+ let digit = ['', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
299
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
300
+ let head = n < 0 ? '欠' : '';
301
+ n = Math.abs(n);
302
+
303
+ let s = '';
304
+
305
+ for (var i = 0; i < fraction.length; i++) {
306
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
307
+ }
308
+ s = s || '整';
309
+ n = Math.floor(n);
310
+
311
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
312
+ let p = '';
313
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
314
+ p = digit[n % 10] + unit[1][j] + p;
315
+ n = Math.floor(n / 10);
316
+ }
317
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
318
+ }
319
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '').replace(/^整$/, '零元整')
320
+ },
321
+ getLableValue(label) {
322
+ for (const item of this.show_data.fields) {
323
+ if (item.label === label && item.type !== 'number') {
324
+ return item.value || ''
325
+ }
326
+ if (item.label === label && item.type === 'number') {
327
+ return item.value || 0
328
+ }
329
+ }
330
+ },
331
+ getLableOptions(label) {
332
+ for (const item of this.show_data.fields) {
333
+ if (item.label === label) {
334
+ return item.options
335
+ }
336
+ }
337
+ },
338
+ setLabelValue(label, value) {
339
+ for (const item of this.show_data.fields) {
340
+ if (item.label === label) {
341
+ item.value = value
342
+ this.show_data[item.field] = value
343
+ }
344
+ }
345
+ },
346
+ setLabelOptions(label, options) {
347
+ for (const item of this.show_data.fields) {
348
+ if (item.label === label) {
349
+ item.options = options
350
+ }
351
+ }
352
+ },
353
+ showLabels(...labels) {
354
+ for (const item of this.show_data.fields) {
355
+ if (labels.includes(item.label)) {
356
+ item.hidden = false
357
+ }
358
+ }
359
+ },
360
+ hideLabels(...labels) {
361
+ for (const item of this.show_data.fields) {
362
+ if (labels.includes(item.label)) {
363
+ item.hidden = true
364
+ }
365
+ }
366
+ },
367
+ showButtons(...buttons) {
368
+ for (const item of this.show_data.buttons) {
369
+ if (buttons.includes(item.button_name)) {
370
+ item.hidden = false
371
+ }
372
+ }
373
+ },
374
+ hideButtons(...buttons) {
375
+ for (const item of this.show_data.buttons) {
376
+ if (buttons.includes(item.button_name)) {
377
+ item.hidden = true
378
+ }
379
+ }
380
+ },
381
+ requiredLabels(...labels) {
382
+ for (const item of this.show_data.fields) {
383
+ if (labels.includes(item.label)) {
384
+ item.required = true
385
+ }
386
+ }
387
+ },
388
+ electiveLabels(...labels) {
389
+ for (const item of this.show_data.fields) {
390
+ if (labels.includes(item.label)) {
391
+ item.required = false
392
+ }
393
+ }
394
+ },
395
+ readonlyLabels(...labels) {
396
+ for (const item of this.show_data.fields) {
397
+ if (labels.includes(item.label)) {
398
+ item.readonly = true
399
+ item.disabled = true
400
+ }
401
+ }
402
+ },
403
+ readwriteLabels(...labels) {
404
+ for (const item of this.show_data.fields) {
405
+ if (labels.includes(item.label)) {
406
+ item.readonly = false
407
+ item.disabled = false
408
+ }
409
+ }
410
+ },
411
+ disabledButtons(...buttons) {
412
+ for (const item of this.show_data.buttons) {
413
+ if (buttons.includes(item.button_name)) {
414
+ item.disabled = true
415
+ }
416
+ }
417
+ },
418
+ enableButtons(...buttons) {
419
+ for (const item of this.show_data.buttons) {
420
+ if (buttons.includes(item.button_name)) {
421
+ item.disabled = false
422
+ }
423
+ }
424
+ },
425
+ showComponents(...titles) {
426
+ for (const item of this.show_data.components) {
427
+ if (titles.includes(item.title) && item.device === 'pc') {
428
+ item.hidden = false
429
+ }
430
+ }
431
+ },
432
+ hideComponents(...titles) {
433
+ for (const item of this.show_data.components) {
434
+ if (titles.includes(item.title) && item.device === 'pc') {
435
+ item.hidden = true
436
+ }
437
+ }
438
+ },
439
+ async checkDuplicate(index) {
440
+ let http = new HttpResetClass()
441
+ let data = {
442
+ tablename: 't_apply',
443
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
444
+ }
445
+ let res = await http.load('POST', 'rs/sql/applySingleTable', {data: data}, {
446
+ resolveMsg: null,
447
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
448
+ })
449
+ if (res.data.length > 0) {
450
+ this.show_data.fields[index].value = null
451
+ this.$showMessage(`${this.show_data.fields[index].label}已存在!!!`)
452
+ }
453
+ },
454
+ // 获取片区
455
+ async getSliceArea () {
456
+ let data = {
457
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
458
+ userid: this.$login.f.id
459
+ }
460
+
461
+ let http = new HttpResetClass()
462
+ let res = await http.load(
463
+ 'POST',
464
+ `rs/search`,
465
+ {data: data},
466
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
467
+ )
468
+
469
+ return res.data.map(item => {
470
+ return {
471
+ label: item.name,
472
+ value: item.name
473
+ }
474
+ })
475
+ },
476
+ // 获取区县
477
+ async getPcd () {
478
+ let data = {
479
+ tablename: 't_pcd',
480
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
481
+ }
482
+ let http = new HttpResetClass()
483
+ let res = await http.load(
484
+ 'POST',
485
+ `rs/sql/applySingleTable`,
486
+ {data: data},
487
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
488
+ )
489
+
490
+ return res.data.map(item => {
491
+ return {
492
+ label: item.f_pcd,
493
+ value: item.f_pcd
494
+ }
495
+ })
496
+ },
497
+ // 缴费前置
498
+ chargeBefore () {
499
+ if ((this.show_data.f_apply_type === '民用报建' && this.show_data.f_apply_nature === '小区') || this.show_data.f_apply_type === '非民用报建') {
500
+ return
501
+ }
502
+ if (this.show_data.f_house_type === '旧报建导入'){
503
+ return
504
+ }
505
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
506
+ this.$showMessage('费用未结清!!!')
507
+ throw null
508
+ }
509
+ },
510
+ // 缴费流程退回前置
511
+ async backBefore() {
512
+ let data = {
513
+ tablename: 't_apply',
514
+ condition: `f_process_id = '${this.selectdata.f_process_id}'`
515
+ }
516
+ let http = new HttpResetClass()
517
+ let res = await http.load(
518
+ 'POST',
519
+ `rs/sql/applySingleTable`,
520
+ {data: data},
521
+ {resolveMsg: null, rejectMsg: null}
522
+ )
523
+ if (res.data.length > 0 && res.data[0].f_surplus_money !== res.data[0].f_due_money) {
524
+ this.$showMessage('用户已缴费,无法退回!!!')
525
+ }
526
+ },
527
+ // 获取设计人员
528
+ async getDesignerPeople () {
529
+ let data = {
530
+ source: 'this.getParentByType($organization$).getChildByName($设计人员$).getChildren()',
531
+ userid: this.$login.f.id
532
+ }
533
+
534
+ let http = new HttpResetClass()
535
+ let res = await http.load(
536
+ 'POST',
537
+ 'rs/search',
538
+ {data: data},
539
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
540
+ )
541
+ return res.data.map(item => {
542
+ return {
543
+ label: item.name,
544
+ value: item.name
545
+ }
546
+ })
547
+ },
548
+ //现场勘察
549
+ async prospectingBefore() {
550
+ let data = {
551
+ tablename: 't_files',
552
+ condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '现场勘察' and fremarks = '报装手机签字文件'`
553
+ }
554
+ let http = new HttpResetClass()
555
+ let res = await http.load(
556
+ 'POST',
557
+ `rs/sql/applySingleTable`,
558
+ {data: data},
559
+ {resolveMsg: null, rejectMsg: null}
560
+ )
561
+ if (res.data.length <= 0) {
562
+ this.$showMessage('现场勘察未签字,无法提交!!!')
563
+ throw '现场勘察未签字,无法提交!'
564
+ }
565
+ },
566
+ //报建受理下发,对基本信息进行校验
567
+ checkSpaces(){
568
+ let name=this.getLableValue('用户名称')
569
+ //如果用户名称中包含空格,提示用户名称中不能包含空格
570
+ if(name.indexOf(' ')>=0){
571
+ this.$showMessage('用户名称中不能包含空格!!!')
572
+ throw '用户名称中不能包含空格!!!'
573
+ }
574
+ let Contact= this.getLableValue('联系人')
575
+ if(Contact.indexOf(' ')>=0){
576
+ this.$showMessage('联系人中不能包含空格!!!')
577
+ throw '联系人中不能包含空格!!!'
578
+ }
579
+ let phone= this.getLableValue('用户电话')
580
+ if(phone.indexOf(' ')>=0){
581
+ this.$showMessage('用户电话中不能包含空格!!!')
582
+ throw '用户电话中不能包含空格!!!'
583
+ }
584
+ let ifnumber= this.getLableValue('证件号码')
585
+ if(ifnumber.indexOf(' ')>=0){
586
+ this.$showMessage('证件号码中不能包含空格!!!')
587
+ throw '证件号码中不能包含空格!!!'
588
+ }
589
+ },
590
+ //合同签订提交
591
+ async contractSigningBefore() {
592
+ let http = new HttpResetClass()
593
+ let data = {
594
+ tablename: 't_contract',
595
+ condition: `f_process_id = '${this.selectdata.f_process_id}' and f_sign_state <> '签订完成'`
596
+ }
597
+ let res = await http.load(
598
+ 'POST',
599
+ `rs/sql/applySingleTable`,
600
+ {data: data},
601
+ {resolveMsg: null, rejectMsg: null}
602
+ )
603
+ if(res.data.length<=0){
604
+ let data = {
605
+ tablename: 't_files',
606
+ condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '${this.selectdata.defname}' and fusetype = '纸质合同'`
607
+ }
608
+ let res = await http.load(
609
+ 'POST',
610
+ `rs/sql/applySingleTable`,
611
+ {data: data},
612
+ {resolveMsg: null, rejectMsg: null}
613
+ )
614
+ if (res.data.length <= 0) {
615
+ this.$showMessage('纸质合同未上传,无法提交!')
616
+ throw '纸质合同未上传,无法提交!'
617
+ }
618
+ }
619
+ if (res.data.length > 0) {
620
+ let data = {
621
+ tablename: 't_files',
622
+ condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '${this.selectdata.defname}' and fusetype = '纸质合同'`
623
+ }
624
+ let res = await http.load(
625
+ 'POST',
626
+ `rs/sql/applySingleTable`,
627
+ {data: data},
628
+ {resolveMsg: null, rejectMsg: null}
629
+ )
630
+ if (res.data.length <= 0) {
631
+ this.$showMessage('合同未签订完成且纸质合同未上传,无法提交!!!')
632
+ throw '合同未签订完成且纸质合同未上传,无法提交!!!'
633
+ }
634
+ }
635
+ },
636
+ async otherAuthentication() {
637
+ console.log("当前数据", this.selectdata)
638
+ this.$showMessage(`请确认是否进行重新认证,确认前请保证身份信息正确!!!`, ['confirm']).then(async (res) => {
639
+ if (res === 'confirm') {
640
+ let http = new HttpResetClass()
641
+ let data = {
642
+ apply: this.selectdata
643
+ }
644
+ let result = await http.load(
645
+ 'POST',
646
+ 'rs/logic/anotherLegalize',
647
+ {data: data},
648
+ {
649
+ resolveMsg: '重新发起实名认证成功!',
650
+ rejectMsg: '重新发起实名认证失败!'
651
+ }).then((res)=>{
652
+ if(res.data === 200){
653
+ this.$dispatch('loadPage')
654
+ }
655
+ })
656
+ }
657
+ })
658
+ throw '重新发起实名认证!!!'
659
+ },
660
+ async otherSigned() {
661
+ console.log("当前数据", this.selectdata)
662
+ this.$showMessage(`请确认是否进行重新发送签署短信!!!`, ['confirm']).then(async (res) => {
663
+ if (res === 'confirm') {
664
+ let http = new HttpResetClass()
665
+ let data = {
666
+ apply: this.selectdata
667
+ }
668
+ let result = await http.load(
669
+ 'POST',
670
+ 'rs/logic/anotherMAS',
671
+ {data: data},
672
+ {
673
+ resolveMsg: '重新发送签署短信成功!',
674
+ rejectMsg: '重新发送签署短信失败!'
675
+ }).then((res)=>{
676
+ if(res.data === 200){
677
+ this.$dispatch('loadPage')
678
+ }
679
+ })
680
+ }
681
+ })
682
+ throw '重新发送签署短信!!!'
683
+ },
684
+ // 施工前置
685
+ async constructionBefore () {
686
+ await this.userSignBefore()
687
+ if (this.show_data.f_apply_nature !== '分户挂表') {
688
+ let http = new HttpResetClass()
689
+ let data = {
690
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and f_meternumber is null and f_gasbrand_id is not null `
691
+ }
692
+ let res = await http.load(
693
+ 'POST',
694
+ 'rs/sql/countApplyUserinfo',
695
+ {data: data},
696
+ {
697
+ resolveMsg: null,
698
+ rejectMsg: '安装明细查询失败!!!'
699
+ })
700
+ if (res.data[0].num > 0) {
701
+ this.$showMessage(`还有${res.data[0].num}户未安装,无法提交`)
702
+ throw `还有${res.data[0].num}户未安装,无法提交`
703
+ }
704
+ }
705
+ },
706
+ async userSignBefore() {
707
+ let http = new HttpResetClass()
708
+ let data = {
709
+ tablename: 't_files',
710
+ condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '${this.selectdata.defname}' and fremarks = '报装手机签字文件'`
711
+ }
712
+ let res = await http.load(
713
+ 'POST',
714
+ `rs/sql/applySingleTable`,
715
+ {data: data},
716
+ {resolveMsg: null, rejectMsg: null}
717
+ )
718
+ if (res.data.length <= 0) {
719
+ this.$showMessage('用户未签字,无法提交!!!')
720
+ throw '用户未签字,无法提交!'
721
+ }
722
+ },
723
+ addressInitialization () {
724
+ this.$getConfig(this, 'UserAddress')
725
+
726
+ let f_address_type = this.show_data.f_address_type
727
+
728
+ for (const item of this.show_data.fields) {
729
+ if (f_address_type === '民用市区') {
730
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
731
+ item.hidden = false
732
+ item.required = true
733
+ }
734
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
735
+ item.hidden = false
736
+ item.required = false
737
+ }
738
+ if (item.label === '地址') {
739
+ item.readonly = true
740
+ }
741
+ }
742
+ if (f_address_type === '民用乡镇') {
743
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
744
+ item.hidden = false
745
+ item.required = true
746
+ }
747
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
748
+ item.hidden = false
749
+ item.required = false
750
+ }
751
+ if (item.label === '楼层') {
752
+ item.hidden = true
753
+ item.required = false
754
+ }
755
+ if (item.label === '地址') {
756
+ item.readonly = true
757
+ }
758
+ }
759
+ if (f_address_type === '特殊地址') {
760
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
761
+ item.hidden = false
762
+ item.required = true
763
+ }
764
+ if (item.label === '集收单位') {
765
+ item.hidden = false
766
+ item.required = false
767
+ }
768
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
769
+ item.hidden = true
770
+ item.required = false
771
+ }
772
+ if (item.label === '地址') {
773
+ item.readonly = false
774
+ }
775
+ }
776
+
777
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
778
+ item.hidden = true
779
+ }
780
+ }
781
+ },
782
+ async streetChange () {
783
+ if (isEmpty(this.show_data.f_street)) {
784
+ return
785
+ }
786
+
787
+ let data = {
788
+ tablename: 't_area',
789
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
790
+ }
791
+ let http = new HttpResetClass()
792
+ let res = await http.load(
793
+ 'POST',
794
+ `rs/sql/applySingleTable`,
795
+ {data: data},
796
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
797
+ )
798
+
799
+ this.setLabelOptions('集收单位', res.data.map(item => {
800
+ return {
801
+ label: item.f_residential_area,
802
+ value: item.f_residential_area
803
+ }
804
+ }))
805
+ },
806
+ async pcdChange () {
807
+ if (isEmpty(this.show_data.f_pcd)) {
808
+ return
809
+ }
810
+
811
+ let data = {
812
+ tablename: 't_street',
813
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
814
+ }
815
+ let f_address_type = this.getLableValue('地址类型')
816
+
817
+ if (f_address_type === '民用市区') {
818
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
819
+ }
820
+ if (f_address_type === '民用乡镇') {
821
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
822
+ }
823
+
824
+ let http = new HttpResetClass()
825
+ let res = await http.load(
826
+ 'POST',
827
+ `rs/sql/applySingleTable`,
828
+ {data: data},
829
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
830
+ )
831
+
832
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
833
+ return {
834
+ label: item.f_street,
835
+ value: item.f_street
836
+ }
837
+ }))
838
+ },
839
+ //查询现场负责人
840
+ async getConstructionWorker(){
841
+ let data = {
842
+ source: 'this.getParentByType($organization$).getChildByName($建设单位$).getChildren()',
843
+ userid: this.$login.f.id
844
+ }
845
+ let http = new HttpResetClass()
846
+ let res = await http.load(
847
+ 'POST',
848
+ `rs/search`,
849
+ {data: data},
850
+ {resolveMsg: null, rejectMsg: '现场负责人查询失败!!!'}
851
+ )
852
+ return res.data.map(item => {
853
+ return {
854
+ label: item.name,
855
+ value: item.id
856
+ }
857
+ })
858
+ },
859
+ //获取下发人(当前操作人所属部门下的所有人)
860
+ getSource () {
861
+ return 'this.getParentByType($organization$).getChildByName($'+ this.$login.f.f_department_name + '$).getChildren()'
862
+ },
863
+ async getUserName() {
864
+ if(this.selectdata.f_construction_unit_id){
865
+ let data = {
866
+ tablename: 't_user',
867
+ condition: `id='${this.selectdata.f_construction_unit_id}'`
868
+ }
869
+ let http = new HttpResetClass()
870
+ let res = await http.load(
871
+ 'POST',
872
+ `rs/sql/applySingleTable`,
873
+ {data: data},
874
+ {resolveMsg: null, rejectMsg: null}
875
+ )
876
+ return res.data.map(item => {
877
+ return {
878
+ label: item.name,
879
+ value: item.id
880
+ }
881
+ })
882
+ }
883
+ return
884
+ },
885
+ // 安装单位签字人
886
+ async getConstructionUnitId () {
887
+ let data = {
888
+ source: '',
889
+ userid: this.$login.f.id
890
+ }
891
+ data.source = 'this.getParentByType($organization$).getChildByName($'+ this.$login.f.f_department_name + '$).getChildren()'
892
+ let http = new HttpResetClass()
893
+ let res = await http.load(
894
+ 'POST',
895
+ `rs/search`,
896
+ {data: data},
897
+ {resolveMsg: null, rejectMsg: '安装单位施工班组查询失败!!!'}
898
+ )
899
+ return res.data.map(item => {
900
+ return {
901
+ label: item.name,
902
+ value: item.id
903
+ }
904
+ })
905
+ },
906
+ // 安装单位负责人
907
+ async getConstructionUnit () {
908
+ let data = {
909
+ source: 'this.getParentByType($organization$).getChildByName($工程施工队$).getChildren()',
910
+ userid: this.$login.f.id
911
+ }
912
+ let http = new HttpResetClass()
913
+ let res = await http.load(
914
+ 'POST',
915
+ `rs/search`,
916
+ {data: data},
917
+ {resolveMsg: null, rejectMsg: '安装单位负责人查询失败!!!'}
918
+ )
919
+ console.log("显示返回值",res)
920
+ let constructionUnit = res.data.map(item => {
921
+ return {
922
+ label: item.name,
923
+ value: item.id
924
+ }
925
+ })
926
+ constructionUnit = constructionUnit.sort((a,b) => a.value - b.value)
927
+ console.log("显示返回值1",constructionUnit)
928
+ return constructionUnit
929
+ },
930
+ // 管线施工单位
931
+ async getGuanXianBuildUnit () {
932
+ let data = {
933
+ source: 'this.getParentByType($organization$).getChildByName($工程施工队$).getChildren()',
934
+ userid: this.$login.f.id
935
+ }
936
+ let http = new HttpResetClass()
937
+ let res = await http.load(
938
+ 'POST',
939
+ `rs/search`,
940
+ {data: data},
941
+ {resolveMsg: null, rejectMsg: '安装单位负责人查询失败!!!'}
942
+ )
943
+ return res.data.map(item => {
944
+ return {
945
+ label: item.name,
946
+ value: item.name
947
+ }
948
+ })
949
+ },
950
+ // 建设单位
951
+ async getConstructOperator () {
952
+ let data = {
953
+ source: 'this.getParentByType($organization$).getChildByName($建设单位$).getChildren()',
954
+ userid: this.$login.f.id
955
+ }
956
+ let http = new HttpResetClass()
957
+ let res = await http.load(
958
+ 'POST',
959
+ `rs/search`,
960
+ {data: data},
961
+ {resolveMsg: null, rejectMsg: '建设单位人员查询失败!!!'}
962
+ )
963
+ return res.data.map(item => {
964
+ return {
965
+ label: item.name,
966
+ value: item.id
967
+ }
968
+ })
969
+ },
970
+ // 监理单位
971
+ async getSupervisorOperator () {
972
+ let data = {
973
+ source: 'this.getParentByType($organization$).getChildByName($监理单位$).getChildren()',
974
+ userid: this.$login.f.id
975
+ }
976
+ let http = new HttpResetClass()
977
+ let res = await http.load(
978
+ 'POST',
979
+ `rs/search`,
980
+ {data: data},
981
+ {resolveMsg: null, rejectMsg: '监理单位人员查询失败!!!'}
982
+ )
983
+ for (const item of this.selectdata.fields) {
984
+ if (item.label === '监理单位') {
985
+ item.value = res.data[0].id
986
+ this.selectdata[item.field] = res.data[0].id
987
+ }
988
+ }
989
+ return res.data.map(item => {
990
+ return {
991
+ label: item.name,
992
+ value: item.id
993
+ }
994
+ })
995
+ },
996
+ // 管线监理单位
997
+ async getSupervisorName () {
998
+ let data = {
999
+ source: 'this.getParentByType($organization$).getChildByName($监理单位$).getChildren()',
1000
+ userid: this.$login.f.id
1001
+ }
1002
+ let http = new HttpResetClass()
1003
+ let res = await http.load(
1004
+ 'POST',
1005
+ `rs/search`,
1006
+ {data: data},
1007
+ {resolveMsg: null, rejectMsg: '监理单位人员查询失败!!!'}
1008
+ )
1009
+ return res.data.map(item => {
1010
+ return {
1011
+ label: item.name,
1012
+ value: item.name
1013
+ }
1014
+ })
1015
+ },
1016
+
1017
+ // 监理现场负责人
1018
+ async getSupervisorOperatorId () {
1019
+ let data = {
1020
+ source: 'this.getParentByType($organization$).getChildByName($监理班组$).getChildren()',
1021
+ userid: this.$login.f.id
1022
+ }
1023
+ let http = new HttpResetClass()
1024
+ let res = await http.load(
1025
+ 'POST',
1026
+ `rs/search`,
1027
+ {data: data},
1028
+ {resolveMsg: null, rejectMsg: '监理单位人员查询失败!!!'}
1029
+ )
1030
+ return res.data.map(item => {
1031
+ return {
1032
+ label: item.name,
1033
+ value: item.id
1034
+ }
1035
+ })
1036
+ },
1037
+ // 土建单位
1038
+ async getEngineeringOperator () {
1039
+ let data = {
1040
+ source: 'this.getParentByType($organization$).getChildByName($土建单位$).getChildren()',
1041
+ userid: this.$login.f.id
1042
+ }
1043
+ let http = new HttpResetClass()
1044
+ let res = await http.load(
1045
+ 'POST',
1046
+ `rs/search`,
1047
+ {data: data},
1048
+ {resolveMsg: null, rejectMsg: '土建单位人员查询失败!!!'}
1049
+ )
1050
+ let result = res.data.map(item => {
1051
+ return {
1052
+ label: item.name,
1053
+ value: item.id
1054
+ }
1055
+ })
1056
+ result.push({label:'用户自理',value:'用户自理'})
1057
+ result.push({label:'无',value:'无'})
1058
+ return result
1059
+ },
1060
+ // 管线土建单位
1061
+ async getEngineeringName () {
1062
+ let data = {
1063
+ source: 'this.getParentByType($organization$).getChildByName($土建单位$).getChildren()',
1064
+ userid: this.$login.f.id
1065
+ }
1066
+ let http = new HttpResetClass()
1067
+ let res = await http.load(
1068
+ 'POST',
1069
+ `rs/search`,
1070
+ {data: data},
1071
+ {resolveMsg: null, rejectMsg: '土建单位人员查询失败!!!'}
1072
+ )
1073
+ let result = res.data.map(item => {
1074
+ return {
1075
+ label: item.name,
1076
+ value: item.name
1077
+ }
1078
+ })
1079
+ result.push({label:'用户自理',value:'用户自理'})
1080
+ result.push({label:'无',value:'无'})
1081
+ return result
1082
+ },
1083
+ // 检测单位
1084
+ async getCheckOperator () {
1085
+ let data = {
1086
+ source: 'this.getParentByType($organization$).getChildByName($检测单位$).getChildren()',
1087
+ userid: this.$login.f.id
1088
+ }
1089
+ let http = new HttpResetClass()
1090
+ let res = await http.load(
1091
+ 'POST',
1092
+ `rs/search`,
1093
+ {data: data},
1094
+ {resolveMsg: null, rejectMsg: '检测单位人员查询失败!!!'}
1095
+ )
1096
+
1097
+ let result = res.data.map(item => {
1098
+ return {
1099
+ label: item.name,
1100
+ value: item.id
1101
+ }
1102
+ })
1103
+ result.push({label:'无',value:'无'})
1104
+ return result
1105
+ },
1106
+ // 管线检测单位
1107
+ async getCheckName () {
1108
+ let data = {
1109
+ source: 'this.getParentByType($organization$).getChildByName($检测单位$).getChildren()',
1110
+ userid: this.$login.f.id
1111
+ }
1112
+ let http = new HttpResetClass()
1113
+ let res = await http.load(
1114
+ 'POST',
1115
+ `rs/search`,
1116
+ {data: data},
1117
+ {resolveMsg: null, rejectMsg: '检测单位人员查询失败!!!'}
1118
+ )
1119
+
1120
+ let result = res.data.map(item => {
1121
+ return {
1122
+ label: item.name,
1123
+ value: item.name
1124
+ }
1125
+ })
1126
+ result.push({label:'无',value:'无'})
1127
+ return result
1128
+ },
1129
+ // 获取气表品牌
1130
+ async getMeterBrand () {
1131
+ let data = {
1132
+ }
1133
+
1134
+ let http = new HttpResetClass()
1135
+ let res = await http.load(
1136
+ 'POST',
1137
+ `rs/sql/getMeterBrand`,
1138
+ {data: data},
1139
+ {resolveMsg: null, rejectMsg: '气表品牌查询失败!!!'}
1140
+ )
1141
+
1142
+ return res.data
1143
+ },
1144
+ async stopApply () {
1145
+ console.log('终止报建!!!!!')
1146
+ if (this.show_data.defname === '报建受理') {
1147
+ this.show_data.f_stop_reason = this.show_data.f_accept_result
1148
+ }
1149
+ if (this.show_data.defname === '现场勘察') {
1150
+ this.show_data.f_stop_reason = this.show_data.f_prospecting_result
1151
+ }
1152
+
1153
+ let data = {
1154
+ apply: this.show_data,
1155
+ user: this.$login.f
1156
+ }
1157
+
1158
+ let res = await this.$resetpost(
1159
+ `rs/logic/stopApply`,
1160
+ {data: data},
1161
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
1162
+ )
1163
+
1164
+ this.$dispatch('loadPage')
1165
+
1166
+ throw '终止报建!!!'
1167
+ },
1168
+ // 获取小区
1169
+ async getResidentialArea () {
1170
+ let data = {
1171
+ tablename: 't_area_address',
1172
+ condition: `f_filiale like '%${"榆林."+this.$login.f.orgs}%' and f_area_status = '启用'`
1173
+ }
1174
+ let http = new HttpResetClass()
1175
+ let res = await http.load(
1176
+ 'POST',
1177
+ `rs/sql/applySingleTable`,
1178
+ {data: data},
1179
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
1180
+ )
1181
+ return res.data.map(item => {
1182
+ return {
1183
+ label: item.f_residential_area,
1184
+ value: item.id
1185
+ }
1186
+ })
1187
+ },
1188
+ //获取燃气公司内部签署人
1189
+ async getContractSignatory () {
1190
+ let data = {
1191
+ condition: `asj.f_type = '内部' and asj.f_subject_type = '企业' and asj.f_state = '有效' and asj.f_auth_state = '审核通过' and asg.f_state = '有效' and asg.f_sign_state = '签章成功'`
1192
+ }
1193
+ let http = new HttpResetClass()
1194
+ let res = await http.load(
1195
+ 'POST',
1196
+ `rs/sql/getAuthSubjectList`,
1197
+ {data: data},
1198
+ {resolveMsg: null, rejectMsg: '签署人查询失败!!!'}
1199
+ )
1200
+ return res.data.map(item => {
1201
+ return {
1202
+ label: item.f_subject_name,
1203
+ value: `${item.id}`
1204
+ }
1205
+ })
1206
+ },
1207
+ async setContractSignatory () {
1208
+ let data = {
1209
+ condition: `asj.f_type = '内部' and asj.f_subject_type = '企业' and asj.f_state = '有效' and asj.f_auth_state = '审核通过' and asg.f_state = '有效' and asg.f_sign_state = '签章成功'`
1210
+ }
1211
+ let http = new HttpResetClass()
1212
+ let res = await http.load(
1213
+ 'POST',
1214
+ `rs/sql/getAuthSubjectList`,
1215
+ {data: data},
1216
+ {resolveMsg: null, rejectMsg: '签署人查询失败!!!'}
1217
+ )
1218
+ this.setLabelOptions('签署人',res.data.map(item => {
1219
+ return {
1220
+ label: item.f_subject_name,
1221
+ value: `${item.id}`
1222
+ }
1223
+ }))
1224
+ this.setLabelValue('签署人',res.data[0].id)
1225
+ },
1226
+ // 地址拼接
1227
+ addressSplicing () {
1228
+ let f_area = this.getLableValue('区/县') ? this.getLableValue('区/县') + '-' : ''
1229
+ let f_slice_area = this.getLableValue('片区') ? this.getLableValue('片区') + '-' : ''
1230
+ let f_street = this.getLableValue('街道') || ''
1231
+ let f_address_detail = this.getLableValue('详细地址') || ''
1232
+
1233
+ let f_address = f_area + f_slice_area + f_street + f_address_detail
1234
+ this.setLabelValue("地址", f_address)
1235
+ },
1236
+ // 小区地址拼接
1237
+ areaAddressSplicing () {
1238
+ let f_area = this.area.f_area || ''
1239
+ let f_slice_area = this.area.f_slice_area || ''
1240
+ let f_street = this.area.f_street || ''
1241
+ let f_residential_area = this.area.f_residential_area || ''
1242
+
1243
+ let f_address = f_area + f_slice_area + f_street + f_residential_area
1244
+ this.setLabelValue("地址", f_address)
1245
+ },
1246
+ //分户挂表生成安检单
1247
+ async getChecklist() {
1248
+ let http = new HttpResetClass()
1249
+ let data = {
1250
+ f_process_id: this.selectdata.f_process_id,
1251
+ f_userinfo_id: this.selectdata.f_userinfo_id,
1252
+ user: this.$login.f.user
1253
+ }
1254
+ let res = await http.load(
1255
+ 'POST',
1256
+ `rs/logic/getChecklist`,
1257
+ {data: data},
1258
+ {resolveMsg: null, rejectMsg: null}
1259
+ )
1260
+ },
1261
+ // 生成合同编号(已作废)
1262
+ async getContractNumber() {
1263
+ const nowDate = new Date()
1264
+ let year = nowDate.getFullYear()
1265
+ let nature = ''
1266
+ if (this.show_data.f_apply_type === '民用报建') {
1267
+ nature = 'J'
1268
+ } else if (this.show_data.f_apply_type === '非民用报建') {
1269
+ nature = 'F'
1270
+ }
1271
+ let shiGong = 'S'
1272
+ let gongQi = 'G'
1273
+
1274
+ let lastyYear = year - 1
1275
+ let http = new HttpResetClass()
1276
+ let data = {
1277
+ user: this.$login.f.user,
1278
+ startDate: year + '-01-01 00:00:00',
1279
+ endDate: year + '-12-31 23:59:59'
1280
+ }
1281
+ let res = await http.load(
1282
+ 'POST',
1283
+ `rs/sql/getContractCount`,
1284
+ {data: data},
1285
+ {resolveMsg: null, rejectMsg: null}
1286
+ )
1287
+ let count = res.data[0].count + 1
1288
+
1289
+
1290
+ let shiGongContractNumber = year + nature + shiGong + '-' + count
1291
+ let gongQiContractNumber = year + nature + gongQi + '-' + count
1292
+ if (!this.getLableValue('委托合同编号')){
1293
+ this.setLabelValue('委托合同编号',shiGongContractNumber)
1294
+ this.setLabelValue('供气合同编号',gongQiContractNumber)
1295
+ }
1296
+ },
1297
+ //获取气价列表
1298
+ async getPrice (index) {
1299
+ if (isEmpty(this.show_data.f_gas_nature) || isEmpty(this.show_data.f_price_type)) {
1300
+ return
1301
+ }
1302
+
1303
+ if (index) {
1304
+ this.setLabelValue('气价名称', null)
1305
+ }
1306
+
1307
+ if (this.show_data.f_price_type === '混合气价') {
1308
+ this.showLabels('比率')
1309
+ } else {
1310
+ this.setLabelValue('比率', null)
1311
+ this.hideLabels('比率')
1312
+ }
1313
+
1314
+ let data = {
1315
+ condition: `sp.f_filiale like '%${"榆林."+this.$login.f.orgs}%' and sp.f_price_type = '${this.show_data.f_price_type}' and f_gasproperties = '${this.show_data.f_gas_nature}'`
1316
+ }
1317
+
1318
+ if (this.show_data.f_apply_type === '民用报建') {
1319
+ data.condition += `and f_user_type = '民用'`
1320
+ }
1321
+ if (this.show_data.f_apply_type === '非民用报建') {
1322
+ data.condition += `and f_user_type = '非民用'`
1323
+ }
1324
+
1325
+
1326
+ let http = new HttpResetClass()
1327
+ let res = await http.load(
1328
+ 'POST',
1329
+ `rs/sql/applyGetPrice`,
1330
+ {data: data},
1331
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
1332
+ )
1333
+ let priceLoptions = res.data.map(item => {
1334
+ return {
1335
+ label: item.f_price_name,
1336
+ value: `${item.id}`
1337
+ }
1338
+ })
1339
+ this.setLabelOptions('气价名称', priceLoptions)
1340
+ },
1341
+ // 单价失去焦点
1342
+ async priceChange () {
1343
+ if (isEmpty(this.show_data.f_price)) {
1344
+ return
1345
+ }
1346
+ let data = {
1347
+ operator: '*',
1348
+ num1: this.show_data.f_price,
1349
+ num2: this.show_data.f_install_count
1350
+ }
1351
+ let http = new HttpResetClass()
1352
+ let res = await http.load(
1353
+ 'POST',
1354
+ `rs/logic/compute`,
1355
+ {data: data},
1356
+ {resolveMsg: null, rejectMsg: '工程材料费计算失败!!!'}
1357
+ )
1358
+
1359
+ this.setLabelValue('工程材料费', res.data)
1360
+ },
1361
+ //工商户验证表具类型是否需选择
1362
+ async meterBrandCheck() {
1363
+ let data = {
1364
+ f_process_id: this.show_data.f_process_id,
1365
+ orgid:this.$login.f.orgid
1366
+ }
1367
+ let http = new HttpResetClass()
1368
+ let res = await http.load(
1369
+ 'POST',
1370
+ `rs/sql/meterCheck`,
1371
+ {data: data},
1372
+ {resolveMsg: null, rejectMsg: null}
1373
+ )
1374
+ if (res.data[0].num > 0){
1375
+ this.$showMessage(`还有${res.data[0].num}处未选择表具,请选择后提交!`)
1376
+ throw null
1377
+ }
1378
+ },
1379
+ // 安装户数
1380
+ async installCountCheck() {
1381
+ let data = {
1382
+ tablename: 't_userinfo',
1383
+ condition: `f_process_id = '${this.show_data.f_process_id}' and f_user_state != '销户'`,
1384
+ }
1385
+
1386
+ let http = new HttpResetClass()
1387
+ let res = await http.load(
1388
+ 'POST',
1389
+ `rs/sql/applySingleTable`,
1390
+ {data: data},
1391
+ {resolveMsg: null, rejectMsg: '用户数量查询失败'}
1392
+ )
1393
+ this.setLabelValue('安装户数',res.data.length)
1394
+ },
1395
+ // 户内出单日期
1396
+ getOutdoorsTime () {
1397
+ for (const item of this.selectdata.fields) {
1398
+ console.log('是否进入')
1399
+ if (item.label === '户内出单日期') {
1400
+ item.value = this.selectdata.f_release_date
1401
+ this.selectdata[item.field] = item.value
1402
+ console.log('当前出单时间',item.value)
1403
+ }else if(item.label === '庭院出单日期'){
1404
+ item.value = this.selectdata.f_release_date
1405
+ this.selectdata[item.field] = item.value
1406
+ }else if(item.label === '出单日期'){
1407
+ item.value = this.selectdata.f_release_date
1408
+ this.selectdata[item.field] = item.value
1409
+ }
1410
+ }
1411
+ },
1412
+ //获取缴费日期
1413
+ async getChargeDate() {
1414
+ let data = {
1415
+ tablename: 'activityins',
1416
+ condition: `processid = '${this.selectdata.f_process_id}' and defname = '报装缴费'`,
1417
+ }
1418
+
1419
+ let http = new HttpResetClass()
1420
+ let res = await http.load(
1421
+ 'POST',
1422
+ `rs/sql/applySingleTable`,
1423
+ {data: data},
1424
+ {resolveMsg: null, rejectMsg: null}
1425
+ )
1426
+ if (res.data[0]) {
1427
+ for (const item of this.selectdata.fields) {
1428
+ if (item.label === '缴费日期') {
1429
+ item.value = res.data[0].finishtime
1430
+ this.selectdata[item.field] = item.value
1431
+ }
1432
+ }
1433
+ }
1434
+ },
1435
+ //获取工程施工时各部门当前签字环节
1436
+ async getSingAct() {
1437
+ let data = {
1438
+ f_process_id: this.selectdata.f_process_id
1439
+ }
1440
+ let http = new HttpResetClass()
1441
+ let res = await http.load(
1442
+ 'POST',
1443
+ `rs/sql/getSingAct`,
1444
+ {data: data},
1445
+ {resolveMsg: null, rejectMsg: '签字状态查询失败!!!'}
1446
+ )
1447
+ if (res.data.length > 0) {
1448
+ for (const item of this.selectdata.fields) {
1449
+ if (item.label === '签字所在环节') {
1450
+ item.value = res.data[0].defname
1451
+ this.selectdata[item.field] = item.value
1452
+ }
1453
+ }
1454
+ }
1455
+ },
1456
+ //获取土建的乙方
1457
+ getYiFang() {
1458
+ return [{label: '榆林榆川天然气', value: '榆林榆川天然气'},
1459
+ {label: this.selectdata.f_user_name, value: this.selectdata.f_user_name},
1460
+ {label: '无', value: '无'}]
1461
+ },
1462
+ getGaiXianType () {
1463
+ return [{label: "隐患整改", value: "隐患整改"},
1464
+ {label: "改造工程", value: "改造工程"},
1465
+ {label: "改线工程", value: "改线工程"},
1466
+ {label: "老旧小区", value: "老旧小区"}]
1467
+ },
1468
+ async checkIsUser() {
1469
+ let data = {
1470
+ items: 'count(*) num' ,
1471
+ tablename: 't_userinfo',
1472
+ condition: `f_process_id = '${this.show_data.f_process_id}' and f_user_state <> '销户'`
1473
+ }
1474
+
1475
+ let http = new HttpResetClass()
1476
+ let res = await http.load(
1477
+ 'POST',
1478
+ `rs/sql/applySingleTable`,
1479
+ {data: data},
1480
+ {resolveMsg: null, rejectMsg: '是否存在用户!!!'}
1481
+ )
1482
+ if (res.data[0].num <= 0){
1483
+ this.$showMessage(`未添加设备,请添加后提交!`)
1484
+ throw null
1485
+ }
1486
+ },
1487
+ async repair() {
1488
+ let data = {
1489
+ f_process_id: this.show_data.f_process_id
1490
+ }
1491
+ let http = new HttpResetClass()
1492
+ let res = await http.load(
1493
+ 'POST',
1494
+ `rs/logic/updateRepair`,
1495
+ {data: data},
1496
+ {resolveMsg: null, rejectMsg: '维修工单状态修改!!!'}
1497
+ )
1498
+ this.$dispatch('loadPage')
1499
+ },
1500
+ changeDispatch(value){
1501
+ if (value === '维修安检中心'){
1502
+ this.hideLabels('现场项目负责人', '安装单位', '安装单位现场负责人', '建设单位', '监理单位', '土建单位', '检测单位', '户内出单日期', '户内回单日期'
1503
+ , '户内施工备注', '庭院出单日期', '庭院回单日期', '庭院施工备注', '是否发起签字', '签字是否完成', '签字所在环节')
1504
+ this.hideButtons('签字')
1505
+ this.electiveLabels('现场项目负责人', '安装单位', '建设单位', '监理单位', '土建单位', '检测单位', '户内出单日期', '户内回单日期'
1506
+ , '户内施工备注', '庭院出单日期', '庭院回单日期', '庭院施工备注', '是否发起签字', '签字是否完成', '签字所在环节')
1507
+ }
1508
+ if (value === '施工工队'){
1509
+ this.showLabels('现场项目负责人', '安装单位', '安装单位现场负责人','建设单位', '监理单位', '土建单位', '检测单位', '户内出单日期', '户内回单日期'
1510
+ , '户内施工备注', '庭院出单日期', '庭院回单日期', '庭院施工备注', '是否发起签字', '签字是否完成', '签字所在环节')
1511
+ this.requiredLabels('现场项目负责人', '安装单位', '安装单位现场负责人','建设单位', '监理单位', '土建单位', '检测单位', '现场项目负责人', '是否发起签字', '签字是否完成', '签字所在环节')
1512
+ }
1513
+ },
1514
+ //拆除流程核对气量提交
1515
+ async gasCheckBefore() {
1516
+ let http = new HttpResetClass()
1517
+ let data = {
1518
+ tablename: 't_files',
1519
+ condition: `f_blobid = '${this.selectdata.f_process_id}' and defname = '${this.selectdata.defname}' and fusetype = '气量核对单'`
1520
+ }
1521
+ let res = await http.load(
1522
+ 'POST',
1523
+ `rs/sql/applySingleTable`,
1524
+ {data: data},
1525
+ {resolveMsg: null, rejectMsg: null}
1526
+ )
1527
+ if (res.data.length <= 0) {
1528
+ this.$showMessage('气量核对单未上传,无法提交!!!')
1529
+ throw '气量核对单未上传,无法提交!'
1530
+ }
1531
+ },
1532
+ },
1533
+ events: {
1534
+ // 强制开关阀
1535
+ async 'onOffValve' () {
1536
+ let data = {
1537
+ condition: `ui.f_userinfo_id = '${this.show_data.f_userinfo_id}'`
1538
+ }
1539
+ let http = new HttpResetClass()
1540
+ let res = await http.load(
1541
+ 'POST',
1542
+ `rs/sql/getApplyUserinfo`,
1543
+ {data: data},
1544
+ {resolveMsg: null, rejectMsg: '档案获取失败!!!'}
1545
+ )
1546
+
1547
+ let userinfo = res.data[0]
1548
+
1549
+ if (this.show_data.button.button_name !== '退出强制状态') {
1550
+ data = {
1551
+ condition: `t_userfiles.f_meternumber = '${userinfo.f_meternumber}'`,
1552
+ contentData: {
1553
+ isOpen: this.show_data.button.button_name === '强制开阀' ? 1 : 0
1554
+ },
1555
+ inputtor: this.$login.f.name,
1556
+ instructTitle: this.show_data.button.button_name === '强制开阀' ? '开阀' : '关阀',
1557
+ instructType: '阀门控制',
1558
+ meterBrandName: userinfo.f_alias
1559
+ }
1560
+ res = await http.load(
1561
+ 'POST',
1562
+ `rs/logic/saveInstruct`,
1563
+ {data: data},
1564
+ {resolveMsg: null, rejectMsg: `${this.show_data.button.button_name}失败!!!`}
1565
+ )
1566
+ }
1567
+
1568
+ data = {
1569
+ f_user_id: userinfo.f_user_id,
1570
+ f_userinfo_id: userinfo.f_userinfo_id,
1571
+ record: {
1572
+ f_filiale: "榆林."+this.$login.f.orgs,
1573
+ f_instruct_meta_data: this.show_data.button.button_name === '退出强制状态' ? '退出强制阀控' : '进入强制阀控',
1574
+ f_instruct_title: this.show_data.button.button_name === '退出强制状态' ? '退出强制阀控' : '进入强制阀控',
1575
+ f_instruct_type: '阀门控制',
1576
+ f_meternumber: userinfo.f_meternumber,
1577
+ f_operator: this.$login.f.name,
1578
+ f_outlets: userinfo.f_outlets,
1579
+ f_reason: this.show_data.button.f_reason,
1580
+ f_user_id: userinfo.f_user_id,
1581
+ f_userinfo_id: userinfo.f_userinfo_id
1582
+ },
1583
+ state: this.show_data.button.button_name === '退出强制状态' ? 0 : 1
1584
+ }
1585
+
1586
+ res = await http.load(
1587
+ 'POST',
1588
+ `rs/logic/updateNetWorkValve`,
1589
+ {data: data},
1590
+ {resolveMsg: '执行成功!!!', rejectMsg: `执行失败!!!`}
1591
+ )
1592
+
1593
+ },
1594
+ // 修改用户档案
1595
+ async 'updateUserinfoState' () {
1596
+ let data = {
1597
+ f_userinfo_id: this.show_data.f_userinfo_id
1598
+ }
1599
+ let http = new HttpResetClass()
1600
+ let res = await http.load(
1601
+ 'POST',
1602
+ `rs/logic/updateUserinfoState`,
1603
+ {data: data},
1604
+ {resolveMsg: '该用户档案已为正常档案,可进行开关阀操作!!!', rejectMsg: '档案状态修改失败!!!'}
1605
+ )
1606
+
1607
+ this.showButtons('强制开阀','强制关阀')
1608
+ this.hideButtons('转正式档案')
1609
+ },
1610
+ // 选择用户
1611
+ async 'selectUserinfo' (row) {
1612
+ this.setLabelValue('用户编号', row.f_userinfo_id)
1613
+ this.setLabelValue('用户名称', row.f_user_name)
1614
+ this.setLabelValue('用户电话', row.f_user_phone)
1615
+ this.setLabelValue('证件类型', row.f_credentials)
1616
+ this.setLabelValue('证件号码', row.f_idnumber)
1617
+ this.setLabelValue('地址', row.f_address)
1618
+ this.setLabelValue('定位地址', row.f_location_address)
1619
+ this.setLabelValue('购货单位识别号', row.f_taxpayer_id)
1620
+ this.setLabelValue('购货单位名称', row.f_paper_name)
1621
+ this.setLabelValue('购货单位开户行及银行账号', row.f_paper_account)
1622
+ this.setLabelValue('购货单位地址电话', row.f_address_phone)
1623
+ this.setLabelValue('联系人', row.f_petitionuser)
1624
+ this.setLabelValue('区/县', row.f_area)
1625
+ this.setLabelValue('片区', row.f_slice_area)
1626
+ this.setLabelValue('街道', row.f_street)
1627
+ if (row.f_address_detail){
1628
+ this.setLabelValue('详细地址', row.f_address_detail)
1629
+ }
1630
+ if (this.show_data.f_apply_type === '改线业务'){
1631
+ this.setLabelValue('工程名称', row.f_user_name)
1632
+ this.setLabelValue('联系电话', row.f_user_phone)
1633
+ let str = '项目名称:天然气整改工程;项目地址:'+ this.show_data.f_address
1634
+ this.show_data.f_paper_remarks = str
1635
+ this.setLabelValue('发票备注',str)
1636
+ }
1637
+ this.show_data.f_address_detail = row.f_address_detail
1638
+ this.show_data.f_residential_area = row.f_residential_area
1639
+ this.show_data.unit = row.unit
1640
+ this.show_data.f_building = row.f_building
1641
+ this.show_data.f_floor = row.f_floor
1642
+ this.show_data.f_taxpayer_id = row.f_taxpayer_id //购货单位识别号
1643
+ this.show_data.f_address_phone = row.f_address_phone //购货单位地址电话
1644
+ this.show_data.f_paper_name = row.f_paper_name //购货单位名称
1645
+ this.show_data.f_paper_account = row.f_paper_account
1646
+ this.show_data.f_userinfo_id = row.f_userinfo_id
1647
+ console.log("当前数据",this.show_data)
1648
+ if (this.show_data.f_apply_type === '设备拆除'){
1649
+ let data = {
1650
+ userinfo: row,
1651
+ apply: this.show_data,
1652
+ loginUser: this.$login.f
1653
+ }
1654
+ let res = await this.$resetpost(
1655
+ `rs/logic/addChaiChuUser`,
1656
+ {data: data},
1657
+ {resolveMsg: '添加拆除用户成功!!!', rejectMsg: '添加拆除用户失败!!!'}
1658
+ )
1659
+ this.$dispatch('breakControl', this.show_data)
1660
+ }
1661
+ },
1662
+ async 'priceReadEvent' (index) {
1663
+ await this.setContractSignatory()
1664
+ // await this.getContractNumber()
1665
+ await this.getPrice(index)
1666
+ await this.priceChange()
1667
+ },
1668
+ async 'getPrice' (index) {
1669
+ if (isEmpty(this.show_data.f_gas_nature) || isEmpty(this.show_data.f_price_type)) {
1670
+ return
1671
+ }
1672
+
1673
+ if (index) {
1674
+ this.setLabelValue('气价名称', null)
1675
+ }
1676
+
1677
+ if (this.show_data.f_price_type === '混合气价') {
1678
+ this.showLabels('比率')
1679
+ } else {
1680
+ this.setLabelValue('比率', null)
1681
+ this.hideLabels('比率')
1682
+ }
1683
+
1684
+ let data = {
1685
+ condition: `sp.f_filiale like '%${"榆林."+this.$login.f.orgs}%' and sp.f_price_type = '${this.show_data.f_price_type}' and f_gasproperties = '${this.show_data.f_gas_nature}'`
1686
+ }
1687
+
1688
+ if (this.show_data.f_apply_type === '民用报建') {
1689
+ data.condition += `and f_user_type = '民用'`
1690
+ }
1691
+ if (this.show_data.f_apply_type === '非民用报建') {
1692
+ data.condition += `and f_user_type = '非民用'`
1693
+ }
1694
+
1695
+
1696
+ let http = new HttpResetClass()
1697
+ let res = await http.load(
1698
+ 'POST',
1699
+ `rs/sql/applyGetPrice`,
1700
+ {data: data},
1701
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
1702
+ )
1703
+
1704
+ let priceLoptions = res.data.map(item => {
1705
+ return {
1706
+ label: item.f_price_name,
1707
+ value: `${item.id}`
1708
+ }
1709
+ })
1710
+ this.setLabelOptions('气价名称',priceLoptions)
1711
+ },
1712
+ // 街道失去焦点
1713
+ async changStreet () {
1714
+ if (isEmpty(this.show_data.f_street)) {
1715
+ return
1716
+ }
1717
+ this.addressSplicing()
1718
+ },
1719
+
1720
+ 'changAddressDetail'(){
1721
+ if (isEmpty(this.show_data.f_address_detail)) {
1722
+ return
1723
+ }
1724
+ this.addressSplicing()
1725
+ },
1726
+ 'changAddress'(){
1727
+ if (isEmpty(this.show_data.f_address_detail)) {
1728
+ return
1729
+ }
1730
+ let f_address = this.show_data.f_address + this.show_data.f_address_detail
1731
+ this.setLabelValue("地址", f_address)
1732
+ },
1733
+ // 片区失去焦点
1734
+ async 'changSliceArea' () {
1735
+ if (isEmpty(this.show_data.f_area) || isEmpty(this.show_data.f_slice_area)) {
1736
+ return
1737
+ }
1738
+
1739
+ let data = {
1740
+ items: 'f_street label,f_street value',
1741
+ tablename: 't_area_address',
1742
+ condition: `f_area = '${this.show_data.f_area}' and f_slice_area = '${this.show_data.f_slice_area}'`,
1743
+ groupitem: 'f_street'
1744
+ }
1745
+
1746
+ let http = new HttpResetClass()
1747
+ let res = await http.load(
1748
+ 'POST',
1749
+ `rs/sql/applySingleTable`,
1750
+ {data: data},
1751
+ {resolveMsg: null, rejectMsg: '签字状态查询失败!!!'}
1752
+ )
1753
+ this.setLabelOptions('街道', res.data)
1754
+
1755
+ this.addressSplicing()
1756
+ },
1757
+ // 区县失去焦点
1758
+ 'changeArea' () {
1759
+ if (isEmpty(this.show_data.f_area)) {
1760
+ return
1761
+ }
1762
+ this.setLabelValue('片区', null)
1763
+ this.setLabelValue('街道', null)
1764
+ this.setLabelOptions('片区', this.$appdata.getParam(`${this.show_data.f_area}片区`))
1765
+ this.setLabelOptions('街道', [])
1766
+
1767
+ this.addressSplicing()
1768
+ },
1769
+ // 开启签字
1770
+ async 'startSignActivity' () {
1771
+ this.hideButtons('签字')
1772
+ if(this.show_data.f_apply_type !== '管线建设'){
1773
+ await this.constructionBefore()
1774
+ }
1775
+ let data = {
1776
+ apply: this.show_data,
1777
+ user: this.$login.f
1778
+ }
1779
+
1780
+ let res = await this.$resetpost(
1781
+ `rs/logic/startSignActivity`,
1782
+ {data: data},
1783
+ {resolveMsg: '签字流程已发起!!!', rejectMsg: '签字发起失败!!!'}
1784
+ )
1785
+
1786
+ this.$dispatch('breakControl', this.show_data)
1787
+ },
1788
+ // 工程施工初始化
1789
+ async 'buildReadyEvent' () {
1790
+ // this.changeDispatch(this.getLableValue('派工类型'))
1791
+ if(this.getLableValue('是否发起签字') === '') {
1792
+ this.hideButtons('签字')
1793
+ }
1794
+ let http = new HttpResetClass()
1795
+ if (isEmpty(this.show_data.f_meter_brand)) {
1796
+ return
1797
+ }else {
1798
+ if (this.show_data.f_meter_brand === 'null') {
1799
+ this.setLabelOptions('气表型号', [{label: '无', value: 'null'}])
1800
+ return
1801
+ }
1802
+ let data = {
1803
+ f_gasbrand_id: this.show_data.f_meter_brand
1804
+ }
1805
+ let res = await http.load(
1806
+ 'POST',
1807
+ `rs/sql/getGasModel`,
1808
+ {data: data},
1809
+ {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
1810
+ )
1811
+ this.setLabelOptions('气表型号', res.data)
1812
+ }
1813
+
1814
+ if (this.show_data.f_apply_type === '分户挂表') {
1815
+ let data = {
1816
+ condition: `ui.f_userinfo_id = '${this.show_data.f_userinfo_id}'`
1817
+ }
1818
+ let http = new HttpResetClass()
1819
+ let res = await http.load(
1820
+ 'POST',
1821
+ `rs/sql/getApplyUserinfo`,
1822
+ {data: data},
1823
+ {resolveMsg: null, rejectMsg: '档案状态获取失败!!!'}
1824
+ )
1825
+ console.log("f_meter_classif11y",res.data[0].f_meter_classify)
1826
+ if (!res.data[0].f_meter_brand.includes('物联网表')) {
1827
+ return
1828
+ }
1829
+ console.log("f_user_state11",res.data[0].f_user_state)
1830
+ if (res.data[0].f_user_state === '正常') {
1831
+ this.showButtons('退出强制状态','强制关阀')
1832
+ this.hideButtons('转正式档案')
1833
+ } else {
1834
+ this.showButtons('转正式档案')
1835
+ this.hideButtons('退出强制状态','强制关阀')
1836
+ }
1837
+ }
1838
+ },
1839
+ // 工程派工初始化
1840
+ async 'dispatchReadyEvent' () {
1841
+ if (isEmpty(this.show_data.f_meter_brand)) {
1842
+ return
1843
+ }
1844
+ let data = {
1845
+ f_gasbrand_id: this.show_data.f_meter_brand
1846
+ }
1847
+ let http = new HttpResetClass()
1848
+ let res = await http.load(
1849
+ 'POST',
1850
+ `rs/sql/getGasModel`,
1851
+ {data: data},
1852
+ {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
1853
+ )
1854
+
1855
+ this.setLabelOptions('气表型号', res.data)
1856
+ },
1857
+ // 气表品牌失去焦点
1858
+ async 'meterBrandChenge' (index) {
1859
+ if (isEmpty(this.show_data.f_meter_brand)) {
1860
+ return
1861
+ }
1862
+ this.setLabelValue('气表型号', null)
1863
+ let data = {
1864
+ f_gasbrand_id: this.show_data.f_meter_brand
1865
+ }
1866
+ let http = new HttpResetClass()
1867
+ let res = await http.load(
1868
+ 'POST',
1869
+ `rs/sql/getGasModel`,
1870
+ {data: data},
1871
+ {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
1872
+ )
1873
+
1874
+ this.setLabelOptions('气表型号', res.data)
1875
+ },
1876
+ // 单价失去焦点
1877
+ async 'priceChange' (index) {
1878
+ if (isEmpty(this.show_data.f_price)) {
1879
+ return
1880
+ }
1881
+ let data = {
1882
+ operator: '*',
1883
+ num1: this.show_data.f_price,
1884
+ num2: this.show_data.f_install_count
1885
+ }
1886
+ let http = new HttpResetClass()
1887
+ let res = await http.load(
1888
+ 'POST',
1889
+ `rs/logic/compute`,
1890
+ {data: data},
1891
+ {resolveMsg: null, rejectMsg: '工程材料费计算失败!!!'}
1892
+ )
1893
+
1894
+ this.setLabelValue('工程材料费', res.data)
1895
+ },
1896
+ // 安装户数失去焦点
1897
+ 'installCountChange' (index) {
1898
+ if (isEmpty(this.show_data.f_install_count)) {
1899
+ return
1900
+ }
1901
+ if (Number(this.show_data.f_install_count) > Number(this.show_data.f_apply_count)) {
1902
+ this.$showMessage('安装数已超过申请数!!!')
1903
+ // this.setLabelValue('安装户数', null)
1904
+ // this.setLabelValue('安装点数', null)
1905
+ // return
1906
+ }
1907
+
1908
+ if (Number(this.show_data.f_install_count) <= 0) {
1909
+ this.$showMessage('至少有一个用户!!!')
1910
+ this.setLabelValue('安装户数', null)
1911
+ this.setLabelValue('安装点数', null)
1912
+ return
1913
+ }
1914
+ },
1915
+ // 土建单位失去焦点
1916
+ 'judgmentEngineering' (index) {
1917
+ if (this.show_data.f_engineering_operator_id === '无' && this.show_data.f_civil_engineering !== "无") {
1918
+ this.$showMessage('土建工程派单与实际选择不符,请仔细核对后再次提交')
1919
+ throw null
1920
+ }
1921
+ },
1922
+ // 报建性质失去焦点
1923
+ 'applyNatureChange' (index) {
1924
+ if (this.show_data.f_apply_nature === '散户') {
1925
+ //绑定票据类型为电子票
1926
+ this.setLabelValue('票据类型', '电子票')
1927
+ this.hideLabels('营业执照')
1928
+ this.electiveLabels('营业执照', '购货单位识别号', '购货单位银行账号', '购货单位地址电话')
1929
+ }
1930
+ if (this.show_data.f_apply_nature === '小区') {
1931
+ //票据类型为专票
1932
+ this.setLabelValue('票据类型', '专票')
1933
+ this.showLabels('营业执照', '小区/巷道')
1934
+ this.requiredLabels('小区/巷道')
1935
+ }
1936
+ },
1937
+ // 票据类型失去焦点
1938
+ 'applyPaperChange' (index) {
1939
+ console.log("测试是否进入")
1940
+ if (this.show_data.f_paper_type === '专票') {
1941
+ this.requiredLabels('购货单位名称','购货单位识别号', '购货单位银行账号', '购货单位地址电话')
1942
+ }else {
1943
+ this.electiveLabels( '购货单位识别号', '购货单位银行账号', '购货单位地址电话')
1944
+ }
1945
+ },
1946
+ 'chargeAfter'(index){
1947
+ if (this.show_data.f_surplus_money !== this.show_data.f_due_money){
1948
+ this.hideButtons('退回')
1949
+ }else {
1950
+ this.showButtons('退回')
1951
+ }
1952
+ },
1953
+ //购货单位识别号失去焦点
1954
+ 'getAuthenticationMethod' (index){
1955
+ if (isEmpty(this.show_data.f_taxpayer_id)) {
1956
+ this.setLabelValue('认证类型','个人认证')
1957
+ }else {
1958
+ this.setLabelValue('认证类型','企业认证')
1959
+ }
1960
+ },
1961
+ //搜索小区
1962
+ 'selectArea' (val,index) {
1963
+ let pcdText = `and f_residential_area like '%${val}%'`
1964
+ let data = {
1965
+ tablename: 't_area_address',
1966
+ condition: `f_filiale like '%${"榆林."+this.$login.f.orgs}%' and f_area_status = '启用' ${pcdText}`
1967
+ }
1968
+ new HttpResetClass().load("POST", `rs/sql/applySingleTable`, {data:data}, {resolveMsg: null, rejectMsg: null}).then((res)=>{
1969
+ console.log('请求发送完成!!!!!'+JSON.stringify(res))
1970
+ if(res.data.length>0){
1971
+ this.setLabelOptions('小区/巷道', res.data.map(item => {
1972
+ return {
1973
+ label: item.f_residential_area,
1974
+ value: item.id
1975
+ }
1976
+ }))
1977
+ }
1978
+ })
1979
+ },
1980
+ //身份证号码校验
1981
+ 'checkIdnumber' (index) {
1982
+ if(this.show_data.f_credentials === '身份证'){
1983
+ var verify = /^[1-9]\d{5}(18|19|20|21)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
1984
+ if (!verify.test(this.show_data.fields[index].value)){
1985
+ this.show_data.fields[index].value = null
1986
+ this.$showMessage('身份证号码格式错误请重新输入!!!')
1987
+ }
1988
+ }
1989
+ },
1990
+ //电话号码校验
1991
+ 'checkPhone' (index) {
1992
+ var verify = /^([1][0-9]{10})$/
1993
+ if (!verify.test(this.show_data.fields[index].value)){
1994
+ this.show_data.fields[index].value = null
1995
+ this.$showMessage('电话号码格式错误请重新输入!!!')
1996
+ }
1997
+ },
1998
+ 'changeDispatching'(index){
1999
+ if (this.show_data.fields[index].value === '安检维修中心'){
2000
+ this.hideLabels('现场项目负责人', '安装单位', '安装单位现场负责人','建设单位', '监理单位', '土建单位', '检测单位')
2001
+ this.electiveLabels('现场项目负责人', '安装单位', '安装单位现场负责人','建设单位', '监理单位', '土建单位', '检测单位')
2002
+ }else if (this.show_data.fields[index].value === '施工工队'){
2003
+ this.showLabels('现场项目负责人', '安装单位', '安装单位现场负责人','建设单位', '监理单位', '土建单位', '检测单位')
2004
+ this.requiredLabels('现场项目负责人', '安装单位', '安装单位现场负责人','建设单位', '监理单位', '土建单位', '检测单位')
2005
+ }
2006
+ },
2007
+ 'getRefund'(index){
2008
+ if (this.show_data.fields[index].value === ''){
2009
+ this.hideLabels('退费金额', '退款项')
2010
+ this.electiveLabels('退费金额', '退款项')
2011
+ }else if (this.show_data.fields[index].value === ''){
2012
+ this.showLabels('退费金额', '退款项')
2013
+ this.requiredLabels('退费金额', '退款项')
2014
+ }
2015
+ },
2016
+ 'hasTrouble'(index) {
2017
+ if (this.show_data.fields[index].value === '有纠纷'){
2018
+ this.hideButtons('提交', '签字', '图纸变更')
2019
+ this.showLabels('纠纷原因')
2020
+ }else {
2021
+ this.showButtons('提交', '签字', '图纸变更')
2022
+ this.hideLabels('纠纷原因')
2023
+ }
2024
+ },
2025
+ //金额大小写转换
2026
+ 'applyCapitalizedAmount' (index){
2027
+ // 通过正则过滤小数点后两位
2028
+ let money = (this.show_data.fields[index].value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
2029
+ this.setLabelValue('应交金额大写',this.smalltoBIG(money))
2030
+ },
2031
+
2032
+ // ===========================================
2033
+ 'initializtionView' () {
2034
+ if (this.show_data.f_apply_nature === '散户') {
2035
+ this.hideLabels('营业执照')
2036
+ this.electiveLabels('营业执照', '购货单位识别号', '购货单位银行账号', '购货单位地址电话')
2037
+ }
2038
+ if (this.show_data.f_apply_nature === '小区') {
2039
+ this.showLabels('营业执照', '小区/巷道', '小区名称')
2040
+ this.requiredLabels('小区/巷道')
2041
+ // this.hideComponents('用户花名单')
2042
+ }
2043
+ },
2044
+ // 检查重复
2045
+ 'checkRepeat' (index) {
2046
+ this.checkDuplicate(index)
2047
+ },
2048
+ async 'button'() {
2049
+ if (this.show_data.button.before) {
2050
+ await this[this.show_data.button.before]()
2051
+ }
2052
+ // 点击重置按钮就重置数据
2053
+ if (this.show_data.button.button_name === '重置') {
2054
+ this.$dispatch('breakControl', this.selectdata)
2055
+ return
2056
+ }
2057
+ this.show_data.start_activity = this.$workflow_vue.start_activity
2058
+ this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
2059
+ let data = {
2060
+ apply: this.show_data,
2061
+ user: this.$login.f
2062
+ }
2063
+ let http = new HttpResetClass()
2064
+ let res = await http.load(
2065
+ 'POST',
2066
+ `rs/logic/ApplyProductService`,
2067
+ {data: data},
2068
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
2069
+ )
2070
+ if (this.show_data.button.after) {
2071
+ this[this.show_data.button.after]()
2072
+ }
2073
+ this.$dispatch('loadPage')
2074
+ },
2075
+ // 失去焦点出触发事件
2076
+ 'onchange' (index) {
2077
+ },
2078
+ selectSearch (val, index) {},
2079
+ 'onblur' (index) {},
2080
+ 'oninput' (index) {},
2081
+ async 'onchangeModal' (index, fieldIndex) {
2082
+ },
2083
+ async 'onblurModal' (index, fieldIndex) {
2084
+
2085
+ },
2086
+ async 'oninputModal' (index, fieldIndex) {
2087
+
2088
+ },
2089
+ async 'onetomanydelete' (index, rowIndex) {
2090
+
2091
+ let http = new HttpResetClass()
2092
+
2093
+ let res = await http.load(
2094
+ 'DELETE',
2095
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
2096
+ null,
2097
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
2098
+ )
2099
+
2100
+ res = await this.$resetpost(
2101
+ 'rs/entity/t_apply',
2102
+ this.show_data
2103
+ )
2104
+
2105
+ this.$dispatch('breakControl', this.show_data)
2106
+ },
2107
+ async 'onetomanyupdate' (index, rowIndex) {
2108
+ let data = this.show_data.onetomany[index].rows[rowIndex]
2109
+
2110
+ this.show_data.onetomany[index].fields.forEach(item => {
2111
+ data[item.field] = item.value
2112
+ })
2113
+ let res = await this.$resetpost(
2114
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
2115
+ data
2116
+ )
2117
+
2118
+ res = await this.$resetpost(
2119
+ 'rs/entity/t_apply',
2120
+ this.show_data
2121
+ )
2122
+
2123
+ this.$dispatch('breakControl', this.show_data)
2124
+ },
2125
+ async 'onetomanyadd' (index) {
2126
+ let data = {
2127
+ f_process_id : this.show_data.f_process_id,
2128
+ f_operator_id: this.$login.f.id,
2129
+ f_operator: this.$login.f.name,
2130
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
2131
+ f_orgid: this.$login.f.orgid,
2132
+ f_orgname: "榆林."+this.$login.f.orgs
2133
+ }
2134
+ this.show_data.onetomany[index].fields.forEach(item => {
2135
+ data[item.field] = item.value
2136
+ })
2137
+ let res = await this.$resetpost(
2138
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
2139
+ data
2140
+ )
2141
+
2142
+ res = await this.$resetpost(
2143
+ 'rs/entity/t_apply',
2144
+ this.show_data
2145
+ )
2146
+
2147
+ this.$dispatch('breakControl', this.show_data)
2148
+ },
2149
+ 'complyInstallation' (index) {
2150
+ if (this.show_data.defname === '报建受理'){
2151
+ if (this.show_data.f_accept_install === '否') {
2152
+ console.log("测试")
2153
+ this.hideButtons('下发','提交')
2154
+ this.showButtons('终止')
2155
+ } else {
2156
+ this.hideButtons('终止')
2157
+ this.showButtons('下发','提交')
2158
+ }
2159
+ }
2160
+ if (this.show_data.defname === '现场勘察'){
2161
+ if (this.show_data.f_survey_opinion === '否') {
2162
+ console.log("测试")
2163
+ this.hideButtons('下发','提交')
2164
+ this.showButtons('终止')
2165
+ } else {
2166
+ this.hideButtons('终止')
2167
+ this.showButtons('下发','提交')
2168
+ }
2169
+ }
2170
+ if (this.show_data.defname === '报建受理' || this.show_data.defname === '现场勘察'){
2171
+ this.installCountCheck()
2172
+ }
2173
+ },
2174
+ async 'saveData'(index) {
2175
+ if (this.show_data.f_residential_area_id) {
2176
+ let data = {
2177
+ tablename: 't_area_address',
2178
+ condition: `id = '${this.show_data.f_residential_area_id}'`
2179
+ }
2180
+ let http = new HttpResetClass()
2181
+ let res = await http.load(
2182
+ 'POST',
2183
+ `rs/sql/applySingleTable`,
2184
+ {data: data},
2185
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
2186
+ )
2187
+
2188
+ this.area = res.data[0]
2189
+ }
2190
+ this.areaAddressSplicing()
2191
+ },
2192
+ async 'importEvent' (index, table, configName, filepath) {
2193
+ let data = {
2194
+ selectdata: this.show_data,
2195
+ table: table,
2196
+ filepath: filepath,
2197
+ configName: configName,
2198
+ user: this.$login.f
2199
+ }
2200
+
2201
+ let res = await this.$resetpost(
2202
+ `rs/logic/importEvent`,
2203
+ data
2204
+ )
2205
+
2206
+ this.$dispatch('breakControl', this.show_data)
2207
+ },
2208
+ 'onbutchange' (index) {
2209
+
2210
+ },
2211
+ 'onbutblur' (index) {
2212
+
2213
+ },
2214
+ 'onbutinput' (index) {
2215
+
2216
+ }
2217
+ },
2218
+ watch: {
2219
+ }
2220
+ }
2221
+ </script>
2222
+ <style scoped>
2223
+ /*清除model中的浮动*/
2224
+ .clearfix:after,.clearfix:before{
2225
+ display: table;
2226
+ }
2227
+ .clearfix:after{
2228
+ clear: both;
2229
+ }
2230
+ </style>