【修改】增加直接编辑接口

This commit is contained in:
zhoulingpo
2023-05-12 10:45:42 +08:00
parent 48aca5b170
commit e2b8764a74
+57 -25
View File
@@ -19,7 +19,7 @@
<span class="base_title">审批历史</span>
<process-approval-history :prcNum="prcNum"></process-approval-history>
</div>
<div class="process_content">
<div class="process_content" v-if="isLevel">
<span class="base_title">指派信息</span>
<el-form ref="assignFormRef" :model="assignForm" label-width="150px"
:rules="assignFormRules" class="label-input-form" size="medium">
@@ -78,6 +78,7 @@ export default {
mixins: [processMixin],
data() {
return {
isLevel: true,
dataId:'',
showTableD: false,
initShow: false, // 控制审批历史是否显示 只有在不是第一次的时候才是true
@@ -177,6 +178,12 @@ export default {
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
@@ -313,38 +320,63 @@ export default {
// 提交
handleSubmit() {
console.log(this.$store.getters.userInfo.usid, " this.$store.getters.userInfo.USID")
this.$refs.assignFormRef.validate(async v => {
if(this.isLevel){
this.$refs.assignFormRef.validate(async v => {
this.processForm=this.$refs.basMes.form
this.processForm.keyContent = JSON.stringify(this.$refs.basMes.tags)
this.processForm.prcName=this.processForm.name
// this.processForm.labelList= JSON.stringify(this.processForm.labelList)
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()
}
} else {
this.$message.warning('请检查表单填写完整')
}
})
}else{
this.processForm=this.$refs.basMes.form
this.processForm.keyContent = JSON.stringify(this.$refs.basMes.tags)
this.processForm.prcName=this.processForm.name
// this.processForm.labelList= JSON.stringify(this.processForm.labelList)
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()
}
} else {
if(z){
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'
}
})
})
}else{
this.$message.warning('请检查表单填写完整')
}
})
}
},
startProcess() {
//把表单都整合到form中