apply-clients 5.0.37-2 → 5.0.37-4

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,687 +1,687 @@
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
- console.log('sum=>' + sum)
204
- if(sum==1){
205
- this.data =null
206
- this.data = jsonData
207
- console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
208
- this.initializtion()
209
-
210
- } else if(sum==0) {
211
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
212
- } else {
213
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
214
- }
215
- },
216
- // json配置数据处理 比如下拉框的options
217
- async initializtion() {
218
-
219
- console.log('进入initializtion()方法')
220
- console.log('接收到的selectdata有无变化'+JSON.stringify(this.selectdata))
221
- console.log('接收到的selectdata有无actorexpression'+JSON.stringify(this.selectdata.actorexpression))
222
- // 下发人 options 处理,options初始化
223
- if(this.selectdata.actorexpression){
224
- //截取actorexpression
225
- let http = new HttpResetClass()
226
- var url = this.$androidUtil.getProxyUrl() + '/rs/search'
227
- console.log('即将请求后台获取下发人员,url=>' + url)
228
- // R(安装员报装)
229
- console.log("777777776"+JSON.stringify(this.selectdata.actorexpression))
230
- let res
231
- if (this.selectdata.actorexpression.startsWith('R')) {
232
- let actorexpression = this.selectdata.actorexpression
233
- //let actorexpression="R(安装员报装)"
234
- let actor = actorexpression.substring(actorexpression.indexOf('(') + 1, actorexpression.indexOf(')'))
235
- console.log("看看角色" + JSON.stringify(actor))
236
- res= await http.load('POST', url, {
237
- source: `tool.getChildrenOfResName($${actor}$)`,
238
- userid: Vue.user.id
239
- }, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
240
- }else{
241
- res = await http.load('POST', url, this.selectdata.actorexpression, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
242
- }
243
- console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
244
- let jsonString = JSON.stringify(res.data)
245
- let jsonArray = []
246
- if(jsonString.startsWith("{")){
247
- jsonArray.push(res.data)
248
- res.data = jsonArray
249
- }
250
- this.department_search = res.data
251
- }
252
-
253
- // data 填充 selectdata
254
- console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
255
- this.data = Object.assign({},this.data, this.selectdata)
256
- console.log('this.data的值=>' + JSON.stringify(this.data))
257
-
258
- // 初始化 fields
259
- console.log('this.data.fields.length=>' + this.data.fields.length)
260
- for(let i=0;i<this.data.fields.length;i++){
261
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
262
- if(this.selectdata[this.data.fields[i].field]){
263
- this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
264
- }
265
- // 如果配置类型为select,优先从参数列表获取options
266
- if(this.data.fields[i].type == 'select'){
267
- console.log('进入下拉框参数获取方法,参数名称=>' + this.data.fields[i].label)
268
- console.log('$appdata中的缓存参数与单值=>' + JSON.stringify(this.$appdata))
269
- var param = this.$appdata.getParam(this.data.fields[i].label)
270
- console.log(param)
271
- if (param){
272
- this.data.fields[i].options = param
273
- }
274
-
275
- }
276
- // 设置用户类型
277
- if (this.data.fields[i].label == '用户类型') {
278
- this.data.fields[i].options = [{label: '民用', value: '民用'},{label: '非民用', value: '非民用'}]
279
- }
280
- // 获取县区
281
- if (this.data.fields[i].label == '县/区') {
282
- let http = new HttpResetClass()
283
- let area = await http.load('post',`${this.$androidUtil.getProxyUrl()}/rs/sql/applysingleTable`, {
284
- data: {
285
- // items: 'f_bill_url,f_url_code',
286
- tablename: 't_pcd',
287
- condition: `f_filialeids = '${Vue.user.f_orgids}'`
288
- }
289
- }, {resolveMsg: null, rejectMsg: null})
290
- let rs = []
291
- for (let i = 0; i < area.data.length; i++) {
292
- let temp = {
293
- label: area.data[i].f_pcd,
294
- value: area.data[i].f_pcd
295
- }
296
- rs.push(temp)
297
- }
298
- this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
299
- }
300
- }
301
- // 初始化 buttons_fields
302
- for(let i=0;i<this.data.buttons.length;i++){
303
- if(this.data.buttons[i].button_fields){
304
- for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
305
- // 如果selectdata有这些key,则把selectdata的value赋值给data的value
306
- if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
307
- this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
308
- }
309
- // 如果配置类型为select,优先从参数列表获取options
310
- if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
311
- console.log("这里是给select赋值的地方"+JSON.stringify(this.data.buttons[i].button_fields[j]))
312
- console.log("参数列表获取到的"+JSON.stringify(this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)))
313
- this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
314
- }
315
- // 下发特殊配置
316
- if(this.data.buttons[i].button_name==='下发'){
317
- if(this.data.buttons[i].button_fields.length===1){
318
- // value初始化
319
- // if(this.department_search){
320
- console.log("看看111department_search"+JSON.stringify(this.department_search))
321
-
322
- if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
323
-
324
- for(let k=0;k<this.department_search.length;k++){
325
- // 将id转换为name
326
- if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
327
- this.data.buttons[i].button_fields[0].value=this.department_search[k].name
328
- }
329
- }
330
- }
331
-
332
- if(this.department_search){
333
- let array = []
334
- console.log("看看department_search"+JSON.stringify(this.department_search))
335
- this.department_search.forEach((paper)=>{
336
- array.push({label:paper.name,value:paper.name})
337
- })
338
- this.data.buttons[i].button_fields[0].options = array
339
- }
340
- }else {
341
- this.$showMessage("下发按钮必须满足 当且仅当一个字段")
342
- }
343
- }
344
- }
345
- }
346
- }
347
- // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
348
- let temp = JSON.parse(JSON.stringify(this.data))
349
- // 退回原因展示
350
- if(this.selectdata.f_back_reason){
351
- temp['back_reason'] = this.selectdata.f_back_reason
352
- }
353
- console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
354
- console.log(JSON.stringify(this.show_data.ppp))
355
- if (JSON.stringify(this.show_data.ppp)=='{}'){
356
- this.show_data.ppp = temp
357
- console.log("重新赋值")
358
-
359
- }else{
360
- console.log("不重新赋值")
361
- }
362
- console.log('initializtion()方法结束,showview')
363
- this.showview = true
364
- },
365
- deleteLocalApply(model){
366
- console.log(`前台上传完成,开始删除本地报建工单`)
367
- this.$androidUtil.bzLogic('deleteApply', {data:model})
368
- }
369
- },
370
- events: {
371
- 'checkboxSelectControl'(index,index2){
372
- if(this.$refs.service_show.data.fields[index].label=="施工提交资料"){
373
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
374
- if(this.$refs.service_show.data.fields[i].label=="施工已上传文件"){
375
- //增加和删除框中的内容
376
- if (this.$refs.service_show.data.fields[i].value==undefined){
377
- this.$refs.service_show.data.fields[i].value=''
378
- }
379
- if(this.$refs.service_show.data.fields[index].items[index2].value == false){
380
- this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
381
- // 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+" ";
382
- this.$refs.service_show.data.fields[index].items[index2].value=true;
383
- }else{
384
- let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
385
- let values =this.$refs.service_show.data.fields[i].value;
386
- let result = values.split(" ").filter((item)=>{
387
- return item!=deleteValue;
388
- }).join(" ")
389
- this.$refs.service_show.data.fields[i].value =result;
390
- this.$refs.service_show.data.fields[index].items[index2].value=false;
391
- }
392
- //}
393
- }
394
- }
395
- }
396
- if(this.$refs.service_show.data.fields[index].label=="验收提交资料"){
397
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
398
-
399
- if(this.$refs.service_show.data.fields[i].label=="验收已上传文件"){
400
- //增加和删除框中的内容
401
- if(this.$refs.service_show.data.fields[index].items[index2].value == false){
402
- this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
403
- // 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+" ";
404
- this.$refs.service_show.data.fields[index].items[index2].value=true;
405
- }else{
406
- let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
407
- let values =this.$refs.service_show.data.fields[i].value;
408
- let result = values.split(" ").filter((item)=>{
409
- return item!=deleteValue;
410
- }).join(" ")
411
- this.$refs.service_show.data.fields[i].value =result;
412
- this.$refs.service_show.data.fields[index].items[index2].value=false;
413
- }
414
- //}
415
- }
416
- }
417
- }
418
- this.$refs.service_show.update()
419
- },
420
- // 任意select选中时触发事件
421
- async 'select_cascade'(index){
422
- // this.$refs.service_show.model_temp // 子业务显示组件
423
- // 级联操作示例:
424
- /*
425
- if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
426
- for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
427
- // 控制设置级联
428
- // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
429
- if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
430
- this.$refs.service_show.model_temp.activitys.fields[i].options=[
431
- {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
432
- ]
433
- }
434
- }
435
- }
436
- */
437
- if (this.$refs.service_show.data.fields[index].label === '县/区') {
438
- let temp = this.$refs.service_show.data.fields[index].value
439
- console.log('==============================县/区:' + temp)
440
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
441
- // 控制设置级联
442
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
443
- if (this.$refs.service_show.data.fields[i].label === '街道名称') {
444
- await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/applysingleTable`, {
445
- data: {
446
- tablename: 't_street',
447
- condition: `f_filialeids = '${Vue.user.f_orgids}' and f_pcd='${temp}'`
448
- }
449
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
450
- let streetrs = []
451
- for (let i = 0; i < res.data.length; i++) {
452
- let temp = {
453
- label: res.data[i].f_street,
454
- value: res.data[i].f_street
455
- }
456
- streetrs.push(temp)
457
- }
458
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
459
- // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
460
- this.$refs.service_show.update()
461
- })
462
- }
463
- }
464
- }
465
- if (this.$refs.service_show.data.fields[index].label === '街道名称') {
466
- let temp = this.$refs.service_show.data.fields[index].value
467
- console.log('=============================街道:' + temp)
468
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
469
- // 控制设置级联
470
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
471
- if (this.$refs.service_show.data.fields[i].label === '小区名称') {
472
- await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/applysingleTable`, {
473
- data: {
474
- tablename: 't_area',
475
- condition: `f_filialeids = '${Vue.user.f_orgids}' and f_street='${temp}'`
476
- }
477
- }, {resolveMsg: null, rejectMsg: null}).then(res => {
478
- let arears = []
479
- for (let i = 0; i < res.data.length; i++) {
480
- let temp = {
481
- label: res.data[i].f_residential_area,
482
- value: res.data[i].f_residential_area
483
- }
484
- arears.push(temp)
485
- }
486
- this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...arears]
487
- // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
488
- this.$refs.service_show.update()
489
- })
490
- }
491
- }
492
- }
493
- // 合成地址
494
- if (
495
- this.$refs.service_show.data.fields[index].label === '县/区' ||
496
- this.$refs.service_show.data.fields[index].label === '街道名称' ||
497
- this.$refs.service_show.data.fields[index].label === '小区名称' ||
498
- this.$refs.service_show.data.fields[index].label === '楼号' ||
499
- this.$refs.service_show.data.fields[index].label === '单元号' ||
500
- this.$refs.service_show.data.fields[index].label === '楼层' ||
501
- this.$refs.service_show.data.fields[index].label === '门牌号'
502
- ) {
503
- console.log('即将合成地址')
504
- var address = ''
505
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
506
- // 控制设置级联
507
- // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
508
- // xxx xx xxx
509
- if (this.$refs.service_show.data.fields[i].label === '县/区' && this.$refs.service_show.data.fields[i].value) {
510
- address += this.$refs.service_show.data.fields[i].value
511
- }
512
- if (this.$refs.service_show.data.fields[i].label === '街道名称' && this.$refs.service_show.data.fields[i].value) {
513
- address += this.$refs.service_show.data.fields[i].value
514
- }
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 += '栋'
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
-
543
- }
544
- console.log('获取到的address=>' + address)
545
- // 数据获取完毕时放入地址text
546
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
547
- if (this.$refs.service_show.data.fields[i].label === '地址' || this.$refs.service_show.data.fields[i].label === '报装地址') {
548
- this.$refs.service_show.data.fields[i].value = address
549
- console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
550
- }
551
- }
552
- this.$refs.service_show.update()
553
- }
554
- if (this.$refs.service_show.data.fields[index].label == '用户类型'){
555
- if(this.$refs.service_show.data.fields[index].value == '非民用'){
556
- for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
557
- if (this.$refs.service_show.data.fields[i].label === '小区名称') {
558
- this.$refs.service_show.data.fields[i].required=false;
559
- }
560
- }
561
- }else{
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=true;
565
- }
566
- }
567
- }
568
- }
569
- },
570
- // 获取view层button事件
571
- async 'button'(model){
572
- if (this.data.defname==='踏勘'){
573
- if (model.button.button_name === '终止'){
574
- this.stop_show=true
575
- return
576
- }
577
- }
578
- this.loading=true
579
- console.log('进入async button事件方法')
580
- var delteLocal = true
581
- // 点击保存与重置按钮不需要修改本地工单状态
582
- if(model.button.button_name == '保存' || model.button.button_name==='重置'){
583
- delteLocal = false
584
- }
585
- // 点击重置按钮就重置数据
586
- if(model.button.button_name==='重置'){
587
- this.initializtion()
588
- return
589
- }
590
- if(model.button.button_name==='下发'){
591
- let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
592
- for(let i=0;i<this.department_search.length;i++){
593
- // 找到人名为person_name 的人,然后把人名换成id
594
- if(this.department_search[i].name === person_name){
595
- model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
596
- }
597
- }
598
- }
599
- console.log("button事件接收参数model=>" + JSON.stringify(model))
600
- model=Object.assign({},this.selectdata,model)
601
- console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
602
- if (this.data.defname==='踏勘'&&(model.button.button_name === '提交'||model.button.button_name === '通气')){
603
- this.loading=false
604
- this.apply_show=true
605
- this.models2 = model
606
- return
607
- }
608
- let http = new HttpResetClass()
609
- if (this.data.defname === '通气转单'&& model.button.button_name === '提交'){
610
- model.f_sub_state = '完工'
611
- }else {
612
- model.f_sub_state = '未完工'
613
- }
614
- var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
615
- // let res = await http.load('POST',url,{data:data}, {resolveMsg: null, rejectMsg: null})
616
- // // 先判断是否包含code,如果服务端异常,可能不存在code
617
- // console.log("service处理完成返回数据=>" + res)
618
- // if(!res.code){
619
- // console.log("service处理完成返回数据=>" + res)
620
- // this.$showMessage('操作异常,原因:' + res)
621
- // }else{
622
- // console.log("service处理完成返回数据=>" + JSON.stringify(res))
623
- // if(res.code = 200){
624
- // this.showview = false
625
- // // 特殊处理
626
- // this.special(model)
627
- // this.$dispatch('close')
628
- // this.initializtion()
629
- // this.$showMessage('操作成功')
630
- // }else{
631
- // this.$showMessage('操作失败,原因:' + res.data.msg)
632
- // }
633
- // }
634
- let btn = btn_operate(this, url, http, model, delteLocal)
635
- co(btn)
636
- }
637
- },
638
- watch:{
639
- // 监听selectdata的变化
640
- 'selectdata'() {
641
- console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
642
- this.refurbish()
643
- },
644
- deep:true
645
- }
646
- }
647
-
648
- let btn_operate = function * (self, url, http, model, delteLocal) {
649
- self.delteLocal=delteLocal
650
- console.log("model的信息",model)
651
- // 下发,提交,保存,退回都在后台处理
652
- console.log('即将请求后台url=>' + url)
653
- model.employeetemplate=''
654
- self.model=model
655
- console.log(JSON.stringify(self.model))
656
- let param={
657
- employeetemplate:'',
658
- tables:self.data.tables,
659
- workflow_xmlfilename : self.$workflow_vue.workflow_xmlfilename,
660
- start_activity:model.start_activity,
661
- model:model,
662
- loginUser:Vue.user
663
- }
664
- if(param.model.defname === '现场勘查定价'){
665
- param.model.f_unaccounts_money = param.model.f_total_cost
666
- }
667
- // 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})
668
- let paramStr = JSON.stringify(param)
669
- // 多长截断一次
670
- let subLength = 800
671
- for (let i = 0; i < paramStr.length; i += subLength) {
672
- HostApp.param_cache(paramStr.substr(i, subLength))
673
- }
674
- HostApp.__this__ = self
675
- HostApp.syncLogic({
676
- // logic别名,key必须为logic
677
- 'logic': 'updatePic',
678
- // 回调执行方法名,key必须为callback
679
- 'callback': 'javascript:HostApp.__this__.saveCallBack()',
680
- // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
681
- // 执行回调方法传入key为backresult
682
- // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
683
- 'backresult': 1
684
- })
685
-
686
- }
687
- </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
+ console.log('sum=>' + sum)
204
+ if(sum==1){
205
+ this.data =null
206
+ this.data = jsonData
207
+ console.log('调用initializtion前的this.data=>' + JSON.stringify(this.data))
208
+ this.initializtion()
209
+
210
+ } else if(sum==0) {
211
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
212
+ } else {
213
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
214
+ }
215
+ },
216
+ // json配置数据处理 比如下拉框的options
217
+ async initializtion() {
218
+
219
+ console.log('进入initializtion()方法')
220
+ console.log('接收到的selectdata有无变化'+JSON.stringify(this.selectdata))
221
+ console.log('接收到的selectdata有无actorexpression'+JSON.stringify(this.selectdata.actorexpression))
222
+ // 下发人 options 处理,options初始化
223
+ if(this.selectdata.actorexpression){
224
+ //截取actorexpression
225
+ let http = new HttpResetClass()
226
+ var url = this.$androidUtil.getProxyUrl() + '/rs/search'
227
+ console.log('即将请求后台获取下发人员,url=>' + url)
228
+ // R(安装员报装)
229
+ console.log("777777776"+JSON.stringify(this.selectdata.actorexpression))
230
+ let res
231
+ if (this.selectdata.actorexpression.startsWith('R')) {
232
+ let actorexpression = this.selectdata.actorexpression
233
+ //let actorexpression="R(安装员报装)"
234
+ let actor = actorexpression.substring(actorexpression.indexOf('(') + 1, actorexpression.indexOf(')'))
235
+ console.log("看看角色" + JSON.stringify(actor))
236
+ res= await http.load('POST', url, {
237
+ source: `tool.getChildrenOfResName($${actor}$)`,
238
+ userid: Vue.user.id
239
+ }, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
240
+ }else{
241
+ res = await http.load('POST', url, this.selectdata.actorexpression, {resolveMsg: null, rejectMsg: '获取当前部门人员失败'})
242
+ }
243
+ console.log("请求后台获取下发人员结果转换=>" + JSON.stringify(res))
244
+ let jsonString = JSON.stringify(res.data)
245
+ let jsonArray = []
246
+ if(jsonString.startsWith("{")){
247
+ jsonArray.push(res.data)
248
+ res.data = jsonArray
249
+ }
250
+ this.department_search = res.data
251
+ }
252
+
253
+ // data 填充 selectdata
254
+ console.log('即将合并data与selectdata,selectdata数据=>' + JSON.stringify(this.selectdata))
255
+ this.data = Object.assign({},this.data, this.selectdata)
256
+ console.log('this.data的值=>' + JSON.stringify(this.data))
257
+
258
+ // 初始化 fields
259
+ console.log('this.data.fields.length=>' + this.data.fields.length)
260
+ for(let i=0;i<this.data.fields.length;i++){
261
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
262
+ if(this.selectdata[this.data.fields[i].field]){
263
+ this.data.fields[i].value = this.selectdata[this.data.fields[i].field]
264
+ }
265
+ // 如果配置类型为select,优先从参数列表获取options
266
+ if(this.data.fields[i].type == 'select'){
267
+ console.log('进入下拉框参数获取方法,参数名称=>' + this.data.fields[i].label)
268
+ console.log('$appdata中的缓存参数与单值=>' + JSON.stringify(this.$appdata))
269
+ var param = this.$appdata.getParam(this.data.fields[i].label)
270
+ console.log(param)
271
+ if (param){
272
+ this.data.fields[i].options = param
273
+ }
274
+
275
+ }
276
+ // 设置用户类型
277
+ if (this.data.fields[i].label == '用户类型') {
278
+ this.data.fields[i].options = [{label: '民用', value: '民用'},{label: '非民用', value: '非民用'}]
279
+ }
280
+ // 获取县区
281
+ if (this.data.fields[i].label == '县/区') {
282
+ let http = new HttpResetClass()
283
+ let area = await http.load('post',`${this.$androidUtil.getProxyUrl()}/rs/sql/applysingleTable`, {
284
+ data: {
285
+ // items: 'f_bill_url,f_url_code',
286
+ tablename: 't_pcd',
287
+ condition: `f_filialeids = '${Vue.user.f_orgids}'`
288
+ }
289
+ }, {resolveMsg: null, rejectMsg: null})
290
+ let rs = []
291
+ for (let i = 0; i < area.data.length; i++) {
292
+ let temp = {
293
+ label: area.data[i].f_pcd,
294
+ value: area.data[i].f_pcd
295
+ }
296
+ rs.push(temp)
297
+ }
298
+ this.data.fields[i].options = [{label: '全部', value: ''}, ...rs]
299
+ }
300
+ }
301
+ // 初始化 buttons_fields
302
+ for(let i=0;i<this.data.buttons.length;i++){
303
+ if(this.data.buttons[i].button_fields){
304
+ for(let j=0;j<this.data.buttons[i].button_fields.length;j++){
305
+ // 如果selectdata有这些key,则把selectdata的value赋值给data的value
306
+ if(this.selectdata[this.data.buttons[i].button_fields[j].field]){
307
+ this.data.buttons[i].button_fields[j].value = this.selectdata[this.data.buttons[i].button_fields[j].field]
308
+ }
309
+ // 如果配置类型为select,优先从参数列表获取options
310
+ if(this.data.buttons[i].button_fields[j].type==='select'&&this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)){
311
+ console.log("这里是给select赋值的地方"+JSON.stringify(this.data.buttons[i].button_fields[j]))
312
+ console.log("参数列表获取到的"+JSON.stringify(this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)))
313
+ this.data.buttons[i].button_fields[j].options=this.$appdata.getParam(this.data.buttons[i].button_fields[j].label)
314
+ }
315
+ // 下发特殊配置
316
+ if(this.data.buttons[i].button_name==='下发'){
317
+ if(this.data.buttons[i].button_fields.length===1){
318
+ // value初始化
319
+ // if(this.department_search){
320
+ console.log("看看111department_search"+JSON.stringify(this.department_search))
321
+
322
+ if(this.selectdata[this.data.buttons[i].button_fields[0].field]){
323
+
324
+ for(let k=0;k<this.department_search.length;k++){
325
+ // 将id转换为name
326
+ if(Number(this.department_search[k].id) === Number(this.selectdata[this.data.buttons[i].button_fields[0].field])){
327
+ this.data.buttons[i].button_fields[0].value=this.department_search[k].name
328
+ }
329
+ }
330
+ }
331
+
332
+ if(this.department_search){
333
+ let array = []
334
+ console.log("看看department_search"+JSON.stringify(this.department_search))
335
+ this.department_search.forEach((paper)=>{
336
+ array.push({label:paper.name,value:paper.name})
337
+ })
338
+ this.data.buttons[i].button_fields[0].options = array
339
+ }
340
+ }else {
341
+ this.$showMessage("下发按钮必须满足 当且仅当一个字段")
342
+ }
343
+ }
344
+ }
345
+ }
346
+ }
347
+ // 消除双向绑定,避免子组件(显示层)数据更改,父组件(控制层)也更改
348
+ let temp = JSON.parse(JSON.stringify(this.data))
349
+ // 退回原因展示
350
+ if(this.selectdata.f_back_reason){
351
+ temp['back_reason'] = this.selectdata.f_back_reason
352
+ }
353
+ console.log('即将给show_data赋值temp=>' + JSON.stringify(temp))
354
+ console.log(JSON.stringify(this.show_data.ppp))
355
+ if (JSON.stringify(this.show_data.ppp)=='{}'){
356
+ this.show_data.ppp = temp
357
+ console.log("重新赋值")
358
+
359
+ }else{
360
+ console.log("不重新赋值")
361
+ }
362
+ console.log('initializtion()方法结束,showview')
363
+ this.showview = true
364
+ },
365
+ deleteLocalApply(model){
366
+ console.log(`前台上传完成,开始删除本地报建工单`)
367
+ this.$androidUtil.bzLogic('deleteApply', {data:model})
368
+ }
369
+ },
370
+ events: {
371
+ 'checkboxSelectControl'(index,index2){
372
+ if(this.$refs.service_show.data.fields[index].label=="施工提交资料"){
373
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
374
+ if(this.$refs.service_show.data.fields[i].label=="施工已上传文件"){
375
+ //增加和删除框中的内容
376
+ if (this.$refs.service_show.data.fields[i].value==undefined){
377
+ this.$refs.service_show.data.fields[i].value=''
378
+ }
379
+ if(this.$refs.service_show.data.fields[index].items[index2].value == false){
380
+ this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
381
+ // 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+" ";
382
+ this.$refs.service_show.data.fields[index].items[index2].value=true;
383
+ }else{
384
+ let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
385
+ let values =this.$refs.service_show.data.fields[i].value;
386
+ let result = values.split(" ").filter((item)=>{
387
+ return item!=deleteValue;
388
+ }).join(" ")
389
+ this.$refs.service_show.data.fields[i].value =result;
390
+ this.$refs.service_show.data.fields[index].items[index2].value=false;
391
+ }
392
+ //}
393
+ }
394
+ }
395
+ }
396
+ if(this.$refs.service_show.data.fields[index].label=="验收提交资料"){
397
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
398
+
399
+ if(this.$refs.service_show.data.fields[i].label=="验收已上传文件"){
400
+ //增加和删除框中的内容
401
+ if(this.$refs.service_show.data.fields[index].items[index2].value == false){
402
+ this.$refs.service_show.data.fields[i].value+=this.$refs.service_show.data.fields[index].items[index2].label+" ";
403
+ // 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+" ";
404
+ this.$refs.service_show.data.fields[index].items[index2].value=true;
405
+ }else{
406
+ let deleteValue = this.$refs.service_show.data.fields[index].items[index2].label;
407
+ let values =this.$refs.service_show.data.fields[i].value;
408
+ let result = values.split(" ").filter((item)=>{
409
+ return item!=deleteValue;
410
+ }).join(" ")
411
+ this.$refs.service_show.data.fields[i].value =result;
412
+ this.$refs.service_show.data.fields[index].items[index2].value=false;
413
+ }
414
+ //}
415
+ }
416
+ }
417
+ }
418
+ this.$refs.service_show.update()
419
+ },
420
+ // 任意select选中时触发事件
421
+ async 'select_cascade'(index){
422
+ // this.$refs.service_show.model_temp // 子业务显示组件
423
+ // 级联操作示例:
424
+ /*
425
+ if(this.$refs.service_show.model_temp.activitys.ields[index].label==='报建类型'){
426
+ for(let i=0;i<this.$refs.service_show.model_temp.activitys.fields.length;i++){
427
+ // 控制设置级联
428
+ // 源select所选的值 this.$refs.service_show.model_temp.activitys.fields[index].value
429
+ if(this.$refs.service_show.model_temp.activitys.fields[i].label==='级联测试2'){
430
+ this.$refs.service_show.model_temp.activitys.fields[i].options=[
431
+ {label:'级联选项1',value:'级联选项1'},{label:'级联选项2',value:'级联选项2'},{label:'级联选项3',value:'级联选项3'}
432
+ ]
433
+ }
434
+ }
435
+ }
436
+ */
437
+ if (this.$refs.service_show.data.fields[index].label === '县/区') {
438
+ let temp = this.$refs.service_show.data.fields[index].value
439
+ console.log('==============================县/区:' + temp)
440
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
441
+ // 控制设置级联
442
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
443
+ if (this.$refs.service_show.data.fields[i].label === '街道名称') {
444
+ await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/applysingleTable`, {
445
+ data: {
446
+ tablename: 't_street',
447
+ condition: `f_filialeids = '${Vue.user.f_orgids}' and f_pcd='${temp}'`
448
+ }
449
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
450
+ let streetrs = []
451
+ for (let i = 0; i < res.data.length; i++) {
452
+ let temp = {
453
+ label: res.data[i].f_street,
454
+ value: res.data[i].f_street
455
+ }
456
+ streetrs.push(temp)
457
+ }
458
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...streetrs]
459
+ // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
460
+ this.$refs.service_show.update()
461
+ })
462
+ }
463
+ }
464
+ }
465
+ if (this.$refs.service_show.data.fields[index].label === '街道名称') {
466
+ let temp = this.$refs.service_show.data.fields[index].value
467
+ console.log('=============================街道:' + temp)
468
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
469
+ // 控制设置级联
470
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
471
+ if (this.$refs.service_show.data.fields[i].label === '小区名称') {
472
+ await this.$resetpost(`${this.$androidUtil.getProxyUrl()}/rs/sql/applysingleTable`, {
473
+ data: {
474
+ tablename: 't_area',
475
+ condition: `f_filialeids = '${Vue.user.f_orgids}' and f_street='${temp}'`
476
+ }
477
+ }, {resolveMsg: null, rejectMsg: null}).then(res => {
478
+ let arears = []
479
+ for (let i = 0; i < res.data.length; i++) {
480
+ let temp = {
481
+ label: res.data[i].f_residential_area,
482
+ value: res.data[i].f_residential_area
483
+ }
484
+ arears.push(temp)
485
+ }
486
+ this.$refs.service_show.data.fields[i].options = [{label: '全部', value: ''}, ...arears]
487
+ // console.log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~option:', this.$refs.service_show.data.fields[i].options)
488
+ this.$refs.service_show.update()
489
+ })
490
+ }
491
+ }
492
+ }
493
+ // 合成地址
494
+ if (
495
+ this.$refs.service_show.data.fields[index].label === '县/区' ||
496
+ this.$refs.service_show.data.fields[index].label === '街道名称' ||
497
+ this.$refs.service_show.data.fields[index].label === '小区名称' ||
498
+ this.$refs.service_show.data.fields[index].label === '楼号' ||
499
+ this.$refs.service_show.data.fields[index].label === '单元号' ||
500
+ this.$refs.service_show.data.fields[index].label === '楼层' ||
501
+ this.$refs.service_show.data.fields[index].label === '门牌号'
502
+ ) {
503
+ console.log('即将合成地址')
504
+ var address = ''
505
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
506
+ // 控制设置级联
507
+ // 源select所选的值 this.$refs.service_show.data.activitys.fields[index].value
508
+ // xxx xx xxx
509
+ if (this.$refs.service_show.data.fields[i].label === '县/区' && this.$refs.service_show.data.fields[i].value) {
510
+ address += this.$refs.service_show.data.fields[i].value
511
+ }
512
+ if (this.$refs.service_show.data.fields[i].label === '街道名称' && this.$refs.service_show.data.fields[i].value) {
513
+ address += this.$refs.service_show.data.fields[i].value
514
+ }
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 += '栋'
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
+
543
+ }
544
+ console.log('获取到的address=>' + address)
545
+ // 数据获取完毕时放入地址text
546
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
547
+ if (this.$refs.service_show.data.fields[i].label === '地址' || this.$refs.service_show.data.fields[i].label === '报装地址') {
548
+ this.$refs.service_show.data.fields[i].value = address
549
+ console.log('修改fields[i].value后的值=>' + this.$refs.service_show.data.fields[i].value)
550
+ }
551
+ }
552
+ this.$refs.service_show.update()
553
+ }
554
+ if (this.$refs.service_show.data.fields[index].label == '用户类型'){
555
+ if(this.$refs.service_show.data.fields[index].value == '非民用'){
556
+ for (let i = 0; i < this.$refs.service_show.data.fields.length; i++) {
557
+ if (this.$refs.service_show.data.fields[i].label === '小区名称') {
558
+ this.$refs.service_show.data.fields[i].required=false;
559
+ }
560
+ }
561
+ }else{
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=true;
565
+ }
566
+ }
567
+ }
568
+ }
569
+ },
570
+ // 获取view层button事件
571
+ async 'button'(model){
572
+ if (this.data.defname==='踏勘'){
573
+ if (model.button.button_name === '终止'){
574
+ this.stop_show=true
575
+ return
576
+ }
577
+ }
578
+ this.loading=true
579
+ console.log('进入async button事件方法')
580
+ var delteLocal = true
581
+ // 点击保存与重置按钮不需要修改本地工单状态
582
+ if(model.button.button_name == '保存' || model.button.button_name==='重置'){
583
+ delteLocal = false
584
+ }
585
+ // 点击重置按钮就重置数据
586
+ if(model.button.button_name==='重置'){
587
+ this.initializtion()
588
+ return
589
+ }
590
+ if(model.button.button_name==='下发'){
591
+ let person_name = model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field]
592
+ for(let i=0;i<this.department_search.length;i++){
593
+ // 找到人名为person_name 的人,然后把人名换成id
594
+ if(this.department_search[i].name === person_name){
595
+ model.button.button_fields[this.show_data.buttons[model.button.button_index].button_fields[0].field] = this.department_search[i].id
596
+ }
597
+ }
598
+ }
599
+ console.log("button事件接收参数model=>" + JSON.stringify(model))
600
+ model=Object.assign({},this.selectdata,model)
601
+ console.log('合并selectdata与model后的model=>' + JSON.stringify(model))
602
+ if (this.data.defname==='踏勘'&&(model.button.button_name === '提交'||model.button.button_name === '通气')){
603
+ this.loading=false
604
+ this.apply_show=true
605
+ this.models2 = model
606
+ return
607
+ }
608
+ let http = new HttpResetClass()
609
+ if (this.data.defname === '通气转单'&& model.button.button_name === '提交'){
610
+ model.f_sub_state = '完工'
611
+ }else {
612
+ model.f_sub_state = '未完工'
613
+ }
614
+ var url = this.$androidUtil.getProxyUrl() + '/rs/logic/ApplyProductService'
615
+ // let res = await http.load('POST',url,{data:data}, {resolveMsg: null, rejectMsg: null})
616
+ // // 先判断是否包含code,如果服务端异常,可能不存在code
617
+ // console.log("service处理完成返回数据=>" + res)
618
+ // if(!res.code){
619
+ // console.log("service处理完成返回数据=>" + res)
620
+ // this.$showMessage('操作异常,原因:' + res)
621
+ // }else{
622
+ // console.log("service处理完成返回数据=>" + JSON.stringify(res))
623
+ // if(res.code = 200){
624
+ // this.showview = false
625
+ // // 特殊处理
626
+ // this.special(model)
627
+ // this.$dispatch('close')
628
+ // this.initializtion()
629
+ // this.$showMessage('操作成功')
630
+ // }else{
631
+ // this.$showMessage('操作失败,原因:' + res.data.msg)
632
+ // }
633
+ // }
634
+ let btn = btn_operate(this, url, http, model, delteLocal)
635
+ co(btn)
636
+ }
637
+ },
638
+ watch:{
639
+ // 监听selectdata的变化
640
+ 'selectdata'() {
641
+ console.log('进入selectdata改变事件data=>' + JSON.stringify(this.selectdata))
642
+ this.refurbish()
643
+ },
644
+ deep:true
645
+ }
646
+ }
647
+
648
+ let btn_operate = function * (self, url, http, model, delteLocal) {
649
+ self.delteLocal=delteLocal
650
+ console.log("model的信息",model)
651
+ // 下发,提交,保存,退回都在后台处理
652
+ console.log('即将请求后台url=>' + url)
653
+ model.employeetemplate=''
654
+ self.model=model
655
+ console.log(JSON.stringify(self.model))
656
+ let param={
657
+ employeetemplate:'',
658
+ tables:self.data.tables,
659
+ workflow_xmlfilename : self.$workflow_vue.workflow_xmlfilename,
660
+ start_activity:model.start_activity,
661
+ model:model,
662
+ loginUser:Vue.user
663
+ }
664
+ if(param.model.defname === '现场勘查定价'){
665
+ param.model.f_unaccounts_money = param.model.f_total_cost
666
+ }
667
+ // 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})
668
+ let paramStr = JSON.stringify(param)
669
+ // 多长截断一次
670
+ let subLength = 800
671
+ for (let i = 0; i < paramStr.length; i += subLength) {
672
+ HostApp.param_cache(paramStr.substr(i, subLength))
673
+ }
674
+ HostApp.__this__ = self
675
+ HostApp.syncLogic({
676
+ // logic别名,key必须为logic
677
+ 'logic': 'updatePic',
678
+ // 回调执行方法名,key必须为callback
679
+ 'callback': 'javascript:HostApp.__this__.saveCallBack()',
680
+ // 固定key,代表是否将logic执行结果作为参数传入回调方法,1代表true,0代表false,
681
+ // 执行回调方法传入key为backresult
682
+ // 如需额外拼接参数,写在logic返回值的params,例如xxlogic返回:{"params": "success"}
683
+ 'backresult': 1
684
+ })
685
+
686
+ }
687
+ </script>