【修改】修改bug

This commit is contained in:
zhoulingpo
2023-05-12 17:03:28 +08:00
parent 30d0ce64b9
commit aeb3f37d4d
12 changed files with 137 additions and 69 deletions
+1 -8
View File
@@ -9,14 +9,7 @@ export default {
data: data data: data
}) })
}, },
// 查询报告如果已经发起了 就不能再发起了
selectReport (data) {
return request({
url: '/api/report/isAct',
method: 'post',
data: data
})
},
deletReport(data){ deletReport(data){
return request({ return request({
url: '/api/report/powerApply/deleteAct', url: '/api/report/powerApply/deleteAct',
+12 -3
View File
@@ -116,7 +116,7 @@ export default {
params: data params: data
}) })
}, },
// 停用流程发起 // 流程发起
startProcess(data) { startProcess(data) {
return request({ return request({
url: '/api/startProcess', url: '/api/startProcess',
@@ -125,7 +125,7 @@ export default {
}) })
}, },
// 停用流程发起 // 流程发起
startProcessALL(data) { startProcessALL(data) {
return request({ return request({
url: '/api/batchStartProcess', url: '/api/batchStartProcess',
@@ -162,5 +162,14 @@ export default {
params: data params: data
}) })
} },
// 查询报告如果已经发起了 就不能再发起了
selectReport (data) {
return request({
url: '/api/report/isAct',
method: 'post',
data: data
})
},
} }
+1 -1
View File
@@ -60,7 +60,7 @@ export default {
// 新增或编辑报告 // 新增或编辑报告
reportAdd (data) { reportAdd (data) {
return request({ return request({
url: '/api/report/add', url: '/api/report/saveOrUpdate',
method: 'POST', method: 'POST',
data data
}) })
+8
View File
@@ -7,4 +7,12 @@ export default {
params:data params:data
}) })
}, },
// 判断报告名称是否重复
JggleName(data) {
return request({
url: '/api/report/isReportNameOccupy',
method: 'post',
data:data
})
}
} }
+1 -1
View File
@@ -5,7 +5,7 @@
<el-dialog <el-dialog
v-if="isOrg" v-if="isOrg"
append-to-body append-to-body
:title="showTitle" title="组织机构"
:visible.sync="isVisible" :visible.sync="isVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
class="org-table" class="org-table"
-2
View File
@@ -213,8 +213,6 @@
this.$message.warning("您没有当前流程的操作权限") this.$message.warning("您没有当前流程的操作权限")
resolve(false) resolve(false)
} }
}) })
}) })
} }
+8 -2
View File
@@ -62,7 +62,8 @@
</div> </div>
<div class="report-jug"> <div class="report-jug">
<div class="report-jug-left"> <div class="report-jug-left">
报告满意度: <div>报告满意度</div>
<el-rate allow-half :max="5" v-model="userRating" @click.native="saveScore"></el-rate> <el-rate allow-half :max="5" v-model="userRating" @click.native="saveScore"></el-rate>
</div> </div>
<div class="pointclick"> <div class="pointclick">
@@ -386,7 +387,12 @@ export default {
.report-jug-left { .report-jug-left {
display: flex; display: flex;
&>div{
margin-right: 10px;
}
::v-deep .el-rate__item{
vertical-align: inherit;
}
} }
} }
+13 -11
View File
@@ -316,6 +316,7 @@ export default {
console.log("发送数据") console.log("发送数据")
// 处理表格数据 // 处理表格数据
//如果不是第一次 //如果不是第一次
if (this.initShow) { if (this.initShow) {
let flag= this.JuggleSub(this.taskId) let flag= this.JuggleSub(this.taskId)
@@ -324,23 +325,24 @@ export default {
this.completeProcess(this.params[0]) this.completeProcess(this.params[0])
} }
} else { } else {
// 先判断数据完整
if(this.JuggleTableAll()){ if(this.JuggleTableAll()){
// 完整判断草稿发起的在不在流程
this.organizeData() if(this.$route.query.isDraft){
this.startProcess() this.isSendDraft().then((res)=>{
this.organizeData()
this.startProcess()
})
}else{
this.organizeData()
this.startProcess()
}
}else{ }else{
this.$message.warning("请把表格数据填写完整") this.$message.warning("请把表格数据填写完整")
} }
// this.isSendDraft().then(()=>{
// })
} }
} }
},
//修改参数
changeParam() {
}, },
// 草稿发起 需要先调用这个接口 // 草稿发起 需要先调用这个接口
isSendDraft(){ isSendDraft(){
@@ -348,7 +350,7 @@ export default {
return item.reportId return item.reportId
}) })
return new Promise((resolve,reject)=>{ 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){ if(res.data.length==0){
resolve(true) resolve(true)
}else{ }else{
@@ -25,7 +25,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="10" :offset="4"> <el-col :span="10" :offset="4">
<el-form-item label="标签:" prop="department"> <el-form-item label="标签:" >
<el-cascader :disabled="formControl" width="100%" v-model="form.labelList" :options="cascaderOptions" <el-cascader :disabled="formControl" width="100%" v-model="form.labelList" :options="cascaderOptions"
filterable collapse-tags filterable collapse-tags
:props="{ checkStrictly: true ,multiple: true }" clearable placeholder="请选择标签"> :props="{ checkStrictly: true ,multiple: true }" clearable placeholder="请选择标签">
@@ -265,9 +265,9 @@ export default {
if(this.processForm.keyContent){ if(this.processForm.keyContent){
this.tags=JSON.parse(this.processForm.keyContent) this.tags=JSON.parse(this.processForm.keyContent)
} }
if(this.processForm.labelList && typeof this.processForm.labelList[0]=='string'){ if(this.processForm.labelList && typeof this.processForm.labelList[0]=='string'){
this.form.labelList= this.processForm.labelList.map(item=>{ this.form.labelList= this.processForm.labelList.map(item=>{
return JSON.parse(item) return JSON.parse(item)
}) })
} }
@@ -284,8 +284,10 @@ export default {
}) })
}, },
handleClick(){ handleClick(){
this.orgTableVal=this.form.department if(this.form.departmentName){
this.orgTableValName=this.form.departmentName this.orgTableVal=this.form.departmentId
this.orgTableValName=this.form.departmentName
}
this.visibleOrgTable=true this.visibleOrgTable=true
}, },
isTreeOk(checkedList){ isTreeOk(checkedList){
+81 -36
View File
@@ -173,17 +173,20 @@ export default {
this.isShowSave = true this.isShowSave = true
this.$store.commit('setHandleProcess','') this.$store.commit('setHandleProcess','')
this.handleReset() this.handleReset()
if(this.$store.getters.userInfo.levelId=='0.5'){
this.isShowSave = false
this.isLevel=false
}else{
this.isLevel = true
this.isShowSave = true
}
// 第一次进入此页面 需要依据ids区分是新增还是编辑流程 // 第一次进入此页面 需要依据ids区分是新增还是编辑流程
if(this.$route.query.ids){ if(this.$route.query.ids){
this.prcType=5 this.prcType=5
// 调用接口 // 调用接口
this.ids=this.$route.query.ids this.ids=this.$route.query.ids
// 如果该用户的levelId==5 就直接编辑 并且不显示指派信息 // 如果该用户的levelId==5 就直接编辑 并且不显示指派信息
if(this.$store.getters.userInfo.levelId=='0.5'){
this.isLevel=false
}else{
this.isLevel = true
}
this.getReportDetail() this.getReportDetail()
}else{ }else{
this.prcType=4 this.prcType=4
@@ -209,10 +212,13 @@ export default {
this.$api.report.getReportDetail(this.ids).then(res=>{ this.$api.report.getReportDetail(this.ids).then(res=>{
this.processForm=res.data this.processForm=res.data
this.processForm.reportId=this.processForm.id this.processForm.reportId=this.processForm.id
delete this.processForm['id'] if(this.isLevel){
if(this.processForm.fileId){ delete this.processForm['id']
this.getFileName() if(this.processForm.fileId){
this.getFileName()
}
} }
}) })
}, },
handleReset() { handleReset() {
@@ -300,7 +306,8 @@ export default {
createUser: this.$store.getters.userInfo.usid, createUser: this.$store.getters.userInfo.usid,
submitJson, submitJson,
dataJson, dataJson,
id: this.$store.getters.handleProcess?.id id: this.$store.getters.handleProcess?.id,
reportId: this.processForm.reportId || ''
} }
this.saveProcess(params).then( this.saveProcess(params).then(
()=>{ ()=>{
@@ -320,8 +327,9 @@ export default {
// 提交 // 提交
handleSubmit() { handleSubmit() {
console.log(this.$store.getters.userInfo.usid, " this.$store.getters.userInfo.USID") console.log(this.$store.getters.userInfo.usid, " this.$store.getters.userInfo.USID")
if(this.isLevel){ if(this.isLevel){
this.$refs.assignFormRef.validate(async v => { this.$refs.assignFormRef.validate( v => {
this.processForm=this.$refs.basMes.form this.processForm=this.$refs.basMes.form
this.processForm.keyContent = JSON.stringify(this.$refs.basMes.tags) this.processForm.keyContent = JSON.stringify(this.$refs.basMes.tags)
this.processForm.prcName=this.processForm.name this.processForm.prcName=this.processForm.name
@@ -329,26 +337,42 @@ export default {
let z=this.$refs.basMes.submit() let z=this.$refs.basMes.submit()
if (v && z) { if (v && z) {
this.processForm.createUserId=this.userId console.log(this.processForm,"his.processFormhis.processFormhis.processForm")
//如果不是第一次 // 判断报告名称是否重复
if (this.initShow) { this.$api.reportProcess.JggleName({
let flag=await this.JuggleSub(this.taskId) id:this.processForm.reportId || '',
if(flag){ name:this.processForm.name
let dataJson = JSON.stringify(this.processForm) }).then(async res=>{
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()
}
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 { } else {
this.$message.warning('请检查表单填写完整') this.$message.warning('请检查表单填写完整')
} }
@@ -364,13 +388,19 @@ export default {
this.processForm=this.$refs.basMes.form this.processForm=this.$refs.basMes.form
this.processForm.id=this.processForm.reportId this.processForm.id=this.processForm.reportId
this.processForm.keyContent = JSON.stringify(this.$refs.basMes.tags) this.processForm.keyContent = JSON.stringify(this.$refs.basMes.tags)
this.$api.report.reportAdd(this.processForm).then(_ => { // 先判断名称是不是重复
this.$message.success('编辑成功'); this.$api.reportProcess.JggleName({
this.$router.push({ id:this.processForm.reportId || '',
path:"/userCenter/processCenter", name:this.processForm.name
query:{ }).then( res=>{
id:'AEHJB8YNJ3' this.$api.report.reportAdd(this.processForm).then(_ => {
} this.$message.success('操作成功');
this.$router.push({
path:"/report/manager",
query:{
id:'AEHJB8YNJ3'
}
})
}) })
}) })
}else{ }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() { startProcess() {
//把表单都整合到form中 //把表单都整合到form中
// dataJson与submitJson需要发到completeProcess // dataJson与submitJson需要发到completeProcess
+3
View File
@@ -145,6 +145,9 @@ import tabs from '../userCenter/processCenter/tabs.vue'
}else{ }else{
this.flag=1 this.flag=1
} }
this.$nextTick(()=>{
this.$refs.examineForm.clearValidate()
})
}else{ }else{
this.$message.warning("请至少选择一条数据") this.$message.warning("请至少选择一条数据")
@@ -158,7 +158,9 @@ export default {
}else{ }else{
this.flag=1 this.flag=1
} }
this.$nextTick(()=>{
this.$refs.examineForm.clearValidate()
})
}, },
selectAllEvent({checked}) { selectAllEvent({checked}) {
const records = this.$refs.xTable.getCheckboxRecords() const records = this.$refs.xTable.getCheckboxRecords()