apply-clients 5.0.35-ezhou-6 → 5.0.35-ezhou-8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,693 +1,693 @@
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
- <modal :show.sync="stop_show" v-ref:modal stop_show="false">
7
- <header slot="modal-header" class="modal-header">
8
- <button type="button" class="close" @click="closeback"><span>&times;</span></button>
9
- <h4 class="modal-title">终止备注</h4>
10
- </header>
11
- <article slot="modal-body" class="modal-body">
12
- <div class="from-group">
13
- <input type="text" class="form-control" v-model="models.f_stop_remarks"/>
14
- </div>
15
- </article>
16
- <footer slot="modal-footer" class="modal-footer">
17
- <button v-show="stop_show" type="button" class="btn btn-default" @click='stopapplys'>确认</button>
18
- </footer>
19
- </modal>
20
- <modal :show.sync="apply_show" v-ref:modal apply_show="false" >
21
- <header slot="modal-header" class="modal-header">
22
- <button type="button" class="close" @click="closeapply"><span>&times;</span></button>
23
- <h4 class="modal-title">转单报建</h4>
24
- </header>
25
- <article slot="modal-body" class="modal-body">
26
- <div class="from-group">
27
- <v-select style="min-width: 80%;"
28
- placeholder='请选择'
29
- :options="applytypes"
30
- :search="false"
31
- v-model="apply_type"
32
- :value.sync="apply_type"
33
- close-on-select>
34
- </v-select>
35
- </div>
36
- </article>
37
- <footer slot="modal-footer" class="modal-footer">
38
- <button v-show="apply_show" type="button" class="btn btn-default" @click='addactive()'>确认</button>
39
- </footer>
40
- </modal>
41
- </template>
42
- <script>
43
- import co from 'co'
44
- import Vue from 'vue'
45
- import {HttpResetClass} from 'vue-client'
46
- import * as Util from "../Util";
47
- export default {
48
- title: '报建流程业务控制层',
49
- props: ['selectdata','selectmodel','show_data'],
50
- data () {
51
- return {
52
- model:'',
53
- delteLocal:false,
54
- loading:false,
55
- data:null, // 数据库数据,json配置文件数据的数据集合
56
- json_datas:null, // Json配置文件集合
57
- showview:false, // 控制显示service-view组件
58
- // 给view层显示的数据
59
- department_search:null, // 当前部门下所有人
60
- stop_show:false, // 终止备注开关
61
- apply_show:false, // 转单报建开关
62
- apply_type:'',
63
- applytypes:[{label:"散户报装",value:"报装申请"},{label:"集体报装",value:"集体报装申请"}],// 报建类型
64
- models: {
65
- f_date: Util.toStandardTimeString(),
66
- f_department: Vue.user.f_parentname,
67
- f_operator: Vue.user.name,
68
- f_filiale: Vue.user.f_fengongsi
69
- },
70
- models2:{}
71
- }
72
- },
73
- methods: {
74
- // 转到报建
75
- async addactive(){
76
- this.selectdata.applyid = this.selectdata.id
77
- // this.$resetpost('rs/logic/stopapply', {data: this.selectdata})
78
- console.log(this.apply_type[0])
79
- this.$workflow_vue.start_activity = this.apply_type[0]
80
- let http = new HttpResetClass()
81
- let res = await http.load('POST',this.$androidUtil.getProxyUrl() +'/rs/logic/ApplyGetProcessID',{data:{filename:this.$workflow_vue.workflow_xmlfilename,start_activity:this.$workflow_vue.start_activity}}, {resolveMsg: null, rejectMsg: '获取流程ID失败,请联系开发人员'})
82
- let data = {
83
- defname: this.$workflow_vue.start_activity,
84
- f_process_id: res.data.f_process_id,
85
- f_apply_date: Util.toStandardTimeString(),
86
- f_product_id: res.data.f_product_id,
87
- start_activity:this.$workflow_vue.start_activity,
88
- f_user_type:this.models2.f_user_type,
89
- f_user_name:this.models2.f_user_name,
90
- f_phone:this.models2.f_phone,
91
- f_area:this.models2.f_area,
92
- f_street:this.models2.f_street,
93
- f_residential_area:this.models2.f_residential_area,
94
- f_building:this.models2.f_building,
95
- f_unit:this.models2.f_unit,
96
- f_floor:this.models2.f_floor,
97
- f_room:this.models2.f_room,
98
- f_address:this.models2.f_address,
99
- f_idnumber:this.models2.f_social_credit_code,
100
- f_apply_source:this.models2.f_apply_source,
101
- f_sub_state:'未完工',
102
- user:Vue.user
103
- }
104
- await http.load('POST',this.$androidUtil.getProxyUrl() +'/rs/logic/newaddApplyproduct',{data:data}, {resolveMsg: null, rejectMsg: '转发失败,请联系开发人员'})
105
- var delteLocal = true
106
- var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
107
- let btn = btn_operate(this, url, http, this.models2, delteLocal)
108
- co(btn)
109
- this.apply_show = false
110
- },
111
- // 终止报建
112
- async stopapplys () {
113
- this.models = Object.assign({}, this.selectdata, this.models)
114
- this.models.id = null
115
- this.models.applyid = this.selectdata.id
116
- this.models.f_operat_type = '终止报建'
117
- this.models.f_state = '有效'
118
- this.models.f_describe = this.selectdata.f_user_name + '已终止报建'
119
- let data ={
120
- tablename:'t_project_stop',
121
- parameters:this.models
122
- }
123
- let http = new HttpResetClass()
124
- await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/save', {data:data},{resolveMsg: null, rejectMsg: "添加失败"})
125
- await http.load('POST',this.$androidUtil.getProxyUrl() +'/rs/logic/stopapply', {data:this.models},{resolveMsg: null, rejectMsg: "终止失败"})
126
- this.closeback()
127
- this.$dispatch('close')
128
- },
129
- // 关闭终止备注弹框
130
- closeback() {
131
- this.stop_show = false
132
- },
133
- // 关闭报建弹框
134
- closeapply() {
135
- this.apply_show = false
136
- },
137
- // 特殊化处理
138
- saveCallBack(jo){
139
- console.log(JSON.stringify(jo))
140
- console.log("hhhhhhhhhhhhhhhhh")
141
- console.log(JSON.stringify(jo))
142
- if(jo.state == 'ok'){
143
- console.log("hhhhhhhhhhhhhhhhh2")
144
- let res = JSON.parse(jo.result)
145
- console.log("hhhhhhhhhhhhhhhhh3")
146
- if(res.code = 200){
147
- this.showview = false
148
- // 如果需要删除本地记录则去删除
149
- console.log("hhhhhhhhhhhhhhhhh4")
150
- if(this.delteLocal){
151
- console.log("hhhhhhhhhhhhhhhhh5")
152
- this.deleteLocalApply(this.model)
153
- }
154
- console.log("hhhhhhhhhhhhhhhhh6")
155
- // 特殊处理
156
- this.special(this.model)
157
- console.log("hhhhhhhhhhhhhhhhh7")
158
- this.loading=false
159
- this.$dispatch('close')
160
- console.log("hhhhhhhhhhhhhhhhh8")
161
- this.initializtion()
162
- console.log("hhhhhhhhhhhhhhhhh9")
163
- this.$showMessage('操作成功')
164
- }else{
165
- this.$showMessage('操作失败,原因:' + res.data.msg)
166
- }
167
- }
168
-
169
- },
170
- async special(model){
171
- console.log('进入async special方法')
172
- if(this.data.distribute_async && model.button.button_name==='下发'){
173
- // 流程异步处理
174
- let http = new HttpResetClass();
175
- // let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
176
- let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser: Vue.user}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
177
- console.log("流程的异步处理:",JSON.stringify(res.data))
178
- }
179
- if(this.data.distribute_async && model.button.button_name==='完成'){
180
- // 强制结束
181
- let http = new HttpResetClass();
182
- let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser: Vue.user}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
183
- // let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
184
- console.log("流程的异步处理:",JSON.stringify(res.data))
185
- }
186
- },
187
- // 组件初始化操作
188
- refurbish(){
189
- if(!this.$workflow_vue){
190
- this.$showMessage('流程配置文件不存在,请反馈系统管理员')
191
- return
192
- }
193
- console.log('内存中的流程配置文件数据=>' + JSON.stringify(this.$workflow_vue))
194
- this.json_datas=this.$workflow_vue
195
- let sum = 0
196
- let jsonData ={}
197
- for(let i=0;i<this.json_datas.activitys.length;i++){
198
- if(this.selectdata.defname==this.json_datas.activitys[i].title){
199
- jsonData = this.json_datas.activitys[i]
200
- sum++
201
- }
202
- }
203
- for (let j = 0; j < jsonData.fields.length; j++) {
204
- jsonData.fields[j].value = ''
205
- if (jsonData.fields[j].default) {
206
- jsonData.fields[j].value = jsonData.fields[j].default
207
- }
208
- }
209
- console.log('sum=>' + sum)
210
- if(sum==1){
211
- this.data =null
212
- this.data = jsonData
213
- console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
214
- this.initializtion()
215
-
216
- } else if(sum==0) {
217
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
218
- } else {
219
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
220
- }
221
- },
222
- // json配置数据处理 比如下拉框的options
223
- async initializtion() {
224
-
225
- console.log('进入initializtion()方法')
226
- console.log('接收到的selectdata有无变化'+JSON.stringify(this.selectdata))
227
- console.log('接收到的selectdata有无actorexpression'+JSON.stringify(this.selectdata.actorexpression))
228
- // 下发人 options 处理,options初始化
229
- if(this.selectdata.actorexpression){
230
- //截取actorexpression
231
- let http = new HttpResetClass()
232
- var url = this.$androidUtil.getProxyUrl() + '/rs/search'
233
- console.log('即将请求后台获取下发人员,url=>' + url)
234
- // R(安装员报装)
235
- console.log("777777776"+JSON.stringify(this.selectdata.actorexpression))
236
- let res
237
- if (this.selectdata.actorexpression.startsWith('R')) {
238
- let actorexpression = this.selectdata.actorexpression
239
- //let actorexpression="R(安装员报装)"
240
- let actor = actorexpression.substring(actorexpression.indexOf('(') + 1, actorexpression.indexOf(')'))
241
- console.log("看看角色" + JSON.stringify(actor))
242
- res= await http.load('POST', url, {
243
- source: `tool.getChildrenOfResName($${actor}$)`,
244
- userid: Vue.user.id
245
- }, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
246
- }else{
247
- res = await http.load('POST', url, this.selectdata.actorexpression, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
248
- }
249
- console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
250
- let jsonString = JSON.stringify(res.data)
251
- let jsonArray = []
252
- if(jsonString.startsWith("{")){
253
- jsonArray.push(res.data)
254
- res.data = jsonArray
255
- }
256
- this.department_search = res.data
257
- }
258
-
259
- // data 填充 selectdata
260
- console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
261
- this.data = Object.assign({},this.data, this.selectdata)
262
- console.log('this.data的值=>' + JSON.stringify(this.data))
263
-
264
- // 初始化 fields
265
- console.log('this.data.fields.length=>' + this.data.fields.length)
266
- for(let i=0;i<this.data.fields.length;i++){
267
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
268
- if(this.selectdata[this.data.fields[i].field]){
269
- this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
270
- }
271
- // 如果配置类型为select,优先从参数列表获取options
272
- if(this.data.fields[i].type == 'select'){
273
- console.log('进入下拉框参数获取方法,参数名称=>' + this.data.fields[i].label)
274
- console.log('$appdata中的缓存参数与单值=>' + JSON.stringify(this.$appdata))
275
- var param = this.$appdata.getParam(this.data.fields[i].label)
276
- console.log(param)
277
- if (param){
278
- this.data.fields[i].options = param
279
- }
280
-
281
- }
282
- // 设置用户类型
283
- if (this.data.fields[i].label == '用户类型') {
284
- this.data.fields[i].options = [{label: '民用', value: '民用'},{label: '非民用', value: '非民用'}]
285
- }
286
- // 获取县区
287
- if (this.data.fields[i].label == '县/区') {
288
- let http = new HttpResetClass()
289
- let area = await http.load('post',`${this.$androidUtil.getProxyUrl()}/rs/sql/applysingleTable`, {
290
- data: {
291
- // items: 'f_bill_url,f_url_code',
292
- tablename: 't_pcd',
293
- condition: `f_filialeids = '${Vue.user.f_orgids}'`
294
- }
295
- }, {resolveMsg: null, rejectMsg: null})
296
- let rs = []
297
- for (let i = 0; i < area.data.length; i++) {
298
- let temp = {
299
- label: area.data[i].f_pcd,
300
- value: area.data[i].f_pcd
301
- }
302
- rs.push(temp)
303
- }
304
- this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
305
- }
306
- }
307
- // 初始化 buttons_fields
308
- for(let i=0;i<this.data.buttons.length;i++){
309
- if(this.data.buttons[i].button_fields){
310
- for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
311
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
312
- if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
313
- this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
314
- }
315
- // 如果配置类型为select,优先从参数列表获取options
316
- if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
317
- console.log("这里是给select赋值的地方"+JSON.stringify(this.data.buttons[i].button_fields[j]))
318
- console.log("参数列表获取到的"+JSON.stringify(this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)))
319
- this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
320
- }
321
- // 下发特殊配置
322
- if(this.data.buttons[i].button_name==='下发'){
323
- if(this.data.buttons[i].button_fields.length===1){
324
- // value初始化
325
- // if(this.department_search){
326
- console.log("看看111department_search"+JSON.stringify(this.department_search))
327
-
328
- if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
329
-
330
- for(let k=0;k<this.department_search.length;k++){
331
- // 将id转换为name
332
- if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
333
- this.data.buttons[i].button_fields[0].value=this.department_search[k].name
334
- }
335
- }
336
- }
337
-
338
- if(this.department_search){
339
- let array = []
340
- console.log("看看department_search"+JSON.stringify(this.department_search))
341
- this.department_search.forEach((paper)=>{
342
- array.push({label:paper.name,value:paper.name})
343
- })
344
- this.data.buttons[i].button_fields[0].options = array
345
- }
346
- }else {
347
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
348
- }
349
- }
350
- }
351
- }
352
- }
353
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
354
- let temp = JSON.parse(JSON.stringify(this.data))
355
- // 退回原因展示
356
- if(this.selectdata.f_back_reason){
357
- temp['back_reason'] = this.selectdata.f_back_reason
358
- }
359
- console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
360
- console.log(JSON.stringify(this.show_data.ppp))
361
- if (JSON.stringify(this.show_data.ppp)=='{}'){
362
- this.show_data.ppp = temp
363
- console.log("重新赋值")
364
-
365
- }else{
366
- console.log("不重新赋值")
367
- }
368
- console.log('initializtion()方法结束,showview')
369
- this.showview = true
370
- },
371
- deleteLocalApply(model){
372
- console.log(`前台上传完成,开始删除本地报建工单`)
373
- this.$androidUtil.bzLogic('deleteApply', {data:model})
374
- }
375
- },
376
- events: {
377
- 'checkboxSelectControl'(index,index2){
378
- if(this.$refs.service_show.data.fields[index].label=="施工提交资料"){
379
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
380
- if(this.$refs.service_show.data.fields[i].label=="施工已上传文件"){
381
- //增加和删除框中的内容
382
- if (this.$refs.service_show.data.fields[i].value==undefined){
383
- this.$refs.service_show.data.fields[i].value=''
384
- }
385
- if(this.$refs.service_show.data.fields[index].items[index2].value == false){
386
- this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
387
- // 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+" ";
388
- this.$refs.service_show.data.fields[index].items[index2].value=true;
389
- }else{
390
- let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
391
- let values =this.$refs.service_show.data.fields[i].value;
392
- let result = values.split(" ").filter((item)=>{
393
- return item!=deleteValue;
394
- }).join(" ")
395
- this.$refs.service_show.data.fields[i].value =result;
396
- this.$refs.service_show.data.fields[index].items[index2].value=false;
397
- }
398
- //}
399
- }
400
- }
401
- }
402
- if(this.$refs.service_show.data.fields[index].label=="验收提交资料"){
403
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
404
-
405
- if(this.$refs.service_show.data.fields[i].label=="验收已上传文件"){
406
- //增加和删除框中的内容
407
- if(this.$refs.service_show.data.fields[index].items[index2].value == false){
408
- this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
409
- // 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+" ";
410
- this.$refs.service_show.data.fields[index].items[index2].value=true;
411
- }else{
412
- let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
413
- let values =this.$refs.service_show.data.fields[i].value;
414
- let result = values.split(" ").filter((item)=>{
415
- return item!=deleteValue;
416
- }).join(" ")
417
- this.$refs.service_show.data.fields[i].value =result;
418
- this.$refs.service_show.data.fields[index].items[index2].value=false;
419
- }
420
- //}
421
- }
422
- }
423
- }
424
- this.$refs.service_show.update()
425
- },
426
- // 任意select选中时触发事件
427
- async 'select_cascade'(index){
428
- // this.$refs.service_show.model_temp // 子业务显示组件
429
- // 级联操作示例:
430
- /*
431
- if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
432
- for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
433
- // 控制设置级联
434
- // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
435
- if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
436
- this.$refs.service_show.model_temp.activitys.fields[i].options=[
437
- {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
438
- ]
439
- }
440
- }
441
- }
442
- */
443
- if (this.$refs.service_show.data.fields[index].label === '县/区') {
444
- let temp = this.$refs.service_show.data.fields[index].value
445
- console.log('==============================县/区:' + temp)
446
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
447
- // 控制设置级联
448
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
449
- if (this.$refs.service_show.data.fields[i].label === '街道名称') {
450
- await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/applysingleTable`, {
451
- data: {
452
- tablename: 't_street',
453
- condition: `f_filialeids = '${Vue.user.f_orgids}' and f_pcd='${temp}'`
454
- }
455
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
456
- let streetrs = []
457
- for (let i = 0; i < res.data.length; i++) {
458
- let temp = {
459
- label: res.data[i].f_street,
460
- value: res.data[i].f_street
461
- }
462
- streetrs.push(temp)
463
- }
464
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
465
- // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
466
- this.$refs.service_show.update()
467
- })
468
- }
469
- }
470
- }
471
- if (this.$refs.service_show.data.fields[index].label === '街道名称') {
472
- let temp = this.$refs.service_show.data.fields[index].value
473
- console.log('=============================街道:' + temp)
474
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
475
- // 控制设置级联
476
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
477
- if (this.$refs.service_show.data.fields[i].label === '小区名称') {
478
- await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/applysingleTable`, {
479
- data: {
480
- tablename: 't_area',
481
- condition: `f_filialeids = '${Vue.user.f_orgids}' and f_street='${temp}'`
482
- }
483
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
484
- let arears = []
485
- for (let i = 0; i < res.data.length; i++) {
486
- let temp = {
487
- label: res.data[i].f_residential_area,
488
- value: res.data[i].f_residential_area
489
- }
490
- arears.push(temp)
491
- }
492
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...arears]
493
- // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
494
- this.$refs.service_show.update()
495
- })
496
- }
497
- }
498
- }
499
- // 合成地址
500
- if (
501
- this.$refs.service_show.data.fields[index].label === '县/区' ||
502
- this.$refs.service_show.data.fields[index].label === '街道名称' ||
503
- this.$refs.service_show.data.fields[index].label === '小区名称' ||
504
- this.$refs.service_show.data.fields[index].label === '楼号' ||
505
- this.$refs.service_show.data.fields[index].label === '单元号' ||
506
- this.$refs.service_show.data.fields[index].label === '楼层' ||
507
- this.$refs.service_show.data.fields[index].label === '门牌号'
508
- ) {
509
- console.log('即将合成地址')
510
- var address = ''
511
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
512
- // 控制设置级联
513
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
514
- // xxx xx xxx
515
- if (this.$refs.service_show.data.fields[i].label === '县/区' && this.$refs.service_show.data.fields[i].value) {
516
- address += this.$refs.service_show.data.fields[i].value
517
- }
518
- if (this.$refs.service_show.data.fields[i].label === '街道名称' && this.$refs.service_show.data.fields[i].value) {
519
- address += this.$refs.service_show.data.fields[i].value
520
- }
521
- if (this.$refs.service_show.data.fields[i].label === '小区名称' && this.$refs.service_show.data.fields[i].value) {
522
- address += this.$refs.service_show.data.fields[i].value
523
- }
524
- if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
525
- address += this.$refs.service_show.data.fields[i].value
526
- }
527
- if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
528
- address += '栋'
529
- }
530
- if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
531
- address += '-' +this.$refs.service_show.data.fields[i].value
532
- }
533
- if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
534
- address += '单元'
535
- }
536
- if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
537
- address += '-' +this.$refs.service_show.data.fields[i].value
538
- }
539
- if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
540
- address += '层'
541
- }
542
- if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
543
- address += '-' +this.$refs.service_show.data.fields[i].value
544
- }
545
- if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
546
- address += '室'
547
- }
548
-
549
- }
550
- console.log('获取到的address=>' + address)
551
- // 数据获取完毕时放入地址text
552
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
553
- if (this.$refs.service_show.data.fields[i].label === '地址' || this.$refs.service_show.data.fields[i].label === '报装地址') {
554
- this.$refs.service_show.data.fields[i].value = address
555
- console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
556
- }
557
- }
558
- this.$refs.service_show.update()
559
- }
560
- if (this.$refs.service_show.data.fields[index].label == '用户类型'){
561
- if(this.$refs.service_show.data.fields[index].value == '非民用'){
562
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
563
- if (this.$refs.service_show.data.fields[i].label === '小区名称') {
564
- this.$refs.service_show.data.fields[i].required=false;
565
- }
566
- }
567
- }else{
568
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
569
- if (this.$refs.service_show.data.fields[i].label === '小区名称') {
570
- this.$refs.service_show.data.fields[i].required=true;
571
- }
572
- }
573
- }
574
- }
575
- },
576
- // 获取view层button事件
577
- async 'button'(model){
578
- if (this.data.defname==='踏勘'){
579
- if (model.button.button_name === '终止'){
580
- this.stop_show=true
581
- return
582
- }
583
- }
584
- this.loading=true
585
- console.log('进入async button事件方法')
586
- var delteLocal = true
587
- // 点击保存与重置按钮不需要修改本地工单状态
588
- if(model.button.button_name == '保存' || model.button.button_name==='重置'){
589
- delteLocal = false
590
- }
591
- // 点击重置按钮就重置数据
592
- if(model.button.button_name==='重置'){
593
- this.initializtion()
594
- return
595
- }
596
- if(model.button.button_name==='下发'){
597
- let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
598
- for(let i=0;i<this.department_search.length;i++){
599
- // 找到人名为person_name 的人,然后把人名换成id
600
- if(this.department_search[i].name === person_name){
601
- model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
602
- }
603
- }
604
- }
605
- console.log("button事件接收参数model=>" + JSON.stringify(model))
606
- model=Object.assign({},this.selectdata,model)
607
- console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
608
- if (this.data.defname==='踏勘'&&(model.button.button_name === '提交'||model.button.button_name === '通气')){
609
- this.loading=false
610
- this.apply_show=true
611
- this.models2 = model
612
- return
613
- }
614
- let http = new HttpResetClass()
615
- if (this.data.defname === '通气转单'&& model.button.button_name === '提交'){
616
- model.f_sub_state = '完工'
617
- }else {
618
- model.f_sub_state = '未完工'
619
- }
620
- var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
621
- // let res = await http.load('POST',url,{data:data}, {resolveMsg: null, rejectMsg: null})
622
- // // 先判断是否包含code,如果服务端异常,可能不存在code
623
- // console.log("service处理完成返回数据=>" + res)
624
- // if(!res.code){
625
- // console.log("service处理完成返回数据=>" + res)
626
- // this.$showMessage('操作异常,原因:' + res)
627
- // }else{
628
- // console.log("service处理完成返回数据=>" + JSON.stringify(res))
629
- // if(res.code = 200){
630
- // this.showview = false
631
- // // 特殊处理
632
- // this.special(model)
633
- // this.$dispatch('close')
634
- // this.initializtion()
635
- // this.$showMessage('操作成功')
636
- // }else{
637
- // this.$showMessage('操作失败,原因:' + res.data.msg)
638
- // }
639
- // }
640
- let btn = btn_operate(this, url, http, model, delteLocal)
641
- co(btn)
642
- }
643
- },
644
- watch:{
645
- // 监听selectdata的变化
646
- 'selectdata'() {
647
- console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
648
- this.refurbish()
649
- },
650
- deep:true
651
- }
652
- }
653
-
654
- let btn_operate = function * (self, url, http, model, delteLocal) {
655
- self.delteLocal=delteLocal
656
- console.log("model的信息",model)
657
- // 下发,提交,保存,退回都在后台处理
658
- console.log('即将请求后台url=>' + url)
659
- model.employeetemplate=''
660
- self.model=model
661
- console.log(JSON.stringify(self.model))
662
- let param={
663
- employeetemplate:'',
664
- tables:self.data.tables,
665
- workflow_xmlfilename : self.$workflow_vue.workflow_xmlfilename,
666
- start_activity:model.start_activity,
667
- model:model,
668
- loginUser:Vue.user
669
- }
670
- if(param.model.defname === '现场勘查定价'){
671
- param.model.f_unaccounts_money = param.model.f_total_cost
672
- }
673
- // 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})
674
- let paramStr = JSON.stringify(param)
675
- // 多长截断一次
676
- let subLength = 800
677
- for (let i = 0; i < paramStr.length; i += subLength) {
678
- HostApp.param_cache(paramStr.substr(i, subLength))
679
- }
680
- HostApp.__this__ = self
681
- HostApp.syncLogic({
682
- // logic别名,key必须为logic
683
- 'logic': 'updatePic',
684
- // 回调执行方法名,key必须为callback
685
- 'callback': 'javascript:HostApp.__this__.saveCallBack()',
686
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
687
- // 执行回调方法传入key为backresult
688
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
689
- 'backresult': 1
690
- })
691
-
692
- }
693
- </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
+ <modal :show.sync="stop_show" v-ref:modal stop_show="false">
7
+ <header slot="modal-header" class="modal-header">
8
+ <button type="button" class="close" @click="closeback"><span>&times;</span></button>
9
+ <h4 class="modal-title">终止备注</h4>
10
+ </header>
11
+ <article slot="modal-body" class="modal-body">
12
+ <div class="from-group">
13
+ <input type="text" class="form-control" v-model="models.f_stop_remarks"/>
14
+ </div>
15
+ </article>
16
+ <footer slot="modal-footer" class="modal-footer">
17
+ <button v-show="stop_show" type="button" class="btn btn-default" @click='stopapplys'>确认</button>
18
+ </footer>
19
+ </modal>
20
+ <modal :show.sync="apply_show" v-ref:modal apply_show="false" >
21
+ <header slot="modal-header" class="modal-header">
22
+ <button type="button" class="close" @click="closeapply"><span>&times;</span></button>
23
+ <h4 class="modal-title">转单报建</h4>
24
+ </header>
25
+ <article slot="modal-body" class="modal-body">
26
+ <div class="from-group">
27
+ <v-select style="min-width: 80%;"
28
+ placeholder='请选择'
29
+ :options="applytypes"
30
+ :search="false"
31
+ v-model="apply_type"
32
+ :value.sync="apply_type"
33
+ close-on-select>
34
+ </v-select>
35
+ </div>
36
+ </article>
37
+ <footer slot="modal-footer" class="modal-footer">
38
+ <button v-show="apply_show" type="button" class="btn btn-default" @click='addactive()'>确认</button>
39
+ </footer>
40
+ </modal>
41
+ </template>
42
+ <script>
43
+ import co from 'co'
44
+ import Vue from 'vue'
45
+ import {HttpResetClass} from 'vue-client'
46
+ import * as Util from "../Util";
47
+ export default {
48
+ title: '报建流程业务控制层',
49
+ props: ['selectdata','selectmodel','show_data'],
50
+ data () {
51
+ return {
52
+ model:'',
53
+ delteLocal:false,
54
+ loading:false,
55
+ data:null, // 数据库数据,json配置文件数据的数据集合
56
+ json_datas:null, // Json配置文件集合
57
+ showview:false, // 控制显示service-view组件
58
+ // 给view层显示的数据
59
+ department_search:null, // 当前部门下所有人
60
+ stop_show:false, // 终止备注开关
61
+ apply_show:false, // 转单报建开关
62
+ apply_type:'',
63
+ applytypes:[{label:"散户报装",value:"报装申请"},{label:"集体报装",value:"集体报装申请"}],// 报建类型
64
+ models: {
65
+ f_date: Util.toStandardTimeString(),
66
+ f_department: Vue.user.f_parentname,
67
+ f_operator: Vue.user.name,
68
+ f_filiale: Vue.user.f_fengongsi
69
+ },
70
+ models2:{}
71
+ }
72
+ },
73
+ methods: {
74
+ // 转到报建
75
+ async addactive(){
76
+ this.selectdata.applyid = this.selectdata.id
77
+ // this.$resetpost('rs/logic/stopapply', {data: this.selectdata})
78
+ console.log(this.apply_type[0])
79
+ this.$workflow_vue.start_activity = this.apply_type[0]
80
+ let http = new HttpResetClass()
81
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() +'/rs/logic/ApplyGetProcessID',{data:{filename:this.$workflow_vue.workflow_xmlfilename,start_activity:this.$workflow_vue.start_activity}}, {resolveMsg: null, rejectMsg: '获取流程ID失败,请联系开发人员'})
82
+ let data = {
83
+ defname: this.$workflow_vue.start_activity,
84
+ f_process_id: res.data.f_process_id,
85
+ f_apply_date: Util.toStandardTimeString(),
86
+ f_product_id: res.data.f_product_id,
87
+ start_activity:this.$workflow_vue.start_activity,
88
+ f_user_type:this.models2.f_user_type,
89
+ f_user_name:this.models2.f_user_name,
90
+ f_phone:this.models2.f_phone,
91
+ f_area:this.models2.f_area,
92
+ f_street:this.models2.f_street,
93
+ f_residential_area:this.models2.f_residential_area,
94
+ f_building:this.models2.f_building,
95
+ f_unit:this.models2.f_unit,
96
+ f_floor:this.models2.f_floor,
97
+ f_room:this.models2.f_room,
98
+ f_address:this.models2.f_address,
99
+ f_idnumber:this.models2.f_social_credit_code,
100
+ f_apply_source:this.models2.f_apply_source,
101
+ f_sub_state:'未完工',
102
+ user:Vue.user
103
+ }
104
+ await http.load('POST',this.$androidUtil.getProxyUrl() +'/rs/logic/newaddApplyproduct',{data:data}, {resolveMsg: null, rejectMsg: '转发失败,请联系开发人员'})
105
+ var delteLocal = true
106
+ var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
107
+ let btn = btn_operate(this, url, http, this.models2, delteLocal)
108
+ co(btn)
109
+ this.apply_show = false
110
+ },
111
+ // 终止报建
112
+ async stopapplys () {
113
+ this.models = Object.assign({}, this.selectdata, this.models)
114
+ this.models.id = null
115
+ this.models.applyid = this.selectdata.id
116
+ this.models.f_operat_type = '终止报建'
117
+ this.models.f_state = '有效'
118
+ this.models.f_describe = this.selectdata.f_user_name + '已终止报建'
119
+ let data ={
120
+ tablename:'t_project_stop',
121
+ parameters:this.models
122
+ }
123
+ let http = new HttpResetClass()
124
+ await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/save', {data:data},{resolveMsg: null, rejectMsg: "添加失败"})
125
+ await http.load('POST',this.$androidUtil.getProxyUrl() +'/rs/logic/stopapply', {data:this.models},{resolveMsg: null, rejectMsg: "终止失败"})
126
+ this.closeback()
127
+ this.$dispatch('close')
128
+ },
129
+ // 关闭终止备注弹框
130
+ closeback() {
131
+ this.stop_show = false
132
+ },
133
+ // 关闭报建弹框
134
+ closeapply() {
135
+ this.apply_show = false
136
+ },
137
+ // 特殊化处理
138
+ saveCallBack(jo){
139
+ console.log(JSON.stringify(jo))
140
+ console.log("hhhhhhhhhhhhhhhhh")
141
+ console.log(JSON.stringify(jo))
142
+ if(jo.state == 'ok'){
143
+ console.log("hhhhhhhhhhhhhhhhh2")
144
+ let res = JSON.parse(jo.result)
145
+ console.log("hhhhhhhhhhhhhhhhh3")
146
+ if(res.code = 200){
147
+ this.showview = false
148
+ // 如果需要删除本地记录则去删除
149
+ console.log("hhhhhhhhhhhhhhhhh4")
150
+ if(this.delteLocal){
151
+ console.log("hhhhhhhhhhhhhhhhh5")
152
+ this.deleteLocalApply(this.model)
153
+ }
154
+ console.log("hhhhhhhhhhhhhhhhh6")
155
+ // 特殊处理
156
+ this.special(this.model)
157
+ console.log("hhhhhhhhhhhhhhhhh7")
158
+ this.loading=false
159
+ this.$dispatch('close')
160
+ console.log("hhhhhhhhhhhhhhhhh8")
161
+ this.initializtion()
162
+ console.log("hhhhhhhhhhhhhhhhh9")
163
+ this.$showMessage('操作成功')
164
+ }else{
165
+ this.$showMessage('操作失败,原因:' + res.data.msg)
166
+ }
167
+ }
168
+
169
+ },
170
+ async special(model){
171
+ console.log('进入async special方法')
172
+ if(this.data.distribute_async && model.button.button_name==='下发'){
173
+ // 流程异步处理
174
+ let http = new HttpResetClass();
175
+ // let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
176
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/syncprocess',{data:{model:model,loginUser: Vue.user}}, {resolveMsg: null, rejectMsg: '流程异步下发据保存失败'})
177
+ console.log("流程的异步处理:",JSON.stringify(res.data))
178
+ }
179
+ if(this.data.distribute_async && model.button.button_name==='完成'){
180
+ // 强制结束
181
+ let http = new HttpResetClass();
182
+ let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser: Vue.user}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
183
+ // let res = await http.load('POST',this.$androidUtil.getProxyUrl() + '/rs/logic/stoprocess',{data:{model:model,loginUser:this.$login.f}}, {resolveMsg: null, rejectMsg: '流程异步完成数据保存失败'})
184
+ console.log("流程的异步处理:",JSON.stringify(res.data))
185
+ }
186
+ },
187
+ // 组件初始化操作
188
+ refurbish(){
189
+ if(!this.$workflow_vue){
190
+ this.$showMessage('流程配置文件不存在,请反馈系统管理员')
191
+ return
192
+ }
193
+ console.log('内存中的流程配置文件数据=>' + JSON.stringify(this.$workflow_vue))
194
+ this.json_datas=this.$workflow_vue
195
+ let sum = 0
196
+ let jsonData ={}
197
+ for(let i=0;i<this.json_datas.activitys.length;i++){
198
+ if(this.selectdata.defname==this.json_datas.activitys[i].title){
199
+ jsonData = this.json_datas.activitys[i]
200
+ sum++
201
+ }
202
+ }
203
+ for (let j = 0; j < jsonData.fields.length; j++) {
204
+ jsonData.fields[j].value = ''
205
+ if (jsonData.fields[j].default) {
206
+ jsonData.fields[j].value = jsonData.fields[j].default
207
+ }
208
+ }
209
+ console.log('sum=>' + sum)
210
+ if(sum==1){
211
+ this.data =null
212
+ this.data = jsonData
213
+ console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
214
+ this.initializtion()
215
+
216
+ } else if(sum==0) {
217
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
218
+ } else {
219
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
220
+ }
221
+ },
222
+ // json配置数据处理 比如下拉框的options
223
+ async initializtion() {
224
+
225
+ console.log('进入initializtion()方法')
226
+ console.log('接收到的selectdata有无变化'+JSON.stringify(this.selectdata))
227
+ console.log('接收到的selectdata有无actorexpression'+JSON.stringify(this.selectdata.actorexpression))
228
+ // 下发人 options 处理,options初始化
229
+ if(this.selectdata.actorexpression){
230
+ //截取actorexpression
231
+ let http = new HttpResetClass()
232
+ var url = this.$androidUtil.getProxyUrl() + '/rs/search'
233
+ console.log('即将请求后台获取下发人员,url=>' + url)
234
+ // R(安装员报装)
235
+ console.log("777777776"+JSON.stringify(this.selectdata.actorexpression))
236
+ let res
237
+ if (this.selectdata.actorexpression.startsWith('R')) {
238
+ let actorexpression = this.selectdata.actorexpression
239
+ //let actorexpression="R(安装员报装)"
240
+ let actor = actorexpression.substring(actorexpression.indexOf('(') + 1, actorexpression.indexOf(')'))
241
+ console.log("看看角色" + JSON.stringify(actor))
242
+ res= await http.load('POST', url, {
243
+ source: `tool.getChildrenOfResName($${actor}$)`,
244
+ userid: Vue.user.id
245
+ }, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
246
+ }else{
247
+ res = await http.load('POST', url, this.selectdata.actorexpression, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
248
+ }
249
+ console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
250
+ let jsonString = JSON.stringify(res.data)
251
+ let jsonArray = []
252
+ if(jsonString.startsWith("{")){
253
+ jsonArray.push(res.data)
254
+ res.data = jsonArray
255
+ }
256
+ this.department_search = res.data
257
+ }
258
+
259
+ // data 填充 selectdata
260
+ console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
261
+ this.data = Object.assign({},this.data, this.selectdata)
262
+ console.log('this.data的值=>' + JSON.stringify(this.data))
263
+
264
+ // 初始化 fields
265
+ console.log('this.data.fields.length=>' + this.data.fields.length)
266
+ for(let i=0;i<this.data.fields.length;i++){
267
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
268
+ if(this.selectdata[this.data.fields[i].field]){
269
+ this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
270
+ }
271
+ // 如果配置类型为select,优先从参数列表获取options
272
+ if(this.data.fields[i].type == 'select'){
273
+ console.log('进入下拉框参数获取方法,参数名称=>' + this.data.fields[i].label)
274
+ console.log('$appdata中的缓存参数与单值=>' + JSON.stringify(this.$appdata))
275
+ var param = this.$appdata.getParam(this.data.fields[i].label)
276
+ console.log(param)
277
+ if (param){
278
+ this.data.fields[i].options = param
279
+ }
280
+
281
+ }
282
+ // 设置用户类型
283
+ if (this.data.fields[i].label == '用户类型') {
284
+ this.data.fields[i].options = [{label: '民用', value: '民用'},{label: '非民用', value: '非民用'}]
285
+ }
286
+ // 获取县区
287
+ if (this.data.fields[i].label == '县/区') {
288
+ let http = new HttpResetClass()
289
+ let area = await http.load('post',`${this.$androidUtil.getProxyUrl()}/rs/sql/applysingleTable`, {
290
+ data: {
291
+ // items: 'f_bill_url,f_url_code',
292
+ tablename: 't_pcd',
293
+ condition: `f_filialeids = '${Vue.user.f_orgids}'`
294
+ }
295
+ }, {resolveMsg: null, rejectMsg: null})
296
+ let rs = []
297
+ for (let i = 0; i < area.data.length; i++) {
298
+ let temp = {
299
+ label: area.data[i].f_pcd,
300
+ value: area.data[i].f_pcd
301
+ }
302
+ rs.push(temp)
303
+ }
304
+ this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
305
+ }
306
+ }
307
+ // 初始化 buttons_fields
308
+ for(let i=0;i<this.data.buttons.length;i++){
309
+ if(this.data.buttons[i].button_fields){
310
+ for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
311
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
312
+ if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
313
+ this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
314
+ }
315
+ // 如果配置类型为select,优先从参数列表获取options
316
+ if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
317
+ console.log("这里是给select赋值的地方"+JSON.stringify(this.data.buttons[i].button_fields[j]))
318
+ console.log("参数列表获取到的"+JSON.stringify(this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)))
319
+ this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
320
+ }
321
+ // 下发特殊配置
322
+ if(this.data.buttons[i].button_name==='下发'){
323
+ if(this.data.buttons[i].button_fields.length===1){
324
+ // value初始化
325
+ // if(this.department_search){
326
+ console.log("看看111department_search"+JSON.stringify(this.department_search))
327
+
328
+ if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
329
+
330
+ for(let k=0;k<this.department_search.length;k++){
331
+ // 将id转换为name
332
+ if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
333
+ this.data.buttons[i].button_fields[0].value=this.department_search[k].name
334
+ }
335
+ }
336
+ }
337
+
338
+ if(this.department_search){
339
+ let array = []
340
+ console.log("看看department_search"+JSON.stringify(this.department_search))
341
+ this.department_search.forEach((paper)=>{
342
+ array.push({label:paper.name,value:paper.name})
343
+ })
344
+ this.data.buttons[i].button_fields[0].options = array
345
+ }
346
+ }else {
347
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
348
+ }
349
+ }
350
+ }
351
+ }
352
+ }
353
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
354
+ let temp = JSON.parse(JSON.stringify(this.data))
355
+ // 退回原因展示
356
+ if(this.selectdata.f_back_reason){
357
+ temp['back_reason'] = this.selectdata.f_back_reason
358
+ }
359
+ console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
360
+ console.log(JSON.stringify(this.show_data.ppp))
361
+ if (JSON.stringify(this.show_data.ppp)=='{}'){
362
+ this.show_data.ppp = temp
363
+ console.log("重新赋值")
364
+
365
+ }else{
366
+ console.log("不重新赋值")
367
+ }
368
+ console.log('initializtion()方法结束,showview')
369
+ this.showview = true
370
+ },
371
+ deleteLocalApply(model){
372
+ console.log(`前台上传完成,开始删除本地报建工单`)
373
+ this.$androidUtil.bzLogic('deleteApply', {data:model})
374
+ }
375
+ },
376
+ events: {
377
+ 'checkboxSelectControl'(index,index2){
378
+ if(this.$refs.service_show.data.fields[index].label=="施工提交资料"){
379
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
380
+ if(this.$refs.service_show.data.fields[i].label=="施工已上传文件"){
381
+ //增加和删除框中的内容
382
+ if (this.$refs.service_show.data.fields[i].value==undefined){
383
+ this.$refs.service_show.data.fields[i].value=''
384
+ }
385
+ if(this.$refs.service_show.data.fields[index].items[index2].value == false){
386
+ this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
387
+ // 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+" ";
388
+ this.$refs.service_show.data.fields[index].items[index2].value=true;
389
+ }else{
390
+ let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
391
+ let values =this.$refs.service_show.data.fields[i].value;
392
+ let result = values.split(" ").filter((item)=>{
393
+ return item!=deleteValue;
394
+ }).join(" ")
395
+ this.$refs.service_show.data.fields[i].value =result;
396
+ this.$refs.service_show.data.fields[index].items[index2].value=false;
397
+ }
398
+ //}
399
+ }
400
+ }
401
+ }
402
+ if(this.$refs.service_show.data.fields[index].label=="验收提交资料"){
403
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
404
+
405
+ if(this.$refs.service_show.data.fields[i].label=="验收已上传文件"){
406
+ //增加和删除框中的内容
407
+ if(this.$refs.service_show.data.fields[index].items[index2].value == false){
408
+ this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
409
+ // 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+" ";
410
+ this.$refs.service_show.data.fields[index].items[index2].value=true;
411
+ }else{
412
+ let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
413
+ let values =this.$refs.service_show.data.fields[i].value;
414
+ let result = values.split(" ").filter((item)=>{
415
+ return item!=deleteValue;
416
+ }).join(" ")
417
+ this.$refs.service_show.data.fields[i].value =result;
418
+ this.$refs.service_show.data.fields[index].items[index2].value=false;
419
+ }
420
+ //}
421
+ }
422
+ }
423
+ }
424
+ this.$refs.service_show.update()
425
+ },
426
+ // 任意select选中时触发事件
427
+ async 'select_cascade'(index){
428
+ // this.$refs.service_show.model_temp // 子业务显示组件
429
+ // 级联操作示例:
430
+ /*
431
+ if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
432
+ for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
433
+ // 控制设置级联
434
+ // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
435
+ if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
436
+ this.$refs.service_show.model_temp.activitys.fields[i].options=[
437
+ {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
438
+ ]
439
+ }
440
+ }
441
+ }
442
+ */
443
+ if (this.$refs.service_show.data.fields[index].label === '县/区') {
444
+ let temp = this.$refs.service_show.data.fields[index].value
445
+ console.log('==============================县/区:' + temp)
446
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
447
+ // 控制设置级联
448
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
449
+ if (this.$refs.service_show.data.fields[i].label === '街道名称') {
450
+ await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/applysingleTable`, {
451
+ data: {
452
+ tablename: 't_street',
453
+ condition: `f_filialeids = '${Vue.user.f_orgids}' and f_pcd='${temp}'`
454
+ }
455
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
456
+ let streetrs = []
457
+ for (let i = 0; i < res.data.length; i++) {
458
+ let temp = {
459
+ label: res.data[i].f_street,
460
+ value: res.data[i].f_street
461
+ }
462
+ streetrs.push(temp)
463
+ }
464
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
465
+ // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
466
+ this.$refs.service_show.update()
467
+ })
468
+ }
469
+ }
470
+ }
471
+ if (this.$refs.service_show.data.fields[index].label === '街道名称') {
472
+ let temp = this.$refs.service_show.data.fields[index].value
473
+ console.log('=============================街道:' + temp)
474
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
475
+ // 控制设置级联
476
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
477
+ if (this.$refs.service_show.data.fields[i].label === '小区名称') {
478
+ await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/applysingleTable`, {
479
+ data: {
480
+ tablename: 't_area',
481
+ condition: `f_filialeids = '${Vue.user.f_orgids}' and f_street='${temp}'`
482
+ }
483
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
484
+ let arears = []
485
+ for (let i = 0; i < res.data.length; i++) {
486
+ let temp = {
487
+ label: res.data[i].f_residential_area,
488
+ value: res.data[i].f_residential_area
489
+ }
490
+ arears.push(temp)
491
+ }
492
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...arears]
493
+ // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
494
+ this.$refs.service_show.update()
495
+ })
496
+ }
497
+ }
498
+ }
499
+ // 合成地址
500
+ if (
501
+ this.$refs.service_show.data.fields[index].label === '县/区' ||
502
+ this.$refs.service_show.data.fields[index].label === '街道名称' ||
503
+ this.$refs.service_show.data.fields[index].label === '小区名称' ||
504
+ this.$refs.service_show.data.fields[index].label === '楼号' ||
505
+ this.$refs.service_show.data.fields[index].label === '单元号' ||
506
+ this.$refs.service_show.data.fields[index].label === '楼层' ||
507
+ this.$refs.service_show.data.fields[index].label === '门牌号'
508
+ ) {
509
+ console.log('即将合成地址')
510
+ var address = ''
511
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
512
+ // 控制设置级联
513
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
514
+ // xxx xx xxx
515
+ if (this.$refs.service_show.data.fields[i].label === '县/区' && this.$refs.service_show.data.fields[i].value) {
516
+ address += this.$refs.service_show.data.fields[i].value
517
+ }
518
+ if (this.$refs.service_show.data.fields[i].label === '街道名称' && this.$refs.service_show.data.fields[i].value) {
519
+ address += this.$refs.service_show.data.fields[i].value
520
+ }
521
+ if (this.$refs.service_show.data.fields[i].label === '小区名称' && this.$refs.service_show.data.fields[i].value) {
522
+ address += this.$refs.service_show.data.fields[i].value
523
+ }
524
+ if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
525
+ address += this.$refs.service_show.data.fields[i].value
526
+ }
527
+ if (this.$refs.service_show.data.fields[i].label === '楼号' && this.$refs.service_show.data.fields[i].value) {
528
+ address += '栋'
529
+ }
530
+ if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
531
+ address += '-' +this.$refs.service_show.data.fields[i].value
532
+ }
533
+ if (this.$refs.service_show.data.fields[i].label === '单元号' && this.$refs.service_show.data.fields[i].value) {
534
+ address += '单元'
535
+ }
536
+ if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
537
+ address += '-' +this.$refs.service_show.data.fields[i].value
538
+ }
539
+ if (this.$refs.service_show.data.fields[i].label === '楼层' && this.$refs.service_show.data.fields[i].value) {
540
+ address += '层'
541
+ }
542
+ if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
543
+ address += '-' +this.$refs.service_show.data.fields[i].value
544
+ }
545
+ if (this.$refs.service_show.data.fields[i].label === '门牌号' && this.$refs.service_show.data.fields[i].value) {
546
+ address += '室'
547
+ }
548
+
549
+ }
550
+ console.log('获取到的address=>' + address)
551
+ // 数据获取完毕时放入地址text
552
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
553
+ if (this.$refs.service_show.data.fields[i].label === '地址' || this.$refs.service_show.data.fields[i].label === '报装地址') {
554
+ this.$refs.service_show.data.fields[i].value = address
555
+ console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
556
+ }
557
+ }
558
+ this.$refs.service_show.update()
559
+ }
560
+ if (this.$refs.service_show.data.fields[index].label == '用户类型'){
561
+ if(this.$refs.service_show.data.fields[index].value == '非民用'){
562
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
563
+ if (this.$refs.service_show.data.fields[i].label === '小区名称') {
564
+ this.$refs.service_show.data.fields[i].required=false;
565
+ }
566
+ }
567
+ }else{
568
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
569
+ if (this.$refs.service_show.data.fields[i].label === '小区名称') {
570
+ this.$refs.service_show.data.fields[i].required=true;
571
+ }
572
+ }
573
+ }
574
+ }
575
+ },
576
+ // 获取view层button事件
577
+ async 'button'(model){
578
+ if (this.data.defname==='踏勘'){
579
+ if (model.button.button_name === '终止'){
580
+ this.stop_show=true
581
+ return
582
+ }
583
+ }
584
+ this.loading=true
585
+ console.log('进入async button事件方法')
586
+ var delteLocal = true
587
+ // 点击保存与重置按钮不需要修改本地工单状态
588
+ if(model.button.button_name == '保存' || model.button.button_name==='重置'){
589
+ delteLocal = false
590
+ }
591
+ // 点击重置按钮就重置数据
592
+ if(model.button.button_name==='重置'){
593
+ this.initializtion()
594
+ return
595
+ }
596
+ if(model.button.button_name==='下发'){
597
+ let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
598
+ for(let i=0;i<this.department_search.length;i++){
599
+ // 找到人名为person_name 的人,然后把人名换成id
600
+ if(this.department_search[i].name === person_name){
601
+ model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
602
+ }
603
+ }
604
+ }
605
+ console.log("button事件接收参数model=>" + JSON.stringify(model))
606
+ model=Object.assign({},this.selectdata,model)
607
+ console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
608
+ if (this.data.defname==='踏勘'&&(model.button.button_name === '提交'||model.button.button_name === '通气')){
609
+ this.loading=false
610
+ this.apply_show=true
611
+ this.models2 = model
612
+ return
613
+ }
614
+ let http = new HttpResetClass()
615
+ if (this.data.defname === '通气转单'&& model.button.button_name === '提交'){
616
+ model.f_sub_state = '完工'
617
+ }else {
618
+ model.f_sub_state = '未完工'
619
+ }
620
+ var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
621
+ // let res = await http.load('POST',url,{data:data}, {resolveMsg: null, rejectMsg: null})
622
+ // // 先判断是否包含code,如果服务端异常,可能不存在code
623
+ // console.log("service处理完成返回数据=>" + res)
624
+ // if(!res.code){
625
+ // console.log("service处理完成返回数据=>" + res)
626
+ // this.$showMessage('操作异常,原因:' + res)
627
+ // }else{
628
+ // console.log("service处理完成返回数据=>" + JSON.stringify(res))
629
+ // if(res.code = 200){
630
+ // this.showview = false
631
+ // // 特殊处理
632
+ // this.special(model)
633
+ // this.$dispatch('close')
634
+ // this.initializtion()
635
+ // this.$showMessage('操作成功')
636
+ // }else{
637
+ // this.$showMessage('操作失败,原因:' + res.data.msg)
638
+ // }
639
+ // }
640
+ let btn = btn_operate(this, url, http, model, delteLocal)
641
+ co(btn)
642
+ }
643
+ },
644
+ watch:{
645
+ // 监听selectdata的变化
646
+ 'selectdata'() {
647
+ console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
648
+ this.refurbish()
649
+ },
650
+ deep:true
651
+ }
652
+ }
653
+
654
+ let btn_operate = function * (self, url, http, model, delteLocal) {
655
+ self.delteLocal=delteLocal
656
+ console.log("model的信息",model)
657
+ // 下发,提交,保存,退回都在后台处理
658
+ console.log('即将请求后台url=>' + url)
659
+ model.employeetemplate=''
660
+ self.model=model
661
+ console.log(JSON.stringify(self.model))
662
+ let param={
663
+ employeetemplate:'',
664
+ tables:self.data.tables,
665
+ workflow_xmlfilename : self.$workflow_vue.workflow_xmlfilename,
666
+ start_activity:model.start_activity,
667
+ model:model,
668
+ loginUser:Vue.user
669
+ }
670
+ if(param.model.defname === '现场勘查定价'){
671
+ param.model.f_unaccounts_money = param.model.f_total_cost
672
+ }
673
+ // 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})
674
+ let paramStr = JSON.stringify(param)
675
+ // 多长截断一次
676
+ let subLength = 800
677
+ for (let i = 0; i < paramStr.length; i += subLength) {
678
+ HostApp.param_cache(paramStr.substr(i, subLength))
679
+ }
680
+ HostApp.__this__ = self
681
+ HostApp.syncLogic({
682
+ // logic别名,key必须为logic
683
+ 'logic': 'updatePic',
684
+ // 回调执行方法名,key必须为callback
685
+ 'callback': 'javascript:HostApp.__this__.saveCallBack()',
686
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
687
+ // 执行回调方法传入key为backresult
688
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
689
+ 'backresult': 1
690
+ })
691
+
692
+ }
693
+ </script>