apply-clients 3.3.88 → 3.3.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1412 +1,1416 @@
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
- // `ncc/rs/logic/bjqadduser`,
1014
- // `/rs/logic/bjqadduser`,
1015
- adddata
1016
- )
1017
- if (res.data.code != 200){
1018
- this.$showMessage(res.data.msg)
1019
- return
1020
- }
1021
-
1022
- }
1023
- let res = await this.$resetpost(
1024
- // `rs/logic/ApplyProductService`,
1025
- `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyProductService`,
1026
- {data: this.show_data},
1027
- {resolveMsg: null, rejectMsg: '数据保存失败'}
1028
- )
1029
-
1030
- if (this.show_data.button.after) {
1031
- this[this.show_data.button.after]()
1032
- }
1033
- // 返回上层
1034
- this.$dispatch('confirm')
1035
- },
1036
- // 失去焦点出触发事件
1037
- 'onchange' (index) {
1038
- if (this.show_data.defname === '报装申请') {
1039
- if (
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
- this.show_data.fields[index].label === '门牌号'
1047
- ) {
1048
-
1049
- let f_pcd = this.getLableValue('区/县') || ''
1050
- let f_street = this.getLableValue('街道/乡镇') || ''
1051
- let f_residential_area = this.getLableValue('集收单位') || ''
1052
- let f_building = this.getLableValue('楼号/组') || ''
1053
- let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1054
- let f_unit = this.getLableValue('单元/排') || ''
1055
- let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1056
- let f_floor = this.getLableValue('楼层') || ''
1057
- let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1058
- let f_room = this.getLableValue('门牌号') || ''
1059
- let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1060
-
1061
- let f_address = null
1062
-
1063
- let f_address_type = this.show_data.f_address_type
1064
- 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
1065
- /*if (f_address_type === '民用城区') {
1066
- 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
1067
- }
1068
- if (f_address_type === '民用农村') {
1069
- f_address = f_building + f_unit + f_floor + f_room
1070
- }
1071
- if (f_address_type === '特殊城区') {
1072
- f_address = f_street + f_residential_area
1073
- }*/
1074
- this.setLabelValue("地址", f_address)
1075
- }
1076
- }
1077
- },
1078
- async getDesignerPeople () {
1079
- let data = {
1080
- source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
1081
- userid: this.$login.f.id
1082
- }
1083
-
1084
- let http = new HttpResetClass()
1085
- let res = await http.load(
1086
- 'POST',
1087
- `rs/search`,
1088
- {data: data},
1089
- {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
1090
- )
1091
-
1092
- return res.data.map(item => {
1093
- return {
1094
- label: item.name,
1095
- value: item.id
1096
- }
1097
- })
1098
- },
1099
- // 申请节点初始化
1100
- 'applyReadyEvent' () {
1101
- this.addressInitialization()
1102
-
1103
- this.pcdChange()
1104
- this.streetChange()
1105
- },
1106
- // 合同金额失去焦点
1107
- async 'contractMoneyChange' (index) {
1108
- let data = {
1109
- operator: '+',
1110
- num1: this.show_data.f_contract_money || 0,
1111
- num2: this.getLableValue('追加金额') || 0
1112
- }
1113
- let res = await this.$resetpost(
1114
- `${this.$androidUtil.getProxyUrl()}/rs/logic/compute`,
1115
- {data: data},
1116
- {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1117
- )
1118
-
1119
- this.setLabelValue('应交金额', res.data)
1120
- },
1121
- // 街道失去焦点
1122
- async 'streetChange' (index) {
1123
- if (isEmpty(this.show_data.f_street)) {
1124
- return
1125
- }
1126
-
1127
- this.setLabelValue('集收单位', null)
1128
-
1129
- let data = {
1130
- tablename: 't_area',
1131
- condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}'`
1132
- }
1133
- let http = new HttpResetClass()
1134
- let res = await http.load(
1135
- 'POST',
1136
- `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
1137
- {data: data},
1138
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1139
- )
1140
-
1141
- this.setLabelOptions('集收单位', res.data.map(item => {
1142
- return {
1143
- label: item.f_residential_area,
1144
- value: item.f_residential_area
1145
- }
1146
- }))
1147
- },
1148
- // 选择报建项目
1149
- 'selectApply' (row) {
1150
- this.setLabelValue('工程名称', row.f_entry_name)
1151
- this.setLabelValue('工程编号', row.f_apply_num)
1152
- this.setLabelValue('报建类型', row.f_apply_type)
1153
- this.setLabelValue('用户名称', row.f_user_name)
1154
- this.setLabelValue('用户电话', row.f_phone)
1155
- this.setLabelValue('证件类型', row.f_credentials)
1156
- this.setLabelValue('证件号码', row.f_idnumber)
1157
- this.setLabelValue('地址', row.f_address)
1158
- this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
1159
-
1160
- this.show_data.parentApply = JSON.parse(JSON.stringify(row))
1161
-
1162
- delete row.id
1163
- delete row.actid
1164
- delete row.defid
1165
- delete row.defname
1166
- delete row.version
1167
- delete row.f_apply_num
1168
- delete row.f_sub_state
1169
- delete row.f_apply_type
1170
- delete row.f_process_id
1171
-
1172
- this.show_data = Object.assign({}, this.show_data, row)
1173
-
1174
- this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
1175
- },
1176
- // 区县失去焦点
1177
- async 'pcdChange' (index) {
1178
- if (isEmpty(this.show_data.f_pcd)) {
1179
- return
1180
- }
1181
-
1182
- this.setLabelValue('街道/乡镇', null)
1183
- this.setLabelValue('集收单位', null)
1184
-
1185
-
1186
-
1187
- let data = {
1188
- tablename: 't_street',
1189
- condition: `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1190
- }
1191
- let f_address_type = this.getLableValue('地址类型')
1192
-
1193
- if (f_address_type === '民用市区') {
1194
- data.condition = `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1195
- }
1196
- if (f_address_type === '民用乡镇') {
1197
- data.condition = `f_filialeid = '${Vue.user.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1198
- }
1199
-
1200
- let http = new HttpResetClass()
1201
- let res = await http.load(
1202
- 'POST',
1203
- `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
1204
- {data: data},
1205
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1206
- )
1207
-
1208
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
1209
- return {
1210
- label: item.f_street,
1211
- value: item.f_street
1212
- }
1213
- }))
1214
- },
1215
- // 选择用户档案信息
1216
- 'selectUserinfo' (row) {
1217
- this.setLabelValue('用户编号', row.f_userinfo_code)
1218
- this.setLabelValue('用户名称', row.f_user_name)
1219
- this.setLabelValue('用户电话', row.f_user_phone)
1220
- this.setLabelValue('证件类型', row.f_credentials)
1221
- this.setLabelValue('证件号码', row.f_idnumber)
1222
- this.setLabelValue('地址', row.f_address)
1223
-
1224
- this.show_data.f_userinfo_id = row.f_userinfo_id
1225
- this.show_data.f_userinfo_code = row.f_userinfo_code
1226
- },
1227
- // 地址类型失去焦点
1228
- 'addressTypeChange' (index) {
1229
- this.setLabelValue('街道/乡镇', null)
1230
- this.setLabelValue('集收单位', null)
1231
- let f_address_type = this.show_data.fields[index].value
1232
- for (const item of this.show_data.fields) {
1233
- if (f_address_type === '民用市区') {
1234
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1235
- item.hidden = false
1236
- item.required = true
1237
- item.value = null
1238
- }
1239
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1240
- item.hidden = false
1241
- item.required = false
1242
- item.value = null
1243
- }
1244
- if (item.label === '地址') {
1245
- item.readonly = true
1246
- item.value = null
1247
- }
1248
- }
1249
- if (f_address_type === '民用乡镇') {
1250
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1251
- item.hidden = false
1252
- item.required = true
1253
- item.value = null
1254
- }
1255
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1256
- item.hidden = false
1257
- item.required = false
1258
- item.value = null
1259
- }
1260
- if (item.label === '楼层') {
1261
- item.hidden = true
1262
- item.required = false
1263
- item.value = null
1264
- }
1265
- if (item.label === '地址') {
1266
- item.readonly = true
1267
- item.value = null
1268
- }
1269
- }
1270
- if (f_address_type === '特殊地址') {
1271
- if (item.label === '区/县' || item.label === '街道/乡镇') {
1272
- item.hidden = false
1273
- item.required = true
1274
- item.value = null
1275
- }
1276
- if (item.label === '集收单位') {
1277
- item.hidden = false
1278
- item.required = false
1279
- item.value = null
1280
- }
1281
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1282
- item.hidden = true
1283
- item.required = false
1284
- item.value = null
1285
- }
1286
- if (item.label === '地址') {
1287
- item.readonly = false
1288
- item.value = null
1289
- }
1290
- }
1291
- }
1292
- },
1293
- // 搜索小区
1294
- async 'searchArea' (area, index) {
1295
- let data = {
1296
- tablename: 't_area',
1297
- condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1298
- }
1299
- let http = new HttpResetClass()
1300
- let res = await http.load(
1301
- 'POST',
1302
- `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
1303
- {data: data},
1304
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1305
- )
1306
-
1307
- if (res.data.length === 0) {
1308
- return
1309
- }
1310
-
1311
- this.setLabelOptions('集收单位', res.data.map(item => {
1312
- return {
1313
- label: item.f_residential_area,
1314
- value: item.f_residential_area
1315
- }
1316
- }))
1317
- },
1318
- // 团购转散户初始化
1319
- 'apply2ReadyEvent' () {
1320
- if (this.show_data.f_apply_source === '线下发起') {
1321
- this.addressInitialization()
1322
- this.hideLabels('用户编号')
1323
- this.electiveLabels('用户编号')
1324
- this.showLabels('片区', '地址类型')
1325
- this.requiredLabels('片区', '地址类型')
1326
- }
1327
- if (this.show_data.f_apply_source === '自动发起') {
1328
- this.hideLabels('片区', '地址类型')
1329
- this.electiveLabels('片区', '地址类型',)
1330
- }
1331
- },
1332
- 'onblur' (index) {},
1333
- 'oninput' (index) {},
1334
- 'initializtionView' () {},
1335
- async 'onchangeModal' (index, fieldIndex) {
1336
- },
1337
- async 'onblurModal' (index, fieldIndex) {
1338
-
1339
- },
1340
- async 'oninputModal' (index, fieldIndex) {
1341
-
1342
- },
1343
- async 'onetomanydelete' (index, rowIndex) {
1344
-
1345
- let http = new HttpResetClass()
1346
-
1347
- let res = await http.load(
1348
- 'DELETE',
1349
- `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1350
- null,
1351
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
1352
- )
1353
- res = await this.$resetpost(
1354
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1355
- this.show_data
1356
- )
1357
- this.breakControl()
1358
- },
1359
- async 'onetomanyupdate' (index, rowIndex) {
1360
- let data = this.show_data.onetomany[index].rows[rowIndex]
1361
-
1362
- this.show_data.onetomany[index].fields.forEach(item => {
1363
- data[item.field] = item.value
1364
- })
1365
- let res = await this.$resetpost(
1366
- `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1367
- data
1368
- )
1369
- res = await this.$resetpost(
1370
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1371
- this.show_data
1372
- )
1373
- this.breakControl()
1374
- },
1375
- async 'onetomanyadd' (index) {
1376
- let data = {
1377
- f_process_id : this.show_data.f_process_id,
1378
- f_operator_id: Vue.user.id,
1379
- f_operator: Vue.user.name,
1380
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1381
- f_orgid: Vue.user.orgid,
1382
- f_orgname: Vue.user.orgs
1383
- }
1384
- this.show_data.onetomany[index].fields.forEach(item => {
1385
- data[item.field] = item.value
1386
- })
1387
- let res = await this.$resetpost(
1388
- `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1389
- data
1390
- )
1391
- res = await this.$resetpost(
1392
- `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1393
- this.show_data
1394
- )
1395
- this.breakControl()
1396
- },
1397
- 'onbutchange' (index) {
1398
-
1399
- },
1400
- 'onbutblur' (index) {
1401
-
1402
- },
1403
- 'onbutinput' (index) {
1404
-
1405
- }
1406
- },
1407
- watch: {
1408
- }
1409
- }
1410
- </script>
1411
- <style scoped>
1412
- </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
+ if (this.show_data.f_apply_type === '报警器报建') {
556
+ let res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
557
+ }else{
558
+ let res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
559
+ }
560
+ if (res == 'confirm') {
561
+ return
562
+ }
563
+ throw '用户信息确认!!!'
564
+ },
565
+ // 缴费前置
566
+ chargeBefore () {
567
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
568
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
569
+ throw null
570
+ }
571
+ },
572
+ // 施工前置
573
+ async constructionBefore () {
574
+ let http = new HttpResetClass()
575
+ let data = {
576
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
577
+ }
578
+ let res = await http.load(
579
+ 'POST',
580
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/countApplyUserinfo`,
581
+ {data: data},
582
+ {
583
+ resolveMsg: null,
584
+ rejectMsg: '安装明细查询失败!!!'
585
+ })
586
+ if (res.data[0].num > 0) {
587
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
588
+ throw `还有${res.data[0].num}户未安装,无法提交`
589
+ }
590
+ },
591
+ changePipeBuild () {
592
+ if (this.selectdata.f_process_dep === '工程部') {
593
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
594
+ }
595
+ if (this.selectdata.f_process_dep === '运营部') {
596
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
597
+ }
598
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
599
+ },
600
+ async getPrice (f_price_id) {
601
+ console.log('=======================')
602
+ console.log(f_price_id)
603
+
604
+ let data = {
605
+ condition: `sp.f_filialeid = '${Vue.user.orgid}'`
606
+ }
607
+
608
+ if (!isEmpty(f_price_id)) {
609
+ data.condition = `sp.f_filialeid = '${Vue.user.orgid}' and sp.f_price_id = ${f_price_id}`
610
+ }
611
+ let http = new HttpResetClass()
612
+ let res = await http.load(
613
+ 'POST',
614
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/applyGetPrice`,
615
+ {data: data},
616
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
617
+ )
618
+
619
+ return res.data.map(item => {
620
+ return {
621
+ label: item.f_price_name,
622
+ value: item
623
+ }
624
+ })
625
+ },
626
+ async getDesignerPeople () {
627
+ let data = {
628
+ source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
629
+ userid: Vue.user.id
630
+ }
631
+
632
+ let http = new HttpResetClass()
633
+ let res = await http.load(
634
+ 'POST',
635
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
636
+ {data: data},
637
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
638
+ )
639
+
640
+ return res.data.map(item => {
641
+ return {
642
+ label: item.name,
643
+ value: item.id
644
+ }
645
+ })
646
+ },
647
+ async surveyStopApply () {
648
+ console.log('终止报建!!!!!')
649
+
650
+ this.show_data.f_stop_reason = '现场勘察不符合报装条件'
651
+
652
+ let data = {
653
+ data: this.show_data,
654
+ user: Vue.user
655
+ }
656
+
657
+ let res = await this.$resetpost(
658
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/surveyStopApply`,
659
+ {data: data},
660
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
661
+ )
662
+
663
+ this.$dispatch('loadPage')
664
+
665
+ throw '终止报建!!!'
666
+ },
667
+ async getDevInfo () {
668
+ let data = {
669
+ tablename: 't_dev_info',
670
+ condition: `f_orgid = '${Vue.user.orgid}'`
671
+ }
672
+ let http = new HttpResetClass()
673
+ let res = await http.load(
674
+ 'POST',
675
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
676
+ {data: data},
677
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
678
+ )
679
+
680
+ return res.data.map(item => {
681
+ return {
682
+ label: item.f_dev_name,
683
+ value: item.f_dev_name
684
+ }
685
+ })
686
+ },
687
+ async getDesignerPeople () {
688
+ let data = {
689
+ source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
690
+ userid: Vue.user.id
691
+ }
692
+
693
+ let http = new HttpResetClass()
694
+ let res = await http.load(
695
+ 'POST',
696
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
697
+ {data: data},
698
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
699
+ )
700
+
701
+ return res.data.map(item => {
702
+ return {
703
+ label: item.name,
704
+ value: item.id
705
+ }
706
+ })
707
+ },
708
+ // 获取片区
709
+ async getSliceArea () {
710
+ let data = {
711
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
712
+ userid: Vue.user.id
713
+ }
714
+
715
+ let http = new HttpResetClass()
716
+ let res = await http.load(
717
+ 'POST',
718
+ `${this.$androidUtil.getProxyUrl()}/rs/search`,
719
+ {data: data},
720
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
721
+ )
722
+
723
+ return res.data.map(item => {
724
+ return {
725
+ label: item.name,
726
+ value: item.name
727
+ }
728
+ })
729
+ },
730
+ // 获取区县
731
+ async getPcd () {
732
+ let data = {
733
+ tablename: 't_pcd',
734
+ condition: `f_filialeid = '${Vue.user.orgid}'`
735
+ }
736
+ let http = new HttpResetClass()
737
+ let res = await http.load(
738
+ 'POST',
739
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
740
+ {data: data},
741
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
742
+ )
743
+
744
+ return res.data.map(item => {
745
+ return {
746
+ label: item.f_pcd,
747
+ value: item.f_pcd
748
+ }
749
+ })
750
+ }
751
+
752
+ },
753
+ events: {
754
+ 'complyInstallation' (index) {
755
+ if (this.show_data.f_is_have === '') {
756
+ this.hideButtons('提交', '出图', '缴费')
757
+ this.showButtons('终止')
758
+ }
759
+ if (this.show_data.f_is_have === '是') {
760
+ this.hideButtons('终止')
761
+ this.showButtons('提交', '出图', '缴费')
762
+ }
763
+ },
764
+ async 'igniteDispatchReadyEvent' () {
765
+ let data = {
766
+ tablename: 'activityins',
767
+ condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
768
+ }
769
+ let http = new HttpResetClass()
770
+ let res = await http.load(
771
+ 'POST',
772
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
773
+ {data: data},
774
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
775
+ )
776
+ if (res.data.length <= 0) {
777
+ console.log('+++++++++++++++++++++++++++++')
778
+ console.log('没有施工,不能退回')
779
+ this.hideButtons('退回')
780
+ }
781
+ },
782
+ 'breakControl' () {
783
+ this.breakControl()
784
+ },
785
+ // 检查重复
786
+ 'checkRepeat' (index) {
787
+ this.checkDuplicate(index)
788
+ },
789
+ 'buildReadyEvent' () {
790
+ this.setLabelValue('施工单位', Vue.user.name)
791
+ this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
792
+ },
793
+ // 选择材料
794
+ async materialNameChenge (index, fieldIndex) {
795
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
796
+
797
+ this.show_data.onetomany[index].fields.forEach(item => {
798
+ if (material[item.field]) {
799
+ item.value = material[item.field]
800
+ }
801
+ })
802
+ },
803
+ // 打开模态框获取材料
804
+ async 'getMaterialName' (index) {
805
+ let data = {
806
+ condition: `1=1`
807
+ }
808
+ let http = new HttpResetClass()
809
+ let res = await http.load(
810
+ 'POST',
811
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/getStockMaterial`,
812
+ {data: data},
813
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
814
+ )
815
+
816
+ this.show_data.onetomany[index].fields.forEach(field => {
817
+ if (field.label === '选择材料') {
818
+ field.options = res.data.map(item => {
819
+ return {
820
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
821
+ 'value': item
822
+ }
823
+ })
824
+ }
825
+ })
826
+ },
827
+ // 选择气价
828
+ 'priceChange' (index) {
829
+ if (isEmpty(this.show_data.stairPrice)) {
830
+ return
831
+ }
832
+
833
+ let stairPrice = this.getLableValue('气价名称')
834
+
835
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
836
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
837
+ this.setLabelValue('价格', stairPrice.f_price)
838
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
839
+
840
+ this.show_data.f_price_id = stairPrice.f_price_id
841
+ this.show_data.f_price_name = stairPrice.f_price_name
842
+ },
843
+ // 是否购买保险
844
+ isInsureChange (index) {
845
+ let f_is_insure = this.getLableValue('是否购买保险')
846
+ for (const item of this.show_data.fields) {
847
+ if (f_is_insure === '是') {
848
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
849
+ item.hidden = false
850
+ item.required = true
851
+ }
852
+ if (item.label === '保险备注') {
853
+ item.hidden = false
854
+ }
855
+ } else {
856
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
857
+ item.hidden = true
858
+ item.required = false
859
+ }
860
+ }
861
+ }
862
+ },
863
+ // 通气点火初始化
864
+ async 'gasReadyEvent' () {
865
+ console.log('----通气点火初始化----')
866
+ if (!isEmpty(this.show_data.f_price_id)) {
867
+ let priceList = await this.getPrice(this.show_data.f_price_id)
868
+ this.setLabelValue('气价名称', priceList[0].value)
869
+ }
870
+
871
+ let data = {
872
+ tablename: 't_userfees',
873
+ condition: `f_orgid = '${Vue.user.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
874
+ }
875
+
876
+ console.log('---------查询是否有待执行保险-----------')
877
+ let http = new HttpResetClass()
878
+ let res = await http.load(
879
+ 'POST',
880
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
881
+ {data: data},
882
+ {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
883
+ )
884
+ if (res.data.length > 0) {
885
+ console.log('----------具有待执行保险------------')
886
+ this.setLabelValue('待执行保险', '是')
887
+ for (const item of this.show_data.fields) {
888
+ if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
889
+ item.hidden = true
890
+ item.required = false
891
+ item.value = null
892
+ }
893
+ }
894
+ console.log('----------具有待执行保险------------')
895
+ } else {
896
+ console.log('----------不有待执行保险------------')
897
+ this.setLabelValue('待执行保险', '否')
898
+ for (const item of this.show_data.fields) {
899
+ if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
900
+ item.hidden = false
901
+ item.required = true
902
+ }
903
+ }
904
+ console.log('----------具有待执行保险------------')
905
+ }
906
+
907
+ // 初始化显示内容
908
+ let f_is_insure = this.getLableValue('是否购买保险')
909
+ for (const item of this.show_data.fields) {
910
+ if (f_is_insure === '是') {
911
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
912
+ item.hidden = false
913
+ item.required = true
914
+ }
915
+ if (item.label === '保险备注') {
916
+ item.hidden = false
917
+ }
918
+ // 本期保费到期时间默认一年
919
+ if (isEmpty(this.selectdata.f_ins_expiration_date)) {
920
+ let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
921
+ this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
922
+ }
923
+ }
924
+ if (f_is_insure === '否') {
925
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
926
+ item.hidden = true
927
+ item.required = false
928
+ }
929
+ }
930
+ }
931
+ },
932
+ // 合同金额失去焦点
933
+ async 'contractMoneyChange' (index) {
934
+ let data = {
935
+ operator: '+',
936
+ num1: this.show_data.f_contract_money || 0,
937
+ num2: this.getLableValue('追加金额') || 0
938
+ }
939
+ let res = await this.$resetpost(
940
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/compute`,
941
+ {data: data},
942
+ {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
943
+ )
944
+
945
+ this.setLabelValue('应交金额', res.data)
946
+ },
947
+ // ===========================================
948
+ async 'button'() {
949
+ if (this.show_data.button.before) {
950
+ await this[this.show_data.button.before]()
951
+ }
952
+ // 点击重置按钮就重置数据
953
+ if (this.show_data.button.button_name === '重置') {
954
+ this.$dispatch('breakControl', this.selectdata)
955
+ return
956
+ }
957
+
958
+ this.show_data.user = Vue.user
959
+ // 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":[]}
960
+ this.show_data.start_activity = this.json_datas.start_activity
961
+ this.show_data.xmlfilename = this.json_datas.workflow_xmlfilename
962
+
963
+
964
+ if (this.show_data.f_apply_type === '报警器报建' && this.show_data.defname === '工程施工' && this.show_data.f_sub_state !='完工'){
965
+ //判断是否添加报警器材料
966
+ let bjqlag = false
967
+ let datatemp = {
968
+ 'bjqid':"",
969
+ 'fprocessid':"",
970
+ 'sqvalue':"",
971
+ 'f_bjq_sid':"",
972
+ 'f_material_code':""
973
+ }
974
+ let numOne = [];
975
+ this.show_data.onetomany.forEach(item=>{
976
+ item.rows.forEach(i=>{
977
+ if (i.f_material_name.substr(0,3) === '报警器'){
978
+ bjqlag = true
979
+ datatemp.bjqid = i.id
980
+ datatemp.fprocessid = i.f_process_id
981
+ datatemp.f_bjq_sid = i.f_bjq_sid
982
+ datatemp.f_material_code = i.f_material_code
983
+ numOne.push(i.f_bjq_sid)
984
+ }
985
+ })
986
+ })
987
+ if (!bjqlag){
988
+ this.$showMessage('请添加报警器物料信息!!!')
989
+ return
990
+ }
991
+ if (numOne.length > 1){
992
+ this.$showMessage("暂时支持单个报警器物料安装!!!")
993
+ return
994
+ }
995
+ datatemp.sqvalue = this.show_data.areaData.sqvalue
996
+ //区域地址存入材料记录表
997
+ let areares = await this.$resetpost(
998
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/saveArea`,
999
+ // `rs/logic/saveArea`,
1000
+ {data: datatemp},
1001
+ {resolveMsg: null, rejectMsg: '区域地址保存失败'}
1002
+ )
1003
+
1004
+ // 完工之后推送数据到汉威
1005
+ let adddata = {
1006
+ f_bjq_sid : datatemp.f_bjq_sid,
1007
+ f_material_code : datatemp.f_material_code,
1008
+ f_bjq_address: this.show_data.areaData.sqvalue,
1009
+ f_user_name: this.show_data.f_user_name,
1010
+ f_address: this.show_data.f_address,
1011
+ f_user_phone: this.show_data.f_phone,
1012
+ f_userinfo_code: this.show_data.f_userinfo_code,
1013
+ installtime: this.show_data.f_construction_date,
1014
+ }
1015
+ let res = await this.$resetpost(
1016
+ `${this.$androidUtil.getProxyUrl()}/ncc/rs/logic/bjqadduser`,
1017
+ // `ncc/rs/logic/bjqadduser`,
1018
+ // `/rs/logic/bjqadduser`,
1019
+ adddata
1020
+ )
1021
+ if (res.data.code != 200){
1022
+ this.$showMessage(res.data.msg)
1023
+ return
1024
+ }
1025
+
1026
+ }
1027
+ let res = await this.$resetpost(
1028
+ // `rs/logic/ApplyProductService`,
1029
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/ApplyProductService`,
1030
+ {data: this.show_data},
1031
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1032
+ )
1033
+
1034
+ if (this.show_data.button.after) {
1035
+ this[this.show_data.button.after]()
1036
+ }
1037
+ // 返回上层
1038
+ this.$dispatch('confirm')
1039
+ },
1040
+ // 失去焦点出触发事件
1041
+ 'onchange' (index) {
1042
+ if (this.show_data.defname === '报装申请') {
1043
+ if (
1044
+ this.show_data.fields[index].label === '区/县' ||
1045
+ this.show_data.fields[index].label === '街道/乡镇' ||
1046
+ this.show_data.fields[index].label === '集收单位' ||
1047
+ this.show_data.fields[index].label === '楼号/组' ||
1048
+ this.show_data.fields[index].label === '单元/排' ||
1049
+ this.show_data.fields[index].label === '楼层' ||
1050
+ this.show_data.fields[index].label === '门牌号'
1051
+ ) {
1052
+
1053
+ let f_pcd = this.getLableValue('区/县') || ''
1054
+ let f_street = this.getLableValue('街道/乡镇') || ''
1055
+ let f_residential_area = this.getLableValue('集收单位') || ''
1056
+ let f_building = this.getLableValue('楼号/组') || ''
1057
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1058
+ let f_unit = this.getLableValue('单元/排') || ''
1059
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1060
+ let f_floor = this.getLableValue('楼层') || ''
1061
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1062
+ let f_room = this.getLableValue('门牌号') || ''
1063
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1064
+
1065
+ let f_address = null
1066
+
1067
+ let f_address_type = this.show_data.f_address_type
1068
+ 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
1069
+ /*if (f_address_type === '民用城区') {
1070
+ 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
1071
+ }
1072
+ if (f_address_type === '民用农村') {
1073
+ f_address = f_building + f_unit + f_floor + f_room
1074
+ }
1075
+ if (f_address_type === '特殊城区') {
1076
+ f_address = f_street + f_residential_area
1077
+ }*/
1078
+ this.setLabelValue("地址", f_address)
1079
+ }
1080
+ }
1081
+ },
1082
+ async getDesignerPeople () {
1083
+ let data = {
1084
+ source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
1085
+ userid: this.$login.f.id
1086
+ }
1087
+
1088
+ let http = new HttpResetClass()
1089
+ let res = await http.load(
1090
+ 'POST',
1091
+ `rs/search`,
1092
+ {data: data},
1093
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
1094
+ )
1095
+
1096
+ return res.data.map(item => {
1097
+ return {
1098
+ label: item.name,
1099
+ value: item.id
1100
+ }
1101
+ })
1102
+ },
1103
+ // 申请节点初始化
1104
+ 'applyReadyEvent' () {
1105
+ this.addressInitialization()
1106
+
1107
+ this.pcdChange()
1108
+ this.streetChange()
1109
+ },
1110
+ // 合同金额失去焦点
1111
+ async 'contractMoneyChange' (index) {
1112
+ let data = {
1113
+ operator: '+',
1114
+ num1: this.show_data.f_contract_money || 0,
1115
+ num2: this.getLableValue('追加金额') || 0
1116
+ }
1117
+ let res = await this.$resetpost(
1118
+ `${this.$androidUtil.getProxyUrl()}/rs/logic/compute`,
1119
+ {data: data},
1120
+ {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1121
+ )
1122
+
1123
+ this.setLabelValue('应交金额', res.data)
1124
+ },
1125
+ // 街道失去焦点
1126
+ async 'streetChange' (index) {
1127
+ if (isEmpty(this.show_data.f_street)) {
1128
+ return
1129
+ }
1130
+
1131
+ this.setLabelValue('集收单位', null)
1132
+
1133
+ let data = {
1134
+ tablename: 't_area',
1135
+ condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}'`
1136
+ }
1137
+ let http = new HttpResetClass()
1138
+ let res = await http.load(
1139
+ 'POST',
1140
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
1141
+ {data: data},
1142
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1143
+ )
1144
+
1145
+ this.setLabelOptions('集收单位', res.data.map(item => {
1146
+ return {
1147
+ label: item.f_residential_area,
1148
+ value: item.f_residential_area
1149
+ }
1150
+ }))
1151
+ },
1152
+ // 选择报建项目
1153
+ 'selectApply' (row) {
1154
+ this.setLabelValue('工程名称', row.f_entry_name)
1155
+ this.setLabelValue('工程编号', row.f_apply_num)
1156
+ this.setLabelValue('报建类型', row.f_apply_type)
1157
+ this.setLabelValue('用户名称', row.f_user_name)
1158
+ this.setLabelValue('用户电话', row.f_phone)
1159
+ this.setLabelValue('证件类型', row.f_credentials)
1160
+ this.setLabelValue('证件号码', row.f_idnumber)
1161
+ this.setLabelValue('地址', row.f_address)
1162
+ this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
1163
+
1164
+ this.show_data.parentApply = JSON.parse(JSON.stringify(row))
1165
+
1166
+ delete row.id
1167
+ delete row.actid
1168
+ delete row.defid
1169
+ delete row.defname
1170
+ delete row.version
1171
+ delete row.f_apply_num
1172
+ delete row.f_sub_state
1173
+ delete row.f_apply_type
1174
+ delete row.f_process_id
1175
+
1176
+ this.show_data = Object.assign({}, this.show_data, row)
1177
+
1178
+ this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
1179
+ },
1180
+ // 区县失去焦点
1181
+ async 'pcdChange' (index) {
1182
+ if (isEmpty(this.show_data.f_pcd)) {
1183
+ return
1184
+ }
1185
+
1186
+ this.setLabelValue('街道/乡镇', null)
1187
+ this.setLabelValue('集收单位', null)
1188
+
1189
+
1190
+
1191
+ let data = {
1192
+ tablename: 't_street',
1193
+ condition: `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1194
+ }
1195
+ let f_address_type = this.getLableValue('地址类型')
1196
+
1197
+ if (f_address_type === '民用市区') {
1198
+ data.condition = `f_filialeid = '${Vue.user.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1199
+ }
1200
+ if (f_address_type === '民用乡镇') {
1201
+ data.condition = `f_filialeid = '${Vue.user.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1202
+ }
1203
+
1204
+ let http = new HttpResetClass()
1205
+ let res = await http.load(
1206
+ 'POST',
1207
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
1208
+ {data: data},
1209
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1210
+ )
1211
+
1212
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
1213
+ return {
1214
+ label: item.f_street,
1215
+ value: item.f_street
1216
+ }
1217
+ }))
1218
+ },
1219
+ // 选择用户档案信息
1220
+ 'selectUserinfo' (row) {
1221
+ this.setLabelValue('用户编号', row.f_userinfo_code)
1222
+ this.setLabelValue('用户名称', row.f_user_name)
1223
+ this.setLabelValue('用户电话', row.f_user_phone)
1224
+ this.setLabelValue('证件类型', row.f_credentials)
1225
+ this.setLabelValue('证件号码', row.f_idnumber)
1226
+ this.setLabelValue('地址', row.f_address)
1227
+
1228
+ this.show_data.f_userinfo_id = row.f_userinfo_id
1229
+ this.show_data.f_userinfo_code = row.f_userinfo_code
1230
+ },
1231
+ // 地址类型失去焦点
1232
+ 'addressTypeChange' (index) {
1233
+ this.setLabelValue('街道/乡镇', null)
1234
+ this.setLabelValue('集收单位', null)
1235
+ let f_address_type = this.show_data.fields[index].value
1236
+ for (const item of this.show_data.fields) {
1237
+ if (f_address_type === '民用市区') {
1238
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1239
+ item.hidden = false
1240
+ item.required = true
1241
+ item.value = null
1242
+ }
1243
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1244
+ item.hidden = false
1245
+ item.required = false
1246
+ item.value = null
1247
+ }
1248
+ if (item.label === '地址') {
1249
+ item.readonly = true
1250
+ item.value = null
1251
+ }
1252
+ }
1253
+ if (f_address_type === '民用乡镇') {
1254
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1255
+ item.hidden = false
1256
+ item.required = true
1257
+ item.value = null
1258
+ }
1259
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1260
+ item.hidden = false
1261
+ item.required = false
1262
+ item.value = null
1263
+ }
1264
+ if (item.label === '楼层') {
1265
+ item.hidden = true
1266
+ item.required = false
1267
+ item.value = null
1268
+ }
1269
+ if (item.label === '地址') {
1270
+ item.readonly = true
1271
+ item.value = null
1272
+ }
1273
+ }
1274
+ if (f_address_type === '特殊地址') {
1275
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
1276
+ item.hidden = false
1277
+ item.required = true
1278
+ item.value = null
1279
+ }
1280
+ if (item.label === '集收单位') {
1281
+ item.hidden = false
1282
+ item.required = false
1283
+ item.value = null
1284
+ }
1285
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1286
+ item.hidden = true
1287
+ item.required = false
1288
+ item.value = null
1289
+ }
1290
+ if (item.label === '地址') {
1291
+ item.readonly = false
1292
+ item.value = null
1293
+ }
1294
+ }
1295
+ }
1296
+ },
1297
+ // 搜索小区
1298
+ async 'searchArea' (area, index) {
1299
+ let data = {
1300
+ tablename: 't_area',
1301
+ condition: `f_filialeid = '${Vue.user.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1302
+ }
1303
+ let http = new HttpResetClass()
1304
+ let res = await http.load(
1305
+ 'POST',
1306
+ `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`,
1307
+ {data: data},
1308
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1309
+ )
1310
+
1311
+ if (res.data.length === 0) {
1312
+ return
1313
+ }
1314
+
1315
+ this.setLabelOptions('集收单位', res.data.map(item => {
1316
+ return {
1317
+ label: item.f_residential_area,
1318
+ value: item.f_residential_area
1319
+ }
1320
+ }))
1321
+ },
1322
+ // 团购转散户初始化
1323
+ 'apply2ReadyEvent' () {
1324
+ if (this.show_data.f_apply_source === '线下发起') {
1325
+ this.addressInitialization()
1326
+ this.hideLabels('用户编号')
1327
+ this.electiveLabels('用户编号')
1328
+ this.showLabels('片区', '地址类型')
1329
+ this.requiredLabels('片区', '地址类型')
1330
+ }
1331
+ if (this.show_data.f_apply_source === '自动发起') {
1332
+ this.hideLabels('片区', '地址类型')
1333
+ this.electiveLabels('片区', '地址类型',)
1334
+ }
1335
+ },
1336
+ 'onblur' (index) {},
1337
+ 'oninput' (index) {},
1338
+ 'initializtionView' () {},
1339
+ async 'onchangeModal' (index, fieldIndex) {
1340
+ },
1341
+ async 'onblurModal' (index, fieldIndex) {
1342
+
1343
+ },
1344
+ async 'oninputModal' (index, fieldIndex) {
1345
+
1346
+ },
1347
+ async 'onetomanydelete' (index, rowIndex) {
1348
+
1349
+ let http = new HttpResetClass()
1350
+
1351
+ let res = await http.load(
1352
+ 'DELETE',
1353
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1354
+ null,
1355
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1356
+ )
1357
+ res = await this.$resetpost(
1358
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1359
+ this.show_data
1360
+ )
1361
+ this.breakControl()
1362
+ },
1363
+ async 'onetomanyupdate' (index, rowIndex) {
1364
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1365
+
1366
+ this.show_data.onetomany[index].fields.forEach(item => {
1367
+ data[item.field] = item.value
1368
+ })
1369
+ let res = await this.$resetpost(
1370
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1371
+ data
1372
+ )
1373
+ res = await this.$resetpost(
1374
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1375
+ this.show_data
1376
+ )
1377
+ this.breakControl()
1378
+ },
1379
+ async 'onetomanyadd' (index) {
1380
+ let data = {
1381
+ f_process_id : this.show_data.f_process_id,
1382
+ f_operator_id: Vue.user.id,
1383
+ f_operator: Vue.user.name,
1384
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1385
+ f_orgid: Vue.user.orgid,
1386
+ f_orgname: Vue.user.orgs
1387
+ }
1388
+ this.show_data.onetomany[index].fields.forEach(item => {
1389
+ data[item.field] = item.value
1390
+ })
1391
+ let res = await this.$resetpost(
1392
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1393
+ data
1394
+ )
1395
+ res = await this.$resetpost(
1396
+ `${this.$androidUtil.getProxyUrl()}/rs/entity/t_apply`,
1397
+ this.show_data
1398
+ )
1399
+ this.breakControl()
1400
+ },
1401
+ 'onbutchange' (index) {
1402
+
1403
+ },
1404
+ 'onbutblur' (index) {
1405
+
1406
+ },
1407
+ 'onbutinput' (index) {
1408
+
1409
+ }
1410
+ },
1411
+ watch: {
1412
+ }
1413
+ }
1414
+ </script>
1415
+ <style scoped>
1416
+ </style>