apply-clients 4.1.85 → 4.1.86
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.
|
@@ -1,1222 +1,1222 @@
|
|
|
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
|
-
// 组件初始化操作
|
|
52
|
-
refurbish() {
|
|
53
|
-
this.json_datas = this.$workflow_vue
|
|
54
|
-
let sum = 0
|
|
55
|
-
let jsonData = {}
|
|
56
|
-
if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length == 0) {
|
|
57
|
-
this.$showMessage("网络故障,请刷新页面")
|
|
58
|
-
return
|
|
59
|
-
}
|
|
60
|
-
for (let i = 0; i < this.json_datas.activitys.length; i++) {
|
|
61
|
-
if (this.selectdata.defname == this.json_datas.activitys[i].title) {
|
|
62
|
-
jsonData = this.json_datas.activitys[i] // 拿到当前节点的json配置信息
|
|
63
|
-
sum++ // 节点名一样的个数
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if (sum == 1) {
|
|
67
|
-
this.data = null
|
|
68
|
-
this.data = jsonData
|
|
69
|
-
// selectdata 填充 data
|
|
70
|
-
this.data = Object.assign({}, this.data, this.selectdata)
|
|
71
|
-
this.initializeJSON()
|
|
72
|
-
} else if (sum == 0) {
|
|
73
|
-
this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
|
|
74
|
-
} else {
|
|
75
|
-
this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
// json配置数据处理
|
|
79
|
-
async initializeJSON() {
|
|
80
|
-
// 有默认值,value就给默认值,没有就是null
|
|
81
|
-
this.data.fields.forEach(item => {
|
|
82
|
-
if (!item.value) {
|
|
83
|
-
if (item.value === 0) {
|
|
84
|
-
item.value = 0
|
|
85
|
-
} else {
|
|
86
|
-
item.value = null
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
if (item.default || item.default == 0) {
|
|
90
|
-
if(item.type === 'datepicker'){
|
|
91
|
-
item.value = ''
|
|
92
|
-
}else {
|
|
93
|
-
item.value = item.default
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
if (this.selectdata[item.field]) {
|
|
97
|
-
// 将json字符串格式化赋值给value
|
|
98
|
-
if (String(this.selectdata[item.field]).startsWith("{")) {
|
|
99
|
-
item.value = JSON.parse(this.selectdata[item.field])
|
|
100
|
-
this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
|
|
101
|
-
} else {
|
|
102
|
-
item.value = this.selectdata[item.field]
|
|
103
|
-
}
|
|
104
|
-
} else {
|
|
105
|
-
if (this.selectdata[item.field] === 0) {
|
|
106
|
-
item.value = 0
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// datepicker 没有值给当时值
|
|
111
|
-
if (item.type === 'datepicker' && !item.value && item.default) {
|
|
112
|
-
item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// 如果配置类型为select,优先从参数列表获取options
|
|
116
|
-
if (item.type === 'select') {
|
|
117
|
-
let temp = null
|
|
118
|
-
|
|
119
|
-
temp = this.$appdata.getParam(item.label)
|
|
120
|
-
|
|
121
|
-
if (temp && temp.length > 0 && item.label) {
|
|
122
|
-
item.options = temp
|
|
123
|
-
} else {
|
|
124
|
-
if (item.paramLabel) {
|
|
125
|
-
temp = this.$appdata.getParam(item.paramLabel)
|
|
126
|
-
if (temp && temp.length > 0) {
|
|
127
|
-
item.options = temp
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
// 控制组件
|
|
135
|
-
if (this.data.components) {
|
|
136
|
-
this.data.components.forEach(item => {
|
|
137
|
-
if (!item.mark) {
|
|
138
|
-
item.mark = 0
|
|
139
|
-
}
|
|
140
|
-
})
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// 初始化 fields 可对数据进行特殊处理
|
|
144
|
-
this.initializeFields()
|
|
145
|
-
|
|
146
|
-
// 初始化 buttons_fields
|
|
147
|
-
for (let i = 0; i < this.data.buttons.length; i++) {
|
|
148
|
-
// 下发按钮相关配置
|
|
149
|
-
if (this.data.buttons[i].button_name === '下发') {
|
|
150
|
-
if (this.data.buttons[i].button_fields && this.data.buttons[i].button_fields.length === 1) {
|
|
151
|
-
if (this.data.buttons[i].source){
|
|
152
|
-
let http = new HttpResetClass()
|
|
153
|
-
let res = await http.load('POST', 'rs/search', {
|
|
154
|
-
source: this.data.buttons[i].source,
|
|
155
|
-
userid: this.$login.f.id
|
|
156
|
-
}, {resolveMsg: null, rejectMsg: null})
|
|
157
|
-
|
|
158
|
-
let options = []
|
|
159
|
-
for (let i = 0; i < res.data.length; i++) {
|
|
160
|
-
options.push(
|
|
161
|
-
{
|
|
162
|
-
"label": res.data[i].name,
|
|
163
|
-
"value": res.data[i].id
|
|
164
|
-
}
|
|
165
|
-
)
|
|
166
|
-
}
|
|
167
|
-
this.data.buttons[i].button_fields[0]['options'] = options
|
|
168
|
-
} else {
|
|
169
|
-
this.$showMessage("请配置获取人员表达式")
|
|
170
|
-
}
|
|
171
|
-
} else {
|
|
172
|
-
this.$showMessage("下发按钮必须满足 当且仅当一个字段")
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
if (this.data.buttons[i].button_fields) {
|
|
176
|
-
this.data.buttons[i].button_fields.forEach(x => {
|
|
177
|
-
// 如果配置类型为select,优先从参数列表获取options
|
|
178
|
-
if (x.type === 'select' && this.$appdata.getParam(x.label)) {
|
|
179
|
-
x.options = this.$appdata.getParam(x.label).trim()
|
|
180
|
-
}
|
|
181
|
-
})
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// onetomany 数据获取
|
|
186
|
-
if (this.data.onetomany) {
|
|
187
|
-
for (let index = 0; index < this.data.onetomany.length; index++) {
|
|
188
|
-
let res = null
|
|
189
|
-
if (!this.data.onetomany[index].queryEvent || this.data.onetomany[index].queryEvent === 'default'){
|
|
190
|
-
let http = new HttpResetClass()
|
|
191
|
-
let data = {
|
|
192
|
-
tablename: this.data.onetomany[index].tables[0],
|
|
193
|
-
condition: `f_process_id='${this.selectdata.f_process_id}'`
|
|
194
|
-
}
|
|
195
|
-
res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
|
|
196
|
-
resolveMsg: null,
|
|
197
|
-
rejectMsg: 'onetomany查询失败'
|
|
198
|
-
})
|
|
199
|
-
} else {
|
|
200
|
-
res = this[this.data.onetomany[index].queryEvent]()
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// 初始化 onetomany
|
|
204
|
-
this.data.onetomany[index].rows = res.data
|
|
205
|
-
|
|
206
|
-
// 初始化onetomany中的fields
|
|
207
|
-
for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
|
|
208
|
-
if (!this.data.onetomany[index].fields[j].value) {
|
|
209
|
-
if (this.data.onetomany[index].fields[j].value === 0) {
|
|
210
|
-
this.data.onetomany[index].fields[j].value = 0
|
|
211
|
-
} else {
|
|
212
|
-
this.data.onetomany[index].fields[j].value = null
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
if (this.data.onetomany[index].fields[j].default || this.data.onetomany[index].fields[j].default == 0) {
|
|
216
|
-
this.data.onetomany[index].fields[j].value = this.data.onetomany[index].fields[j].default
|
|
217
|
-
}
|
|
218
|
-
// 如果配置类型为select,优先从参数列表获取options
|
|
219
|
-
if (this.data.onetomany[index].fields[j].type === 'select') {
|
|
220
|
-
let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
|
|
221
|
-
if (temp && temp.length > 0) {
|
|
222
|
-
this.data.onetomany[index].fields[j].options = temp
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
|
|
230
|
-
let temp = JSON.parse(JSON.stringify(this.data))
|
|
231
|
-
|
|
232
|
-
this.show_data = temp
|
|
233
|
-
this.$nextTick(() => {
|
|
234
|
-
this.showview = true
|
|
235
|
-
})
|
|
236
|
-
// 初始化加载
|
|
237
|
-
// ========================= 中盛 =================================
|
|
238
|
-
|
|
239
|
-
if (this.selectdata.defname === '报建登记') {
|
|
240
|
-
let http = new HttpResetClass()
|
|
241
|
-
let condition = "f_filialeid = " + this.$login.f.orgid
|
|
242
|
-
let res = await http.load('POST','rs/sql/apply_singleTable',{data:{tablename:'t_area',condition:condition}}, {resolveMsg: null, rejectMsg: null})
|
|
243
|
-
for (let i = 0; i < this.show_data.fields.length; i++) {
|
|
244
|
-
|
|
245
|
-
if (this.show_data.fields[i].label == '街道') {
|
|
246
|
-
let data = []
|
|
247
|
-
let array = []
|
|
248
|
-
data = res.data.map(item => {
|
|
249
|
-
return item.f_street;
|
|
250
|
-
})
|
|
251
|
-
for (let q = 0; q < data.length; q++) {
|
|
252
|
-
let arraydata = {
|
|
253
|
-
'label': data[q],
|
|
254
|
-
'value': data[q]
|
|
255
|
-
}
|
|
256
|
-
if (array.length != 0) {
|
|
257
|
-
for (let w = 0; w < array.length; w++) {
|
|
258
|
-
if (array[w].label == data[q]) {
|
|
259
|
-
break
|
|
260
|
-
}
|
|
261
|
-
while (w == array.length - 1) {
|
|
262
|
-
array.push(arraydata)
|
|
263
|
-
break
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
} else {
|
|
267
|
-
array.push(arraydata)
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
this.show_data.fields[i].options = array
|
|
271
|
-
console.log("街道选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
|
|
272
|
-
}
|
|
273
|
-
if (this.show_data.fields[i].label == '小区') {
|
|
274
|
-
let data = []
|
|
275
|
-
let array = []
|
|
276
|
-
data = res.data.map(item => {
|
|
277
|
-
return item.f_residential_area;
|
|
278
|
-
})
|
|
279
|
-
for (let q = 0; q < data.length; q++) {
|
|
280
|
-
let arraydata = {
|
|
281
|
-
'label': data[q],
|
|
282
|
-
'value': data[q]
|
|
283
|
-
}
|
|
284
|
-
if (array.length != 0) {
|
|
285
|
-
for (let w = 0; w < array.length; w++) {
|
|
286
|
-
if (array[w].label == data[q]) {
|
|
287
|
-
break
|
|
288
|
-
}
|
|
289
|
-
while (w == array.length - 1) {
|
|
290
|
-
array.push(arraydata)
|
|
291
|
-
break
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
} else {
|
|
295
|
-
array.push(arraydata)
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
this.show_data.fields[i].options = array
|
|
299
|
-
console.log("小区选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
if (this.selectdata.defname === '施工') {
|
|
304
|
-
// for (let i = 0; i < this.show_data.fields.length; i++) {
|
|
305
|
-
// if (this.show_data.fields[i].label == '工程状态') {
|
|
306
|
-
// this.show_data.fields[i].value = ''
|
|
307
|
-
// }
|
|
308
|
-
// }
|
|
309
|
-
for (const item of this.show_data.fields) {
|
|
310
|
-
if (item.label === '工程状态' && !item.value) {
|
|
311
|
-
return item.value = '未开工'
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
},
|
|
317
|
-
// 初始化fields值
|
|
318
|
-
initializeFields() {
|
|
319
|
-
|
|
320
|
-
},
|
|
321
|
-
// 金额转大写
|
|
322
|
-
smalltoBIG(n) {
|
|
323
|
-
let fraction = ['角', '分'];
|
|
324
|
-
let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
|
|
325
|
-
let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
|
|
326
|
-
let head = n < 0 ? '欠' : '';
|
|
327
|
-
n = Math.abs(n);
|
|
328
|
-
|
|
329
|
-
let s = '';
|
|
330
|
-
|
|
331
|
-
for (var i = 0; i < fraction.length; i++) {
|
|
332
|
-
s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
|
|
333
|
-
}
|
|
334
|
-
s = s || '整';
|
|
335
|
-
n = Math.floor(n);
|
|
336
|
-
|
|
337
|
-
for (var i = 0; i < unit[0].length && n > 0; i++) {
|
|
338
|
-
let p = '';
|
|
339
|
-
for (var j = 0; j < unit[1].length && n > 0; j++) {
|
|
340
|
-
p = digit[n % 10] + unit[1][j] + p;
|
|
341
|
-
n = Math.floor(n / 10);
|
|
342
|
-
}
|
|
343
|
-
s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
|
|
344
|
-
}
|
|
345
|
-
return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
|
|
346
|
-
},
|
|
347
|
-
getLableValue(label) {
|
|
348
|
-
for (const item of this.show_data.fields) {
|
|
349
|
-
if (item.label === label && item.type !== 'number') {
|
|
350
|
-
return item.value || ''
|
|
351
|
-
}
|
|
352
|
-
if (item.label === label && item.type === 'number') {
|
|
353
|
-
return item.value || 0
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
},
|
|
357
|
-
setLabelValue(label, value) {
|
|
358
|
-
for (const item of this.show_data.fields) {
|
|
359
|
-
if (item.label === label) {
|
|
360
|
-
item.value = value
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
},
|
|
364
|
-
setLabelOptions(label, options) {
|
|
365
|
-
for (const item of this.show_data.fields) {
|
|
366
|
-
if (item.label === label) {
|
|
367
|
-
item.options = options
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
},
|
|
371
|
-
showLabels(...labels) {
|
|
372
|
-
for (const item of this.show_data.fields) {
|
|
373
|
-
if (labels.includes(item.label)) {
|
|
374
|
-
item.hidden = false
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
hideLabels(...labels) {
|
|
379
|
-
for (const item of this.show_data.fields) {
|
|
380
|
-
if (labels.includes(item.label)) {
|
|
381
|
-
item.hidden = true
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
},
|
|
385
|
-
requiredLabels(...labels) {
|
|
386
|
-
for (const item of this.show_data.fields) {
|
|
387
|
-
if (labels.includes(item.label)) {
|
|
388
|
-
item.required = true
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
electiveLabels(...labels) {
|
|
393
|
-
for (const item of this.show_data.fields) {
|
|
394
|
-
if (labels.includes(item.label)) {
|
|
395
|
-
item.required = false
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
readonlyLabels(...labels) {
|
|
400
|
-
for (const item of this.show_data.fields) {
|
|
401
|
-
if (labels.includes(item.label)) {
|
|
402
|
-
item.readonly = true
|
|
403
|
-
item.disabled = true
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
},
|
|
407
|
-
readwriteLabels(...labels) {
|
|
408
|
-
for (const item of this.show_data.fields) {
|
|
409
|
-
if (labels.includes(item.label)) {
|
|
410
|
-
item.readonly = false
|
|
411
|
-
item.disabled = false
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
},
|
|
415
|
-
showButtons(...buttons) {
|
|
416
|
-
for (const item of this.show_data.buttons) {
|
|
417
|
-
if (buttons.includes(item.button_name)) {
|
|
418
|
-
item.hidden = false
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
},
|
|
422
|
-
hideButtons(...buttons) {
|
|
423
|
-
for (const item of this.show_data.buttons) {
|
|
424
|
-
if (buttons.includes(item.button_name)) {
|
|
425
|
-
item.hidden = true
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
},
|
|
429
|
-
// 获取区县
|
|
430
|
-
async getPcd() {
|
|
431
|
-
let data = {
|
|
432
|
-
tablename: 't_pcd',
|
|
433
|
-
condition: `f_filialeid = '${this.$login.f.orgid}'`
|
|
434
|
-
}
|
|
435
|
-
let http = new HttpResetClass()
|
|
436
|
-
let res = await http.load(
|
|
437
|
-
'POST',
|
|
438
|
-
`rs/sql/singleTable`,
|
|
439
|
-
{data: data},
|
|
440
|
-
{resolveMsg: null, rejectMsg: '区县查询失败!!!'}
|
|
441
|
-
)
|
|
442
|
-
|
|
443
|
-
let pcd = res.data.map(item => {
|
|
444
|
-
return {
|
|
445
|
-
label: item.f_pcd,
|
|
446
|
-
value: item.f_pcd
|
|
447
|
-
}
|
|
448
|
-
})
|
|
449
|
-
this.setLabelOptions('区域',pcd)
|
|
450
|
-
},
|
|
451
|
-
// 地址关联
|
|
452
|
-
addressInitialization() {
|
|
453
|
-
this.$getConfig(this, 'UserAddress')
|
|
454
|
-
|
|
455
|
-
let f_address_type = this.show_data.f_address_type
|
|
456
|
-
|
|
457
|
-
for (const item of this.show_data.fields) {
|
|
458
|
-
if (f_address_type === '民用地址') {
|
|
459
|
-
if (item.label === '区域' || item.label === '街道' || item.label === '小区' || item.label === '门牌号') {
|
|
460
|
-
item.hidden = false
|
|
461
|
-
item.required = true
|
|
462
|
-
}
|
|
463
|
-
if (item.label === '楼号' || item.label === '单元' || item.label === '楼层') {
|
|
464
|
-
item.hidden = false
|
|
465
|
-
item.required = false
|
|
466
|
-
}
|
|
467
|
-
if (item.label === '地址') {
|
|
468
|
-
item.readonly = true
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
if (f_address_type === '特殊地址') {
|
|
472
|
-
if (item.label === '区域' || item.label === '街道') {
|
|
473
|
-
item.hidden = false
|
|
474
|
-
item.required = true
|
|
475
|
-
}
|
|
476
|
-
if (item.label === '小区') {
|
|
477
|
-
item.hidden = true
|
|
478
|
-
item.required = false
|
|
479
|
-
}
|
|
480
|
-
if (item.label === '楼号' || item.label === '单元' || item.label === '楼层' || item.label === '门牌号') {
|
|
481
|
-
item.hidden = true
|
|
482
|
-
item.required = false
|
|
483
|
-
}
|
|
484
|
-
if (item.label === '地址') {
|
|
485
|
-
item.readonly = false
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
|
|
490
|
-
item.hidden = true
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
},
|
|
494
|
-
async streetChange() {
|
|
495
|
-
if (isEmpty(this.show_data.f_street)) {
|
|
496
|
-
return
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
let data = {
|
|
500
|
-
tablename: 't_area',
|
|
501
|
-
condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
|
|
502
|
-
}
|
|
503
|
-
let http = new HttpResetClass()
|
|
504
|
-
let res = await http.load(
|
|
505
|
-
'POST',
|
|
506
|
-
`rs/sql/singleTable`,
|
|
507
|
-
{data: data},
|
|
508
|
-
{resolveMsg: null, rejectMsg: '小区查询失败!!!'}
|
|
509
|
-
)
|
|
510
|
-
|
|
511
|
-
this.setLabelOptions('小区', res.data.map(item => {
|
|
512
|
-
return {
|
|
513
|
-
label: item.f_residential_area,
|
|
514
|
-
value: item.f_residential_area
|
|
515
|
-
}
|
|
516
|
-
}))
|
|
517
|
-
},
|
|
518
|
-
async pcdChange() {
|
|
519
|
-
if (isEmpty(this.show_data.f_pcd)) {
|
|
520
|
-
return
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
let data = {
|
|
524
|
-
tablename: 't_street',
|
|
525
|
-
condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
|
|
526
|
-
}
|
|
527
|
-
let f_address_type = this.getLableValue('地址类型')
|
|
528
|
-
|
|
529
|
-
if (f_address_type === '民用地址') {
|
|
530
|
-
data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
let http = new HttpResetClass()
|
|
534
|
-
let res = await http.load(
|
|
535
|
-
'POST',
|
|
536
|
-
`rs/sql/singleTable`,
|
|
537
|
-
{data: data},
|
|
538
|
-
{resolveMsg: null, rejectMsg: '街道查询失败!!!'}
|
|
539
|
-
)
|
|
540
|
-
|
|
541
|
-
this.setLabelOptions('街道', res.data.map(item => {
|
|
542
|
-
return {
|
|
543
|
-
label: item.f_street,
|
|
544
|
-
value: item.f_street
|
|
545
|
-
}
|
|
546
|
-
}))
|
|
547
|
-
},
|
|
548
|
-
async buttonBefore(model) {
|
|
549
|
-
if (model.defname === '报建登记' && model.button.button_name === '提交') {
|
|
550
|
-
|
|
551
|
-
if (model.f_is_user === '是') {
|
|
552
|
-
if (isEmpty(model.f_user_name) || isEmpty(model.f_phone) || isEmpty(model.f_address)) {
|
|
553
|
-
throw '用户信息未填写完整,无法提交!!!'
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
if (
|
|
558
|
-
model.button.button_name === '提交' &&
|
|
559
|
-
model.defname === '通气点火' &&
|
|
560
|
-
(
|
|
561
|
-
model.f_apply_type === '散户报建' ||
|
|
562
|
-
model.f_apply_type === '工商户报建'
|
|
563
|
-
) &&
|
|
564
|
-
model.f_surplus_money > 0
|
|
565
|
-
) {
|
|
566
|
-
throw '未结金额大于0,无法提交!!!'
|
|
567
|
-
}
|
|
568
|
-
if (model.defname === '验收是否合格' && model.button.button_name === '提交') {
|
|
569
|
-
let http = new HttpResetClass()
|
|
570
|
-
let data = {
|
|
571
|
-
f_process_id: model.f_process_id
|
|
572
|
-
}
|
|
573
|
-
let res = await http.load('POST', 'rs/sql/notInstalled', {data: data}, {resolveMsg: null, rejectMsg: null})
|
|
574
|
-
if (res.data[0].num > 0) {
|
|
575
|
-
throw `还有${res.data[0].num}户未安装,无法提交`
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
return model
|
|
579
|
-
},
|
|
580
|
-
// ========================= 武安 =================================
|
|
581
|
-
// 地址类型变化
|
|
582
|
-
addressType() {
|
|
583
|
-
for (const item of this.show_data.fields) {
|
|
584
|
-
if (item.label === '小区' && this.show_data.f_address_type === '民用地址') {
|
|
585
|
-
item.hidden = false
|
|
586
|
-
item.required = true
|
|
587
|
-
}
|
|
588
|
-
if (item.label === '小区' && this.show_data.f_address_type === '特殊地址') {
|
|
589
|
-
item.required = false
|
|
590
|
-
}
|
|
591
|
-
if (
|
|
592
|
-
(
|
|
593
|
-
item.label === '门牌号'
|
|
594
|
-
) && this.show_data.f_address_type === '民用地址'
|
|
595
|
-
) {
|
|
596
|
-
item.required = true
|
|
597
|
-
item.hidden = false
|
|
598
|
-
item.value = null
|
|
599
|
-
}
|
|
600
|
-
if (
|
|
601
|
-
(
|
|
602
|
-
item.label === '楼号' ||
|
|
603
|
-
item.label === '单元' ||
|
|
604
|
-
item.label === '楼层'
|
|
605
|
-
) && this.show_data.f_address_type === '民用地址'
|
|
606
|
-
) {
|
|
607
|
-
item.required = false
|
|
608
|
-
item.hidden = false
|
|
609
|
-
item.value = null
|
|
610
|
-
}
|
|
611
|
-
if (
|
|
612
|
-
(
|
|
613
|
-
item.label === '楼号' ||
|
|
614
|
-
item.label === '单元' ||
|
|
615
|
-
item.label === '楼层' ||
|
|
616
|
-
item.label === '门牌号'
|
|
617
|
-
) && this.show_data.f_address_type === '特殊地址'
|
|
618
|
-
) {
|
|
619
|
-
item.required = false
|
|
620
|
-
item.hidden = true
|
|
621
|
-
item.value = null
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
this.getPcd()
|
|
625
|
-
}
|
|
626
|
-
// ========================= 武安 =================================
|
|
627
|
-
},
|
|
628
|
-
events: {
|
|
629
|
-
// ========================= 武安 =================================
|
|
630
|
-
// ========================= 武安 =================================
|
|
631
|
-
'openAddModel'(index) {
|
|
632
|
-
// ========================= 武安 =================================
|
|
633
|
-
// ========================= 武安 =================================
|
|
634
|
-
},
|
|
635
|
-
// 获取view层button事件/
|
|
636
|
-
async 'button'(model) {
|
|
637
|
-
// 修改提交数据
|
|
638
|
-
model = Object.assign({}, this.selectdata, model)
|
|
639
|
-
// 点击重置按钮就重置数据
|
|
640
|
-
if (model.button.button_name === '重置') {
|
|
641
|
-
this.$dispatch('breakControl', this.data)
|
|
642
|
-
return
|
|
643
|
-
}
|
|
644
|
-
// 提交前置
|
|
645
|
-
try {
|
|
646
|
-
model = await this.buttonBefore(model)
|
|
647
|
-
} catch (e) {
|
|
648
|
-
this.$showAlert(e, 'warning', 3000)
|
|
649
|
-
return
|
|
650
|
-
}
|
|
651
|
-
let http = new HttpResetClass()
|
|
652
|
-
let requestData = {
|
|
653
|
-
tables: this.data.tables,
|
|
654
|
-
start_activity: this.$workflow_vue.start_activity,
|
|
655
|
-
model: model,
|
|
656
|
-
loginUser: this.$login.f,
|
|
657
|
-
workflow_gxmlfilename: this.$workflow_vue.workflow_xmlfilename
|
|
658
|
-
}
|
|
659
|
-
console.log("gwfwe",this.selectdata)
|
|
660
|
-
// 下发,提交,保存,退回通用业务后台处理logic
|
|
661
|
-
let url = 'rs/logic/ApplyProductService'
|
|
662
|
-
let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
|
|
663
|
-
if (res.data.code === 200) {
|
|
664
|
-
this.$dispatch('search')
|
|
665
|
-
} else {
|
|
666
|
-
if (res.data.msg) {
|
|
667
|
-
this.$showMessage(res.data.msg)
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
async 'initializtionView'() {
|
|
672
|
-
// ========================= 武安 =================================
|
|
673
|
-
this.addressType()
|
|
674
|
-
// ========================= 武安 =================================
|
|
675
|
-
},
|
|
676
|
-
// 失去焦点出触发事件
|
|
677
|
-
async 'onchange'(index) {
|
|
678
|
-
console.log('失去焦点')
|
|
679
|
-
// ========================= 武安 =================================
|
|
680
|
-
if (this.show_data.defname === '报建登记' || this.show_data.defname === '业务申请'){
|
|
681
|
-
if (this.show_data.fields[index].label === '是否具备安装条件') {
|
|
682
|
-
for (const button of this.show_data.buttons) {
|
|
683
|
-
if (this.show_data.fields[index].value === '否'&& button.button_name === '退回') {
|
|
684
|
-
button.hidden = false
|
|
685
|
-
}else {
|
|
686
|
-
button.hidden = true
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
if (this.show_data.fields[index].label === '地址类型'){
|
|
691
|
-
this.addressType()
|
|
692
|
-
}
|
|
693
|
-
// if (this.show_data.fields[index].label === '街道'){
|
|
694
|
-
// console.log('-----------添加街道-----------')
|
|
695
|
-
// if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
|
|
696
|
-
// this.show_data.fields[index].value = null
|
|
697
|
-
// this.$showAlert('街道地址不能为空!!!', 'warning', 3000)
|
|
698
|
-
// return
|
|
699
|
-
// }
|
|
700
|
-
// let http = new HttpResetClass()
|
|
701
|
-
// let data = {
|
|
702
|
-
// f_adjustable_id: '', // 调压箱编号
|
|
703
|
-
// f_orgid: this.$login.f.orgid, // 组织id
|
|
704
|
-
// f_orgname: this.$login.f.orgs, // 组织名
|
|
705
|
-
// f_pcd: '河北省邯郸市武安市', // 省市区
|
|
706
|
-
// f_pcd_id: 8, // 省市区id
|
|
707
|
-
// // f_pcd_id: 124, // 50.4测试
|
|
708
|
-
// f_slice_area: '', // 片区
|
|
709
|
-
// f_operatorid: this.$login.f.id, // 操作人id
|
|
710
|
-
// f_operator: this.$login.f.name, // 操作人
|
|
711
|
-
// f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
|
|
712
|
-
// f_street: this.show_data.fields[index].value.trim(), // 地址
|
|
713
|
-
// f_comments: '报建系统自动创建' // 备注
|
|
714
|
-
// }
|
|
715
|
-
// try {
|
|
716
|
-
// let res = await http.load('POST', 'rs/logic/address_updatestreet', {data: data}, {
|
|
717
|
-
// resolveMsg: null,
|
|
718
|
-
// rejectMsg: null
|
|
719
|
-
// })
|
|
720
|
-
// } catch (e) {
|
|
721
|
-
// if (e.status === 635) {
|
|
722
|
-
// this.$showAlert('此街道已存在!!!', 'warning', 3000)
|
|
723
|
-
// } else {
|
|
724
|
-
// this.$showAlert('自动添加街道失败,请手动添加!!!', 'danger', 3000)
|
|
725
|
-
// }
|
|
726
|
-
// }
|
|
727
|
-
// }
|
|
728
|
-
// if (this.show_data.fields[index].label === '小区') {
|
|
729
|
-
// if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
|
|
730
|
-
// this.show_data.fields[index].value = null
|
|
731
|
-
// this.$showAlert('小区名称不能为空!!!', 'warning', 3000)
|
|
732
|
-
// return
|
|
733
|
-
// }
|
|
734
|
-
// // 先查询街道
|
|
735
|
-
// let street = null
|
|
736
|
-
// for (const item of this.show_data.fields) {
|
|
737
|
-
// if (item.label === '街道') {
|
|
738
|
-
// if (item.value.trim() === null || item.value.trim() === '') {
|
|
739
|
-
// this.show_data.fields[index].value = null
|
|
740
|
-
// this.$showAlert('请先录入街道信息,才能录入小区信息!!!', 'warning', 3000)
|
|
741
|
-
// return
|
|
742
|
-
// }
|
|
743
|
-
// let http = new HttpResetClass()
|
|
744
|
-
// let data = {
|
|
745
|
-
// 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()}'`
|
|
746
|
-
// }
|
|
747
|
-
// let res = await http.load('POST', 'rs/sql/address_getstreetlist', {data: data}, {
|
|
748
|
-
// resolveMsg: null,
|
|
749
|
-
// rejectMsg: null
|
|
750
|
-
// })
|
|
751
|
-
// if (res.data.length > 0) {
|
|
752
|
-
// street = res.data[0]
|
|
753
|
-
// } else {
|
|
754
|
-
// this.show_data.fields[index].value = null
|
|
755
|
-
// this.$showAlert(`【${item.value}】街道不存在,请手动添加或重新输入街道信息,在录入小区信息!!!`, 'warning', 3000)
|
|
756
|
-
// }
|
|
757
|
-
// }
|
|
758
|
-
// }
|
|
759
|
-
// console.log('-----------添加小区-----------')
|
|
760
|
-
// let data = {
|
|
761
|
-
// f_linkname: '', // 联系人
|
|
762
|
-
// f_linkphone: '', // 联系电话
|
|
763
|
-
// f_adjustable_id: '', // 调压箱编号
|
|
764
|
-
// f_user_type: '', // 用户类型
|
|
765
|
-
// f_gasproperties: '', // 用气性质
|
|
766
|
-
// f_meter_brand: '', // 气表品牌
|
|
767
|
-
// f_price_name: '', // 气价名称
|
|
768
|
-
// f_price_type: '', // 气价类型
|
|
769
|
-
// f_meter_style: '', // 气表型号
|
|
770
|
-
// f_position: '', // 表安装位置
|
|
771
|
-
// f_meter_type: '', // 气表类型
|
|
772
|
-
// f_area_id: '', // 小区编号 (自动生成)
|
|
773
|
-
// f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
|
|
774
|
-
// f_operatorid: this.$login.f.id, // 操作人id
|
|
775
|
-
// f_operator: this.$login.f.name, // 操作人
|
|
776
|
-
// f_orgid: this.$login.f.orgid, // 组织id
|
|
777
|
-
// f_orgname: this.$login.f.orgs, // 组织名
|
|
778
|
-
// f_pcd_id: 8, // 省市区id
|
|
779
|
-
// // f_pcd_id: 124, // 50.4测试
|
|
780
|
-
// f_pcd: '河北省邯郸市武安市', // 省市区
|
|
781
|
-
// f_street_id: street.id, // 街道id
|
|
782
|
-
// f_street: street.f_street,// 街道
|
|
783
|
-
// f_area_code: '01', // 片区编码
|
|
784
|
-
// f_slice_area: '武安片区', // 片区
|
|
785
|
-
// // f_area_code: '66556', // 50.4测试
|
|
786
|
-
// // f_slice_area: '武安明星', // 50.4测试
|
|
787
|
-
// slice_area: [
|
|
788
|
-
// {
|
|
789
|
-
// name: '武安片区',
|
|
790
|
-
// code: '01'
|
|
791
|
-
// }
|
|
792
|
-
// ],
|
|
793
|
-
// // slice_area: [ // 50.4测试
|
|
794
|
-
// // {
|
|
795
|
-
// // name: '武安明星',
|
|
796
|
-
// // code: '66556'
|
|
797
|
-
// // }
|
|
798
|
-
// // ],
|
|
799
|
-
// f_residential_area: this.show_data.fields[index].value.trim(), // 小区名称
|
|
800
|
-
// f_area_address: `河北省邯郸市武安市${street.f_street}`, // 详细地址(省市区+街道)
|
|
801
|
-
// f_comments: '报建系统自动创建'
|
|
802
|
-
// }
|
|
803
|
-
// try {
|
|
804
|
-
// let http = new HttpResetClass()
|
|
805
|
-
// let res = await http.load('POST', 'rs/logic/address_updatearea', {data: data}, {
|
|
806
|
-
// resolveMsg: null,
|
|
807
|
-
// rejectMsg: null
|
|
808
|
-
// })
|
|
809
|
-
// } catch (e) {
|
|
810
|
-
// if (e.status === 635) {
|
|
811
|
-
// this.$showAlert('此小区已存在!!!', 'warning', 3000)
|
|
812
|
-
// } else {
|
|
813
|
-
// this.$showAlert('自动添加小区失败,请手动添加!!!', 'warning', 3000)
|
|
814
|
-
// }
|
|
815
|
-
// }
|
|
816
|
-
// }
|
|
817
|
-
// 地址拼接
|
|
818
|
-
if (
|
|
819
|
-
this.show_data.fields[index].label === '区域' ||
|
|
820
|
-
this.show_data.fields[index].label === '街道' ||
|
|
821
|
-
this.show_data.fields[index].label === '小区' ||
|
|
822
|
-
this.show_data.fields[index].label === '楼号' ||
|
|
823
|
-
this.show_data.fields[index].label === '单元' ||
|
|
824
|
-
this.show_data.fields[index].label === '楼层' ||
|
|
825
|
-
this.show_data.fields[index].label === '门牌号'
|
|
826
|
-
) {
|
|
827
|
-
let f_address = null
|
|
828
|
-
if (this.show_data.f_address_type !== '民用地址') {
|
|
829
|
-
f_address = this.getLableValue('区域') + this.getLableValue('街道') + this.getLableValue('小区')
|
|
830
|
-
} else {
|
|
831
|
-
f_address = this.getLableValue('区域') + this.getLableValue('街道') +
|
|
832
|
-
this.getLableValue('小区') +
|
|
833
|
-
this.getLableValue('楼号') +
|
|
834
|
-
(isEmpty(this.getLableValue('楼号')) ? '' : '号楼') +
|
|
835
|
-
this.getLableValue('单元') +
|
|
836
|
-
(isEmpty(this.getLableValue('单元')) ? '' : '单元') +
|
|
837
|
-
this.getLableValue('楼层') +
|
|
838
|
-
(isEmpty(this.getLableValue('楼层')) ? '' : '层') +
|
|
839
|
-
this.getLableValue('门牌号') +
|
|
840
|
-
(isEmpty(this.getLableValue('门牌号')) ? '' : '室')
|
|
841
|
-
}
|
|
842
|
-
this.setLabelValue('地址', f_address)
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
if (this.show_data.defname === '竣工验收') {
|
|
847
|
-
if (this.show_data.fields[index].label === '验收是否合格'){
|
|
848
|
-
for (const button of this.show_data.buttons) {
|
|
849
|
-
if (this.show_data.fields[index].value === '否' && button.button_name === '退回') {
|
|
850
|
-
button.hidden = false
|
|
851
|
-
} else {
|
|
852
|
-
button.hidden = true
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
if (this.show_data.defname === '报建登记'&&this.show_data.f_apply_type==='工商户报建') {
|
|
858
|
-
|
|
859
|
-
console.log("13f", this.selectdata.onetomany)
|
|
860
|
-
for (const button of this.show_data.buttons) {
|
|
861
|
-
if (this.selectdata.onetomany&& button.button_name === '提交') {
|
|
862
|
-
console.log("1f")
|
|
863
|
-
button.disable = true
|
|
864
|
-
}
|
|
865
|
-
else {
|
|
866
|
-
button.disable = false
|
|
867
|
-
console.log("2f")
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
// if (this.show_data.defname === '营业厅建档'){
|
|
872
|
-
// let http = new HttpResetClass()
|
|
873
|
-
// let data = {
|
|
874
|
-
// tablename: 't_userinfo',
|
|
875
|
-
// condition: `f_process_id='${this.selectdata.f_process_id}'`
|
|
876
|
-
//
|
|
877
|
-
// }
|
|
878
|
-
// let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
|
|
879
|
-
//
|
|
880
|
-
// if (this.show_data.fields[index].label === '是否已建档') {
|
|
881
|
-
// if (res.data[0].f_user_state === '预备') {
|
|
882
|
-
// this.show_data.fields[index].value = '否'
|
|
883
|
-
// button.hidden = false
|
|
884
|
-
// }else{
|
|
885
|
-
// this.show_data.fields[index].value = '是'
|
|
886
|
-
// button.hidden = true
|
|
887
|
-
// }
|
|
888
|
-
// }
|
|
889
|
-
// }
|
|
890
|
-
if(this.show_data.defname === '现场勘察') {
|
|
891
|
-
console.log("this.shdata",this.show_data)
|
|
892
|
-
if (this.show_data.fields[index].label === '是否具备安装条件') {
|
|
893
|
-
for (const button of this.show_data.buttons) {
|
|
894
|
-
if (this.show_data.fields[index].value === '否'&& button.button_name === '退回') {
|
|
895
|
-
button.hidden = false
|
|
896
|
-
}else {
|
|
897
|
-
button.hidden = true
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
// if (this.show_data.defname === '通气点火'){
|
|
903
|
-
// let http = new HttpResetClass()
|
|
904
|
-
// let data = {
|
|
905
|
-
// tablename: 't_firemessage',
|
|
906
|
-
// condition: `f_process_id='${this.selectdata.f_process_id}'`
|
|
907
|
-
//
|
|
908
|
-
// }
|
|
909
|
-
// let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
|
|
910
|
-
// console.log("res")
|
|
911
|
-
// console.log(res.data)
|
|
912
|
-
// if (this.show_data.fields[index].label === '是否已通气') {
|
|
913
|
-
// if (res.data.length==0) {
|
|
914
|
-
// this.show_data.fields[index].value = '否'
|
|
915
|
-
// button.hidden = false
|
|
916
|
-
// }else{
|
|
917
|
-
// this.show_data.fields[index].value = '是'
|
|
918
|
-
// button.hidden = true
|
|
919
|
-
// }
|
|
920
|
-
// }
|
|
921
|
-
// }
|
|
922
|
-
if (this.show_data.defname === '合同签订') {
|
|
923
|
-
if (this.show_data.fields[index].label === '合同编号') {
|
|
924
|
-
if (!isEmpty(this.show_data.fields[index].value)) {
|
|
925
|
-
let http = new HttpResetClass()
|
|
926
|
-
let data = {
|
|
927
|
-
tablename: 't_apply',
|
|
928
|
-
condition: `f_contract_number='${this.show_data.fields[index].value}'`
|
|
929
|
-
}
|
|
930
|
-
let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
|
|
931
|
-
resolveMsg: null,
|
|
932
|
-
rejectMsg: '合同编号查重失败'
|
|
933
|
-
})
|
|
934
|
-
if (res.data.length > 0) {
|
|
935
|
-
this.show_data.fields[index].value = null
|
|
936
|
-
this.$showAlert('合同编号已存在!!!', 'warning', 3000)
|
|
937
|
-
}
|
|
938
|
-
//拼写合同编号
|
|
939
|
-
// if (this.selectdata.f_apply_type == '工商户报建') {
|
|
940
|
-
// this.show_data.fields[index].value = "ZS-S-" + this.show_data.fields[index].value
|
|
941
|
-
// // this.show_data.fields[index].value = "ZS-S-" + this.show_data.fields[index].value + "-" + new Date().Format('yyyy-MM-dd')
|
|
942
|
-
// }else {
|
|
943
|
-
// this.show_data.fields[index].value = "ZS-M-" + this.show_data.fields[index].value
|
|
944
|
-
// // this.show_data.fields[index].value = "ZS-M-" + this.show_data.fields[index].value + "-" + new Date().Format('yyyy-MM-dd')
|
|
945
|
-
// }
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
if (this.show_data.fields[index].label === '单价(户)') {
|
|
949
|
-
let http = new HttpResetClass()
|
|
950
|
-
let data = {
|
|
951
|
-
num1: this.getLableValue(this.show_data.fields[index].label),
|
|
952
|
-
num2: this.getLableValue('户数'),
|
|
953
|
-
operator: '*'
|
|
954
|
-
}
|
|
955
|
-
try {
|
|
956
|
-
let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
|
|
957
|
-
resolveMsg: null,
|
|
958
|
-
rejectMsg: null
|
|
959
|
-
})
|
|
960
|
-
data = {
|
|
961
|
-
num1: res.data,
|
|
962
|
-
num2: this.getLableValue('其他费用'),
|
|
963
|
-
operator: '+'
|
|
964
|
-
}
|
|
965
|
-
res = await http.load('POST', 'rs/logic/compute', {data: data}, {
|
|
966
|
-
resolveMsg: null,
|
|
967
|
-
rejectMsg: null
|
|
968
|
-
})
|
|
969
|
-
this.setLabelValue('合同金额',res.data)
|
|
970
|
-
} catch (e) {
|
|
971
|
-
this.$showAlert(e.data.msg, 'warning', 3000)
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
if (this.show_data.fields[index].label === '其他费用') {
|
|
975
|
-
let http = new HttpResetClass()
|
|
976
|
-
let data = {
|
|
977
|
-
num1: this.getLableValue(this.show_data.fields[index].label),
|
|
978
|
-
num2: this.getLableValue('合同金额'),
|
|
979
|
-
operator: '+'
|
|
980
|
-
}
|
|
981
|
-
try {
|
|
982
|
-
let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
|
|
983
|
-
resolveMsg: null,
|
|
984
|
-
rejectMsg: null
|
|
985
|
-
})
|
|
986
|
-
this.setLabelValue('合同金额',res.data)
|
|
987
|
-
} catch (e) {
|
|
988
|
-
this.$showAlert(e.data.msg, 'warning', 3000)
|
|
989
|
-
}
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
// ========================= 武安 =================================
|
|
993
|
-
// 号码检测
|
|
994
|
-
if (this.show_data.fields[index].label === '电话号码') {
|
|
995
|
-
let phone = this.show_data.fields[index].value
|
|
996
|
-
// 电话号码效验
|
|
997
|
-
if (!(/^1[3456789]\d{9}$/.test(phone))) {
|
|
998
|
-
this.show_data.fields[index].value = ""
|
|
999
|
-
this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
//时间提醒
|
|
1003
|
-
if (this.show_data.fields[index].label.includes("时间") || this.show_data.fields[index].type === 'datepicker') {
|
|
1004
|
-
let setTime = this.show_data.fields[index].value
|
|
1005
|
-
let nowTime = new Date().Format("yyyy-MM-dd HH:mm:ss")
|
|
1006
|
-
if (nowTime >= setTime) {
|
|
1007
|
-
this.$showMessage("请注意,当前节点时间/工期已过期!")
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
},
|
|
1011
|
-
// input值发生变化
|
|
1012
|
-
async 'oninput'(index) {
|
|
1013
|
-
|
|
1014
|
-
},
|
|
1015
|
-
// 错误事件
|
|
1016
|
-
error_check(index) {
|
|
1017
|
-
// 时间格式检测
|
|
1018
|
-
if (this.show_data.fields[index].type == 'datepicker') {
|
|
1019
|
-
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)$/)
|
|
1020
|
-
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])$/)
|
|
1021
|
-
if (datetimeRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 19 && this.show_data.fields[index].fullsize) {
|
|
1022
|
-
this.show_data.fields[index].error.flag = false
|
|
1023
|
-
} else if (dateRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 10) {
|
|
1024
|
-
this.show_data.fields[index].error.flag = false
|
|
1025
|
-
} else {
|
|
1026
|
-
if (this.show_data.fields[index].fullsize) {
|
|
1027
|
-
this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
|
|
1028
|
-
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'
|
|
1029
|
-
this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
|
|
1030
|
-
this.show_data.fields[index].error.flag = true
|
|
1031
|
-
this.show_data.fields[index].value = ''
|
|
1032
|
-
} else {
|
|
1033
|
-
this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
|
|
1034
|
-
this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02'
|
|
1035
|
-
this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
|
|
1036
|
-
this.show_data.fields[index].error.flag = true
|
|
1037
|
-
this.show_data.fields[index].value = ''
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
},
|
|
1043
|
-
// onetomany模态框默认监听监听事件
|
|
1044
|
-
async 'onetomanydelete'(i, j) {
|
|
1045
|
-
console.log('默认删除')
|
|
1046
|
-
let http = new HttpResetClass()
|
|
1047
|
-
let data = {
|
|
1048
|
-
table: this.show_data.onetomany[i].tables[0],
|
|
1049
|
-
row: this.show_data.onetomany[i].rows[j]
|
|
1050
|
-
}
|
|
1051
|
-
let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
|
|
1052
|
-
resolveMsg: null,
|
|
1053
|
-
rejectMsg: '删除失败'
|
|
1054
|
-
})
|
|
1055
|
-
|
|
1056
|
-
if (res.data <= 0){
|
|
1057
|
-
this.$showMessage('删除失败')
|
|
1058
|
-
return
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
this.$dispatch('breakControl', this.show_data)
|
|
1062
|
-
},
|
|
1063
|
-
async 'onetomanyadd'(index) {
|
|
1064
|
-
|
|
1065
|
-
let data = {
|
|
1066
|
-
f_process_id : this.show_data.f_process_id
|
|
1067
|
-
}
|
|
1068
|
-
this.show_data.onetomany[index].fields.forEach(item => {
|
|
1069
|
-
data[item.field] = item.value
|
|
1070
|
-
})
|
|
1071
|
-
let res = await this.$resetpost(
|
|
1072
|
-
`rs/entity/${this.show_data.onetomany[index].tables[0]}`,
|
|
1073
|
-
data
|
|
1074
|
-
)
|
|
1075
|
-
this.$dispatch('breakControl', this.show_data)
|
|
1076
|
-
},
|
|
1077
|
-
async 'onetomanyupdate'(i, j) {
|
|
1078
|
-
let onetomany = this.show_data.onetomany[i]
|
|
1079
|
-
let data = onetomany.rows[j]
|
|
1080
|
-
|
|
1081
|
-
onetomany.fields.forEach(item => {
|
|
1082
|
-
data[item.field] = item.value
|
|
1083
|
-
})
|
|
1084
|
-
let res = await this.$resetpost(
|
|
1085
|
-
`rs/entity/${this.show_data.onetomany[i].tables[0]}`,
|
|
1086
|
-
data
|
|
1087
|
-
)
|
|
1088
|
-
|
|
1089
|
-
this.$dispatch('breakControl', this.show_data)
|
|
1090
|
-
},
|
|
1091
|
-
// 选择用户档案信息
|
|
1092
|
-
'selectUserinfo'(row) {
|
|
1093
|
-
console.log("当前选择数据",row)
|
|
1094
|
-
if (this.selectdata.f_apply_type === '拆改装报建'){
|
|
1095
|
-
this.showLabels('用户编号')
|
|
1096
|
-
this.hideLabels('地址类型','区域','街道','小区','楼号','单元','楼层','门牌号')
|
|
1097
|
-
this.electiveLabels('地址类型','区域','街道','小区','楼号','单元','楼层','门牌号')
|
|
1098
|
-
this.show_data.f_address_type = '民用地址'
|
|
1099
|
-
this.show_data.f_pcd = row.f_pcd
|
|
1100
|
-
this.show_data.f_street = row.f_street
|
|
1101
|
-
this.show_data.f_residential_area = row.f_residential_area
|
|
1102
|
-
this.show_data.f_building = row.f_building
|
|
1103
|
-
this.show_data.f_unit = row.f_unit
|
|
1104
|
-
this.show_data.f_floor = row.f_floor
|
|
1105
|
-
this.show_data.f_room = row.f_room
|
|
1106
|
-
this.selectdata.flag = '旧用户'
|
|
1107
|
-
}
|
|
1108
|
-
this.setLabelValue('用户编号', row.f_userinfo_code)
|
|
1109
|
-
this.setLabelValue('用户名称', row.f_user_name)
|
|
1110
|
-
this.setLabelValue('用户电话', row.f_user_phone)
|
|
1111
|
-
this.setLabelValue('证件类型', row.f_credentials)
|
|
1112
|
-
this.setLabelValue('证件号码', row.f_idnumber)
|
|
1113
|
-
this.setLabelValue('地址', row.f_address)
|
|
1114
|
-
|
|
1115
|
-
this.selectdata.f_userinfo_id = row.f_userinfo_id
|
|
1116
|
-
this.selectdata.f_userinfo_code = row.f_userinfo_code
|
|
1117
|
-
console.log("当前选择数据",this.show_data)
|
|
1118
|
-
},
|
|
1119
|
-
async 'streetChange'(index) {
|
|
1120
|
-
if (isEmpty(this.show_data.f_street)) {
|
|
1121
|
-
return
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
this.setLabelValue('小区', null)
|
|
1125
|
-
|
|
1126
|
-
let data = {
|
|
1127
|
-
tablename: 't_area',
|
|
1128
|
-
condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
|
|
1129
|
-
}
|
|
1130
|
-
let http = new HttpResetClass()
|
|
1131
|
-
let res = await http.load(
|
|
1132
|
-
'POST',
|
|
1133
|
-
`rs/sql/singleTable`,
|
|
1134
|
-
{data: data},
|
|
1135
|
-
{resolveMsg: null, rejectMsg: '小区!!!'}
|
|
1136
|
-
)
|
|
1137
|
-
|
|
1138
|
-
this.setLabelOptions('小区', res.data.map(item => {
|
|
1139
|
-
return {
|
|
1140
|
-
label: item.f_residential_area,
|
|
1141
|
-
value: item.f_residential_area
|
|
1142
|
-
}
|
|
1143
|
-
}))
|
|
1144
|
-
},
|
|
1145
|
-
// 区县失去焦点
|
|
1146
|
-
async 'pcdChange'(index) {
|
|
1147
|
-
if (isEmpty(this.show_data.f_pcd)) {
|
|
1148
|
-
return
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
this.setLabelValue('街道', null)
|
|
1152
|
-
this.setLabelValue('小区', null)
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
let data = {
|
|
1156
|
-
tablename: 't_street',
|
|
1157
|
-
condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
|
|
1158
|
-
}
|
|
1159
|
-
let f_address_type = this.getLableValue('地址类型')
|
|
1160
|
-
|
|
1161
|
-
if (f_address_type === '民用地址') {
|
|
1162
|
-
data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
let http = new HttpResetClass()
|
|
1166
|
-
let res = await http.load(
|
|
1167
|
-
'POST',
|
|
1168
|
-
`rs/sql/singleTable`,
|
|
1169
|
-
{data: data},
|
|
1170
|
-
{resolveMsg: null, rejectMsg: '街道查询失败!!!'}
|
|
1171
|
-
)
|
|
1172
|
-
|
|
1173
|
-
this.setLabelOptions('街道', res.data.map(item => {
|
|
1174
|
-
return {
|
|
1175
|
-
label: item.f_street,
|
|
1176
|
-
value: item.f_street
|
|
1177
|
-
}
|
|
1178
|
-
}))
|
|
1179
|
-
},
|
|
1180
|
-
'buttonChange' (index) {
|
|
1181
|
-
if (this.show_data.fields[index].value === '否') {
|
|
1182
|
-
console.log("测试")
|
|
1183
|
-
this.hideButtons('下发','提交')
|
|
1184
|
-
this.showButtons('退回','终止')
|
|
1185
|
-
} else {
|
|
1186
|
-
this.hideButtons('退回','终止')
|
|
1187
|
-
this.showButtons('下发','提交')
|
|
1188
|
-
}
|
|
1189
|
-
},
|
|
1190
|
-
async 'stopApply'() {
|
|
1191
|
-
this.stope_view = true
|
|
1192
|
-
this.showview = false
|
|
1193
|
-
},
|
|
1194
|
-
async 'signUserInfo' (index) {
|
|
1195
|
-
if (this.show_data.fields[index].value === '是') {
|
|
1196
|
-
console.log("测试")
|
|
1197
|
-
this.showLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
|
|
1198
|
-
this.requiredLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '门牌号', '地址')
|
|
1199
|
-
} else {
|
|
1200
|
-
this.hideLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
|
|
1201
|
-
this.electiveLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
|
|
1202
|
-
}
|
|
1203
|
-
},
|
|
1204
|
-
// onetomany模态框监听事件
|
|
1205
|
-
async 'onchange_modal'(index, i) {
|
|
1206
|
-
},
|
|
1207
|
-
async 'oninput_modal'(index, i) {
|
|
1208
|
-
}
|
|
1209
|
-
},
|
|
1210
|
-
watch: {
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
</script>
|
|
1214
|
-
<style scoped>
|
|
1215
|
-
/*清除model中的浮动*/
|
|
1216
|
-
.clearfix:after,.clearfix:before{
|
|
1217
|
-
display: table;
|
|
1218
|
-
}
|
|
1219
|
-
.clearfix:after{
|
|
1220
|
-
clear: both;
|
|
1221
|
-
}
|
|
1222
|
-
</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
|
+
// 组件初始化操作
|
|
52
|
+
refurbish() {
|
|
53
|
+
this.json_datas = this.$workflow_vue
|
|
54
|
+
let sum = 0
|
|
55
|
+
let jsonData = {}
|
|
56
|
+
if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length == 0) {
|
|
57
|
+
this.$showMessage("网络故障,请刷新页面")
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
for (let i = 0; i < this.json_datas.activitys.length; i++) {
|
|
61
|
+
if (this.selectdata.defname == this.json_datas.activitys[i].title) {
|
|
62
|
+
jsonData = this.json_datas.activitys[i] // 拿到当前节点的json配置信息
|
|
63
|
+
sum++ // 节点名一样的个数
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (sum == 1) {
|
|
67
|
+
this.data = null
|
|
68
|
+
this.data = jsonData
|
|
69
|
+
// selectdata 填充 data
|
|
70
|
+
this.data = Object.assign({}, this.data, this.selectdata)
|
|
71
|
+
this.initializeJSON()
|
|
72
|
+
} else if (sum == 0) {
|
|
73
|
+
this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
|
|
74
|
+
} else {
|
|
75
|
+
this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
// json配置数据处理
|
|
79
|
+
async initializeJSON() {
|
|
80
|
+
// 有默认值,value就给默认值,没有就是null
|
|
81
|
+
this.data.fields.forEach(item => {
|
|
82
|
+
if (!item.value) {
|
|
83
|
+
if (item.value === 0) {
|
|
84
|
+
item.value = 0
|
|
85
|
+
} else {
|
|
86
|
+
item.value = null
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (item.default || item.default == 0) {
|
|
90
|
+
if(item.type === 'datepicker'){
|
|
91
|
+
item.value = ''
|
|
92
|
+
}else {
|
|
93
|
+
item.value = item.default
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (this.selectdata[item.field]) {
|
|
97
|
+
// 将json字符串格式化赋值给value
|
|
98
|
+
if (String(this.selectdata[item.field]).startsWith("{")) {
|
|
99
|
+
item.value = JSON.parse(this.selectdata[item.field])
|
|
100
|
+
this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
|
|
101
|
+
} else {
|
|
102
|
+
item.value = this.selectdata[item.field]
|
|
103
|
+
}
|
|
104
|
+
} else {
|
|
105
|
+
if (this.selectdata[item.field] === 0) {
|
|
106
|
+
item.value = 0
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// datepicker 没有值给当时值
|
|
111
|
+
if (item.type === 'datepicker' && !item.value && item.default) {
|
|
112
|
+
item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 如果配置类型为select,优先从参数列表获取options
|
|
116
|
+
if (item.type === 'select') {
|
|
117
|
+
let temp = null
|
|
118
|
+
|
|
119
|
+
temp = this.$appdata.getParam(item.label)
|
|
120
|
+
|
|
121
|
+
if (temp && temp.length > 0 && item.label) {
|
|
122
|
+
item.options = temp
|
|
123
|
+
} else {
|
|
124
|
+
if (item.paramLabel) {
|
|
125
|
+
temp = this.$appdata.getParam(item.paramLabel)
|
|
126
|
+
if (temp && temp.length > 0) {
|
|
127
|
+
item.options = temp
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
// 控制组件
|
|
135
|
+
if (this.data.components) {
|
|
136
|
+
this.data.components.forEach(item => {
|
|
137
|
+
if (!item.mark) {
|
|
138
|
+
item.mark = 0
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// 初始化 fields 可对数据进行特殊处理
|
|
144
|
+
this.initializeFields()
|
|
145
|
+
|
|
146
|
+
// 初始化 buttons_fields
|
|
147
|
+
for (let i = 0; i < this.data.buttons.length; i++) {
|
|
148
|
+
// 下发按钮相关配置
|
|
149
|
+
if (this.data.buttons[i].button_name === '下发') {
|
|
150
|
+
if (this.data.buttons[i].button_fields && this.data.buttons[i].button_fields.length === 1) {
|
|
151
|
+
if (this.data.buttons[i].source){
|
|
152
|
+
let http = new HttpResetClass()
|
|
153
|
+
let res = await http.load('POST', 'rs/search', {
|
|
154
|
+
source: this.data.buttons[i].source,
|
|
155
|
+
userid: this.$login.f.id
|
|
156
|
+
}, {resolveMsg: null, rejectMsg: null})
|
|
157
|
+
|
|
158
|
+
let options = []
|
|
159
|
+
for (let i = 0; i < res.data.length; i++) {
|
|
160
|
+
options.push(
|
|
161
|
+
{
|
|
162
|
+
"label": res.data[i].name,
|
|
163
|
+
"value": res.data[i].id
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
this.data.buttons[i].button_fields[0]['options'] = options
|
|
168
|
+
} else {
|
|
169
|
+
this.$showMessage("请配置获取人员表达式")
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
this.$showMessage("下发按钮必须满足 当且仅当一个字段")
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (this.data.buttons[i].button_fields) {
|
|
176
|
+
this.data.buttons[i].button_fields.forEach(x => {
|
|
177
|
+
// 如果配置类型为select,优先从参数列表获取options
|
|
178
|
+
if (x.type === 'select' && this.$appdata.getParam(x.label)) {
|
|
179
|
+
x.options = this.$appdata.getParam(x.label).trim()
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// onetomany 数据获取
|
|
186
|
+
if (this.data.onetomany) {
|
|
187
|
+
for (let index = 0; index < this.data.onetomany.length; index++) {
|
|
188
|
+
let res = null
|
|
189
|
+
if (!this.data.onetomany[index].queryEvent || this.data.onetomany[index].queryEvent === 'default'){
|
|
190
|
+
let http = new HttpResetClass()
|
|
191
|
+
let data = {
|
|
192
|
+
tablename: this.data.onetomany[index].tables[0],
|
|
193
|
+
condition: `f_process_id='${this.selectdata.f_process_id}'`
|
|
194
|
+
}
|
|
195
|
+
res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
|
|
196
|
+
resolveMsg: null,
|
|
197
|
+
rejectMsg: 'onetomany查询失败'
|
|
198
|
+
})
|
|
199
|
+
} else {
|
|
200
|
+
res = this[this.data.onetomany[index].queryEvent]()
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// 初始化 onetomany
|
|
204
|
+
this.data.onetomany[index].rows = res.data
|
|
205
|
+
|
|
206
|
+
// 初始化onetomany中的fields
|
|
207
|
+
for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
|
|
208
|
+
if (!this.data.onetomany[index].fields[j].value) {
|
|
209
|
+
if (this.data.onetomany[index].fields[j].value === 0) {
|
|
210
|
+
this.data.onetomany[index].fields[j].value = 0
|
|
211
|
+
} else {
|
|
212
|
+
this.data.onetomany[index].fields[j].value = null
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
if (this.data.onetomany[index].fields[j].default || this.data.onetomany[index].fields[j].default == 0) {
|
|
216
|
+
this.data.onetomany[index].fields[j].value = this.data.onetomany[index].fields[j].default
|
|
217
|
+
}
|
|
218
|
+
// 如果配置类型为select,优先从参数列表获取options
|
|
219
|
+
if (this.data.onetomany[index].fields[j].type === 'select') {
|
|
220
|
+
let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
|
|
221
|
+
if (temp && temp.length > 0) {
|
|
222
|
+
this.data.onetomany[index].fields[j].options = temp
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
|
|
230
|
+
let temp = JSON.parse(JSON.stringify(this.data))
|
|
231
|
+
|
|
232
|
+
this.show_data = temp
|
|
233
|
+
this.$nextTick(() => {
|
|
234
|
+
this.showview = true
|
|
235
|
+
})
|
|
236
|
+
// 初始化加载
|
|
237
|
+
// ========================= 中盛 =================================
|
|
238
|
+
|
|
239
|
+
if (this.selectdata.defname === '报建登记') {
|
|
240
|
+
let http = new HttpResetClass()
|
|
241
|
+
let condition = "f_filialeid = " + this.$login.f.orgid
|
|
242
|
+
let res = await http.load('POST','rs/sql/apply_singleTable',{data:{tablename:'t_area',condition:condition}}, {resolveMsg: null, rejectMsg: null})
|
|
243
|
+
for (let i = 0; i < this.show_data.fields.length; i++) {
|
|
244
|
+
|
|
245
|
+
if (this.show_data.fields[i].label == '街道') {
|
|
246
|
+
let data = []
|
|
247
|
+
let array = []
|
|
248
|
+
data = res.data.map(item => {
|
|
249
|
+
return item.f_street;
|
|
250
|
+
})
|
|
251
|
+
for (let q = 0; q < data.length; q++) {
|
|
252
|
+
let arraydata = {
|
|
253
|
+
'label': data[q],
|
|
254
|
+
'value': data[q]
|
|
255
|
+
}
|
|
256
|
+
if (array.length != 0) {
|
|
257
|
+
for (let w = 0; w < array.length; w++) {
|
|
258
|
+
if (array[w].label == data[q]) {
|
|
259
|
+
break
|
|
260
|
+
}
|
|
261
|
+
while (w == array.length - 1) {
|
|
262
|
+
array.push(arraydata)
|
|
263
|
+
break
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
} else {
|
|
267
|
+
array.push(arraydata)
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
this.show_data.fields[i].options = array
|
|
271
|
+
console.log("街道选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
|
|
272
|
+
}
|
|
273
|
+
if (this.show_data.fields[i].label == '小区') {
|
|
274
|
+
let data = []
|
|
275
|
+
let array = []
|
|
276
|
+
data = res.data.map(item => {
|
|
277
|
+
return item.f_residential_area;
|
|
278
|
+
})
|
|
279
|
+
for (let q = 0; q < data.length; q++) {
|
|
280
|
+
let arraydata = {
|
|
281
|
+
'label': data[q],
|
|
282
|
+
'value': data[q]
|
|
283
|
+
}
|
|
284
|
+
if (array.length != 0) {
|
|
285
|
+
for (let w = 0; w < array.length; w++) {
|
|
286
|
+
if (array[w].label == data[q]) {
|
|
287
|
+
break
|
|
288
|
+
}
|
|
289
|
+
while (w == array.length - 1) {
|
|
290
|
+
array.push(arraydata)
|
|
291
|
+
break
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
} else {
|
|
295
|
+
array.push(arraydata)
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
this.show_data.fields[i].options = array
|
|
299
|
+
console.log("小区选择框数据:" + JSON.stringify(this.show_data.fields[i].options))
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (this.selectdata.defname === '施工') {
|
|
304
|
+
// for (let i = 0; i < this.show_data.fields.length; i++) {
|
|
305
|
+
// if (this.show_data.fields[i].label == '工程状态') {
|
|
306
|
+
// this.show_data.fields[i].value = ''
|
|
307
|
+
// }
|
|
308
|
+
// }
|
|
309
|
+
for (const item of this.show_data.fields) {
|
|
310
|
+
if (item.label === '工程状态' && !item.value) {
|
|
311
|
+
return item.value = '未开工'
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
},
|
|
317
|
+
// 初始化fields值
|
|
318
|
+
initializeFields() {
|
|
319
|
+
|
|
320
|
+
},
|
|
321
|
+
// 金额转大写
|
|
322
|
+
smalltoBIG(n) {
|
|
323
|
+
let fraction = ['角', '分'];
|
|
324
|
+
let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
|
|
325
|
+
let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
|
|
326
|
+
let head = n < 0 ? '欠' : '';
|
|
327
|
+
n = Math.abs(n);
|
|
328
|
+
|
|
329
|
+
let s = '';
|
|
330
|
+
|
|
331
|
+
for (var i = 0; i < fraction.length; i++) {
|
|
332
|
+
s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
|
|
333
|
+
}
|
|
334
|
+
s = s || '整';
|
|
335
|
+
n = Math.floor(n);
|
|
336
|
+
|
|
337
|
+
for (var i = 0; i < unit[0].length && n > 0; i++) {
|
|
338
|
+
let p = '';
|
|
339
|
+
for (var j = 0; j < unit[1].length && n > 0; j++) {
|
|
340
|
+
p = digit[n % 10] + unit[1][j] + p;
|
|
341
|
+
n = Math.floor(n / 10);
|
|
342
|
+
}
|
|
343
|
+
s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
|
|
344
|
+
}
|
|
345
|
+
return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
|
|
346
|
+
},
|
|
347
|
+
getLableValue(label) {
|
|
348
|
+
for (const item of this.show_data.fields) {
|
|
349
|
+
if (item.label === label && item.type !== 'number') {
|
|
350
|
+
return item.value || ''
|
|
351
|
+
}
|
|
352
|
+
if (item.label === label && item.type === 'number') {
|
|
353
|
+
return item.value || 0
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
setLabelValue(label, value) {
|
|
358
|
+
for (const item of this.show_data.fields) {
|
|
359
|
+
if (item.label === label) {
|
|
360
|
+
item.value = value
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
setLabelOptions(label, options) {
|
|
365
|
+
for (const item of this.show_data.fields) {
|
|
366
|
+
if (item.label === label) {
|
|
367
|
+
item.options = options
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
showLabels(...labels) {
|
|
372
|
+
for (const item of this.show_data.fields) {
|
|
373
|
+
if (labels.includes(item.label)) {
|
|
374
|
+
item.hidden = false
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
hideLabels(...labels) {
|
|
379
|
+
for (const item of this.show_data.fields) {
|
|
380
|
+
if (labels.includes(item.label)) {
|
|
381
|
+
item.hidden = true
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
requiredLabels(...labels) {
|
|
386
|
+
for (const item of this.show_data.fields) {
|
|
387
|
+
if (labels.includes(item.label)) {
|
|
388
|
+
item.required = true
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
electiveLabels(...labels) {
|
|
393
|
+
for (const item of this.show_data.fields) {
|
|
394
|
+
if (labels.includes(item.label)) {
|
|
395
|
+
item.required = false
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
readonlyLabels(...labels) {
|
|
400
|
+
for (const item of this.show_data.fields) {
|
|
401
|
+
if (labels.includes(item.label)) {
|
|
402
|
+
item.readonly = true
|
|
403
|
+
item.disabled = true
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
readwriteLabels(...labels) {
|
|
408
|
+
for (const item of this.show_data.fields) {
|
|
409
|
+
if (labels.includes(item.label)) {
|
|
410
|
+
item.readonly = false
|
|
411
|
+
item.disabled = false
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
showButtons(...buttons) {
|
|
416
|
+
for (const item of this.show_data.buttons) {
|
|
417
|
+
if (buttons.includes(item.button_name)) {
|
|
418
|
+
item.hidden = false
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
hideButtons(...buttons) {
|
|
423
|
+
for (const item of this.show_data.buttons) {
|
|
424
|
+
if (buttons.includes(item.button_name)) {
|
|
425
|
+
item.hidden = true
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
// 获取区县
|
|
430
|
+
async getPcd() {
|
|
431
|
+
let data = {
|
|
432
|
+
tablename: 't_pcd',
|
|
433
|
+
condition: `f_filialeid = '${this.$login.f.orgid}'`
|
|
434
|
+
}
|
|
435
|
+
let http = new HttpResetClass()
|
|
436
|
+
let res = await http.load(
|
|
437
|
+
'POST',
|
|
438
|
+
`rs/sql/singleTable`,
|
|
439
|
+
{data: data},
|
|
440
|
+
{resolveMsg: null, rejectMsg: '区县查询失败!!!'}
|
|
441
|
+
)
|
|
442
|
+
|
|
443
|
+
let pcd = res.data.map(item => {
|
|
444
|
+
return {
|
|
445
|
+
label: item.f_pcd,
|
|
446
|
+
value: item.f_pcd
|
|
447
|
+
}
|
|
448
|
+
})
|
|
449
|
+
this.setLabelOptions('区域',pcd)
|
|
450
|
+
},
|
|
451
|
+
// 地址关联
|
|
452
|
+
addressInitialization() {
|
|
453
|
+
this.$getConfig(this, 'UserAddress')
|
|
454
|
+
|
|
455
|
+
let f_address_type = this.show_data.f_address_type
|
|
456
|
+
|
|
457
|
+
for (const item of this.show_data.fields) {
|
|
458
|
+
if (f_address_type === '民用地址') {
|
|
459
|
+
if (item.label === '区域' || item.label === '街道' || item.label === '小区' || item.label === '门牌号') {
|
|
460
|
+
item.hidden = false
|
|
461
|
+
item.required = true
|
|
462
|
+
}
|
|
463
|
+
if (item.label === '楼号' || item.label === '单元' || item.label === '楼层') {
|
|
464
|
+
item.hidden = false
|
|
465
|
+
item.required = false
|
|
466
|
+
}
|
|
467
|
+
if (item.label === '地址') {
|
|
468
|
+
item.readonly = true
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
if (f_address_type === '特殊地址') {
|
|
472
|
+
if (item.label === '区域' || item.label === '街道') {
|
|
473
|
+
item.hidden = false
|
|
474
|
+
item.required = true
|
|
475
|
+
}
|
|
476
|
+
if (item.label === '小区') {
|
|
477
|
+
item.hidden = true
|
|
478
|
+
item.required = false
|
|
479
|
+
}
|
|
480
|
+
if (item.label === '楼号' || item.label === '单元' || item.label === '楼层' || item.label === '门牌号') {
|
|
481
|
+
item.hidden = true
|
|
482
|
+
item.required = false
|
|
483
|
+
}
|
|
484
|
+
if (item.label === '地址') {
|
|
485
|
+
item.readonly = false
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
|
|
490
|
+
item.hidden = true
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
async streetChange() {
|
|
495
|
+
if (isEmpty(this.show_data.f_street)) {
|
|
496
|
+
return
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
let data = {
|
|
500
|
+
tablename: 't_area',
|
|
501
|
+
condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
|
|
502
|
+
}
|
|
503
|
+
let http = new HttpResetClass()
|
|
504
|
+
let res = await http.load(
|
|
505
|
+
'POST',
|
|
506
|
+
`rs/sql/singleTable`,
|
|
507
|
+
{data: data},
|
|
508
|
+
{resolveMsg: null, rejectMsg: '小区查询失败!!!'}
|
|
509
|
+
)
|
|
510
|
+
|
|
511
|
+
this.setLabelOptions('小区', res.data.map(item => {
|
|
512
|
+
return {
|
|
513
|
+
label: item.f_residential_area,
|
|
514
|
+
value: item.f_residential_area
|
|
515
|
+
}
|
|
516
|
+
}))
|
|
517
|
+
},
|
|
518
|
+
async pcdChange() {
|
|
519
|
+
if (isEmpty(this.show_data.f_pcd)) {
|
|
520
|
+
return
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
let data = {
|
|
524
|
+
tablename: 't_street',
|
|
525
|
+
condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
|
|
526
|
+
}
|
|
527
|
+
let f_address_type = this.getLableValue('地址类型')
|
|
528
|
+
|
|
529
|
+
if (f_address_type === '民用地址') {
|
|
530
|
+
data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
let http = new HttpResetClass()
|
|
534
|
+
let res = await http.load(
|
|
535
|
+
'POST',
|
|
536
|
+
`rs/sql/singleTable`,
|
|
537
|
+
{data: data},
|
|
538
|
+
{resolveMsg: null, rejectMsg: '街道查询失败!!!'}
|
|
539
|
+
)
|
|
540
|
+
|
|
541
|
+
this.setLabelOptions('街道', res.data.map(item => {
|
|
542
|
+
return {
|
|
543
|
+
label: item.f_street,
|
|
544
|
+
value: item.f_street
|
|
545
|
+
}
|
|
546
|
+
}))
|
|
547
|
+
},
|
|
548
|
+
async buttonBefore(model) {
|
|
549
|
+
if (model.defname === '报建登记' && model.button.button_name === '提交') {
|
|
550
|
+
|
|
551
|
+
if (model.f_is_user === '是') {
|
|
552
|
+
if (isEmpty(model.f_user_name) || isEmpty(model.f_phone) || isEmpty(model.f_address)) {
|
|
553
|
+
throw '用户信息未填写完整,无法提交!!!'
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
if (
|
|
558
|
+
model.button.button_name === '提交' &&
|
|
559
|
+
model.defname === '通气点火' &&
|
|
560
|
+
(
|
|
561
|
+
model.f_apply_type === '散户报建' ||
|
|
562
|
+
model.f_apply_type === '工商户报建'
|
|
563
|
+
) &&
|
|
564
|
+
model.f_surplus_money > 0
|
|
565
|
+
) {
|
|
566
|
+
throw '未结金额大于0,无法提交!!!'
|
|
567
|
+
}
|
|
568
|
+
if (model.defname === '验收是否合格' && model.button.button_name === '提交') {
|
|
569
|
+
let http = new HttpResetClass()
|
|
570
|
+
let data = {
|
|
571
|
+
f_process_id: model.f_process_id
|
|
572
|
+
}
|
|
573
|
+
let res = await http.load('POST', 'rs/sql/notInstalled', {data: data}, {resolveMsg: null, rejectMsg: null})
|
|
574
|
+
if (res.data[0].num > 0) {
|
|
575
|
+
throw `还有${res.data[0].num}户未安装,无法提交`
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
return model
|
|
579
|
+
},
|
|
580
|
+
// ========================= 武安 =================================
|
|
581
|
+
// 地址类型变化
|
|
582
|
+
addressType() {
|
|
583
|
+
for (const item of this.show_data.fields) {
|
|
584
|
+
if (item.label === '小区' && this.show_data.f_address_type === '民用地址') {
|
|
585
|
+
item.hidden = false
|
|
586
|
+
item.required = true
|
|
587
|
+
}
|
|
588
|
+
if (item.label === '小区' && this.show_data.f_address_type === '特殊地址') {
|
|
589
|
+
item.required = false
|
|
590
|
+
}
|
|
591
|
+
if (
|
|
592
|
+
(
|
|
593
|
+
item.label === '门牌号'
|
|
594
|
+
) && this.show_data.f_address_type === '民用地址'
|
|
595
|
+
) {
|
|
596
|
+
item.required = true
|
|
597
|
+
item.hidden = false
|
|
598
|
+
item.value = null
|
|
599
|
+
}
|
|
600
|
+
if (
|
|
601
|
+
(
|
|
602
|
+
item.label === '楼号' ||
|
|
603
|
+
item.label === '单元' ||
|
|
604
|
+
item.label === '楼层'
|
|
605
|
+
) && this.show_data.f_address_type === '民用地址'
|
|
606
|
+
) {
|
|
607
|
+
item.required = false
|
|
608
|
+
item.hidden = false
|
|
609
|
+
item.value = null
|
|
610
|
+
}
|
|
611
|
+
if (
|
|
612
|
+
(
|
|
613
|
+
item.label === '楼号' ||
|
|
614
|
+
item.label === '单元' ||
|
|
615
|
+
item.label === '楼层' ||
|
|
616
|
+
item.label === '门牌号'
|
|
617
|
+
) && this.show_data.f_address_type === '特殊地址'
|
|
618
|
+
) {
|
|
619
|
+
item.required = false
|
|
620
|
+
item.hidden = true
|
|
621
|
+
item.value = null
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
this.getPcd()
|
|
625
|
+
}
|
|
626
|
+
// ========================= 武安 =================================
|
|
627
|
+
},
|
|
628
|
+
events: {
|
|
629
|
+
// ========================= 武安 =================================
|
|
630
|
+
// ========================= 武安 =================================
|
|
631
|
+
'openAddModel'(index) {
|
|
632
|
+
// ========================= 武安 =================================
|
|
633
|
+
// ========================= 武安 =================================
|
|
634
|
+
},
|
|
635
|
+
// 获取view层button事件/
|
|
636
|
+
async 'button'(model) {
|
|
637
|
+
// 修改提交数据
|
|
638
|
+
model = Object.assign({}, this.selectdata, model)
|
|
639
|
+
// 点击重置按钮就重置数据
|
|
640
|
+
if (model.button.button_name === '重置') {
|
|
641
|
+
this.$dispatch('breakControl', this.data)
|
|
642
|
+
return
|
|
643
|
+
}
|
|
644
|
+
// 提交前置
|
|
645
|
+
try {
|
|
646
|
+
model = await this.buttonBefore(model)
|
|
647
|
+
} catch (e) {
|
|
648
|
+
this.$showAlert(e, 'warning', 3000)
|
|
649
|
+
return
|
|
650
|
+
}
|
|
651
|
+
let http = new HttpResetClass()
|
|
652
|
+
let requestData = {
|
|
653
|
+
tables: this.data.tables,
|
|
654
|
+
start_activity: this.$workflow_vue.start_activity,
|
|
655
|
+
model: model,
|
|
656
|
+
loginUser: this.$login.f,
|
|
657
|
+
workflow_gxmlfilename: this.$workflow_vue.workflow_xmlfilename
|
|
658
|
+
}
|
|
659
|
+
console.log("gwfwe",this.selectdata)
|
|
660
|
+
// 下发,提交,保存,退回通用业务后台处理logic
|
|
661
|
+
let url = 'rs/logic/ApplyProductService'
|
|
662
|
+
let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
|
|
663
|
+
if (res.data.code === 200) {
|
|
664
|
+
this.$dispatch('search')
|
|
665
|
+
} else {
|
|
666
|
+
if (res.data.msg) {
|
|
667
|
+
this.$showMessage(res.data.msg)
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
async 'initializtionView'() {
|
|
672
|
+
// ========================= 武安 =================================
|
|
673
|
+
this.addressType()
|
|
674
|
+
// ========================= 武安 =================================
|
|
675
|
+
},
|
|
676
|
+
// 失去焦点出触发事件
|
|
677
|
+
async 'onchange'(index) {
|
|
678
|
+
console.log('失去焦点')
|
|
679
|
+
// ========================= 武安 =================================
|
|
680
|
+
if (this.show_data.defname === '报建登记' || this.show_data.defname === '业务申请'){
|
|
681
|
+
if (this.show_data.fields[index].label === '是否具备安装条件') {
|
|
682
|
+
for (const button of this.show_data.buttons) {
|
|
683
|
+
if (this.show_data.fields[index].value === '否'&& button.button_name === '退回') {
|
|
684
|
+
button.hidden = false
|
|
685
|
+
}else {
|
|
686
|
+
button.hidden = true
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
if (this.show_data.fields[index].label === '地址类型'){
|
|
691
|
+
this.addressType()
|
|
692
|
+
}
|
|
693
|
+
// if (this.show_data.fields[index].label === '街道'){
|
|
694
|
+
// console.log('-----------添加街道-----------')
|
|
695
|
+
// if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
|
|
696
|
+
// this.show_data.fields[index].value = null
|
|
697
|
+
// this.$showAlert('街道地址不能为空!!!', 'warning', 3000)
|
|
698
|
+
// return
|
|
699
|
+
// }
|
|
700
|
+
// let http = new HttpResetClass()
|
|
701
|
+
// let data = {
|
|
702
|
+
// f_adjustable_id: '', // 调压箱编号
|
|
703
|
+
// f_orgid: this.$login.f.orgid, // 组织id
|
|
704
|
+
// f_orgname: this.$login.f.orgs, // 组织名
|
|
705
|
+
// f_pcd: '河北省邯郸市武安市', // 省市区
|
|
706
|
+
// f_pcd_id: 8, // 省市区id
|
|
707
|
+
// // f_pcd_id: 124, // 50.4测试
|
|
708
|
+
// f_slice_area: '', // 片区
|
|
709
|
+
// f_operatorid: this.$login.f.id, // 操作人id
|
|
710
|
+
// f_operator: this.$login.f.name, // 操作人
|
|
711
|
+
// f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
|
|
712
|
+
// f_street: this.show_data.fields[index].value.trim(), // 地址
|
|
713
|
+
// f_comments: '报建系统自动创建' // 备注
|
|
714
|
+
// }
|
|
715
|
+
// try {
|
|
716
|
+
// let res = await http.load('POST', 'rs/logic/address_updatestreet', {data: data}, {
|
|
717
|
+
// resolveMsg: null,
|
|
718
|
+
// rejectMsg: null
|
|
719
|
+
// })
|
|
720
|
+
// } catch (e) {
|
|
721
|
+
// if (e.status === 635) {
|
|
722
|
+
// this.$showAlert('此街道已存在!!!', 'warning', 3000)
|
|
723
|
+
// } else {
|
|
724
|
+
// this.$showAlert('自动添加街道失败,请手动添加!!!', 'danger', 3000)
|
|
725
|
+
// }
|
|
726
|
+
// }
|
|
727
|
+
// }
|
|
728
|
+
// if (this.show_data.fields[index].label === '小区') {
|
|
729
|
+
// if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
|
|
730
|
+
// this.show_data.fields[index].value = null
|
|
731
|
+
// this.$showAlert('小区名称不能为空!!!', 'warning', 3000)
|
|
732
|
+
// return
|
|
733
|
+
// }
|
|
734
|
+
// // 先查询街道
|
|
735
|
+
// let street = null
|
|
736
|
+
// for (const item of this.show_data.fields) {
|
|
737
|
+
// if (item.label === '街道') {
|
|
738
|
+
// if (item.value.trim() === null || item.value.trim() === '') {
|
|
739
|
+
// this.show_data.fields[index].value = null
|
|
740
|
+
// this.$showAlert('请先录入街道信息,才能录入小区信息!!!', 'warning', 3000)
|
|
741
|
+
// return
|
|
742
|
+
// }
|
|
743
|
+
// let http = new HttpResetClass()
|
|
744
|
+
// let data = {
|
|
745
|
+
// 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()}'`
|
|
746
|
+
// }
|
|
747
|
+
// let res = await http.load('POST', 'rs/sql/address_getstreetlist', {data: data}, {
|
|
748
|
+
// resolveMsg: null,
|
|
749
|
+
// rejectMsg: null
|
|
750
|
+
// })
|
|
751
|
+
// if (res.data.length > 0) {
|
|
752
|
+
// street = res.data[0]
|
|
753
|
+
// } else {
|
|
754
|
+
// this.show_data.fields[index].value = null
|
|
755
|
+
// this.$showAlert(`【${item.value}】街道不存在,请手动添加或重新输入街道信息,在录入小区信息!!!`, 'warning', 3000)
|
|
756
|
+
// }
|
|
757
|
+
// }
|
|
758
|
+
// }
|
|
759
|
+
// console.log('-----------添加小区-----------')
|
|
760
|
+
// let data = {
|
|
761
|
+
// f_linkname: '', // 联系人
|
|
762
|
+
// f_linkphone: '', // 联系电话
|
|
763
|
+
// f_adjustable_id: '', // 调压箱编号
|
|
764
|
+
// f_user_type: '', // 用户类型
|
|
765
|
+
// f_gasproperties: '', // 用气性质
|
|
766
|
+
// f_meter_brand: '', // 气表品牌
|
|
767
|
+
// f_price_name: '', // 气价名称
|
|
768
|
+
// f_price_type: '', // 气价类型
|
|
769
|
+
// f_meter_style: '', // 气表型号
|
|
770
|
+
// f_position: '', // 表安装位置
|
|
771
|
+
// f_meter_type: '', // 气表类型
|
|
772
|
+
// f_area_id: '', // 小区编号 (自动生成)
|
|
773
|
+
// f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
|
|
774
|
+
// f_operatorid: this.$login.f.id, // 操作人id
|
|
775
|
+
// f_operator: this.$login.f.name, // 操作人
|
|
776
|
+
// f_orgid: this.$login.f.orgid, // 组织id
|
|
777
|
+
// f_orgname: this.$login.f.orgs, // 组织名
|
|
778
|
+
// f_pcd_id: 8, // 省市区id
|
|
779
|
+
// // f_pcd_id: 124, // 50.4测试
|
|
780
|
+
// f_pcd: '河北省邯郸市武安市', // 省市区
|
|
781
|
+
// f_street_id: street.id, // 街道id
|
|
782
|
+
// f_street: street.f_street,// 街道
|
|
783
|
+
// f_area_code: '01', // 片区编码
|
|
784
|
+
// f_slice_area: '武安片区', // 片区
|
|
785
|
+
// // f_area_code: '66556', // 50.4测试
|
|
786
|
+
// // f_slice_area: '武安明星', // 50.4测试
|
|
787
|
+
// slice_area: [
|
|
788
|
+
// {
|
|
789
|
+
// name: '武安片区',
|
|
790
|
+
// code: '01'
|
|
791
|
+
// }
|
|
792
|
+
// ],
|
|
793
|
+
// // slice_area: [ // 50.4测试
|
|
794
|
+
// // {
|
|
795
|
+
// // name: '武安明星',
|
|
796
|
+
// // code: '66556'
|
|
797
|
+
// // }
|
|
798
|
+
// // ],
|
|
799
|
+
// f_residential_area: this.show_data.fields[index].value.trim(), // 小区名称
|
|
800
|
+
// f_area_address: `河北省邯郸市武安市${street.f_street}`, // 详细地址(省市区+街道)
|
|
801
|
+
// f_comments: '报建系统自动创建'
|
|
802
|
+
// }
|
|
803
|
+
// try {
|
|
804
|
+
// let http = new HttpResetClass()
|
|
805
|
+
// let res = await http.load('POST', 'rs/logic/address_updatearea', {data: data}, {
|
|
806
|
+
// resolveMsg: null,
|
|
807
|
+
// rejectMsg: null
|
|
808
|
+
// })
|
|
809
|
+
// } catch (e) {
|
|
810
|
+
// if (e.status === 635) {
|
|
811
|
+
// this.$showAlert('此小区已存在!!!', 'warning', 3000)
|
|
812
|
+
// } else {
|
|
813
|
+
// this.$showAlert('自动添加小区失败,请手动添加!!!', 'warning', 3000)
|
|
814
|
+
// }
|
|
815
|
+
// }
|
|
816
|
+
// }
|
|
817
|
+
// 地址拼接
|
|
818
|
+
if (
|
|
819
|
+
this.show_data.fields[index].label === '区域' ||
|
|
820
|
+
this.show_data.fields[index].label === '街道' ||
|
|
821
|
+
this.show_data.fields[index].label === '小区' ||
|
|
822
|
+
this.show_data.fields[index].label === '楼号' ||
|
|
823
|
+
this.show_data.fields[index].label === '单元' ||
|
|
824
|
+
this.show_data.fields[index].label === '楼层' ||
|
|
825
|
+
this.show_data.fields[index].label === '门牌号'
|
|
826
|
+
) {
|
|
827
|
+
let f_address = null
|
|
828
|
+
if (this.show_data.f_address_type !== '民用地址') {
|
|
829
|
+
f_address = this.getLableValue('区域') + this.getLableValue('街道') + this.getLableValue('小区')
|
|
830
|
+
} else {
|
|
831
|
+
f_address = this.getLableValue('区域') + this.getLableValue('街道') +
|
|
832
|
+
this.getLableValue('小区') +
|
|
833
|
+
this.getLableValue('楼号') +
|
|
834
|
+
(isEmpty(this.getLableValue('楼号')) ? '' : '号楼') +
|
|
835
|
+
this.getLableValue('单元') +
|
|
836
|
+
(isEmpty(this.getLableValue('单元')) ? '' : '单元') +
|
|
837
|
+
this.getLableValue('楼层') +
|
|
838
|
+
(isEmpty(this.getLableValue('楼层')) ? '' : '层') +
|
|
839
|
+
this.getLableValue('门牌号') +
|
|
840
|
+
(isEmpty(this.getLableValue('门牌号')) ? '' : '室')
|
|
841
|
+
}
|
|
842
|
+
this.setLabelValue('地址', f_address)
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
if (this.show_data.defname === '竣工验收') {
|
|
847
|
+
if (this.show_data.fields[index].label === '验收是否合格'){
|
|
848
|
+
for (const button of this.show_data.buttons) {
|
|
849
|
+
if (this.show_data.fields[index].value === '否' && button.button_name === '退回') {
|
|
850
|
+
button.hidden = false
|
|
851
|
+
} else {
|
|
852
|
+
button.hidden = true
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
if (this.show_data.defname === '报建登记'&&this.show_data.f_apply_type==='工商户报建') {
|
|
858
|
+
|
|
859
|
+
console.log("13f", this.selectdata.onetomany)
|
|
860
|
+
for (const button of this.show_data.buttons) {
|
|
861
|
+
if (this.selectdata.onetomany&& button.button_name === '提交') {
|
|
862
|
+
console.log("1f")
|
|
863
|
+
button.disable = true
|
|
864
|
+
}
|
|
865
|
+
else {
|
|
866
|
+
button.disable = false
|
|
867
|
+
console.log("2f")
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
// if (this.show_data.defname === '营业厅建档'){
|
|
872
|
+
// let http = new HttpResetClass()
|
|
873
|
+
// let data = {
|
|
874
|
+
// tablename: 't_userinfo',
|
|
875
|
+
// condition: `f_process_id='${this.selectdata.f_process_id}'`
|
|
876
|
+
//
|
|
877
|
+
// }
|
|
878
|
+
// let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
|
|
879
|
+
//
|
|
880
|
+
// if (this.show_data.fields[index].label === '是否已建档') {
|
|
881
|
+
// if (res.data[0].f_user_state === '预备') {
|
|
882
|
+
// this.show_data.fields[index].value = '否'
|
|
883
|
+
// button.hidden = false
|
|
884
|
+
// }else{
|
|
885
|
+
// this.show_data.fields[index].value = '是'
|
|
886
|
+
// button.hidden = true
|
|
887
|
+
// }
|
|
888
|
+
// }
|
|
889
|
+
// }
|
|
890
|
+
if(this.show_data.defname === '现场勘察') {
|
|
891
|
+
console.log("this.shdata",this.show_data)
|
|
892
|
+
if (this.show_data.fields[index].label === '是否具备安装条件') {
|
|
893
|
+
for (const button of this.show_data.buttons) {
|
|
894
|
+
if (this.show_data.fields[index].value === '否'&& button.button_name === '退回') {
|
|
895
|
+
button.hidden = false
|
|
896
|
+
}else {
|
|
897
|
+
button.hidden = true
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
// if (this.show_data.defname === '通气点火'){
|
|
903
|
+
// let http = new HttpResetClass()
|
|
904
|
+
// let data = {
|
|
905
|
+
// tablename: 't_firemessage',
|
|
906
|
+
// condition: `f_process_id='${this.selectdata.f_process_id}'`
|
|
907
|
+
//
|
|
908
|
+
// }
|
|
909
|
+
// let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {resolveMsg: null, rejectMsg: null})
|
|
910
|
+
// console.log("res")
|
|
911
|
+
// console.log(res.data)
|
|
912
|
+
// if (this.show_data.fields[index].label === '是否已通气') {
|
|
913
|
+
// if (res.data.length==0) {
|
|
914
|
+
// this.show_data.fields[index].value = '否'
|
|
915
|
+
// button.hidden = false
|
|
916
|
+
// }else{
|
|
917
|
+
// this.show_data.fields[index].value = '是'
|
|
918
|
+
// button.hidden = true
|
|
919
|
+
// }
|
|
920
|
+
// }
|
|
921
|
+
// }
|
|
922
|
+
if (this.show_data.defname === '合同签订') {
|
|
923
|
+
if (this.show_data.fields[index].label === '合同编号') {
|
|
924
|
+
if (!isEmpty(this.show_data.fields[index].value)) {
|
|
925
|
+
let http = new HttpResetClass()
|
|
926
|
+
let data = {
|
|
927
|
+
tablename: 't_apply',
|
|
928
|
+
condition: `f_contract_number='${this.show_data.fields[index].value}'`
|
|
929
|
+
}
|
|
930
|
+
let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
|
|
931
|
+
resolveMsg: null,
|
|
932
|
+
rejectMsg: '合同编号查重失败'
|
|
933
|
+
})
|
|
934
|
+
if (res.data.length > 0) {
|
|
935
|
+
this.show_data.fields[index].value = null
|
|
936
|
+
this.$showAlert('合同编号已存在!!!', 'warning', 3000)
|
|
937
|
+
}
|
|
938
|
+
//拼写合同编号
|
|
939
|
+
// if (this.selectdata.f_apply_type == '工商户报建') {
|
|
940
|
+
// this.show_data.fields[index].value = "ZS-S-" + this.show_data.fields[index].value
|
|
941
|
+
// // this.show_data.fields[index].value = "ZS-S-" + this.show_data.fields[index].value + "-" + new Date().Format('yyyy-MM-dd')
|
|
942
|
+
// }else {
|
|
943
|
+
// this.show_data.fields[index].value = "ZS-M-" + this.show_data.fields[index].value
|
|
944
|
+
// // this.show_data.fields[index].value = "ZS-M-" + this.show_data.fields[index].value + "-" + new Date().Format('yyyy-MM-dd')
|
|
945
|
+
// }
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
if (this.show_data.fields[index].label === '单价(户)') {
|
|
949
|
+
let http = new HttpResetClass()
|
|
950
|
+
let data = {
|
|
951
|
+
num1: this.getLableValue(this.show_data.fields[index].label),
|
|
952
|
+
num2: this.getLableValue('户数'),
|
|
953
|
+
operator: '*'
|
|
954
|
+
}
|
|
955
|
+
try {
|
|
956
|
+
let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
|
|
957
|
+
resolveMsg: null,
|
|
958
|
+
rejectMsg: null
|
|
959
|
+
})
|
|
960
|
+
data = {
|
|
961
|
+
num1: res.data,
|
|
962
|
+
num2: this.getLableValue('其他费用'),
|
|
963
|
+
operator: '+'
|
|
964
|
+
}
|
|
965
|
+
res = await http.load('POST', 'rs/logic/compute', {data: data}, {
|
|
966
|
+
resolveMsg: null,
|
|
967
|
+
rejectMsg: null
|
|
968
|
+
})
|
|
969
|
+
this.setLabelValue('合同金额',res.data)
|
|
970
|
+
} catch (e) {
|
|
971
|
+
this.$showAlert(e.data.msg, 'warning', 3000)
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
if (this.show_data.fields[index].label === '其他费用') {
|
|
975
|
+
let http = new HttpResetClass()
|
|
976
|
+
let data = {
|
|
977
|
+
num1: this.getLableValue(this.show_data.fields[index].label),
|
|
978
|
+
num2: this.getLableValue('合同金额'),
|
|
979
|
+
operator: '+'
|
|
980
|
+
}
|
|
981
|
+
try {
|
|
982
|
+
let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
|
|
983
|
+
resolveMsg: null,
|
|
984
|
+
rejectMsg: null
|
|
985
|
+
})
|
|
986
|
+
this.setLabelValue('合同金额',res.data)
|
|
987
|
+
} catch (e) {
|
|
988
|
+
this.$showAlert(e.data.msg, 'warning', 3000)
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
// ========================= 武安 =================================
|
|
993
|
+
// 号码检测
|
|
994
|
+
if (this.show_data.fields[index].label === '电话号码') {
|
|
995
|
+
let phone = this.show_data.fields[index].value
|
|
996
|
+
// 电话号码效验
|
|
997
|
+
if (!(/^1[3456789]\d{9}$/.test(phone))) {
|
|
998
|
+
this.show_data.fields[index].value = ""
|
|
999
|
+
this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
//时间提醒
|
|
1003
|
+
if (this.show_data.fields[index].label.includes("时间") || this.show_data.fields[index].type === 'datepicker') {
|
|
1004
|
+
let setTime = this.show_data.fields[index].value
|
|
1005
|
+
let nowTime = new Date().Format("yyyy-MM-dd HH:mm:ss")
|
|
1006
|
+
if (nowTime >= setTime) {
|
|
1007
|
+
this.$showMessage("请注意,当前节点时间/工期已过期!")
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
},
|
|
1011
|
+
// input值发生变化
|
|
1012
|
+
async 'oninput'(index) {
|
|
1013
|
+
|
|
1014
|
+
},
|
|
1015
|
+
// 错误事件
|
|
1016
|
+
error_check(index) {
|
|
1017
|
+
// 时间格式检测
|
|
1018
|
+
if (this.show_data.fields[index].type == 'datepicker') {
|
|
1019
|
+
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)$/)
|
|
1020
|
+
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])$/)
|
|
1021
|
+
if (datetimeRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 19 && this.show_data.fields[index].fullsize) {
|
|
1022
|
+
this.show_data.fields[index].error.flag = false
|
|
1023
|
+
} else if (dateRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 10) {
|
|
1024
|
+
this.show_data.fields[index].error.flag = false
|
|
1025
|
+
} else {
|
|
1026
|
+
if (this.show_data.fields[index].fullsize) {
|
|
1027
|
+
this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
|
|
1028
|
+
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'
|
|
1029
|
+
this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
|
|
1030
|
+
this.show_data.fields[index].error.flag = true
|
|
1031
|
+
this.show_data.fields[index].value = ''
|
|
1032
|
+
} else {
|
|
1033
|
+
this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
|
|
1034
|
+
this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02'
|
|
1035
|
+
this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
|
|
1036
|
+
this.show_data.fields[index].error.flag = true
|
|
1037
|
+
this.show_data.fields[index].value = ''
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
},
|
|
1043
|
+
// onetomany模态框默认监听监听事件
|
|
1044
|
+
async 'onetomanydelete'(i, j) {
|
|
1045
|
+
console.log('默认删除')
|
|
1046
|
+
let http = new HttpResetClass()
|
|
1047
|
+
let data = {
|
|
1048
|
+
table: this.show_data.onetomany[i].tables[0],
|
|
1049
|
+
row: this.show_data.onetomany[i].rows[j]
|
|
1050
|
+
}
|
|
1051
|
+
let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
|
|
1052
|
+
resolveMsg: null,
|
|
1053
|
+
rejectMsg: '删除失败'
|
|
1054
|
+
})
|
|
1055
|
+
|
|
1056
|
+
if (res.data <= 0){
|
|
1057
|
+
this.$showMessage('删除失败')
|
|
1058
|
+
return
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
this.$dispatch('breakControl', this.show_data)
|
|
1062
|
+
},
|
|
1063
|
+
async 'onetomanyadd'(index) {
|
|
1064
|
+
|
|
1065
|
+
let data = {
|
|
1066
|
+
f_process_id : this.show_data.f_process_id
|
|
1067
|
+
}
|
|
1068
|
+
this.show_data.onetomany[index].fields.forEach(item => {
|
|
1069
|
+
data[item.field] = item.value
|
|
1070
|
+
})
|
|
1071
|
+
let res = await this.$resetpost(
|
|
1072
|
+
`rs/entity/${this.show_data.onetomany[index].tables[0]}`,
|
|
1073
|
+
data
|
|
1074
|
+
)
|
|
1075
|
+
this.$dispatch('breakControl', this.show_data)
|
|
1076
|
+
},
|
|
1077
|
+
async 'onetomanyupdate'(i, j) {
|
|
1078
|
+
let onetomany = this.show_data.onetomany[i]
|
|
1079
|
+
let data = onetomany.rows[j]
|
|
1080
|
+
|
|
1081
|
+
onetomany.fields.forEach(item => {
|
|
1082
|
+
data[item.field] = item.value
|
|
1083
|
+
})
|
|
1084
|
+
let res = await this.$resetpost(
|
|
1085
|
+
`rs/entity/${this.show_data.onetomany[i].tables[0]}`,
|
|
1086
|
+
data
|
|
1087
|
+
)
|
|
1088
|
+
|
|
1089
|
+
this.$dispatch('breakControl', this.show_data)
|
|
1090
|
+
},
|
|
1091
|
+
// 选择用户档案信息
|
|
1092
|
+
'selectUserinfo'(row) {
|
|
1093
|
+
console.log("当前选择数据",row)
|
|
1094
|
+
if (this.selectdata.f_apply_type === '拆改装报建'){
|
|
1095
|
+
this.showLabels('用户编号')
|
|
1096
|
+
this.hideLabels('地址类型','区域','街道','小区','楼号','单元','楼层','门牌号')
|
|
1097
|
+
this.electiveLabels('地址类型','区域','街道','小区','楼号','单元','楼层','门牌号')
|
|
1098
|
+
this.show_data.f_address_type = '民用地址'
|
|
1099
|
+
this.show_data.f_pcd = row.f_pcd
|
|
1100
|
+
this.show_data.f_street = row.f_street
|
|
1101
|
+
this.show_data.f_residential_area = row.f_residential_area
|
|
1102
|
+
this.show_data.f_building = row.f_building
|
|
1103
|
+
this.show_data.f_unit = row.f_unit
|
|
1104
|
+
this.show_data.f_floor = row.f_floor
|
|
1105
|
+
this.show_data.f_room = row.f_room
|
|
1106
|
+
this.selectdata.flag = '旧用户'
|
|
1107
|
+
}
|
|
1108
|
+
this.setLabelValue('用户编号', row.f_userinfo_code)
|
|
1109
|
+
this.setLabelValue('用户名称', row.f_user_name)
|
|
1110
|
+
this.setLabelValue('用户电话', row.f_user_phone)
|
|
1111
|
+
this.setLabelValue('证件类型', row.f_credentials)
|
|
1112
|
+
this.setLabelValue('证件号码', row.f_idnumber)
|
|
1113
|
+
this.setLabelValue('地址', row.f_address)
|
|
1114
|
+
|
|
1115
|
+
this.selectdata.f_userinfo_id = row.f_userinfo_id
|
|
1116
|
+
this.selectdata.f_userinfo_code = row.f_userinfo_code
|
|
1117
|
+
console.log("当前选择数据",this.show_data)
|
|
1118
|
+
},
|
|
1119
|
+
async 'streetChange'(index) {
|
|
1120
|
+
if (isEmpty(this.show_data.f_street)) {
|
|
1121
|
+
return
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
this.setLabelValue('小区', null)
|
|
1125
|
+
|
|
1126
|
+
let data = {
|
|
1127
|
+
tablename: 't_area',
|
|
1128
|
+
condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
|
|
1129
|
+
}
|
|
1130
|
+
let http = new HttpResetClass()
|
|
1131
|
+
let res = await http.load(
|
|
1132
|
+
'POST',
|
|
1133
|
+
`rs/sql/singleTable`,
|
|
1134
|
+
{data: data},
|
|
1135
|
+
{resolveMsg: null, rejectMsg: '小区!!!'}
|
|
1136
|
+
)
|
|
1137
|
+
|
|
1138
|
+
this.setLabelOptions('小区', res.data.map(item => {
|
|
1139
|
+
return {
|
|
1140
|
+
label: item.f_residential_area,
|
|
1141
|
+
value: item.f_residential_area
|
|
1142
|
+
}
|
|
1143
|
+
}))
|
|
1144
|
+
},
|
|
1145
|
+
// 区县失去焦点
|
|
1146
|
+
async 'pcdChange'(index) {
|
|
1147
|
+
if (isEmpty(this.show_data.f_pcd)) {
|
|
1148
|
+
return
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
this.setLabelValue('街道', null)
|
|
1152
|
+
this.setLabelValue('小区', null)
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
let data = {
|
|
1156
|
+
tablename: 't_street',
|
|
1157
|
+
condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
|
|
1158
|
+
}
|
|
1159
|
+
let f_address_type = this.getLableValue('地址类型')
|
|
1160
|
+
|
|
1161
|
+
if (f_address_type === '民用地址') {
|
|
1162
|
+
data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
let http = new HttpResetClass()
|
|
1166
|
+
let res = await http.load(
|
|
1167
|
+
'POST',
|
|
1168
|
+
`rs/sql/singleTable`,
|
|
1169
|
+
{data: data},
|
|
1170
|
+
{resolveMsg: null, rejectMsg: '街道查询失败!!!'}
|
|
1171
|
+
)
|
|
1172
|
+
|
|
1173
|
+
this.setLabelOptions('街道', res.data.map(item => {
|
|
1174
|
+
return {
|
|
1175
|
+
label: item.f_street,
|
|
1176
|
+
value: item.f_street
|
|
1177
|
+
}
|
|
1178
|
+
}))
|
|
1179
|
+
},
|
|
1180
|
+
'buttonChange' (index) {
|
|
1181
|
+
if (this.show_data.fields[index].value === '否') {
|
|
1182
|
+
console.log("测试")
|
|
1183
|
+
this.hideButtons('下发','提交')
|
|
1184
|
+
this.showButtons('退回','终止')
|
|
1185
|
+
} else {
|
|
1186
|
+
this.hideButtons('退回','终止')
|
|
1187
|
+
this.showButtons('下发','提交')
|
|
1188
|
+
}
|
|
1189
|
+
},
|
|
1190
|
+
async 'stopApply'() {
|
|
1191
|
+
this.stope_view = true
|
|
1192
|
+
this.showview = false
|
|
1193
|
+
},
|
|
1194
|
+
async 'signUserInfo' (index) {
|
|
1195
|
+
if (this.show_data.fields[index].value === '是') {
|
|
1196
|
+
console.log("测试")
|
|
1197
|
+
this.showLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
|
|
1198
|
+
this.requiredLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '门牌号', '地址')
|
|
1199
|
+
} else {
|
|
1200
|
+
this.hideLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
|
|
1201
|
+
this.electiveLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
|
|
1202
|
+
}
|
|
1203
|
+
},
|
|
1204
|
+
// onetomany模态框监听事件
|
|
1205
|
+
async 'onchange_modal'(index, i) {
|
|
1206
|
+
},
|
|
1207
|
+
async 'oninput_modal'(index, i) {
|
|
1208
|
+
}
|
|
1209
|
+
},
|
|
1210
|
+
watch: {
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
</script>
|
|
1214
|
+
<style scoped>
|
|
1215
|
+
/*清除model中的浮动*/
|
|
1216
|
+
.clearfix:after,.clearfix:before{
|
|
1217
|
+
display: table;
|
|
1218
|
+
}
|
|
1219
|
+
.clearfix:after{
|
|
1220
|
+
clear: both;
|
|
1221
|
+
}
|
|
1222
|
+
</style>
|