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
|
||||
|
||||
@@ -3,25 +3,54 @@
|
||||
<el-col :span="24">
|
||||
<baseTitle :title="'项目附件'"></baseTitle>
|
||||
</el-col>
|
||||
<el-form :model="attachmentParam" inline style="margin-left: 15px">
|
||||
<el-form-item label="标签" prop="tag">
|
||||
<el-select v-model="attachmentParam.tag" placeholder="请选择标签" clearable filterable style="width: 300px">
|
||||
<el-option
|
||||
v-for="item in tagsOption"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch" color="#DED0B2">搜索</el-button>
|
||||
<el-button v-if="uploadState&&isLineBtn" color="#DED0B2" @click="handleUpload">上传附件</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-col v-if="!isLineBtn" :span="24" style="margin-bottom: 8px;margin-left: 15px">
|
||||
<!-- <div class="file-tag">-->
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-left: 15px;margin-top: -10px">
|
||||
<el-tab-pane v-for="item in tagsOption"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:name="item.value">
|
||||
<div class="tag-title">
|
||||
<div></div>
|
||||
{{item.label}}
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="plus">
|
||||
<template #label>
|
||||
<div style="margin-top: 4px;">
|
||||
<el-icon color="#BEA266">
|
||||
<Plus/>
|
||||
</el-icon>
|
||||
</div>
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<!-- </div>-->
|
||||
<!-- <el-form :model="attachmentParam" inline style="margin-left: 15px">-->
|
||||
<!-- <el-form-item label="标签" prop="tag">-->
|
||||
<!-- <el-select v-model="attachmentParam.tag" placeholder="请选择标签" clearable filterable style="width: 300px">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in tagsOption"-->
|
||||
<!-- :key="item.value"-->
|
||||
<!-- :label="item.label"-->
|
||||
<!-- :value="item.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item>-->
|
||||
<!-- <el-button @click="handleSearch" color="#DED0B2">搜索</el-button>-->
|
||||
<!-- <el-button v-if="uploadState&&isLineBtn" color="#DED0B2" @click="handleUpload">上传附件</el-button>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
</el-row>
|
||||
<el-row style="margin-top:-15px;margin-bottom: 8px;margin-left: 15px">
|
||||
<el-col v-if="!isLineBtn" :span="2" style="margin-right: -10px">
|
||||
<el-button v-if="uploadState" color="#DED0B2" @click="handleUpload">上传附件</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2" >
|
||||
<el-button color="#DED0B2" @click="handleEditTag">编辑</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<fvTable style="width: 100%;min-height:311px;max-height: 311px" v-if="showAttachmentTable" height="311"
|
||||
:tableConfig="executeTableConfig" class="execute-apply-table"
|
||||
:data="otherAttachmentList" :isSettingCol="false" :pagination="false">
|
||||
@@ -29,8 +58,8 @@
|
||||
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
|
||||
</template>
|
||||
</fvTable>
|
||||
</el-row>
|
||||
<file-preview ref="filePreviewRef" :fullscreen="false" v-if="filePreviewShow" :fileName="filePreviewParam.fileName" :fileUrl="filePreviewParam.fileUrl"
|
||||
<file-preview ref="filePreviewRef" :fullscreen="false" v-if="filePreviewShow" :fileName="filePreviewParam.fileName"
|
||||
:fileUrl="filePreviewParam.fileUrl"
|
||||
:fileType="filePreviewParam.fileType"/>
|
||||
</template>
|
||||
|
||||
@@ -47,6 +76,7 @@ const attachmentParam = reactive({
|
||||
const uploadState = ref(false)
|
||||
const tagsOption = ref([])
|
||||
const showAttachmentTable = ref(true)
|
||||
const activeName = ref('测试2')
|
||||
|
||||
const props = defineProps({
|
||||
fileNameTableWidth: {
|
||||
@@ -109,14 +139,14 @@ const filePreviewParam = ref({
|
||||
fileType: 'pdf'
|
||||
})
|
||||
const filePreviewShow = ref(false)
|
||||
const clickToPreview=(row)=>{
|
||||
const clickToPreview = (row) => {
|
||||
filePreviewShow.value = false
|
||||
filePreviewParam.value = {
|
||||
fileUrl: row.url,
|
||||
fileName: row.originalFileName,
|
||||
fileType: row.fileType
|
||||
}
|
||||
nextTick(()=>{
|
||||
nextTick(() => {
|
||||
filePreviewShow.value = true
|
||||
})
|
||||
}
|
||||
@@ -158,6 +188,7 @@ const getTagsOption = () => {
|
||||
getTags(route.query.projectId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
tagsOption.value = res.data
|
||||
activeName.value=res.data[0].value
|
||||
} else {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
@@ -180,7 +211,7 @@ const handleUpload = () => {
|
||||
}
|
||||
handleSearch()
|
||||
getTagsOption()
|
||||
onActivated(()=>{
|
||||
onActivated(() => {
|
||||
handleSearch()
|
||||
getTagsOption()
|
||||
})
|
||||
@@ -217,8 +248,44 @@ onActivated(()=>{
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
<style scoped lang="scss">
|
||||
.tag-title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 10px 0;
|
||||
margin-top: 15px;
|
||||
>div{
|
||||
margin-right: 5px;
|
||||
width: 4px;
|
||||
height: 20px;
|
||||
background-color: #BEA266;
|
||||
}
|
||||
}
|
||||
:deep(.el-table--fit ) {
|
||||
height: 311px !important;
|
||||
}
|
||||
:deep(.el-tabs__nav){
|
||||
width: 1308px;
|
||||
}
|
||||
:deep(.el-tabs__item){
|
||||
flex: none!important;
|
||||
}
|
||||
:deep(.el-tabs__header) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__item.is-active) {
|
||||
color: #BEA266;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__active-bar) {
|
||||
background-color: #BEA266;
|
||||
}
|
||||
|
||||
.file-tag {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
border-bottom: 2px solid #f6f6f6;
|
||||
/*align-items: center;*/
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -56,7 +56,6 @@ const props = defineProps({
|
||||
plugins: {
|
||||
type: [String, Array],
|
||||
default:
|
||||
//
|
||||
"preview searchreplace autolink directionality visualblocks visualchars fullscreen image axupimgs link media template code codesample table pagebreak nonbreaking anchor insertdatetime advlist lists wordcount autosave",
|
||||
},
|
||||
toolbar: {
|
||||
|
||||
@@ -279,7 +279,7 @@ const schema = computed(() => {
|
||||
)
|
||||
},
|
||||
{
|
||||
label: '经费预算(元)',
|
||||
label: '预估经费预算',
|
||||
prop: 'economicEstimate',
|
||||
colProps: {
|
||||
span: 6
|
||||
@@ -334,7 +334,7 @@ const schema = computed(() => {
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '申请总部专项资金(元)',
|
||||
label: '预估专项资金(元)',
|
||||
prop: 'specialFundAmount',
|
||||
colProps: {
|
||||
span: 6
|
||||
|
||||
Reference in New Issue
Block a user