apply-clients 5.0.35-63 → 5.0.35-64
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 +1 -1
- package/src/components/app_apply/ApplyToDoList.vue +2820 -2820
- package/src/components/app_apply/ServiceControl.vue +540 -540
- package/src/components/app_apply/ezhou/ServiceView.vue +810 -810
- package/src/components/product/Common/PrintBill.vue +121 -121
- package/src/components/product/EngineeringManagement/EngineerUpload.vue +304 -304
- package/src/components/product/EngineeringManagement/EngineeringManagement.vue +137 -137
- package/src/components/product/EngineeringManagement/EngineeringSelect.vue +588 -588
- package/src/components/product/EngineeringSupervisory/EngineeringApplyStopInfo.vue +281 -281
- package/src/components/product/EngineeringSupervisory/EngineeringSupervisoryControl.vue +130 -130
- package/src/components/product/EngineeringSupervisory/EngineeringSupervisoryList.vue +350 -350
- package/src/components/product/Function/InstallInfoSelect.vue +255 -255
- package/src/components/product/Function/functions/BuyerMessage.vue +512 -512
- package/src/components/product/Function/functions/InstallFee.vue +1144 -1144
- package/src/components/product/Process/ExplorationSelect.vue +640 -640
- package/src/components/product/Process/Processes/Service/PaperTicketBill.vue +85 -85
- package/src/components/product/Supervisory/SupervisoryList.vue +350 -350
- package/src/components/product/stopInfo/ApplyStopInfo.vue +281 -281
- package/src/ezhouAndroid.js +48 -48
|
@@ -1,540 +1,540 @@
|
|
|
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
|
-
if(this.$refs.service_show.data.fields[i].label=="施工已上传文件"){
|
|
265
|
-
//增加和删除框中的内容
|
|
266
|
-
if(this.$refs.service_show.data.fields[index].items[index2].value == false){
|
|
267
|
-
// this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
|
|
268
|
-
this.$refs.service_show.data.fields[i].value=this.$refs.service_show.data.fields[i].value==undefined?'':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[i].value==undefined?'':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
|
-
this.$refs.service_show.update()
|
|
305
|
-
},
|
|
306
|
-
// 任意select选中时触发事件
|
|
307
|
-
async 'select_cascade'(index){
|
|
308
|
-
// this.$refs.service_show.model_temp // 子业务显示组件
|
|
309
|
-
// 级联操作示例:
|
|
310
|
-
/*
|
|
311
|
-
if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
|
|
312
|
-
for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
|
|
313
|
-
// 控制设置级联
|
|
314
|
-
// 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
|
|
315
|
-
if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
|
|
316
|
-
this.$refs.service_show.model_temp.activitys.fields[i].options=[
|
|
317
|
-
{label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
|
|
318
|
-
]
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
*/
|
|
323
|
-
if (this.$refs.service_show.data.fields[index].label === '县/区') {
|
|
324
|
-
let temp = this.$refs.service_show.data.fields[index].value
|
|
325
|
-
console.log('==============================县/区:' + temp)
|
|
326
|
-
for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
|
|
327
|
-
// 控制设置级联
|
|
328
|
-
// 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
|
|
329
|
-
if (this.$refs.service_show.data.fields[i].label === '街道名称') {
|
|
330
|
-
await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {
|
|
331
|
-
data: {
|
|
332
|
-
tablename: 't_street',
|
|
333
|
-
condition: `f_filialeids = '${Vue.user.f_orgids}' and f_pcd='${temp}'`
|
|
334
|
-
}
|
|
335
|
-
}, {resolveMsg: null, rejectMsg: null}).then(res => {
|
|
336
|
-
let streetrs = []
|
|
337
|
-
for (let i = 0; i < res.data.length; i++) {
|
|
338
|
-
let temp = {
|
|
339
|
-
label: res.data[i].f_street,
|
|
340
|
-
value: res.data[i].f_street
|
|
341
|
-
}
|
|
342
|
-
streetrs.push(temp)
|
|
343
|
-
}
|
|
344
|
-
this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
|
|
345
|
-
// console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
|
|
346
|
-
this.$refs.service_show.update()
|
|
347
|
-
})
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
if (this.$refs.service_show.data.fields[index].label === '街道名称') {
|
|
352
|
-
let temp = this.$refs.service_show.data.fields[index].value
|
|
353
|
-
console.log('=============================街道:' + temp)
|
|
354
|
-
for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
|
|
355
|
-
// 控制设置级联
|
|
356
|
-
// 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
|
|
357
|
-
if (this.$refs.service_show.data.fields[i].label === '小区名称') {
|
|
358
|
-
await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {
|
|
359
|
-
data: {
|
|
360
|
-
tablename: 't_area',
|
|
361
|
-
condition: `f_filialeids = '${Vue.user.f_orgids}' and f_street='${temp}'`
|
|
362
|
-
}
|
|
363
|
-
}, {resolveMsg: null, rejectMsg: null}).then(res => {
|
|
364
|
-
let arears = []
|
|
365
|
-
for (let i = 0; i < res.data.length; i++) {
|
|
366
|
-
let temp = {
|
|
367
|
-
label: res.data[i].f_residential_area,
|
|
368
|
-
value: res.data[i].f_residential_area
|
|
369
|
-
}
|
|
370
|
-
arears.push(temp)
|
|
371
|
-
}
|
|
372
|
-
this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...arears]
|
|
373
|
-
// console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
|
|
374
|
-
this.$refs.service_show.update()
|
|
375
|
-
})
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
// 合成地址
|
|
380
|
-
if (
|
|
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
|
-
this.$refs.service_show.data.fields[index].label === '单元号' ||
|
|
386
|
-
this.$refs.service_show.data.fields[index].label === '楼层' ||
|
|
387
|
-
this.$refs.service_show.data.fields[index].label === '门牌号'
|
|
388
|
-
) {
|
|
389
|
-
console.log('即将合成地址')
|
|
390
|
-
var address = ''
|
|
391
|
-
for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
|
|
392
|
-
// 控制设置级联
|
|
393
|
-
// 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
|
|
394
|
-
// xxx xx xxx
|
|
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 += this.$refs.service_show.data.fields[i].value
|
|
406
|
-
}
|
|
407
|
-
if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
|
|
408
|
-
address += '栋'
|
|
409
|
-
}
|
|
410
|
-
if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
|
|
411
|
-
address += '-' +this.$refs.service_show.data.fields[i].value
|
|
412
|
-
}
|
|
413
|
-
if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
|
|
414
|
-
address += '单元'
|
|
415
|
-
}
|
|
416
|
-
if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
|
|
417
|
-
address += '-' +this.$refs.service_show.data.fields[i].value
|
|
418
|
-
}
|
|
419
|
-
if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
|
|
420
|
-
address += '层'
|
|
421
|
-
}
|
|
422
|
-
if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
|
|
423
|
-
address += '-' +this.$refs.service_show.data.fields[i].value
|
|
424
|
-
}
|
|
425
|
-
if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
|
|
426
|
-
address += '室'
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
console.log('获取到的address=>' + address)
|
|
431
|
-
// 数据获取完毕时放入地址text
|
|
432
|
-
for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
|
|
433
|
-
if (this.$refs.service_show.data.fields[i].label === '地址' || this.$refs.service_show.data.fields[i].label === '报装地址') {
|
|
434
|
-
this.$refs.service_show.data.fields[i].value = address
|
|
435
|
-
console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
},
|
|
440
|
-
// 获取view层button事件
|
|
441
|
-
async 'button'(model){
|
|
442
|
-
this.loading=true
|
|
443
|
-
|
|
444
|
-
console.log('进入async button事件方法')
|
|
445
|
-
var delteLocal = true
|
|
446
|
-
// 点击保存与重置按钮不需要修改本地工单状态
|
|
447
|
-
if(model.button.button_name == '保存' || model.button.button_name==='重置'){
|
|
448
|
-
delteLocal = false
|
|
449
|
-
}
|
|
450
|
-
// 点击重置按钮就重置数据
|
|
451
|
-
if(model.button.button_name==='重置'){
|
|
452
|
-
this.initializtion()
|
|
453
|
-
return
|
|
454
|
-
}
|
|
455
|
-
if(model.button.button_name==='下发'){
|
|
456
|
-
let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
|
|
457
|
-
for(let i=0;i<this.department_search.length;i++){
|
|
458
|
-
// 找到人名为person_name 的人,然后把人名换成id
|
|
459
|
-
if(this.department_search[i].name === person_name){
|
|
460
|
-
model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
console.log("button事件接收参数model=>" + JSON.stringify(model))
|
|
465
|
-
model=Object.assign({},this.selectdata,model)
|
|
466
|
-
console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
|
|
467
|
-
let http = new HttpResetClass()
|
|
468
|
-
var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
|
|
469
|
-
// 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})
|
|
470
|
-
// // 先判断是否包含code,如果服务端异常,可能不存在code
|
|
471
|
-
// console.log("service处理完成返回数据=>" + res)
|
|
472
|
-
// if(!res.code){
|
|
473
|
-
// console.log("service处理完成返回数据=>" + res)
|
|
474
|
-
// this.$showMessage('操作异常,原因:' + res)
|
|
475
|
-
// }else{
|
|
476
|
-
// console.log("service处理完成返回数据=>" + JSON.stringify(res))
|
|
477
|
-
// if(res.code = 200){
|
|
478
|
-
// this.showview = false
|
|
479
|
-
// // 特殊处理
|
|
480
|
-
// this.special(model)
|
|
481
|
-
// this.$dispatch('close')
|
|
482
|
-
// this.initializtion()
|
|
483
|
-
// this.$showMessage('操作成功')
|
|
484
|
-
// }else{
|
|
485
|
-
// this.$showMessage('操作失败,原因:' + res.data.msg)
|
|
486
|
-
// }
|
|
487
|
-
// }
|
|
488
|
-
let btn = btn_operate(this, url, http, model, delteLocal)
|
|
489
|
-
co(btn)
|
|
490
|
-
}
|
|
491
|
-
},
|
|
492
|
-
watch:{
|
|
493
|
-
// 监听selectdata的变化
|
|
494
|
-
'selectdata'() {
|
|
495
|
-
console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
|
|
496
|
-
this.refurbish()
|
|
497
|
-
},
|
|
498
|
-
deep:true
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
let btn_operate = function * (self, url, http, model, delteLocal) {
|
|
503
|
-
self.delteLocal=delteLocal
|
|
504
|
-
|
|
505
|
-
// 下发,提交,保存,退回都在后台处理
|
|
506
|
-
console.log('即将请求后台url=>' + url)
|
|
507
|
-
model.employeetemplate=''
|
|
508
|
-
self.model=model
|
|
509
|
-
console.log(JSON.stringify(self.model))
|
|
510
|
-
let param={
|
|
511
|
-
employeetemplate:'',
|
|
512
|
-
tables:self.data.tables,
|
|
513
|
-
start_activity:self.$workflow_vue.start_activity,
|
|
514
|
-
model:model,
|
|
515
|
-
loginUser:Vue.user
|
|
516
|
-
}
|
|
517
|
-
if(param.model.defname === '现场勘查定价'){
|
|
518
|
-
param.model.f_unaccounts_money = param.model.f_total_cost
|
|
519
|
-
}
|
|
520
|
-
// 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})
|
|
521
|
-
let paramStr = JSON.stringify(param)
|
|
522
|
-
// 多长截断一次
|
|
523
|
-
let subLength = 800
|
|
524
|
-
for (let i = 0; i < paramStr.length; i += subLength) {
|
|
525
|
-
HostApp.param_cache(paramStr.substr(i, subLength))
|
|
526
|
-
}
|
|
527
|
-
HostApp.__this__ = self
|
|
528
|
-
HostApp.syncLogic({
|
|
529
|
-
// logic别名,key必须为logic
|
|
530
|
-
'logic': 'updatePic',
|
|
531
|
-
// 回调执行方法名,key必须为callback
|
|
532
|
-
'callback': 'javascript:HostApp.__this__.saveCallBack()',
|
|
533
|
-
// 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
|
|
534
|
-
// 执行回调方法传入key为backresult
|
|
535
|
-
// 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
|
|
536
|
-
'backresult': 1
|
|
537
|
-
})
|
|
538
|
-
|
|
539
|
-
}
|
|
540
|
-
</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
|
+
if(this.$refs.service_show.data.fields[i].label=="施工已上传文件"){
|
|
265
|
+
//增加和删除框中的内容
|
|
266
|
+
if(this.$refs.service_show.data.fields[index].items[index2].value == false){
|
|
267
|
+
// this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
|
|
268
|
+
this.$refs.service_show.data.fields[i].value=this.$refs.service_show.data.fields[i].value==undefined?'':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[i].value==undefined?'':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
|
+
this.$refs.service_show.update()
|
|
305
|
+
},
|
|
306
|
+
// 任意select选中时触发事件
|
|
307
|
+
async 'select_cascade'(index){
|
|
308
|
+
// this.$refs.service_show.model_temp // 子业务显示组件
|
|
309
|
+
// 级联操作示例:
|
|
310
|
+
/*
|
|
311
|
+
if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
|
|
312
|
+
for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
|
|
313
|
+
// 控制设置级联
|
|
314
|
+
// 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
|
|
315
|
+
if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
|
|
316
|
+
this.$refs.service_show.model_temp.activitys.fields[i].options=[
|
|
317
|
+
{label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
*/
|
|
323
|
+
if (this.$refs.service_show.data.fields[index].label === '县/区') {
|
|
324
|
+
let temp = this.$refs.service_show.data.fields[index].value
|
|
325
|
+
console.log('==============================县/区:' + temp)
|
|
326
|
+
for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
|
|
327
|
+
// 控制设置级联
|
|
328
|
+
// 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
|
|
329
|
+
if (this.$refs.service_show.data.fields[i].label === '街道名称') {
|
|
330
|
+
await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {
|
|
331
|
+
data: {
|
|
332
|
+
tablename: 't_street',
|
|
333
|
+
condition: `f_filialeids = '${Vue.user.f_orgids}' and f_pcd='${temp}'`
|
|
334
|
+
}
|
|
335
|
+
}, {resolveMsg: null, rejectMsg: null}).then(res => {
|
|
336
|
+
let streetrs = []
|
|
337
|
+
for (let i = 0; i < res.data.length; i++) {
|
|
338
|
+
let temp = {
|
|
339
|
+
label: res.data[i].f_street,
|
|
340
|
+
value: res.data[i].f_street
|
|
341
|
+
}
|
|
342
|
+
streetrs.push(temp)
|
|
343
|
+
}
|
|
344
|
+
this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
|
|
345
|
+
// console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
|
|
346
|
+
this.$refs.service_show.update()
|
|
347
|
+
})
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if (this.$refs.service_show.data.fields[index].label === '街道名称') {
|
|
352
|
+
let temp = this.$refs.service_show.data.fields[index].value
|
|
353
|
+
console.log('=============================街道:' + temp)
|
|
354
|
+
for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
|
|
355
|
+
// 控制设置级联
|
|
356
|
+
// 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
|
|
357
|
+
if (this.$refs.service_show.data.fields[i].label === '小区名称') {
|
|
358
|
+
await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/singleTable`, {
|
|
359
|
+
data: {
|
|
360
|
+
tablename: 't_area',
|
|
361
|
+
condition: `f_filialeids = '${Vue.user.f_orgids}' and f_street='${temp}'`
|
|
362
|
+
}
|
|
363
|
+
}, {resolveMsg: null, rejectMsg: null}).then(res => {
|
|
364
|
+
let arears = []
|
|
365
|
+
for (let i = 0; i < res.data.length; i++) {
|
|
366
|
+
let temp = {
|
|
367
|
+
label: res.data[i].f_residential_area,
|
|
368
|
+
value: res.data[i].f_residential_area
|
|
369
|
+
}
|
|
370
|
+
arears.push(temp)
|
|
371
|
+
}
|
|
372
|
+
this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...arears]
|
|
373
|
+
// console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
|
|
374
|
+
this.$refs.service_show.update()
|
|
375
|
+
})
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
// 合成地址
|
|
380
|
+
if (
|
|
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
|
+
this.$refs.service_show.data.fields[index].label === '单元号' ||
|
|
386
|
+
this.$refs.service_show.data.fields[index].label === '楼层' ||
|
|
387
|
+
this.$refs.service_show.data.fields[index].label === '门牌号'
|
|
388
|
+
) {
|
|
389
|
+
console.log('即将合成地址')
|
|
390
|
+
var address = ''
|
|
391
|
+
for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
|
|
392
|
+
// 控制设置级联
|
|
393
|
+
// 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
|
|
394
|
+
// xxx xx xxx
|
|
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 += this.$refs.service_show.data.fields[i].value
|
|
406
|
+
}
|
|
407
|
+
if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
|
|
408
|
+
address += '栋'
|
|
409
|
+
}
|
|
410
|
+
if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
|
|
411
|
+
address += '-' +this.$refs.service_show.data.fields[i].value
|
|
412
|
+
}
|
|
413
|
+
if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
|
|
414
|
+
address += '单元'
|
|
415
|
+
}
|
|
416
|
+
if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
|
|
417
|
+
address += '-' +this.$refs.service_show.data.fields[i].value
|
|
418
|
+
}
|
|
419
|
+
if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
|
|
420
|
+
address += '层'
|
|
421
|
+
}
|
|
422
|
+
if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
|
|
423
|
+
address += '-' +this.$refs.service_show.data.fields[i].value
|
|
424
|
+
}
|
|
425
|
+
if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
|
|
426
|
+
address += '室'
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
}
|
|
430
|
+
console.log('获取到的address=>' + address)
|
|
431
|
+
// 数据获取完毕时放入地址text
|
|
432
|
+
for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
|
|
433
|
+
if (this.$refs.service_show.data.fields[i].label === '地址' || this.$refs.service_show.data.fields[i].label === '报装地址') {
|
|
434
|
+
this.$refs.service_show.data.fields[i].value = address
|
|
435
|
+
console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
// 获取view层button事件
|
|
441
|
+
async 'button'(model){
|
|
442
|
+
this.loading=true
|
|
443
|
+
|
|
444
|
+
console.log('进入async button事件方法')
|
|
445
|
+
var delteLocal = true
|
|
446
|
+
// 点击保存与重置按钮不需要修改本地工单状态
|
|
447
|
+
if(model.button.button_name == '保存' || model.button.button_name==='重置'){
|
|
448
|
+
delteLocal = false
|
|
449
|
+
}
|
|
450
|
+
// 点击重置按钮就重置数据
|
|
451
|
+
if(model.button.button_name==='重置'){
|
|
452
|
+
this.initializtion()
|
|
453
|
+
return
|
|
454
|
+
}
|
|
455
|
+
if(model.button.button_name==='下发'){
|
|
456
|
+
let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
|
|
457
|
+
for(let i=0;i<this.department_search.length;i++){
|
|
458
|
+
// 找到人名为person_name 的人,然后把人名换成id
|
|
459
|
+
if(this.department_search[i].name === person_name){
|
|
460
|
+
model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
console.log("button事件接收参数model=>" + JSON.stringify(model))
|
|
465
|
+
model=Object.assign({},this.selectdata,model)
|
|
466
|
+
console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
|
|
467
|
+
let http = new HttpResetClass()
|
|
468
|
+
var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
|
|
469
|
+
// 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})
|
|
470
|
+
// // 先判断是否包含code,如果服务端异常,可能不存在code
|
|
471
|
+
// console.log("service处理完成返回数据=>" + res)
|
|
472
|
+
// if(!res.code){
|
|
473
|
+
// console.log("service处理完成返回数据=>" + res)
|
|
474
|
+
// this.$showMessage('操作异常,原因:' + res)
|
|
475
|
+
// }else{
|
|
476
|
+
// console.log("service处理完成返回数据=>" + JSON.stringify(res))
|
|
477
|
+
// if(res.code = 200){
|
|
478
|
+
// this.showview = false
|
|
479
|
+
// // 特殊处理
|
|
480
|
+
// this.special(model)
|
|
481
|
+
// this.$dispatch('close')
|
|
482
|
+
// this.initializtion()
|
|
483
|
+
// this.$showMessage('操作成功')
|
|
484
|
+
// }else{
|
|
485
|
+
// this.$showMessage('操作失败,原因:' + res.data.msg)
|
|
486
|
+
// }
|
|
487
|
+
// }
|
|
488
|
+
let btn = btn_operate(this, url, http, model, delteLocal)
|
|
489
|
+
co(btn)
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
watch:{
|
|
493
|
+
// 监听selectdata的变化
|
|
494
|
+
'selectdata'() {
|
|
495
|
+
console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
|
|
496
|
+
this.refurbish()
|
|
497
|
+
},
|
|
498
|
+
deep:true
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
let btn_operate = function * (self, url, http, model, delteLocal) {
|
|
503
|
+
self.delteLocal=delteLocal
|
|
504
|
+
|
|
505
|
+
// 下发,提交,保存,退回都在后台处理
|
|
506
|
+
console.log('即将请求后台url=>' + url)
|
|
507
|
+
model.employeetemplate=''
|
|
508
|
+
self.model=model
|
|
509
|
+
console.log(JSON.stringify(self.model))
|
|
510
|
+
let param={
|
|
511
|
+
employeetemplate:'',
|
|
512
|
+
tables:self.data.tables,
|
|
513
|
+
start_activity:self.$workflow_vue.start_activity,
|
|
514
|
+
model:model,
|
|
515
|
+
loginUser:Vue.user
|
|
516
|
+
}
|
|
517
|
+
if(param.model.defname === '现场勘查定价'){
|
|
518
|
+
param.model.f_unaccounts_money = param.model.f_total_cost
|
|
519
|
+
}
|
|
520
|
+
// 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})
|
|
521
|
+
let paramStr = JSON.stringify(param)
|
|
522
|
+
// 多长截断一次
|
|
523
|
+
let subLength = 800
|
|
524
|
+
for (let i = 0; i < paramStr.length; i += subLength) {
|
|
525
|
+
HostApp.param_cache(paramStr.substr(i, subLength))
|
|
526
|
+
}
|
|
527
|
+
HostApp.__this__ = self
|
|
528
|
+
HostApp.syncLogic({
|
|
529
|
+
// logic别名,key必须为logic
|
|
530
|
+
'logic': 'updatePic',
|
|
531
|
+
// 回调执行方法名,key必须为callback
|
|
532
|
+
'callback': 'javascript:HostApp.__this__.saveCallBack()',
|
|
533
|
+
// 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
|
|
534
|
+
// 执行回调方法传入key为backresult
|
|
535
|
+
// 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
|
|
536
|
+
'backresult': 1
|
|
537
|
+
})
|
|
538
|
+
|
|
539
|
+
}
|
|
540
|
+
</script>
|