fix : 修复项目实施附件查询及上传功能、代码文件优化
This commit is contained in:
@@ -132,27 +132,14 @@ const upload = () => {
|
||||
})
|
||||
} else {
|
||||
router.push({
|
||||
name: switchUpload(activeName.value),
|
||||
name: 'Filing/upload',
|
||||
query: {
|
||||
id: route.query.id
|
||||
id: route.query.id,
|
||||
name: activeName.value
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const switchUpload = (index) => {
|
||||
switch (index) {
|
||||
case '00':
|
||||
return 'Requirement/upload';
|
||||
case '10':
|
||||
return 'Summary/upload';
|
||||
case '20':
|
||||
return 'Initiation/upload';
|
||||
case '40':
|
||||
return 'Implementation/upload';
|
||||
case '50':
|
||||
return 'Filing/upload';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -1,214 +0,0 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="需求征集" name="0">
|
||||
<search-files-by-tag @search="searchRequirement" @upload="upload"
|
||||
:otherFileList="otherFileList"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="需求上报" name="1">
|
||||
<search-files-by-tag @search="searchReport" @upload="upload"
|
||||
:otherFileList="otherFileList"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="项目立项" name="2">
|
||||
<search-files-by-tag @search="searchInitiation" @upload="upload"
|
||||
:otherFileList="otherFileList"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="项目实施" name="3">
|
||||
<search-files-by-tag type="3" @search="searchImplementation" @upload="upload" ref="implementation"
|
||||
:otherFileList="otherFileList"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="项目归档" name="4">
|
||||
<search-files-by-tag @search="searchFiling" @upload="upload"
|
||||
:otherFileList="otherFileList"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import {ElNotification} from "element-plus";
|
||||
import {getImplementationAttachment} from "@/api/project-manage";
|
||||
import {getRequirementAttachment} from "@/api/project-demand";
|
||||
import {getCollectAttachment} from "@/views/project-demand/summary/api";
|
||||
import {getFilingAttachment, getInitiationAttachment} from "@/api/project-manage";
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const activeName = ref('4')
|
||||
const attachment = ref({})
|
||||
const showTable = ref(true)
|
||||
const implementation = ref()
|
||||
const otherFileList = ref([])
|
||||
const handleClick = (tab) => {
|
||||
let name = {}
|
||||
switchSearch(name, tab.index)
|
||||
}
|
||||
const getParams = (param, type) => {
|
||||
let targetId
|
||||
let params
|
||||
if (type === 1) {
|
||||
targetId = route.query.requirementId
|
||||
params = {
|
||||
targetId: targetId,
|
||||
...param
|
||||
}
|
||||
} else if (type === 2){
|
||||
targetId = route.query.id
|
||||
if(JSON.stringify(param) !== '{}'){
|
||||
if (param.tag &&!param.name) {
|
||||
implementation.value.tagsOption?.forEach(item => {
|
||||
if (item.value === param.tag) {
|
||||
param.tag = item.label
|
||||
}
|
||||
})
|
||||
params = {
|
||||
targetId: targetId,
|
||||
tag:param.tag
|
||||
}
|
||||
}else if(!param.tag &¶m.name){
|
||||
params = {
|
||||
targetId: targetId,
|
||||
...param
|
||||
}
|
||||
} else if (!param.tag &&!param.name) {
|
||||
params = {
|
||||
targetId: targetId,
|
||||
}
|
||||
}
|
||||
}else {
|
||||
params = {
|
||||
targetId: targetId
|
||||
}
|
||||
}
|
||||
}else {
|
||||
targetId = route.query.id
|
||||
params = {
|
||||
targetId: targetId,
|
||||
...param
|
||||
}
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
const searchRequirement = async (param) => {
|
||||
await search(param)
|
||||
}
|
||||
const search = async (param, type) => {
|
||||
const res = await getRequirementAttachment(getParams(param, type))
|
||||
changeFileList(res)
|
||||
}
|
||||
const searchReport = async (param) => {
|
||||
const res = await getCollectAttachment(getParams(param))
|
||||
changeFileList(res)
|
||||
}
|
||||
const searchInitiation = async (param) => {
|
||||
const res = await getInitiationAttachment(getParams(param))
|
||||
changeFileList(res)
|
||||
}
|
||||
const searchImplementation = async (param) => {
|
||||
const res = await getImplementationAttachment(getParams(param,2))
|
||||
changeFileList(res)
|
||||
}
|
||||
const searchFiling = async (param) => {
|
||||
const res = await getFilingAttachment(getParams(param))
|
||||
changeFileList(res)
|
||||
}
|
||||
const changeFileList = (res) => {
|
||||
showTable.value = false
|
||||
if (res.code === 1000) {
|
||||
otherFileList.value = res.data
|
||||
nextTick(() => {
|
||||
showTable.value = true
|
||||
})
|
||||
} else {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
}
|
||||
const upload = () => {
|
||||
if(activeName.value==='3'){
|
||||
router.push({
|
||||
name: 'Implementation/upload',
|
||||
query: {
|
||||
id: route.query.id,
|
||||
type:'3'
|
||||
}
|
||||
})
|
||||
}else {
|
||||
router.push({
|
||||
name: switchUpload(activeName.value),
|
||||
query: {
|
||||
id: route.query.id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const switchUpload=(index)=>{
|
||||
switch (index) {
|
||||
case '0':
|
||||
return 'Requirement/upload';
|
||||
case '1':
|
||||
return 'Summary/upload';
|
||||
case '2':
|
||||
return 'Initiation/upload';
|
||||
case '3':
|
||||
return 'Implementation/upload';
|
||||
case '4':
|
||||
return 'Filing/upload';
|
||||
}
|
||||
}
|
||||
const switchSearch = (name, index) => {
|
||||
switch (index) {
|
||||
case '0':
|
||||
search(name, 1)
|
||||
break
|
||||
case '1':
|
||||
searchReport(name)
|
||||
break
|
||||
case '2':
|
||||
searchInitiation(name)
|
||||
break
|
||||
case '3':
|
||||
searchImplementation(name)
|
||||
break
|
||||
case '4':
|
||||
searchFiling(name)
|
||||
break
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
if (activeName.value === '4') {
|
||||
let name = {
|
||||
name: ''
|
||||
}
|
||||
searchFiling(name)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
:deep(.el-tabs__header) {
|
||||
margin: 15px 0 30px 0;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__nav-scroll) {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
.el-tabs__nav {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
|
||||
.el-tabs__item {
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.is-active {
|
||||
color: black;
|
||||
//background-color: #DED0B2;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,94 +0,0 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="需求征集" name="00">
|
||||
<search-files-by-tag @search="searchRequirement" @upload="upload"
|
||||
:otherFileList="otherFileList"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="需求上报" name="10">
|
||||
<search-files-by-tag @search="searchReport" @upload="upload"
|
||||
:otherFileList="otherFileList"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="项目立项" name="20">
|
||||
<search-files-by-tag @search="searchInitiation" @upload="upload"
|
||||
:otherFileList="otherFileList"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="项目实施" name="40">
|
||||
<search-files-by-tag type="3" @search="searchImplementation" @upload="upload" ref="implementation"
|
||||
:otherFileList="otherFileList"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="项目归档" name="50">
|
||||
<search-files-by-tag @search="searchFiling" @upload="upload"
|
||||
:otherFileList="otherFileList"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import {searchFileList} from "@/api/project-manage/attachment.js";
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const activeName = ref('4')
|
||||
const attachment = ref({})
|
||||
const showTable = ref(true)
|
||||
const implementation = ref()
|
||||
const otherFileList = ref([])
|
||||
const handleClick = (tab) => {
|
||||
let name = {}
|
||||
switchSearch(name, tab.index)
|
||||
}
|
||||
|
||||
const switchSearch = (name, index) => {
|
||||
switch (index) {
|
||||
case '0':
|
||||
search(name, 1)
|
||||
break
|
||||
case '1':
|
||||
searchReport(name)
|
||||
break
|
||||
case '2':
|
||||
searchInitiation(name)
|
||||
break
|
||||
case '3':
|
||||
searchImplementation(name)
|
||||
break
|
||||
case '4':
|
||||
searchFiling(name)
|
||||
break
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
if (activeName.value === '4') {
|
||||
let name = {
|
||||
name: ''
|
||||
}
|
||||
searchFiling(name)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
:deep(.el-tabs__header) {
|
||||
margin: 15px 0 30px 0;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__nav-scroll) {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
.el-tabs__nav {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
|
||||
.el-tabs__item {
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.is-active {
|
||||
color: black;
|
||||
//background-color: #DED0B2;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,112 +0,0 @@
|
||||
<template>
|
||||
<steps :active="4" @setDetail="setDetail" @stepChange="stepChange">
|
||||
<template #content>
|
||||
<collection-detail
|
||||
:formData="commonForm.formData"
|
||||
:data="commonForm"
|
||||
:processViewer="commonProvessViewer"
|
||||
v-show="showActive == '00'"
|
||||
:loading="loading"
|
||||
/>
|
||||
<summary-detail v-show="showActive == '10'" :formData="commonForm.formData" :data="commonForm"
|
||||
:processViewer="commonProvessViewer" :loading="loading" :fileListShow="fileListShow"/>
|
||||
<ApprovalDetail type="approval" v-show="showActive == '20'" :formData="commonForm.formData" :data="commonForm"
|
||||
:processViewer="commonProvessViewer" :loading="loading" :fileListShow="fileListShow"/>
|
||||
<ApprovalDetail type="execute" v-show="showActive == '40'" :formData="commonForm.formData" :data="commonForm"
|
||||
:processViewer="commonProvessViewer" :loading="loading" :fileListShow="fileListShow"/>
|
||||
<ApprovalDetail type="archivist" v-show="showActive == '50'" :formData="commonForm.formData" :data="commonForm"
|
||||
:processViewer="commonProvessViewer" :loading="loading" :fileListShow="fileListShow"/>
|
||||
</template>
|
||||
</steps>
|
||||
<opinion v-if="commonForm.taskId" :formData="commonForm.formData" :taskId="commonForm.taskId"/>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import {useProcessStore} from '@/stores/processStore.js';
|
||||
import CollectionDetail from "@/components/DetailComponent/CollectionDetail.vue";
|
||||
import SummaryDetail from "@/components/DetailComponent/SummaryDetail.vue";
|
||||
import ApprovalDetail from "@/components/DetailComponent/ApprovalDetail.vue";
|
||||
import {getMapProjectStateInfo} from '@/components/steps/api';
|
||||
import {ElLoading, ElNotification} from "element-plus";
|
||||
|
||||
const route = useRoute()
|
||||
const showActive = ref()
|
||||
const loading = ref(false)
|
||||
const processStore = useProcessStore()
|
||||
const activeName = ref('first')
|
||||
const commonForm = ref({})
|
||||
const fileListShow = ref('READ')
|
||||
const commonProvessViewer = ref(true)
|
||||
|
||||
const getAllInfo = async (state) => {
|
||||
const loading = ElLoading.service({fullscreen: true})
|
||||
try {
|
||||
commonProvessViewer.value = false
|
||||
loading.value = true
|
||||
const {data, code, msg} = await getMapProjectStateInfo(route.query.projectId, state)
|
||||
if (code === 1000) {
|
||||
loading.value = false
|
||||
} else {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: msg,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
if (data === undefined) return;
|
||||
commonForm.value = data
|
||||
processStore.setDesign(data)
|
||||
processStore.runningList.value = data.runningList;
|
||||
processStore.endList.value = data.endList;
|
||||
processStore.noTakeList.value = data.noTakeList;
|
||||
processStore.refuseList.value = data.refuseList;
|
||||
processStore.passList.value = data.passList;
|
||||
nextTick(() => {
|
||||
commonProvessViewer.value = true
|
||||
if (data.formPermMap["fileList"]) {
|
||||
fileListShow.value = data.formPermMap["fileList"].perm
|
||||
}
|
||||
})
|
||||
loading.close()
|
||||
} catch {
|
||||
loading.close()
|
||||
}
|
||||
}
|
||||
|
||||
const setDetail = (active) => {
|
||||
showActive.value = active
|
||||
getAllInfo(active)
|
||||
}
|
||||
|
||||
const stepChange = (data) => {
|
||||
showActive.value = data.active
|
||||
getAllInfo(data.active)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.detail-block {
|
||||
padding-top: 15px;
|
||||
|
||||
:deep(.el-tabs__nav-scroll) {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
.el-tabs__nav {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
|
||||
.el-tabs__item {
|
||||
flex: 1;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.is-active {
|
||||
color: black;
|
||||
background-color: #DED0B2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,4 @@
|
||||
<template>
|
||||
<!-- <baseTitle title="标签名称"></baseTitle>-->
|
||||
<!-- <el-form :model="formData" ref="tagForm" label-width="auto" :rules="rules">-->
|
||||
<!-- <el-form-item label="标签名称" prop="tagName">-->
|
||||
<!-- <el-input v-model="formData.tagName" placeholder="请输入标签名称" style="width: 300px"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<baseTitle title="上传附件"></baseTitle>
|
||||
<el-card style="width: 100%;margin: 15px 0">
|
||||
<file-upload @getFile="getFile" />
|
||||
@@ -23,7 +17,7 @@
|
||||
<script setup lang="jsx">
|
||||
import {ElNotification} from "element-plus";
|
||||
import {useTagsView} from '@/stores/tagsview.js'
|
||||
import {uploadFilingAttachment} from "@/api/project-manage";
|
||||
import {uploadFileList} from "@/api/project-manage/attachment";
|
||||
|
||||
const tagsViewStore = useTagsView()
|
||||
const route = useRoute()
|
||||
@@ -76,6 +70,24 @@ const rules = reactive({
|
||||
tagName: [{required: true, message: '请输入标签名称', trigger: 'blur'}],
|
||||
})
|
||||
const compositeParam = (item) => {
|
||||
let tag=''
|
||||
switch (route.query.name) {
|
||||
case '00':
|
||||
tag='需求征集'
|
||||
break
|
||||
case '10':
|
||||
tag='需求上报'
|
||||
break
|
||||
case '20':
|
||||
tag='项目立项'
|
||||
break
|
||||
case '40':
|
||||
tag='项目实施'
|
||||
break
|
||||
case '50':
|
||||
tag='项目归档'
|
||||
break
|
||||
}
|
||||
return {
|
||||
fileId: item.id,
|
||||
size: item.size,
|
||||
@@ -83,7 +95,7 @@ const compositeParam = (item) => {
|
||||
fileType: item.fileType,
|
||||
url: item.url,
|
||||
newFile: true,
|
||||
tag: '项目归档',
|
||||
tag: tag,
|
||||
}
|
||||
}
|
||||
const getFile = (val) => {
|
||||
@@ -106,10 +118,11 @@ const handleSubmit = async () => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
let params = {
|
||||
mosrUserFileDtoList: files,
|
||||
fileList: files,
|
||||
targetState:'',
|
||||
projectId: route.query.id,
|
||||
}
|
||||
let res = await uploadFilingAttachment(params)
|
||||
let res = await uploadFileList(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
|
||||
Reference in New Issue
Block a user