apply-clients 3.5.5-10 → 3.5.5-101

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