apply-clients 3.5.4-87 → 3.5.4-89

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