apply-clients 4.1.17-weinan → 4.1.19-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apply-clients",
3
- "version": "4.1.17-weinan",
3
+ "version": "4.1.19-weinan",
4
4
  "description": "报建前端模块",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -1,349 +1,349 @@
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', this.$androidUtil.getProxyUrl() +'/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
- if (this.data.fields[i].param) {
113
- let temp = this.$appdata.getParam(this.data.fields[i].label)
114
-
115
- if (temp && temp.length > 0) {
116
- this.data.fields[i].options = temp
117
- }
118
-
119
- if (this.data.fields[i].paramLabel) {
120
- temp = this.$appdata.getParam(this.data.fields[i].paramLabel)
121
- if (temp && temp.length > 0) {
122
- this.data.fields[i].options = temp
123
- }
124
- }
125
- }
126
-
127
- }
128
- }
129
- // 初始化 buttons_fields
130
- for(let i=0;i<this.data.buttons.length;i++){
131
- if(this.data.buttons[i].button_fields){
132
- for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
133
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
134
- if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
135
- this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
136
- }
137
- // 如果配置类型为select,优先从参数列表获取options
138
- if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
139
- this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
140
- }
141
- // 下发特殊配置
142
- if(this.data.buttons[i].button_name==='下发'){
143
- if(this.data.buttons[i].button_fields.length===1){
144
- // value初始化
145
- // if(this.department_search){
146
- if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
147
- for(let k=0;k<this.department_search.length;k++){
148
- // 将id转换为name
149
- if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
150
- this.data.buttons[i].button_fields[0].value=this.department_search[k].name
151
- }
152
- }
153
- }
154
-
155
- if(this.department_search){
156
- let array = []
157
- for(let k=0;k<this.department_search.length;k++){
158
- array.push({label:this.department_search[k].name,value:this.department_search[k].name})
159
- }
160
- this.data.buttons[i].button_fields[0].options = array
161
- }
162
- }else {
163
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
164
- }
165
- }
166
- }
167
- }
168
- }
169
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
170
- let temp = JSON.parse(JSON.stringify(this.data))
171
- // 退回原因展示
172
- if(this.selectdata.f_back_reason){
173
- temp['back_reason'] = this.selectdata.f_back_reason
174
- }
175
- console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
176
- this.show_data = temp
177
- console.log('initializtion()方法结束,showview')
178
- this.showview = true
179
- if (this.selectdata.defname === '现场勘察' || this.selectdata.defname ==='入户安装') {
180
- for (const item of this.show_data.fields) {
181
- if (item.label === '现场勘察人员' && !item.value) {
182
- return item.value = Vue.user.name
183
- }
184
- }
185
- }
186
- },
187
- deleteLocalApply(model){
188
- console.log(`前台上传完成,开始删除本地报建工单`)
189
- this.$androidUtil.bzLogic('deleteApply', {data:model})
190
- },
191
- stopapply(model1,model){
192
- this.$showMessage('确定不具备条件,终止报建!',['confirm', 'cancel']).then((res)=>{
193
- if (res=='confirm'){
194
- this.selectdata = Object.assign( {},this.selectdata,model)
195
- let data = {
196
- loginUser: Vue.user,
197
- selectdata: this.selectdata,
198
- model: model1
199
- }
200
- let http = new HttpResetClass()
201
- http.load('POST', this.$androidUtil.getProxyUrl()+'/rs/logic/stopApply', {data: data}, {resolveMsg: null,rejectMsg: '删除失败'})
202
- .then(res => {
203
- if (res.data === 200) {
204
- this.$dispatch('search')
205
- this.$dispatch('close')
206
- } else {
207
- this.$showMessage('终止报建失败')
208
- }
209
- })
210
- }
211
- })
212
- }
213
- },
214
- events: {
215
- // 任意select选中时触发事件
216
- 'select_cascade'(index){
217
- // this.$refs.service_show.model_temp // 子业务显示组件
218
- // 级联操作示例:
219
- /*
220
- if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
221
- for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
222
- // 控制设置级联
223
- // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
224
- if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
225
- this.$refs.service_show.model_temp.activitys.fields[i].options=[
226
- {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
227
- ]
228
- }
229
- }
230
- }
231
- */
232
- },
233
- // 获取view层button事件
234
- async 'button'(model){
235
- console.log('进入async button事件方法')
236
- var delteLocal = true
237
- // 点击保存与重置按钮不需要修改本地工单状态
238
- if(model.button.button_name == '保存' || model.button.button_name==='重置'){
239
- delteLocal = false
240
- }
241
- // 点击重置按钮就重置数据
242
- if(model.button.button_name==='重置'){
243
- this.initializtion()
244
- return
245
- }
246
- if(model.button.button_name==='下发'){
247
- let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
248
- for(let i=0;i<this.department_search.length;i++){
249
- // 找到人名为person_name 的人,然后把人名换成id
250
- if(this.department_search[i].name === person_name){
251
- model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
252
- }
253
- }
254
- }
255
- console.log("button事件接收参数model=>" + JSON.stringify(model))
256
- model=Object.assign({},this.selectdata,model)
257
- console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
258
- let http = new HttpResetClass()
259
- if((this.selectdata.defname =='现场勘察' || this.selectdata.defname ==='入户安装') && model.f_is_have == '否'&& model. model.button.button_name == '提交'){
260
- let model1 ={
261
- f_stop_remarks : '不具备安装条件'
262
- }
263
- this.stopapply(model1,model)
264
- return
265
- }
266
- if((this.selectdata.defname =='现场勘察' || this.selectdata.defname ==='入户安装') && model.f_is_aerate == '否' && model. model.button.button_name == '提交'){
267
- let model1 ={
268
- f_stop_remarks : '未通气'
269
- }
270
- this.stopapply(model1,model)
271
- return
272
- }
273
- if(this.selectdata.defname =='现场勘察' && this.selectdata.f_apply_type == '工商户报建'&& model.button.button_name == '提交'){
274
- let http = new HttpResetClass()
275
- let data = {
276
- tablename: 't_files',
277
- condition: `defname = '现场勘察' and f_blobid = '${this.selectdata.f_process_id}'`
278
- }
279
- let res = await http.load('POST', this.$androidUtil.getProxyUrl() + '/rs/sql/singleTable', {data: data}, {
280
- resolveMsg: null,
281
- rejectMsg: '查询失败'
282
- })
283
- console.log("数据长度:" + res.data.length)
284
- if (res.data.length <= 0) {
285
- this.$showMessage("请上传照片!!!")
286
- return
287
- }
288
-
289
- }
290
- var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
291
- // 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})
292
- // // 先判断是否包含code,如果服务端异常,可能不存在code
293
- // console.log("service处理完成返回数据=>" + res)
294
- // if(!res.code){
295
- // console.log("service处理完成返回数据=>" + res)
296
- // this.$showMessage('操作异常,原因:' + res)
297
- // }else{
298
- // console.log("service处理完成返回数据=>" + JSON.stringify(res))
299
- // if(res.code = 200){
300
- // this.showview = false
301
- // // 特殊处理
302
- // this.special(model)
303
- // this.$dispatch('close')
304
- // this.initializtion()
305
- // this.$showMessage('操作成功')
306
- // }else{
307
- // this.$showMessage('操作失败,原因:' + res.data.msg)
308
- // }
309
- // }
310
- let btn = btn_operate(this, url, http, model, delteLocal)
311
- co(btn)
312
- }
313
- },
314
- watch:{
315
- // 监听selectdata的变化
316
- 'selectdata'() {
317
- console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
318
- this.refurbish()
319
- },
320
- deep:true
321
- }
322
- }
323
-
324
- let btn_operate = function * (self, url, http, model, delteLocal) {
325
- // 下发,提交,保存,退回都在后台处理
326
- console.log('即将请求后台url=>' + url)
327
- 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})
328
- .then((res) => {
329
- console.log(JSON.stringify(res))
330
- if(res.code = 200){
331
- self.showview = false
332
- // 如果需要删除本地记录则去删除
333
- if(delteLocal){
334
- self.deleteLocalApply(model)
335
- }
336
- // 特殊处理
337
- self.special(model)
338
- self.$dispatch('close')
339
- self.initializtion()
340
- self.$showMessage('操作成功')
341
- }else{
342
- self.$showMessage('操作失败,原因:' + res.data.msg)
343
- }
344
- })
345
- .catch((ret) => {
346
- self.$showMessage('操作异常,原因:' + JSON.stringify(ret.data))
347
- })
348
- }
349
- </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', this.$androidUtil.getProxyUrl() +'/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
+ if (this.data.fields[i].param) {
113
+ let temp = this.$appdata.getParam(this.data.fields[i].label)
114
+
115
+ if (temp && temp.length > 0) {
116
+ this.data.fields[i].options = temp
117
+ }
118
+
119
+ if (this.data.fields[i].paramLabel) {
120
+ temp = this.$appdata.getParam(this.data.fields[i].paramLabel)
121
+ if (temp && temp.length > 0) {
122
+ this.data.fields[i].options = temp
123
+ }
124
+ }
125
+ }
126
+
127
+ }
128
+ }
129
+ // 初始化 buttons_fields
130
+ for(let i=0;i<this.data.buttons.length;i++){
131
+ if(this.data.buttons[i].button_fields){
132
+ for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
133
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
134
+ if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
135
+ this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
136
+ }
137
+ // 如果配置类型为select,优先从参数列表获取options
138
+ if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
139
+ this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
140
+ }
141
+ // 下发特殊配置
142
+ if(this.data.buttons[i].button_name==='下发'){
143
+ if(this.data.buttons[i].button_fields.length===1){
144
+ // value初始化
145
+ // if(this.department_search){
146
+ if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
147
+ for(let k=0;k<this.department_search.length;k++){
148
+ // 将id转换为name
149
+ if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
150
+ this.data.buttons[i].button_fields[0].value=this.department_search[k].name
151
+ }
152
+ }
153
+ }
154
+
155
+ if(this.department_search){
156
+ let array = []
157
+ for(let k=0;k<this.department_search.length;k++){
158
+ array.push({label:this.department_search[k].name,value:this.department_search[k].name})
159
+ }
160
+ this.data.buttons[i].button_fields[0].options = array
161
+ }
162
+ }else {
163
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
164
+ }
165
+ }
166
+ }
167
+ }
168
+ }
169
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
170
+ let temp = JSON.parse(JSON.stringify(this.data))
171
+ // 退回原因展示
172
+ if(this.selectdata.f_back_reason){
173
+ temp['back_reason'] = this.selectdata.f_back_reason
174
+ }
175
+ console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
176
+ this.show_data = temp
177
+ console.log('initializtion()方法结束,showview')
178
+ this.showview = true
179
+ if (this.selectdata.defname === '现场勘察' || this.selectdata.defname ==='入户安装') {
180
+ for (const item of this.show_data.fields) {
181
+ if (item.label === '现场勘察人员' && !item.value) {
182
+ return item.value = Vue.user.name
183
+ }
184
+ }
185
+ }
186
+ },
187
+ deleteLocalApply(model){
188
+ console.log(`前台上传完成,开始删除本地报建工单`)
189
+ this.$androidUtil.bzLogic('deleteApply', {data:model})
190
+ },
191
+ stopapply(model1,model){
192
+ this.$showMessage('确定不具备条件,终止报建!',['confirm', 'cancel']).then((res)=>{
193
+ if (res=='confirm'){
194
+ this.selectdata = Object.assign( {},this.selectdata,model)
195
+ let data = {
196
+ loginUser: Vue.user,
197
+ selectdata: this.selectdata,
198
+ model: model1
199
+ }
200
+ let http = new HttpResetClass()
201
+ http.load('POST', this.$androidUtil.getProxyUrl()+'/rs/logic/stopApply', {data: data}, {resolveMsg: null,rejectMsg: '删除失败'})
202
+ .then(res => {
203
+ if (res.data === 200) {
204
+ this.$dispatch('search')
205
+ this.$dispatch('close')
206
+ } else {
207
+ this.$showMessage('终止报建失败')
208
+ }
209
+ })
210
+ }
211
+ })
212
+ }
213
+ },
214
+ events: {
215
+ // 任意select选中时触发事件
216
+ 'select_cascade'(index){
217
+ // this.$refs.service_show.model_temp // 子业务显示组件
218
+ // 级联操作示例:
219
+ /*
220
+ if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
221
+ for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
222
+ // 控制设置级联
223
+ // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
224
+ if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
225
+ this.$refs.service_show.model_temp.activitys.fields[i].options=[
226
+ {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
227
+ ]
228
+ }
229
+ }
230
+ }
231
+ */
232
+ },
233
+ // 获取view层button事件
234
+ async 'button'(model){
235
+ console.log('进入async button事件方法')
236
+ var delteLocal = true
237
+ // 点击保存与重置按钮不需要修改本地工单状态
238
+ if(model.button.button_name == '保存' || model.button.button_name==='重置'){
239
+ delteLocal = false
240
+ }
241
+ // 点击重置按钮就重置数据
242
+ if(model.button.button_name==='重置'){
243
+ this.initializtion()
244
+ return
245
+ }
246
+ if(model.button.button_name==='下发'){
247
+ let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
248
+ for(let i=0;i<this.department_search.length;i++){
249
+ // 找到人名为person_name 的人,然后把人名换成id
250
+ if(this.department_search[i].name === person_name){
251
+ model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
252
+ }
253
+ }
254
+ }
255
+ console.log("button事件接收参数model=>" + JSON.stringify(model))
256
+ model=Object.assign({},this.selectdata,model)
257
+ console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
258
+ let http = new HttpResetClass()
259
+ if((this.selectdata.defname =='现场勘察' || this.selectdata.defname ==='入户安装') && model.f_is_have == '否'&& model. model.button.button_name == '提交'){
260
+ let model1 ={
261
+ f_stop_remarks : '不具备安装条件'
262
+ }
263
+ this.stopapply(model1,model)
264
+ return
265
+ }
266
+ if((this.selectdata.defname =='现场勘察' || this.selectdata.defname ==='入户安装') && model.f_is_aerate == '否' && model. model.button.button_name == '提交'){
267
+ let model1 ={
268
+ f_stop_remarks : '未通气'
269
+ }
270
+ this.stopapply(model1,model)
271
+ return
272
+ }
273
+ if(this.selectdata.defname =='现场勘察' && this.selectdata.f_apply_type == '工商户报建'&& model.button.button_name == '提交'){
274
+ let http = new HttpResetClass()
275
+ let data = {
276
+ tablename: 't_files',
277
+ condition: `defname = '现场勘察' and f_blobid = '${this.selectdata.f_process_id}'`
278
+ }
279
+ let res = await http.load('POST', this.$androidUtil.getProxyUrl() + '/rs/sql/singleTable', {data: data}, {
280
+ resolveMsg: null,
281
+ rejectMsg: '查询失败'
282
+ })
283
+ console.log("数据长度:" + res.data.length)
284
+ if (res.data.length <= 0) {
285
+ this.$showMessage("请上传照片!!!")
286
+ return
287
+ }
288
+
289
+ }
290
+ var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
291
+ // 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})
292
+ // // 先判断是否包含code,如果服务端异常,可能不存在code
293
+ // console.log("service处理完成返回数据=>" + res)
294
+ // if(!res.code){
295
+ // console.log("service处理完成返回数据=>" + res)
296
+ // this.$showMessage('操作异常,原因:' + res)
297
+ // }else{
298
+ // console.log("service处理完成返回数据=>" + JSON.stringify(res))
299
+ // if(res.code = 200){
300
+ // this.showview = false
301
+ // // 特殊处理
302
+ // this.special(model)
303
+ // this.$dispatch('close')
304
+ // this.initializtion()
305
+ // this.$showMessage('操作成功')
306
+ // }else{
307
+ // this.$showMessage('操作失败,原因:' + res.data.msg)
308
+ // }
309
+ // }
310
+ let btn = btn_operate(this, url, http, model, delteLocal)
311
+ co(btn)
312
+ }
313
+ },
314
+ watch:{
315
+ // 监听selectdata的变化
316
+ 'selectdata'() {
317
+ console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
318
+ this.refurbish()
319
+ },
320
+ deep:true
321
+ }
322
+ }
323
+
324
+ let btn_operate = function * (self, url, http, model, delteLocal) {
325
+ // 下发,提交,保存,退回都在后台处理
326
+ console.log('即将请求后台url=>' + url)
327
+ 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})
328
+ .then((res) => {
329
+ console.log(JSON.stringify(res))
330
+ if(res.code = 200){
331
+ self.showview = false
332
+ // 如果需要删除本地记录则去删除
333
+ if(delteLocal){
334
+ self.deleteLocalApply(model)
335
+ }
336
+ // 特殊处理
337
+ self.special(model)
338
+ self.$dispatch('close')
339
+ self.initializtion()
340
+ self.$showMessage('操作成功')
341
+ }else{
342
+ self.$showMessage('操作失败,原因:' + res.data.msg)
343
+ }
344
+ })
345
+ .catch((ret) => {
346
+ self.$showMessage('操作异常,原因:' + JSON.stringify(ret.data))
347
+ })
348
+ }
349
+ </script>
@@ -18,7 +18,7 @@
18
18
  :value="data.fields[index].value"
19
19
  :readonly="item.readonly"
20
20
  :disable="item.disable"
21
- @change="disabled_check(data.fields[index].required,data.fields[index].value)"
21
+ @change="select_change(index)"
22
22
  @blur ="check_disable"
23
23
  />
24
24
  </div>
@@ -1054,6 +1054,39 @@ export default {
1054
1054
  }
1055
1055
  }
1056
1056
  if (this.show_data.fields[index].label === '其他费用') {
1057
+ let http = new HttpResetClass()
1058
+ let data = {
1059
+ num1: this.getLableValue('单价'),
1060
+ num2: this.getLableValue('户数'),
1061
+ operator: '*'
1062
+ }
1063
+ try {
1064
+ let res = await http.load('POST', 'rs/logic/compute', {data: data}, {
1065
+ resolveMsg: null,
1066
+ rejectMsg: null
1067
+ })
1068
+ data = {
1069
+ num1: res.data,
1070
+ num2: this.getLableValue('其他费用'),
1071
+ operator: '+'
1072
+ }
1073
+ res = await http.load('POST', 'rs/logic/compute', {data: data}, {
1074
+ resolveMsg: null,
1075
+ rejectMsg: null
1076
+ })
1077
+ this.setLabelValue('合同金额',res.data)
1078
+ if(this.show_data.f_apply_type === '居民报建'){
1079
+ this.show_data.f_contract_money = res.data
1080
+ this.show_data.f_due_money = res.data
1081
+ this.show_data.f_surplus_money = res.data
1082
+ this.setLabelValue('应交总金额',res.data)
1083
+ this.setLabelValue('未结总金额',res.data)
1084
+ }
1085
+ } catch (e) {
1086
+ this.$showAlert(e.data.msg, 'warning', 3000)
1087
+ }
1088
+ }
1089
+ /*if (this.show_data.fields[index].label === '其他费用') {
1057
1090
  let http = new HttpResetClass()
1058
1091
  let data = {
1059
1092
  num1: this.getLableValue(this.show_data.fields[index].label),
@@ -1076,7 +1109,7 @@ export default {
1076
1109
  } catch (e) {
1077
1110
  this.$showAlert(e.data.msg, 'warning', 3000)
1078
1111
  }
1079
- }
1112
+ }*/
1080
1113
  }
1081
1114
  // ========================= 武安 =================================
1082
1115
  // 号码检测