apply-clients 5.0.35-61 → 5.0.35-62

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.
@@ -1,539 +1,537 @@
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
- if (this.data.fields[i].label == '用户类型') {
167
- this.data.fields[i].options = [{label: '民用', value: '民用'},{label: '非民用', value: '非民用'}]
168
- }
169
- // 获取县区
170
- if (this.data.fields[i].label == '县/区') {
171
- let area = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {
172
- data: {
173
- // items: 'f_bill_url,f_url_code',
174
- tablename: 't_pcd',
175
- condition: `f_filialeids = '${Vue.user.f_orgids}'`
176
- }
177
- }, {resolveMsg: null, rejectMsg: null})
178
- let rs = []
179
- for (let i = 0; i < area.data.length; i++) {
180
- let temp = {
181
- label: area.data[i].f_pcd,
182
- value: area.data[i].f_pcd
183
- }
184
- rs.push(temp)
185
- }
186
- this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
187
- }
188
- }
189
- // 初始化 buttons_fields
190
- for(let i=0;i<this.data.buttons.length;i++){
191
- if(this.data.buttons[i].button_fields){
192
- for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
193
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
194
- if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
195
- this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
196
- }
197
- // 如果配置类型为select,优先从参数列表获取options
198
- if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
199
- console.log("这里是给select赋值的地方"+JSON.stringify(this.data.buttons[i].button_fields[j]))
200
- console.log("参数列表获取到的"+JSON.stringify(this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)))
201
- this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
202
- }
203
- // 下发特殊配置
204
- if(this.data.buttons[i].button_name==='下发'){
205
- if(this.data.buttons[i].button_fields.length===1){
206
- // value初始化
207
- // if(this.department_search){
208
- console.log("看看111department_search"+JSON.stringify(this.department_search))
209
-
210
- if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
211
-
212
- for(let k=0;k<this.department_search.length;k++){
213
- // 将id转换为name
214
- if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
215
- this.data.buttons[i].button_fields[0].value=this.department_search[k].name
216
- }
217
- }
218
- }
219
-
220
- if(this.department_search){
221
- let array = []
222
- console.log("看看department_search"+JSON.stringify(this.department_search))
223
- this.department_search.forEach((paper)=>{
224
- array.push({label:paper.name,value:paper.name})
225
- })
226
- this.data.buttons[i].button_fields[0].options = array
227
- }
228
- }else {
229
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
230
- }
231
- }
232
- }
233
- }
234
- }
235
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
236
- let temp = JSON.parse(JSON.stringify(this.data))
237
- // 退回原因展示
238
- if(this.selectdata.f_back_reason){
239
- temp['back_reason'] = this.selectdata.f_back_reason
240
- }
241
- console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
242
- console.log(JSON.stringify(this.show_data.ppp))
243
- if (JSON.stringify(this.show_data.ppp)=='{}'){
244
- this.show_data.ppp = temp
245
- console.log("重新赋值")
246
-
247
- }else{
248
- console.log("不重新赋值")
249
- }
250
- console.log('initializtion()方法结束,showview')
251
- this.showview = true
252
- },
253
- deleteLocalApply(model){
254
- console.log(`前台上传完成,开始删除本地报建工单`)
255
- this.$androidUtil.bzLogic('deleteApply', {data:model})
256
- }
257
- },
258
- events: {
259
- // 任意select选中时触发事件
260
- 'select_cascade'(index){
261
- // this.$refs.service_show.model_temp // 子业务显示组件
262
- // 级联操作示例:
263
- /*
264
- if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
265
- for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
266
- // 控制设置级联
267
- // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
268
- if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
269
- this.$refs.service_show.model_temp.activitys.fields[i].options=[
270
- {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
271
- ]
272
- }
273
- }
274
- }
275
- */
276
- if (this.$refs.service_show.data.fields[index].label === '县/区') {
277
- let temp = this.$refs.service_show.data.fields[index].value
278
- console.log('==============================县/区:' + temp)
279
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
280
- // 控制设置级联
281
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
282
- if (this.$refs.service_show.data.fields[i].label === '街道名称') {
283
- this.$refs.service_show.data.fields[i].value = ''
284
- this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {
285
- data: {
286
- tablename: 't_street',
287
- condition: `f_filialeids = '${Vue.user.f_orgids}' and f_pcd='${temp}'`
288
- }
289
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
290
- let streetrs = []
291
- for (let i = 0; i < res.data.length; i++) {
292
- let temp = {
293
- label: res.data[i].f_street,
294
- value: res.data[i].f_street
295
- }
296
- streetrs.push(temp)
297
- }
298
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
299
- console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
300
- })
301
- }
302
- }
303
- }
304
- if (this.$refs.service_show.data.fields[index].label === '街道名称') {
305
- let temp = this.$refs.service_show.data.fields[index].value
306
- console.log('=============================街道:' + temp)
307
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
308
- // 控制设置级联
309
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
310
- if (this.$refs.service_show.data.fields[i].label === '小区名称') {
311
- this.$refs.service_show.data.fields[i].value = ''
312
-
313
- this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {
314
- data: {
315
- tablename: 't_area',
316
- condition: `f_filialeids = '${Vue.user.f_orgids}' and f_street='${temp}'`
317
- }
318
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
319
- let arears = []
320
- this.areaall=area.data;
321
- for (let i = 0; i < area.data.length; i++) {
322
- let temp = {
323
- label: area.data[i].f_residential_area,
324
- value: area.data[i].f_residential_area
325
- }
326
- arears.push(temp)
327
- }
328
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...arears]
329
- console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
330
- })
331
- }
332
- }
333
- }
334
- // 合成地址
335
- if (
336
- this.$refs.service_show.data.fields[index].label === '县/区' ||
337
- this.$refs.service_show.data.fields[index].label === '街道名称' ||
338
- this.$refs.service_show.data.fields[index].label === '小区名称' ||
339
- this.$refs.service_show.data.fields[index].label === '楼号' ||
340
- this.$refs.service_show.data.fields[index].label === '单元号' ||
341
- this.$refs.service_show.data.fields[index].label === '楼层' ||
342
- this.$refs.service_show.data.fields[index].label === '门牌号'
343
- ) {
344
- console.log('即将合成地址')
345
- var address = ''
346
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
347
- // 控制设置级联
348
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
349
- // xxx xx xxx
350
- if (this.$refs.service_show.data.fields[i].label === '县/区' && this.$refs.service_show.data.fields[i].value) {
351
- address += this.$refs.service_show.data.fields[i].value
352
- }
353
- if (this.$refs.service_show.data.fields[i].label === '街道名称' && this.$refs.service_show.data.fields[i].value) {
354
- address += this.$refs.service_show.data.fields[i].value
355
- }
356
- if (this.$refs.service_show.data.fields[i].label === '小区名称' && this.$refs.service_show.data.fields[i].value) {
357
- address += this.$refs.service_show.data.fields[i].value
358
- }
359
- if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
360
- address += this.$refs.service_show.data.fields[i].value
361
- }
362
- if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
363
- address += '栋'
364
- }
365
- if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
366
- address += '-' +this.$refs.service_show.data.fields[i].value
367
- }
368
- if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
369
- address += '单元'
370
- }
371
- if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
372
- address += '-' +this.$refs.service_show.data.fields[i].value
373
- }
374
- if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
375
- address += '层'
376
- }
377
- if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
378
- address += '-' +this.$refs.service_show.data.fields[i].value
379
- }
380
- if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
381
- address += ''
382
- }
383
-
384
- }
385
- console.log('获取到的address=>' + address)
386
- // 数据获取完毕时放入地址text
387
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
388
- if (this.$refs.service_show.data.fields[i].label === '地址' || this.$refs.service_show.data.fields[i].label === '报装地址') {
389
- this.$refs.service_show.data.fields[i].value = address
390
- console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
391
- }
392
- }
393
- }
394
- },
395
- // 获取view层button事件
396
- async 'button'(model){
397
- this.loading=true
398
-
399
- console.log('进入async button事件方法')
400
- var delteLocal = true
401
- // 点击保存与重置按钮不需要修改本地工单状态
402
- if(model.button.button_name == '保存' || model.button.button_name==='重置'){
403
- delteLocal = false
404
- }
405
- // 点击重置按钮就重置数据
406
- if(model.button.button_name==='重置'){
407
- this.initializtion()
408
- return
409
- }
410
- if(model.button.button_name==='下发'){
411
- let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
412
- for(let i=0;i<this.department_search.length;i++){
413
- // 找到人名为person_name 的人,然后把人名换成id
414
- if(this.department_search[i].name === person_name){
415
- model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
416
- }
417
- }
418
- }
419
- console.log("button事件接收参数model=>" + JSON.stringify(model))
420
- model=Object.assign({},this.selectdata,model)
421
- console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
422
- let http = new HttpResetClass()
423
- var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
424
- // 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})
425
- // // 先判断是否包含code,如果服务端异常,可能不存在code
426
- // console.log("service处理完成返回数据=>" + res)
427
- // if(!res.code){
428
- // console.log("service处理完成返回数据=>" + res)
429
- // this.$showMessage('操作异常,原因:' + res)
430
- // }else{
431
- // console.log("service处理完成返回数据=>" + JSON.stringify(res))
432
- // if(res.code = 200){
433
- // this.showview = false
434
- // // 特殊处理
435
- // this.special(model)
436
- // this.$dispatch('close')
437
- // this.initializtion()
438
- // this.$showMessage('操作成功')
439
- // }else{
440
- // this.$showMessage('操作失败,原因:' + res.data.msg)
441
- // }
442
- // }
443
- let btn = btn_operate(this, url, http, model, delteLocal)
444
- co(btn)
445
- },
446
- 'checkboxSelectControl'(index,index2){
447
- if(this.$refs.service_show.data.fields[index].label=="施工提交资料"){
448
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
449
-
450
- if(this.$refs.service_show.data.fields[i].label=="施工已上传文件"){
451
- //增加和删除框中的内容
452
- if(this.$refs.service_show.data.fields[index].items[index2].value == false){
453
- this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
454
- this.$refs.service_show.data.fields[index].items[index2].value=true;
455
- }else{
456
- let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
457
- let values =this.$refs.service_show.data.fields[i].value;
458
- let result = values.split(" ").filter((item)=>{
459
- return item!=deleteValue;
460
- }).join(" ")
461
- this.$refs.service_show.data.fields[i].value =result;
462
- this.$refs.service_show.data.fields[index].items[index2].value=false;
463
- }
464
- //}
465
- }
466
- }
467
- }
468
- if(this.$refs.service_show.data.fields[index].label=="验收提交资料"){
469
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
470
-
471
- if(this.$refs.service_show.data.fields[i].label=="验收已上传文件"){
472
- //增加和删除框中的内容
473
- if(this.$refs.service_show.data.fields[index].items[index2].value == false){
474
- this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
475
- this.$refs.service_show.data.fields[index].items[index2].value=true;
476
- }else{
477
- let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
478
- let values =this.$refs.service_show.data.fields[i].value;
479
- let result = values.split(" ").filter((item)=>{
480
- return item!=deleteValue;
481
- }).join(" ")
482
- this.$refs.service_show.data.fields[i].value =result;
483
- this.$refs.service_show.data.fields[index].items[index2].value=false;
484
- }
485
- //}
486
- }
487
- }
488
- }
489
- }
490
- },
491
- watch:{
492
- // 监听selectdata的变化
493
- 'selectdata'() {
494
- console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
495
- this.refurbish()
496
- },
497
- deep:true
498
- }
499
- }
500
-
501
- let btn_operate = function * (self, url, http, model, delteLocal) {
502
- self.delteLocal=delteLocal
503
-
504
- // 下发,提交,保存,退回都在后台处理
505
- console.log('即将请求后台url=>' + url)
506
- model.employeetemplate=''
507
- self.model=model
508
- console.log(JSON.stringify(self.model))
509
- let param={
510
- employeetemplate:'',
511
- tables:self.data.tables,
512
- start_activity:self.$workflow_vue.start_activity,
513
- model:model,
514
- loginUser:Vue.user
515
- }
516
- if(param.model.defname === '现场勘查定价'){
517
- param.model.f_unaccounts_money = param.model.f_total_cost
518
- }
519
- // 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})
520
- let paramStr = JSON.stringify(param)
521
- // 多长截断一次
522
- let subLength = 800
523
- for (let i = 0; i < paramStr.length; i += subLength) {
524
- HostApp.param_cache(paramStr.substr(i, subLength))
525
- }
526
- HostApp.__this__ = self
527
- HostApp.syncLogic({
528
- // logic别名,key必须为logic
529
- 'logic': 'updatePic',
530
- // 回调执行方法名,key必须为callback
531
- 'callback': 'javascript:HostApp.__this__.saveCallBack()',
532
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
533
- // 执行回调方法传入key为backresult
534
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
535
- 'backresult': 1
536
- })
537
-
538
- }
539
- </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
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser: Vue.user}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
67
+ console.log("流程的异步处理:",JSON.stringify(res.data))
68
+ }
69
+ if(this.data.distribute_async && model.button.button_name==='完成'){
70
+ // 强制结束
71
+ let http = new HttpResetClass();
72
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser: Vue.user}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
73
+ // let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
74
+ console.log("流程的异步处理:",JSON.stringify(res.data))
75
+ }
76
+ },
77
+ // 组件初始化操作
78
+ refurbish(){
79
+ if(!this.$workflow_vue){
80
+ this.$showMessage('流程配置文件不存在,请反馈系统管理员')
81
+ return
82
+ }
83
+ console.log('内存中的流程配置文件数据=>' + JSON.stringify(this.$workflow_vue))
84
+ this.json_datas=this.$workflow_vue
85
+ let sum = 0
86
+ let jsonData ={}
87
+ for(let i=0;i<this.json_datas.activitys.length;i++){
88
+ if(this.selectdata.defname==this.json_datas.activitys[i].title){
89
+ jsonData = this.json_datas.activitys[i]
90
+ sum++
91
+ }
92
+ }
93
+ console.log('sum=>' + sum)
94
+ if(sum==1){
95
+ this.data =null
96
+ this.data = jsonData
97
+ console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
98
+ this.initializtion()
99
+
100
+ } else if(sum==0) {
101
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
102
+ } else {
103
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
104
+ }
105
+ },
106
+ // json配置数据处理 比如下拉框的options
107
+ async initializtion() {
108
+
109
+ console.log('进入initializtion()方法')
110
+ console.log('接收到的selectdata有无变化'+JSON.stringify(this.selectdata))
111
+ console.log('接收到的selectdata有无actorexpression'+JSON.stringify(this.selectdata.actorexpression))
112
+ // 下发人 options 处理,options初始化
113
+ if(this.selectdata.actorexpression){
114
+ //截取actorexpression
115
+
116
+ let http = new HttpResetClass()
117
+ var url = this.$androidUtil.getProxyUrl() + '/rs/search'
118
+ console.log('即将请求后台获取下发人员,url=>' + url)
119
+ // R(安装员报装)
120
+ console.log("777777776"+JSON.stringify(this.selectdata.actorexpression))
121
+ let res
122
+ if (this.selectdata.actorexpression.startsWith('R')) {
123
+ let actorexpression = this.selectdata.actorexpression
124
+ //let actorexpression="R(安装员报装)"
125
+ let actor = actorexpression.substring(actorexpression.indexOf('(') + 1, actorexpression.indexOf(')'))
126
+ console.log("看看角色" + JSON.stringify(actor))
127
+ res= await http.load('POST', url, {
128
+ source: `tool.getChildrenOfResName($${actor}$)`,
129
+ userid: Vue.user.id
130
+ }, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
131
+ }else{
132
+ res = await http.load('POST', url, this.selectdata.actorexpression, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
133
+ }
134
+ console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
135
+ let jsonString = JSON.stringify(res.data)
136
+ let jsonArray = []
137
+ if(jsonString.startsWith("{")){
138
+ jsonArray.push(res.data)
139
+ res.data = jsonArray
140
+ }
141
+ this.department_search = res.data
142
+ }
143
+
144
+ // data 填充 selectdata
145
+ console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
146
+ this.data = Object.assign({},this.data, this.selectdata)
147
+ console.log('this.data的值=>' + JSON.stringify(this.data))
148
+
149
+ // 初始化 fields
150
+ console.log('this.data.fields.length=>' + this.data.fields.length)
151
+ for(let i=0;i<this.data.fields.length;i++){
152
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
153
+ if(this.selectdata[this.data.fields[i].field]){
154
+ this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
155
+ }
156
+ // 如果配置类型为select,优先从参数列表获取options
157
+ if(this.data.fields[i].type == 'select'){
158
+ console.log('进入下拉框参数获取方法,参数名称=>' + this.data.fields[i].label)
159
+ console.log('$appdata中的缓存参数与单值=>' + JSON.stringify(this.$appdata))
160
+ var param = this.$appdata.getParam(this.data.fields[i].label)
161
+ console.log(param)
162
+ if (param){
163
+ this.data.fields[i].options = param
164
+ }
165
+
166
+ }
167
+ // 设置用户类型
168
+ if (this.data.fields[i].label == '用户类型') {
169
+ this.data.fields[i].options = [{label: '民用', value: '民用'},{label: '非民用', value: '非民用'}]
170
+ }
171
+ // 获取县区
172
+ if (this.data.fields[i].label == '县/区') {
173
+ let area = await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {
174
+ data: {
175
+ // items: 'f_bill_url,f_url_code',
176
+ tablename: 't_pcd',
177
+ condition: `f_filialeids = '${Vue.user.f_orgids}'`
178
+ }
179
+ }, {resolveMsg: null, rejectMsg: null})
180
+ let rs = []
181
+ for (let i = 0; i < area.data.length; i++) {
182
+ let temp = {
183
+ label: area.data[i].f_pcd,
184
+ value: area.data[i].f_pcd
185
+ }
186
+ rs.push(temp)
187
+ }
188
+ this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
189
+ }
190
+ }
191
+ // 初始化 buttons_fields
192
+ for(let i=0;i<this.data.buttons.length;i++){
193
+ if(this.data.buttons[i].button_fields){
194
+ for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
195
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
196
+ if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
197
+ this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
198
+ }
199
+ // 如果配置类型为select,优先从参数列表获取options
200
+ if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
201
+ console.log("这里是给select赋值的地方"+JSON.stringify(this.data.buttons[i].button_fields[j]))
202
+ console.log("参数列表获取到的"+JSON.stringify(this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)))
203
+ this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
204
+ }
205
+ // 下发特殊配置
206
+ if(this.data.buttons[i].button_name==='下发'){
207
+ if(this.data.buttons[i].button_fields.length===1){
208
+ // value初始化
209
+ // if(this.department_search){
210
+ console.log("看看111department_search"+JSON.stringify(this.department_search))
211
+
212
+ if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
213
+
214
+ for(let k=0;k<this.department_search.length;k++){
215
+ // 将id转换为name
216
+ if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
217
+ this.data.buttons[i].button_fields[0].value=this.department_search[k].name
218
+ }
219
+ }
220
+ }
221
+
222
+ if(this.department_search){
223
+ let array = []
224
+ console.log("看看department_search"+JSON.stringify(this.department_search))
225
+ this.department_search.forEach((paper)=>{
226
+ array.push({label:paper.name,value:paper.name})
227
+ })
228
+ this.data.buttons[i].button_fields[0].options = array
229
+ }
230
+ }else {
231
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
232
+ }
233
+ }
234
+ }
235
+ }
236
+ }
237
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
238
+ let temp = JSON.parse(JSON.stringify(this.data))
239
+ // 退回原因展示
240
+ if(this.selectdata.f_back_reason){
241
+ temp['back_reason'] = this.selectdata.f_back_reason
242
+ }
243
+ console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
244
+ console.log(JSON.stringify(this.show_data.ppp))
245
+ if (JSON.stringify(this.show_data.ppp)=='{}'){
246
+ this.show_data.ppp = temp
247
+ console.log("重新赋值")
248
+
249
+ }else{
250
+ console.log("不重新赋值")
251
+ }
252
+ console.log('initializtion()方法结束,showview')
253
+ this.showview = true
254
+ },
255
+ deleteLocalApply(model){
256
+ console.log(`前台上传完成,开始删除本地报建工单`)
257
+ this.$androidUtil.bzLogic('deleteApply', {data:model})
258
+ }
259
+ },
260
+ events: {
261
+ 'checkboxSelectControl'(index,index2){
262
+ if(this.$refs.service_show.data.fields[index].label=="施工提交资料"){
263
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
264
+
265
+ if(this.$refs.service_show.data.fields[i].label=="施工已上传文件"){
266
+ //增加和删除框中的内容
267
+ if(this.$refs.service_show.data.fields[index].items[index2].value == false){
268
+ this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
269
+ this.$refs.service_show.data.fields[index].items[index2].value=true;
270
+ }else{
271
+ let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
272
+ let values =this.$refs.service_show.data.fields[i].value;
273
+ let result = values.split(" ").filter((item)=>{
274
+ return item!=deleteValue;
275
+ }).join(" ")
276
+ this.$refs.service_show.data.fields[i].value =result;
277
+ this.$refs.service_show.data.fields[index].items[index2].value=false;
278
+ }
279
+ //}
280
+ }
281
+ }
282
+ }
283
+ if(this.$refs.service_show.data.fields[index].label=="验收提交资料"){
284
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
285
+
286
+ if(this.$refs.service_show.data.fields[i].label=="验收已上传文件"){
287
+ //增加和删除框中的内容
288
+ if(this.$refs.service_show.data.fields[index].items[index2].value == false){
289
+ this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
290
+ this.$refs.service_show.data.fields[index].items[index2].value=true;
291
+ }else{
292
+ let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
293
+ let values =this.$refs.service_show.data.fields[i].value;
294
+ let result = values.split(" ").filter((item)=>{
295
+ return item!=deleteValue;
296
+ }).join(" ")
297
+ this.$refs.service_show.data.fields[i].value =result;
298
+ this.$refs.service_show.data.fields[index].items[index2].value=false;
299
+ }
300
+ //}
301
+ }
302
+ }
303
+ }
304
+ },
305
+ // 任意select选中时触发事件
306
+ async 'select_cascade'(index){
307
+ // this.$refs.service_show.model_temp // 子业务显示组件
308
+ // 级联操作示例:
309
+ /*
310
+ if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
311
+ for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
312
+ // 控制设置级联
313
+ // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
314
+ if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
315
+ this.$refs.service_show.model_temp.activitys.fields[i].options=[
316
+ {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
317
+ ]
318
+ }
319
+ }
320
+ }
321
+ */
322
+ if (this.$refs.service_show.data.fields[index].label === '县/区') {
323
+ let temp = this.$refs.service_show.data.fields[index].value
324
+ console.log('==============================县/区:' + temp)
325
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
326
+ // 控制设置级联
327
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
328
+ if (this.$refs.service_show.data.fields[i].label === '街道名称') {
329
+ await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {
330
+ data: {
331
+ tablename: 't_street',
332
+ condition: `f_filialeids = '${Vue.user.f_orgids}' and f_pcd='${temp}'`
333
+ }
334
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
335
+ let streetrs = []
336
+ for (let i = 0; i < res.data.length; i++) {
337
+ let temp = {
338
+ label: res.data[i].f_street,
339
+ value: res.data[i].f_street
340
+ }
341
+ streetrs.push(temp)
342
+ }
343
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
344
+ console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
345
+ })
346
+ }
347
+ }
348
+ }
349
+ if (this.$refs.service_show.data.fields[index].label === '街道名称') {
350
+ let temp = this.$refs.service_show.data.fields[index].value
351
+ console.log('=============================街道:' + temp)
352
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
353
+ // 控制设置级联
354
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
355
+ if (this.$refs.service_show.data.fields[i].label === '小区名称') {
356
+ await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {
357
+ data: {
358
+ tablename: 't_area',
359
+ condition: `f_filialeids = '${Vue.user.f_orgids}' and f_street='${temp}'`
360
+ }
361
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
362
+ let arears = []
363
+ for (let i = 0; i < res.data.length; i++) {
364
+ let temp = {
365
+ label: res.data[i].f_residential_area,
366
+ value: res.data[i].f_residential_area
367
+ }
368
+ arears.push(temp)
369
+ }
370
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...arears]
371
+ console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
372
+ })
373
+ }
374
+ }
375
+ }
376
+ // 合成地址
377
+ if (
378
+ this.$refs.service_show.data.fields[index].label === '县/区' ||
379
+ this.$refs.service_show.data.fields[index].label === '街道名称' ||
380
+ this.$refs.service_show.data.fields[index].label === '小区名称' ||
381
+ this.$refs.service_show.data.fields[index].label === '楼号' ||
382
+ this.$refs.service_show.data.fields[index].label === '单元号' ||
383
+ this.$refs.service_show.data.fields[index].label === '楼层' ||
384
+ this.$refs.service_show.data.fields[index].label === '门牌号'
385
+ ) {
386
+ console.log('即将合成地址')
387
+ var address = ''
388
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
389
+ // 控制设置级联
390
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
391
+ // xxx xx xxx
392
+ if (this.$refs.service_show.data.fields[i].label === '县/区' && this.$refs.service_show.data.fields[i].value) {
393
+ address += this.$refs.service_show.data.fields[i].value
394
+ }
395
+ if (this.$refs.service_show.data.fields[i].label === '街道名称' && this.$refs.service_show.data.fields[i].value) {
396
+ address += this.$refs.service_show.data.fields[i].value
397
+ }
398
+ if (this.$refs.service_show.data.fields[i].label === '小区名称' && this.$refs.service_show.data.fields[i].value) {
399
+ address += this.$refs.service_show.data.fields[i].value
400
+ }
401
+ if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
402
+ address += this.$refs.service_show.data.fields[i].value
403
+ }
404
+ if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
405
+ address += '栋'
406
+ }
407
+ if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
408
+ address += '-' +this.$refs.service_show.data.fields[i].value
409
+ }
410
+ if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
411
+ address += '单元'
412
+ }
413
+ if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
414
+ address += '-' +this.$refs.service_show.data.fields[i].value
415
+ }
416
+ if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
417
+ address += '层'
418
+ }
419
+ if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
420
+ address += '-' +this.$refs.service_show.data.fields[i].value
421
+ }
422
+ if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
423
+ address += ''
424
+ }
425
+
426
+ }
427
+ console.log('获取到的address=>' + address)
428
+ // 数据获取完毕时放入地址text
429
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
430
+ if (this.$refs.service_show.data.fields[i].label === '地址' || this.$refs.service_show.data.fields[i].label === '报装地址') {
431
+ this.$refs.service_show.data.fields[i].value = address
432
+ console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
433
+ }
434
+ }
435
+ }
436
+ },
437
+ // 获取view层button事件
438
+ async 'button'(model){
439
+ this.loading=true
440
+
441
+ console.log('进入async button事件方法')
442
+ var delteLocal = true
443
+ // 点击保存与重置按钮不需要修改本地工单状态
444
+ if(model.button.button_name == '保存' || model.button.button_name==='重置'){
445
+ delteLocal = false
446
+ }
447
+ // 点击重置按钮就重置数据
448
+ if(model.button.button_name==='重置'){
449
+ this.initializtion()
450
+ return
451
+ }
452
+ if(model.button.button_name==='下发'){
453
+ let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
454
+ for(let i=0;i<this.department_search.length;i++){
455
+ // 找到人名为person_name 的人,然后把人名换成id
456
+ if(this.department_search[i].name === person_name){
457
+ model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
458
+ }
459
+ }
460
+ }
461
+ console.log("button事件接收参数model=>" + JSON.stringify(model))
462
+ model=Object.assign({},this.selectdata,model)
463
+ console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
464
+ let http = new HttpResetClass()
465
+ var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
466
+ // 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})
467
+ // // 先判断是否包含code,如果服务端异常,可能不存在code
468
+ // console.log("service处理完成返回数据=>" + res)
469
+ // if(!res.code){
470
+ // console.log("service处理完成返回数据=>" + res)
471
+ // this.$showMessage('操作异常,原因:' + res)
472
+ // }else{
473
+ // console.log("service处理完成返回数据=>" + JSON.stringify(res))
474
+ // if(res.code = 200){
475
+ // this.showview = false
476
+ // // 特殊处理
477
+ // this.special(model)
478
+ // this.$dispatch('close')
479
+ // this.initializtion()
480
+ // this.$showMessage('操作成功')
481
+ // }else{
482
+ // this.$showMessage('操作失败,原因:' + res.data.msg)
483
+ // }
484
+ // }
485
+ let btn = btn_operate(this, url, http, model, delteLocal)
486
+ co(btn)
487
+ }
488
+ },
489
+ watch:{
490
+ // 监听selectdata的变化
491
+ 'selectdata'() {
492
+ console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
493
+ this.refurbish()
494
+ },
495
+ deep:true
496
+ }
497
+ }
498
+
499
+ let btn_operate = function * (self, url, http, model, delteLocal) {
500
+ self.delteLocal=delteLocal
501
+
502
+ // 下发,提交,保存,退回都在后台处理
503
+ console.log('即将请求后台url=>' + url)
504
+ model.employeetemplate=''
505
+ self.model=model
506
+ console.log(JSON.stringify(self.model))
507
+ let param={
508
+ employeetemplate:'',
509
+ tables:self.data.tables,
510
+ start_activity:self.$workflow_vue.start_activity,
511
+ model:model,
512
+ loginUser:Vue.user
513
+ }
514
+ if(param.model.defname === '现场勘查定价'){
515
+ param.model.f_unaccounts_money = param.model.f_total_cost
516
+ }
517
+ // 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})
518
+ let paramStr = JSON.stringify(param)
519
+ // 多长截断一次
520
+ let subLength = 800
521
+ for (let i = 0; i < paramStr.length; i += subLength) {
522
+ HostApp.param_cache(paramStr.substr(i, subLength))
523
+ }
524
+ HostApp.__this__ = self
525
+ HostApp.syncLogic({
526
+ // logic别名,key必须为logic
527
+ 'logic': 'updatePic',
528
+ // 回调执行方法名,key必须为callback
529
+ 'callback': 'javascript:HostApp.__this__.saveCallBack()',
530
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
531
+ // 执行回调方法传入key为backresult
532
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
533
+ 'backresult': 1
534
+ })
535
+
536
+ }
537
+ </script>