【修改】修改回显的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){ }else if(form.twoApprove){
let res=await this.getLearder(form.oneApprove) let res=await this.getLearder(form.oneApprove)
// 判断有二级审批人
if(res.length>0){ if(res.length>0){
form.twoApprove = res[0].usid form.twoApprove = res[0].usid
form.twoApproveName= res[0].usname form.twoApproveName= res[0].usname
@@ -184,12 +185,35 @@ export default {
form.powerName='' form.powerName=''
form.power='' 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{ }else{
this.conTwo=false this.conTwo=false
form.applyReason = '' // 是不是有以前的数据
form.prcType = '' if(form.oldpower){
form.powerName='' this.PERMISSION = this.PERMISSION.map(item=>{
form.power='' 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.dataId= this.$store.getters.handleProcess?.dataId
this.prcType= this.$store.getters.handleProcess?.prcType this.prcType= this.$store.getters.handleProcess?.prcType
this.getProcessDetail().then(res => { this.getProcessDetail().then(res => {
let powerName='' // let powerName=''
let dataJson=JSON.parse(this.processOld.dataJson) let dataJson=JSON.parse(this.processOld.dataJson)
if(dataJson.power){ let powerName=''
this.PERMISSION.forEach(item=>{ // if(dataJson.power)
if(item.value == dataJson.power){ this.reportList(JSON.parse(this.processOld.dataJson).reportId)
powerName=item.label
}
})
}
let submitJson = JSON.parse(this.processOld.submitJson) let submitJson = JSON.parse(this.processOld.submitJson)
// this.applicationForm.applyReason = applyReason.applyReason // this.applicationForm.applyReason = applyReason.applyReason
this.tableData.push({...dataJson,...submitJson,powerName:powerName})
}) })
@@ -157,16 +153,13 @@ export default {
this.initShow = true this.initShow = true
this.formControlname = true this.formControlname = true
await this.getProcessDetail() 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') { if (this.$route.query.type == 'yiban') {
this.taskId = this.$store.getters.handleProcess.taskId this.taskId = this.$store.getters.handleProcess.taskId
@@ -227,24 +220,52 @@ export default {
pageNo:1, pageNo:1,
ids: ids.split(',') ids: ids.split(',')
}).then(({data}) => { }).then(({data}) => {
let templateL=[] if(this.$route.query.taskDefinitionKey == 'reEdit' ){
data.records.map(async item => { let powerName=''
item.oneApprove = item.createUserId || '' this.PERMISSION.forEach(item=>{
item.oneApproveName= item.uploader || '' if(item.value == JSON.parse(this.processOld.dataJson).power ){
if(item.oneApprove){ powerName=item.label
let res=await this.getLearder(item.oneApprove)
if(res){
item.twoApprove = res[0].usid
item.twoApproveName= res[0].usname
} }
} })
item.reportId = item['id'] this.tableData.push({...JSON.parse(this.processOld.dataJson),...JSON.parse(this.processOld.submitJson),powerName:powerName})
delete item['id'] this.tableData[0].oldpower=data.records[0].power
templateL.push(item) this.$set(this.tableData[0],'oldpower',data.records[0].power)
}) }else if(this.$route.query.isDraft){
this.tableData=templateL if(JSON.parse(this.processOld.dataJson).power==data.records[0].power){
console.log("页面没渲染?",this.tableData) 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() { handleReset() {