apply-clients 4.1.3 → 4.1.4-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 (37) hide show
  1. package/index.html +1 -1
  2. package/package.json +7 -5
  3. package/src/apply.js +81 -66
  4. package/src/applyAndroid.js +41 -39
  5. package/src/components/app_apply/AppChargeManagement.vue +619 -0
  6. package/src/components/app_apply/ApplyInfo.vue +56 -56
  7. package/src/components/app_apply/ApplyToDoList.vue +148 -165
  8. package/src/components/app_apply/PlaceControler.vue +258 -258
  9. package/src/components/app_apply/ServiceControl.vue +280 -267
  10. package/src/components/product/ApplyCharge/ApplyChargeList.vue +251 -251
  11. package/src/components/product/Function/InstallInfoSelect.vue +40 -27
  12. package/src/components/product/Function/StopApplyCrrdList.vue +1 -1
  13. package/src/components/product/Function/functions/StopInstall.vue +7 -1
  14. package/src/components/product/Process/ExplorationSelect.vue +82 -59
  15. package/src/components/product/Process/Processes/InstallationDetails.vue +276 -246
  16. package/src/components/product/Process/Processes/UserFireInfo.vue +409 -0
  17. package/src/components/product/Process/Processes/addressAndUserinfoManagement.vue +1458 -99
  18. package/src/components/product/Process/Processes/addressAndUserinfoManagementPro.vue +1221 -0
  19. package/src/components/product/Process/Processes/chargeManagement.vue +47 -53
  20. package/src/components/product/Process/Processes/devicesDetails.vue +834 -0
  21. package/src/components/product/Process/Processes/materialshoufei.vue +182 -0
  22. package/src/components/product/Process/Processes/printCharge.vue +130 -130
  23. package/src/components/product/Process/Processes/recordcancel.vue +50 -0
  24. package/src/components/product/Process/Processes/selectUserinfo.vue +199 -0
  25. package/src/components/product/Process/Processes/splitMaterial.vue +358 -0
  26. package/src/components/product/Process/Service/ServiceControl.vue +1126 -703
  27. package/src/components/product/Process/ShowBackReason.vue +1 -0
  28. package/src/components/product/ServiceView.vue +82 -35
  29. package/src/components/product/Stop/StopApply.vue +101 -0
  30. package/src/components/product/Stop/StopApplyList.vue +257 -0
  31. package/src/components/product/Supervisory/SupervisoryControl.vue +7 -4
  32. package/src/components/product/Supervisory/SupervisoryList.vue +40 -27
  33. package/src/components/product/Supervisory/SupervisoryhCart.vue +0 -7
  34. package/src/components/product/Test.vue +8 -4
  35. package/src/components/product/VueUtils/ApplyUpload.vue +261 -261
  36. package/src/main.js +25 -23
  37. package/static/images/lefticon//347/237/251/345/275/2421183.png +0 -0
@@ -1,267 +1,280 @@
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
- data:null, // 数据库数据,json配置文件数据的数据集合
14
- json_datas:null, // Json配置文件集合
15
- showview:false, // 控制显示service-view组件
16
- show_data:null, // 给view层显示的数据
17
- department_search:null // 当前部门下所有人
18
- }
19
- },
20
- methods: {
21
- // 特殊化处理
22
- async special(model){
23
- console.log('进入async special方法')
24
- if(this.data.distribute_async && model.button.button_name==='下发'){
25
- // 流程异步处理
26
- let http = new HttpResetClass();
27
- let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
28
- console.log("流程的异步处理:",JSON.stringify(res.data))
29
- }
30
- if(this.data.distribute_async && model.button.button_name==='完成'){
31
- // 强制结束
32
- let http = new HttpResetClass();
33
- let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
34
- console.log("流程的异步处理:",JSON.stringify(res.data))
35
- }
36
- },
37
- // 组件初始化操作
38
- refurbish(){
39
- if(!this.$workflow_vue){
40
- this.$showMessage('流程配置文件不存在,请反馈系统管理员')
41
- return
42
- }
43
- console.log('内存中的流程配置文件数据=>' + JSON.stringify(this.$workflow_vue))
44
- this.json_datas=this.$workflow_vue
45
- let sum = 0
46
- let jsonData ={}
47
- for(let i=0;i<this.json_datas.activitys.length;i++){
48
- if(this.selectdata.defname==this.json_datas.activitys[i].title){
49
- jsonData = this.json_datas.activitys[i]
50
- sum++
51
- }
52
- }
53
- console.log('sum=>' + sum)
54
- if(sum==1){
55
- this.data =null
56
- this.data = jsonData
57
- console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
58
- this.initializtion()
59
-
60
- } else if(sum==0) {
61
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
62
- } else {
63
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
64
- }
65
- },
66
- // json配置数据处理 比如下拉框的options
67
- async initializtion() {
68
- console.log('进入initializtion()方法')
69
- // 下发人 options 处理,options初始化
70
- if(this.selectdata.actorexpression){
71
- let http = new HttpResetClass()
72
- var url = this.$androidUtil.getProxyUrl() + '/rs/search'
73
- console.log('即将请求后台获取下发人员,url=>' + url)
74
- let res = await http.load('POST', url, this.selectdata.actorexpression, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
75
- console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
76
- let jsonString = JSON.stringify(res.data)
77
- let jsonArray = []
78
- if(jsonString.startsWith("{")){
79
- jsonArray.push(res.data)
80
- res.data = jsonArray
81
- }
82
- this.department_search = res.data
83
- }
84
-
85
- // data 填充 selectdata
86
- console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
87
- this.data = Object.assign({},this.data, this.selectdata)
88
- console.log('this.data的值=>' + JSON.stringify(this.data))
89
-
90
- // 初始化 fields
91
- console.log('this.data.fields.length=>' + this.data.fields.length)
92
- for(let i=0;i<this.data.fields.length;i++){
93
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
94
- if(this.selectdata[this.data.fields[i].field]){
95
- this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
96
- }
97
- // 如果配置类型为select,优先从参数列表获取options
98
- if(this.data.fields[i].type == 'select'){
99
- console.log('进入下拉框参数获取方法,参数名称=>' + this.data.fields[i].label)
100
- console.log('$appdata中的缓存参数与单值=>' + JSON.stringify(this.$appdata))
101
- var param = this.$appdata.getParam(this.data.fields[i].label)
102
- console.log(param)
103
- this.data.fields[i].options = param
104
-
105
- }
106
- }
107
- // 初始化 buttons_fields
108
- for(let i=0;i<this.data.buttons.length;i++){
109
- if(this.data.buttons[i].button_fields){
110
- for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
111
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
112
- if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
113
- this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
114
- }
115
- // 如果配置类型为select,优先从参数列表获取options
116
- if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
117
- this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
118
- }
119
- // 下发特殊配置
120
- if(this.data.buttons[i].button_name==='下发'){
121
- if(this.data.buttons[i].button_fields.length===1){
122
- // value初始化
123
- // if(this.department_search){
124
- if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
125
- for(let k=0;k<this.department_search.length;k++){
126
- // 将id转换为name
127
- if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
128
- this.data.buttons[i].button_fields[0].value=this.department_search[k].name
129
- }
130
- }
131
- }
132
-
133
- if(this.department_search){
134
- let array = []
135
- for(let k=0;k<this.department_search.length;k++){
136
- array.push({label:this.department_search[k].name,value:this.department_search[k].name})
137
- }
138
- this.data.buttons[i].button_fields[0].options = array
139
- }
140
- }else {
141
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
142
- }
143
- }
144
- }
145
- }
146
- }
147
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
148
- let temp = JSON.parse(JSON.stringify(this.data))
149
- // 退回原因展示
150
- if(this.selectdata.f_back_reason){
151
- temp['back_reason'] = this.selectdata.f_back_reason
152
- }
153
- console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
154
- this.show_data = temp
155
- console.log('initializtion()方法结束,showview')
156
- this.showview = true
157
- },
158
- deleteLocalApply(model){
159
- console.log(`前台上传完成,开始删除本地报建工单`)
160
- this.$androidUtil.bzLogic('deleteApply', {data:model})
161
- }
162
- },
163
- events: {
164
- // 任意select选中时触发事件
165
- 'select_cascade'(index){
166
- // this.$refs.service_show.model_temp // 子业务显示组件
167
- // 级联操作示例:
168
- /*
169
- if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
170
- for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
171
- // 控制设置级联
172
- // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
173
- if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
174
- this.$refs.service_show.model_temp.activitys.fields[i].options=[
175
- {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
176
- ]
177
- }
178
- }
179
- }
180
- */
181
- },
182
- // 获取view层button事件
183
- async 'button'(model){
184
- console.log('进入async button事件方法')
185
- var delteLocal = true
186
- // 点击保存与重置按钮不需要修改本地工单状态
187
- if(model.button.button_name == '保存' || model.button.button_name==='重置'){
188
- delteLocal = false
189
- }
190
- // 点击重置按钮就重置数据
191
- if(model.button.button_name==='重置'){
192
- this.initializtion()
193
- return
194
- }
195
- if(model.button.button_name==='下发'){
196
- let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
197
- for(let i=0;i<this.department_search.length;i++){
198
- // 找到人名为person_name 的人,然后把人名换成id
199
- if(this.department_search[i].name === person_name){
200
- model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
201
- }
202
- }
203
- }
204
- console.log("button事件接收参数model=>" + JSON.stringify(model))
205
- model=Object.assign({},this.selectdata,model)
206
- console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
207
- let http = new HttpResetClass()
208
- var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
209
- // 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})
210
- // // 先判断是否包含code,如果服务端异常,可能不存在code
211
- // console.log("service处理完成返回数据=>" + res)
212
- // if(!res.code){
213
- // console.log("service处理完成返回数据=>" + res)
214
- // this.$showMessage('操作异常,原因:' + res)
215
- // }else{
216
- // console.log("service处理完成返回数据=>" + JSON.stringify(res))
217
- // if(res.code = 200){
218
- // this.showview = false
219
- // // 特殊处理
220
- // this.special(model)
221
- // this.$dispatch('close')
222
- // this.initializtion()
223
- // this.$showMessage('操作成功')
224
- // }else{
225
- // this.$showMessage('操作失败,原因:' + res.data.msg)
226
- // }
227
- // }
228
- let btn = btn_operate(this, url, http, model, delteLocal)
229
- co(btn)
230
- }
231
- },
232
- watch:{
233
- // 监听selectdata的变化
234
- 'selectdata'() {
235
- console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
236
- this.refurbish()
237
- },
238
- deep:true
239
- }
240
- }
241
-
242
- let btn_operate = function * (self, url, http, model, delteLocal) {
243
- // 下发,提交,保存,退回都在后台处理
244
- console.log('即将请求后台url=>' + url)
245
- 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})
246
- .then((res) => {
247
- console.log(JSON.stringify(res))
248
- if(res.code = 200){
249
- self.showview = false
250
- // 如果需要删除本地记录则去删除
251
- if(delteLocal){
252
- self.deleteLocalApply(model)
253
- }
254
- // 特殊处理
255
- self.special(model)
256
- self.$dispatch('close')
257
- self.initializtion()
258
- self.$showMessage('操作成功')
259
- }else{
260
- self.$showMessage('操作失败,原因:' + res.data.msg)
261
- }
262
- })
263
- .catch((ret) => {
264
- self.$showMessage('操作异常,原因:' + JSON.stringify(ret.data))
265
- })
266
- }
267
- </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
+ export default {
9
+ title: '报建流程业务控制层',
10
+ props: ['selectdata'],
11
+ data () {
12
+ return {
13
+ data:null, // 数据库数据,json配置文件数据的数据集合
14
+ json_datas:null, // Json配置文件集合
15
+ showview:false, // 控制显示service-view组件
16
+ show_data:null, // 给view层显示的数据
17
+ department_search:null // 当前部门下所有人
18
+ }
19
+ },
20
+ methods: {
21
+ // 特殊化处理
22
+ async special(model){
23
+ console.log('进入async special方法')
24
+ if(this.data.distribute_async && model.button.button_name==='下发'){
25
+ // 流程异步处理
26
+ let http = new HttpResetClass();
27
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
28
+ console.log("流程的异步处理:",JSON.stringify(res.data))
29
+ }
30
+ if(this.data.distribute_async && model.button.button_name==='完成'){
31
+ // 强制结束
32
+ let http = new HttpResetClass();
33
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
34
+ console.log("流程的异步处理:",JSON.stringify(res.data))
35
+ }
36
+ },
37
+ // 组件初始化操作
38
+ async refurbish(){
39
+ let http = new HttpResetClass()
40
+ let xmldata = {
41
+ data: Vue.user,
42
+ workname: this.selectdata.processname
43
+ }
44
+ let res = await http.load('POST', 'rs/logic/ApplyGetConfigs', {data: xmldata}, {resolveMsg: null, rejectMsg: null})
45
+ if (res.data.code && res.data.code === 200) {
46
+ Vue.prototype.$workflow_vue = res.data.workflow_vue
47
+ } else {
48
+ this.$showMessage('获取报建配置失败,原因:' + res.data.msg)
49
+ return
50
+ }
51
+ if(!this.$workflow_vue){
52
+ this.$showMessage('流程配置文件不存在,请反馈系统管理员')
53
+ return
54
+ }
55
+ console.log('内存中的流程配置文件数据=>' + JSON.stringify(this.$workflow_vue))
56
+ this.json_datas=this.$workflow_vue
57
+ let sum = 0
58
+ let jsonData ={}
59
+ console.log(this.selectdata)
60
+ for(let i=0;i<this.json_datas.activitys.length;i++){
61
+ if(this.selectdata.defname==this.json_datas.activitys[i].title){
62
+ jsonData = this.json_datas.activitys[i]
63
+ sum++
64
+ }
65
+ }
66
+ console.log('sum=>' + sum)
67
+ if(sum==1){
68
+ this.data =null
69
+ this.data = jsonData
70
+ console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
71
+ this.initializtion()
72
+
73
+ } else if(sum==0) {
74
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
75
+ } else {
76
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
77
+ }
78
+ },
79
+ // json配置数据处理 比如下拉框的options
80
+ async initializtion() {
81
+ console.log('进入initializtion()方法')
82
+ // 下发人 options 处理,options初始化
83
+ /*if(this.selectdata.actorexpression){
84
+ let http = new HttpResetClass()
85
+ var url = this.$androidUtil.getProxyUrl() + '/rs/search'
86
+ console.log('即将请求后台获取下发人员,url=>' + url)
87
+ let res = await http.load('POST', url, this.selectdata.actorexpression, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
88
+ console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
89
+ let jsonString = JSON.stringify(res.data)
90
+ let jsonArray = []
91
+ if(jsonString.startsWith("{")){
92
+ jsonArray.push(res.data)
93
+ res.data = jsonArray
94
+ }
95
+ this.department_search = res.data
96
+ }*/
97
+
98
+ // data 填充 selectdata
99
+ console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
100
+ this.data = Object.assign({},this.data, this.selectdata)
101
+ console.log('this.data的值=>' + JSON.stringify(this.data))
102
+
103
+ // 初始化 fields
104
+ console.log('this.data.fields.length=>' + this.data.fields.length)
105
+ for(let i=0;i<this.data.fields.length;i++){
106
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
107
+ if(this.selectdata[this.data.fields[i].field]){
108
+ this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
109
+ }
110
+ // 如果配置类型为select,优先从参数列表获取options
111
+ if(this.data.fields[i].type == 'select'){
112
+ console.log('进入下拉框参数获取方法,参数名称=>' + this.data.fields[i].label)
113
+ console.log('$appdata中的缓存参数与单值=>' + JSON.stringify(this.$appdata))
114
+ var param = this.$appdata.getParam(this.data.fields[i].label)
115
+ console.log(param)
116
+ this.data.fields[i].options = param
117
+
118
+ }
119
+ }
120
+ // 初始化 buttons_fields
121
+ for(let i=0;i<this.data.buttons.length;i++){
122
+ if(this.data.buttons[i].button_fields){
123
+ for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
124
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
125
+ if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
126
+ this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
127
+ }
128
+ // 如果配置类型为select,优先从参数列表获取options
129
+ if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
130
+ this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
131
+ }
132
+ // 下发特殊配置
133
+ if(this.data.buttons[i].button_name==='下发'){
134
+ if(this.data.buttons[i].button_fields.length===1){
135
+ // value初始化
136
+ // if(this.department_search){
137
+ if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
138
+ for(let k=0;k<this.department_search.length;k++){
139
+ // 将id转换为name
140
+ if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
141
+ this.data.buttons[i].button_fields[0].value=this.department_search[k].name
142
+ }
143
+ }
144
+ }
145
+
146
+ if(this.department_search){
147
+ let array = []
148
+ for(let k=0;k<this.department_search.length;k++){
149
+ array.push({label:this.department_search[k].name,value:this.department_search[k].name})
150
+ }
151
+ this.data.buttons[i].button_fields[0].options = array
152
+ }
153
+ }else {
154
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
160
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
161
+ let temp = JSON.parse(JSON.stringify(this.data))
162
+ // 退回原因展示
163
+ if(this.selectdata.f_back_reason){
164
+ temp['back_reason'] = this.selectdata.f_back_reason
165
+ }
166
+ console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
167
+ this.show_data = temp
168
+ console.log('initializtion()方法结束,showview')
169
+ this.showview = true
170
+ },
171
+ deleteLocalApply(model){
172
+ console.log(`前台上传完成,开始删除本地报建工单`)
173
+ this.$androidUtil.bzLogic('deleteApply', {data:model})
174
+ }
175
+ },
176
+ events: {
177
+ // 任意select选中时触发事件
178
+ 'select_cascade'(index){
179
+ // this.$refs.service_show.model_temp // 子业务显示组件
180
+ // 级联操作示例:
181
+ /*
182
+ if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
183
+ for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
184
+ // 控制设置级联
185
+ // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
186
+ if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
187
+ this.$refs.service_show.model_temp.activitys.fields[i].options=[
188
+ {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
189
+ ]
190
+ }
191
+ }
192
+ }
193
+ */
194
+ },
195
+ // 获取view层button事件
196
+ async 'button'(model){
197
+ console.log('进入async button事件方法')
198
+ var delteLocal = true
199
+ // 点击保存与重置按钮不需要修改本地工单状态
200
+ if(model.button.button_name == '保存' || model.button.button_name==='重置'){
201
+ delteLocal = false
202
+ }
203
+ // 点击重置按钮就重置数据
204
+ if(model.button.button_name==='重置'){
205
+ this.initializtion()
206
+ return
207
+ }
208
+ if(model.button.button_name==='下发'){
209
+ let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
210
+ for(let i=0;i<this.department_search.length;i++){
211
+ // 找到人名为person_name 的人,然后把人名换成id
212
+ if(this.department_search[i].name === person_name){
213
+ model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
214
+ }
215
+ }
216
+ }
217
+ console.log("button事件接收参数model=>" + JSON.stringify(model))
218
+ model=Object.assign({},this.selectdata,model)
219
+ console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
220
+ let http = new HttpResetClass()
221
+ var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
222
+ // 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})
223
+ // // 先判断是否包含code,如果服务端异常,可能不存在code
224
+ // console.log("service处理完成返回数据=>" + res)
225
+ // if(!res.code){
226
+ // console.log("service处理完成返回数据=>" + res)
227
+ // this.$showMessage('操作异常,原因:' + res)
228
+ // }else{
229
+ // console.log("service处理完成返回数据=>" + JSON.stringify(res))
230
+ // if(res.code = 200){
231
+ // this.showview = false
232
+ // // 特殊处理
233
+ // this.special(model)
234
+ // this.$dispatch('close')
235
+ // this.initializtion()
236
+ // this.$showMessage('操作成功')
237
+ // }else{
238
+ // this.$showMessage('操作失败,原因:' + res.data.msg)
239
+ // }
240
+ // }
241
+ let btn = btn_operate(this, url, http, model, delteLocal)
242
+ co(btn)
243
+ }
244
+ },
245
+ watch:{
246
+ // 监听selectdata的变化
247
+ 'selectdata'() {
248
+ console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
249
+ this.refurbish()
250
+ },
251
+ deep:true
252
+ }
253
+ }
254
+
255
+ let btn_operate = function * (self, url, http, model, delteLocal) {
256
+ // 下发,提交,保存,退回都在后台处理
257
+ console.log('即将请求后台url=>' + url)
258
+ 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})
259
+ .then((res) => {
260
+ console.log(JSON.stringify(res))
261
+ if(res.code = 200){
262
+ self.showview = false
263
+ // 如果需要删除本地记录则去删除
264
+ if(delteLocal){
265
+ self.deleteLocalApply(model)
266
+ }
267
+ // 特殊处理
268
+ self.special(model)
269
+ self.$dispatch('close')
270
+ self.initializtion()
271
+ self.$showMessage('操作成功')
272
+ }else{
273
+ self.$showMessage('操作失败,原因:' + res.data.msg)
274
+ }
275
+ })
276
+ .catch((ret) => {
277
+ self.$showMessage('操作异常,原因:' + JSON.stringify(ret.data))
278
+ })
279
+ }
280
+ </script>