apply-clients 3.4.39 → 3.4.51

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 (58) hide show
  1. package/build/dev-server.js +2 -2
  2. package/package.json +1 -1
  3. package/src/android.js +21 -21
  4. package/src/apply.js +113 -113
  5. package/src/applyAndroid.js +53 -53
  6. package/src/components/android/AppServiceView.vue +745 -745
  7. package/src/components/android/AppSign.vue +154 -154
  8. package/src/components/android/Process/AppExplorationUser.vue +507 -507
  9. package/src/components/android/Process/AppServiceControl.vue +1708 -1708
  10. package/src/components/android/Process/Processes/AppAddMaterialScience.vue +477 -477
  11. package/src/components/android/Process/Processes/AppDevicesManagement.vue +519 -519
  12. package/src/components/android/Process/Processes/AppInstallationDetails.vue +482 -482
  13. package/src/components/android/Supervisory/AppSupervisoryCart.vue +156 -156
  14. package/src/components/product/Business/BusinessApply.vue +269 -269
  15. package/src/components/product/Business/CivilApply.vue +269 -269
  16. package/src/components/product/GroupByApply/ApplyGroupByList.vue +253 -253
  17. package/src/components/product/GroupByApply/ApplyGroupByMain.vue +53 -53
  18. package/src/components/product/GroupByApply/ApplyGroupByPaper.vue +376 -376
  19. package/src/components/product/Material/MaterialDetailed.vue +262 -262
  20. package/src/components/product/OldApply/Monitor/MonitorApply.vue +360 -360
  21. package/src/components/product/Print/BuildOrder/printBuildOrder.vue +157 -157
  22. package/src/components/product/Print/IgnitionBill/IgnitionBill.vue +259 -259
  23. package/src/components/product/Print/IgnitionBill/printIgnitionBill.vue +168 -168
  24. package/src/components/product/Process/ExplorationSelect.vue +495 -495
  25. package/src/components/product/Process/ExplorationUser.vue +189 -189
  26. package/src/components/product/Process/Processes/InstallationDetails.vue +610 -610
  27. package/src/components/product/Process/Processes/Print/printCharge.vue +166 -166
  28. package/src/components/product/Process/Processes/addMaterialScience.vue +454 -454
  29. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +211 -211
  30. package/src/components/product/Process/Processes/chargeManagement.vue +656 -656
  31. package/src/components/product/Process/Processes/devicesManagement.vue +484 -484
  32. package/src/components/product/Process/Service/ServiceControl.vue +1918 -1920
  33. package/src/components/product/ServiceView.vue +981 -981
  34. package/src/components/product/Supervisory/SupervisoryControl.vue +137 -137
  35. package/src/components/product/Supervisory/SupervisoryList.vue +404 -404
  36. package/src/components/product/VueUtils/ApplyUpload.vue +275 -280
  37. package/src/filiale/gehua/pc/ExplorationSelect.vue +483 -483
  38. package/src/filiale/gehua/pc/ServiceControl.vue +1929 -1929
  39. package/src/filiale/gehua/pc/SupervisoryControl.vue +137 -137
  40. package/src/filiale/gehua/pc/SupervisoryServiceControl.vue +890 -890
  41. package/src/filiale/gehua/pc/buildOrderList.vue +339 -0
  42. package/src/filiale/gehua/pc/printBuildOrder.vue +243 -0
  43. package/src/filiale/gehua/pc.js +3 -2
  44. package/src/filiale/guangxi/android/Process/AppExplorationUser.vue +503 -503
  45. package/src/filiale/guangxi/android/Process/Processes/AppAddMaterialScience.vue +470 -470
  46. package/src/filiale/guangxi/android/Process/Processes/AppDevicesManagement.vue +519 -519
  47. package/src/filiale/guangxi/android/Process/Processes/AppInstallationDetails.vue +482 -482
  48. package/src/filiale/guangxi/android/Process/Processes/AppServiceControl.vue +1708 -1708
  49. package/src/filiale/guangxi/android/Process/Processes/AppServiceView.vue +766 -766
  50. package/src/filiale/guangxi/android.js +9 -9
  51. package/src/filiale/guangxi/pc/ApplyCharge/ApplyChargeList.vue +470 -470
  52. package/src/filiale/guangxi/pc/ApplyCharge/chargeManagement.vue +702 -702
  53. package/src/filiale/guangxi/pc/Process/ExplorationSelect.vue +538 -538
  54. package/src/filiale/guangxi/pc/Process/Service/ServiceControl.vue +1922 -1922
  55. package/src/filiale/guangxi/pc/Process/Service/SupervisoryServiceControl.vue +891 -891
  56. package/src/filiale/guangxi/pc/Process/Service/addMaterialScience.vue +482 -482
  57. package/src/filiale/guangxi/pc.js +15 -15
  58. package/src/main.js +1 -4
@@ -1,1929 +1,1929 @@
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
- this.servicer()
45
- this.ceshi()
46
- debugger
47
- },
48
- methods: {
49
- async servicer(){
50
- let data = {
51
- tablename: 't_user',
52
- condition: `1=1`
53
- }
54
- let http = new HttpResetClass()
55
- let res = await http.load(
56
- 'POST',
57
- `rs/sql/singleTable`,
58
- {data: data},
59
- {resolveMsg: null, rejectMsg: '服务人查询失败!!!'}
60
- )
61
- this.setLabelOptions('服务人', res.data.map(item => {
62
- return {
63
- label: item.name,
64
- value: item.name
65
- }
66
- }))
67
- },
68
- async ceshi(){
69
- for (let i = 0; i < this.show_data.fields.length; i++) {
70
- if (this.show_data.defname==='报装申请' && this.show_data.fields[i].label === '合同编号') {
71
- debugger
72
- let http2 = new HttpResetClass()
73
- let applyNum = await http2.load('POST', 'rs/logic/getProjectNo', {
74
- data: {
75
- f_filiale: this.$login.f.orgs,
76
- f_order_id: this.selectdata.f_order_id
77
- }
78
- }, {resolveMsg: null, rejectMsg: null})
79
- debugger
80
- console.log("生成的合同编号为:" + applyNum.data)
81
- this.show_data.fields[i].value = applyNum.data
82
- }
83
- }
84
- },
85
- async servicer(){
86
- debugger
87
- let data = {
88
- tablename: 't_user',
89
- condition: `1=1`
90
- }
91
- let http = new HttpResetClass()
92
- let res = await http.load(
93
- 'POST',
94
- `rs/sql/singleTable`,
95
- {data: data},
96
- {resolveMsg: null, rejectMsg: '服务人查询失败!!!'}
97
- )
98
- debugger
99
- this.setLabelOptions('服务人', res.data.map(item => {
100
- return {
101
- label: item.name,
102
- value: item.name
103
- }
104
- }))
105
- },
106
- // 组件初始化操作
107
- async refurbish() {
108
- this.json_datas = this.$workflow_vue
109
- let sum = 0
110
- let jsonData = {}
111
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
112
- this.$showMessage("网络故障,请刷新页面")
113
- return
114
- }
115
- this.json_datas.activitys.forEach(item => {
116
- if (this.selectdata.defname === item.title) {
117
- jsonData = item // 拿到当前节点的json配置信息
118
- sum++ // 节点名一样的个数
119
- }
120
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
121
- })
122
-
123
- if (sum === 0) {
124
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
125
- return
126
- }
127
- if (sum > 1) {
128
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
129
- return
130
- }
131
-
132
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
133
-
134
- // fields 字段填充值
135
- for (const item of this.selectdata.fields) {
136
- if (!item.value) {
137
- item.value = null
138
- }
139
-
140
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
141
- if (item.eval) {
142
- item.value = eval(item.default)
143
- } else {
144
- item.value = item.default
145
- }
146
- }
147
-
148
- if (this.selectdata[item.field]) {
149
- // 将json字符串格式化赋值给value
150
- if (String(this.selectdata[item.field]).startsWith("{")) {
151
- item.value = JSON.parse(this.selectdata[item.field])
152
- } else {
153
- item.value = this.selectdata[item.field]
154
- }
155
- }
156
- if (this.selectdata[item.field] === 0) {
157
- item.value = 0
158
- }
159
-
160
- // datepicker
161
- if (item.type === 'datepicker' && !item.value && item.default) {
162
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
163
- }
164
-
165
- // 如果配置类型为select,优先从参数列表获取options
166
- if (item.type === 'select' || item.type === 'checkbox') {
167
- if (item.param) {
168
- let temp = this.$appdata.getParam(item.label)
169
-
170
- if (temp && temp.length > 0) {
171
- item.options = temp
172
- }
173
-
174
- if (item.paramLabel) {
175
- temp = this.$appdata.getParam(item.paramLabel)
176
- if (temp && temp.length > 0) {
177
- item.options = temp
178
- }
179
- }
180
- }
181
-
182
- if (item.ready) {
183
- item.options = await this[item.ready]()
184
- }
185
- }
186
-
187
-
188
- if (item.type === 'checkbox') {
189
- if (this.selectdata[item.field]) {
190
- item.value = JSON.parse(this.selectdata[item.field])
191
- } else {
192
- item.value = []
193
- }
194
- }
195
-
196
- this.selectdata[item.field] = item.value
197
- }
198
-
199
- // 控制组件
200
- if (this.selectdata.components) {
201
- this.selectdata.components.forEach(item => {
202
- if (!item.mark) {
203
- item.mark = 0
204
- }
205
- })
206
- }
207
-
208
- // 初始化onetomany
209
- if (this.selectdata.onetomany) {
210
- for (const item of this.selectdata.onetomany) {
211
- let res = null
212
- if (item.queryEvent) {
213
- res = this[item.queryEvent]()
214
- } else {
215
- let data = {
216
- tablename: item.tables[0],
217
- condition: `f_process_id='${this.selectdata.f_process_id}'`
218
- }
219
- res = await this.$resetpost(
220
- 'rs/sql/singleTable',
221
- {data: data},
222
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
223
- )
224
- }
225
-
226
- item.rows = res.data
227
-
228
- // 初始化onetomany中的fields
229
- for (const field of item.fields) {
230
- if (!field.value) {
231
- if (field.value !== 0) {
232
- field.value = null
233
- }
234
- }
235
-
236
- if (field.default || field.default === 0) {
237
- field.value = field.default
238
- }
239
-
240
- // datepicker
241
- if (field.type === 'datepicker' && !field.value && field.default) {
242
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
243
- }
244
-
245
- if (field.type === 'select') {
246
-
247
- let temp = this.$appdata.getParam(field.label)
248
-
249
- if (temp && temp.length > 0) {
250
- field.options = temp
251
- }
252
-
253
- if (field.paramLabel) {
254
- temp = this.$appdata.getParam(field.paramLabel)
255
- if (temp && temp.length > 0) {
256
- item.options = temp
257
- }
258
- }
259
- }
260
- }
261
- }
262
- }
263
-
264
- // 初始化 buttons_fields
265
- for (const item of this.selectdata.buttons) {
266
- if (item.button_name === '下发') {
267
-
268
- let data = {
269
- source: item.source,
270
- userid: this.$login.f.id
271
- }
272
- if (item.sourceMethod) {
273
- data.source = this[item.sourceMethod]()
274
- }
275
- if (!data.source) {
276
- this.$showMessage("请配置获取人员表达式")
277
- return
278
- }
279
-
280
- let res = await this.$resetpost(
281
- 'rs/search',
282
- {data: data},
283
- {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
284
- )
285
-
286
- let options = res.data.map(source => {
287
- return {
288
- "label": source.name,
289
- "value": source.id
290
- }
291
- })
292
-
293
- if (item.button_fields.length !== 1) {
294
- this.$showMessage("下发有且只能有一个字段!!!")
295
- return
296
- }
297
-
298
- item.button_fields[0].options = options
299
- }
300
- if (item.button_fields) {
301
- item.button_fields.forEach(x => {
302
- // 如果配置类型为select,优先从参数列表获取options
303
- if (x.type === 'select') {
304
-
305
- if (x.param) {
306
- let temp = this.$appdata.getParam(x.label)
307
-
308
- if (temp && temp.length > 0) {
309
- x.options = temp
310
- }
311
-
312
- if (x.paramLabel) {
313
- temp = this.$appdata.getParam(x.paramLabel)
314
- if (temp && temp.length > 0) {
315
- x.options = temp
316
- }
317
- }
318
- }
319
-
320
- }
321
- })
322
- }
323
- }
324
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
325
- let temp = JSON.parse(JSON.stringify(this.selectdata))
326
- console.log('打印下temp',temp)
327
- this.show_data = temp
328
- this.$nextTick(() => {
329
- this.showview = true
330
- })
331
- this.ceshi()
332
- },
333
- // 金额转大写
334
- smalltoBIG(n) {
335
- let fraction = ['角', '分'];
336
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
337
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
338
- let head = n < 0 ? '欠' : '';
339
- n = Math.abs(n);
340
-
341
- let s = '';
342
-
343
- for (var i = 0; i < fraction.length; i++) {
344
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
345
- }
346
- s = s || '整';
347
- n = Math.floor(n);
348
-
349
- for (var i = 0; i < unit[0].length && n > 0; i++) {
350
- let p = '';
351
- for (var j = 0; j < unit[1].length && n > 0; j++) {
352
- p = digit[n % 10] + unit[1][j] + p;
353
- n = Math.floor(n / 10);
354
- }
355
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
356
- }
357
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
358
- },
359
- getLableValue(label) {
360
- for (const item of this.show_data.fields) {
361
- if (item.label === label && item.type !== 'number') {
362
- return item.value || ''
363
- }
364
- if (item.label === label && item.type === 'number') {
365
- return item.value || 0
366
- }
367
- }
368
- },
369
- getLableOptions(label) {
370
- for (const item of this.show_data.fields) {
371
- if (item.label === label) {
372
- return item.options
373
- }
374
- }
375
- },
376
- setLabelValue(label, value) {
377
- for (const item of this.show_data.fields) {
378
- if (item.label === label) {
379
- item.value = value
380
- this.show_data[item.field] = value
381
- }
382
- }
383
- },
384
- setLabelOptions(label, options) {
385
- for (const item of this.show_data.fields) {
386
- if (item.label === label) {
387
- item.options = options
388
- }
389
- }
390
- },
391
- showLabels(...labels) {
392
- for (const item of this.show_data.fields) {
393
- if (labels.includes(item.label)) {
394
- item.hidden = false
395
- }
396
- }
397
- },
398
- hideLabels(...labels) {
399
- for (const item of this.show_data.fields) {
400
- if (labels.includes(item.label)) {
401
- item.hidden = true
402
- }
403
- }
404
- },
405
- requiredLabels(...labels) {
406
- for (const item of this.show_data.fields) {
407
- if (labels.includes(item.label)) {
408
- item.required = true
409
- }
410
- }
411
- },
412
- electiveLabels(...labels) {
413
- for (const item of this.show_data.fields) {
414
- if (labels.includes(item.label)) {
415
- item.required = false
416
- }
417
- }
418
- },
419
- readonlyLabels(...labels) {
420
- for (const item of this.show_data.fields) {
421
- if (labels.includes(item.label)) {
422
- item.readonly = true
423
- item.disabled = true
424
- }
425
- }
426
- },
427
- readwriteLabels(...labels) {
428
- for (const item of this.show_data.fields) {
429
- if (labels.includes(item.label)) {
430
- item.readonly = false
431
- item.disabled = false
432
- }
433
- }
434
- },
435
- disabledButtons(...buttons) {
436
- for (const item of this.show_data.buttons) {
437
- if (buttons.includes(item.button_name)) {
438
- item.disabled = true
439
- }
440
- }
441
- },
442
- enableButtons(...buttons) {
443
- for (const item of this.show_data.buttons) {
444
- if (buttons.includes(item.button_name)) {
445
- item.disabled = false
446
- }
447
- }
448
- },
449
- showButtons(...buttons) {
450
- for (const item of this.show_data.buttons) {
451
- if (buttons.includes(item.button_name)) {
452
- item.hidden = false
453
- }
454
- }
455
- },
456
- hideButtons(...buttons) {
457
- for (const item of this.show_data.buttons) {
458
- if (buttons.includes(item.button_name)) {
459
- item.hidden = true
460
- }
461
- }
462
- },
463
- async checkDuplicate(index) {
464
- let http = new HttpResetClass()
465
- let data = {
466
- tablename: 't_apply',
467
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
468
- }
469
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
470
- resolveMsg: null,
471
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
472
- })
473
- if (res.data.length > 0) {
474
- this.show_data.fields[index].value = null
475
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
476
- }
477
- },
478
- // 获取片区
479
- async getSliceArea () {
480
- let data = {
481
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
482
- userid: this.$login.f.id
483
- }
484
-
485
- let http = new HttpResetClass()
486
- let res = await http.load(
487
- 'POST',
488
- `rs/search`,
489
- {data: data},
490
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
491
- )
492
-
493
- return res.data.map(item => {
494
- return {
495
- label: item.name,
496
- value: item.name
497
- }
498
- })
499
- },
500
- // 获取区县
501
- async getPcd () {
502
- let data = {
503
- tablename: 't_pcd',
504
- condition: `f_filialeid = '${this.$login.f.orgid}'`
505
- }
506
- let http = new HttpResetClass()
507
- let res = await http.load(
508
- 'POST',
509
- `rs/sql/singleTable`,
510
- {data: data},
511
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
512
- )
513
-
514
- return res.data.map(item => {
515
- return {
516
- label: item.f_pcd,
517
- value: item.f_pcd
518
- }
519
- })
520
- },
521
- // 获取集收单位
522
- async getArea () {
523
- let data = {
524
- tablename: 't_area',
525
- condition: `f_filialeid = '${this.$login.f.orgid}'`
526
- }
527
- let http = new HttpResetClass()
528
- let res = await http.load(
529
- 'POST',
530
- `rs/sql/singleTable`,
531
- {data: data},
532
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
533
- )
534
-
535
- return res.data.map(item => {
536
- return {
537
- label: item.f_residential_area,
538
- value: item.f_residential_area
539
- }
540
- })
541
- },
542
- // 缴费前置
543
- chargeBefore () {
544
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
545
- this.$showAlert('费用未结清!!!', 'warning', 3000)
546
- throw null
547
- }
548
- },
549
- // 施工前置 加表具后状态是待开通 提交后是正常 所以这里的判断条件需改正 (and uf.f_meter_classify is null and f_meternumber is null)
550
- async constructionBefore () {
551
- let http = new HttpResetClass()
552
- let data = {
553
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_meter_classify is null and f_meternumber is null`
554
- }
555
- let res = await http.load(
556
- 'POST',
557
- 'rs/sql/countApplyUserinfo',
558
- {data: data},
559
- {
560
- resolveMsg: null,
561
- rejectMsg: '安装明细查询失败!!!'
562
- })
563
- if (res.data[0].num > 0) {
564
- this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
565
- throw `还有${res.data[0].num}户未安装,无法提交`
566
- }
567
- },
568
- changePipeBuild () {
569
- if (this.selectdata.f_process_dep === '工程部') {
570
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
571
- }
572
- if (this.selectdata.f_process_dep === '运营部') {
573
- return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
574
- }
575
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
576
- },
577
- async getDevInfo () {
578
- let data = {
579
- tablename: 't_dev_info',
580
- condition: `f_orgid = '${this.$login.f.orgid}'`
581
- }
582
- let http = new HttpResetClass()
583
- let res = await http.load(
584
- 'POST',
585
- `rs/sql/singleTable`,
586
- {data: data},
587
- {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
588
- )
589
-
590
- return res.data.map(item => {
591
- return {
592
- label: item.f_dev_name,
593
- value: item.f_dev_name
594
- }
595
- })
596
- },
597
- async getPrice (f_price_id) {
598
- console.log('=======================')
599
- console.log(f_price_id)
600
-
601
- let data = {
602
- condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
603
- }
604
- if(this.Pricetype==='机表'){
605
- data.condition=`sp.f_custom = '机表'`
606
- }
607
- if(this.Pricetype==='非机表'){
608
- data.condition=`sp.f_custom = '非机表'`
609
- }
610
-
611
- if (!isEmpty(f_price_id)) {
612
- data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
613
- }
614
- let http = new HttpResetClass()
615
- let res = await http.load(
616
- 'POST',
617
- `rs/sql/applyGetPrice`,
618
- {data: data},
619
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
620
- )
621
-
622
- let a= res.data.map(item => {
623
- return {
624
- label: item.f_price_name,
625
- value: item
626
- }
627
- })
628
- this.selectdata.fields.forEach(field => {
629
- if (field.label === '气价名称') {
630
- field.options = a}
631
- })
632
- return a
633
- },
634
- addressInitialization () {
635
- this.$getConfig(this, 'UserAddress')
636
-
637
- let f_address_type = this.show_data.f_address_type
638
-
639
- for (const item of this.show_data.fields) {
640
- if (f_address_type === '民用市区') {
641
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
642
- item.hidden = false
643
- item.required = true
644
- }
645
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
646
- item.hidden = false
647
- item.required = false
648
- }
649
- if (item.label === '地址') {
650
- item.readonly = true
651
- }
652
- }
653
- if (f_address_type === '民用乡镇') {
654
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
655
- item.hidden = false
656
- item.required = true
657
- }
658
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
659
- item.hidden = false
660
- item.required = false
661
- }
662
- if (item.label === '楼层') {
663
- item.hidden = true
664
- item.required = false
665
- }
666
- if (item.label === '地址') {
667
- item.readonly = true
668
- }
669
- }
670
- if (f_address_type === '特殊地址') {
671
- if (item.label === '区/县' || item.label === '街道/乡镇') {
672
- item.hidden = false
673
- item.required = true
674
- }
675
- if (item.label === '集收单位') {
676
- item.hidden = false
677
- if (this.show_data.f_apply_type === '工商户报建'){
678
- item.required = false
679
- } else {
680
- item.required = false
681
- }
682
-
683
- }
684
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
685
- item.hidden = true
686
- item.required = false
687
- }
688
- if (item.label === '地址') {
689
- item.readonly = false
690
- }
691
- }
692
-
693
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
694
- item.hidden = true
695
- }
696
- }
697
- },
698
- async streetChange () {
699
- if (isEmpty(this.show_data.f_street)) {
700
- return
701
- }
702
-
703
- let data = {
704
- tablename: 't_area',
705
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
706
- }
707
- let http = new HttpResetClass()
708
- let res = await http.load(
709
- 'POST',
710
- `rs/sql/singleTable`,
711
- {data: data},
712
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
713
- )
714
-
715
- this.setLabelOptions('集收单位', res.data.map(item => {
716
- return {
717
- label: item.f_residential_area,
718
- value: item.f_residential_area
719
- }
720
- }))
721
- },
722
- async pcdChange () {
723
- if (isEmpty(this.show_data.f_pcd)) {
724
- return
725
- }
726
-
727
- let data = {
728
- tablename: 't_street',
729
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
730
- }
731
- let f_address_type = this.getLableValue('地址类型')
732
-
733
- if (f_address_type === '民用市区') {
734
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
735
- }
736
- if (f_address_type === '民用乡镇') {
737
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
738
- }
739
-
740
- let http = new HttpResetClass()
741
- let res = await http.load(
742
- 'POST',
743
- `rs/sql/singleTable`,
744
- {data: data},
745
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
746
- )
747
-
748
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
749
- return {
750
- label: item.f_street,
751
- value: item.f_street
752
- }
753
- }))
754
- },
755
- async addressTips () {
756
- // console.log('======================='+this.show_data.f_apply_type)
757
- let res = ''
758
- if (this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') {
759
- res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
760
- }else{
761
- res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
762
- }
763
- if (res == 'confirm') {
764
- return
765
- }
766
- throw '用户信息确认!!!'
767
- },
768
- async getDesignerPeople () {
769
- let data = {
770
- source: 'this.getParentByType($organization$).getChildByName($设计员$).getChildren()',
771
- userid: this.$login.f.id
772
- }
773
-
774
- let http = new HttpResetClass()
775
- let res = await http.load(
776
- 'POST',
777
- `rs/search`,
778
- {data: data},
779
- {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
780
- )
781
-
782
- return res.data.map(item => {
783
- return {
784
- label: item.name,
785
- value: item.id
786
- }
787
- })
788
- },
789
- async surveyStopApply () {
790
- console.log('终止报建!!!!!')
791
-
792
- this.show_data.f_stop_reason = '现场勘察不符合报装条件'
793
-
794
- let data = {
795
- data: this.show_data,
796
- user: this.$login.f
797
- }
798
-
799
- let res = await this.$resetpost(
800
- `rs/logic/surveyStopApply`,
801
- {data: data},
802
- {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
803
- )
804
-
805
- this.$dispatch('loadPage')
806
-
807
- throw '终止报建!!!'
808
- },
809
- async contract_number() {
810
- console.log("进入编号合同编号生成",this.$login.f.orgs)
811
- let f_contract_number = ''
812
- const nowDate = new Date();
813
- const date = {
814
- year: nowDate.getFullYear(),
815
- month: nowDate.getMonth() + 1,
816
- day: nowDate.getDate()
817
- }
818
-
819
- function upperCaseChars(dir) {
820
- let string = '';
821
- switch (dir){
822
- case '周口市天然气有限公司':
823
- string = 'ZK' // 当表达式的结果等于 房产 时,则执行该代码
824
- break;
825
- case '项城市天然气有限公司':
826
- string = "XC" // 当表达式的结果等于 自建房 时,则执行该代码
827
- break;
828
- case '西华县天然气有限公司':
829
- string = 'XH' // 当表达式的结果等于 商业 时,则执行该代码
830
- break;
831
- case '鹿邑县天然气有限公司':
832
- string = 'LY' // 当表达式的结果等于 工业 时,则执行该代码
833
- break;
834
- case '郸城县天然气有限公司':
835
- string = 'DC' // 当表达式的结果等于 中压 时,则执行该代码
836
- break;
837
- case '测试公司(一)':
838
- string = 'CS' // 当表达式的结果等于 中压 时,则执行该代码
839
- break;
840
- default :
841
- break; // 如果没有与表达式相同的值,则执行该代码
842
- }
843
- return string;
844
- }
845
-
846
- const dir = upperCaseChars(this.$login.f.orgs) //分公司
847
-
848
- let type = 0 //类型
849
-
850
- switch (this.show_data.f_entry_type){
851
- case '城区/县城':
852
- type = 1 // 当表达式的结果等于 城区 时,则执行该代码
853
- break;
854
- case '新农村':
855
- type = 2 // 当表达式的结果等于 新农村 时,则执行该代码
856
- break;
857
- case '测试':
858
- type = 3 // 当表达式的结果等于 新农村 时,则执行该代码
859
- break;
860
- default :
861
- break; // 如果没有与表达式相同的值,则执行该代码
862
- }
863
-
864
- let nature = 0 // 性质
865
- switch (this.show_data.f_apply_nature){
866
- case '楼房':
867
- nature = 1 // 当表达式的结果等于 楼房 时,则执行该代码
868
- break;
869
- case '房产':
870
- nature = 1 // 当表达式的结果等于 房产 时,则执行该代码
871
- break;
872
- case '自建房':
873
- nature = 2 // 当表达式的结果等于 自建房 时,则执行该代码
874
- break;
875
- case '商业':
876
- nature = 3 // 当表达式的结果等于 商业 时,则执行该代码
877
- break;
878
- case '学校':
879
- nature = 3 // 当表达式的结果等于 学校 时,则执行该代码
880
- break;
881
- case '福利机构':
882
- nature = 3 // 当表达式的结果等于 福利机构 时,则执行该代码
883
- break;
884
- case '其他':
885
- nature = 3 // 当表达式的结果等于 其他 时,则执行该代码
886
- break;
887
- case '工业':
888
- nature = 4 // 当表达式的结果等于 工业 时,则执行该代码
889
- break;
890
- case '中压':
891
- nature = 5 // 当表达式的结果等于 中压 时,则执行该代码
892
- break;
893
- case '测试':
894
- nature = 6 // 当表达式的结果等于 中压 时,则执行该代码
895
- break;
896
- default :
897
- break; // 如果没有与表达式相同的值,则执行该代码
898
- }
899
-
900
- const newMonth = date.month >= 10 ? date.month : '0' + date.month //月份
901
- const dataYm = date.year + '-01-01'
902
- const newYear = date.year + 1
903
- const year = date.year.toString().substring(2,4) //年份
904
-
905
- let data = {
906
- orgid: this.$login.f.orgid
907
- }
908
-
909
- let http = new HttpResetClass()
910
- let res = await http.load('POST', 'rs/sql/contractCount', {data:data}, {
911
- resolveMsg: null,
912
- rejectMsg: null
913
- })
914
- let oldDate
915
- for (const item of res.data) {
916
- if (item.name === '合同编号最后更新日期'){
917
- oldDate = item.value
918
- }
919
- }
920
- for (const item of res.data){
921
- if (item.name === '合同编号'){
922
- if (item.value === 0 || Date.parse(oldDate) < Date.parse(dataYm)) {
923
- f_contract_number = dir + type + nature + year + newMonth + '001'
924
- console.log("触发if", f_contract_number)
925
- } else {
926
- let count = item.value
927
- f_contract_number = dir + type + nature + year + newMonth + this.PrefixInteger(count, 3)
928
- console.log("触发else", f_contract_number)
929
- }
930
- }
931
- }
932
- this.selectdata.f_contract_number = f_contract_number
933
- this.show_data.f_contract_number = f_contract_number
934
- return f_contract_number
935
- },
936
- PrefixInteger(num, n) {
937
- return (Array(n).join(0) + num).slice(-n);
938
- }
939
- },
940
- events: {
941
- 'priceType'(index){
942
- this.Pricetype = this.getLableValue('所属类型')
943
- console.log('打印方法值',this.getPrice(this.show_data.f_price_id))
944
- for (const item of this.show_data.fields) {
945
- if (this.show_data.f_sprice_type !=null && this.show_data.f_sprice_type !='') {
946
- if(item.label==='气价名称'){
947
- this.getPrice(this.show_data.f_price_id).then(value =>{
948
- item.options=value
949
- })
950
- console.log('最终',item.options)
951
- }
952
- }
953
- }
954
- },
955
- // 'complyInstallation' (index) {
956
- // if (this.show_data.f_is_have === '否') {
957
- // this.hideButtons('提交', '出图', '缴费')
958
- // this.showButtons('终止')
959
- // }
960
- // if (this.show_data.f_is_have === '是') {
961
- // this.hideButtons('终止')
962
- // this.showButtons('提交', '出图', '缴费')
963
- // }
964
- // },
965
- async 'igniteDispatchReadyEvent' () {
966
- let data = {
967
- tablename: 'activityins',
968
- condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
969
- }
970
- let http = new HttpResetClass()
971
- let res = await http.load(
972
- 'POST',
973
- `rs/sql/singleTable`,
974
- {data: data},
975
- {resolveMsg: null, rejectMsg: '查询失败!!!'}
976
- )
977
- if (res.data.length <= 0) {
978
- console.log('+++++++++++++++++++++++++++++')
979
- console.log('没有施工,不能退回')
980
- this.hideButtons('退回')
981
- }
982
- },
983
- 'buildReadyEvent' () {
984
- this.setLabelValue('施工单位', this.$login.f.name)
985
- this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
986
- },
987
- // 选择材料
988
- async materialNameChenge (index, fieldIndex) {
989
- let material = this.show_data.onetomany[index].fields[fieldIndex].value
990
-
991
- this.show_data.onetomany[index].fields.forEach(item => {
992
- if (material[item.field]) {
993
- item.value = material[item.field]
994
- }
995
- })
996
- },
997
- // 打开模态框获取材料
998
- async 'getMaterialName' (index) {
999
- let data = {
1000
- condition: `1=1`
1001
- }
1002
- let http = new HttpResetClass()
1003
- let res = await http.load(
1004
- 'POST',
1005
- `rs/sql/getStockMaterial`,
1006
- {data: data},
1007
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
1008
- )
1009
-
1010
- this.show_data.onetomany[index].fields.forEach(field => {
1011
- if (field.label === '选择材料') {
1012
- field.options = res.data.map(item => {
1013
- return {
1014
- 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
1015
- 'value': item
1016
- }
1017
- })
1018
- }
1019
- })
1020
- },
1021
- // 搜索小区
1022
- async 'searchArea' (area, index) {
1023
- let data = {
1024
- tablename: 't_area',
1025
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1026
- }
1027
- let http = new HttpResetClass()
1028
- let res = await http.load(
1029
- 'POST',
1030
- `rs/sql/singleTable`,
1031
- {data: data},
1032
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1033
- )
1034
-
1035
- if (res.data.length === 0) {
1036
- return
1037
- }
1038
-
1039
- this.setLabelOptions('集收单位', res.data.map(item => {
1040
- return {
1041
- label: item.f_residential_area,
1042
- value: item.f_residential_area
1043
- }
1044
- }))
1045
- },
1046
- // 搜索小区
1047
- async 'searchAreaCollective' (area, index) {
1048
- let data = {
1049
- tablename: 't_area',
1050
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${area}%'`
1051
- }
1052
- let http = new HttpResetClass()
1053
- let res = await http.load(
1054
- 'POST',
1055
- `rs/sql/singleTable`,
1056
- {data: data},
1057
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1058
- )
1059
-
1060
- if (res.data.length === 0) {
1061
- return
1062
- }
1063
-
1064
- this.setLabelOptions('集收单位', res.data.map(item => {
1065
- return {
1066
- label: item.f_residential_area,
1067
- value: item.f_residential_area
1068
- }
1069
- }))
1070
- },
1071
- // 选择气价
1072
- 'priceChange' (index) {
1073
- debugger
1074
- if (isEmpty(this.show_data.stairPrice)) {
1075
- return
1076
- }
1077
-
1078
- let stairPrice = this.getLableValue('气价名称')
1079
-
1080
- this.setLabelValue('气价类型', stairPrice.f_price_type)
1081
- this.setLabelValue('用气性质', stairPrice.f_gasproperties)
1082
- this.setLabelValue('价格', stairPrice.f_price)
1083
- this.setLabelValue('客户类型', stairPrice.f_user_type)
1084
-
1085
- this.show_data.f_price_id = stairPrice.f_price_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/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/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_filialeid = '${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/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_filialeid = '${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_filialeid = '${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_filialeid = '${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/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
- debugger
1472
- if (this.show_data.button.before) {
1473
- await this[this.show_data.button.before]()
1474
- }
1475
- // 点击重置按钮就重置数据
1476
- if (this.show_data.button.button_name === '重置') {
1477
- this.$dispatch('breakControl', this.selectdata)
1478
- return
1479
- }
1480
-
1481
- this.show_data.user = this.$login.f
1482
- this.show_data.start_activity = this.$workflow_vue.start_activity
1483
- this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1484
-
1485
- 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 === '完工'){
1486
- //判断是否添加报警器材料
1487
- let bjqlag = false
1488
- let datatemp = {
1489
- 'bjqid':"",
1490
- 'fprocessid':"",
1491
- 'sqvalue':"",
1492
- 'f_bjq_sid':"",
1493
- 'f_material_code':"",
1494
- 'f_bjq_baidu_lng':"",
1495
- 'f_bjq_baidu_lat':"",
1496
- 'f_bjq_gaode_lng':"",
1497
- 'f_bjq_gaode_lat':""
1498
- }
1499
-
1500
- let bjqststedata = {
1501
- "sid":"",
1502
- "bjqtype":"",
1503
- "f_process_id":"",
1504
- "bjqstate":"",
1505
- "f_userinfo_code":""
1506
- }
1507
- let numOne = [];
1508
-
1509
- let http = new HttpResetClass()
1510
- let data = {
1511
- tablename: `t_material_apply`,
1512
- condition: `f_process_id='${this.show_data.f_process_id}'`
1513
- }
1514
- let res = await http.load(
1515
- 'POST',
1516
- `rs/sql/singleTable`,
1517
- {data: data},
1518
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
1519
- )
1520
- res.data.forEach(item => {
1521
- if (item.f_material_name.substr(0,3) === '报警器'){
1522
- var bjname = item.f_material_name.split("-")
1523
- bjqststedata.sid = item.f_bjq_sid
1524
- bjqststedata.f_process_id = item.f_process_id
1525
- bjqststedata.bjqtype = bjname[1]
1526
- //====================================
1527
- bjqlag = true
1528
- datatemp.bjqid = item.id
1529
- datatemp.fprocessid = item.f_process_id
1530
- datatemp.f_bjq_sid = item.f_bjq_sid
1531
- datatemp.f_material_code = item.f_material_code
1532
- datatemp.f_bjq_lng = item.f_bjq_lng
1533
- datatemp.f_bjq_lat = item.f_bjq_lat
1534
- datatemp.f_bjq_gaode_lng = item.f_bjq_gaode_lng
1535
- datatemp.f_bjq_gaode_lat = item.f_bjq_gaode_lng
1536
- datatemp.f_bjq_baidu_lng = item.f_bjq_baidu_lng
1537
- datatemp.f_bjq_baidu_lat = item.f_bjq_baidu_lat
1538
- numOne.push(item.f_bjq_sid)
1539
- }
1540
- })
1541
-
1542
- // this.show_data.onetomany.forEach(item=>{
1543
- // console.log("查看报警器材料",item)
1544
- // item.rows.forEach(i=>{
1545
- // if (i.f_material_name.substr(0,3) === '报警器'){
1546
- // var bjname = i.f_material_name.split("-")
1547
- // bjqststedata.sid = i.f_bjq_sid
1548
- // bjqststedata.f_process_id = i.f_process_id
1549
- // bjqststedata.bjqtype = bjname[1]
1550
- // //====================================
1551
- // bjqlag = true
1552
- // datatemp.bjqid = i.id
1553
- // datatemp.fprocessid = i.f_process_id
1554
- // datatemp.f_bjq_sid = i.f_bjq_sid
1555
- // datatemp.f_material_code = i.f_material_code
1556
- // numOne.push(i.f_bjq_sid)
1557
- // }
1558
- // })
1559
- // })
1560
- if (!bjqlag){
1561
- this.$showMessage('请添加报警器物料信息!!!')
1562
- return
1563
- }
1564
- if (numOne.length > 1){
1565
- this.$showMessage("暂时支持单个报警器物料安装!!!")
1566
- return
1567
- }
1568
- datatemp.sqvalue = this.show_data.areaData.sqvalue
1569
- datatemp.f_bjq_baidu_lng = this.show_data.templatlng.baidutemplng
1570
- datatemp.f_bjq_baidu_lat = this.show_data.templatlng.baidutemplat
1571
- datatemp.f_bjq_gaode_lng = this.show_data.templatlng.gaodetemplng
1572
- datatemp.f_bjq_gaode_lat = this.show_data.templatlng.gaodetemplat
1573
- datatemp.f_bjq_lng = this.show_data.templatlng.baidutemplng
1574
- datatemp.f_bjq_lat = this.show_data.templatlng.baidutemplat
1575
-
1576
- bjqststedata.f_userinfo_code = this.show_data.f_userinfo_code
1577
-
1578
- //判断是否推送 及推送的状态
1579
- //查询是否存在, 以型号及厂家判断
1580
- let bjqres = await this.$resetpost(
1581
- `rs/logic/getbjqsyncinfo`,
1582
- bjqststedata
1583
- )
1584
- if (bjqres.data.bjqstate != "成功"){
1585
- //区域地址存入材料记录表
1586
- let areares = await this.$resetpost(
1587
- `rs/logic/saveArea`,
1588
- {data: datatemp},
1589
- {resolveMsg: null, rejectMsg: '区域地址保存失败'}
1590
- )
1591
-
1592
- //完工之后推送数据到汉威
1593
- let adddata = {
1594
- f_bjq_sid : datatemp.f_bjq_sid,
1595
- f_material_code : datatemp.f_material_code,
1596
- f_bjq_address: this.show_data.areaData.sqvalue,
1597
- f_user_name: this.show_data.f_user_name,
1598
- f_address: this.show_data.f_address,
1599
- f_user_phone: this.show_data.f_phone,
1600
- f_userinfo_code: this.show_data.f_userinfo_code,
1601
- installtime: this.show_data.f_construction_date,
1602
- f_orgid : this.show_data.f_orgid,
1603
- f_bjq_lng: datatemp.f_bjq_baidu_lng,
1604
- f_bjq_lat: datatemp.f_bjq_baidu_lat
1605
- }
1606
- let res = await this.$resetpost(
1607
- `ncc/rs/logic/bjqadduser`,
1608
- // `rs/logic/bjqadduser`,
1609
- adddata
1610
- )
1611
- if (res.data.code != 200){
1612
- if (bjqres.data.bjqstate.length == 0){
1613
- bjqststedata.bjqstate = "失败"
1614
- let bjqres3 = await this.$resetpost(
1615
- `rs/logic/addbjqsyncinfo`,
1616
- bjqststedata
1617
- )
1618
- }
1619
- this.$showMessage(res.data.msg)
1620
- return
1621
- }
1622
- //更改记录表状态
1623
- if (bjqres.data.bjqstate === "失败"){
1624
- bjqststedata.bjqstate = "成功"
1625
- let bjqres1 = await this.$resetpost(
1626
- `rs/logic/updatebjqsyncinfo`,
1627
- bjqststedata
1628
- )
1629
- }else{
1630
- bjqststedata.bjqstate = "成功"
1631
- let bjqres2 = await this.$resetpost(
1632
- `rs/logic/addbjqsyncinfo`,
1633
- bjqststedata
1634
- )
1635
- }
1636
- }
1637
- }
1638
- if ((this.show_data.f_apply_type === '工商户报建' || this.show_data.f_apply_type === '团购报建')
1639
- && (this.show_data.defname === '报装申请') && this.show_data.button.button_name === '提交'){
1640
- await this.contract_number()
1641
- }
1642
- // if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && (this.show_data.button.button_name === '保存'||this.show_data.button.button_name === '提交')){
1643
- // let dataz = {
1644
- // condition: `u.id = ${this.show_data.id}`,
1645
- // data: {
1646
- // id: this.$login.f.id,
1647
- // orgid: this.$login.f.orgid
1648
- // }
1649
- // }
1650
- // let http = new HttpResetClass()
1651
- // let restpz = await http.load(
1652
- // 'POST',
1653
- // `rs/sql/checkuser`,
1654
- // {data: dataz},
1655
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1656
- // )
1657
- // this.show_data.actid=restpz.data[0].actid
1658
- // }
1659
- debugger
1660
- let res = await this.$resetpost(
1661
- `rs/logic/ApplyProductService`,
1662
- {data: this.show_data},
1663
- {resolveMsg: null, rejectMsg: '数据保存失败'}
1664
- )
1665
-
1666
-
1667
- if (this.show_data.button.after) {
1668
- this[this.show_data.button.after]()
1669
- }
1670
- // 改管报建 增容报建 优化
1671
- if((this.show_data.f_apply_type === '改管报建'||this.show_data.f_apply_type === '增容报建') && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '缴费'){
1672
- let datagg = {
1673
- condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1674
- }
1675
- let http = new HttpResetClass()
1676
- let restgg = await http.load(
1677
- 'POST',
1678
- `rs/sql/checkusertwo`,
1679
- {data: datagg},
1680
- {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1681
- )
1682
- debugger
1683
- if(this.show_data.f_apply_type === '改管报建'){
1684
- restgg.data[0].processname = '改管报建流程'
1685
- restgg.data[0].defname = '报装缴费'
1686
- }else{
1687
- restgg.data[0].processname = '增容报建流程'
1688
- restgg.data[0].defname = '报装缴费'
1689
- }
1690
- restgg.data[0].actid = restgg.data[0].actid + 1
1691
- this.$dispatch('apply',restgg.data[0])
1692
-
1693
- }
1694
-
1695
- // 退款报建 优化
1696
- if(this.show_data.f_apply_type === '退款报建' && this.show_data.defname === '终止报建' && this.show_data.button.button_name === '提交'){
1697
- let datatk = {
1698
- condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1699
- }
1700
- let http = new HttpResetClass()
1701
- let resttk = await http.load(
1702
- 'POST',
1703
- `rs/sql/checkusertwo`,
1704
- {data: datatk},
1705
- {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1706
- )
1707
- debugger
1708
- resttk.data[0].processname = '退款报建流程'
1709
- resttk.data[0].defname = '退款'
1710
- this.$dispatch('apply',resttk.data[0])
1711
-
1712
- }
1713
-
1714
- //
1715
- // if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '合同'){
1716
- // let data = {
1717
- // tablename: 't_apply',
1718
- // condition: `f_process_id='${this.show_data.f_process_id}'`
1719
- // }
1720
- // let http = new HttpResetClass()
1721
- // let restp = await http.load(
1722
- // 'POST',
1723
- // `rs/sql/singleTable`,
1724
- // {data: data},
1725
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1726
- // )
1727
- // debugger
1728
- // restp.data[0].processname = '散户报建流程'
1729
- // restp.data[0].defname = '合同签订'
1730
- // this.$dispatch('apply',restp.data[0])
1731
- //
1732
- // } else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && this.show_data.button.button_name === '提交'){
1733
- // let data2 = {
1734
- // condition: `u.id = ${this.show_data.id}`,
1735
- // data: {
1736
- // id: this.$login.f.id,
1737
- // orgid: this.$login.f.orgid
1738
- // }
1739
- // }
1740
- // let http = new HttpResetClass()
1741
- // let restp1 = await http.load(
1742
- // 'POST',
1743
- // `rs/sql/checkuser`,
1744
- // {data: data2},
1745
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1746
- // )
1747
- // debugger
1748
- // console.log('有没有发请求打印查询的内容restp1',restp1)
1749
- // // restp1.data[0].processname = '散户报建流程'
1750
- // // restp1.data[0].defname = '报装缴费'
1751
- // this.$dispatch('apply',restp1.data[0])
1752
- // }else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装缴费' && this.show_data.button.button_name === '提交'){
1753
- // let data3 = {
1754
- // condition: `u.id = ${this.show_data.id}`,
1755
- // data: {
1756
- // id: this.$login.f.id,
1757
- // orgid: this.$login.f.orgid
1758
- // }
1759
- // }
1760
- // let http = new HttpResetClass()
1761
- // let restp2 = await http.load(
1762
- // 'POST',
1763
- // `rs/sql/checkuser`,
1764
- // {data: data3},
1765
- // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1766
- // )
1767
- // debugger
1768
- // console.log('打印查询的内容',restp2)
1769
- // if(restp2.length>0){
1770
- // this.$dispatch('apply',restp2.data[0])
1771
- // }else{
1772
- // debugger
1773
- // this.$dispatch('loadPage')
1774
- // }
1775
- // }
1776
- // else{
1777
- // this.$dispatch('loadPage')
1778
- // }
1779
- this.$dispatch('loadPage')
1780
-
1781
- },
1782
- // 失去焦点出触发事件
1783
- 'onchange' (index) {
1784
- debugger
1785
- if(this.show_data.defname==='移交' && this.show_data.f_is_have==='否'){
1786
- this.show_data.buttons[1].hidden = true
1787
- }else{
1788
- this.show_data.buttons[1].hidden = false
1789
- }
1790
- if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1791
- if (
1792
- this.show_data.fields[index].label === '区/县' ||
1793
- this.show_data.fields[index].label === '街道/乡镇' ||
1794
- this.show_data.fields[index].label === '集收单位' ||
1795
- this.show_data.fields[index].label === '楼号/组' ||
1796
- this.show_data.fields[index].label === '单元/排' ||
1797
- this.show_data.fields[index].label === '楼层' ||
1798
- this.show_data.fields[index].label === '门牌号'
1799
- ) {
1800
-
1801
- let f_pcd = this.getLableValue('区/县') || ''
1802
- let f_street = this.getLableValue('街道/乡镇') || ''
1803
- let f_residential_area = this.getLableValue('集收单位') || ''
1804
- let f_building = this.getLableValue('楼号/组') || ''
1805
- let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1806
- let f_unit = this.getLableValue('单元/排') || ''
1807
- let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1808
- let f_floor = this.getLableValue('楼层') || ''
1809
- let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1810
- let f_room = this.getLableValue('门牌号') || ''
1811
- let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1812
-
1813
- 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
1814
- this.setLabelValue("地址", f_address)
1815
- }
1816
- }
1817
- },
1818
- selectSearch (val, index) {},
1819
- 'onblur' (index) {},
1820
- 'oninput' (index) {},
1821
- 'initializtionView' () {},
1822
- async 'onchangeModal' (index, fieldIndex) {
1823
- },
1824
- async 'onblurModal' (index, fieldIndex) {
1825
-
1826
- },
1827
- async 'oninputModal' (index, fieldIndex) {
1828
-
1829
- },
1830
- async 'onetomanydelete' (index, rowIndex) {
1831
-
1832
- let http = new HttpResetClass()
1833
-
1834
- let res = await http.load(
1835
- 'DELETE',
1836
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1837
- null,
1838
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
1839
- )
1840
-
1841
- res = await this.$resetpost(
1842
- 'rs/entity/t_apply',
1843
- this.show_data
1844
- )
1845
-
1846
- this.$dispatch('breakControl', this.show_data)
1847
- },
1848
- async 'onetomanyupdate' (index, rowIndex) {
1849
- let data = this.show_data.onetomany[index].rows[rowIndex]
1850
-
1851
- this.show_data.onetomany[index].fields.forEach(item => {
1852
- data[item.field] = item.value
1853
- })
1854
- let res = await this.$resetpost(
1855
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1856
- data
1857
- )
1858
-
1859
- res = await this.$resetpost(
1860
- 'rs/entity/t_apply',
1861
- this.show_data
1862
- )
1863
-
1864
- this.$dispatch('breakControl', this.show_data)
1865
- },
1866
- async 'onetomanyadd' (index) {
1867
- let data = {
1868
- f_process_id : this.show_data.f_process_id,
1869
- f_operator_id: this.$login.f.id,
1870
- f_operator: this.$login.f.name,
1871
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1872
- f_orgid: this.$login.f.orgid,
1873
- f_orgname: this.$login.f.orgs
1874
- }
1875
- this.show_data.onetomany[index].fields.forEach(item => {
1876
- data[item.field] = item.value
1877
- })
1878
- let res = await this.$resetpost(
1879
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1880
- data
1881
- )
1882
-
1883
- res = await this.$resetpost(
1884
- 'rs/entity/t_apply',
1885
- this.show_data
1886
- )
1887
-
1888
- this.$dispatch('breakControl', this.show_data)
1889
- },
1890
- async 'importEvent' (index, table, configName, filepath) {
1891
- let data = {
1892
- selectdata: this.show_data,
1893
- table: table,
1894
- filepath: filepath,
1895
- configName: configName,
1896
- user: this.$login.f
1897
- }
1898
-
1899
- let res = await this.$resetpost(
1900
- `rs/logic/importEvent`,
1901
- data
1902
- )
1903
-
1904
- this.$dispatch('breakControl', this.show_data)
1905
- },
1906
- 'onbutchange' (index) {
1907
-
1908
- },
1909
- 'onbutblur' (index) {
1910
-
1911
- },
1912
- 'onbutinput' (index) {
1913
-
1914
-
1915
- }
1916
- },
1917
- watch: {
1918
- }
1919
- }
1920
- </script>
1921
- <style scoped>
1922
- /*清除model中的浮动*/
1923
- .clearfix:after,.clearfix:before{
1924
- display: table;
1925
- }
1926
- .clearfix:after{
1927
- clear: both;
1928
- }
1929
- </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
+ this.servicer()
45
+ this.ceshi()
46
+ debugger
47
+ },
48
+ methods: {
49
+ async servicer(){
50
+ let data = {
51
+ tablename: 't_user',
52
+ condition: `1=1`
53
+ }
54
+ let http = new HttpResetClass()
55
+ let res = await http.load(
56
+ 'POST',
57
+ `rs/sql/singleTable`,
58
+ {data: data},
59
+ {resolveMsg: null, rejectMsg: '服务人查询失败!!!'}
60
+ )
61
+ this.setLabelOptions('服务人', res.data.map(item => {
62
+ return {
63
+ label: item.name,
64
+ value: item.name
65
+ }
66
+ }))
67
+ },
68
+ async ceshi(){
69
+ for (let i = 0; i < this.show_data.fields.length; i++) {
70
+ if (this.show_data.defname==='报装申请' && this.show_data.fields[i].label === '合同编号') {
71
+ debugger
72
+ let http2 = new HttpResetClass()
73
+ let applyNum = await http2.load('POST', 'rs/logic/getProjectNo', {
74
+ data: {
75
+ f_filiale: this.$login.f.orgs,
76
+ f_order_id: this.selectdata.f_order_id
77
+ }
78
+ }, {resolveMsg: null, rejectMsg: null})
79
+ debugger
80
+ console.log("生成的合同编号为:" + applyNum.data)
81
+ this.show_data.fields[i].value = applyNum.data
82
+ }
83
+ }
84
+ },
85
+ async servicer(){
86
+ debugger
87
+ let data = {
88
+ tablename: 't_user',
89
+ condition: `1=1`
90
+ }
91
+ let http = new HttpResetClass()
92
+ let res = await http.load(
93
+ 'POST',
94
+ `rs/sql/singleTable`,
95
+ {data: data},
96
+ {resolveMsg: null, rejectMsg: '服务人查询失败!!!'}
97
+ )
98
+ debugger
99
+ this.setLabelOptions('服务人', res.data.map(item => {
100
+ return {
101
+ label: item.name,
102
+ value: item.name
103
+ }
104
+ }))
105
+ },
106
+ // 组件初始化操作
107
+ async refurbish() {
108
+ this.json_datas = this.$workflow_vue
109
+ let sum = 0
110
+ let jsonData = {}
111
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
112
+ this.$showMessage("网络故障,请刷新页面")
113
+ return
114
+ }
115
+ this.json_datas.activitys.forEach(item => {
116
+ if (this.selectdata.defname === item.title) {
117
+ jsonData = item // 拿到当前节点的json配置信息
118
+ sum++ // 节点名一样的个数
119
+ }
120
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
121
+ })
122
+
123
+ if (sum === 0) {
124
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
125
+ return
126
+ }
127
+ if (sum > 1) {
128
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
129
+ return
130
+ }
131
+
132
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
133
+
134
+ // fields 字段填充值
135
+ for (const item of this.selectdata.fields) {
136
+ if (!item.value) {
137
+ item.value = null
138
+ }
139
+
140
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
141
+ if (item.eval) {
142
+ item.value = eval(item.default)
143
+ } else {
144
+ item.value = item.default
145
+ }
146
+ }
147
+
148
+ if (this.selectdata[item.field]) {
149
+ // 将json字符串格式化赋值给value
150
+ if (String(this.selectdata[item.field]).startsWith("{")) {
151
+ item.value = JSON.parse(this.selectdata[item.field])
152
+ } else {
153
+ item.value = this.selectdata[item.field]
154
+ }
155
+ }
156
+ if (this.selectdata[item.field] === 0) {
157
+ item.value = 0
158
+ }
159
+
160
+ // datepicker
161
+ if (item.type === 'datepicker' && !item.value && item.default) {
162
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
163
+ }
164
+
165
+ // 如果配置类型为select,优先从参数列表获取options
166
+ if (item.type === 'select' || item.type === 'checkbox') {
167
+ if (item.param) {
168
+ let temp = this.$appdata.getParam(item.label)
169
+
170
+ if (temp && temp.length > 0) {
171
+ item.options = temp
172
+ }
173
+
174
+ if (item.paramLabel) {
175
+ temp = this.$appdata.getParam(item.paramLabel)
176
+ if (temp && temp.length > 0) {
177
+ item.options = temp
178
+ }
179
+ }
180
+ }
181
+
182
+ if (item.ready) {
183
+ item.options = await this[item.ready]()
184
+ }
185
+ }
186
+
187
+
188
+ if (item.type === 'checkbox') {
189
+ if (this.selectdata[item.field]) {
190
+ item.value = JSON.parse(this.selectdata[item.field])
191
+ } else {
192
+ item.value = []
193
+ }
194
+ }
195
+
196
+ this.selectdata[item.field] = item.value
197
+ }
198
+
199
+ // 控制组件
200
+ if (this.selectdata.components) {
201
+ this.selectdata.components.forEach(item => {
202
+ if (!item.mark) {
203
+ item.mark = 0
204
+ }
205
+ })
206
+ }
207
+
208
+ // 初始化onetomany
209
+ if (this.selectdata.onetomany) {
210
+ for (const item of this.selectdata.onetomany) {
211
+ let res = null
212
+ if (item.queryEvent) {
213
+ res = this[item.queryEvent]()
214
+ } else {
215
+ let data = {
216
+ tablename: item.tables[0],
217
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
218
+ }
219
+ res = await this.$resetpost(
220
+ 'rs/sql/singleTable',
221
+ {data: data},
222
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
223
+ )
224
+ }
225
+
226
+ item.rows = res.data
227
+
228
+ // 初始化onetomany中的fields
229
+ for (const field of item.fields) {
230
+ if (!field.value) {
231
+ if (field.value !== 0) {
232
+ field.value = null
233
+ }
234
+ }
235
+
236
+ if (field.default || field.default === 0) {
237
+ field.value = field.default
238
+ }
239
+
240
+ // datepicker
241
+ if (field.type === 'datepicker' && !field.value && field.default) {
242
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
243
+ }
244
+
245
+ if (field.type === 'select') {
246
+
247
+ let temp = this.$appdata.getParam(field.label)
248
+
249
+ if (temp && temp.length > 0) {
250
+ field.options = temp
251
+ }
252
+
253
+ if (field.paramLabel) {
254
+ temp = this.$appdata.getParam(field.paramLabel)
255
+ if (temp && temp.length > 0) {
256
+ item.options = temp
257
+ }
258
+ }
259
+ }
260
+ }
261
+ }
262
+ }
263
+
264
+ // 初始化 buttons_fields
265
+ for (const item of this.selectdata.buttons) {
266
+ if (item.button_name === '下发') {
267
+
268
+ let data = {
269
+ source: item.source,
270
+ userid: this.$login.f.id
271
+ }
272
+ if (item.sourceMethod) {
273
+ data.source = this[item.sourceMethod]()
274
+ }
275
+ if (!data.source) {
276
+ this.$showMessage("请配置获取人员表达式")
277
+ return
278
+ }
279
+
280
+ let res = await this.$resetpost(
281
+ 'rs/search',
282
+ {data: data},
283
+ {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
284
+ )
285
+
286
+ let options = res.data.map(source => {
287
+ return {
288
+ "label": source.name,
289
+ "value": source.id
290
+ }
291
+ })
292
+
293
+ if (item.button_fields.length !== 1) {
294
+ this.$showMessage("下发有且只能有一个字段!!!")
295
+ return
296
+ }
297
+
298
+ item.button_fields[0].options = options
299
+ }
300
+ if (item.button_fields) {
301
+ item.button_fields.forEach(x => {
302
+ // 如果配置类型为select,优先从参数列表获取options
303
+ if (x.type === 'select') {
304
+
305
+ if (x.param) {
306
+ let temp = this.$appdata.getParam(x.label)
307
+
308
+ if (temp && temp.length > 0) {
309
+ x.options = temp
310
+ }
311
+
312
+ if (x.paramLabel) {
313
+ temp = this.$appdata.getParam(x.paramLabel)
314
+ if (temp && temp.length > 0) {
315
+ x.options = temp
316
+ }
317
+ }
318
+ }
319
+
320
+ }
321
+ })
322
+ }
323
+ }
324
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
325
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
326
+ console.log('打印下temp',temp)
327
+ this.show_data = temp
328
+ this.$nextTick(() => {
329
+ this.showview = true
330
+ })
331
+ this.ceshi()
332
+ },
333
+ // 金额转大写
334
+ smalltoBIG(n) {
335
+ let fraction = ['角', '分'];
336
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
337
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
338
+ let head = n < 0 ? '欠' : '';
339
+ n = Math.abs(n);
340
+
341
+ let s = '';
342
+
343
+ for (var i = 0; i < fraction.length; i++) {
344
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
345
+ }
346
+ s = s || '整';
347
+ n = Math.floor(n);
348
+
349
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
350
+ let p = '';
351
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
352
+ p = digit[n % 10] + unit[1][j] + p;
353
+ n = Math.floor(n / 10);
354
+ }
355
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
356
+ }
357
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
358
+ },
359
+ getLableValue(label) {
360
+ for (const item of this.show_data.fields) {
361
+ if (item.label === label && item.type !== 'number') {
362
+ return item.value || ''
363
+ }
364
+ if (item.label === label && item.type === 'number') {
365
+ return item.value || 0
366
+ }
367
+ }
368
+ },
369
+ getLableOptions(label) {
370
+ for (const item of this.show_data.fields) {
371
+ if (item.label === label) {
372
+ return item.options
373
+ }
374
+ }
375
+ },
376
+ setLabelValue(label, value) {
377
+ for (const item of this.show_data.fields) {
378
+ if (item.label === label) {
379
+ item.value = value
380
+ this.show_data[item.field] = value
381
+ }
382
+ }
383
+ },
384
+ setLabelOptions(label, options) {
385
+ for (const item of this.show_data.fields) {
386
+ if (item.label === label) {
387
+ item.options = options
388
+ }
389
+ }
390
+ },
391
+ showLabels(...labels) {
392
+ for (const item of this.show_data.fields) {
393
+ if (labels.includes(item.label)) {
394
+ item.hidden = false
395
+ }
396
+ }
397
+ },
398
+ hideLabels(...labels) {
399
+ for (const item of this.show_data.fields) {
400
+ if (labels.includes(item.label)) {
401
+ item.hidden = true
402
+ }
403
+ }
404
+ },
405
+ requiredLabels(...labels) {
406
+ for (const item of this.show_data.fields) {
407
+ if (labels.includes(item.label)) {
408
+ item.required = true
409
+ }
410
+ }
411
+ },
412
+ electiveLabels(...labels) {
413
+ for (const item of this.show_data.fields) {
414
+ if (labels.includes(item.label)) {
415
+ item.required = false
416
+ }
417
+ }
418
+ },
419
+ readonlyLabels(...labels) {
420
+ for (const item of this.show_data.fields) {
421
+ if (labels.includes(item.label)) {
422
+ item.readonly = true
423
+ item.disabled = true
424
+ }
425
+ }
426
+ },
427
+ readwriteLabels(...labels) {
428
+ for (const item of this.show_data.fields) {
429
+ if (labels.includes(item.label)) {
430
+ item.readonly = false
431
+ item.disabled = false
432
+ }
433
+ }
434
+ },
435
+ disabledButtons(...buttons) {
436
+ for (const item of this.show_data.buttons) {
437
+ if (buttons.includes(item.button_name)) {
438
+ item.disabled = true
439
+ }
440
+ }
441
+ },
442
+ enableButtons(...buttons) {
443
+ for (const item of this.show_data.buttons) {
444
+ if (buttons.includes(item.button_name)) {
445
+ item.disabled = false
446
+ }
447
+ }
448
+ },
449
+ showButtons(...buttons) {
450
+ for (const item of this.show_data.buttons) {
451
+ if (buttons.includes(item.button_name)) {
452
+ item.hidden = false
453
+ }
454
+ }
455
+ },
456
+ hideButtons(...buttons) {
457
+ for (const item of this.show_data.buttons) {
458
+ if (buttons.includes(item.button_name)) {
459
+ item.hidden = true
460
+ }
461
+ }
462
+ },
463
+ async checkDuplicate(index) {
464
+ let http = new HttpResetClass()
465
+ let data = {
466
+ tablename: 't_apply',
467
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
468
+ }
469
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
470
+ resolveMsg: null,
471
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
472
+ })
473
+ if (res.data.length > 0) {
474
+ this.show_data.fields[index].value = null
475
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
476
+ }
477
+ },
478
+ // 获取片区
479
+ async getSliceArea () {
480
+ let data = {
481
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
482
+ userid: this.$login.f.id
483
+ }
484
+
485
+ let http = new HttpResetClass()
486
+ let res = await http.load(
487
+ 'POST',
488
+ `rs/search`,
489
+ {data: data},
490
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
491
+ )
492
+
493
+ return res.data.map(item => {
494
+ return {
495
+ label: item.name,
496
+ value: item.name
497
+ }
498
+ })
499
+ },
500
+ // 获取区县
501
+ async getPcd () {
502
+ let data = {
503
+ tablename: 't_pcd',
504
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
505
+ }
506
+ let http = new HttpResetClass()
507
+ let res = await http.load(
508
+ 'POST',
509
+ `rs/sql/singleTable`,
510
+ {data: data},
511
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
512
+ )
513
+
514
+ return res.data.map(item => {
515
+ return {
516
+ label: item.f_pcd,
517
+ value: item.f_pcd
518
+ }
519
+ })
520
+ },
521
+ // 获取集收单位
522
+ async getArea () {
523
+ let data = {
524
+ tablename: 't_area',
525
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
526
+ }
527
+ let http = new HttpResetClass()
528
+ let res = await http.load(
529
+ 'POST',
530
+ `rs/sql/singleTable`,
531
+ {data: data},
532
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
533
+ )
534
+
535
+ return res.data.map(item => {
536
+ return {
537
+ label: item.f_residential_area,
538
+ value: item.f_residential_area
539
+ }
540
+ })
541
+ },
542
+ // 缴费前置
543
+ chargeBefore () {
544
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
545
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
546
+ throw null
547
+ }
548
+ },
549
+ // 施工前置 加表具后状态是待开通 提交后是正常 所以这里的判断条件需改正 (and uf.f_meter_classify is null and f_meternumber is null)
550
+ async constructionBefore () {
551
+ let http = new HttpResetClass()
552
+ let data = {
553
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_meter_classify is null and f_meternumber is null`
554
+ }
555
+ let res = await http.load(
556
+ 'POST',
557
+ 'rs/sql/countApplyUserinfo',
558
+ {data: data},
559
+ {
560
+ resolveMsg: null,
561
+ rejectMsg: '安装明细查询失败!!!'
562
+ })
563
+ if (res.data[0].num > 0) {
564
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
565
+ throw `还有${res.data[0].num}户未安装,无法提交`
566
+ }
567
+ },
568
+ changePipeBuild () {
569
+ if (this.selectdata.f_process_dep === '工程部') {
570
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
571
+ }
572
+ if (this.selectdata.f_process_dep === '运营部') {
573
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
574
+ }
575
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
576
+ },
577
+ async getDevInfo () {
578
+ let data = {
579
+ tablename: 't_dev_info',
580
+ condition: `f_orgid = '${this.$login.f.orgid}'`
581
+ }
582
+ let http = new HttpResetClass()
583
+ let res = await http.load(
584
+ 'POST',
585
+ `rs/sql/singleTable`,
586
+ {data: data},
587
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
588
+ )
589
+
590
+ return res.data.map(item => {
591
+ return {
592
+ label: item.f_dev_name,
593
+ value: item.f_dev_name
594
+ }
595
+ })
596
+ },
597
+ async getPrice (f_price_id) {
598
+ console.log('=======================')
599
+ console.log(f_price_id)
600
+
601
+ let data = {
602
+ condition: `sp.f_filialeid = '${this.$login.f.orgid}'`
603
+ }
604
+ if(this.Pricetype==='机表'){
605
+ data.condition=`sp.f_custom = '机表'`
606
+ }
607
+ if(this.Pricetype==='非机表'){
608
+ data.condition=`sp.f_custom = '非机表'`
609
+ }
610
+
611
+ if (!isEmpty(f_price_id)) {
612
+ data.condition = `sp.f_filialeid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
613
+ }
614
+ let http = new HttpResetClass()
615
+ let res = await http.load(
616
+ 'POST',
617
+ `rs/sql/applyGetPrice`,
618
+ {data: data},
619
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
620
+ )
621
+
622
+ let a= res.data.map(item => {
623
+ return {
624
+ label: item.f_price_name,
625
+ value: item
626
+ }
627
+ })
628
+ this.selectdata.fields.forEach(field => {
629
+ if (field.label === '气价名称') {
630
+ field.options = a}
631
+ })
632
+ return a
633
+ },
634
+ addressInitialization () {
635
+ this.$getConfig(this, 'UserAddress')
636
+
637
+ let f_address_type = this.show_data.f_address_type
638
+
639
+ for (const item of this.show_data.fields) {
640
+ if (f_address_type === '民用市区') {
641
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
642
+ item.hidden = false
643
+ item.required = true
644
+ }
645
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
646
+ item.hidden = false
647
+ item.required = false
648
+ }
649
+ if (item.label === '地址') {
650
+ item.readonly = true
651
+ }
652
+ }
653
+ if (f_address_type === '民用乡镇') {
654
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
655
+ item.hidden = false
656
+ item.required = true
657
+ }
658
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
659
+ item.hidden = false
660
+ item.required = false
661
+ }
662
+ if (item.label === '楼层') {
663
+ item.hidden = true
664
+ item.required = false
665
+ }
666
+ if (item.label === '地址') {
667
+ item.readonly = true
668
+ }
669
+ }
670
+ if (f_address_type === '特殊地址') {
671
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
672
+ item.hidden = false
673
+ item.required = true
674
+ }
675
+ if (item.label === '集收单位') {
676
+ item.hidden = false
677
+ if (this.show_data.f_apply_type === '工商户报建'){
678
+ item.required = false
679
+ } else {
680
+ item.required = false
681
+ }
682
+
683
+ }
684
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
685
+ item.hidden = true
686
+ item.required = false
687
+ }
688
+ if (item.label === '地址') {
689
+ item.readonly = false
690
+ }
691
+ }
692
+
693
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
694
+ item.hidden = true
695
+ }
696
+ }
697
+ },
698
+ async streetChange () {
699
+ if (isEmpty(this.show_data.f_street)) {
700
+ return
701
+ }
702
+
703
+ let data = {
704
+ tablename: 't_area',
705
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
706
+ }
707
+ let http = new HttpResetClass()
708
+ let res = await http.load(
709
+ 'POST',
710
+ `rs/sql/singleTable`,
711
+ {data: data},
712
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
713
+ )
714
+
715
+ this.setLabelOptions('集收单位', res.data.map(item => {
716
+ return {
717
+ label: item.f_residential_area,
718
+ value: item.f_residential_area
719
+ }
720
+ }))
721
+ },
722
+ async pcdChange () {
723
+ if (isEmpty(this.show_data.f_pcd)) {
724
+ return
725
+ }
726
+
727
+ let data = {
728
+ tablename: 't_street',
729
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
730
+ }
731
+ let f_address_type = this.getLableValue('地址类型')
732
+
733
+ if (f_address_type === '民用市区') {
734
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
735
+ }
736
+ if (f_address_type === '民用乡镇') {
737
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
738
+ }
739
+
740
+ let http = new HttpResetClass()
741
+ let res = await http.load(
742
+ 'POST',
743
+ `rs/sql/singleTable`,
744
+ {data: data},
745
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
746
+ )
747
+
748
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
749
+ return {
750
+ label: item.f_street,
751
+ value: item.f_street
752
+ }
753
+ }))
754
+ },
755
+ async addressTips () {
756
+ // console.log('======================='+this.show_data.f_apply_type)
757
+ let res = ''
758
+ if (this.show_data.f_apply_type === '报警器报建' || this.show_data.f_apply_type === '工商业报警器报建') {
759
+ res = await this.$showMessage('报警器报建下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
760
+ }else{
761
+ res = await this.$showMessage('增容改管下单后将不能修改用户信息,请确认用户信息地址等是否正确,如不完善可在档案中进行修正!!!')
762
+ }
763
+ if (res == 'confirm') {
764
+ return
765
+ }
766
+ throw '用户信息确认!!!'
767
+ },
768
+ async getDesignerPeople () {
769
+ let data = {
770
+ source: 'this.getParentByType($organization$).getChildByName($设计员$).getChildren()',
771
+ userid: this.$login.f.id
772
+ }
773
+
774
+ let http = new HttpResetClass()
775
+ let res = await http.load(
776
+ 'POST',
777
+ `rs/search`,
778
+ {data: data},
779
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
780
+ )
781
+
782
+ return res.data.map(item => {
783
+ return {
784
+ label: item.name,
785
+ value: item.id
786
+ }
787
+ })
788
+ },
789
+ async surveyStopApply () {
790
+ console.log('终止报建!!!!!')
791
+
792
+ this.show_data.f_stop_reason = '现场勘察不符合报装条件'
793
+
794
+ let data = {
795
+ data: this.show_data,
796
+ user: this.$login.f
797
+ }
798
+
799
+ let res = await this.$resetpost(
800
+ `rs/logic/surveyStopApply`,
801
+ {data: data},
802
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
803
+ )
804
+
805
+ this.$dispatch('loadPage')
806
+
807
+ throw '终止报建!!!'
808
+ },
809
+ async contract_number() {
810
+ console.log("进入编号合同编号生成",this.$login.f.orgs)
811
+ let f_contract_number = ''
812
+ const nowDate = new Date();
813
+ const date = {
814
+ year: nowDate.getFullYear(),
815
+ month: nowDate.getMonth() + 1,
816
+ day: nowDate.getDate()
817
+ }
818
+
819
+ function upperCaseChars(dir) {
820
+ let string = '';
821
+ switch (dir){
822
+ case '周口市天然气有限公司':
823
+ string = 'ZK' // 当表达式的结果等于 房产 时,则执行该代码
824
+ break;
825
+ case '项城市天然气有限公司':
826
+ string = "XC" // 当表达式的结果等于 自建房 时,则执行该代码
827
+ break;
828
+ case '西华县天然气有限公司':
829
+ string = 'XH' // 当表达式的结果等于 商业 时,则执行该代码
830
+ break;
831
+ case '鹿邑县天然气有限公司':
832
+ string = 'LY' // 当表达式的结果等于 工业 时,则执行该代码
833
+ break;
834
+ case '郸城县天然气有限公司':
835
+ string = 'DC' // 当表达式的结果等于 中压 时,则执行该代码
836
+ break;
837
+ case '测试公司(一)':
838
+ string = 'CS' // 当表达式的结果等于 中压 时,则执行该代码
839
+ break;
840
+ default :
841
+ break; // 如果没有与表达式相同的值,则执行该代码
842
+ }
843
+ return string;
844
+ }
845
+
846
+ const dir = upperCaseChars(this.$login.f.orgs) //分公司
847
+
848
+ let type = 0 //类型
849
+
850
+ switch (this.show_data.f_entry_type){
851
+ case '城区/县城':
852
+ type = 1 // 当表达式的结果等于 城区 时,则执行该代码
853
+ break;
854
+ case '新农村':
855
+ type = 2 // 当表达式的结果等于 新农村 时,则执行该代码
856
+ break;
857
+ case '测试':
858
+ type = 3 // 当表达式的结果等于 新农村 时,则执行该代码
859
+ break;
860
+ default :
861
+ break; // 如果没有与表达式相同的值,则执行该代码
862
+ }
863
+
864
+ let nature = 0 // 性质
865
+ switch (this.show_data.f_apply_nature){
866
+ case '楼房':
867
+ nature = 1 // 当表达式的结果等于 楼房 时,则执行该代码
868
+ break;
869
+ case '房产':
870
+ nature = 1 // 当表达式的结果等于 房产 时,则执行该代码
871
+ break;
872
+ case '自建房':
873
+ nature = 2 // 当表达式的结果等于 自建房 时,则执行该代码
874
+ break;
875
+ case '商业':
876
+ nature = 3 // 当表达式的结果等于 商业 时,则执行该代码
877
+ break;
878
+ case '学校':
879
+ nature = 3 // 当表达式的结果等于 学校 时,则执行该代码
880
+ break;
881
+ case '福利机构':
882
+ nature = 3 // 当表达式的结果等于 福利机构 时,则执行该代码
883
+ break;
884
+ case '其他':
885
+ nature = 3 // 当表达式的结果等于 其他 时,则执行该代码
886
+ break;
887
+ case '工业':
888
+ nature = 4 // 当表达式的结果等于 工业 时,则执行该代码
889
+ break;
890
+ case '中压':
891
+ nature = 5 // 当表达式的结果等于 中压 时,则执行该代码
892
+ break;
893
+ case '测试':
894
+ nature = 6 // 当表达式的结果等于 中压 时,则执行该代码
895
+ break;
896
+ default :
897
+ break; // 如果没有与表达式相同的值,则执行该代码
898
+ }
899
+
900
+ const newMonth = date.month >= 10 ? date.month : '0' + date.month //月份
901
+ const dataYm = date.year + '-01-01'
902
+ const newYear = date.year + 1
903
+ const year = date.year.toString().substring(2,4) //年份
904
+
905
+ let data = {
906
+ orgid: this.$login.f.orgid
907
+ }
908
+
909
+ let http = new HttpResetClass()
910
+ let res = await http.load('POST', 'rs/sql/contractCount', {data:data}, {
911
+ resolveMsg: null,
912
+ rejectMsg: null
913
+ })
914
+ let oldDate
915
+ for (const item of res.data) {
916
+ if (item.name === '合同编号最后更新日期'){
917
+ oldDate = item.value
918
+ }
919
+ }
920
+ for (const item of res.data){
921
+ if (item.name === '合同编号'){
922
+ if (item.value === 0 || Date.parse(oldDate) < Date.parse(dataYm)) {
923
+ f_contract_number = dir + type + nature + year + newMonth + '001'
924
+ console.log("触发if", f_contract_number)
925
+ } else {
926
+ let count = item.value
927
+ f_contract_number = dir + type + nature + year + newMonth + this.PrefixInteger(count, 3)
928
+ console.log("触发else", f_contract_number)
929
+ }
930
+ }
931
+ }
932
+ this.selectdata.f_contract_number = f_contract_number
933
+ this.show_data.f_contract_number = f_contract_number
934
+ return f_contract_number
935
+ },
936
+ PrefixInteger(num, n) {
937
+ return (Array(n).join(0) + num).slice(-n);
938
+ }
939
+ },
940
+ events: {
941
+ 'priceType'(index){
942
+ this.Pricetype = this.getLableValue('所属类型')
943
+ console.log('打印方法值',this.getPrice(this.show_data.f_price_id))
944
+ for (const item of this.show_data.fields) {
945
+ if (this.show_data.f_sprice_type !=null && this.show_data.f_sprice_type !='') {
946
+ if(item.label==='气价名称'){
947
+ this.getPrice(this.show_data.f_price_id).then(value =>{
948
+ item.options=value
949
+ })
950
+ console.log('最终',item.options)
951
+ }
952
+ }
953
+ }
954
+ },
955
+ // 'complyInstallation' (index) {
956
+ // if (this.show_data.f_is_have === '否') {
957
+ // this.hideButtons('提交', '出图', '缴费')
958
+ // this.showButtons('终止')
959
+ // }
960
+ // if (this.show_data.f_is_have === '是') {
961
+ // this.hideButtons('终止')
962
+ // this.showButtons('提交', '出图', '缴费')
963
+ // }
964
+ // },
965
+ async 'igniteDispatchReadyEvent' () {
966
+ let data = {
967
+ tablename: 'activityins',
968
+ condition: `processid = '${this.show_data.f_process_id}' and defname = '工程施工' and state = '结束'`
969
+ }
970
+ let http = new HttpResetClass()
971
+ let res = await http.load(
972
+ 'POST',
973
+ `rs/sql/singleTable`,
974
+ {data: data},
975
+ {resolveMsg: null, rejectMsg: '查询失败!!!'}
976
+ )
977
+ if (res.data.length <= 0) {
978
+ console.log('+++++++++++++++++++++++++++++')
979
+ console.log('没有施工,不能退回')
980
+ this.hideButtons('退回')
981
+ }
982
+ },
983
+ 'buildReadyEvent' () {
984
+ this.setLabelValue('施工单位', this.$login.f.name)
985
+ this.setLabelValue('施工安装时间', new Date().Format('yyyy-MM-dd HH:mm:ss'))
986
+ },
987
+ // 选择材料
988
+ async materialNameChenge (index, fieldIndex) {
989
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
990
+
991
+ this.show_data.onetomany[index].fields.forEach(item => {
992
+ if (material[item.field]) {
993
+ item.value = material[item.field]
994
+ }
995
+ })
996
+ },
997
+ // 打开模态框获取材料
998
+ async 'getMaterialName' (index) {
999
+ let data = {
1000
+ condition: `1=1`
1001
+ }
1002
+ let http = new HttpResetClass()
1003
+ let res = await http.load(
1004
+ 'POST',
1005
+ `rs/sql/getStockMaterial`,
1006
+ {data: data},
1007
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
1008
+ )
1009
+
1010
+ this.show_data.onetomany[index].fields.forEach(field => {
1011
+ if (field.label === '选择材料') {
1012
+ field.options = res.data.map(item => {
1013
+ return {
1014
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
1015
+ 'value': item
1016
+ }
1017
+ })
1018
+ }
1019
+ })
1020
+ },
1021
+ // 搜索小区
1022
+ async 'searchArea' (area, index) {
1023
+ let data = {
1024
+ tablename: 't_area',
1025
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}' and f_residential_area like '%${area}%'`
1026
+ }
1027
+ let http = new HttpResetClass()
1028
+ let res = await http.load(
1029
+ 'POST',
1030
+ `rs/sql/singleTable`,
1031
+ {data: data},
1032
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1033
+ )
1034
+
1035
+ if (res.data.length === 0) {
1036
+ return
1037
+ }
1038
+
1039
+ this.setLabelOptions('集收单位', res.data.map(item => {
1040
+ return {
1041
+ label: item.f_residential_area,
1042
+ value: item.f_residential_area
1043
+ }
1044
+ }))
1045
+ },
1046
+ // 搜索小区
1047
+ async 'searchAreaCollective' (area, index) {
1048
+ let data = {
1049
+ tablename: 't_area',
1050
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_residential_area like '%${area}%'`
1051
+ }
1052
+ let http = new HttpResetClass()
1053
+ let res = await http.load(
1054
+ 'POST',
1055
+ `rs/sql/singleTable`,
1056
+ {data: data},
1057
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
1058
+ )
1059
+
1060
+ if (res.data.length === 0) {
1061
+ return
1062
+ }
1063
+
1064
+ this.setLabelOptions('集收单位', res.data.map(item => {
1065
+ return {
1066
+ label: item.f_residential_area,
1067
+ value: item.f_residential_area
1068
+ }
1069
+ }))
1070
+ },
1071
+ // 选择气价
1072
+ 'priceChange' (index) {
1073
+ debugger
1074
+ if (isEmpty(this.show_data.stairPrice)) {
1075
+ return
1076
+ }
1077
+
1078
+ let stairPrice = this.getLableValue('气价名称')
1079
+
1080
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
1081
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
1082
+ this.setLabelValue('价格', stairPrice.f_price)
1083
+ this.setLabelValue('客户类型', stairPrice.f_user_type)
1084
+
1085
+ this.show_data.f_price_id = stairPrice.f_price_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/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/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_filialeid = '${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/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_filialeid = '${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_filialeid = '${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_filialeid = '${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/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
+ debugger
1472
+ if (this.show_data.button.before) {
1473
+ await this[this.show_data.button.before]()
1474
+ }
1475
+ // 点击重置按钮就重置数据
1476
+ if (this.show_data.button.button_name === '重置') {
1477
+ this.$dispatch('breakControl', this.selectdata)
1478
+ return
1479
+ }
1480
+
1481
+ this.show_data.user = this.$login.f
1482
+ this.show_data.start_activity = this.$workflow_vue.start_activity
1483
+ this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
1484
+
1485
+ 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 === '完工'){
1486
+ //判断是否添加报警器材料
1487
+ let bjqlag = false
1488
+ let datatemp = {
1489
+ 'bjqid':"",
1490
+ 'fprocessid':"",
1491
+ 'sqvalue':"",
1492
+ 'f_bjq_sid':"",
1493
+ 'f_material_code':"",
1494
+ 'f_bjq_baidu_lng':"",
1495
+ 'f_bjq_baidu_lat':"",
1496
+ 'f_bjq_gaode_lng':"",
1497
+ 'f_bjq_gaode_lat':""
1498
+ }
1499
+
1500
+ let bjqststedata = {
1501
+ "sid":"",
1502
+ "bjqtype":"",
1503
+ "f_process_id":"",
1504
+ "bjqstate":"",
1505
+ "f_userinfo_code":""
1506
+ }
1507
+ let numOne = [];
1508
+
1509
+ let http = new HttpResetClass()
1510
+ let data = {
1511
+ tablename: `t_material_apply`,
1512
+ condition: `f_process_id='${this.show_data.f_process_id}'`
1513
+ }
1514
+ let res = await http.load(
1515
+ 'POST',
1516
+ `rs/sql/singleTable`,
1517
+ {data: data},
1518
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
1519
+ )
1520
+ res.data.forEach(item => {
1521
+ if (item.f_material_name.substr(0,3) === '报警器'){
1522
+ var bjname = item.f_material_name.split("-")
1523
+ bjqststedata.sid = item.f_bjq_sid
1524
+ bjqststedata.f_process_id = item.f_process_id
1525
+ bjqststedata.bjqtype = bjname[1]
1526
+ //====================================
1527
+ bjqlag = true
1528
+ datatemp.bjqid = item.id
1529
+ datatemp.fprocessid = item.f_process_id
1530
+ datatemp.f_bjq_sid = item.f_bjq_sid
1531
+ datatemp.f_material_code = item.f_material_code
1532
+ datatemp.f_bjq_lng = item.f_bjq_lng
1533
+ datatemp.f_bjq_lat = item.f_bjq_lat
1534
+ datatemp.f_bjq_gaode_lng = item.f_bjq_gaode_lng
1535
+ datatemp.f_bjq_gaode_lat = item.f_bjq_gaode_lng
1536
+ datatemp.f_bjq_baidu_lng = item.f_bjq_baidu_lng
1537
+ datatemp.f_bjq_baidu_lat = item.f_bjq_baidu_lat
1538
+ numOne.push(item.f_bjq_sid)
1539
+ }
1540
+ })
1541
+
1542
+ // this.show_data.onetomany.forEach(item=>{
1543
+ // console.log("查看报警器材料",item)
1544
+ // item.rows.forEach(i=>{
1545
+ // if (i.f_material_name.substr(0,3) === '报警器'){
1546
+ // var bjname = i.f_material_name.split("-")
1547
+ // bjqststedata.sid = i.f_bjq_sid
1548
+ // bjqststedata.f_process_id = i.f_process_id
1549
+ // bjqststedata.bjqtype = bjname[1]
1550
+ // //====================================
1551
+ // bjqlag = true
1552
+ // datatemp.bjqid = i.id
1553
+ // datatemp.fprocessid = i.f_process_id
1554
+ // datatemp.f_bjq_sid = i.f_bjq_sid
1555
+ // datatemp.f_material_code = i.f_material_code
1556
+ // numOne.push(i.f_bjq_sid)
1557
+ // }
1558
+ // })
1559
+ // })
1560
+ if (!bjqlag){
1561
+ this.$showMessage('请添加报警器物料信息!!!')
1562
+ return
1563
+ }
1564
+ if (numOne.length > 1){
1565
+ this.$showMessage("暂时支持单个报警器物料安装!!!")
1566
+ return
1567
+ }
1568
+ datatemp.sqvalue = this.show_data.areaData.sqvalue
1569
+ datatemp.f_bjq_baidu_lng = this.show_data.templatlng.baidutemplng
1570
+ datatemp.f_bjq_baidu_lat = this.show_data.templatlng.baidutemplat
1571
+ datatemp.f_bjq_gaode_lng = this.show_data.templatlng.gaodetemplng
1572
+ datatemp.f_bjq_gaode_lat = this.show_data.templatlng.gaodetemplat
1573
+ datatemp.f_bjq_lng = this.show_data.templatlng.baidutemplng
1574
+ datatemp.f_bjq_lat = this.show_data.templatlng.baidutemplat
1575
+
1576
+ bjqststedata.f_userinfo_code = this.show_data.f_userinfo_code
1577
+
1578
+ //判断是否推送 及推送的状态
1579
+ //查询是否存在, 以型号及厂家判断
1580
+ let bjqres = await this.$resetpost(
1581
+ `rs/logic/getbjqsyncinfo`,
1582
+ bjqststedata
1583
+ )
1584
+ if (bjqres.data.bjqstate != "成功"){
1585
+ //区域地址存入材料记录表
1586
+ let areares = await this.$resetpost(
1587
+ `rs/logic/saveArea`,
1588
+ {data: datatemp},
1589
+ {resolveMsg: null, rejectMsg: '区域地址保存失败'}
1590
+ )
1591
+
1592
+ //完工之后推送数据到汉威
1593
+ let adddata = {
1594
+ f_bjq_sid : datatemp.f_bjq_sid,
1595
+ f_material_code : datatemp.f_material_code,
1596
+ f_bjq_address: this.show_data.areaData.sqvalue,
1597
+ f_user_name: this.show_data.f_user_name,
1598
+ f_address: this.show_data.f_address,
1599
+ f_user_phone: this.show_data.f_phone,
1600
+ f_userinfo_code: this.show_data.f_userinfo_code,
1601
+ installtime: this.show_data.f_construction_date,
1602
+ f_orgid : this.show_data.f_orgid,
1603
+ f_bjq_lng: datatemp.f_bjq_baidu_lng,
1604
+ f_bjq_lat: datatemp.f_bjq_baidu_lat
1605
+ }
1606
+ let res = await this.$resetpost(
1607
+ `ncc/rs/logic/bjqadduser`,
1608
+ // `rs/logic/bjqadduser`,
1609
+ adddata
1610
+ )
1611
+ if (res.data.code != 200){
1612
+ if (bjqres.data.bjqstate.length == 0){
1613
+ bjqststedata.bjqstate = "失败"
1614
+ let bjqres3 = await this.$resetpost(
1615
+ `rs/logic/addbjqsyncinfo`,
1616
+ bjqststedata
1617
+ )
1618
+ }
1619
+ this.$showMessage(res.data.msg)
1620
+ return
1621
+ }
1622
+ //更改记录表状态
1623
+ if (bjqres.data.bjqstate === "失败"){
1624
+ bjqststedata.bjqstate = "成功"
1625
+ let bjqres1 = await this.$resetpost(
1626
+ `rs/logic/updatebjqsyncinfo`,
1627
+ bjqststedata
1628
+ )
1629
+ }else{
1630
+ bjqststedata.bjqstate = "成功"
1631
+ let bjqres2 = await this.$resetpost(
1632
+ `rs/logic/addbjqsyncinfo`,
1633
+ bjqststedata
1634
+ )
1635
+ }
1636
+ }
1637
+ }
1638
+ if ((this.show_data.f_apply_type === '工商户报建' || this.show_data.f_apply_type === '团购报建')
1639
+ && (this.show_data.defname === '报装申请') && this.show_data.button.button_name === '提交'){
1640
+ await this.contract_number()
1641
+ }
1642
+ // if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && (this.show_data.button.button_name === '保存'||this.show_data.button.button_name === '提交')){
1643
+ // let dataz = {
1644
+ // condition: `u.id = ${this.show_data.id}`,
1645
+ // data: {
1646
+ // id: this.$login.f.id,
1647
+ // orgid: this.$login.f.orgid
1648
+ // }
1649
+ // }
1650
+ // let http = new HttpResetClass()
1651
+ // let restpz = await http.load(
1652
+ // 'POST',
1653
+ // `rs/sql/checkuser`,
1654
+ // {data: dataz},
1655
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1656
+ // )
1657
+ // this.show_data.actid=restpz.data[0].actid
1658
+ // }
1659
+ debugger
1660
+ let res = await this.$resetpost(
1661
+ `rs/logic/ApplyProductService`,
1662
+ {data: this.show_data},
1663
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
1664
+ )
1665
+
1666
+
1667
+ if (this.show_data.button.after) {
1668
+ this[this.show_data.button.after]()
1669
+ }
1670
+ // 改管报建 增容报建 优化
1671
+ if((this.show_data.f_apply_type === '改管报建'||this.show_data.f_apply_type === '增容报建') && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '缴费'){
1672
+ let datagg = {
1673
+ condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1674
+ }
1675
+ let http = new HttpResetClass()
1676
+ let restgg = await http.load(
1677
+ 'POST',
1678
+ `rs/sql/checkusertwo`,
1679
+ {data: datagg},
1680
+ {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1681
+ )
1682
+ debugger
1683
+ if(this.show_data.f_apply_type === '改管报建'){
1684
+ restgg.data[0].processname = '改管报建流程'
1685
+ restgg.data[0].defname = '报装缴费'
1686
+ }else{
1687
+ restgg.data[0].processname = '增容报建流程'
1688
+ restgg.data[0].defname = '报装缴费'
1689
+ }
1690
+ restgg.data[0].actid = restgg.data[0].actid + 1
1691
+ this.$dispatch('apply',restgg.data[0])
1692
+
1693
+ }
1694
+
1695
+ // 退款报建 优化
1696
+ if(this.show_data.f_apply_type === '退款报建' && this.show_data.defname === '终止报建' && this.show_data.button.button_name === '提交'){
1697
+ let datatk = {
1698
+ condition: `t.f_process_id='${this.show_data.f_process_id}'`,
1699
+ }
1700
+ let http = new HttpResetClass()
1701
+ let resttk = await http.load(
1702
+ 'POST',
1703
+ `rs/sql/checkusertwo`,
1704
+ {data: datatk},
1705
+ {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1706
+ )
1707
+ debugger
1708
+ resttk.data[0].processname = '退款报建流程'
1709
+ resttk.data[0].defname = '退款'
1710
+ this.$dispatch('apply',resttk.data[0])
1711
+
1712
+ }
1713
+
1714
+ //
1715
+ // if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装申请' && this.show_data.button.button_name === '合同'){
1716
+ // let data = {
1717
+ // tablename: 't_apply',
1718
+ // condition: `f_process_id='${this.show_data.f_process_id}'`
1719
+ // }
1720
+ // let http = new HttpResetClass()
1721
+ // let restp = await http.load(
1722
+ // 'POST',
1723
+ // `rs/sql/singleTable`,
1724
+ // {data: data},
1725
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1726
+ // )
1727
+ // debugger
1728
+ // restp.data[0].processname = '散户报建流程'
1729
+ // restp.data[0].defname = '合同签订'
1730
+ // this.$dispatch('apply',restp.data[0])
1731
+ //
1732
+ // } else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '合同签订' && this.show_data.button.button_name === '提交'){
1733
+ // let data2 = {
1734
+ // condition: `u.id = ${this.show_data.id}`,
1735
+ // data: {
1736
+ // id: this.$login.f.id,
1737
+ // orgid: this.$login.f.orgid
1738
+ // }
1739
+ // }
1740
+ // let http = new HttpResetClass()
1741
+ // let restp1 = await http.load(
1742
+ // 'POST',
1743
+ // `rs/sql/checkuser`,
1744
+ // {data: data2},
1745
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1746
+ // )
1747
+ // debugger
1748
+ // console.log('有没有发请求打印查询的内容restp1',restp1)
1749
+ // // restp1.data[0].processname = '散户报建流程'
1750
+ // // restp1.data[0].defname = '报装缴费'
1751
+ // this.$dispatch('apply',restp1.data[0])
1752
+ // }else if(this.show_data.f_apply_type === '散户报建' && this.show_data.defname === '报装缴费' && this.show_data.button.button_name === '提交'){
1753
+ // let data3 = {
1754
+ // condition: `u.id = ${this.show_data.id}`,
1755
+ // data: {
1756
+ // id: this.$login.f.id,
1757
+ // orgid: this.$login.f.orgid
1758
+ // }
1759
+ // }
1760
+ // let http = new HttpResetClass()
1761
+ // let restp2 = await http.load(
1762
+ // 'POST',
1763
+ // `rs/sql/checkuser`,
1764
+ // {data: data3},
1765
+ // {resolveMsg: null, rejectMsg: '报建数据查询失败!!!'}
1766
+ // )
1767
+ // debugger
1768
+ // console.log('打印查询的内容',restp2)
1769
+ // if(restp2.length>0){
1770
+ // this.$dispatch('apply',restp2.data[0])
1771
+ // }else{
1772
+ // debugger
1773
+ // this.$dispatch('loadPage')
1774
+ // }
1775
+ // }
1776
+ // else{
1777
+ // this.$dispatch('loadPage')
1778
+ // }
1779
+ this.$dispatch('loadPage')
1780
+
1781
+ },
1782
+ // 失去焦点出触发事件
1783
+ 'onchange' (index) {
1784
+ debugger
1785
+ if(this.show_data.defname==='移交' && this.show_data.f_is_have==='否'){
1786
+ this.show_data.buttons[1].hidden = true
1787
+ }else{
1788
+ this.show_data.buttons[1].hidden = false
1789
+ }
1790
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
1791
+ if (
1792
+ this.show_data.fields[index].label === '区/县' ||
1793
+ this.show_data.fields[index].label === '街道/乡镇' ||
1794
+ this.show_data.fields[index].label === '集收单位' ||
1795
+ this.show_data.fields[index].label === '楼号/组' ||
1796
+ this.show_data.fields[index].label === '单元/排' ||
1797
+ this.show_data.fields[index].label === '楼层' ||
1798
+ this.show_data.fields[index].label === '门牌号'
1799
+ ) {
1800
+
1801
+ let f_pcd = this.getLableValue('区/县') || ''
1802
+ let f_street = this.getLableValue('街道/乡镇') || ''
1803
+ let f_residential_area = this.getLableValue('集收单位') || ''
1804
+ let f_building = this.getLableValue('楼号/组') || ''
1805
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
1806
+ let f_unit = this.getLableValue('单元/排') || ''
1807
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
1808
+ let f_floor = this.getLableValue('楼层') || ''
1809
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
1810
+ let f_room = this.getLableValue('门牌号') || ''
1811
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
1812
+
1813
+ 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
1814
+ this.setLabelValue("地址", f_address)
1815
+ }
1816
+ }
1817
+ },
1818
+ selectSearch (val, index) {},
1819
+ 'onblur' (index) {},
1820
+ 'oninput' (index) {},
1821
+ 'initializtionView' () {},
1822
+ async 'onchangeModal' (index, fieldIndex) {
1823
+ },
1824
+ async 'onblurModal' (index, fieldIndex) {
1825
+
1826
+ },
1827
+ async 'oninputModal' (index, fieldIndex) {
1828
+
1829
+ },
1830
+ async 'onetomanydelete' (index, rowIndex) {
1831
+
1832
+ let http = new HttpResetClass()
1833
+
1834
+ let res = await http.load(
1835
+ 'DELETE',
1836
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1837
+ null,
1838
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1839
+ )
1840
+
1841
+ res = await this.$resetpost(
1842
+ 'rs/entity/t_apply',
1843
+ this.show_data
1844
+ )
1845
+
1846
+ this.$dispatch('breakControl', this.show_data)
1847
+ },
1848
+ async 'onetomanyupdate' (index, rowIndex) {
1849
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1850
+
1851
+ this.show_data.onetomany[index].fields.forEach(item => {
1852
+ data[item.field] = item.value
1853
+ })
1854
+ let res = await this.$resetpost(
1855
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1856
+ data
1857
+ )
1858
+
1859
+ res = await this.$resetpost(
1860
+ 'rs/entity/t_apply',
1861
+ this.show_data
1862
+ )
1863
+
1864
+ this.$dispatch('breakControl', this.show_data)
1865
+ },
1866
+ async 'onetomanyadd' (index) {
1867
+ let data = {
1868
+ f_process_id : this.show_data.f_process_id,
1869
+ f_operator_id: this.$login.f.id,
1870
+ f_operator: this.$login.f.name,
1871
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1872
+ f_orgid: this.$login.f.orgid,
1873
+ f_orgname: this.$login.f.orgs
1874
+ }
1875
+ this.show_data.onetomany[index].fields.forEach(item => {
1876
+ data[item.field] = item.value
1877
+ })
1878
+ let res = await this.$resetpost(
1879
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1880
+ data
1881
+ )
1882
+
1883
+ res = await this.$resetpost(
1884
+ 'rs/entity/t_apply',
1885
+ this.show_data
1886
+ )
1887
+
1888
+ this.$dispatch('breakControl', this.show_data)
1889
+ },
1890
+ async 'importEvent' (index, table, configName, filepath) {
1891
+ let data = {
1892
+ selectdata: this.show_data,
1893
+ table: table,
1894
+ filepath: filepath,
1895
+ configName: configName,
1896
+ user: this.$login.f
1897
+ }
1898
+
1899
+ let res = await this.$resetpost(
1900
+ `rs/logic/importEvent`,
1901
+ data
1902
+ )
1903
+
1904
+ this.$dispatch('breakControl', this.show_data)
1905
+ },
1906
+ 'onbutchange' (index) {
1907
+
1908
+ },
1909
+ 'onbutblur' (index) {
1910
+
1911
+ },
1912
+ 'onbutinput' (index) {
1913
+
1914
+
1915
+ }
1916
+ },
1917
+ watch: {
1918
+ }
1919
+ }
1920
+ </script>
1921
+ <style scoped>
1922
+ /*清除model中的浮动*/
1923
+ .clearfix:after,.clearfix:before{
1924
+ display: table;
1925
+ }
1926
+ .clearfix:after{
1927
+ clear: both;
1928
+ }
1929
+ </style>