apply-clients 4.1.59-weinan → 4.1.61-weinan

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/index.html +30 -30
  2. package/package.json +1 -1
  3. package/src/apply.js +81 -81
  4. package/src/applyAndroid.js +52 -52
  5. package/src/components/app_apply/AppChargeManagement.vue +749 -749
  6. package/src/components/app_apply/AppInstallationDetails.vue +529 -529
  7. package/src/components/app_apply/AppProcessSupervisory.vue +214 -214
  8. package/src/components/app_apply/AppSupervisoryCart.vue +68 -68
  9. package/src/components/app_apply/AppTakePic.vue +146 -146
  10. package/src/components/app_apply/AppdevicesDetails.vue +867 -867
  11. package/src/components/app_apply/ApplyInfo.vue +56 -56
  12. package/src/components/app_apply/ApplyToDoList.vue +292 -292
  13. package/src/components/app_apply/PlaceControler.vue +274 -274
  14. package/src/components/app_apply/ServiceControl.vue +440 -440
  15. package/src/components/app_apply/ServiceView.vue +394 -394
  16. package/src/components/app_apply/materialshoufei.vue +243 -243
  17. package/src/components/product/ApplyCharge/ApplyChargeList.vue +252 -252
  18. package/src/components/product/Process/ExplorationSelect.vue +377 -377
  19. package/src/components/product/Process/ExplorationUser.vue +134 -134
  20. package/src/components/product/Process/Processes/InstallationDetails.vue +515 -515
  21. package/src/components/product/Process/Processes/chargeManagement.vue +545 -545
  22. package/src/components/product/Process/Processes/devicesDetails.vue +843 -843
  23. package/src/components/product/Process/Processes/materialshoufei.vue +5 -0
  24. package/src/components/product/Process/Service/ServiceControl.vue +25 -2
  25. package/src/components/product/Stop/StopApply.vue +101 -101
  26. package/src/components/product/Stop/StopApplyList.vue +266 -266
  27. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +200 -200
  28. package/src/components/product/Supervisory/SupervisoryControl.vue +124 -124
  29. package/src/components/product/Supervisory/SupervisoryList.vue +221 -221
  30. package/src/components/product/VueUtils/ApplyUpload.vue +276 -276
  31. package/src/main.js +25 -25
@@ -1,440 +1,440 @@
1
- <template>
2
- <service-view-app v-ref:service_show :data="show_data" v-if="showview"></service-view-app>
3
- </template>
4
- <script>
5
- import co from 'co'
6
- import Vue from 'vue'
7
- import {HttpResetClass} from 'vue-client'
8
- import {isEmpty} from "../Util";
9
- export default {
10
- title: '报建流程业务控制层',
11
- props: ['selectdata','copydata'],
12
- data () {
13
- return {
14
- data:null, // 数据库数据,json配置文件数据的数据集合
15
- json_datas:null, // Json配置文件集合
16
- showview:false, // 控制显示service-view组件
17
- show_data:null, // 给view层显示的数据
18
- department_search:null // 当前部门下所有人
19
- }
20
- },
21
- methods: {
22
- // 特殊化处理
23
- async special(model){
24
- console.log('进入async special方法')
25
- if(this.data.distribute_async && model.button.button_name==='下发'){
26
- // 流程异步处理
27
- let http = new HttpResetClass();
28
- let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
29
- console.log("流程的异步处理:",JSON.stringify(res.data))
30
- }
31
- if(this.data.distribute_async && model.button.button_name==='完成'){
32
- // 强制结束
33
- let http = new HttpResetClass();
34
- let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
35
- console.log("流程的异步处理:",JSON.stringify(res.data))
36
- }
37
- },
38
- // 组件初始化操作
39
- async refurbish(){
40
- let http = new HttpResetClass()
41
- let xmldata = {
42
- data: Vue.user,
43
- workname: this.selectdata.processname
44
- }
45
- let res = await http.load('POST', this.$androidUtil.getProxyUrl() +'/rs/logic/ApplyGetConfigs', {data: xmldata}, {resolveMsg: null, rejectMsg: null})
46
- if (res.data.code && res.data.code === 200) {
47
- Vue.prototype.$workflow_vue = res.data.workflow_vue
48
- } else {
49
- this.$showMessage('获取报建配置失败,原因:' + res.data.msg)
50
- return
51
- }
52
- if(!this.$workflow_vue){
53
- this.$showMessage('流程配置文件不存在,请反馈系统管理员')
54
- return
55
- }
56
- console.log('内存中的流程配置文件数据=>' + JSON.stringify(this.$workflow_vue))
57
- this.json_datas=this.$workflow_vue
58
- let sum = 0
59
- let jsonData ={}
60
- console.log(this.selectdata)
61
- for(let i=0;i<this.json_datas.activitys.length;i++){
62
- if(this.selectdata.defname==this.json_datas.activitys[i].title){
63
- jsonData = this.json_datas.activitys[i]
64
- sum++
65
- }
66
- }
67
- console.log('sum=>' + sum)
68
- if(sum==1){
69
- this.data =null
70
- this.data = jsonData
71
- console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
72
- this.initializtion()
73
-
74
- } else if(sum==0) {
75
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
76
- } else {
77
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
78
- }
79
- },
80
- // json配置数据处理 比如下拉框的options
81
- async initializtion() {
82
- console.log('进入initializtion()方法')
83
- // 下发人 options 处理,options初始化
84
- /*if(this.selectdata.actorexpression){
85
- let http = new HttpResetClass()
86
- var url = this.$androidUtil.getProxyUrl() + '/rs/search'
87
- console.log('即将请求后台获取下发人员,url=>' + url)
88
- let res = await http.load('POST', url, this.selectdata.actorexpression, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
89
- console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
90
- let jsonString = JSON.stringify(res.data)
91
- let jsonArray = []
92
- if(jsonString.startsWith("{")){
93
- jsonArray.push(res.data)
94
- res.data = jsonArray
95
- }
96
- this.department_search = res.data
97
- }*/
98
-
99
- // data 填充 selectdata
100
- console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
101
- this.data = Object.assign({},this.data, this.selectdata)
102
- console.log('this.data的值=>' + JSON.stringify(this.data))
103
-
104
- // 初始化 fields
105
- console.log('this.data.fields.length=>' + this.data.fields.length)
106
- for(let i=0;i<this.data.fields.length;i++){
107
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
108
- if(this.selectdata[this.data.fields[i].field]){
109
- this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
110
- }
111
- // 如果配置类型为select,优先从参数列表获取options
112
- if (this.data.fields[i].type === 'select') {
113
- if (this.data.fields[i].param) {
114
- let temp = this.$appdata.getParam(this.data.fields[i].label)
115
-
116
- if (temp && temp.length > 0) {
117
- this.data.fields[i].options = temp
118
- }
119
-
120
- if (this.data.fields[i].paramLabel) {
121
- temp = this.$appdata.getParam(this.data.fields[i].paramLabel)
122
- if (temp && temp.length > 0) {
123
- this.data.fields[i].options = temp
124
- }
125
- }
126
- }
127
- if (this.data.fields[i].ready) {
128
- this.data.fields[i].options = await this[this.data.fields[i].ready]()
129
- }
130
- }
131
- }
132
- // 初始化 buttons_fields
133
- for(let i=0;i<this.data.buttons.length;i++){
134
- if(this.data.buttons[i].button_fields){
135
- for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
136
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
137
- if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
138
- this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
139
- }
140
- // 如果配置类型为select,优先从参数列表获取options
141
- if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
142
- this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
143
- }
144
- // 下发特殊配置
145
- if(this.data.buttons[i].button_name==='下发'){
146
- if(this.data.buttons[i].button_fields.length===1){
147
- // value初始化
148
- // if(this.department_search){
149
- if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
150
- for(let k=0;k<this.department_search.length;k++){
151
- // 将id转换为name
152
- if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
153
- this.data.buttons[i].button_fields[0].value=this.department_search[k].name
154
- }
155
- }
156
- }
157
-
158
- if(this.department_search){
159
- let array = []
160
- for(let k=0;k<this.department_search.length;k++){
161
- array.push({label:this.department_search[k].name,value:this.department_search[k].name})
162
- }
163
- this.data.buttons[i].button_fields[0].options = array
164
- }
165
- }else {
166
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
167
- }
168
- }
169
- }
170
- }
171
- }
172
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
173
- let temp = JSON.parse(JSON.stringify(this.data))
174
- // 退回原因展示
175
- if(this.selectdata.f_back_reason){
176
- temp['back_reason'] = this.selectdata.f_back_reason
177
- }
178
- console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
179
- if (this.show_data==null){
180
- this.show_data = temp
181
- }
182
- console.log('initializtion()方法结束,showview')
183
- this.showview = true
184
- if (this.selectdata.defname === '现场勘察' || this.selectdata.defname ==='入户安装') {
185
- for (const item of this.show_data.fields) {
186
- if (item.label === '现场勘察人员' && !item.value) {
187
- return item.value = Vue.user.name
188
- }
189
- }
190
- }
191
- },
192
- deleteLocalApply(model){
193
- console.log(`前台上传完成,开始删除本地报建工单`)
194
- this.$androidUtil.bzLogic('deleteApply', {data:model})
195
- },
196
- stopapply(model1,model){
197
- this.$showMessage('确定不具备条件,终止报建!',['confirm', 'cancel']).then((res)=>{
198
- if (res=='confirm'){
199
- this.selectdata = Object.assign( {},this.selectdata,model)
200
- let data = {
201
- loginUser: Vue.user,
202
- selectdata: this.selectdata,
203
- model: model1
204
- }
205
- let http = new HttpResetClass()
206
- http.load('POST', this.$androidUtil.getProxyUrl()+'/rs/logic/stopApply', {data: data}, {resolveMsg: null,rejectMsg: '删除失败'})
207
- .then(res => {
208
- if (res.data === 200) {
209
- this.$dispatch('search')
210
- this.$dispatch('close')
211
- } else {
212
- this.$showMessage('终止报建失败')
213
- }
214
- })
215
- }
216
- })
217
- },
218
- // 获取气价
219
- async getPrice(f_price_id) {
220
- let data = {
221
- condition: `sp.f_orgid = '${Vue.user.orgid}'`
222
- }
223
-
224
- if (!isEmpty(f_price_id)) {
225
- data.condition = `sp.f_orgid = '${Vue.user.orgid}' and sp.f_price_id = ${f_price_id}`
226
- }
227
- let http = new HttpResetClass()
228
- let res = await http.load(
229
- 'POST',
230
- this.$androidUtil.getProxyUrl() +`/rs/sql/applyGetPrice`,
231
- {data: data},
232
- {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
233
- )
234
-
235
- return res.data.map(item => {
236
- return {
237
- label: item.f_price_name,
238
- value: item
239
- }
240
- })
241
- },
242
- getLableValue(label) {
243
- for (const item of this.show_data.fields) {
244
- if (item.label === label && item.type !== 'number') {
245
- return item.value || ''
246
- }
247
- if (item.label === label && item.type === 'number') {
248
- return item.value || 0
249
- }
250
- }
251
- },
252
- setLabelValue(label, value) {
253
- for (const item of this.show_data.fields) {
254
- if (item.label === label) {
255
- item.value = value
256
- }
257
- }
258
- },
259
- },
260
- events: {
261
- // 选择气价
262
- 'priceChange'(index) {
263
- /* if (isEmpty(this.show_data.f_stair_price_name)) {
264
- return
265
- }*/
266
- let stairPrice = this.getLableValue('气价名称')
267
- console.log("气价信息", stairPrice)
268
- this.setLabelValue('气价类型', stairPrice.f_price_type)
269
- this.setLabelValue('用气性质', stairPrice.f_gasproperties)
270
- this.setLabelValue('气价', stairPrice.f_price)
271
-
272
-
273
- this.selectdata.f_price_id = stairPrice.f_price_id
274
- this.selectdata.f_price_name = stairPrice.f_price_name
275
- this.$refs.service_show.update()
276
- },
277
- // 任意select选中时触发事件
278
- 'select_cascade'(index){
279
- if (this.data.f_apply_type === '居民报建'&&this.data.fields[index].label === '是否具备安装条件'&& this.show_data.fields[index].value === '否') {
280
- this.show_data.fields[index+9].required = false
281
- this.show_data.fields[index+10].required = false
282
- this.show_data.fields[index+11].required = false
283
- this.show_data.fields[index+12].required = false
284
- this.show_data.fields[index+13].required = false
285
- }else if (this.data.fields[index].label === '居民报建'&&this.data.fields[index].label === '是否具备安装条件'&& this.show_data.fields[index].value === '是') {
286
- this.show_data.fields[index+9].required = true
287
- this.show_data.fields[index+10].required = true
288
- this.show_data.fields[index+11].required = true
289
- this.show_data.fields[index+12].required = true
290
- this.show_data.fields[index+13].required = true
291
- }
292
- // this.$refs.service_show.model_temp // 子业务显示组件
293
- // 级联操作示例:
294
- /*
295
- if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
296
- for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
297
- // 控制设置级联
298
- // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
299
- if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
300
- this.$refs.service_show.model_temp.activitys.fields[i].options=[
301
- {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
302
- ]
303
- }
304
- }
305
- }
306
- */
307
- },
308
- // 获取view层button事件
309
- async 'button'(model){
310
- console.log('进入async button事件方法')
311
- var delteLocal = true
312
- // 点击保存与重置按钮不需要修改本地工单状态
313
- if(model.button.button_name == '保存' || model.button.button_name==='重置'){
314
- delteLocal = false
315
- }
316
- // 点击重置按钮就重置数据
317
- if(model.button.button_name==='重置'){
318
- this.initializtion()
319
- return
320
- }
321
- if(model.button.button_name==='下发'){
322
- let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
323
- for(let i=0;i<this.department_search.length;i++){
324
- // 找到人名为person_name 的人,然后把人名换成id
325
- if(this.department_search[i].name === person_name){
326
- model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
327
- }
328
- }
329
- }
330
- console.log("button事件接收参数model=>" + JSON.stringify(model))
331
- model=Object.assign({},this.selectdata,model)
332
- console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
333
- let http = new HttpResetClass()
334
- if((this.selectdata.defname =='现场勘察' || this.selectdata.defname ==='入户安装') && model.f_is_have == '否'&& model.button.button_name == '提交'){
335
- let model1 ={
336
- f_stop_remarks : '不具备安装条件'
337
- }
338
- this.stopapply(model1,model)
339
- return
340
- }
341
- if((this.selectdata.defname =='现场勘察' || this.selectdata.defname ==='入户安装') && model.f_is_aerate == '否' && model.button.button_name == '提交'){
342
- let model1 ={
343
- f_stop_remarks : '未通气'
344
- }
345
- this.stopapply(model1,model)
346
- return
347
- }
348
- if( this.selectdata.defname ==='入户安装'&& model.button.button_name == '提交'){
349
- let data1 = {
350
- tablename: 't_userfiles',
351
- condition: `f_userinfo_id = '${this.selectdata.f_userinfo_id}'`
352
- }
353
- let res1 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {data: data1}, {resolveMsg: null, rejectMsg: '获取数据失败'})
354
- if (res1<=0){
355
- this.$showMessage("请填写表具信息!!!")
356
- return
357
- }
358
- }
359
- if(this.selectdata.defname =='现场勘察' && this.selectdata.f_apply_type == '工商户报建'&& model.button.button_name == '提交'){
360
- let http = new HttpResetClass()
361
- let data = {
362
- tablename: 't_files',
363
- condition: `defname = '现场勘察' and f_blobid = '${this.selectdata.f_process_id}'`
364
- }
365
- let res = await http.load('POST', this.$androidUtil.getProxyUrl() + '/rs/sql/singleTable', {data: data}, {
366
- resolveMsg: null,
367
- rejectMsg: '查询失败'
368
- })
369
- console.log("数据长度:" + res.data.length)
370
- if (res.data.length <= 0) {
371
- this.$showMessage("请上传照片!!!")
372
- return
373
- }
374
-
375
- }
376
- var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
377
- // let res = await http.load('POST',url,{data:{tables:this.data.tables,start_activity:this.$workflow_vue.start_activity,model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: null})
378
- // // 先判断是否包含code,如果服务端异常,可能不存在code
379
- // console.log("service处理完成返回数据=>" + res)
380
- // if(!res.code){
381
- // console.log("service处理完成返回数据=>" + res)
382
- // this.$showMessage('操作异常,原因:' + res)
383
- // }else{
384
- // console.log("service处理完成返回数据=>" + JSON.stringify(res))
385
- // if(res.code = 200){
386
- // this.showview = false
387
- // // 特殊处理
388
- // this.special(model)
389
- // this.$dispatch('close')
390
- // this.initializtion()
391
- // this.$showMessage('操作成功')
392
- // }else{
393
- // this.$showMessage('操作失败,原因:' + res.data.msg)
394
- // }
395
- // }
396
- let btn = btn_operate(this, url, http, model, delteLocal)
397
- co(btn)
398
- }
399
- },
400
- watch:{
401
- // 监听selectdata的变化
402
- 'selectdata'() {
403
- console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
404
- if(this.copydata!=null){
405
- this.show_data=this.copydata
406
- this.refurbish()
407
- }else{
408
- this.refurbish()
409
- }
410
- },
411
- deep:true
412
- }
413
- }
414
-
415
- let btn_operate = function * (self, url, http, model, delteLocal) {
416
- // 下发,提交,保存,退回都在后台处理
417
- console.log('即将请求后台url=>' + url)
418
- http.load('POST',url,{data:{tables:self.data.tables,start_activity:self.$workflow_vue.start_activity,model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: null})
419
- .then((res) => {
420
- console.log(JSON.stringify(res))
421
- if(res.code = 200){
422
- self.showview = false
423
- // 如果需要删除本地记录则去删除
424
- if(delteLocal){
425
- self.deleteLocalApply(model)
426
- }
427
- // 特殊处理
428
- self.special(model)
429
- self.$dispatch('close')
430
- self.initializtion()
431
- self.$showMessage('操作成功')
432
- }else{
433
- self.$showMessage('操作失败,原因:' + res.data.msg)
434
- }
435
- })
436
- .catch((ret) => {
437
- self.$showMessage('操作异常,原因:' + JSON.stringify(ret.data))
438
- })
439
- }
440
- </script>
1
+ <template>
2
+ <service-view-app v-ref:service_show :data="show_data" v-if="showview"></service-view-app>
3
+ </template>
4
+ <script>
5
+ import co from 'co'
6
+ import Vue from 'vue'
7
+ import {HttpResetClass} from 'vue-client'
8
+ import {isEmpty} from "../Util";
9
+ export default {
10
+ title: '报建流程业务控制层',
11
+ props: ['selectdata','copydata'],
12
+ data () {
13
+ return {
14
+ data:null, // 数据库数据,json配置文件数据的数据集合
15
+ json_datas:null, // Json配置文件集合
16
+ showview:false, // 控制显示service-view组件
17
+ show_data:null, // 给view层显示的数据
18
+ department_search:null // 当前部门下所有人
19
+ }
20
+ },
21
+ methods: {
22
+ // 特殊化处理
23
+ async special(model){
24
+ console.log('进入async special方法')
25
+ if(this.data.distribute_async && model.button.button_name==='下发'){
26
+ // 流程异步处理
27
+ let http = new HttpResetClass();
28
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
29
+ console.log("流程的异步处理:",JSON.stringify(res.data))
30
+ }
31
+ if(this.data.distribute_async && model.button.button_name==='完成'){
32
+ // 强制结束
33
+ let http = new HttpResetClass();
34
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
35
+ console.log("流程的异步处理:",JSON.stringify(res.data))
36
+ }
37
+ },
38
+ // 组件初始化操作
39
+ async refurbish(){
40
+ let http = new HttpResetClass()
41
+ let xmldata = {
42
+ data: Vue.user,
43
+ workname: this.selectdata.processname
44
+ }
45
+ let res = await http.load('POST', this.$androidUtil.getProxyUrl() +'/rs/logic/ApplyGetConfigs', {data: xmldata}, {resolveMsg: null, rejectMsg: null})
46
+ if (res.data.code && res.data.code === 200) {
47
+ Vue.prototype.$workflow_vue = res.data.workflow_vue
48
+ } else {
49
+ this.$showMessage('获取报建配置失败,原因:' + res.data.msg)
50
+ return
51
+ }
52
+ if(!this.$workflow_vue){
53
+ this.$showMessage('流程配置文件不存在,请反馈系统管理员')
54
+ return
55
+ }
56
+ console.log('内存中的流程配置文件数据=>' + JSON.stringify(this.$workflow_vue))
57
+ this.json_datas=this.$workflow_vue
58
+ let sum = 0
59
+ let jsonData ={}
60
+ console.log(this.selectdata)
61
+ for(let i=0;i<this.json_datas.activitys.length;i++){
62
+ if(this.selectdata.defname==this.json_datas.activitys[i].title){
63
+ jsonData = this.json_datas.activitys[i]
64
+ sum++
65
+ }
66
+ }
67
+ console.log('sum=>' + sum)
68
+ if(sum==1){
69
+ this.data =null
70
+ this.data = jsonData
71
+ console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
72
+ this.initializtion()
73
+
74
+ } else if(sum==0) {
75
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
76
+ } else {
77
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
78
+ }
79
+ },
80
+ // json配置数据处理 比如下拉框的options
81
+ async initializtion() {
82
+ console.log('进入initializtion()方法')
83
+ // 下发人 options 处理,options初始化
84
+ /*if(this.selectdata.actorexpression){
85
+ let http = new HttpResetClass()
86
+ var url = this.$androidUtil.getProxyUrl() + '/rs/search'
87
+ console.log('即将请求后台获取下发人员,url=>' + url)
88
+ let res = await http.load('POST', url, this.selectdata.actorexpression, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
89
+ console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
90
+ let jsonString = JSON.stringify(res.data)
91
+ let jsonArray = []
92
+ if(jsonString.startsWith("{")){
93
+ jsonArray.push(res.data)
94
+ res.data = jsonArray
95
+ }
96
+ this.department_search = res.data
97
+ }*/
98
+
99
+ // data 填充 selectdata
100
+ console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
101
+ this.data = Object.assign({},this.data, this.selectdata)
102
+ console.log('this.data的值=>' + JSON.stringify(this.data))
103
+
104
+ // 初始化 fields
105
+ console.log('this.data.fields.length=>' + this.data.fields.length)
106
+ for(let i=0;i<this.data.fields.length;i++){
107
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
108
+ if(this.selectdata[this.data.fields[i].field]){
109
+ this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
110
+ }
111
+ // 如果配置类型为select,优先从参数列表获取options
112
+ if (this.data.fields[i].type === 'select') {
113
+ if (this.data.fields[i].param) {
114
+ let temp = this.$appdata.getParam(this.data.fields[i].label)
115
+
116
+ if (temp && temp.length > 0) {
117
+ this.data.fields[i].options = temp
118
+ }
119
+
120
+ if (this.data.fields[i].paramLabel) {
121
+ temp = this.$appdata.getParam(this.data.fields[i].paramLabel)
122
+ if (temp && temp.length > 0) {
123
+ this.data.fields[i].options = temp
124
+ }
125
+ }
126
+ }
127
+ if (this.data.fields[i].ready) {
128
+ this.data.fields[i].options = await this[this.data.fields[i].ready]()
129
+ }
130
+ }
131
+ }
132
+ // 初始化 buttons_fields
133
+ for(let i=0;i<this.data.buttons.length;i++){
134
+ if(this.data.buttons[i].button_fields){
135
+ for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
136
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
137
+ if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
138
+ this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
139
+ }
140
+ // 如果配置类型为select,优先从参数列表获取options
141
+ if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
142
+ this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
143
+ }
144
+ // 下发特殊配置
145
+ if(this.data.buttons[i].button_name==='下发'){
146
+ if(this.data.buttons[i].button_fields.length===1){
147
+ // value初始化
148
+ // if(this.department_search){
149
+ if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
150
+ for(let k=0;k<this.department_search.length;k++){
151
+ // 将id转换为name
152
+ if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
153
+ this.data.buttons[i].button_fields[0].value=this.department_search[k].name
154
+ }
155
+ }
156
+ }
157
+
158
+ if(this.department_search){
159
+ let array = []
160
+ for(let k=0;k<this.department_search.length;k++){
161
+ array.push({label:this.department_search[k].name,value:this.department_search[k].name})
162
+ }
163
+ this.data.buttons[i].button_fields[0].options = array
164
+ }
165
+ }else {
166
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
167
+ }
168
+ }
169
+ }
170
+ }
171
+ }
172
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
173
+ let temp = JSON.parse(JSON.stringify(this.data))
174
+ // 退回原因展示
175
+ if(this.selectdata.f_back_reason){
176
+ temp['back_reason'] = this.selectdata.f_back_reason
177
+ }
178
+ console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
179
+ if (this.show_data==null){
180
+ this.show_data = temp
181
+ }
182
+ console.log('initializtion()方法结束,showview')
183
+ this.showview = true
184
+ if (this.selectdata.defname === '现场勘察' || this.selectdata.defname ==='入户安装') {
185
+ for (const item of this.show_data.fields) {
186
+ if (item.label === '现场勘察人员' && !item.value) {
187
+ return item.value = Vue.user.name
188
+ }
189
+ }
190
+ }
191
+ },
192
+ deleteLocalApply(model){
193
+ console.log(`前台上传完成,开始删除本地报建工单`)
194
+ this.$androidUtil.bzLogic('deleteApply', {data:model})
195
+ },
196
+ stopapply(model1,model){
197
+ this.$showMessage('确定不具备条件,终止报建!',['confirm', 'cancel']).then((res)=>{
198
+ if (res=='confirm'){
199
+ this.selectdata = Object.assign( {},this.selectdata,model)
200
+ let data = {
201
+ loginUser: Vue.user,
202
+ selectdata: this.selectdata,
203
+ model: model1
204
+ }
205
+ let http = new HttpResetClass()
206
+ http.load('POST', this.$androidUtil.getProxyUrl()+'/rs/logic/stopApply', {data: data}, {resolveMsg: null,rejectMsg: '删除失败'})
207
+ .then(res => {
208
+ if (res.data === 200) {
209
+ this.$dispatch('search')
210
+ this.$dispatch('close')
211
+ } else {
212
+ this.$showMessage('终止报建失败')
213
+ }
214
+ })
215
+ }
216
+ })
217
+ },
218
+ // 获取气价
219
+ async getPrice(f_price_id) {
220
+ let data = {
221
+ condition: `sp.f_orgid = '${Vue.user.orgid}'`
222
+ }
223
+
224
+ if (!isEmpty(f_price_id)) {
225
+ data.condition = `sp.f_orgid = '${Vue.user.orgid}' and sp.f_price_id = ${f_price_id}`
226
+ }
227
+ let http = new HttpResetClass()
228
+ let res = await http.load(
229
+ 'POST',
230
+ this.$androidUtil.getProxyUrl() +`/rs/sql/applyGetPrice`,
231
+ {data: data},
232
+ {resolveMsg: null, rejectMsg: '气价查询失败!!!'}
233
+ )
234
+
235
+ return res.data.map(item => {
236
+ return {
237
+ label: item.f_price_name,
238
+ value: item
239
+ }
240
+ })
241
+ },
242
+ getLableValue(label) {
243
+ for (const item of this.show_data.fields) {
244
+ if (item.label === label && item.type !== 'number') {
245
+ return item.value || ''
246
+ }
247
+ if (item.label === label && item.type === 'number') {
248
+ return item.value || 0
249
+ }
250
+ }
251
+ },
252
+ setLabelValue(label, value) {
253
+ for (const item of this.show_data.fields) {
254
+ if (item.label === label) {
255
+ item.value = value
256
+ }
257
+ }
258
+ },
259
+ },
260
+ events: {
261
+ // 选择气价
262
+ 'priceChange'(index) {
263
+ /* if (isEmpty(this.show_data.f_stair_price_name)) {
264
+ return
265
+ }*/
266
+ let stairPrice = this.getLableValue('气价名称')
267
+ console.log("气价信息", stairPrice)
268
+ this.setLabelValue('气价类型', stairPrice.f_price_type)
269
+ this.setLabelValue('用气性质', stairPrice.f_gasproperties)
270
+ this.setLabelValue('气价', stairPrice.f_price)
271
+
272
+
273
+ this.selectdata.f_price_id = stairPrice.f_price_id
274
+ this.selectdata.f_price_name = stairPrice.f_price_name
275
+ this.$refs.service_show.update()
276
+ },
277
+ // 任意select选中时触发事件
278
+ 'select_cascade'(index){
279
+ if (this.data.f_apply_type === '居民报建'&&this.data.fields[index].label === '是否具备安装条件'&& this.show_data.fields[index].value === '否') {
280
+ this.show_data.fields[index+9].required = false
281
+ this.show_data.fields[index+10].required = false
282
+ this.show_data.fields[index+11].required = false
283
+ this.show_data.fields[index+12].required = false
284
+ this.show_data.fields[index+13].required = false
285
+ }else if (this.data.fields[index].label === '居民报建'&&this.data.fields[index].label === '是否具备安装条件'&& this.show_data.fields[index].value === '是') {
286
+ this.show_data.fields[index+9].required = true
287
+ this.show_data.fields[index+10].required = true
288
+ this.show_data.fields[index+11].required = true
289
+ this.show_data.fields[index+12].required = true
290
+ this.show_data.fields[index+13].required = true
291
+ }
292
+ // this.$refs.service_show.model_temp // 子业务显示组件
293
+ // 级联操作示例:
294
+ /*
295
+ if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
296
+ for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
297
+ // 控制设置级联
298
+ // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
299
+ if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
300
+ this.$refs.service_show.model_temp.activitys.fields[i].options=[
301
+ {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
302
+ ]
303
+ }
304
+ }
305
+ }
306
+ */
307
+ },
308
+ // 获取view层button事件
309
+ async 'button'(model){
310
+ console.log('进入async button事件方法')
311
+ var delteLocal = true
312
+ // 点击保存与重置按钮不需要修改本地工单状态
313
+ if(model.button.button_name == '保存' || model.button.button_name==='重置'){
314
+ delteLocal = false
315
+ }
316
+ // 点击重置按钮就重置数据
317
+ if(model.button.button_name==='重置'){
318
+ this.initializtion()
319
+ return
320
+ }
321
+ if(model.button.button_name==='下发'){
322
+ let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
323
+ for(let i=0;i<this.department_search.length;i++){
324
+ // 找到人名为person_name 的人,然后把人名换成id
325
+ if(this.department_search[i].name === person_name){
326
+ model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
327
+ }
328
+ }
329
+ }
330
+ console.log("button事件接收参数model=>" + JSON.stringify(model))
331
+ model=Object.assign({},this.selectdata,model)
332
+ console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
333
+ let http = new HttpResetClass()
334
+ if((this.selectdata.defname =='现场勘察' || this.selectdata.defname ==='入户安装') && model.f_is_have == '否'&& model.button.button_name == '提交'){
335
+ let model1 ={
336
+ f_stop_remarks : '不具备安装条件'
337
+ }
338
+ this.stopapply(model1,model)
339
+ return
340
+ }
341
+ if((this.selectdata.defname =='现场勘察' || this.selectdata.defname ==='入户安装') && model.f_is_aerate == '否' && model.button.button_name == '提交'){
342
+ let model1 ={
343
+ f_stop_remarks : '未通气'
344
+ }
345
+ this.stopapply(model1,model)
346
+ return
347
+ }
348
+ if( this.selectdata.defname ==='入户安装'&& model.button.button_name == '提交'){
349
+ let data1 = {
350
+ tablename: 't_userfiles',
351
+ condition: `f_userinfo_id = '${this.selectdata.f_userinfo_id}'`
352
+ }
353
+ let res1 = await http.load('POST', `${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {data: data1}, {resolveMsg: null, rejectMsg: '获取数据失败'})
354
+ if (res1<=0){
355
+ this.$showMessage("请填写表具信息!!!")
356
+ return
357
+ }
358
+ }
359
+ if(this.selectdata.defname =='现场勘察' && this.selectdata.f_apply_type == '工商户报建'&& model.button.button_name == '提交'){
360
+ let http = new HttpResetClass()
361
+ let data = {
362
+ tablename: 't_files',
363
+ condition: `defname = '现场勘察' and f_blobid = '${this.selectdata.f_process_id}'`
364
+ }
365
+ let res = await http.load('POST', this.$androidUtil.getProxyUrl() + '/rs/sql/singleTable', {data: data}, {
366
+ resolveMsg: null,
367
+ rejectMsg: '查询失败'
368
+ })
369
+ console.log("数据长度:" + res.data.length)
370
+ if (res.data.length <= 0) {
371
+ this.$showMessage("请上传照片!!!")
372
+ return
373
+ }
374
+
375
+ }
376
+ var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
377
+ // let res = await http.load('POST',url,{data:{tables:this.data.tables,start_activity:this.$workflow_vue.start_activity,model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: null})
378
+ // // 先判断是否包含code,如果服务端异常,可能不存在code
379
+ // console.log("service处理完成返回数据=>" + res)
380
+ // if(!res.code){
381
+ // console.log("service处理完成返回数据=>" + res)
382
+ // this.$showMessage('操作异常,原因:' + res)
383
+ // }else{
384
+ // console.log("service处理完成返回数据=>" + JSON.stringify(res))
385
+ // if(res.code = 200){
386
+ // this.showview = false
387
+ // // 特殊处理
388
+ // this.special(model)
389
+ // this.$dispatch('close')
390
+ // this.initializtion()
391
+ // this.$showMessage('操作成功')
392
+ // }else{
393
+ // this.$showMessage('操作失败,原因:' + res.data.msg)
394
+ // }
395
+ // }
396
+ let btn = btn_operate(this, url, http, model, delteLocal)
397
+ co(btn)
398
+ }
399
+ },
400
+ watch:{
401
+ // 监听selectdata的变化
402
+ 'selectdata'() {
403
+ console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
404
+ if(this.copydata!=null){
405
+ this.show_data=this.copydata
406
+ this.refurbish()
407
+ }else{
408
+ this.refurbish()
409
+ }
410
+ },
411
+ deep:true
412
+ }
413
+ }
414
+
415
+ let btn_operate = function * (self, url, http, model, delteLocal) {
416
+ // 下发,提交,保存,退回都在后台处理
417
+ console.log('即将请求后台url=>' + url)
418
+ http.load('POST',url,{data:{tables:self.data.tables,start_activity:self.$workflow_vue.start_activity,model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: null})
419
+ .then((res) => {
420
+ console.log(JSON.stringify(res))
421
+ if(res.code = 200){
422
+ self.showview = false
423
+ // 如果需要删除本地记录则去删除
424
+ if(delteLocal){
425
+ self.deleteLocalApply(model)
426
+ }
427
+ // 特殊处理
428
+ self.special(model)
429
+ self.$dispatch('close')
430
+ self.initializtion()
431
+ self.$showMessage('操作成功')
432
+ }else{
433
+ self.$showMessage('操作失败,原因:' + res.data.msg)
434
+ }
435
+ })
436
+ .catch((ret) => {
437
+ self.$showMessage('操作异常,原因:' + JSON.stringify(ret.data))
438
+ })
439
+ }
440
+ </script>