apply-clients 3.5.4-81 → 3.5.4-83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/build/dev-server.js +6 -6
  2. package/package.json +1 -1
  3. package/src/App.vue +25 -25
  4. package/src/applyAndroid.js +72 -72
  5. package/src/components/android/Process/Processes/AppChargeManagement.vue +635 -637
  6. package/src/components/android/Process/Processes/AppChargeManagementNew.vue +635 -637
  7. package/src/components/product/Function/Service/FunctionServiceControl.vue +497 -497
  8. package/src/components/product/MaterialsManage/MaterialsBase.vue +181 -181
  9. package/src/components/product/MaterialsManage/MaterialsManage.vue +60 -60
  10. package/src/components/product/Process/ExplorationSelect.vue +497 -497
  11. package/src/components/product/Process/Processes/chargeManagement.vue +1 -1
  12. package/src/components/product/ServiceView.vue +1026 -1026
  13. package/src/filiale/baiyin/android/ByAddMaterialScience.vue +824 -824
  14. package/src/filiale/baiyin/android/ByDeviceManagement.vue +916 -916
  15. package/src/filiale/fugou/android/AppChargeManagement.vue +8 -8
  16. package/src/filiale/fugou/android/AppServiceControl.vue +1 -1
  17. package/src/filiale/gongyi/android/AppDisclosurerecord.vue +214 -214
  18. package/src/filiale/gongyi/android/AppInstallationDetails.vue +500 -500
  19. package/src/filiale/gongyi/android/AppLegacyIssues.vue +309 -309
  20. package/src/filiale/gongyi/android/AppSign.vue +170 -170
  21. package/src/filiale/gongyi/android/AppSupplementalAgreement.vue +298 -298
  22. package/src/filiale/gongyi/android.js +18 -18
  23. package/src/filiale/gongyi/pc/ApplyUpload.vue +371 -371
  24. package/src/filiale/gongyi/pc/PcAddLogs.vue +221 -221
  25. package/src/filiale/gongyi/pc/PcDisclosurerecord.vue +218 -218
  26. package/src/filiale/gongyi/pc/PcLegacyIssues.vue +309 -309
  27. package/src/filiale/gongyi/pc/SupervisoryServiceControl.vue +894 -894
  28. package/src/filiale/gongyi/pc/SupervisoryServiceView.vue +1005 -1005
  29. package/src/filiale/gongyi/pc/addMaterialScience.vue +575 -575
  30. package/src/filiale/gongyi/pc/chargeManagement.vue +765 -765
  31. package/src/filiale/gongyi/pc/supplementalAgreement.vue +277 -277
  32. package/src/filiale/gongyi/pc.js +24 -24
  33. package/src/filiale/hongda/pc/SupervisoryList.vue +422 -422
  34. package/src/filiale/jinhuang/pc/ServiceControl.vue +1925 -1925
  35. package/src/filiale/jinhuang/pc/addressAndUserinfoManagement.vue +203 -0
  36. package/src/filiale/jinhuang/pc/chargeManagementNew.vue +589 -589
  37. package/src/filiale/jinhuang/pc.js +8 -7
  38. package/src/filiale/siyangRH/android/AppAddMaterialScience.vue +466 -466
  39. package/src/filiale/yongzhouch/pc/ApplyUpload.vue +327 -327
  40. package/src/filiale/yongzhouch/pc/ExplorationSelect.vue +490 -490
  41. package/src/filiale/yongzhouch/pc/InstallationDetails.vue +610 -610
  42. package/src/filiale/yongzhouch/pc/ServiceControl.vue +1943 -1943
  43. package/src/filiale/yongzhouch/pc/devicesManagement.vue +488 -488
  44. package/src/filiale/yongzhouch/pc.js +10 -10
  45. package/src/main.js +1 -1
  46. package/app/src/main/java/com/example/phonechatbot/MainActivity.java +0 -50
  47. package/~/chatbot/main.py +0 -57
@@ -1,1925 +1,1925 @@
1
- <template>
2
- <div class="" v-if="showview">
3
- <show-back-reason :selectdata="show_data"></show-back-reason>
4
- <service-view v-ref:serviceview :data="show_data"></service-view>
5
- </div>
6
- </template>
7
- <script>
8
- import Vue from 'vue'
9
- import {HttpResetClass} from 'vue-client'
10
- import {isEmpty} from "../../../components/Util";
11
-
12
- // Date格式化
13
- Date.prototype.Format = function (fmt) {
14
- var o = {
15
- "M+": this.getMonth() + 1, //月份
16
- "d+": this.getDate(), //日
17
- "H+": this.getHours(), //小时
18
- "m+": this.getMinutes(), //分
19
- "s+": this.getSeconds(), //秒
20
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
21
- "S": this.getMilliseconds() //毫秒
22
- };
23
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
24
- for (var k in o)
25
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
26
- return fmt;
27
- }
28
-
29
- export default {
30
- title: '报建流程业务控制层',
31
- props: ['selectdata'],
32
- data () {
33
- return {
34
- data: null, // 数据库数据,json配置文件数据的数据集合
35
- json_datas: null, // Json配置文件集合
36
- showview: false, // 控制显示service-view组件
37
- show_data: null, // 给view层显示的数据
38
- config: {},
39
- Pricetype:''
40
- }
41
- },
42
- ready () {
43
- this.refurbish()
44
- },
45
- methods: {
46
- async servicer(){
47
- let data = {
48
- tablename: 't_user',
49
- condition: `1=1`
50
- }
51
- let http = new HttpResetClass()
52
- let res = await http.load(
53
- 'POST',
54
- `rs/sql/apply_singleTable`,
55
- {data: data},
56
- {resolveMsg: null, rejectMsg: '服务人查询失败!!!'}
57
- )
58
- this.setLabelOptions('服务人', res.data.map(item => {
59
- return {
60
- label: item.name,
61
- value: item.name
62
- }
63
- }))
64
- },
65
- async ceshi(){
66
- for (let i = 0; i < this.show_data.fields.length; i++) {
67
- if (this.show_data.defname==='报装申请' && this.show_data.fields[i].label === '合同编号') {
68
- let http2 = new HttpResetClass()
69
- let applyNum = await http2.load('POST', 'rs/logic/getProjectNo', {
70
- data: {
71
- f_filiale: this.$login.f.orgs,
72
- f_order_id: this.selectdata.f_order_id
73
- }
74
- }, {resolveMsg: null, rejectMsg: null})
75
- console.log("生成的合同编号为:" + applyNum.data)
76
- this.show_data.fields[i].value = applyNum.data
77
- }
78
- }
79
- },
80
-
81
- // 组件初始化操作
82
- async refurbish() {
83
- this.json_datas = this.$workflow_vue
84
- let sum = 0
85
- let jsonData = {}
86
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
87
- this.$showMessage("网络故障,请刷新页面")
88
- return
89
- }
90
- this.json_datas.activitys.forEach(item => {
91
- if (this.selectdata.defname === item.title) {
92
- jsonData = item // 拿到当前节点的json配置信息
93
- sum++ // 节点名一样的个数
94
- }
95
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
96
- })
97
-
98
- if (sum === 0) {
99
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
100
- return
101
- }
102
- if (sum > 1) {
103
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
104
- return
105
- }
106
-
107
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
108
-
109
- // fields 字段填充值
110
- for (const item of this.selectdata.fields) {
111
- if (!item.value) {
112
- item.value = null
113
- }
114
- if(this.selectdata.f_apply_type === '集体报建' && this.selectdata.defname === '报装缴费'){
115
- if(item.label === '未结总金额'){
116
- item.value = this.selectdata.f_due_money - this.selectdata.f_cumulative_payment_money
117
- }
118
- if(item.label === '付款比例'){
119
- item.value = (this.selectdata.f_cumulative_payment_money/this.selectdata.f_due_money * 100) + '%'
120
- }
121
- }
122
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
123
- if (item.eval) {
124
- item.value = eval(item.default)
125
- } else {
126
- item.value = item.default
127
- }
128
- }
129
-
130
- if (this.selectdata[item.field]) {
131
- // 将json字符串格式化赋值给value
132
- if (String(this.selectdata[item.field]).startsWith("{")) {
133
- item.value = JSON.parse(this.selectdata[item.field])
134
- } else {
135
- item.value = this.selectdata[item.field]
136
- }
137
- }
138
- if (this.selectdata[item.field] === 0) {
139
- item.value = 0
140
- }
141
-
142
- // datepicker
143
- if (item.type === 'datepicker' && !item.value && item.default) {
144
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
145
- }
146
- // 如果配置类型为select,优先从参数列表获取options
147
- if (item.type === 'select' || item.type === 'checkbox') {
148
- if (item.param) {
149
- let temp = this.$appdata.getParam(item.label)
150
-
151
- if (temp && temp.length > 0) {
152
- item.options = temp
153
- }
154
-
155
- if (item.paramLabel) {
156
- temp = this.$appdata.getParam(item.paramLabel)
157
- if (temp && temp.length > 0) {
158
- item.options = temp
159
- }
160
- }
161
- }
162
-
163
- if (item.ready) {
164
- console.log(item.ready)
165
- item.options = await this[item.ready]()
166
-
167
- }
168
- }
169
-
170
-
171
- if (item.type === 'checkbox') {
172
- if (this.selectdata[item.field]) {
173
- item.value = JSON.parse(this.selectdata[item.field])
174
- } else {
175
- item.value = []
176
- }
177
- }
178
-
179
- this.selectdata[item.field] = item.value
180
- }
181
-
182
- // 控制组件
183
- if (this.selectdata.components) {
184
- this.selectdata.components.forEach(item => {
185
- if (!item.mark) {
186
- item.mark = 0
187
- }
188
- })
189
- }
190
- // 初始化onetomany
191
- if (this.selectdata.onetomany) {
192
- for (const item of this.selectdata.onetomany) {
193
- let res = null
194
- if (item.queryEvent) {
195
- res = this[item.queryEvent]()
196
- } else {
197
- let data = {
198
- tablename: item.tables[0],
199
- condition: `f_process_id='${this.selectdata.f_process_id}'`
200
- }
201
- res = await this.$resetpost(
202
- 'rs/sql/apply_singleTable',
203
- {data: data},
204
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
205
- )
206
- }
207
-
208
- item.rows = res.data
209
-
210
- // 初始化onetomany中的fields
211
- for (const field of item.fields) {
212
- if (!field.value) {
213
- if (field.value !== 0) {
214
- field.value = null
215
- }
216
- }
217
-
218
- if (field.default || field.default === 0) {
219
- field.value = field.default
220
- }
221
-
222
- // datepicker
223
- if (field.type === 'datepicker' && !field.value && field.default) {
224
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
225
- }
226
-
227
- if (field.type === 'select') {
228
-
229
- let temp = this.$appdata.getParam(field.label)
230
-
231
- if (temp && temp.length > 0) {
232
- field.options = temp
233
- }
234
-
235
- if (field.paramLabel) {
236
- temp = this.$appdata.getParam(field.paramLabel)
237
- if (temp && temp.length > 0) {
238
- item.options = temp
239
- }
240
- }
241
- }
242
- }
243
- }
244
- }
245
- // 初始化 buttons_fields
246
- for (const item of this.selectdata.buttons) {
247
- if (item.button_name === '下发') {
248
-
249
- let data = {
250
- source: item.source,
251
- userid: this.$login.f.id
252
- }
253
- if (item.sourceMethod) {
254
- data.source = this[item.sourceMethod]()
255
- }
256
- if (!data.source) {
257
- this.$showMessage("请配置获取人员表达式")
258
- return
259
- }
260
-
261
- let res = await this.$resetpost(
262
- 'rs/search',
263
- {data: data},
264
- {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
265
- )
266
-
267
- let options = res.data.map(source => {
268
- return {
269
- "label": source.name,
270
- "value": source.id
271
- }
272
- })
273
-
274
- if (item.button_fields.length !== 1) {
275
- this.$showMessage("下发有且只能有一个字段!!!")
276
- return
277
- }
278
-
279
- item.button_fields[0].options = options
280
- }
281
- if (item.button_fields) {
282
- item.button_fields.forEach(x => {
283
- // 如果配置类型为select,优先从参数列表获取options
284
- if (x.type === 'select') {
285
-
286
- if (x.param) {
287
- let temp = this.$appdata.getParam(x.label)
288
-
289
- if (temp && temp.length > 0) {
290
- x.options = temp
291
- }
292
-
293
- if (x.paramLabel) {
294
- temp = this.$appdata.getParam(x.paramLabel)
295
- if (temp && temp.length > 0) {
296
- x.options = temp
297
- }
298
- }
299
- }
300
-
301
- }
302
- })
303
- }
304
- }
305
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
306
- let temp = JSON.parse(JSON.stringify(this.selectdata))
307
- console.log('打印下temp',temp)
308
- this.show_data = temp
309
- this.$nextTick(() => {
310
- this.showview = true
311
- })
312
- },
313
- // 金额转大写
314
- smalltoBIG(n) {
315
- let fraction = ['角', '分'];
316
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
317
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
318
- let head = n < 0 ? '欠' : '';
319
- n = Math.abs(n);
320
-
321
- let s = '';
322
-
323
- for (var i = 0; i < fraction.length; i++) {
324
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
325
- }
326
- s = s || '整';
327
- n = Math.floor(n);
328
-
329
- for (var i = 0; i < unit[0].length && n > 0; i++) {
330
- let p = '';
331
- for (var j = 0; j < unit[1].length && n > 0; j++) {
332
- p = digit[n % 10] + unit[1][j] + p;
333
- n = Math.floor(n / 10);
334
- }
335
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
336
- }
337
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
338
- },
339
- getLableValue(label) {
340
- for (const item of this.show_data.fields) {
341
- if (item.label === label && item.type !== 'number') {
342
- return item.value || ''
343
- }
344
- if (item.label === label && item.type === 'number') {
345
- return item.value || 0
346
- }
347
- }
348
- },
349
- getLableOptions(label) {
350
- for (const item of this.show_data.fields) {
351
- if (item.label === label) {
352
- return item.options
353
- }
354
- }
355
- },
356
- setLabelValue(label, value) {
357
- for (const item of this.show_data.fields) {
358
- if (item.label === label) {
359
- item.value = value
360
- this.show_data[item.field] = value
361
- }
362
- }
363
- },
364
- setLabelOptions(label, options) {
365
- for (const item of this.show_data.fields) {
366
- if (item.label === label) {
367
- item.options = options
368
- }
369
- }
370
- },
371
- showLabels(...labels) {
372
- for (const item of this.show_data.fields) {
373
- if (labels.includes(item.label)) {
374
- item.hidden = false
375
- }
376
- }
377
- },
378
- hideLabels(...labels) {
379
- for (const item of this.show_data.fields) {
380
- if (labels.includes(item.label)) {
381
- item.hidden = true
382
- }
383
- }
384
- },
385
- requiredLabels(...labels) {
386
- for (const item of this.show_data.fields) {
387
- if (labels.includes(item.label)) {
388
- item.required = true
389
- }
390
- }
391
- },
392
- electiveLabels(...labels) {
393
- for (const item of this.show_data.fields) {
394
- if (labels.includes(item.label)) {
395
- item.required = false
396
- }
397
- }
398
- },
399
- readonlyLabels(...labels) {
400
- for (const item of this.show_data.fields) {
401
- if (labels.includes(item.label)) {
402
- item.readonly = true
403
- item.disabled = true
404
- }
405
- }
406
- },
407
- readwriteLabels(...labels) {
408
- for (const item of this.show_data.fields) {
409
- if (labels.includes(item.label)) {
410
- item.readonly = false
411
- item.disabled = false
412
- }
413
- }
414
- },
415
- disabledButtons(...buttons) {
416
- for (const item of this.show_data.buttons) {
417
- if (buttons.includes(item.button_name)) {
418
- item.disabled = true
419
- }
420
- }
421
- },
422
- enableButtons(...buttons) {
423
- for (const item of this.show_data.buttons) {
424
- if (buttons.includes(item.button_name)) {
425
- item.disabled = false
426
- }
427
- }
428
- },
429
- showButtons(...buttons) {
430
- for (const item of this.show_data.buttons) {
431
- if (buttons.includes(item.button_name)) {
432
- item.hidden = false
433
- }
434
- }
435
- },
436
- hideButtons(...buttons) {
437
- for (const item of this.show_data.buttons) {
438
- if (buttons.includes(item.button_name)) {
439
- item.hidden = true
440
- }
441
- }
442
- },
443
- async checkDuplicate(index) {
444
- let http = new HttpResetClass()
445
- let data = {
446
- tablename: 't_apply',
447
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
448
- }
449
- let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
450
- resolveMsg: null,
451
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
452
- })
453
- if (res.data.length > 0) {
454
- this.show_data.fields[index].value = null
455
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
456
- }
457
- },
458
- // 获取片区
459
- async getSliceArea () {
460
- let data = {
461
- tablename: 't_zone',
462
- condition: `f_orgid = '${this.$login.f.orgid}'`
463
- }
464
- let http = new HttpResetClass()
465
- let res = await http.load(
466
- 'POST',
467
- `rs/sql/apply_singleTable`,
468
- {data: data},
469
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
470
- )
471
-
472
- return res.data.map(item => {
473
- return {
474
- label: item.name,
475
- value: item.name
476
- }
477
- })
478
- },
479
- // 获取区县
480
- async getPcd () {
481
- let data = {
482
- tablename: 't_pcd',
483
- condition: `f_orgid = '${this.$login.f.orgid}'`
484
- }
485
- let http = new HttpResetClass()
486
- let res = await http.load(
487
- 'POST',
488
- `rs/sql/apply_singleTable`,
489
- {data: data},
490
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
491
- )
492
-
493
- return res.data.map(item => {
494
- return {
495
- label: item.f_pcd,
496
- value: item.f_pcd
497
- }
498
- })
499
- },
500
- // 获取集收单位
501
- async getArea () {
502
- let data = {
503
- tablename: 't_area',
504
- condition: `f_orgid = '${this.$login.f.orgid}'`
505
- }
506
- let http = new HttpResetClass()
507
- let res = await http.load(
508
- 'POST',
509
- `rs/sql/apply_singleTable`,
510
- {data: data},
511
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
512
- )
513
-
514
- return res.data.map(item => {
515
- return {
516
- label: item.f_residential_area,
517
- value: item.f_residential_area
518
- }
519
- })
520
- },
521
- // 缴费前置
522
- chargeBefore () {
523
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
524
- this.$showAlert('费用未结清!!!', 'warning', 3000)
525
- throw null
526
- }
527
- },
528
- // 施工前置 加表具后状态是待开通 提交后是正常 所以这里的判断条件需改正 (and uf.f_meter_classify is null and f_meternumber is null)
529
- async constructionBefore () {
530
- let http = new HttpResetClass()
531
- let data = {
532
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_meter_classify is null and f_meternumber is null`
533
- }
534
- let res = await http.load(
535
- 'POST',
536
- 'rs/sql/countApplyUserinfo',
537
- {data: data},
538
- {
539
- resolveMsg: null,
540
- rejectMsg: '安装明细查询失败!!!'
541
- })
542
- if (res.data[0].num > 0) {
543
- this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
544
- throw `还有${res.data[0].num}户未安装,无法提交`
545
- }
546
- },
547
- changePipeBuild () {
548
- if (this.selectdata.f_process_dep === '工程部') {
549
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
550
- }
551
- if (this.selectdata.f_process_dep === '运营部') {
552
- return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
553
- }
554
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
555
- },
556
- // async getDevInfo () {
557
- // let data = {
558
- // tablename: 't_dev_info',
559
- // condition: `f_orgid = '${this.$login.f.orgid}'`
560
- // }
561
- // let http = new HttpResetClass()
562
- // let res = await http.load(
563
- // 'POST',
564
- // `rs/sql/apply_singleTable`,
565
- // {data: data},
566
- // {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
567
- // )
568
- //
569
- // return res.data.map(item => {
570
- // return {
571
- // label: item.f_dev_name,
572
- // value: item.f_dev_name
573
- // }
574
- // })
575
- // },
576
- async getPrice (f_price_id) {
577
- console.log('=======================')
578
- console.log(f_price_id)
579
-
580
- let data = {
581
- condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
582
- }
583
- // if(this.Pricetype==='机表'){
584
- // data.condition=`sp.f_custom = '机表'`
585
- // }
586
- // if(this.Pricetype==='非机表'){
587
- // data.condition=`sp.f_custom = '非机表'`
588
- // }
589
-
590
- if (!isEmpty(f_price_id)) {
591
- data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
592
- }
593
- let http = new HttpResetClass()
594
- let res = await http.load(
595
- 'POST',
596
- `rs/sql/applyGetPrice`,
597
- {data: data},
598
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
599
- )
600
-
601
- let a= res.data.map(item => {
602
- return {
603
- label: item.f_price_name,
604
- value: item
605
- }
606
- })
607
- this.selectdata.fields.forEach(field => {
608
- if (field.label === '气价名称') {
609
- field.options = a}
610
- })
611
- return a
612
- },
613
- addressInitialization () {
614
- this.$getConfig(this, 'UserAddress')
615
-
616
- let f_address_type = this.show_data.f_address_type
617
-
618
- for (const item of this.show_data.fields) {
619
- if (f_address_type === '民用市区') {
620
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
621
- item.hidden = false
622
- item.required = true
623
- }
624
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
625
- item.hidden = false
626
- item.required = false
627
- }
628
- if (item.label === '地址') {
629
- item.readonly = true
630
- }
631
- }
632
- if (f_address_type === '民用乡镇') {
633
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
634
- item.hidden = false
635
- item.required = true
636
- }
637
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
638
- item.hidden = false
639
- item.required = false
640
- }
641
- if (item.label === '楼层') {
642
- item.hidden = true
643
- item.required = false
644
- }
645
- if (item.label === '地址') {
646
- item.readonly = true
647
- }
648
- }
649
- if (f_address_type === '特殊地址') {
650
- if (item.label === '区/县' || item.label === '街道/乡镇') {
651
- item.hidden = false
652
- item.required = true
653
- }
654
- if (item.label === '集收单位') {
655
- item.hidden = false
656
- if (this.show_data.f_apply_type === '工商户报建'){
657
- item.required = false
658
- } else {
659
- item.required = false
660
- }
661
-
662
- }
663
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
664
- item.hidden = true
665
- item.required = false
666
- }
667
- if (item.label === '地址') {
668
- item.readonly = false
669
- }
670
- }
671
-
672
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
673
- item.hidden = true
674
- }
675
- }
676
- },
677
- async streetChange () {
678
- if (isEmpty(this.show_data.f_street)) {
679
- return
680
- }
681
-
682
- let data = {
683
- tablename: 't_area',
684
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
685
- }
686
- let http = new HttpResetClass()
687
- let res = await http.load(
688
- 'POST',
689
- `rs/sql/apply_singleTable`,
690
- {data: data},
691
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
692
- )
693
-
694
- this.setLabelOptions('集收单位', res.data.map(item => {
695
- return {
696
- label: item.f_residential_area,
697
- value: item.f_residential_area
698
- }
699
- }))
700
- },
701
- async pcdChange () {
702
- if (isEmpty(this.show_data.f_pcd)) {
703
- return
704
- }
705
-
706
- let data = {
707
- tablename: 't_street',
708
- condition: `f_orgid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
709
- }
710
- let f_address_type = this.getLableValue('地址类型')
711
-
712
- if (f_address_type === '民用市区') {
713
- data.condition = `f_orgid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
714
- }
715
- if (f_address_type === '民用乡镇') {
716
- data.condition = `f_orgid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
717
- }
718
-
719
- let http = new HttpResetClass()
720
- let res = await http.load(
721
- 'POST',
722
- `rs/sql/apply_singleTable`,
723
- {data: data},
724
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
725
- )
726
-
727
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
728
- return {
729
- label: item.f_street,
730
- value: item.f_street
731
- }
732
- }))
733
- },
734
- async addressTips () {
735
- // console.log('======================='+this.show_data.f_apply_type)
736
- let res = ''
737
- if (this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') {
738
- res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
739
- }else{
740
- res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
741
- }
742
- if (res == 'confirm') {
743
- return
744
- }
745
- throw '用户信息确认!!!'
746
- },
747
- async getDesignerPeople () {
748
- let data = {
749
- source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
750
- userid: this.$login.f.id
751
- }
752
-
753
- let http = new HttpResetClass()
754
- let res = await http.load(
755
- 'POST',
756
- `rs/search`,
757
- {data: data},
758
- {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
759
- )
760
-
761
- return res.data.map(item => {
762
- return {
763
- label: item.name,
764
- value: item.id
765
- }
766
- })
767
- },
768
- async surveyStopApply () {
769
- console.log('终止报建!!!!!')
770
-
771
- this.show_data.f_stop_reason = '现场勘察不符合报装条件'
772
-
773
- let data = {
774
- data: this.show_data,
775
- user: this.$login.f
776
- }
777
-
778
- let res = await this.$resetpost(
779
- `rs/logic/surveyStopApply`,
780
- {data: data},
781
- {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
782
- )
783
-
784
- this.$dispatch('loadPage')
785
-
786
- throw '终止报建!!!'
787
- },
788
- async contract_number() {
789
- console.log("进入编号合同编号生成",this.$login.f.orgs)
790
- let f_contract_number = ''
791
- const nowDate = new Date();
792
- const date = {
793
- year: nowDate.getFullYear(),
794
- month: nowDate.getMonth() + 1,
795
- day: nowDate.getDate()
796
- }
797
-
798
- function upperCaseChars(dir) {
799
- let string = '';
800
- switch (dir){
801
- case '周口市天然气有限公司':
802
- string = 'ZK' // 当表达式的结果等于 房产 时,则执行该代码
803
- break;
804
- case '项城市天然气有限公司':
805
- string = "XC" // 当表达式的结果等于 自建房 时,则执行该代码
806
- break;
807
- case '西华县天然气有限公司':
808
- string = 'XH' // 当表达式的结果等于 商业 时,则执行该代码
809
- break;
810
- case '鹿邑县天然气有限公司':
811
- string = 'LY' // 当表达式的结果等于 工业 时,则执行该代码
812
- break;
813
- case '郸城县天然气有限公司':
814
- string = 'DC' // 当表达式的结果等于 中压 时,则执行该代码
815
- break;
816
- case '测试公司(一)':
817
- string = 'CS' // 当表达式的结果等于 中压 时,则执行该代码
818
- break;
819
- case '甘泉县丰源天然气有限责任公司':
820
- string = 'GQ' // 当表达式的结果等于 中压 时,则执行该代码
821
- break;
822
- default : 'HT'
823
- break; // 如果没有与表达式相同的公司,则执行该代码
824
- }
825
- return string;
826
- }
827
-
828
- const dir = upperCaseChars(this.$login.f.orgs) //分公司
829
-
830
- let type = 0 //类型
831
-
832
- switch (this.show_data.f_entry_type){
833
- case '城区/县城':
834
- type = 1 // 当表达式的结果等于 城区 时,则执行该代码
835
- break;
836
- case '新农村':
837
- type = 2 // 当表达式的结果等于 新农村 时,则执行该代码
838
- break;
839
- case '测试':
840
- type = 3 // 当表达式的结果等于 新农村 时,则执行该代码
841
- break;
842
- default :
843
- break; // 如果没有与表达式相同的值,则执行该代码
844
- }
845
-
846
- let nature = 0 // 性质
847
- switch (this.show_data.f_apply_nature){
848
- case '楼房':
849
- nature = 1 // 当表达式的结果等于 楼房 时,则执行该代码
850
- break;
851
- case '房产':
852
- nature = 1 // 当表达式的结果等于 房产 时,则执行该代码
853
- break;
854
- case '自建房':
855
- nature = 2 // 当表达式的结果等于 自建房 时,则执行该代码
856
- break;
857
- case '商业':
858
- nature = 3 // 当表达式的结果等于 商业 时,则执行该代码
859
- break;
860
- case '学校':
861
- nature = 3 // 当表达式的结果等于 学校 时,则执行该代码
862
- break;
863
- case '福利机构':
864
- nature = 3 // 当表达式的结果等于 福利机构 时,则执行该代码
865
- break;
866
- case '其他':
867
- nature = 3 // 当表达式的结果等于 其他 时,则执行该代码
868
- break;
869
- case '工业':
870
- nature = 4 // 当表达式的结果等于 工业 时,则执行该代码
871
- break;
872
- case '中压':
873
- nature = 5 // 当表达式的结果等于 中压 时,则执行该代码
874
- break;
875
- case '测试':
876
- nature = 6 // 当表达式的结果等于 中压 时,则执行该代码
877
- break;
878
- default :
879
- break; // 如果没有与表达式相同的值,则执行该代码
880
- }
881
-
882
- const newMonth = date.month >= 10 ? date.month : '0' + date.month //月份
883
- const dataYm = date.year + '-01-01'
884
- const newYear = date.year + 1
885
- const year = date.year.toString().substring(2,4) //年份
886
-
887
- let data = {
888
- orgid: this.$login.f.orgid
889
- }
890
-
891
- let http = new HttpResetClass()
892
- let res = await http.load('POST', 'rs/sql/contractCount', {data:data}, {
893
- resolveMsg: null,
894
- rejectMsg: null
895
- })
896
- let oldDate
897
- for (const item of res.data) {
898
- if (item.name === '合同编号最后更新日期'){
899
- oldDate = item.value
900
- }
901
- }
902
- for (const item of res.data){
903
- if (item.name === '合同编号'){
904
- if (item.value === 0 || Date.parse(oldDate) < Date.parse(dataYm)) {
905
- f_contract_number = dir + type + nature + year + newMonth + '001'
906
- console.log("触发if", f_contract_number)
907
- } else {
908
- let count = item.value
909
- f_contract_number = dir + type + nature + year + newMonth + this.PrefixInteger(count, 3)
910
- console.log("触发else", f_contract_number)
911
- }
912
- }
913
- }
914
- this.selectdata.f_contract_number = f_contract_number
915
- this.show_data.f_contract_number = f_contract_number
916
- return f_contract_number
917
- },
918
- PrefixInteger(num, n) {
919
- return (Array(n).join(0) + num).slice(-n);
920
- },
921
- // 单价失去焦点
922
- async priceSum () {
923
- if (isEmpty(this.show_data.f_price)) {
924
- return
925
- }
926
- let data = {
927
- operator: '乘',
928
- num1: this.show_data.f_price,
929
- num2: this.show_data.f_install_count
930
- }
931
- let http = new HttpResetClass()
932
- let res = await http.load(
933
- 'POST',
934
- `rs/logic/compute`,
935
- {data: data},
936
- {resolveMsg: null, rejectMsg: '工程材料费计算失败!!!'}
937
- )
938
-
939
- this.setLabelValue('工程材料费', res.data)
940
- },
941
- },
942
- events: {
943
- 'priceType'(index){
944
- this.Pricetype = this.getLableValue('所属类型')
945
- console.log('打印方法值',this.getPrice(this.show_data.f_price_id))
946
- for (const item of this.show_data.fields) {
947
- if (this.show_data.f_sprice_type !=null && this.show_data.f_sprice_type !='') {
948
- if(item.label==='气价名称'){
949
- this.getPrice().then(value =>{
950
- item.options=value
951
- })
952
- console.log('最终',item.options)
953
- }
954
- }
955
- }
956
- },
957
- 'complyInstallation' (index) {
958
- if (this.show_data.f_is_have === '否') {
959
- this.hideButtons('提交', '出图', '缴费')
960
- this.showButtons('终止')
961
- }
962
- if (this.show_data.f_is_have === '是') {
963
- this.hideButtons('终止')
964
- this.showButtons('提交', '出图', '缴费')
965
- }
966
- },
967
- async 'igniteDispatchReadyEvent' () {
968
- let data = {
969
- tablename: 'activityins',
970
- condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
971
- }
972
- let http = new HttpResetClass()
973
- let res = await http.load(
974
- 'POST',
975
- `rs/sql/apply_singleTable`,
976
- {data: data},
977
- {resolveMsg: null, rejectMsg: '查询失败!!!'}
978
- )
979
- if (res.data.length <= 0) {
980
- console.log('+++++++++++++++++++++++++++++')
981
- console.log('没有施工,不能退回')
982
- this.hideButtons('退回')
983
- }
984
- },
985
- 'buildReadyEvent' () {
986
- this.setLabelValue('施工单位', this.$login.f.name)
987
- this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
988
- },
989
- // 选择材料
990
- async materialNameChenge (index, fieldIndex) {
991
- let material = this.show_data.onetomany[index].fields[fieldIndex].value
992
-
993
- this.show_data.onetomany[index].fields.forEach(item => {
994
- if (material[item.field]) {
995
- item.value = material[item.field]
996
- }
997
- })
998
- },
999
- // 打开模态框获取材料
1000
- async 'getMaterialName' (index) {
1001
- let data = {
1002
- condition: `1=1`
1003
- }
1004
- let http = new HttpResetClass()
1005
- let res = await http.load(
1006
- 'POST',
1007
- `rs/sql/getStockMaterial`,
1008
- {data: data},
1009
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
1010
- )
1011
-
1012
- this.show_data.onetomany[index].fields.forEach(field => {
1013
- if (field.label === '选择材料') {
1014
- field.options = res.data.map(item => {
1015
- return {
1016
- 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
1017
- 'value': item
1018
- }
1019
- })
1020
- }
1021
- })
1022
- },
1023
- // 搜索小区
1024
- async 'searchArea' (area, index) {
1025
- let data = {
1026
- tablename: 't_area',
1027
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1028
- }
1029
- let http = new HttpResetClass()
1030
- let res = await http.load(
1031
- 'POST',
1032
- `rs/sql/apply_singleTable`,
1033
- {data: data},
1034
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1035
- )
1036
-
1037
- if (res.data.length === 0) {
1038
- return
1039
- }
1040
-
1041
- this.setLabelOptions('集收单位', res.data.map(item => {
1042
- return {
1043
- label: item.f_residential_area,
1044
- value: item.f_residential_area
1045
- }
1046
- }))
1047
- },
1048
- // 搜索小区
1049
- async 'searchAreaCollective' (area, index) {
1050
- let data = {
1051
- tablename: 't_area',
1052
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${area}%'`
1053
- }
1054
- let http = new HttpResetClass()
1055
- let res = await http.load(
1056
- 'POST',
1057
- `rs/sql/apply_singleTable`,
1058
- {data: data},
1059
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1060
- )
1061
-
1062
- if (res.data.length === 0) {
1063
- return
1064
- }
1065
-
1066
- this.setLabelOptions('集收单位', res.data.map(item => {
1067
- return {
1068
- label: item.f_residential_area,
1069
- value: item.f_residential_area
1070
- }
1071
- }))
1072
- },
1073
- // 选择气价
1074
- 'priceChange' (index) {
1075
- if (isEmpty(this.show_data.stairPrice)) {
1076
- return
1077
- }
1078
-
1079
- let stairPrice = this.getLableValue('气价名称')
1080
-
1081
- this.setLabelValue('气价类型', stairPrice.f_price_type)
1082
- this.setLabelValue('用气性质', stairPrice.f_gasproperties)
1083
- this.setLabelValue('价格', stairPrice.f_price)
1084
- this.setLabelValue('客户类型', stairPrice.f_user_type)
1085
- this.show_data.f_price_id = stairPrice.id
1086
- this.show_data.f_price_name = stairPrice.f_price_name
1087
- },
1088
- // 选择开发商
1089
- // async 'devInfoChange' (index) {
1090
- // if (isEmpty(this.show_data.f_company_name)) {
1091
- // return
1092
- // }
1093
- // let data = {
1094
- // tablename: 't_dev_info',
1095
- // condition: `f_orgid = '${this.$login.f.orgid}' and f_dev_name = '${this.show_data.f_company_name}'`
1096
- // }
1097
- // let res = await this.$resetpost(
1098
- // `rs/sql/apply_singleTable`,
1099
- // {data: data},
1100
- // {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
1101
- // )
1102
- // this.show_data.f_dev_id = res.data[0].id
1103
- // this.show_data.f_dev_code = res.data[0].f_dev_code
1104
- // this.setLabelValue('法人名称', res.data[0].f_legal_person)
1105
- // this.setLabelValue('身份证', res.data[0].f_idnumber)
1106
- // this.setLabelValue('营业执照', res.data[0].f_license_num)
1107
- // },
1108
- // 退款金额
1109
- 'refundMoneyChange' (index) {
1110
- let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
1111
- let f_refund_money = this.show_data.fields[index].value
1112
-
1113
- if (f_refund_money > f_cumulative_payment_money) {
1114
- this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
1115
- this.show_data.fields[index].value = null
1116
- }
1117
- },
1118
- // 检查重复
1119
- 'checkRepeat' (index) {
1120
- this.checkDuplicate(index)
1121
- },
1122
- // 选择报建项目
1123
- 'selectApply' (row) {
1124
- this.setLabelValue('工程名称', row.f_entry_name)
1125
- this.setLabelValue('工程编号', row.f_apply_num)
1126
- this.setLabelValue('报建类型', row.f_apply_type)
1127
- this.setLabelValue('用户名称', row.f_user_name)
1128
- this.setLabelValue('用户电话', row.f_phone)
1129
- this.setLabelValue('证件类型', row.f_credentials)
1130
- this.setLabelValue('证件号码', row.f_idnumber)
1131
- this.setLabelValue('地址', row.f_address)
1132
- this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
1133
-
1134
- this.show_data.parentApply = JSON.parse(JSON.stringify(row))
1135
-
1136
- delete row.id
1137
- delete row.actid
1138
- delete row.defid
1139
- delete row.defname
1140
- delete row.version
1141
- delete row.f_apply_num
1142
- delete row.f_sub_state
1143
- delete row.f_apply_type
1144
- delete row.f_process_id
1145
-
1146
- this.show_data = Object.assign({}, this.show_data, row)
1147
-
1148
- this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
1149
- },
1150
- // 是否终止
1151
- 'isStopChange' (index) {
1152
- let f_is_stop = this.show_data.f_is_stop
1153
-
1154
- for (const item of this.show_data.fields) {
1155
- if (f_is_stop === '是') {
1156
- if (item.label === '终止原因') {
1157
- item.hidden = false
1158
- item.required = true
1159
- }
1160
- } else {
1161
- if (item.label === '终止原因') {
1162
- item.hidden = true
1163
- item.required = false
1164
- }
1165
- }
1166
- }
1167
- },
1168
- // 终止报建初始化
1169
- async 'stopApplyReadyEvent' () {
1170
-
1171
- let f_is_stop = this.getLableValue('是否终止')
1172
-
1173
- for (const item of this.show_data.fields) {
1174
- if (f_is_stop === '是') {
1175
- if (item.label === '终止原因') {
1176
- item.hidden = false
1177
- item.required = true
1178
- }
1179
- } else {
1180
- if (item.label === '终止原因') {
1181
- item.hidden = true
1182
- item.required = false
1183
- }
1184
- }
1185
- }
1186
-
1187
- if (isEmpty(this.show_data.f_parent_process_id)) {
1188
- return
1189
- }
1190
- let data = {
1191
- condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
1192
- data: {
1193
- id: this.$login.f.id,
1194
- orgid: this.$login.f.orgid
1195
- }
1196
- }
1197
- let res = await this.$resetpost(
1198
- `rs/sql/supervisory`,
1199
- {data: data},
1200
- {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
1201
- )
1202
- this.show_data.parentApply = res.data[0]
1203
- },
1204
- // 选择用户档案信息
1205
- 'selectUserinfo' (row) {
1206
- this.setLabelValue('用户编号', row.f_userinfo_code)
1207
- this.setLabelValue('用户名称', row.f_user_name)
1208
- this.setLabelValue('用户电话', row.f_user_phone)
1209
- this.setLabelValue('证件类型', row.f_credentials)
1210
- this.setLabelValue('证件号码', row.f_idnumber)
1211
- this.setLabelValue('地址', row.f_address)
1212
-
1213
- this.show_data.f_userinfo_id = row.f_userinfo_id
1214
- this.show_data.f_userinfo_code = row.f_userinfo_code
1215
- },
1216
- // 是否购买保险
1217
- async 'isInsureChange' (index) {
1218
- if (!this.show_data.f_is_insure) {
1219
- return
1220
- }
1221
- let f_is_insure = this.show_data.f_is_insure
1222
- for (const item of this.show_data.fields) {
1223
- if (f_is_insure === '是') {
1224
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1225
- item.hidden = false
1226
- item.required = true
1227
- }
1228
- if (item.label === '保险备注') {
1229
- item.hidden = false
1230
- }
1231
- } else {
1232
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1233
- item.hidden = true
1234
- item.required = false
1235
- }
1236
- }
1237
- }
1238
- },
1239
- // 通气点火初始化
1240
- async 'gasReadyEvent' () {
1241
- // 是否有气价信息
1242
- if (!isEmpty(this.show_data.f_price_id)) {
1243
- let priceList = await this.getPrice(this.show_data.f_price_id)
1244
- this.setLabelValue('气价名称', priceList[0].value)
1245
- }
1246
-
1247
- let data = {
1248
- tablename: 't_userfees',
1249
- condition: `f_orgid = '${this.$login.f.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
1250
- }
1251
- let http = new HttpResetClass()
1252
- let res = await http.load(
1253
- 'POST',
1254
- `rs/sql/apply_singleTable`,
1255
- {data: data},
1256
- {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
1257
- )
1258
- if (res.data.length > 0) {
1259
- this.setLabelValue('待执行保险', '是')
1260
- for (const item of this.show_data.fields) {
1261
- if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1262
- item.hidden = true
1263
- item.required = false
1264
- item.value = null
1265
- }
1266
- }
1267
- } else {
1268
- this.setLabelValue('待执行保险', '否')
1269
- for (const item of this.show_data.fields) {
1270
- if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1271
- item.hidden = false
1272
- item.required = true
1273
- }
1274
- }
1275
- }
1276
-
1277
- // 保险初始化显示内容
1278
- let f_is_insure = this.getLableValue('是否购买保险')
1279
- for (const item of this.show_data.fields) {
1280
- if (f_is_insure === '是') {
1281
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1282
- item.hidden = false
1283
- item.required = true
1284
- }
1285
- if (item.label === '保险备注') {
1286
- item.hidden = false
1287
- }
1288
- // 本期保费到期时间默认一年
1289
- if (isEmpty(this.selectdata.f_ins_expiration_date)) {
1290
- let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
1291
- this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
1292
- }
1293
- }
1294
- if (f_is_insure === '否') {
1295
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1296
- item.hidden = true
1297
- item.required = false
1298
- }
1299
- }
1300
- }
1301
- },
1302
- // 合同金额失去焦点
1303
- async 'contractMoneyChange' (index) {
1304
- let data = {
1305
- operator: '加',
1306
- num1: this.show_data.f_contract_money || 0,
1307
- num2: this.getLableValue('追加金额') || 0
1308
- }
1309
- let res = await this.$resetpost(
1310
- `rs/logic/compute`,
1311
- {data: data},
1312
- {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1313
- )
1314
-
1315
- this.setLabelValue('应交金额', res.data)
1316
- },
1317
- // 街道失去焦点
1318
- async 'streetChange' (index) {
1319
- if (isEmpty(this.show_data.f_street)) {
1320
- return
1321
- }
1322
-
1323
- this.setLabelValue('集收单位', null)
1324
-
1325
- let data = {
1326
- tablename: 't_area',
1327
- condition: `f_orgid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1328
- }
1329
- let http = new HttpResetClass()
1330
- let res = await http.load(
1331
- 'POST',
1332
- `rs/sql/apply_singleTable`,
1333
- {data: data},
1334
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1335
- )
1336
-
1337
- this.setLabelOptions('集收单位', res.data.map(item => {
1338
- return {
1339
- label: item.f_residential_area,
1340
- value: item.f_residential_area
1341
- }
1342
- }))
1343
- },
1344
- // 区县失去焦点
1345
- async 'pcdChange' (index) {
1346
- if (isEmpty(this.show_data.f_pcd)) {
1347
- return
1348
- }
1349
-
1350
- this.setLabelValue('街道/乡镇', null)
1351
- this.setLabelValue('集收单位', null)
1352
-
1353
-
1354
-
1355
- let data = {
1356
- tablename: 't_street',
1357
- condition: `f_orgid= '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1358
- }
1359
- let f_address_type = this.getLableValue('地址类型')
1360
-
1361
- if (f_address_type === '民用市区') {
1362
- data.condition = `f_orgid= '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1363
- }
1364
- if (f_address_type === '民用乡镇') {
1365
- data.condition = `f_orgid= '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1366
- }
1367
-
1368
- let http = new HttpResetClass()
1369
- let res = await http.load(
1370
- 'POST',
1371
- `rs/sql/apply_singleTable`,
1372
- {data: data},
1373
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1374
- )
1375
-
1376
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
1377
- return {
1378
- label: item.f_street,
1379
- value: item.f_street
1380
- }
1381
- }))
1382
- },
1383
- // 地址类型失去焦点
1384
- 'addressTypeChange' (index) {
1385
- this.setLabelValue('街道/乡镇', null)
1386
- this.setLabelValue('集收单位', null)
1387
- let f_address_type = this.show_data.fields[index].value
1388
- for (const item of this.show_data.fields) {
1389
- if (f_address_type === '民用市区') {
1390
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1391
- item.hidden = false
1392
- item.required = true
1393
- item.value = null
1394
- }
1395
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1396
- item.hidden = false
1397
- item.required = false
1398
- item.value = null
1399
- }
1400
- if (item.label === '地址') {
1401
- item.readonly = true
1402
- item.value = null
1403
- }
1404
- }
1405
- if (f_address_type === '民用乡镇') {
1406
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1407
- item.hidden = false
1408
- item.required = true
1409
- item.value = null
1410
- }
1411
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1412
- item.hidden = false
1413
- item.required = false
1414
- item.value = null
1415
- }
1416
- if (item.label === '楼层') {
1417
- item.hidden = true
1418
- item.required = false
1419
- item.value = null
1420
- }
1421
- if (item.label === '地址') {
1422
- item.readonly = true
1423
- item.value = null
1424
- }
1425
- }
1426
- if (f_address_type === '特殊地址') {
1427
- if (item.label === '区/县' || item.label === '街道/乡镇') {
1428
- item.hidden = false
1429
- item.required = true
1430
- item.value = null
1431
- }
1432
- if (item.label === '集收单位') {
1433
- item.hidden = false
1434
- item.required = false
1435
- item.value = null
1436
- }
1437
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1438
- item.hidden = true
1439
- item.required = false
1440
- item.value = null
1441
- }
1442
- if (item.label === '地址') {
1443
- item.readonly = false
1444
- item.value = null
1445
- }
1446
- }
1447
- }
1448
- },
1449
- // 团购转散户初始化
1450
- 'apply2ReadyEvent' () {
1451
- if (this.show_data.f_apply_source === '线下发起') {
1452
- this.addressInitialization()
1453
- this.hideLabels('用户编号')
1454
- this.electiveLabels('用户编号')
1455
- this.showLabels('片区', '地址类型')
1456
- this.requiredLabels('片区', '地址类型')
1457
- }
1458
- if (this.show_data.f_apply_source === '自动发起') {
1459
- this.hideLabels('片区', '地址类型')
1460
- this.electiveLabels('片区', '地址类型',)
1461
- }
1462
- },
1463
- // 申请节点初始化
1464
- 'applyReadyEvent' () {
1465
- this.addressInitialization()
1466
- this.pcdChange()
1467
- this.streetChange()
1468
- },
1469
- // ===========================================
1470
- async 'button'() {
1471
- if (this.show_data.button.before) {
1472
- await this[this.show_data.button.before]()
1473
- }
1474
- // 点击重置按钮就重置数据
1475
- if (this.show_data.button.button_name === '重置') {
1476
- this.$dispatch('breakControl', this.selectdata)
1477
- return
1478
- }
1479
-
1480
- this.show_data.user = this.$login.f
1481
- this.show_data.start_activity = this.$workflow_vue.start_activity
1482
- this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1483
-
1484
- if ((this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') && this.show_data.defname === '工程施工' && this.show_data.f_sub_state !='完工' && this.show_data.button.button_name === '完工'){
1485
- //判断是否添加报警器材料
1486
- let bjqlag = false
1487
- let datatemp = {
1488
- 'bjqid':"",
1489
- 'fprocessid':"",
1490
- 'sqvalue':"",
1491
- 'f_bjq_sid':"",
1492
- 'f_material_code':"",
1493
- 'f_bjq_baidu_lng':"",
1494
- 'f_bjq_baidu_lat':"",
1495
- 'f_bjq_gaode_lng':"",
1496
- 'f_bjq_gaode_lat':""
1497
- }
1498
-
1499
- let bjqststedata = {
1500
- "sid":"",
1501
- "bjqtype":"",
1502
- "f_process_id":"",
1503
- "bjqstate":"",
1504
- "f_userinfo_code":""
1505
- }
1506
- let numOne = [];
1507
-
1508
- let http = new HttpResetClass()
1509
- let data = {
1510
- tablename: `t_material_apply`,
1511
- condition: `f_process_id='${this.show_data.f_process_id}'`
1512
- }
1513
- let res = await http.load(
1514
- 'POST',
1515
- `rs/sql/apply_singleTable`,
1516
- {data: data},
1517
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
1518
- )
1519
- res.data.forEach(item => {
1520
- if (item.f_material_name.substr(0,3) === '报警器'){
1521
- var bjname = item.f_material_name.split("-")
1522
- bjqststedata.sid = item.f_bjq_sid
1523
- bjqststedata.f_process_id = item.f_process_id
1524
- bjqststedata.bjqtype = bjname[1]
1525
- //====================================
1526
- bjqlag = true
1527
- datatemp.bjqid = item.id
1528
- datatemp.fprocessid = item.f_process_id
1529
- datatemp.f_bjq_sid = item.f_bjq_sid
1530
- datatemp.f_material_code = item.f_material_code
1531
- datatemp.f_bjq_lng = item.f_bjq_lng
1532
- datatemp.f_bjq_lat = item.f_bjq_lat
1533
- datatemp.f_bjq_gaode_lng = item.f_bjq_gaode_lng
1534
- datatemp.f_bjq_gaode_lat = item.f_bjq_gaode_lng
1535
- datatemp.f_bjq_baidu_lng = item.f_bjq_baidu_lng
1536
- datatemp.f_bjq_baidu_lat = item.f_bjq_baidu_lat
1537
- numOne.push(item.f_bjq_sid)
1538
- }
1539
- })
1540
-
1541
- // this.show_data.onetomany.forEach(item=>{
1542
- // console.log("查看报警器材料",item)
1543
- // item.rows.forEach(i=>{
1544
- // if (i.f_material_name.substr(0,3) === '报警器'){
1545
- // var bjname = i.f_material_name.split("-")
1546
- // bjqststedata.sid = i.f_bjq_sid
1547
- // bjqststedata.f_process_id = i.f_process_id
1548
- // bjqststedata.bjqtype = bjname[1]
1549
- // //====================================
1550
- // bjqlag = true
1551
- // datatemp.bjqid = i.id
1552
- // datatemp.fprocessid = i.f_process_id
1553
- // datatemp.f_bjq_sid = i.f_bjq_sid
1554
- // datatemp.f_material_code = i.f_material_code
1555
- // numOne.push(i.f_bjq_sid)
1556
- // }
1557
- // })
1558
- // })
1559
- if (!bjqlag){
1560
- this.$showMessage('请添加报警器物料信息!!!')
1561
- return
1562
- }
1563
- if (numOne.length > 1){
1564
- this.$showMessage("暂时支持单个报警器物料安装!!!")
1565
- return
1566
- }
1567
- datatemp.sqvalue = this.show_data.areaData.sqvalue
1568
- datatemp.f_bjq_baidu_lng = this.show_data.templatlng.baidutemplng
1569
- datatemp.f_bjq_baidu_lat = this.show_data.templatlng.baidutemplat
1570
- datatemp.f_bjq_gaode_lng = this.show_data.templatlng.gaodetemplng
1571
- datatemp.f_bjq_gaode_lat = this.show_data.templatlng.gaodetemplat
1572
- datatemp.f_bjq_lng = this.show_data.templatlng.baidutemplng
1573
- datatemp.f_bjq_lat = this.show_data.templatlng.baidutemplat
1574
-
1575
- bjqststedata.f_userinfo_code = this.show_data.f_userinfo_code
1576
-
1577
- //判断是否推送 及推送的状态
1578
- //查询是否存在, 以型号及厂家判断
1579
- let bjqres = await this.$resetpost(
1580
- `rs/logic/getbjqsyncinfo`,
1581
- bjqststedata
1582
- )
1583
- if (bjqres.data.bjqstate != "成功"){
1584
- //区域地址存入材料记录表
1585
- let areares = await this.$resetpost(
1586
- `rs/logic/saveArea`,
1587
- {data: datatemp},
1588
- {resolveMsg: null, rejectMsg: '区域地址保存失败'}
1589
- )
1590
-
1591
- //完工之后推送数据到汉威
1592
- let adddata = {
1593
- f_bjq_sid : datatemp.f_bjq_sid,
1594
- f_material_code : datatemp.f_material_code,
1595
- f_bjq_address: this.show_data.areaData.sqvalue,
1596
- f_user_name: this.show_data.f_user_name,
1597
- f_address: this.show_data.f_address,
1598
- f_user_phone: this.show_data.f_phone,
1599
- f_userinfo_code: this.show_data.f_userinfo_code,
1600
- installtime: this.show_data.f_construction_date,
1601
- f_orgid : this.show_data.f_orgid,
1602
- f_bjq_lng: datatemp.f_bjq_baidu_lng,
1603
- f_bjq_lat: datatemp.f_bjq_baidu_lat
1604
- }
1605
- let res = await this.$resetpost(
1606
- `ncc/rs/logic/bjqadduser`,
1607
- // `rs/logic/bjqadduser`,
1608
- adddata
1609
- )
1610
- if (res.data.code != 200){
1611
- if (bjqres.data.bjqstate.length == 0){
1612
- bjqststedata.bjqstate = "失败"
1613
- let bjqres3 = await this.$resetpost(
1614
- `rs/logic/addbjqsyncinfo`,
1615
- bjqststedata
1616
- )
1617
- }
1618
- this.$showMessage(res.data.msg)
1619
- return
1620
- }
1621
- //更改记录表状态
1622
- if (bjqres.data.bjqstate === "失败"){
1623
- bjqststedata.bjqstate = "成功"
1624
- let bjqres1 = await this.$resetpost(
1625
- `rs/logic/updatebjqsyncinfo`,
1626
- bjqststedata
1627
- )
1628
- }else{
1629
- bjqststedata.bjqstate = "成功"
1630
- let bjqres2 = await this.$resetpost(
1631
- `rs/logic/addbjqsyncinfo`,
1632
- bjqststedata
1633
- )
1634
- }
1635
- }
1636
- }
1637
- if ((this.show_data.f_apply_type === '工商户报建' || this.show_data.f_apply_type === '团购报建')
1638
- && (this.show_data.defname === '报装申请') && this.show_data.button.button_name === '提交'){
1639
- await this.contract_number()
1640
- }
1641
- // if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && (this.show_data.button.button_name === '保存'||this.show_data.button.button_name === '提交')){
1642
- // let dataz = {
1643
- // condition: `u.id = ${this.show_data.id}`,
1644
- // data: {
1645
- // id: this.$login.f.id,
1646
- // orgid: this.$login.f.orgid
1647
- // }
1648
- // }
1649
- // let http = new HttpResetClass()
1650
- // let restpz = await http.load(
1651
- // 'POST',
1652
- // `rs/sql/checkuser`,
1653
- // {data: dataz},
1654
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1655
- // )
1656
- // this.show_data.actid=restpz.data[0].actid
1657
- // }
1658
- let res = await this.$resetpost(
1659
- `rs/logic/ApplyProductService`,
1660
- {data: this.show_data},
1661
- {resolveMsg: null, rejectMsg: '数据保存失败'}
1662
- )
1663
-
1664
-
1665
- if (this.show_data.button.after) {
1666
- this[this.show_data.button.after]()
1667
- }
1668
- // // 改管报建 增容报建 优化
1669
- // if((this.show_data.f_apply_type === '改管报建'||this.show_data.f_apply_type === '增容报建') && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '缴费'){
1670
- // let datagg = {
1671
- // condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1672
- // }
1673
- // let http = new HttpResetClass()
1674
- // let restgg = await http.load(
1675
- // 'POST',
1676
- // `rs/sql/checkusertwo`,
1677
- // {data: datagg},
1678
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1679
- // )
1680
- // debugger
1681
- // if(this.show_data.f_apply_type === '改管报建'){
1682
- // restgg.data[0].processname = '改管报建流程'
1683
- // restgg.data[0].defname = '报装缴费'
1684
- // }else{
1685
- // restgg.data[0].processname = '增容报建流程'
1686
- // restgg.data[0].defname = '报装缴费'
1687
- // }
1688
- // restgg.data[0].actid = restgg.data[0].actid + 1
1689
- // this.$dispatch('apply',restgg.data[0])
1690
- //
1691
- // }
1692
- //
1693
- // // 退款报建 优化
1694
- // if(this.show_data.f_apply_type === '退款报建' && this.show_data.defname === '终止报建' && this.show_data.button.button_name === '提交'){
1695
- // let datatk = {
1696
- // condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1697
- // }
1698
- // let http = new HttpResetClass()
1699
- // let resttk = await http.load(
1700
- // 'POST',
1701
- // `rs/sql/checkusertwo`,
1702
- // {data: datatk},
1703
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1704
- // )
1705
- // debugger
1706
- // resttk.data[0].processname = '退款报建流程'
1707
- // resttk.data[0].defname = '退款'
1708
- // this.$dispatch('apply',resttk.data[0])
1709
- //
1710
- // }
1711
- //
1712
- //
1713
- // if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '合同'){
1714
- // let data = {
1715
- // tablename: 't_apply',
1716
- // condition: `f_process_id='${this.show_data.f_process_id}'`
1717
- // }
1718
- // let http = new HttpResetClass()
1719
- // let restp = await http.load(
1720
- // 'POST',
1721
- // `rs/sql/apply_singleTable`,
1722
- // {data: data},
1723
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1724
- // )
1725
- // debugger
1726
- // restp.data[0].processname = '散户报建流程'
1727
- // restp.data[0].defname = '合同签订'
1728
- // this.$dispatch('apply',restp.data[0])
1729
- //
1730
- // } else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && this.show_data.button.button_name === '提交'){
1731
- // let data2 = {
1732
- // condition: `u.id = ${this.show_data.id}`,
1733
- // data: {
1734
- // id: this.$login.f.id,
1735
- // orgid: this.$login.f.orgid
1736
- // }
1737
- // }
1738
- // let http = new HttpResetClass()
1739
- // let restp1 = await http.load(
1740
- // 'POST',
1741
- // `rs/sql/checkuser`,
1742
- // {data: data2},
1743
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1744
- // )
1745
- // debugger
1746
- // console.log('有没有发请求打印查询的内容restp1',restp1)
1747
- // // restp1.data[0].processname = '散户报建流程'
1748
- // // restp1.data[0].defname = '报装缴费'
1749
- // this.$dispatch('apply',restp1.data[0])
1750
- // }else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装缴费' && this.show_data.button.button_name === '提交'){
1751
- // let data3 = {
1752
- // condition: `u.id = ${this.show_data.id}`,
1753
- // data: {
1754
- // id: this.$login.f.id,
1755
- // orgid: this.$login.f.orgid
1756
- // }
1757
- // }
1758
- // let http = new HttpResetClass()
1759
- // let restp2 = await http.load(
1760
- // 'POST',
1761
- // `rs/sql/checkuser`,
1762
- // {data: data3},
1763
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1764
- // )
1765
- // debugger
1766
- // console.log('打印查询的内容',restp2)
1767
- // if(restp2.length>0){
1768
- // this.$dispatch('apply',restp2.data[0])
1769
- // }else{
1770
- // debugger
1771
- // this.$dispatch('loadPage')
1772
- // }
1773
- // }
1774
- // else{
1775
- // this.$dispatch('loadPage')
1776
- // }
1777
- this.$dispatch('loadPage')
1778
- },
1779
- // 失去焦点出触发事件
1780
- 'onchange' (index) {
1781
- if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1782
-
1783
- if (
1784
- this.show_data.fields[index].label === '区/县' ||
1785
- this.show_data.fields[index].label === '街道/乡镇' ||
1786
- this.show_data.fields[index].label === '集收单位' ||
1787
- this.show_data.fields[index].label === '楼号/组' ||
1788
- this.show_data.fields[index].label === '单元/排' ||
1789
- this.show_data.fields[index].label === '楼层' ||
1790
- this.show_data.fields[index].label === '门牌号'
1791
- ) {
1792
-
1793
- let f_pcd = this.getLableValue('区/县') || ''
1794
- let f_street = this.getLableValue('街道/乡镇') || ''
1795
- let f_residential_area = this.getLableValue('集收单位') || ''
1796
- let f_building = this.getLableValue('楼号/组') || ''
1797
- // let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1798
- let f_building_suffix = f_building ? '号楼' : ''
1799
- let f_unit = this.getLableValue('单元/排') || ''
1800
- // let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1801
- let f_unit_suffix = f_unit ? '单元' : ''
1802
- let f_floor = this.getLableValue('楼层') || ''
1803
- // let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1804
- let f_floor_suffix = f_floor ? '层' : ''
1805
- let f_room = this.getLableValue('门牌号') || ''
1806
- // let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1807
- let f_room_suffix = f_room ? '室' : ''
1808
-
1809
- let f_address = f_pcd + f_street + f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
1810
- this.setLabelValue("地址", f_address)
1811
- }
1812
- }
1813
- },
1814
- selectSearch (val, index) {},
1815
- 'onblur' (index) {},
1816
- 'oninput' (index) {},
1817
- 'initializtionView' () {},
1818
- async 'onchangeModal' (index, fieldIndex) {
1819
- },
1820
- async 'onblurModal' (index, fieldIndex) {
1821
-
1822
- },
1823
- async 'oninputModal' (index, fieldIndex) {
1824
-
1825
- },
1826
- async 'onetomanydelete' (index, rowIndex) {
1827
-
1828
- let http = new HttpResetClass()
1829
-
1830
- let res = await http.load(
1831
- 'DELETE',
1832
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1833
- null,
1834
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
1835
- )
1836
-
1837
- res = await this.$resetpost(
1838
- 'rs/entity/t_apply',
1839
- this.show_data
1840
- )
1841
-
1842
- this.$dispatch('breakControl', this.show_data)
1843
- },
1844
- async 'onetomanyupdate' (index, rowIndex) {
1845
- let data = this.show_data.onetomany[index].rows[rowIndex]
1846
-
1847
- this.show_data.onetomany[index].fields.forEach(item => {
1848
- data[item.field] = item.value
1849
- })
1850
- let res = await this.$resetpost(
1851
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1852
- data
1853
- )
1854
-
1855
- res = await this.$resetpost(
1856
- 'rs/entity/t_apply',
1857
- this.show_data
1858
- )
1859
-
1860
- this.$dispatch('breakControl', this.show_data)
1861
- },
1862
- async 'onetomanyadd' (index) {
1863
- let data = {
1864
- f_process_id : this.show_data.f_process_id,
1865
- f_operator_id: this.$login.f.id,
1866
- f_operator: this.$login.f.name,
1867
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1868
- f_orgid: this.$login.f.orgid,
1869
- f_orgname: this.$login.f.orgs
1870
- }
1871
- this.show_data.onetomany[index].fields.forEach(item => {
1872
- data[item.field] = item.value
1873
- })
1874
- let res = await this.$resetpost(
1875
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1876
- data
1877
- )
1878
-
1879
- res = await this.$resetpost(
1880
- 'rs/entity/t_apply',
1881
- this.show_data
1882
- )
1883
-
1884
- this.$dispatch('breakControl', this.show_data)
1885
- },
1886
- async 'importEvent' (index, table, configName, filepath) {
1887
- let data = {
1888
- selectdata: this.show_data,
1889
- table: table,
1890
- filepath: filepath,
1891
- configName: configName,
1892
- user: this.$login.f
1893
- }
1894
-
1895
- let res = await this.$resetpost(
1896
- `rs/logic/importEvent`,
1897
- data
1898
- )
1899
-
1900
- this.$dispatch('breakControl', this.show_data)
1901
- },
1902
- 'onbutchange' (index) {
1903
-
1904
- },
1905
- 'onbutblur' (index) {
1906
-
1907
- },
1908
- 'onbutinput' (index) {
1909
-
1910
-
1911
- }
1912
- },
1913
- watch: {
1914
- }
1915
- }
1916
- </script>
1917
- <style scoped>
1918
- /*清除model中的浮动*/
1919
- .clearfix:after,.clearfix:before{
1920
- display: table;
1921
- }
1922
- .clearfix:after{
1923
- clear: both;
1924
- }
1925
- </style>
1
+ <template>
2
+ <div class="" v-if="showview">
3
+ <show-back-reason :selectdata="show_data"></show-back-reason>
4
+ <service-view v-ref:serviceview :data="show_data"></service-view>
5
+ </div>
6
+ </template>
7
+ <script>
8
+ import Vue from 'vue'
9
+ import {HttpResetClass} from 'vue-client'
10
+ import {isEmpty} from "../../../components/Util";
11
+
12
+ // Date格式化
13
+ Date.prototype.Format = function (fmt) {
14
+ var o = {
15
+ "M+": this.getMonth() + 1, //月份
16
+ "d+": this.getDate(), //日
17
+ "H+": this.getHours(), //小时
18
+ "m+": this.getMinutes(), //分
19
+ "s+": this.getSeconds(), //秒
20
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
21
+ "S": this.getMilliseconds() //毫秒
22
+ };
23
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
24
+ for (var k in o)
25
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
26
+ return fmt;
27
+ }
28
+
29
+ export default {
30
+ title: '报建流程业务控制层',
31
+ props: ['selectdata'],
32
+ data () {
33
+ return {
34
+ data: null, // 数据库数据,json配置文件数据的数据集合
35
+ json_datas: null, // Json配置文件集合
36
+ showview: false, // 控制显示service-view组件
37
+ show_data: null, // 给view层显示的数据
38
+ config: {},
39
+ Pricetype:''
40
+ }
41
+ },
42
+ ready () {
43
+ this.refurbish()
44
+ },
45
+ methods: {
46
+ async servicer(){
47
+ let data = {
48
+ tablename: 't_user',
49
+ condition: `1=1`
50
+ }
51
+ let http = new HttpResetClass()
52
+ let res = await http.load(
53
+ 'POST',
54
+ `rs/sql/apply_singleTable`,
55
+ {data: data},
56
+ {resolveMsg: null, rejectMsg: '服务人查询失败!!!'}
57
+ )
58
+ this.setLabelOptions('服务人', res.data.map(item => {
59
+ return {
60
+ label: item.name,
61
+ value: item.name
62
+ }
63
+ }))
64
+ },
65
+ async ceshi(){
66
+ for (let i = 0; i < this.show_data.fields.length; i++) {
67
+ if (this.show_data.defname==='报装申请' && this.show_data.fields[i].label === '合同编号') {
68
+ let http2 = new HttpResetClass()
69
+ let applyNum = await http2.load('POST', 'rs/logic/getProjectNo', {
70
+ data: {
71
+ f_filiale: this.$login.f.orgs,
72
+ f_order_id: this.selectdata.f_order_id
73
+ }
74
+ }, {resolveMsg: null, rejectMsg: null})
75
+ console.log("生成的合同编号为:" + applyNum.data)
76
+ this.show_data.fields[i].value = applyNum.data
77
+ }
78
+ }
79
+ },
80
+
81
+ // 组件初始化操作
82
+ async refurbish() {
83
+ this.json_datas = this.$workflow_vue
84
+ let sum = 0
85
+ let jsonData = {}
86
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
87
+ this.$showMessage("网络故障,请刷新页面")
88
+ return
89
+ }
90
+ this.json_datas.activitys.forEach(item => {
91
+ if (this.selectdata.defname === item.title) {
92
+ jsonData = item // 拿到当前节点的json配置信息
93
+ sum++ // 节点名一样的个数
94
+ }
95
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
96
+ })
97
+
98
+ if (sum === 0) {
99
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
100
+ return
101
+ }
102
+ if (sum > 1) {
103
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
104
+ return
105
+ }
106
+
107
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
108
+
109
+ // fields 字段填充值
110
+ for (const item of this.selectdata.fields) {
111
+ if (!item.value) {
112
+ item.value = null
113
+ }
114
+ if(this.selectdata.f_apply_type === '集体报建' && this.selectdata.defname === '报装缴费'){
115
+ if(item.label === '未结总金额'){
116
+ item.value = this.selectdata.f_due_money - this.selectdata.f_cumulative_payment_money
117
+ }
118
+ if(item.label === '付款比例'){
119
+ item.value = (this.selectdata.f_cumulative_payment_money/this.selectdata.f_due_money * 100) + '%'
120
+ }
121
+ }
122
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
123
+ if (item.eval) {
124
+ item.value = eval(item.default)
125
+ } else {
126
+ item.value = item.default
127
+ }
128
+ }
129
+
130
+ if (this.selectdata[item.field]) {
131
+ // 将json字符串格式化赋值给value
132
+ if (String(this.selectdata[item.field]).startsWith("{")) {
133
+ item.value = JSON.parse(this.selectdata[item.field])
134
+ } else {
135
+ item.value = this.selectdata[item.field]
136
+ }
137
+ }
138
+ if (this.selectdata[item.field] === 0) {
139
+ item.value = 0
140
+ }
141
+
142
+ // datepicker
143
+ if (item.type === 'datepicker' && !item.value && item.default) {
144
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
145
+ }
146
+ // 如果配置类型为select,优先从参数列表获取options
147
+ if (item.type === 'select' || item.type === 'checkbox') {
148
+ if (item.param) {
149
+ let temp = this.$appdata.getParam(item.label)
150
+
151
+ if (temp && temp.length > 0) {
152
+ item.options = temp
153
+ }
154
+
155
+ if (item.paramLabel) {
156
+ temp = this.$appdata.getParam(item.paramLabel)
157
+ if (temp && temp.length > 0) {
158
+ item.options = temp
159
+ }
160
+ }
161
+ }
162
+
163
+ if (item.ready) {
164
+ console.log(item.ready)
165
+ item.options = await this[item.ready]()
166
+
167
+ }
168
+ }
169
+
170
+
171
+ if (item.type === 'checkbox') {
172
+ if (this.selectdata[item.field]) {
173
+ item.value = JSON.parse(this.selectdata[item.field])
174
+ } else {
175
+ item.value = []
176
+ }
177
+ }
178
+
179
+ this.selectdata[item.field] = item.value
180
+ }
181
+
182
+ // 控制组件
183
+ if (this.selectdata.components) {
184
+ this.selectdata.components.forEach(item => {
185
+ if (!item.mark) {
186
+ item.mark = 0
187
+ }
188
+ })
189
+ }
190
+ // 初始化onetomany
191
+ if (this.selectdata.onetomany) {
192
+ for (const item of this.selectdata.onetomany) {
193
+ let res = null
194
+ if (item.queryEvent) {
195
+ res = this[item.queryEvent]()
196
+ } else {
197
+ let data = {
198
+ tablename: item.tables[0],
199
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
200
+ }
201
+ res = await this.$resetpost(
202
+ 'rs/sql/apply_singleTable',
203
+ {data: data},
204
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
205
+ )
206
+ }
207
+
208
+ item.rows = res.data
209
+
210
+ // 初始化onetomany中的fields
211
+ for (const field of item.fields) {
212
+ if (!field.value) {
213
+ if (field.value !== 0) {
214
+ field.value = null
215
+ }
216
+ }
217
+
218
+ if (field.default || field.default === 0) {
219
+ field.value = field.default
220
+ }
221
+
222
+ // datepicker
223
+ if (field.type === 'datepicker' && !field.value && field.default) {
224
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
225
+ }
226
+
227
+ if (field.type === 'select') {
228
+
229
+ let temp = this.$appdata.getParam(field.label)
230
+
231
+ if (temp && temp.length > 0) {
232
+ field.options = temp
233
+ }
234
+
235
+ if (field.paramLabel) {
236
+ temp = this.$appdata.getParam(field.paramLabel)
237
+ if (temp && temp.length > 0) {
238
+ item.options = temp
239
+ }
240
+ }
241
+ }
242
+ }
243
+ }
244
+ }
245
+ // 初始化 buttons_fields
246
+ for (const item of this.selectdata.buttons) {
247
+ if (item.button_name === '下发') {
248
+
249
+ let data = {
250
+ source: item.source,
251
+ userid: this.$login.f.id
252
+ }
253
+ if (item.sourceMethod) {
254
+ data.source = this[item.sourceMethod]()
255
+ }
256
+ if (!data.source) {
257
+ this.$showMessage("请配置获取人员表达式")
258
+ return
259
+ }
260
+
261
+ let res = await this.$resetpost(
262
+ 'rs/search',
263
+ {data: data},
264
+ {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
265
+ )
266
+
267
+ let options = res.data.map(source => {
268
+ return {
269
+ "label": source.name,
270
+ "value": source.id
271
+ }
272
+ })
273
+
274
+ if (item.button_fields.length !== 1) {
275
+ this.$showMessage("下发有且只能有一个字段!!!")
276
+ return
277
+ }
278
+
279
+ item.button_fields[0].options = options
280
+ }
281
+ if (item.button_fields) {
282
+ item.button_fields.forEach(x => {
283
+ // 如果配置类型为select,优先从参数列表获取options
284
+ if (x.type === 'select') {
285
+
286
+ if (x.param) {
287
+ let temp = this.$appdata.getParam(x.label)
288
+
289
+ if (temp && temp.length > 0) {
290
+ x.options = temp
291
+ }
292
+
293
+ if (x.paramLabel) {
294
+ temp = this.$appdata.getParam(x.paramLabel)
295
+ if (temp && temp.length > 0) {
296
+ x.options = temp
297
+ }
298
+ }
299
+ }
300
+
301
+ }
302
+ })
303
+ }
304
+ }
305
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
306
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
307
+ console.log('打印下temp',temp)
308
+ this.show_data = temp
309
+ this.$nextTick(() => {
310
+ this.showview = true
311
+ })
312
+ },
313
+ // 金额转大写
314
+ smalltoBIG(n) {
315
+ let fraction = ['角', '分'];
316
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
317
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
318
+ let head = n < 0 ? '欠' : '';
319
+ n = Math.abs(n);
320
+
321
+ let s = '';
322
+
323
+ for (var i = 0; i < fraction.length; i++) {
324
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
325
+ }
326
+ s = s || '整';
327
+ n = Math.floor(n);
328
+
329
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
330
+ let p = '';
331
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
332
+ p = digit[n % 10] + unit[1][j] + p;
333
+ n = Math.floor(n / 10);
334
+ }
335
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
336
+ }
337
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
338
+ },
339
+ getLableValue(label) {
340
+ for (const item of this.show_data.fields) {
341
+ if (item.label === label && item.type !== 'number') {
342
+ return item.value || ''
343
+ }
344
+ if (item.label === label && item.type === 'number') {
345
+ return item.value || 0
346
+ }
347
+ }
348
+ },
349
+ getLableOptions(label) {
350
+ for (const item of this.show_data.fields) {
351
+ if (item.label === label) {
352
+ return item.options
353
+ }
354
+ }
355
+ },
356
+ setLabelValue(label, value) {
357
+ for (const item of this.show_data.fields) {
358
+ if (item.label === label) {
359
+ item.value = value
360
+ this.show_data[item.field] = value
361
+ }
362
+ }
363
+ },
364
+ setLabelOptions(label, options) {
365
+ for (const item of this.show_data.fields) {
366
+ if (item.label === label) {
367
+ item.options = options
368
+ }
369
+ }
370
+ },
371
+ showLabels(...labels) {
372
+ for (const item of this.show_data.fields) {
373
+ if (labels.includes(item.label)) {
374
+ item.hidden = false
375
+ }
376
+ }
377
+ },
378
+ hideLabels(...labels) {
379
+ for (const item of this.show_data.fields) {
380
+ if (labels.includes(item.label)) {
381
+ item.hidden = true
382
+ }
383
+ }
384
+ },
385
+ requiredLabels(...labels) {
386
+ for (const item of this.show_data.fields) {
387
+ if (labels.includes(item.label)) {
388
+ item.required = true
389
+ }
390
+ }
391
+ },
392
+ electiveLabels(...labels) {
393
+ for (const item of this.show_data.fields) {
394
+ if (labels.includes(item.label)) {
395
+ item.required = false
396
+ }
397
+ }
398
+ },
399
+ readonlyLabels(...labels) {
400
+ for (const item of this.show_data.fields) {
401
+ if (labels.includes(item.label)) {
402
+ item.readonly = true
403
+ item.disabled = true
404
+ }
405
+ }
406
+ },
407
+ readwriteLabels(...labels) {
408
+ for (const item of this.show_data.fields) {
409
+ if (labels.includes(item.label)) {
410
+ item.readonly = false
411
+ item.disabled = false
412
+ }
413
+ }
414
+ },
415
+ disabledButtons(...buttons) {
416
+ for (const item of this.show_data.buttons) {
417
+ if (buttons.includes(item.button_name)) {
418
+ item.disabled = true
419
+ }
420
+ }
421
+ },
422
+ enableButtons(...buttons) {
423
+ for (const item of this.show_data.buttons) {
424
+ if (buttons.includes(item.button_name)) {
425
+ item.disabled = false
426
+ }
427
+ }
428
+ },
429
+ showButtons(...buttons) {
430
+ for (const item of this.show_data.buttons) {
431
+ if (buttons.includes(item.button_name)) {
432
+ item.hidden = false
433
+ }
434
+ }
435
+ },
436
+ hideButtons(...buttons) {
437
+ for (const item of this.show_data.buttons) {
438
+ if (buttons.includes(item.button_name)) {
439
+ item.hidden = true
440
+ }
441
+ }
442
+ },
443
+ async checkDuplicate(index) {
444
+ let http = new HttpResetClass()
445
+ let data = {
446
+ tablename: 't_apply',
447
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
448
+ }
449
+ let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
450
+ resolveMsg: null,
451
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
452
+ })
453
+ if (res.data.length > 0) {
454
+ this.show_data.fields[index].value = null
455
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
456
+ }
457
+ },
458
+ // 获取片区
459
+ async getSliceArea () {
460
+ let data = {
461
+ tablename: 't_zone',
462
+ condition: `f_orgid = '${this.$login.f.orgid}'`
463
+ }
464
+ let http = new HttpResetClass()
465
+ let res = await http.load(
466
+ 'POST',
467
+ `rs/sql/apply_singleTable`,
468
+ {data: data},
469
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
470
+ )
471
+
472
+ return res.data.map(item => {
473
+ return {
474
+ label: item.name,
475
+ value: item.name
476
+ }
477
+ })
478
+ },
479
+ // 获取区县
480
+ async getPcd () {
481
+ let data = {
482
+ tablename: 't_pcd',
483
+ condition: `f_orgid = '${this.$login.f.orgid}'`
484
+ }
485
+ let http = new HttpResetClass()
486
+ let res = await http.load(
487
+ 'POST',
488
+ `rs/sql/apply_singleTable`,
489
+ {data: data},
490
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
491
+ )
492
+
493
+ return res.data.map(item => {
494
+ return {
495
+ label: item.f_pcd,
496
+ value: item.f_pcd
497
+ }
498
+ })
499
+ },
500
+ // 获取集收单位
501
+ async getArea () {
502
+ let data = {
503
+ tablename: 't_area',
504
+ condition: `f_orgid = '${this.$login.f.orgid}'`
505
+ }
506
+ let http = new HttpResetClass()
507
+ let res = await http.load(
508
+ 'POST',
509
+ `rs/sql/apply_singleTable`,
510
+ {data: data},
511
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
512
+ )
513
+
514
+ return res.data.map(item => {
515
+ return {
516
+ label: item.f_residential_area,
517
+ value: item.f_residential_area
518
+ }
519
+ })
520
+ },
521
+ // 缴费前置
522
+ chargeBefore () {
523
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
524
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
525
+ throw null
526
+ }
527
+ },
528
+ // 施工前置 加表具后状态是待开通 提交后是正常 所以这里的判断条件需改正 (and uf.f_meter_classify is null and f_meternumber is null)
529
+ async constructionBefore () {
530
+ let http = new HttpResetClass()
531
+ let data = {
532
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_meter_classify is null and f_meternumber is null`
533
+ }
534
+ let res = await http.load(
535
+ 'POST',
536
+ 'rs/sql/countApplyUserinfo',
537
+ {data: data},
538
+ {
539
+ resolveMsg: null,
540
+ rejectMsg: '安装明细查询失败!!!'
541
+ })
542
+ if (res.data[0].num > 0) {
543
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
544
+ throw `还有${res.data[0].num}户未安装,无法提交`
545
+ }
546
+ },
547
+ changePipeBuild () {
548
+ if (this.selectdata.f_process_dep === '工程部') {
549
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
550
+ }
551
+ if (this.selectdata.f_process_dep === '运营部') {
552
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
553
+ }
554
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
555
+ },
556
+ // async getDevInfo () {
557
+ // let data = {
558
+ // tablename: 't_dev_info',
559
+ // condition: `f_orgid = '${this.$login.f.orgid}'`
560
+ // }
561
+ // let http = new HttpResetClass()
562
+ // let res = await http.load(
563
+ // 'POST',
564
+ // `rs/sql/apply_singleTable`,
565
+ // {data: data},
566
+ // {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
567
+ // )
568
+ //
569
+ // return res.data.map(item => {
570
+ // return {
571
+ // label: item.f_dev_name,
572
+ // value: item.f_dev_name
573
+ // }
574
+ // })
575
+ // },
576
+ async getPrice (f_price_id) {
577
+ console.log('=======================')
578
+ console.log(f_price_id)
579
+
580
+ let data = {
581
+ condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
582
+ }
583
+ // if(this.Pricetype==='机表'){
584
+ // data.condition=`sp.f_custom = '机表'`
585
+ // }
586
+ // if(this.Pricetype==='非机表'){
587
+ // data.condition=`sp.f_custom = '非机表'`
588
+ // }
589
+
590
+ if (!isEmpty(f_price_id)) {
591
+ data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
592
+ }
593
+ let http = new HttpResetClass()
594
+ let res = await http.load(
595
+ 'POST',
596
+ `rs/sql/applyGetPrice`,
597
+ {data: data},
598
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
599
+ )
600
+
601
+ let a= res.data.map(item => {
602
+ return {
603
+ label: item.f_price_name,
604
+ value: item
605
+ }
606
+ })
607
+ this.selectdata.fields.forEach(field => {
608
+ if (field.label === '气价名称') {
609
+ field.options = a}
610
+ })
611
+ return a
612
+ },
613
+ addressInitialization () {
614
+ this.$getConfig(this, 'UserAddress')
615
+
616
+ let f_address_type = this.show_data.f_address_type
617
+
618
+ for (const item of this.show_data.fields) {
619
+ if (f_address_type === '民用市区') {
620
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
621
+ item.hidden = false
622
+ item.required = true
623
+ }
624
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
625
+ item.hidden = false
626
+ item.required = false
627
+ }
628
+ if (item.label === '地址') {
629
+ item.readonly = true
630
+ }
631
+ }
632
+ if (f_address_type === '民用乡镇') {
633
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
634
+ item.hidden = false
635
+ item.required = true
636
+ }
637
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
638
+ item.hidden = false
639
+ item.required = false
640
+ }
641
+ if (item.label === '楼层') {
642
+ item.hidden = true
643
+ item.required = false
644
+ }
645
+ if (item.label === '地址') {
646
+ item.readonly = true
647
+ }
648
+ }
649
+ if (f_address_type === '特殊地址') {
650
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
651
+ item.hidden = false
652
+ item.required = true
653
+ }
654
+ if (item.label === '集收单位') {
655
+ item.hidden = false
656
+ if (this.show_data.f_apply_type === '工商户报建'){
657
+ item.required = false
658
+ } else {
659
+ item.required = false
660
+ }
661
+
662
+ }
663
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
664
+ item.hidden = true
665
+ item.required = false
666
+ }
667
+ if (item.label === '地址') {
668
+ item.readonly = false
669
+ }
670
+ }
671
+
672
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
673
+ item.hidden = true
674
+ }
675
+ }
676
+ },
677
+ async streetChange () {
678
+ if (isEmpty(this.show_data.f_street)) {
679
+ return
680
+ }
681
+
682
+ let data = {
683
+ tablename: 't_area',
684
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
685
+ }
686
+ let http = new HttpResetClass()
687
+ let res = await http.load(
688
+ 'POST',
689
+ `rs/sql/apply_singleTable`,
690
+ {data: data},
691
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
692
+ )
693
+
694
+ this.setLabelOptions('集收单位', res.data.map(item => {
695
+ return {
696
+ label: item.f_residential_area,
697
+ value: item.f_residential_area
698
+ }
699
+ }))
700
+ },
701
+ async pcdChange () {
702
+ if (isEmpty(this.show_data.f_pcd)) {
703
+ return
704
+ }
705
+
706
+ let data = {
707
+ tablename: 't_street',
708
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
709
+ }
710
+ let f_address_type = this.getLableValue('地址类型')
711
+
712
+ if (f_address_type === '民用市区') {
713
+ data.condition = `f_orgid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
714
+ }
715
+ if (f_address_type === '民用乡镇') {
716
+ data.condition = `f_orgid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
717
+ }
718
+
719
+ let http = new HttpResetClass()
720
+ let res = await http.load(
721
+ 'POST',
722
+ `rs/sql/apply_singleTable`,
723
+ {data: data},
724
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
725
+ )
726
+
727
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
728
+ return {
729
+ label: item.f_street,
730
+ value: item.f_street
731
+ }
732
+ }))
733
+ },
734
+ async addressTips () {
735
+ // console.log('======================='+this.show_data.f_apply_type)
736
+ let res = ''
737
+ if (this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') {
738
+ res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
739
+ }else{
740
+ res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
741
+ }
742
+ if (res == 'confirm') {
743
+ return
744
+ }
745
+ throw '用户信息确认!!!'
746
+ },
747
+ async getDesignerPeople () {
748
+ let data = {
749
+ source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
750
+ userid: this.$login.f.id
751
+ }
752
+
753
+ let http = new HttpResetClass()
754
+ let res = await http.load(
755
+ 'POST',
756
+ `rs/search`,
757
+ {data: data},
758
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
759
+ )
760
+
761
+ return res.data.map(item => {
762
+ return {
763
+ label: item.name,
764
+ value: item.id
765
+ }
766
+ })
767
+ },
768
+ async surveyStopApply () {
769
+ console.log('终止报建!!!!!')
770
+
771
+ this.show_data.f_stop_reason = '现场勘察不符合报装条件'
772
+
773
+ let data = {
774
+ data: this.show_data,
775
+ user: this.$login.f
776
+ }
777
+
778
+ let res = await this.$resetpost(
779
+ `rs/logic/surveyStopApply`,
780
+ {data: data},
781
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
782
+ )
783
+
784
+ this.$dispatch('loadPage')
785
+
786
+ throw '终止报建!!!'
787
+ },
788
+ async contract_number() {
789
+ console.log("进入编号合同编号生成",this.$login.f.orgs)
790
+ let f_contract_number = ''
791
+ const nowDate = new Date();
792
+ const date = {
793
+ year: nowDate.getFullYear(),
794
+ month: nowDate.getMonth() + 1,
795
+ day: nowDate.getDate()
796
+ }
797
+
798
+ function upperCaseChars(dir) {
799
+ let string = '';
800
+ switch (dir){
801
+ case '周口市天然气有限公司':
802
+ string = 'ZK' // 当表达式的结果等于 房产 时,则执行该代码
803
+ break;
804
+ case '项城市天然气有限公司':
805
+ string = "XC" // 当表达式的结果等于 自建房 时,则执行该代码
806
+ break;
807
+ case '西华县天然气有限公司':
808
+ string = 'XH' // 当表达式的结果等于 商业 时,则执行该代码
809
+ break;
810
+ case '鹿邑县天然气有限公司':
811
+ string = 'LY' // 当表达式的结果等于 工业 时,则执行该代码
812
+ break;
813
+ case '郸城县天然气有限公司':
814
+ string = 'DC' // 当表达式的结果等于 中压 时,则执行该代码
815
+ break;
816
+ case '测试公司(一)':
817
+ string = 'CS' // 当表达式的结果等于 中压 时,则执行该代码
818
+ break;
819
+ case '甘泉县丰源天然气有限责任公司':
820
+ string = 'GQ' // 当表达式的结果等于 中压 时,则执行该代码
821
+ break;
822
+ default : 'HT'
823
+ break; // 如果没有与表达式相同的公司,则执行该代码
824
+ }
825
+ return string;
826
+ }
827
+
828
+ const dir = upperCaseChars(this.$login.f.orgs) //分公司
829
+
830
+ let type = 0 //类型
831
+
832
+ switch (this.show_data.f_entry_type){
833
+ case '城区/县城':
834
+ type = 1 // 当表达式的结果等于 城区 时,则执行该代码
835
+ break;
836
+ case '新农村':
837
+ type = 2 // 当表达式的结果等于 新农村 时,则执行该代码
838
+ break;
839
+ case '测试':
840
+ type = 3 // 当表达式的结果等于 新农村 时,则执行该代码
841
+ break;
842
+ default :
843
+ break; // 如果没有与表达式相同的值,则执行该代码
844
+ }
845
+
846
+ let nature = 0 // 性质
847
+ switch (this.show_data.f_apply_nature){
848
+ case '楼房':
849
+ nature = 1 // 当表达式的结果等于 楼房 时,则执行该代码
850
+ break;
851
+ case '房产':
852
+ nature = 1 // 当表达式的结果等于 房产 时,则执行该代码
853
+ break;
854
+ case '自建房':
855
+ nature = 2 // 当表达式的结果等于 自建房 时,则执行该代码
856
+ break;
857
+ case '商业':
858
+ nature = 3 // 当表达式的结果等于 商业 时,则执行该代码
859
+ break;
860
+ case '学校':
861
+ nature = 3 // 当表达式的结果等于 学校 时,则执行该代码
862
+ break;
863
+ case '福利机构':
864
+ nature = 3 // 当表达式的结果等于 福利机构 时,则执行该代码
865
+ break;
866
+ case '其他':
867
+ nature = 3 // 当表达式的结果等于 其他 时,则执行该代码
868
+ break;
869
+ case '工业':
870
+ nature = 4 // 当表达式的结果等于 工业 时,则执行该代码
871
+ break;
872
+ case '中压':
873
+ nature = 5 // 当表达式的结果等于 中压 时,则执行该代码
874
+ break;
875
+ case '测试':
876
+ nature = 6 // 当表达式的结果等于 中压 时,则执行该代码
877
+ break;
878
+ default :
879
+ break; // 如果没有与表达式相同的值,则执行该代码
880
+ }
881
+
882
+ const newMonth = date.month >= 10 ? date.month : '0' + date.month //月份
883
+ const dataYm = date.year + '-01-01'
884
+ const newYear = date.year + 1
885
+ const year = date.year.toString().substring(2,4) //年份
886
+
887
+ let data = {
888
+ orgid: this.$login.f.orgid
889
+ }
890
+
891
+ let http = new HttpResetClass()
892
+ let res = await http.load('POST', 'rs/sql/contractCount', {data:data}, {
893
+ resolveMsg: null,
894
+ rejectMsg: null
895
+ })
896
+ let oldDate
897
+ for (const item of res.data) {
898
+ if (item.name === '合同编号最后更新日期'){
899
+ oldDate = item.value
900
+ }
901
+ }
902
+ for (const item of res.data){
903
+ if (item.name === '合同编号'){
904
+ if (item.value === 0 || Date.parse(oldDate) < Date.parse(dataYm)) {
905
+ f_contract_number = dir + type + nature + year + newMonth + '001'
906
+ console.log("触发if", f_contract_number)
907
+ } else {
908
+ let count = item.value
909
+ f_contract_number = dir + type + nature + year + newMonth + this.PrefixInteger(count, 3)
910
+ console.log("触发else", f_contract_number)
911
+ }
912
+ }
913
+ }
914
+ this.selectdata.f_contract_number = f_contract_number
915
+ this.show_data.f_contract_number = f_contract_number
916
+ return f_contract_number
917
+ },
918
+ PrefixInteger(num, n) {
919
+ return (Array(n).join(0) + num).slice(-n);
920
+ },
921
+ // 单价失去焦点
922
+ async priceSum () {
923
+ if (isEmpty(this.show_data.f_price)) {
924
+ return
925
+ }
926
+ let data = {
927
+ operator: '乘',
928
+ num1: this.show_data.f_price,
929
+ num2: this.show_data.f_install_count
930
+ }
931
+ let http = new HttpResetClass()
932
+ let res = await http.load(
933
+ 'POST',
934
+ `rs/logic/compute`,
935
+ {data: data},
936
+ {resolveMsg: null, rejectMsg: '工程材料费计算失败!!!'}
937
+ )
938
+
939
+ this.setLabelValue('工程材料费', res.data)
940
+ },
941
+ },
942
+ events: {
943
+ 'priceType'(index){
944
+ this.Pricetype = this.getLableValue('所属类型')
945
+ console.log('打印方法值',this.getPrice(this.show_data.f_price_id))
946
+ for (const item of this.show_data.fields) {
947
+ if (this.show_data.f_sprice_type !=null && this.show_data.f_sprice_type !='') {
948
+ if(item.label==='气价名称'){
949
+ this.getPrice().then(value =>{
950
+ item.options=value
951
+ })
952
+ console.log('最终',item.options)
953
+ }
954
+ }
955
+ }
956
+ },
957
+ 'complyInstallation' (index) {
958
+ if (this.show_data.f_is_have === '否') {
959
+ this.hideButtons('提交', '出图', '缴费')
960
+ this.showButtons('终止')
961
+ }
962
+ if (this.show_data.f_is_have === '是') {
963
+ this.hideButtons('终止')
964
+ this.showButtons('提交', '出图', '缴费')
965
+ }
966
+ },
967
+ async 'igniteDispatchReadyEvent' () {
968
+ let data = {
969
+ tablename: 'activityins',
970
+ condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
971
+ }
972
+ let http = new HttpResetClass()
973
+ let res = await http.load(
974
+ 'POST',
975
+ `rs/sql/apply_singleTable`,
976
+ {data: data},
977
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
978
+ )
979
+ if (res.data.length <= 0) {
980
+ console.log('+++++++++++++++++++++++++++++')
981
+ console.log('没有施工,不能退回')
982
+ this.hideButtons('退回')
983
+ }
984
+ },
985
+ 'buildReadyEvent' () {
986
+ this.setLabelValue('施工单位', this.$login.f.name)
987
+ this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
988
+ },
989
+ // 选择材料
990
+ async materialNameChenge (index, fieldIndex) {
991
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
992
+
993
+ this.show_data.onetomany[index].fields.forEach(item => {
994
+ if (material[item.field]) {
995
+ item.value = material[item.field]
996
+ }
997
+ })
998
+ },
999
+ // 打开模态框获取材料
1000
+ async 'getMaterialName' (index) {
1001
+ let data = {
1002
+ condition: `1=1`
1003
+ }
1004
+ let http = new HttpResetClass()
1005
+ let res = await http.load(
1006
+ 'POST',
1007
+ `rs/sql/getStockMaterial`,
1008
+ {data: data},
1009
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
1010
+ )
1011
+
1012
+ this.show_data.onetomany[index].fields.forEach(field => {
1013
+ if (field.label === '选择材料') {
1014
+ field.options = res.data.map(item => {
1015
+ return {
1016
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
1017
+ 'value': item
1018
+ }
1019
+ })
1020
+ }
1021
+ })
1022
+ },
1023
+ // 搜索小区
1024
+ async 'searchArea' (area, index) {
1025
+ let data = {
1026
+ tablename: 't_area',
1027
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1028
+ }
1029
+ let http = new HttpResetClass()
1030
+ let res = await http.load(
1031
+ 'POST',
1032
+ `rs/sql/apply_singleTable`,
1033
+ {data: data},
1034
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1035
+ )
1036
+
1037
+ if (res.data.length === 0) {
1038
+ return
1039
+ }
1040
+
1041
+ this.setLabelOptions('集收单位', res.data.map(item => {
1042
+ return {
1043
+ label: item.f_residential_area,
1044
+ value: item.f_residential_area
1045
+ }
1046
+ }))
1047
+ },
1048
+ // 搜索小区
1049
+ async 'searchAreaCollective' (area, index) {
1050
+ let data = {
1051
+ tablename: 't_area',
1052
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${area}%'`
1053
+ }
1054
+ let http = new HttpResetClass()
1055
+ let res = await http.load(
1056
+ 'POST',
1057
+ `rs/sql/apply_singleTable`,
1058
+ {data: data},
1059
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1060
+ )
1061
+
1062
+ if (res.data.length === 0) {
1063
+ return
1064
+ }
1065
+
1066
+ this.setLabelOptions('集收单位', res.data.map(item => {
1067
+ return {
1068
+ label: item.f_residential_area,
1069
+ value: item.f_residential_area
1070
+ }
1071
+ }))
1072
+ },
1073
+ // 选择气价
1074
+ 'priceChange' (index) {
1075
+ if (isEmpty(this.show_data.stairPrice)) {
1076
+ return
1077
+ }
1078
+
1079
+ let stairPrice = this.getLableValue('气价名称')
1080
+
1081
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
1082
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
1083
+ this.setLabelValue('价格', stairPrice.f_price)
1084
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
1085
+ this.show_data.f_price_id = stairPrice.id
1086
+ this.show_data.f_price_name = stairPrice.f_price_name
1087
+ },
1088
+ // 选择开发商
1089
+ // async 'devInfoChange' (index) {
1090
+ // if (isEmpty(this.show_data.f_company_name)) {
1091
+ // return
1092
+ // }
1093
+ // let data = {
1094
+ // tablename: 't_dev_info',
1095
+ // condition: `f_orgid = '${this.$login.f.orgid}' and f_dev_name = '${this.show_data.f_company_name}'`
1096
+ // }
1097
+ // let res = await this.$resetpost(
1098
+ // `rs/sql/apply_singleTable`,
1099
+ // {data: data},
1100
+ // {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
1101
+ // )
1102
+ // this.show_data.f_dev_id = res.data[0].id
1103
+ // this.show_data.f_dev_code = res.data[0].f_dev_code
1104
+ // this.setLabelValue('法人名称', res.data[0].f_legal_person)
1105
+ // this.setLabelValue('身份证', res.data[0].f_idnumber)
1106
+ // this.setLabelValue('营业执照', res.data[0].f_license_num)
1107
+ // },
1108
+ // 退款金额
1109
+ 'refundMoneyChange' (index) {
1110
+ let f_cumulative_payment_money = this.show_data.f_cumulative_payment_money
1111
+ let f_refund_money = this.show_data.fields[index].value
1112
+
1113
+ if (f_refund_money > f_cumulative_payment_money) {
1114
+ this.$showAlert('退款金额不能大于累计缴费金额!!!', 'warning', 3000)
1115
+ this.show_data.fields[index].value = null
1116
+ }
1117
+ },
1118
+ // 检查重复
1119
+ 'checkRepeat' (index) {
1120
+ this.checkDuplicate(index)
1121
+ },
1122
+ // 选择报建项目
1123
+ 'selectApply' (row) {
1124
+ this.setLabelValue('工程名称', row.f_entry_name)
1125
+ this.setLabelValue('工程编号', row.f_apply_num)
1126
+ this.setLabelValue('报建类型', row.f_apply_type)
1127
+ this.setLabelValue('用户名称', row.f_user_name)
1128
+ this.setLabelValue('用户电话', row.f_phone)
1129
+ this.setLabelValue('证件类型', row.f_credentials)
1130
+ this.setLabelValue('证件号码', row.f_idnumber)
1131
+ this.setLabelValue('地址', row.f_address)
1132
+ this.setLabelValue('累计缴费金额', row.f_cumulative_payment_money)
1133
+
1134
+ this.show_data.parentApply = JSON.parse(JSON.stringify(row))
1135
+
1136
+ delete row.id
1137
+ delete row.actid
1138
+ delete row.defid
1139
+ delete row.defname
1140
+ delete row.version
1141
+ delete row.f_apply_num
1142
+ delete row.f_sub_state
1143
+ delete row.f_apply_type
1144
+ delete row.f_process_id
1145
+
1146
+ this.show_data = Object.assign({}, this.show_data, row)
1147
+
1148
+ this.show_data.f_parent_process_id = this.show_data.parentApply.f_process_id
1149
+ },
1150
+ // 是否终止
1151
+ 'isStopChange' (index) {
1152
+ let f_is_stop = this.show_data.f_is_stop
1153
+
1154
+ for (const item of this.show_data.fields) {
1155
+ if (f_is_stop === '是') {
1156
+ if (item.label === '终止原因') {
1157
+ item.hidden = false
1158
+ item.required = true
1159
+ }
1160
+ } else {
1161
+ if (item.label === '终止原因') {
1162
+ item.hidden = true
1163
+ item.required = false
1164
+ }
1165
+ }
1166
+ }
1167
+ },
1168
+ // 终止报建初始化
1169
+ async 'stopApplyReadyEvent' () {
1170
+
1171
+ let f_is_stop = this.getLableValue('是否终止')
1172
+
1173
+ for (const item of this.show_data.fields) {
1174
+ if (f_is_stop === '是') {
1175
+ if (item.label === '终止原因') {
1176
+ item.hidden = false
1177
+ item.required = true
1178
+ }
1179
+ } else {
1180
+ if (item.label === '终止原因') {
1181
+ item.hidden = true
1182
+ item.required = false
1183
+ }
1184
+ }
1185
+ }
1186
+
1187
+ if (isEmpty(this.show_data.f_parent_process_id)) {
1188
+ return
1189
+ }
1190
+ let data = {
1191
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
1192
+ data: {
1193
+ id: this.$login.f.id,
1194
+ orgid: this.$login.f.orgid
1195
+ }
1196
+ }
1197
+ let res = await this.$resetpost(
1198
+ `rs/sql/supervisory`,
1199
+ {data: data},
1200
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
1201
+ )
1202
+ this.show_data.parentApply = res.data[0]
1203
+ },
1204
+ // 选择用户档案信息
1205
+ 'selectUserinfo' (row) {
1206
+ this.setLabelValue('用户编号', row.f_userinfo_code)
1207
+ this.setLabelValue('用户名称', row.f_user_name)
1208
+ this.setLabelValue('用户电话', row.f_user_phone)
1209
+ this.setLabelValue('证件类型', row.f_credentials)
1210
+ this.setLabelValue('证件号码', row.f_idnumber)
1211
+ this.setLabelValue('地址', row.f_address)
1212
+
1213
+ this.show_data.f_userinfo_id = row.f_userinfo_id
1214
+ this.show_data.f_userinfo_code = row.f_userinfo_code
1215
+ },
1216
+ // 是否购买保险
1217
+ async 'isInsureChange' (index) {
1218
+ if (!this.show_data.f_is_insure) {
1219
+ return
1220
+ }
1221
+ let f_is_insure = this.show_data.f_is_insure
1222
+ for (const item of this.show_data.fields) {
1223
+ if (f_is_insure === '是') {
1224
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1225
+ item.hidden = false
1226
+ item.required = true
1227
+ }
1228
+ if (item.label === '保险备注') {
1229
+ item.hidden = false
1230
+ }
1231
+ } else {
1232
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1233
+ item.hidden = true
1234
+ item.required = false
1235
+ }
1236
+ }
1237
+ }
1238
+ },
1239
+ // 通气点火初始化
1240
+ async 'gasReadyEvent' () {
1241
+ // 是否有气价信息
1242
+ if (!isEmpty(this.show_data.f_price_id)) {
1243
+ let priceList = await this.getPrice(this.show_data.f_price_id)
1244
+ this.setLabelValue('气价名称', priceList[0].value)
1245
+ }
1246
+
1247
+ let data = {
1248
+ tablename: 't_userfees',
1249
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_userinfo_id = '${this.show_data.f_userinfo_id}' and f_state = '待执行'`
1250
+ }
1251
+ let http = new HttpResetClass()
1252
+ let res = await http.load(
1253
+ 'POST',
1254
+ `rs/sql/apply_singleTable`,
1255
+ {data: data},
1256
+ {resolveMsg: null, rejectMsg: '保险查询失败!!!'}
1257
+ )
1258
+ if (res.data.length > 0) {
1259
+ this.setLabelValue('待执行保险', '是')
1260
+ for (const item of this.show_data.fields) {
1261
+ if (item.label === '保费开始日期' || item.label === '是否购买保险' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1262
+ item.hidden = true
1263
+ item.required = false
1264
+ item.value = null
1265
+ }
1266
+ }
1267
+ } else {
1268
+ this.setLabelValue('待执行保险', '否')
1269
+ for (const item of this.show_data.fields) {
1270
+ if (item.label === '是否购买保险' || item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1271
+ item.hidden = false
1272
+ item.required = true
1273
+ }
1274
+ }
1275
+ }
1276
+
1277
+ // 保险初始化显示内容
1278
+ let f_is_insure = this.getLableValue('是否购买保险')
1279
+ for (const item of this.show_data.fields) {
1280
+ if (f_is_insure === '是') {
1281
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
1282
+ item.hidden = false
1283
+ item.required = true
1284
+ }
1285
+ if (item.label === '保险备注') {
1286
+ item.hidden = false
1287
+ }
1288
+ // 本期保费到期时间默认一年
1289
+ if (isEmpty(this.selectdata.f_ins_expiration_date)) {
1290
+ let f_ins_expiration_date = new Date().setFullYear(new Date().getFullYear() + 1)
1291
+ this.setLabelValue("保费结束日期", new Date(f_ins_expiration_date).Format('yyyy-MM-dd'))
1292
+ }
1293
+ }
1294
+ if (f_is_insure === '否') {
1295
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额' || item.label === '保险备注') {
1296
+ item.hidden = true
1297
+ item.required = false
1298
+ }
1299
+ }
1300
+ }
1301
+ },
1302
+ // 合同金额失去焦点
1303
+ async 'contractMoneyChange' (index) {
1304
+ let data = {
1305
+ operator: '加',
1306
+ num1: this.show_data.f_contract_money || 0,
1307
+ num2: this.getLableValue('追加金额') || 0
1308
+ }
1309
+ let res = await this.$resetpost(
1310
+ `rs/logic/compute`,
1311
+ {data: data},
1312
+ {resolveMsg: null, rejectMsg: '金额计算失败!!!'}
1313
+ )
1314
+
1315
+ this.setLabelValue('应交金额', res.data)
1316
+ },
1317
+ // 街道失去焦点
1318
+ async 'streetChange' (index) {
1319
+ if (isEmpty(this.show_data.f_street)) {
1320
+ return
1321
+ }
1322
+
1323
+ this.setLabelValue('集收单位', null)
1324
+
1325
+ let data = {
1326
+ tablename: 't_area',
1327
+ condition: `f_orgid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1328
+ }
1329
+ let http = new HttpResetClass()
1330
+ let res = await http.load(
1331
+ 'POST',
1332
+ `rs/sql/apply_singleTable`,
1333
+ {data: data},
1334
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1335
+ )
1336
+
1337
+ this.setLabelOptions('集收单位', res.data.map(item => {
1338
+ return {
1339
+ label: item.f_residential_area,
1340
+ value: item.f_residential_area
1341
+ }
1342
+ }))
1343
+ },
1344
+ // 区县失去焦点
1345
+ async 'pcdChange' (index) {
1346
+ if (isEmpty(this.show_data.f_pcd)) {
1347
+ return
1348
+ }
1349
+
1350
+ this.setLabelValue('街道/乡镇', null)
1351
+ this.setLabelValue('集收单位', null)
1352
+
1353
+
1354
+
1355
+ let data = {
1356
+ tablename: 't_street',
1357
+ condition: `f_orgid= '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1358
+ }
1359
+ let f_address_type = this.getLableValue('地址类型')
1360
+
1361
+ if (f_address_type === '民用市区') {
1362
+ data.condition = `f_orgid= '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
1363
+ }
1364
+ if (f_address_type === '民用乡镇') {
1365
+ data.condition = `f_orgid= '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
1366
+ }
1367
+
1368
+ let http = new HttpResetClass()
1369
+ let res = await http.load(
1370
+ 'POST',
1371
+ `rs/sql/apply_singleTable`,
1372
+ {data: data},
1373
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
1374
+ )
1375
+
1376
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
1377
+ return {
1378
+ label: item.f_street,
1379
+ value: item.f_street
1380
+ }
1381
+ }))
1382
+ },
1383
+ // 地址类型失去焦点
1384
+ 'addressTypeChange' (index) {
1385
+ this.setLabelValue('街道/乡镇', null)
1386
+ this.setLabelValue('集收单位', null)
1387
+ let f_address_type = this.show_data.fields[index].value
1388
+ for (const item of this.show_data.fields) {
1389
+ if (f_address_type === '民用市区') {
1390
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1391
+ item.hidden = false
1392
+ item.required = true
1393
+ item.value = null
1394
+ }
1395
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1396
+ item.hidden = false
1397
+ item.required = false
1398
+ item.value = null
1399
+ }
1400
+ if (item.label === '地址') {
1401
+ item.readonly = true
1402
+ item.value = null
1403
+ }
1404
+ }
1405
+ if (f_address_type === '民用乡镇') {
1406
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
1407
+ item.hidden = false
1408
+ item.required = true
1409
+ item.value = null
1410
+ }
1411
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
1412
+ item.hidden = false
1413
+ item.required = false
1414
+ item.value = null
1415
+ }
1416
+ if (item.label === '楼层') {
1417
+ item.hidden = true
1418
+ item.required = false
1419
+ item.value = null
1420
+ }
1421
+ if (item.label === '地址') {
1422
+ item.readonly = true
1423
+ item.value = null
1424
+ }
1425
+ }
1426
+ if (f_address_type === '特殊地址') {
1427
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
1428
+ item.hidden = false
1429
+ item.required = true
1430
+ item.value = null
1431
+ }
1432
+ if (item.label === '集收单位') {
1433
+ item.hidden = false
1434
+ item.required = false
1435
+ item.value = null
1436
+ }
1437
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
1438
+ item.hidden = true
1439
+ item.required = false
1440
+ item.value = null
1441
+ }
1442
+ if (item.label === '地址') {
1443
+ item.readonly = false
1444
+ item.value = null
1445
+ }
1446
+ }
1447
+ }
1448
+ },
1449
+ // 团购转散户初始化
1450
+ 'apply2ReadyEvent' () {
1451
+ if (this.show_data.f_apply_source === '线下发起') {
1452
+ this.addressInitialization()
1453
+ this.hideLabels('用户编号')
1454
+ this.electiveLabels('用户编号')
1455
+ this.showLabels('片区', '地址类型')
1456
+ this.requiredLabels('片区', '地址类型')
1457
+ }
1458
+ if (this.show_data.f_apply_source === '自动发起') {
1459
+ this.hideLabels('片区', '地址类型')
1460
+ this.electiveLabels('片区', '地址类型',)
1461
+ }
1462
+ },
1463
+ // 申请节点初始化
1464
+ 'applyReadyEvent' () {
1465
+ this.addressInitialization()
1466
+ this.pcdChange()
1467
+ this.streetChange()
1468
+ },
1469
+ // ===========================================
1470
+ async 'button'() {
1471
+ if (this.show_data.button.before) {
1472
+ await this[this.show_data.button.before]()
1473
+ }
1474
+ // 点击重置按钮就重置数据
1475
+ if (this.show_data.button.button_name === '重置') {
1476
+ this.$dispatch('breakControl', this.selectdata)
1477
+ return
1478
+ }
1479
+
1480
+ this.show_data.user = this.$login.f
1481
+ this.show_data.start_activity = this.$workflow_vue.start_activity
1482
+ this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1483
+
1484
+ if ((this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') && this.show_data.defname === '工程施工' && this.show_data.f_sub_state !='完工' && this.show_data.button.button_name === '完工'){
1485
+ //判断是否添加报警器材料
1486
+ let bjqlag = false
1487
+ let datatemp = {
1488
+ 'bjqid':"",
1489
+ 'fprocessid':"",
1490
+ 'sqvalue':"",
1491
+ 'f_bjq_sid':"",
1492
+ 'f_material_code':"",
1493
+ 'f_bjq_baidu_lng':"",
1494
+ 'f_bjq_baidu_lat':"",
1495
+ 'f_bjq_gaode_lng':"",
1496
+ 'f_bjq_gaode_lat':""
1497
+ }
1498
+
1499
+ let bjqststedata = {
1500
+ "sid":"",
1501
+ "bjqtype":"",
1502
+ "f_process_id":"",
1503
+ "bjqstate":"",
1504
+ "f_userinfo_code":""
1505
+ }
1506
+ let numOne = [];
1507
+
1508
+ let http = new HttpResetClass()
1509
+ let data = {
1510
+ tablename: `t_material_apply`,
1511
+ condition: `f_process_id='${this.show_data.f_process_id}'`
1512
+ }
1513
+ let res = await http.load(
1514
+ 'POST',
1515
+ `rs/sql/apply_singleTable`,
1516
+ {data: data},
1517
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
1518
+ )
1519
+ res.data.forEach(item => {
1520
+ if (item.f_material_name.substr(0,3) === '报警器'){
1521
+ var bjname = item.f_material_name.split("-")
1522
+ bjqststedata.sid = item.f_bjq_sid
1523
+ bjqststedata.f_process_id = item.f_process_id
1524
+ bjqststedata.bjqtype = bjname[1]
1525
+ //====================================
1526
+ bjqlag = true
1527
+ datatemp.bjqid = item.id
1528
+ datatemp.fprocessid = item.f_process_id
1529
+ datatemp.f_bjq_sid = item.f_bjq_sid
1530
+ datatemp.f_material_code = item.f_material_code
1531
+ datatemp.f_bjq_lng = item.f_bjq_lng
1532
+ datatemp.f_bjq_lat = item.f_bjq_lat
1533
+ datatemp.f_bjq_gaode_lng = item.f_bjq_gaode_lng
1534
+ datatemp.f_bjq_gaode_lat = item.f_bjq_gaode_lng
1535
+ datatemp.f_bjq_baidu_lng = item.f_bjq_baidu_lng
1536
+ datatemp.f_bjq_baidu_lat = item.f_bjq_baidu_lat
1537
+ numOne.push(item.f_bjq_sid)
1538
+ }
1539
+ })
1540
+
1541
+ // this.show_data.onetomany.forEach(item=>{
1542
+ // console.log("查看报警器材料",item)
1543
+ // item.rows.forEach(i=>{
1544
+ // if (i.f_material_name.substr(0,3) === '报警器'){
1545
+ // var bjname = i.f_material_name.split("-")
1546
+ // bjqststedata.sid = i.f_bjq_sid
1547
+ // bjqststedata.f_process_id = i.f_process_id
1548
+ // bjqststedata.bjqtype = bjname[1]
1549
+ // //====================================
1550
+ // bjqlag = true
1551
+ // datatemp.bjqid = i.id
1552
+ // datatemp.fprocessid = i.f_process_id
1553
+ // datatemp.f_bjq_sid = i.f_bjq_sid
1554
+ // datatemp.f_material_code = i.f_material_code
1555
+ // numOne.push(i.f_bjq_sid)
1556
+ // }
1557
+ // })
1558
+ // })
1559
+ if (!bjqlag){
1560
+ this.$showMessage('请添加报警器物料信息!!!')
1561
+ return
1562
+ }
1563
+ if (numOne.length > 1){
1564
+ this.$showMessage("暂时支持单个报警器物料安装!!!")
1565
+ return
1566
+ }
1567
+ datatemp.sqvalue = this.show_data.areaData.sqvalue
1568
+ datatemp.f_bjq_baidu_lng = this.show_data.templatlng.baidutemplng
1569
+ datatemp.f_bjq_baidu_lat = this.show_data.templatlng.baidutemplat
1570
+ datatemp.f_bjq_gaode_lng = this.show_data.templatlng.gaodetemplng
1571
+ datatemp.f_bjq_gaode_lat = this.show_data.templatlng.gaodetemplat
1572
+ datatemp.f_bjq_lng = this.show_data.templatlng.baidutemplng
1573
+ datatemp.f_bjq_lat = this.show_data.templatlng.baidutemplat
1574
+
1575
+ bjqststedata.f_userinfo_code = this.show_data.f_userinfo_code
1576
+
1577
+ //判断是否推送 及推送的状态
1578
+ //查询是否存在, 以型号及厂家判断
1579
+ let bjqres = await this.$resetpost(
1580
+ `rs/logic/getbjqsyncinfo`,
1581
+ bjqststedata
1582
+ )
1583
+ if (bjqres.data.bjqstate != "成功"){
1584
+ //区域地址存入材料记录表
1585
+ let areares = await this.$resetpost(
1586
+ `rs/logic/saveArea`,
1587
+ {data: datatemp},
1588
+ {resolveMsg: null, rejectMsg: '区域地址保存失败'}
1589
+ )
1590
+
1591
+ //完工之后推送数据到汉威
1592
+ let adddata = {
1593
+ f_bjq_sid : datatemp.f_bjq_sid,
1594
+ f_material_code : datatemp.f_material_code,
1595
+ f_bjq_address: this.show_data.areaData.sqvalue,
1596
+ f_user_name: this.show_data.f_user_name,
1597
+ f_address: this.show_data.f_address,
1598
+ f_user_phone: this.show_data.f_phone,
1599
+ f_userinfo_code: this.show_data.f_userinfo_code,
1600
+ installtime: this.show_data.f_construction_date,
1601
+ f_orgid : this.show_data.f_orgid,
1602
+ f_bjq_lng: datatemp.f_bjq_baidu_lng,
1603
+ f_bjq_lat: datatemp.f_bjq_baidu_lat
1604
+ }
1605
+ let res = await this.$resetpost(
1606
+ `ncc/rs/logic/bjqadduser`,
1607
+ // `rs/logic/bjqadduser`,
1608
+ adddata
1609
+ )
1610
+ if (res.data.code != 200){
1611
+ if (bjqres.data.bjqstate.length == 0){
1612
+ bjqststedata.bjqstate = "失败"
1613
+ let bjqres3 = await this.$resetpost(
1614
+ `rs/logic/addbjqsyncinfo`,
1615
+ bjqststedata
1616
+ )
1617
+ }
1618
+ this.$showMessage(res.data.msg)
1619
+ return
1620
+ }
1621
+ //更改记录表状态
1622
+ if (bjqres.data.bjqstate === "失败"){
1623
+ bjqststedata.bjqstate = "成功"
1624
+ let bjqres1 = await this.$resetpost(
1625
+ `rs/logic/updatebjqsyncinfo`,
1626
+ bjqststedata
1627
+ )
1628
+ }else{
1629
+ bjqststedata.bjqstate = "成功"
1630
+ let bjqres2 = await this.$resetpost(
1631
+ `rs/logic/addbjqsyncinfo`,
1632
+ bjqststedata
1633
+ )
1634
+ }
1635
+ }
1636
+ }
1637
+ if ((this.show_data.f_apply_type === '工商户报建' || this.show_data.f_apply_type === '团购报建')
1638
+ && (this.show_data.defname === '报装申请') && this.show_data.button.button_name === '提交'){
1639
+ await this.contract_number()
1640
+ }
1641
+ // if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && (this.show_data.button.button_name === '保存'||this.show_data.button.button_name === '提交')){
1642
+ // let dataz = {
1643
+ // condition: `u.id = ${this.show_data.id}`,
1644
+ // data: {
1645
+ // id: this.$login.f.id,
1646
+ // orgid: this.$login.f.orgid
1647
+ // }
1648
+ // }
1649
+ // let http = new HttpResetClass()
1650
+ // let restpz = await http.load(
1651
+ // 'POST',
1652
+ // `rs/sql/checkuser`,
1653
+ // {data: dataz},
1654
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1655
+ // )
1656
+ // this.show_data.actid=restpz.data[0].actid
1657
+ // }
1658
+ let res = await this.$resetpost(
1659
+ `rs/logic/ApplyProductService`,
1660
+ {data: this.show_data},
1661
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1662
+ )
1663
+
1664
+
1665
+ if (this.show_data.button.after) {
1666
+ this[this.show_data.button.after]()
1667
+ }
1668
+ // // 改管报建 增容报建 优化
1669
+ // if((this.show_data.f_apply_type === '改管报建'||this.show_data.f_apply_type === '增容报建') && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '缴费'){
1670
+ // let datagg = {
1671
+ // condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1672
+ // }
1673
+ // let http = new HttpResetClass()
1674
+ // let restgg = await http.load(
1675
+ // 'POST',
1676
+ // `rs/sql/checkusertwo`,
1677
+ // {data: datagg},
1678
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1679
+ // )
1680
+ // debugger
1681
+ // if(this.show_data.f_apply_type === '改管报建'){
1682
+ // restgg.data[0].processname = '改管报建流程'
1683
+ // restgg.data[0].defname = '报装缴费'
1684
+ // }else{
1685
+ // restgg.data[0].processname = '增容报建流程'
1686
+ // restgg.data[0].defname = '报装缴费'
1687
+ // }
1688
+ // restgg.data[0].actid = restgg.data[0].actid + 1
1689
+ // this.$dispatch('apply',restgg.data[0])
1690
+ //
1691
+ // }
1692
+ //
1693
+ // // 退款报建 优化
1694
+ // if(this.show_data.f_apply_type === '退款报建' && this.show_data.defname === '终止报建' && this.show_data.button.button_name === '提交'){
1695
+ // let datatk = {
1696
+ // condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1697
+ // }
1698
+ // let http = new HttpResetClass()
1699
+ // let resttk = await http.load(
1700
+ // 'POST',
1701
+ // `rs/sql/checkusertwo`,
1702
+ // {data: datatk},
1703
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1704
+ // )
1705
+ // debugger
1706
+ // resttk.data[0].processname = '退款报建流程'
1707
+ // resttk.data[0].defname = '退款'
1708
+ // this.$dispatch('apply',resttk.data[0])
1709
+ //
1710
+ // }
1711
+ //
1712
+ //
1713
+ // if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '合同'){
1714
+ // let data = {
1715
+ // tablename: 't_apply',
1716
+ // condition: `f_process_id='${this.show_data.f_process_id}'`
1717
+ // }
1718
+ // let http = new HttpResetClass()
1719
+ // let restp = await http.load(
1720
+ // 'POST',
1721
+ // `rs/sql/apply_singleTable`,
1722
+ // {data: data},
1723
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1724
+ // )
1725
+ // debugger
1726
+ // restp.data[0].processname = '散户报建流程'
1727
+ // restp.data[0].defname = '合同签订'
1728
+ // this.$dispatch('apply',restp.data[0])
1729
+ //
1730
+ // } else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && this.show_data.button.button_name === '提交'){
1731
+ // let data2 = {
1732
+ // condition: `u.id = ${this.show_data.id}`,
1733
+ // data: {
1734
+ // id: this.$login.f.id,
1735
+ // orgid: this.$login.f.orgid
1736
+ // }
1737
+ // }
1738
+ // let http = new HttpResetClass()
1739
+ // let restp1 = await http.load(
1740
+ // 'POST',
1741
+ // `rs/sql/checkuser`,
1742
+ // {data: data2},
1743
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1744
+ // )
1745
+ // debugger
1746
+ // console.log('有没有发请求打印查询的内容restp1',restp1)
1747
+ // // restp1.data[0].processname = '散户报建流程'
1748
+ // // restp1.data[0].defname = '报装缴费'
1749
+ // this.$dispatch('apply',restp1.data[0])
1750
+ // }else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装缴费' && this.show_data.button.button_name === '提交'){
1751
+ // let data3 = {
1752
+ // condition: `u.id = ${this.show_data.id}`,
1753
+ // data: {
1754
+ // id: this.$login.f.id,
1755
+ // orgid: this.$login.f.orgid
1756
+ // }
1757
+ // }
1758
+ // let http = new HttpResetClass()
1759
+ // let restp2 = await http.load(
1760
+ // 'POST',
1761
+ // `rs/sql/checkuser`,
1762
+ // {data: data3},
1763
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1764
+ // )
1765
+ // debugger
1766
+ // console.log('打印查询的内容',restp2)
1767
+ // if(restp2.length>0){
1768
+ // this.$dispatch('apply',restp2.data[0])
1769
+ // }else{
1770
+ // debugger
1771
+ // this.$dispatch('loadPage')
1772
+ // }
1773
+ // }
1774
+ // else{
1775
+ // this.$dispatch('loadPage')
1776
+ // }
1777
+ this.$dispatch('loadPage')
1778
+ },
1779
+ // 失去焦点出触发事件
1780
+ 'onchange' (index) {
1781
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1782
+
1783
+ if (
1784
+ this.show_data.fields[index].label === '区/县' ||
1785
+ this.show_data.fields[index].label === '街道/乡镇' ||
1786
+ this.show_data.fields[index].label === '集收单位' ||
1787
+ this.show_data.fields[index].label === '楼号/组' ||
1788
+ this.show_data.fields[index].label === '单元/排' ||
1789
+ this.show_data.fields[index].label === '楼层' ||
1790
+ this.show_data.fields[index].label === '门牌号'
1791
+ ) {
1792
+
1793
+ let f_pcd = this.getLableValue('区/县') || ''
1794
+ let f_street = this.getLableValue('街道/乡镇') || ''
1795
+ let f_residential_area = this.getLableValue('集收单位') || ''
1796
+ let f_building = this.getLableValue('楼号/组') || ''
1797
+ // let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1798
+ let f_building_suffix = f_building ? '号楼' : ''
1799
+ let f_unit = this.getLableValue('单元/排') || ''
1800
+ // let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1801
+ let f_unit_suffix = f_unit ? '单元' : ''
1802
+ let f_floor = this.getLableValue('楼层') || ''
1803
+ // let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1804
+ let f_floor_suffix = f_floor ? '层' : ''
1805
+ let f_room = this.getLableValue('门牌号') || ''
1806
+ // let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1807
+ let f_room_suffix = f_room ? '室' : ''
1808
+
1809
+ let f_address = f_pcd + f_street + f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
1810
+ this.setLabelValue("地址", f_address)
1811
+ }
1812
+ }
1813
+ },
1814
+ selectSearch (val, index) {},
1815
+ 'onblur' (index) {},
1816
+ 'oninput' (index) {},
1817
+ 'initializtionView' () {},
1818
+ async 'onchangeModal' (index, fieldIndex) {
1819
+ },
1820
+ async 'onblurModal' (index, fieldIndex) {
1821
+
1822
+ },
1823
+ async 'oninputModal' (index, fieldIndex) {
1824
+
1825
+ },
1826
+ async 'onetomanydelete' (index, rowIndex) {
1827
+
1828
+ let http = new HttpResetClass()
1829
+
1830
+ let res = await http.load(
1831
+ 'DELETE',
1832
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1833
+ null,
1834
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1835
+ )
1836
+
1837
+ res = await this.$resetpost(
1838
+ 'rs/entity/t_apply',
1839
+ this.show_data
1840
+ )
1841
+
1842
+ this.$dispatch('breakControl', this.show_data)
1843
+ },
1844
+ async 'onetomanyupdate' (index, rowIndex) {
1845
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1846
+
1847
+ this.show_data.onetomany[index].fields.forEach(item => {
1848
+ data[item.field] = item.value
1849
+ })
1850
+ let res = await this.$resetpost(
1851
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1852
+ data
1853
+ )
1854
+
1855
+ res = await this.$resetpost(
1856
+ 'rs/entity/t_apply',
1857
+ this.show_data
1858
+ )
1859
+
1860
+ this.$dispatch('breakControl', this.show_data)
1861
+ },
1862
+ async 'onetomanyadd' (index) {
1863
+ let data = {
1864
+ f_process_id : this.show_data.f_process_id,
1865
+ f_operator_id: this.$login.f.id,
1866
+ f_operator: this.$login.f.name,
1867
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1868
+ f_orgid: this.$login.f.orgid,
1869
+ f_orgname: this.$login.f.orgs
1870
+ }
1871
+ this.show_data.onetomany[index].fields.forEach(item => {
1872
+ data[item.field] = item.value
1873
+ })
1874
+ let res = await this.$resetpost(
1875
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1876
+ data
1877
+ )
1878
+
1879
+ res = await this.$resetpost(
1880
+ 'rs/entity/t_apply',
1881
+ this.show_data
1882
+ )
1883
+
1884
+ this.$dispatch('breakControl', this.show_data)
1885
+ },
1886
+ async 'importEvent' (index, table, configName, filepath) {
1887
+ let data = {
1888
+ selectdata: this.show_data,
1889
+ table: table,
1890
+ filepath: filepath,
1891
+ configName: configName,
1892
+ user: this.$login.f
1893
+ }
1894
+
1895
+ let res = await this.$resetpost(
1896
+ `rs/logic/importEvent`,
1897
+ data
1898
+ )
1899
+
1900
+ this.$dispatch('breakControl', this.show_data)
1901
+ },
1902
+ 'onbutchange' (index) {
1903
+
1904
+ },
1905
+ 'onbutblur' (index) {
1906
+
1907
+ },
1908
+ 'onbutinput' (index) {
1909
+
1910
+
1911
+ }
1912
+ },
1913
+ watch: {
1914
+ }
1915
+ }
1916
+ </script>
1917
+ <style scoped>
1918
+ /*清除model中的浮动*/
1919
+ .clearfix:after,.clearfix:before{
1920
+ display: table;
1921
+ }
1922
+ .clearfix:after{
1923
+ clear: both;
1924
+ }
1925
+ </style>