apply-clients 4.1.63-weinan → 4.1.64-weinan

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 (31) hide show
  1. package/index.html +30 -30
  2. package/package.json +1 -1
  3. package/src/apply.js +81 -81
  4. package/src/applyAndroid.js +52 -52
  5. package/src/components/app_apply/AppChargeManagement.vue +753 -749
  6. package/src/components/app_apply/AppInstallationDetails.vue +529 -529
  7. package/src/components/app_apply/AppProcessSupervisory.vue +214 -214
  8. package/src/components/app_apply/AppSupervisoryCart.vue +68 -68
  9. package/src/components/app_apply/AppTakePic.vue +146 -146
  10. package/src/components/app_apply/AppdevicesDetails.vue +867 -867
  11. package/src/components/app_apply/ApplyInfo.vue +56 -56
  12. package/src/components/app_apply/ApplyToDoList.vue +292 -292
  13. package/src/components/app_apply/PlaceControler.vue +274 -274
  14. package/src/components/app_apply/ServiceControl.vue +440 -440
  15. package/src/components/app_apply/ServiceView.vue +394 -394
  16. package/src/components/app_apply/materialshoufei.vue +248 -248
  17. package/src/components/product/ApplyCharge/ApplyChargeList.vue +252 -252
  18. package/src/components/product/Process/ExplorationSelect.vue +377 -377
  19. package/src/components/product/Process/ExplorationUser.vue +134 -134
  20. package/src/components/product/Process/Processes/InstallationDetails.vue +515 -515
  21. package/src/components/product/Process/Processes/chargeManagement.vue +545 -545
  22. package/src/components/product/Process/Processes/devicesDetails.vue +843 -843
  23. package/src/components/product/Process/Processes/materialshoufei.vue +187 -187
  24. package/src/components/product/Process/Service/ServiceControl.vue +1490 -1490
  25. package/src/components/product/Stop/StopApply.vue +101 -101
  26. package/src/components/product/Stop/StopApplyList.vue +266 -266
  27. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +200 -200
  28. package/src/components/product/Supervisory/SupervisoryControl.vue +124 -124
  29. package/src/components/product/Supervisory/SupervisoryList.vue +221 -221
  30. package/src/components/product/VueUtils/ApplyUpload.vue +276 -276
  31. package/src/main.js +25 -25
@@ -1,1490 +1,1490 @@
1
- <template>
2
-
3
- <div class="auto clearfix">
4
- <show-back-reason :selectdata="selectdata"></show-back-reason>
5
- <stop-install :data="show_data" v-if="stope_view"></stop-install>
6
- </div>
7
-
8
- <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
9
-
10
- </template>
11
- <script>
12
- import Vue from 'vue'
13
- import {HttpResetClass} from 'vue-client'
14
- import {getNowDate,isEmpty} from '../../../Util'
15
- // Date格式化
16
- Date.prototype.Format = function (fmt) {
17
- var o = {
18
- "M+": this.getMonth() + 1, //月份
19
- "d+": this.getDate(), //日
20
- "H+": this.getHours(), //小时
21
- "m+": this.getMinutes(), //分
22
- "s+": this.getSeconds(), //秒
23
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
24
- "S": this.getMilliseconds() //毫秒
25
- };
26
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
27
- for (var k in o)
28
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
29
- return fmt;
30
- }
31
-
32
- export default {
33
- title: '报建流程业务控制层',
34
- props: ['selectdata'],
35
- data() {
36
- return {
37
- data: null, // 数据库数据,json配置文件数据的数据集合
38
- json_datas: null, // Json配置文件集合
39
- showview: false, // 控制显示service-view组件
40
- show_data: null, // 给view层显示的数据
41
- stope_view: false
42
- }
43
-
44
- },
45
- created () {
46
- this.refurbish()
47
- },
48
- ready(){
49
- },
50
- methods: {
51
- stopapply(model1,model){
52
- this.$showMessage('确定不具备条件,终止报建!',['confirm', 'cancel']).then((res)=>{
53
- if (res=='confirm'){
54
- this.selectdata = Object.assign( {},this.selectdata,model)
55
- let data = {
56
- loginUser: Vue.this.$login.f,
57
- selectdata: this.selectdata,
58
- model: model1
59
- }
60
- let http = new HttpResetClass()
61
- http.load('POST', 'rs/logic/stopApply', {data: data}, {resolveMsg: null,rejectMsg: '删除失败'})
62
- .then(res => {
63
- if (res.data === 200) {
64
- this.$dispatch('search')
65
- this.$dispatch('close')
66
- } else {
67
- this.$showMessage('终止报建失败')
68
- }
69
- })
70
- }
71
- })
72
- },
73
- // 组件初始化操作
74
- refurbish() {
75
- this.json_datas = this.$workflow_vue
76
- let sum = 0
77
- let jsonData = {}
78
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length == 0) {
79
- this.$showMessage("网络故障,请刷新页面")
80
- return
81
- }
82
- for (let i = 0; i < this.json_datas.activitys.length; i++) {
83
- if (this.selectdata.defname == this.json_datas.activitys[i].title) {
84
- jsonData = this.json_datas.activitys[i] // 拿到当前节点的json配置信息
85
- sum++ // 节点名一样的个数
86
- }
87
- }
88
- if (sum == 1) {
89
- this.data = null
90
- this.data = jsonData
91
- // selectdata 填充 data
92
- this.data = Object.assign({}, this.data, this.selectdata)
93
- this.initializeJSON()
94
- } else if (sum == 0) {
95
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
96
- } else {
97
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
98
- }
99
- },
100
- // json配置数据处理
101
- async initializeJSON() {
102
- // 有默认值,value就给默认值,没有就是null
103
- for (const item of this.data.fields) {
104
- if (!item.value) {
105
- if (item.value === 0) {
106
- item.value = 0
107
- } else {
108
- item.value = null
109
- }
110
- }
111
- if (item.default || item.default == 0) {
112
- if(item.type === 'datepicker'){
113
- item.value = ''
114
- }else {
115
- item.value = item.default
116
- }
117
- }
118
- if (this.selectdata[item.field]) {
119
- // 将json字符串格式化赋值给value
120
- if (String(this.selectdata[item.field]).startsWith("{")) {
121
- item.value = JSON.parse(this.selectdata[item.field])
122
- this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
123
- } else {
124
- item.value = this.selectdata[item.field]
125
- }
126
- } else {
127
- if (this.selectdata[item.field] === 0) {
128
- item.value = 0
129
- }
130
- }
131
-
132
- // datepicker 没有值给当时值
133
- if (item.type === 'datepicker' && !item.value && item.default) {
134
- item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
135
- }
136
-
137
- // 如果配置类型为select,优先从参数列表获取options
138
- if (item.type === 'select') {
139
- let temp = null
140
-
141
- temp = this.$appdata.getParam(item.label)
142
-
143
- if (temp && temp.length > 0 && item.label) {
144
- item.options = temp
145
- } else {
146
- if (item.paramLabel) {
147
- temp = this.$appdata.getParam(item.paramLabel)
148
- if (temp && temp.length > 0) {
149
- item.options = temp
150
- }
151
- }
152
- }
153
- if (item.ready) {
154
- item.options = await this[item.ready]()
155
- }
156
- }
157
- }
158
-
159
- // 控制组件
160
- if (this.data.components) {
161
- this.data.components.forEach(item => {
162
- if (!item.mark) {
163
- item.mark = 0
164
- }
165
- })
166
- }
167
-
168
- // 初始化 fields 可对数据进行特殊处理
169
- this.initializeFields()
170
-
171
- // 初始化 buttons_fields
172
- for (let i = 0; i < this.data.buttons.length; i++) {
173
- // 下发按钮相关配置
174
- if (this.data.buttons[i].button_name === '下发') {
175
- if (this.data.buttons[i].button_fields && this.data.buttons[i].button_fields.length === 1) {
176
- if (this.data.buttons[i].source){
177
- let http = new HttpResetClass()
178
- let res = await http.load('POST', 'rs/search', {
179
- source: this.data.buttons[i].source,
180
- userid: this.$login.f.id
181
- }, {resolveMsg: null, rejectMsg: null})
182
-
183
- let options = []
184
- for (let i = 0; i < res.data.length; i++) {
185
- options.push(
186
- {
187
- "label": res.data[i].name,
188
- "value": res.data[i].id
189
- }
190
- )
191
- }
192
- this.data.buttons[i].button_fields[0]['options'] = options
193
- } else {
194
- this.$showMessage("请配置获取人员表达式")
195
- }
196
- } else {
197
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
198
- }
199
- }
200
- if (this.data.buttons[i].button_fields) {
201
- this.data.buttons[i].button_fields.forEach(x => {
202
- // 如果配置类型为select,优先从参数列表获取options
203
- if (x.type === 'select' && this.$appdata.getParam(x.label)) {
204
- x.options = this.$appdata.getParam(x.label).trim()
205
- }
206
- })
207
- }
208
- }
209
-
210
- // onetomany 数据获取
211
- if (this.data.onetomany) {
212
- for (let index = 0; index < this.data.onetomany.length; index++) {
213
- let res = null
214
- if (!this.data.onetomany[index].queryEvent || this.data.onetomany[index].queryEvent === 'default'){
215
- let http = new HttpResetClass()
216
- let data = {
217
- tablename: this.data.onetomany[index].tables[0],
218
- condition: `f_process_id='${this.selectdata.f_process_id}'`
219
- }
220
- res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
221
- resolveMsg: null,
222
- rejectMsg: 'onetomany查询失败'
223
- })
224
- } else {
225
- res = this[this.data.onetomany[index].queryEvent]()
226
- }
227
-
228
- // 初始化 onetomany
229
- this.data.onetomany[index].rows = res.data
230
-
231
- // 初始化onetomany中的fields
232
- for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
233
- if (!this.data.onetomany[index].fields[j].value) {
234
- if (this.data.onetomany[index].fields[j].value === 0) {
235
- this.data.onetomany[index].fields[j].value = 0
236
- } else {
237
- this.data.onetomany[index].fields[j].value = null
238
- }
239
- }
240
- if (this.data.onetomany[index].fields[j].default || this.data.onetomany[index].fields[j].default == 0) {
241
- this.data.onetomany[index].fields[j].value = this.data.onetomany[index].fields[j].default
242
- }
243
- // 如果配置类型为select,优先从参数列表获取options
244
- if (this.data.onetomany[index].fields[j].type === 'select') {
245
- let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
246
- if (temp && temp.length > 0) {
247
- this.data.onetomany[index].fields[j].options = temp
248
- }
249
- }
250
- }
251
- }
252
- }
253
-
254
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
255
- let temp = JSON.parse(JSON.stringify(this.data))
256
-
257
- this.show_data = temp
258
- this.$nextTick(() => {
259
- this.showview = true
260
- })
261
- // 初始化加载
262
- // ========================= 中盛 =================================
263
-
264
- if (this.selectdata.defname === '报建登记') {
265
- let http = new HttpResetClass()
266
- let condition = "f_filialeid = " + this.$login.f.orgid
267
- let res = await http.load('POST','rs/sql/apply_singleTable',{data:{tablename:'t_area',condition:condition}}, {resolveMsg: null, rejectMsg: null})
268
- for (let i = 0; i < this.show_data.fields.length; i++) {
269
-
270
- if (this.show_data.fields[i].label == '街道') {
271
- let data = []
272
- let array = []
273
- data = res.data.map(item => {
274
- return item.f_street;
275
- })
276
- for (let q = 0; q < data.length; q++) {
277
- let arraydata = {
278
- 'label': data[q],
279
- 'value': data[q]
280
- }
281
- if (array.length != 0) {
282
- for (let w = 0; w < array.length; w++) {
283
- if (array[w].label == data[q]) {
284
- break
285
- }
286
- while (w == array.length - 1) {
287
- array.push(arraydata)
288
- break
289
- }
290
- }
291
- } else {
292
- array.push(arraydata)
293
- }
294
- }
295
- this.show_data.fields[i].options = array
296
- console.log("街道选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
297
- }
298
- if (this.show_data.fields[i].label == '小区') {
299
- let data = []
300
- let array = []
301
- data = res.data.map(item => {
302
- return item.f_residential_area;
303
- })
304
- for (let q = 0; q < data.length; q++) {
305
- let arraydata = {
306
- 'label': data[q],
307
- 'value': data[q]
308
- }
309
- if (array.length != 0) {
310
- for (let w = 0; w < array.length; w++) {
311
- if (array[w].label == data[q]) {
312
- break
313
- }
314
- while (w == array.length - 1) {
315
- array.push(arraydata)
316
- break
317
- }
318
- }
319
- } else {
320
- array.push(arraydata)
321
- }
322
- }
323
- this.show_data.fields[i].options = array
324
- console.log("小区选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
325
- }
326
- }
327
- }
328
- if (this.selectdata.defname === '施工') {
329
- // for (let i = 0; i < this.show_data.fields.length; i++) {
330
- // if (this.show_data.fields[i].label == '工程状态') {
331
- // this.show_data.fields[i].value = ''
332
- // }
333
- // }
334
- for (const item of this.show_data.fields) {
335
- if (item.label === '工程状态' && !item.value) {
336
- return item.value = '未开工'
337
- }
338
- }
339
- }
340
- if (this.selectdata.defname === '现场勘察'|| this.selectdata.defname ==='入户安装') {
341
- for (const item of this.show_data.fields) {
342
- if (item.label === '现场勘察人员' && !item.value) {
343
- return item.value = this.$login.f.name
344
- }
345
- }
346
- }
347
- },
348
- // 初始化fields值
349
- initializeFields() {
350
-
351
- },
352
- // 金额转大写
353
- smalltoBIG(n) {
354
- let fraction = ['角', '分'];
355
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
356
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
357
- let head = n < 0 ? '欠' : '';
358
- n = Math.abs(n);
359
-
360
- let s = '';
361
-
362
- for (var i = 0; i < fraction.length; i++) {
363
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
364
- }
365
- s = s || '整';
366
- n = Math.floor(n);
367
-
368
- for (var i = 0; i < unit[0].length && n > 0; i++) {
369
- let p = '';
370
- for (var j = 0; j < unit[1].length && n > 0; j++) {
371
- p = digit[n % 10] + unit[1][j] + p;
372
- n = Math.floor(n / 10);
373
- }
374
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
375
- }
376
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
377
- },
378
- getLableValue(label) {
379
- for (const item of this.show_data.fields) {
380
- if (item.label === label && item.type !== 'number') {
381
- return item.value || ''
382
- }
383
- if (item.label === label && item.type === 'number') {
384
- return item.value || 0
385
- }
386
- }
387
- },
388
- setLabelValue(label, value) {
389
- for (const item of this.show_data.fields) {
390
- if (item.label === label) {
391
- item.value = value
392
- }
393
- }
394
- },
395
- setLabelOptions(label, options) {
396
- for (const item of this.show_data.fields) {
397
- if (item.label === label) {
398
- item.options = options
399
- }
400
- }
401
- },
402
- showLabels(...labels) {
403
- for (const item of this.show_data.fields) {
404
- if (labels.includes(item.label)) {
405
- item.hidden = false
406
- }
407
- }
408
- },
409
- hideLabels(...labels) {
410
- for (const item of this.show_data.fields) {
411
- if (labels.includes(item.label)) {
412
- item.hidden = true
413
- }
414
- }
415
- },
416
- requiredLabels(...labels) {
417
- for (const item of this.show_data.fields) {
418
- if (labels.includes(item.label)) {
419
- item.required = true
420
- }
421
- }
422
- },
423
- electiveLabels(...labels) {
424
- for (const item of this.show_data.fields) {
425
- if (labels.includes(item.label)) {
426
- item.required = false
427
- }
428
- }
429
- },
430
- readonlyLabels(...labels) {
431
- for (const item of this.show_data.fields) {
432
- if (labels.includes(item.label)) {
433
- item.readonly = true
434
- item.disabled = true
435
- }
436
- }
437
- },
438
- readwriteLabels(...labels) {
439
- for (const item of this.show_data.fields) {
440
- if (labels.includes(item.label)) {
441
- item.readonly = false
442
- item.disabled = false
443
- }
444
- }
445
- },
446
- showButtons(...buttons) {
447
- for (const item of this.show_data.buttons) {
448
- if (buttons.includes(item.button_name)) {
449
- item.hidden = false
450
- }
451
- }
452
- },
453
- hideButtons(...buttons) {
454
- for (const item of this.show_data.buttons) {
455
- if (buttons.includes(item.button_name)) {
456
- item.hidden = true
457
- }
458
- }
459
- },
460
- // 获取区县
461
- async getPcd() {
462
- let data = {
463
- tablename: 't_pcd',
464
- condition: `f_filialeid = '${this.$login.f.orgid}'`
465
- }
466
- let http = new HttpResetClass()
467
- let res = await http.load(
468
- 'POST',
469
- `rs/sql/singleTable`,
470
- {data: data},
471
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
472
- )
473
-
474
- let pcd = res.data.map(item => {
475
- return {
476
- label: item.f_pcd,
477
- value: item.f_pcd
478
- }
479
- })
480
- this.setLabelOptions('区域',pcd)
481
- },
482
- // 获取气价
483
- async getPrice(f_price_id) {
484
- let data = {
485
- condition: `sp.f_orgid = '${this.$login.f.orgid}'`
486
- }
487
-
488
- if (!isEmpty(f_price_id)) {
489
- data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
490
- }
491
- let http = new HttpResetClass()
492
- let res = await http.load(
493
- 'POST',
494
- `rs/sql/applyGetPrice`,
495
- {data: data},
496
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
497
- )
498
-
499
- return res.data.map(item => {
500
- return {
501
- label: item.f_price_name,
502
- value: item
503
- }
504
- })
505
- },
506
- // 地址关联
507
- addressInitialization() {
508
- this.$getConfig(this, 'UserAddress')
509
-
510
- let f_address_type = this.show_data.f_address_type
511
-
512
- for (const item of this.show_data.fields) {
513
- if (f_address_type === '民用地址') {
514
- if (item.label === '区域' || item.label === '街道' || item.label === '小区' || item.label === '门牌号') {
515
- item.hidden = false
516
- item.required = true
517
- }
518
- if (item.label === '楼号' || item.label === '单元' || item.label === '楼层') {
519
- item.hidden = false
520
- item.required = false
521
- }
522
- if (item.label === '地址') {
523
- item.readonly = true
524
- }
525
- }
526
- if (f_address_type === '特殊地址') {
527
- if (item.label === '区域' || item.label === '街道') {
528
- item.hidden = false
529
- item.required = true
530
- }
531
- if (item.label === '小区') {
532
- item.hidden = true
533
- item.required = false
534
- }
535
- if (item.label === '楼号' || item.label === '单元' || item.label === '楼层' || item.label === '门牌号') {
536
- item.hidden = true
537
- item.required = false
538
- }
539
- if (item.label === '地址') {
540
- item.readonly = false
541
- }
542
- }
543
-
544
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
545
- item.hidden = true
546
- }
547
- }
548
- },
549
- async streetChange() {
550
- if (isEmpty(this.show_data.f_street)) {
551
- return
552
- }
553
-
554
- let data = {
555
- tablename: 't_area',
556
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
557
- }
558
- let http = new HttpResetClass()
559
- let res = await http.load(
560
- 'POST',
561
- `rs/sql/singleTable`,
562
- {data: data},
563
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
564
- )
565
-
566
- this.setLabelOptions('小区', res.data.map(item => {
567
- return {
568
- label: item.f_residential_area,
569
- value: item.f_residential_area
570
- }
571
- }))
572
- },
573
- async pcdChange() {
574
- if (isEmpty(this.show_data.f_pcd)) {
575
- return
576
- }
577
-
578
- let data = {
579
- tablename: 't_street',
580
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
581
- }
582
- let f_address_type = this.getLableValue('地址类型')
583
-
584
- if (f_address_type === '民用地址') {
585
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
586
- }
587
-
588
- let http = new HttpResetClass()
589
- let res = await http.load(
590
- 'POST',
591
- `rs/sql/singleTable`,
592
- {data: data},
593
- {resolveMsg: null, rejectMsg: '街道查询失败!!!'}
594
- )
595
-
596
- this.setLabelOptions('街道', res.data.map(item => {
597
- return {
598
- label: item.f_street,
599
- value: item.f_street
600
- }
601
- }))
602
- },
603
- async buttonBefore(model) {
604
- if (model.defname === '报建登记' && model.button.button_name === '提交') {
605
-
606
- if (model.f_is_user === '是') {
607
- if (isEmpty(model.f_user_name) || isEmpty(model.f_phone) || isEmpty(model.f_address)) {
608
- throw '用户信息未填写完整,无法提交!!!'
609
- }
610
- }
611
- }
612
- if (
613
- model.button.button_name === '提交' &&
614
- model.defname === '通气点火' &&
615
- (
616
- model.f_apply_type === '散户报建' ||
617
- model.f_apply_type === '工商户报建'
618
- ) &&
619
- model.f_surplus_money > 0
620
- ) {
621
- throw '未结金额大于0,无法提交!!!'
622
- }
623
- if (model.defname === '验收是否合格' && model.button.button_name === '提交') {
624
- let http = new HttpResetClass()
625
- let data = {
626
- f_process_id: model.f_process_id
627
- }
628
- let res = await http.load('POST', 'rs/sql/notInstalled', {data: data}, {resolveMsg: null, rejectMsg: null})
629
- if (res.data[0].num > 0) {
630
- throw `还有${res.data[0].num}户未安装,无法提交`
631
- }
632
- }
633
- if (
634
- model.f_apply_type === '工商户报建' &&
635
- model.button.button_name === '提交' &&
636
- (model.defname === '设计出图' || model.defname === '竣工验收' || model.defname === '合同签订' )
637
- ) {
638
- let http = new HttpResetClass()
639
- let data = {
640
- tablename: 't_files',
641
- condition: `defname = '${model.defname}' and f_blobid = '${this.selectdata.f_process_id}'`
642
- }
643
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
644
- resolveMsg: null,
645
- rejectMsg: '查询失败'
646
- })
647
- console.log("数据长度:" + res.data.length)
648
- if (res.data.length <= 0) {
649
- throw '请上传附件!!!'
650
- }
651
-
652
- }
653
- if (
654
- model.f_apply_type === '工商户报建' &&
655
- model.button.button_name === '提交' &&
656
- model.defname === '报建登记'
657
- ) {
658
- let http = new HttpResetClass()
659
- let data = {
660
- tablename: 't_files',
661
- condition: `defname = '${model.defname}' and f_blobid = '${this.selectdata.f_process_id}'`
662
- }
663
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
664
- resolveMsg: null,
665
- rejectMsg: '查询失败'
666
- })
667
- console.log("数据长度:" , res.data)
668
- if (res.data.length <= 0) {
669
- throw '请上传附件!!!'
670
- }
671
- let inc=true
672
- let name1 = ''
673
- let wenjian = ['营业执照','身份证','非居民用户申请表','灶具五证','厨房设备布置设计图']
674
- for (let name = 0;name<wenjian.length;name++){
675
- let has=false
676
- for (let i=0;i<res.data.length;i++){
677
- if(res.data[i].f_filename.includes(wenjian[name])){
678
- has=true
679
- }
680
- }
681
- if(!has){
682
- name1=name1+wenjian[name]+','
683
- inc=false
684
- }
685
- }
686
- if (inc==false){
687
- throw '请上传'+name1+'附件!!!'
688
- }
689
- /*for (let i=0;i<res.data.length;i++){
690
- if (!(
691
- res.data[i].f_filename.includes('营业执照')
692
- || res.data[i].f_filename.includes('身份证')
693
- || res.data[i].f_filename.includes('非居民用户申请表')
694
- || res.data[i].f_filename.includes('灶具五证')
695
- || res.data[i].f_filename.includes('厨房设备布置设计图')
696
- )){
697
- throw '请检查当前节点的附件,只能上传以下文件 营业执照/'
698
- return
699
- }
700
- }*/
701
- }
702
- return model
703
- },
704
- // ========================= 武安 =================================
705
- // 地址类型变化
706
- addressType() {
707
- for (const item of this.show_data.fields) {
708
- if (item.label === '小区' && this.show_data.f_address_type === '民用地址') {
709
- item.hidden = false
710
- item.required = true
711
- }
712
- if (item.label === '小区' && this.show_data.f_address_type === '特殊地址') {
713
- item.required = false
714
- }
715
- if (
716
- (
717
- item.label === '门牌号'
718
- ) && this.show_data.f_address_type === '民用地址'
719
- ) {
720
- item.required = true
721
- item.hidden = false
722
- item.value = null
723
- }
724
- if (
725
- (
726
- item.label === '楼号' ||
727
- item.label === '单元' ||
728
- item.label === '楼层'
729
- ) && this.show_data.f_address_type === '民用地址'
730
- ) {
731
- item.required = false
732
- item.hidden = false
733
- item.value = null
734
- }
735
- if (
736
- (
737
- item.label === '楼号' ||
738
- item.label === '单元' ||
739
- item.label === '楼层' ||
740
- item.label === '门牌号'
741
- ) && this.show_data.f_address_type === '特殊地址'
742
- ) {
743
- item.required = false
744
- item.hidden = true
745
- item.value = null
746
- }
747
- }
748
- this.getPcd()
749
- },
750
- getPerSon(){
751
- //查询是否有用户
752
- let http = new HttpResetClass()
753
- let data = {
754
- condition: '1=1',
755
- f_filialeid: this.$login.f.orgid,
756
- f_process_id: this.selectdata.f_process_id,
757
- }
758
- let res = http.load('POST', 'rs/sql/getAddressAanUserinfo', {data:data}, {
759
- resolveMsg: null,
760
- rejectMsg: null
761
- })
762
- return res
763
- }
764
- // ========================= 武安 =================================
765
- },
766
- events: {
767
- // 选择气价
768
- 'priceChange'(index) {
769
- if (isEmpty(this.show_data.f_stair_price_name)) {
770
- return
771
- }
772
-
773
- let stairPrice = this.getLableValue('气价名称')
774
- console.log("气价信息", stairPrice)
775
- this.setLabelValue('气价类型', stairPrice.f_price_type)
776
- this.setLabelValue('用气性质', stairPrice.f_gasproperties)
777
- this.setLabelValue('气价', stairPrice.f_price)
778
- this.selectdata.f_price_id = stairPrice.f_price_id
779
- this.selectdata.f_price_name = stairPrice.f_price_name
780
- },
781
- // ========================= 武安 =================================
782
- // ========================= 武安 =================================
783
- 'openAddModel'(index) {
784
- // ========================= 武安 =================================
785
- // ========================= 武安 =================================
786
- },
787
- // 获取view层button事件/
788
- async 'button'(model) {
789
- model = Object.assign({}, this.selectdata, model)
790
- if(this.show_data.components.length>0 && model.button.button_name === '提交') {
791
- for (let i = 0; i < this.show_data.components.length; i++) {
792
- if (this.show_data.components[i].name == 'apply-address-userinfo-management') {
793
- let result = await this.getPerSon()
794
- if (result.data.length == 0) {
795
- this.$showAlert('请录入用户信息', 'warning', 3000)
796
- return
797
- }
798
- }
799
- }
800
- }
801
- // 点击重置按钮就重置数据
802
- if (model.button.button_name === '重置') {
803
- this.$dispatch('breakControl', this.data)
804
- return
805
- }
806
- // 提交前置
807
- try {
808
- model = await this.buttonBefore(model)
809
- } catch (e) {
810
- this.$showAlert(e, 'warning', 3000)
811
- return
812
- }
813
- if (model.f_entry_name && model.defname == '报建登记'){
814
- let http = new HttpResetClass()
815
- let data = {
816
- tablename:'t_apply',
817
- condition:`f_entry_name = '${model.f_entry_name}'`
818
- }
819
- let res = await http.load('post','rs/sql/singleTable', {data:data},{
820
- resolveMsg: null,
821
- rejectMsg: '查询失败'})
822
- debugger
823
- if (res.data.length > 0){
824
- this.$showMessage('项目名称不能重复,请重新输入!!!')
825
- return
826
- }
827
- }
828
- let http = new HttpResetClass()
829
- if((this.selectdata.defname =='现场勘察' || this.selectdata.defname ==='入户安装') && model.f_is_have == '否'&& model.button.button_name == '提交'){
830
- let model1 ={
831
- f_stop_remarks : '不具备安装条件'
832
- }
833
- this.stopapply(model1,model)
834
- return
835
- }
836
- if((this.selectdata.defname =='现场勘察' || this.selectdata.defname ==='入户安装') && model.f_is_aerate == '否' && model.button.button_name == '提交'){
837
- let model1 ={
838
- f_stop_remarks : '未通气'
839
- }
840
- this.stopapply(model1,model)
841
- return
842
- }
843
- if( this.selectdata.defname ==='入户安装'&& model.button.button_name == '提交'){
844
- let data = {
845
- condition: " 1=1",
846
- f_process_id: this.selectdata.f_process_id
847
- }
848
- let res1 = await http.load('POST', 'rs/sql/getAddresAndUserinfoAndUserfilesAmount', {data:data}, {
849
- resolveMsg: null,
850
- rejectMsg: null
851
- })
852
- debugger
853
- if (res1.data[0].f_userfiles_num===null){
854
- this.$showMessage("请填写表具信息!!!")
855
- return
856
- }
857
-
858
- }
859
- let requestData = {
860
- tables: this.data.tables,
861
- start_activity: this.$workflow_vue.start_activity,
862
- model: model,
863
- loginUser: this.$login.f,
864
- workflow_gxmlfilename: this.$workflow_vue.workflow_xmlfilename
865
- }
866
- console.log("gwfwe",this.selectdata)
867
- // 下发,提交,保存,退回通用业务后台处理logic
868
- let url = 'rs/logic/ApplyProductService'
869
- let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
870
- if (res.data.code === 200) {
871
- this.$dispatch('search')
872
- } else {
873
- if (res.data.msg) {
874
- this.$showMessage(res.data.msg)
875
- }
876
- }
877
- },
878
- async 'initializtionView'() {
879
- // ========================= 武安 =================================
880
- this.addressType()
881
- // ========================= 武安 =================================
882
- },
883
- // 失去焦点出触发事件
884
- async 'onchange'(index) {
885
- console.log('失去焦点')
886
- // ========================= 武安 =================================
887
- if (this.show_data.defname === '报建登记' || this.show_data.defname === '业务申请'){
888
- if (this.show_data.fields[index].label === '是否具备安装条件') {
889
- for (const button of this.show_data.buttons) {
890
- if (this.show_data.fields[index].value === '否'&& button.button_name === '退回') {
891
- button.hidden = false
892
- }else {
893
- button.hidden = true
894
- }
895
- }
896
- }
897
- if (this.show_data.fields[index].label === '地址类型'){
898
- this.addressType()
899
- }
900
- if (this.show_data.fields[index].label === '项目名称'){
901
- let http = new HttpResetClass()
902
- let data = {
903
- tablename:'t_apply',
904
- condition:`f_entry_name = '${this.show_data.fields[index].value}'`
905
- }
906
- let res = await http.load('post','rs/sql/singleTable', {data:data},{
907
- resolveMsg: null,
908
- rejectMsg: '查询失败'})
909
- if (res.data.length > 0){
910
- this.$showMessage('项目名称不能重复,请重新输入!!!')
911
- this.show_data.fields[index].value = ''
912
- }
913
- }
914
- // if (this.show_data.fields[index].label === '街道'){
915
- // console.log('-----------添加街道-----------')
916
- // if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
917
- // this.show_data.fields[index].value = null
918
- // this.$showAlert('街道地址不能为空!!!', 'warning', 3000)
919
- // return
920
- // }
921
- // let http = new HttpResetClass()
922
- // let data = {
923
- // f_adjustable_id: '', // 调压箱编号
924
- // f_orgid: this.$login.f.orgid, // 组织id
925
- // f_orgname: this.$login.f.orgs, // 组织名
926
- // f_pcd: '河北省邯郸市武安市', // 省市区
927
- // f_pcd_id: 8, // 省市区id
928
- // // f_pcd_id: 124, // 50.4测试
929
- // f_slice_area: '', // 片区
930
- // f_operatorid: this.$login.f.id, // 操作人id
931
- // f_operator: this.$login.f.name, // 操作人
932
- // f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
933
- // f_street: this.show_data.fields[index].value.trim(), // 地址
934
- // f_comments: '报建系统自动创建' // 备注
935
- // }
936
- // try {
937
- // let res = await http.load('POST', 'rs/logic/address_updatestreet', {data: data}, {
938
- // resolveMsg: null,
939
- // rejectMsg: null
940
- // })
941
- // } catch (e) {
942
- // if (e.status === 635) {
943
- // this.$showAlert('此街道已存在!!!', 'warning', 3000)
944
- // } else {
945
- // this.$showAlert('自动添加街道失败,请手动添加!!!', 'danger', 3000)
946
- // }
947
- // }
948
- // }
949
- // if (this.show_data.fields[index].label === '小区') {
950
- // if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
951
- // this.show_data.fields[index].value = null
952
- // this.$showAlert('小区名称不能为空!!!', 'warning', 3000)
953
- // return
954
- // }
955
- // // 先查询街道
956
- // let street = null
957
- // for (const item of this.show_data.fields) {
958
- // if (item.label === '街道') {
959
- // if (item.value.trim() === null || item.value.trim() === '') {
960
- // this.show_data.fields[index].value = null
961
- // this.$showAlert('请先录入街道信息,才能录入小区信息!!!', 'warning', 3000)
962
- // return
963
- // }
964
- // let http = new HttpResetClass()
965
- // let data = {
966
- // condition: `1=1 and s.f_filialeid in ('${this.$login.f.orgid}') and f_province = '河北省' and f_city = '邯郸市' and f_district = '武安市' and f_street = '${item.value.trim()}'`
967
- // }
968
- // let res = await http.load('POST', 'rs/sql/address_getstreetlist', {data: data}, {
969
- // resolveMsg: null,
970
- // rejectMsg: null
971
- // })
972
- // if (res.data.length > 0) {
973
- // street = res.data[0]
974
- // } else {
975
- // this.show_data.fields[index].value = null
976
- // this.$showAlert(`【${item.value}】街道不存在,请手动添加或重新输入街道信息,在录入小区信息!!!`, 'warning', 3000)
977
- // }
978
- // }
979
- // }
980
- // console.log('-----------添加小区-----------')
981
- // let data = {
982
- // f_linkname: '', // 联系人
983
- // f_linkphone: '', // 联系电话
984
- // f_adjustable_id: '', // 调压箱编号
985
- // f_user_type: '', // 用户类型
986
- // f_gasproperties: '', // 用气性质
987
- // f_meter_brand: '', // 气表品牌
988
- // f_price_name: '', // 气价名称
989
- // f_price_type: '', // 气价类型
990
- // f_meter_style: '', // 气表型号
991
- // f_position: '', // 表安装位置
992
- // f_meter_type: '', // 气表类型
993
- // f_area_id: '', // 小区编号 (自动生成)
994
- // f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
995
- // f_operatorid: this.$login.f.id, // 操作人id
996
- // f_operator: this.$login.f.name, // 操作人
997
- // f_orgid: this.$login.f.orgid, // 组织id
998
- // f_orgname: this.$login.f.orgs, // 组织名
999
- // f_pcd_id: 8, // 省市区id
1000
- // // f_pcd_id: 124, // 50.4测试
1001
- // f_pcd: '河北省邯郸市武安市', // 省市区
1002
- // f_street_id: street.id, // 街道id
1003
- // f_street: street.f_street,// 街道
1004
- // f_area_code: '01', // 片区编码
1005
- // f_slice_area: '武安片区', // 片区
1006
- // // f_area_code: '66556', // 50.4测试
1007
- // // f_slice_area: '武安明星', // 50.4测试
1008
- // slice_area: [
1009
- // {
1010
- // name: '武安片区',
1011
- // code: '01'
1012
- // }
1013
- // ],
1014
- // // slice_area: [ // 50.4测试
1015
- // // {
1016
- // // name: '武安明星',
1017
- // // code: '66556'
1018
- // // }
1019
- // // ],
1020
- // f_residential_area: this.show_data.fields[index].value.trim(), // 小区名称
1021
- // f_area_address: `河北省邯郸市武安市${street.f_street}`, // 详细地址(省市区+街道)
1022
- // f_comments: '报建系统自动创建'
1023
- // }
1024
- // try {
1025
- // let http = new HttpResetClass()
1026
- // let res = await http.load('POST', 'rs/logic/address_updatearea', {data: data}, {
1027
- // resolveMsg: null,
1028
- // rejectMsg: null
1029
- // })
1030
- // } catch (e) {
1031
- // if (e.status === 635) {
1032
- // this.$showAlert('此小区已存在!!!', 'warning', 3000)
1033
- // } else {
1034
- // this.$showAlert('自动添加小区失败,请手动添加!!!', 'warning', 3000)
1035
- // }
1036
- // }
1037
- // }
1038
- // 地址拼接
1039
- if (
1040
- this.show_data.fields[index].label === '区域' ||
1041
- this.show_data.fields[index].label === '街道' ||
1042
- this.show_data.fields[index].label === '小区' ||
1043
- this.show_data.fields[index].label === '楼号' ||
1044
- this.show_data.fields[index].label === '单元' ||
1045
- this.show_data.fields[index].label === '楼层' ||
1046
- this.show_data.fields[index].label === '门牌号'
1047
- ) {
1048
- let f_address = null
1049
- if (this.show_data.f_address_type !== '民用地址') {
1050
- f_address = this.getLableValue('街道') + this.getLableValue('小区')
1051
- } else {
1052
- f_address = this.getLableValue('街道') +
1053
- this.getLableValue('小区') +
1054
- this.getLableValue('楼号') +
1055
- (isEmpty(this.getLableValue('楼号')) ? '' : '号楼') +
1056
- this.getLableValue('单元') +
1057
- (isEmpty(this.getLableValue('单元')) ? '' : '单元') +
1058
- this.getLableValue('楼层') +
1059
- (isEmpty(this.getLableValue('楼层')) ? '' : '层') +
1060
- this.getLableValue('门牌号') +
1061
- (isEmpty(this.getLableValue('门牌号')) ? '' : '室')
1062
- }
1063
- this.setLabelValue('地址', f_address)
1064
- }
1065
- }
1066
-
1067
- if (this.show_data.defname === '竣工验收') {
1068
- if (this.show_data.fields[index].label === '验收是否合格'){
1069
- for (const button of this.show_data.buttons) {
1070
- if (this.show_data.fields[index].value === '否' && button.button_name === '退回') {
1071
- button.hidden = false
1072
- } else {
1073
- button.hidden = true
1074
- }
1075
- }
1076
- }
1077
- }
1078
- if (this.show_data.defname === '报建登记'&&this.show_data.f_apply_type==='工商户报建') {
1079
-
1080
- console.log("13f", this.selectdata.onetomany)
1081
- for (const button of this.show_data.buttons) {
1082
- if (this.selectdata.onetomany&& button.button_name === '提交') {
1083
- console.log("1f")
1084
- button.disable = true
1085
- }
1086
- else {
1087
- button.disable = false
1088
- console.log("2f")
1089
- }
1090
- }
1091
- }
1092
- // if (this.show_data.defname === '营业厅建档'){
1093
- // let http = new HttpResetClass()
1094
- // let data = {
1095
- // tablename: 't_userinfo',
1096
- // condition: `f_process_id='${this.selectdata.f_process_id}'`
1097
- //
1098
- // }
1099
- // let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
1100
- //
1101
- // if (this.show_data.fields[index].label === '是否已建档') {
1102
- // if (res.data[0].f_user_state === '预备') {
1103
- // this.show_data.fields[index].value = '否'
1104
- // button.hidden = false
1105
- // }else{
1106
- // this.show_data.fields[index].value = '是'
1107
- // button.hidden = true
1108
- // }
1109
- // }
1110
- // }
1111
- if(this.show_data.defname === '现场勘察' || this.show_data.defname ==='入户安装') {
1112
- console.log("this.shdata",this.show_data)
1113
- if (this.show_data.fields[index].label === '是否具备安装条件') {
1114
- for (const button of this.show_data.buttons) {
1115
- if (this.show_data.fields[index].value === '否'&& button.button_name === '退回') {
1116
- button.hidden = false
1117
- }else {
1118
- button.hidden = true
1119
- }
1120
- }
1121
- }
1122
- }
1123
- // if (this.show_data.defname === '通气点火'){
1124
- // let http = new HttpResetClass()
1125
- // let data = {
1126
- // tablename: 't_firemessage',
1127
- // condition: `f_process_id='${this.selectdata.f_process_id}'`
1128
- //
1129
- // }
1130
- // let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
1131
- // console.log("res")
1132
- // console.log(res.data)
1133
- // if (this.show_data.fields[index].label === '是否已通气') {
1134
- // if (res.data.length==0) {
1135
- // this.show_data.fields[index].value = '否'
1136
- // button.hidden = false
1137
- // }else{
1138
- // this.show_data.fields[index].value = '是'
1139
- // button.hidden = true
1140
- // }
1141
- // }
1142
- // }
1143
- if (this.show_data.defname === '合同签订') {
1144
- if (this.show_data.fields[index].label === '合同编号') {
1145
- if (!isEmpty(this.show_data.fields[index].value)) {
1146
- let http = new HttpResetClass()
1147
- let data = {
1148
- tablename: 't_apply',
1149
- condition: `f_contract_number='${this.show_data.fields[index].value}'`
1150
- }
1151
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
1152
- resolveMsg: null,
1153
- rejectMsg: '合同编号查重失败'
1154
- })
1155
- if (res.data.length > 0) {
1156
- this.show_data.fields[index].value = null
1157
- this.$showAlert('合同编号已存在!!!', 'warning', 3000)
1158
- }
1159
- //拼写合同编号
1160
- // if (this.selectdata.f_apply_type == '工商户报建') {
1161
- // this.show_data.fields[index].value = "ZS-S-" + this.show_data.fields[index].value
1162
- // // this.show_data.fields[index].value = "ZS-S-" + this.show_data.fields[index].value + "-" + new Date().Format('yyyy-MM-dd')
1163
- // }else {
1164
- // this.show_data.fields[index].value = "ZS-M-" + this.show_data.fields[index].value
1165
- // // this.show_data.fields[index].value = "ZS-M-" + this.show_data.fields[index].value + "-" + new Date().Format('yyyy-MM-dd')
1166
- // }
1167
- }
1168
- }
1169
- if (this.show_data.fields[index].label === '单价') {
1170
- let http = new HttpResetClass()
1171
- let data = {
1172
- num1: this.getLableValue(this.show_data.fields[index].label),
1173
- num2: this.getLableValue('户数'),
1174
- operator: '*'
1175
- }
1176
- try {
1177
- let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
1178
- resolveMsg: null,
1179
- rejectMsg: null
1180
- })
1181
- data = {
1182
- num1: res.data,
1183
- num2: this.getLableValue('其他费用'),
1184
- operator: '+'
1185
- }
1186
- res = await http.load('POST', 'rs/logic/compute', {data: data}, {
1187
- resolveMsg: null,
1188
- rejectMsg: null
1189
- })
1190
- this.setLabelValue('合同金额',res.data)
1191
- if(this.show_data.f_apply_type === '居民报建'){
1192
- this.show_data.f_contract_money = res.data
1193
- this.show_data.f_due_money = res.data
1194
- this.show_data.f_surplus_money = res.data
1195
- this.setLabelValue('应交总金额',res.data)
1196
- this.setLabelValue('未结总金额',res.data)
1197
- }
1198
- } catch (e) {
1199
- this.$showAlert(e.data.msg, 'warning', 3000)
1200
- }
1201
- }
1202
- if (this.show_data.fields[index].label === '其他费用') {
1203
- let http = new HttpResetClass()
1204
- let data = {
1205
- num1: this.getLableValue('单价'),
1206
- num2: this.getLableValue('户数'),
1207
- operator: '*'
1208
- }
1209
- try {
1210
- let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
1211
- resolveMsg: null,
1212
- rejectMsg: null
1213
- })
1214
- data = {
1215
- num1: res.data,
1216
- num2: this.getLableValue('其他费用'),
1217
- operator: '+'
1218
- }
1219
- res = await http.load('POST', 'rs/logic/compute', {data: data}, {
1220
- resolveMsg: null,
1221
- rejectMsg: null
1222
- })
1223
- this.setLabelValue('合同金额',res.data)
1224
- if(this.show_data.f_apply_type === '居民报建'){
1225
- this.show_data.f_contract_money = res.data
1226
- this.show_data.f_due_money = res.data
1227
- this.show_data.f_surplus_money = res.data
1228
- this.setLabelValue('应交总金额',res.data)
1229
- this.setLabelValue('未结总金额',res.data)
1230
- }
1231
- } catch (e) {
1232
- this.$showAlert(e.data.msg, 'warning', 3000)
1233
- }
1234
- }
1235
- /*if (this.show_data.fields[index].label === '其他费用') {
1236
- let http = new HttpResetClass()
1237
- let data = {
1238
- num1: this.getLableValue(this.show_data.fields[index].label),
1239
- num2: this.getLableValue('合同金额'),
1240
- operator: '+'
1241
- }
1242
- try {
1243
- let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
1244
- resolveMsg: null,
1245
- rejectMsg: null
1246
- })
1247
- this.setLabelValue('合同金额',res.data)
1248
- if(this.show_data.f_apply_type === '居民报建'){
1249
- this.show_data.f_contract_money = res.data
1250
- this.show_data.f_due_money = res.data
1251
- this.show_data.f_surplus_money = res.data
1252
- this.setLabelValue('应交总金额',res.data)
1253
- this.setLabelValue('未结总金额',res.data)
1254
- }
1255
- } catch (e) {
1256
- this.$showAlert(e.data.msg, 'warning', 3000)
1257
- }
1258
- }*/
1259
- }
1260
- // ========================= 武安 =================================
1261
- // 号码检测
1262
- if (this.show_data.fields[index].label === '电话号码') {
1263
- let phone = this.show_data.fields[index].value
1264
- // 电话号码效验
1265
- if (!(/^1[3456789]\d{9}$/.test(phone))) {
1266
- this.show_data.fields[index].value = ""
1267
- this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
1268
- }
1269
- }
1270
- //时间提醒
1271
- if (this.show_data.fields[index].label.includes("时间") || this.show_data.fields[index].type === 'datepicker') {
1272
- let setTime = this.show_data.fields[index].value
1273
- let nowTime = new Date().Format("yyyy-MM-dd HH:mm:ss")
1274
- if (nowTime >= setTime) {
1275
- this.$showMessage("请注意,当前节点时间/工期已过期!")
1276
- }
1277
- }
1278
- },
1279
- // input值发生变化
1280
- async 'oninput'(index) {
1281
-
1282
- },
1283
- // 错误事件
1284
- error_check(index) {
1285
- // 时间格式检测
1286
- if (this.show_data.fields[index].type == 'datepicker') {
1287
- let dateRe = new RegExp(/(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)$/)
1288
- let datetimeRe = new RegExp(/((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/)
1289
- if (datetimeRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 19 && this.show_data.fields[index].fullsize) {
1290
- this.show_data.fields[index].error.flag = false
1291
- } else if (dateRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 10) {
1292
- this.show_data.fields[index].error.flag = false
1293
- } else {
1294
- if (this.show_data.fields[index].fullsize) {
1295
- this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
1296
- this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02 09:23:21'
1297
- this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
1298
- this.show_data.fields[index].error.flag = true
1299
- this.show_data.fields[index].value = ''
1300
- } else {
1301
- this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
1302
- this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02'
1303
- this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
1304
- this.show_data.fields[index].error.flag = true
1305
- this.show_data.fields[index].value = ''
1306
- }
1307
-
1308
- }
1309
- }
1310
- },
1311
- // onetomany模态框默认监听监听事件
1312
- async 'onetomanydelete'(i, j) {
1313
- console.log('默认删除')
1314
- let http = new HttpResetClass()
1315
- let data = {
1316
- table: this.show_data.onetomany[i].tables[0],
1317
- row: this.show_data.onetomany[i].rows[j]
1318
- }
1319
- let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
1320
- resolveMsg: null,
1321
- rejectMsg: '删除失败'
1322
- })
1323
-
1324
- if (res.data <= 0){
1325
- this.$showMessage('删除失败')
1326
- return
1327
- }
1328
-
1329
- this.$dispatch('breakControl', this.show_data)
1330
- },
1331
- async 'onetomanyadd'(index) {
1332
-
1333
- let data = {
1334
- f_process_id : this.show_data.f_process_id
1335
- }
1336
- this.show_data.onetomany[index].fields.forEach(item => {
1337
- data[item.field] = item.value
1338
- })
1339
- let res = await this.$resetpost(
1340
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1341
- data
1342
- )
1343
- this.$dispatch('breakControl', this.show_data)
1344
- },
1345
- async 'onetomanyupdate'(i, j) {
1346
- let onetomany = this.show_data.onetomany[i]
1347
- let data = onetomany.rows[j]
1348
-
1349
- onetomany.fields.forEach(item => {
1350
- data[item.field] = item.value
1351
- })
1352
- let res = await this.$resetpost(
1353
- `rs/entity/${this.show_data.onetomany[i].tables[0]}`,
1354
- data
1355
- )
1356
-
1357
- this.$dispatch('breakControl', this.show_data)
1358
- },
1359
- // 选择用户档案信息
1360
- 'selectUserinfo'(row) {
1361
- console.log("当前选择数据",row)
1362
- if (this.selectdata.f_apply_type === '拆改装报建'){
1363
- this.showLabels('用户编号')
1364
- this.hideLabels('地址类型','区域','街道','小区','楼号','单元','楼层','门牌号')
1365
- this.electiveLabels('地址类型','区域','街道','小区','楼号','单元','楼层','门牌号')
1366
- this.show_data.f_address_type = '民用地址'
1367
- this.show_data.f_pcd = row.f_pcd
1368
- this.show_data.f_street = row.f_street
1369
- this.show_data.f_residential_area = row.f_residential_area
1370
- this.show_data.f_building = row.f_building
1371
- this.show_data.f_unit = row.f_unit
1372
- this.show_data.f_floor = row.f_floor
1373
- this.show_data.f_room = row.f_room
1374
- this.selectdata.flag = '旧用户'
1375
- }
1376
- this.setLabelValue('用户编号', row.f_userinfo_code)
1377
- this.setLabelValue('用户名称', row.f_user_name)
1378
- this.setLabelValue('用户电话', row.f_user_phone)
1379
- this.setLabelValue('证件类型', row.f_credentials)
1380
- this.setLabelValue('证件号码', row.f_idnumber)
1381
- this.setLabelValue('地址', row.f_address)
1382
-
1383
- this.selectdata.f_userinfo_id = row.f_userinfo_id
1384
- this.selectdata.f_userinfo_code = row.f_userinfo_code
1385
- console.log("当前选择数据",this.show_data)
1386
- },
1387
- async 'streetChange'(index) {
1388
- if (isEmpty(this.show_data.f_street)) {
1389
- return
1390
- }
1391
-
1392
- this.setLabelValue('小区', null)
1393
-
1394
- let data = {
1395
- tablename: 't_area',
1396
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1397
- }
1398
- let http = new HttpResetClass()
1399
- let res = await http.load(
1400
- 'POST',
1401
- `rs/sql/singleTable`,
1402
- {data: data},
1403
- {resolveMsg: null, rejectMsg: '小区!!!'}
1404
- )
1405
-
1406
- this.setLabelOptions('小区', res.data.map(item => {
1407
- return {
1408
- label: item.f_residential_area,
1409
- value: item.f_residential_area
1410
- }
1411
- }))
1412
- },
1413
- // 区县失去焦点
1414
- async 'pcdChange'(index) {
1415
- if (isEmpty(this.show_data.f_pcd)) {
1416
- return
1417
- }
1418
-
1419
- this.setLabelValue('街道', null)
1420
- this.setLabelValue('小区', null)
1421
-
1422
-
1423
- let data = {
1424
- tablename: 't_street',
1425
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1426
- }
1427
- let f_address_type = this.getLableValue('地址类型')
1428
-
1429
- if (f_address_type === '民用地址') {
1430
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1431
- }
1432
-
1433
- let http = new HttpResetClass()
1434
- let res = await http.load(
1435
- 'POST',
1436
- `rs/sql/singleTable`,
1437
- {data: data},
1438
- {resolveMsg: null, rejectMsg: '街道查询失败!!!'}
1439
- )
1440
-
1441
- this.setLabelOptions('街道', res.data.map(item => {
1442
- return {
1443
- label: item.f_street,
1444
- value: item.f_street
1445
- }
1446
- }))
1447
- },
1448
- 'buttonChange' (index) {
1449
- if (this.show_data.fields[index].value === '否') {
1450
- console.log("测试")
1451
- this.hideButtons('下发','提交')
1452
- this.showButtons('退回','终止')
1453
- } else {
1454
- this.hideButtons('退回','终止')
1455
- this.showButtons('下发','提交')
1456
- }
1457
- },
1458
- async 'stopApply'() {
1459
- this.stope_view = true
1460
- this.showview = false
1461
- },
1462
- async 'signUserInfo' (index) {
1463
- if (this.show_data.fields[index].value === '是') {
1464
- console.log("测试")
1465
- this.showLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
1466
- this.requiredLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '门牌号', '地址')
1467
- } else {
1468
- this.hideLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
1469
- this.electiveLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
1470
- }
1471
- },
1472
- // onetomany模态框监听事件
1473
- async 'onchange_modal'(index, i) {
1474
- },
1475
- async 'oninput_modal'(index, i) {
1476
- }
1477
- },
1478
- watch: {
1479
- }
1480
- }
1481
- </script>
1482
- <style scoped>
1483
- /*清除model中的浮动*/
1484
- .clearfix:after,.clearfix:before{
1485
- display: table;
1486
- }
1487
- .clearfix:after{
1488
- clear: both;
1489
- }
1490
- </style>
1
+ <template>
2
+
3
+ <div class="auto clearfix">
4
+ <show-back-reason :selectdata="selectdata"></show-back-reason>
5
+ <stop-install :data="show_data" v-if="stope_view"></stop-install>
6
+ </div>
7
+
8
+ <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
9
+
10
+ </template>
11
+ <script>
12
+ import Vue from 'vue'
13
+ import {HttpResetClass} from 'vue-client'
14
+ import {getNowDate,isEmpty} from '../../../Util'
15
+ // Date格式化
16
+ Date.prototype.Format = function (fmt) {
17
+ var o = {
18
+ "M+": this.getMonth() + 1, //月份
19
+ "d+": this.getDate(), //日
20
+ "H+": this.getHours(), //小时
21
+ "m+": this.getMinutes(), //分
22
+ "s+": this.getSeconds(), //秒
23
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
24
+ "S": this.getMilliseconds() //毫秒
25
+ };
26
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
27
+ for (var k in o)
28
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
29
+ return fmt;
30
+ }
31
+
32
+ export default {
33
+ title: '报建流程业务控制层',
34
+ props: ['selectdata'],
35
+ data() {
36
+ return {
37
+ data: null, // 数据库数据,json配置文件数据的数据集合
38
+ json_datas: null, // Json配置文件集合
39
+ showview: false, // 控制显示service-view组件
40
+ show_data: null, // 给view层显示的数据
41
+ stope_view: false
42
+ }
43
+
44
+ },
45
+ created () {
46
+ this.refurbish()
47
+ },
48
+ ready(){
49
+ },
50
+ methods: {
51
+ stopapply(model1,model){
52
+ this.$showMessage('确定不具备条件,终止报建!',['confirm', 'cancel']).then((res)=>{
53
+ if (res=='confirm'){
54
+ this.selectdata = Object.assign( {},this.selectdata,model)
55
+ let data = {
56
+ loginUser: Vue.this.$login.f,
57
+ selectdata: this.selectdata,
58
+ model: model1
59
+ }
60
+ let http = new HttpResetClass()
61
+ http.load('POST', 'rs/logic/stopApply', {data: data}, {resolveMsg: null,rejectMsg: '删除失败'})
62
+ .then(res => {
63
+ if (res.data === 200) {
64
+ this.$dispatch('search')
65
+ this.$dispatch('close')
66
+ } else {
67
+ this.$showMessage('终止报建失败')
68
+ }
69
+ })
70
+ }
71
+ })
72
+ },
73
+ // 组件初始化操作
74
+ refurbish() {
75
+ this.json_datas = this.$workflow_vue
76
+ let sum = 0
77
+ let jsonData = {}
78
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length == 0) {
79
+ this.$showMessage("网络故障,请刷新页面")
80
+ return
81
+ }
82
+ for (let i = 0; i < this.json_datas.activitys.length; i++) {
83
+ if (this.selectdata.defname == this.json_datas.activitys[i].title) {
84
+ jsonData = this.json_datas.activitys[i] // 拿到当前节点的json配置信息
85
+ sum++ // 节点名一样的个数
86
+ }
87
+ }
88
+ if (sum == 1) {
89
+ this.data = null
90
+ this.data = jsonData
91
+ // selectdata 填充 data
92
+ this.data = Object.assign({}, this.data, this.selectdata)
93
+ this.initializeJSON()
94
+ } else if (sum == 0) {
95
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
96
+ } else {
97
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
98
+ }
99
+ },
100
+ // json配置数据处理
101
+ async initializeJSON() {
102
+ // 有默认值,value就给默认值,没有就是null
103
+ for (const item of this.data.fields) {
104
+ if (!item.value) {
105
+ if (item.value === 0) {
106
+ item.value = 0
107
+ } else {
108
+ item.value = null
109
+ }
110
+ }
111
+ if (item.default || item.default == 0) {
112
+ if(item.type === 'datepicker'){
113
+ item.value = ''
114
+ }else {
115
+ item.value = item.default
116
+ }
117
+ }
118
+ if (this.selectdata[item.field]) {
119
+ // 将json字符串格式化赋值给value
120
+ if (String(this.selectdata[item.field]).startsWith("{")) {
121
+ item.value = JSON.parse(this.selectdata[item.field])
122
+ this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
123
+ } else {
124
+ item.value = this.selectdata[item.field]
125
+ }
126
+ } else {
127
+ if (this.selectdata[item.field] === 0) {
128
+ item.value = 0
129
+ }
130
+ }
131
+
132
+ // datepicker 没有值给当时值
133
+ if (item.type === 'datepicker' && !item.value && item.default) {
134
+ item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
135
+ }
136
+
137
+ // 如果配置类型为select,优先从参数列表获取options
138
+ if (item.type === 'select') {
139
+ let temp = null
140
+
141
+ temp = this.$appdata.getParam(item.label)
142
+
143
+ if (temp && temp.length > 0 && item.label) {
144
+ item.options = temp
145
+ } else {
146
+ if (item.paramLabel) {
147
+ temp = this.$appdata.getParam(item.paramLabel)
148
+ if (temp && temp.length > 0) {
149
+ item.options = temp
150
+ }
151
+ }
152
+ }
153
+ if (item.ready) {
154
+ item.options = await this[item.ready]()
155
+ }
156
+ }
157
+ }
158
+
159
+ // 控制组件
160
+ if (this.data.components) {
161
+ this.data.components.forEach(item => {
162
+ if (!item.mark) {
163
+ item.mark = 0
164
+ }
165
+ })
166
+ }
167
+
168
+ // 初始化 fields 可对数据进行特殊处理
169
+ this.initializeFields()
170
+
171
+ // 初始化 buttons_fields
172
+ for (let i = 0; i < this.data.buttons.length; i++) {
173
+ // 下发按钮相关配置
174
+ if (this.data.buttons[i].button_name === '下发') {
175
+ if (this.data.buttons[i].button_fields && this.data.buttons[i].button_fields.length === 1) {
176
+ if (this.data.buttons[i].source){
177
+ let http = new HttpResetClass()
178
+ let res = await http.load('POST', 'rs/search', {
179
+ source: this.data.buttons[i].source,
180
+ userid: this.$login.f.id
181
+ }, {resolveMsg: null, rejectMsg: null})
182
+
183
+ let options = []
184
+ for (let i = 0; i < res.data.length; i++) {
185
+ options.push(
186
+ {
187
+ "label": res.data[i].name,
188
+ "value": res.data[i].id
189
+ }
190
+ )
191
+ }
192
+ this.data.buttons[i].button_fields[0]['options'] = options
193
+ } else {
194
+ this.$showMessage("请配置获取人员表达式")
195
+ }
196
+ } else {
197
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
198
+ }
199
+ }
200
+ if (this.data.buttons[i].button_fields) {
201
+ this.data.buttons[i].button_fields.forEach(x => {
202
+ // 如果配置类型为select,优先从参数列表获取options
203
+ if (x.type === 'select' && this.$appdata.getParam(x.label)) {
204
+ x.options = this.$appdata.getParam(x.label).trim()
205
+ }
206
+ })
207
+ }
208
+ }
209
+
210
+ // onetomany 数据获取
211
+ if (this.data.onetomany) {
212
+ for (let index = 0; index < this.data.onetomany.length; index++) {
213
+ let res = null
214
+ if (!this.data.onetomany[index].queryEvent || this.data.onetomany[index].queryEvent === 'default'){
215
+ let http = new HttpResetClass()
216
+ let data = {
217
+ tablename: this.data.onetomany[index].tables[0],
218
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
219
+ }
220
+ res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
221
+ resolveMsg: null,
222
+ rejectMsg: 'onetomany查询失败'
223
+ })
224
+ } else {
225
+ res = this[this.data.onetomany[index].queryEvent]()
226
+ }
227
+
228
+ // 初始化 onetomany
229
+ this.data.onetomany[index].rows = res.data
230
+
231
+ // 初始化onetomany中的fields
232
+ for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
233
+ if (!this.data.onetomany[index].fields[j].value) {
234
+ if (this.data.onetomany[index].fields[j].value === 0) {
235
+ this.data.onetomany[index].fields[j].value = 0
236
+ } else {
237
+ this.data.onetomany[index].fields[j].value = null
238
+ }
239
+ }
240
+ if (this.data.onetomany[index].fields[j].default || this.data.onetomany[index].fields[j].default == 0) {
241
+ this.data.onetomany[index].fields[j].value = this.data.onetomany[index].fields[j].default
242
+ }
243
+ // 如果配置类型为select,优先从参数列表获取options
244
+ if (this.data.onetomany[index].fields[j].type === 'select') {
245
+ let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
246
+ if (temp && temp.length > 0) {
247
+ this.data.onetomany[index].fields[j].options = temp
248
+ }
249
+ }
250
+ }
251
+ }
252
+ }
253
+
254
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
255
+ let temp = JSON.parse(JSON.stringify(this.data))
256
+
257
+ this.show_data = temp
258
+ this.$nextTick(() => {
259
+ this.showview = true
260
+ })
261
+ // 初始化加载
262
+ // ========================= 中盛 =================================
263
+
264
+ if (this.selectdata.defname === '报建登记') {
265
+ let http = new HttpResetClass()
266
+ let condition = "f_filialeid = " + this.$login.f.orgid
267
+ let res = await http.load('POST','rs/sql/apply_singleTable',{data:{tablename:'t_area',condition:condition}}, {resolveMsg: null, rejectMsg: null})
268
+ for (let i = 0; i < this.show_data.fields.length; i++) {
269
+
270
+ if (this.show_data.fields[i].label == '街道') {
271
+ let data = []
272
+ let array = []
273
+ data = res.data.map(item => {
274
+ return item.f_street;
275
+ })
276
+ for (let q = 0; q < data.length; q++) {
277
+ let arraydata = {
278
+ 'label': data[q],
279
+ 'value': data[q]
280
+ }
281
+ if (array.length != 0) {
282
+ for (let w = 0; w < array.length; w++) {
283
+ if (array[w].label == data[q]) {
284
+ break
285
+ }
286
+ while (w == array.length - 1) {
287
+ array.push(arraydata)
288
+ break
289
+ }
290
+ }
291
+ } else {
292
+ array.push(arraydata)
293
+ }
294
+ }
295
+ this.show_data.fields[i].options = array
296
+ console.log("街道选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
297
+ }
298
+ if (this.show_data.fields[i].label == '小区') {
299
+ let data = []
300
+ let array = []
301
+ data = res.data.map(item => {
302
+ return item.f_residential_area;
303
+ })
304
+ for (let q = 0; q < data.length; q++) {
305
+ let arraydata = {
306
+ 'label': data[q],
307
+ 'value': data[q]
308
+ }
309
+ if (array.length != 0) {
310
+ for (let w = 0; w < array.length; w++) {
311
+ if (array[w].label == data[q]) {
312
+ break
313
+ }
314
+ while (w == array.length - 1) {
315
+ array.push(arraydata)
316
+ break
317
+ }
318
+ }
319
+ } else {
320
+ array.push(arraydata)
321
+ }
322
+ }
323
+ this.show_data.fields[i].options = array
324
+ console.log("小区选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
325
+ }
326
+ }
327
+ }
328
+ if (this.selectdata.defname === '施工') {
329
+ // for (let i = 0; i < this.show_data.fields.length; i++) {
330
+ // if (this.show_data.fields[i].label == '工程状态') {
331
+ // this.show_data.fields[i].value = ''
332
+ // }
333
+ // }
334
+ for (const item of this.show_data.fields) {
335
+ if (item.label === '工程状态' && !item.value) {
336
+ return item.value = '未开工'
337
+ }
338
+ }
339
+ }
340
+ if (this.selectdata.defname === '现场勘察'|| this.selectdata.defname ==='入户安装') {
341
+ for (const item of this.show_data.fields) {
342
+ if (item.label === '现场勘察人员' && !item.value) {
343
+ return item.value = this.$login.f.name
344
+ }
345
+ }
346
+ }
347
+ },
348
+ // 初始化fields值
349
+ initializeFields() {
350
+
351
+ },
352
+ // 金额转大写
353
+ smalltoBIG(n) {
354
+ let fraction = ['角', '分'];
355
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
356
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
357
+ let head = n < 0 ? '欠' : '';
358
+ n = Math.abs(n);
359
+
360
+ let s = '';
361
+
362
+ for (var i = 0; i < fraction.length; i++) {
363
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
364
+ }
365
+ s = s || '整';
366
+ n = Math.floor(n);
367
+
368
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
369
+ let p = '';
370
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
371
+ p = digit[n % 10] + unit[1][j] + p;
372
+ n = Math.floor(n / 10);
373
+ }
374
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
375
+ }
376
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
377
+ },
378
+ getLableValue(label) {
379
+ for (const item of this.show_data.fields) {
380
+ if (item.label === label && item.type !== 'number') {
381
+ return item.value || ''
382
+ }
383
+ if (item.label === label && item.type === 'number') {
384
+ return item.value || 0
385
+ }
386
+ }
387
+ },
388
+ setLabelValue(label, value) {
389
+ for (const item of this.show_data.fields) {
390
+ if (item.label === label) {
391
+ item.value = value
392
+ }
393
+ }
394
+ },
395
+ setLabelOptions(label, options) {
396
+ for (const item of this.show_data.fields) {
397
+ if (item.label === label) {
398
+ item.options = options
399
+ }
400
+ }
401
+ },
402
+ showLabels(...labels) {
403
+ for (const item of this.show_data.fields) {
404
+ if (labels.includes(item.label)) {
405
+ item.hidden = false
406
+ }
407
+ }
408
+ },
409
+ hideLabels(...labels) {
410
+ for (const item of this.show_data.fields) {
411
+ if (labels.includes(item.label)) {
412
+ item.hidden = true
413
+ }
414
+ }
415
+ },
416
+ requiredLabels(...labels) {
417
+ for (const item of this.show_data.fields) {
418
+ if (labels.includes(item.label)) {
419
+ item.required = true
420
+ }
421
+ }
422
+ },
423
+ electiveLabels(...labels) {
424
+ for (const item of this.show_data.fields) {
425
+ if (labels.includes(item.label)) {
426
+ item.required = false
427
+ }
428
+ }
429
+ },
430
+ readonlyLabels(...labels) {
431
+ for (const item of this.show_data.fields) {
432
+ if (labels.includes(item.label)) {
433
+ item.readonly = true
434
+ item.disabled = true
435
+ }
436
+ }
437
+ },
438
+ readwriteLabels(...labels) {
439
+ for (const item of this.show_data.fields) {
440
+ if (labels.includes(item.label)) {
441
+ item.readonly = false
442
+ item.disabled = false
443
+ }
444
+ }
445
+ },
446
+ showButtons(...buttons) {
447
+ for (const item of this.show_data.buttons) {
448
+ if (buttons.includes(item.button_name)) {
449
+ item.hidden = false
450
+ }
451
+ }
452
+ },
453
+ hideButtons(...buttons) {
454
+ for (const item of this.show_data.buttons) {
455
+ if (buttons.includes(item.button_name)) {
456
+ item.hidden = true
457
+ }
458
+ }
459
+ },
460
+ // 获取区县
461
+ async getPcd() {
462
+ let data = {
463
+ tablename: 't_pcd',
464
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
465
+ }
466
+ let http = new HttpResetClass()
467
+ let res = await http.load(
468
+ 'POST',
469
+ `rs/sql/singleTable`,
470
+ {data: data},
471
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
472
+ )
473
+
474
+ let pcd = res.data.map(item => {
475
+ return {
476
+ label: item.f_pcd,
477
+ value: item.f_pcd
478
+ }
479
+ })
480
+ this.setLabelOptions('区域',pcd)
481
+ },
482
+ // 获取气价
483
+ async getPrice(f_price_id) {
484
+ let data = {
485
+ condition: `sp.f_orgid = '${this.$login.f.orgid}'`
486
+ }
487
+
488
+ if (!isEmpty(f_price_id)) {
489
+ data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
490
+ }
491
+ let http = new HttpResetClass()
492
+ let res = await http.load(
493
+ 'POST',
494
+ `rs/sql/applyGetPrice`,
495
+ {data: data},
496
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
497
+ )
498
+
499
+ return res.data.map(item => {
500
+ return {
501
+ label: item.f_price_name,
502
+ value: item
503
+ }
504
+ })
505
+ },
506
+ // 地址关联
507
+ addressInitialization() {
508
+ this.$getConfig(this, 'UserAddress')
509
+
510
+ let f_address_type = this.show_data.f_address_type
511
+
512
+ for (const item of this.show_data.fields) {
513
+ if (f_address_type === '民用地址') {
514
+ if (item.label === '区域' || item.label === '街道' || item.label === '小区' || item.label === '门牌号') {
515
+ item.hidden = false
516
+ item.required = true
517
+ }
518
+ if (item.label === '楼号' || item.label === '单元' || item.label === '楼层') {
519
+ item.hidden = false
520
+ item.required = false
521
+ }
522
+ if (item.label === '地址') {
523
+ item.readonly = true
524
+ }
525
+ }
526
+ if (f_address_type === '特殊地址') {
527
+ if (item.label === '区域' || item.label === '街道') {
528
+ item.hidden = false
529
+ item.required = true
530
+ }
531
+ if (item.label === '小区') {
532
+ item.hidden = true
533
+ item.required = false
534
+ }
535
+ if (item.label === '楼号' || item.label === '单元' || item.label === '楼层' || item.label === '门牌号') {
536
+ item.hidden = true
537
+ item.required = false
538
+ }
539
+ if (item.label === '地址') {
540
+ item.readonly = false
541
+ }
542
+ }
543
+
544
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
545
+ item.hidden = true
546
+ }
547
+ }
548
+ },
549
+ async streetChange() {
550
+ if (isEmpty(this.show_data.f_street)) {
551
+ return
552
+ }
553
+
554
+ let data = {
555
+ tablename: 't_area',
556
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
557
+ }
558
+ let http = new HttpResetClass()
559
+ let res = await http.load(
560
+ 'POST',
561
+ `rs/sql/singleTable`,
562
+ {data: data},
563
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
564
+ )
565
+
566
+ this.setLabelOptions('小区', res.data.map(item => {
567
+ return {
568
+ label: item.f_residential_area,
569
+ value: item.f_residential_area
570
+ }
571
+ }))
572
+ },
573
+ async pcdChange() {
574
+ if (isEmpty(this.show_data.f_pcd)) {
575
+ return
576
+ }
577
+
578
+ let data = {
579
+ tablename: 't_street',
580
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
581
+ }
582
+ let f_address_type = this.getLableValue('地址类型')
583
+
584
+ if (f_address_type === '民用地址') {
585
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
586
+ }
587
+
588
+ let http = new HttpResetClass()
589
+ let res = await http.load(
590
+ 'POST',
591
+ `rs/sql/singleTable`,
592
+ {data: data},
593
+ {resolveMsg: null, rejectMsg: '街道查询失败!!!'}
594
+ )
595
+
596
+ this.setLabelOptions('街道', res.data.map(item => {
597
+ return {
598
+ label: item.f_street,
599
+ value: item.f_street
600
+ }
601
+ }))
602
+ },
603
+ async buttonBefore(model) {
604
+ if (model.defname === '报建登记' && model.button.button_name === '提交') {
605
+
606
+ if (model.f_is_user === '是') {
607
+ if (isEmpty(model.f_user_name) || isEmpty(model.f_phone) || isEmpty(model.f_address)) {
608
+ throw '用户信息未填写完整,无法提交!!!'
609
+ }
610
+ }
611
+ }
612
+ if (
613
+ model.button.button_name === '提交' &&
614
+ model.defname === '通气点火' &&
615
+ (
616
+ model.f_apply_type === '散户报建' ||
617
+ model.f_apply_type === '工商户报建'
618
+ ) &&
619
+ model.f_surplus_money > 0
620
+ ) {
621
+ throw '未结金额大于0,无法提交!!!'
622
+ }
623
+ if (model.defname === '验收是否合格' && model.button.button_name === '提交') {
624
+ let http = new HttpResetClass()
625
+ let data = {
626
+ f_process_id: model.f_process_id
627
+ }
628
+ let res = await http.load('POST', 'rs/sql/notInstalled', {data: data}, {resolveMsg: null, rejectMsg: null})
629
+ if (res.data[0].num > 0) {
630
+ throw `还有${res.data[0].num}户未安装,无法提交`
631
+ }
632
+ }
633
+ if (
634
+ model.f_apply_type === '工商户报建' &&
635
+ model.button.button_name === '提交' &&
636
+ (model.defname === '设计出图' || model.defname === '竣工验收' || model.defname === '合同签订' )
637
+ ) {
638
+ let http = new HttpResetClass()
639
+ let data = {
640
+ tablename: 't_files',
641
+ condition: `defname = '${model.defname}' and f_blobid = '${this.selectdata.f_process_id}'`
642
+ }
643
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
644
+ resolveMsg: null,
645
+ rejectMsg: '查询失败'
646
+ })
647
+ console.log("数据长度:" + res.data.length)
648
+ if (res.data.length <= 0) {
649
+ throw '请上传附件!!!'
650
+ }
651
+
652
+ }
653
+ if (
654
+ model.f_apply_type === '工商户报建' &&
655
+ model.button.button_name === '提交' &&
656
+ model.defname === '报建登记'
657
+ ) {
658
+ let http = new HttpResetClass()
659
+ let data = {
660
+ tablename: 't_files',
661
+ condition: `defname = '${model.defname}' and f_blobid = '${this.selectdata.f_process_id}'`
662
+ }
663
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
664
+ resolveMsg: null,
665
+ rejectMsg: '查询失败'
666
+ })
667
+ console.log("数据长度:" , res.data)
668
+ if (res.data.length <= 0) {
669
+ throw '请上传附件!!!'
670
+ }
671
+ let inc=true
672
+ let name1 = ''
673
+ let wenjian = ['营业执照','身份证','非居民用户申请表','灶具五证','厨房设备布置设计图']
674
+ for (let name = 0;name<wenjian.length;name++){
675
+ let has=false
676
+ for (let i=0;i<res.data.length;i++){
677
+ if(res.data[i].f_filename.includes(wenjian[name])){
678
+ has=true
679
+ }
680
+ }
681
+ if(!has){
682
+ name1=name1+wenjian[name]+','
683
+ inc=false
684
+ }
685
+ }
686
+ if (inc==false){
687
+ throw '请上传'+name1+'附件!!!'
688
+ }
689
+ /*for (let i=0;i<res.data.length;i++){
690
+ if (!(
691
+ res.data[i].f_filename.includes('营业执照')
692
+ || res.data[i].f_filename.includes('身份证')
693
+ || res.data[i].f_filename.includes('非居民用户申请表')
694
+ || res.data[i].f_filename.includes('灶具五证')
695
+ || res.data[i].f_filename.includes('厨房设备布置设计图')
696
+ )){
697
+ throw '请检查当前节点的附件,只能上传以下文件 营业执照/'
698
+ return
699
+ }
700
+ }*/
701
+ }
702
+ return model
703
+ },
704
+ // ========================= 武安 =================================
705
+ // 地址类型变化
706
+ addressType() {
707
+ for (const item of this.show_data.fields) {
708
+ if (item.label === '小区' && this.show_data.f_address_type === '民用地址') {
709
+ item.hidden = false
710
+ item.required = true
711
+ }
712
+ if (item.label === '小区' && this.show_data.f_address_type === '特殊地址') {
713
+ item.required = false
714
+ }
715
+ if (
716
+ (
717
+ item.label === '门牌号'
718
+ ) && this.show_data.f_address_type === '民用地址'
719
+ ) {
720
+ item.required = true
721
+ item.hidden = false
722
+ item.value = null
723
+ }
724
+ if (
725
+ (
726
+ item.label === '楼号' ||
727
+ item.label === '单元' ||
728
+ item.label === '楼层'
729
+ ) && this.show_data.f_address_type === '民用地址'
730
+ ) {
731
+ item.required = false
732
+ item.hidden = false
733
+ item.value = null
734
+ }
735
+ if (
736
+ (
737
+ item.label === '楼号' ||
738
+ item.label === '单元' ||
739
+ item.label === '楼层' ||
740
+ item.label === '门牌号'
741
+ ) && this.show_data.f_address_type === '特殊地址'
742
+ ) {
743
+ item.required = false
744
+ item.hidden = true
745
+ item.value = null
746
+ }
747
+ }
748
+ this.getPcd()
749
+ },
750
+ getPerSon(){
751
+ //查询是否有用户
752
+ let http = new HttpResetClass()
753
+ let data = {
754
+ condition: '1=1',
755
+ f_filialeid: this.$login.f.orgid,
756
+ f_process_id: this.selectdata.f_process_id,
757
+ }
758
+ let res = http.load('POST', 'rs/sql/getAddressAanUserinfo', {data:data}, {
759
+ resolveMsg: null,
760
+ rejectMsg: null
761
+ })
762
+ return res
763
+ }
764
+ // ========================= 武安 =================================
765
+ },
766
+ events: {
767
+ // 选择气价
768
+ 'priceChange'(index) {
769
+ if (isEmpty(this.show_data.f_stair_price_name)) {
770
+ return
771
+ }
772
+
773
+ let stairPrice = this.getLableValue('气价名称')
774
+ console.log("气价信息", stairPrice)
775
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
776
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
777
+ this.setLabelValue('气价', stairPrice.f_price)
778
+ this.selectdata.f_price_id = stairPrice.f_price_id
779
+ this.selectdata.f_price_name = stairPrice.f_price_name
780
+ },
781
+ // ========================= 武安 =================================
782
+ // ========================= 武安 =================================
783
+ 'openAddModel'(index) {
784
+ // ========================= 武安 =================================
785
+ // ========================= 武安 =================================
786
+ },
787
+ // 获取view层button事件/
788
+ async 'button'(model) {
789
+ model = Object.assign({}, this.selectdata, model)
790
+ if(this.show_data.components.length>0 && model.button.button_name === '提交') {
791
+ for (let i = 0; i < this.show_data.components.length; i++) {
792
+ if (this.show_data.components[i].name == 'apply-address-userinfo-management') {
793
+ let result = await this.getPerSon()
794
+ if (result.data.length == 0) {
795
+ this.$showAlert('请录入用户信息', 'warning', 3000)
796
+ return
797
+ }
798
+ }
799
+ }
800
+ }
801
+ // 点击重置按钮就重置数据
802
+ if (model.button.button_name === '重置') {
803
+ this.$dispatch('breakControl', this.data)
804
+ return
805
+ }
806
+ // 提交前置
807
+ try {
808
+ model = await this.buttonBefore(model)
809
+ } catch (e) {
810
+ this.$showAlert(e, 'warning', 3000)
811
+ return
812
+ }
813
+ if (model.f_entry_name && model.defname == '报建登记'){
814
+ let http = new HttpResetClass()
815
+ let data = {
816
+ tablename:'t_apply',
817
+ condition:`f_entry_name = '${model.f_entry_name}'`
818
+ }
819
+ let res = await http.load('post','rs/sql/singleTable', {data:data},{
820
+ resolveMsg: null,
821
+ rejectMsg: '查询失败'})
822
+ debugger
823
+ if (res.data.length > 0){
824
+ this.$showMessage('项目名称不能重复,请重新输入!!!')
825
+ return
826
+ }
827
+ }
828
+ let http = new HttpResetClass()
829
+ if((this.selectdata.defname =='现场勘察' || this.selectdata.defname ==='入户安装') && model.f_is_have == '否'&& model.button.button_name == '提交'){
830
+ let model1 ={
831
+ f_stop_remarks : '不具备安装条件'
832
+ }
833
+ this.stopapply(model1,model)
834
+ return
835
+ }
836
+ if((this.selectdata.defname =='现场勘察' || this.selectdata.defname ==='入户安装') && model.f_is_aerate == '否' && model.button.button_name == '提交'){
837
+ let model1 ={
838
+ f_stop_remarks : '未通气'
839
+ }
840
+ this.stopapply(model1,model)
841
+ return
842
+ }
843
+ if( this.selectdata.defname ==='入户安装'&& model.button.button_name == '提交'){
844
+ let data = {
845
+ condition: " 1=1",
846
+ f_process_id: this.selectdata.f_process_id
847
+ }
848
+ let res1 = await http.load('POST', 'rs/sql/getAddresAndUserinfoAndUserfilesAmount', {data:data}, {
849
+ resolveMsg: null,
850
+ rejectMsg: null
851
+ })
852
+ debugger
853
+ if (res1.data[0].f_userfiles_num===null){
854
+ this.$showMessage("请填写表具信息!!!")
855
+ return
856
+ }
857
+
858
+ }
859
+ let requestData = {
860
+ tables: this.data.tables,
861
+ start_activity: this.$workflow_vue.start_activity,
862
+ model: model,
863
+ loginUser: this.$login.f,
864
+ workflow_gxmlfilename: this.$workflow_vue.workflow_xmlfilename
865
+ }
866
+ console.log("gwfwe",this.selectdata)
867
+ // 下发,提交,保存,退回通用业务后台处理logic
868
+ let url = 'rs/logic/ApplyProductService'
869
+ let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
870
+ if (res.data.code === 200) {
871
+ this.$dispatch('search')
872
+ } else {
873
+ if (res.data.msg) {
874
+ this.$showMessage(res.data.msg)
875
+ }
876
+ }
877
+ },
878
+ async 'initializtionView'() {
879
+ // ========================= 武安 =================================
880
+ this.addressType()
881
+ // ========================= 武安 =================================
882
+ },
883
+ // 失去焦点出触发事件
884
+ async 'onchange'(index) {
885
+ console.log('失去焦点')
886
+ // ========================= 武安 =================================
887
+ if (this.show_data.defname === '报建登记' || this.show_data.defname === '业务申请'){
888
+ if (this.show_data.fields[index].label === '是否具备安装条件') {
889
+ for (const button of this.show_data.buttons) {
890
+ if (this.show_data.fields[index].value === '否'&& button.button_name === '退回') {
891
+ button.hidden = false
892
+ }else {
893
+ button.hidden = true
894
+ }
895
+ }
896
+ }
897
+ if (this.show_data.fields[index].label === '地址类型'){
898
+ this.addressType()
899
+ }
900
+ if (this.show_data.fields[index].label === '项目名称'){
901
+ let http = new HttpResetClass()
902
+ let data = {
903
+ tablename:'t_apply',
904
+ condition:`f_entry_name = '${this.show_data.fields[index].value}'`
905
+ }
906
+ let res = await http.load('post','rs/sql/singleTable', {data:data},{
907
+ resolveMsg: null,
908
+ rejectMsg: '查询失败'})
909
+ if (res.data.length > 0){
910
+ this.$showMessage('项目名称不能重复,请重新输入!!!')
911
+ this.show_data.fields[index].value = ''
912
+ }
913
+ }
914
+ // if (this.show_data.fields[index].label === '街道'){
915
+ // console.log('-----------添加街道-----------')
916
+ // if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
917
+ // this.show_data.fields[index].value = null
918
+ // this.$showAlert('街道地址不能为空!!!', 'warning', 3000)
919
+ // return
920
+ // }
921
+ // let http = new HttpResetClass()
922
+ // let data = {
923
+ // f_adjustable_id: '', // 调压箱编号
924
+ // f_orgid: this.$login.f.orgid, // 组织id
925
+ // f_orgname: this.$login.f.orgs, // 组织名
926
+ // f_pcd: '河北省邯郸市武安市', // 省市区
927
+ // f_pcd_id: 8, // 省市区id
928
+ // // f_pcd_id: 124, // 50.4测试
929
+ // f_slice_area: '', // 片区
930
+ // f_operatorid: this.$login.f.id, // 操作人id
931
+ // f_operator: this.$login.f.name, // 操作人
932
+ // f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
933
+ // f_street: this.show_data.fields[index].value.trim(), // 地址
934
+ // f_comments: '报建系统自动创建' // 备注
935
+ // }
936
+ // try {
937
+ // let res = await http.load('POST', 'rs/logic/address_updatestreet', {data: data}, {
938
+ // resolveMsg: null,
939
+ // rejectMsg: null
940
+ // })
941
+ // } catch (e) {
942
+ // if (e.status === 635) {
943
+ // this.$showAlert('此街道已存在!!!', 'warning', 3000)
944
+ // } else {
945
+ // this.$showAlert('自动添加街道失败,请手动添加!!!', 'danger', 3000)
946
+ // }
947
+ // }
948
+ // }
949
+ // if (this.show_data.fields[index].label === '小区') {
950
+ // if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
951
+ // this.show_data.fields[index].value = null
952
+ // this.$showAlert('小区名称不能为空!!!', 'warning', 3000)
953
+ // return
954
+ // }
955
+ // // 先查询街道
956
+ // let street = null
957
+ // for (const item of this.show_data.fields) {
958
+ // if (item.label === '街道') {
959
+ // if (item.value.trim() === null || item.value.trim() === '') {
960
+ // this.show_data.fields[index].value = null
961
+ // this.$showAlert('请先录入街道信息,才能录入小区信息!!!', 'warning', 3000)
962
+ // return
963
+ // }
964
+ // let http = new HttpResetClass()
965
+ // let data = {
966
+ // condition: `1=1 and s.f_filialeid in ('${this.$login.f.orgid}') and f_province = '河北省' and f_city = '邯郸市' and f_district = '武安市' and f_street = '${item.value.trim()}'`
967
+ // }
968
+ // let res = await http.load('POST', 'rs/sql/address_getstreetlist', {data: data}, {
969
+ // resolveMsg: null,
970
+ // rejectMsg: null
971
+ // })
972
+ // if (res.data.length > 0) {
973
+ // street = res.data[0]
974
+ // } else {
975
+ // this.show_data.fields[index].value = null
976
+ // this.$showAlert(`【${item.value}】街道不存在,请手动添加或重新输入街道信息,在录入小区信息!!!`, 'warning', 3000)
977
+ // }
978
+ // }
979
+ // }
980
+ // console.log('-----------添加小区-----------')
981
+ // let data = {
982
+ // f_linkname: '', // 联系人
983
+ // f_linkphone: '', // 联系电话
984
+ // f_adjustable_id: '', // 调压箱编号
985
+ // f_user_type: '', // 用户类型
986
+ // f_gasproperties: '', // 用气性质
987
+ // f_meter_brand: '', // 气表品牌
988
+ // f_price_name: '', // 气价名称
989
+ // f_price_type: '', // 气价类型
990
+ // f_meter_style: '', // 气表型号
991
+ // f_position: '', // 表安装位置
992
+ // f_meter_type: '', // 气表类型
993
+ // f_area_id: '', // 小区编号 (自动生成)
994
+ // f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
995
+ // f_operatorid: this.$login.f.id, // 操作人id
996
+ // f_operator: this.$login.f.name, // 操作人
997
+ // f_orgid: this.$login.f.orgid, // 组织id
998
+ // f_orgname: this.$login.f.orgs, // 组织名
999
+ // f_pcd_id: 8, // 省市区id
1000
+ // // f_pcd_id: 124, // 50.4测试
1001
+ // f_pcd: '河北省邯郸市武安市', // 省市区
1002
+ // f_street_id: street.id, // 街道id
1003
+ // f_street: street.f_street,// 街道
1004
+ // f_area_code: '01', // 片区编码
1005
+ // f_slice_area: '武安片区', // 片区
1006
+ // // f_area_code: '66556', // 50.4测试
1007
+ // // f_slice_area: '武安明星', // 50.4测试
1008
+ // slice_area: [
1009
+ // {
1010
+ // name: '武安片区',
1011
+ // code: '01'
1012
+ // }
1013
+ // ],
1014
+ // // slice_area: [ // 50.4测试
1015
+ // // {
1016
+ // // name: '武安明星',
1017
+ // // code: '66556'
1018
+ // // }
1019
+ // // ],
1020
+ // f_residential_area: this.show_data.fields[index].value.trim(), // 小区名称
1021
+ // f_area_address: `河北省邯郸市武安市${street.f_street}`, // 详细地址(省市区+街道)
1022
+ // f_comments: '报建系统自动创建'
1023
+ // }
1024
+ // try {
1025
+ // let http = new HttpResetClass()
1026
+ // let res = await http.load('POST', 'rs/logic/address_updatearea', {data: data}, {
1027
+ // resolveMsg: null,
1028
+ // rejectMsg: null
1029
+ // })
1030
+ // } catch (e) {
1031
+ // if (e.status === 635) {
1032
+ // this.$showAlert('此小区已存在!!!', 'warning', 3000)
1033
+ // } else {
1034
+ // this.$showAlert('自动添加小区失败,请手动添加!!!', 'warning', 3000)
1035
+ // }
1036
+ // }
1037
+ // }
1038
+ // 地址拼接
1039
+ if (
1040
+ this.show_data.fields[index].label === '区域' ||
1041
+ this.show_data.fields[index].label === '街道' ||
1042
+ this.show_data.fields[index].label === '小区' ||
1043
+ this.show_data.fields[index].label === '楼号' ||
1044
+ this.show_data.fields[index].label === '单元' ||
1045
+ this.show_data.fields[index].label === '楼层' ||
1046
+ this.show_data.fields[index].label === '门牌号'
1047
+ ) {
1048
+ let f_address = null
1049
+ if (this.show_data.f_address_type !== '民用地址') {
1050
+ f_address = this.getLableValue('街道') + this.getLableValue('小区')
1051
+ } else {
1052
+ f_address = this.getLableValue('街道') +
1053
+ this.getLableValue('小区') +
1054
+ this.getLableValue('楼号') +
1055
+ (isEmpty(this.getLableValue('楼号')) ? '' : '号楼') +
1056
+ this.getLableValue('单元') +
1057
+ (isEmpty(this.getLableValue('单元')) ? '' : '单元') +
1058
+ this.getLableValue('楼层') +
1059
+ (isEmpty(this.getLableValue('楼层')) ? '' : '层') +
1060
+ this.getLableValue('门牌号') +
1061
+ (isEmpty(this.getLableValue('门牌号')) ? '' : '室')
1062
+ }
1063
+ this.setLabelValue('地址', f_address)
1064
+ }
1065
+ }
1066
+
1067
+ if (this.show_data.defname === '竣工验收') {
1068
+ if (this.show_data.fields[index].label === '验收是否合格'){
1069
+ for (const button of this.show_data.buttons) {
1070
+ if (this.show_data.fields[index].value === '否' && button.button_name === '退回') {
1071
+ button.hidden = false
1072
+ } else {
1073
+ button.hidden = true
1074
+ }
1075
+ }
1076
+ }
1077
+ }
1078
+ if (this.show_data.defname === '报建登记'&&this.show_data.f_apply_type==='工商户报建') {
1079
+
1080
+ console.log("13f", this.selectdata.onetomany)
1081
+ for (const button of this.show_data.buttons) {
1082
+ if (this.selectdata.onetomany&& button.button_name === '提交') {
1083
+ console.log("1f")
1084
+ button.disable = true
1085
+ }
1086
+ else {
1087
+ button.disable = false
1088
+ console.log("2f")
1089
+ }
1090
+ }
1091
+ }
1092
+ // if (this.show_data.defname === '营业厅建档'){
1093
+ // let http = new HttpResetClass()
1094
+ // let data = {
1095
+ // tablename: 't_userinfo',
1096
+ // condition: `f_process_id='${this.selectdata.f_process_id}'`
1097
+ //
1098
+ // }
1099
+ // let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
1100
+ //
1101
+ // if (this.show_data.fields[index].label === '是否已建档') {
1102
+ // if (res.data[0].f_user_state === '预备') {
1103
+ // this.show_data.fields[index].value = '否'
1104
+ // button.hidden = false
1105
+ // }else{
1106
+ // this.show_data.fields[index].value = '是'
1107
+ // button.hidden = true
1108
+ // }
1109
+ // }
1110
+ // }
1111
+ if(this.show_data.defname === '现场勘察' || this.show_data.defname ==='入户安装') {
1112
+ console.log("this.shdata",this.show_data)
1113
+ if (this.show_data.fields[index].label === '是否具备安装条件') {
1114
+ for (const button of this.show_data.buttons) {
1115
+ if (this.show_data.fields[index].value === '否'&& button.button_name === '退回') {
1116
+ button.hidden = false
1117
+ }else {
1118
+ button.hidden = true
1119
+ }
1120
+ }
1121
+ }
1122
+ }
1123
+ // if (this.show_data.defname === '通气点火'){
1124
+ // let http = new HttpResetClass()
1125
+ // let data = {
1126
+ // tablename: 't_firemessage',
1127
+ // condition: `f_process_id='${this.selectdata.f_process_id}'`
1128
+ //
1129
+ // }
1130
+ // let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
1131
+ // console.log("res")
1132
+ // console.log(res.data)
1133
+ // if (this.show_data.fields[index].label === '是否已通气') {
1134
+ // if (res.data.length==0) {
1135
+ // this.show_data.fields[index].value = '否'
1136
+ // button.hidden = false
1137
+ // }else{
1138
+ // this.show_data.fields[index].value = '是'
1139
+ // button.hidden = true
1140
+ // }
1141
+ // }
1142
+ // }
1143
+ if (this.show_data.defname === '合同签订') {
1144
+ if (this.show_data.fields[index].label === '合同编号') {
1145
+ if (!isEmpty(this.show_data.fields[index].value)) {
1146
+ let http = new HttpResetClass()
1147
+ let data = {
1148
+ tablename: 't_apply',
1149
+ condition: `f_contract_number='${this.show_data.fields[index].value}'`
1150
+ }
1151
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
1152
+ resolveMsg: null,
1153
+ rejectMsg: '合同编号查重失败'
1154
+ })
1155
+ if (res.data.length > 0) {
1156
+ this.show_data.fields[index].value = null
1157
+ this.$showAlert('合同编号已存在!!!', 'warning', 3000)
1158
+ }
1159
+ //拼写合同编号
1160
+ // if (this.selectdata.f_apply_type == '工商户报建') {
1161
+ // this.show_data.fields[index].value = "ZS-S-" + this.show_data.fields[index].value
1162
+ // // this.show_data.fields[index].value = "ZS-S-" + this.show_data.fields[index].value + "-" + new Date().Format('yyyy-MM-dd')
1163
+ // }else {
1164
+ // this.show_data.fields[index].value = "ZS-M-" + this.show_data.fields[index].value
1165
+ // // this.show_data.fields[index].value = "ZS-M-" + this.show_data.fields[index].value + "-" + new Date().Format('yyyy-MM-dd')
1166
+ // }
1167
+ }
1168
+ }
1169
+ if (this.show_data.fields[index].label === '单价') {
1170
+ let http = new HttpResetClass()
1171
+ let data = {
1172
+ num1: this.getLableValue(this.show_data.fields[index].label),
1173
+ num2: this.getLableValue('户数'),
1174
+ operator: '*'
1175
+ }
1176
+ try {
1177
+ let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
1178
+ resolveMsg: null,
1179
+ rejectMsg: null
1180
+ })
1181
+ data = {
1182
+ num1: res.data,
1183
+ num2: this.getLableValue('其他费用'),
1184
+ operator: '+'
1185
+ }
1186
+ res = await http.load('POST', 'rs/logic/compute', {data: data}, {
1187
+ resolveMsg: null,
1188
+ rejectMsg: null
1189
+ })
1190
+ this.setLabelValue('合同金额',res.data)
1191
+ if(this.show_data.f_apply_type === '居民报建'){
1192
+ this.show_data.f_contract_money = res.data
1193
+ this.show_data.f_due_money = res.data
1194
+ this.show_data.f_surplus_money = res.data
1195
+ this.setLabelValue('应交总金额',res.data)
1196
+ this.setLabelValue('未结总金额',res.data)
1197
+ }
1198
+ } catch (e) {
1199
+ this.$showAlert(e.data.msg, 'warning', 3000)
1200
+ }
1201
+ }
1202
+ if (this.show_data.fields[index].label === '其他费用') {
1203
+ let http = new HttpResetClass()
1204
+ let data = {
1205
+ num1: this.getLableValue('单价'),
1206
+ num2: this.getLableValue('户数'),
1207
+ operator: '*'
1208
+ }
1209
+ try {
1210
+ let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
1211
+ resolveMsg: null,
1212
+ rejectMsg: null
1213
+ })
1214
+ data = {
1215
+ num1: res.data,
1216
+ num2: this.getLableValue('其他费用'),
1217
+ operator: '+'
1218
+ }
1219
+ res = await http.load('POST', 'rs/logic/compute', {data: data}, {
1220
+ resolveMsg: null,
1221
+ rejectMsg: null
1222
+ })
1223
+ this.setLabelValue('合同金额',res.data)
1224
+ if(this.show_data.f_apply_type === '居民报建'){
1225
+ this.show_data.f_contract_money = res.data
1226
+ this.show_data.f_due_money = res.data
1227
+ this.show_data.f_surplus_money = res.data
1228
+ this.setLabelValue('应交总金额',res.data)
1229
+ this.setLabelValue('未结总金额',res.data)
1230
+ }
1231
+ } catch (e) {
1232
+ this.$showAlert(e.data.msg, 'warning', 3000)
1233
+ }
1234
+ }
1235
+ /*if (this.show_data.fields[index].label === '其他费用') {
1236
+ let http = new HttpResetClass()
1237
+ let data = {
1238
+ num1: this.getLableValue(this.show_data.fields[index].label),
1239
+ num2: this.getLableValue('合同金额'),
1240
+ operator: '+'
1241
+ }
1242
+ try {
1243
+ let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
1244
+ resolveMsg: null,
1245
+ rejectMsg: null
1246
+ })
1247
+ this.setLabelValue('合同金额',res.data)
1248
+ if(this.show_data.f_apply_type === '居民报建'){
1249
+ this.show_data.f_contract_money = res.data
1250
+ this.show_data.f_due_money = res.data
1251
+ this.show_data.f_surplus_money = res.data
1252
+ this.setLabelValue('应交总金额',res.data)
1253
+ this.setLabelValue('未结总金额',res.data)
1254
+ }
1255
+ } catch (e) {
1256
+ this.$showAlert(e.data.msg, 'warning', 3000)
1257
+ }
1258
+ }*/
1259
+ }
1260
+ // ========================= 武安 =================================
1261
+ // 号码检测
1262
+ if (this.show_data.fields[index].label === '电话号码') {
1263
+ let phone = this.show_data.fields[index].value
1264
+ // 电话号码效验
1265
+ if (!(/^1[3456789]\d{9}$/.test(phone))) {
1266
+ this.show_data.fields[index].value = ""
1267
+ this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
1268
+ }
1269
+ }
1270
+ //时间提醒
1271
+ if (this.show_data.fields[index].label.includes("时间") || this.show_data.fields[index].type === 'datepicker') {
1272
+ let setTime = this.show_data.fields[index].value
1273
+ let nowTime = new Date().Format("yyyy-MM-dd HH:mm:ss")
1274
+ if (nowTime >= setTime) {
1275
+ this.$showMessage("请注意,当前节点时间/工期已过期!")
1276
+ }
1277
+ }
1278
+ },
1279
+ // input值发生变化
1280
+ async 'oninput'(index) {
1281
+
1282
+ },
1283
+ // 错误事件
1284
+ error_check(index) {
1285
+ // 时间格式检测
1286
+ if (this.show_data.fields[index].type == 'datepicker') {
1287
+ let dateRe = new RegExp(/(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)$/)
1288
+ let datetimeRe = new RegExp(/((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))\s([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/)
1289
+ if (datetimeRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 19 && this.show_data.fields[index].fullsize) {
1290
+ this.show_data.fields[index].error.flag = false
1291
+ } else if (dateRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 10) {
1292
+ this.show_data.fields[index].error.flag = false
1293
+ } else {
1294
+ if (this.show_data.fields[index].fullsize) {
1295
+ this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
1296
+ this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02 09:23:21'
1297
+ this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
1298
+ this.show_data.fields[index].error.flag = true
1299
+ this.show_data.fields[index].value = ''
1300
+ } else {
1301
+ this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
1302
+ this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02'
1303
+ this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
1304
+ this.show_data.fields[index].error.flag = true
1305
+ this.show_data.fields[index].value = ''
1306
+ }
1307
+
1308
+ }
1309
+ }
1310
+ },
1311
+ // onetomany模态框默认监听监听事件
1312
+ async 'onetomanydelete'(i, j) {
1313
+ console.log('默认删除')
1314
+ let http = new HttpResetClass()
1315
+ let data = {
1316
+ table: this.show_data.onetomany[i].tables[0],
1317
+ row: this.show_data.onetomany[i].rows[j]
1318
+ }
1319
+ let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
1320
+ resolveMsg: null,
1321
+ rejectMsg: '删除失败'
1322
+ })
1323
+
1324
+ if (res.data <= 0){
1325
+ this.$showMessage('删除失败')
1326
+ return
1327
+ }
1328
+
1329
+ this.$dispatch('breakControl', this.show_data)
1330
+ },
1331
+ async 'onetomanyadd'(index) {
1332
+
1333
+ let data = {
1334
+ f_process_id : this.show_data.f_process_id
1335
+ }
1336
+ this.show_data.onetomany[index].fields.forEach(item => {
1337
+ data[item.field] = item.value
1338
+ })
1339
+ let res = await this.$resetpost(
1340
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1341
+ data
1342
+ )
1343
+ this.$dispatch('breakControl', this.show_data)
1344
+ },
1345
+ async 'onetomanyupdate'(i, j) {
1346
+ let onetomany = this.show_data.onetomany[i]
1347
+ let data = onetomany.rows[j]
1348
+
1349
+ onetomany.fields.forEach(item => {
1350
+ data[item.field] = item.value
1351
+ })
1352
+ let res = await this.$resetpost(
1353
+ `rs/entity/${this.show_data.onetomany[i].tables[0]}`,
1354
+ data
1355
+ )
1356
+
1357
+ this.$dispatch('breakControl', this.show_data)
1358
+ },
1359
+ // 选择用户档案信息
1360
+ 'selectUserinfo'(row) {
1361
+ console.log("当前选择数据",row)
1362
+ if (this.selectdata.f_apply_type === '拆改装报建'){
1363
+ this.showLabels('用户编号')
1364
+ this.hideLabels('地址类型','区域','街道','小区','楼号','单元','楼层','门牌号')
1365
+ this.electiveLabels('地址类型','区域','街道','小区','楼号','单元','楼层','门牌号')
1366
+ this.show_data.f_address_type = '民用地址'
1367
+ this.show_data.f_pcd = row.f_pcd
1368
+ this.show_data.f_street = row.f_street
1369
+ this.show_data.f_residential_area = row.f_residential_area
1370
+ this.show_data.f_building = row.f_building
1371
+ this.show_data.f_unit = row.f_unit
1372
+ this.show_data.f_floor = row.f_floor
1373
+ this.show_data.f_room = row.f_room
1374
+ this.selectdata.flag = '旧用户'
1375
+ }
1376
+ this.setLabelValue('用户编号', row.f_userinfo_code)
1377
+ this.setLabelValue('用户名称', row.f_user_name)
1378
+ this.setLabelValue('用户电话', row.f_user_phone)
1379
+ this.setLabelValue('证件类型', row.f_credentials)
1380
+ this.setLabelValue('证件号码', row.f_idnumber)
1381
+ this.setLabelValue('地址', row.f_address)
1382
+
1383
+ this.selectdata.f_userinfo_id = row.f_userinfo_id
1384
+ this.selectdata.f_userinfo_code = row.f_userinfo_code
1385
+ console.log("当前选择数据",this.show_data)
1386
+ },
1387
+ async 'streetChange'(index) {
1388
+ if (isEmpty(this.show_data.f_street)) {
1389
+ return
1390
+ }
1391
+
1392
+ this.setLabelValue('小区', null)
1393
+
1394
+ let data = {
1395
+ tablename: 't_area',
1396
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1397
+ }
1398
+ let http = new HttpResetClass()
1399
+ let res = await http.load(
1400
+ 'POST',
1401
+ `rs/sql/singleTable`,
1402
+ {data: data},
1403
+ {resolveMsg: null, rejectMsg: '小区!!!'}
1404
+ )
1405
+
1406
+ this.setLabelOptions('小区', res.data.map(item => {
1407
+ return {
1408
+ label: item.f_residential_area,
1409
+ value: item.f_residential_area
1410
+ }
1411
+ }))
1412
+ },
1413
+ // 区县失去焦点
1414
+ async 'pcdChange'(index) {
1415
+ if (isEmpty(this.show_data.f_pcd)) {
1416
+ return
1417
+ }
1418
+
1419
+ this.setLabelValue('街道', null)
1420
+ this.setLabelValue('小区', null)
1421
+
1422
+
1423
+ let data = {
1424
+ tablename: 't_street',
1425
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1426
+ }
1427
+ let f_address_type = this.getLableValue('地址类型')
1428
+
1429
+ if (f_address_type === '民用地址') {
1430
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1431
+ }
1432
+
1433
+ let http = new HttpResetClass()
1434
+ let res = await http.load(
1435
+ 'POST',
1436
+ `rs/sql/singleTable`,
1437
+ {data: data},
1438
+ {resolveMsg: null, rejectMsg: '街道查询失败!!!'}
1439
+ )
1440
+
1441
+ this.setLabelOptions('街道', res.data.map(item => {
1442
+ return {
1443
+ label: item.f_street,
1444
+ value: item.f_street
1445
+ }
1446
+ }))
1447
+ },
1448
+ 'buttonChange' (index) {
1449
+ if (this.show_data.fields[index].value === '否') {
1450
+ console.log("测试")
1451
+ this.hideButtons('下发','提交')
1452
+ this.showButtons('退回','终止')
1453
+ } else {
1454
+ this.hideButtons('退回','终止')
1455
+ this.showButtons('下发','提交')
1456
+ }
1457
+ },
1458
+ async 'stopApply'() {
1459
+ this.stope_view = true
1460
+ this.showview = false
1461
+ },
1462
+ async 'signUserInfo' (index) {
1463
+ if (this.show_data.fields[index].value === '是') {
1464
+ console.log("测试")
1465
+ this.showLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
1466
+ this.requiredLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '门牌号', '地址')
1467
+ } else {
1468
+ this.hideLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
1469
+ this.electiveLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
1470
+ }
1471
+ },
1472
+ // onetomany模态框监听事件
1473
+ async 'onchange_modal'(index, i) {
1474
+ },
1475
+ async 'oninput_modal'(index, i) {
1476
+ }
1477
+ },
1478
+ watch: {
1479
+ }
1480
+ }
1481
+ </script>
1482
+ <style scoped>
1483
+ /*清除model中的浮动*/
1484
+ .clearfix:after,.clearfix:before{
1485
+ display: table;
1486
+ }
1487
+ .clearfix:after{
1488
+ clear: both;
1489
+ }
1490
+ </style>