apply-clients 3.4.2 → 3.4.4

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 (130) hide show
  1. package/android.html +23 -23
  2. package/build/dev-server.js +119 -119
  3. package/build/webpack.base.conf.js +2 -1
  4. package/build/webpack.dev.conf.js +12 -0
  5. package/dingding.html +23 -0
  6. package/index.html +33 -33
  7. package/package.json +2 -1
  8. package/src/AndroidApp.vue +35 -35
  9. package/src/DingDingApp.vue +51 -0
  10. package/src/android.js +21 -21
  11. package/src/apply.js +38 -13
  12. package/src/applyAndroid.js +46 -32
  13. package/src/applyDingDing.js +12 -0
  14. package/src/components/android/AppOnetomany.vue +343 -301
  15. package/src/components/android/AppServiceView.vue +189 -10
  16. package/src/components/android/AppSign.vue +19 -7
  17. package/src/components/android/AppTakePic.vue +143 -143
  18. package/src/components/android/AreaSelect/AppQrcodeReader.vue +73 -0
  19. package/src/components/android/AreaSelect/AppResAreaMapGroup.vue +148 -0
  20. package/src/components/android/AreaSelect/AppResAreaSelect.vue +108 -0
  21. package/src/components/android/AreaSelect/AppResAreaSelectGroup.vue +142 -0
  22. package/src/components/android/Function/AppFunctionServiceControl.vue +344 -0
  23. package/src/components/android/Function/AppInstallFunction.vue +366 -0
  24. package/src/components/android/Process/AppExplorationUser.vue +500 -320
  25. package/src/components/android/Process/AppServiceControl.vue +999 -48
  26. package/src/components/android/Process/Processes/AppAddMaterialScience.vue +477 -0
  27. package/src/components/android/Process/Processes/AppBuildSign.vue +46 -0
  28. package/src/components/android/Process/Processes/AppChargeManagement.vue +637 -0
  29. package/src/components/android/Process/Processes/AppDevicesManagement.vue +519 -0
  30. package/src/components/android/Process/Processes/AppInstallationDetails.vue +116 -90
  31. package/src/components/android/Process/Processes/AppSupplementalAgreement.vue +298 -0
  32. package/src/components/android/Process/Processes/selectApply.vue +250 -0
  33. package/src/components/android/Process/Processes/selectUserinfo.vue +182 -0
  34. package/src/components/android/ProgressReport/ProgressReportDetail.vue +64 -64
  35. package/src/components/android/Supervisory/AppProcessSupervisory.vue +205 -71
  36. package/src/components/android/Supervisory/AppSupervisoryCart.vue +69 -34
  37. package/src/components/android/TaskGraph.vue +125 -125
  38. package/src/components/common/TabButton.vue +149 -0
  39. package/src/components/common/Tabs.vue +67 -0
  40. package/src/components/image/dwg.jpg +0 -0
  41. package/src/components/image/txt.jpg +0 -0
  42. package/src/components/image//345/221/250/345/217/243/346/224/266/346/254/276/344/270/223/347/224/250/347/253/240.png +0 -0
  43. package/src/components/image//350/245/277/345/215/216/346/224/266/346/254/276/344/270/223/347/224/250/347/253/240.png +0 -0
  44. package/src/components/image//351/203/270/345/237/216/346/224/266/346/254/276/344/270/223/347/224/250/347/253/240.png +0 -0
  45. package/src/components/image//351/241/271/345/237/216/346/224/266/346/254/276/344/270/223/347/224/250/347/253/240.png +0 -0
  46. package/src/components/image//351/271/277/351/202/221/346/224/266/346/254/276/344/270/223/347/224/250/347/253/240.png +0 -0
  47. package/src/components/product/ApplyCharge/ApplyChargeList.vue +272 -53
  48. package/src/components/product/ApplyCharge/ApplyChargeSearch.vue +3 -3
  49. package/src/components/product/AreaSelect/MyAreaSelect.vue +423 -0
  50. package/src/components/product/AreaSelect/ResAreaSelect.vue +106 -0
  51. package/src/components/product/AreaSelect/ResAreaSelectGroup.vue +150 -0
  52. package/src/components/product/AreaSelect/utils/EventListener.js +29 -0
  53. package/src/components/product/AreaSelect/utils/coerceBoolean.js +7 -0
  54. package/src/components/product/Business/BusinessApply.vue +269 -0
  55. package/src/components/product/Business/CivilApply.vue +269 -0
  56. package/src/components/product/Function/InstallFunction.vue +132 -125
  57. package/src/components/product/Function/InstallInfoSelect.vue +320 -292
  58. package/src/components/product/Function/Service/FunctionServiceControl.vue +445 -222
  59. package/src/components/product/GaoDeMapComponents/GaoDeMap.vue +231 -0
  60. package/src/components/product/GroupByApply/ApplyGroupByList.vue +253 -0
  61. package/src/components/product/GroupByApply/ApplyGroupByMain.vue +53 -0
  62. package/src/components/product/GroupByApply/ApplyGroupByPaper.vue +376 -0
  63. package/src/components/product/Install/InstallProject.vue +194 -0
  64. package/src/components/product/Material/MaterialDetailed.vue +262 -0
  65. package/src/components/product/OldApply/Handle/HandleApply.vue +337 -0
  66. package/src/components/product/OldApply/Monitor/MonitorApply.vue +360 -0
  67. package/src/components/product/OldApply/OldApply.vue +209 -0
  68. package/src/components/product/OldApply/OldApplyMessage.vue +420 -0
  69. package/src/components/product/Onetomany.vue +406 -377
  70. package/src/components/product/Print/BuildOrder/buildOrderList.vue +339 -0
  71. package/src/components/product/Print/BuildOrder/printBuildOrder.vue +157 -0
  72. package/src/components/product/Print/IgnitionBill/IgnitionBill.vue +259 -0
  73. package/src/components/product/Print/IgnitionBill/printIgnitionBill.vue +168 -0
  74. package/src/components/product/Process/ExplorationSelect.vue +495 -410
  75. package/src/components/product/Process/ExplorationUser.vue +189 -138
  76. package/src/components/product/Process/Processes/InstallationDetails.vue +25 -7
  77. package/src/components/product/Process/Processes/Print/printCharge.vue +41 -17
  78. package/src/components/product/Process/Processes/Print/printChargepc.vue +142 -0
  79. package/src/components/product/Process/Processes/Print/printRefund.vue +196 -0
  80. package/src/components/product/Process/Processes/addMaterialScience.vue +454 -0
  81. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +211 -207
  82. package/src/components/product/Process/Processes/chargeManagement.vue +20 -3
  83. package/src/components/product/Process/Processes/devicesManagement.vue +484 -478
  84. package/src/components/product/Process/Processes/selectApply.vue +2 -2
  85. package/src/components/product/Process/Service/ServiceControl.vue +638 -20
  86. package/src/components/product/Process/Service/ShowBackReason.vue +33 -33
  87. package/src/components/product/Process/ShowBackReason.vue +33 -0
  88. package/src/components/product/ServiceView.vue +357 -7
  89. package/src/components/product/Stop/StopApply.vue +101 -103
  90. package/src/components/product/Stop/StopApplyList.vue +271 -269
  91. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +884 -186
  92. package/src/components/product/Supervisory/SupervisoryControl.vue +137 -100
  93. package/src/components/product/Supervisory/SupervisoryList.vue +201 -30
  94. package/src/components/product/Supervisory/SupervisoryhCart.vue +130 -107
  95. package/src/components/product/VueUtils/ApplyUpload.vue +275 -273
  96. package/src/components/product/VueUtils/GaoPaiYi/HighMeter.vue +1090 -0
  97. package/src/components/product/VueUtils/HighMeter.vue +208 -208
  98. package/src/components/product/VueUtils/ToolsPage.vue +51 -0
  99. package/src/components/product/VueUtils/Tree.vue +330 -0
  100. package/src/dingding.js +19 -0
  101. package/src/expandcssAndroid.less +517 -1034
  102. package/src/filiale/yuchuan/android/Process/AppServiceControl.vue +735 -731
  103. package/src/filiale/yuchuan/android/Process/Processes/AppInstallationDetails.vue +824 -824
  104. package/src/filiale/yuchuan/android/Process/Processes/AppInstallationDetailsCivil.vue +650 -650
  105. package/src/filiale/yuchuan/android/Sign/AppSignTask.vue +182 -182
  106. package/src/filiale/yuchuan/android/Sign/BuildSign.vue +50 -50
  107. package/src/filiale/yuchuan/android/Sign/ConstructSign.vue +50 -50
  108. package/src/filiale/yuchuan/android/Sign/DesignSign.vue +50 -50
  109. package/src/filiale/yuchuan/android/Sign/SupervisorSign.vue +50 -50
  110. package/src/filiale/yuchuan/android/Task/Build/BuildTsak.vue +60 -60
  111. package/src/filiale/yuchuan/android/Task/Survey/SurveyTsak.vue +60 -60
  112. package/src/filiale/yuchuan/android.js +14 -14
  113. package/src/filiale/yuchuan/pc/Order/OrderApply.vue +528 -528
  114. package/src/filiale/yuchuan/pc/Order/OrderApplyList.vue +343 -343
  115. package/src/filiale/yuchuan/pc/Print/BuildOrder/buildOrderList.vue +264 -0
  116. package/src/filiale/yuchuan/pc/Print/BuildOrder/printBuildOrder.vue +152 -0
  117. package/src/filiale/yuchuan/pc/Process/ExplorationUser.vue +149 -149
  118. package/src/filiale/yuchuan/pc/Process/Processes/ApplyMapCom.vue +67 -67
  119. package/src/filiale/yuchuan/pc/Process/Processes/InstallationDetails.vue +809 -809
  120. package/src/filiale/yuchuan/pc/Process/Processes/InstallationDetailsCivil.vue +595 -595
  121. package/src/filiale/yuchuan/pc/Process/Processes/Print/printCharge.vue +125 -0
  122. package/src/filiale/yuchuan/pc/Process/Processes/chargeManagement.vue +621 -470
  123. package/src/filiale/yuchuan/pc/Process/Service/ServiceControl.vue +1108 -1074
  124. package/src/filiale/yuchuan/pc/Sign/SignRecord.vue +24 -0
  125. package/src/filiale/yuchuan/pc/Sign/SignRecordList.vue +174 -0
  126. package/src/filiale/yuchuan/pc.js +20 -12
  127. package/src/main.js +4 -1
  128. package/src/components/product/Function/StopApplyCrrdList.vue +0 -176
  129. package/src/components/product/Function/functions/ApplyRecordCancel.vue +0 -102
  130. package/src/components/product/Function/functions/StopInstall.vue +0 -106
@@ -1,1074 +1,1108 @@
1
- <template>
2
- <div class="" v-if="showview">
3
- <show-back-reason :selectdata="show_data"></show-back-reason>
4
- <service-view v-ref:serviceview :data="show_data"></service-view>
5
- </div>
6
- </template>
7
- <script>
8
- import Vue from 'vue'
9
- import {HttpResetClass} from 'vue-client'
10
- import {isEmpty} from '../../../../../components/Util'
11
-
12
- // Date格式化
13
- Date.prototype.Format = function (fmt) {
14
- var o = {
15
- "M+": this.getMonth() + 1, //月份
16
- "d+": this.getDate(), //日
17
- "H+": this.getHours(), //小时
18
- "m+": this.getMinutes(), //分
19
- "s+": this.getSeconds(), //秒
20
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
21
- "S": this.getMilliseconds() //毫秒
22
- };
23
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
24
- for (var k in o)
25
- if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
26
- return fmt;
27
- }
28
-
29
- export default {
30
- title: '报建流程业务控制层',
31
- props: ['selectdata'],
32
- data () {
33
- return {
34
- data: null, // 数据库数据,json配置文件数据的数据集合
35
- json_datas: null, // Json配置文件集合
36
- showview: false, // 控制显示service-view组件
37
- show_data: null, // 给view层显示的数据
38
- config: {}
39
- }
40
- },
41
- ready () {
42
- this.refurbish()
43
- },
44
- methods: {
45
- // 组件初始化操作
46
- async refurbish() {
47
- this.json_datas = this.$workflow_vue
48
- let sum = 0
49
- let jsonData = {}
50
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
51
- this.$showMessage("网络故障,请刷新页面")
52
- return
53
- }
54
- this.json_datas.activitys.forEach(item => {
55
- if (this.selectdata.defname === item.title) {
56
- jsonData = item // 拿到当前节点的json配置信息
57
- sum++ // 节点名一样的个数
58
- }
59
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
60
- })
61
-
62
- if (sum === 0) {
63
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
64
- return
65
- }
66
- if (sum > 1) {
67
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
68
- return
69
- }
70
-
71
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
72
-
73
- // fields 字段填充值
74
- for (const item of this.selectdata.fields) {
75
- if (!item.value) {
76
- item.value = null
77
- }
78
-
79
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
80
- if (item.eval) {
81
- item.value = eval(item.default)
82
- } else {
83
- item.value = item.default
84
- }
85
- }
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
- } else {
92
- item.value = this.selectdata[item.field]
93
- }
94
- }
95
- if (this.selectdata[item.field] === 0) {
96
- item.value = 0
97
- }
98
-
99
- // datepicker
100
- if (item.type === 'datepicker' && !item.value && item.default) {
101
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
102
- }
103
-
104
- // 如果配置类型为select,优先从参数列表获取options
105
- if (item.type === 'select' || item.type === 'checkbox') {
106
- if (item.param) {
107
- let temp = this.$appdata.getParam(item.label)
108
-
109
- if (temp && temp.length > 0) {
110
- item.options = temp
111
- }
112
-
113
- if (item.paramLabel) {
114
- temp = this.$appdata.getParam(item.paramLabel)
115
- if (temp && temp.length > 0) {
116
- item.options = temp
117
- }
118
- }
119
- }
120
- if (item.ready) {
121
- item.options = await this[item.ready]()
122
- }
123
- }
124
-
125
-
126
- if (item.type === 'checkbox') {
127
- if (this.selectdata[item.field]) {
128
- item.value = JSON.parse(this.selectdata[item.field])
129
- } else {
130
- item.value = []
131
- }
132
- }
133
-
134
- this.selectdata[item.field] = item.value
135
- }
136
-
137
- // 控制组件
138
- if (this.selectdata.components) {
139
- this.selectdata.components.forEach(item => {
140
- if (!item.mark) {
141
- item.mark = 0
142
- }
143
- })
144
- }
145
-
146
- // 初始化onetomany
147
- if (this.selectdata.onetomany) {
148
- for (const item of this.selectdata.onetomany) {
149
- let res = null
150
- if (item.queryEvent) {
151
- res = this[item.queryEvent]()
152
- } else {
153
- let data = {
154
- tablename: item.tables[0],
155
- condition: `f_process_id='${this.selectdata.f_process_id}'`
156
- }
157
- res = await this.$resetpost(
158
- 'rs/sql/singleTable',
159
- {data: data},
160
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
161
- )
162
- }
163
-
164
- item.rows = res.data
165
-
166
- // 初始化onetomany中的fields
167
- for (const field of item.fields) {
168
- if (!field.value) {
169
- if (field.value !== 0) {
170
- field.value = null
171
- }
172
- }
173
-
174
- if (field.default || field.default === 0) {
175
- field.value = field.default
176
- }
177
-
178
- // datepicker
179
- if (field.type === 'datepicker' && !field.value && field.default) {
180
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
181
- }
182
-
183
- if (field.type === 'select') {
184
-
185
- let temp = this.$appdata.getParam(field.label)
186
-
187
- if (temp && temp.length > 0) {
188
- field.options = temp
189
- }
190
-
191
- if (field.paramLabel) {
192
- temp = this.$appdata.getParam(field.paramLabel)
193
- if (temp && temp.length > 0) {
194
- item.options = temp
195
- }
196
- }
197
- }
198
- }
199
- }
200
- }
201
-
202
- // 初始化 buttons_fields
203
- for (const item of this.selectdata.buttons) {
204
- if (item.button_name === '下发') {
205
-
206
- let data = {
207
- source: item.source,
208
- userid: this.$login.f.id
209
- }
210
- if (item.sourceMethod) {
211
- data.source = this[item.sourceMethod]()
212
- }
213
- if (!data.source) {
214
- this.$showMessage("请配置获取人员表达式")
215
- return
216
- }
217
-
218
- let res = await this.$resetpost(
219
- 'rs/search',
220
- {data: data},
221
- {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
222
- )
223
-
224
- let options = res.data.map(source => {
225
- return {
226
- "label": source.name,
227
- "value": source.id
228
- }
229
- })
230
-
231
- if (item.button_fields.length !== 1) {
232
- this.$showMessage("下发有且只能有一个字段!!!")
233
- return
234
- }
235
-
236
- item.button_fields[0].options = options
237
- }
238
- if (item.button_fields) {
239
- item.button_fields.forEach(x => {
240
- // 如果配置类型为select,优先从参数列表获取options
241
- if (x.type === 'select') {
242
-
243
- if (x.param) {
244
- let temp = this.$appdata.getParam(x.label)
245
-
246
- if (temp && temp.length > 0) {
247
- x.options = temp
248
- }
249
-
250
- if (x.paramLabel) {
251
- temp = this.$appdata.getParam(x.paramLabel)
252
- if (temp && temp.length > 0) {
253
- x.options = temp
254
- }
255
- }
256
- }
257
-
258
- }
259
- })
260
- }
261
- }
262
-
263
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
264
- let temp = JSON.parse(JSON.stringify(this.selectdata))
265
-
266
- this.show_data = temp
267
- this.$nextTick(() => {
268
- this.showview = true
269
- })
270
- },
271
- // 金额转大写
272
- smalltoBIG(n) {
273
- let fraction = ['角', '分'];
274
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
275
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
276
- let head = n < 0 ? '欠' : '';
277
- n = Math.abs(n);
278
-
279
- let s = '';
280
-
281
- for (var i = 0; i < fraction.length; i++) {
282
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
283
- }
284
- s = s || '整';
285
- n = Math.floor(n);
286
-
287
- for (var i = 0; i < unit[0].length && n > 0; i++) {
288
- let p = '';
289
- for (var j = 0; j < unit[1].length && n > 0; j++) {
290
- p = digit[n % 10] + unit[1][j] + p;
291
- n = Math.floor(n / 10);
292
- }
293
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
294
- }
295
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
296
- },
297
- getLableValue(label) {
298
- for (const item of this.show_data.fields) {
299
- if (item.label === label && item.type !== 'number') {
300
- return item.value || ''
301
- }
302
- if (item.label === label && item.type === 'number') {
303
- return item.value || 0
304
- }
305
- }
306
- },
307
- getLableOptions(label) {
308
- for (const item of this.show_data.fields) {
309
- if (item.label === label) {
310
- return item.options
311
- }
312
- }
313
- },
314
- setLabelValue(label, value) {
315
- for (const item of this.show_data.fields) {
316
- if (item.label === label) {
317
- item.value = value
318
- this.show_data[item.field] = value
319
- }
320
- }
321
- },
322
- setLabelOptions(label, options) {
323
- for (const item of this.show_data.fields) {
324
- if (item.label === label) {
325
- item.options = options
326
- }
327
- }
328
- },
329
- showLabels(...labels) {
330
- for (const item of this.show_data.fields) {
331
- if (labels.includes(item.label)) {
332
- item.hidden = false
333
- }
334
- }
335
- },
336
- hideLabels(...labels) {
337
- for (const item of this.show_data.fields) {
338
- if (labels.includes(item.label)) {
339
- item.hidden = true
340
- }
341
- }
342
- },
343
- showButtons(...buttons) {
344
- for (const item of this.show_data.buttons) {
345
- if (buttons.includes(item.button_name)) {
346
- item.hidden = false
347
- }
348
- }
349
- },
350
- hideButtons(...buttons) {
351
- for (const item of this.show_data.buttons) {
352
- if (buttons.includes(item.button_name)) {
353
- item.hidden = true
354
- }
355
- }
356
- },
357
- requiredLabels(...labels) {
358
- for (const item of this.show_data.fields) {
359
- if (labels.includes(item.label)) {
360
- item.required = true
361
- }
362
- }
363
- },
364
- electiveLabels(...labels) {
365
- for (const item of this.show_data.fields) {
366
- if (labels.includes(item.label)) {
367
- item.required = false
368
- }
369
- }
370
- },
371
- readonlyLabels(...labels) {
372
- for (const item of this.show_data.fields) {
373
- if (labels.includes(item.label)) {
374
- item.readonly = true
375
- item.disabled = true
376
- }
377
- }
378
- },
379
- readwriteLabels(...labels) {
380
- for (const item of this.show_data.fields) {
381
- if (labels.includes(item.label)) {
382
- item.readonly = false
383
- item.disabled = false
384
- }
385
- }
386
- },
387
- disabledButtons(...buttons) {
388
- for (const item of this.show_data.buttons) {
389
- if (buttons.includes(item.button_name)) {
390
- item.disabled = true
391
- }
392
- }
393
- },
394
- enableButtons(...buttons) {
395
- for (const item of this.show_data.buttons) {
396
- if (buttons.includes(item.button_name)) {
397
- item.disabled = false
398
- }
399
- }
400
- },
401
- async checkDuplicate(index) {
402
- let http = new HttpResetClass()
403
- let data = {
404
- tablename: 't_apply',
405
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
406
- }
407
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
408
- resolveMsg: null,
409
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
410
- })
411
- if (res.data.length > 0) {
412
- this.show_data.fields[index].value = null
413
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
414
- }
415
- },
416
- // 获取片区
417
- async getSliceArea () {
418
- let data = {
419
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
420
- userid: this.$login.f.id
421
- }
422
-
423
- let http = new HttpResetClass()
424
- let res = await http.load(
425
- 'POST',
426
- `rs/search`,
427
- {data: data},
428
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
429
- )
430
-
431
- return res.data.map(item => {
432
- return {
433
- label: item.name,
434
- value: item.name
435
- }
436
- })
437
- },
438
- // 获取区县
439
- async getPcd () {
440
- let data = {
441
- tablename: 't_pcd',
442
- condition: `f_filialeid = '${this.$login.f.orgid}'`
443
- }
444
- let http = new HttpResetClass()
445
- let res = await http.load(
446
- 'POST',
447
- `rs/sql/singleTable`,
448
- {data: data},
449
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
450
- )
451
-
452
- return res.data.map(item => {
453
- return {
454
- label: item.f_pcd,
455
- value: item.f_pcd
456
- }
457
- })
458
- },
459
- // 缴费前置
460
- chargeBefore () {
461
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
462
- this.$showAlert('费用未结清!!!', 'warning', 3000)
463
- throw null
464
- }
465
- },
466
- // 施工前置
467
- async constructionBefore () {
468
- let http = new HttpResetClass()
469
- let data = {
470
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
471
- }
472
- let res = await http.load(
473
- 'POST',
474
- 'rs/sql/countApplyUserinfo',
475
- {data: data},
476
- {
477
- resolveMsg: null,
478
- rejectMsg: '安装明细查询失败!!!'
479
- })
480
- if (res.data[0].num > 0) {
481
- this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
482
- throw `还有${res.data[0].num}户未安装,无法提交`
483
- }
484
- },
485
- async getPrice (f_price_id) {
486
- console.log('=======================')
487
- console.log(f_price_id)
488
-
489
- let data = {
490
- condition: `sp.f_orgid = '${this.$login.f.orgid}'`
491
- }
492
-
493
- if (!isEmpty(f_price_id)) {
494
- data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
495
- }
496
- let http = new HttpResetClass()
497
- let res = await http.load(
498
- 'POST',
499
- `rs/sql/applyGetPrice`,
500
- {data: data},
501
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
502
- )
503
-
504
- return res.data.map(item => {
505
- return {
506
- label: item.f_price_name,
507
- value: item
508
- }
509
- })
510
- },
511
- addressInitialization () {
512
- this.$getConfig(this, 'UserAddress')
513
-
514
- let f_address_type = this.show_data.f_address_type
515
-
516
- for (const item of this.show_data.fields) {
517
- if (f_address_type === '民用市区') {
518
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
519
- item.hidden = false
520
- item.required = true
521
- }
522
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
523
- item.hidden = false
524
- item.required = false
525
- }
526
- if (item.label === '地址') {
527
- item.readonly = true
528
- }
529
- }
530
- if (f_address_type === '民用乡镇') {
531
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
532
- item.hidden = false
533
- item.required = true
534
- }
535
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
536
- item.hidden = false
537
- item.required = false
538
- }
539
- if (item.label === '楼层') {
540
- item.hidden = true
541
- item.required = false
542
- }
543
- if (item.label === '地址') {
544
- item.readonly = true
545
- }
546
- }
547
- if (f_address_type === '特殊地址') {
548
- if (item.label === '区/县' || item.label === '街道/乡镇') {
549
- item.hidden = false
550
- item.required = true
551
- }
552
- if (item.label === '集收单位') {
553
- item.hidden = false
554
- item.required = false
555
- }
556
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
557
- item.hidden = true
558
- item.required = false
559
- }
560
- if (item.label === '地址') {
561
- item.readonly = false
562
- }
563
- }
564
-
565
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
566
- item.hidden = true
567
- }
568
- }
569
- },
570
- async streetChange () {
571
- if (isEmpty(this.show_data.f_street)) {
572
- return
573
- }
574
-
575
- let data = {
576
- tablename: 't_area',
577
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
578
- }
579
- let http = new HttpResetClass()
580
- let res = await http.load(
581
- 'POST',
582
- `rs/sql/singleTable`,
583
- {data: data},
584
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
585
- )
586
-
587
- this.setLabelOptions('集收单位', res.data.map(item => {
588
- return {
589
- label: item.f_residential_area,
590
- value: item.f_residential_area
591
- }
592
- }))
593
- },
594
- async pcdChange () {
595
- if (isEmpty(this.show_data.f_pcd)) {
596
- return
597
- }
598
-
599
- let data = {
600
- tablename: 't_street',
601
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
602
- }
603
- let f_address_type = this.getLableValue('地址类型')
604
-
605
- if (f_address_type === '民用市区') {
606
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
607
- }
608
- if (f_address_type === '民用乡镇') {
609
- data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
610
- }
611
-
612
- let http = new HttpResetClass()
613
- let res = await http.load(
614
- 'POST',
615
- `rs/sql/singleTable`,
616
- {data: data},
617
- {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
618
- )
619
-
620
- this.setLabelOptions('街道/乡镇', res.data.map(item => {
621
- return {
622
- label: item.f_street,
623
- value: item.f_street
624
- }
625
- }))
626
- },
627
- async getMeterBrand () {
628
- let data = {
629
- f_orgid: this.$login.f.orgid
630
- }
631
-
632
- let http = new HttpResetClass()
633
- let res = await http.load(
634
- 'POST',
635
- `rs/sql/getMeterBrand`,
636
- {data: data},
637
- {resolveMsg: null, rejectMsg: '气表品牌查询失败!!!'}
638
- )
639
-
640
- return res.data
641
- },
642
- async getDesignerPeople () {
643
- let data = {
644
- source: 'this.getParentByType($organization$).getChildByName($营业厅报装$).getChildren()',
645
- userid: this.$login.f.id
646
- }
647
-
648
- let res = await this.$resetpost(
649
- 'rs/search',
650
- {data: data},
651
- {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
652
- )
653
-
654
- return res.data.map(item => {
655
- return {
656
- label: item.name,
657
- value: item.id
658
- }
659
- })
660
- },
661
- async getConstructionUnit () {
662
- let data = {
663
- source: 'this.getParentByType($organization$).getChildByName($营业厅报装$).getChildren()',
664
- userid: this.$login.f.id
665
- }
666
-
667
- let res = await this.$resetpost(
668
- 'rs/search',
669
- {data: data},
670
- {resolveMsg: null, rejectMsg: '施工单位人员查询失败!!!'}
671
- )
672
-
673
- return res.data.map(item => {
674
- return {
675
- label: item.name,
676
- value: item.id
677
- }
678
- })
679
- },
680
- async getConstructOperator () {
681
- let data = {
682
- source: 'this.getParentByType($organization$).getChildByName($营业厅报装$).getChildren()',
683
- userid: this.$login.f.id
684
- }
685
-
686
- let res = await this.$resetpost(
687
- 'rs/search',
688
- {data: data},
689
- {resolveMsg: null, rejectMsg: '建设单位人员查询失败!!!'}
690
- )
691
-
692
- return res.data.map(item => {
693
- return {
694
- label: item.name,
695
- value: item.id
696
- }
697
- })
698
- },
699
- async getSupervisorOperator () {
700
- let data = {
701
- source: 'this.getParentByType($organization$).getChildByName($营业厅报装$).getChildren()',
702
- userid: this.$login.f.id
703
- }
704
-
705
- let res = await this.$resetpost(
706
- 'rs/search',
707
- {data: data},
708
- {resolveMsg: null, rejectMsg: '监理单位人员查询失败!!!'}
709
- )
710
-
711
- return res.data.map(item => {
712
- return {
713
- label: item.name,
714
- value: item.id
715
- }
716
- })
717
- }
718
- },
719
- events: {
720
- ventilateHouseholdsChange (index) {
721
- if (isEmpty(this.show_data.f_ventilate_households)) {
722
- return
723
- }
724
- if (Number(this.show_data.f_ventilate_households) < 0) {
725
- this.$showAlert('通气数不能小于0!!!', 'warning', 3000)
726
- this.setLabelValue('已通气户数', null)
727
- this.setLabelValue('已通气点数', null)
728
- return
729
- }
730
- if (Number(this.show_data.f_ventilate_households) > Number(this.show_data.f_install_count)) {
731
- this.$showAlert('通气数不能大于安装数!!!', 'warning', 3000)
732
- this.setLabelValue('已通气户数', null)
733
- this.setLabelValue('已通气点数', null)
734
- return
735
- }
736
- this.setLabelValue('未通气户数', Number(this.show_data.f_install_count) - Number(this.show_data.f_ventilate_households))
737
- this.setLabelValue('未通气点数', Number(this.show_data.f_install_count) - Number(this.show_data.f_ventilate_households))
738
- },
739
- async 'startSignActivity' () {
740
- this.hideButtons('签字')
741
- this.show_data.user = this.$login.f
742
-
743
- let res = await this.$resetpost(
744
- `rs/logic/startSignActivity`,
745
- {data: this.show_data},
746
- {resolveMsg: '签字流程已发起!!!', rejectMsg: '签字发起失败!!!'}
747
- )
748
-
749
- this.$dispatch('breakControl', this.show_data)
750
- },
751
- // 工程施工初始化
752
- async 'buildReadyEvent' () {
753
- if(this.getLableValue('是否发起签字') === '是') {
754
- this.hideButtons('签字')
755
- }
756
-
757
- let data = {
758
- f_process_id: this.show_data.f_process_id
759
- }
760
- let http = new HttpResetClass()
761
- let res = await http.load(
762
- 'POST',
763
- `rs/sql/getSingAct`,
764
- {data: data},
765
- {resolveMsg: null, rejectMsg: '签字状态查询失败!!!'}
766
- )
767
-
768
- if (res.data.length > 0) {
769
- this.setLabelValue('签字所在环节', res.data[0].defname)
770
- return
771
- }
772
- this.setLabelValue('签字所在环节', null)
773
-
774
- },
775
- async 'meterBrandChenge' (index) {
776
- if (isEmpty(this.show_data.f_meter_brand)) {
777
- return
778
- }
779
- this.setLabelValue('气表型号', null)
780
- let data = {
781
- f_meter_brand: this.show_data.f_meter_brand,
782
- f_orgid: this.$login.f.orgid
783
- }
784
- let http = new HttpResetClass()
785
- let res = await http.load(
786
- 'POST',
787
- `rs/sql/getGasModel`,
788
- {data: data},
789
- {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
790
- )
791
-
792
- this.setLabelOptions('气表型号', res.data)
793
- },
794
- // 单价失去焦点
795
- async 'priceChange' (index) {
796
- if (isEmpty(this.show_data.f_price)) {
797
- return
798
- }
799
- let data = {
800
- operator: '*',
801
- num1: this.show_data.f_price,
802
- num2: this.show_data.f_install_count
803
- }
804
- let http = new HttpResetClass()
805
- let res = await http.load(
806
- 'POST',
807
- `rs/logic/compute`,
808
- {data: data},
809
- {resolveMsg: null, rejectMsg: '工程材料费计算失败!!!'}
810
- )
811
-
812
- this.setLabelValue('工程材料费', res.data)
813
- },
814
- // 安装户数失去焦点
815
- 'installCountChange' (index) {
816
- if (isEmpty(this.show_data.f_install_count)) {
817
- return
818
- }
819
- if (Number(this.show_data.f_install_count) > Number(this.show_data.f_apply_count)) {
820
- this.$showAlert('安装数不能超过申请数!!!', 'warning', 3000)
821
- this.setLabelValue('安装户数', null)
822
- this.setLabelValue('安装点数', null)
823
- return
824
- }
825
-
826
- if (Number(this.show_data.f_install_count) <= 0) {
827
- this.$showAlert('至少有安装一个!!!', 'warning', 3000)
828
- this.setLabelValue('安装户数', null)
829
- this.setLabelValue('安装点数', null)
830
- return
831
- }
832
- },
833
- // 街道失去焦点
834
- async 'streetChange' (index) {
835
- if (isEmpty(this.show_data.f_street)) {
836
- return
837
- }
838
-
839
- let data = {
840
- tablename: 't_area',
841
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
842
- }
843
- let http = new HttpResetClass()
844
- let res = await http.load(
845
- 'POST',
846
- `rs/sql/singleTable`,
847
- {data: data},
848
- {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
849
- )
850
-
851
- this.setLabelOptions('小区', res.data.map(item => {
852
- return {
853
- label: item.f_residential_area,
854
- value: item.f_residential_area
855
- }
856
- }))
857
- },
858
- // 省市区失去焦点
859
- async 'pcdChange' (index) {
860
- if (isEmpty(this.show_data.f_pcd)) {
861
- return
862
- }
863
-
864
- let data = {
865
- tablename: 't_street',
866
- condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
867
- }
868
-
869
- let http = new HttpResetClass()
870
- let res = await http.load(
871
- 'POST',
872
- `rs/sql/singleTable`,
873
- {data: data},
874
- {resolveMsg: null, rejectMsg: '街道查询失败!!!'}
875
- )
876
-
877
- this.setLabelOptions('街道', res.data.map(item => {
878
- return {
879
- label: item.f_street,
880
- value: item.f_street
881
- }
882
- }))
883
- },
884
- // 报建性质失去焦点
885
- 'applyNatureChange' (index) {
886
- // if (isEmpty(this.show_data.f_apply_nature)) {
887
- // return
888
- // }
889
- // if (this.show_data.f_apply_nature === '小区') {
890
- // this.showLabels('片区','省市区','街道','小区')
891
- // this.requiredLabels('片区','省市区','街道','小区')
892
- // } else {
893
- // this.hideLabels('片区','省市区','街道','小区')
894
- // this.electiveLabels('片区','省市区','街道','小区')
895
- // }
896
- },
897
- // ===========================================
898
- 'initializtionView' () {
899
- if (this.show_data.f_apply_type === '民用报建' && this.show_data.f_apply_nature === '小区') {
900
- this.showLabels('片区', '省市区', '街道', '小区')
901
- }
902
- if (this.show_data.f_apply_type === '民用报建' && this.show_data.f_apply_nature === '散户') {
903
- this.hideLabels('片区', '省市区', '街道', '小区')
904
- }
905
- },
906
- // 检查重复
907
- 'checkRepeat' (index) {
908
- this.checkDuplicate(index)
909
- },
910
- async 'button'() {
911
- if (this.show_data.button.before) {
912
- await this[this.show_data.button.before]()
913
- }
914
- // 点击重置按钮就重置数据
915
- if (this.show_data.button.button_name === '重置') {
916
- this.$dispatch('breakControl', this.selectdata)
917
- return
918
- }
919
-
920
- this.show_data.user = this.$login.f
921
- this.show_data.start_activity = this.$workflow_vue.start_activity
922
- this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
923
-
924
- let res = await this.$resetpost(
925
- `rs/logic/ApplyProductService`,
926
- {data: this.show_data},
927
- {resolveMsg: null, rejectMsg: '数据保存失败'}
928
- )
929
-
930
- if (this.show_data.button.after) {
931
- this[this.show_data.button.after]()
932
- }
933
- this.$dispatch('loadPage')
934
- },
935
- // 失去焦点出触发事件
936
- 'onchange' (index) {
937
- if (this.show_data.defname === '报建受理' && this.show_data.f_apply_type === '非民用报建') {
938
- if (
939
- this.show_data.fields[index].label === '省市区' ||
940
- this.show_data.fields[index].label === '街道' ||
941
- this.show_data.fields[index].label === '小区' ||
942
- this.show_data.fields[index].label === '楼号' ||
943
- this.show_data.fields[index].label === '单元' ||
944
- this.show_data.fields[index].label === '楼层' ||
945
- this.show_data.fields[index].label === '门牌号'
946
- ) {
947
-
948
- let f_pcd = this.getLableValue('省市区') || ''
949
- let f_street = this.getLableValue('街道') || ''
950
- let f_residential_area = this.getLableValue('小区') || ''
951
- let f_building = this.getLableValue('楼号') || ''
952
- let f_building_suffix = f_building ? this.config.f_building_suffix : ''
953
- let f_unit = this.getLableValue('单元') || ''
954
- let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
955
- let f_floor = this.getLableValue('楼层') || ''
956
- let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
957
- let f_room = this.getLableValue('门牌号') || ''
958
- let f_room_suffix = f_room ? this.config.f_room_suffix : ''
959
-
960
- let f_address = f_pcd + f_street + f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
961
- this.setLabelValue("地址", f_address)
962
- }
963
- }
964
- },
965
- selectSearch (val, index) {},
966
- 'onblur' (index) {},
967
- 'oninput' (index) {},
968
- async 'onchangeModal' (index, fieldIndex) {
969
- },
970
- async 'onblurModal' (index, fieldIndex) {
971
-
972
- },
973
- async 'oninputModal' (index, fieldIndex) {
974
-
975
- },
976
- async 'onetomanydelete' (index, rowIndex) {
977
-
978
- let http = new HttpResetClass()
979
-
980
- let res = await http.load(
981
- 'DELETE',
982
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
983
- null,
984
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
985
- )
986
-
987
- res = await this.$resetpost(
988
- 'rs/entity/t_apply',
989
- this.show_data
990
- )
991
-
992
- this.$dispatch('breakControl', this.show_data)
993
- },
994
- async 'onetomanyupdate' (index, rowIndex) {
995
- let data = this.show_data.onetomany[index].rows[rowIndex]
996
-
997
- this.show_data.onetomany[index].fields.forEach(item => {
998
- data[item.field] = item.value
999
- })
1000
- let res = await this.$resetpost(
1001
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1002
- data
1003
- )
1004
-
1005
- res = await this.$resetpost(
1006
- 'rs/entity/t_apply',
1007
- this.show_data
1008
- )
1009
-
1010
- this.$dispatch('breakControl', this.show_data)
1011
- },
1012
- async 'onetomanyadd' (index) {
1013
- let data = {
1014
- f_process_id : this.show_data.f_process_id,
1015
- f_operator_id: this.$login.f.id,
1016
- f_operator: this.$login.f.name,
1017
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1018
- f_orgid: this.$login.f.orgid,
1019
- f_orgname: this.$login.f.orgs
1020
- }
1021
- this.show_data.onetomany[index].fields.forEach(item => {
1022
- data[item.field] = item.value
1023
- })
1024
- let res = await this.$resetpost(
1025
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1026
- data
1027
- )
1028
-
1029
- res = await this.$resetpost(
1030
- 'rs/entity/t_apply',
1031
- this.show_data
1032
- )
1033
-
1034
- this.$dispatch('breakControl', this.show_data)
1035
- },
1036
- async 'importEvent' (index, table, configName, filepath) {
1037
- let data = {
1038
- selectdata: this.show_data,
1039
- table: table,
1040
- filepath: filepath,
1041
- configName: configName,
1042
- user: this.$login.f
1043
- }
1044
-
1045
- let res = await this.$resetpost(
1046
- `rs/logic/importEvent`,
1047
- data
1048
- )
1049
-
1050
- this.$dispatch('breakControl', this.show_data)
1051
- },
1052
- 'onbutchange' (index) {
1053
-
1054
- },
1055
- 'onbutblur' (index) {
1056
-
1057
- },
1058
- 'onbutinput' (index) {
1059
-
1060
- }
1061
- },
1062
- watch: {
1063
- }
1064
- }
1065
- </script>
1066
- <style scoped>
1067
- /*清除model中的浮动*/
1068
- .clearfix:after,.clearfix:before{
1069
- display: table;
1070
- }
1071
- .clearfix:after{
1072
- clear: both;
1073
- }
1074
- </style>
1
+ <template>
2
+ <div class="" v-if="showview">
3
+ <show-back-reason :selectdata="show_data"></show-back-reason>
4
+ <service-view v-ref:serviceview :data="show_data"></service-view>
5
+ </div>
6
+ </template>
7
+ <script>
8
+ import Vue from 'vue'
9
+ import {HttpResetClass} from 'vue-client'
10
+ import {isEmpty} from '../../../../../components/Util'
11
+
12
+ // Date格式化
13
+ Date.prototype.Format = function (fmt) {
14
+ var o = {
15
+ "M+": this.getMonth() + 1, //月份
16
+ "d+": this.getDate(), //日
17
+ "H+": this.getHours(), //小时
18
+ "m+": this.getMinutes(), //分
19
+ "s+": this.getSeconds(), //秒
20
+ "q+": Math.floor((this.getMonth() + 3) / 3), //季度
21
+ "S": this.getMilliseconds() //毫秒
22
+ };
23
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
24
+ for (var k in o)
25
+ if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
26
+ return fmt;
27
+ }
28
+
29
+ export default {
30
+ title: '报建流程业务控制层',
31
+ props: ['selectdata'],
32
+ data () {
33
+ return {
34
+ data: null, // 数据库数据,json配置文件数据的数据集合
35
+ json_datas: null, // Json配置文件集合
36
+ showview: false, // 控制显示service-view组件
37
+ show_data: null, // 给view层显示的数据
38
+ config: {}
39
+ }
40
+ },
41
+ ready () {
42
+ this.refurbish()
43
+ },
44
+ methods: {
45
+ // 组件初始化操作
46
+ async refurbish() {
47
+ this.json_datas = this.$workflow_vue
48
+ let sum = 0
49
+ let jsonData = {}
50
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
51
+ this.$showMessage("网络故障,请刷新页面")
52
+ return
53
+ }
54
+ this.json_datas.activitys.forEach(item => {
55
+ if (this.selectdata.defname === item.title) {
56
+ jsonData = item // 拿到当前节点的json配置信息
57
+ sum++ // 节点名一样的个数
58
+ }
59
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
60
+ })
61
+
62
+ if (sum === 0) {
63
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
64
+ return
65
+ }
66
+ if (sum > 1) {
67
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
68
+ return
69
+ }
70
+
71
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
72
+
73
+ // fields 字段填充值
74
+ for (const item of this.selectdata.fields) {
75
+ if (!item.value) {
76
+ item.value = null
77
+ }
78
+
79
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
80
+ if (item.eval) {
81
+ item.value = eval(item.default)
82
+ } else {
83
+ item.value = item.default
84
+ }
85
+ }
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
+ } else {
92
+ item.value = this.selectdata[item.field]
93
+ }
94
+ }
95
+ if (this.selectdata[item.field] === 0) {
96
+ item.value = 0
97
+ }
98
+
99
+ // datepicker
100
+ if (item.type === 'datepicker' && !item.value && item.default) {
101
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
102
+ }
103
+
104
+ // 如果配置类型为select,优先从参数列表获取options
105
+ if (item.type === 'select' || item.type === 'checkbox') {
106
+ if (item.param) {
107
+ let temp = this.$appdata.getParam(item.label)
108
+
109
+ if (temp && temp.length > 0) {
110
+ item.options = temp
111
+ }
112
+
113
+ if (item.paramLabel) {
114
+ temp = this.$appdata.getParam(item.paramLabel)
115
+ if (temp && temp.length > 0) {
116
+ item.options = temp
117
+ }
118
+ }
119
+ }
120
+ if (item.ready) {
121
+ item.options = await this[item.ready]()
122
+ }
123
+ }
124
+
125
+
126
+ if (item.type === 'checkbox') {
127
+ if (this.selectdata[item.field]) {
128
+ item.value = JSON.parse(this.selectdata[item.field])
129
+ } else {
130
+ item.value = []
131
+ }
132
+ }
133
+
134
+ this.selectdata[item.field] = item.value
135
+ }
136
+
137
+ // 控制组件
138
+ if (this.selectdata.components) {
139
+ this.selectdata.components.forEach(item => {
140
+ if (!item.mark) {
141
+ item.mark = 0
142
+ }
143
+ })
144
+ }
145
+
146
+ // 初始化onetomany
147
+ if (this.selectdata.onetomany) {
148
+ for (const item of this.selectdata.onetomany) {
149
+ let res = null
150
+ if (item.queryEvent) {
151
+ res = this[item.queryEvent]()
152
+ } else {
153
+ let data = {
154
+ tablename: item.tables[0],
155
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
156
+ }
157
+ res = await this.$resetpost(
158
+ 'rs/sql/singleTable',
159
+ {data: data},
160
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
161
+ )
162
+ }
163
+
164
+ item.rows = res.data
165
+
166
+ // 初始化onetomany中的fields
167
+ for (const field of item.fields) {
168
+ if (!field.value) {
169
+ if (field.value !== 0) {
170
+ field.value = null
171
+ }
172
+ }
173
+
174
+ if (field.default || field.default === 0) {
175
+ field.value = field.default
176
+ }
177
+
178
+ // datepicker
179
+ if (field.type === 'datepicker' && !field.value && field.default) {
180
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
181
+ }
182
+
183
+ if (field.type === 'select') {
184
+
185
+ let temp = this.$appdata.getParam(field.label)
186
+
187
+ if (temp && temp.length > 0) {
188
+ field.options = temp
189
+ }
190
+
191
+ if (field.paramLabel) {
192
+ temp = this.$appdata.getParam(field.paramLabel)
193
+ if (temp && temp.length > 0) {
194
+ item.options = temp
195
+ }
196
+ }
197
+ }
198
+ }
199
+ }
200
+ }
201
+
202
+ // 初始化 buttons_fields
203
+ for (const item of this.selectdata.buttons) {
204
+ if (item.button_name === '下发') {
205
+
206
+ let data = {
207
+ source: item.source,
208
+ userid: this.$login.f.id
209
+ }
210
+ if (item.sourceMethod) {
211
+ data.source = this[item.sourceMethod]()
212
+ }
213
+ if (!data.source) {
214
+ this.$showMessage("请配置获取人员表达式")
215
+ return
216
+ }
217
+
218
+ let res = await this.$resetpost(
219
+ 'rs/search',
220
+ {data: data},
221
+ {resolveMsg: null, rejectMsg: '下发人员查询失败!!!'}
222
+ )
223
+
224
+ let options = res.data.map(source => {
225
+ return {
226
+ "label": source.name,
227
+ "value": source.id
228
+ }
229
+ })
230
+
231
+ if (item.button_fields.length !== 1) {
232
+ this.$showMessage("下发有且只能有一个字段!!!")
233
+ return
234
+ }
235
+
236
+ item.button_fields[0].options = options
237
+ }
238
+ if (item.button_fields) {
239
+ item.button_fields.forEach(x => {
240
+ // 如果配置类型为select,优先从参数列表获取options
241
+ if (x.type === 'select') {
242
+
243
+ if (x.param) {
244
+ let temp = this.$appdata.getParam(x.label)
245
+
246
+ if (temp && temp.length > 0) {
247
+ x.options = temp
248
+ }
249
+
250
+ if (x.paramLabel) {
251
+ temp = this.$appdata.getParam(x.paramLabel)
252
+ if (temp && temp.length > 0) {
253
+ x.options = temp
254
+ }
255
+ }
256
+ }
257
+
258
+ }
259
+ })
260
+ }
261
+ }
262
+
263
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
264
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
265
+
266
+ this.show_data = temp
267
+ this.$nextTick(() => {
268
+ this.showview = true
269
+ })
270
+ },
271
+ // 金额转大写
272
+ smalltoBIG(n) {
273
+ let fraction = ['角', '分'];
274
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
275
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
276
+ let head = n < 0 ? '欠' : '';
277
+ n = Math.abs(n);
278
+
279
+ let s = '';
280
+
281
+ for (var i = 0; i < fraction.length; i++) {
282
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
283
+ }
284
+ s = s || '整';
285
+ n = Math.floor(n);
286
+
287
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
288
+ let p = '';
289
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
290
+ p = digit[n % 10] + unit[1][j] + p;
291
+ n = Math.floor(n / 10);
292
+ }
293
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
294
+ }
295
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
296
+ },
297
+ getLableValue(label) {
298
+ for (const item of this.show_data.fields) {
299
+ if (item.label === label && item.type !== 'number') {
300
+ return item.value || ''
301
+ }
302
+ if (item.label === label && item.type === 'number') {
303
+ return item.value || 0
304
+ }
305
+ }
306
+ },
307
+ getLableOptions(label) {
308
+ for (const item of this.show_data.fields) {
309
+ if (item.label === label) {
310
+ return item.options
311
+ }
312
+ }
313
+ },
314
+ setLabelValue(label, value) {
315
+ for (const item of this.show_data.fields) {
316
+ if (item.label === label) {
317
+ item.value = value
318
+ this.show_data[item.field] = value
319
+ }
320
+ }
321
+ },
322
+ setLabelOptions(label, options) {
323
+ for (const item of this.show_data.fields) {
324
+ if (item.label === label) {
325
+ item.options = options
326
+ }
327
+ }
328
+ },
329
+ showLabels(...labels) {
330
+ for (const item of this.show_data.fields) {
331
+ if (labels.includes(item.label)) {
332
+ item.hidden = false
333
+ }
334
+ }
335
+ },
336
+ hideLabels(...labels) {
337
+ for (const item of this.show_data.fields) {
338
+ if (labels.includes(item.label)) {
339
+ item.hidden = true
340
+ }
341
+ }
342
+ },
343
+ showButtons(...buttons) {
344
+ for (const item of this.show_data.buttons) {
345
+ if (buttons.includes(item.button_name)) {
346
+ item.hidden = false
347
+ }
348
+ }
349
+ },
350
+ hideButtons(...buttons) {
351
+ for (const item of this.show_data.buttons) {
352
+ if (buttons.includes(item.button_name)) {
353
+ item.hidden = true
354
+ }
355
+ }
356
+ },
357
+ requiredLabels(...labels) {
358
+ for (const item of this.show_data.fields) {
359
+ if (labels.includes(item.label)) {
360
+ item.required = true
361
+ }
362
+ }
363
+ },
364
+ electiveLabels(...labels) {
365
+ for (const item of this.show_data.fields) {
366
+ if (labels.includes(item.label)) {
367
+ item.required = false
368
+ }
369
+ }
370
+ },
371
+ readonlyLabels(...labels) {
372
+ for (const item of this.show_data.fields) {
373
+ if (labels.includes(item.label)) {
374
+ item.readonly = true
375
+ item.disabled = true
376
+ }
377
+ }
378
+ },
379
+ readwriteLabels(...labels) {
380
+ for (const item of this.show_data.fields) {
381
+ if (labels.includes(item.label)) {
382
+ item.readonly = false
383
+ item.disabled = false
384
+ }
385
+ }
386
+ },
387
+ disabledButtons(...buttons) {
388
+ for (const item of this.show_data.buttons) {
389
+ if (buttons.includes(item.button_name)) {
390
+ item.disabled = true
391
+ }
392
+ }
393
+ },
394
+ enableButtons(...buttons) {
395
+ for (const item of this.show_data.buttons) {
396
+ if (buttons.includes(item.button_name)) {
397
+ item.disabled = false
398
+ }
399
+ }
400
+ },
401
+ async checkDuplicate(index) {
402
+ let http = new HttpResetClass()
403
+ let data = {
404
+ tablename: 't_apply',
405
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
406
+ }
407
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
408
+ resolveMsg: null,
409
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
410
+ })
411
+ if (res.data.length > 0) {
412
+ this.show_data.fields[index].value = null
413
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
414
+ }
415
+ },
416
+ // 获取片区
417
+ async getSliceArea () {
418
+ let data = {
419
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
420
+ userid: this.$login.f.id
421
+ }
422
+
423
+ let http = new HttpResetClass()
424
+ let res = await http.load(
425
+ 'POST',
426
+ `rs/search`,
427
+ {data: data},
428
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
429
+ )
430
+
431
+ return res.data.map(item => {
432
+ return {
433
+ label: item.name,
434
+ value: item.name
435
+ }
436
+ })
437
+ },
438
+ // 获取区县
439
+ async getPcd () {
440
+ let data = {
441
+ tablename: 't_pcd',
442
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
443
+ }
444
+ let http = new HttpResetClass()
445
+ let res = await http.load(
446
+ 'POST',
447
+ `rs/sql/singleTable`,
448
+ {data: data},
449
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
450
+ )
451
+
452
+ return res.data.map(item => {
453
+ return {
454
+ label: item.f_pcd,
455
+ value: item.f_pcd
456
+ }
457
+ })
458
+ },
459
+ // 缴费前置
460
+ chargeBefore () {
461
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
462
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
463
+ throw null
464
+ }
465
+ },
466
+ // 施工前置
467
+ async constructionBefore () {
468
+ let http = new HttpResetClass()
469
+ let data = {
470
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
471
+ }
472
+ let res = await http.load(
473
+ 'POST',
474
+ 'rs/sql/countApplyUserinfo',
475
+ {data: data},
476
+ {
477
+ resolveMsg: null,
478
+ rejectMsg: '安装明细查询失败!!!'
479
+ })
480
+ if (res.data[0].num > 0) {
481
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
482
+ throw `还有${res.data[0].num}户未安装,无法提交`
483
+ }
484
+ },
485
+ async getPrice (f_price_id) {
486
+ console.log('=======================')
487
+ console.log(f_price_id)
488
+
489
+ let data = {
490
+ condition: `sp.f_orgid = '${this.$login.f.orgid}'`
491
+ }
492
+
493
+ if (!isEmpty(f_price_id)) {
494
+ data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
495
+ }
496
+ let http = new HttpResetClass()
497
+ let res = await http.load(
498
+ 'POST',
499
+ `rs/sql/applyGetPrice`,
500
+ {data: data},
501
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
502
+ )
503
+
504
+ return res.data.map(item => {
505
+ return {
506
+ label: item.f_price_name,
507
+ value: item
508
+ }
509
+ })
510
+ },
511
+ addressInitialization () {
512
+ this.$getConfig(this, 'UserAddress')
513
+
514
+ let f_address_type = this.show_data.f_address_type
515
+
516
+ for (const item of this.show_data.fields) {
517
+ if (f_address_type === '民用市区') {
518
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
519
+ item.hidden = false
520
+ item.required = true
521
+ }
522
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
523
+ item.hidden = false
524
+ item.required = false
525
+ }
526
+ if (item.label === '地址') {
527
+ item.readonly = true
528
+ }
529
+ }
530
+ if (f_address_type === '民用乡镇') {
531
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
532
+ item.hidden = false
533
+ item.required = true
534
+ }
535
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
536
+ item.hidden = false
537
+ item.required = false
538
+ }
539
+ if (item.label === '楼层') {
540
+ item.hidden = true
541
+ item.required = false
542
+ }
543
+ if (item.label === '地址') {
544
+ item.readonly = true
545
+ }
546
+ }
547
+ if (f_address_type === '特殊地址') {
548
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
549
+ item.hidden = false
550
+ item.required = true
551
+ }
552
+ if (item.label === '集收单位') {
553
+ item.hidden = false
554
+ item.required = false
555
+ }
556
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
557
+ item.hidden = true
558
+ item.required = false
559
+ }
560
+ if (item.label === '地址') {
561
+ item.readonly = false
562
+ }
563
+ }
564
+
565
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
566
+ item.hidden = true
567
+ }
568
+ }
569
+ },
570
+ async streetChange () {
571
+ if (isEmpty(this.show_data.f_street)) {
572
+ return
573
+ }
574
+
575
+ let data = {
576
+ tablename: 't_area',
577
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
578
+ }
579
+ let http = new HttpResetClass()
580
+ let res = await http.load(
581
+ 'POST',
582
+ `rs/sql/singleTable`,
583
+ {data: data},
584
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
585
+ )
586
+
587
+ this.setLabelOptions('集收单位', res.data.map(item => {
588
+ return {
589
+ label: item.f_residential_area,
590
+ value: item.f_residential_area
591
+ }
592
+ }))
593
+ },
594
+ async pcdChange () {
595
+ if (isEmpty(this.show_data.f_pcd)) {
596
+ return
597
+ }
598
+
599
+ let data = {
600
+ tablename: 't_street',
601
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
602
+ }
603
+ let f_address_type = this.getLableValue('地址类型')
604
+
605
+ if (f_address_type === '民用市区') {
606
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '市区'`
607
+ }
608
+ if (f_address_type === '民用乡镇') {
609
+ data.condition = `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}' and f_iscity = '乡镇'`
610
+ }
611
+
612
+ let http = new HttpResetClass()
613
+ let res = await http.load(
614
+ 'POST',
615
+ `rs/sql/singleTable`,
616
+ {data: data},
617
+ {resolveMsg: null, rejectMsg: '街道/乡镇查询失败!!!'}
618
+ )
619
+
620
+ this.setLabelOptions('街道/乡镇', res.data.map(item => {
621
+ return {
622
+ label: item.f_street,
623
+ value: item.f_street
624
+ }
625
+ }))
626
+ },
627
+ async getMeterBrand () {
628
+ let data = {
629
+ f_orgid: this.$login.f.orgid
630
+ }
631
+
632
+ let http = new HttpResetClass()
633
+ let res = await http.load(
634
+ 'POST',
635
+ `rs/sql/getMeterBrand`,
636
+ {data: data},
637
+ {resolveMsg: null, rejectMsg: '气表品牌查询失败!!!'}
638
+ )
639
+
640
+ return res.data
641
+ },
642
+ async getDesignerPeople () {
643
+ let data = {
644
+ source: 'this.getParentByType($organization$).getChildByName($营业厅报装$).getChildren()',
645
+ userid: this.$login.f.id
646
+ }
647
+
648
+ let res = await this.$resetpost(
649
+ 'rs/search',
650
+ {data: data},
651
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
652
+ )
653
+
654
+ return res.data.map(item => {
655
+ return {
656
+ label: item.name,
657
+ value: item.id
658
+ }
659
+ })
660
+ },
661
+ async getConstructionUnit () {
662
+ let data = {
663
+ source: 'this.getParentByType($organization$).getChildByName($营业厅报装$).getChildren()',
664
+ userid: this.$login.f.id
665
+ }
666
+
667
+ let res = await this.$resetpost(
668
+ 'rs/search',
669
+ {data: data},
670
+ {resolveMsg: null, rejectMsg: '施工单位人员查询失败!!!'}
671
+ )
672
+
673
+ return res.data.map(item => {
674
+ return {
675
+ label: item.name,
676
+ value: item.id
677
+ }
678
+ })
679
+ },
680
+ async getConstructOperator () {
681
+ let data = {
682
+ source: 'this.getParentByType($organization$).getChildByName($营业厅报装$).getChildren()',
683
+ userid: this.$login.f.id
684
+ }
685
+
686
+ let res = await this.$resetpost(
687
+ 'rs/search',
688
+ {data: data},
689
+ {resolveMsg: null, rejectMsg: '建设单位人员查询失败!!!'}
690
+ )
691
+
692
+ return res.data.map(item => {
693
+ return {
694
+ label: item.name,
695
+ value: item.id
696
+ }
697
+ })
698
+ },
699
+ async getSupervisorOperator () {
700
+ let data = {
701
+ source: 'this.getParentByType($organization$).getChildByName($营业厅报装$).getChildren()',
702
+ userid: this.$login.f.id
703
+ }
704
+
705
+ let res = await this.$resetpost(
706
+ 'rs/search',
707
+ {data: data},
708
+ {resolveMsg: null, rejectMsg: '监理单位人员查询失败!!!'}
709
+ )
710
+
711
+ return res.data.map(item => {
712
+ return {
713
+ label: item.name,
714
+ value: item.id
715
+ }
716
+ })
717
+ },
718
+ async stopApply () {
719
+ console.log('终止报建!!!!!')
720
+
721
+ if (this.show_data.defname === '报建受理') {
722
+ this.show_data.f_stop_reason = this.show_data.f_accept_result
723
+ }
724
+ if (this.show_data.defname === '现场勘察') {
725
+ this.show_data.f_stop_reason = this.show_data.f_prospecting_result
726
+ }
727
+
728
+ let data = {
729
+ apply: this.show_data,
730
+ user: this.$login.f
731
+ }
732
+
733
+ let res = await this.$resetpost(
734
+ `rs/logic/stopApply`,
735
+ {data: data},
736
+ {resolveMsg: null, rejectMsg: '终止报建失败!!!'}
737
+ )
738
+
739
+ this.$dispatch('loadPage')
740
+
741
+ throw '终止报建!!!'
742
+ }
743
+ },
744
+ events: {
745
+ 'complyInstallation' (index) {
746
+ if (this.show_data.f_accept_install === '' || this.show_data.f_survey_opinion === '') {
747
+ this.hideButtons('下发','提交')
748
+ this.showButtons('终止')
749
+ } else {
750
+ this.hideButtons('终止')
751
+ this.showButtons('下发','提交')
752
+ }
753
+ },
754
+ 'ventilateHouseholdsChange' (index) {
755
+ if (isEmpty(this.show_data.f_ventilate_households)) {
756
+ return
757
+ }
758
+ if (Number(this.show_data.f_ventilate_households) < 0) {
759
+ this.$showAlert('通气数不能小于0!!!', 'warning', 3000)
760
+ this.setLabelValue('已通气户数', null)
761
+ this.setLabelValue('已通气点数', null)
762
+ return
763
+ }
764
+ if (Number(this.show_data.f_ventilate_households) > Number(this.show_data.f_install_count)) {
765
+ this.$showAlert('通气数不能大于安装数!!!', 'warning', 3000)
766
+ this.setLabelValue('已通气户数', null)
767
+ this.setLabelValue('已通气点数', null)
768
+ return
769
+ }
770
+ this.setLabelValue('未通气户数', Number(this.show_data.f_install_count) - Number(this.show_data.f_ventilate_households))
771
+ this.setLabelValue('未通气点数', Number(this.show_data.f_install_count) - Number(this.show_data.f_ventilate_households))
772
+ },
773
+ async 'startSignActivity' () {
774
+ this.hideButtons('签字')
775
+ this.show_data.user = this.$login.f
776
+
777
+ let res = await this.$resetpost(
778
+ `rs/logic/startSignActivity`,
779
+ {data: this.show_data},
780
+ {resolveMsg: '签字流程已发起!!!', rejectMsg: '签字发起失败!!!'}
781
+ )
782
+
783
+ this.$dispatch('breakControl', this.show_data)
784
+ },
785
+ // 工程施工初始化
786
+ async 'buildReadyEvent' () {
787
+ if(this.getLableValue('是否发起签字') === '是') {
788
+ this.hideButtons('签字')
789
+ }
790
+
791
+ let data = {
792
+ f_process_id: this.show_data.f_process_id
793
+ }
794
+ let http = new HttpResetClass()
795
+ let res = await http.load(
796
+ 'POST',
797
+ `rs/sql/getSingAct`,
798
+ {data: data},
799
+ {resolveMsg: null, rejectMsg: '签字状态查询失败!!!'}
800
+ )
801
+
802
+ if (res.data.length > 0) {
803
+ this.setLabelValue('签字所在环节', res.data[0].defname)
804
+ return
805
+ }
806
+ this.setLabelValue('签字所在环节', null)
807
+
808
+ },
809
+ async 'meterBrandChenge' (index) {
810
+ if (isEmpty(this.show_data.f_meter_brand)) {
811
+ return
812
+ }
813
+ this.setLabelValue('气表型号', null)
814
+ let data = {
815
+ f_meter_brand: this.show_data.f_meter_brand,
816
+ f_orgid: this.$login.f.orgid
817
+ }
818
+ let http = new HttpResetClass()
819
+ let res = await http.load(
820
+ 'POST',
821
+ `rs/sql/getGasModel`,
822
+ {data: data},
823
+ {resolveMsg: null, rejectMsg: '气表型号查询失败!!!'}
824
+ )
825
+
826
+ this.setLabelOptions('气表型号', res.data)
827
+ },
828
+ // 单价失去焦点
829
+ async 'priceChange' (index) {
830
+ if (isEmpty(this.show_data.f_price)) {
831
+ return
832
+ }
833
+ let data = {
834
+ operator: '*',
835
+ num1: this.show_data.f_price,
836
+ num2: this.show_data.f_install_count
837
+ }
838
+ let http = new HttpResetClass()
839
+ let res = await http.load(
840
+ 'POST',
841
+ `rs/logic/compute`,
842
+ {data: data},
843
+ {resolveMsg: null, rejectMsg: '工程材料费计算失败!!!'}
844
+ )
845
+
846
+ this.setLabelValue('工程材料费', res.data)
847
+ },
848
+ // 安装户数失去焦点
849
+ 'installCountChange' (index) {
850
+ if (isEmpty(this.show_data.f_install_count)) {
851
+ return
852
+ }
853
+ if (Number(this.show_data.f_install_count) > Number(this.show_data.f_apply_count)) {
854
+ this.$showAlert('安装数不能超过申请数!!!', 'warning', 3000)
855
+ this.setLabelValue('安装户数', null)
856
+ this.setLabelValue('安装点数', null)
857
+ return
858
+ }
859
+
860
+ if (Number(this.show_data.f_install_count) <= 0) {
861
+ this.$showAlert('至少有安装一个!!!', 'warning', 3000)
862
+ this.setLabelValue('安装户数', null)
863
+ this.setLabelValue('安装点数', null)
864
+ return
865
+ }
866
+ },
867
+ // 街道失去焦点
868
+ async 'streetChange' (index) {
869
+ if (isEmpty(this.show_data.f_street)) {
870
+ return
871
+ }
872
+
873
+ let data = {
874
+ tablename: 't_area',
875
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_street = '${this.show_data.f_street}'`
876
+ }
877
+ let http = new HttpResetClass()
878
+ let res = await http.load(
879
+ 'POST',
880
+ `rs/sql/singleTable`,
881
+ {data: data},
882
+ {resolveMsg: null, rejectMsg: '小区查询失败!!!'}
883
+ )
884
+
885
+ this.setLabelOptions('小区', res.data.map(item => {
886
+ return {
887
+ label: item.f_residential_area,
888
+ value: item.f_residential_area
889
+ }
890
+ }))
891
+ },
892
+ // 省市区失去焦点
893
+ async 'pcdChange' (index) {
894
+ if (isEmpty(this.show_data.f_pcd)) {
895
+ return
896
+ }
897
+
898
+ let data = {
899
+ tablename: 't_street',
900
+ condition: `f_filialeid = '${this.$login.f.orgid}' and f_pcd = '${this.show_data.f_pcd}'`
901
+ }
902
+
903
+ let http = new HttpResetClass()
904
+ let res = await http.load(
905
+ 'POST',
906
+ `rs/sql/singleTable`,
907
+ {data: data},
908
+ {resolveMsg: null, rejectMsg: '街道查询失败!!!'}
909
+ )
910
+
911
+ this.setLabelOptions('街道', res.data.map(item => {
912
+ return {
913
+ label: item.f_street,
914
+ value: item.f_street
915
+ }
916
+ }))
917
+ },
918
+ // 报建性质失去焦点
919
+ 'applyNatureChange' (index) {
920
+ // if (isEmpty(this.show_data.f_apply_nature)) {
921
+ // return
922
+ // }
923
+ // if (this.show_data.f_apply_nature === '小区') {
924
+ // this.showLabels('片区','省市区','街道','小区')
925
+ // this.requiredLabels('片区','省市区','街道','小区')
926
+ // } else {
927
+ // this.hideLabels('片区','省市区','街道','小区')
928
+ // this.electiveLabels('片区','省市区','街道','小区')
929
+ // }
930
+ },
931
+ // ===========================================
932
+ 'initializtionView' () {
933
+ if (this.show_data.f_apply_type === '民用报建' && this.show_data.f_apply_nature === '小区') {
934
+ this.showLabels('片区', '省市区', '街道', '小区')
935
+ }
936
+ if (this.show_data.f_apply_type === '民用报建' && this.show_data.f_apply_nature === '散户') {
937
+ this.hideLabels('片区', '省市区', '街道', '小区')
938
+ }
939
+ },
940
+ // 检查重复
941
+ 'checkRepeat' (index) {
942
+ this.checkDuplicate(index)
943
+ },
944
+ async 'button'() {
945
+ if (this.show_data.button.before) {
946
+ await this[this.show_data.button.before]()
947
+ }
948
+ // 点击重置按钮就重置数据
949
+ if (this.show_data.button.button_name === '重置') {
950
+ this.$dispatch('breakControl', this.selectdata)
951
+ return
952
+ }
953
+
954
+ this.show_data.user = this.$login.f
955
+ this.show_data.start_activity = this.$workflow_vue.start_activity
956
+ this.show_data.xmlfilename = this.$workflow_vue.workflow_xmlfilename
957
+
958
+ let res = await this.$resetpost(
959
+ `rs/logic/ApplyProductService`,
960
+ {data: this.show_data},
961
+ {resolveMsg: null, rejectMsg: '数据保存失败'}
962
+ )
963
+
964
+ if (this.show_data.button.after) {
965
+ this[this.show_data.button.after]()
966
+ }
967
+ this.$dispatch('loadPage')
968
+ },
969
+ // 失去焦点出触发事件
970
+ 'onchange' (index) {
971
+ if (this.show_data.defname === '报建受理' && this.show_data.f_apply_type === '非民用报建') {
972
+ if (
973
+ this.show_data.fields[index].label === '省市区' ||
974
+ this.show_data.fields[index].label === '街道' ||
975
+ this.show_data.fields[index].label === '小区' ||
976
+ this.show_data.fields[index].label === '楼号' ||
977
+ this.show_data.fields[index].label === '单元' ||
978
+ this.show_data.fields[index].label === '楼层' ||
979
+ this.show_data.fields[index].label === '门牌号'
980
+ ) {
981
+
982
+ let f_pcd = this.getLableValue('省市区') || ''
983
+ let f_street = this.getLableValue('街道') || ''
984
+ let f_residential_area = this.getLableValue('小区') || ''
985
+ let f_building = this.getLableValue('楼号') || ''
986
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
987
+ let f_unit = this.getLableValue('单元') || ''
988
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
989
+ let f_floor = this.getLableValue('楼层') || ''
990
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
991
+ let f_room = this.getLableValue('门牌号') || ''
992
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
993
+
994
+ let f_address = f_pcd + f_street + f_residential_area + f_building + f_building_suffix + f_unit + f_unit_suffix + f_floor + f_floor_suffix + f_room + f_room_suffix
995
+ this.setLabelValue("地址", f_address)
996
+ }
997
+ }
998
+ },
999
+ selectSearch (val, index) {},
1000
+ 'onblur' (index) {},
1001
+ 'oninput' (index) {},
1002
+ async 'onchangeModal' (index, fieldIndex) {
1003
+ },
1004
+ async 'onblurModal' (index, fieldIndex) {
1005
+
1006
+ },
1007
+ async 'oninputModal' (index, fieldIndex) {
1008
+
1009
+ },
1010
+ async 'onetomanydelete' (index, rowIndex) {
1011
+
1012
+ let http = new HttpResetClass()
1013
+
1014
+ let res = await http.load(
1015
+ 'DELETE',
1016
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
1017
+ null,
1018
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
1019
+ )
1020
+
1021
+ res = await this.$resetpost(
1022
+ 'rs/entity/t_apply',
1023
+ this.show_data
1024
+ )
1025
+
1026
+ this.$dispatch('breakControl', this.show_data)
1027
+ },
1028
+ async 'onetomanyupdate' (index, rowIndex) {
1029
+ let data = this.show_data.onetomany[index].rows[rowIndex]
1030
+
1031
+ this.show_data.onetomany[index].fields.forEach(item => {
1032
+ data[item.field] = item.value
1033
+ })
1034
+ let res = await this.$resetpost(
1035
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1036
+ data
1037
+ )
1038
+
1039
+ res = await this.$resetpost(
1040
+ 'rs/entity/t_apply',
1041
+ this.show_data
1042
+ )
1043
+
1044
+ this.$dispatch('breakControl', this.show_data)
1045
+ },
1046
+ async 'onetomanyadd' (index) {
1047
+ let data = {
1048
+ f_process_id : this.show_data.f_process_id,
1049
+ f_operator_id: this.$login.f.id,
1050
+ f_operator: this.$login.f.name,
1051
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
1052
+ f_orgid: this.$login.f.orgid,
1053
+ f_orgname: this.$login.f.orgs
1054
+ }
1055
+ this.show_data.onetomany[index].fields.forEach(item => {
1056
+ data[item.field] = item.value
1057
+ })
1058
+ let res = await this.$resetpost(
1059
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
1060
+ data
1061
+ )
1062
+
1063
+ res = await this.$resetpost(
1064
+ 'rs/entity/t_apply',
1065
+ this.show_data
1066
+ )
1067
+
1068
+ this.$dispatch('breakControl', this.show_data)
1069
+ },
1070
+ async 'importEvent' (index, table, configName, filepath) {
1071
+ let data = {
1072
+ selectdata: this.show_data,
1073
+ table: table,
1074
+ filepath: filepath,
1075
+ configName: configName,
1076
+ user: this.$login.f
1077
+ }
1078
+
1079
+ let res = await this.$resetpost(
1080
+ `rs/logic/importEvent`,
1081
+ data
1082
+ )
1083
+
1084
+ this.$dispatch('breakControl', this.show_data)
1085
+ },
1086
+ 'onbutchange' (index) {
1087
+
1088
+ },
1089
+ 'onbutblur' (index) {
1090
+
1091
+ },
1092
+ 'onbutinput' (index) {
1093
+
1094
+ }
1095
+ },
1096
+ watch: {
1097
+ }
1098
+ }
1099
+ </script>
1100
+ <style scoped>
1101
+ /*清除model中的浮动*/
1102
+ .clearfix:after,.clearfix:before{
1103
+ display: table;
1104
+ }
1105
+ .clearfix:after{
1106
+ clear: both;
1107
+ }
1108
+ </style>