apply-clients 7.1.36-yuchuan-6 → 7.1.36-yuchuan-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/build/dev-server.js +25 -10
  2. package/index.html +39 -39
  3. package/package.json +1 -1
  4. package/src/apply.js +7 -0
  5. package/src/components/android/AppSign.vue +234 -234
  6. package/src/components/android/AppUpload.vue +275 -275
  7. package/src/components/android/Ignition/VentilationIgnitionHandle.vue +462 -462
  8. package/src/components/android/Process/AppServiceControl.vue +1437 -1437
  9. package/src/components/android/Supervisory/AppProcessSupervisory.vue +344 -344
  10. package/src/components/android/Task/ShiGongXinXi/AppShowBuildUser.vue +431 -431
  11. package/src/components/android/Task/yiban/ShowDone.vue +95 -95
  12. package/src/components/android/Task/yiban/satisfactionShow.vue +166 -166
  13. package/src/components/product/ApplyCharge/ApplyChargeList.vue +1101 -1101
  14. package/src/components/product/ApplyGaiXianCharge/ApplyGaiXianViewList.vue +272 -272
  15. package/src/components/product/ApplyGuanXian/GuanXianCaiLiao.vue +236 -236
  16. package/src/components/product/ApplyGuanXian/GuanXianExplorationSelect.vue +324 -324
  17. package/src/components/product/ApplyGuanXian/GuanXianSupervisoryhCart.vue +119 -119
  18. package/src/components/product/ApplyMap/ApplyDragaboutList.vue +223 -223
  19. package/src/components/product/ApplyMap/ApplyMapLocation.vue +862 -862
  20. package/src/components/product/ChongZheng/ApplyChongZhengList.vue +415 -415
  21. package/src/components/product/Function/InstallInfoSelect.vue +371 -371
  22. package/src/components/product/Function/Service/FunctionServiceControl.vue +586 -586
  23. package/src/components/product/GongJianPush/ApplyPushDispose.vue +206 -0
  24. package/src/components/product/GongJianPush/ApplyPushList.vue +196 -0
  25. package/src/components/product/GongJianPush/ApplyPushManage.vue +90 -0
  26. package/src/components/product/Ignition/IgnitionListManage.vue +602 -602
  27. package/src/components/product/Ignition/IgnitionRecord.vue +380 -380
  28. package/src/components/product/List/OldShowDevices.vue +271 -271
  29. package/src/components/product/List/ShowAllActivity.vue +540 -540
  30. package/src/components/product/List/ShowDevices.vue +279 -279
  31. package/src/components/product/Print/BuildOrder/buildOrderList.vue +446 -446
  32. package/src/components/product/Process/ExplorationSelect.vue +597 -597
  33. package/src/components/product/Process/NewExplorationSelect.vue +586 -586
  34. package/src/components/product/Process/Processes/Print/printCharge.vue +250 -250
  35. package/src/components/product/Process/Processes/Print/printGaiXianCharge.vue +244 -244
  36. package/src/components/product/Process/Processes/devicesManagement.vue +393 -393
  37. package/src/components/product/Process/Processes/newDevicesManagement.vue +413 -413
  38. package/src/components/product/Stop/StopApplyList.vue +224 -224
  39. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +592 -592
  40. package/src/components/product/Supervisory/SupervisoryControl.vue +116 -116
  41. package/src/components/product/Supervisory/SupervisoryList.vue +557 -557
  42. package/src/components/product/Supervisory/YiBanSupervisoryList.vue +539 -539
  43. package/src/components/product/VueUtils/ApplyUpload.vue +285 -285
  44. package/src/components/product/records/AdjustmentRecordList.vue +162 -162
  45. package/src/main.js +27 -27
  46. package/yarn.lock +0 -9824
@@ -1,586 +1,586 @@
1
- <template>
2
- <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
3
- </template>
4
- <script>
5
- import {HttpResetClass} from 'vue-client'
6
- import Vue from 'vue'
7
- export default {
8
- title: '报建功能业务控制层',
9
- props: ['selectdata'],
10
- data () {
11
- return {
12
- show_data: null, // 给通用页面显示的数据
13
- showview: false, // 控制通用页面
14
- recording: 0, // 是否有缴费记录
15
- }
16
- },
17
- ready () {
18
- this.refurbish()
19
- },
20
- methods: {
21
- // 判断是否有缴费记录
22
- getCheckPayRecording () {
23
- let http = new HttpResetClass()
24
- let data = {
25
- f_process_id: this.selectdata.f_process_id,
26
- user: this.$login.f,
27
- paynum:'',
28
- }
29
- let res = http.load('POST', 'rs/logic/getCheckPay', {data:data}, {
30
- resolveMsg: null,
31
- rejectMsg: '缴费记录查询失败!!!'
32
- })
33
- // 有缴费记录
34
- if (res.data> 0) {
35
- this.recording = 1
36
-
37
- }
38
- },
39
- modifData(fields,falg){
40
- fields.forEach(item => {
41
- if((item.label=='工程费单价'||item.label=='应交总金额'|| item.label=='未结总金额')&&falg==1){
42
- this.readwriteLabels(item.label)
43
- }
44
- if((item.label=='工程费单价'||item.label=='应交总金额'|| item.label=='未结总金额')&&falg==0){
45
- this.readonlyLabels(item.label)
46
- }
47
- })
48
- },
49
- //根据缴费记录判断是否可编辑
50
- async getCheckPay (fields, defname,type) {
51
- console.log(fields)
52
- let http = new HttpResetClass()
53
- let data = {
54
- f_process_id: this.selectdata.f_process_id,
55
- user: this.$login.f,
56
- paynum:'',
57
- }
58
- let res = await http.load('POST', 'rs/logic/getCheckPay', {data:data}, {
59
- resolveMsg: null,
60
- rejectMsg: '缴费记录查询失败!!!'
61
- })
62
- // 有缴费记录
63
- if (res.data> 0) {
64
- if(type=='非民用报建'||type=='设备变更'){
65
- if(defname=='报装缴费'){
66
- fields.forEach(item => {
67
- if(item.label=='收费标准备注'){
68
- this.showLabels(item.label)
69
- }
70
- })
71
- }
72
- }
73
- //使用foreach遍历fields
74
- if(defname=='报装缴费'){
75
- fields.forEach(item => {
76
- if(item.label=='收费标准备注'||item.label=='票据类型'||item.label=='报警器'||item.label=='购货单位识别号'||item.label=='购货单位名称'||item.label=='购货单位开户'||item.label=='购货单位地址电话'||item.label=='购货单位银行账号'){
77
- this.readonlyLabels(item.label)
78
- }else{
79
- this.readonlyLabels(item.label)
80
- }
81
- })
82
- }
83
- }else{ //无缴费记录
84
- if(type=='非民用报建'||type=='设备变更'){
85
- if(defname=='报装缴费'){
86
- fields.forEach(item => {
87
- if(item.label=='收费标准备注'){
88
- this.showLabels(item.label)
89
- }
90
- })
91
- }
92
- }
93
- if(defname=='报装缴费'){
94
- fields.forEach(item => {
95
- if(item.label=='收费标准备注'||item.label=='票据类型'||item.label=='报警器'||item.label=='购货单位识别号'||item.label=='购货单位名称'||item.label=='购货单位开户'||item.label=='购货单位地址电话'||item.label=='购货单位银行账号'){
96
-
97
- this.readwriteLabels(item.label)
98
- }else{
99
- this.readonlyLabels(item.label)
100
- }
101
- })
102
- }
103
- }
104
- },
105
- async refurbish () {
106
- // fields 字段填充值
107
- for (const item of this.selectdata.fields) {
108
- if (!item.value) {
109
- item.value = null
110
- }
111
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
112
- if (item.eval) {
113
- item.value = eval(item.default)
114
- } else {
115
- item.value = item.default
116
- }
117
- }
118
- if (this.selectdata[item.field]) {
119
- // 将json字符串格式化赋值给value
120
- if (String(this.selectdata[item.field]).startsWith("{")) {
121
- item.value = JSON.parse(this.selectdata[item.field])
122
- } else {
123
- item.value = this.selectdata[item.field]
124
- }
125
- }
126
- if (this.selectdata[item.field] === 0) {
127
- item.value = 0
128
- }
129
-
130
- // datepicker
131
- if (item.type === 'datepicker' && !item.value && item.default) {
132
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
133
- }
134
-
135
- // 如果配置类型为select,优先从参数列表获取options
136
- if (item.type === 'select' || item.type === 'checkbox') {
137
- if (item.param) {
138
- let temp = this.$appdata.getParam(item.label)
139
-
140
- if (temp && temp.length > 0) {
141
- item.options = temp
142
- }
143
- if (item.paramLabel) {
144
- temp = this.$appdata.getParam(item.paramLabel)
145
- if (temp && temp.length > 0) {
146
- item.options = temp
147
- }
148
- }
149
- }
150
- if (item.ready) {
151
- item.options = await this[item.ready]()
152
- }
153
- }
154
- if (item.type === 'checkbox') {
155
- if (this.selectdata[item.field]) {
156
- item.value = JSON.parse(this.selectdata[item.field])
157
- } else {
158
- item.value = []
159
- }
160
- }
161
- }
162
- // 控制组件
163
- if (this.selectdata.components) {
164
- this.selectdata.components.forEach(item => {
165
- item.mark = 2
166
- })
167
- }
168
- // 初始化onetomany
169
- if (this.selectdata.onetomany) {
170
- for (const item of this.selectdata.onetomany) {
171
- let res = null
172
- if (item.queryEvent) {
173
- res = this[item.queryEvent]()
174
- } else {
175
- let data = {
176
- tablename: item.tables[0],
177
- condition: `f_process_id='${this.selectdata.f_process_id}'`
178
- }
179
- res = await this.$resetpost(
180
- 'rs/sql/applySingleTable',
181
- {data: data},
182
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
183
- )
184
- }
185
- item.rows = res.data
186
- // 初始化onetomany中的fields
187
- for (const field of item.fields) {
188
- if (!field.value) {
189
- if (field.value !== 0) {
190
- field.value = null
191
- }
192
- }
193
-
194
- if (field.default || field.default === 0) {
195
- field.value = field.default
196
- }
197
-
198
- // datepicker
199
- if (field.type === 'datepicker' && !field.value && field.default) {
200
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
201
- }
202
-
203
- if (field.type === 'select') {
204
- let temp = this.$appdata.getParam(field.label)
205
-
206
- if (temp && temp.length > 0) {
207
- field.options = temp
208
- }
209
-
210
- if (field.paramLabel) {
211
- temp = this.$appdata.getParam(field.paramLabel)
212
- if (temp && temp.length > 0) {
213
- item.options = temp
214
- }
215
- }
216
- }
217
- }
218
- }
219
- }
220
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
221
- let temp = JSON.parse(JSON.stringify(this.selectdata))
222
- this.show_data = temp
223
- this.$nextTick(() => {
224
- this.showview = true
225
- })
226
- const defname = this.selectdata.defname
227
- const type = this.selectdata.f_apply_type
228
- const title=this.selectdata.title
229
- if(title=='信息修改' ||title=='信息变更'){
230
- this.getCheckPay(this.selectdata.fields, defname, type)
231
- }
232
- if( type=='非民用报建' && title=='费用调整'){
233
- if(defname=='报装缴费'){
234
- this.getCheckPayRecording()
235
- if(this.recording ==1){ //收费了
236
- this.modifData(this.selectdata.fields,0)
237
- }
238
- if(this.recording ==0){ //没收费
239
- this.modifData(this.selectdata.fields,1)
240
- }
241
- }
242
- }
243
- },
244
- // 金额转大写
245
- smalltoBIG(n) {
246
- let fraction = ['角', '分'];
247
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
248
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
249
- let head = n < 0 ? '欠' : '';
250
- n = Math.abs(n);
251
-
252
- let s = '';
253
-
254
- for (var i = 0; i < fraction.length; i++) {
255
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
256
- }
257
- s = s || '整';
258
- n = Math.floor(n);
259
-
260
- for (var i = 0; i < unit[0].length && n > 0; i++) {
261
- let p = '';
262
- for (var j = 0; j < unit[1].length && n > 0; j++) {
263
- p = digit[n % 10] + unit[1][j] + p;
264
- n = Math.floor(n / 10);
265
- }
266
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
267
- }
268
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
269
- },
270
- getLableValue(label) {
271
- for (const item of this.show_data.fields) {
272
- if (item.label === label && item.type !== 'number') {
273
- return item.value || ''
274
- }
275
- if (item.label === label && item.type === 'number') {
276
- return item.value || 0
277
- }
278
- }
279
- },
280
- getLableOptions(label) {
281
- for (const item of this.show_data.fields) {
282
- if (item.label === label) {
283
- return item.options
284
- }
285
- }
286
- },
287
- setLabelValue(label, value) {
288
- for (const item of this.show_data.fields) {
289
- if (item.label === label) {
290
- item.value = value
291
- this.show_data[item.field] = value
292
- }
293
- }
294
- },
295
- setLabelOptions(label, options) {
296
- for (const item of this.show_data.fields) {
297
- if (item.label === label) {
298
- item.options = options
299
- }
300
- }
301
- },
302
- showLabels(...labels) {
303
- for (const item of this.show_data.fields) {
304
- if (labels.includes(item.label)) {
305
- item.hidden = false
306
- }
307
- }
308
- },
309
- hideLabels(...labels) {
310
- for (const item of this.show_data.fields) {
311
- if (labels.includes(item.label)) {
312
- item.hidden = true
313
- }
314
- }
315
- },
316
- showButtons(...buttons) {
317
- for (const item of this.show_data.buttons) {
318
- if (buttons.includes(item.button_name)) {
319
- item.hidden = false
320
- }
321
- }
322
- },
323
- hideButtons(...buttons) {
324
- for (const item of this.show_data.buttons) {
325
- if (buttons.includes(item.button_name)) {
326
- item.hidden = true
327
- }
328
- }
329
- },
330
- requiredLabels(...labels) {
331
- for (const item of this.show_data.fields) {
332
- if (labels.includes(item.label)) {
333
- item.required = true
334
- }
335
- }
336
- },
337
- electiveLabels(...labels) {
338
- for (const item of this.show_data.fields) {
339
- if (labels.includes(item.label)) {
340
- item.required = false
341
- }
342
- }
343
- },
344
- readonlyLabels(...labels) {
345
- for (const item of this.show_data.fields) {
346
- if (labels.includes(item.label)) {
347
- item.readonly = true
348
- item.disabled = true
349
- }
350
- }
351
- },
352
- readwriteLabels(...labels) {
353
- for (const item of this.show_data.fields) {
354
- if (labels.includes(item.label)) {
355
- item.readonly = false
356
- item.disabled = false
357
- }
358
- }
359
- },
360
- disabledButtons(...buttons) {
361
- for (const item of this.show_data.buttons) {
362
- if (buttons.includes(item.button_name)) {
363
- item.disabled = true
364
- }
365
- }
366
- },
367
- enableButtons(...buttons) {
368
- for (const item of this.show_data.buttons) {
369
- if (buttons.includes(item.button_name)) {
370
- item.disabled = false
371
- }
372
- }
373
- },
374
- async checkDuplicate(index) {
375
- let http = new HttpResetClass()
376
- let data = {
377
- tablename: 't_apply',
378
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
379
- }
380
- let res = await http.load('POST', 'rs/sql/applySingleTable', {data: data}, {
381
- resolveMsg: null,
382
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
383
- })
384
- if (res.data.length > 0) {
385
- this.show_data.fields[index].value = null
386
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
387
- }
388
- }
389
- },
390
- events: {
391
- async 'stopApply' () {
392
-
393
- let data = {
394
- apply: this.show_data,
395
- user: this.$login.f
396
- }
397
-
398
- let res = await this.$resetpost(
399
- `rs/logic/stopApply`,
400
- {data: data},
401
- {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
402
- )
403
-
404
- this.$dispatch('loadPage')
405
- },
406
- async 'pauseApply' () {
407
-
408
- let data = {
409
- apply: this.show_data,
410
- user: this.$login.f
411
- }
412
-
413
- let res = await this.$resetpost(
414
- `rs/logic/pauseApply`,
415
- {data: data},
416
- {resolveMsg: null, rejectMsg: '暂停报建失败!!!'}
417
- )
418
-
419
- this.$dispatch('loadPage')
420
- },
421
- async 'modifyInfo'() {
422
- if(this.selectdata.title === '费用修改'){
423
- let data = {
424
- tablename: 't_charge_record',
425
- condition: `f_process_id='${this.selectdata.f_process_id}'`
426
- }
427
- res = await this.$resetpost(
428
- 'rs/sql/applySingleTable',
429
- {data: data},
430
- {resolveMsg: null, rejectMsg: '收费信息查看'}
431
- )
432
- if (res.data.length > 0){
433
- this.$showMessage('用户已缴费,无法修改!!!', ['confirm']).then((res) => {
434
- if (res === 'confirm') {
435
- this.$dispatch('loadPage')
436
- }
437
- })
438
- throw '用户已缴费,无法修改!!!'
439
- }else{
440
- let datas = {
441
- data: this.show_data,
442
- user: this.$login.f
443
- }
444
- let http = new HttpResetClass()
445
- let res = http.load('POST', 'rs/logic/modifyRecords', {data:datas}, {
446
- resolveMsg: null,
447
- rejectMsg: '保存修改记录失败!!!'
448
- })
449
- }
450
- }
451
- if(this.selectdata.title === '费用调整'){
452
- let data = {
453
- data: this.show_data,
454
- user: this.$login.f
455
- }
456
- let http = new HttpResetClass()
457
- let res = http.load('POST', 'rs/logic/modifyRecords', {data:data}, {
458
- resolveMsg: null,
459
- rejectMsg: '保存修改记录失败!!!'
460
- })
461
- }
462
- console.log("保存数据")
463
- let res = await this.$resetpost(
464
- `rs/entity/t_apply`,
465
- this.show_data,
466
- {resolveMsg: null, rejectMsg: '数据保存失败!!!'}
467
- )
468
- this.$dispatch('loadPage')
469
- },
470
- //身份证号码校验
471
- 'checkIdnumber' (index) {
472
- if(this.show_data.f_credentials === '身份证'){
473
- 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]$/
474
- if (!verify.test(this.show_data.fields[index].value)){
475
- this.show_data.fields[index].value = null
476
- this.$showAlert('身份证号码格式错误请重新输入!!!', 'warning', 3000)
477
- }
478
- }
479
- },
480
- //电话号码校验
481
- 'checkPhone' (index) {
482
- var verify = /^([1][0-9]{10})$/
483
- if (!verify.test(this.show_data.fields[index].value)){
484
- this.show_data.fields[index].value = null
485
- this.$showAlert('电话号码格式错误请重新输入!!!', 'warning', 3000)
486
- }
487
- },
488
- 'applyPaperChange' (index) {
489
- console.log("测试是否进入")
490
- if (this.show_data.f_paper_type === '专票') {
491
- this.requiredLabels('购货单位名称','购货单位识别号', '购货单位银行账号', '购货单位地址电话')
492
- }else {
493
- this.electiveLabels( '购货单位识别号', '购货单位银行账号', '购货单位地址电话')
494
- }
495
- },
496
- // 获取view层button事件
497
- async 'button' (){
498
- console.log("保存数据")
499
- let res = await this.$resetpost(
500
- `rs/entity/t_apply`,
501
- this.show_data,
502
- {resolveMsg: null, rejectMsg: '数据保存失败!!!'}
503
- )
504
-
505
- this.$dispatch('loadPage')
506
- },
507
- // 失去焦点出触发事件
508
- 'onchange' (index) {
509
- },
510
- 'onblur' (index) {},
511
- 'oninput' (index) {},
512
- 'initializtionView' () {},
513
- async 'onchangeModal' (index, fieldIndex) {
514
- },
515
- async 'onblurModal' (index, fieldIndex) {
516
-
517
- },
518
- async 'oninputModal' (index, fieldIndex) {
519
-
520
- },
521
- async 'onetomanydelete' (index, rowIndex) {
522
-
523
- let http = new HttpResetClass()
524
-
525
- let res = await http.load(
526
- 'DELETE',
527
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
528
- null,
529
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
530
- )
531
-
532
- res = await this.$resetpost(
533
- 'rs/entity/t_apply',
534
- this.show_data
535
- )
536
-
537
- this.$dispatch('breakControl', this.show_data)
538
- },
539
- async 'onetomanyupdate' (index, rowIndex) {
540
- let data = this.show_data.onetomany[index].rows[rowIndex]
541
-
542
- this.show_data.onetomany[index].fields.forEach(item => {
543
- data[item.field] = item.value
544
- })
545
- let res = await this.$resetpost(
546
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
547
- data
548
- )
549
-
550
- res = await this.$resetpost(
551
- 'rs/entity/t_apply',
552
- this.show_data
553
- )
554
-
555
- this.$dispatch('breakControl', this.show_data)
556
- },
557
- async 'onetomanyadd' (index) {
558
- let data = {
559
- f_process_id : this.show_data.f_process_id,
560
- f_operator_id: this.$login.f.id,
561
- f_operator: this.$login.f.name,
562
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
563
- f_orgid: this.$login.f.orgid,
564
- f_orgname: this.$login.f.orgs
565
- }
566
- this.show_data.onetomany[index].fields.forEach(item => {
567
- data[item.field] = item.value
568
- })
569
- let res = await this.$resetpost(
570
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
571
- data
572
- )
573
-
574
- res = await this.$resetpost(
575
- 'rs/entity/t_apply',
576
- this.show_data
577
- )
578
-
579
- this.$dispatch('breakControl', this.show_data)
580
- }
581
- },
582
- watch:{
583
- deep: true
584
- }
585
- }
586
- </script>
1
+ <template>
2
+ <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
3
+ </template>
4
+ <script>
5
+ import {HttpResetClass} from 'vue-client'
6
+ import Vue from 'vue'
7
+ export default {
8
+ title: '报建功能业务控制层',
9
+ props: ['selectdata'],
10
+ data () {
11
+ return {
12
+ show_data: null, // 给通用页面显示的数据
13
+ showview: false, // 控制通用页面
14
+ recording: 0, // 是否有缴费记录
15
+ }
16
+ },
17
+ ready () {
18
+ this.refurbish()
19
+ },
20
+ methods: {
21
+ // 判断是否有缴费记录
22
+ getCheckPayRecording () {
23
+ let http = new HttpResetClass()
24
+ let data = {
25
+ f_process_id: this.selectdata.f_process_id,
26
+ user: this.$login.f,
27
+ paynum:'',
28
+ }
29
+ let res = http.load('POST', 'rs/logic/getCheckPay', {data:data}, {
30
+ resolveMsg: null,
31
+ rejectMsg: '缴费记录查询失败!!!'
32
+ })
33
+ // 有缴费记录
34
+ if (res.data> 0) {
35
+ this.recording = 1
36
+
37
+ }
38
+ },
39
+ modifData(fields,falg){
40
+ fields.forEach(item => {
41
+ if((item.label=='工程费单价'||item.label=='应交总金额'|| item.label=='未结总金额')&&falg==1){
42
+ this.readwriteLabels(item.label)
43
+ }
44
+ if((item.label=='工程费单价'||item.label=='应交总金额'|| item.label=='未结总金额')&&falg==0){
45
+ this.readonlyLabels(item.label)
46
+ }
47
+ })
48
+ },
49
+ //根据缴费记录判断是否可编辑
50
+ async getCheckPay (fields, defname,type) {
51
+ console.log(fields)
52
+ let http = new HttpResetClass()
53
+ let data = {
54
+ f_process_id: this.selectdata.f_process_id,
55
+ user: this.$login.f,
56
+ paynum:'',
57
+ }
58
+ let res = await http.load('POST', 'rs/logic/getCheckPay', {data:data}, {
59
+ resolveMsg: null,
60
+ rejectMsg: '缴费记录查询失败!!!'
61
+ })
62
+ // 有缴费记录
63
+ if (res.data> 0) {
64
+ if(type=='非民用报建'||type=='设备变更'){
65
+ if(defname=='报装缴费'){
66
+ fields.forEach(item => {
67
+ if(item.label=='收费标准备注'){
68
+ this.showLabels(item.label)
69
+ }
70
+ })
71
+ }
72
+ }
73
+ //使用foreach遍历fields
74
+ if(defname=='报装缴费'){
75
+ fields.forEach(item => {
76
+ if(item.label=='收费标准备注'||item.label=='票据类型'||item.label=='报警器'||item.label=='购货单位识别号'||item.label=='购货单位名称'||item.label=='购货单位开户'||item.label=='购货单位地址电话'||item.label=='购货单位银行账号'){
77
+ this.readonlyLabels(item.label)
78
+ }else{
79
+ this.readonlyLabels(item.label)
80
+ }
81
+ })
82
+ }
83
+ }else{ //无缴费记录
84
+ if(type=='非民用报建'||type=='设备变更'){
85
+ if(defname=='报装缴费'){
86
+ fields.forEach(item => {
87
+ if(item.label=='收费标准备注'){
88
+ this.showLabels(item.label)
89
+ }
90
+ })
91
+ }
92
+ }
93
+ if(defname=='报装缴费'){
94
+ fields.forEach(item => {
95
+ if(item.label=='收费标准备注'||item.label=='票据类型'||item.label=='报警器'||item.label=='购货单位识别号'||item.label=='购货单位名称'||item.label=='购货单位开户'||item.label=='购货单位地址电话'||item.label=='购货单位银行账号'){
96
+
97
+ this.readwriteLabels(item.label)
98
+ }else{
99
+ this.readonlyLabels(item.label)
100
+ }
101
+ })
102
+ }
103
+ }
104
+ },
105
+ async refurbish () {
106
+ // fields 字段填充值
107
+ for (const item of this.selectdata.fields) {
108
+ if (!item.value) {
109
+ item.value = null
110
+ }
111
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
112
+ if (item.eval) {
113
+ item.value = eval(item.default)
114
+ } else {
115
+ item.value = item.default
116
+ }
117
+ }
118
+ if (this.selectdata[item.field]) {
119
+ // 将json字符串格式化赋值给value
120
+ if (String(this.selectdata[item.field]).startsWith("{")) {
121
+ item.value = JSON.parse(this.selectdata[item.field])
122
+ } else {
123
+ item.value = this.selectdata[item.field]
124
+ }
125
+ }
126
+ if (this.selectdata[item.field] === 0) {
127
+ item.value = 0
128
+ }
129
+
130
+ // datepicker
131
+ if (item.type === 'datepicker' && !item.value && item.default) {
132
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
133
+ }
134
+
135
+ // 如果配置类型为select,优先从参数列表获取options
136
+ if (item.type === 'select' || item.type === 'checkbox') {
137
+ if (item.param) {
138
+ let temp = this.$appdata.getParam(item.label)
139
+
140
+ if (temp && temp.length > 0) {
141
+ item.options = temp
142
+ }
143
+ if (item.paramLabel) {
144
+ temp = this.$appdata.getParam(item.paramLabel)
145
+ if (temp && temp.length > 0) {
146
+ item.options = temp
147
+ }
148
+ }
149
+ }
150
+ if (item.ready) {
151
+ item.options = await this[item.ready]()
152
+ }
153
+ }
154
+ if (item.type === 'checkbox') {
155
+ if (this.selectdata[item.field]) {
156
+ item.value = JSON.parse(this.selectdata[item.field])
157
+ } else {
158
+ item.value = []
159
+ }
160
+ }
161
+ }
162
+ // 控制组件
163
+ if (this.selectdata.components) {
164
+ this.selectdata.components.forEach(item => {
165
+ item.mark = 2
166
+ })
167
+ }
168
+ // 初始化onetomany
169
+ if (this.selectdata.onetomany) {
170
+ for (const item of this.selectdata.onetomany) {
171
+ let res = null
172
+ if (item.queryEvent) {
173
+ res = this[item.queryEvent]()
174
+ } else {
175
+ let data = {
176
+ tablename: item.tables[0],
177
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
178
+ }
179
+ res = await this.$resetpost(
180
+ 'rs/sql/applySingleTable',
181
+ {data: data},
182
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
183
+ )
184
+ }
185
+ item.rows = res.data
186
+ // 初始化onetomany中的fields
187
+ for (const field of item.fields) {
188
+ if (!field.value) {
189
+ if (field.value !== 0) {
190
+ field.value = null
191
+ }
192
+ }
193
+
194
+ if (field.default || field.default === 0) {
195
+ field.value = field.default
196
+ }
197
+
198
+ // datepicker
199
+ if (field.type === 'datepicker' && !field.value && field.default) {
200
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
201
+ }
202
+
203
+ if (field.type === 'select') {
204
+ let temp = this.$appdata.getParam(field.label)
205
+
206
+ if (temp && temp.length > 0) {
207
+ field.options = temp
208
+ }
209
+
210
+ if (field.paramLabel) {
211
+ temp = this.$appdata.getParam(field.paramLabel)
212
+ if (temp && temp.length > 0) {
213
+ item.options = temp
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
221
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
222
+ this.show_data = temp
223
+ this.$nextTick(() => {
224
+ this.showview = true
225
+ })
226
+ const defname = this.selectdata.defname
227
+ const type = this.selectdata.f_apply_type
228
+ const title=this.selectdata.title
229
+ if(title=='信息修改' ||title=='信息变更'){
230
+ this.getCheckPay(this.selectdata.fields, defname, type)
231
+ }
232
+ if( type=='非民用报建' && title=='费用调整'){
233
+ if(defname=='报装缴费'){
234
+ this.getCheckPayRecording()
235
+ if(this.recording ==1){ //收费了
236
+ this.modifData(this.selectdata.fields,0)
237
+ }
238
+ if(this.recording ==0){ //没收费
239
+ this.modifData(this.selectdata.fields,1)
240
+ }
241
+ }
242
+ }
243
+ },
244
+ // 金额转大写
245
+ smalltoBIG(n) {
246
+ let fraction = ['角', '分'];
247
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
248
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
249
+ let head = n < 0 ? '欠' : '';
250
+ n = Math.abs(n);
251
+
252
+ let s = '';
253
+
254
+ for (var i = 0; i < fraction.length; i++) {
255
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
256
+ }
257
+ s = s || '整';
258
+ n = Math.floor(n);
259
+
260
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
261
+ let p = '';
262
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
263
+ p = digit[n % 10] + unit[1][j] + p;
264
+ n = Math.floor(n / 10);
265
+ }
266
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
267
+ }
268
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
269
+ },
270
+ getLableValue(label) {
271
+ for (const item of this.show_data.fields) {
272
+ if (item.label === label && item.type !== 'number') {
273
+ return item.value || ''
274
+ }
275
+ if (item.label === label && item.type === 'number') {
276
+ return item.value || 0
277
+ }
278
+ }
279
+ },
280
+ getLableOptions(label) {
281
+ for (const item of this.show_data.fields) {
282
+ if (item.label === label) {
283
+ return item.options
284
+ }
285
+ }
286
+ },
287
+ setLabelValue(label, value) {
288
+ for (const item of this.show_data.fields) {
289
+ if (item.label === label) {
290
+ item.value = value
291
+ this.show_data[item.field] = value
292
+ }
293
+ }
294
+ },
295
+ setLabelOptions(label, options) {
296
+ for (const item of this.show_data.fields) {
297
+ if (item.label === label) {
298
+ item.options = options
299
+ }
300
+ }
301
+ },
302
+ showLabels(...labels) {
303
+ for (const item of this.show_data.fields) {
304
+ if (labels.includes(item.label)) {
305
+ item.hidden = false
306
+ }
307
+ }
308
+ },
309
+ hideLabels(...labels) {
310
+ for (const item of this.show_data.fields) {
311
+ if (labels.includes(item.label)) {
312
+ item.hidden = true
313
+ }
314
+ }
315
+ },
316
+ showButtons(...buttons) {
317
+ for (const item of this.show_data.buttons) {
318
+ if (buttons.includes(item.button_name)) {
319
+ item.hidden = false
320
+ }
321
+ }
322
+ },
323
+ hideButtons(...buttons) {
324
+ for (const item of this.show_data.buttons) {
325
+ if (buttons.includes(item.button_name)) {
326
+ item.hidden = true
327
+ }
328
+ }
329
+ },
330
+ requiredLabels(...labels) {
331
+ for (const item of this.show_data.fields) {
332
+ if (labels.includes(item.label)) {
333
+ item.required = true
334
+ }
335
+ }
336
+ },
337
+ electiveLabels(...labels) {
338
+ for (const item of this.show_data.fields) {
339
+ if (labels.includes(item.label)) {
340
+ item.required = false
341
+ }
342
+ }
343
+ },
344
+ readonlyLabels(...labels) {
345
+ for (const item of this.show_data.fields) {
346
+ if (labels.includes(item.label)) {
347
+ item.readonly = true
348
+ item.disabled = true
349
+ }
350
+ }
351
+ },
352
+ readwriteLabels(...labels) {
353
+ for (const item of this.show_data.fields) {
354
+ if (labels.includes(item.label)) {
355
+ item.readonly = false
356
+ item.disabled = false
357
+ }
358
+ }
359
+ },
360
+ disabledButtons(...buttons) {
361
+ for (const item of this.show_data.buttons) {
362
+ if (buttons.includes(item.button_name)) {
363
+ item.disabled = true
364
+ }
365
+ }
366
+ },
367
+ enableButtons(...buttons) {
368
+ for (const item of this.show_data.buttons) {
369
+ if (buttons.includes(item.button_name)) {
370
+ item.disabled = false
371
+ }
372
+ }
373
+ },
374
+ async checkDuplicate(index) {
375
+ let http = new HttpResetClass()
376
+ let data = {
377
+ tablename: 't_apply',
378
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
379
+ }
380
+ let res = await http.load('POST', 'rs/sql/applySingleTable', {data: data}, {
381
+ resolveMsg: null,
382
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
383
+ })
384
+ if (res.data.length > 0) {
385
+ this.show_data.fields[index].value = null
386
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
387
+ }
388
+ }
389
+ },
390
+ events: {
391
+ async 'stopApply' () {
392
+
393
+ let data = {
394
+ apply: this.show_data,
395
+ user: this.$login.f
396
+ }
397
+
398
+ let res = await this.$resetpost(
399
+ `rs/logic/stopApply`,
400
+ {data: data},
401
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
402
+ )
403
+
404
+ this.$dispatch('loadPage')
405
+ },
406
+ async 'pauseApply' () {
407
+
408
+ let data = {
409
+ apply: this.show_data,
410
+ user: this.$login.f
411
+ }
412
+
413
+ let res = await this.$resetpost(
414
+ `rs/logic/pauseApply`,
415
+ {data: data},
416
+ {resolveMsg: null, rejectMsg: '暂停报建失败!!!'}
417
+ )
418
+
419
+ this.$dispatch('loadPage')
420
+ },
421
+ async 'modifyInfo'() {
422
+ if(this.selectdata.title === '费用修改'){
423
+ let data = {
424
+ tablename: 't_charge_record',
425
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
426
+ }
427
+ res = await this.$resetpost(
428
+ 'rs/sql/applySingleTable',
429
+ {data: data},
430
+ {resolveMsg: null, rejectMsg: '收费信息查看'}
431
+ )
432
+ if (res.data.length > 0){
433
+ this.$showMessage('用户已缴费,无法修改!!!', ['confirm']).then((res) => {
434
+ if (res === 'confirm') {
435
+ this.$dispatch('loadPage')
436
+ }
437
+ })
438
+ throw '用户已缴费,无法修改!!!'
439
+ }else{
440
+ let datas = {
441
+ data: this.show_data,
442
+ user: this.$login.f
443
+ }
444
+ let http = new HttpResetClass()
445
+ let res = http.load('POST', 'rs/logic/modifyRecords', {data:datas}, {
446
+ resolveMsg: null,
447
+ rejectMsg: '保存修改记录失败!!!'
448
+ })
449
+ }
450
+ }
451
+ if(this.selectdata.title === '费用调整'){
452
+ let data = {
453
+ data: this.show_data,
454
+ user: this.$login.f
455
+ }
456
+ let http = new HttpResetClass()
457
+ let res = http.load('POST', 'rs/logic/modifyRecords', {data:data}, {
458
+ resolveMsg: null,
459
+ rejectMsg: '保存修改记录失败!!!'
460
+ })
461
+ }
462
+ console.log("保存数据")
463
+ let res = await this.$resetpost(
464
+ `rs/entity/t_apply`,
465
+ this.show_data,
466
+ {resolveMsg: null, rejectMsg: '数据保存失败!!!'}
467
+ )
468
+ this.$dispatch('loadPage')
469
+ },
470
+ //身份证号码校验
471
+ 'checkIdnumber' (index) {
472
+ if(this.show_data.f_credentials === '身份证'){
473
+ 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]$/
474
+ if (!verify.test(this.show_data.fields[index].value)){
475
+ this.show_data.fields[index].value = null
476
+ this.$showAlert('身份证号码格式错误请重新输入!!!', 'warning', 3000)
477
+ }
478
+ }
479
+ },
480
+ //电话号码校验
481
+ 'checkPhone' (index) {
482
+ var verify = /^([1][0-9]{10})$/
483
+ if (!verify.test(this.show_data.fields[index].value)){
484
+ this.show_data.fields[index].value = null
485
+ this.$showAlert('电话号码格式错误请重新输入!!!', 'warning', 3000)
486
+ }
487
+ },
488
+ 'applyPaperChange' (index) {
489
+ console.log("测试是否进入")
490
+ if (this.show_data.f_paper_type === '专票') {
491
+ this.requiredLabels('购货单位名称','购货单位识别号', '购货单位银行账号', '购货单位地址电话')
492
+ }else {
493
+ this.electiveLabels( '购货单位识别号', '购货单位银行账号', '购货单位地址电话')
494
+ }
495
+ },
496
+ // 获取view层button事件
497
+ async 'button' (){
498
+ console.log("保存数据")
499
+ let res = await this.$resetpost(
500
+ `rs/entity/t_apply`,
501
+ this.show_data,
502
+ {resolveMsg: null, rejectMsg: '数据保存失败!!!'}
503
+ )
504
+
505
+ this.$dispatch('loadPage')
506
+ },
507
+ // 失去焦点出触发事件
508
+ 'onchange' (index) {
509
+ },
510
+ 'onblur' (index) {},
511
+ 'oninput' (index) {},
512
+ 'initializtionView' () {},
513
+ async 'onchangeModal' (index, fieldIndex) {
514
+ },
515
+ async 'onblurModal' (index, fieldIndex) {
516
+
517
+ },
518
+ async 'oninputModal' (index, fieldIndex) {
519
+
520
+ },
521
+ async 'onetomanydelete' (index, rowIndex) {
522
+
523
+ let http = new HttpResetClass()
524
+
525
+ let res = await http.load(
526
+ 'DELETE',
527
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
528
+ null,
529
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
530
+ )
531
+
532
+ res = await this.$resetpost(
533
+ 'rs/entity/t_apply',
534
+ this.show_data
535
+ )
536
+
537
+ this.$dispatch('breakControl', this.show_data)
538
+ },
539
+ async 'onetomanyupdate' (index, rowIndex) {
540
+ let data = this.show_data.onetomany[index].rows[rowIndex]
541
+
542
+ this.show_data.onetomany[index].fields.forEach(item => {
543
+ data[item.field] = item.value
544
+ })
545
+ let res = await this.$resetpost(
546
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
547
+ data
548
+ )
549
+
550
+ res = await this.$resetpost(
551
+ 'rs/entity/t_apply',
552
+ this.show_data
553
+ )
554
+
555
+ this.$dispatch('breakControl', this.show_data)
556
+ },
557
+ async 'onetomanyadd' (index) {
558
+ let data = {
559
+ f_process_id : this.show_data.f_process_id,
560
+ f_operator_id: this.$login.f.id,
561
+ f_operator: this.$login.f.name,
562
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
563
+ f_orgid: this.$login.f.orgid,
564
+ f_orgname: this.$login.f.orgs
565
+ }
566
+ this.show_data.onetomany[index].fields.forEach(item => {
567
+ data[item.field] = item.value
568
+ })
569
+ let res = await this.$resetpost(
570
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
571
+ data
572
+ )
573
+
574
+ res = await this.$resetpost(
575
+ 'rs/entity/t_apply',
576
+ this.show_data
577
+ )
578
+
579
+ this.$dispatch('breakControl', this.show_data)
580
+ }
581
+ },
582
+ watch:{
583
+ deep: true
584
+ }
585
+ }
586
+ </script>