apply-clients 3.4.64 → 3.4.66

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 (105) hide show
  1. package/build/dev-server.js +2 -2
  2. package/dist-android/static/18.js +2 -2
  3. package/dist-android/static/18.js.map +1 -1
  4. package/dist-android/static/19.js +2 -2
  5. package/dist-android/static/19.js.map +1 -1
  6. package/dist-android/static/24.js +2 -2
  7. package/dist-android/static/24.js.map +1 -1
  8. package/dist-android/static/25.js +2 -2
  9. package/dist-android/static/25.js.map +1 -1
  10. package/dist-android/static/26.js +2 -2
  11. package/dist-android/static/26.js.map +1 -1
  12. package/dist-android/static/28.js +2 -2
  13. package/dist-android/static/28.js.map +1 -1
  14. package/dist-android/static/30.js +2 -2
  15. package/dist-android/static/30.js.map +1 -1
  16. package/dist-android/static/34.js +2 -2
  17. package/dist-android/static/34.js.map +1 -1
  18. package/dist-android/static/43.js +2 -2
  19. package/dist-android/static/43.js.map +1 -1
  20. package/dist-android/static/47.js +2 -2
  21. package/dist-android/static/47.js.map +1 -1
  22. package/dist-android/static/50.js +2 -2
  23. package/dist-android/static/50.js.map +1 -1
  24. package/dist-android/static/52.js +2 -2
  25. package/dist-android/static/52.js.map +1 -1
  26. package/dist-android/static/53.js +2 -2
  27. package/dist-android/static/53.js.map +1 -1
  28. package/dist-android/static/54.js +2 -2
  29. package/dist-android/static/54.js.map +1 -1
  30. package/dist-android/static/60.js +2 -2
  31. package/dist-android/static/60.js.map +1 -1
  32. package/dist-android/static/63.js +2 -2
  33. package/dist-android/static/63.js.map +1 -1
  34. package/dist-android/static/64.js +2 -2
  35. package/dist-android/static/64.js.map +1 -1
  36. package/dist-android/static/78.js +2 -2
  37. package/dist-android/static/78.js.map +1 -1
  38. package/dist-android/static/83.js +2 -2
  39. package/dist-android/static/83.js.map +1 -1
  40. package/dist-android/static/84.js +2 -2
  41. package/dist-android/static/84.js.map +1 -1
  42. package/dist-android/static/86.js +2 -2
  43. package/dist-android/static/86.js.map +1 -1
  44. package/dist-android/static/87.js +2 -2
  45. package/dist-android/static/87.js.map +1 -1
  46. package/dist-android/static/89.js +2 -2
  47. package/dist-android/static/89.js.map +1 -1
  48. package/dist-android/static/97.js +2 -2
  49. package/dist-android/static/97.js.map +1 -1
  50. package/dist-android/static/app.js +80 -80
  51. package/dist-android/static/app.js.map +1 -1
  52. package/package.json +4 -3
  53. package/src/apply.js +5 -0
  54. package/src/applyAndroid.js +2 -0
  55. package/src/components/android/AppSign.vue +154 -154
  56. package/src/components/android/AppTakePic.vue +143 -143
  57. package/src/components/android/Function/AppFunctionServiceControl.vue +344 -344
  58. package/src/components/android/Ignition/VentilationIgnition.vue +408 -0
  59. package/src/components/android/Ignition/VentilationIgnitionHandle.vue +455 -0
  60. package/src/components/android/Process/AppServiceControl.vue +1708 -1708
  61. package/src/components/android/Process/Processes/AppAddMaterialScience.vue +477 -477
  62. package/src/components/android/Process/Processes/AppDevicesManagement.vue +519 -519
  63. package/src/components/android/Process/Processes/AppSupplementalAgreement.vue +298 -298
  64. package/src/components/android/Supervisory/AppSupervisoryCart.vue +156 -156
  65. package/src/components/build/Install/Process/zhongran/ZR_Design.vue +537 -537
  66. package/src/components/product/ApplyCharge/ApplyChargeList.vue +470 -470
  67. package/src/components/product/Function/Service/FunctionServiceControl.vue +445 -445
  68. package/src/components/product/Ignition/IgnitionDispatch.vue +92 -0
  69. package/src/components/product/Ignition/IgnitionList.vue +236 -0
  70. package/src/components/product/Ignition/IgnitionListManage.vue +413 -0
  71. package/src/components/product/Ignition/IgnitionRecord.vue +357 -0
  72. package/src/components/product/Process/ExplorationSelect.vue +0 -13
  73. package/src/components/product/Process/Processes/addMaterialScience.vue +454 -454
  74. package/src/components/product/Process/Processes/chargeManagement.vue +656 -656
  75. package/src/components/product/Process/Processes/devicesManagement.vue +484 -484
  76. package/src/components/product/Process/Processes/supplementalAgreement.vue +298 -298
  77. package/src/components/product/Process/Service/ServiceControl.vue +56 -1
  78. package/src/components/product/Process/Service/ShowBackReason.vue +33 -33
  79. package/src/components/product/Process/ShowBackReason.vue +33 -33
  80. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +882 -882
  81. package/src/components/product/VueUtils/ApplyUpload.vue +287 -287
  82. package/src/filiale/gehua/pc/ServiceControl.vue +1938 -1938
  83. package/src/filiale/gehua/pc/SupervisoryServiceControl.vue +890 -890
  84. package/src/filiale/guangxi/android/Process/Processes/AppAddMaterialScience.vue +520 -520
  85. package/src/filiale/guangxi/android/Process/Processes/AppDevicesManagement.vue +519 -519
  86. package/src/filiale/guangxi/android/Process/Processes/AppServiceControl.vue +1708 -1708
  87. package/src/filiale/guangxi/android/Process/Processes/AppSupplementalAgreement.vue +298 -298
  88. package/src/filiale/guangxi/pc/ApplyCharge/ApplyChargeList.vue +470 -470
  89. package/src/filiale/guangxi/pc/ApplyCharge/chargeManagement.vue +724 -724
  90. package/src/filiale/guangxi/pc/Process/Service/ServiceControl.vue +1922 -1922
  91. package/src/filiale/guangxi/pc/Process/Service/ShowBackReason.vue +33 -33
  92. package/src/filiale/guangxi/pc/Process/Service/SupervisoryServiceControl.vue +891 -891
  93. package/src/filiale/guangxi/pc/Process/Service/addMaterialScience.vue +517 -517
  94. package/src/filiale/guangxi/pc/Process/ShowBackReason.vue +33 -33
  95. package/src/filiale/shexian/pc/ExplorationSelect.vue +474 -0
  96. package/src/filiale/shexian/pc.js +6 -0
  97. package/src/filiale/yuchuan/android/Process/AppServiceControl.vue +735 -735
  98. package/src/filiale/yuchuan/android/Process/Processes/AppInstallationDetails.vue +824 -824
  99. package/src/filiale/yuchuan/android/Process/Processes/AppInstallationDetailsCivil.vue +650 -650
  100. package/src/filiale/yuchuan/pc/Order/OrderApply.vue +528 -528
  101. package/src/filiale/yuchuan/pc/Process/Processes/InstallationDetails.vue +809 -809
  102. package/src/filiale/yuchuan/pc/Process/Processes/InstallationDetailsCivil.vue +595 -595
  103. package/src/filiale/yuchuan/pc/Process/Processes/chargeManagement.vue +621 -621
  104. package/src/filiale/yuchuan/pc/Process/Service/ServiceControl.vue +1108 -1108
  105. package/dist.7z +0 -0
@@ -1,882 +1,882 @@
1
- <template>
2
- <div class="auto clearfix">
3
- <show-back-reason :selectdata="show_data"></show-back-reason>
4
- </div>
5
- <service-view v-ref:service_show :data="show_data" v-if="showview"></service-view>
6
- </template>
7
- <script>
8
- import Vue from 'vue'
9
- import {HttpResetClass} from 'vue-client'
10
- import {isEmpty} from "../../../Util";
11
- // Date格式化
12
- Date.prototype.Format = function (fmt) {
13
- var o = {
14
- 'M+': this.getMonth() + 1, // 月份
15
- 'd+': this.getDate(), // 日
16
- 'H+': this.getHours(), // 小时
17
- 'm+': this.getMinutes(), // 分
18
- 's+': this.getSeconds(), // 秒
19
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
20
- 'S': this.getMilliseconds() // 毫秒
21
- }
22
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
23
- for (var k in o) {
24
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
25
- }
26
- return fmt
27
- }
28
- export default {
29
- title: '报建监控控制层',
30
- props: {
31
- selectdata: {
32
- type: Object
33
- },
34
- nodeSnapshot: {
35
- type: Boolean,
36
- default: false
37
- }
38
- },
39
- data() {
40
- return {
41
- data: null, // 展示的数据
42
- json_datas: null, // json配置数据结构
43
- showview: false, // 控制显示层显示
44
- show_data: null,
45
- config: {}
46
- }
47
- },
48
- created () {
49
- this.refurbish()
50
- },
51
- methods: {
52
- // 初始化模块
53
- async refurbish() {
54
- this.json_datas = this.$workflow_vue
55
- let sum = 0
56
- let jsonData = {}
57
- if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
58
- this.$showMessage("网络故障,请刷新页面")
59
- return
60
- }
61
- this.json_datas.activitys.forEach(item => {
62
- if (this.selectdata.defname === item.title) {
63
- jsonData = item // 拿到当前节点的json配置信息
64
- sum++ // 节点名一样的个数
65
- }
66
- return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
67
- })
68
-
69
- if (sum === 0) {
70
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
71
- return
72
- }
73
- if (sum > 1) {
74
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
75
- return
76
- }
77
-
78
- this.selectdata = Object.assign({}, this.selectdata, jsonData)
79
-
80
- // fields 字段填充值
81
- for (const item of this.selectdata.fields) {
82
- if (!item.value) {
83
- item.value = null
84
- }
85
-
86
- if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
87
- if (item.eval) {
88
- item.value = eval(item.default)
89
- } else {
90
- item.value = item.default
91
- }
92
- }
93
-
94
- if (this.selectdata[item.field]) {
95
- // 将json字符串格式化赋值给value
96
- if (String(this.selectdata[item.field]).startsWith("{")) {
97
- item.value = JSON.parse(this.selectdata[item.field])
98
- } else {
99
- item.value = this.selectdata[item.field]
100
- }
101
- }
102
- if (this.selectdata[item.field] === 0) {
103
- item.value = 0
104
- }
105
-
106
- // datepicker
107
- if (item.type === 'datepicker' && !item.value && item.default) {
108
- item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
109
- }
110
-
111
- // 如果配置类型为select,优先从参数列表获取options
112
- if (item.type === 'select' || item.type === 'checkbox') {
113
- if (item.param) {
114
- let temp = this.$appdata.getParam(item.label)
115
-
116
- if (temp && temp.length > 0) {
117
- item.options = temp
118
- }
119
-
120
- if (item.paramLabel) {
121
- temp = this.$appdata.getParam(item.paramLabel)
122
- if (temp && temp.length > 0) {
123
- item.options = temp
124
- }
125
- }
126
- }
127
-
128
- if (item.ready) {
129
- item.options = await this[item.ready]()
130
- }
131
- }
132
-
133
-
134
- if (item.type === 'checkbox') {
135
- if (this.selectdata[item.field]) {
136
- item.value = JSON.parse(this.selectdata[item.field])
137
- } else {
138
- item.value = []
139
- }
140
- }
141
-
142
- this.selectdata[item.field] = item.value
143
-
144
- item.readonly = true
145
- item.disabled = true
146
- }
147
-
148
- // 控制组件
149
- if (this.selectdata.components) {
150
- this.selectdata.components.forEach(item => {
151
- item.mark = 1
152
- if (item.supervisory && this[item.supervisory]()) {
153
- item.mark = 0
154
- }
155
- })
156
- }
157
-
158
- // 初始化onetomany
159
- if (this.selectdata.onetomany) {
160
- for (const item of this.selectdata.onetomany) {
161
- let res = null
162
- if (item.queryEvent) {
163
- res = this[item.queryEvent]()
164
- } else {
165
- let data = {
166
- tablename: item.tables[0],
167
- condition: `f_process_id='${this.selectdata.f_process_id}'`
168
- }
169
- res = await this.$resetpost(
170
- 'rs/sql/apply_singleTable',
171
- {data: data},
172
- {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
173
- )
174
- }
175
-
176
- item.rows = res.data
177
-
178
- // 初始化onetomany中的fields
179
- for (const field of item.fields) {
180
- if (!field.value) {
181
- if (field.value !== 0) {
182
- field.value = null
183
- }
184
- }
185
-
186
- if (field.default || field.default === 0) {
187
- field.value = field.default
188
- }
189
-
190
- // datepicker
191
- if (field.type === 'datepicker' && !field.value && field.default) {
192
- field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
193
- }
194
-
195
- if (field.type === 'select') {
196
-
197
- let temp = this.$appdata.getParam(field.label)
198
-
199
- if (temp && temp.length > 0) {
200
- field.options = temp
201
- }
202
-
203
- if (field.paramLabel) {
204
- temp = this.$appdata.getParam(field.paramLabel)
205
- if (temp && temp.length > 0) {
206
- item.options = temp
207
- }
208
- }
209
-
210
- }
211
- }
212
-
213
- // 隐藏所有操作
214
- item.hiddenOperate = true
215
- if (item.supervisory && this[item.supervisory]()) {
216
- item.hiddenOperate = false
217
- }
218
- }
219
- }
220
-
221
- // 去除button
222
- this.selectdata.buttons = null
223
-
224
- // 完成时间和完成人,部门,分公司
225
- if (this.selectdata.state === '结束') {
226
- let http = new HttpResetClass()
227
- let res = await http.load('POST', 'rs/search', {
228
- source: 'this.getInfo()',
229
- userid: this.selectdata.userid
230
- }, {resolveMsg: null, rejectMsg: '处理人员获取失败!!!'})
231
- let user = res.data
232
- this.selectdata.operate_date = new Date(this.selectdata.finishtime).Format('yyyy-MM-dd')
233
- this.selectdata.operator = this.selectdata.person
234
- this.selectdata.orgs = user.orgs
235
- this.selectdata.parentname = user.deps
236
- }
237
-
238
- // 未结束且是下发查看指定人员
239
- if (this.selectdata.state !== '结束' && this.selectdata.actorexpression !== null && this.selectdata.actorexpression.indexOf('PI') === 0) {
240
- let http = new HttpResetClass()
241
- let res = await http.load('POST', 'rs/search', {
242
- source: 'this',
243
- userid: this.selectdata.actorexpression.substring(3, this.selectdata.actorexpression.length-1)
244
- }, {resolveMsg: null, rejectMsg: '处理人员获取失败!!!'})
245
- let user = res.data
246
- this.selectdata.operate_date = new Date().Format('yyyy-MM-dd')
247
- this.selectdata.operator = user.name
248
- this.selectdata.orgs = user.orgs
249
- this.selectdata.parentname = user.f_department_name
250
- }
251
-
252
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
253
- let temp = JSON.parse(JSON.stringify(this.selectdata))
254
-
255
- this.show_data = temp
256
- for (const item of this.show_data.fields) {
257
- debugger
258
- if(item.label==='气价名称'){
259
- item.value=this.show_data.f_price_name
260
- }
261
- }
262
- this.$nextTick(() => {
263
- this.showview = true
264
- })
265
- },
266
- // 金额转大写
267
- smalltoBIG(n) {
268
- let fraction = ['角', '分'];
269
- let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
270
- let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
271
- let head = n < 0 ? '欠' : '';
272
- n = Math.abs(n);
273
-
274
- let s = '';
275
-
276
- for (var i = 0; i < fraction.length; i++) {
277
- s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
278
- }
279
- s = s || '整';
280
- n = Math.floor(n);
281
-
282
- for (var i = 0; i < unit[0].length && n > 0; i++) {
283
- let p = '';
284
- for (var j = 0; j < unit[1].length && n > 0; j++) {
285
- p = digit[n % 10] + unit[1][j] + p;
286
- n = Math.floor(n / 10);
287
- }
288
- s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
289
- }
290
- return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
291
- },
292
- getLableValue(label) {
293
- for (const item of this.show_data.fields) {
294
- if (item.label === label && item.type !== 'number') {
295
- return item.value || ''
296
- }
297
- if (item.label === label && item.type === 'number') {
298
- return item.value || 0
299
- }
300
- }
301
- },
302
- getLableOptions(label) {
303
- for (const item of this.show_data.fields) {
304
- if (item.label === label) {
305
- return item.options
306
- }
307
- }
308
- },
309
- setLabelValue(label, value) {
310
- for (const item of this.show_data.fields) {
311
- if (item.label === label) {
312
- item.value = value
313
- this.show_data[item.field] = value
314
- }
315
- }
316
- },
317
- setLabelOptions(label, options) {
318
- for (const item of this.show_data.fields) {
319
- if (item.label === label) {
320
- item.options = options
321
- }
322
- }
323
- },
324
- showLabels(...labels) {
325
- for (const item of this.show_data.fields) {
326
- if (labels.includes(item.label)) {
327
- item.hidden = false
328
- }
329
- }
330
- },
331
- hideLabels(...labels) {
332
- for (const item of this.show_data.fields) {
333
- if (labels.includes(item.label)) {
334
- item.hidden = true
335
- }
336
- }
337
- },
338
- requiredLabels(...labels) {
339
- for (const item of this.show_data.fields) {
340
- if (labels.includes(item.label)) {
341
- item.required = true
342
- }
343
- }
344
- },
345
- electiveLabels(...labels) {
346
- for (const item of this.show_data.fields) {
347
- if (labels.includes(item.label)) {
348
- item.required = false
349
- }
350
- }
351
- },
352
- readonlyLabels(...labels) {
353
- for (const item of this.show_data.fields) {
354
- if (labels.includes(item.label)) {
355
- item.readonly = true
356
- item.disabled = true
357
- }
358
- }
359
- },
360
- readwriteLabels(...labels) {
361
- for (const item of this.show_data.fields) {
362
- if (labels.includes(item.label)) {
363
- item.readonly = false
364
- item.disabled = false
365
- }
366
- }
367
- },
368
- disabledButtons(...buttons) {
369
- for (const item of this.show_data.buttons) {
370
- if (buttons.includes(item.button_name)) {
371
- item.disabled = true
372
- }
373
- }
374
- },
375
- enableButtons(...buttons) {
376
- for (const item of this.show_data.buttons) {
377
- if (buttons.includes(item.button_name)) {
378
- item.disabled = false
379
- }
380
- }
381
- },
382
- showButtons(...buttons) {
383
- for (const item of this.show_data.buttons) {
384
- if (buttons.includes(item.button_name)) {
385
- item.hidden = false
386
- }
387
- }
388
- },
389
- hideButtons(...buttons) {
390
- for (const item of this.show_data.buttons) {
391
- if (buttons.includes(item.button_name)) {
392
- item.hidden = true
393
- }
394
- }
395
- },
396
- async checkDuplicate(index) {
397
- let http = new HttpResetClass()
398
- let data = {
399
- tablename: 't_apply',
400
- condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
401
- }
402
- let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
403
- resolveMsg: null,
404
- rejectMsg: `${this.show_data.fields[index].label}查询失败`
405
- })
406
- if (res.data.length > 0) {
407
- this.show_data.fields[index].value = null
408
- this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
409
- }
410
- },
411
- // 获取片区
412
- async getSliceArea () {
413
- let data = {
414
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
415
- userid: this.$login.f.id
416
- }
417
-
418
- let res = await this.$resetpost(
419
- `rs/search`,
420
- {data: data},
421
- {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
422
- )
423
-
424
- return res.data.map(item => {
425
- return {
426
- label: item.name,
427
- value: item.name
428
- }
429
- })
430
- },
431
- // 获取区县
432
- async getPcd () {
433
- let data = {
434
- tablename: 't_pcd',
435
- condition: `f_filialeid = '${this.$login.f.orgid}'`
436
- }
437
- let res = await this.$resetpost(
438
- `rs/sql/apply_singleTable`,
439
- {data: data},
440
- {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
441
- )
442
-
443
- return res.data.map(item => {
444
- return {
445
- label: item.f_pcd,
446
- value: item.f_pcd
447
- }
448
- })
449
- },
450
- // 缴费前置
451
- chargeBefore () {
452
- if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
453
- this.$showAlert('费用未结清!!!', 'warning', 3000)
454
- throw null
455
- }
456
- },
457
- // 施工前置
458
- async constructionBefore () {
459
- let http = new HttpResetClass()
460
- let data = {
461
- condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
462
- }
463
- let res = await http.load(
464
- 'POST',
465
- 'rs/sql/countApplyUserinfo',
466
- {data: data},
467
- {
468
- resolveMsg: null,
469
- rejectMsg: '安装明细查询失败!!!'
470
- })
471
- if (res.data[0].num > 0) {
472
- this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
473
- throw `还有${res.data[0].num}户未安装,无法提交`
474
- }
475
- },
476
- changePipeBuild () {
477
- if (this.selectdata.f_process_dep === '工程部') {
478
- return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
479
- }
480
- if (this.selectdata.f_process_dep === '运营部') {
481
- return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
482
- }
483
- },
484
- async getDevInfo () {
485
- let data = {
486
- tablename: 't_dev_info',
487
- condition: `f_orgid = '${this.$login.f.orgid}'`
488
- }
489
- let res = await this.$resetpost(
490
- `rs/sql/apply_singleTable`,
491
- {data: data},
492
- {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
493
- )
494
-
495
- return res.data.map(item => {
496
- return {
497
- label: item.f_dev_name,
498
- value: item.f_dev_name
499
- }
500
- })
501
- },
502
- async getPrice (f_price_id) {
503
- /* console.log('=======================')
504
- console.log(f_price_id)
505
-
506
- let data = {
507
- condition: `sp.f_orgid = '${this.$login.f.orgid}'`
508
- }
509
-
510
- if (!isEmpty(f_price_id)) {
511
- data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
512
- }
513
- let http = new HttpResetClass()
514
- let res = await http.load(
515
- 'POST',
516
- `rs/sql/applyGetPrice`,
517
- {data: data},
518
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
519
- )
520
-
521
- return res.data.map(item => {
522
- return {
523
- label: item.f_price_name,
524
- value: item
525
- }
526
- })*/
527
- },
528
- materialSupervisory () {
529
- if (this.selectdata.userid === this.$login.f.id) {
530
- return true
531
- }
532
- return false
533
- },
534
- async getDesignerPeople () {
535
- let data = {
536
- source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
537
- userid: this.$login.f.id
538
- }
539
-
540
- let http = new HttpResetClass()
541
- let res = await http.load(
542
- 'POST',
543
- `rs/search`,
544
- {data: data},
545
- {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
546
- )
547
-
548
- return res.data.map(item => {
549
- return {
550
- label: item.name,
551
- value: item.id
552
- }
553
- })
554
- },
555
- // 获取区县
556
- async getArea () {
557
- let data = {
558
- tablename: 't_area',
559
- condition: `f_filialeid = '${this.$login.f.orgid}'`
560
- }
561
- let http = new HttpResetClass()
562
- let res = await http.load(
563
- 'POST',
564
- `rs/sql/apply_singleTable`,
565
- {data: data},
566
- {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
567
- )
568
-
569
- return res.data.map(item => {
570
- return {
571
- label: item.f_residential_area,
572
- value: item.f_residential_area
573
- }
574
- })
575
- }
576
- },
577
- events:{
578
- 'complyInstallation' (index) {
579
- },
580
- // 选择材料
581
- async materialNameChenge (index, fieldIndex) {
582
- let material = this.show_data.onetomany[index].fields[fieldIndex].value
583
-
584
- this.show_data.onetomany[index].fields.forEach(item => {
585
- if (material[item.field]) {
586
- item.value = material[item.field]
587
- }
588
- })
589
- },
590
- // 打开模态框获取材料
591
- async 'getMaterialName' (index) {
592
- let data = {
593
- condition: `1=1`
594
- }
595
- let http = new HttpResetClass()
596
- let res = await http.load(
597
- 'POST',
598
- `rs/sql/getStockMaterial`,
599
- {data: data},
600
- {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
601
- )
602
-
603
- this.show_data.onetomany[index].fields.forEach(field => {
604
- if (field.label === '选择材料') {
605
- field.options = res.data.map(item => {
606
- return {
607
- 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
608
- 'value': item
609
- }
610
- })
611
- }
612
- })
613
- },
614
- // 终止报建初始化·
615
- async 'stopApplyReadyEvent' () {
616
-
617
- let f_is_stop = this.getLableValue('是否终止')
618
-
619
- for (const item of this.show_data.fields) {
620
- if (f_is_stop === '是') {
621
- if (item.label === '终止原因') {
622
- item.hidden = false
623
- item.required = true
624
- }
625
- } else {
626
- if (item.label === '终止原因') {
627
- item.hidden = true
628
- item.required = false
629
- }
630
- }
631
- }
632
-
633
- if (isEmpty(this.show_data.f_parent_process_id)) {
634
- return
635
- }
636
- let data = {
637
- condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
638
- data: {
639
- id: this.$login.f.id,
640
- orgid: this.$login.f.orgid
641
- }
642
- }
643
- let res = await this.$resetpost(
644
- `rs/sql/supervisory`,
645
- {data: data},
646
- {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
647
- )
648
- this.show_data.parentApply = res.data[0]
649
- },
650
- // 通气点火初始化
651
- async 'gasReadyEvent' () {
652
- /*if (!isEmpty(this.show_data.f_price_id)) {
653
- let priceList = await this.getPrice(this.show_data.f_price_id)
654
- this.setLabelValue('气价名称', priceList[0].value)
655
- }*/
656
-
657
-
658
- // 保险初始化显示内容
659
- let f_is_insure = this.getLableValue('是否购买保险')
660
- for (const item of this.show_data.fields) {
661
- if (f_is_insure === '是') {
662
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
663
- item.hidden = false
664
- item.required = true
665
- }
666
- if (item.label === '保险备注') {
667
- item.hidden = false
668
- }
669
- } else {
670
- if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
671
- item.hidden = true
672
- item.required = false
673
- }
674
- if (item.label === '保险备注') {
675
- item.hidden = true
676
- }
677
- }
678
- }
679
- },
680
- // 申请节点初始化
681
- 'applyReadyEvent' () {
682
- this.$getConfig(this, 'UserAddress')
683
-
684
- let f_address_type = this.show_data.f_address_type
685
-
686
- for (const item of this.show_data.fields) {
687
- if (f_address_type === '民用市区') {
688
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
689
- item.hidden = false
690
- item.required = true
691
- }
692
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
693
- item.hidden = false
694
- item.required = false
695
- }
696
- if (item.label === '地址') {
697
- item.readonly = true
698
- }
699
- }
700
- if (f_address_type === '民用乡镇') {
701
- if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
702
- item.hidden = false
703
- item.required = true
704
- }
705
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
706
- item.hidden = false
707
- item.required = false
708
- }
709
- if (item.label === '楼层') {
710
- item.hidden = true
711
- item.required = false
712
- }
713
- if (item.label === '地址') {
714
- item.readonly = true
715
- }
716
- }
717
- if (f_address_type === '特殊地址') {
718
- if (item.label === '区/县' || item.label === '街道/乡镇') {
719
- item.hidden = false
720
- item.required = true
721
- }
722
- if (item.label === '集收单位') {
723
- item.hidden = false
724
- item.required = false
725
- }
726
- if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
727
- item.hidden = true
728
- item.required = false
729
- }
730
- if (item.label === '地址') {
731
- item.readonly = false
732
- }
733
- }
734
-
735
- if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
736
- item.hidden = true
737
- }
738
- }
739
- },
740
- // 失去焦点出触发事件
741
- 'onchange' (index) {
742
- if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
743
- if (
744
- this.show_data.fields[index].label === '区/县' ||
745
- this.show_data.fields[index].label === '街道/乡镇' ||
746
- this.show_data.fields[index].label === '集收单位' ||
747
- this.show_data.fields[index].label === '楼号/组' ||
748
- this.show_data.fields[index].label === '单元/排' ||
749
- this.show_data.fields[index].label === '楼层' ||
750
- this.show_data.fields[index].label === '门牌号'
751
- ) {
752
-
753
- let f_pcd = this.getLableValue('区/县') || ''
754
- let f_street = this.getLableValue('街道/乡镇') || ''
755
- let f_residential_area = this.getLableValue('集收单位') || ''
756
- let f_building = this.getLableValue('楼号/组') || ''
757
- let f_building_suffix = f_building ? this.config.f_building_suffix : ''
758
- let f_unit = this.getLableValue('单元/排') || ''
759
- let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
760
- let f_floor = this.getLableValue('楼层') || ''
761
- let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
762
- let f_room = this.getLableValue('门牌号') || ''
763
- let f_room_suffix = f_room ? this.config.f_room_suffix : ''
764
-
765
- 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
766
- this.setLabelValue("地址", f_address)
767
- }
768
- }
769
- },
770
- // =============================
771
- selectSearch (val, index) {},
772
- 'onblur' (index) {},
773
- 'oninput' (index) {},
774
- 'initializtionView' () {},
775
- async 'onchangeModal' (index, fieldIndex) {
776
- },
777
- async 'onblurModal' (index, fieldIndex) {
778
-
779
- },
780
- async 'oninputModal' (index, fieldIndex) {
781
-
782
- },
783
- async 'onetomanydelete' (index, rowIndex) {
784
-
785
- let http = new HttpResetClass()
786
-
787
- let res = await http.load(
788
- 'DELETE',
789
- `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
790
- null,
791
- {resolveMsg: null, rejectMsg: '删除失败!!!'}
792
- )
793
-
794
- res = await this.$resetpost(
795
- 'rs/entity/t_apply',
796
- this.show_data
797
- )
798
-
799
- this.$dispatch('breakControl', this.show_data)
800
- },
801
- async 'onetomanyupdate' (index, rowIndex) {
802
- let data = this.show_data.onetomany[index].rows[rowIndex]
803
-
804
- this.show_data.onetomany[index].fields.forEach(item => {
805
- data[item.field] = item.value
806
- })
807
- let res = await this.$resetpost(
808
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
809
- data
810
- )
811
-
812
- res = await this.$resetpost(
813
- 'rs/entity/t_apply',
814
- this.show_data
815
- )
816
-
817
- this.$dispatch('breakControl', this.show_data)
818
- },
819
- async 'onetomanyadd' (index) {
820
- let data = {
821
- f_process_id : this.show_data.f_process_id,
822
- f_operator_id: this.$login.f.id,
823
- f_operator: this.$login.f.name,
824
- f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
825
- f_orgid: this.$login.f.orgid,
826
- f_orgname: this.$login.f.orgs
827
- }
828
- this.show_data.onetomany[index].fields.forEach(item => {
829
- data[item.field] = item.value
830
- })
831
- let res = await this.$resetpost(
832
- `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
833
- data
834
- )
835
-
836
- res = await this.$resetpost(
837
- 'rs/entity/t_apply',
838
- this.show_data
839
- )
840
-
841
- this.$dispatch('breakControl', this.show_data)
842
- },
843
- async 'importEvent' (index, table, configName, filepath) {
844
- let data = {
845
- selectdata: this.show_data,
846
- table: table,
847
- filepath: filepath,
848
- configName: configName,
849
- user: this.$login.f
850
- }
851
-
852
- let res = await this.$resetpost(
853
- `rs/logic/importEvent`,
854
- data
855
- )
856
-
857
- this.$dispatch('breakControl', this.show_data)
858
- },
859
- 'onbutchange' (index) {
860
-
861
- },
862
- 'onbutblur' (index) {
863
-
864
- },
865
- 'onbutinput' (index) {
866
-
867
- }
868
- },
869
- watch: {
870
- deep: true
871
- }
872
- }
873
- </script>
874
- <style scoped>
875
- /*清除model中的浮动*/
876
- .clearfix:after,.clearfix:before{
877
- display: table;
878
- }
879
- .clearfix:after{
880
- clear: both;
881
- }
882
- </style>
1
+ <template>
2
+ <div class="auto clearfix">
3
+ <show-back-reason :selectdata="show_data"></show-back-reason>
4
+ </div>
5
+ <service-view v-ref:service_show :data="show_data" v-if="showview"></service-view>
6
+ </template>
7
+ <script>
8
+ import Vue from 'vue'
9
+ import {HttpResetClass} from 'vue-client'
10
+ import {isEmpty} from "../../../Util";
11
+ // Date格式化
12
+ Date.prototype.Format = function (fmt) {
13
+ var o = {
14
+ 'M+': this.getMonth() + 1, // 月份
15
+ 'd+': this.getDate(), // 日
16
+ 'H+': this.getHours(), // 小时
17
+ 'm+': this.getMinutes(), // 分
18
+ 's+': this.getSeconds(), // 秒
19
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
20
+ 'S': this.getMilliseconds() // 毫秒
21
+ }
22
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
23
+ for (var k in o) {
24
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
25
+ }
26
+ return fmt
27
+ }
28
+ export default {
29
+ title: '报建监控控制层',
30
+ props: {
31
+ selectdata: {
32
+ type: Object
33
+ },
34
+ nodeSnapshot: {
35
+ type: Boolean,
36
+ default: false
37
+ }
38
+ },
39
+ data() {
40
+ return {
41
+ data: null, // 展示的数据
42
+ json_datas: null, // json配置数据结构
43
+ showview: false, // 控制显示层显示
44
+ show_data: null,
45
+ config: {}
46
+ }
47
+ },
48
+ created () {
49
+ this.refurbish()
50
+ },
51
+ methods: {
52
+ // 初始化模块
53
+ async refurbish() {
54
+ this.json_datas = this.$workflow_vue
55
+ let sum = 0
56
+ let jsonData = {}
57
+ if (!this.json_datas || !this.json_datas.activitys || this.json_datas.activitys.length === 0) {
58
+ this.$showMessage("网络故障,请刷新页面")
59
+ return
60
+ }
61
+ this.json_datas.activitys.forEach(item => {
62
+ if (this.selectdata.defname === item.title) {
63
+ jsonData = item // 拿到当前节点的json配置信息
64
+ sum++ // 节点名一样的个数
65
+ }
66
+ return this.selectdata.defname === item.title // 拿到当前节点的json配置信息
67
+ })
68
+
69
+ if (sum === 0) {
70
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
71
+ return
72
+ }
73
+ if (sum > 1) {
74
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
75
+ return
76
+ }
77
+
78
+ this.selectdata = Object.assign({}, this.selectdata, jsonData)
79
+
80
+ // fields 字段填充值
81
+ for (const item of this.selectdata.fields) {
82
+ if (!item.value) {
83
+ item.value = null
84
+ }
85
+
86
+ if (!item.value && (item.default || item.default === 0) && item.type !== 'datepicker') {
87
+ if (item.eval) {
88
+ item.value = eval(item.default)
89
+ } else {
90
+ item.value = item.default
91
+ }
92
+ }
93
+
94
+ if (this.selectdata[item.field]) {
95
+ // 将json字符串格式化赋值给value
96
+ if (String(this.selectdata[item.field]).startsWith("{")) {
97
+ item.value = JSON.parse(this.selectdata[item.field])
98
+ } else {
99
+ item.value = this.selectdata[item.field]
100
+ }
101
+ }
102
+ if (this.selectdata[item.field] === 0) {
103
+ item.value = 0
104
+ }
105
+
106
+ // datepicker
107
+ if (item.type === 'datepicker' && !item.value && item.default) {
108
+ item.value = new Date().Format(`${item.format ? item.format : 'yyyy-MM-dd HH:mm:ss'}`)
109
+ }
110
+
111
+ // 如果配置类型为select,优先从参数列表获取options
112
+ if (item.type === 'select' || item.type === 'checkbox') {
113
+ if (item.param) {
114
+ let temp = this.$appdata.getParam(item.label)
115
+
116
+ if (temp && temp.length > 0) {
117
+ item.options = temp
118
+ }
119
+
120
+ if (item.paramLabel) {
121
+ temp = this.$appdata.getParam(item.paramLabel)
122
+ if (temp && temp.length > 0) {
123
+ item.options = temp
124
+ }
125
+ }
126
+ }
127
+
128
+ if (item.ready) {
129
+ item.options = await this[item.ready]()
130
+ }
131
+ }
132
+
133
+
134
+ if (item.type === 'checkbox') {
135
+ if (this.selectdata[item.field]) {
136
+ item.value = JSON.parse(this.selectdata[item.field])
137
+ } else {
138
+ item.value = []
139
+ }
140
+ }
141
+
142
+ this.selectdata[item.field] = item.value
143
+
144
+ item.readonly = true
145
+ item.disabled = true
146
+ }
147
+
148
+ // 控制组件
149
+ if (this.selectdata.components) {
150
+ this.selectdata.components.forEach(item => {
151
+ item.mark = 1
152
+ if (item.supervisory && this[item.supervisory]()) {
153
+ item.mark = 0
154
+ }
155
+ })
156
+ }
157
+
158
+ // 初始化onetomany
159
+ if (this.selectdata.onetomany) {
160
+ for (const item of this.selectdata.onetomany) {
161
+ let res = null
162
+ if (item.queryEvent) {
163
+ res = this[item.queryEvent]()
164
+ } else {
165
+ let data = {
166
+ tablename: item.tables[0],
167
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
168
+ }
169
+ res = await this.$resetpost(
170
+ 'rs/sql/apply_singleTable',
171
+ {data: data},
172
+ {resolveMsg: null, rejectMsg: 'onetomany查询失败'}
173
+ )
174
+ }
175
+
176
+ item.rows = res.data
177
+
178
+ // 初始化onetomany中的fields
179
+ for (const field of item.fields) {
180
+ if (!field.value) {
181
+ if (field.value !== 0) {
182
+ field.value = null
183
+ }
184
+ }
185
+
186
+ if (field.default || field.default === 0) {
187
+ field.value = field.default
188
+ }
189
+
190
+ // datepicker
191
+ if (field.type === 'datepicker' && !field.value && field.default) {
192
+ field.value = new Date().Format(`${field.format ? field.format : 'yyyy-MM-dd HH:mm:ss'}`)
193
+ }
194
+
195
+ if (field.type === 'select') {
196
+
197
+ let temp = this.$appdata.getParam(field.label)
198
+
199
+ if (temp && temp.length > 0) {
200
+ field.options = temp
201
+ }
202
+
203
+ if (field.paramLabel) {
204
+ temp = this.$appdata.getParam(field.paramLabel)
205
+ if (temp && temp.length > 0) {
206
+ item.options = temp
207
+ }
208
+ }
209
+
210
+ }
211
+ }
212
+
213
+ // 隐藏所有操作
214
+ item.hiddenOperate = true
215
+ if (item.supervisory && this[item.supervisory]()) {
216
+ item.hiddenOperate = false
217
+ }
218
+ }
219
+ }
220
+
221
+ // 去除button
222
+ this.selectdata.buttons = null
223
+
224
+ // 完成时间和完成人,部门,分公司
225
+ if (this.selectdata.state === '结束') {
226
+ let http = new HttpResetClass()
227
+ let res = await http.load('POST', 'rs/search', {
228
+ source: 'this.getInfo()',
229
+ userid: this.selectdata.userid
230
+ }, {resolveMsg: null, rejectMsg: '处理人员获取失败!!!'})
231
+ let user = res.data
232
+ this.selectdata.operate_date = new Date(this.selectdata.finishtime).Format('yyyy-MM-dd')
233
+ this.selectdata.operator = this.selectdata.person
234
+ this.selectdata.orgs = user.orgs
235
+ this.selectdata.parentname = user.deps
236
+ }
237
+
238
+ // 未结束且是下发查看指定人员
239
+ if (this.selectdata.state !== '结束' && this.selectdata.actorexpression !== null && this.selectdata.actorexpression.indexOf('PI') === 0) {
240
+ let http = new HttpResetClass()
241
+ let res = await http.load('POST', 'rs/search', {
242
+ source: 'this',
243
+ userid: this.selectdata.actorexpression.substring(3, this.selectdata.actorexpression.length-1)
244
+ }, {resolveMsg: null, rejectMsg: '处理人员获取失败!!!'})
245
+ let user = res.data
246
+ this.selectdata.operate_date = new Date().Format('yyyy-MM-dd')
247
+ this.selectdata.operator = user.name
248
+ this.selectdata.orgs = user.orgs
249
+ this.selectdata.parentname = user.f_department_name
250
+ }
251
+
252
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
253
+ let temp = JSON.parse(JSON.stringify(this.selectdata))
254
+
255
+ this.show_data = temp
256
+ for (const item of this.show_data.fields) {
257
+ debugger
258
+ if(item.label==='气价名称'){
259
+ item.value=this.show_data.f_price_name
260
+ }
261
+ }
262
+ this.$nextTick(() => {
263
+ this.showview = true
264
+ })
265
+ },
266
+ // 金额转大写
267
+ smalltoBIG(n) {
268
+ let fraction = ['角', '分'];
269
+ let digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'];
270
+ let unit = [['元', '万', '亿'], ['', '拾', '佰', '仟']];
271
+ let head = n < 0 ? '欠' : '';
272
+ n = Math.abs(n);
273
+
274
+ let s = '';
275
+
276
+ for (var i = 0; i < fraction.length; i++) {
277
+ s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
278
+ }
279
+ s = s || '整';
280
+ n = Math.floor(n);
281
+
282
+ for (var i = 0; i < unit[0].length && n > 0; i++) {
283
+ let p = '';
284
+ for (var j = 0; j < unit[1].length && n > 0; j++) {
285
+ p = digit[n % 10] + unit[1][j] + p;
286
+ n = Math.floor(n / 10);
287
+ }
288
+ s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s;
289
+ }
290
+ return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
291
+ },
292
+ getLableValue(label) {
293
+ for (const item of this.show_data.fields) {
294
+ if (item.label === label && item.type !== 'number') {
295
+ return item.value || ''
296
+ }
297
+ if (item.label === label && item.type === 'number') {
298
+ return item.value || 0
299
+ }
300
+ }
301
+ },
302
+ getLableOptions(label) {
303
+ for (const item of this.show_data.fields) {
304
+ if (item.label === label) {
305
+ return item.options
306
+ }
307
+ }
308
+ },
309
+ setLabelValue(label, value) {
310
+ for (const item of this.show_data.fields) {
311
+ if (item.label === label) {
312
+ item.value = value
313
+ this.show_data[item.field] = value
314
+ }
315
+ }
316
+ },
317
+ setLabelOptions(label, options) {
318
+ for (const item of this.show_data.fields) {
319
+ if (item.label === label) {
320
+ item.options = options
321
+ }
322
+ }
323
+ },
324
+ showLabels(...labels) {
325
+ for (const item of this.show_data.fields) {
326
+ if (labels.includes(item.label)) {
327
+ item.hidden = false
328
+ }
329
+ }
330
+ },
331
+ hideLabels(...labels) {
332
+ for (const item of this.show_data.fields) {
333
+ if (labels.includes(item.label)) {
334
+ item.hidden = true
335
+ }
336
+ }
337
+ },
338
+ requiredLabels(...labels) {
339
+ for (const item of this.show_data.fields) {
340
+ if (labels.includes(item.label)) {
341
+ item.required = true
342
+ }
343
+ }
344
+ },
345
+ electiveLabels(...labels) {
346
+ for (const item of this.show_data.fields) {
347
+ if (labels.includes(item.label)) {
348
+ item.required = false
349
+ }
350
+ }
351
+ },
352
+ readonlyLabels(...labels) {
353
+ for (const item of this.show_data.fields) {
354
+ if (labels.includes(item.label)) {
355
+ item.readonly = true
356
+ item.disabled = true
357
+ }
358
+ }
359
+ },
360
+ readwriteLabels(...labels) {
361
+ for (const item of this.show_data.fields) {
362
+ if (labels.includes(item.label)) {
363
+ item.readonly = false
364
+ item.disabled = false
365
+ }
366
+ }
367
+ },
368
+ disabledButtons(...buttons) {
369
+ for (const item of this.show_data.buttons) {
370
+ if (buttons.includes(item.button_name)) {
371
+ item.disabled = true
372
+ }
373
+ }
374
+ },
375
+ enableButtons(...buttons) {
376
+ for (const item of this.show_data.buttons) {
377
+ if (buttons.includes(item.button_name)) {
378
+ item.disabled = false
379
+ }
380
+ }
381
+ },
382
+ showButtons(...buttons) {
383
+ for (const item of this.show_data.buttons) {
384
+ if (buttons.includes(item.button_name)) {
385
+ item.hidden = false
386
+ }
387
+ }
388
+ },
389
+ hideButtons(...buttons) {
390
+ for (const item of this.show_data.buttons) {
391
+ if (buttons.includes(item.button_name)) {
392
+ item.hidden = true
393
+ }
394
+ }
395
+ },
396
+ async checkDuplicate(index) {
397
+ let http = new HttpResetClass()
398
+ let data = {
399
+ tablename: 't_apply',
400
+ condition: `${this.show_data.fields[index].field} = '${this.show_data.fields[index].value}'`
401
+ }
402
+ let res = await http.load('POST', 'rs/sql/apply_singleTable', {data: data}, {
403
+ resolveMsg: null,
404
+ rejectMsg: `${this.show_data.fields[index].label}查询失败`
405
+ })
406
+ if (res.data.length > 0) {
407
+ this.show_data.fields[index].value = null
408
+ this.$showAlert(`${this.show_data.fields[index].label}已存在!!!`, 'warning', 3000)
409
+ }
410
+ },
411
+ // 获取片区
412
+ async getSliceArea () {
413
+ let data = {
414
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
415
+ userid: this.$login.f.id
416
+ }
417
+
418
+ let res = await this.$resetpost(
419
+ `rs/search`,
420
+ {data: data},
421
+ {resolveMsg: null, rejectMsg: '片区查询失败!!!'}
422
+ )
423
+
424
+ return res.data.map(item => {
425
+ return {
426
+ label: item.name,
427
+ value: item.name
428
+ }
429
+ })
430
+ },
431
+ // 获取区县
432
+ async getPcd () {
433
+ let data = {
434
+ tablename: 't_pcd',
435
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
436
+ }
437
+ let res = await this.$resetpost(
438
+ `rs/sql/apply_singleTable`,
439
+ {data: data},
440
+ {resolveMsg: null, rejectMsg: '区县查询失败!!!'}
441
+ )
442
+
443
+ return res.data.map(item => {
444
+ return {
445
+ label: item.f_pcd,
446
+ value: item.f_pcd
447
+ }
448
+ })
449
+ },
450
+ // 缴费前置
451
+ chargeBefore () {
452
+ if (Number(this.show_data.f_due_money) > Number(this.show_data.f_cumulative_payment_money) || Number(this.show_data.f_surplus_money) > 0) {
453
+ this.$showAlert('费用未结清!!!', 'warning', 3000)
454
+ throw null
455
+ }
456
+ },
457
+ // 施工前置
458
+ async constructionBefore () {
459
+ let http = new HttpResetClass()
460
+ let data = {
461
+ condition: `ui.f_process_id = '${this.show_data.f_process_id}' and uf.f_table_state = '待开通'`
462
+ }
463
+ let res = await http.load(
464
+ 'POST',
465
+ 'rs/sql/countApplyUserinfo',
466
+ {data: data},
467
+ {
468
+ resolveMsg: null,
469
+ rejectMsg: '安装明细查询失败!!!'
470
+ })
471
+ if (res.data[0].num > 0) {
472
+ this.$showAlert(`还有${res.data[0].num}户未安装,无法提交`, 'warning', 3000)
473
+ throw `还有${res.data[0].num}户未安装,无法提交`
474
+ }
475
+ },
476
+ changePipeBuild () {
477
+ if (this.selectdata.f_process_dep === '工程部') {
478
+ return 'this.getParentByType($organization$).getChildByName($工程部报装$).getChildren()'
479
+ }
480
+ if (this.selectdata.f_process_dep === '运营部') {
481
+ return 'this.getParentByType($organization$).getChildByName($运营部报装$).getChildren()'
482
+ }
483
+ },
484
+ async getDevInfo () {
485
+ let data = {
486
+ tablename: 't_dev_info',
487
+ condition: `f_orgid = '${this.$login.f.orgid}'`
488
+ }
489
+ let res = await this.$resetpost(
490
+ `rs/sql/apply_singleTable`,
491
+ {data: data},
492
+ {resolveMsg: null, rejectMsg: '公司查询失败!!!'}
493
+ )
494
+
495
+ return res.data.map(item => {
496
+ return {
497
+ label: item.f_dev_name,
498
+ value: item.f_dev_name
499
+ }
500
+ })
501
+ },
502
+ async getPrice (f_price_id) {
503
+ /* console.log('=======================')
504
+ console.log(f_price_id)
505
+
506
+ let data = {
507
+ condition: `sp.f_orgid = '${this.$login.f.orgid}'`
508
+ }
509
+
510
+ if (!isEmpty(f_price_id)) {
511
+ data.condition = `sp.f_orgid = '${this.$login.f.orgid}' and sp.f_price_id = ${f_price_id}`
512
+ }
513
+ let http = new HttpResetClass()
514
+ let res = await http.load(
515
+ 'POST',
516
+ `rs/sql/applyGetPrice`,
517
+ {data: data},
518
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
519
+ )
520
+
521
+ return res.data.map(item => {
522
+ return {
523
+ label: item.f_price_name,
524
+ value: item
525
+ }
526
+ })*/
527
+ },
528
+ materialSupervisory () {
529
+ if (this.selectdata.userid === this.$login.f.id) {
530
+ return true
531
+ }
532
+ return false
533
+ },
534
+ async getDesignerPeople () {
535
+ let data = {
536
+ source: 'this.getParentByType($organization$).getChildByName($设计部报装$).getChildren()',
537
+ userid: this.$login.f.id
538
+ }
539
+
540
+ let http = new HttpResetClass()
541
+ let res = await http.load(
542
+ 'POST',
543
+ `rs/search`,
544
+ {data: data},
545
+ {resolveMsg: null, rejectMsg: '设计人员查询失败!!!'}
546
+ )
547
+
548
+ return res.data.map(item => {
549
+ return {
550
+ label: item.name,
551
+ value: item.id
552
+ }
553
+ })
554
+ },
555
+ // 获取区县
556
+ async getArea () {
557
+ let data = {
558
+ tablename: 't_area',
559
+ condition: `f_filialeid = '${this.$login.f.orgid}'`
560
+ }
561
+ let http = new HttpResetClass()
562
+ let res = await http.load(
563
+ 'POST',
564
+ `rs/sql/apply_singleTable`,
565
+ {data: data},
566
+ {resolveMsg: null, rejectMsg: '集收单位查询失败!!!'}
567
+ )
568
+
569
+ return res.data.map(item => {
570
+ return {
571
+ label: item.f_residential_area,
572
+ value: item.f_residential_area
573
+ }
574
+ })
575
+ }
576
+ },
577
+ events:{
578
+ 'complyInstallation' (index) {
579
+ },
580
+ // 选择材料
581
+ async materialNameChenge (index, fieldIndex) {
582
+ let material = this.show_data.onetomany[index].fields[fieldIndex].value
583
+
584
+ this.show_data.onetomany[index].fields.forEach(item => {
585
+ if (material[item.field]) {
586
+ item.value = material[item.field]
587
+ }
588
+ })
589
+ },
590
+ // 打开模态框获取材料
591
+ async 'getMaterialName' (index) {
592
+ let data = {
593
+ condition: `1=1`
594
+ }
595
+ let http = new HttpResetClass()
596
+ let res = await http.load(
597
+ 'POST',
598
+ `rs/sql/getStockMaterial`,
599
+ {data: data},
600
+ {resolveMsg: null, rejectMsg: '材料查询失败!!!'}
601
+ )
602
+
603
+ this.show_data.onetomany[index].fields.forEach(field => {
604
+ if (field.label === '选择材料') {
605
+ field.options = res.data.map(item => {
606
+ return {
607
+ 'label': `${item.f_material_name}--${item.f_material_style}--${item.f_material_unit}`,
608
+ 'value': item
609
+ }
610
+ })
611
+ }
612
+ })
613
+ },
614
+ // 终止报建初始化·
615
+ async 'stopApplyReadyEvent' () {
616
+
617
+ let f_is_stop = this.getLableValue('是否终止')
618
+
619
+ for (const item of this.show_data.fields) {
620
+ if (f_is_stop === '是') {
621
+ if (item.label === '终止原因') {
622
+ item.hidden = false
623
+ item.required = true
624
+ }
625
+ } else {
626
+ if (item.label === '终止原因') {
627
+ item.hidden = true
628
+ item.required = false
629
+ }
630
+ }
631
+ }
632
+
633
+ if (isEmpty(this.show_data.f_parent_process_id)) {
634
+ return
635
+ }
636
+ let data = {
637
+ condition: `f_process_id = '${this.show_data.f_parent_process_id}'`,
638
+ data: {
639
+ id: this.$login.f.id,
640
+ orgid: this.$login.f.orgid
641
+ }
642
+ }
643
+ let res = await this.$resetpost(
644
+ `rs/sql/supervisory`,
645
+ {data: data},
646
+ {resolveMsg: null, rejectMsg: '项目查询失败!!!'}
647
+ )
648
+ this.show_data.parentApply = res.data[0]
649
+ },
650
+ // 通气点火初始化
651
+ async 'gasReadyEvent' () {
652
+ /*if (!isEmpty(this.show_data.f_price_id)) {
653
+ let priceList = await this.getPrice(this.show_data.f_price_id)
654
+ this.setLabelValue('气价名称', priceList[0].value)
655
+ }*/
656
+
657
+
658
+ // 保险初始化显示内容
659
+ let f_is_insure = this.getLableValue('是否购买保险')
660
+ for (const item of this.show_data.fields) {
661
+ if (f_is_insure === '是') {
662
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
663
+ item.hidden = false
664
+ item.required = true
665
+ }
666
+ if (item.label === '保险备注') {
667
+ item.hidden = false
668
+ }
669
+ } else {
670
+ if (item.label === '保费开始日期' || item.label === '保费结束日期' || item.label === '险种' || item.label === '保费金额') {
671
+ item.hidden = true
672
+ item.required = false
673
+ }
674
+ if (item.label === '保险备注') {
675
+ item.hidden = true
676
+ }
677
+ }
678
+ }
679
+ },
680
+ // 申请节点初始化
681
+ 'applyReadyEvent' () {
682
+ this.$getConfig(this, 'UserAddress')
683
+
684
+ let f_address_type = this.show_data.f_address_type
685
+
686
+ for (const item of this.show_data.fields) {
687
+ if (f_address_type === '民用市区') {
688
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
689
+ item.hidden = false
690
+ item.required = true
691
+ }
692
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
693
+ item.hidden = false
694
+ item.required = false
695
+ }
696
+ if (item.label === '地址') {
697
+ item.readonly = true
698
+ }
699
+ }
700
+ if (f_address_type === '民用乡镇') {
701
+ if (item.label === '区/县' || item.label === '街道/乡镇' || item.label === '集收单位' || item.label === '门牌号') {
702
+ item.hidden = false
703
+ item.required = true
704
+ }
705
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层') {
706
+ item.hidden = false
707
+ item.required = false
708
+ }
709
+ if (item.label === '楼层') {
710
+ item.hidden = true
711
+ item.required = false
712
+ }
713
+ if (item.label === '地址') {
714
+ item.readonly = true
715
+ }
716
+ }
717
+ if (f_address_type === '特殊地址') {
718
+ if (item.label === '区/县' || item.label === '街道/乡镇') {
719
+ item.hidden = false
720
+ item.required = true
721
+ }
722
+ if (item.label === '集收单位') {
723
+ item.hidden = false
724
+ item.required = false
725
+ }
726
+ if (item.label === '楼号/组' || item.label === '单元/排' || item.label === '楼层' || item.label === '门牌号') {
727
+ item.hidden = true
728
+ item.required = false
729
+ }
730
+ if (item.label === '地址') {
731
+ item.readonly = false
732
+ }
733
+ }
734
+
735
+ if (this.show_data.f_apply_source === '线下发起' && item.label === '预约地址') {
736
+ item.hidden = true
737
+ }
738
+ }
739
+ },
740
+ // 失去焦点出触发事件
741
+ 'onchange' (index) {
742
+ if (this.show_data.defname === '报装申请' || this.show_data.defname === '信息确认') {
743
+ if (
744
+ this.show_data.fields[index].label === '区/县' ||
745
+ this.show_data.fields[index].label === '街道/乡镇' ||
746
+ this.show_data.fields[index].label === '集收单位' ||
747
+ this.show_data.fields[index].label === '楼号/组' ||
748
+ this.show_data.fields[index].label === '单元/排' ||
749
+ this.show_data.fields[index].label === '楼层' ||
750
+ this.show_data.fields[index].label === '门牌号'
751
+ ) {
752
+
753
+ let f_pcd = this.getLableValue('区/县') || ''
754
+ let f_street = this.getLableValue('街道/乡镇') || ''
755
+ let f_residential_area = this.getLableValue('集收单位') || ''
756
+ let f_building = this.getLableValue('楼号/组') || ''
757
+ let f_building_suffix = f_building ? this.config.f_building_suffix : ''
758
+ let f_unit = this.getLableValue('单元/排') || ''
759
+ let f_unit_suffix = f_unit ? this.config.f_unit_suffix : ''
760
+ let f_floor = this.getLableValue('楼层') || ''
761
+ let f_floor_suffix = f_floor ? this.config.f_floor_suffix : ''
762
+ let f_room = this.getLableValue('门牌号') || ''
763
+ let f_room_suffix = f_room ? this.config.f_room_suffix : ''
764
+
765
+ 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
766
+ this.setLabelValue("地址", f_address)
767
+ }
768
+ }
769
+ },
770
+ // =============================
771
+ selectSearch (val, index) {},
772
+ 'onblur' (index) {},
773
+ 'oninput' (index) {},
774
+ 'initializtionView' () {},
775
+ async 'onchangeModal' (index, fieldIndex) {
776
+ },
777
+ async 'onblurModal' (index, fieldIndex) {
778
+
779
+ },
780
+ async 'oninputModal' (index, fieldIndex) {
781
+
782
+ },
783
+ async 'onetomanydelete' (index, rowIndex) {
784
+
785
+ let http = new HttpResetClass()
786
+
787
+ let res = await http.load(
788
+ 'DELETE',
789
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}/${this.show_data.onetomany[index].rows[rowIndex].id}`,
790
+ null,
791
+ {resolveMsg: null, rejectMsg: '删除失败!!!'}
792
+ )
793
+
794
+ res = await this.$resetpost(
795
+ 'rs/entity/t_apply',
796
+ this.show_data
797
+ )
798
+
799
+ this.$dispatch('breakControl', this.show_data)
800
+ },
801
+ async 'onetomanyupdate' (index, rowIndex) {
802
+ let data = this.show_data.onetomany[index].rows[rowIndex]
803
+
804
+ this.show_data.onetomany[index].fields.forEach(item => {
805
+ data[item.field] = item.value
806
+ })
807
+ let res = await this.$resetpost(
808
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
809
+ data
810
+ )
811
+
812
+ res = await this.$resetpost(
813
+ 'rs/entity/t_apply',
814
+ this.show_data
815
+ )
816
+
817
+ this.$dispatch('breakControl', this.show_data)
818
+ },
819
+ async 'onetomanyadd' (index) {
820
+ let data = {
821
+ f_process_id : this.show_data.f_process_id,
822
+ f_operator_id: this.$login.f.id,
823
+ f_operator: this.$login.f.name,
824
+ f_operation_date: new Date().Format('yyyy-MM-dd HH:mm:ss'),
825
+ f_orgid: this.$login.f.orgid,
826
+ f_orgname: this.$login.f.orgs
827
+ }
828
+ this.show_data.onetomany[index].fields.forEach(item => {
829
+ data[item.field] = item.value
830
+ })
831
+ let res = await this.$resetpost(
832
+ `rs/entity/${this.show_data.onetomany[index].tables[0]}`,
833
+ data
834
+ )
835
+
836
+ res = await this.$resetpost(
837
+ 'rs/entity/t_apply',
838
+ this.show_data
839
+ )
840
+
841
+ this.$dispatch('breakControl', this.show_data)
842
+ },
843
+ async 'importEvent' (index, table, configName, filepath) {
844
+ let data = {
845
+ selectdata: this.show_data,
846
+ table: table,
847
+ filepath: filepath,
848
+ configName: configName,
849
+ user: this.$login.f
850
+ }
851
+
852
+ let res = await this.$resetpost(
853
+ `rs/logic/importEvent`,
854
+ data
855
+ )
856
+
857
+ this.$dispatch('breakControl', this.show_data)
858
+ },
859
+ 'onbutchange' (index) {
860
+
861
+ },
862
+ 'onbutblur' (index) {
863
+
864
+ },
865
+ 'onbutinput' (index) {
866
+
867
+ }
868
+ },
869
+ watch: {
870
+ deep: true
871
+ }
872
+ }
873
+ </script>
874
+ <style scoped>
875
+ /*清除model中的浮动*/
876
+ .clearfix:after,.clearfix:before{
877
+ display: table;
878
+ }
879
+ .clearfix:after{
880
+ clear: both;
881
+ }
882
+ </style>