apply-clients 3.3.16 → 3.3.17

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 (57) hide show
  1. package/index.html +33 -33
  2. package/package.json +1 -1
  3. package/src/AndroidApp.vue +30 -30
  4. package/src/android.js +21 -21
  5. package/src/apply.js +3 -6
  6. package/src/applyAndroid.js +35 -35
  7. package/src/components/android/AppOnetomany.vue +285 -285
  8. package/src/components/android/AppServiceView.vue +570 -570
  9. package/src/components/android/AppTakePic.vue +143 -143
  10. package/src/components/android/Function/AppFunctionServiceControl.vue +329 -329
  11. package/src/components/android/Function/AppInstallFunction.vue +327 -327
  12. package/src/components/android/Process/AppExplorationUser.vue +268 -268
  13. package/src/components/android/Process/AppServiceControl.vue +711 -686
  14. package/src/components/android/Process/Processes/AppChargeManagement.vue +468 -468
  15. package/src/components/android/Process/Processes/AppDevicesManagement.vue +490 -490
  16. package/src/components/android/Process/Processes/AppInstallationDetails.vue +466 -466
  17. package/src/components/android/Process/Processes/AppSupplementalAgreement.vue +297 -297
  18. package/src/components/android/Supervisory/AppProcessSupervisory.vue +261 -261
  19. package/src/components/android/Supervisory/AppSupervisoryCart.vue +115 -115
  20. package/src/components/product/ApplyCharge/ApplyChargeList.vue +265 -265
  21. package/src/components/product/ApplyCharge/ApplyChargeSearch.vue +30 -30
  22. package/src/components/product/Function/InstallFunction.vue +122 -122
  23. package/src/components/product/Function/InstallInfoSelect.vue +289 -289
  24. package/src/components/product/Function/Service/FunctionServiceControl.vue +254 -254
  25. package/src/components/product/Onetomany.vue +296 -296
  26. package/src/components/product/Order/OrderApply.vue +47 -47
  27. package/src/components/product/Order/OrderApplyList.vue +62 -62
  28. package/src/components/product/Order/OrderMessage.vue +237 -237
  29. package/src/components/product/Process/ExplorationSelect.vue +145 -143
  30. package/src/components/product/Process/ExplorationUser.vue +128 -128
  31. package/src/components/product/Process/Processes/InstallationDetails.vue +421 -352
  32. package/src/components/product/Process/Processes/Print/img/10101.png +0 -0
  33. package/src/components/product/Process/Processes/Print/img/1010109.png +0 -0
  34. package/src/components/product/Process/Processes/Print/img/1010110.png +0 -0
  35. package/src/components/product/Process/Processes/Print/img/1010111.png +0 -0
  36. package/src/components/product/Process/Processes/Print/img/1010112.png +0 -0
  37. package/src/components/product/Process/Processes/{printCharge.vue → Print/printCharge.vue} +139 -121
  38. package/src/components/product/Process/Processes/Print/printRefund.vue +193 -0
  39. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +181 -181
  40. package/src/components/product/Process/Processes/chargeManagement.vue +639 -639
  41. package/src/components/product/Process/Processes/devicesManagement.vue +458 -458
  42. package/src/components/product/Process/Processes/selectApply.vue +250 -250
  43. package/src/components/product/Process/Processes/selectUserinfo.vue +182 -182
  44. package/src/components/product/Process/Processes/supplementalAgreement.vue +298 -298
  45. package/src/components/product/Process/Service/ServiceControl.vue +916 -810
  46. package/src/components/product/Process/ShowBackReason.vue +33 -33
  47. package/src/components/product/ServiceView.vue +301 -307
  48. package/src/components/product/Stop/StopApplyList.vue +254 -254
  49. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +512 -517
  50. package/src/components/product/Supervisory/SupervisoryControl.vue +100 -100
  51. package/src/components/product/Supervisory/SupervisoryList.vue +226 -226
  52. package/src/components/product/Supervisory/SupervisoryhCart.vue +124 -124
  53. package/src/components/product/VueUtils/ApplyUpload.vue +262 -262
  54. package/src/components/product/VueUtils/GaoPaiYi/HighMeter.vue +1090 -1090
  55. package/src/main.js +23 -23
  56. package/src/components/product/Function/Inform.vue +0 -74
  57. package/src/components/product/Function/MarketSurvey.vue +0 -80
@@ -1,517 +1,512 @@
1
- <template>
2
- <div class="auto clearfix">
3
- <show-back-reason :selectdata="show_data"></show-back-reason>
4
- </div>
5
- <service-view v-ref:service_show :data="show_data" v-if="showview"></service-view>
6
- </template>
7
- <script>
8
- import Vue from 'vue'
9
- import {HttpResetClass} from 'vue-client'
10
- import {isEmpty} from "../../../Util";
11
- // Date格式化
12
- Date.prototype.Format = function (fmt) {
13
- var o = {
14
- 'M+': this.getMonth() + 1, // 月份
15
- 'd+': this.getDate(), // 日
16
- 'H+': this.getHours(), // 小时
17
- 'm+': this.getMinutes(), // 分
18
- 's+': this.getSeconds(), // 秒
19
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
20
- 'S': this.getMilliseconds() // 毫秒
21
- }
22
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
23
- for (var k in o) {
24
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
25
- }
26
- return fmt
27
- }
28
- export default {
29
- title: '报建监控控制层',
30
- props: {
31
- selectdata: {
32
- type: Object
33
- },
34
- nodeSnapshot: {
35
- type: Boolean,
36
- default: false
37
- }
38
- },
39
- data() {
40
- return {
41
- data: null, // 展示的数据
42
- json_datas: null, // json配置数据结构
43
- showview: false, // 控制显示层显示
44
- show_data: null,
45
- config: {}
46
- }
47
- },
48
- created () {
49
- this.refurbish()
50
- },
51
- methods: {
52
- // 初始化模块
53
- async refurbish() {
54
- this.json_datas = this.$workflow_vue
55
- let sum = 0
56
- let jsonData = {}
57
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
58
- this.$showMessage("网络故障,请刷新页面")
59
- return
60
- }
61
- this.json_datas.activitys.forEach(item => {
62
- if (this.selectdata.defname === item.title) {
63
- jsonData = item // 拿到当前节点的json配置信息
64
- sum++ // 节点名一样的个数
65
- }
66
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
67
- })
68
- if (sum === 0) {
69
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
70
- return
71
- }
72
- if (sum > 1) {
73
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
74
- return
75
- }
76
-
77
- this.data = null
78
- this.data = jsonData
79
- this.data = Object.assign({}, this.data, this.selectdata)
80
-
81
- // fields 字段填充值
82
- for (const item of this.data.fields) {
83
- if (this.selectdata[item.field]) {
84
- item.value = this.selectdata[item.field]
85
- }
86
- if (this.selectdata[item.field] === 0) {
87
- item.value = 0
88
- }
89
-
90
- if (item.type === 'select' || item.type === 'checkbox') {
91
- if (item.param) {
92
- let temp = this.$appdata.getParam(item.label)
93
-
94
- if (temp && temp.length > 0) {
95
- item.options = temp
96
- }
97
-
98
- if (item.paramLabel) {
99
- temp = this.$appdata.getParam(item.paramLabel)
100
- if (temp && temp.length > 0) {
101
- item.options = temp
102
- }
103
- }
104
- }
105
-
106
- if (item.ready) {
107
- item.options = await this[item.ready]()
108
- }
109
- }
110
-
111
- if (item.type === 'checkbox') {
112
- if (this.selectdata[item.field]) {
113
- item.value = JSON.parse(this.selectdata[item.field])
114
- } else {
115
- item.value = []
116
- }
117
- }
118
-
119
- item.readonly = true
120
- item.disabled = true
121
- }
122
-
123
- // 控制组件
124
- if (this.data.components) {
125
- this.data.components.forEach(item => {
126
- item.mark = 1
127
- })
128
- }
129
-
130
- // onetomany 数据获取
131
- if (this.data.onetomany) {
132
- for (const item of this.data.onetomany) {
133
- let res = null
134
- if (item.queryEvent) {
135
- res = this[item.queryEvent]()
136
- } else {
137
- let data = {
138
- tablename: item.tables[0],
139
- condition: `f_process_id='${this.selectdata.f_process_id}'`
140
- }
141
- res = await this.$resetpost(
142
- 'rs/sql/singleTable',
143
- {data: data},
144
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
145
- )
146
- }
147
-
148
- item.rows = res.data
149
-
150
- // 隐藏所有操作
151
- item.hiddenOperate = true
152
- }
153
- }
154
-
155
- // 去除button
156
- this.data.buttons = null
157
-
158
- // 完成时间和完成人,部门,分公司
159
- if (this.selectdata.state === '结束') {
160
- let http = new HttpResetClass()
161
- let res = await http.load('POST', 'rs/search', {
162
- source: 'this.getInfo()',
163
- userid: this.selectdata.userid
164
- }, {resolveMsg: null, rejectMsg: null})
165
- let user = res.data
166
- this.data.operate_date = new Date(this.selectdata.finishtime).Format('yyyy-MM-dd')
167
- this.data.operator = this.selectdata.person
168
- this.data.orgs = user.orgs
169
- this.data.parentname = user.deps
170
- }
171
-
172
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
173
- let temp = JSON.parse(JSON.stringify(this.data))
174
-
175
- this.show_data = temp
176
- this.$nextTick(() => {
177
- this.showview = true
178
- })
179
- },
180
- // 金额转大写
181
- smalltoBIG(n) {
182
- let fraction = ['角', '分'];
183
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
184
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
185
- let head = n < 0 ? '欠' : '';
186
- n = Math.abs(n);
187
-
188
- let s = '';
189
-
190
- for (var i = 0; i < fraction.length; i++) {
191
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
192
- }
193
- s = s || '整';
194
- n = Math.floor(n);
195
-
196
- for (var i = 0; i < unit[0].length && n > 0; i++) {
197
- let p = '';
198
- for (var j = 0; j < unit[1].length && n > 0; j++) {
199
- p = digit[n % 10] + unit[1][j] + p;
200
- n = Math.floor(n / 10);
201
- }
202
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
203
- }
204
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
205
- },
206
- getLableValue(label) {
207
- for (const item of this.show_data.fields) {
208
- if (item.label === label && item.type !== 'number') {
209
- return item.value || ''
210
- }
211
- if (item.label === label && item.type === 'number') {
212
- return item.value || 0
213
- }
214
- }
215
- },
216
- getLableOptions(label) {
217
- for (const item of this.show_data.fields) {
218
- if (item.label === label) {
219
- return item.options
220
- }
221
- }
222
- },
223
- setLabelValue(label, value) {
224
- for (const item of this.show_data.fields) {
225
- if (item.label === label) {
226
- item.value = value
227
- this.show_data[item.field] = value
228
- }
229
- }
230
- },
231
- setLabelOptions(label, options) {
232
- for (const item of this.show_data.fields) {
233
- if (item.label === label) {
234
- item.options = options
235
- }
236
- }
237
- },
238
- async checkDuplicate(index) {
239
- let http = new HttpResetClass()
240
- let data = {
241
- tablename: 't_apply',
242
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
243
- }
244
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
245
- resolveMsg: null,
246
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
247
- })
248
- if (res.data.length > 0) {
249
- this.show_data.fields[index].value = null
250
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
251
- }
252
- },
253
- // 获取片区
254
- async getSliceArea () {
255
- let data = {
256
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
257
- userid: this.$login.f.id
258
- }
259
-
260
- let res = await this.$resetpost(
261
- `rs/search`,
262
- {data: data},
263
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
264
- )
265
-
266
- return res.data.map(item => {
267
- return {
268
- label: item.name,
269
- value: item.name
270
- }
271
- })
272
- },
273
- // 获取区县
274
- async getPcd () {
275
- let data = {
276
- tablename: 't_pcd',
277
- condition: `f_filialeid = '${this.$login.f.orgid}'`
278
- }
279
- let res = await this.$resetpost(
280
- `rs/sql/singleTable`,
281
- {data: data},
282
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
283
- )
284
-
285
- return res.data.map(item => {
286
- return {
287
- label: item.f_pcd,
288
- value: item.f_pcd
289
- }
290
- })
291
- },
292
- // 缴费前置
293
- chargeBefore () {
294
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
295
- this.$showAlert('费用未结清!!!', 'warning', 3000)
296
- throw null
297
- }
298
- },
299
- // 施工前置
300
- async constructionBefore () {
301
- let http = new HttpResetClass()
302
- let data = {
303
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
304
- }
305
- let res = await http.load(
306
- 'POST',
307
- 'rs/sql/countApplyUserinfo',
308
- {data: data},
309
- {
310
- resolveMsg: null,
311
- rejectMsg: '安装明细查询失败!!!'
312
- })
313
- if (res.data[0].num > 0) {
314
- this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
315
- throw `还有${res.data[0].num}户未安装,无法提交`
316
- }
317
- },
318
- changePipeBuild () {
319
- if (this.selectdata.f_process_dep === '工程部') {
320
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
321
- }
322
- if (this.selectdata.f_process_dep === '运营部') {
323
- return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
324
- }
325
- },
326
- async getDevInfo () {
327
- let data = {
328
- tablename: 't_dev_info',
329
- condition: `f_orgid = '${this.$login.f.orgid}'`
330
- }
331
- let res = await this.$resetpost(
332
- `rs/sql/singleTable`,
333
- {data: data},
334
- {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
335
- )
336
-
337
- return res.data.map(item => {
338
- return {
339
- label: item.f_dev_name,
340
- value: item.f_dev_name
341
- }
342
- })
343
- },
344
- async getPrice (f_price_id) {
345
- console.log('=======================')
346
- console.log(f_price_id)
347
-
348
- let data = {
349
- condition: `sp.f_orgid = '${this.$login.f.orgid}'`
350
- }
351
-
352
- if (!isEmpty(f_price_id)) {
353
- data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
354
- }
355
- let http = new HttpResetClass()
356
- let res = await http.load(
357
- 'POST',
358
- `rs/sql/applyGetPrice`,
359
- {data: data},
360
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
361
- )
362
-
363
- return res.data.map(item => {
364
- return {
365
- label: item.f_price_name,
366
- value: item
367
- }
368
- })
369
- }
370
- },
371
- events:{
372
- // 终止报建初始化·
373
- async 'stopApplyReadyEvent' () {
374
-
375
- let f_is_stop = this.getLableValue('是否终止')
376
-
377
- for (const item of this.show_data.fields) {
378
- if (f_is_stop === '是') {
379
- if (item.label === '终止原因') {
380
- item.hidden = false
381
- item.required = true
382
- }
383
- } else {
384
- if (item.label === '终止原因') {
385
- item.hidden = true
386
- item.required = false
387
- }
388
- }
389
- }
390
-
391
- if (isEmpty(this.show_data.f_parent_process_id)) {
392
- return
393
- }
394
- let data = {
395
- condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
396
- data: {
397
- id: this.$login.f.id,
398
- orgid: this.$login.f.orgid
399
- }
400
- }
401
- let res = await this.$resetpost(
402
- `rs/sql/supervisory`,
403
- {data: data},
404
- {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
405
- )
406
- this.show_data.parentApply = res.data[0]
407
- },
408
- // 通气点火初始化
409
- async 'gasReadyEvent' () {
410
- if (!isEmpty(this.show_data.f_price_id)) {
411
- let priceList = await this.getPrice(this.show_data.f_price_id)
412
- this.setLabelValue('气价名称', priceList[0].value)
413
- }
414
-
415
-
416
- // 保险初始化显示内容
417
- let f_is_insure = this.getLableValue('是否购买保险')
418
- for (const item of this.show_data.fields) {
419
- if (f_is_insure === '是') {
420
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
421
- item.hidden = false
422
- item.required = true
423
- }
424
- if (item.label === '保险备注') {
425
- item.hidden = false
426
- }
427
- } else {
428
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
429
- item.hidden = true
430
- item.required = false
431
- }
432
- if (item.label === '保险备注') {
433
- item.hidden = true
434
- }
435
- }
436
- }
437
- // 本期保费到期时间默认一年
438
- if (isEmpty(this.selectdata.f_ins_expiration_date)) {
439
- let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
440
- this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
441
- }
442
- },
443
- // 申请节点初始化
444
- 'applyReadyEvent' () {
445
- this.$getConfig(this, 'UserAddress')
446
-
447
- let f_address_type = this.show_data.f_address_type
448
-
449
- for (const item of this.show_data.fields) {
450
- if (f_address_type === '民用市区') {
451
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
452
- item.hidden = false
453
- item.required = true
454
- }
455
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
456
- item.hidden = false
457
- item.required = false
458
- }
459
- if (item.label === '地址') {
460
- item.readonly = true
461
- }
462
- }
463
- if (f_address_type === '民用乡镇') {
464
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
465
- item.hidden = false
466
- item.required = true
467
- }
468
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
469
- item.hidden = false
470
- item.required = false
471
- }
472
- if (item.label === '楼层') {
473
- item.hidden = true
474
- item.required = false
475
- }
476
- if (item.label === '地址') {
477
- item.readonly = true
478
- }
479
- }
480
- if (f_address_type === '特殊地址') {
481
- if (item.label === '区/县' || item.label === '街道/乡镇') {
482
- item.hidden = false
483
- item.required = true
484
- }
485
- if (item.label === '集收单位') {
486
- item.hidden = false
487
- item.required = false
488
- }
489
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
490
- item.hidden = true
491
- item.required = false
492
- }
493
- if (item.label === '地址') {
494
- item.readonly = false
495
- }
496
- }
497
-
498
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
499
- item.hidden = true
500
- }
501
- }
502
- },
503
- },
504
- watch: {
505
- deep: true
506
- }
507
- }
508
- </script>
509
- <style scoped>
510
- /*清除model中的浮动*/
511
- .clearfix:after,.clearfix:before{
512
- display: table;
513
- }
514
- .clearfix:after{
515
- clear: both;
516
- }
517
- </style>
1
+ <template>
2
+ <div class="auto clearfix">
3
+ <show-back-reason :selectdata="show_data"></show-back-reason>
4
+ </div>
5
+ <service-view v-ref:service_show :data="show_data" v-if="showview"></service-view>
6
+ </template>
7
+ <script>
8
+ import Vue from 'vue'
9
+ import {HttpResetClass} from 'vue-client'
10
+ import {isEmpty} from "../../../Util";
11
+ // Date格式化
12
+ Date.prototype.Format = function (fmt) {
13
+ var o = {
14
+ 'M+': this.getMonth() + 1, // 月份
15
+ 'd+': this.getDate(), // 日
16
+ 'H+': this.getHours(), // 小时
17
+ 'm+': this.getMinutes(), // 分
18
+ 's+': this.getSeconds(), // 秒
19
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
20
+ 'S': this.getMilliseconds() // 毫秒
21
+ }
22
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
23
+ for (var k in o) {
24
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
25
+ }
26
+ return fmt
27
+ }
28
+ export default {
29
+ title: '报建监控控制层',
30
+ props: {
31
+ selectdata: {
32
+ type: Object
33
+ },
34
+ nodeSnapshot: {
35
+ type: Boolean,
36
+ default: false
37
+ }
38
+ },
39
+ data() {
40
+ return {
41
+ data: null, // 展示的数据
42
+ json_datas: null, // json配置数据结构
43
+ showview: false, // 控制显示层显示
44
+ show_data: null,
45
+ config: {}
46
+ }
47
+ },
48
+ created () {
49
+ this.refurbish()
50
+ },
51
+ methods: {
52
+ // 初始化模块
53
+ async refurbish() {
54
+ this.json_datas = this.$workflow_vue
55
+ let sum = 0
56
+ let jsonData = {}
57
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
58
+ this.$showMessage("网络故障,请刷新页面")
59
+ return
60
+ }
61
+ this.json_datas.activitys.forEach(item => {
62
+ if (this.selectdata.defname === item.title) {
63
+ jsonData = item // 拿到当前节点的json配置信息
64
+ sum++ // 节点名一样的个数
65
+ }
66
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
67
+ })
68
+ if (sum === 0) {
69
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
70
+ return
71
+ }
72
+ if (sum > 1) {
73
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
74
+ return
75
+ }
76
+
77
+ this.data = null
78
+ this.data = jsonData
79
+ this.data = Object.assign({}, this.data, this.selectdata)
80
+
81
+ // fields 字段填充值
82
+ for (const item of this.data.fields) {
83
+ if (this.selectdata[item.field]) {
84
+ item.value = this.selectdata[item.field]
85
+ }
86
+ if (this.selectdata[item.field] === 0) {
87
+ item.value = 0
88
+ }
89
+
90
+ if (item.type === 'select' || item.type === 'checkbox') {
91
+ if (item.param) {
92
+ let temp = this.$appdata.getParam(item.label)
93
+
94
+ if (temp && temp.length > 0) {
95
+ item.options = temp
96
+ }
97
+
98
+ if (item.paramLabel) {
99
+ temp = this.$appdata.getParam(item.paramLabel)
100
+ if (temp && temp.length > 0) {
101
+ item.options = temp
102
+ }
103
+ }
104
+ }
105
+
106
+ if (item.ready) {
107
+ item.options = await this[item.ready]()
108
+ }
109
+ }
110
+
111
+ if (item.type === 'checkbox') {
112
+ if (this.selectdata[item.field]) {
113
+ item.value = JSON.parse(this.selectdata[item.field])
114
+ } else {
115
+ item.value = []
116
+ }
117
+ }
118
+
119
+ item.readonly = true
120
+ item.disabled = true
121
+ }
122
+
123
+ // 控制组件
124
+ if (this.data.components) {
125
+ this.data.components.forEach(item => {
126
+ item.mark = 1
127
+ })
128
+ }
129
+
130
+ // onetomany 数据获取
131
+ if (this.data.onetomany) {
132
+ for (const item of this.data.onetomany) {
133
+ let res = null
134
+ if (item.queryEvent) {
135
+ res = this[item.queryEvent]()
136
+ } else {
137
+ let data = {
138
+ tablename: item.tables[0],
139
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
140
+ }
141
+ res = await this.$resetpost(
142
+ 'rs/sql/singleTable',
143
+ {data: data},
144
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
145
+ )
146
+ }
147
+
148
+ item.rows = res.data
149
+
150
+ // 隐藏所有操作
151
+ item.hiddenOperate = true
152
+ }
153
+ }
154
+
155
+ // 去除button
156
+ this.data.buttons = null
157
+
158
+ // 完成时间和完成人,部门,分公司
159
+ if (this.selectdata.state === '结束') {
160
+ let http = new HttpResetClass()
161
+ let res = await http.load('POST', 'rs/search', {
162
+ source: 'this.getInfo()',
163
+ userid: this.selectdata.userid
164
+ }, {resolveMsg: null, rejectMsg: null})
165
+ let user = res.data
166
+ this.data.operate_date = new Date(this.selectdata.finishtime).Format('yyyy-MM-dd')
167
+ this.data.operator = this.selectdata.person
168
+ this.data.orgs = user.orgs
169
+ this.data.parentname = user.deps
170
+ }
171
+
172
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
173
+ let temp = JSON.parse(JSON.stringify(this.data))
174
+
175
+ this.show_data = temp
176
+ this.$nextTick(() => {
177
+ this.showview = true
178
+ })
179
+ },
180
+ // 金额转大写
181
+ smalltoBIG(n) {
182
+ let fraction = ['角', '分'];
183
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
184
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
185
+ let head = n < 0 ? '欠' : '';
186
+ n = Math.abs(n);
187
+
188
+ let s = '';
189
+
190
+ for (var i = 0; i < fraction.length; i++) {
191
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
192
+ }
193
+ s = s || '整';
194
+ n = Math.floor(n);
195
+
196
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
197
+ let p = '';
198
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
199
+ p = digit[n % 10] + unit[1][j] + p;
200
+ n = Math.floor(n / 10);
201
+ }
202
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
203
+ }
204
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
205
+ },
206
+ getLableValue(label) {
207
+ for (const item of this.show_data.fields) {
208
+ if (item.label === label && item.type !== 'number') {
209
+ return item.value || ''
210
+ }
211
+ if (item.label === label && item.type === 'number') {
212
+ return item.value || 0
213
+ }
214
+ }
215
+ },
216
+ getLableOptions(label) {
217
+ for (const item of this.show_data.fields) {
218
+ if (item.label === label) {
219
+ return item.options
220
+ }
221
+ }
222
+ },
223
+ setLabelValue(label, value) {
224
+ for (const item of this.show_data.fields) {
225
+ if (item.label === label) {
226
+ item.value = value
227
+ this.show_data[item.field] = value
228
+ }
229
+ }
230
+ },
231
+ setLabelOptions(label, options) {
232
+ for (const item of this.show_data.fields) {
233
+ if (item.label === label) {
234
+ item.options = options
235
+ }
236
+ }
237
+ },
238
+ async checkDuplicate(index) {
239
+ let http = new HttpResetClass()
240
+ let data = {
241
+ tablename: 't_apply',
242
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
243
+ }
244
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
245
+ resolveMsg: null,
246
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
247
+ })
248
+ if (res.data.length > 0) {
249
+ this.show_data.fields[index].value = null
250
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
251
+ }
252
+ },
253
+ // 获取片区
254
+ async getSliceArea () {
255
+ let data = {
256
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
257
+ userid: this.$login.f.id
258
+ }
259
+
260
+ let res = await this.$resetpost(
261
+ `rs/search`,
262
+ {data: data},
263
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
264
+ )
265
+
266
+ return res.data.map(item => {
267
+ return {
268
+ label: item.name,
269
+ value: item.name
270
+ }
271
+ })
272
+ },
273
+ // 获取区县
274
+ async getPcd () {
275
+ let data = {
276
+ tablename: 't_pcd',
277
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
278
+ }
279
+ let res = await this.$resetpost(
280
+ `rs/sql/singleTable`,
281
+ {data: data},
282
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
283
+ )
284
+
285
+ return res.data.map(item => {
286
+ return {
287
+ label: item.f_pcd,
288
+ value: item.f_pcd
289
+ }
290
+ })
291
+ },
292
+ // 缴费前置
293
+ chargeBefore () {
294
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
295
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
296
+ throw null
297
+ }
298
+ },
299
+ // 施工前置
300
+ async constructionBefore () {
301
+ let http = new HttpResetClass()
302
+ let data = {
303
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
304
+ }
305
+ let res = await http.load(
306
+ 'POST',
307
+ 'rs/sql/countApplyUserinfo',
308
+ {data: data},
309
+ {
310
+ resolveMsg: null,
311
+ rejectMsg: '安装明细查询失败!!!'
312
+ })
313
+ if (res.data[0].num > 0) {
314
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
315
+ throw `还有${res.data[0].num}户未安装,无法提交`
316
+ }
317
+ },
318
+ changePipeBuild () {
319
+ if (this.selectdata.f_process_dep === '工程部') {
320
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
321
+ }
322
+ if (this.selectdata.f_process_dep === '运营部') {
323
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
324
+ }
325
+ },
326
+ async getDevInfo () {
327
+ let data = {
328
+ tablename: 't_dev_info',
329
+ condition: `f_orgid = '${this.$login.f.orgid}'`
330
+ }
331
+ let res = await this.$resetpost(
332
+ `rs/sql/singleTable`,
333
+ {data: data},
334
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
335
+ )
336
+
337
+ return res.data.map(item => {
338
+ return {
339
+ label: item.f_dev_name,
340
+ value: item.f_dev_name
341
+ }
342
+ })
343
+ },
344
+ async getPrice (f_price_id) {
345
+ console.log('=======================')
346
+ console.log(f_price_id)
347
+
348
+ let data = {
349
+ condition: `sp.f_orgid = '${this.$login.f.orgid}'`
350
+ }
351
+
352
+ if (!isEmpty(f_price_id)) {
353
+ data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
354
+ }
355
+ let http = new HttpResetClass()
356
+ let res = await http.load(
357
+ 'POST',
358
+ `rs/sql/applyGetPrice`,
359
+ {data: data},
360
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
361
+ )
362
+
363
+ return res.data.map(item => {
364
+ return {
365
+ label: item.f_price_name,
366
+ value: item
367
+ }
368
+ })
369
+ }
370
+ },
371
+ events:{
372
+ // 终止报建初始化·
373
+ async 'stopApplyReadyEvent' () {
374
+
375
+ let f_is_stop = this.getLableValue('是否终止')
376
+
377
+ for (const item of this.show_data.fields) {
378
+ if (f_is_stop === '是') {
379
+ if (item.label === '终止原因') {
380
+ item.hidden = false
381
+ item.required = true
382
+ }
383
+ } else {
384
+ if (item.label === '终止原因') {
385
+ item.hidden = true
386
+ item.required = false
387
+ }
388
+ }
389
+ }
390
+
391
+ if (isEmpty(this.show_data.f_parent_process_id)) {
392
+ return
393
+ }
394
+ let data = {
395
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
396
+ data: {
397
+ id: this.$login.f.id,
398
+ orgid: this.$login.f.orgid
399
+ }
400
+ }
401
+ let res = await this.$resetpost(
402
+ `rs/sql/supervisory`,
403
+ {data: data},
404
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
405
+ )
406
+ this.show_data.parentApply = res.data[0]
407
+ },
408
+ // 通气点火初始化
409
+ async 'gasReadyEvent' () {
410
+ if (!isEmpty(this.show_data.f_price_id)) {
411
+ let priceList = await this.getPrice(this.show_data.f_price_id)
412
+ this.setLabelValue('气价名称', priceList[0].value)
413
+ }
414
+
415
+
416
+ // 保险初始化显示内容
417
+ let f_is_insure = this.getLableValue('是否购买保险')
418
+ for (const item of this.show_data.fields) {
419
+ if (f_is_insure === '是') {
420
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
421
+ item.hidden = false
422
+ item.required = true
423
+ }
424
+ if (item.label === '保险备注') {
425
+ item.hidden = false
426
+ }
427
+ } else {
428
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
429
+ item.hidden = true
430
+ item.required = false
431
+ }
432
+ if (item.label === '保险备注') {
433
+ item.hidden = true
434
+ }
435
+ }
436
+ }
437
+ },
438
+ // 申请节点初始化
439
+ 'applyReadyEvent' () {
440
+ this.$getConfig(this, 'UserAddress')
441
+
442
+ let f_address_type = this.show_data.f_address_type
443
+
444
+ for (const item of this.show_data.fields) {
445
+ if (f_address_type === '民用市区') {
446
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
447
+ item.hidden = false
448
+ item.required = true
449
+ }
450
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
451
+ item.hidden = false
452
+ item.required = false
453
+ }
454
+ if (item.label === '地址') {
455
+ item.readonly = true
456
+ }
457
+ }
458
+ if (f_address_type === '民用乡镇') {
459
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
460
+ item.hidden = false
461
+ item.required = true
462
+ }
463
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
464
+ item.hidden = false
465
+ item.required = false
466
+ }
467
+ if (item.label === '楼层') {
468
+ item.hidden = true
469
+ item.required = false
470
+ }
471
+ if (item.label === '地址') {
472
+ item.readonly = true
473
+ }
474
+ }
475
+ if (f_address_type === '特殊地址') {
476
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
477
+ item.hidden = false
478
+ item.required = true
479
+ }
480
+ if (item.label === '集收单位') {
481
+ item.hidden = false
482
+ item.required = false
483
+ }
484
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
485
+ item.hidden = true
486
+ item.required = false
487
+ }
488
+ if (item.label === '地址') {
489
+ item.readonly = false
490
+ }
491
+ }
492
+
493
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
494
+ item.hidden = true
495
+ }
496
+ }
497
+ },
498
+ },
499
+ watch: {
500
+ deep: true
501
+ }
502
+ }
503
+ </script>
504
+ <style scoped>
505
+ /*清除model中的浮动*/
506
+ .clearfix:after,.clearfix:before{
507
+ display: table;
508
+ }
509
+ .clearfix:after{
510
+ clear: both;
511
+ }
512
+ </style>