fix : 修改打印范围, 详情增加项目实施模块

This commit is contained in:
2024-08-26 20:52:39 +08:00
parent 741187c129
commit 2173cd1cf1
9 changed files with 322 additions and 370 deletions

View File

@@ -1,36 +1,9 @@
<template>
<div v-loading="loading">
<el-row v-if="type==='execute'">
<el-col :span="24">
<baseTitle :title="'附件信息'" style="margin-bottom: 5px"></baseTitle>
</el-col>
<el-form :model="attachmentParam" inline style="margin-top: 15px;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="handleSearchImplementationFileList" color="#DED0B2">搜索</el-button>
</el-form-item>
</el-form>
<fvTable style="width: 100%;min-height:160px;max-height: 160px" v-if="showAttachmentTable" height="160"
:tableConfig="executeTableConfig" class="execute-table"
:data="otherAttachmentList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="55" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-row>
<baseTitle v-if="type!='phase'" :title="getTagName(type)+getTitleInfo(data.taskId)"></baseTitle>
<fvForm :schema="schema" @getInstance="(e)=>form = e" style="margin-left: 15px"></fvForm>
<el-form :model="formData" label-width="auto" style="margin-top: -15px">
<file-component :title="getTagName(type)+'附件'" :tag="getTagName(type)"
<file-component :title="getTagName(type)+'附件'" :tag="getTagName(type)" :isOpenPrint="isOpenPrint"
v-model:value="formData.fileList" :processViewer="processViewer"
:file-list-show="fileListShow"/>
</el-form>
@@ -77,58 +50,6 @@ import {downloadFile} from "@/api/project-demand";
import {searchImplementationFileList} from "@/api/project-manage/attachment";
import {getTags} from "@/api/project-manage";
const attachmentParam = reactive({
tag: ''
})
const tagsOption = ref([])
const uploadState = ref(false)
const showAttachmentTable = ref(true)
const otherAttachmentList = ref([])
const executeTableConfig = reactive({
columns: [
{
prop: 'index',
type: 'index',
label: '序号',
align: 'center',
},
{
prop: 'originalFileName',
label: '文件名',
align: 'center',
// width: 700,
currentRender: ({row, index}) => (
<div style="color: #2a99ff;cursor: pointer;" onClick={() => clickToPreview(row)}>{row.originalFileName}</div>)
},
{
prop: 'tag',
label: '标签',
align: 'center',
// width: 200,
},
{
prop: 'size',
label: '文件大小',
align: 'center',
// width: 450,
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 changeDiagram = ref(false)
const props = defineProps({
formData: {
@@ -164,6 +85,11 @@ const props = defineProps({
type: Boolean,
default: false
},
//是否开始打印
isOpenPrint: {
type: Boolean,
default: false
},
value: {
type: String,
default: ''
@@ -472,50 +398,6 @@ const clickToPreview = (row) => {
filePreviewShow.value = true
})
}
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 handleSearchImplementationFileList = () => {
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'
})
}
})
}
const getTitleInfo = (taskId) => {
if (taskId) {
@@ -551,11 +433,6 @@ watchEffect(() => {
Object.keys(props.formData).length && (form.value?.setValues(props.formData))
})
if (props.formData.mode == 'view' && props.type == 'execute') {
handleSearchImplementationFileList()
getTagsOption()
}
watch(() => props.loading, (newVal) => {
props.loading = newVal
}, {deep: true})

View File

@@ -2,7 +2,8 @@
<el-form :label-position="labelAlign">
<el-form-item :label="title?'其他文件':''" v-if="fileListShow === 'READ' || fileListShow === 'EDIT'" :label-position="labelAlign" :label-width="title?95:''" :style="{marginTop: '10px',marginLeft: tag!=='需求上报'?'15px':'0'}">
<file-upload @getFile="getOtherFile" v-if="fileListShow === 'EDIT'"/>
<fvTable style="width: 100%;max-height: 160px;" v-if="processViewer" height="160" :tableConfig="tableConfig"
<!-- :style="{width:isOpenPrint?'610px': '100%'}" table-layout="auto" id="printTable"-->
<fvTable style="width:100%;max-height: 160px;" v-if="processViewer" height="160" :tableConfig="tableConfig"
:data="_value" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="55" description="暂无数据" style="padding: 0"/>
@@ -52,7 +53,12 @@ const props = defineProps({
fullscreen: {
type: Boolean,
default: false
}
},
//是否开始打印
isOpenPrint: {
type: Boolean,
default: false
},
})
const emit = defineEmits(['update:value'])
const tableConfig = reactive({
@@ -196,5 +202,10 @@ watch(() => props.processViewer, (newVal) => {
:deep(.el-table--fit ) {
height: 160px !important;
}
@media print {
//#printTable{
// width: 400px!important;
//}
}
</style>

View File

@@ -1,40 +1,11 @@
<template>
<div class="apply-block">
<el-row v-if="title==='check'">
<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" color="#DED0B2" @click="handleUpload">上传附件</el-button>
</el-form-item>
</el-form>
<fvTable style="width: 100%;min-height:160px;max-height: 160px" v-if="showAttachmentTable" height="160"
:tableConfig="executeTableConfig" class="execute-apply-table"
: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="6" v-if="title==='apply'">
<!-- label-width="106"-->
<el-form-item label="项目负责人" :required="true" prop="" label-width="111"
>
<el-form-item label="项目负责人" :required="true" prop="" label-width="111">
<el-button style="margin-right: 10px" color="#DED0B2" @click="handleShowProjectChargePersonTable">
{{ projectChargePersonUserList?.length !== 0 ? '更改' : '请选择' }}
</el-button>
@@ -170,7 +141,6 @@
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,
@@ -188,70 +158,16 @@ 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)
const formRef = ref()
const showSingleTable = ref(false)
const projectChargePersonUserList = ref([])
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 executeTableConfig = reactive({
columns: [
{
prop: 'index',
type: 'index',
label: '序号',
align: 'center',
width: '80',
},
{
prop: 'originalFileName',
label: '文件名',
align: 'center',
width: 620,
currentRender: ({row, index}) => (
<div style="color: #2a99ff;cursor: pointer;" onClick={() => clickToPreview(row)}>{row.originalFileName}</div>)
},
{
prop: 'tag',
label: '标签',
align: 'center',
width: 160,
},
{
prop: 'size',
label: '文件大小',
align: 'center',
width: 600,
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: {
@@ -393,61 +309,6 @@ const getRequestName = (list) => {
return list
}
}
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'
})
}
})
}
const handleUpload = () => {
router.push({
name: 'Implementation/upload',
query: {
id: route.query.id,
projectId: route.query.projectId,
state: route.query.state,
step: '40'
}
})
}
const getProjectChargePersonUser = () => {
if (projectChargePersonUserList.value.length !== 0) {
return projectChargePersonUserList.value.map(item => item.name).join()
@@ -720,10 +581,6 @@ const handleSubmit = async () => {
}
}
const init = async () => {
if (props.title && props.title === 'check') {
handleSearch()
getTagsOption()
}
let id = projectId.value
if (!id) return;
processDiagramViewer.value = false

View File

@@ -0,0 +1,158 @@
<template>
<el-row>
<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-form-item>
</el-form>
<el-col :span="24" style="margin-bottom: 8px;margin-left: 15px">
<el-button v-if="uploadState" color="#DED0B2" @click="handleUpload">上传附件</el-button>
</el-col>
<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">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-row>
</template>
<script setup lang="jsx">
import {getTags} from "@/api/project-manage";
import {ElLoading, ElNotification} from "element-plus";
import {searchImplementationFileList} from "@/api/project-manage/attachment";
const router = useRouter()
const route = useRoute()
const attachmentParam = reactive({
tag: ''
})
const uploadState = ref(false)
const tagsOption = ref([])
const showAttachmentTable = ref(true)
const executeTableConfig = reactive({
columns: [
{
prop: 'index',
type: 'index',
label: '序号',
align: 'center',
width: 85,
},
{
prop: 'originalFileName',
label: '文件名',
align: 'center',
currentRender: ({row, index}) => (
<div style="color: #2a99ff;cursor: pointer;" onClick={() => clickToPreview(row)}>{row.originalFileName}</div>)
},
{
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 otherAttachmentList = ref([])
const handleSearch = () => {
const loading = ElLoading.service({fullscreen: true})
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
})
loading.close()
} else {
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
loading.close()
}
})
}
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 handleUpload = () => {
router.push({
name: 'Implementation/upload',
query: {
id: route.query.id,
projectId: route.query.projectId,
state: route.query.state,
step: '30'
}
})
}
handleSearch()
getTagsOption()
</script>
<style scoped>
:deep(.el-table--fit ) {
height: 311px !important;
}
</style>