apply-clients 3.5.1 → 3.5.2

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