apply-clients 3.5.4-69 → 3.5.4-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 (45) hide show
  1. package/build/dev-server.js +7 -15
  2. package/package.json +1 -1
  3. package/src/App.vue +25 -25
  4. package/src/components/product/Material/MaterialDetailed.vue +268 -268
  5. package/src/components/product/Supervisory/SupervisoryControl.vue +141 -141
  6. package/src/components/product/Supervisory/SupervisoryList.vue +452 -452
  7. package/src/filiale/fugou/android/AppAddMaterialScience.vue +442 -442
  8. package/src/filiale/fugou/android/AppChargeManagement.vue +739 -739
  9. package/src/filiale/fugou/android/AppDevicesManagement.vue +519 -519
  10. package/src/filiale/fugou/android.js +14 -14
  11. package/src/filiale/fugou/pc/ExplorationSelect.vue +515 -525
  12. package/src/filiale/fugou/pc/InstallationDetails.vue +647 -647
  13. package/src/filiale/fugou/pc/ServiceControl.vue +1702 -1701
  14. package/src/filiale/fugou/pc/addMaterialScience.vue +482 -482
  15. package/src/filiale/fugou/pc/devicesManagement.vue +483 -483
  16. package/src/filiale/fugou/pc.js +10 -11
  17. package/src/filiale/gongyi/android/AppAddMaterialScience.vue +493 -493
  18. package/src/filiale/qianneng/android/AppChargeManagement.vue +686 -686
  19. package/src/filiale/qianneng/android.js +15 -15
  20. package/src/filiale/qianneng/pc/Applydetail.vue +378 -378
  21. package/src/filiale/qianneng/pc/InstallFunction.vue +188 -188
  22. package/src/filiale/yangchunboneng/android/AppChargeManagement.vue +526 -526
  23. package/src/filiale/yangchunboneng/android/AppDevicesManagement.vue +639 -639
  24. package/src/filiale/yangchunboneng/android/AppExplorationUser.vue +518 -518
  25. package/src/filiale/yangchunboneng/android/AppInstallationMaterial.vue +1083 -1081
  26. package/src/filiale/yangchunboneng/android/AppServiceControl.vue +1681 -1681
  27. package/src/filiale/yangchunboneng/android/AppSuperServiceControl.vue +1524 -1524
  28. package/src/filiale/yangchunboneng/android/AppUpload.vue +205 -205
  29. package/src/filiale/yangchunboneng/android/MaterIialOne.vue +156 -156
  30. package/src/filiale/yangchunboneng/android.js +20 -20
  31. package/src/filiale/yangchunboneng/pc/ApplyUpload.vue +392 -392
  32. package/src/filiale/yangchunboneng/pc/ExplorationSelect.vue +548 -548
  33. package/src/filiale/yangchunboneng/pc/ExplorationUser.vue +191 -191
  34. package/src/filiale/yangchunboneng/pc/InstallInfoSelect.vue +365 -365
  35. package/src/filiale/yangchunboneng/pc/ServiceControl.vue +2075 -2075
  36. package/src/filiale/yangchunboneng/pc/SupervisoryControlNew.vue +142 -142
  37. package/src/filiale/yangchunboneng/pc/SupervisoryList.vue +590 -590
  38. package/src/filiale/yangchunboneng/pc/SupervisoryListNew.vue +628 -628
  39. package/src/filiale/yangchunboneng/pc/SupervisoryServiceControl.vue +902 -902
  40. package/src/filiale/yangchunboneng/pc/SupervisoryServiceControlNew.vue +901 -901
  41. package/src/filiale/yangchunboneng/pc/SupervisoryServiceView.vue +1117 -1117
  42. package/src/filiale/yangchunboneng/pc/chargeManagement.vue +1058 -1058
  43. package/src/filiale/yangchunboneng/pc.js +24 -24
  44. package/src/main.js +3 -3
  45. package/src/filiale/fugou/pc/ServiceView.vue +0 -941
@@ -1,901 +1,901 @@
1
- <template>
2
- <div class="auto clearfix">
3
- <show-back-reason :selectdata="show_data"></show-back-reason>
4
- </div>
5
- <supervisory-service-view v-ref:service_show :data="show_data" v-if="showview"></supervisory-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
- 'complyInstallation' (index) {
598
- },
599
- // 选择材料
600
- async materialNameChenge (index, fieldIndex) {
601
- let material = this.show_data.onetomany[index].fields[fieldIndex].value
602
-
603
- this.show_data.onetomany[index].fields.forEach(item => {
604
- if (material[item.field]) {
605
- item.value = material[item.field]
606
- }
607
- })
608
- },
609
- // 打开模态框获取材料
610
- async 'getMaterialName' (index) {
611
- let data = {
612
- condition: `1=1`
613
- }
614
- let http = new HttpResetClass()
615
- let res = await http.load(
616
- 'POST',
617
- `rs/sql/getStockMaterial`,
618
- {data: data},
619
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
620
- )
621
-
622
- this.show_data.onetomany[index].fields.forEach(field => {
623
- if (field.label === '选择材料') {
624
- field.options = res.data.map(item => {
625
- return {
626
- 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
627
- 'value': item
628
- }
629
- })
630
- }
631
- })
632
- },
633
- // 终止报建初始化·
634
- async 'stopApplyReadyEvent' () {
635
-
636
- let f_is_stop = this.getLableValue('是否终止')
637
-
638
- for (const item of this.show_data.fields) {
639
- if (f_is_stop === '是') {
640
- if (item.label === '终止原因') {
641
- item.hidden = false
642
- item.required = true
643
- }
644
- } else {
645
- if (item.label === '终止原因') {
646
- item.hidden = true
647
- item.required = false
648
- }
649
- }
650
- }
651
-
652
- if (isEmpty(this.show_data.f_parent_process_id)) {
653
- return
654
- }
655
- let data = {
656
- condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
657
- data: {
658
- id: this.$login.f.id,
659
- orgid: this.$login.f.orgid
660
- }
661
- }
662
- let res = await this.$resetpost(
663
- `rs/sql/supervisory`,
664
- {data: data},
665
- {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
666
- )
667
- this.show_data.parentApply = res.data[0]
668
- },
669
- // 通气点火初始化
670
- async 'gasReadyEvent' () {
671
- /*if (!isEmpty(this.show_data.f_price_id)) {
672
- let priceList = await this.getPrice(this.show_data.f_price_id)
673
- this.setLabelValue('气价名称', priceList[0].value)
674
- }*/
675
-
676
-
677
- // 保险初始化显示内容
678
- let f_is_insure = this.getLableValue('是否购买保险')
679
- for (const item of this.show_data.fields) {
680
- if (f_is_insure === '是') {
681
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
682
- item.hidden = false
683
- item.required = true
684
- }
685
- if (item.label === '保险备注') {
686
- item.hidden = false
687
- }
688
- } else {
689
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
690
- item.hidden = true
691
- item.required = false
692
- }
693
- if (item.label === '保险备注') {
694
- item.hidden = true
695
- }
696
- }
697
- }
698
- },
699
- // 申请节点初始化
700
- 'applyReadyEvent' () {
701
- this.$getConfig(this, 'UserAddress')
702
-
703
- let f_address_type = this.show_data.f_address_type
704
-
705
- for (const item of this.show_data.fields) {
706
- if (f_address_type === '民用市区') {
707
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '小区' || item.label === '门牌号') {
708
- item.hidden = false
709
- item.required = true
710
- }
711
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
712
- item.hidden = false
713
- item.required = false
714
- }
715
- if (item.label === '地址') {
716
- item.readonly = true
717
- }
718
- }
719
- if (f_address_type === '民用乡镇') {
720
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '小区' || item.label === '门牌号') {
721
- item.hidden = false
722
- item.required = true
723
- }
724
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
725
- item.hidden = false
726
- item.required = false
727
- }
728
- if (item.label === '楼层') {
729
- item.hidden = true
730
- item.required = false
731
- }
732
- if (item.label === '地址') {
733
- item.readonly = true
734
- }
735
- }
736
- if (f_address_type === '特殊地址') {
737
- if (item.label === '区/县' || item.label === '街道/乡镇') {
738
- item.hidden = false
739
- item.required = true
740
- }
741
- if (item.label === '小区') {
742
- item.hidden = false
743
- item.required = false
744
- }
745
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
746
- item.hidden = true
747
- item.required = false
748
- }
749
- if (item.label === '地址') {
750
- item.readonly = false
751
- }
752
- }
753
-
754
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
755
- item.hidden = true
756
- }
757
- }
758
- },
759
- // 失去焦点出触发事件
760
- 'onchange' (index) {
761
- if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
762
- if (
763
- this.show_data.fields[index].label === '区/县' ||
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
- ) {
771
-
772
- let f_pcd = this.getLableValue('区/县') || ''
773
- let f_street = this.getLableValue('街道/乡镇') || ''
774
- let f_residential_area = this.getLableValue('小区') || ''
775
- let f_building = this.getLableValue('楼号/组') || ''
776
- let f_building_suffix = f_building ? this.config.f_building_suffix : ''
777
- let f_unit = this.getLableValue('单元/排') || ''
778
- let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
779
- let f_floor = this.getLableValue('楼层') || ''
780
- let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
781
- let f_room = this.getLableValue('门牌号') || ''
782
- let f_room_suffix = f_room ? this.config.f_room_suffix : ''
783
-
784
- 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
785
- this.setLabelValue("地址", f_address)
786
- }
787
- }
788
- },
789
- // =============================
790
- selectSearch (val, index) {},
791
- 'onblur' (index) {},
792
- 'oninput' (index) {},
793
- 'initializtionView' () {},
794
- async 'onchangeModal' (index, fieldIndex) {
795
- },
796
- async 'onblurModal' (index, fieldIndex) {
797
-
798
- },
799
- async 'oninputModal' (index, fieldIndex) {
800
-
801
- },
802
- async 'onetomanydelete' (index, rowIndex) {
803
-
804
- let http = new HttpResetClass()
805
-
806
- let res = await http.load(
807
- 'DELETE',
808
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
809
- null,
810
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
811
- )
812
-
813
- res = await this.$resetpost(
814
- 'rs/entity/t_apply',
815
- this.show_data
816
- )
817
-
818
- this.$dispatch('breakControl', this.show_data)
819
- },
820
- async 'onetomanyupdate' (index, rowIndex) {
821
- let data = this.show_data.onetomany[index].rows[rowIndex]
822
-
823
- this.show_data.onetomany[index].fields.forEach(item => {
824
- data[item.field] = item.value
825
- })
826
- let res = await this.$resetpost(
827
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
828
- data
829
- )
830
-
831
- res = await this.$resetpost(
832
- 'rs/entity/t_apply',
833
- this.show_data
834
- )
835
-
836
- this.$dispatch('breakControl', this.show_data)
837
- },
838
- async 'onetomanyadd' (index) {
839
- let data = {
840
- f_process_id : this.show_data.f_process_id,
841
- f_operator_id: this.$login.f.id,
842
- f_operator: this.$login.f.name,
843
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
844
- f_orgid: this.$login.f.orgid,
845
- f_orgname: this.$login.f.orgs
846
- }
847
- this.show_data.onetomany[index].fields.forEach(item => {
848
- data[item.field] = item.value
849
- })
850
- let res = await this.$resetpost(
851
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
852
- data
853
- )
854
-
855
- res = await this.$resetpost(
856
- 'rs/entity/t_apply',
857
- this.show_data
858
- )
859
-
860
- this.$dispatch('breakControl', this.show_data)
861
- },
862
- async 'importEvent' (index, table, configName, filepath) {
863
- let data = {
864
- selectdata: this.show_data,
865
- table: table,
866
- filepath: filepath,
867
- configName: configName,
868
- user: this.$login.f
869
- }
870
-
871
- let res = await this.$resetpost(
872
- `rs/logic/importEvent`,
873
- data
874
- )
875
-
876
- this.$dispatch('breakControl', this.show_data)
877
- },
878
- 'onbutchange' (index) {
879
-
880
- },
881
- 'onbutblur' (index) {
882
-
883
- },
884
- 'onbutinput' (index) {
885
-
886
- }
887
- },
888
- watch: {
889
- deep: true
890
- }
891
- }
892
- </script>
893
- <style scoped>
894
- /*清除model中的浮动*/
895
- .clearfix:after,.clearfix:before{
896
- display: table;
897
- }
898
- .clearfix:after{
899
- clear: both;
900
- }
901
- </style>
1
+ <template>
2
+ <div class="auto clearfix">
3
+ <show-back-reason :selectdata="show_data"></show-back-reason>
4
+ </div>
5
+ <supervisory-service-view v-ref:service_show :data="show_data" v-if="showview"></supervisory-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
+ 'complyInstallation' (index) {
598
+ },
599
+ // 选择材料
600
+ async materialNameChenge (index, fieldIndex) {
601
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
602
+
603
+ this.show_data.onetomany[index].fields.forEach(item => {
604
+ if (material[item.field]) {
605
+ item.value = material[item.field]
606
+ }
607
+ })
608
+ },
609
+ // 打开模态框获取材料
610
+ async 'getMaterialName' (index) {
611
+ let data = {
612
+ condition: `1=1`
613
+ }
614
+ let http = new HttpResetClass()
615
+ let res = await http.load(
616
+ 'POST',
617
+ `rs/sql/getStockMaterial`,
618
+ {data: data},
619
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
620
+ )
621
+
622
+ this.show_data.onetomany[index].fields.forEach(field => {
623
+ if (field.label === '选择材料') {
624
+ field.options = res.data.map(item => {
625
+ return {
626
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
627
+ 'value': item
628
+ }
629
+ })
630
+ }
631
+ })
632
+ },
633
+ // 终止报建初始化·
634
+ async 'stopApplyReadyEvent' () {
635
+
636
+ let f_is_stop = this.getLableValue('是否终止')
637
+
638
+ for (const item of this.show_data.fields) {
639
+ if (f_is_stop === '是') {
640
+ if (item.label === '终止原因') {
641
+ item.hidden = false
642
+ item.required = true
643
+ }
644
+ } else {
645
+ if (item.label === '终止原因') {
646
+ item.hidden = true
647
+ item.required = false
648
+ }
649
+ }
650
+ }
651
+
652
+ if (isEmpty(this.show_data.f_parent_process_id)) {
653
+ return
654
+ }
655
+ let data = {
656
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
657
+ data: {
658
+ id: this.$login.f.id,
659
+ orgid: this.$login.f.orgid
660
+ }
661
+ }
662
+ let res = await this.$resetpost(
663
+ `rs/sql/supervisory`,
664
+ {data: data},
665
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
666
+ )
667
+ this.show_data.parentApply = res.data[0]
668
+ },
669
+ // 通气点火初始化
670
+ async 'gasReadyEvent' () {
671
+ /*if (!isEmpty(this.show_data.f_price_id)) {
672
+ let priceList = await this.getPrice(this.show_data.f_price_id)
673
+ this.setLabelValue('气价名称', priceList[0].value)
674
+ }*/
675
+
676
+
677
+ // 保险初始化显示内容
678
+ let f_is_insure = this.getLableValue('是否购买保险')
679
+ for (const item of this.show_data.fields) {
680
+ if (f_is_insure === '是') {
681
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
682
+ item.hidden = false
683
+ item.required = true
684
+ }
685
+ if (item.label === '保险备注') {
686
+ item.hidden = false
687
+ }
688
+ } else {
689
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
690
+ item.hidden = true
691
+ item.required = false
692
+ }
693
+ if (item.label === '保险备注') {
694
+ item.hidden = true
695
+ }
696
+ }
697
+ }
698
+ },
699
+ // 申请节点初始化
700
+ 'applyReadyEvent' () {
701
+ this.$getConfig(this, 'UserAddress')
702
+
703
+ let f_address_type = this.show_data.f_address_type
704
+
705
+ for (const item of this.show_data.fields) {
706
+ if (f_address_type === '民用市区') {
707
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '小区' || item.label === '门牌号') {
708
+ item.hidden = false
709
+ item.required = true
710
+ }
711
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
712
+ item.hidden = false
713
+ item.required = false
714
+ }
715
+ if (item.label === '地址') {
716
+ item.readonly = true
717
+ }
718
+ }
719
+ if (f_address_type === '民用乡镇') {
720
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '小区' || item.label === '门牌号') {
721
+ item.hidden = false
722
+ item.required = true
723
+ }
724
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
725
+ item.hidden = false
726
+ item.required = false
727
+ }
728
+ if (item.label === '楼层') {
729
+ item.hidden = true
730
+ item.required = false
731
+ }
732
+ if (item.label === '地址') {
733
+ item.readonly = true
734
+ }
735
+ }
736
+ if (f_address_type === '特殊地址') {
737
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
738
+ item.hidden = false
739
+ item.required = true
740
+ }
741
+ if (item.label === '小区') {
742
+ item.hidden = false
743
+ item.required = false
744
+ }
745
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
746
+ item.hidden = true
747
+ item.required = false
748
+ }
749
+ if (item.label === '地址') {
750
+ item.readonly = false
751
+ }
752
+ }
753
+
754
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
755
+ item.hidden = true
756
+ }
757
+ }
758
+ },
759
+ // 失去焦点出触发事件
760
+ 'onchange' (index) {
761
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
762
+ if (
763
+ this.show_data.fields[index].label === '区/县' ||
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
+ ) {
771
+
772
+ let f_pcd = this.getLableValue('区/县') || ''
773
+ let f_street = this.getLableValue('街道/乡镇') || ''
774
+ let f_residential_area = this.getLableValue('小区') || ''
775
+ let f_building = this.getLableValue('楼号/组') || ''
776
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
777
+ let f_unit = this.getLableValue('单元/排') || ''
778
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
779
+ let f_floor = this.getLableValue('楼层') || ''
780
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
781
+ let f_room = this.getLableValue('门牌号') || ''
782
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
783
+
784
+ 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
785
+ this.setLabelValue("地址", f_address)
786
+ }
787
+ }
788
+ },
789
+ // =============================
790
+ selectSearch (val, index) {},
791
+ 'onblur' (index) {},
792
+ 'oninput' (index) {},
793
+ 'initializtionView' () {},
794
+ async 'onchangeModal' (index, fieldIndex) {
795
+ },
796
+ async 'onblurModal' (index, fieldIndex) {
797
+
798
+ },
799
+ async 'oninputModal' (index, fieldIndex) {
800
+
801
+ },
802
+ async 'onetomanydelete' (index, rowIndex) {
803
+
804
+ let http = new HttpResetClass()
805
+
806
+ let res = await http.load(
807
+ 'DELETE',
808
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
809
+ null,
810
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
811
+ )
812
+
813
+ res = await this.$resetpost(
814
+ 'rs/entity/t_apply',
815
+ this.show_data
816
+ )
817
+
818
+ this.$dispatch('breakControl', this.show_data)
819
+ },
820
+ async 'onetomanyupdate' (index, rowIndex) {
821
+ let data = this.show_data.onetomany[index].rows[rowIndex]
822
+
823
+ this.show_data.onetomany[index].fields.forEach(item => {
824
+ data[item.field] = item.value
825
+ })
826
+ let res = await this.$resetpost(
827
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
828
+ data
829
+ )
830
+
831
+ res = await this.$resetpost(
832
+ 'rs/entity/t_apply',
833
+ this.show_data
834
+ )
835
+
836
+ this.$dispatch('breakControl', this.show_data)
837
+ },
838
+ async 'onetomanyadd' (index) {
839
+ let data = {
840
+ f_process_id : this.show_data.f_process_id,
841
+ f_operator_id: this.$login.f.id,
842
+ f_operator: this.$login.f.name,
843
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
844
+ f_orgid: this.$login.f.orgid,
845
+ f_orgname: this.$login.f.orgs
846
+ }
847
+ this.show_data.onetomany[index].fields.forEach(item => {
848
+ data[item.field] = item.value
849
+ })
850
+ let res = await this.$resetpost(
851
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
852
+ data
853
+ )
854
+
855
+ res = await this.$resetpost(
856
+ 'rs/entity/t_apply',
857
+ this.show_data
858
+ )
859
+
860
+ this.$dispatch('breakControl', this.show_data)
861
+ },
862
+ async 'importEvent' (index, table, configName, filepath) {
863
+ let data = {
864
+ selectdata: this.show_data,
865
+ table: table,
866
+ filepath: filepath,
867
+ configName: configName,
868
+ user: this.$login.f
869
+ }
870
+
871
+ let res = await this.$resetpost(
872
+ `rs/logic/importEvent`,
873
+ data
874
+ )
875
+
876
+ this.$dispatch('breakControl', this.show_data)
877
+ },
878
+ 'onbutchange' (index) {
879
+
880
+ },
881
+ 'onbutblur' (index) {
882
+
883
+ },
884
+ 'onbutinput' (index) {
885
+
886
+ }
887
+ },
888
+ watch: {
889
+ deep: true
890
+ }
891
+ }
892
+ </script>
893
+ <style scoped>
894
+ /*清除model中的浮动*/
895
+ .clearfix:after,.clearfix:before{
896
+ display: table;
897
+ }
898
+ .clearfix:after{
899
+ clear: both;
900
+ }
901
+ </style>