apply-clients 4.1.10-11 → 4.1.10-weinan

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/index.html +30 -21
  2. package/package.json +10 -7
  3. package/src/AndroidApp.vue +1 -1
  4. package/src/apply.js +16 -7
  5. package/src/applyAndroid.js +43 -50
  6. package/src/components/Table.js +13 -13
  7. package/src/components/app_apply/AppChargeManagement.vue +622 -0
  8. package/src/components/app_apply/ApplyInfo.vue +56 -56
  9. package/src/components/app_apply/ApplyToDoList.vue +144 -165
  10. package/src/components/app_apply/FieldExploration.vue +3 -3
  11. package/src/components/app_apply/PlaceControler.vue +255 -258
  12. package/src/components/app_apply/ServiceControl.vue +289 -267
  13. package/src/components/app_apply/ServiceView.vue +363 -355
  14. package/src/components/app_apply/ToolsPage.vue +1 -1
  15. package/src/components/app_apply/Ventilation.vue +10 -10
  16. package/src/components/app_apply/materialshoufei.vue +184 -0
  17. package/src/components/product/ApplyCharge/ApplyChargeList.vue +251 -251
  18. package/src/components/product/Function/InstallFunction.vue +120 -95
  19. package/src/components/product/Function/InstallInfoSelect.vue +268 -206
  20. package/src/components/product/Function/Service/FunctionServiceControl.vue +206 -386
  21. package/src/components/product/Function/StopApplyCrrdList.vue +1 -1
  22. package/src/components/product/Function/functions/StopInstall.vue +7 -1
  23. package/src/components/product/Process/ExplorationSelect.vue +377 -501
  24. package/src/components/product/Process/ExplorationUser.vue +100 -133
  25. package/src/components/product/Process/Processes/InstallationDetails.vue +276 -246
  26. package/src/components/product/Process/Processes/UserFireInfo.vue +409 -0
  27. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +1458 -99
  28. package/src/components/product/Process/Processes/addressAndUserinfoManagementPro.vue +1221 -0
  29. package/src/components/product/Process/Processes/chargeManagement.vue +545 -552
  30. package/src/components/product/Process/Processes/devicesDetails.vue +834 -0
  31. package/src/components/product/Process/Processes/materialshoufei.vue +182 -0
  32. package/src/components/product/Process/Processes/printCharge.vue +12 -8
  33. package/src/components/product/Process/Processes/recordcancel.vue +50 -0
  34. package/src/components/product/Process/Processes/selectUserinfo.vue +199 -0
  35. package/src/components/product/Process/Processes/splitMaterial.vue +358 -0
  36. package/src/components/product/Process/Service/ServiceControl.vue +1236 -726
  37. package/src/components/product/Process/ShowBackReason.vue +21 -6
  38. package/src/components/product/ServiceView.vue +557 -575
  39. package/src/components/product/Stop/StopApply.vue +101 -0
  40. package/src/components/product/Stop/StopApplyList.vue +257 -0
  41. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +150 -210
  42. package/src/components/product/Supervisory/SupervisoryControl.vue +124 -173
  43. package/src/components/product/Supervisory/SupervisoryList.vue +191 -310
  44. package/src/components/product/Supervisory/SupervisoryhCart.vue +76 -99
  45. package/src/components/product/Test.vue +8 -4
  46. package/src/components/product/VueUtils/ApplyUpload.vue +4 -4
  47. package/src/components/product/VueUtils/ToolsPage.vue +1 -1
  48. package/src/main.js +25 -32
  49. package/static/images/lefticon//347/237/251/345/275/2421183.png +0 -0
  50. package/src/components/app_apply/android/ExplorationSelectApp.vue +0 -404
  51. package/src/components/app_apply/android/ExplorationUserApp.vue +0 -189
  52. package/src/components/app_apply/android/ServiceControlApp.vue +0 -714
  53. package/src/components/app_apply/android/ServiceViewApp.vue +0 -736
  54. package/src/components/product/Function/OrderCenter/Step.vue +0 -153
  55. package/src/components/product/Function/OrderCenter/download.png +0 -0
  56. package/src/components/product/Function/OrderCenter/orderApplyDispose.vue +0 -203
  57. package/src/components/product/Function/OrderCenter/orderCenter.vue +0 -41
  58. package/src/components/product/Function/OrderCenter/orderList.vue +0 -265
  59. package/src/components/product/Function/functions/InstallFee.vue +0 -1047
  60. package/src/components/product/Function/functions/PrestoreFee.vue +0 -630
  61. package/src/components/product/Procedures/ProceduresDataGrid.vue +0 -1022
  62. package/src/components/product/Process/ModifyUserFiles.vue +0 -452
  63. package/src/components/product/Process/ProcessInfo/history_control.vue +0 -135
  64. package/src/components/product/Process/Processes/CustomerMaterialMessage.vue +0 -1073
  65. package/src/components/product/Process/Processes/CustomerRecordMessage.vue +0 -949
  66. package/src/components/product/Process/Processes/Service/ApplyChargeSearch.vue +0 -203
  67. package/src/components/product/Process/Processes/Service/GasStop.vue +0 -96
  68. package/src/components/product/Process/Processes/Service/ServiceControl.vue +0 -2569
  69. package/src/components/product/ReportForm/WaterReport.vue +0 -359
  70. package/src/components/product/VueUtils/rightview/InstallCardList2.vue +0 -261
@@ -1,726 +1,1236 @@
1
- <template>
2
-
3
- <div class="auto clearfix">
4
- <show-back-reason :selectdata="show_data"></show-back-reason>
5
- </div>
6
-
7
- <service-view v-ref:serviceview :data="show_data" v-if="showview"></service-view>
8
-
9
- </template>
10
- <script>
11
- import Vue from 'vue'
12
- import {HttpResetClass} from 'vue-client'
13
- import {getNowDate,isEmpty} from '../../../Util'
14
- // Date格式化
15
- Date.prototype.Format = function (fmt) {
16
- var o = {
17
- "M+": this.getMonth() + 1, //月份
18
- "d+": this.getDate(), //日
19
- "H+": this.getHours(), //小时
20
- "m+": this.getMinutes(), //分
21
- "s+": this.getSeconds(), //秒
22
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
23
- "S": this.getMilliseconds() //毫秒
24
- };
25
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
26
- for (var k in o)
27
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
28
- return fmt;
29
- }
30
-
31
- export default {
32
- title: '报建流程业务控制层',
33
- props: ['selectdata'],
34
- data() {
35
- return {
36
- data: null, // 数据库数据,json配置文件数据的数据集合
37
- json_datas: null, // Json配置文件集合
38
- showview: false, // 控制显示service-view组件
39
- show_data: null // view层显示的数据
40
- }
41
- },
42
- created () {
43
- this.refurbish()
44
- },
45
- methods: {
46
- // 组件初始化操作
47
- refurbish() {
48
- this.json_datas = this.$workflow_vue
49
- let sum = 0
50
- let jsonData = {}
51
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length == 0) {
52
- this.$showMessage("网络故障,请刷新页面")
53
- return
54
- }
55
- for (let i = 0; i < this.json_datas.activitys.length; i++) {
56
- if (this.selectdata.defname == this.json_datas.activitys[i].title) {
57
- jsonData = this.json_datas.activitys[i] // 拿到当前节点的json配置信息
58
- sum++ // 节点名一样的个数
59
- }
60
- }
61
- if (sum == 1) {
62
- this.data = null
63
- this.data = jsonData
64
- // selectdata 填充 data
65
- this.data = Object.assign({}, this.data, this.selectdata)
66
- this.initializeJSON()
67
- } else if (sum == 0) {
68
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
69
- } else {
70
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
71
- }
72
- },
73
- // json配置数据处理
74
- async initializeJSON() {
75
- // 有默认值,value就给默认值,没有就是null
76
- this.data.fields.forEach(item => {
77
- if (!item.value) {
78
- if (item.value === 0) {
79
- item.value = 0
80
- } else {
81
- item.value = null
82
- }
83
- }
84
- if (item.default || item.default == 0) {
85
- item.value = item.default
86
- }
87
- if (this.selectdata[item.field]) {
88
- // 将json字符串格式化赋值给value
89
- if (String(this.selectdata[item.field]).startsWith("{")) {
90
- item.value = JSON.parse(this.selectdata[item.field])
91
- this.selectdata[item.field] = JSON.parse(this.selectdata[item.field])
92
- } else {
93
- item.value = this.selectdata[item.field]
94
- }
95
- } else {
96
- if (this.selectdata[item.field] === 0) {
97
- item.value = 0
98
- }
99
- }
100
-
101
- // datepicker 没有值给当时值
102
- if (item.type === 'datepicker' && !item.value && item.default) {
103
- item.value = new Date().Format('yyyy-MM-dd HH:mm:ss')
104
- }
105
-
106
- // 如果配置类型为select,优先从参数列表获取options
107
- if (item.type === 'select') {
108
- let temp = null
109
-
110
- temp = this.$appdata.getParam(item.label)
111
-
112
- if (temp && temp.length > 0 && item.label) {
113
- item.options = temp
114
- } else {
115
- if (item.paramLabel) {
116
- temp = this.$appdata.getParam(item.paramLabel)
117
- if (temp && temp.length > 0) {
118
- item.options = temp
119
- }
120
- }
121
- }
122
- }
123
- })
124
-
125
- // 控制组件
126
- if (this.data.components) {
127
- this.data.components.forEach(item => {
128
- item.mark = 0
129
- })
130
- }
131
-
132
- // 初始化 fields 可对数据进行特殊处理
133
- this.initializeFields()
134
-
135
- // 初始化 buttons_fields
136
- for (let i = 0; i < this.data.buttons.length; i++) {
137
- // 下发按钮相关配置
138
- if (this.data.buttons[i].button_name === '下发') {
139
- if (this.data.buttons[i].button_fields && this.data.buttons[i].button_fields.length === 1) {
140
- if (this.data.buttons[i].source){
141
- let http = new HttpResetClass()
142
- let res = await http.load('POST', 'rs/search', {
143
- source: this.data.buttons[i].source,
144
- userid: this.$login.f.id
145
- }, {resolveMsg: null, rejectMsg: null})
146
-
147
- let options = []
148
- for (let i = 0; i < res.data.length; i++) {
149
- options.push(
150
- {
151
- "label": res.data[i].name,
152
- "value": res.data[i].id
153
- }
154
- )
155
- }
156
- this.data.buttons[i].button_fields[0]['options'] = options
157
- } else {
158
- this.$showMessage("请配置获取人员表达式")
159
- }
160
- } else {
161
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
162
- }
163
- }
164
- if (this.data.buttons[i].button_fields) {
165
- this.data.buttons[i].button_fields.forEach(x => {
166
- // 如果配置类型为select,优先从参数列表获取options
167
- if (x.type === 'select' && this.$appdata.getParam(x.label)) {
168
- x.options = this.$appdata.getParam(x.label).trim()
169
- }
170
- })
171
- }
172
- }
173
-
174
- // onetomany 数据获取
175
- if (this.data.onetomany) {
176
- for (let index = 0; index < this.data.onetomany.length; index++) {
177
- let res = null
178
- if (!this.data.onetomany[index].queryEvent || this.data.onetomany[index].queryEvent === 'default'){
179
- let http = new HttpResetClass()
180
- let data = {
181
- tablename: this.data.onetomany[index].tables[0],
182
- condition: `f_process_id='${this.selectdata.f_process_id}'`
183
- }
184
- res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
185
- resolveMsg: null,
186
- rejectMsg: 'onetomany查询失败'
187
- })
188
- } else {
189
- res = this[this.data.onetomany[index].queryEvent]()
190
- }
191
-
192
- // 初始化 onetomany
193
- this.data.onetomany[index].rows = res.data
194
-
195
- // 初始化onetomany中的fields
196
- for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
197
- if (!this.data.onetomany[index].fields[j].value) {
198
- if (this.data.onetomany[index].fields[j].value === 0) {
199
- this.data.onetomany[index].fields[j].value = 0
200
- } else {
201
- this.data.onetomany[index].fields[j].value = null
202
- }
203
- }
204
- if (this.data.onetomany[index].fields[j].default || this.data.onetomany[index].fields[j].default == 0) {
205
- this.data.onetomany[index].fields[j].value = this.data.onetomany[index].fields[j].default
206
- }
207
- // 如果配置类型为select,优先从参数列表获取options
208
- if (this.data.onetomany[index].fields[j].type === 'select') {
209
- let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
210
- if (temp && temp.length > 0) {
211
- this.data.onetomany[index].fields[j].options = temp
212
- }
213
- }
214
- }
215
- }
216
- }
217
-
218
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
219
- let temp = JSON.parse(JSON.stringify(this.data))
220
-
221
- this.show_data = temp
222
- this.$nextTick(() => {
223
- this.showview = true
224
- })
225
- },
226
- // 初始化fields值
227
- initializeFields() {
228
-
229
- },
230
- // 金额转大写
231
- smalltoBIG(n) {
232
- let fraction = ['角', '分'];
233
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
234
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
235
- let head = n < 0 ? '欠' : '';
236
- n = Math.abs(n);
237
-
238
- let s = '';
239
-
240
- for (var i = 0; i < fraction.length; i++) {
241
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
242
- }
243
- s = s || '整';
244
- n = Math.floor(n);
245
-
246
- for (var i = 0; i < unit[0].length && n > 0; i++) {
247
- let p = '';
248
- for (var j = 0; j < unit[1].length && n > 0; j++) {
249
- p = digit[n % 10] + unit[1][j] + p;
250
- n = Math.floor(n / 10);
251
- }
252
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
253
- }
254
- return head + s.replace(/(零.)*零元/, '').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
255
- },
256
- getLableValue(label) {
257
- for (const item of this.show_data.fields) {
258
- if (item.label === label && item.type !== 'number') {
259
- return item.value || ''
260
- }
261
- if (item.label === label && item.type === 'number') {
262
- return item.value || 0
263
- }
264
- }
265
- },
266
- setLabelValue(label, value) {
267
- for (const item of this.show_data.fields) {
268
- if (item.label === label) {
269
- item.value = value
270
- }
271
- }
272
- },
273
- async buttonBefore(model) {
274
- if (
275
- model.button.button_name === '提交' &&
276
- model.defname === '收费' &&
277
- (
278
- model.f_apply_type === '散户报建' ||
279
- model.f_apply_type === '工业户报建' ||
280
- model.f_apply_type === '商业户报建'
281
- ) &&
282
- model.f_surplus_money > 0
283
- ) {
284
- throw '未结金额大于0,无法提交!!!'
285
- }
286
- if (model.defname === '施工' && model.button.button_name === '提交') {
287
- let http = new HttpResetClass()
288
- let data = {
289
- f_process_id: model.f_process_id
290
- }
291
- let res = await http.load('POST', 'rs/sql/notInstalled', {data: data}, {resolveMsg: null, rejectMsg: null})
292
- if (res.data[0].num > 0) {
293
- throw `还有${res.data[0].num}户未安装,无法提交`
294
- }
295
- }
296
- return model
297
- },
298
- // ========================= 武安 =================================
299
- // 地址类型变化
300
- addressType() {
301
- for (const item of this.show_data.fields) {
302
- if (item.label === '小区' && this.show_data.f_address_type === '民用地址') {
303
- item.required = true
304
- }
305
- if (item.label === '小区' && this.show_data.f_address_type === '特殊地址') {
306
- item.required = false
307
- }
308
- if (
309
- (
310
- item.label === '楼号' ||
311
- item.label === '单元' ||
312
- item.label === '楼层' ||
313
- item.label === '门牌号'
314
- ) && this.show_data.f_address_type === '民用地址'
315
- ) {
316
- item.required = true
317
- item.hidden = false
318
- item.value = null
319
- }
320
- if (
321
- (
322
- item.label === '楼号' ||
323
- item.label === '单元' ||
324
- item.label === '楼层' ||
325
- item.label === '门牌号'
326
- ) && this.show_data.f_address_type === '特殊地址'
327
- ) {
328
- item.required = false
329
- item.hidden = true
330
- item.value = null
331
- }
332
- }
333
- }
334
- // ========================= 武安 =================================
335
- },
336
- events: {
337
- // ========================= 武安 =================================
338
- // ========================= 武安 =================================
339
- 'openAddModel'(index) {
340
- // ========================= 武安 =================================
341
- // ========================= 武安 =================================
342
- },
343
- // 获取view层button事件/
344
- async 'button'(model) {
345
- // 修改提交数据
346
- model = Object.assign({}, this.selectdata, model)
347
- // 点击重置按钮就重置数据
348
- if (model.button.button_name === '重置') {
349
- this.$dispatch('breakControl', this.data)
350
- return
351
- }
352
-
353
- // 提交前置
354
- try {
355
- model = await this.buttonBefore(model)
356
- } catch (e) {
357
- this.$showAlert(e, 'warning', 3000)
358
- return
359
- }
360
-
361
- let http = new HttpResetClass()
362
- let requestData = {
363
- tables: this.data.tables,
364
- start_activity: this.$workflow_vue.start_activity,
365
- model: model,
366
- loginUser: this.$login.f,
367
- workflow_xmlfilename: this.$workflow_vue.workflow_xmlfilename
368
- }
369
- // 下发,提交,保存,退回通用业务后台处理logic
370
- let url = 'rs/logic/ApplyProductService'
371
- let res = await http.load('POST', url, {data: requestData}, {resolveMsg: null, rejectMsg: '数据保存失败'})
372
-
373
- if (res.data.code == 200) {
374
- this.$dispatch('search')
375
- } else {
376
- if (res.data.msg) {
377
- this.$showMessage(res.data.msg)
378
- }
379
- }
380
- },
381
- async 'initializtionView'() {
382
- // ========================= 武安 =================================
383
- this.addressType()
384
- // ========================= 武安 =================================
385
- },
386
- // 失去焦点出触发事件
387
- async 'onchange'(index) {
388
- console.log('失去焦点')
389
- // ========================= 武安 =================================
390
- if (this.show_data.defname === '用户受理'){
391
- if (this.show_data.fields[index].label === '地址类型'){
392
- this.addressType()
393
- }
394
- if (this.show_data.fields[index].label === '街道'){
395
- console.log('-----------添加街道-----------')
396
- if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
397
- this.show_data.fields[index].value = null
398
- this.$showAlert('街道地址不能为空!!!', 'warning', 3000)
399
- return
400
- }
401
- let http = new HttpResetClass()
402
- let data = {
403
- f_adjustable_id: '', // 调压箱编号
404
- f_orgid: this.$login.f.orgid, // 组织id
405
- f_orgname: this.$login.f.orgs, // 组织名
406
- f_pcd: '河北省邯郸市武安市', // 省市区
407
- f_pcd_id: 8, // 省市区id
408
- // f_pcd_id: 124, // 50.4测试
409
- f_slice_area: '', // 片区
410
- f_operatorid: this.$login.f.id, // 操作人id
411
- f_operator: this.$login.f.name, // 操作人
412
- f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
413
- f_street: this.show_data.fields[index].value.trim(), // 地址
414
- f_comments: '报建系统自动创建' // 备注
415
- }
416
- try{
417
- let res = await http.load('POST', 'rs/logic/address_updatestreet', {data: data}, {resolveMsg: null, rejectMsg: null})
418
- } catch (e) {
419
- if (e.status === 635){
420
- this.$showAlert('此街道已存在!!!', 'warning', 3000)
421
- } else {
422
- this.$showAlert('自动添加街道失败,请手动添加!!!', 'danger', 3000)
423
- }
424
- }
425
- }
426
- if (this.show_data.fields[index].label === '小区'){
427
- if (this.show_data.fields[index].value === null || this.show_data.fields[index].value === '') {
428
- this.show_data.fields[index].value = null
429
- this.$showAlert('小区名称不能为空!!!', 'warning', 3000)
430
- return
431
- }
432
- // 先查询街道
433
- let street = null
434
- for (const item of this.show_data.fields) {
435
- if (item.label === '街道') {
436
- if (item.value.trim() === null || item.value.trim() === ''){
437
- this.show_data.fields[index].value = null
438
- this.$showAlert('请先录入街道信息,才能录入小区信息!!!', 'warning', 3000)
439
- return
440
- }
441
- let http = new HttpResetClass()
442
- let data = {
443
- 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()}'`
444
- }
445
- let res = await http.load('POST', 'rs/sql/address_getstreetlist', {data: data}, {resolveMsg: null, rejectMsg: null})
446
- if (res.data.length > 0) {
447
- street = res.data[0]
448
- } else {
449
- this.show_data.fields[index].value = null
450
- this.$showAlert(`【${item.value}】街道不存在,请手动添加或重新输入街道信息,在录入小区信息!!!`, 'warning', 3000)
451
- }
452
- }
453
- }
454
- console.log('-----------添加小区-----------')
455
- let data = {
456
- f_linkname: '', // 联系人
457
- f_linkphone: '', // 联系电话
458
- f_adjustable_id: '', // 调压箱编号
459
- f_user_type: '', // 用户类型
460
- f_gasproperties: '', // 用气性质
461
- f_meter_brand: '', // 气表品牌
462
- f_price_name: '', // 气价名称
463
- f_price_type: '', // 气价类型
464
- f_meter_style: '', // 气表型号
465
- f_position: '', // 表安装位置
466
- f_meter_type: '', // 气表类型
467
- f_area_id: '', // 小区编号 (自动生成)
468
- f_filialeid: this.$login.f.orgid, // 创建地址所属分公司(默认当前操作人)
469
- f_operatorid: this.$login.f.id, // 操作人id
470
- f_operator: this.$login.f.name, // 操作人
471
- f_orgid: this.$login.f.orgid, // 组织id
472
- f_orgname: this.$login.f.orgs, // 组织名
473
- f_pcd_id: 8, // 省市区id
474
- // f_pcd_id: 124, // 50.4测试
475
- f_pcd: '河北省邯郸市武安市', // 省市区
476
- f_street_id: street.id, // 街道id
477
- f_street: street.f_street,// 街道
478
- f_area_code: '01', // 片区编码
479
- f_slice_area: '武安片区', // 片区
480
- // f_area_code: '66556', // 50.4测试
481
- // f_slice_area: '武安明星', // 50.4测试
482
- slice_area: [
483
- {
484
- name: '武安片区',
485
- code: '01'
486
- }
487
- ],
488
- // slice_area: [ // 50.4测试
489
- // {
490
- // name: '武安明星',
491
- // code: '66556'
492
- // }
493
- // ],
494
- f_residential_area: this.show_data.fields[index].value.trim(), // 小区名称
495
- f_area_address: `河北省邯郸市武安市${street.f_street}`, // 详细地址(省市区+街道)
496
- f_comments: '报建系统自动创建'
497
- }
498
- try{
499
- let http = new HttpResetClass()
500
- let res = await http.load('POST', 'rs/logic/address_updatearea', {data: data}, {resolveMsg: null, rejectMsg: null})
501
- } catch (e) {
502
- if (e.status === 635){
503
- this.$showAlert('此小区已存在!!!', 'warning', 3000)
504
- } else {
505
- this.$showAlert('自动添加小区失败,请手动添加!!!', 'warning', 3000)
506
- }
507
- }
508
- }
509
- // 地址拼接
510
- if (
511
- this.show_data.fields[index].label === '街道' ||
512
- this.show_data.fields[index].label === '小区' ||
513
- this.show_data.fields[index].label === '楼号' ||
514
- this.show_data.fields[index].label === '单元' ||
515
- this.show_data.fields[index].label === '楼层' ||
516
- this.show_data.fields[index].label === '门牌号'
517
- ) {
518
- let f_address = null
519
- if (this.show_data.f_address_type !== '民用地址') {
520
- f_address = this.getLableValue('街道') + this.getLableValue('小区')
521
- } else {
522
- f_address = this.getLableValue('街道') +
523
- this.getLableValue('小区') +
524
- this.getLableValue('楼号') +
525
- (isEmpty(this.getLableValue('楼号')) ? '' : '号楼') +
526
- this.getLableValue('单元') +
527
- (isEmpty(this.getLableValue('单元')) ? '' : '单元') +
528
- this.getLableValue('楼层') +
529
- (isEmpty(this.getLableValue('楼层')) ? '' : '层') +
530
- this.getLableValue('门牌号') +
531
- (isEmpty(this.getLableValue('门牌号')) ? '' : '室')
532
- }
533
- this.setLabelValue('地址',f_address)
534
- }
535
- }
536
- if (this.show_data.defname === '竣工验收') {
537
- if (this.show_data.fields[index].label === '验收是否合格'){
538
- for (const button of this.show_data.buttons) {
539
- if (this.show_data.fields[index].value === '否' && button.button_name === '退回') {
540
- button.hidden = false
541
- } else {
542
- button.hidden = true
543
- }
544
- }
545
- }
546
- }
547
- if (this.show_data.defname === '合同签订') {
548
- if (this.show_data.fields[index].label === '合同编号') {
549
- if (!isEmpty(this.show_data.fields[index].value)) {
550
- let http = new HttpResetClass()
551
- let data = {
552
- tablename: 't_apply',
553
- condition: `f_contract_number='${this.show_data.fields[index].value}'`
554
- }
555
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
556
- resolveMsg: null,
557
- rejectMsg: '合同编号查重失败'
558
- })
559
- if (res.data.length > 0) {
560
- this.show_data.fields[index].value = null
561
- this.$showAlert('合同编号已存在!!!', 'warning', 3000)
562
- }
563
- }
564
- }
565
- if (this.show_data.fields[index].label === '单价(户)') {
566
- let http = new HttpResetClass()
567
- let data = {
568
- num1: this.getLableValue(this.show_data.fields[index].label),
569
- num2: this.getLableValue('户数'),
570
- operator: '*'
571
- }
572
- try {
573
- let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
574
- resolveMsg: null,
575
- rejectMsg: null
576
- })
577
- data = {
578
- num1: res.data,
579
- num2: this.getLableValue('其他费用'),
580
- operator: '+'
581
- }
582
- res = await http.load('POST', 'rs/logic/compute', {data: data}, {
583
- resolveMsg: null,
584
- rejectMsg: null
585
- })
586
- this.setLabelValue('合同金额',res.data)
587
- } catch (e) {
588
- this.$showAlert(e.data.msg, 'warning', 3000)
589
- }
590
- }
591
- if (this.show_data.fields[index].label === '其他费用') {
592
- let http = new HttpResetClass()
593
- let data = {
594
- num1: this.getLableValue(this.show_data.fields[index].label),
595
- num2: this.getLableValue('合同金额'),
596
- operator: '+'
597
- }
598
- try {
599
- let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
600
- resolveMsg: null,
601
- rejectMsg: null
602
- })
603
- this.setLabelValue('合同金额',res.data)
604
- } catch (e) {
605
- this.$showAlert(e.data.msg, 'warning', 3000)
606
- }
607
- }
608
- }
609
- // ========================= 武安 =================================
610
- // 号码检测
611
- if (this.show_data.fields[index].label === '电话号码') {
612
- let phone = this.show_data.fields[index].value
613
- // 电话号码效验
614
- if (!(/^1[3456789]\d{9}$/.test(phone))) {
615
- this.show_data.fields[index].value = ""
616
- this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
617
- }
618
- }
619
- //时间提醒
620
- if (this.show_data.fields[index].label.includes("时间") || this.show_data.fields[index].type === 'datepicker') {
621
- let setTime = this.show_data.fields[index].value
622
- let nowTime = new Date().Format("yyyy-MM-dd HH:mm:ss")
623
- if (nowTime >= setTime) {
624
- this.$showMessage("请注意,当前节点时间/工期已过期!")
625
- }
626
- }
627
- },
628
- // input值发生变化
629
- async 'oninput'(index) {
630
-
631
- },
632
- // 错误事件
633
- error_check(index) {
634
- // 时间格式检测
635
- if (this.show_data.fields[index].type == 'datepicker') {
636
- 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)$/)
637
- 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])$/)
638
- if (datetimeRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 19 && this.show_data.fields[index].fullsize) {
639
- this.show_data.fields[index].error.flag = false
640
- } else if (dateRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 10) {
641
- this.show_data.fields[index].error.flag = false
642
- } else {
643
- if (this.show_data.fields[index].fullsize) {
644
- this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
645
- 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'
646
- this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
647
- this.show_data.fields[index].error.flag = true
648
- this.show_data.fields[index].value = ''
649
- } else {
650
- this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
651
- this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02'
652
- this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
653
- this.show_data.fields[index].error.flag = true
654
- this.show_data.fields[index].value = ''
655
- }
656
-
657
- }
658
- }
659
- },
660
- // onetomany模态框默认监听监听事件
661
- async 'onetomanydelete'(i, j) {
662
- console.log('默认删除')
663
- let http = new HttpResetClass()
664
- let data = {
665
- table: this.show_data.onetomany[i].tables[0],
666
- row: this.show_data.onetomany[i].rows[j]
667
- }
668
- let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
669
- resolveMsg: null,
670
- rejectMsg: '删除失败'
671
- })
672
-
673
- if (res.data <= 0){
674
- this.$showMessage('删除失败')
675
- return
676
- }
677
-
678
- this.$dispatch('breakControl', this.show_data)
679
- },
680
- async 'onetomanyadd'(index) {
681
-
682
- let data = {
683
- f_process_id : this.show_data.f_process_id
684
- }
685
- this.show_data.onetomany[index].fields.forEach(item => {
686
- data[item.field] = item.value
687
- })
688
- let res = await this.$resetpost(
689
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
690
- data
691
- )
692
- this.$dispatch('breakControl', this.show_data)
693
- },
694
- async 'onetomanyupdate'(i, j) {
695
- let onetomany = this.show_data.onetomany[i]
696
- let data = onetomany.rows[j]
697
-
698
- onetomany.fields.forEach(item => {
699
- data[item.field] = item.value
700
- })
701
- let res = await this.$resetpost(
702
- `rs/entity/${this.show_data.onetomany[i].tables[0]}`,
703
- data
704
- )
705
-
706
- this.$dispatch('breakControl', this.show_data)
707
- },
708
- // onetomany模态框监听事件
709
- async 'onchange_modal'(index, i) {
710
- },
711
- async 'oninput_modal'(index, i) {
712
- }
713
- },
714
- watch: {
715
- }
716
- }
717
- </script>
718
- <style scoped>
719
- /*清除model中的浮动*/
720
- .clearfix:after,.clearfix:before{
721
- display: table;
722
- }
723
- .clearfix:after{
724
- clear: both;
725
- }
726
- </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('小区')
830
+ } else {
831
+ f_address = 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
+ if(this.show_data.f_apply_type === '居民报建'){
971
+ this.show_data.f_contract_money = res.data
972
+ this.show_data.f_due_money = res.data
973
+ this.show_data.f_surplus_money = res.data
974
+ this.setLabelValue('应交总金额',res.data)
975
+ this.setLabelValue('未结总金额',res.data)
976
+ }
977
+ } catch (e) {
978
+ this.$showAlert(e.data.msg, 'warning', 3000)
979
+ }
980
+ }
981
+ if (this.show_data.fields[index].label === '其他费用') {
982
+ let http = new HttpResetClass()
983
+ let data = {
984
+ num1: this.getLableValue(this.show_data.fields[index].label),
985
+ num2: this.getLableValue('合同金额'),
986
+ operator: '+'
987
+ }
988
+ try {
989
+ let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
990
+ resolveMsg: null,
991
+ rejectMsg: null
992
+ })
993
+ this.setLabelValue('合同金额',res.data)
994
+ if(this.show_data.f_apply_type === '居民报建'){
995
+ this.show_data.f_contract_money = res.data
996
+ this.show_data.f_due_money = res.data
997
+ this.show_data.f_surplus_money = res.data
998
+ this.setLabelValue('应交总金额',res.data)
999
+ this.setLabelValue('未结总金额',res.data)
1000
+ }
1001
+ } catch (e) {
1002
+ this.$showAlert(e.data.msg, 'warning', 3000)
1003
+ }
1004
+ }
1005
+ }
1006
+ // ========================= 武安 =================================
1007
+ // 号码检测
1008
+ if (this.show_data.fields[index].label === '电话号码') {
1009
+ let phone = this.show_data.fields[index].value
1010
+ // 电话号码效验
1011
+ if (!(/^1[3456789]\d{9}$/.test(phone))) {
1012
+ this.show_data.fields[index].value = ""
1013
+ this.$showAlert('电话号码格式不正确,请重新输入。', 'info', 2000)
1014
+ }
1015
+ }
1016
+ //时间提醒
1017
+ if (this.show_data.fields[index].label.includes("时间") || this.show_data.fields[index].type === 'datepicker') {
1018
+ let setTime = this.show_data.fields[index].value
1019
+ let nowTime = new Date().Format("yyyy-MM-dd HH:mm:ss")
1020
+ if (nowTime >= setTime) {
1021
+ this.$showMessage("请注意,当前节点时间/工期已过期!")
1022
+ }
1023
+ }
1024
+ },
1025
+ // input值发生变化
1026
+ async 'oninput'(index) {
1027
+
1028
+ },
1029
+ // 错误事件
1030
+ error_check(index) {
1031
+ // 时间格式检测
1032
+ if (this.show_data.fields[index].type == 'datepicker') {
1033
+ 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)$/)
1034
+ 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])$/)
1035
+ if (datetimeRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 19 && this.show_data.fields[index].fullsize) {
1036
+ this.show_data.fields[index].error.flag = false
1037
+ } else if (dateRe.test(this.show_data.fields[index].value) && this.show_data.fields[index].value.trim().length == 10) {
1038
+ this.show_data.fields[index].error.flag = false
1039
+ } else {
1040
+ if (this.show_data.fields[index].fullsize) {
1041
+ this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
1042
+ 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'
1043
+ this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
1044
+ this.show_data.fields[index].error.flag = true
1045
+ this.show_data.fields[index].value = ''
1046
+ } else {
1047
+ this.show_data.fields[index].error = Object.assign({}, this.show_data.fields[index].error)
1048
+ this.show_data.fields[index].error.msg = this.show_data.fields[index].error.msg ? this.show_data.fields[index].error.msg : '时间格式如:2019-05-02'
1049
+ this.$showAlert(this.show_data.fields[index].label + '格式错误' + this.show_data.fields[index].error.msg, 'warning', 3000)
1050
+ this.show_data.fields[index].error.flag = true
1051
+ this.show_data.fields[index].value = ''
1052
+ }
1053
+
1054
+ }
1055
+ }
1056
+ },
1057
+ // onetomany模态框默认监听监听事件
1058
+ async 'onetomanydelete'(i, j) {
1059
+ console.log('默认删除')
1060
+ let http = new HttpResetClass()
1061
+ let data = {
1062
+ table: this.show_data.onetomany[i].tables[0],
1063
+ row: this.show_data.onetomany[i].rows[j]
1064
+ }
1065
+ let res = await http.load('POST', 'rs/logic/onetomanyDefaultDeleteEvent', {data: data}, {
1066
+ resolveMsg: null,
1067
+ rejectMsg: '删除失败'
1068
+ })
1069
+
1070
+ if (res.data <= 0){
1071
+ this.$showMessage('删除失败')
1072
+ return
1073
+ }
1074
+
1075
+ this.$dispatch('breakControl', this.show_data)
1076
+ },
1077
+ async 'onetomanyadd'(index) {
1078
+
1079
+ let data = {
1080
+ f_process_id : this.show_data.f_process_id
1081
+ }
1082
+ this.show_data.onetomany[index].fields.forEach(item => {
1083
+ data[item.field] = item.value
1084
+ })
1085
+ let res = await this.$resetpost(
1086
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1087
+ data
1088
+ )
1089
+ this.$dispatch('breakControl', this.show_data)
1090
+ },
1091
+ async 'onetomanyupdate'(i, j) {
1092
+ let onetomany = this.show_data.onetomany[i]
1093
+ let data = onetomany.rows[j]
1094
+
1095
+ onetomany.fields.forEach(item => {
1096
+ data[item.field] = item.value
1097
+ })
1098
+ let res = await this.$resetpost(
1099
+ `rs/entity/${this.show_data.onetomany[i].tables[0]}`,
1100
+ data
1101
+ )
1102
+
1103
+ this.$dispatch('breakControl', this.show_data)
1104
+ },
1105
+ // 选择用户档案信息
1106
+ 'selectUserinfo'(row) {
1107
+ console.log("当前选择数据",row)
1108
+ if (this.selectdata.f_apply_type === '拆改装报建'){
1109
+ this.showLabels('用户编号')
1110
+ this.hideLabels('地址类型','区域','街道','小区','楼号','单元','楼层','门牌号')
1111
+ this.electiveLabels('地址类型','区域','街道','小区','楼号','单元','楼层','门牌号')
1112
+ this.show_data.f_address_type = '民用地址'
1113
+ this.show_data.f_pcd = row.f_pcd
1114
+ this.show_data.f_street = row.f_street
1115
+ this.show_data.f_residential_area = row.f_residential_area
1116
+ this.show_data.f_building = row.f_building
1117
+ this.show_data.f_unit = row.f_unit
1118
+ this.show_data.f_floor = row.f_floor
1119
+ this.show_data.f_room = row.f_room
1120
+ this.selectdata.flag = '旧用户'
1121
+ }
1122
+ this.setLabelValue('用户编号', row.f_userinfo_code)
1123
+ this.setLabelValue('用户名称', row.f_user_name)
1124
+ this.setLabelValue('用户电话', row.f_user_phone)
1125
+ this.setLabelValue('证件类型', row.f_credentials)
1126
+ this.setLabelValue('证件号码', row.f_idnumber)
1127
+ this.setLabelValue('地址', row.f_address)
1128
+
1129
+ this.selectdata.f_userinfo_id = row.f_userinfo_id
1130
+ this.selectdata.f_userinfo_code = row.f_userinfo_code
1131
+ console.log("当前选择数据",this.show_data)
1132
+ },
1133
+ async 'streetChange'(index) {
1134
+ if (isEmpty(this.show_data.f_street)) {
1135
+ return
1136
+ }
1137
+
1138
+ this.setLabelValue('小区', null)
1139
+
1140
+ let data = {
1141
+ tablename: 't_area',
1142
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
1143
+ }
1144
+ let http = new HttpResetClass()
1145
+ let res = await http.load(
1146
+ 'POST',
1147
+ `rs/sql/singleTable`,
1148
+ {data: data},
1149
+ {resolveMsg: null, rejectMsg: '小区!!!'}
1150
+ )
1151
+
1152
+ this.setLabelOptions('小区', res.data.map(item => {
1153
+ return {
1154
+ label: item.f_residential_area,
1155
+ value: item.f_residential_area
1156
+ }
1157
+ }))
1158
+ },
1159
+ // 区县失去焦点
1160
+ async 'pcdChange'(index) {
1161
+ if (isEmpty(this.show_data.f_pcd)) {
1162
+ return
1163
+ }
1164
+
1165
+ this.setLabelValue('街道', null)
1166
+ this.setLabelValue('小区', null)
1167
+
1168
+
1169
+ let data = {
1170
+ tablename: 't_street',
1171
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1172
+ }
1173
+ let f_address_type = this.getLableValue('地址类型')
1174
+
1175
+ if (f_address_type === '民用地址') {
1176
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
1177
+ }
1178
+
1179
+ let http = new HttpResetClass()
1180
+ let res = await http.load(
1181
+ 'POST',
1182
+ `rs/sql/singleTable`,
1183
+ {data: data},
1184
+ {resolveMsg: null, rejectMsg: '街道查询失败!!!'}
1185
+ )
1186
+
1187
+ this.setLabelOptions('街道', res.data.map(item => {
1188
+ return {
1189
+ label: item.f_street,
1190
+ value: item.f_street
1191
+ }
1192
+ }))
1193
+ },
1194
+ 'buttonChange' (index) {
1195
+ if (this.show_data.fields[index].value === '否') {
1196
+ console.log("测试")
1197
+ this.hideButtons('下发','提交')
1198
+ this.showButtons('退回','终止')
1199
+ } else {
1200
+ this.hideButtons('退回','终止')
1201
+ this.showButtons('下发','提交')
1202
+ }
1203
+ },
1204
+ async 'stopApply'() {
1205
+ this.stope_view = true
1206
+ this.showview = false
1207
+ },
1208
+ async 'signUserInfo' (index) {
1209
+ if (this.show_data.fields[index].value === '是') {
1210
+ console.log("测试")
1211
+ this.showLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
1212
+ this.requiredLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '门牌号', '地址')
1213
+ } else {
1214
+ this.hideLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
1215
+ this.electiveLabels("用户名称", "用户电话", "证件类型", "证件号码", '地址类型', '区域', '街道', '小区', '楼号', '单元', '楼层', '门牌号', '地址')
1216
+ }
1217
+ },
1218
+ // onetomany模态框监听事件
1219
+ async 'onchange_modal'(index, i) {
1220
+ },
1221
+ async 'oninput_modal'(index, i) {
1222
+ }
1223
+ },
1224
+ watch: {
1225
+ }
1226
+ }
1227
+ </script>
1228
+ <style scoped>
1229
+ /*清除model中的浮动*/
1230
+ .clearfix:after,.clearfix:before{
1231
+ display: table;
1232
+ }
1233
+ .clearfix:after{
1234
+ clear: both;
1235
+ }
1236
+ </style>