diff --git a/src/api/modules/permissionProcess.js b/src/api/modules/permissionProcess.js index ad5507c..df277b5 100644 --- a/src/api/modules/permissionProcess.js +++ b/src/api/modules/permissionProcess.js @@ -9,14 +9,7 @@ export default { data: data }) }, - // 查询报告如果已经发起了 就不能再发起了 - selectReport (data) { - return request({ - url: '/api/report/isAct', - method: 'post', - data: data - }) - }, + deletReport(data){ return request({ url: '/api/report/powerApply/deleteAct', diff --git a/src/api/modules/process.js b/src/api/modules/process.js index bc71ac8..e75b831 100644 --- a/src/api/modules/process.js +++ b/src/api/modules/process.js @@ -116,7 +116,7 @@ export default { params: data }) }, - // 停用流程发起 + // 流程发起 startProcess(data) { return request({ url: '/api/startProcess', @@ -125,7 +125,7 @@ export default { }) }, - // 停用流程发起 + // 流程发起 startProcessALL(data) { return request({ url: '/api/batchStartProcess', @@ -162,5 +162,14 @@ export default { params: data }) - } + }, + // 查询报告如果已经发起了 就不能再发起了 + selectReport (data) { + return request({ + url: '/api/report/isAct', + method: 'post', + data: data + }) + }, + } diff --git a/src/api/modules/report.js b/src/api/modules/report.js index 64e57d0..7077d69 100644 --- a/src/api/modules/report.js +++ b/src/api/modules/report.js @@ -60,7 +60,7 @@ export default { // 新增或编辑报告 reportAdd (data) { return request({ - url: '/api/report/add', + url: '/api/report/saveOrUpdate', method: 'POST', data }) diff --git a/src/api/modules/reportProcess.js b/src/api/modules/reportProcess.js index 25189b5..ab15040 100644 --- a/src/api/modules/reportProcess.js +++ b/src/api/modules/reportProcess.js @@ -7,4 +7,12 @@ export default { params:data }) }, + // 判断报告名称是否重复 + JggleName(data) { + return request({ + url: '/api/report/isReportNameOccupy', + method: 'post', + data:data + }) + } } diff --git a/src/components/OrgTable.vue b/src/components/OrgTable.vue index 4c3da7e..ef0600a 100644 --- a/src/components/OrgTable.vue +++ b/src/components/OrgTable.vue @@ -5,7 +5,7 @@
- 报告满意度: +
报告满意度
+
@@ -386,7 +387,12 @@ export default { .report-jug-left { display: flex; - + &>div{ + margin-right: 10px; + } + ::v-deep .el-rate__item{ + vertical-align: inherit; + } } } diff --git a/src/views/permissionApplication/launch.vue b/src/views/permissionApplication/launch.vue index b3bc82c..1c9df24 100644 --- a/src/views/permissionApplication/launch.vue +++ b/src/views/permissionApplication/launch.vue @@ -316,6 +316,7 @@ export default { console.log("发送数据") // 处理表格数据 + //如果不是第一次 if (this.initShow) { let flag= this.JuggleSub(this.taskId) @@ -324,23 +325,24 @@ export default { this.completeProcess(this.params[0]) } } else { + // 先判断数据完整 if(this.JuggleTableAll()){ - - this.organizeData() - this.startProcess() + // 完整判断草稿发起的在不在流程 + if(this.$route.query.isDraft){ + this.isSendDraft().then((res)=>{ + this.organizeData() + this.startProcess() + }) + }else{ + this.organizeData() + this.startProcess() + } }else{ this.$message.warning("请把表格数据填写完整") } - // this.isSendDraft().then(()=>{ - - // }) } } - }, - //修改参数 - changeParam() { - }, // 草稿发起 需要先调用这个接口 isSendDraft(){ @@ -348,7 +350,7 @@ export default { return item.reportId }) return new Promise((resolve,reject)=>{ - this.$api.permissionProcess.selectReport({ids:ids}).then((res)=>{ + this.$api.process.selectReport({usid:this.userId,ids:ids}).then((res)=>{ if(res.data.length==0){ resolve(true) }else{ diff --git a/src/views/reportProcess/components/reportForm.vue b/src/views/reportProcess/components/reportForm.vue index 1c4969c..6273cb1 100644 --- a/src/views/reportProcess/components/reportForm.vue +++ b/src/views/reportProcess/components/reportForm.vue @@ -25,7 +25,7 @@ - + @@ -265,9 +265,9 @@ export default { if(this.processForm.keyContent){ this.tags=JSON.parse(this.processForm.keyContent) } - if(this.processForm.labelList && typeof this.processForm.labelList[0]=='string'){ this.form.labelList= this.processForm.labelList.map(item=>{ + return JSON.parse(item) }) } @@ -284,8 +284,10 @@ export default { }) }, handleClick(){ - this.orgTableVal=this.form.department - this.orgTableValName=this.form.departmentName + if(this.form.departmentName){ + this.orgTableVal=this.form.departmentId + this.orgTableValName=this.form.departmentName + } this.visibleOrgTable=true }, isTreeOk(checkedList){ diff --git a/src/views/reportProcess/launch.vue b/src/views/reportProcess/launch.vue index 4eef9fd..1e2af5b 100644 --- a/src/views/reportProcess/launch.vue +++ b/src/views/reportProcess/launch.vue @@ -173,17 +173,20 @@ export default { this.isShowSave = true this.$store.commit('setHandleProcess','') this.handleReset() + if(this.$store.getters.userInfo.levelId=='0.5'){ + this.isShowSave = false + this.isLevel=false + }else{ + this.isLevel = true + this.isShowSave = true + } // 第一次进入此页面 需要依据ids区分是新增还是编辑流程 if(this.$route.query.ids){ this.prcType=5 // 调用接口 this.ids=this.$route.query.ids // 如果该用户的levelId==5 就直接编辑 并且不显示指派信息 - if(this.$store.getters.userInfo.levelId=='0.5'){ - this.isLevel=false - }else{ - this.isLevel = true - } + this.getReportDetail() }else{ this.prcType=4 @@ -209,10 +212,13 @@ export default { this.$api.report.getReportDetail(this.ids).then(res=>{ this.processForm=res.data this.processForm.reportId=this.processForm.id - delete this.processForm['id'] - if(this.processForm.fileId){ - this.getFileName() + if(this.isLevel){ + delete this.processForm['id'] + if(this.processForm.fileId){ + this.getFileName() + } } + }) }, handleReset() { @@ -300,7 +306,8 @@ export default { createUser: this.$store.getters.userInfo.usid, submitJson, dataJson, - id: this.$store.getters.handleProcess?.id + id: this.$store.getters.handleProcess?.id, + reportId: this.processForm.reportId || '' } this.saveProcess(params).then( ()=>{ @@ -320,8 +327,9 @@ export default { // 提交 handleSubmit() { console.log(this.$store.getters.userInfo.usid, " this.$store.getters.userInfo.USID") + if(this.isLevel){ - this.$refs.assignFormRef.validate(async v => { + this.$refs.assignFormRef.validate( v => { this.processForm=this.$refs.basMes.form this.processForm.keyContent = JSON.stringify(this.$refs.basMes.tags) this.processForm.prcName=this.processForm.name @@ -329,26 +337,42 @@ export default { let z=this.$refs.basMes.submit() if (v && z) { - this.processForm.createUserId=this.userId - //如果不是第一次 - if (this.initShow) { - let flag=await this.JuggleSub(this.taskId) - if(flag){ - let dataJson = JSON.stringify(this.processForm) - let submitJson = JSON.stringify({...this.assignForm, userId: this.$store.getters.userInfo.usid}) - this.completeProcess({ - dataJson, - submitJson, - taskId: this.taskId, - userId: this.$store.getters.userInfo.usid, - prcType: this.prcType, - reportId: this.processForm.reportId|| '' - }) - } - } else { - this.startProcess() - } + console.log(this.processForm,"his.processFormhis.processFormhis.processForm") + // 判断报告名称是否重复 + this.$api.reportProcess.JggleName({ + id:this.processForm.reportId || '', + name:this.processForm.name + }).then(async res=>{ + this.processForm.createUserId=this.userId + //如果不是第一次 + if (this.initShow) { + // 判断当前提交人是不是审批人 + let flag=await this.JuggleSub(this.taskId) + if(flag){ + + let dataJson = JSON.stringify(this.processForm) + let submitJson = JSON.stringify({...this.assignForm, userId: this.$store.getters.userInfo.usid}) + this.completeProcess({ + dataJson, + submitJson, + taskId: this.taskId, + userId: this.$store.getters.userInfo.usid, + prcType: this.prcType, + reportId: this.processForm.reportId|| '' + }) + } + } else { + // 如果草稿发起 判断在不在流程中 + if(this.$route.query.isDraft && this.prcType==5) { + this.isSendDraft().then((res)=> { + this.startProcess() + }) + }else{ + this.startProcess() + } + } + }) } else { this.$message.warning('请检查表单填写完整') } @@ -364,13 +388,19 @@ export default { this.processForm=this.$refs.basMes.form this.processForm.id=this.processForm.reportId this.processForm.keyContent = JSON.stringify(this.$refs.basMes.tags) - this.$api.report.reportAdd(this.processForm).then(_ => { - this.$message.success('编辑成功'); - this.$router.push({ - path:"/userCenter/processCenter", - query:{ - id:'AEHJB8YNJ3' - } + // 先判断名称是不是重复 + this.$api.reportProcess.JggleName({ + id:this.processForm.reportId || '', + name:this.processForm.name + }).then( res=>{ + this.$api.report.reportAdd(this.processForm).then(_ => { + this.$message.success('操作成功'); + this.$router.push({ + path:"/report/manager", + query:{ + id:'AEHJB8YNJ3' + } + }) }) }) }else{ @@ -378,6 +408,21 @@ export default { } } }, + // 草稿发起 需要先调用这个接口 + isSendDraft() { + let ids = this.processForm.reportId || '' + return new Promise((resolve, reject) => { + this.$api.process.selectReport({usid: this.userId, ids: [ids]}).then((res) => { + if (res.data.length == 0) { + resolve(true) + } else { + this.$message.warning("报告" + res.data.join(',') + "已经在流程中") + reject() + } + + }) + }) + }, startProcess() { //把表单都整合到form中 // dataJson与submitJson需要发到completeProcess diff --git a/src/views/userCenter/processCenter.vue b/src/views/userCenter/processCenter.vue index 6cb3a16..eecb6a0 100644 --- a/src/views/userCenter/processCenter.vue +++ b/src/views/userCenter/processCenter.vue @@ -145,6 +145,9 @@ import tabs from '../userCenter/processCenter/tabs.vue' }else{ this.flag=1 } + this.$nextTick(()=>{ + this.$refs.examineForm.clearValidate() + }) }else{ this.$message.warning("请至少选择一条数据") diff --git a/src/views/userCenter/processCenter/gencyProcess.vue b/src/views/userCenter/processCenter/gencyProcess.vue index eeb2495..46bb7dc 100644 --- a/src/views/userCenter/processCenter/gencyProcess.vue +++ b/src/views/userCenter/processCenter/gencyProcess.vue @@ -158,7 +158,9 @@ export default { }else{ this.flag=1 } - + this.$nextTick(()=>{ + this.$refs.examineForm.clearValidate() + }) }, selectAllEvent({checked}) { const records = this.$refs.xTable.getCheckboxRecords()