diff --git a/src/views/permissionApplication/components/reportDrawer.vue b/src/views/permissionApplication/components/reportDrawer.vue index dd528f7..3c4092e 100644 --- a/src/views/permissionApplication/components/reportDrawer.vue +++ b/src/views/permissionApplication/components/reportDrawer.vue @@ -49,7 +49,7 @@ - @@ -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,8 +211,26 @@ 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) { + if (this.formControl ) { + return false + } + if(name==='spr2' &&this.conTwo){ return false } this.treeType = name @@ -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) }, } diff --git a/src/views/reportProcess/launch.vue b/src/views/reportProcess/launch.vue index fd5b266..550ef52 100644 --- a/src/views/reportProcess/launch.vue +++ b/src/views/reportProcess/launch.vue @@ -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