【新增】流程增加草稿

This commit is contained in:
zhoulingpo
2023-04-27 17:49:00 +08:00
parent 444ee279cf
commit f36fb8b247
8 changed files with 253 additions and 13 deletions
+61 -10
View File
@@ -1,7 +1,7 @@
<template>
<div class="process">
<div class="process_box">
<process-header v-if="$route.query.isBegin" :title="'发起流程'"></process-header>
<process-header v-if="$route.query.isBegin || $route.query.isDraft" :title="'发起流程'"></process-header>
<process-header v-else-if="$route.query.type == 'yiban'" :title="'已办流程'" :proceesNum="prcNum"></process-header>
<process-header v-else :title="'发起人修改'" :proceesNum="prcNum"></process-header>
<div class="procedure">
@@ -87,11 +87,11 @@
<process-footer
v-if="!formControl"
showCancel
:show-reset="isShowReset"
:show-save="isShowSave"
:show-submit="isShowSubmit"
:submitLoading="isSubmit"
:resetLoading="resetLoading"
@reset="handleReset"
:resetLoading="saveLoading"
@save="handleSave"
@submit="handleSubmit"
></process-footer>
<orgTable :visible.sync="visibleOrgTable" title="人员列表" dialog-model :config="{
@@ -130,8 +130,8 @@ export default {
orgTableValName: '',
visibleOrgTable: false,
isSubmit: false,
resetLoading: false,
isShowReset: true,
saveLoading: false,
isShowSave: false,
isShowSubmit: true,
formControl: false,
formControlname: false,
@@ -200,21 +200,38 @@ export default {
// if (this.$route.query.ids.split(',').length > 0) {
// this.reportList(this.$route.query.ids)
// }
this.isShowSave = true
this.$store.commit('setHandleProcess','')
this.handleReset()
}
// 如果是从草稿进入的
if (this.$route.query.isDraft) {
this.isShowSave = true
this.taskId = this.$store.getters.handleProcess?.taskId
this.prcNum = this.$store.getters.handleProcess?.prcNum
this.prcId = this.$store.getters.handleProcess?.prcId
this.prcName = this.$store.getters.handleProcess?.prcName
this.getDraftDetail().then(res => {
let tableData = JSON.parse(this.processOld.dataJson)
this.processForm.prcName = this.prcName
this.applicationForm.power = tableData[0].power
this.applicationForm.applyReason = tableData[0].applyReason
if(tableData[0].reportId){
this.tableData=tableData
}
debugger
if(this.processOld.submitJson !== '{}'){
this.assignForm =JSON.parse(this.processOld.submitJson)
}
})
}
if (this.$store.getters.handleProcess.taskDefinitionKey == 'aid4' ) {
if (this.$route.query.taskDefinitionKey == 'aid4' ) {
this.taskId = this.$store.getters.handleProcess.taskId
this.prcNum = this.$store.getters.handleProcess.prcNum
this.prcId = this.$store.getters.handleProcess.prcId
this.prcName = this.$store.getters.handleProcess.prcName
this.initShow = true
// this.formControlname = true
this.formControlname = true
this.getProcessDetail().then(res => {
//基础信息
@@ -222,7 +239,6 @@ export default {
this.applicationForm.power = this.tableData[0].power
this.applicationForm.applyReason = this.tableData[0].applyReason
this.processForm.prcName = this.prcName
debugger
//指派信息
({oneApprove:this.assignForm.oneApprove,oneApproveName:this.assignForm.oneApproveName,twoApprove:this.assignForm.twoApprove,twoApproveName:this.assignForm.twoApproveName,remark:this.assignForm.remark}= JSON.parse(this.processOld.submitJson))
})
@@ -327,6 +343,41 @@ export default {
return item
})
},
// 保存
handleSave(){
this.saveLoading = true
if(this.tableData.length > 0){
// 处理表格数据
this.organizeData()
}else{
this.tableData=[{...this.applicationForm}]
}
let submitJson = JSON.stringify({...this.assignForm, userId: this.$store.getters.userInfo.usid,approvalOpinion:this.assignForm.remark})
let dataJson = JSON.stringify(this.tableData)
let params = {
prcName: this.processForm.prcName,
userId: this.$store.getters.userInfo.usid,
prcType: this.prcType,
createUserName: this.$store.getters.userInfo.usname,
createUser: this.$store.getters.userInfo.usid,
submitJson,
dataJson
}
this.saveProcess(params).then(
()=>{
this.saveLoading = false
this.$message['success']('保存成功')
this.$router.push({
path: "/userCenter/processCenter",
query: {
id: 'AEHJB8YNJ3'
}
})
}
).catch(()=>{
this.saveLoading = false
})
},
// 提交
handleSubmit() {
console.log(this.$store.getters.userInfo.usid, " this.$store.getters.userInfo.USID")