apply-clients 4.1.16-weinan → 4.1.18-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.16-weinan",
3
+ "version": "4.1.18-weinan",
4
4
  "description": "报建前端模块",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -59,8 +59,9 @@
59
59
 
60
60
  for (var i = 0; i < res.data.length; i++) {
61
61
  console.log('-----------地址----------------')
62
- console.log(`${this.$androidUtil.getProxyUrl()}/${res.data[i].f_downloadpath.substring(res.data[i].f_downloadpath.lastIndexOf(":\\") + 3)}`)
63
- res.data[i].f_downloadURL = `${this.$androidUtil.getProxyUrl()}/${res.data[i].f_downloadpath.substring(res.data[i].f_downloadpath.lastIndexOf(":\\") + 3)}`
62
+
63
+ console.log(`${this.$androidUtil.getProxyUrl()}/${res.data[i].f_downloadpath.substring(res.data[i].f_downloadpath.lastIndexOf(":\\") + 2)}`)
64
+ res.data[i].f_downloadURL = `${this.$androidUtil.getProxyUrl()}/${res.data[i].f_downloadpath.substring(res.data[i].f_downloadpath.lastIndexOf(":\\") + 2)}`
64
65
  }
65
66
 
66
67
  this.fileList = res.data
@@ -92,7 +93,6 @@
92
93
  },
93
94
  cameraCallBack (fileName, fileUrl) {
94
95
  console.log('-----------cameraCallBack-----------------')
95
-
96
96
  let data = {
97
97
  blodid: HostApp.__this__.blobid,
98
98
  type: HostApp.__this__.type,
@@ -104,7 +104,7 @@ export default{
104
104
  _this.$back()
105
105
  },
106
106
  search () {
107
- var condition = "1=1 and (f_apply_type! = '居民报建' and f_apply_type! = '工商户报建' or (f_apply_type = '居民报建' and defname = '现场勘察') or (f_apply_type = '工商户报建' and (defname = '现场勘察' or defname = '施工'))))"
107
+ var condition = "1=1 and (f_apply_type! = '居民报建' and f_apply_type! = '工商户报建' or (f_apply_type = '居民报建' and defname = '入户安装') or (f_apply_type = '工商户报建' and (defname = '现场勘察' or defname = '施工')))"
108
108
  var param = {condition: condition,condValue:[],data:{"id": Vue.user.id,orgid: Vue.user.orgid}}
109
109
  let http = new HttpResetClass()
110
110
  http.load('POST',`${this.$androidUtil.getProxyUrl()}/rs/sql/checkuser`,{data:param}).then(res=>{
@@ -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. 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>
@@ -258,6 +258,17 @@
258
258
  closemodal(){
259
259
  this.showmodal=false
260
260
  },
261
+ // 是否禁用按钮
262
+ disableButton() {
263
+ let fields = this.data.fields
264
+ let flag = false
265
+ for (const item of fields) {
266
+ if (item.type === 'select' && item.label === '工程状态'&& (item.value === '正在施工' || item.value === '未开工' )&& item.disabledButton) {
267
+ flag = true
268
+ }
269
+ }
270
+ this.disable_button = flag
271
+ },
261
272
  // 点击按钮
262
273
  clicked(index,button){
263
274
  console.log(`点击了按钮index:${index}+button:${JSON.stringify(button)}`);
@@ -303,6 +314,7 @@
303
314
  },
304
315
  // 级联操作预留
305
316
  select_change(index){
317
+ this.disableButton()
306
318
  this.$dispatch('select_cascade',index)
307
319
  },
308
320
  // 检测按钮的disable
@@ -581,6 +581,75 @@ export default {
581
581
  throw `还有${res.data[0].num}户未安装,无法提交`
582
582
  }
583
583
  }
584
+ if (
585
+ model.f_apply_type === '工商户报建' &&
586
+ model.button.button_name === '提交' &&
587
+ (model.defname === '设计出图' || model.defname === '竣工验收' || model.defname === '合同签订' )
588
+ ) {
589
+ let http = new HttpResetClass()
590
+ let data = {
591
+ tablename: 't_files',
592
+ condition: `defname = '${model.defname}' and f_blobid = '${this.selectdata.f_process_id}'`
593
+ }
594
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
595
+ resolveMsg: null,
596
+ rejectMsg: '查询失败'
597
+ })
598
+ console.log("数据长度:" + res.data.length)
599
+ if (res.data.length <= 0) {
600
+ throw '请上传附件!!!'
601
+ }
602
+
603
+ }
604
+ if (
605
+ model.f_apply_type === '工商户报建' &&
606
+ model.button.button_name === '提交' &&
607
+ model.defname === '报建登记'
608
+ ) {
609
+ let http = new HttpResetClass()
610
+ let data = {
611
+ tablename: 't_files',
612
+ condition: `defname = '${model.defname}' and f_blobid = '${this.selectdata.f_process_id}'`
613
+ }
614
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
615
+ resolveMsg: null,
616
+ rejectMsg: '查询失败'
617
+ })
618
+ console.log("数据长度:" , res.data)
619
+ if (res.data.length <= 0) {
620
+ throw '请上传附件!!!'
621
+ }
622
+ let inc=true
623
+ let name1 = ''
624
+ let wenjian = ['营业执照','身份证','非居民用户申请表','灶具五证','厨房设备布置设计图']
625
+ for (let name = 0;name<wenjian.length;name++){
626
+ let has=false
627
+ for (let i=0;i<res.data.length;i++){
628
+ if(res.data[i].f_filename.includes(wenjian[name])){
629
+ has=true
630
+ }
631
+ }
632
+ if(!has){
633
+ name1=name1+wenjian[name]+','
634
+ inc=false
635
+ }
636
+ }
637
+ if (inc==false){
638
+ throw '请上传'+name1+'附件!!!'
639
+ }
640
+ /*for (let i=0;i<res.data.length;i++){
641
+ if (!(
642
+ res.data[i].f_filename.includes('营业执照')
643
+ || res.data[i].f_filename.includes('身份证')
644
+ || res.data[i].f_filename.includes('非居民用户申请表')
645
+ || res.data[i].f_filename.includes('灶具五证')
646
+ || res.data[i].f_filename.includes('厨房设备布置设计图')
647
+ )){
648
+ throw '请检查当前节点的附件,只能上传以下文件 营业执照/'
649
+ return
650
+ }
651
+ }*/
652
+ }
584
653
  return model
585
654
  },
586
655
  // ========================= 武安 =================================
@@ -893,7 +962,7 @@ export default {
893
962
  // }
894
963
  // }
895
964
  // }
896
- if(this.show_data.defname === '现场勘察' || this.selectdata.defname ==='入户安装') {
965
+ if(this.show_data.defname === '现场勘察' || this.show_data.defname ==='入户安装') {
897
966
  console.log("this.shdata",this.show_data)
898
967
  if (this.show_data.fields[index].label === '是否具备安装条件') {
899
968
  for (const button of this.show_data.buttons) {
@@ -534,6 +534,10 @@
534
534
  if (item.type === 'select' && (item.value === '否' || item.value === '未开工') && item.disabledButton) {
535
535
  flag = true
536
536
  }
537
+ // 任何选择框只要是否都不能提交
538
+ if (item.type === 'select' && item.label === '工程状态'&& item.value === '正在施工'&& item.disabledButton) {
539
+ flag = true
540
+ }
537
541
  }
538
542
 
539
543
  let count = 0