From 8fd5b9282cd35a6ca943a6f152bbe65722a6dd70 Mon Sep 17 00:00:00 2001 From: zhoulingpo Date: Thu, 18 May 2023 18:16:38 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=9B=9E=E6=98=BE=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/reportDrawer.vue | 32 ++++++- src/views/permissionApplication/launch.vue | 91 ++++++++++++------- 2 files changed, 84 insertions(+), 39 deletions(-) diff --git a/src/views/permissionApplication/components/reportDrawer.vue b/src/views/permissionApplication/components/reportDrawer.vue index 3c4092e..b150205 100644 --- a/src/views/permissionApplication/components/reportDrawer.vue +++ b/src/views/permissionApplication/components/reportDrawer.vue @@ -174,6 +174,7 @@ export default { }else if(form.twoApprove){ let res=await this.getLearder(form.oneApprove) + // 判断有二级审批人 if(res.length>0){ form.twoApprove = res[0].usid form.twoApproveName= res[0].usname @@ -184,12 +185,35 @@ export default { form.powerName='' form.power='' } + // 是不是有以前的数据 + if(form.oldpower){ + this.PERMISSION = this.PERMISSION.map(item=>{ + if(item.value == form.oldpower){ + item.disabled=true + }else{ + item.disabled=false + } + return item + }) + } }else{ this.conTwo=false - form.applyReason = '' - form.prcType = '' - form.powerName='' - form.power='' + // 是不是有以前的数据 + if(form.oldpower){ + this.PERMISSION = this.PERMISSION.map(item=>{ + if(item.value == form.oldpower){ + item.disabled=true + }else{ + item.disabled=false + } + return item + }) + }else{ + form.applyReason = '' + form.prcType = '' + form.powerName='' + form.power='' + } } } diff --git a/src/views/permissionApplication/launch.vue b/src/views/permissionApplication/launch.vue index 56e85e9..193c2ae 100644 --- a/src/views/permissionApplication/launch.vue +++ b/src/views/permissionApplication/launch.vue @@ -132,18 +132,14 @@ export default { this.dataId= this.$store.getters.handleProcess?.dataId this.prcType= this.$store.getters.handleProcess?.prcType this.getProcessDetail().then(res => { - let powerName='' + // let powerName='' let dataJson=JSON.parse(this.processOld.dataJson) - if(dataJson.power){ - this.PERMISSION.forEach(item=>{ - if(item.value == dataJson.power){ - powerName=item.label - } - }) - } + let powerName='' + // if(dataJson.power) + this.reportList(JSON.parse(this.processOld.dataJson).reportId) let submitJson = JSON.parse(this.processOld.submitJson) // this.applicationForm.applyReason = applyReason.applyReason - this.tableData.push({...dataJson,...submitJson,powerName:powerName}) + }) @@ -157,16 +153,13 @@ export default { this.initShow = true this.formControlname = true await this.getProcessDetail() - let powerName='' - this.PERMISSION.forEach(item=>{ - if(item.value == JSON.parse(this.processOld.dataJson).power ){ - powerName=item.label - } - }) - let submitJson = JSON.parse(this.processOld.submitJson) - // this.applicationForm.applyReason = applyReason.applyReason - this.tableData.push({...JSON.parse(this.processOld.dataJson),...JSON.parse(this.processOld.submitJson),powerName:powerName}) + + let submitJson = JSON.parse(this.processOld.submitJson) + + // this.applicationForm.applyReason = applyReason.applyReason + + this.reportList(JSON.parse(this.processOld.dataJson).reportId) } if (this.$route.query.type == 'yiban') { this.taskId = this.$store.getters.handleProcess.taskId @@ -227,24 +220,52 @@ export default { pageNo:1, ids: ids.split(',') }).then(({data}) => { - let templateL=[] - data.records.map(async item => { - item.oneApprove = item.createUserId || '' - item.oneApproveName= item.uploader || '' - if(item.oneApprove){ - let res=await this.getLearder(item.oneApprove) - if(res){ - item.twoApprove = res[0].usid - item.twoApproveName= res[0].usname + if(this.$route.query.taskDefinitionKey == 'reEdit' ){ + let powerName='' + this.PERMISSION.forEach(item=>{ + if(item.value == JSON.parse(this.processOld.dataJson).power ){ + powerName=item.label } - } - item.reportId = item['id'] - delete item['id'] - templateL.push(item) - }) - this.tableData=templateL - console.log("页面没渲染?",this.tableData) - }) + }) + this.tableData.push({...JSON.parse(this.processOld.dataJson),...JSON.parse(this.processOld.submitJson),powerName:powerName}) + this.tableData[0].oldpower=data.records[0].power + this.$set(this.tableData[0],'oldpower',data.records[0].power) + }else if(this.$route.query.isDraft){ + if(JSON.parse(this.processOld.dataJson).power==data.records[0].power){ + this.tableData.push({...JSON.parse(this.processOld.dataJson),...JSON.parse(this.processOld.submitJson)}) + }else{ + + let powerName='' + this.PERMISSION.forEach(item=>{ + if(item.value == JSON.parse(this.processOld.dataJson).power ){ + powerName=item.label + } + }) + this.tableData.push({...JSON.parse(this.processOld.dataJson),...JSON.parse(this.processOld.submitJson),powerName:powerName}) + this.tableData[0].oldpower=data.records[0].power + this.$set(this.tableData[0],'oldpower',data.records[0].power) + } + }else{ + let templateL=[] + data.records.map(async item => { + item.oneApprove = item.createUserId || '' + item.oneApproveName= item.uploader || '' + if(item.oneApprove){ + let res=await this.getLearder(item.oneApprove) + if(res){ + item.twoApprove = res[0].usid + item.twoApproveName= res[0].usname + } + } + item.reportId = item['id'] + delete item['id'] + templateL.push(item) + }) + this.tableData=templateL + console.log("页面没渲染?",this.tableData) + + } + }) }, handleReset() {