apply-clients 3.3.69 → 3.3.71

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 (35) hide show
  1. package/.project +17 -0
  2. package/build/dev-server.js +133 -133
  3. package/package.json +1 -1
  4. package/src/AndroidApp.vue +35 -35
  5. package/src/applyAndroid.js +31 -31
  6. package/src/components/android/AppOnetomany.vue +301 -301
  7. package/src/components/android/AppSign.vue +142 -142
  8. package/src/components/android/Function/AppInstallFunction.vue +366 -366
  9. package/src/components/android/Process/AppExplorationUser.vue +396 -402
  10. package/src/components/android/Process/AppServiceControl.vue +865 -865
  11. package/src/components/android/Process/Processes/AppBuildSign.vue +46 -46
  12. package/src/components/android/Supervisory/AppProcessSupervisory.vue +300 -300
  13. package/src/components/android/Supervisory/AppSupervisoryCart.vue +119 -119
  14. package/src/components/product/ApplyCharge/ApplyChargeList.vue +382 -382
  15. package/src/components/product/Business/BusinessApply.vue +242 -242
  16. package/src/components/product/Function/InstallFunction.vue +132 -132
  17. package/src/components/product/Function/InstallInfoSelect.vue +320 -320
  18. package/src/components/product/Function/Service/FunctionServiceControl.vue +445 -445
  19. package/src/components/product/OldApply/Monitor/MonitorApply.vue +329 -329
  20. package/src/components/product/OldApply/OldApply.vue +150 -150
  21. package/src/components/product/Onetomany.vue +377 -377
  22. package/src/components/product/Print/BuildOrder/buildOrderList.vue +264 -264
  23. package/src/components/product/Print/BuildOrder/printBuildOrder.vue +153 -153
  24. package/src/components/product/Process/ExplorationSelect.vue +452 -457
  25. package/src/components/product/Process/ExplorationUser.vue +189 -147
  26. package/src/components/product/Process/Processes/Print/printCharge.vue +142 -142
  27. package/src/components/product/Process/Processes/Print/printRefund.vue +196 -196
  28. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +211 -211
  29. package/src/components/product/Process/Service/ServiceControl.vue +1362 -1362
  30. package/src/components/product/ServiceView.vue +631 -631
  31. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +863 -863
  32. package/src/components/product/Supervisory/SupervisoryControl.vue +137 -137
  33. package/src/components/product/Supervisory/SupervisoryhCart.vue +130 -130
  34. package/src/components/product/VueUtils/ApplyUpload.vue +273 -273
  35. package/src/components/product/VueUtils/HighMeter.vue +208 -208
@@ -1,863 +1,863 @@
1
- <template>
2
- <div class="auto clearfix">
3
- <show-back-reason :selectdata="show_data"></show-back-reason>
4
- </div>
5
- <service-view v-ref:service_show :data="show_data" v-if="showview"></service-view>
6
- </template>
7
- <script>
8
- import Vue from 'vue'
9
- import {HttpResetClass} from 'vue-client'
10
- import {isEmpty} from "../../../Util";
11
- // Date格式化
12
- Date.prototype.Format = function (fmt) {
13
- var o = {
14
- 'M+': this.getMonth() + 1, // 月份
15
- 'd+': this.getDate(), // 日
16
- 'H+': this.getHours(), // 小时
17
- 'm+': this.getMinutes(), // 分
18
- 's+': this.getSeconds(), // 秒
19
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
20
- 'S': this.getMilliseconds() // 毫秒
21
- }
22
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
23
- for (var k in o) {
24
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
25
- }
26
- return fmt
27
- }
28
- export default {
29
- title: '报建监控控制层',
30
- props: {
31
- selectdata: {
32
- type: Object
33
- },
34
- nodeSnapshot: {
35
- type: Boolean,
36
- default: false
37
- }
38
- },
39
- data() {
40
- return {
41
- data: null, // 展示的数据
42
- json_datas: null, // json配置数据结构
43
- showview: false, // 控制显示层显示
44
- show_data: null,
45
- config: {}
46
- }
47
- },
48
- created () {
49
- this.refurbish()
50
- },
51
- methods: {
52
- // 初始化模块
53
- async refurbish() {
54
- this.json_datas = this.$workflow_vue
55
- let sum = 0
56
- let jsonData = {}
57
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
58
- this.$showMessage("网络故障,请刷新页面")
59
- return
60
- }
61
- this.json_datas.activitys.forEach(item => {
62
- if (this.selectdata.defname === item.title) {
63
- jsonData = item // 拿到当前节点的json配置信息
64
- sum++ // 节点名一样的个数
65
- }
66
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
67
- })
68
-
69
- if (sum === 0) {
70
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
71
- return
72
- }
73
- if (sum > 1) {
74
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
75
- return
76
- }
77
-
78
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
79
-
80
- // fields 字段填充值
81
- for (const item of this.selectdata.fields) {
82
- if (!item.value) {
83
- item.value = null
84
- }
85
-
86
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
87
- if (item.eval) {
88
- item.value = eval(item.default)
89
- } else {
90
- item.value = item.default
91
- }
92
- }
93
-
94
- if (this.selectdata[item.field]) {
95
- // 将json字符串格式化赋值给value
96
- if (String(this.selectdata[item.field]).startsWith("{")) {
97
- item.value = JSON.parse(this.selectdata[item.field])
98
- } else {
99
- item.value = this.selectdata[item.field]
100
- }
101
- }
102
- if (this.selectdata[item.field] === 0) {
103
- item.value = 0
104
- }
105
-
106
- // datepicker
107
- if (item.type === 'datepicker' && !item.value && item.default) {
108
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
109
- }
110
-
111
- // 如果配置类型为select,优先从参数列表获取options
112
- if (item.type === 'select' || item.type === 'checkbox') {
113
- if (item.param) {
114
- let temp = this.$appdata.getParam(item.label)
115
-
116
- if (temp && temp.length > 0) {
117
- item.options = temp
118
- }
119
-
120
- if (item.paramLabel) {
121
- temp = this.$appdata.getParam(item.paramLabel)
122
- if (temp && temp.length > 0) {
123
- item.options = temp
124
- }
125
- }
126
- }
127
-
128
- if (item.ready) {
129
- item.options = await this[item.ready]()
130
- }
131
- }
132
-
133
-
134
- if (item.type === 'checkbox') {
135
- if (this.selectdata[item.field]) {
136
- item.value = JSON.parse(this.selectdata[item.field])
137
- } else {
138
- item.value = []
139
- }
140
- }
141
-
142
- this.selectdata[item.field] = item.value
143
-
144
- item.readonly = true
145
- item.disabled = true
146
- }
147
-
148
- // 控制组件
149
- if (this.selectdata.components) {
150
- this.selectdata.components.forEach(item => {
151
- item.mark = 1
152
- if (item.supervisory && this[item.supervisory]()) {
153
- item.mark = 0
154
- }
155
- })
156
- }
157
-
158
- // 初始化onetomany
159
- if (this.selectdata.onetomany) {
160
- for (const item of this.selectdata.onetomany) {
161
- let res = null
162
- if (item.queryEvent) {
163
- res = this[item.queryEvent]()
164
- } else {
165
- let data = {
166
- tablename: item.tables[0],
167
- condition: `f_process_id='${this.selectdata.f_process_id}'`
168
- }
169
- res = await this.$resetpost(
170
- 'rs/sql/singleTable',
171
- {data: data},
172
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
173
- )
174
- }
175
-
176
- item.rows = res.data
177
-
178
- // 初始化onetomany中的fields
179
- for (const field of item.fields) {
180
- if (!field.value) {
181
- if (field.value !== 0) {
182
- field.value = null
183
- }
184
- }
185
-
186
- if (field.default || field.default === 0) {
187
- field.value = field.default
188
- }
189
-
190
- // datepicker
191
- if (field.type === 'datepicker' && !field.value && field.default) {
192
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
193
- }
194
-
195
- if (field.type === 'select') {
196
-
197
- let temp = this.$appdata.getParam(field.label)
198
-
199
- if (temp && temp.length > 0) {
200
- field.options = temp
201
- }
202
-
203
- if (field.paramLabel) {
204
- temp = this.$appdata.getParam(field.paramLabel)
205
- if (temp && temp.length > 0) {
206
- item.options = temp
207
- }
208
- }
209
-
210
- }
211
- }
212
-
213
- // 隐藏所有操作
214
- item.hiddenOperate = true
215
- if (item.supervisory && this[item.supervisory]()) {
216
- item.hiddenOperate = false
217
- }
218
- }
219
- }
220
-
221
- // 去除button
222
- this.selectdata.buttons = null
223
-
224
- // 完成时间和完成人,部门,分公司
225
- if (this.selectdata.state === '结束') {
226
- let http = new HttpResetClass()
227
- let res = await http.load('POST', 'rs/search', {
228
- source: 'this.getInfo()',
229
- userid: this.selectdata.userid
230
- }, {resolveMsg: null, rejectMsg: '处理人员获取失败!!!'})
231
- let user = res.data
232
- this.selectdata.operate_date = new Date(this.selectdata.finishtime).Format('yyyy-MM-dd')
233
- this.selectdata.operator = this.selectdata.person
234
- this.selectdata.orgs = user.orgs
235
- this.selectdata.parentname = user.deps
236
- }
237
-
238
- // 未结束且是下发查看指定人员
239
- if (this.selectdata.state !== '结束' && this.selectdata.actorexpression !== null && this.selectdata.actorexpression.indexOf('PI') === 0) {
240
- let http = new HttpResetClass()
241
- let res = await http.load('POST', 'rs/search', {
242
- source: 'this',
243
- userid: this.selectdata.actorexpression.substring(3, this.selectdata.actorexpression.length-1)
244
- }, {resolveMsg: null, rejectMsg: '处理人员获取失败!!!'})
245
- let user = res.data
246
- this.selectdata.operate_date = new Date().Format('yyyy-MM-dd')
247
- this.selectdata.operator = user.name
248
- this.selectdata.orgs = user.orgs
249
- this.selectdata.parentname = user.f_department_name
250
- }
251
-
252
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
253
- let temp = JSON.parse(JSON.stringify(this.selectdata))
254
-
255
- this.show_data = temp
256
- this.$nextTick(() => {
257
- this.showview = true
258
- })
259
- },
260
- // 金额转大写
261
- smalltoBIG(n) {
262
- let fraction = ['角', '分'];
263
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
264
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
265
- let head = n < 0 ? '欠' : '';
266
- n = Math.abs(n);
267
-
268
- let s = '';
269
-
270
- for (var i = 0; i < fraction.length; i++) {
271
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
272
- }
273
- s = s || '整';
274
- n = Math.floor(n);
275
-
276
- for (var i = 0; i < unit[0].length && n > 0; i++) {
277
- let p = '';
278
- for (var j = 0; j < unit[1].length && n > 0; j++) {
279
- p = digit[n % 10] + unit[1][j] + p;
280
- n = Math.floor(n / 10);
281
- }
282
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
283
- }
284
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
285
- },
286
- getLableValue(label) {
287
- for (const item of this.show_data.fields) {
288
- if (item.label === label && item.type !== 'number') {
289
- return item.value || ''
290
- }
291
- if (item.label === label && item.type === 'number') {
292
- return item.value || 0
293
- }
294
- }
295
- },
296
- getLableOptions(label) {
297
- for (const item of this.show_data.fields) {
298
- if (item.label === label) {
299
- return item.options
300
- }
301
- }
302
- },
303
- setLabelValue(label, value) {
304
- for (const item of this.show_data.fields) {
305
- if (item.label === label) {
306
- item.value = value
307
- this.show_data[item.field] = value
308
- }
309
- }
310
- },
311
- setLabelOptions(label, options) {
312
- for (const item of this.show_data.fields) {
313
- if (item.label === label) {
314
- item.options = options
315
- }
316
- }
317
- },
318
- showLabels(...labels) {
319
- for (const item of this.show_data.fields) {
320
- if (labels.includes(item.label)) {
321
- item.hidden = false
322
- }
323
- }
324
- },
325
- hideLabels(...labels) {
326
- for (const item of this.show_data.fields) {
327
- if (labels.includes(item.label)) {
328
- item.hidden = true
329
- }
330
- }
331
- },
332
- requiredLabels(...labels) {
333
- for (const item of this.show_data.fields) {
334
- if (labels.includes(item.label)) {
335
- item.required = true
336
- }
337
- }
338
- },
339
- electiveLabels(...labels) {
340
- for (const item of this.show_data.fields) {
341
- if (labels.includes(item.label)) {
342
- item.required = false
343
- }
344
- }
345
- },
346
- readonlyLabels(...labels) {
347
- for (const item of this.show_data.fields) {
348
- if (labels.includes(item.label)) {
349
- item.readonly = true
350
- item.disabled = true
351
- }
352
- }
353
- },
354
- readwriteLabels(...labels) {
355
- for (const item of this.show_data.fields) {
356
- if (labels.includes(item.label)) {
357
- item.readonly = false
358
- item.disabled = false
359
- }
360
- }
361
- },
362
- disabledButtons(...buttons) {
363
- for (const item of this.show_data.buttons) {
364
- if (buttons.includes(item.button_name)) {
365
- item.disabled = true
366
- }
367
- }
368
- },
369
- enableButtons(...buttons) {
370
- for (const item of this.show_data.buttons) {
371
- if (buttons.includes(item.button_name)) {
372
- item.disabled = false
373
- }
374
- }
375
- },
376
- showButtons(...buttons) {
377
- for (const item of this.show_data.buttons) {
378
- if (buttons.includes(item.button_name)) {
379
- item.hidden = false
380
- }
381
- }
382
- },
383
- hideButtons(...buttons) {
384
- for (const item of this.show_data.buttons) {
385
- if (buttons.includes(item.button_name)) {
386
- item.hidden = true
387
- }
388
- }
389
- },
390
- async checkDuplicate(index) {
391
- let http = new HttpResetClass()
392
- let data = {
393
- tablename: 't_apply',
394
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
395
- }
396
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
397
- resolveMsg: null,
398
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
399
- })
400
- if (res.data.length > 0) {
401
- this.show_data.fields[index].value = null
402
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
403
- }
404
- },
405
- // 获取片区
406
- async getSliceArea () {
407
- let data = {
408
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
409
- userid: this.$login.f.id
410
- }
411
-
412
- let res = await this.$resetpost(
413
- `rs/search`,
414
- {data: data},
415
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
416
- )
417
-
418
- return res.data.map(item => {
419
- return {
420
- label: item.name,
421
- value: item.name
422
- }
423
- })
424
- },
425
- // 获取区县
426
- async getPcd () {
427
- let data = {
428
- tablename: 't_pcd',
429
- condition: `f_filialeid = '${this.$login.f.orgid}'`
430
- }
431
- let res = await this.$resetpost(
432
- `rs/sql/singleTable`,
433
- {data: data},
434
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
435
- )
436
-
437
- return res.data.map(item => {
438
- return {
439
- label: item.f_pcd,
440
- value: item.f_pcd
441
- }
442
- })
443
- },
444
- // 缴费前置
445
- chargeBefore () {
446
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
447
- this.$showAlert('费用未结清!!!', 'warning', 3000)
448
- throw null
449
- }
450
- },
451
- // 施工前置
452
- async constructionBefore () {
453
- let http = new HttpResetClass()
454
- let data = {
455
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
456
- }
457
- let res = await http.load(
458
- 'POST',
459
- 'rs/sql/countApplyUserinfo',
460
- {data: data},
461
- {
462
- resolveMsg: null,
463
- rejectMsg: '安装明细查询失败!!!'
464
- })
465
- if (res.data[0].num > 0) {
466
- this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
467
- throw `还有${res.data[0].num}户未安装,无法提交`
468
- }
469
- },
470
- changePipeBuild () {
471
- if (this.selectdata.f_process_dep === '工程部') {
472
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
473
- }
474
- if (this.selectdata.f_process_dep === '运营部') {
475
- return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
476
- }
477
- },
478
- async getDevInfo () {
479
- let data = {
480
- tablename: 't_dev_info',
481
- condition: `f_orgid = '${this.$login.f.orgid}'`
482
- }
483
- let res = await this.$resetpost(
484
- `rs/sql/singleTable`,
485
- {data: data},
486
- {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
487
- )
488
-
489
- return res.data.map(item => {
490
- return {
491
- label: item.f_dev_name,
492
- value: item.f_dev_name
493
- }
494
- })
495
- },
496
- async getPrice (f_price_id) {
497
- console.log('=======================')
498
- console.log(f_price_id)
499
-
500
- let data = {
501
- condition: `sp.f_orgid = '${this.$login.f.orgid}'`
502
- }
503
-
504
- if (!isEmpty(f_price_id)) {
505
- data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
506
- }
507
- let http = new HttpResetClass()
508
- let res = await http.load(
509
- 'POST',
510
- `rs/sql/applyGetPrice`,
511
- {data: data},
512
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
513
- )
514
-
515
- return res.data.map(item => {
516
- return {
517
- label: item.f_price_name,
518
- value: item
519
- }
520
- })
521
- },
522
- materialSupervisory () {
523
- if (this.selectdata.userid === this.$login.f.id) {
524
- return true
525
- }
526
- return false
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
-
542
- return res.data.map(item => {
543
- return {
544
- label: item.name,
545
- value: item.id
546
- }
547
- })
548
- }
549
- },
550
- events:{
551
- 'complyInstallation' (index) {
552
- if (this.show_data.f_is_have === '否') {
553
- this.hideButtons('提交', '出图', '缴费')
554
- this.showButtons('终止')
555
- }
556
- if (this.show_data.f_is_have === '是') {
557
- this.hideButtons('终止')
558
- this.showButtons('提交', '出图', '缴费')
559
- }
560
- },
561
- // 选择材料
562
- async materialNameChenge (index, fieldIndex) {
563
- let material = this.show_data.onetomany[index].fields[fieldIndex].value
564
-
565
- this.show_data.onetomany[index].fields.forEach(item => {
566
- if (material[item.field]) {
567
- item.value = material[item.field]
568
- }
569
- })
570
- },
571
- // 打开模态框获取材料
572
- async 'getMaterialName' (index) {
573
- let data = {
574
- condition: `1=1`
575
- }
576
- let http = new HttpResetClass()
577
- let res = await http.load(
578
- 'POST',
579
- `rs/sql/getStockMaterial`,
580
- {data: data},
581
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
582
- )
583
-
584
- this.show_data.onetomany[index].fields.forEach(field => {
585
- if (field.label === '选择材料') {
586
- field.options = res.data.map(item => {
587
- return {
588
- 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
589
- 'value': item
590
- }
591
- })
592
- }
593
- })
594
- },
595
- // 终止报建初始化·
596
- async 'stopApplyReadyEvent' () {
597
-
598
- let f_is_stop = this.getLableValue('是否终止')
599
-
600
- for (const item of this.show_data.fields) {
601
- if (f_is_stop === '是') {
602
- if (item.label === '终止原因') {
603
- item.hidden = false
604
- item.required = true
605
- }
606
- } else {
607
- if (item.label === '终止原因') {
608
- item.hidden = true
609
- item.required = false
610
- }
611
- }
612
- }
613
-
614
- if (isEmpty(this.show_data.f_parent_process_id)) {
615
- return
616
- }
617
- let data = {
618
- condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
619
- data: {
620
- id: this.$login.f.id,
621
- orgid: this.$login.f.orgid
622
- }
623
- }
624
- let res = await this.$resetpost(
625
- `rs/sql/supervisory`,
626
- {data: data},
627
- {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
628
- )
629
- this.show_data.parentApply = res.data[0]
630
- },
631
- // 通气点火初始化
632
- async 'gasReadyEvent' () {
633
- if (!isEmpty(this.show_data.f_price_id)) {
634
- let priceList = await this.getPrice(this.show_data.f_price_id)
635
- this.setLabelValue('气价名称', priceList[0].value)
636
- }
637
-
638
-
639
- // 保险初始化显示内容
640
- let f_is_insure = this.getLableValue('是否购买保险')
641
- for (const item of this.show_data.fields) {
642
- if (f_is_insure === '是') {
643
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
644
- item.hidden = false
645
- item.required = true
646
- }
647
- if (item.label === '保险备注') {
648
- item.hidden = false
649
- }
650
- } else {
651
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
652
- item.hidden = true
653
- item.required = false
654
- }
655
- if (item.label === '保险备注') {
656
- item.hidden = true
657
- }
658
- }
659
- }
660
- },
661
- // 申请节点初始化
662
- 'applyReadyEvent' () {
663
- this.$getConfig(this, 'UserAddress')
664
-
665
- let f_address_type = this.show_data.f_address_type
666
-
667
- for (const item of this.show_data.fields) {
668
- if (f_address_type === '民用市区') {
669
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
670
- item.hidden = false
671
- item.required = true
672
- }
673
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
674
- item.hidden = false
675
- item.required = false
676
- }
677
- if (item.label === '地址') {
678
- item.readonly = true
679
- }
680
- }
681
- if (f_address_type === '民用乡镇') {
682
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
683
- item.hidden = false
684
- item.required = true
685
- }
686
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
687
- item.hidden = false
688
- item.required = false
689
- }
690
- if (item.label === '楼层') {
691
- item.hidden = true
692
- item.required = false
693
- }
694
- if (item.label === '地址') {
695
- item.readonly = true
696
- }
697
- }
698
- if (f_address_type === '特殊地址') {
699
- if (item.label === '区/县' || item.label === '街道/乡镇') {
700
- item.hidden = false
701
- item.required = true
702
- }
703
- if (item.label === '集收单位') {
704
- item.hidden = false
705
- item.required = false
706
- }
707
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
708
- item.hidden = true
709
- item.required = false
710
- }
711
- if (item.label === '地址') {
712
- item.readonly = false
713
- }
714
- }
715
-
716
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
717
- item.hidden = true
718
- }
719
- }
720
- },
721
- // 失去焦点出触发事件
722
- 'onchange' (index) {
723
- if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
724
- if (
725
- this.show_data.fields[index].label === '区/县' ||
726
- this.show_data.fields[index].label === '街道/乡镇' ||
727
- this.show_data.fields[index].label === '集收单位' ||
728
- this.show_data.fields[index].label === '楼号/组' ||
729
- this.show_data.fields[index].label === '单元/排' ||
730
- this.show_data.fields[index].label === '楼层' ||
731
- this.show_data.fields[index].label === '门牌号'
732
- ) {
733
-
734
- let f_pcd = this.getLableValue('区/县') || ''
735
- let f_street = this.getLableValue('街道/乡镇') || ''
736
- let f_residential_area = this.getLableValue('集收单位') || ''
737
- let f_building = this.getLableValue('楼号/组') || ''
738
- let f_building_suffix = f_building ? this.config.f_building_suffix : ''
739
- let f_unit = this.getLableValue('单元/排') || ''
740
- let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
741
- let f_floor = this.getLableValue('楼层') || ''
742
- let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
743
- let f_room = this.getLableValue('门牌号') || ''
744
- let f_room_suffix = f_room ? this.config.f_room_suffix : ''
745
-
746
- let f_address = f_pcd + f_street + f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
747
- this.setLabelValue("地址", f_address)
748
- }
749
- }
750
- },
751
- // =============================
752
- selectSearch (val, index) {},
753
- 'onblur' (index) {},
754
- 'oninput' (index) {},
755
- 'initializtionView' () {},
756
- async 'onchangeModal' (index, fieldIndex) {
757
- },
758
- async 'onblurModal' (index, fieldIndex) {
759
-
760
- },
761
- async 'oninputModal' (index, fieldIndex) {
762
-
763
- },
764
- async 'onetomanydelete' (index, rowIndex) {
765
-
766
- let http = new HttpResetClass()
767
-
768
- let res = await http.load(
769
- 'DELETE',
770
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
771
- null,
772
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
773
- )
774
-
775
- res = await this.$resetpost(
776
- 'rs/entity/t_apply',
777
- this.show_data
778
- )
779
-
780
- this.$dispatch('breakControl', this.show_data)
781
- },
782
- async 'onetomanyupdate' (index, rowIndex) {
783
- let data = this.show_data.onetomany[index].rows[rowIndex]
784
-
785
- this.show_data.onetomany[index].fields.forEach(item => {
786
- data[item.field] = item.value
787
- })
788
- let res = await this.$resetpost(
789
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
790
- data
791
- )
792
-
793
- res = await this.$resetpost(
794
- 'rs/entity/t_apply',
795
- this.show_data
796
- )
797
-
798
- this.$dispatch('breakControl', this.show_data)
799
- },
800
- async 'onetomanyadd' (index) {
801
- let data = {
802
- f_process_id : this.show_data.f_process_id,
803
- f_operator_id: this.$login.f.id,
804
- f_operator: this.$login.f.name,
805
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
806
- f_orgid: this.$login.f.orgid,
807
- f_orgname: this.$login.f.orgs
808
- }
809
- this.show_data.onetomany[index].fields.forEach(item => {
810
- data[item.field] = item.value
811
- })
812
- let res = await this.$resetpost(
813
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
814
- data
815
- )
816
-
817
- res = await this.$resetpost(
818
- 'rs/entity/t_apply',
819
- this.show_data
820
- )
821
-
822
- this.$dispatch('breakControl', this.show_data)
823
- },
824
- async 'importEvent' (index, table, configName, filepath) {
825
- let data = {
826
- selectdata: this.show_data,
827
- table: table,
828
- filepath: filepath,
829
- configName: configName,
830
- user: this.$login.f
831
- }
832
-
833
- let res = await this.$resetpost(
834
- `rs/logic/importEvent`,
835
- data
836
- )
837
-
838
- this.$dispatch('breakControl', this.show_data)
839
- },
840
- 'onbutchange' (index) {
841
-
842
- },
843
- 'onbutblur' (index) {
844
-
845
- },
846
- 'onbutinput' (index) {
847
-
848
- }
849
- },
850
- watch: {
851
- deep: true
852
- }
853
- }
854
- </script>
855
- <style scoped>
856
- /*清除model中的浮动*/
857
- .clearfix:after,.clearfix:before{
858
- display: table;
859
- }
860
- .clearfix:after{
861
- clear: both;
862
- }
863
- </style>
1
+ <template>
2
+ <div class="auto clearfix">
3
+ <show-back-reason :selectdata="show_data"></show-back-reason>
4
+ </div>
5
+ <service-view v-ref:service_show :data="show_data" v-if="showview"></service-view>
6
+ </template>
7
+ <script>
8
+ import Vue from 'vue'
9
+ import {HttpResetClass} from 'vue-client'
10
+ import {isEmpty} from "../../../Util";
11
+ // Date格式化
12
+ Date.prototype.Format = function (fmt) {
13
+ var o = {
14
+ 'M+': this.getMonth() + 1, // 月份
15
+ 'd+': this.getDate(), // 日
16
+ 'H+': this.getHours(), // 小时
17
+ 'm+': this.getMinutes(), // 分
18
+ 's+': this.getSeconds(), // 秒
19
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
20
+ 'S': this.getMilliseconds() // 毫秒
21
+ }
22
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
23
+ for (var k in o) {
24
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
25
+ }
26
+ return fmt
27
+ }
28
+ export default {
29
+ title: '报建监控控制层',
30
+ props: {
31
+ selectdata: {
32
+ type: Object
33
+ },
34
+ nodeSnapshot: {
35
+ type: Boolean,
36
+ default: false
37
+ }
38
+ },
39
+ data() {
40
+ return {
41
+ data: null, // 展示的数据
42
+ json_datas: null, // json配置数据结构
43
+ showview: false, // 控制显示层显示
44
+ show_data: null,
45
+ config: {}
46
+ }
47
+ },
48
+ created () {
49
+ this.refurbish()
50
+ },
51
+ methods: {
52
+ // 初始化模块
53
+ async refurbish() {
54
+ this.json_datas = this.$workflow_vue
55
+ let sum = 0
56
+ let jsonData = {}
57
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
58
+ this.$showMessage("网络故障,请刷新页面")
59
+ return
60
+ }
61
+ this.json_datas.activitys.forEach(item => {
62
+ if (this.selectdata.defname === item.title) {
63
+ jsonData = item // 拿到当前节点的json配置信息
64
+ sum++ // 节点名一样的个数
65
+ }
66
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
67
+ })
68
+
69
+ if (sum === 0) {
70
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
71
+ return
72
+ }
73
+ if (sum > 1) {
74
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
75
+ return
76
+ }
77
+
78
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
79
+
80
+ // fields 字段填充值
81
+ for (const item of this.selectdata.fields) {
82
+ if (!item.value) {
83
+ item.value = null
84
+ }
85
+
86
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
87
+ if (item.eval) {
88
+ item.value = eval(item.default)
89
+ } else {
90
+ item.value = item.default
91
+ }
92
+ }
93
+
94
+ if (this.selectdata[item.field]) {
95
+ // 将json字符串格式化赋值给value
96
+ if (String(this.selectdata[item.field]).startsWith("{")) {
97
+ item.value = JSON.parse(this.selectdata[item.field])
98
+ } else {
99
+ item.value = this.selectdata[item.field]
100
+ }
101
+ }
102
+ if (this.selectdata[item.field] === 0) {
103
+ item.value = 0
104
+ }
105
+
106
+ // datepicker
107
+ if (item.type === 'datepicker' && !item.value && item.default) {
108
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
109
+ }
110
+
111
+ // 如果配置类型为select,优先从参数列表获取options
112
+ if (item.type === 'select' || item.type === 'checkbox') {
113
+ if (item.param) {
114
+ let temp = this.$appdata.getParam(item.label)
115
+
116
+ if (temp && temp.length > 0) {
117
+ item.options = temp
118
+ }
119
+
120
+ if (item.paramLabel) {
121
+ temp = this.$appdata.getParam(item.paramLabel)
122
+ if (temp && temp.length > 0) {
123
+ item.options = temp
124
+ }
125
+ }
126
+ }
127
+
128
+ if (item.ready) {
129
+ item.options = await this[item.ready]()
130
+ }
131
+ }
132
+
133
+
134
+ if (item.type === 'checkbox') {
135
+ if (this.selectdata[item.field]) {
136
+ item.value = JSON.parse(this.selectdata[item.field])
137
+ } else {
138
+ item.value = []
139
+ }
140
+ }
141
+
142
+ this.selectdata[item.field] = item.value
143
+
144
+ item.readonly = true
145
+ item.disabled = true
146
+ }
147
+
148
+ // 控制组件
149
+ if (this.selectdata.components) {
150
+ this.selectdata.components.forEach(item => {
151
+ item.mark = 1
152
+ if (item.supervisory && this[item.supervisory]()) {
153
+ item.mark = 0
154
+ }
155
+ })
156
+ }
157
+
158
+ // 初始化onetomany
159
+ if (this.selectdata.onetomany) {
160
+ for (const item of this.selectdata.onetomany) {
161
+ let res = null
162
+ if (item.queryEvent) {
163
+ res = this[item.queryEvent]()
164
+ } else {
165
+ let data = {
166
+ tablename: item.tables[0],
167
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
168
+ }
169
+ res = await this.$resetpost(
170
+ 'rs/sql/singleTable',
171
+ {data: data},
172
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
173
+ )
174
+ }
175
+
176
+ item.rows = res.data
177
+
178
+ // 初始化onetomany中的fields
179
+ for (const field of item.fields) {
180
+ if (!field.value) {
181
+ if (field.value !== 0) {
182
+ field.value = null
183
+ }
184
+ }
185
+
186
+ if (field.default || field.default === 0) {
187
+ field.value = field.default
188
+ }
189
+
190
+ // datepicker
191
+ if (field.type === 'datepicker' && !field.value && field.default) {
192
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
193
+ }
194
+
195
+ if (field.type === 'select') {
196
+
197
+ let temp = this.$appdata.getParam(field.label)
198
+
199
+ if (temp && temp.length > 0) {
200
+ field.options = temp
201
+ }
202
+
203
+ if (field.paramLabel) {
204
+ temp = this.$appdata.getParam(field.paramLabel)
205
+ if (temp && temp.length > 0) {
206
+ item.options = temp
207
+ }
208
+ }
209
+
210
+ }
211
+ }
212
+
213
+ // 隐藏所有操作
214
+ item.hiddenOperate = true
215
+ if (item.supervisory && this[item.supervisory]()) {
216
+ item.hiddenOperate = false
217
+ }
218
+ }
219
+ }
220
+
221
+ // 去除button
222
+ this.selectdata.buttons = null
223
+
224
+ // 完成时间和完成人,部门,分公司
225
+ if (this.selectdata.state === '结束') {
226
+ let http = new HttpResetClass()
227
+ let res = await http.load('POST', 'rs/search', {
228
+ source: 'this.getInfo()',
229
+ userid: this.selectdata.userid
230
+ }, {resolveMsg: null, rejectMsg: '处理人员获取失败!!!'})
231
+ let user = res.data
232
+ this.selectdata.operate_date = new Date(this.selectdata.finishtime).Format('yyyy-MM-dd')
233
+ this.selectdata.operator = this.selectdata.person
234
+ this.selectdata.orgs = user.orgs
235
+ this.selectdata.parentname = user.deps
236
+ }
237
+
238
+ // 未结束且是下发查看指定人员
239
+ if (this.selectdata.state !== '结束' && this.selectdata.actorexpression !== null && this.selectdata.actorexpression.indexOf('PI') === 0) {
240
+ let http = new HttpResetClass()
241
+ let res = await http.load('POST', 'rs/search', {
242
+ source: 'this',
243
+ userid: this.selectdata.actorexpression.substring(3, this.selectdata.actorexpression.length-1)
244
+ }, {resolveMsg: null, rejectMsg: '处理人员获取失败!!!'})
245
+ let user = res.data
246
+ this.selectdata.operate_date = new Date().Format('yyyy-MM-dd')
247
+ this.selectdata.operator = user.name
248
+ this.selectdata.orgs = user.orgs
249
+ this.selectdata.parentname = user.f_department_name
250
+ }
251
+
252
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
253
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
254
+
255
+ this.show_data = temp
256
+ this.$nextTick(() => {
257
+ this.showview = true
258
+ })
259
+ },
260
+ // 金额转大写
261
+ smalltoBIG(n) {
262
+ let fraction = ['角', '分'];
263
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
264
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
265
+ let head = n < 0 ? '欠' : '';
266
+ n = Math.abs(n);
267
+
268
+ let s = '';
269
+
270
+ for (var i = 0; i < fraction.length; i++) {
271
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
272
+ }
273
+ s = s || '整';
274
+ n = Math.floor(n);
275
+
276
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
277
+ let p = '';
278
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
279
+ p = digit[n % 10] + unit[1][j] + p;
280
+ n = Math.floor(n / 10);
281
+ }
282
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
283
+ }
284
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
285
+ },
286
+ getLableValue(label) {
287
+ for (const item of this.show_data.fields) {
288
+ if (item.label === label && item.type !== 'number') {
289
+ return item.value || ''
290
+ }
291
+ if (item.label === label && item.type === 'number') {
292
+ return item.value || 0
293
+ }
294
+ }
295
+ },
296
+ getLableOptions(label) {
297
+ for (const item of this.show_data.fields) {
298
+ if (item.label === label) {
299
+ return item.options
300
+ }
301
+ }
302
+ },
303
+ setLabelValue(label, value) {
304
+ for (const item of this.show_data.fields) {
305
+ if (item.label === label) {
306
+ item.value = value
307
+ this.show_data[item.field] = value
308
+ }
309
+ }
310
+ },
311
+ setLabelOptions(label, options) {
312
+ for (const item of this.show_data.fields) {
313
+ if (item.label === label) {
314
+ item.options = options
315
+ }
316
+ }
317
+ },
318
+ showLabels(...labels) {
319
+ for (const item of this.show_data.fields) {
320
+ if (labels.includes(item.label)) {
321
+ item.hidden = false
322
+ }
323
+ }
324
+ },
325
+ hideLabels(...labels) {
326
+ for (const item of this.show_data.fields) {
327
+ if (labels.includes(item.label)) {
328
+ item.hidden = true
329
+ }
330
+ }
331
+ },
332
+ requiredLabels(...labels) {
333
+ for (const item of this.show_data.fields) {
334
+ if (labels.includes(item.label)) {
335
+ item.required = true
336
+ }
337
+ }
338
+ },
339
+ electiveLabels(...labels) {
340
+ for (const item of this.show_data.fields) {
341
+ if (labels.includes(item.label)) {
342
+ item.required = false
343
+ }
344
+ }
345
+ },
346
+ readonlyLabels(...labels) {
347
+ for (const item of this.show_data.fields) {
348
+ if (labels.includes(item.label)) {
349
+ item.readonly = true
350
+ item.disabled = true
351
+ }
352
+ }
353
+ },
354
+ readwriteLabels(...labels) {
355
+ for (const item of this.show_data.fields) {
356
+ if (labels.includes(item.label)) {
357
+ item.readonly = false
358
+ item.disabled = false
359
+ }
360
+ }
361
+ },
362
+ disabledButtons(...buttons) {
363
+ for (const item of this.show_data.buttons) {
364
+ if (buttons.includes(item.button_name)) {
365
+ item.disabled = true
366
+ }
367
+ }
368
+ },
369
+ enableButtons(...buttons) {
370
+ for (const item of this.show_data.buttons) {
371
+ if (buttons.includes(item.button_name)) {
372
+ item.disabled = false
373
+ }
374
+ }
375
+ },
376
+ showButtons(...buttons) {
377
+ for (const item of this.show_data.buttons) {
378
+ if (buttons.includes(item.button_name)) {
379
+ item.hidden = false
380
+ }
381
+ }
382
+ },
383
+ hideButtons(...buttons) {
384
+ for (const item of this.show_data.buttons) {
385
+ if (buttons.includes(item.button_name)) {
386
+ item.hidden = true
387
+ }
388
+ }
389
+ },
390
+ async checkDuplicate(index) {
391
+ let http = new HttpResetClass()
392
+ let data = {
393
+ tablename: 't_apply',
394
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
395
+ }
396
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
397
+ resolveMsg: null,
398
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
399
+ })
400
+ if (res.data.length > 0) {
401
+ this.show_data.fields[index].value = null
402
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
403
+ }
404
+ },
405
+ // 获取片区
406
+ async getSliceArea () {
407
+ let data = {
408
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
409
+ userid: this.$login.f.id
410
+ }
411
+
412
+ let res = await this.$resetpost(
413
+ `rs/search`,
414
+ {data: data},
415
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
416
+ )
417
+
418
+ return res.data.map(item => {
419
+ return {
420
+ label: item.name,
421
+ value: item.name
422
+ }
423
+ })
424
+ },
425
+ // 获取区县
426
+ async getPcd () {
427
+ let data = {
428
+ tablename: 't_pcd',
429
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
430
+ }
431
+ let res = await this.$resetpost(
432
+ `rs/sql/singleTable`,
433
+ {data: data},
434
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
435
+ )
436
+
437
+ return res.data.map(item => {
438
+ return {
439
+ label: item.f_pcd,
440
+ value: item.f_pcd
441
+ }
442
+ })
443
+ },
444
+ // 缴费前置
445
+ chargeBefore () {
446
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
447
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
448
+ throw null
449
+ }
450
+ },
451
+ // 施工前置
452
+ async constructionBefore () {
453
+ let http = new HttpResetClass()
454
+ let data = {
455
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
456
+ }
457
+ let res = await http.load(
458
+ 'POST',
459
+ 'rs/sql/countApplyUserinfo',
460
+ {data: data},
461
+ {
462
+ resolveMsg: null,
463
+ rejectMsg: '安装明细查询失败!!!'
464
+ })
465
+ if (res.data[0].num > 0) {
466
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
467
+ throw `还有${res.data[0].num}户未安装,无法提交`
468
+ }
469
+ },
470
+ changePipeBuild () {
471
+ if (this.selectdata.f_process_dep === '工程部') {
472
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
473
+ }
474
+ if (this.selectdata.f_process_dep === '运营部') {
475
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
476
+ }
477
+ },
478
+ async getDevInfo () {
479
+ let data = {
480
+ tablename: 't_dev_info',
481
+ condition: `f_orgid = '${this.$login.f.orgid}'`
482
+ }
483
+ let res = await this.$resetpost(
484
+ `rs/sql/singleTable`,
485
+ {data: data},
486
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
487
+ )
488
+
489
+ return res.data.map(item => {
490
+ return {
491
+ label: item.f_dev_name,
492
+ value: item.f_dev_name
493
+ }
494
+ })
495
+ },
496
+ async getPrice (f_price_id) {
497
+ console.log('=======================')
498
+ console.log(f_price_id)
499
+
500
+ let data = {
501
+ condition: `sp.f_orgid = '${this.$login.f.orgid}'`
502
+ }
503
+
504
+ if (!isEmpty(f_price_id)) {
505
+ data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
506
+ }
507
+ let http = new HttpResetClass()
508
+ let res = await http.load(
509
+ 'POST',
510
+ `rs/sql/applyGetPrice`,
511
+ {data: data},
512
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
513
+ )
514
+
515
+ return res.data.map(item => {
516
+ return {
517
+ label: item.f_price_name,
518
+ value: item
519
+ }
520
+ })
521
+ },
522
+ materialSupervisory () {
523
+ if (this.selectdata.userid === this.$login.f.id) {
524
+ return true
525
+ }
526
+ return false
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
+
542
+ return res.data.map(item => {
543
+ return {
544
+ label: item.name,
545
+ value: item.id
546
+ }
547
+ })
548
+ }
549
+ },
550
+ events:{
551
+ 'complyInstallation' (index) {
552
+ if (this.show_data.f_is_have === '否') {
553
+ this.hideButtons('提交', '出图', '缴费')
554
+ this.showButtons('终止')
555
+ }
556
+ if (this.show_data.f_is_have === '是') {
557
+ this.hideButtons('终止')
558
+ this.showButtons('提交', '出图', '缴费')
559
+ }
560
+ },
561
+ // 选择材料
562
+ async materialNameChenge (index, fieldIndex) {
563
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
564
+
565
+ this.show_data.onetomany[index].fields.forEach(item => {
566
+ if (material[item.field]) {
567
+ item.value = material[item.field]
568
+ }
569
+ })
570
+ },
571
+ // 打开模态框获取材料
572
+ async 'getMaterialName' (index) {
573
+ let data = {
574
+ condition: `1=1`
575
+ }
576
+ let http = new HttpResetClass()
577
+ let res = await http.load(
578
+ 'POST',
579
+ `rs/sql/getStockMaterial`,
580
+ {data: data},
581
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
582
+ )
583
+
584
+ this.show_data.onetomany[index].fields.forEach(field => {
585
+ if (field.label === '选择材料') {
586
+ field.options = res.data.map(item => {
587
+ return {
588
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
589
+ 'value': item
590
+ }
591
+ })
592
+ }
593
+ })
594
+ },
595
+ // 终止报建初始化·
596
+ async 'stopApplyReadyEvent' () {
597
+
598
+ let f_is_stop = this.getLableValue('是否终止')
599
+
600
+ for (const item of this.show_data.fields) {
601
+ if (f_is_stop === '是') {
602
+ if (item.label === '终止原因') {
603
+ item.hidden = false
604
+ item.required = true
605
+ }
606
+ } else {
607
+ if (item.label === '终止原因') {
608
+ item.hidden = true
609
+ item.required = false
610
+ }
611
+ }
612
+ }
613
+
614
+ if (isEmpty(this.show_data.f_parent_process_id)) {
615
+ return
616
+ }
617
+ let data = {
618
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
619
+ data: {
620
+ id: this.$login.f.id,
621
+ orgid: this.$login.f.orgid
622
+ }
623
+ }
624
+ let res = await this.$resetpost(
625
+ `rs/sql/supervisory`,
626
+ {data: data},
627
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
628
+ )
629
+ this.show_data.parentApply = res.data[0]
630
+ },
631
+ // 通气点火初始化
632
+ async 'gasReadyEvent' () {
633
+ if (!isEmpty(this.show_data.f_price_id)) {
634
+ let priceList = await this.getPrice(this.show_data.f_price_id)
635
+ this.setLabelValue('气价名称', priceList[0].value)
636
+ }
637
+
638
+
639
+ // 保险初始化显示内容
640
+ let f_is_insure = this.getLableValue('是否购买保险')
641
+ for (const item of this.show_data.fields) {
642
+ if (f_is_insure === '是') {
643
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
644
+ item.hidden = false
645
+ item.required = true
646
+ }
647
+ if (item.label === '保险备注') {
648
+ item.hidden = false
649
+ }
650
+ } else {
651
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
652
+ item.hidden = true
653
+ item.required = false
654
+ }
655
+ if (item.label === '保险备注') {
656
+ item.hidden = true
657
+ }
658
+ }
659
+ }
660
+ },
661
+ // 申请节点初始化
662
+ 'applyReadyEvent' () {
663
+ this.$getConfig(this, 'UserAddress')
664
+
665
+ let f_address_type = this.show_data.f_address_type
666
+
667
+ for (const item of this.show_data.fields) {
668
+ if (f_address_type === '民用市区') {
669
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
670
+ item.hidden = false
671
+ item.required = true
672
+ }
673
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
674
+ item.hidden = false
675
+ item.required = false
676
+ }
677
+ if (item.label === '地址') {
678
+ item.readonly = true
679
+ }
680
+ }
681
+ if (f_address_type === '民用乡镇') {
682
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
683
+ item.hidden = false
684
+ item.required = true
685
+ }
686
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
687
+ item.hidden = false
688
+ item.required = false
689
+ }
690
+ if (item.label === '楼层') {
691
+ item.hidden = true
692
+ item.required = false
693
+ }
694
+ if (item.label === '地址') {
695
+ item.readonly = true
696
+ }
697
+ }
698
+ if (f_address_type === '特殊地址') {
699
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
700
+ item.hidden = false
701
+ item.required = true
702
+ }
703
+ if (item.label === '集收单位') {
704
+ item.hidden = false
705
+ item.required = false
706
+ }
707
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
708
+ item.hidden = true
709
+ item.required = false
710
+ }
711
+ if (item.label === '地址') {
712
+ item.readonly = false
713
+ }
714
+ }
715
+
716
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
717
+ item.hidden = true
718
+ }
719
+ }
720
+ },
721
+ // 失去焦点出触发事件
722
+ 'onchange' (index) {
723
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
724
+ if (
725
+ this.show_data.fields[index].label === '区/县' ||
726
+ this.show_data.fields[index].label === '街道/乡镇' ||
727
+ this.show_data.fields[index].label === '集收单位' ||
728
+ this.show_data.fields[index].label === '楼号/组' ||
729
+ this.show_data.fields[index].label === '单元/排' ||
730
+ this.show_data.fields[index].label === '楼层' ||
731
+ this.show_data.fields[index].label === '门牌号'
732
+ ) {
733
+
734
+ let f_pcd = this.getLableValue('区/县') || ''
735
+ let f_street = this.getLableValue('街道/乡镇') || ''
736
+ let f_residential_area = this.getLableValue('集收单位') || ''
737
+ let f_building = this.getLableValue('楼号/组') || ''
738
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
739
+ let f_unit = this.getLableValue('单元/排') || ''
740
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
741
+ let f_floor = this.getLableValue('楼层') || ''
742
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
743
+ let f_room = this.getLableValue('门牌号') || ''
744
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
745
+
746
+ let f_address = f_pcd + f_street + f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
747
+ this.setLabelValue("地址", f_address)
748
+ }
749
+ }
750
+ },
751
+ // =============================
752
+ selectSearch (val, index) {},
753
+ 'onblur' (index) {},
754
+ 'oninput' (index) {},
755
+ 'initializtionView' () {},
756
+ async 'onchangeModal' (index, fieldIndex) {
757
+ },
758
+ async 'onblurModal' (index, fieldIndex) {
759
+
760
+ },
761
+ async 'oninputModal' (index, fieldIndex) {
762
+
763
+ },
764
+ async 'onetomanydelete' (index, rowIndex) {
765
+
766
+ let http = new HttpResetClass()
767
+
768
+ let res = await http.load(
769
+ 'DELETE',
770
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
771
+ null,
772
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
773
+ )
774
+
775
+ res = await this.$resetpost(
776
+ 'rs/entity/t_apply',
777
+ this.show_data
778
+ )
779
+
780
+ this.$dispatch('breakControl', this.show_data)
781
+ },
782
+ async 'onetomanyupdate' (index, rowIndex) {
783
+ let data = this.show_data.onetomany[index].rows[rowIndex]
784
+
785
+ this.show_data.onetomany[index].fields.forEach(item => {
786
+ data[item.field] = item.value
787
+ })
788
+ let res = await this.$resetpost(
789
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
790
+ data
791
+ )
792
+
793
+ res = await this.$resetpost(
794
+ 'rs/entity/t_apply',
795
+ this.show_data
796
+ )
797
+
798
+ this.$dispatch('breakControl', this.show_data)
799
+ },
800
+ async 'onetomanyadd' (index) {
801
+ let data = {
802
+ f_process_id : this.show_data.f_process_id,
803
+ f_operator_id: this.$login.f.id,
804
+ f_operator: this.$login.f.name,
805
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
806
+ f_orgid: this.$login.f.orgid,
807
+ f_orgname: this.$login.f.orgs
808
+ }
809
+ this.show_data.onetomany[index].fields.forEach(item => {
810
+ data[item.field] = item.value
811
+ })
812
+ let res = await this.$resetpost(
813
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
814
+ data
815
+ )
816
+
817
+ res = await this.$resetpost(
818
+ 'rs/entity/t_apply',
819
+ this.show_data
820
+ )
821
+
822
+ this.$dispatch('breakControl', this.show_data)
823
+ },
824
+ async 'importEvent' (index, table, configName, filepath) {
825
+ let data = {
826
+ selectdata: this.show_data,
827
+ table: table,
828
+ filepath: filepath,
829
+ configName: configName,
830
+ user: this.$login.f
831
+ }
832
+
833
+ let res = await this.$resetpost(
834
+ `rs/logic/importEvent`,
835
+ data
836
+ )
837
+
838
+ this.$dispatch('breakControl', this.show_data)
839
+ },
840
+ 'onbutchange' (index) {
841
+
842
+ },
843
+ 'onbutblur' (index) {
844
+
845
+ },
846
+ 'onbutinput' (index) {
847
+
848
+ }
849
+ },
850
+ watch: {
851
+ deep: true
852
+ }
853
+ }
854
+ </script>
855
+ <style scoped>
856
+ /*清除model中的浮动*/
857
+ .clearfix:after,.clearfix:before{
858
+ display: table;
859
+ }
860
+ .clearfix:after{
861
+ clear: both;
862
+ }
863
+ </style>