【修改】

This commit is contained in:
zhoulingpo
2023-05-18 17:18:20 +08:00
parent 1011adf46c
commit bbd4e80f1b
2 changed files with 61 additions and 6 deletions
@@ -100,6 +100,7 @@ export default {
name: "reportDrawer",
data() {
return {
conTwo: false,
isShow: false,
visibleOrgTable: false,
treeType: '',
@@ -150,7 +151,7 @@ export default {
handleClose() {
this.isShow = false
},
open(form) {
async open(form) {
this.isShow = true
let oldPower = form.power
if (!form.twoApprove) {
@@ -170,8 +171,28 @@ export default {
}
return item
})
}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
this.conTwo=true
if(form.powerName == ''|| !form.powerName){
form.applyReason = ''
form.prcType = ''
form.powerName=''
form.power=''
}
}else{
this.conTwo=false
form.applyReason = ''
form.prcType = ''
form.powerName=''
form.power=''
}
}
this.applicationForm = JSON.parse(JSON.stringify(form))
this.$nextTick(() => {
@@ -190,10 +211,28 @@ export default {
})
},
// 获取领导
getLearder(id){
console.log("获取领导")
return new Promise((resolve,reject)=>{
this.$api.reportProcess.getLeader({
userId:id
}).then(res=>{
if(res.data.length>0){
resolve(res.data)
}else{
resolve('')
}
})
})
},
handleCheck(name) {
if (this.formControl ) {
return false
}
if(name==='spr2' &&this.conTwo){
return false
}
this.treeType = name
this.orgTableVal = ''
this.orgTableValName = ''
@@ -204,10 +243,13 @@ export default {
this.orgTableVal = this.applicationForm.twoApprove ? this.applicationForm.twoApprove : ''
this.orgTableValName = this.applicationForm.twoApproveName ? this.applicationForm.twoApproveName : ''
}
this.visibleOrgTable = true
},
// 树点击
isTreeOk(checkedList) {
async isTreeOk(checkedList) {
// console.log(checkedList)
const parts = []
const partsName = []
@@ -219,10 +261,22 @@ export default {
if (this.treeType === 'spr1') {
this.applicationForm.oneApprove = parts.toString()
this.applicationForm.oneApproveName = partsName.toString()
let res=await this.getLearder(this.applicationForm.oneApprove)
if(res.length>0){
this.applicationForm.twoApprove = res[0].usid
this.applicationForm.twoApproveName= res[0].usname
this.conTwo=true
}else{
this.applicationForm.twoApprove =''
this.applicationForm.twoApproveName=''
this.conTwo=false
}
} else if (this.treeType === 'spr2') {
this.applicationForm.twoApprove = parts.toString()
this.applicationForm.twoApproveName = partsName.toString()
}
// console.log(this.assignForm.name1Id, this.assignForm.name2Id)
},
}
+2 -1
View File
@@ -367,7 +367,8 @@ export default {
// 判断报告名称是否重复
this.$api.reportProcess.JggleName({
id:this.processForm.reportId || '',
name:this.processForm.name
name:this.processForm.name,
prcType:this.prcType
}).then(async res=>{
this.processForm.createUserId=this.userId