apply-clients 3.4.64 → 3.4.65

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