apply-clients 5.0.35-5 → 5.0.35-50

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 (82) hide show
  1. package/.eslintrc.js +16 -16
  2. package/package.json +3 -3
  3. package/src/AndroidApp.vue +28 -28
  4. package/src/android.js +1 -1
  5. package/src/apply.js +14 -1
  6. package/src/assets//347/224/250/346/210/267/345/234/260/345/235/200.png +0 -0
  7. package/src/assets//347/224/250/346/210/267/345/247/223/345/220/215.png +0 -0
  8. package/src/assets//347/224/250/346/210/267/347/224/265/350/257/235.png +0 -0
  9. package/src/components/app_apply/ApplyDownList.vue +168 -164
  10. package/src/components/app_apply/ApplyInfo.vue +56 -56
  11. package/src/components/app_apply/ApplyListUpload.vue +268 -268
  12. package/src/components/app_apply/ApplyToDoList.vue +2656 -6
  13. package/src/components/app_apply/OneToMany.vue +194 -0
  14. package/src/components/app_apply/PlaceControler.vue +299 -256
  15. package/src/components/app_apply/ServiceControl.vue +350 -335
  16. package/src/components/app_apply/ServiceView.vue +383 -383
  17. package/src/components/app_apply/ezhou/FeiMinYongV.vue +109 -109
  18. package/src/components/app_apply/ezhou/FeiMinYongVV.vue +100 -100
  19. package/src/components/app_apply/ezhou/MinYong.vue +92 -92
  20. package/src/components/app_apply/ezhou/ServiceView.vue +790 -620
  21. package/src/components/image/doc.jpg +0 -0
  22. package/src/components/image/dwg.png +0 -0
  23. package/src/components/image/dxf.png +0 -0
  24. package/src/components/image/excel.jpg +0 -0
  25. package/src/components/image/pdf.jpg +0 -0
  26. package/src/components/product/Common/ApplyValidateBill.vue +13 -6
  27. package/src/components/product/Common/PrintBill.vue +3 -2
  28. package/src/components/product/EngineeringManagement/EngineerUpload.vue +304 -0
  29. package/src/components/product/EngineeringManagement/EngineeringManagement.vue +137 -0
  30. package/src/components/product/EngineeringManagement/EngineeringSelect.vue +588 -0
  31. package/src/components/product/EngineeringSupervisory/EngineeringApplyStopInfo.vue +281 -0
  32. package/src/components/product/EngineeringSupervisory/EngineeringSupervisoryControl.vue +130 -0
  33. package/src/components/product/EngineeringSupervisory/EngineeringSupervisoryList.vue +350 -0
  34. package/src/components/product/Function/InstallInfoSelect.vue +255 -254
  35. package/src/components/product/Function/Service/FunctionServiceControl.vue +37 -1
  36. package/src/components/product/Function/functions/ApplyUpload.vue +556 -0
  37. package/src/components/product/Function/functions/InstallFee.vue +546 -343
  38. package/src/components/product/Process/ExplorationSelect.vue +640 -636
  39. package/src/components/product/Process/Processes/CustomerRecordMessage.vue +2 -5
  40. package/src/components/product/Process/Processes/Service/ApplyChargeSearch.vue +123 -37
  41. package/src/components/product/Process/Processes/Service/PaperTicketBill.vue +85 -0
  42. package/src/components/product/Process/Processes/Service/ServiceControl.vue +2056 -1808
  43. package/src/components/product/ServiceView.vue +16 -6
  44. package/src/components/product/Supervisory/Service/SupervisoryServiceControl.vue +53 -6
  45. package/src/components/product/Supervisory/SupervisoryList.vue +350 -349
  46. package/src/components/product/applyReport/ApplyReport.vue +205 -0
  47. package/src/components/product/applyReport/PrintApplyReport.vue +116 -0
  48. package/src/components/product/stopInfo/ApplyStopInfo.vue +281 -280
  49. package/src/ezhouAndroid.js +13 -10
  50. package/src/index.js +8 -8
  51. package/src/main.js +32 -32
  52. package/src/plugins/commonService.js +11 -7
  53. package/static/newStyle/clear.png +0 -0
  54. package/static/newStyle/fife.png +0 -0
  55. package/static/newStyle/hidden.png +0 -0
  56. package/static/newStyle/label-clear.png +0 -0
  57. package/static/newStyle/left-img.png +0 -0
  58. package/static/newStyle/list_ok.png +0 -0
  59. package/static/newStyle/login-check.png +0 -0
  60. package/static/newStyle/login-con.png +0 -0
  61. package/static/newStyle/login-do.gif +0 -0
  62. package/static/newStyle/login-f.png +0 -0
  63. package/static/newStyle/login-info.png +0 -0
  64. package/static/newStyle/login-left.png +0 -0
  65. package/static/newStyle/login-org.png +0 -0
  66. package/static/newStyle/login-pwd.png +0 -0
  67. package/static/newStyle/login-user.png +0 -0
  68. package/static/newStyle/loginbg.gif +0 -0
  69. package/static/newStyle/loginbg1280.gif +0 -0
  70. package/static/newStyle/loginbg1366.gif +0 -0
  71. package/static/newStyle/loginbg_1.gif +0 -0
  72. package/static/newStyle/searchin.png +0 -0
  73. package/static/newStyle/searchout.png +0 -0
  74. package/static/newStyle/setting.png +0 -0
  75. package/static/newStyle/setting1.png +0 -0
  76. package/static/newStyle/shirk.png +0 -0
  77. package/static/newStyle/stretch_bottom.png +0 -0
  78. package/static/newStyle/stretch_left.png +0 -0
  79. package/static/newStyle/stretch_right.png +0 -0
  80. package/static/newStyle/stretch_top.png +0 -0
  81. package/static/newStyle/system-off.png +0 -0
  82. package/static/newStyle//350/261/252/344/275/263/347/207/203/346/260/224.png +0 -0
@@ -1,335 +1,350 @@
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
- export default {
9
- title: '报建流程业务控制层',
10
- props: ['selectdata'],
11
- data () {
12
- return {
13
- model:'',
14
- delteLocal:false,
15
- data:null, // 数据库数据,json配置文件数据的数据集合
16
- json_datas:null, // Json配置文件集合
17
- showview:false, // 控制显示service-view组件
18
- show_data:null, // 给view层显示的数据
19
- department_search:null // 当前部门下所有人
20
- }
21
- },
22
- methods: {
23
- // 特殊化处理
24
- saveCallBack(jo){
25
- console.log(JSON.stringify(jo))
26
- console.log("hhhhhhhhhhhhhhhhh")
27
- console.log(JSON.stringify(jo))
28
- if(jo.state == 'ok'){
29
- console.log("hhhhhhhhhhhhhhhhh2")
30
- let res = JSON.parse(jo.result)
31
- console.log("hhhhhhhhhhhhhhhhh3")
32
- if(res.code = 200){
33
- this.showview = false
34
- // 如果需要删除本地记录则去删除
35
- console.log("hhhhhhhhhhhhhhhhh4")
36
- if(this.delteLocal){
37
- console.log("hhhhhhhhhhhhhhhhh5")
38
- this.deleteLocalApply(this.model)
39
- }
40
- console.log("hhhhhhhhhhhhhhhhh6")
41
- // 特殊处理
42
- this.special(this.model)
43
- console.log("hhhhhhhhhhhhhhhhh7")
44
-
45
- this.$dispatch('close')
46
- console.log("hhhhhhhhhhhhhhhhh8")
47
- this.initializtion()
48
- console.log("hhhhhhhhhhhhhhhhh9")
49
- this.$showMessage('操作成功')
50
- }else{
51
- this.$showMessage('操作失败,原因:' + res.data.msg)
52
- }
53
- }
54
-
55
- },
56
- async special(model){
57
- console.log('进入async special方法')
58
- if(this.data.distribute_async && model.button.button_name==='下发'){
59
- // 流程异步处理
60
- let http = new HttpResetClass();
61
- let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
62
- console.log("流程的异步处理:",JSON.stringify(res.data))
63
- }
64
- if(this.data.distribute_async && model.button.button_name==='完成'){
65
- // 强制结束
66
- let http = new HttpResetClass();
67
- let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
68
- console.log("流程的异步处理:",JSON.stringify(res.data))
69
- }
70
- },
71
- // 组件初始化操作
72
- refurbish(){
73
- if(!this.$workflow_vue){
74
- this.$showMessage('流程配置文件不存在,请反馈系统管理员')
75
- return
76
- }
77
- console.log('内存中的流程配置文件数据=>' + JSON.stringify(this.$workflow_vue))
78
- this.json_datas=this.$workflow_vue
79
- let sum = 0
80
- let jsonData ={}
81
- for(let i=0;i<this.json_datas.activitys.length;i++){
82
- if(this.selectdata.defname==this.json_datas.activitys[i].title){
83
- jsonData = this.json_datas.activitys[i]
84
- sum++
85
- }
86
- }
87
- console.log('sum=>' + sum)
88
- if(sum==1){
89
- this.data =null
90
- this.data = jsonData
91
- console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
92
- this.initializtion()
93
-
94
- } else if(sum==0) {
95
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
96
- } else {
97
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
98
- }
99
- },
100
- // json配置数据处理 比如下拉框的options
101
- async initializtion() {
102
-
103
- console.log('进入initializtion()方法')
104
- console.log('接收到的selectdata有无变化'+JSON.stringify(this.selectdata))
105
- console.log('接收到的selectdata有无actorexpression'+JSON.stringify(this.selectdata.actorexpression))
106
- // 下发人 options 处理,options初始化
107
- if(this.selectdata.actorexpression){
108
- //截取actorexpression
109
-
110
- let http = new HttpResetClass()
111
- var url = this.$androidUtil.getProxyUrl() + '/rs/search'
112
- console.log('即将请求后台获取下发人员,url=>' + url)
113
- // R(安装员报装)
114
- console.log("777777776"+JSON.stringify(this.selectdata.actorexpression))
115
- let res
116
- if (this.selectdata.actorexpression.startsWith('R')) {
117
- let actorexpression = this.selectdata.actorexpression
118
- //let actorexpression="R(安装员报装)"
119
- let actor = actorexpression.substring(actorexpression.indexOf('(') + 1, actorexpression.indexOf(')'))
120
- console.log("看看角色" + JSON.stringify(actor))
121
- res= await http.load('POST', url, {
122
- source: `tool.getChildrenOfResName($${actor}$)`,
123
- userid: Vue.user.id
124
- }, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
125
- }else{
126
- res = await http.load('POST', url, this.selectdata.actorexpression, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
127
- }
128
- console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
129
- let jsonString = JSON.stringify(res.data)
130
- let jsonArray = []
131
- if(jsonString.startsWith("{")){
132
- jsonArray.push(res.data)
133
- res.data = jsonArray
134
- }
135
- this.department_search = res.data
136
- }
137
-
138
- // data 填充 selectdata
139
- console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
140
- this.data = Object.assign({},this.data, this.selectdata)
141
- console.log('this.data的值=>' + JSON.stringify(this.data))
142
-
143
- // 初始化 fields
144
- console.log('this.data.fields.length=>' + this.data.fields.length)
145
- for(let i=0;i<this.data.fields.length;i++){
146
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
147
- if(this.selectdata[this.data.fields[i].field]){
148
- this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
149
- }
150
- // 如果配置类型为select,优先从参数列表获取options
151
- if(this.data.fields[i].type == 'select'){
152
- console.log('进入下拉框参数获取方法,参数名称=>' + this.data.fields[i].label)
153
- console.log('$appdata中的缓存参数与单值=>' + JSON.stringify(this.$appdata))
154
- var param = this.$appdata.getParam(this.data.fields[i].label)
155
- console.log(param)
156
- this.data.fields[i].options = param
157
-
158
- }
159
- }
160
- // 初始化 buttons_fields
161
- for(let i=0;i<this.data.buttons.length;i++){
162
- if(this.data.buttons[i].button_fields){
163
- for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
164
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
165
- if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
166
- this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
167
- }
168
- // 如果配置类型为select,优先从参数列表获取options
169
- if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
170
- console.log("这里是给select赋值的地方"+JSON.stringify(this.data.buttons[i].button_fields[j]))
171
- console.log("参数列表获取到的"+JSON.stringify(this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)))
172
- this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
173
- }
174
- // 下发特殊配置
175
- if(this.data.buttons[i].button_name==='下发'){
176
- if(this.data.buttons[i].button_fields.length===1){
177
- // value初始化
178
- // if(this.department_search){
179
- console.log("看看111department_search"+JSON.stringify(this.department_search))
180
-
181
- if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
182
-
183
- for(let k=0;k<this.department_search.length;k++){
184
- // 将id转换为name
185
- if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
186
- this.data.buttons[i].button_fields[0].value=this.department_search[k].name
187
- }
188
- }
189
- }
190
-
191
- if(this.department_search){
192
- let array = []
193
- console.log("看看department_search"+JSON.stringify(this.department_search))
194
- this.department_search.forEach((paper)=>{
195
- array.push({label:paper.name,value:paper.name})
196
- })
197
- this.data.buttons[i].button_fields[0].options = array
198
- }
199
- }else {
200
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
201
- }
202
- }
203
- }
204
- }
205
- }
206
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
207
- let temp = JSON.parse(JSON.stringify(this.data))
208
- // 退回原因展示
209
- if(this.selectdata.f_back_reason){
210
- temp['back_reason'] = this.selectdata.f_back_reason
211
- }
212
- console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
213
- this.show_data = temp
214
- console.log('initializtion()方法结束,showview')
215
- this.showview = true
216
- },
217
- deleteLocalApply(model){
218
- console.log(`前台上传完成,开始删除本地报建工单`)
219
- this.$androidUtil.bzLogic('deleteApply', {data:model})
220
- }
221
- },
222
- events: {
223
- // 任意select选中时触发事件
224
- 'select_cascade'(index){
225
- // this.$refs.service_show.model_temp // 子业务显示组件
226
- // 级联操作示例:
227
- /*
228
- if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
229
- for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
230
- // 控制设置级联
231
- // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
232
- if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
233
- this.$refs.service_show.model_temp.activitys.fields[i].options=[
234
- {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
235
- ]
236
- }
237
- }
238
- }
239
- */
240
- },
241
- // 获取view层button事件
242
- async 'button'(model){
243
- console.log('进入async button事件方法')
244
- var delteLocal = true
245
- // 点击保存与重置按钮不需要修改本地工单状态
246
- if(model.button.button_name == '保存' || model.button.button_name==='重置'){
247
- delteLocal = false
248
- }
249
- // 点击重置按钮就重置数据
250
- if(model.button.button_name==='重置'){
251
- this.initializtion()
252
- return
253
- }
254
- if(model.button.button_name==='下发'){
255
- let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
256
- for(let i=0;i<this.department_search.length;i++){
257
- // 找到人名为person_name 的人,然后把人名换成id
258
- if(this.department_search[i].name === person_name){
259
- model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
260
- }
261
- }
262
- }
263
- console.log("button事件接收参数model=>" + JSON.stringify(model))
264
- model=Object.assign({},this.selectdata,model)
265
- console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
266
- let http = new HttpResetClass()
267
- var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
268
- // 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})
269
- // // 先判断是否包含code,如果服务端异常,可能不存在code
270
- // console.log("service处理完成返回数据=>" + res)
271
- // if(!res.code){
272
- // console.log("service处理完成返回数据=>" + res)
273
- // this.$showMessage('操作异常,原因:' + res)
274
- // }else{
275
- // console.log("service处理完成返回数据=>" + JSON.stringify(res))
276
- // if(res.code = 200){
277
- // this.showview = false
278
- // // 特殊处理
279
- // this.special(model)
280
- // this.$dispatch('close')
281
- // this.initializtion()
282
- // this.$showMessage('操作成功')
283
- // }else{
284
- // this.$showMessage('操作失败,原因:' + res.data.msg)
285
- // }
286
- // }
287
- let btn = btn_operate(this, url, http, model, delteLocal)
288
- co(btn)
289
- }
290
- },
291
- watch:{
292
- // 监听selectdata的变化
293
- 'selectdata'() {
294
- console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
295
- this.refurbish()
296
- },
297
- deep:true
298
- }
299
- }
300
-
301
- let btn_operate = function * (self, url, http, model, delteLocal) {
302
- self.delteLocal=delteLocal
303
-
304
- // 下发,提交,保存,退回都在后台处理
305
- console.log('即将请求后台url=>' + url)
306
- model.employeetemplate=''
307
- self.model=model
308
- console.log(JSON.stringify(self.model))
309
- let param={
310
- employeetemplate:'',
311
- tables:self.data.tables,
312
- start_activity:self.$workflow_vue.start_activity,
313
- model:model,loginUser:Vue.user
314
- }
315
- // http.load('POST',url,{data:{employeetemplate:'',tables:self.data.tables,start_activity:self.$workflow_vue.start_activity,model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: null})
316
- let paramStr = JSON.stringify(param)
317
- // 多长截断一次
318
- let subLength = 800
319
- for (let i = 0; i < paramStr.length; i += subLength) {
320
- HostApp.param_cache(paramStr.substr(i, subLength))
321
- }
322
- HostApp.__this__ = self
323
- HostApp.syncLogic({
324
- // logic别名,key必须为logic
325
- 'logic': 'updatePic',
326
- // 回调执行方法名,key必须为callback
327
- 'callback': 'javascript:HostApp.__this__.saveCallBack()',
328
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
329
- // 执行回调方法传入key为backresult
330
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
331
- 'backresult': 1
332
- })
333
-
334
- }
335
- </script>
1
+ <template>
2
+ <div>
3
+ <work-busy :is-busy="loading"></work-busy>
4
+ <service-view-app v-ref:service_show :data.sync="show_data.ppp" :model.sync="selectmodel" v-if="showview"></service-view-app>
5
+ </div>
6
+ </template>
7
+ <script>
8
+ import co from 'co'
9
+ import Vue from 'vue'
10
+ import {HttpResetClass} from 'vue-client'
11
+ export default {
12
+ title: '报建流程业务控制层',
13
+ props: ['selectdata','selectmodel','show_data'],
14
+ data () {
15
+ return {
16
+ model:'',
17
+ delteLocal:false,
18
+ loading:false,
19
+ data:null, // 数据库数据,json配置文件数据的数据集合
20
+ json_datas:null, // Json配置文件集合
21
+ showview:false, // 控制显示service-view组件
22
+ // 给view层显示的数据
23
+ department_search:null // 当前部门下所有人
24
+ }
25
+ },
26
+ methods: {
27
+ // 特殊化处理
28
+ saveCallBack(jo){
29
+ console.log(JSON.stringify(jo))
30
+ console.log("hhhhhhhhhhhhhhhhh")
31
+ console.log(JSON.stringify(jo))
32
+ if(jo.state == 'ok'){
33
+ console.log("hhhhhhhhhhhhhhhhh2")
34
+ let res = JSON.parse(jo.result)
35
+ console.log("hhhhhhhhhhhhhhhhh3")
36
+ if(res.code = 200){
37
+ this.showview = false
38
+ // 如果需要删除本地记录则去删除
39
+ console.log("hhhhhhhhhhhhhhhhh4")
40
+ if(this.delteLocal){
41
+ console.log("hhhhhhhhhhhhhhhhh5")
42
+ this.deleteLocalApply(this.model)
43
+ }
44
+ console.log("hhhhhhhhhhhhhhhhh6")
45
+ // 特殊处理
46
+ this.special(this.model)
47
+ console.log("hhhhhhhhhhhhhhhhh7")
48
+ this.loading=false
49
+ this.$dispatch('close')
50
+ console.log("hhhhhhhhhhhhhhhhh8")
51
+ this.initializtion()
52
+ console.log("hhhhhhhhhhhhhhhhh9")
53
+ this.$showMessage('操作成功')
54
+ }else{
55
+ this.$showMessage('操作失败,原因:' + res.data.msg)
56
+ }
57
+ }
58
+
59
+ },
60
+ async special(model){
61
+ console.log('进入async special方法')
62
+ if(this.data.distribute_async && model.button.button_name==='下发'){
63
+ // 流程异步处理
64
+ let http = new HttpResetClass();
65
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
66
+ console.log("流程的异步处理:",JSON.stringify(res.data))
67
+ }
68
+ if(this.data.distribute_async && model.button.button_name==='完成'){
69
+ // 强制结束
70
+ let http = new HttpResetClass();
71
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
72
+ console.log("流程的异步处理:",JSON.stringify(res.data))
73
+ }
74
+ },
75
+ // 组件初始化操作
76
+ refurbish(){
77
+ if(!this.$workflow_vue){
78
+ this.$showMessage('流程配置文件不存在,请反馈系统管理员')
79
+ return
80
+ }
81
+ console.log('内存中的流程配置文件数据=>' + JSON.stringify(this.$workflow_vue))
82
+ this.json_datas=this.$workflow_vue
83
+ let sum = 0
84
+ let jsonData ={}
85
+ for(let i=0;i<this.json_datas.activitys.length;i++){
86
+ if(this.selectdata.defname==this.json_datas.activitys[i].title){
87
+ jsonData = this.json_datas.activitys[i]
88
+ sum++
89
+ }
90
+ }
91
+ console.log('sum=>' + sum)
92
+ if(sum==1){
93
+ this.data =null
94
+ this.data = jsonData
95
+ console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
96
+ this.initializtion()
97
+
98
+ } else if(sum==0) {
99
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
100
+ } else {
101
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
102
+ }
103
+ },
104
+ // json配置数据处理 比如下拉框的options
105
+ async initializtion() {
106
+
107
+ console.log('进入initializtion()方法')
108
+ console.log('接收到的selectdata有无变化'+JSON.stringify(this.selectdata))
109
+ console.log('接收到的selectdata有无actorexpression'+JSON.stringify(this.selectdata.actorexpression))
110
+ // 下发人 options 处理,options初始化
111
+ if(this.selectdata.actorexpression){
112
+ //截取actorexpression
113
+
114
+ let http = new HttpResetClass()
115
+ var url = this.$androidUtil.getProxyUrl() + '/rs/search'
116
+ console.log('即将请求后台获取下发人员,url=>' + url)
117
+ // R(安装员报装)
118
+ console.log("777777776"+JSON.stringify(this.selectdata.actorexpression))
119
+ let res
120
+ if (this.selectdata.actorexpression.startsWith('R')) {
121
+ let actorexpression = this.selectdata.actorexpression
122
+ //let actorexpression="R(安装员报装)"
123
+ let actor = actorexpression.substring(actorexpression.indexOf('(') + 1, actorexpression.indexOf(')'))
124
+ console.log("看看角色" + JSON.stringify(actor))
125
+ res= await http.load('POST', url, {
126
+ source: `tool.getChildrenOfResName($${actor}$)`,
127
+ userid: Vue.user.id
128
+ }, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
129
+ }else{
130
+ res = await http.load('POST', url, this.selectdata.actorexpression, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
131
+ }
132
+ console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
133
+ let jsonString = JSON.stringify(res.data)
134
+ let jsonArray = []
135
+ if(jsonString.startsWith("{")){
136
+ jsonArray.push(res.data)
137
+ res.data = jsonArray
138
+ }
139
+ this.department_search = res.data
140
+ }
141
+
142
+ // data 填充 selectdata
143
+ console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
144
+ this.data = Object.assign({},this.data, this.selectdata)
145
+ console.log('this.data的值=>' + JSON.stringify(this.data))
146
+
147
+ // 初始化 fields
148
+ console.log('this.data.fields.length=>' + this.data.fields.length)
149
+ for(let i=0;i<this.data.fields.length;i++){
150
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
151
+ if(this.selectdata[this.data.fields[i].field]){
152
+ this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
153
+ }
154
+ // 如果配置类型为select,优先从参数列表获取options
155
+ if(this.data.fields[i].type == 'select'){
156
+ console.log('进入下拉框参数获取方法,参数名称=>' + this.data.fields[i].label)
157
+ console.log('$appdata中的缓存参数与单值=>' + JSON.stringify(this.$appdata))
158
+ var param = this.$appdata.getParam(this.data.fields[i].label)
159
+ console.log(param)
160
+ if (param){
161
+ this.data.fields[i].options = param
162
+ }
163
+
164
+ }
165
+ }
166
+ // 初始化 buttons_fields
167
+ for(let i=0;i<this.data.buttons.length;i++){
168
+ if(this.data.buttons[i].button_fields){
169
+ for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
170
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
171
+ if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
172
+ this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
173
+ }
174
+ // 如果配置类型为select,优先从参数列表获取options
175
+ if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
176
+ console.log("这里是给select赋值的地方"+JSON.stringify(this.data.buttons[i].button_fields[j]))
177
+ console.log("参数列表获取到的"+JSON.stringify(this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)))
178
+ this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
179
+ }
180
+ // 下发特殊配置
181
+ if(this.data.buttons[i].button_name==='下发'){
182
+ if(this.data.buttons[i].button_fields.length===1){
183
+ // value初始化
184
+ // if(this.department_search){
185
+ console.log("看看111department_search"+JSON.stringify(this.department_search))
186
+
187
+ if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
188
+
189
+ for(let k=0;k<this.department_search.length;k++){
190
+ // 将id转换为name
191
+ if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
192
+ this.data.buttons[i].button_fields[0].value=this.department_search[k].name
193
+ }
194
+ }
195
+ }
196
+
197
+ if(this.department_search){
198
+ let array = []
199
+ console.log("看看department_search"+JSON.stringify(this.department_search))
200
+ this.department_search.forEach((paper)=>{
201
+ array.push({label:paper.name,value:paper.name})
202
+ })
203
+ this.data.buttons[i].button_fields[0].options = array
204
+ }
205
+ }else {
206
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
207
+ }
208
+ }
209
+ }
210
+ }
211
+ }
212
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
213
+ let temp = JSON.parse(JSON.stringify(this.data))
214
+ // 退回原因展示
215
+ if(this.selectdata.f_back_reason){
216
+ temp['back_reason'] = this.selectdata.f_back_reason
217
+ }
218
+ console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
219
+ console.log(JSON.stringify(this.show_data.ppp))
220
+ if (JSON.stringify(this.show_data.ppp)=='{}'){
221
+ this.show_data.ppp = temp
222
+ console.log("重新赋值")
223
+
224
+ }else{
225
+ console.log("不重新赋值")
226
+ }
227
+ console.log('initializtion()方法结束,showview')
228
+ this.showview = true
229
+ },
230
+ deleteLocalApply(model){
231
+ console.log(`前台上传完成,开始删除本地报建工单`)
232
+ this.$androidUtil.bzLogic('deleteApply', {data:model})
233
+ }
234
+ },
235
+ events: {
236
+ // 任意select选中时触发事件
237
+ 'select_cascade'(index){
238
+ // this.$refs.service_show.model_temp // 子业务显示组件
239
+ // 级联操作示例:
240
+ /*
241
+ if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
242
+ for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
243
+ // 控制设置级联
244
+ // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
245
+ if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
246
+ this.$refs.service_show.model_temp.activitys.fields[i].options=[
247
+ {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
248
+ ]
249
+ }
250
+ }
251
+ }
252
+ */
253
+ },
254
+ // 获取view层button事件
255
+ async 'button'(model){
256
+ this.loading=true
257
+
258
+ console.log('进入async button事件方法')
259
+ var delteLocal = true
260
+ // 点击保存与重置按钮不需要修改本地工单状态
261
+ if(model.button.button_name == '保存' || model.button.button_name==='重置'){
262
+ delteLocal = false
263
+ }
264
+ // 点击重置按钮就重置数据
265
+ if(model.button.button_name==='重置'){
266
+ this.initializtion()
267
+ return
268
+ }
269
+ if(model.button.button_name==='下发'){
270
+ let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
271
+ for(let i=0;i<this.department_search.length;i++){
272
+ // 找到人名为person_name 的人,然后把人名换成id
273
+ if(this.department_search[i].name === person_name){
274
+ model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
275
+ }
276
+ }
277
+ }
278
+ console.log("button事件接收参数model=>" + JSON.stringify(model))
279
+ model=Object.assign({},this.selectdata,model)
280
+ console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
281
+ let http = new HttpResetClass()
282
+ var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
283
+ // 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})
284
+ // // 先判断是否包含code,如果服务端异常,可能不存在code
285
+ // console.log("service处理完成返回数据=>" + res)
286
+ // if(!res.code){
287
+ // console.log("service处理完成返回数据=>" + res)
288
+ // this.$showMessage('操作异常,原因:' + res)
289
+ // }else{
290
+ // console.log("service处理完成返回数据=>" + JSON.stringify(res))
291
+ // if(res.code = 200){
292
+ // this.showview = false
293
+ // // 特殊处理
294
+ // this.special(model)
295
+ // this.$dispatch('close')
296
+ // this.initializtion()
297
+ // this.$showMessage('操作成功')
298
+ // }else{
299
+ // this.$showMessage('操作失败,原因:' + res.data.msg)
300
+ // }
301
+ // }
302
+ let btn = btn_operate(this, url, http, model, delteLocal)
303
+ co(btn)
304
+ }
305
+ },
306
+ watch:{
307
+ // 监听selectdata的变化
308
+ 'selectdata'() {
309
+ console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
310
+ this.refurbish()
311
+ },
312
+ deep:true
313
+ }
314
+ }
315
+
316
+ let btn_operate = function * (self, url, http, model, delteLocal) {
317
+ self.delteLocal=delteLocal
318
+
319
+ // 下发,提交,保存,退回都在后台处理
320
+ console.log('即将请求后台url=>' + url)
321
+ model.employeetemplate=''
322
+ self.model=model
323
+ console.log(JSON.stringify(self.model))
324
+ let param={
325
+ employeetemplate:'',
326
+ tables:self.data.tables,
327
+ start_activity:self.$workflow_vue.start_activity,
328
+ model:model,loginUser:Vue.user
329
+ }
330
+ // http.load('POST',url,{data:{employeetemplate:'',tables:self.data.tables,start_activity:self.$workflow_vue.start_activity,model:model,loginUser:Vue.user}}, {resolveMsg: null, rejectMsg: null})
331
+ let paramStr = JSON.stringify(param)
332
+ // 多长截断一次
333
+ let subLength = 800
334
+ for (let i = 0; i < paramStr.length; i += subLength) {
335
+ HostApp.param_cache(paramStr.substr(i, subLength))
336
+ }
337
+ HostApp.__this__ = self
338
+ HostApp.syncLogic({
339
+ // logic别名,key必须为logic
340
+ 'logic': 'updatePic',
341
+ // 回调执行方法名,key必须为callback
342
+ 'callback': 'javascript:HostApp.__this__.saveCallBack()',
343
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
344
+ // 执行回调方法传入key为backresult
345
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
346
+ 'backresult': 1
347
+ })
348
+
349
+ }
350
+ </script>