apply-clients 3.3.81 → 3.3.83

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.
@@ -1,1348 +1,1411 @@
1
- <template>
2
- <div class="col-sm-12 col-xs-12 p-10">
3
- <accordion one-at-a-time="true">
4
- <panel :header="selectdata.defname" :is-open="true" type="primary">
5
- <app-service-view v-ref:serviceview :data="show_data" v-if="showview"></app-service-view>
6
- </panel>
7
- <panel header="拍照" :is-open="false" type="primary" v-if="selectdata.f_process_id">
8
- <app-take-pic :blobid="selectdata.f_process_id" :defname="selectdata.defname" :isdelete="true" :istakepic="true" :istype="true"></app-take-pic>
9
- </panel>
10
- <panel header="签字" :is-open="false" type="primary" v-if="selectdata.f_process_id">
11
- <app-sign @sign-success="signSuccess" :file-path="selectdata.f_process_id" @sign-clean="signClean"></app-sign>
12
- </panel>
13
- </accordion>
14
- </div>
15
- </template>
16
- <script>
17
- import Vue from 'vue'
18
- import {HttpResetClass} from 'vue-client'
19
- import {isEmpty} from "../../Util";
20
- // Date格式化
21
- Date.prototype.Format = function (fmt) {
22
- var o = {
23
- 'M+': this.getMonth() + 1, // 月份
24
- 'd+': this.getDate(), // 日
25
- 'H+': this.getHours(), // 小时
26
- 'm+': this.getMinutes(), // 分
27
- 's+': this.getSeconds(), // 秒
28
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
29
- 'S': this.getMilliseconds() // 毫秒
30
- }
31
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
32
- for (var k in o) {
33
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
34
- }
35
- return fmt
36
- }
37
- export default {
38
- title: '报建流程业务控制层',
39
- props: ['selectdata'],
40
- data () {
41
- return {
42
- json_datas: null,
43
- data: null,
44
- show_data: null,
45
- showview: false,
46
- config: {}
47
- }
48
- },
49
- ready () {
50
- this.refurbish()
51
- },
52
- methods: {
53
- async refurbish() {
54
- let data = {
55
- workname: this.selectdata.processname
56
- }
57
-
58
- let res = await this.$resetpost(
59
- `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyGetConfigs`,
60
- {data: data},
61
- {resolveMsg: null, rejectMsg: '配置数据获取失败!!!'}
62
- )
63
-
64
- this.json_datas = res.data
65
-
66
- let sum = 0
67
- let jsonData = {}
68
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
69
- this.$showMessage("网络故障,请刷新页面")
70
- return
71
- }
72
- this.json_datas.activitys.forEach(item => {
73
- if (this.selectdata.defname === item.title) {
74
- jsonData = item // 拿到当前节点的json配置信息
75
- sum++ // 节点名一样的个数
76
- }
77
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
78
- })
79
-
80
- if (sum === 0) {
81
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
82
- return
83
- }
84
- if (sum > 1) {
85
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
86
- return
87
- }
88
-
89
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
90
-
91
- // fields 字段填充值
92
- for (const item of this.selectdata.fields) {
93
- if (!item.value) {
94
- item.value = null
95
- }
96
-
97
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
98
- if (item.eval) {
99
- let user = Vue.user
100
- // 将PC用户信息 替换成 APP的
101
- item.value = eval(item.default.replace('this.$login.f', 'user'))
102
- } else {
103
- item.value = item.default
104
- }
105
- }
106
-
107
- if (this.selectdata[item.field]) {
108
- // 将json字符串格式化赋值给value
109
- if (String(this.selectdata[item.field]).startsWith("{")) {
110
- item.value = JSON.parse(this.selectdata[item.field])
111
- } else {
112
- item.value = this.selectdata[item.field]
113
- }
114
- }
115
- if (this.selectdata[item.field] === 0) {
116
- item.value = 0
117
- }
118
-
119
- // datepicker
120
- if (item.type === 'datepicker' && !item.value && item.default) {
121
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
122
- }
123
-
124
- // 如果配置类型为select,优先从参数列表获取options
125
- if (item.type === 'select' || item.type === 'checkbox') {
126
- if (item.param) {
127
- let temp = this.$appdata.getParam(item.label)
128
-
129
- if (temp && temp.length > 0) {
130
- item.options = temp
131
- }
132
-
133
- if (item.paramLabel) {
134
- temp = this.$appdata.getParam(item.paramLabel)
135
- if (temp && temp.length > 0) {
136
- item.options = temp
137
- }
138
- }
139
- }
140
- console.log("item.ready"+item.ready)
141
- if (item.ready) {
142
- item.options = await this[item.ready]()
143
- }
144
- }
145
-
146
-
147
- if (item.type === 'checkbox') {
148
- if (this.selectdata[item.field]) {
149
- item.value = JSON.parse(this.selectdata[item.field])
150
- } else {
151
- item.value = []
152
- }
153
- }
154
- }
155
-
156
- // 控制组件
157
- if (this.selectdata.components) {
158
- this.selectdata.components.forEach(item => {
159
- if (!item.mark) {
160
- item.mark = 0
161
- }
162
- })
163
- }
164
-
165
- // 初始化onetomany
166
- if (this.selectdata.onetomany) {
167
- for (const item of this.selectdata.onetomany) {
168
- let res = null
169
- if (item.queryEvent) {
170
- res = this[item.queryEvent]()
171
- } else {
172
- let http = new HttpResetClass()
173
- let data = {
174
- tablename: item.tables[0],
175
- condition: `f_process_id='${this.selectdata.f_process_id}'`
176
- }
177
- res = await http.load(
178
- 'POST',
179
- `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
180
- // `rs/sql/singleTable`,
181
- {data: data},
182
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
183
- )
184
- }
185
-
186
- item.rows = res.data
187
-
188
- // 初始化onetomany中的fields
189
- for (const field of item.fields) {
190
- if (!field.value) {
191
- if (field.value !== 0) {
192
- field.value = null
193
- }
194
- }
195
-
196
- if (field.default || field.default === 0) {
197
- field.value = field.default
198
- }
199
-
200
- // datepicker
201
- if (field.type === 'datepicker' && !field.value && field.default) {
202
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
203
- }
204
-
205
- if (field.type === 'select') {
206
-
207
- if (field.param) {
208
- let temp = this.$appdata.getParam(field.label)
209
-
210
- if (temp && temp.length > 0) {
211
- field.options = temp
212
- }
213
-
214
- if (field.paramLabel) {
215
- temp = this.$appdata.getParam(field.paramLabel)
216
- if (temp && temp.length > 0) {
217
- item.options = temp
218
- }
219
- }
220
- }
221
-
222
- }
223
- }
224
- }
225
- }
226
-
227
- // 初始化 buttons_fields
228
- for (const item of this.selectdata.buttons) {
229
- if (item.button_name === '下发') {
230
- let data = {
231
- source: item.source,
232
- userid: Vue.user.id
233
- // userid: '51953'
234
- }
235
- if (item.sourceMethod) {
236
- data.source = this[item.sourceMethod]()
237
- }
238
- if (!data.source) {
239
- this.$showMessage("请配置获取人员表达式")
240
- return
241
- }
242
- let res = await this.$resetpost(
243
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
244
- // `rs/search`,
245
- {data: data},
246
- {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
247
- )
248
-
249
- let options = res.data.map(source => {
250
- return {
251
- "label": source.name,
252
- "value": source.id
253
- }
254
- })
255
-
256
- if (item.button_fields.length !== 1) {
257
- this.$showMessage("下发有且只能有一个字段!!!")
258
- return
259
- }
260
-
261
- item.button_fields[0].options = options
262
- }
263
- if (item.button_fields) {
264
- item.button_fields.forEach(x => {
265
- // 如果配置类型为select,优先从参数列表获取options
266
- if (x.type === 'select') {
267
-
268
- if (x.param) {
269
- let temp = this.$appdata.getParam(x.label)
270
-
271
- if (temp && temp.length > 0) {
272
- x.options = temp
273
- }
274
-
275
- if (x.paramLabel) {
276
- temp = this.$appdata.getParam(x.paramLabel)
277
- if (temp && temp.length > 0) {
278
- x.options = temp
279
- }
280
- }
281
- }
282
-
283
- }
284
- })
285
- }
286
- }
287
-
288
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
289
- let temp = JSON.parse(JSON.stringify(this.selectdata))
290
-
291
- this.show_data = temp
292
- this.$nextTick(() => {
293
- this.showview = true
294
- })
295
- },
296
- signClean () {
297
- this.selectdata.f_construction_sign = null
298
- },
299
- signSuccess (fileUrl) {
300
- console.log('==============签字回调==================')
301
- console.log(fileUrl)
302
- this.selectdata.f_construction_sign = fileUrl
303
- },
304
- // 金额转大写
305
- smalltoBIG(n) {
306
- let fraction = ['角', '分'];
307
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
308
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
309
- let head = n < 0 ? '欠' : '';
310
- n = Math.abs(n);
311
-
312
- let s = '';
313
-
314
- for (var i = 0; i < fraction.length; i++) {
315
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
316
- }
317
- s = s || '整';
318
- n = Math.floor(n);
319
-
320
- for (var i = 0; i < unit[0].length && n > 0; i++) {
321
- let p = '';
322
- for (var j = 0; j < unit[1].length && n > 0; j++) {
323
- p = digit[n % 10] + unit[1][j] + p;
324
- n = Math.floor(n / 10);
325
- }
326
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
327
- }
328
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
329
- },
330
- getLableValue(label) {
331
- for (const item of this.show_data.fields) {
332
- if (item.label === label && item.type !== 'number') {
333
- return item.value || ''
334
- }
335
- if (item.label === label && item.type === 'number') {
336
- return item.value || 0
337
- }
338
- }
339
- },
340
- getLableOptions(label) {
341
- for (const item of this.show_data.fields) {
342
- if (item.label === label) {
343
- return item.options
344
- }
345
- }
346
- },
347
- setLabelValue(label, value) {
348
- for (const item of this.show_data.fields) {
349
- if (item.label === label) {
350
- item.value = value
351
- this.show_data[item.field] = value
352
- }
353
- }
354
- },
355
- setLabelOptions(label, options) {
356
- for (const item of this.show_data.fields) {
357
- if (item.label === label) {
358
- item.options = options
359
- }
360
- }
361
- },
362
- disabledButtons(...buttons) {
363
- for (const item of this.show_data.buttons) {
364
- if (buttons.includes(item.button_name)) {
365
- item.disabled = true
366
- }
367
- }
368
- },
369
- enableButtons(...buttons) {
370
- for (const item of this.show_data.buttons) {
371
- if (buttons.includes(item.button_name)) {
372
- item.disabled = false
373
- }
374
- }
375
- },
376
- showButtons(...buttons) {
377
- for (const item of this.show_data.buttons) {
378
- if (buttons.includes(item.button_name)) {
379
- item.hidden = false
380
- }
381
- }
382
- },
383
- hideButtons(...buttons) {
384
- for (const item of this.show_data.buttons) {
385
- if (buttons.includes(item.button_name)) {
386
- item.hidden = true
387
- }
388
- }
389
- },
390
- async streetChange () {
391
- if (isEmpty(this.show_data.f_street)) {
392
- return
393
- }
394
-
395
- let data = {
396
- tablename: 't_area',
397
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
398
- }
399
- let http = new HttpResetClass()
400
- let res = await http.load(
401
- 'POST',
402
- `rs/sql/singleTable`,
403
- {data: data},
404
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
405
- )
406
-
407
- this.setLabelOptions('集收单位', res.data.map(item => {
408
- return {
409
- label: item.f_residential_area,
410
- value: item.f_residential_area
411
- }
412
- }))
413
- },
414
- async pcdChange () {
415
- if (isEmpty(this.show_data.f_pcd)) {
416
- return
417
- }
418
-
419
- let data = {
420
- tablename: 't_street',
421
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
422
- }
423
- let f_address_type = this.getLableValue('地址类型')
424
-
425
- if (f_address_type === '民用市区') {
426
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
427
- }
428
- if (f_address_type === '民用乡镇') {
429
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
430
- }
431
-
432
- let http = new HttpResetClass()
433
- let res = await http.load(
434
- 'POST',
435
- `rs/sql/singleTable`,
436
- {data: data},
437
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
438
- )
439
-
440
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
441
- return {
442
- label: item.f_street,
443
- value: item.f_street
444
- }
445
- }))
446
- },
447
- async addressInitialization () {
448
- //this.$getConfig(this, 'UserAddress')
449
- //获取地址配置文件
450
- try {
451
- let res = await new HttpResetClass().load('get',`${this.$androidUtil.getProxyUrl()}/rs/vue/UserAddress.json`,null,{resolveMsg: null, rejectMsg: null})
452
- Object.assign(this.config, res.data)
453
- } catch (error) {
454
- console.log("未获取到地址信息")
455
- }
456
- console.log("???????????不走了吗!")
457
- let f_address_type = this.show_data.f_address_type
458
-
459
- for (const item of this.show_data.fields) {
460
- if (f_address_type === '民用市区') {
461
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
462
- item.hidden = false
463
- item.required = true
464
- }
465
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
466
- item.hidden = false
467
- item.required = false
468
- }
469
- if (item.label === '地址') {
470
- item.readonly = true
471
- }
472
- }
473
- if (f_address_type === '民用乡镇') {
474
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
475
- item.hidden = false
476
- item.required = true
477
- }
478
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
479
- item.hidden = false
480
- item.required = false
481
- }
482
- if (item.label === '楼层') {
483
- item.hidden = true
484
- item.required = false
485
- }
486
- if (item.label === '地址') {
487
- item.readonly = true
488
- }
489
- }
490
- if (f_address_type === '特殊地址') {
491
- if (item.label === '区/县' || item.label === '街道/乡镇') {
492
- item.hidden = false
493
- item.required = true
494
- }
495
- if (item.label === '集收单位') {
496
- item.hidden = false
497
- item.required = false
498
- }
499
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
500
- item.hidden = true
501
- item.required = false
502
- }
503
- if (item.label === '地址') {
504
- item.readonly = false
505
- }
506
- }
507
-
508
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
509
- item.hidden = true
510
- }
511
- }
512
- },
513
-
514
- async checkDuplicate(index) {
515
- let http = new HttpResetClass()
516
- let data = {
517
- tablename: 't_apply',
518
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
519
- }
520
- let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {data: data}, {
521
- resolveMsg: null,
522
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
523
- })
524
- if (res.data.length > 0) {
525
- this.show_data.fields[index].value = null
526
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
527
- }
528
- },
529
- async breakControl () {
530
- if (this.show_data.id) {
531
- let data = {
532
- condition: `u.id = ${this.show_data.id}`,
533
- data: {
534
- id: Vue.user.id,
535
- orgid: Vue.user.orgid
536
- // id: '51953',
537
- // orgid: '10101'
538
- }
539
- }
540
- let res = await this.$resetpost(
541
- `${this.$androidUtil.getProxyUrl()}/rs/sql/checkuser`,
542
- // `rs/sql/checkuser`,
543
- {data: data},
544
- {resolveMsg: null, rejectMsg: '数据更新失败,请手查询更新!!!'}
545
- )
546
-
547
- this.selectdata = res.data[0]
548
- } else {
549
- this.selectdata = servicedata
550
- }
551
-
552
- this.refurbish()
553
- },
554
- async addressTips () {
555
- let res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
556
- if (res == 'confirm') {
557
- return
558
- }
559
- throw '用户信息确认!!!'
560
- },
561
- // 缴费前置
562
- chargeBefore () {
563
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
564
- this.$showAlert('费用未结清!!!', 'warning', 3000)
565
- throw null
566
- }
567
- },
568
- // 施工前置
569
- async constructionBefore () {
570
- let http = new HttpResetClass()
571
- let data = {
572
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
573
- }
574
- let res = await http.load(
575
- 'POST',
576
- `${this.$androidUtil.getProxyUrl()}/rs/sql/countApplyUserinfo`,
577
- {data: data},
578
- {
579
- resolveMsg: null,
580
- rejectMsg: '安装明细查询失败!!!'
581
- })
582
- if (res.data[0].num > 0) {
583
- this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
584
- throw `还有${res.data[0].num}户未安装,无法提交`
585
- }
586
- },
587
- changePipeBuild () {
588
- if (this.selectdata.f_process_dep === '工程部') {
589
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
590
- }
591
- if (this.selectdata.f_process_dep === '运营部') {
592
- return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
593
- }
594
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
595
- },
596
- async getPrice (f_price_id) {
597
- console.log('=======================')
598
- console.log(f_price_id)
599
-
600
- let data = {
601
- condition: `sp.f_filialeid = '${Vue.user.orgid}'`
602
- }
603
-
604
- if (!isEmpty(f_price_id)) {
605
- data.condition = `sp.f_filialeid = '${Vue.user.orgid}' and sp.f_price_id = ${f_price_id}`
606
- }
607
- let http = new HttpResetClass()
608
- let res = await http.load(
609
- 'POST',
610
- `${this.$androidUtil.getProxyUrl()}/rs/sql/applyGetPrice`,
611
- {data: data},
612
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
613
- )
614
-
615
- return res.data.map(item => {
616
- return {
617
- label: item.f_price_name,
618
- value: item
619
- }
620
- })
621
- },
622
- async getDesignerPeople () {
623
- let data = {
624
- source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
625
- userid: Vue.user.id
626
- }
627
-
628
- let http = new HttpResetClass()
629
- let res = await http.load(
630
- 'POST',
631
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
632
- {data: data},
633
- {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
634
- )
635
-
636
- return res.data.map(item => {
637
- return {
638
- label: item.name,
639
- value: item.id
640
- }
641
- })
642
- },
643
- async surveyStopApply () {
644
- console.log('终止报建!!!!!')
645
-
646
- this.show_data.f_stop_reason = '现场勘察不符合报装条件'
647
-
648
- let data = {
649
- data: this.show_data,
650
- user: Vue.user
651
- }
652
-
653
- let res = await this.$resetpost(
654
- `${this.$androidUtil.getProxyUrl()}/rs/logic/surveyStopApply`,
655
- {data: data},
656
- {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
657
- )
658
-
659
- this.$dispatch('loadPage')
660
-
661
- throw '终止报建!!!'
662
- },
663
- async getDevInfo () {
664
- let data = {
665
- tablename: 't_dev_info',
666
- condition: `f_orgid = '${Vue.user.orgid}'`
667
- }
668
- let http = new HttpResetClass()
669
- let res = await http.load(
670
- 'POST',
671
- `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
672
- {data: data},
673
- {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
674
- )
675
-
676
- return res.data.map(item => {
677
- return {
678
- label: item.f_dev_name,
679
- value: item.f_dev_name
680
- }
681
- })
682
- },
683
- async getDesignerPeople () {
684
- let data = {
685
- source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
686
- userid: Vue.user.id
687
- }
688
-
689
- let http = new HttpResetClass()
690
- let res = await http.load(
691
- 'POST',
692
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
693
- {data: data},
694
- {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
695
- )
696
-
697
- return res.data.map(item => {
698
- return {
699
- label: item.name,
700
- value: item.id
701
- }
702
- })
703
- },
704
- // 获取片区
705
- async getSliceArea () {
706
- let data = {
707
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
708
- userid: Vue.user.id
709
- }
710
-
711
- let http = new HttpResetClass()
712
- let res = await http.load(
713
- 'POST',
714
- `${this.$androidUtil.getProxyUrl()}/rs/search`,
715
- {data: data},
716
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
717
- )
718
-
719
- return res.data.map(item => {
720
- return {
721
- label: item.name,
722
- value: item.name
723
- }
724
- })
725
- },
726
- // 获取区县
727
- async getPcd () {
728
- let data = {
729
- tablename: 't_pcd',
730
- condition: `f_filialeid = '${Vue.user.orgid}'`
731
- }
732
- let http = new HttpResetClass()
733
- let res = await http.load(
734
- 'POST',
735
- `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
736
- {data: data},
737
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
738
- )
739
-
740
- return res.data.map(item => {
741
- return {
742
- label: item.f_pcd,
743
- value: item.f_pcd
744
- }
745
- })
746
- }
747
-
748
- },
749
- events: {
750
- 'complyInstallation' (index) {
751
- if (this.show_data.f_is_have === '否') {
752
- this.hideButtons('提交', '出图', '缴费')
753
- this.showButtons('终止')
754
- }
755
- if (this.show_data.f_is_have === '是') {
756
- this.hideButtons('终止')
757
- this.showButtons('提交', '出图', '缴费')
758
- }
759
- },
760
- async 'igniteDispatchReadyEvent' () {
761
- let data = {
762
- tablename: 'activityins',
763
- condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
764
- }
765
- let http = new HttpResetClass()
766
- let res = await http.load(
767
- 'POST',
768
- `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
769
- {data: data},
770
- {resolveMsg: null, rejectMsg: '查询失败!!!'}
771
- )
772
- if (res.data.length <= 0) {
773
- console.log('+++++++++++++++++++++++++++++')
774
- console.log('没有施工,不能退回')
775
- this.hideButtons('退回')
776
- }
777
- },
778
- 'breakControl' () {
779
- this.breakControl()
780
- },
781
- // 检查重复
782
- 'checkRepeat' (index) {
783
- this.checkDuplicate(index)
784
- },
785
- 'buildReadyEvent' () {
786
- this.setLabelValue('施工单位', Vue.user.name)
787
- this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
788
- },
789
- // 选择材料
790
- async materialNameChenge (index, fieldIndex) {
791
- let material = this.show_data.onetomany[index].fields[fieldIndex].value
792
-
793
- this.show_data.onetomany[index].fields.forEach(item => {
794
- if (material[item.field]) {
795
- item.value = material[item.field]
796
- }
797
- })
798
- },
799
- // 打开模态框获取材料
800
- async 'getMaterialName' (index) {
801
- let data = {
802
- condition: `1=1`
803
- }
804
- let http = new HttpResetClass()
805
- let res = await http.load(
806
- 'POST',
807
- `${this.$androidUtil.getProxyUrl()}/rs/sql/getStockMaterial`,
808
- {data: data},
809
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
810
- )
811
-
812
- this.show_data.onetomany[index].fields.forEach(field => {
813
- if (field.label === '选择材料') {
814
- field.options = res.data.map(item => {
815
- return {
816
- 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
817
- 'value': item
818
- }
819
- })
820
- }
821
- })
822
- },
823
- // 选择气价
824
- 'priceChange' (index) {
825
- if (isEmpty(this.show_data.stairPrice)) {
826
- return
827
- }
828
-
829
- let stairPrice = this.getLableValue('气价名称')
830
-
831
- this.setLabelValue('气价类型', stairPrice.f_price_type)
832
- this.setLabelValue('用气性质', stairPrice.f_gasproperties)
833
- this.setLabelValue('价格', stairPrice.f_price)
834
- this.setLabelValue('客户类型', stairPrice.f_user_type)
835
-
836
- this.show_data.f_price_id = stairPrice.f_price_id
837
- this.show_data.f_price_name = stairPrice.f_price_name
838
- },
839
- // 是否购买保险
840
- isInsureChange (index) {
841
- let f_is_insure = this.getLableValue('是否购买保险')
842
- for (const item of this.show_data.fields) {
843
- if (f_is_insure === '是') {
844
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
845
- item.hidden = false
846
- item.required = true
847
- }
848
- if (item.label === '保险备注') {
849
- item.hidden = false
850
- }
851
- } else {
852
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
853
- item.hidden = true
854
- item.required = false
855
- }
856
- }
857
- }
858
- },
859
- // 通气点火初始化
860
- async 'gasReadyEvent' () {
861
- console.log('----通气点火初始化----')
862
- if (!isEmpty(this.show_data.f_price_id)) {
863
- let priceList = await this.getPrice(this.show_data.f_price_id)
864
- this.setLabelValue('气价名称', priceList[0].value)
865
- }
866
-
867
- let data = {
868
- tablename: 't_userfees',
869
- condition: `f_orgid = '${Vue.user.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
870
- }
871
-
872
- console.log('---------查询是否有待执行保险-----------')
873
- let http = new HttpResetClass()
874
- let res = await http.load(
875
- 'POST',
876
- `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
877
- {data: data},
878
- {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
879
- )
880
- if (res.data.length > 0) {
881
- console.log('----------具有待执行保险------------')
882
- this.setLabelValue('待执行保险', '是')
883
- for (const item of this.show_data.fields) {
884
- if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
885
- item.hidden = true
886
- item.required = false
887
- item.value = null
888
- }
889
- }
890
- console.log('----------具有待执行保险------------')
891
- } else {
892
- console.log('----------不有待执行保险------------')
893
- this.setLabelValue('待执行保险', '否')
894
- for (const item of this.show_data.fields) {
895
- if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
896
- item.hidden = false
897
- item.required = true
898
- }
899
- }
900
- console.log('----------具有待执行保险------------')
901
- }
902
-
903
- // 初始化显示内容
904
- let f_is_insure = this.getLableValue('是否购买保险')
905
- for (const item of this.show_data.fields) {
906
- if (f_is_insure === '是') {
907
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
908
- item.hidden = false
909
- item.required = true
910
- }
911
- if (item.label === '保险备注') {
912
- item.hidden = false
913
- }
914
- // 本期保费到期时间默认一年
915
- if (isEmpty(this.selectdata.f_ins_expiration_date)) {
916
- let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
917
- this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
918
- }
919
- }
920
- if (f_is_insure === '否') {
921
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
922
- item.hidden = true
923
- item.required = false
924
- }
925
- }
926
- }
927
- },
928
- // 合同金额失去焦点
929
- async 'contractMoneyChange' (index) {
930
- let data = {
931
- operator: '+',
932
- num1: this.show_data.f_contract_money || 0,
933
- num2: this.getLableValue('追加金额') || 0
934
- }
935
- let res = await this.$resetpost(
936
- `${this.$androidUtil.getProxyUrl()}/rs/logic/compute`,
937
- {data: data},
938
- {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
939
- )
940
-
941
- this.setLabelValue('应交金额', res.data)
942
- },
943
- // ===========================================
944
- async 'button'() {
945
- if (this.show_data.button.before) {
946
- await this[this.show_data.button.before]()
947
- }
948
- // 点击重置按钮就重置数据
949
- if (this.show_data.button.button_name === '重置') {
950
- this.$dispatch('breakControl', this.selectdata)
951
- return
952
- }
953
-
954
- this.show_data.user = Vue.user
955
- // this.show_data.user = {"f_show_department_name":"","parentname":"市场部","functions":[{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","parentname":"客服系统","icon":"/images/lefticon/档案管理.png","hasright":false,"resourcetype":"function","parentid":"27","children":[{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","parentname":"档案管理","link":"city-manage","hasright":true,"resourcetype":"function","parentid":"212","children":[],"selfid":"231","name":"街道管理","templatename":"functionedit","id":"230","position":"1","fullname":"资源管理.功能模块.客服系统.档案管理.街道管理","fullid":"3.21.27.212.230","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","parentname":"档案管理","link":"area-manage","hasright":true,"resourcetype":"function","parentid":"212","children":[],"selfid":"219","name":"小区管理","templatename":"functionedit","id":"218","position":"3","fullname":"资源管理.功能模块.客服系统.档案管理.小区管理","fullid":"3.21.27.212.218","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","parentname":"档案管理","link":"address-manage","hasright":true,"resourcetype":"function","parentid":"212","children":[],"selfid":"33664","name":"地址管理","templatename":"functionedit","id":"33663","position":"5","fullname":"资源管理.功能模块.客服系统.档案管理.地址管理","fullid":"3.21.27.212.33663","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","parentname":"档案管理","link":"file-user-files","hasright":true,"resourcetype":"function","parentid":"212","children":[],"selfid":"237","name":"用户档案","templatename":"functionedit","id":"236","position":"5","fullname":"资源管理.功能模块.客服系统.档案管理.用户档案","fullid":"3.21.27.212.236","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"档案管理","link":"file-user-files-new","hasright":true,"resourcetype":"function","parentid":"212","f_parentname":"档案管理","children":[],"selfid":"39450","name":"预备户管理","templatename":"functionedit","id":"39449","position":"6","fullname":"资源管理.功能模块.客服系统.档案管理.预备户管理","fullid":"3.21.27.212.39449","tablename":"t_function"}],"selfid":"213","name":"档案管理","templatename":"functionedit","id":"212","position":"2","fullname":"资源管理.功能模块.客服系统.档案管理","fullid":"3.21.27.212","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"客服系统","icon":"/images/lefticon/报建系统.png","hasright":true,"resourcetype":"function","parentid":"27","f_parentname":"客服系统","children":[{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"报建业务","link":"install-function","hasright":true,"resourcetype":"function","parentid":"34673","f_parentname":"报建业务","children":[],"selfid":"34680","name":"功能业务","templatename":"functionedit","id":"34679","position":"1","fullname":"资源管理.功能模块.客服系统.报建业务.功能业务","fullid":"3.21.27.34673.34679","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"报建业务","link":"exploration-user","hasright":true,"resourcetype":"function","parentid":"34673","f_parentname":"报建业务","children":[],"selfid":"34686","name":"流程业务","templatename":"functionedit","id":"34685","position":"2","fullname":"资源管理.功能模块.客服系统.报建业务.流程业务","fullid":"3.21.27.34673.34685","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"报建业务","link":"supervisory-control","hasright":true,"resourcetype":"function","parentid":"34673","f_parentname":"报建业务","children":[],"selfid":"34692","name":"流程监控","templatename":"functionedit","id":"34691","position":"3","fullname":"资源管理.功能模块.客服系统.报建业务.流程监控","fullid":"3.21.27.34673.34691","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"报建业务","link":"apply-charge-search","hasright":true,"resourcetype":"function","parentid":"34673","f_parentname":"报建业务","children":[],"selfid":"34698","name":"收费明细","templatename":"functionedit","id":"34697","position":"4","fullname":"资源管理.功能模块.客服系统.报建业务.收费明细","fullid":"3.21.27.34673.34697","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"报建业务","link":"order-apply","hasright":true,"resourcetype":"function","parentid":"34673","f_parentname":"报建业务","children":[],"selfid":"34704","name":"预约申请","templatename":"functionedit","id":"34703","position":"5","fullname":"资源管理.功能模块.客服系统.报建业务.预约申请","fullid":"3.21.27.34673.34703","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"报建业务","link":"stop-apply","hasright":true,"resourcetype":"function","parentid":"34673","f_parentname":"报建业务","children":[],"selfid":"34710","name":"终止报建","templatename":"functionedit","id":"34709","position":"6","fullname":"资源管理.功能模块.客服系统.报建业务.终止报建","fullid":"3.21.27.34673.34709","tablename":"t_function"}],"selfid":"34674","name":"报建业务","templatename":"functionedit","id":"34673","position":"12","fullname":"资源管理.功能模块.客服系统.报建业务","fullid":"3.21.27.34673","tablename":"t_function"}],"qrcode":"/rs/user/getQRcode?QRCODE=12b2-1631604191812-03447","rolesnames":"营业厅报装,市场部报装,设计部报装,工程部报装,运营部报装,财务部报装,角色监控","roles":"51383,51485,51707,51767,51833,51905,52289","f_sex":"男","f_icon":"tree_user","fullnames":"河南亿星集团实业有限公司.周口市天然气有限公司.市场部.报建测试","dir":"ZhouKou","userid":"12b2-1631604191812-03447","accesstime":"1632214307117","parentid":"46545","f_show_rolestr":"","fullids":"30463.10101.46545.51953.","number":"10101","f_dep_id":"1010101201","f_idnumber":null,"selfid":"51954","templatename":"useredit","logindate":"2021-09-14 18:46:54","id":"51953","state":"在职","tablename":"t_user","deptype":"部门","depids":"46545","loginid":"15","imgid":null,"f_user_telephone":null,"rolestr":"营业厅报装,市场部报装,设计部报装,工程部报装,运营部报装,财务部报装,角色监控","deps":"市场部","loginnum":"0","f_age":null,"resourcetype":"user","orgid":"10101","f_department_name":"周口市场部","ename":"bjcs","deleted":"false","entitytype":"t_user","f_description":null,"loginip":"192.168.66.37","name":"报建测试","position":"1","orgs":"周口市天然气有限公司","haslicense":true,"f_role_name":"营业厅报装 市场部报装 设计部报装 工程部报装 运营部报装 财务部报装 角色监控 ","f_allArea":[],"f_gasman":[{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"15294978548","rolestr":"抄表员","resourcetype":"user","userid":"100814","parentid":"46581","f_department_name":"周口客服部","ename":"100814","password":"1","deleted":"false","entitytype":"t_user","selfid":"100814","name":"高雪荣","templatename":"useredit","id":"100814","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"qrcode":"/rs/user/getQRcode?QRCODE=004","roles":"51959","f_sex":"男","f_icon":"tree_user","userid":"004","accesstime":"1631765198067","parentid":"46581","password":"1","selfid":"59044","templatename":"useredit","id":"59043","state":"在职","tablename":"t_user","loginid":"15","rolestr":"抄表员","resourcetype":"user","f_department_name":"周口客服部","ename":"cbcs","deleted":"false","entitytype":"t_user","loginip":"10.10.10.1","name":"抄表测试","position":"23","haslicense":"true","f_role_name":"抄表员 "},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"18538602709","rolestr":"抄表员","resourcetype":"user","userid":"100462","parentid":"46581","f_department_name":"周口客服部","ename":"100462","password":"1","deleted":"false","entitytype":"t_user","selfid":"100462","name":"刘林静","templatename":"useredit","id":"100462","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"18839409830","rolestr":"抄表员","resourcetype":"user","userid":"100528","parentid":"46581","f_department_name":"周口客服部","ename":"100528","password":"1","deleted":"false","entitytype":"t_user","selfid":"100528","name":"秦春梅","templatename":"useredit","id":"100528","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"13243376616","rolestr":"抄表员","resourcetype":"user","userid":"102935","parentid":"46581","f_department_name":"周口客服部","ename":"102935","password":"1","deleted":"false","entitytype":"t_user","selfid":"102935","name":"石磊","templatename":"useredit","id":"102935","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"18538602706","rolestr":"抄表员","resourcetype":"user","userid":"100818","parentid":"46581","f_department_name":"周口客服部","ename":"100818","password":"1","deleted":"false","entitytype":"t_user","selfid":"100818","name":"白静","templatename":"useredit","id":"100818","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"15294991670","rolestr":"抄表员","resourcetype":"user","userid":"102934","parentid":"46581","f_department_name":"周口客服部","ename":"102934","password":"1","deleted":"false","entitytype":"t_user","selfid":"102934","name":"郭新胜","templatename":"useredit","id":"102934","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"15036438918","rolestr":"抄表员","resourcetype":"user","userid":"103392","accesstime":"1631757950369","parentid":"46581","f_department_name":"周口客服部","ename":"103392","password":"1","deleted":"false","entitytype":"t_user","loginip":"10.10.10.1","selfid":"103392","name":"牛永胜","templatename":"useredit","id":"103392","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"13592232789","rolestr":"抄表员","resourcetype":"user","userid":"100337","parentid":"46581","f_department_name":"周口客服部","ename":"100337","password":"1","deleted":"false","entitytype":"t_user","selfid":"100337","name":"王雪丽","templatename":"useredit","id":"100337","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"17796528119","rolestr":"抄表员","resourcetype":"user","userid":"101021","parentid":"46581","f_department_name":"周口客服部","ename":"101021","password":"1","deleted":"false","entitytype":"t_user","selfid":"101021","name":"张书荣","templatename":"useredit","id":"101021","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"18839409832","rolestr":"抄表员","resourcetype":"user","userid":"100330","parentid":"46581","f_department_name":"周口客服部","ename":"100330","password":"1","deleted":"false","entitytype":"t_user","selfid":"100330","name":"武文平","templatename":"useredit","id":"100330","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"13839441227","rolestr":"抄表员","resourcetype":"user","userid":"100871","parentid":"46581","f_department_name":"周口客服部","ename":"100871","password":"1","deleted":"false","entitytype":"t_user","selfid":"100871","name":"李明磊","templatename":"useredit","id":"100871","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"}],"lics":[]}
956
- this.show_data.start_activity = this.json_datas.start_activity
957
- this.show_data.xmlfilename = this.json_datas.workflow_xmlfilename
958
-
959
- let res = await this.$resetpost(
960
- // `rs/logic/ApplyProductService`,
961
- `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyProductService`,
962
- {data: this.show_data},
963
- {resolveMsg: null, rejectMsg: '数据保存失败'}
964
- )
965
-
966
- if (this.show_data.button.after) {
967
- this[this.show_data.button.after]()
968
- }
969
- // 返回上层
970
- this.$dispatch('confirm')
971
- },
972
- // 失去焦点出触发事件
973
- 'onchange' (index) {
974
- if (this.show_data.defname === '报装申请') {
975
- if (
976
- this.show_data.fields[index].label === '区/县' ||
977
- this.show_data.fields[index].label === '街道/乡镇' ||
978
- this.show_data.fields[index].label === '集收单位' ||
979
- this.show_data.fields[index].label === '楼号/组' ||
980
- this.show_data.fields[index].label === '单元/排' ||
981
- this.show_data.fields[index].label === '楼层' ||
982
- this.show_data.fields[index].label === '门牌号'
983
- ) {
984
-
985
- let f_pcd = this.getLableValue('区/县') || ''
986
- let f_street = this.getLableValue('街道/乡镇') || ''
987
- let f_residential_area = this.getLableValue('集收单位') || ''
988
- let f_building = this.getLableValue('楼号/组') || ''
989
- let f_building_suffix = f_building ? this.config.f_building_suffix : ''
990
- let f_unit = this.getLableValue('单元/排') || ''
991
- let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
992
- let f_floor = this.getLableValue('楼层') || ''
993
- let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
994
- let f_room = this.getLableValue('门牌号') || ''
995
- let f_room_suffix = f_room ? this.config.f_room_suffix : ''
996
-
997
- let f_address = null
998
-
999
- let f_address_type = this.show_data.f_address_type
1000
- 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
1001
- /*if (f_address_type === '民用城区') {
1002
- f_address = 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
1003
- }
1004
- if (f_address_type === '民用农村') {
1005
- f_address = f_building + f_unit + f_floor + f_room
1006
- }
1007
- if (f_address_type === '特殊城区') {
1008
- f_address = f_street + f_residential_area
1009
- }*/
1010
- this.setLabelValue("地址", f_address)
1011
- }
1012
- }
1013
- },
1014
- async getDesignerPeople () {
1015
- let data = {
1016
- source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
1017
- userid: this.$login.f.id
1018
- }
1019
-
1020
- let http = new HttpResetClass()
1021
- let res = await http.load(
1022
- 'POST',
1023
- `rs/search`,
1024
- {data: data},
1025
- {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
1026
- )
1027
-
1028
- return res.data.map(item => {
1029
- return {
1030
- label: item.name,
1031
- value: item.id
1032
- }
1033
- })
1034
- },
1035
- // 申请节点初始化
1036
- 'applyReadyEvent' () {
1037
- this.addressInitialization()
1038
-
1039
- this.pcdChange()
1040
- this.streetChange()
1041
- },
1042
- // 合同金额失去焦点
1043
- async 'contractMoneyChange' (index) {
1044
- let data = {
1045
- operator: '+',
1046
- num1: this.show_data.f_contract_money || 0,
1047
- num2: this.getLableValue('追加金额') || 0
1048
- }
1049
- let res = await this.$resetpost(
1050
- `${this.$androidUtil.getProxyUrl()}/rs/logic/compute`,
1051
- {data: data},
1052
- {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1053
- )
1054
-
1055
- this.setLabelValue('应交金额', res.data)
1056
- },
1057
- // 街道失去焦点
1058
- async 'streetChange' (index) {
1059
- if (isEmpty(this.show_data.f_street)) {
1060
- return
1061
- }
1062
-
1063
- this.setLabelValue('集收单位', null)
1064
-
1065
- let data = {
1066
- tablename: 't_area',
1067
- condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}'`
1068
- }
1069
- let http = new HttpResetClass()
1070
- let res = await http.load(
1071
- 'POST',
1072
- `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
1073
- {data: data},
1074
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1075
- )
1076
-
1077
- this.setLabelOptions('集收单位', res.data.map(item => {
1078
- return {
1079
- label: item.f_residential_area,
1080
- value: item.f_residential_area
1081
- }
1082
- }))
1083
- },
1084
- // 选择报建项目
1085
- 'selectApply' (row) {
1086
- this.setLabelValue('工程名称', row.f_entry_name)
1087
- this.setLabelValue('工程编号', row.f_apply_num)
1088
- this.setLabelValue('报建类型', row.f_apply_type)
1089
- this.setLabelValue('用户名称', row.f_user_name)
1090
- this.setLabelValue('用户电话', row.f_phone)
1091
- this.setLabelValue('证件类型', row.f_credentials)
1092
- this.setLabelValue('证件号码', row.f_idnumber)
1093
- this.setLabelValue('地址', row.f_address)
1094
- this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
1095
-
1096
- this.show_data.parentApply = JSON.parse(JSON.stringify(row))
1097
-
1098
- delete row.id
1099
- delete row.actid
1100
- delete row.defid
1101
- delete row.defname
1102
- delete row.version
1103
- delete row.f_apply_num
1104
- delete row.f_sub_state
1105
- delete row.f_apply_type
1106
- delete row.f_process_id
1107
-
1108
- this.show_data = Object.assign({}, this.show_data, row)
1109
-
1110
- this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
1111
- },
1112
- // 区县失去焦点
1113
- async 'pcdChange' (index) {
1114
- if (isEmpty(this.show_data.f_pcd)) {
1115
- return
1116
- }
1117
-
1118
- this.setLabelValue('街道/乡镇', null)
1119
- this.setLabelValue('集收单位', null)
1120
-
1121
-
1122
-
1123
- let data = {
1124
- tablename: 't_street',
1125
- condition: `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1126
- }
1127
- let f_address_type = this.getLableValue('地址类型')
1128
-
1129
- if (f_address_type === '民用市区') {
1130
- data.condition = `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1131
- }
1132
- if (f_address_type === '民用乡镇') {
1133
- data.condition = `f_filialeid = '${Vue.user.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1134
- }
1135
-
1136
- let http = new HttpResetClass()
1137
- let res = await http.load(
1138
- 'POST',
1139
- `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
1140
- {data: data},
1141
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1142
- )
1143
-
1144
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
1145
- return {
1146
- label: item.f_street,
1147
- value: item.f_street
1148
- }
1149
- }))
1150
- },
1151
- // 选择用户档案信息
1152
- 'selectUserinfo' (row) {
1153
- this.setLabelValue('用户编号', row.f_userinfo_code)
1154
- this.setLabelValue('用户名称', row.f_user_name)
1155
- this.setLabelValue('用户电话', row.f_user_phone)
1156
- this.setLabelValue('证件类型', row.f_credentials)
1157
- this.setLabelValue('证件号码', row.f_idnumber)
1158
- this.setLabelValue('地址', row.f_address)
1159
-
1160
- this.show_data.f_userinfo_id = row.f_userinfo_id
1161
- this.show_data.f_userinfo_code = row.f_userinfo_code
1162
- },
1163
- // 地址类型失去焦点
1164
- 'addressTypeChange' (index) {
1165
- this.setLabelValue('街道/乡镇', null)
1166
- this.setLabelValue('集收单位', null)
1167
- let f_address_type = this.show_data.fields[index].value
1168
- for (const item of this.show_data.fields) {
1169
- if (f_address_type === '民用市区') {
1170
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1171
- item.hidden = false
1172
- item.required = true
1173
- item.value = null
1174
- }
1175
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1176
- item.hidden = false
1177
- item.required = false
1178
- item.value = null
1179
- }
1180
- if (item.label === '地址') {
1181
- item.readonly = true
1182
- item.value = null
1183
- }
1184
- }
1185
- if (f_address_type === '民用乡镇') {
1186
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1187
- item.hidden = false
1188
- item.required = true
1189
- item.value = null
1190
- }
1191
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1192
- item.hidden = false
1193
- item.required = false
1194
- item.value = null
1195
- }
1196
- if (item.label === '楼层') {
1197
- item.hidden = true
1198
- item.required = false
1199
- item.value = null
1200
- }
1201
- if (item.label === '地址') {
1202
- item.readonly = true
1203
- item.value = null
1204
- }
1205
- }
1206
- if (f_address_type === '特殊地址') {
1207
- if (item.label === '区/县' || item.label === '街道/乡镇') {
1208
- item.hidden = false
1209
- item.required = true
1210
- item.value = null
1211
- }
1212
- if (item.label === '集收单位') {
1213
- item.hidden = false
1214
- item.required = false
1215
- item.value = null
1216
- }
1217
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1218
- item.hidden = true
1219
- item.required = false
1220
- item.value = null
1221
- }
1222
- if (item.label === '地址') {
1223
- item.readonly = false
1224
- item.value = null
1225
- }
1226
- }
1227
- }
1228
- },
1229
- // 搜索小区
1230
- async 'searchArea' (area, index) {
1231
- let data = {
1232
- tablename: 't_area',
1233
- condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1234
- }
1235
- let http = new HttpResetClass()
1236
- let res = await http.load(
1237
- 'POST',
1238
- `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
1239
- {data: data},
1240
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1241
- )
1242
-
1243
- if (res.data.length === 0) {
1244
- return
1245
- }
1246
-
1247
- this.setLabelOptions('集收单位', res.data.map(item => {
1248
- return {
1249
- label: item.f_residential_area,
1250
- value: item.f_residential_area
1251
- }
1252
- }))
1253
- },
1254
- // 团购转散户初始化
1255
- 'apply2ReadyEvent' () {
1256
- if (this.show_data.f_apply_source === '线下发起') {
1257
- this.addressInitialization()
1258
- this.hideLabels('用户编号')
1259
- this.electiveLabels('用户编号')
1260
- this.showLabels('片区', '地址类型')
1261
- this.requiredLabels('片区', '地址类型')
1262
- }
1263
- if (this.show_data.f_apply_source === '自动发起') {
1264
- this.hideLabels('片区', '地址类型')
1265
- this.electiveLabels('片区', '地址类型',)
1266
- }
1267
- },
1268
- 'onblur' (index) {},
1269
- 'oninput' (index) {},
1270
- 'initializtionView' () {},
1271
- async 'onchangeModal' (index, fieldIndex) {
1272
- },
1273
- async 'onblurModal' (index, fieldIndex) {
1274
-
1275
- },
1276
- async 'oninputModal' (index, fieldIndex) {
1277
-
1278
- },
1279
- async 'onetomanydelete' (index, rowIndex) {
1280
-
1281
- let http = new HttpResetClass()
1282
-
1283
- let res = await http.load(
1284
- 'DELETE',
1285
- `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1286
- null,
1287
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
1288
- )
1289
- res = await this.$resetpost(
1290
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1291
- this.show_data
1292
- )
1293
- this.breakControl()
1294
- },
1295
- async 'onetomanyupdate' (index, rowIndex) {
1296
- let data = this.show_data.onetomany[index].rows[rowIndex]
1297
-
1298
- this.show_data.onetomany[index].fields.forEach(item => {
1299
- data[item.field] = item.value
1300
- })
1301
- let res = await this.$resetpost(
1302
- `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1303
- data
1304
- )
1305
- res = await this.$resetpost(
1306
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1307
- this.show_data
1308
- )
1309
- this.breakControl()
1310
- },
1311
- async 'onetomanyadd' (index) {
1312
- let data = {
1313
- f_process_id : this.show_data.f_process_id,
1314
- f_operator_id: Vue.user.id,
1315
- f_operator: Vue.user.name,
1316
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1317
- f_orgid: Vue.user.orgid,
1318
- f_orgname: Vue.user.orgs
1319
- }
1320
- this.show_data.onetomany[index].fields.forEach(item => {
1321
- data[item.field] = item.value
1322
- })
1323
- let res = await this.$resetpost(
1324
- `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1325
- data
1326
- )
1327
- res = await this.$resetpost(
1328
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1329
- this.show_data
1330
- )
1331
- this.breakControl()
1332
- },
1333
- 'onbutchange' (index) {
1334
-
1335
- },
1336
- 'onbutblur' (index) {
1337
-
1338
- },
1339
- 'onbutinput' (index) {
1340
-
1341
- }
1342
- },
1343
- watch: {
1344
- }
1345
- }
1346
- </script>
1347
- <style scoped>
1348
- </style>
1
+ <template>
2
+ <div class="col-sm-12 col-xs-12 p-10">
3
+ <accordion one-at-a-time="true">
4
+ <panel :header="selectdata.defname" :is-open="true" type="primary">
5
+ <app-service-view v-ref:serviceview :data="show_data" v-if="showview"></app-service-view>
6
+ </panel>
7
+ <panel header="拍照" :is-open="false" type="primary" v-if="selectdata.f_process_id">
8
+ <app-take-pic :blobid="selectdata.f_process_id" :defname="selectdata.defname" :isdelete="true" :istakepic="true" :istype="true"></app-take-pic>
9
+ </panel>
10
+ <panel header="签字" :is-open="false" type="primary" v-if="selectdata.f_process_id">
11
+ <app-sign @sign-success="signSuccess" :file-path="selectdata.f_process_id" @sign-clean="signClean"></app-sign>
12
+ </panel>
13
+ </accordion>
14
+ </div>
15
+ </template>
16
+ <script>
17
+ import Vue from 'vue'
18
+ import {HttpResetClass} from 'vue-client'
19
+ import {isEmpty} from "../../Util";
20
+ // Date格式化
21
+ Date.prototype.Format = function (fmt) {
22
+ var o = {
23
+ 'M+': this.getMonth() + 1, // 月份
24
+ 'd+': this.getDate(), // 日
25
+ 'H+': this.getHours(), // 小时
26
+ 'm+': this.getMinutes(), // 分
27
+ 's+': this.getSeconds(), // 秒
28
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
29
+ 'S': this.getMilliseconds() // 毫秒
30
+ }
31
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
32
+ for (var k in o) {
33
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
34
+ }
35
+ return fmt
36
+ }
37
+ export default {
38
+ title: '报建流程业务控制层',
39
+ props: ['selectdata'],
40
+ data () {
41
+ return {
42
+ json_datas: null,
43
+ data: null,
44
+ show_data: null,
45
+ showview: false,
46
+ config: {}
47
+ }
48
+ },
49
+ ready () {
50
+ this.refurbish()
51
+ },
52
+ methods: {
53
+ async refurbish() {
54
+ let data = {
55
+ workname: this.selectdata.processname
56
+ }
57
+
58
+ let res = await this.$resetpost(
59
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyGetConfigs`,
60
+ {data: data},
61
+ {resolveMsg: null, rejectMsg: '配置数据获取失败!!!'}
62
+ )
63
+
64
+ this.json_datas = res.data
65
+
66
+ let sum = 0
67
+ let jsonData = {}
68
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
69
+ this.$showMessage("网络故障,请刷新页面")
70
+ return
71
+ }
72
+ this.json_datas.activitys.forEach(item => {
73
+ if (this.selectdata.defname === item.title) {
74
+ jsonData = item // 拿到当前节点的json配置信息
75
+ sum++ // 节点名一样的个数
76
+ }
77
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
78
+ })
79
+
80
+ if (sum === 0) {
81
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
82
+ return
83
+ }
84
+ if (sum > 1) {
85
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
86
+ return
87
+ }
88
+
89
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
90
+
91
+ // fields 字段填充值
92
+ for (const item of this.selectdata.fields) {
93
+ if (!item.value) {
94
+ item.value = null
95
+ }
96
+
97
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
98
+ if (item.eval) {
99
+ let user = Vue.user
100
+ // 将PC用户信息 替换成 APP的
101
+ item.value = eval(item.default.replace('this.$login.f', 'user'))
102
+ } else {
103
+ item.value = item.default
104
+ }
105
+ }
106
+
107
+ if (this.selectdata[item.field]) {
108
+ // 将json字符串格式化赋值给value
109
+ if (String(this.selectdata[item.field]).startsWith("{")) {
110
+ item.value = JSON.parse(this.selectdata[item.field])
111
+ } else {
112
+ item.value = this.selectdata[item.field]
113
+ }
114
+ }
115
+ if (this.selectdata[item.field] === 0) {
116
+ item.value = 0
117
+ }
118
+
119
+ // datepicker
120
+ if (item.type === 'datepicker' && !item.value && item.default) {
121
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
122
+ }
123
+
124
+ // 如果配置类型为select,优先从参数列表获取options
125
+ if (item.type === 'select' || item.type === 'checkbox') {
126
+ if (item.param) {
127
+ let temp = this.$appdata.getParam(item.label)
128
+
129
+ if (temp && temp.length > 0) {
130
+ item.options = temp
131
+ }
132
+
133
+ if (item.paramLabel) {
134
+ temp = this.$appdata.getParam(item.paramLabel)
135
+ if (temp && temp.length > 0) {
136
+ item.options = temp
137
+ }
138
+ }
139
+ }
140
+ console.log("item.ready"+item.ready)
141
+ if (item.ready) {
142
+ item.options = await this[item.ready]()
143
+ }
144
+ }
145
+
146
+
147
+ if (item.type === 'checkbox') {
148
+ if (this.selectdata[item.field]) {
149
+ item.value = JSON.parse(this.selectdata[item.field])
150
+ } else {
151
+ item.value = []
152
+ }
153
+ }
154
+ }
155
+
156
+ // 控制组件
157
+ if (this.selectdata.components) {
158
+ this.selectdata.components.forEach(item => {
159
+ if (!item.mark) {
160
+ item.mark = 0
161
+ }
162
+ })
163
+ }
164
+
165
+ // 初始化onetomany
166
+ if (this.selectdata.onetomany) {
167
+ for (const item of this.selectdata.onetomany) {
168
+ let res = null
169
+ if (item.queryEvent) {
170
+ res = this[item.queryEvent]()
171
+ } else {
172
+ let http = new HttpResetClass()
173
+ let data = {
174
+ tablename: item.tables[0],
175
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
176
+ }
177
+ res = await http.load(
178
+ 'POST',
179
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
180
+ // `rs/sql/singleTable`,
181
+ {data: data},
182
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
183
+ )
184
+ }
185
+
186
+ item.rows = res.data
187
+
188
+ // 初始化onetomany中的fields
189
+ for (const field of item.fields) {
190
+ if (!field.value) {
191
+ if (field.value !== 0) {
192
+ field.value = null
193
+ }
194
+ }
195
+
196
+ if (field.default || field.default === 0) {
197
+ field.value = field.default
198
+ }
199
+
200
+ // datepicker
201
+ if (field.type === 'datepicker' && !field.value && field.default) {
202
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
203
+ }
204
+
205
+ if (field.type === 'select') {
206
+
207
+ if (field.param) {
208
+ let temp = this.$appdata.getParam(field.label)
209
+
210
+ if (temp && temp.length > 0) {
211
+ field.options = temp
212
+ }
213
+
214
+ if (field.paramLabel) {
215
+ temp = this.$appdata.getParam(field.paramLabel)
216
+ if (temp && temp.length > 0) {
217
+ item.options = temp
218
+ }
219
+ }
220
+ }
221
+
222
+ }
223
+ }
224
+ }
225
+ }
226
+
227
+ // 初始化 buttons_fields
228
+ for (const item of this.selectdata.buttons) {
229
+ if (item.button_name === '下发') {
230
+ let data = {
231
+ source: item.source,
232
+ userid: Vue.user.id
233
+ // userid: '51953'
234
+ }
235
+ if (item.sourceMethod) {
236
+ data.source = this[item.sourceMethod]()
237
+ }
238
+ if (!data.source) {
239
+ this.$showMessage("请配置获取人员表达式")
240
+ return
241
+ }
242
+ let res = await this.$resetpost(
243
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
244
+ // `rs/search`,
245
+ {data: data},
246
+ {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
247
+ )
248
+
249
+ let options = res.data.map(source => {
250
+ return {
251
+ "label": source.name,
252
+ "value": source.id
253
+ }
254
+ })
255
+
256
+ if (item.button_fields.length !== 1) {
257
+ this.$showMessage("下发有且只能有一个字段!!!")
258
+ return
259
+ }
260
+
261
+ item.button_fields[0].options = options
262
+ }
263
+ if (item.button_fields) {
264
+ item.button_fields.forEach(x => {
265
+ // 如果配置类型为select,优先从参数列表获取options
266
+ if (x.type === 'select') {
267
+
268
+ if (x.param) {
269
+ let temp = this.$appdata.getParam(x.label)
270
+
271
+ if (temp && temp.length > 0) {
272
+ x.options = temp
273
+ }
274
+
275
+ if (x.paramLabel) {
276
+ temp = this.$appdata.getParam(x.paramLabel)
277
+ if (temp && temp.length > 0) {
278
+ x.options = temp
279
+ }
280
+ }
281
+ }
282
+
283
+ }
284
+ })
285
+ }
286
+ }
287
+
288
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
289
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
290
+
291
+ this.show_data = temp
292
+ this.$nextTick(() => {
293
+ this.showview = true
294
+ })
295
+ },
296
+ signClean () {
297
+ this.selectdata.f_construction_sign = null
298
+ },
299
+ signSuccess (fileUrl) {
300
+ console.log('==============签字回调==================')
301
+ console.log(fileUrl)
302
+ this.selectdata.f_construction_sign = fileUrl
303
+ },
304
+ // 金额转大写
305
+ smalltoBIG(n) {
306
+ let fraction = ['角', '分'];
307
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
308
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
309
+ let head = n < 0 ? '欠' : '';
310
+ n = Math.abs(n);
311
+
312
+ let s = '';
313
+
314
+ for (var i = 0; i < fraction.length; i++) {
315
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
316
+ }
317
+ s = s || '整';
318
+ n = Math.floor(n);
319
+
320
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
321
+ let p = '';
322
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
323
+ p = digit[n % 10] + unit[1][j] + p;
324
+ n = Math.floor(n / 10);
325
+ }
326
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
327
+ }
328
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
329
+ },
330
+ getLableValue(label) {
331
+ for (const item of this.show_data.fields) {
332
+ if (item.label === label && item.type !== 'number') {
333
+ return item.value || ''
334
+ }
335
+ if (item.label === label && item.type === 'number') {
336
+ return item.value || 0
337
+ }
338
+ }
339
+ },
340
+ getLableOptions(label) {
341
+ for (const item of this.show_data.fields) {
342
+ if (item.label === label) {
343
+ return item.options
344
+ }
345
+ }
346
+ },
347
+ setLabelValue(label, value) {
348
+ for (const item of this.show_data.fields) {
349
+ if (item.label === label) {
350
+ item.value = value
351
+ this.show_data[item.field] = value
352
+ }
353
+ }
354
+ },
355
+ setLabelOptions(label, options) {
356
+ for (const item of this.show_data.fields) {
357
+ if (item.label === label) {
358
+ item.options = options
359
+ }
360
+ }
361
+ },
362
+ disabledButtons(...buttons) {
363
+ for (const item of this.show_data.buttons) {
364
+ if (buttons.includes(item.button_name)) {
365
+ item.disabled = true
366
+ }
367
+ }
368
+ },
369
+ enableButtons(...buttons) {
370
+ for (const item of this.show_data.buttons) {
371
+ if (buttons.includes(item.button_name)) {
372
+ item.disabled = false
373
+ }
374
+ }
375
+ },
376
+ showButtons(...buttons) {
377
+ for (const item of this.show_data.buttons) {
378
+ if (buttons.includes(item.button_name)) {
379
+ item.hidden = false
380
+ }
381
+ }
382
+ },
383
+ hideButtons(...buttons) {
384
+ for (const item of this.show_data.buttons) {
385
+ if (buttons.includes(item.button_name)) {
386
+ item.hidden = true
387
+ }
388
+ }
389
+ },
390
+ async streetChange () {
391
+ if (isEmpty(this.show_data.f_street)) {
392
+ return
393
+ }
394
+
395
+ let data = {
396
+ tablename: 't_area',
397
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
398
+ }
399
+ let http = new HttpResetClass()
400
+ let res = await http.load(
401
+ 'POST',
402
+ `rs/sql/singleTable`,
403
+ {data: data},
404
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
405
+ )
406
+
407
+ this.setLabelOptions('集收单位', res.data.map(item => {
408
+ return {
409
+ label: item.f_residential_area,
410
+ value: item.f_residential_area
411
+ }
412
+ }))
413
+ },
414
+ async pcdChange () {
415
+ if (isEmpty(this.show_data.f_pcd)) {
416
+ return
417
+ }
418
+
419
+ let data = {
420
+ tablename: 't_street',
421
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
422
+ }
423
+ let f_address_type = this.getLableValue('地址类型')
424
+
425
+ if (f_address_type === '民用市区') {
426
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
427
+ }
428
+ if (f_address_type === '民用乡镇') {
429
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
430
+ }
431
+
432
+ let http = new HttpResetClass()
433
+ let res = await http.load(
434
+ 'POST',
435
+ `rs/sql/singleTable`,
436
+ {data: data},
437
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
438
+ )
439
+
440
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
441
+ return {
442
+ label: item.f_street,
443
+ value: item.f_street
444
+ }
445
+ }))
446
+ },
447
+ async addressInitialization () {
448
+ //this.$getConfig(this, 'UserAddress')
449
+ //获取地址配置文件
450
+ try {
451
+ let res = await new HttpResetClass().load('get',`${this.$androidUtil.getProxyUrl()}/rs/vue/UserAddress.json`,null,{resolveMsg: null, rejectMsg: null})
452
+ Object.assign(this.config, res.data)
453
+ } catch (error) {
454
+ console.log("未获取到地址信息")
455
+ }
456
+ console.log("???????????不走了吗!")
457
+ let f_address_type = this.show_data.f_address_type
458
+
459
+ for (const item of this.show_data.fields) {
460
+ if (f_address_type === '民用市区') {
461
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
462
+ item.hidden = false
463
+ item.required = true
464
+ }
465
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
466
+ item.hidden = false
467
+ item.required = false
468
+ }
469
+ if (item.label === '地址') {
470
+ item.readonly = true
471
+ }
472
+ }
473
+ if (f_address_type === '民用乡镇') {
474
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
475
+ item.hidden = false
476
+ item.required = true
477
+ }
478
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
479
+ item.hidden = false
480
+ item.required = false
481
+ }
482
+ if (item.label === '楼层') {
483
+ item.hidden = true
484
+ item.required = false
485
+ }
486
+ if (item.label === '地址') {
487
+ item.readonly = true
488
+ }
489
+ }
490
+ if (f_address_type === '特殊地址') {
491
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
492
+ item.hidden = false
493
+ item.required = true
494
+ }
495
+ if (item.label === '集收单位') {
496
+ item.hidden = false
497
+ item.required = false
498
+ }
499
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
500
+ item.hidden = true
501
+ item.required = false
502
+ }
503
+ if (item.label === '地址') {
504
+ item.readonly = false
505
+ }
506
+ }
507
+
508
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
509
+ item.hidden = true
510
+ }
511
+ }
512
+ },
513
+
514
+ async checkDuplicate(index) {
515
+ let http = new HttpResetClass()
516
+ let data = {
517
+ tablename: 't_apply',
518
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
519
+ }
520
+ let res = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {data: data}, {
521
+ resolveMsg: null,
522
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
523
+ })
524
+ if (res.data.length > 0) {
525
+ this.show_data.fields[index].value = null
526
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
527
+ }
528
+ },
529
+ async breakControl () {
530
+ if (this.show_data.id) {
531
+ let data = {
532
+ condition: `u.id = ${this.show_data.id}`,
533
+ data: {
534
+ id: Vue.user.id,
535
+ orgid: Vue.user.orgid
536
+ // id: '51953',
537
+ // orgid: '10101'
538
+ }
539
+ }
540
+ let res = await this.$resetpost(
541
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/checkuser`,
542
+ // `rs/sql/checkuser`,
543
+ {data: data},
544
+ {resolveMsg: null, rejectMsg: '数据更新失败,请手查询更新!!!'}
545
+ )
546
+
547
+ this.selectdata = res.data[0]
548
+ } else {
549
+ this.selectdata = servicedata
550
+ }
551
+
552
+ this.refurbish()
553
+ },
554
+ async addressTips () {
555
+ let res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
556
+ if (res == 'confirm') {
557
+ return
558
+ }
559
+ throw '用户信息确认!!!'
560
+ },
561
+ // 缴费前置
562
+ chargeBefore () {
563
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
564
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
565
+ throw null
566
+ }
567
+ },
568
+ // 施工前置
569
+ async constructionBefore () {
570
+ let http = new HttpResetClass()
571
+ let data = {
572
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
573
+ }
574
+ let res = await http.load(
575
+ 'POST',
576
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/countApplyUserinfo`,
577
+ {data: data},
578
+ {
579
+ resolveMsg: null,
580
+ rejectMsg: '安装明细查询失败!!!'
581
+ })
582
+ if (res.data[0].num > 0) {
583
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
584
+ throw `还有${res.data[0].num}户未安装,无法提交`
585
+ }
586
+ },
587
+ changePipeBuild () {
588
+ if (this.selectdata.f_process_dep === '工程部') {
589
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
590
+ }
591
+ if (this.selectdata.f_process_dep === '运营部') {
592
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
593
+ }
594
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
595
+ },
596
+ async getPrice (f_price_id) {
597
+ console.log('=======================')
598
+ console.log(f_price_id)
599
+
600
+ let data = {
601
+ condition: `sp.f_filialeid = '${Vue.user.orgid}'`
602
+ }
603
+
604
+ if (!isEmpty(f_price_id)) {
605
+ data.condition = `sp.f_filialeid = '${Vue.user.orgid}' and sp.f_price_id = ${f_price_id}`
606
+ }
607
+ let http = new HttpResetClass()
608
+ let res = await http.load(
609
+ 'POST',
610
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/applyGetPrice`,
611
+ {data: data},
612
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
613
+ )
614
+
615
+ return res.data.map(item => {
616
+ return {
617
+ label: item.f_price_name,
618
+ value: item
619
+ }
620
+ })
621
+ },
622
+ async getDesignerPeople () {
623
+ let data = {
624
+ source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
625
+ userid: Vue.user.id
626
+ }
627
+
628
+ let http = new HttpResetClass()
629
+ let res = await http.load(
630
+ 'POST',
631
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
632
+ {data: data},
633
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
634
+ )
635
+
636
+ return res.data.map(item => {
637
+ return {
638
+ label: item.name,
639
+ value: item.id
640
+ }
641
+ })
642
+ },
643
+ async surveyStopApply () {
644
+ console.log('终止报建!!!!!')
645
+
646
+ this.show_data.f_stop_reason = '现场勘察不符合报装条件'
647
+
648
+ let data = {
649
+ data: this.show_data,
650
+ user: Vue.user
651
+ }
652
+
653
+ let res = await this.$resetpost(
654
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/surveyStopApply`,
655
+ {data: data},
656
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
657
+ )
658
+
659
+ this.$dispatch('loadPage')
660
+
661
+ throw '终止报建!!!'
662
+ },
663
+ async getDevInfo () {
664
+ let data = {
665
+ tablename: 't_dev_info',
666
+ condition: `f_orgid = '${Vue.user.orgid}'`
667
+ }
668
+ let http = new HttpResetClass()
669
+ let res = await http.load(
670
+ 'POST',
671
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
672
+ {data: data},
673
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
674
+ )
675
+
676
+ return res.data.map(item => {
677
+ return {
678
+ label: item.f_dev_name,
679
+ value: item.f_dev_name
680
+ }
681
+ })
682
+ },
683
+ async getDesignerPeople () {
684
+ let data = {
685
+ source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
686
+ userid: Vue.user.id
687
+ }
688
+
689
+ let http = new HttpResetClass()
690
+ let res = await http.load(
691
+ 'POST',
692
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
693
+ {data: data},
694
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
695
+ )
696
+
697
+ return res.data.map(item => {
698
+ return {
699
+ label: item.name,
700
+ value: item.id
701
+ }
702
+ })
703
+ },
704
+ // 获取片区
705
+ async getSliceArea () {
706
+ let data = {
707
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
708
+ userid: Vue.user.id
709
+ }
710
+
711
+ let http = new HttpResetClass()
712
+ let res = await http.load(
713
+ 'POST',
714
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
715
+ {data: data},
716
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
717
+ )
718
+
719
+ return res.data.map(item => {
720
+ return {
721
+ label: item.name,
722
+ value: item.name
723
+ }
724
+ })
725
+ },
726
+ // 获取区县
727
+ async getPcd () {
728
+ let data = {
729
+ tablename: 't_pcd',
730
+ condition: `f_filialeid = '${Vue.user.orgid}'`
731
+ }
732
+ let http = new HttpResetClass()
733
+ let res = await http.load(
734
+ 'POST',
735
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
736
+ {data: data},
737
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
738
+ )
739
+
740
+ return res.data.map(item => {
741
+ return {
742
+ label: item.f_pcd,
743
+ value: item.f_pcd
744
+ }
745
+ })
746
+ }
747
+
748
+ },
749
+ events: {
750
+ 'complyInstallation' (index) {
751
+ if (this.show_data.f_is_have === '否') {
752
+ this.hideButtons('提交', '出图', '缴费')
753
+ this.showButtons('终止')
754
+ }
755
+ if (this.show_data.f_is_have === '是') {
756
+ this.hideButtons('终止')
757
+ this.showButtons('提交', '出图', '缴费')
758
+ }
759
+ },
760
+ async 'igniteDispatchReadyEvent' () {
761
+ let data = {
762
+ tablename: 'activityins',
763
+ condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
764
+ }
765
+ let http = new HttpResetClass()
766
+ let res = await http.load(
767
+ 'POST',
768
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
769
+ {data: data},
770
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
771
+ )
772
+ if (res.data.length <= 0) {
773
+ console.log('+++++++++++++++++++++++++++++')
774
+ console.log('没有施工,不能退回')
775
+ this.hideButtons('退回')
776
+ }
777
+ },
778
+ 'breakControl' () {
779
+ this.breakControl()
780
+ },
781
+ // 检查重复
782
+ 'checkRepeat' (index) {
783
+ this.checkDuplicate(index)
784
+ },
785
+ 'buildReadyEvent' () {
786
+ this.setLabelValue('施工单位', Vue.user.name)
787
+ this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
788
+ },
789
+ // 选择材料
790
+ async materialNameChenge (index, fieldIndex) {
791
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
792
+
793
+ this.show_data.onetomany[index].fields.forEach(item => {
794
+ if (material[item.field]) {
795
+ item.value = material[item.field]
796
+ }
797
+ })
798
+ },
799
+ // 打开模态框获取材料
800
+ async 'getMaterialName' (index) {
801
+ let data = {
802
+ condition: `1=1`
803
+ }
804
+ let http = new HttpResetClass()
805
+ let res = await http.load(
806
+ 'POST',
807
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getStockMaterial`,
808
+ {data: data},
809
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
810
+ )
811
+
812
+ this.show_data.onetomany[index].fields.forEach(field => {
813
+ if (field.label === '选择材料') {
814
+ field.options = res.data.map(item => {
815
+ return {
816
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
817
+ 'value': item
818
+ }
819
+ })
820
+ }
821
+ })
822
+ },
823
+ // 选择气价
824
+ 'priceChange' (index) {
825
+ if (isEmpty(this.show_data.stairPrice)) {
826
+ return
827
+ }
828
+
829
+ let stairPrice = this.getLableValue('气价名称')
830
+
831
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
832
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
833
+ this.setLabelValue('价格', stairPrice.f_price)
834
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
835
+
836
+ this.show_data.f_price_id = stairPrice.f_price_id
837
+ this.show_data.f_price_name = stairPrice.f_price_name
838
+ },
839
+ // 是否购买保险
840
+ isInsureChange (index) {
841
+ let f_is_insure = this.getLableValue('是否购买保险')
842
+ for (const item of this.show_data.fields) {
843
+ if (f_is_insure === '是') {
844
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
845
+ item.hidden = false
846
+ item.required = true
847
+ }
848
+ if (item.label === '保险备注') {
849
+ item.hidden = false
850
+ }
851
+ } else {
852
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
853
+ item.hidden = true
854
+ item.required = false
855
+ }
856
+ }
857
+ }
858
+ },
859
+ // 通气点火初始化
860
+ async 'gasReadyEvent' () {
861
+ console.log('----通气点火初始化----')
862
+ if (!isEmpty(this.show_data.f_price_id)) {
863
+ let priceList = await this.getPrice(this.show_data.f_price_id)
864
+ this.setLabelValue('气价名称', priceList[0].value)
865
+ }
866
+
867
+ let data = {
868
+ tablename: 't_userfees',
869
+ condition: `f_orgid = '${Vue.user.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
870
+ }
871
+
872
+ console.log('---------查询是否有待执行保险-----------')
873
+ let http = new HttpResetClass()
874
+ let res = await http.load(
875
+ 'POST',
876
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
877
+ {data: data},
878
+ {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
879
+ )
880
+ if (res.data.length > 0) {
881
+ console.log('----------具有待执行保险------------')
882
+ this.setLabelValue('待执行保险', '是')
883
+ for (const item of this.show_data.fields) {
884
+ if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
885
+ item.hidden = true
886
+ item.required = false
887
+ item.value = null
888
+ }
889
+ }
890
+ console.log('----------具有待执行保险------------')
891
+ } else {
892
+ console.log('----------不有待执行保险------------')
893
+ this.setLabelValue('待执行保险', '否')
894
+ for (const item of this.show_data.fields) {
895
+ if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
896
+ item.hidden = false
897
+ item.required = true
898
+ }
899
+ }
900
+ console.log('----------具有待执行保险------------')
901
+ }
902
+
903
+ // 初始化显示内容
904
+ let f_is_insure = this.getLableValue('是否购买保险')
905
+ for (const item of this.show_data.fields) {
906
+ if (f_is_insure === '是') {
907
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
908
+ item.hidden = false
909
+ item.required = true
910
+ }
911
+ if (item.label === '保险备注') {
912
+ item.hidden = false
913
+ }
914
+ // 本期保费到期时间默认一年
915
+ if (isEmpty(this.selectdata.f_ins_expiration_date)) {
916
+ let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
917
+ this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
918
+ }
919
+ }
920
+ if (f_is_insure === '否') {
921
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
922
+ item.hidden = true
923
+ item.required = false
924
+ }
925
+ }
926
+ }
927
+ },
928
+ // 合同金额失去焦点
929
+ async 'contractMoneyChange' (index) {
930
+ let data = {
931
+ operator: '+',
932
+ num1: this.show_data.f_contract_money || 0,
933
+ num2: this.getLableValue('追加金额') || 0
934
+ }
935
+ let res = await this.$resetpost(
936
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/compute`,
937
+ {data: data},
938
+ {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
939
+ )
940
+
941
+ this.setLabelValue('应交金额', res.data)
942
+ },
943
+ // ===========================================
944
+ async 'button'() {
945
+ if (this.show_data.button.before) {
946
+ await this[this.show_data.button.before]()
947
+ }
948
+ // 点击重置按钮就重置数据
949
+ if (this.show_data.button.button_name === '重置') {
950
+ this.$dispatch('breakControl', this.selectdata)
951
+ return
952
+ }
953
+
954
+ this.show_data.user = Vue.user
955
+ // this.show_data.user = {"f_show_department_name":"","parentname":"市场部","functions":[{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","parentname":"客服系统","icon":"/images/lefticon/档案管理.png","hasright":false,"resourcetype":"function","parentid":"27","children":[{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","parentname":"档案管理","link":"city-manage","hasright":true,"resourcetype":"function","parentid":"212","children":[],"selfid":"231","name":"街道管理","templatename":"functionedit","id":"230","position":"1","fullname":"资源管理.功能模块.客服系统.档案管理.街道管理","fullid":"3.21.27.212.230","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","parentname":"档案管理","link":"area-manage","hasright":true,"resourcetype":"function","parentid":"212","children":[],"selfid":"219","name":"小区管理","templatename":"functionedit","id":"218","position":"3","fullname":"资源管理.功能模块.客服系统.档案管理.小区管理","fullid":"3.21.27.212.218","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","parentname":"档案管理","link":"address-manage","hasright":true,"resourcetype":"function","parentid":"212","children":[],"selfid":"33664","name":"地址管理","templatename":"functionedit","id":"33663","position":"5","fullname":"资源管理.功能模块.客服系统.档案管理.地址管理","fullid":"3.21.27.212.33663","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","parentname":"档案管理","link":"file-user-files","hasright":true,"resourcetype":"function","parentid":"212","children":[],"selfid":"237","name":"用户档案","templatename":"functionedit","id":"236","position":"5","fullname":"资源管理.功能模块.客服系统.档案管理.用户档案","fullid":"3.21.27.212.236","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"档案管理","link":"file-user-files-new","hasright":true,"resourcetype":"function","parentid":"212","f_parentname":"档案管理","children":[],"selfid":"39450","name":"预备户管理","templatename":"functionedit","id":"39449","position":"6","fullname":"资源管理.功能模块.客服系统.档案管理.预备户管理","fullid":"3.21.27.212.39449","tablename":"t_function"}],"selfid":"213","name":"档案管理","templatename":"functionedit","id":"212","position":"2","fullname":"资源管理.功能模块.客服系统.档案管理","fullid":"3.21.27.212","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"客服系统","icon":"/images/lefticon/报建系统.png","hasright":true,"resourcetype":"function","parentid":"27","f_parentname":"客服系统","children":[{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"报建业务","link":"install-function","hasright":true,"resourcetype":"function","parentid":"34673","f_parentname":"报建业务","children":[],"selfid":"34680","name":"功能业务","templatename":"functionedit","id":"34679","position":"1","fullname":"资源管理.功能模块.客服系统.报建业务.功能业务","fullid":"3.21.27.34673.34679","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"报建业务","link":"exploration-user","hasright":true,"resourcetype":"function","parentid":"34673","f_parentname":"报建业务","children":[],"selfid":"34686","name":"流程业务","templatename":"functionedit","id":"34685","position":"2","fullname":"资源管理.功能模块.客服系统.报建业务.流程业务","fullid":"3.21.27.34673.34685","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"报建业务","link":"supervisory-control","hasright":true,"resourcetype":"function","parentid":"34673","f_parentname":"报建业务","children":[],"selfid":"34692","name":"流程监控","templatename":"functionedit","id":"34691","position":"3","fullname":"资源管理.功能模块.客服系统.报建业务.流程监控","fullid":"3.21.27.34673.34691","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"报建业务","link":"apply-charge-search","hasright":true,"resourcetype":"function","parentid":"34673","f_parentname":"报建业务","children":[],"selfid":"34698","name":"收费明细","templatename":"functionedit","id":"34697","position":"4","fullname":"资源管理.功能模块.客服系统.报建业务.收费明细","fullid":"3.21.27.34673.34697","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"报建业务","link":"order-apply","hasright":true,"resourcetype":"function","parentid":"34673","f_parentname":"报建业务","children":[],"selfid":"34704","name":"预约申请","templatename":"functionedit","id":"34703","position":"5","fullname":"资源管理.功能模块.客服系统.报建业务.预约申请","fullid":"3.21.27.34673.34703","tablename":"t_function"},{"pagenames":"公共通讯录维护模板","processnames":"发邮件流程","loginid":"15","parentname":"报建业务","link":"stop-apply","hasright":true,"resourcetype":"function","parentid":"34673","f_parentname":"报建业务","children":[],"selfid":"34710","name":"终止报建","templatename":"functionedit","id":"34709","position":"6","fullname":"资源管理.功能模块.客服系统.报建业务.终止报建","fullid":"3.21.27.34673.34709","tablename":"t_function"}],"selfid":"34674","name":"报建业务","templatename":"functionedit","id":"34673","position":"12","fullname":"资源管理.功能模块.客服系统.报建业务","fullid":"3.21.27.34673","tablename":"t_function"}],"qrcode":"/rs/user/getQRcode?QRCODE=12b2-1631604191812-03447","rolesnames":"营业厅报装,市场部报装,设计部报装,工程部报装,运营部报装,财务部报装,角色监控","roles":"51383,51485,51707,51767,51833,51905,52289","f_sex":"男","f_icon":"tree_user","fullnames":"河南亿星集团实业有限公司.周口市天然气有限公司.市场部.报建测试","dir":"ZhouKou","userid":"12b2-1631604191812-03447","accesstime":"1632214307117","parentid":"46545","f_show_rolestr":"","fullids":"30463.10101.46545.51953.","number":"10101","f_dep_id":"1010101201","f_idnumber":null,"selfid":"51954","templatename":"useredit","logindate":"2021-09-14 18:46:54","id":"51953","state":"在职","tablename":"t_user","deptype":"部门","depids":"46545","loginid":"15","imgid":null,"f_user_telephone":null,"rolestr":"营业厅报装,市场部报装,设计部报装,工程部报装,运营部报装,财务部报装,角色监控","deps":"市场部","loginnum":"0","f_age":null,"resourcetype":"user","orgid":"10101","f_department_name":"周口市场部","ename":"bjcs","deleted":"false","entitytype":"t_user","f_description":null,"loginip":"192.168.66.37","name":"报建测试","position":"1","orgs":"周口市天然气有限公司","haslicense":true,"f_role_name":"营业厅报装 市场部报装 设计部报装 工程部报装 运营部报装 财务部报装 角色监控 ","f_allArea":[],"f_gasman":[{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"15294978548","rolestr":"抄表员","resourcetype":"user","userid":"100814","parentid":"46581","f_department_name":"周口客服部","ename":"100814","password":"1","deleted":"false","entitytype":"t_user","selfid":"100814","name":"高雪荣","templatename":"useredit","id":"100814","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"qrcode":"/rs/user/getQRcode?QRCODE=004","roles":"51959","f_sex":"男","f_icon":"tree_user","userid":"004","accesstime":"1631765198067","parentid":"46581","password":"1","selfid":"59044","templatename":"useredit","id":"59043","state":"在职","tablename":"t_user","loginid":"15","rolestr":"抄表员","resourcetype":"user","f_department_name":"周口客服部","ename":"cbcs","deleted":"false","entitytype":"t_user","loginip":"10.10.10.1","name":"抄表测试","position":"23","haslicense":"true","f_role_name":"抄表员 "},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"18538602709","rolestr":"抄表员","resourcetype":"user","userid":"100462","parentid":"46581","f_department_name":"周口客服部","ename":"100462","password":"1","deleted":"false","entitytype":"t_user","selfid":"100462","name":"刘林静","templatename":"useredit","id":"100462","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"18839409830","rolestr":"抄表员","resourcetype":"user","userid":"100528","parentid":"46581","f_department_name":"周口客服部","ename":"100528","password":"1","deleted":"false","entitytype":"t_user","selfid":"100528","name":"秦春梅","templatename":"useredit","id":"100528","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"13243376616","rolestr":"抄表员","resourcetype":"user","userid":"102935","parentid":"46581","f_department_name":"周口客服部","ename":"102935","password":"1","deleted":"false","entitytype":"t_user","selfid":"102935","name":"石磊","templatename":"useredit","id":"102935","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"18538602706","rolestr":"抄表员","resourcetype":"user","userid":"100818","parentid":"46581","f_department_name":"周口客服部","ename":"100818","password":"1","deleted":"false","entitytype":"t_user","selfid":"100818","name":"白静","templatename":"useredit","id":"100818","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"15294991670","rolestr":"抄表员","resourcetype":"user","userid":"102934","parentid":"46581","f_department_name":"周口客服部","ename":"102934","password":"1","deleted":"false","entitytype":"t_user","selfid":"102934","name":"郭新胜","templatename":"useredit","id":"102934","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"15036438918","rolestr":"抄表员","resourcetype":"user","userid":"103392","accesstime":"1631757950369","parentid":"46581","f_department_name":"周口客服部","ename":"103392","password":"1","deleted":"false","entitytype":"t_user","loginip":"10.10.10.1","selfid":"103392","name":"牛永胜","templatename":"useredit","id":"103392","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"13592232789","rolestr":"抄表员","resourcetype":"user","userid":"100337","parentid":"46581","f_department_name":"周口客服部","ename":"100337","password":"1","deleted":"false","entitytype":"t_user","selfid":"100337","name":"王雪丽","templatename":"useredit","id":"100337","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"17796528119","rolestr":"抄表员","resourcetype":"user","userid":"101021","parentid":"46581","f_department_name":"周口客服部","ename":"101021","password":"1","deleted":"false","entitytype":"t_user","selfid":"101021","name":"张书荣","templatename":"useredit","id":"101021","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"18839409832","rolestr":"抄表员","resourcetype":"user","userid":"100330","parentid":"46581","f_department_name":"周口客服部","ename":"100330","password":"1","deleted":"false","entitytype":"t_user","selfid":"100330","name":"武文平","templatename":"useredit","id":"100330","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"},{"loginid":"1","roles":"51959","f_icon":"tree_user","f_user_telephone":"13839441227","rolestr":"抄表员","resourcetype":"user","userid":"100871","parentid":"46581","f_department_name":"周口客服部","ename":"100871","password":"1","deleted":"false","entitytype":"t_user","selfid":"100871","name":"李明磊","templatename":"useredit","id":"100871","position":"23","state":"在职","tablename":"t_user","f_role_name":"抄表员"}],"lics":[]}
956
+ this.show_data.start_activity = this.json_datas.start_activity
957
+ this.show_data.xmlfilename = this.json_datas.workflow_xmlfilename
958
+
959
+
960
+ if (this.show_data.f_apply_type === '报警器报建' && this.show_data.defname === '工程施工' && this.show_data.f_sub_state !='完工'){
961
+ //判断是否添加报警器材料
962
+ let bjqlag = false
963
+ let datatemp = {
964
+ 'bjqid':"",
965
+ 'fprocessid':"",
966
+ 'sqvalue':"",
967
+ 'f_bjq_sid':"",
968
+ 'f_material_code':""
969
+ }
970
+ let numOne = [];
971
+ this.show_data.onetomany.forEach(item=>{
972
+ item.rows.forEach(i=>{
973
+ if (i.f_material_name.substr(0,3) === '报警器'){
974
+ bjqlag = true
975
+ datatemp.bjqid = i.id
976
+ datatemp.fprocessid = i.f_process_id
977
+ datatemp.f_bjq_sid = i.f_bjq_sid
978
+ datatemp.f_material_code = i.f_material_code
979
+ numOne.push(i.f_bjq_sid)
980
+ }
981
+ })
982
+ })
983
+ if (!bjqlag){
984
+ this.$showMessage('请添加报警器物料信息!!!')
985
+ return
986
+ }
987
+ if (numOne.length > 1){
988
+ this.$showMessage("暂时支持单个报警器物料安装!!!")
989
+ return
990
+ }
991
+ datatemp.sqvalue = this.show_data.areaData.sqvalue
992
+ //区域地址存入材料记录表
993
+ let areares = await this.$resetpost(
994
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/saveArea`,
995
+ // `rs/logic/saveArea`,
996
+ {data: datatemp},
997
+ {resolveMsg: null, rejectMsg: '区域地址保存失败'}
998
+ )
999
+
1000
+ // 完工之后推送数据到汉威
1001
+ let adddata = {
1002
+ f_bjq_sid : datatemp.f_bjq_sid,
1003
+ f_material_code : datatemp.f_material_code,
1004
+ f_bjq_address: this.show_data.areaData.sqvalue,
1005
+ f_user_name: this.show_data.f_user_name,
1006
+ f_address: this.show_data.f_address,
1007
+ f_user_phone: this.show_data.f_phone,
1008
+ f_userinfo_code: this.show_data.f_userinfo_code,
1009
+ installtime: this.show_data.f_construction_date,
1010
+ }
1011
+ let res = await this.$resetpost(
1012
+ `${this.$androidUtil.getProxyUrl()}/ncc/rs/logic/bjqadduser`,
1013
+ // `/rs/logic/bjqadduser`,
1014
+ adddata
1015
+ )
1016
+ if (res.data.code != 200){
1017
+ this.$showMessage(res.data.msg)
1018
+ return
1019
+ }
1020
+
1021
+ }
1022
+ let res = await this.$resetpost(
1023
+ // `rs/logic/ApplyProductService`,
1024
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyProductService`,
1025
+ {data: this.show_data},
1026
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1027
+ )
1028
+
1029
+ if (this.show_data.button.after) {
1030
+ this[this.show_data.button.after]()
1031
+ }
1032
+ // 返回上层
1033
+ this.$dispatch('confirm')
1034
+ },
1035
+ // 失去焦点出触发事件
1036
+ 'onchange' (index) {
1037
+ if (this.show_data.defname === '报装申请') {
1038
+ if (
1039
+ this.show_data.fields[index].label === '区/县' ||
1040
+ this.show_data.fields[index].label === '街道/乡镇' ||
1041
+ this.show_data.fields[index].label === '集收单位' ||
1042
+ this.show_data.fields[index].label === '楼号/组' ||
1043
+ this.show_data.fields[index].label === '单元/排' ||
1044
+ this.show_data.fields[index].label === '楼层' ||
1045
+ this.show_data.fields[index].label === '门牌号'
1046
+ ) {
1047
+
1048
+ let f_pcd = this.getLableValue('区/县') || ''
1049
+ let f_street = this.getLableValue('街道/乡镇') || ''
1050
+ let f_residential_area = this.getLableValue('集收单位') || ''
1051
+ let f_building = this.getLableValue('楼号/组') || ''
1052
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1053
+ let f_unit = this.getLableValue('单元/排') || ''
1054
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1055
+ let f_floor = this.getLableValue('楼层') || ''
1056
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1057
+ let f_room = this.getLableValue('门牌号') || ''
1058
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1059
+
1060
+ let f_address = null
1061
+
1062
+ let f_address_type = this.show_data.f_address_type
1063
+ 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
1064
+ /*if (f_address_type === '民用城区') {
1065
+ f_address = 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
1066
+ }
1067
+ if (f_address_type === '民用农村') {
1068
+ f_address = f_building + f_unit + f_floor + f_room
1069
+ }
1070
+ if (f_address_type === '特殊城区') {
1071
+ f_address = f_street + f_residential_area
1072
+ }*/
1073
+ this.setLabelValue("地址", f_address)
1074
+ }
1075
+ }
1076
+ },
1077
+ async getDesignerPeople () {
1078
+ let data = {
1079
+ source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
1080
+ userid: this.$login.f.id
1081
+ }
1082
+
1083
+ let http = new HttpResetClass()
1084
+ let res = await http.load(
1085
+ 'POST',
1086
+ `rs/search`,
1087
+ {data: data},
1088
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
1089
+ )
1090
+
1091
+ return res.data.map(item => {
1092
+ return {
1093
+ label: item.name,
1094
+ value: item.id
1095
+ }
1096
+ })
1097
+ },
1098
+ // 申请节点初始化
1099
+ 'applyReadyEvent' () {
1100
+ this.addressInitialization()
1101
+
1102
+ this.pcdChange()
1103
+ this.streetChange()
1104
+ },
1105
+ // 合同金额失去焦点
1106
+ async 'contractMoneyChange' (index) {
1107
+ let data = {
1108
+ operator: '+',
1109
+ num1: this.show_data.f_contract_money || 0,
1110
+ num2: this.getLableValue('追加金额') || 0
1111
+ }
1112
+ let res = await this.$resetpost(
1113
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/compute`,
1114
+ {data: data},
1115
+ {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1116
+ )
1117
+
1118
+ this.setLabelValue('应交金额', res.data)
1119
+ },
1120
+ // 街道失去焦点
1121
+ async 'streetChange' (index) {
1122
+ if (isEmpty(this.show_data.f_street)) {
1123
+ return
1124
+ }
1125
+
1126
+ this.setLabelValue('集收单位', null)
1127
+
1128
+ let data = {
1129
+ tablename: 't_area',
1130
+ condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}'`
1131
+ }
1132
+ let http = new HttpResetClass()
1133
+ let res = await http.load(
1134
+ 'POST',
1135
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
1136
+ {data: data},
1137
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1138
+ )
1139
+
1140
+ this.setLabelOptions('集收单位', res.data.map(item => {
1141
+ return {
1142
+ label: item.f_residential_area,
1143
+ value: item.f_residential_area
1144
+ }
1145
+ }))
1146
+ },
1147
+ // 选择报建项目
1148
+ 'selectApply' (row) {
1149
+ this.setLabelValue('工程名称', row.f_entry_name)
1150
+ this.setLabelValue('工程编号', row.f_apply_num)
1151
+ this.setLabelValue('报建类型', row.f_apply_type)
1152
+ this.setLabelValue('用户名称', row.f_user_name)
1153
+ this.setLabelValue('用户电话', row.f_phone)
1154
+ this.setLabelValue('证件类型', row.f_credentials)
1155
+ this.setLabelValue('证件号码', row.f_idnumber)
1156
+ this.setLabelValue('地址', row.f_address)
1157
+ this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
1158
+
1159
+ this.show_data.parentApply = JSON.parse(JSON.stringify(row))
1160
+
1161
+ delete row.id
1162
+ delete row.actid
1163
+ delete row.defid
1164
+ delete row.defname
1165
+ delete row.version
1166
+ delete row.f_apply_num
1167
+ delete row.f_sub_state
1168
+ delete row.f_apply_type
1169
+ delete row.f_process_id
1170
+
1171
+ this.show_data = Object.assign({}, this.show_data, row)
1172
+
1173
+ this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
1174
+ },
1175
+ // 区县失去焦点
1176
+ async 'pcdChange' (index) {
1177
+ if (isEmpty(this.show_data.f_pcd)) {
1178
+ return
1179
+ }
1180
+
1181
+ this.setLabelValue('街道/乡镇', null)
1182
+ this.setLabelValue('集收单位', null)
1183
+
1184
+
1185
+
1186
+ let data = {
1187
+ tablename: 't_street',
1188
+ condition: `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1189
+ }
1190
+ let f_address_type = this.getLableValue('地址类型')
1191
+
1192
+ if (f_address_type === '民用市区') {
1193
+ data.condition = `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1194
+ }
1195
+ if (f_address_type === '民用乡镇') {
1196
+ data.condition = `f_filialeid = '${Vue.user.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1197
+ }
1198
+
1199
+ let http = new HttpResetClass()
1200
+ let res = await http.load(
1201
+ 'POST',
1202
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
1203
+ {data: data},
1204
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1205
+ )
1206
+
1207
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
1208
+ return {
1209
+ label: item.f_street,
1210
+ value: item.f_street
1211
+ }
1212
+ }))
1213
+ },
1214
+ // 选择用户档案信息
1215
+ 'selectUserinfo' (row) {
1216
+ this.setLabelValue('用户编号', row.f_userinfo_code)
1217
+ this.setLabelValue('用户名称', row.f_user_name)
1218
+ this.setLabelValue('用户电话', row.f_user_phone)
1219
+ this.setLabelValue('证件类型', row.f_credentials)
1220
+ this.setLabelValue('证件号码', row.f_idnumber)
1221
+ this.setLabelValue('地址', row.f_address)
1222
+
1223
+ this.show_data.f_userinfo_id = row.f_userinfo_id
1224
+ this.show_data.f_userinfo_code = row.f_userinfo_code
1225
+ },
1226
+ // 地址类型失去焦点
1227
+ 'addressTypeChange' (index) {
1228
+ this.setLabelValue('街道/乡镇', null)
1229
+ this.setLabelValue('集收单位', null)
1230
+ let f_address_type = this.show_data.fields[index].value
1231
+ for (const item of this.show_data.fields) {
1232
+ if (f_address_type === '民用市区') {
1233
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1234
+ item.hidden = false
1235
+ item.required = true
1236
+ item.value = null
1237
+ }
1238
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1239
+ item.hidden = false
1240
+ item.required = false
1241
+ item.value = null
1242
+ }
1243
+ if (item.label === '地址') {
1244
+ item.readonly = true
1245
+ item.value = null
1246
+ }
1247
+ }
1248
+ if (f_address_type === '民用乡镇') {
1249
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1250
+ item.hidden = false
1251
+ item.required = true
1252
+ item.value = null
1253
+ }
1254
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1255
+ item.hidden = false
1256
+ item.required = false
1257
+ item.value = null
1258
+ }
1259
+ if (item.label === '楼层') {
1260
+ item.hidden = true
1261
+ item.required = false
1262
+ item.value = null
1263
+ }
1264
+ if (item.label === '地址') {
1265
+ item.readonly = true
1266
+ item.value = null
1267
+ }
1268
+ }
1269
+ if (f_address_type === '特殊地址') {
1270
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
1271
+ item.hidden = false
1272
+ item.required = true
1273
+ item.value = null
1274
+ }
1275
+ if (item.label === '集收单位') {
1276
+ item.hidden = false
1277
+ item.required = false
1278
+ item.value = null
1279
+ }
1280
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1281
+ item.hidden = true
1282
+ item.required = false
1283
+ item.value = null
1284
+ }
1285
+ if (item.label === '地址') {
1286
+ item.readonly = false
1287
+ item.value = null
1288
+ }
1289
+ }
1290
+ }
1291
+ },
1292
+ // 搜索小区
1293
+ async 'searchArea' (area, index) {
1294
+ let data = {
1295
+ tablename: 't_area',
1296
+ condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1297
+ }
1298
+ let http = new HttpResetClass()
1299
+ let res = await http.load(
1300
+ 'POST',
1301
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
1302
+ {data: data},
1303
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1304
+ )
1305
+
1306
+ if (res.data.length === 0) {
1307
+ return
1308
+ }
1309
+
1310
+ this.setLabelOptions('集收单位', res.data.map(item => {
1311
+ return {
1312
+ label: item.f_residential_area,
1313
+ value: item.f_residential_area
1314
+ }
1315
+ }))
1316
+ },
1317
+ // 团购转散户初始化
1318
+ 'apply2ReadyEvent' () {
1319
+ if (this.show_data.f_apply_source === '线下发起') {
1320
+ this.addressInitialization()
1321
+ this.hideLabels('用户编号')
1322
+ this.electiveLabels('用户编号')
1323
+ this.showLabels('片区', '地址类型')
1324
+ this.requiredLabels('片区', '地址类型')
1325
+ }
1326
+ if (this.show_data.f_apply_source === '自动发起') {
1327
+ this.hideLabels('片区', '地址类型')
1328
+ this.electiveLabels('片区', '地址类型',)
1329
+ }
1330
+ },
1331
+ 'onblur' (index) {},
1332
+ 'oninput' (index) {},
1333
+ 'initializtionView' () {},
1334
+ async 'onchangeModal' (index, fieldIndex) {
1335
+ },
1336
+ async 'onblurModal' (index, fieldIndex) {
1337
+
1338
+ },
1339
+ async 'oninputModal' (index, fieldIndex) {
1340
+
1341
+ },
1342
+ async 'onetomanydelete' (index, rowIndex) {
1343
+
1344
+ let http = new HttpResetClass()
1345
+
1346
+ let res = await http.load(
1347
+ 'DELETE',
1348
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1349
+ null,
1350
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1351
+ )
1352
+ res = await this.$resetpost(
1353
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1354
+ this.show_data
1355
+ )
1356
+ this.breakControl()
1357
+ },
1358
+ async 'onetomanyupdate' (index, rowIndex) {
1359
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1360
+
1361
+ this.show_data.onetomany[index].fields.forEach(item => {
1362
+ data[item.field] = item.value
1363
+ })
1364
+ let res = await this.$resetpost(
1365
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1366
+ data
1367
+ )
1368
+ res = await this.$resetpost(
1369
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1370
+ this.show_data
1371
+ )
1372
+ this.breakControl()
1373
+ },
1374
+ async 'onetomanyadd' (index) {
1375
+ let data = {
1376
+ f_process_id : this.show_data.f_process_id,
1377
+ f_operator_id: Vue.user.id,
1378
+ f_operator: Vue.user.name,
1379
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1380
+ f_orgid: Vue.user.orgid,
1381
+ f_orgname: Vue.user.orgs
1382
+ }
1383
+ this.show_data.onetomany[index].fields.forEach(item => {
1384
+ data[item.field] = item.value
1385
+ })
1386
+ let res = await this.$resetpost(
1387
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1388
+ data
1389
+ )
1390
+ res = await this.$resetpost(
1391
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1392
+ this.show_data
1393
+ )
1394
+ this.breakControl()
1395
+ },
1396
+ 'onbutchange' (index) {
1397
+
1398
+ },
1399
+ 'onbutblur' (index) {
1400
+
1401
+ },
1402
+ 'onbutinput' (index) {
1403
+
1404
+ }
1405
+ },
1406
+ watch: {
1407
+ }
1408
+ }
1409
+ </script>
1410
+ <style scoped>
1411
+ </style>