fix : 修复项目详情排版,组织机构管理排版

This commit is contained in:
2024-07-15 19:12:30 +08:00
parent f6dcb6b71b
commit 6ac1dba2b5
7 changed files with 295 additions and 122 deletions

View File

@@ -1,5 +1,6 @@
<template>
<div v-loading="loading">
<baseTitle :title="getTagName(type)+getTitleInfo(data.taskId)" ></baseTitle>
<fvForm :schema="schema" @getInstance="(e)=>form = e"></fvForm>
<el-form :model="formData" label-width="auto" style="margin-top: -15px">
<file-component :title="getTagName(type)+'附件'" :tag="getTagName(type)"
@@ -266,13 +267,20 @@ const _value = computed({
emit("update:value", val);
}
})
const getTitleInfo=(taskId)=>{
if(taskId){
return '审批'
}else {
return '信息'
}
}
const getTagName = (type) => {
switch (type) {
case 'approval':
return '项目立项'
case 'execute':
return '项目实施'
return '项目验收'
case 'archivist':
return '项目归档'
case 'phase':

View File

@@ -1,6 +1,34 @@
<template>
<div class="apply-block">
<el-form :model="localFormData" ref="formRef" label-width="auto" v-if="step!=='50'">
<el-row>
<el-col :span="24" v-if="title==='check'">
<baseTitle :title="'附件信息'"></baseTitle>
</el-col>
<el-form :model="attachmentParam" inline style="margin-top: 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" color="#DED0B2" @click="handleUpload">上传附件</el-button>
</el-form-item>
</el-form>
<fvTable style="width: 100%;max-height: 162px" v-if="showAttachmentTable" height="162" :tableConfig="tableConfig"
:data="otherAttachmentList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="55" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-row>
<baseTitle :title="getTitleName(title)+'信息'"></baseTitle>
<el-form :model="localFormData" ref="formRef" label-width="auto" v-if="step!=='50'">
<el-row>
<el-col :span="24" v-if="title==='apply'">
<el-form-item label="项目负责人" :required="true" prop="projectChargePerson"
@@ -30,6 +58,7 @@
v-model:value="projectPersonUserList" @ok="projectPersonUserPickerOk"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="前置流程" :required="preProcessRequired" prop="preProcess" label-width="125">
<el-button color="#DED0B2" @click="handleShowPreTable" style="margin-right: 10px">
@@ -115,6 +144,7 @@
import OperationRender from '@/views/workflow/common/OperationRender.vue'
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {ElNotification} from "element-plus";
import {getTags} from "@/api/project-manage";
import {
getApplyProcess,
getPreProcess,
@@ -132,6 +162,7 @@ import {useTagsView} from '@/stores/tagsview.js'
import Paging from "@/components/pagination/index.vue";
import UserPicker from "@/views/workflow/process/common/UserPicker.vue";
import {searchImplementationFileList} from "@/api/project-manage/attachment";
const router = useRouter()
const route = useRoute()
const changeDiagram = ref(false)
@@ -142,6 +173,53 @@ const projectChargePersonUserPicker = ref()
const projectPersonUserList = ref([])
const projectPersonUserPicker = ref()
const singleList = ref([])
const tagsOption = ref([])
const uploadState = ref(false)
const showAttachmentTable = ref(true)
const otherAttachmentList = ref([])
const attachmentParam = reactive({
tag: ''
})
const tableConfig = reactive({
columns: [
{
prop: 'index',
type: 'index',
label: '序号',
align: 'center',
width: '80',
},
{
prop: 'originalFileName',
label: '文件名',
align: 'center',
},
{
prop: 'tag',
label: '标签',
align: 'center'
},
{
prop: 'size',
label: '文件大小',
align: 'center',
currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
},
{
prop: 'oper',
label: '操作',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
return (
<div>
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
</div>
)
}
}
]
})
const emit = defineEmits(["getAttachment", "getOtherFile"])
const props = defineProps({
title: {
@@ -210,6 +288,64 @@ const name = ref(router.currentRoute.value.name)
const deploymentId = ref()
const selectRows = ref([])
const projectId = ref(route.query.projectId)
const getTagsOption = () => {
if (!route.query.projectId) return
getTags(route.query.projectId).then(res => {
if (res.code === 1000) {
tagsOption.value = res.data
}else{
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
}
})
}
const handleSearch = () => {
let params = {
targetId: route.query.projectId,
targetState: "40"
}
if (attachmentParam.tag) {
tagsOption.value.forEach(item => {
if (item.value === attachmentParam.tag) {
attachmentParam.tag = item.label
}
})
params.tag = attachmentParam.tag
}
searchImplementationFileList(params).then(res => {
showAttachmentTable.value = false
if (res.code === 1000) {
otherAttachmentList.value = res.data.fileList
uploadState.value = res.data.upload
nextTick(() => {
showAttachmentTable.value = true
})
}else{
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
}
})
}
handleSearch()
getTagsOption()
const handleUpload = () => {
router.push({
name: 'Implementation/upload',
query: {
id: route.query.requirementId,
state: route.query.state,
projectId:route.query.projectId,
step: '40'
}
})
}
const getProjectChargePersonUser = () => {
console.log('list', projectChargePersonUserList.value)
if (projectChargePersonUserList.value.length !== 0) {
@@ -372,109 +508,109 @@ const getFileParam = (item) => {
}
}
const handleSubmit = async () => {
if (deploymentData.value.deploymentName === '重大项目立项' || deploymentData.value.deploymentName === '重大项目验收') {
if (localFormData.value.preProcess === undefined) {
ElNotification({
title: '提示',
message: '请选择前置流程!',
type: 'error'
})
return;
}
}
if(projectChargePersonUserList.value&&projectChargePersonUserList.value.length===0){
if (deploymentData.value.deploymentName === '重大项目立项' || deploymentData.value.deploymentName === '重大项目验收') {
if (localFormData.value.preProcess === undefined) {
ElNotification({
title: '提示',
message: '请选择项目负责人!',
message: '请选择前置流程!',
type: 'error'
})
return;
}
if(projectPersonUserList.value&&projectPersonUserList.value.length===0){
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))
})
}
if (attachment.value.singleFile == null) {
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,
preProcess: JSON.stringify(localFormData.value.preProcess)
}
console.log(params)
let res
if (props.step === '20') {
params.projectChargePerson = parseInt(projectChargePersonUserList.value[0].id)
params.projectPersonIds = projectPersonIds
if (props.mode === 'resubmit') {
res = await resubmitApply(params)
} else {
res = await projectApply(params)
}
} else if (props.step === '40') {
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)
}
}
}
if (projectChargePersonUserList.value && projectChargePersonUserList.value.length === 0) {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
message: '请选择项目负责人!',
type: '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'
})
}
return;
}
if (projectPersonUserList.value && projectPersonUserList.value.length === 0) {
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))
})
}
if (attachment.value.singleFile == null) {
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,
preProcess: JSON.stringify(localFormData.value.preProcess)
}
console.log(params)
let res
if (props.step === '20') {
params.projectChargePerson = parseInt(projectChargePersonUserList.value[0].id)
params.projectPersonIds = projectPersonIds
if (props.mode === 'resubmit') {
res = await resubmitApply(params)
} else {
res = await projectApply(params)
}
} else if (props.step === '40') {
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

View File

@@ -1,5 +1,6 @@
<template>
<div class="detail-block" v-loading="loading">
<baseTitle title="需求上报信息"></baseTitle>
<el-form :model="localFormData" ref="summaryForm" :rules="rules">
<el-row gutter="50">
<el-col :span="8">
@@ -32,11 +33,11 @@
<span>{{ filterDict(cacheStore.getDict('invest_type'), localFormData.investmentType) }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目影响" prop="projectImpact">
<span>{{ filterDict(cacheStore.getDict('project_impact'), localFormData.projectImpact) }}</span>
</el-form-item>
</el-col>
<!-- <el-col :span="8">-->
<!-- <el-form-item label="项目影响" prop="projectImpact">-->
<!-- <span>{{ filterDict(cacheStore.getDict('project_impact'), localFormData.projectImpact) }}</span>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="8">
<el-form-item label="所属业务板块" prop="businessSegment">
<span>{{ filterDict(cacheStore.getDict('business_segment'), localFormData.businessSegment) }}</span>
@@ -61,8 +62,8 @@
}}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="专项资金名称" prop="specialFund" v-if="localFormData.isSpecialFund">
<el-col :span="8" v-if="localFormData.isSpecialFund">
<el-form-item label="专项资金名称" prop="specialFund">
<span>{{
localFormData.specialFundId === 0 ? localFormData.specialFund : changeName(fundOption, localFormData.specialFundId)
}}</span>
@@ -358,10 +359,10 @@ watchEffect(() => {
getFundOptions()
</script>
<style scoped>
<style scoped lang="scss">
.detail-block {
overflow-x: hidden;
overflow-y: auto;
padding-bottom: 20px;
padding-bottom: 0!important;
}
</style>

View File

@@ -1,4 +1,6 @@
<template>
<baseTitle title="公司详情"></baseTitle>
<fv-Form :schema="companySchema" @getInstance="(e)=>companyForm = e"></fv-Form>
<baseTitle title="部门详情"></baseTitle>
<fv-Form :schema="schema" @getInstance="(e)=>form = e"></fv-Form>
<UserPicker ref="usrPickershipIds" @ok="editshipIds"></UserPicker>
@@ -17,6 +19,7 @@ const props=defineProps({
}
})
const form = ref()
const companyForm = ref()
const usrPickershipIds = ref()
const usrPickerHeadIds = ref()
const usrPickerDeputyIds = ref()
@@ -26,6 +29,20 @@ const departmentalDeputyNames = ref()
const departmentChargeLeadershipIds = ref()
const departmentHeadIds = ref()
const departmentalDeputyIds = ref()
const companySchema = reactive([
{
label: '公司名称:',
prop: 'companyName',
},
{
label: '公司编码:',
prop: 'companyCode'
},
{
label: '创建时间:',
prop: 'createTime'
}
])
const schema = reactive([
{
label: '部门名字:',
@@ -67,6 +84,7 @@ const _value = computed({
const getInfo = async () => {
const { data } = await getInfoById(_value.value)
companyForm.value.setValues(data.company)
const params = {
createTime: data.createTime,
departmentMark: data.departmentMark,

View File

@@ -25,7 +25,6 @@
</div>
<!-- 步骤内容 -->
<div>
<baseTitle title="各流程信息"></baseTitle>
<slot name="content" :localActive="localActive"></slot>
<!-- <template v-for="(item, index) in stepList" :key="item.key">
<component v-if="localActive == index" v-bind="item.props || {}" :is="item.component" />
@@ -84,7 +83,7 @@ const localSteps = ref([
key: 'approve',
},
{
title: '项目实施',
title: '项目验收',
key: 'execute',
},
{

View File

@@ -141,9 +141,9 @@ const stepChange = (data) => {
</script>
<style scoped lang="scss">
.detail-block {
padding-top: 15px;
}
//.detail-block{
// padding-top: 15px;
//}
:deep(.el-tabs__nav-scroll) {
width: 100%;

View File

@@ -2,9 +2,9 @@
<baseTitle title="基础信息"></baseTitle>
<fvForm :schema="schema" @getInstance="(e)=>baseForm = e"></fvForm>
<baseTitle title="项目实施-上传附件"></baseTitle>
<el-form :model="formData" ref="tagForm" label-width="auto" :rules="rules">
<el-form :model="formData" ref="tagForm" label-width="auto" >
<el-form-item label="标签名称" prop="tagName">
<el-input v-model="formData.tagName" placeholder="请输入标签名称" style="width: 300px" v-if="showInput"/>
<el-input v-model="formData.tagName" placeholder="请输入标签名称" style="width: 300px" v-if="showInput" clearable/>
<el-select v-model="formData.tagName" placeholder="请选择标签名称" clearable filterable style="width: 300px" v-else>
<el-option
v-for="item in tagsOption"
@@ -16,16 +16,15 @@
<el-button type="primary" link @click="changeInput">{{ showInput ? '选择' : '输入' }}</el-button>
</el-form-item>
</el-form>
<baseTitle title="其他文件"></baseTitle>
<el-card style="width: 100%;margin: 15px 0">
<file-upload @getFile="getFile" :disabled="!formData.tagName" :title="!formData.tagName?'请先选择/输入标签!':''"/>
<div style="display: flex; align-items: center">
<baseTitle title="其他文件" style="margin-right: 10px"></baseTitle>
<file-upload @getFile="getFile" :disabled="!formData.tagName" :title="!formData.tagName?'请先选择/输入标签!':''"/></div>
<fvTable style="width: 100%;max-height: 162px;" v-if="showTable" height="162" :tableConfig="tableConfig"
:data="fileList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="55" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-card>
<div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(tagForm)">提交</el-button>
</div>
@@ -131,6 +130,15 @@ const name = ref(router.currentRoute.value.name)
const rules = reactive({
tagName: [{required: true, message: '请输入标签名称', trigger: ['blur', 'change']}],
})
onActivated(()=>{
console.log('onActivated')
formData.value.tagName = '';
showTable.value=false
nextTick(()=>{
showTable.value=true
})
fileList.value=[]
})
const handleDelete = (row) => {
deleteFile(row.fileId).then(res => {
ElNotification({
@@ -155,7 +163,7 @@ const handleDownload = (row) => {
}
const getBaseInfo = async () => {
try {
const {code, data} = await getBaseInfoApi(route.query.id)
const {code, data} = await getBaseInfoApi(route.query.projectId)
baseForm.value.setValues(data)
} catch {
}
@@ -167,8 +175,8 @@ const changeInput = () => {
formData.value.tagName = '';
}
const getTagsOption = () => {
if (!route.query.id) return
getTags(route.query.id).then(res => {
if (!route.query.projectId) return
getTags(route.query.projectId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
@@ -219,7 +227,7 @@ const handleSubmit = async (instance) => {
}
let params = {
fileList: fileList.value,
projectId: route.query.id,
projectId: route.query.projectId,
targetState: "40"
}
let res = await uploadFileList(params)
@@ -234,14 +242,17 @@ const handleSubmit = async (instance) => {
await router.push({
name: 'Filing/attachment',
query: {
id: route.query.id
id: route.query.projectId
}
})
} else {
await router.push({
name: 'Implementation/attachment',
name: 'Implementation/detail',
query: {
id: route.query.id
id: route.query.id,
state: route.query.state,
projectId: route.query.projectId,
step: '40'
}
})
}