Merge pull request 'fix : 项目归档附件查询功能优化' (#276) from dj into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/276
This commit is contained in:
2024-06-02 15:17:16 +00:00
6 changed files with 89 additions and 85 deletions

View File

@@ -91,11 +91,10 @@ export const addLedger = (data) => {
});
};
export const getTags = (params) => {
export const getTags = (projectId) => {
return request({
url: '/workflow/mosr/project/implementation/option',
method: "get",
params:params
url: `/workflow/mosr/attachment/option/${projectId}`,
method: "get"
});
};
//项目归档

View File

@@ -1,34 +1,15 @@
<template>
<div v-loading="loading">
<el-form :model="formData" ref="form" class="query-form" label-width="auto">
<el-row>
<el-col :span="24">
<el-form-item>
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item>
<el-table :data="detailList" style="width: 100%">
<el-table-column prop="projectId" label="项目名称" width="180"/>
<el-table-column prop="researchPersonnel" label="研发人员" width="180"/>
<el-table-column prop="wagesPayable" label="应发工资"/>
<el-table-column prop="performance" label="绩效"/>
<el-table-column prop="reserveFund" label="公积金"/>
<el-table-column prop="socialSecurity" label="社保"/>
<el-table-column prop="annuity" label="年金"/>
<el-table-column prop="workday" label="工作日(天)"/>
<el-table-column prop="researchDuration" label="研发时长(天)"/>
</el-table>
</el-form-item>
</el-col>
</el-row>
</el-form>
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig" :data="detailList" style="width: 100%">
<template #empty>
<el-empty description="暂无数据"/>
</template>
</fvTable>
</div>
</template>
<script setup lang="jsx">
const searchConfig = reactive([
{
label: '项目名称',
@@ -63,16 +44,57 @@ const searchConfig = reactive([
colProps: {}
},
])
const tableConfig = reactive({
columns: [
{
prop: 'projectName',
label: '项目名称',
align: 'center'
},
{
prop: 'researchPersonnel',
label: '研发人员',
align: 'center'
},
{
prop: 'wagesPayable',
label: '应发工资',
align: 'center'
},
{
prop: 'performance',
label: '绩效',
align: 'center'
},
{
prop: 'reserveFund',
label: '公积金',
align: 'center'
},
{
prop: 'socialSecurity',
label: '社保',
align: 'center'
},
{
prop: 'annuity',
label: '年金',
align: 'center'
},
{
prop: 'workday',
label: '工作日(天)',
align: 'center'
},
{
prop: 'researchDuration',
label: '研发时长(天)',
align: 'center'
},
]
})
const tableIns = ref()
const props = defineProps({
formData: {
type: Array,
default: []
},
data: {
type: Array,
default: []
},
detailList: {
type: Array,
default: []

View File

@@ -1,9 +1,9 @@
<template>
<el-form :model="attachment" inline>
<el-form-item label="关键词" prop="name">
<el-input v-model="attachment.name" placeholder="请输入" clearable filterable style="width: 300px"/>
<el-form-item label="名称" prop="fileName">
<el-input v-model="attachment.fileName" placeholder="请输入附件名称查询" clearable filterable style="width: 300px"/>
</el-form-item>
<el-form-item label="标签" prop="tag" v-if="type==='3'">
<el-form-item label="标签" prop="tag" v-if="type==='40'">
<el-select v-model="attachment.tag" placeholder="请选择标签" clearable filterable style="width: 300px">
<el-option
v-for="item in tagsOption"
@@ -35,10 +35,7 @@ import {getTags} from "@/api/project-manage";
const route = useRoute()
const router = useRouter()
const attachment = reactive({
name: '',
tag: ''
})
const attachment = reactive({})
const emit = defineEmits(['search'])
const props = defineProps({
otherFileList: {
@@ -47,7 +44,7 @@ const props = defineProps({
},
type: {
type: String,
default: '0'
default: '00'
},
uploadState:{
type: Boolean,
@@ -68,12 +65,13 @@ const tableConfig = reactive({
align: 'center'
},
{
prop: 'processNodeTag',
label: '内置标签',
align: 'center'
prop: 'size',
label: '文件大小',
align: 'center',
currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
},
{
prop: 'size',
prop: 'createTime',
label: '上传时间',
align: 'center',
},
@@ -95,11 +93,7 @@ const tableConfig = reactive({
const showTable = ref(true)
const getTagsOption = () => {
if (!route.query.id) return
let params = {
projectId: route.query.id
}
getTags(params).then(res => {
getTags(route.query.id).then(res => {
if (res.code === 1000) {
tagsOption.value = res.data
} else {
@@ -127,11 +121,7 @@ const handleDownload = (row) => {
})
}
watch(() => props.type, (val) => {
console.log('va四川省l', val)
props.type = val
if (val === '3') {
getTagsOption()
}
})
watch(() => props.otherFileList, (val) => {
showTable.value = false
@@ -140,12 +130,9 @@ watch(() => props.otherFileList, (val) => {
})
props.otherFileList = val
})
if (props.type === '3') {
if (props.type === '40') {
getTagsOption()
}
defineExpose({
tagsOption
})
</script>
<style scoped>

View File

@@ -15,8 +15,7 @@
</el-form>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="分摊明细" name="first">
<expense-detail :formData="shareData.formData" :data="shareData"
:processViewer="shareProcessViewer" :detailList="detailList"
<expense-detail :processViewer="shareProcessViewer" :detailList="detailList"
:loading="loading"/>
</el-tab-pane>
<el-tab-pane label="分摊汇总" name="second">
@@ -39,6 +38,8 @@
</template>
<script setup lang="jsx">
import OperationRender from '@/views/workflow/common/OperationRender.vue'
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'
import {ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js';
import {getAllocationDetail, getAllocationDetailList} from "@/api/expense-manage";

View File

@@ -1,11 +1,11 @@
<template>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="需求征集" name="00">
<search-files-by-tag v-if="showTable" @search="searchRequirement" @upload="upload"
<search-files-by-tag @search="searchRequirement" @upload="upload"
:otherFileList="otherFileList" :uploadState="uploadState"/>
</el-tab-pane>
<el-tab-pane label="需求上报" name="10">
<search-files-by-tag v-if="showTable" @search="searchReport" @upload="upload"
<search-files-by-tag @search="searchReport" @upload="upload"
:otherFileList="otherFileList" :uploadState="uploadState"/>
</el-tab-pane>
<el-tab-pane label="项目立项" name="20">
@@ -13,7 +13,7 @@
:otherFileList="otherFileList" :uploadState="uploadState"/>
</el-tab-pane>
<el-tab-pane label="项目实施" name="40">
<search-files-by-tag type="3" @search="searchImplementation" @upload="upload" ref="implementation"
<search-files-by-tag type="40" @search="searchImplementation" @upload="upload" ref="implementation"
:otherFileList="otherFileList" :uploadState="uploadState"/>
</el-tab-pane>
<el-tab-pane label="项目归档" name="50">
@@ -29,20 +29,18 @@ import {ElNotification} from "element-plus";
const route = useRoute()
const router = useRouter()
const activeName = ref('4')
const activeName = ref('50')
const attachment = ref({})
const showTable = ref(true)
const implementation = ref()
const uploadState = ref(true)
const otherFileList = ref([])
const projectId = ref(route.query.id)
const requirementId = ref(route.query.requirementId)
const handleClick = (tab) => {
let name = {}
switchSearch(name, tab.props.name)
switchSearch(tab.props.name)
}
const switchSearch = (name, index) => {
const switchSearch = (index) => {
switch (index) {
case '00':
searchRequirement({})
@@ -88,6 +86,7 @@ const searchInitiation = async (param) => {
const searchImplementation = async (param) => {
param.targetState = '40'
param.targetId = projectId.value
console.log('param',param)
searchFileList(param).then(res => {
changeFileList(res)
})
@@ -102,13 +101,9 @@ const searchFiling = async (param) => {
const changeFileList = (res) => {
showTable.value = false
if (res.code === 1000) {
otherFileList.value = res.data.fileList
uploadState.value = res.data.upload
nextTick(() => {
showTable.value = true
})
} else {
ElNotification({
title: '提示',
@@ -120,19 +115,19 @@ const changeFileList = (res) => {
onMounted(() => {
if (activeName.value === '4') {
if (activeName.value === '50') {
searchFiling({})
}
})
const upload = () => {
if (activeName.value === '3') {
if (activeName.value === '40') {
router.push({
name: 'Implementation/upload',
query: {
id: route.query.id,
type: '3'
type: '40'
}
})
} else {
@@ -146,15 +141,15 @@ const upload = () => {
}
const switchUpload = (index) => {
switch (index) {
case '0':
case '00':
return 'Requirement/upload';
case '1':
case '10':
return 'Summary/upload';
case '2':
case '20':
return 'Initiation/upload';
case '3':
case '40':
return 'Implementation/upload';
case '4':
case '50':
return 'Filing/upload';
}
}

View File

@@ -161,7 +161,7 @@ const handleSubmit = async (instance) => {
})
if (res.code === 1000) {
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
if(route.query.type=='3'){
if(route.query.type==='40'){
await router.push({
name: 'Filing/attachment',
query:{