feat(project-management): 更新项目管理相关页面文案并优化附件功能
This commit is contained in:
@@ -1,8 +1,24 @@
|
||||
<template>
|
||||
<div class="apply-block">
|
||||
<baseTitle :title="getTitleName(title)+'信息'"></baseTitle>
|
||||
<el-form :model="localFormData" ref="formRef" label-width="auto" v-if="step!=='50'">
|
||||
<el-form :model="localFormData" ref="formRef" label-width="auto" v-if="step!=='50'" :rules="rules">
|
||||
<el-row>
|
||||
<el-col :span="6" v-if="title==='apply'">
|
||||
<!-- label-width="106"-->
|
||||
<el-form-item label="实际经费预算" prop="actualEconomicEstimate" label-width="111" >
|
||||
<el-input v-model="localFormData.actualEconomicEstimate" placeholder="请输入实际经费预算">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="6" v-if="title==='apply'">-->
|
||||
<!-- <!– label-width="106"–>-->
|
||||
<!-- <el-form-item label="实际专项资金" prop="budget" label-width="120">-->
|
||||
<!-- <el-input v-model="localFormData.budget" placeholder="请输入实际专项资金">-->
|
||||
<!-- </el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="6" v-if="title==='apply'">
|
||||
<!-- label-width="106"-->
|
||||
<el-form-item label="项目负责人" :required="true" prop="" label-width="111">
|
||||
@@ -17,7 +33,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6" v-if="title==='apply'">
|
||||
<el-form-item label="项目成员" :required="true" prop="" label-width="85"
|
||||
<el-form-item label="项目成员" :required="true" prop="" label-width="120"
|
||||
>
|
||||
<el-button color="#DED0B2" style="margin-right: 10px" @click="handleShowProjectPersonTable">
|
||||
{{ projectPersonUserList?.length !== 0 ? '更改' : getProjectPerson(projectPersonUserList) ? '更改' : '请选择' }}
|
||||
@@ -91,8 +107,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="oper-page-btn">
|
||||
<el-button color="#DED0B2" v-if="mode === 'submit'" @click="handleSubmit">提交</el-button>
|
||||
<el-button color="#DED0B2" v-else-if="mode === 'resubmit'" @click="handleSubmit">重新提交</el-button>
|
||||
<el-button color="#DED0B2" v-if="mode === 'submit'" @click="handleSubmit(formRef)">提交</el-button>
|
||||
<el-button color="#DED0B2" v-else-if="mode === 'resubmit'" @click="handleSubmit(formRef)">重新提交</el-button>
|
||||
<el-button @click="handleBack">返回</el-button>
|
||||
</div>
|
||||
|
||||
@@ -160,6 +176,7 @@ import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const formRef = ref()
|
||||
const changeDiagram = ref(false)
|
||||
const showSingleTable = ref(false)
|
||||
const projectChargePersonUserList = ref([])
|
||||
@@ -211,11 +228,11 @@ const pageInfo = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
})
|
||||
// const rules = reactive({
|
||||
// preProcess: [{required: true, message: '请选择前置流程', trigger: 'blur'}],
|
||||
// projectChargePerson: [{required: true, message: '请选择项目负责人', trigger: 'blur'}],
|
||||
// projectPerson: [{required: true, message: '请选择项目成员', trigger: 'blur'}],
|
||||
// })
|
||||
const rules = reactive({
|
||||
actualEconomicEstimate: [{required: true, message: '请输入实际经费预算', trigger: ['blur','change']}],
|
||||
// projectChargePerson: [{required: true, message: '请选择项目负责人', trigger: 'blur'}],
|
||||
// projectPerson: [{required: true, message: '请选择项目成员', trigger: 'blur'}],
|
||||
})
|
||||
const tagsViewStore = useTagsView()
|
||||
const processStore = useProcessStore()
|
||||
const localProjectPerson = ref([])
|
||||
@@ -489,106 +506,118 @@ const getFileParam = (item) => {
|
||||
tag: item.tag
|
||||
}
|
||||
}
|
||||
const handleSubmit = async () => {
|
||||
let files = []
|
||||
if (props.mode === 'resubmit') {
|
||||
attachment.value.allFileList.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
} else {
|
||||
otherFileList.value.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
}
|
||||
// console.info("🚀 ~method:handleSubmit -----", files,attachment.value.isHaveOneFile)
|
||||
if (!attachment.value.isHaveOneFile) {
|
||||
attachment.value.validate()
|
||||
const handleSubmit = async (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请完善数据,再提交!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
let files = []
|
||||
if (props.mode === 'resubmit') {
|
||||
attachment.value.allFileList.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
} else {
|
||||
otherFileList.value.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
}
|
||||
// console.info("🚀 ~method:handleSubmit -----", files,attachment.value.isHaveOneFile)
|
||||
if (!attachment.value.isHaveOneFile) {
|
||||
attachment.value.validate()
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请上传附件',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
} else {
|
||||
attachment.value.clearValidate()
|
||||
}
|
||||
let projectPersonIds = []
|
||||
for (const item of projectPersonUserList.value) {
|
||||
projectPersonIds.push(parseInt(item.id))
|
||||
}
|
||||
let params = {
|
||||
deploymentId: deploymentId.value,
|
||||
requirementId: route.query.id,
|
||||
fileList: files,
|
||||
// singleFile: attachment.value.singleFile,
|
||||
projectId: projectId.value,
|
||||
actualEconomicEstimate: localFormData.value.actualEconomicEstimate,
|
||||
preProcess: JSON.stringify(localFormData.value.preProcess)
|
||||
}
|
||||
if (sessionParams.value.preProcess && !localFormData.value.preProcess) {
|
||||
params.preProcess = JSON.stringify(sessionParams.value.preProcess)
|
||||
}
|
||||
console.log('params',params)
|
||||
let res
|
||||
if (props.step === '20') {
|
||||
if (projectChargePersonUserList.value && projectChargePersonUserList.value.length === 0) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请选择项目负责人!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (projectPersonUserList.value && projectPersonUserList.value.length === 0) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请选择项目成员!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
params.projectChargePerson = parseInt(projectChargePersonUserList.value[0].id)
|
||||
params.projectPersonIds = projectPersonIds
|
||||
params.optionalChargeLeadership = optionalChargeLeadershipList.value
|
||||
if (props.mode === 'resubmit') {
|
||||
res = await resubmitApply(params)
|
||||
} else {
|
||||
res = await projectApply(params)
|
||||
}
|
||||
} else if (props.step === '40') {
|
||||
params.optionalChargeLeadership = optionalChargeLeadershipList.value
|
||||
if (props.mode === 'resubmit') {
|
||||
res = await resubmitCheck(params)
|
||||
} else {
|
||||
res = await projectCheck(params)
|
||||
}
|
||||
} else if (props.step === '50') {
|
||||
if (props.mode === 'resubmit') {
|
||||
res = await resubmitConclusion(params)
|
||||
} else {
|
||||
res = await projectConclusion(params)
|
||||
}
|
||||
}
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请上传附件',
|
||||
type: 'error'
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
return;
|
||||
} else {
|
||||
attachment.value.clearValidate()
|
||||
}
|
||||
let projectPersonIds = []
|
||||
for (const item of projectPersonUserList.value) {
|
||||
projectPersonIds.push(parseInt(item.id))
|
||||
}
|
||||
let params = {
|
||||
deploymentId: deploymentId.value,
|
||||
requirementId: route.query.id,
|
||||
fileList: files,
|
||||
// singleFile: attachment.value.singleFile,
|
||||
projectId: projectId.value,
|
||||
preProcess: JSON.stringify(localFormData.value.preProcess)
|
||||
}
|
||||
if (sessionParams.value.preProcess && !localFormData.value.preProcess) {
|
||||
params.preProcess = JSON.stringify(sessionParams.value.preProcess)
|
||||
}
|
||||
// console.log(params.preProcess)
|
||||
let res
|
||||
if (props.step === '20') {
|
||||
if (projectChargePersonUserList.value && projectChargePersonUserList.value.length === 0) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请选择项目负责人!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
if (res.code === 1000) {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
if (props.step === '20') {
|
||||
await router.push({
|
||||
name: 'Initiation'
|
||||
})
|
||||
} else if (props.step === '40') {
|
||||
await router.push({
|
||||
name: 'Implementation'
|
||||
})
|
||||
} else if (props.step === '50') {
|
||||
await router.push({
|
||||
name: 'Filing'
|
||||
})
|
||||
}
|
||||
}
|
||||
if (projectPersonUserList.value && projectPersonUserList.value.length === 0) {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: '请选择项目成员!',
|
||||
type: 'error'
|
||||
})
|
||||
return;
|
||||
}
|
||||
params.projectChargePerson = parseInt(projectChargePersonUserList.value[0].id)
|
||||
params.projectPersonIds = projectPersonIds
|
||||
params.optionalChargeLeadership = optionalChargeLeadershipList.value
|
||||
if (props.mode === 'resubmit') {
|
||||
res = await resubmitApply(params)
|
||||
} else {
|
||||
res = await projectApply(params)
|
||||
}
|
||||
} else if (props.step === '40') {
|
||||
params.optionalChargeLeadership = optionalChargeLeadershipList.value
|
||||
if (props.mode === 'resubmit') {
|
||||
res = await resubmitCheck(params)
|
||||
} else {
|
||||
res = await projectCheck(params)
|
||||
}
|
||||
} else if (props.step === '50') {
|
||||
if (props.mode === 'resubmit') {
|
||||
res = await resubmitConclusion(params)
|
||||
} else {
|
||||
res = await projectConclusion(params)
|
||||
}
|
||||
}
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
if (props.step === '20') {
|
||||
await router.push({
|
||||
name: 'Initiation'
|
||||
})
|
||||
} else if (props.step === '40') {
|
||||
await router.push({
|
||||
name: 'Implementation'
|
||||
})
|
||||
} else if (props.step === '50') {
|
||||
await router.push({
|
||||
name: 'Filing'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
const init = async () => {
|
||||
let id = projectId.value
|
||||
|
||||
Reference in New Issue
Block a user