apply-clients 3.3.213 → 3.4.1

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 (93) hide show
  1. package/android.html +23 -23
  2. package/index.html +33 -33
  3. package/package.json +3 -3
  4. package/src/AndroidApp.vue +35 -30
  5. package/src/App.vue +20 -20
  6. package/src/android.js +21 -21
  7. package/src/apply.js +81 -90
  8. package/src/applyAndroid.js +2 -16
  9. package/src/components/android/AppOnetomany.vue +301 -285
  10. package/src/components/android/AppServiceView.vue +566 -570
  11. package/src/components/android/AppSign.vue +142 -142
  12. package/src/components/android/AppTakePic.vue +143 -144
  13. package/src/components/android/Process/AppExplorationUser.vue +320 -270
  14. package/src/components/android/Process/AppServiceControl.vue +757 -686
  15. package/src/components/android/Process/Processes/AppInstallationDetails.vue +456 -466
  16. package/src/components/android/ProgressReport/ProgressReportDetail.vue +64 -0
  17. package/src/components/android/ProgressReport/ProgressReportList.vue +209 -0
  18. package/src/components/android/Supervisory/AppProcessSupervisory.vue +73 -152
  19. package/src/components/android/Supervisory/AppSupervisoryCart.vue +121 -115
  20. package/src/components/android/TaskGraph.vue +125 -0
  21. package/src/components/product/ApplyCharge/ApplyChargeList.vue +36 -50
  22. package/src/components/product/ApplyCharge/ApplyChargeSearch.vue +3 -3
  23. package/src/components/product/Function/InstallFunction.vue +125 -122
  24. package/src/components/product/Function/InstallInfoSelect.vue +292 -318
  25. package/src/components/product/Function/Service/FunctionServiceControl.vue +222 -254
  26. package/src/components/product/Function/StopApplyCrrdList.vue +176 -0
  27. package/src/components/product/Function/functions/ApplyRecordCancel.vue +102 -0
  28. package/src/components/product/Function/functions/StopInstall.vue +106 -0
  29. package/src/components/product/Onetomany.vue +377 -296
  30. package/src/components/product/Order/OrderApply.vue +30 -30
  31. package/src/components/product/Order/OrderApplyList.vue +78 -67
  32. package/src/components/product/Order/OrderMessage.vue +11 -87
  33. package/src/components/product/Process/ExplorationSelect.vue +410 -369
  34. package/src/components/product/Process/ExplorationUser.vue +138 -128
  35. package/src/components/product/Process/Processes/InstallationDetails.vue +592 -504
  36. package/src/components/product/Process/Processes/Print/img/10101.png +0 -0
  37. package/src/components/product/Process/Processes/Print/img/1010109.png +0 -0
  38. package/src/components/product/Process/Processes/Print/img/1010110.png +0 -0
  39. package/src/components/product/Process/Processes/Print/img/1010111.png +0 -0
  40. package/src/components/product/Process/Processes/Print/img/1010112.png +0 -0
  41. package/src/components/product/Process/Processes/Print/printCharge.vue +142 -0
  42. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +207 -181
  43. package/src/components/product/Process/Processes/chargeManagement.vue +639 -638
  44. package/src/components/product/Process/Processes/devicesManagement.vue +22 -2
  45. package/src/components/product/Process/Processes/selectApply.vue +1 -1
  46. package/src/components/product/Process/Service/ServiceControl.vue +1254 -883
  47. package/src/components/product/Process/Service/ShowBackReason.vue +33 -0
  48. package/src/components/product/ServiceView.vue +631 -741
  49. package/src/components/product/Stop/StopApply.vue +103 -103
  50. package/src/components/product/Stop/StopApplyList.vue +269 -254
  51. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +186 -517
  52. package/src/components/product/Supervisory/SupervisoryControl.vue +100 -108
  53. package/src/components/product/Supervisory/SupervisoryList.vue +233 -253
  54. package/src/components/product/Supervisory/SupervisoryhCart.vue +107 -124
  55. package/src/components/product/VueUtils/ApplyUpload.vue +273 -264
  56. package/src/components/product/VueUtils/HighMeter.vue +208 -0
  57. package/src/expandcssAndroid.less +1034 -517
  58. package/src/filiale/yuchuan/android/Process/AppServiceControl.vue +548 -414
  59. package/src/filiale/yuchuan/android/Process/Processes/AppInstallationDetails.vue +754 -456
  60. package/src/filiale/yuchuan/android/Task/Survey/SurveyTsak.vue +60 -0
  61. package/src/filiale/yuchuan/android.js +7 -8
  62. package/src/filiale/yuchuan/pc/Order/OrderApply.vue +528 -517
  63. package/src/filiale/yuchuan/pc/Order/OrderApplyList.vue +343 -343
  64. package/src/filiale/yuchuan/pc/Process/ExplorationSelect.vue +270 -231
  65. package/src/filiale/yuchuan/pc/Process/ExplorationUser.vue +147 -131
  66. package/src/filiale/yuchuan/pc/Process/Processes/ApplyMapCom.vue +66 -0
  67. package/src/filiale/yuchuan/pc/Process/Processes/InstallationDetails.vue +759 -0
  68. package/src/filiale/yuchuan/pc/Process/Processes/chargeManagement.vue +470 -0
  69. package/src/filiale/yuchuan/pc/Process/Service/ServiceControl.vue +879 -517
  70. package/src/filiale/yuchuan/pc.js +11 -13
  71. package/src/main.js +23 -23
  72. package/src/components/android/Function/AppFunctionServiceControl.vue +0 -329
  73. package/src/components/android/Function/AppInstallFunction.vue +0 -330
  74. package/src/components/android/Process/Processes/AppBuildSign.vue +0 -47
  75. package/src/components/android/Process/Processes/AppChargeManagement.vue +0 -468
  76. package/src/components/android/Process/Processes/AppDevicesManagement.vue +0 -490
  77. package/src/components/android/Process/Processes/AppSupplementalAgreement.vue +0 -297
  78. package/src/components/image/dwg.jpg +0 -0
  79. package/src/components/image/yasuobao.jpg +0 -0
  80. package/src/components/product/Function/Inform.vue +0 -73
  81. package/src/components/product/Function/MarketSurvey.vue +0 -81
  82. package/src/components/product/Process/Processes/printCharge.vue +0 -121
  83. package/src/components/product/Process/ShowBackReason.vue +0 -33
  84. package/src/components/product/Supervisory/Service/printChargeNode.vue +0 -873
  85. package/src/components/product/VueUtils/GaoPaiYi/HighMeter.vue +0 -1090
  86. package/src/components/product/VueUtils/ToolsPage.vue +0 -51
  87. package/src/components/product/VueUtils/Tree.vue +0 -330
  88. package/src/filiale/wuan/android.js +0 -0
  89. package/src/filiale/wuan/pc.js +0 -4
  90. package/src/filiale/yuchuan/android/AppServiceView.vue +0 -599
  91. package/src/filiale/yuchuan/android/Reserve/ApplyReserve.vue +0 -200
  92. package/src/filiale/yuchuan/android/SiteSurvey/TaskGraph.vue +0 -137
  93. package/src/filiale/yuchuan/pc/Process/Processes/MapCom.vue +0 -51
@@ -1,883 +1,1254 @@
1
- <template>
2
-
3
- <div class="auto clearfix">
4
- <show-back-reason :selectdata="show_data"></show-back-reason>
5
- </div>
6
-
7
- <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
8
- </template>
9
- <script>
10
- import Vue from 'vue'
11
- import {HttpResetClass} from 'vue-client'
12
- import {isEmpty} from "../../../Util";
13
-
14
- // Date格式化
15
- Date.prototype.Format = function (fmt) {
16
- var o = {
17
- "M+": this.getMonth() + 1, //月份
18
- "d+": this.getDate(), //日
19
- "H+": this.getHours(), //小时
20
- "m+": this.getMinutes(), //分
21
- "s+": this.getSeconds(), //秒
22
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
23
- "S": this.getMilliseconds() //毫秒
24
- };
25
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
26
- for (var k in o)
27
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
28
- return fmt;
29
- }
30
-
31
- export default {
32
- title: '报建流程业务控制层',
33
- props: ['selectdata'],
34
- data () {
35
- return {
36
- data: null, // 数据库数据,json配置文件数据的数据集合
37
- json_datas: null, // Json配置文件集合
38
- showview: false, // 控制显示service-view组件
39
- show_data: null, // 给view层显示的数据
40
- config: {}
41
- }
42
- },
43
- ready () {
44
- this.refurbish()
45
- },
46
- methods: {
47
- // 组件初始化操作
48
- async refurbish() {
49
- this.json_datas = this.$workflow_vue
50
- let sum = 0
51
- let jsonData = {}
52
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
53
- this.$showMessage("网络故障,请刷新页面")
54
- return
55
- }
56
- this.json_datas.activitys.forEach(item => {
57
- if (this.selectdata.defname === item.title) {
58
- jsonData = item // 拿到当前节点的json配置信息
59
- sum++ // 节点名一样的个数
60
- }
61
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
62
- })
63
-
64
- if (sum === 0) {
65
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
66
- return
67
- }
68
- if (sum > 1) {
69
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
70
- return
71
- }
72
-
73
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
74
-
75
- // fields 字段填充值
76
- for (const item of this.selectdata.fields) {
77
- if (!item.value) {
78
- item.value = null
79
- }
80
-
81
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
82
- if (item.eval) {
83
- item.value = eval(item.default)
84
- } else {
85
- item.value = item.default
86
- }
87
- }
88
-
89
- if (this.selectdata[item.field]) {
90
- // 将json字符串格式化赋值给value
91
- if (String(this.selectdata[item.field]).startsWith("{")) {
92
- item.value = JSON.parse(this.selectdata[item.field])
93
- } else {
94
- item.value = this.selectdata[item.field]
95
- }
96
- }
97
- if (this.selectdata[item.field] === 0) {
98
- item.value = 0
99
- }
100
-
101
- // datepicker
102
- if (item.type === 'datepicker' && !item.value && item.default) {
103
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
104
- }
105
-
106
- // 如果配置类型为select,优先从参数列表获取options
107
- if (item.type === 'select' || item.type === 'checkbox') {
108
- if (item.param) {
109
- let temp = this.$appdata.getParam(item.label)
110
-
111
- if (temp && temp.length > 0) {
112
- item.options = temp
113
- }
114
-
115
- if (item.paramLabel) {
116
- temp = this.$appdata.getParam(item.paramLabel)
117
- if (temp && temp.length > 0) {
118
- item.options = temp
119
- }
120
- }
121
- }
122
- //
123
- if (item.ready) {
124
- item.options = await this[item.ready]()
125
- }
126
- }
127
-
128
- if (item.type === 'checkbox') {
129
- if (this.selectdata[item.field]) {
130
- item.value = JSON.parse(this.selectdata[item.field])
131
- } else {
132
- item.value = []
133
- }
134
- }
135
- }
136
-
137
- // 控制组件
138
- if (this.selectdata.components) {
139
- this.selectdata.components.forEach(item => {
140
- if (!item.mark) {
141
- item.mark = 0
142
- }
143
- })
144
- }
145
-
146
- // 初始化onetomany
147
- if (this.selectdata.onetomany) {
148
- for (const item of this.selectdata.onetomany) {
149
- let res = null
150
- if (item.queryEvent) {
151
- res = this[item.queryEvent]()
152
- } else {
153
- let data = {
154
- tablename: item.tables[0],
155
- condition: `f_process_id='${this.selectdata.f_process_id}'`
156
- }
157
- res = await this.$resetpost(
158
- 'rs/sql/singleTable',
159
- {data: data},
160
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
161
- )
162
- }
163
-
164
- item.rows = res.data
165
-
166
- // 初始化onetomany中的fields
167
- for (const field of item.fields) {
168
- if (!field.value) {
169
- if (field.value !== 0) {
170
- field.value = null
171
- }
172
- }
173
-
174
- if (field.default || field.default === 0) {
175
- field.value = field.default
176
- }
177
-
178
- // datepicker
179
- if (field.type === 'datepicker' && !field.value && field.default) {
180
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
181
- }
182
-
183
- if (field.type === 'select') {
184
-
185
- let temp = this.$appdata.getParam(field.label)
186
-
187
- if (temp && temp.length > 0) {
188
- field.options = temp
189
- }
190
-
191
- if (field.paramLabel) {
192
- temp = this.$appdata.getParam(field.paramLabel)
193
- if (temp && temp.length > 0) {
194
- item.options = temp
195
- }
196
- }
197
-
198
- }
199
- }
200
- }
201
- }
202
-
203
- // 初始化 buttons_fields
204
- for (const item of this.selectdata.buttons) {
205
- if (item.button_name === '下发') {
206
-
207
- let data = {
208
- source: item.source,
209
- userid: this.$login.f.id
210
- }
211
- if (item.sourceMethod) {
212
- data.source = this[item.sourceMethod]()
213
- }
214
- if (!data.source) {
215
- this.$showMessage("请配置获取人员表达式")
216
- return
217
- }
218
-
219
- let res = await this.$resetpost(
220
- 'rs/search',
221
- {data: data},
222
- {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
223
- )
224
-
225
- let options = res.data.map(source => {
226
- return {
227
- "label": source.name,
228
- "value": source.id
229
- }
230
- })
231
-
232
- if (item.button_fields.length !== 1) {
233
- this.$showMessage("下发有且只能有一个字段!!!")
234
- return
235
- }
236
-
237
- item.button_fields[0].options = options
238
- }
239
- if (item.button_fields) {
240
- item.button_fields.forEach(x => {
241
- // 如果配置类型为select,优先从参数列表获取options
242
- if (x.type === 'select') {
243
-
244
- if (x.param) {
245
- let temp = this.$appdata.getParam(x.label)
246
-
247
- if (temp && temp.length > 0) {
248
- x.options = temp
249
- }
250
-
251
- if (x.paramLabel) {
252
- temp = this.$appdata.getParam(x.paramLabel)
253
- if (temp && temp.length > 0) {
254
- x.options = temp
255
- }
256
- }
257
- }
258
-
259
- }
260
- })
261
- }
262
- }
263
-
264
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
265
- let temp = JSON.parse(JSON.stringify(this.selectdata))
266
-
267
- this.show_data = temp
268
- this.$nextTick(() => {
269
- this.showview = true
270
- })
271
- },
272
- // 金额转大写
273
- smalltoBIG(n) {
274
- let fraction = ['角', '分'];
275
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
276
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
277
- let head = n < 0 ? '欠' : '';
278
- n = Math.abs(n);
279
-
280
- let s = '';
281
-
282
- for (var i = 0; i < fraction.length; i++) {
283
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
284
- }
285
- s = s || '整';
286
- n = Math.floor(n);
287
-
288
- for (var i = 0; i < unit[0].length && n > 0; i++) {
289
- let p = '';
290
- for (var j = 0; j < unit[1].length && n > 0; j++) {
291
- p = digit[n % 10] + unit[1][j] + p;
292
- n = Math.floor(n / 10);
293
- }
294
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
295
- }
296
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
297
- },
298
- getLableValue(label) {
299
- for (const item of this.show_data.fields) {
300
- if (item.label === label && item.type !== 'number') {
301
- return item.value || ''
302
- }
303
- if (item.label === label && item.type === 'number') {
304
- return item.value || 0
305
- }
306
- }
307
- },
308
- getLableOptions(label) {
309
- for (const item of this.show_data.fields) {
310
- if (item.label === label) {
311
- return item.options
312
- }
313
- }
314
- },
315
- setLabelValue(label, value) {
316
- for (const item of this.show_data.fields) {
317
- if (item.label === label) {
318
- item.value = value
319
- this.show_data[item.field] = value
320
- }
321
- }
322
- },
323
- setLabelOptions(label, options) {
324
- for (const item of this.show_data.fields) {
325
- if (item.label === label) {
326
- item.options = options
327
- }
328
- }
329
- },
330
- async checkDuplicate(index) {
331
- let http = new HttpResetClass()
332
- let data = {
333
- tablename: 't_apply',
334
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
335
- }
336
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
337
- resolveMsg: null,
338
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
339
- })
340
- if (res.data.length > 0) {
341
- this.show_data.fields[index].value = null
342
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
343
- }
344
- },
345
- // 获取区县
346
- async getPcd () {
347
- let data = {
348
- tablename: 't_pcd',
349
- condition: `f_filialeid = '${this.$login.f.orgid}'`
350
- }
351
- let http = new HttpResetClass()
352
- let res = await http.load(
353
- 'POST',
354
- `rs/sql/singleTable`,
355
- {data: data},
356
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
357
- )
358
-
359
- return res.data.map(item => {
360
- return {
361
- label: item.f_pcd,
362
- value: item.f_pcd
363
- }
364
- })
365
- },
366
- // 缴费前置
367
- chargeBefore () {
368
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
369
- this.$showAlert('费用未结清!!!', 'warning', 3000)
370
- throw null
371
- }
372
- },
373
- // 施工前置
374
- async constructionBefore () {
375
- let http = new HttpResetClass()
376
- let data = {
377
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
378
- }
379
- let res = await http.load(
380
- 'POST',
381
- 'rs/sql/countApplyUserinfo',
382
- {data: data},
383
- {
384
- resolveMsg: null,
385
- rejectMsg: '安装明细查询失败!!!'
386
- })
387
- // if (res.data[0].num > 0) {
388
- // this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
389
- // throw `还有${res.data[0].num}户未安装,无法提交`
390
- // }
391
- },
392
- changePipeBuild () {
393
- if (this.selectdata.f_process_dep === '工程部') {
394
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
395
- }
396
- if (this.selectdata.f_process_dep === '运营部') {
397
- return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
398
- }
399
- },
400
- async getDevInfo () {
401
- let data = {
402
- tablename: 't_dev_info',
403
- condition: `f_orgid = '${this.$login.f.orgid}'`
404
- }
405
- let res = await this.$resetpost(
406
- `rs/sql/singleTable`,
407
- {data: data},
408
- {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
409
- )
410
-
411
- return res.data.map(item => {
412
- return {
413
- label: item.f_dev_name,
414
- value: item.f_dev_name
415
- }
416
- })
417
- }
418
- },
419
- events: {
420
- // 选择开发商
421
- async 'devInfoChange' (index) {
422
- if (isEmpty(this.show_data.f_company_name)) {
423
- return
424
- }
425
- let data = {
426
- tablename: 't_dev_info',
427
- condition: `f_orgid = '${this.$login.f.orgid}' and f_dev_name = '${this.show_data.f_company_name}'`
428
- }
429
- let res = await this.$resetpost(
430
- `rs/sql/singleTable`,
431
- {data: data},
432
- {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
433
- )
434
- this.show_data.f_dev_id = res.data[0].id
435
- this.setLabelValue('法人名称', res.data[0].f_legal_person)
436
- this.setLabelValue('身份证', res.data[0].f_idnumber)
437
- this.setLabelValue('营业执照', res.data[0].f_business_license)
438
- },
439
- // 退款金额
440
- 'refundMoneyChange' (index) {
441
- let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
442
- let f_refund_money = this.show_data.fields[index].value
443
-
444
- if (f_refund_money > f_cumulative_payment_money) {
445
- this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
446
- this.show_data.fields[index].value = null
447
- }
448
- },
449
- // 检查重复
450
- 'checkRepeat' (index) {
451
- this.checkDuplicate(index)
452
- },
453
- // 选择报建项目
454
- 'selectApply' (row) {
455
- this.setLabelValue('工程名称', row.f_entry_name)
456
- this.setLabelValue('工程编号', row.f_apply_num)
457
- this.setLabelValue('报建类型', row.f_apply_type)
458
- this.setLabelValue('用户名称', row.f_user_name)
459
- this.setLabelValue('用户电话', row.f_phone)
460
- this.setLabelValue('证件类型', row.f_credentials)
461
- this.setLabelValue('证件号码', row.f_idnumber)
462
- this.setLabelValue('地址', row.f_address)
463
- this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
464
-
465
- this.show_data.parentApply = JSON.parse(JSON.stringify(row))
466
-
467
- delete row.id
468
- delete row.actid
469
- delete row.defid
470
- delete row.defname
471
- delete row.version
472
- delete row.f_apply_num
473
- delete row.f_sub_state
474
- delete row.f_apply_type
475
- delete row.f_process_id
476
-
477
- this.show_data = Object.assign({}, this.show_data, row)
478
-
479
- this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
480
- },
481
- // 是否终止
482
- 'isStopChange' (index) {
483
- let f_is_stop = this.show_data.f_is_stop
484
-
485
- for (const item of this.show_data.fields) {
486
- if (f_is_stop === '是') {
487
- if (item.label === '终止原因') {
488
- item.hidden = false
489
- item.required = true
490
- }
491
- } else {
492
- if (item.label === '终止原因') {
493
- item.hidden = true
494
- item.required = false
495
- }
496
- }
497
- }
498
- },
499
- async 'stopApplyReadyEvent' () {
500
-
501
- let f_is_stop = this.getLableValue('是否终止')
502
-
503
- for (const item of this.show_data.fields) {
504
- if (f_is_stop === '是') {
505
- if (item.label === '终止原因') {
506
- item.hidden = false
507
- item.required = true
508
- }
509
- } else {
510
- if (item.label === '终止原因') {
511
- item.hidden = true
512
- item.required = false
513
- }
514
- }
515
- }
516
-
517
- if (isEmpty(this.show_data.f_parent_process_id)) {
518
- return
519
- }
520
- let data = {
521
- condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
522
- data: {
523
- id: this.$login.f.id,
524
- orgid: this.$login.f.orgid
525
- }
526
- }
527
- let res = await this.$resetpost(
528
- `rs/sql/supervisory`,
529
- {data: data},
530
- {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
531
- )
532
- this.show_data.parentApply = res.data[0]
533
- },
534
- // 选择用户档案信息
535
- 'selectUserinfo' (row) {
536
- this.setLabelValue('用户编号', row.f_userinfo_code)
537
- this.setLabelValue('用户名称', row.f_user_name)
538
- this.setLabelValue('用户电话', row.f_user_phone)
539
- this.setLabelValue('证件类型', row.f_credentials)
540
- this.setLabelValue('证件号码', row.f_idnumber)
541
- this.setLabelValue('地址', row.f_address)
542
-
543
- this.show_data.f_userinfo_id = row.f_userinfo_id
544
- this.show_data.f_userinfo_code = row.f_userinfo_code
545
- },
546
- // 合同金额失去焦点
547
- async 'contractMoneyChange' (index) {
548
- let data = {
549
- operator: '+',
550
- num1: this.show_data.f_contract_money || 0,
551
- num2: this.getLableValue('追加金额') || 0
552
- }
553
- let res = await this.$resetpost(
554
- `rs/logic/compute`,
555
- {data: data},
556
- {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
557
- )
558
-
559
- this.setLabelValue('应交金额', res.data)
560
- },
561
-
562
- // 区县失去焦点
563
- async 'pcdChange' (index) {
564
- if (isEmpty(this.show_data.f_pcd)) {
565
- return
566
- }
567
-
568
- this.setLabelValue('街道', null)
569
-
570
- let data = {
571
- tablename: 't_street',
572
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
573
- }
574
- let res = await this.$resetpost(
575
- `rs/sql/singleTable`,
576
- {data: data},
577
- {resolveMsg: null, rejectMsg: '街道查询失败!!!'}
578
- )
579
-
580
- this.setLabelOptions('街道', res.data.map(item => {
581
- return {
582
- label: item.f_street,
583
- value: item.f_street
584
- }
585
- }))
586
- },
587
- // 街道失去焦点
588
- async 'streetChange' (index) {
589
- if (isEmpty(this.show_data.f_street)) {
590
- return
591
- }
592
-
593
- this.setLabelValue('小区', null)
594
-
595
- let data = {
596
- tablename: 't_area',
597
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
598
- }
599
- let http = new HttpResetClass()
600
- let res = await http.load(
601
- 'POST',
602
- `rs/sql/singleTable`,
603
- {data: data},
604
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
605
- )
606
-
607
- this.setLabelOptions('小区', res.data.map(item => {
608
- return {
609
- label: item.f_residential_area,
610
- value: item.f_residential_area
611
- }
612
- }))
613
- },
614
- // 地址类型失去焦点
615
- 'addressTypeChange' (index) {
616
- let f_address_type = this.show_data.f_address_type
617
- for (const item of this.show_data.fields) {
618
- if (f_address_type === '民用地址') {
619
- if (item.label === '区域' || item.label === '街道' || item.label === '小区' ||item.label === '楼号' || item.label === '单元' || item.label === '楼层' || item.label === '门牌号') {
620
- item.hidden = false
621
- item.required = true
622
- item.value = null
623
- }
624
- }
625
- if (f_address_type === '特殊地址') {
626
- if (item.label === '区域') {
627
- item.hidden = false
628
- item.required = true
629
- item.value = null
630
- }
631
- if(item.label === '街道' || item.label === '小区' ||item.label === '楼号' || item.label === '单元' || item.label === '楼层' || item.label === '门牌号'){
632
- item.hidden = true
633
- item.required = false
634
- item.value = null
635
- }
636
- }
637
- if (item.label === '地址') {
638
- item.value = null
639
- }
640
- }
641
- },
642
- // 申请节点初始化
643
- 'applyReadyEvent' () {
644
- this.$getConfig(this, 'UserAddress')
645
-
646
- let f_address_type = this.show_data.f_address_type
647
-
648
- for (const item of this.show_data.fields) {
649
- if (f_address_type === '民用地址') {
650
- if (item.label === '区域' || item.label === '街道' || item.label === '小区' ||item.label === '楼号' || item.label === '单元' || item.label === '楼层' || item.label === '门牌号') {
651
- item.hidden = false
652
- item.required = true
653
- item.value = null
654
- }
655
- }
656
- if (f_address_type === '特殊地址') {
657
- if (item.label === '区域') {
658
- item.hidden = false
659
- item.required = false
660
- item.value = null
661
- }
662
- }
663
-
664
- if (this.show_data.f_apply_source === '线下发起' && item.label === '地址') {
665
- item.hidden = true
666
- }
667
- }
668
- },
669
- // ===========================================
670
- async 'button'() {
671
- if (this.show_data.button.before) {
672
- await this[this.show_data.button.before]()
673
- }
674
- // 点击重置按钮就重置数据
675
- if (this.show_data.button.button_name === '重置') {
676
- this.$dispatch('breakControl', this.selectdata)
677
- return
678
- }
679
-
680
- this.show_data.user = this.$login.f
681
- this.show_data.start_activity = this.$workflow_vue.start_activity
682
- this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
683
-
684
- let res = await this.$resetpost(
685
- `rs/logic/ApplyProductService`,
686
- {data: this.show_data},
687
- {resolveMsg: null, rejectMsg: '数据保存失败'}
688
- )
689
-
690
- if (this.show_data.button.after) {
691
- this[this.show_data.button.after]()
692
- }
693
-
694
-
695
-
696
- this.$dispatch('search')
697
- },
698
- // 失去焦点出触发事件
699
- 'onchange' (index) {
700
-
701
- if(this.show_data.defname === '方案确定' && this.$refs.serviceview.model.parentname == '经理部'){
702
- if(this.show_data.f_budget_no ===''){
703
- for (const button of this.show_data.buttons) {
704
- if(button.button_name === '跳过') {
705
- button.hidden = true
706
- }}}
707
- if(this.show_data.fields[index].label==='是否跳过预算'){
708
- for (const button of this.show_data.buttons) {
709
- if( (this.show_data.fields[index].value === '否' || this.show_data.fields[index].value ==='') && button.button_name === '跳过') {
710
- button.hidden = true
711
- } else {
712
- button.hidden = false
713
- }
714
- }
715
- }
716
- }
717
- if(this.show_data.defname === '合同签订' && this.$refs.serviceview.model.parentname === '经理部'){
718
- if(this.show_data.f_toll_no ===''){
719
- for (const button of this.show_data.buttons) {
720
- if(button.button_name === '跳过') {
721
- button.hidden = true
722
- }}}
723
- if(this.show_data.fields[index].label==='是否跳过收费'){
724
- for (const button of this.show_data.buttons) {
725
- if ((this.show_data.fields[index].value === '否' || this.show_data.fields[index].value ==='') && button.button_name === '跳过') {
726
- button.hidden = true
727
- } else {
728
- button.hidden = false
729
- }
730
- }
731
- }
732
- }
733
- if(this.show_data.defname === '发起施工' && this.$refs.serviceview.model.parentname === '经理部'){
734
- if(this.show_data.f_drawing_issuance_no === ''){
735
- for (const button of this.show_data.buttons) {
736
- if(button.button_name === '跳过') {
737
- button.hidden = true
738
- }}}
739
- if(this.show_data.fields[index].label==='是否跳过图纸下发'){
740
- for (const button of this.show_data.buttons) {
741
- if ((this.show_data.fields[index].value === '' || this.show_data.fields[index].value ==='') && button.button_name === '跳过') {
742
- button.hidden = true
743
- } else {
744
- button.hidden = false
745
- }
746
- }
747
- }
748
- }
749
-
750
- if ((this.show_data.f_apply_type==='工商户报建' ||this.show_data.f_apply_type==='开发商集体报建'||this.show_data.f_apply_type==='预埋管报建')&&this.show_data.defname === '用户受理') {
751
- if (
752
- this.show_data.fields[index].label === '街道' ||
753
- this.show_data.fields[index].label === '区域'
754
- ) {
755
-
756
- let f_street = this.getLableValue('街道')
757
- let f_pcd = this.getLableValue('区域')
758
-
759
- let f_address = null
760
-
761
- f_address = f_pcd + f_street
762
- this.setLabelValue('地址',f_address)
763
-
764
- }
765
- }
766
- if(this.show_data.f_apply_type==='散户报建'&& this.show_data.f_address_type==='民用地址' && this.show_data.defname === '用户受理'){
767
- if (
768
- this.show_data.fields[index].label === '区域' ||
769
- this.show_data.fields[index].label === '街道'||
770
- this.show_data.fields[index].label === '小区'||
771
- this.show_data.fields[index].label === '楼号' ||
772
- this.show_data.fields[index].label === '单元'||
773
- this.show_data.fields[index].label === '楼层' ||
774
- this.show_data.fields[index].label === '门牌号'
775
- ){
776
- let f_pcd = this.getLableValue('区域')
777
- let f_street = this.getLableValue('街道')
778
- let f_residential_area = this.getLableValue('小区')
779
- let f_building = this.getLableValue('楼号')
780
- let f_unit = this.getLableValue('单元')
781
- let f_floor = this.getLableValue('楼层')
782
- let f_room = this.getLableValue('门牌号')
783
-
784
- let f_address = null
785
-
786
- f_address = f_pcd + f_street + f_residential_area + f_building + f_unit + f_floor + f_room
787
- this.setLabelValue('地址',f_address)
788
- }
789
- }
790
- if(this.show_data.f_apply_type==='散户报建'&& this.show_data.f_address_type==='特殊地址' && this.show_data.defname === '用户受理'){
791
- if (
792
- this.show_data.fields[index].label === '区域'
793
- ){
794
- let f_pcd = this.getLableValue('区域')
795
-
796
- let f_address = null
797
-
798
- f_address = f_pcd
799
- this.setLabelValue('地址',f_address)
800
- }
801
- }
802
-
803
-
804
-
805
- },
806
- 'onblur' (index) {},
807
- 'oninput' (index) {},
808
- 'initializtionView' () {},
809
- async 'onchangeModal' (index, fieldIndex) {
810
- },
811
- async 'onblurModal' (index, fieldIndex) {
812
-
813
- },
814
- async 'oninputModal' (index, fieldIndex) {
815
-
816
- },
817
- async 'onetomanydelete' (index, rowIndex) {
818
-
819
- let http = new HttpResetClass()
820
-
821
- let res = await http.load(
822
- 'DELETE',
823
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
824
- null,
825
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
826
- )
827
-
828
- this.$dispatch('breakControl', this.show_data)
829
- },
830
- async 'onetomanyupdate' (index, rowIndex) {
831
- let data = this.show_data.onetomany[index].rows[rowIndex]
832
-
833
- this.show_data.onetomany[index].fields.forEach(item => {
834
- data[item.field] = item.value
835
- })
836
- let res = await this.$resetpost(
837
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
838
- data
839
- )
840
-
841
- this.$dispatch('breakControl', this.show_data)
842
- },
843
- async 'onetomanyadd' (index) {
844
- let data = {
845
- f_process_id : this.show_data.f_process_id,
846
- f_operator_id: this.$login.f.id,
847
- f_operator: this.$login.f.name,
848
- f_operation_date: new Date(),
849
- f_orgid: this.$login.f.orgid,
850
- f_orgname: this.$login.f.orgs
851
- }
852
- this.show_data.onetomany[index].fields.forEach(item => {
853
- data[item.field] = item.value
854
- })
855
- let res = await this.$resetpost(
856
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
857
- data
858
- )
859
- this.$dispatch('breakControl', this.show_data)
860
- },
861
- 'onbutchange' (index) {
862
-
863
- },
864
- 'onbutblur' (index) {
865
-
866
- },
867
- 'onbutinput' (index) {
868
-
869
- }
870
- },
871
- watch: {
872
- }
873
- }
874
- </script>
875
- <style scoped>
876
- /*清除model中的浮动*/
877
- .clearfix:after,.clearfix:before{
878
- display: table;
879
- }
880
- .clearfix:after{
881
- clear: both;
882
- }
883
- </style>
1
+ <template>
2
+ <div class="" v-if="showview">
3
+ <show-back-reason :selectdata="show_data"></show-back-reason>
4
+ <service-view v-ref:serviceview :data="show_data"></service-view>
5
+ </div>
6
+ </template>
7
+ <script>
8
+ import Vue from 'vue'
9
+ import {HttpResetClass} from 'vue-client'
10
+ import {isEmpty} from "../../../Util";
11
+
12
+ // Date格式化
13
+ Date.prototype.Format = function (fmt) {
14
+ var o = {
15
+ "M+": this.getMonth() + 1, //月份
16
+ "d+": this.getDate(), //日
17
+ "H+": this.getHours(), //小时
18
+ "m+": this.getMinutes(), //分
19
+ "s+": this.getSeconds(), //秒
20
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
21
+ "S": this.getMilliseconds() //毫秒
22
+ };
23
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
24
+ for (var k in o)
25
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
26
+ return fmt;
27
+ }
28
+
29
+ export default {
30
+ title: '报建流程业务控制层',
31
+ props: ['selectdata'],
32
+ data () {
33
+ return {
34
+ data: null, // 数据库数据,json配置文件数据的数据集合
35
+ json_datas: null, // Json配置文件集合
36
+ showview: false, // 控制显示service-view组件
37
+ show_data: null, // 给view层显示的数据
38
+ config: {}
39
+ }
40
+ },
41
+ ready () {
42
+ this.refurbish()
43
+ },
44
+ methods: {
45
+ // 组件初始化操作
46
+ async refurbish() {
47
+ this.json_datas = this.$workflow_vue
48
+ let sum = 0
49
+ let jsonData = {}
50
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
51
+ this.$showMessage("网络故障,请刷新页面")
52
+ return
53
+ }
54
+ this.json_datas.activitys.forEach(item => {
55
+ if (this.selectdata.defname === item.title) {
56
+ jsonData = item // 拿到当前节点的json配置信息
57
+ sum++ // 节点名一样的个数
58
+ }
59
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
60
+ })
61
+
62
+ if (sum === 0) {
63
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
64
+ return
65
+ }
66
+ if (sum > 1) {
67
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
68
+ return
69
+ }
70
+
71
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
72
+
73
+ // fields 字段填充值
74
+ for (const item of this.selectdata.fields) {
75
+ if (!item.value) {
76
+ item.value = null
77
+ }
78
+
79
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
80
+ if (item.eval) {
81
+ item.value = eval(item.default)
82
+ } else {
83
+ item.value = item.default
84
+ }
85
+ }
86
+
87
+ if (this.selectdata[item.field]) {
88
+ // 将json字符串格式化赋值给value
89
+ if (String(this.selectdata[item.field]).startsWith("{")) {
90
+ item.value = JSON.parse(this.selectdata[item.field])
91
+ } else {
92
+ item.value = this.selectdata[item.field]
93
+ }
94
+ }
95
+ if (this.selectdata[item.field] === 0) {
96
+ item.value = 0
97
+ }
98
+
99
+ // datepicker
100
+ if (item.type === 'datepicker' && !item.value && item.default) {
101
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
102
+ }
103
+
104
+ // 如果配置类型为select,优先从参数列表获取options
105
+ if (item.type === 'select' || item.type === 'checkbox') {
106
+ if (item.param) {
107
+ let temp = this.$appdata.getParam(item.label)
108
+
109
+ if (temp && temp.length > 0) {
110
+ item.options = temp
111
+ }
112
+
113
+ if (item.paramLabel) {
114
+ temp = this.$appdata.getParam(item.paramLabel)
115
+ if (temp && temp.length > 0) {
116
+ item.options = temp
117
+ }
118
+ }
119
+ }
120
+
121
+ if (item.ready) {
122
+ item.options = await this[item.ready]()
123
+ }
124
+ }
125
+
126
+
127
+ if (item.type === 'checkbox') {
128
+ if (this.selectdata[item.field]) {
129
+ item.value = JSON.parse(this.selectdata[item.field])
130
+ } else {
131
+ item.value = []
132
+ }
133
+ }
134
+
135
+ this.selectdata[item.field] = item.value
136
+ }
137
+
138
+ // 控制组件
139
+ if (this.selectdata.components) {
140
+ this.selectdata.components.forEach(item => {
141
+ if (!item.mark) {
142
+ item.mark = 0
143
+ }
144
+ })
145
+ }
146
+
147
+ // 初始化onetomany
148
+ if (this.selectdata.onetomany) {
149
+ for (const item of this.selectdata.onetomany) {
150
+ let res = null
151
+ if (item.queryEvent) {
152
+ res = this[item.queryEvent]()
153
+ } else {
154
+ let data = {
155
+ tablename: item.tables[0],
156
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
157
+ }
158
+ res = await this.$resetpost(
159
+ 'rs/sql/singleTable',
160
+ {data: data},
161
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
162
+ )
163
+ }
164
+
165
+ item.rows = res.data
166
+
167
+ // 初始化onetomany中的fields
168
+ for (const field of item.fields) {
169
+ if (!field.value) {
170
+ if (field.value !== 0) {
171
+ field.value = null
172
+ }
173
+ }
174
+
175
+ if (field.default || field.default === 0) {
176
+ field.value = field.default
177
+ }
178
+
179
+ // datepicker
180
+ if (field.type === 'datepicker' && !field.value && field.default) {
181
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
182
+ }
183
+
184
+ if (field.type === 'select') {
185
+
186
+ let temp = this.$appdata.getParam(field.label)
187
+
188
+ if (temp && temp.length > 0) {
189
+ field.options = temp
190
+ }
191
+
192
+ if (field.paramLabel) {
193
+ temp = this.$appdata.getParam(field.paramLabel)
194
+ if (temp && temp.length > 0) {
195
+ item.options = temp
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ }
202
+
203
+ // 初始化 buttons_fields
204
+ for (const item of this.selectdata.buttons) {
205
+ if (item.button_name === '下发') {
206
+
207
+ let data = {
208
+ source: item.source,
209
+ userid: this.$login.f.id
210
+ }
211
+ if (item.sourceMethod) {
212
+ data.source = this[item.sourceMethod]()
213
+ }
214
+ if (!data.source) {
215
+ this.$showMessage("请配置获取人员表达式")
216
+ return
217
+ }
218
+
219
+ let res = await this.$resetpost(
220
+ 'rs/search',
221
+ {data: data},
222
+ {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
223
+ )
224
+
225
+ let options = res.data.map(source => {
226
+ return {
227
+ "label": source.name,
228
+ "value": source.id
229
+ }
230
+ })
231
+
232
+ if (item.button_fields.length !== 1) {
233
+ this.$showMessage("下发有且只能有一个字段!!!")
234
+ return
235
+ }
236
+
237
+ item.button_fields[0].options = options
238
+ }
239
+ if (item.button_fields) {
240
+ item.button_fields.forEach(x => {
241
+ // 如果配置类型为select,优先从参数列表获取options
242
+ if (x.type === 'select') {
243
+
244
+ if (x.param) {
245
+ let temp = this.$appdata.getParam(x.label)
246
+
247
+ if (temp && temp.length > 0) {
248
+ x.options = temp
249
+ }
250
+
251
+ if (x.paramLabel) {
252
+ temp = this.$appdata.getParam(x.paramLabel)
253
+ if (temp && temp.length > 0) {
254
+ x.options = temp
255
+ }
256
+ }
257
+ }
258
+
259
+ }
260
+ })
261
+ }
262
+ }
263
+
264
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
265
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
266
+
267
+ this.show_data = temp
268
+ this.$nextTick(() => {
269
+ this.showview = true
270
+ })
271
+ },
272
+ // 金额转大写
273
+ smalltoBIG(n) {
274
+ let fraction = ['角', '分'];
275
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
276
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
277
+ let head = n < 0 ? '欠' : '';
278
+ n = Math.abs(n);
279
+
280
+ let s = '';
281
+
282
+ for (var i = 0; i < fraction.length; i++) {
283
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
284
+ }
285
+ s = s || '整';
286
+ n = Math.floor(n);
287
+
288
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
289
+ let p = '';
290
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
291
+ p = digit[n % 10] + unit[1][j] + p;
292
+ n = Math.floor(n / 10);
293
+ }
294
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
295
+ }
296
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
297
+ },
298
+ getLableValue(label) {
299
+ for (const item of this.show_data.fields) {
300
+ if (item.label === label && item.type !== 'number') {
301
+ return item.value || ''
302
+ }
303
+ if (item.label === label && item.type === 'number') {
304
+ return item.value || 0
305
+ }
306
+ }
307
+ },
308
+ getLableOptions(label) {
309
+ for (const item of this.show_data.fields) {
310
+ if (item.label === label) {
311
+ return item.options
312
+ }
313
+ }
314
+ },
315
+ setLabelValue(label, value) {
316
+ for (const item of this.show_data.fields) {
317
+ if (item.label === label) {
318
+ item.value = value
319
+ this.show_data[item.field] = value
320
+ }
321
+ }
322
+ },
323
+ setLabelOptions(label, options) {
324
+ for (const item of this.show_data.fields) {
325
+ if (item.label === label) {
326
+ item.options = options
327
+ }
328
+ }
329
+ },
330
+ showLabels(...labels) {
331
+ for (const item of this.show_data.fields) {
332
+ if (labels.includes(item.label)) {
333
+ item.hidden = false
334
+ }
335
+ }
336
+ },
337
+ hideLabels(...labels) {
338
+ for (const item of this.show_data.fields) {
339
+ if (labels.includes(item.label)) {
340
+ item.hidden = true
341
+ }
342
+ }
343
+ },
344
+ requiredLabels(...labels) {
345
+ for (const item of this.show_data.fields) {
346
+ if (labels.includes(item.label)) {
347
+ item.required = true
348
+ }
349
+ }
350
+ },
351
+ electiveLabels(...labels) {
352
+ for (const item of this.show_data.fields) {
353
+ if (labels.includes(item.label)) {
354
+ item.required = false
355
+ }
356
+ }
357
+ },
358
+ readonlyLabels(...labels) {
359
+ for (const item of this.show_data.fields) {
360
+ if (labels.includes(item.label)) {
361
+ item.readonly = true
362
+ item.disabled = true
363
+ }
364
+ }
365
+ },
366
+ readwriteLabels(...labels) {
367
+ for (const item of this.show_data.fields) {
368
+ if (labels.includes(item.label)) {
369
+ item.readonly = false
370
+ item.disabled = false
371
+ }
372
+ }
373
+ },
374
+ async checkDuplicate(index) {
375
+ let http = new HttpResetClass()
376
+ let data = {
377
+ tablename: 't_apply',
378
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
379
+ }
380
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
381
+ resolveMsg: null,
382
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
383
+ })
384
+ if (res.data.length > 0) {
385
+ this.show_data.fields[index].value = null
386
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
387
+ }
388
+ },
389
+ // 获取片区
390
+ async getSliceArea () {
391
+ let data = {
392
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
393
+ userid: this.$login.f.id
394
+ }
395
+
396
+ let http = new HttpResetClass()
397
+ let res = await http.load(
398
+ 'POST',
399
+ `rs/search`,
400
+ {data: data},
401
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
402
+ )
403
+
404
+ return res.data.map(item => {
405
+ return {
406
+ label: item.name,
407
+ value: item.name
408
+ }
409
+ })
410
+ },
411
+ // 获取区县
412
+ async getPcd () {
413
+ let data = {
414
+ tablename: 't_pcd',
415
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
416
+ }
417
+ let http = new HttpResetClass()
418
+ let res = await http.load(
419
+ 'POST',
420
+ `rs/sql/singleTable`,
421
+ {data: data},
422
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
423
+ )
424
+
425
+ return res.data.map(item => {
426
+ return {
427
+ label: item.f_pcd,
428
+ value: item.f_pcd
429
+ }
430
+ })
431
+ },
432
+ // 缴费前置
433
+ chargeBefore () {
434
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
435
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
436
+ throw null
437
+ }
438
+ },
439
+ // 施工前置
440
+ async constructionBefore () {
441
+ let http = new HttpResetClass()
442
+ let data = {
443
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
444
+ }
445
+ let res = await http.load(
446
+ 'POST',
447
+ 'rs/sql/countApplyUserinfo',
448
+ {data: data},
449
+ {
450
+ resolveMsg: null,
451
+ rejectMsg: '安装明细查询失败!!!'
452
+ })
453
+ if (res.data[0].num > 0) {
454
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
455
+ throw `还有${res.data[0].num}户未安装,无法提交`
456
+ }
457
+ },
458
+ changePipeBuild () {
459
+ if (this.selectdata.f_process_dep === '工程部') {
460
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
461
+ }
462
+ if (this.selectdata.f_process_dep === '运营部') {
463
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
464
+ }
465
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
466
+ },
467
+ async getDevInfo () {
468
+ let data = {
469
+ tablename: 't_dev_info',
470
+ condition: `f_orgid = '${this.$login.f.orgid}'`
471
+ }
472
+ let http = new HttpResetClass()
473
+ let res = await http.load(
474
+ 'POST',
475
+ `rs/sql/singleTable`,
476
+ {data: data},
477
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
478
+ )
479
+
480
+ return res.data.map(item => {
481
+ return {
482
+ label: item.f_dev_name,
483
+ value: item.f_dev_name
484
+ }
485
+ })
486
+ },
487
+ async getPrice (f_price_id) {
488
+ console.log('=======================')
489
+ console.log(f_price_id)
490
+
491
+ let data = {
492
+ condition: `sp.f_orgid = '${this.$login.f.orgid}'`
493
+ }
494
+
495
+ if (!isEmpty(f_price_id)) {
496
+ data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
497
+ }
498
+ let http = new HttpResetClass()
499
+ let res = await http.load(
500
+ 'POST',
501
+ `rs/sql/applyGetPrice`,
502
+ {data: data},
503
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
504
+ )
505
+
506
+ return res.data.map(item => {
507
+ return {
508
+ label: item.f_price_name,
509
+ value: item
510
+ }
511
+ })
512
+ },
513
+ addressInitialization () {
514
+ this.$getConfig(this, 'UserAddress')
515
+
516
+ let f_address_type = this.show_data.f_address_type
517
+
518
+ for (const item of this.show_data.fields) {
519
+ if (f_address_type === '民用市区') {
520
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
521
+ item.hidden = false
522
+ item.required = true
523
+ }
524
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
525
+ item.hidden = false
526
+ item.required = false
527
+ }
528
+ if (item.label === '地址') {
529
+ item.readonly = true
530
+ }
531
+ }
532
+ if (f_address_type === '民用乡镇') {
533
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
534
+ item.hidden = false
535
+ item.required = true
536
+ }
537
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
538
+ item.hidden = false
539
+ item.required = false
540
+ }
541
+ if (item.label === '楼层') {
542
+ item.hidden = true
543
+ item.required = false
544
+ }
545
+ if (item.label === '地址') {
546
+ item.readonly = true
547
+ }
548
+ }
549
+ if (f_address_type === '特殊地址') {
550
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
551
+ item.hidden = false
552
+ item.required = true
553
+ }
554
+ if (item.label === '集收单位') {
555
+ item.hidden = false
556
+ item.required = false
557
+ }
558
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
559
+ item.hidden = true
560
+ item.required = false
561
+ }
562
+ if (item.label === '地址') {
563
+ item.readonly = false
564
+ }
565
+ }
566
+
567
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
568
+ item.hidden = true
569
+ }
570
+ }
571
+ },
572
+ async streetChange () {
573
+ if (isEmpty(this.show_data.f_street)) {
574
+ return
575
+ }
576
+
577
+ let data = {
578
+ tablename: 't_area',
579
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
580
+ }
581
+ let http = new HttpResetClass()
582
+ let res = await http.load(
583
+ 'POST',
584
+ `rs/sql/singleTable`,
585
+ {data: data},
586
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
587
+ )
588
+
589
+ this.setLabelOptions('集收单位', res.data.map(item => {
590
+ return {
591
+ label: item.f_residential_area,
592
+ value: item.f_residential_area
593
+ }
594
+ }))
595
+ },
596
+ async pcdChange () {
597
+ if (isEmpty(this.show_data.f_pcd)) {
598
+ return
599
+ }
600
+
601
+ let data = {
602
+ tablename: 't_street',
603
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
604
+ }
605
+ let f_address_type = this.getLableValue('地址类型')
606
+
607
+ if (f_address_type === '民用市区') {
608
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
609
+ }
610
+ if (f_address_type === '民用乡镇') {
611
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
612
+ }
613
+
614
+ let http = new HttpResetClass()
615
+ let res = await http.load(
616
+ 'POST',
617
+ `rs/sql/singleTable`,
618
+ {data: data},
619
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
620
+ )
621
+
622
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
623
+ return {
624
+ label: item.f_street,
625
+ value: item.f_street
626
+ }
627
+ }))
628
+ }
629
+ },
630
+ events: {
631
+ // 选择材料
632
+ async materialNameChenge (index, fieldIndex) {
633
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
634
+
635
+ this.show_data.onetomany[index].fields.forEach(item => {
636
+ if (material[item.field]) {
637
+ item.value = material[item.field]
638
+ }
639
+ })
640
+ },
641
+ // 打开模态框获取材料
642
+ async 'getMaterialName' (index) {
643
+ let data = {
644
+ condition: `1=1`
645
+ }
646
+ let http = new HttpResetClass()
647
+ let res = await http.load(
648
+ 'POST',
649
+ `rs/sql/getStockMaterial`,
650
+ {data: data},
651
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
652
+ )
653
+
654
+ this.show_data.onetomany[index].fields.forEach(field => {
655
+ if (field.label === '选择材料') {
656
+ field.options = res.data.map(item => {
657
+ return {
658
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
659
+ 'value': item
660
+ }
661
+ })
662
+ }
663
+ })
664
+ },
665
+ // 搜索小区
666
+ async 'searchArea' (area, index) {
667
+ let data = {
668
+ tablename: 't_area',
669
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
670
+ }
671
+ let http = new HttpResetClass()
672
+ let res = await http.load(
673
+ 'POST',
674
+ `rs/sql/singleTable`,
675
+ {data: data},
676
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
677
+ )
678
+
679
+ if (res.data.length === 0) {
680
+ return
681
+ }
682
+
683
+ this.setLabelOptions('集收单位', res.data.map(item => {
684
+ return {
685
+ label: item.f_residential_area,
686
+ value: item.f_residential_area
687
+ }
688
+ }))
689
+ },
690
+ // 选择气价
691
+ 'priceChange' (index) {
692
+ if (isEmpty(this.show_data.stairPrice)) {
693
+ return
694
+ }
695
+
696
+ let stairPrice = this.getLableValue('气价名称')
697
+
698
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
699
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
700
+ this.setLabelValue('价格', stairPrice.f_price)
701
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
702
+
703
+ this.show_data.f_price_id = stairPrice.f_price_id
704
+ this.show_data.f_price_name = stairPrice.f_price_name
705
+ },
706
+ // 选择开发商
707
+ async 'devInfoChange' (index) {
708
+ if (isEmpty(this.show_data.f_company_name)) {
709
+ return
710
+ }
711
+ let data = {
712
+ tablename: 't_dev_info',
713
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_dev_name = '${this.show_data.f_company_name}'`
714
+ }
715
+ let res = await this.$resetpost(
716
+ `rs/sql/singleTable`,
717
+ {data: data},
718
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
719
+ )
720
+ this.show_data.f_dev_id = res.data[0].id
721
+ this.show_data.f_dev_code = res.data[0].f_dev_code
722
+ this.setLabelValue('法人名称', res.data[0].f_legal_person)
723
+ this.setLabelValue('身份证', res.data[0].f_idnumber)
724
+ this.setLabelValue('营业执照', res.data[0].f_license_num)
725
+ },
726
+ // 退款金额
727
+ 'refundMoneyChange' (index) {
728
+ let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
729
+ let f_refund_money = this.show_data.fields[index].value
730
+
731
+ if (f_refund_money > f_cumulative_payment_money) {
732
+ this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
733
+ this.show_data.fields[index].value = null
734
+ }
735
+ },
736
+ // 检查重复
737
+ 'checkRepeat' (index) {
738
+ this.checkDuplicate(index)
739
+ },
740
+ // 选择报建项目
741
+ 'selectApply' (row) {
742
+ this.setLabelValue('工程名称', row.f_entry_name)
743
+ this.setLabelValue('工程编号', row.f_apply_num)
744
+ this.setLabelValue('报建类型', row.f_apply_type)
745
+ this.setLabelValue('用户名称', row.f_user_name)
746
+ this.setLabelValue('用户电话', row.f_phone)
747
+ this.setLabelValue('证件类型', row.f_credentials)
748
+ this.setLabelValue('证件号码', row.f_idnumber)
749
+ this.setLabelValue('地址', row.f_address)
750
+ this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
751
+
752
+ this.show_data.parentApply = JSON.parse(JSON.stringify(row))
753
+
754
+ delete row.id
755
+ delete row.actid
756
+ delete row.defid
757
+ delete row.defname
758
+ delete row.version
759
+ delete row.f_apply_num
760
+ delete row.f_sub_state
761
+ delete row.f_apply_type
762
+ delete row.f_process_id
763
+
764
+ this.show_data = Object.assign({}, this.show_data, row)
765
+
766
+ this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
767
+ },
768
+ // 是否终止
769
+ 'isStopChange' (index) {
770
+ let f_is_stop = this.show_data.f_is_stop
771
+
772
+ for (const item of this.show_data.fields) {
773
+ if (f_is_stop === '') {
774
+ if (item.label === '终止原因') {
775
+ item.hidden = false
776
+ item.required = true
777
+ }
778
+ } else {
779
+ if (item.label === '终止原因') {
780
+ item.hidden = true
781
+ item.required = false
782
+ }
783
+ }
784
+ }
785
+ },
786
+ // 终止报建初始化
787
+ async 'stopApplyReadyEvent' () {
788
+
789
+ let f_is_stop = this.getLableValue('是否终止')
790
+
791
+ for (const item of this.show_data.fields) {
792
+ if (f_is_stop === '') {
793
+ if (item.label === '终止原因') {
794
+ item.hidden = false
795
+ item.required = true
796
+ }
797
+ } else {
798
+ if (item.label === '终止原因') {
799
+ item.hidden = true
800
+ item.required = false
801
+ }
802
+ }
803
+ }
804
+
805
+ if (isEmpty(this.show_data.f_parent_process_id)) {
806
+ return
807
+ }
808
+ let data = {
809
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
810
+ data: {
811
+ id: this.$login.f.id,
812
+ orgid: this.$login.f.orgid
813
+ }
814
+ }
815
+ let res = await this.$resetpost(
816
+ `rs/sql/supervisory`,
817
+ {data: data},
818
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
819
+ )
820
+ this.show_data.parentApply = res.data[0]
821
+ },
822
+ // 选择用户档案信息
823
+ 'selectUserinfo' (row) {
824
+ this.setLabelValue('用户编号', row.f_userinfo_code)
825
+ this.setLabelValue('用户名称', row.f_user_name)
826
+ this.setLabelValue('用户电话', row.f_user_phone)
827
+ this.setLabelValue('证件类型', row.f_credentials)
828
+ this.setLabelValue('证件号码', row.f_idnumber)
829
+ this.setLabelValue('地址', row.f_address)
830
+
831
+ this.show_data.f_userinfo_id = row.f_userinfo_id
832
+ this.show_data.f_userinfo_code = row.f_userinfo_code
833
+ },
834
+ // 是否购买保险
835
+ async 'isInsureChange' (index) {
836
+ if (!this.show_data.f_is_insure) {
837
+ return
838
+ }
839
+ let f_is_insure = this.show_data.f_is_insure
840
+ for (const item of this.show_data.fields) {
841
+ if (f_is_insure === '') {
842
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
843
+ item.hidden = false
844
+ item.required = true
845
+ }
846
+ if (item.label === '保险备注') {
847
+ item.hidden = false
848
+ }
849
+ } else {
850
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
851
+ item.hidden = true
852
+ item.required = false
853
+ }
854
+ }
855
+ }
856
+ },
857
+ // 通气点火初始化
858
+ async 'gasReadyEvent' () {
859
+ // 是否有气价信息
860
+ if (!isEmpty(this.show_data.f_price_id)) {
861
+ let priceList = await this.getPrice(this.show_data.f_price_id)
862
+ this.setLabelValue('气价名称', priceList[0].value)
863
+ }
864
+
865
+ let data = {
866
+ tablename: 't_userfees',
867
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
868
+ }
869
+ let http = new HttpResetClass()
870
+ let res = await http.load(
871
+ 'POST',
872
+ `rs/sql/singleTable`,
873
+ {data: data},
874
+ {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
875
+ )
876
+ if (res.data.length > 0) {
877
+ this.setLabelValue('待执行保险', '是')
878
+ for (const item of this.show_data.fields) {
879
+ if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
880
+ item.hidden = true
881
+ item.required = false
882
+ item.value = null
883
+ }
884
+ }
885
+ } else {
886
+ this.setLabelValue('待执行保险', '否')
887
+ for (const item of this.show_data.fields) {
888
+ if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
889
+ item.hidden = false
890
+ item.required = true
891
+ }
892
+ }
893
+ }
894
+
895
+ // 保险初始化显示内容
896
+ let f_is_insure = this.getLableValue('是否购买保险')
897
+ for (const item of this.show_data.fields) {
898
+ if (f_is_insure === '是') {
899
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
900
+ item.hidden = false
901
+ item.required = true
902
+ }
903
+ if (item.label === '保险备注') {
904
+ item.hidden = false
905
+ }
906
+ // 本期保费到期时间默认一年
907
+ if (isEmpty(this.selectdata.f_ins_expiration_date)) {
908
+ let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
909
+ this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
910
+ }
911
+ }
912
+ if (f_is_insure === '否') {
913
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
914
+ item.hidden = true
915
+ item.required = false
916
+ }
917
+ }
918
+ }
919
+ },
920
+ // 合同金额失去焦点
921
+ async 'contractMoneyChange' (index) {
922
+ let data = {
923
+ operator: '+',
924
+ num1: this.show_data.f_contract_money || 0,
925
+ num2: this.getLableValue('追加金额') || 0
926
+ }
927
+ let res = await this.$resetpost(
928
+ `rs/logic/compute`,
929
+ {data: data},
930
+ {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
931
+ )
932
+
933
+ this.setLabelValue('应交金额', res.data)
934
+ },
935
+ // 街道失去焦点
936
+ async 'streetChange' (index) {
937
+ if (isEmpty(this.show_data.f_street)) {
938
+ return
939
+ }
940
+
941
+ this.setLabelValue('集收单位', null)
942
+
943
+ let data = {
944
+ tablename: 't_area',
945
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
946
+ }
947
+ let http = new HttpResetClass()
948
+ let res = await http.load(
949
+ 'POST',
950
+ `rs/sql/singleTable`,
951
+ {data: data},
952
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
953
+ )
954
+
955
+ this.setLabelOptions('集收单位', res.data.map(item => {
956
+ return {
957
+ label: item.f_residential_area,
958
+ value: item.f_residential_area
959
+ }
960
+ }))
961
+ },
962
+ // 区县失去焦点
963
+ async 'pcdChange' (index) {
964
+ if (isEmpty(this.show_data.f_pcd)) {
965
+ return
966
+ }
967
+
968
+ this.setLabelValue('街道/乡镇', null)
969
+ this.setLabelValue('集收单位', null)
970
+
971
+
972
+
973
+ let data = {
974
+ tablename: 't_street',
975
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
976
+ }
977
+ let f_address_type = this.getLableValue('地址类型')
978
+
979
+ if (f_address_type === '民用市区') {
980
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
981
+ }
982
+ if (f_address_type === '民用乡镇') {
983
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
984
+ }
985
+
986
+ let http = new HttpResetClass()
987
+ let res = await http.load(
988
+ 'POST',
989
+ `rs/sql/singleTable`,
990
+ {data: data},
991
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
992
+ )
993
+
994
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
995
+ return {
996
+ label: item.f_street,
997
+ value: item.f_street
998
+ }
999
+ }))
1000
+ },
1001
+ // 地址类型失去焦点
1002
+ 'addressTypeChange' (index) {
1003
+ this.setLabelValue('街道/乡镇', null)
1004
+ this.setLabelValue('集收单位', null)
1005
+ let f_address_type = this.show_data.fields[index].value
1006
+ for (const item of this.show_data.fields) {
1007
+ if (f_address_type === '民用市区') {
1008
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1009
+ item.hidden = false
1010
+ item.required = true
1011
+ item.value = null
1012
+ }
1013
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1014
+ item.hidden = false
1015
+ item.required = false
1016
+ item.value = null
1017
+ }
1018
+ if (item.label === '地址') {
1019
+ item.readonly = true
1020
+ item.value = null
1021
+ }
1022
+ }
1023
+ if (f_address_type === '民用乡镇') {
1024
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1025
+ item.hidden = false
1026
+ item.required = true
1027
+ item.value = null
1028
+ }
1029
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1030
+ item.hidden = false
1031
+ item.required = false
1032
+ item.value = null
1033
+ }
1034
+ if (item.label === '楼层') {
1035
+ item.hidden = true
1036
+ item.required = false
1037
+ item.value = null
1038
+ }
1039
+ if (item.label === '地址') {
1040
+ item.readonly = true
1041
+ item.value = null
1042
+ }
1043
+ }
1044
+ if (f_address_type === '特殊地址') {
1045
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
1046
+ item.hidden = false
1047
+ item.required = true
1048
+ item.value = null
1049
+ }
1050
+ if (item.label === '集收单位') {
1051
+ item.hidden = false
1052
+ item.required = false
1053
+ item.value = null
1054
+ }
1055
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1056
+ item.hidden = true
1057
+ item.required = false
1058
+ item.value = null
1059
+ }
1060
+ if (item.label === '地址') {
1061
+ item.readonly = false
1062
+ item.value = null
1063
+ }
1064
+ }
1065
+ }
1066
+ },
1067
+ // 团购转散户初始化
1068
+ 'apply2ReadyEvent' () {
1069
+ if (this.show_data.f_apply_source === '线下发起') {
1070
+ this.addressInitialization()
1071
+ this.hideLabels('用户编号')
1072
+ this.electiveLabels('用户编号')
1073
+ this.showLabels('片区', '地址类型')
1074
+ this.requiredLabels('片区', '地址类型')
1075
+ }
1076
+ if (this.show_data.f_apply_source === '自动发起') {
1077
+ this.hideLabels('片区', '地址类型')
1078
+ this.electiveLabels('片区', '地址类型',)
1079
+ }
1080
+ },
1081
+ // 申请节点初始化
1082
+ 'applyReadyEvent' () {
1083
+ this.addressInitialization()
1084
+
1085
+ this.pcdChange()
1086
+ this.streetChange()
1087
+ },
1088
+ // ===========================================
1089
+ async 'button'() {
1090
+ if (this.show_data.button.before) {
1091
+ await this[this.show_data.button.before]()
1092
+ }
1093
+ // 点击重置按钮就重置数据
1094
+ if (this.show_data.button.button_name === '重置') {
1095
+ this.$dispatch('breakControl', this.selectdata)
1096
+ return
1097
+ }
1098
+
1099
+ this.show_data.user = this.$login.f
1100
+ this.show_data.start_activity = this.$workflow_vue.start_activity
1101
+ this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1102
+
1103
+ let res = await this.$resetpost(
1104
+ `rs/logic/ApplyProductService`,
1105
+ {data: this.show_data},
1106
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1107
+ )
1108
+
1109
+ if (this.show_data.button.after) {
1110
+ this[this.show_data.button.after]()
1111
+ }
1112
+ this.$dispatch('loadPage')
1113
+ },
1114
+ // 失去焦点出触发事件
1115
+ 'onchange' (index) {
1116
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1117
+ if (
1118
+ this.show_data.fields[index].label === '区/县' ||
1119
+ this.show_data.fields[index].label === '街道/乡镇' ||
1120
+ this.show_data.fields[index].label === '集收单位' ||
1121
+ this.show_data.fields[index].label === '楼号/组' ||
1122
+ this.show_data.fields[index].label === '单元/排' ||
1123
+ this.show_data.fields[index].label === '楼层' ||
1124
+ this.show_data.fields[index].label === '门牌号'
1125
+ ) {
1126
+
1127
+ let f_pcd = this.getLableValue('区/县') || ''
1128
+ let f_street = this.getLableValue('街道/乡镇') || ''
1129
+ let f_residential_area = this.getLableValue('集收单位') || ''
1130
+ let f_building = this.getLableValue('楼号/组') || ''
1131
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1132
+ let f_unit = this.getLableValue('单元/排') || ''
1133
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1134
+ let f_floor = this.getLableValue('楼层') || ''
1135
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1136
+ let f_room = this.getLableValue('门牌号') || ''
1137
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1138
+
1139
+ 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
1140
+ this.setLabelValue("地址", f_address)
1141
+ }
1142
+ }
1143
+ },
1144
+ selectSearch (val, index) {},
1145
+ 'onblur' (index) {},
1146
+ 'oninput' (index) {},
1147
+ 'initializtionView' () {},
1148
+ async 'onchangeModal' (index, fieldIndex) {
1149
+ },
1150
+ async 'onblurModal' (index, fieldIndex) {
1151
+
1152
+ },
1153
+ async 'oninputModal' (index, fieldIndex) {
1154
+
1155
+ },
1156
+ async 'onetomanydelete' (index, rowIndex) {
1157
+
1158
+ let http = new HttpResetClass()
1159
+
1160
+ let res = await http.load(
1161
+ 'DELETE',
1162
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1163
+ null,
1164
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1165
+ )
1166
+
1167
+ res = await this.$resetpost(
1168
+ 'rs/entity/t_apply',
1169
+ this.show_data
1170
+ )
1171
+
1172
+ this.$dispatch('breakControl', this.show_data)
1173
+ },
1174
+ async 'onetomanyupdate' (index, rowIndex) {
1175
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1176
+
1177
+ this.show_data.onetomany[index].fields.forEach(item => {
1178
+ data[item.field] = item.value
1179
+ })
1180
+ let res = await this.$resetpost(
1181
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1182
+ data
1183
+ )
1184
+
1185
+ res = await this.$resetpost(
1186
+ 'rs/entity/t_apply',
1187
+ this.show_data
1188
+ )
1189
+
1190
+ this.$dispatch('breakControl', this.show_data)
1191
+ },
1192
+ async 'onetomanyadd' (index) {
1193
+ let data = {
1194
+ f_process_id : this.show_data.f_process_id,
1195
+ f_operator_id: this.$login.f.id,
1196
+ f_operator: this.$login.f.name,
1197
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1198
+ f_orgid: this.$login.f.orgid,
1199
+ f_orgname: this.$login.f.orgs
1200
+ }
1201
+ this.show_data.onetomany[index].fields.forEach(item => {
1202
+ data[item.field] = item.value
1203
+ })
1204
+ let res = await this.$resetpost(
1205
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1206
+ data
1207
+ )
1208
+
1209
+ res = await this.$resetpost(
1210
+ 'rs/entity/t_apply',
1211
+ this.show_data
1212
+ )
1213
+
1214
+ this.$dispatch('breakControl', this.show_data)
1215
+ },
1216
+ async 'importEvent' (index, table, configName, filepath) {
1217
+ let data = {
1218
+ selectdata: this.show_data,
1219
+ table: table,
1220
+ filepath: filepath,
1221
+ configName: configName,
1222
+ user: this.$login.f
1223
+ }
1224
+
1225
+ let res = await this.$resetpost(
1226
+ `rs/logic/importEvent`,
1227
+ data
1228
+ )
1229
+
1230
+ this.$dispatch('breakControl', this.show_data)
1231
+ },
1232
+ 'onbutchange' (index) {
1233
+
1234
+ },
1235
+ 'onbutblur' (index) {
1236
+
1237
+ },
1238
+ 'onbutinput' (index) {
1239
+
1240
+ }
1241
+ },
1242
+ watch: {
1243
+ }
1244
+ }
1245
+ </script>
1246
+ <style scoped>
1247
+ /*清除model中的浮动*/
1248
+ .clearfix:after,.clearfix:before{
1249
+ display: table;
1250
+ }
1251
+ .clearfix:after{
1252
+ clear: both;
1253
+ }
1254
+ </style>