【修改】

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", name: "reportDrawer",
data() { data() {
return { return {
conTwo: false,
isShow: false, isShow: false,
visibleOrgTable: false, visibleOrgTable: false,
treeType: '', treeType: '',
@@ -150,7 +151,7 @@ export default {
handleClose() { handleClose() {
this.isShow = false this.isShow = false
}, },
open(form) { async open(form) {
this.isShow = true this.isShow = true
let oldPower = form.power let oldPower = form.power
if (!form.twoApprove) { if (!form.twoApprove) {
@@ -170,8 +171,28 @@ export default {
} }
return item 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.applicationForm = JSON.parse(JSON.stringify(form))
this.$nextTick(() => { 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) { handleCheck(name) {
if (this.formControl ) { if (this.formControl ) {
return false return false
} }
if(name==='spr2' &&this.conTwo){
return false
}
this.treeType = name this.treeType = name
this.orgTableVal = '' this.orgTableVal = ''
this.orgTableValName = '' this.orgTableValName = ''
@@ -204,10 +243,13 @@ export default {
this.orgTableVal = this.applicationForm.twoApprove ? this.applicationForm.twoApprove : '' this.orgTableVal = this.applicationForm.twoApprove ? this.applicationForm.twoApprove : ''
this.orgTableValName = this.applicationForm.twoApproveName ? this.applicationForm.twoApproveName : '' this.orgTableValName = this.applicationForm.twoApproveName ? this.applicationForm.twoApproveName : ''
} }
this.visibleOrgTable = true this.visibleOrgTable = true
}, },
// 树点击 // 树点击
isTreeOk(checkedList) { async isTreeOk(checkedList) {
// console.log(checkedList) // console.log(checkedList)
const parts = [] const parts = []
const partsName = [] const partsName = []
@@ -219,10 +261,22 @@ export default {
if (this.treeType === 'spr1') { if (this.treeType === 'spr1') {
this.applicationForm.oneApprove = parts.toString() this.applicationForm.oneApprove = parts.toString()
this.applicationForm.oneApproveName = partsName.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') { } else if (this.treeType === 'spr2') {
this.applicationForm.twoApprove = parts.toString() this.applicationForm.twoApprove = parts.toString()
this.applicationForm.twoApproveName = partsName.toString() this.applicationForm.twoApproveName = partsName.toString()
} }
// console.log(this.assignForm.name1Id, this.assignForm.name2Id) // console.log(this.assignForm.name1Id, this.assignForm.name2Id)
}, },
} }
+2 -1
View File
@@ -367,7 +367,8 @@ export default {
// 判断报告名称是否重复 // 判断报告名称是否重复
this.$api.reportProcess.JggleName({ this.$api.reportProcess.JggleName({
id:this.processForm.reportId || '', id:this.processForm.reportId || '',
name:this.processForm.name name:this.processForm.name,
prcType:this.prcType
}).then(async res=>{ }).then(async res=>{
this.processForm.createUserId=this.userId this.processForm.createUserId=this.userId