【修改】修改回显的bug

This commit is contained in:
zhoulingpo
2023-05-18 18:16:38 +08:00
parent bbd4e80f1b
commit 8fd5b9282c
2 changed files with 84 additions and 39 deletions
@@ -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=''
}
}
}
+56 -35
View File
@@ -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() {