apply-clients 3.5.4-66 → 3.5.4-67

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