fix : 修复项目归档五个附件上传功能
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<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>
|
||||
<!-- <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" :disabled="!formData.tagName" :title="!formData.tagName?'请先输入标签!':''"/>
|
||||
<file-upload @getFile="getFile" />
|
||||
<fvTable style="width: 100%;max-height: 250px;height: 250px" v-if="showTable" :tableConfig="tableConfig"
|
||||
:data="fileList" :isSettingCol="false" :pagination="false">
|
||||
<template #empty>
|
||||
@@ -16,7 +16,7 @@
|
||||
</fvTable>
|
||||
</el-card>
|
||||
<div class="oper-page-btn">
|
||||
<el-button color="#DED0B2" @click="handleSubmit(tagForm)">提交</el-button>
|
||||
<el-button color="#DED0B2" @click="handleSubmit">提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -29,7 +29,6 @@ const tagsViewStore = useTagsView()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const fileList = ref([])
|
||||
const tagsOption = ref([])
|
||||
const formData = ref({
|
||||
tagName:''
|
||||
})
|
||||
@@ -53,7 +52,7 @@ const tableConfig = reactive({
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'tag',
|
||||
prop: 'size',
|
||||
label: '文件大小',
|
||||
align: 'center'
|
||||
},
|
||||
@@ -72,28 +71,21 @@ const tableConfig = reactive({
|
||||
]
|
||||
})
|
||||
const showTable = ref(true)
|
||||
const tagForm = ref()
|
||||
const name = ref(router.currentRoute.value.name)
|
||||
const rules = reactive({
|
||||
tagName: [{required: true, message: '请输入标签名称', trigger: 'blur'}],
|
||||
})
|
||||
const compositeParam = (item) => {
|
||||
tagsOption.value.forEach(item => {
|
||||
if (item.value == formData.value.tagName) {
|
||||
formData.value.tagName = item.label
|
||||
}
|
||||
})
|
||||
return {
|
||||
fileId: item.id,
|
||||
size: item.size,
|
||||
originalFileName: item.originalFilename,
|
||||
fileType: item.fileType,
|
||||
url: item.url,
|
||||
tag: formData.value.tagName,
|
||||
tag:'需求征集'
|
||||
}
|
||||
}
|
||||
const getFile = (val) => {
|
||||
console.log('上传文件', val)
|
||||
showTable.value = false
|
||||
let fileObj = compositeParam(val)
|
||||
fileList.value.push(fileObj)
|
||||
@@ -103,21 +95,18 @@ const getFile = (val) => {
|
||||
}
|
||||
const getFileParam = (item) => {
|
||||
return {
|
||||
fileId: item.fileId
|
||||
fileId: item.fileId,
|
||||
tag:item.tag
|
||||
}
|
||||
}
|
||||
const handleSubmit = async (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
const handleSubmit = async () => {
|
||||
let files = []
|
||||
fileList.value.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
let params = {
|
||||
fileList: files,
|
||||
mosrUserFileDtoList: files,
|
||||
projectId: route.query.id,
|
||||
tag: formData.value.tagName
|
||||
}
|
||||
console.log('params', params)
|
||||
let res = await uploadRequirementAttachment(params)
|
||||
@@ -135,7 +124,6 @@ const handleSubmit = async (instance) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<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>
|
||||
<!-- <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" :disabled="!formData.tagName" :title="!formData.tagName?'请先输入标签!':''"/>
|
||||
<file-upload @getFile="getFile"/>
|
||||
<fvTable style="width: 100%;max-height: 250px;height: 250px" v-if="showTable" :tableConfig="tableConfig"
|
||||
:data="fileList" :isSettingCol="false" :pagination="false">
|
||||
<template #empty>
|
||||
@@ -16,7 +16,7 @@
|
||||
</fvTable>
|
||||
</el-card>
|
||||
<div class="oper-page-btn">
|
||||
<el-button color="#DED0B2" @click="handleSubmit(tagForm)">提交</el-button>
|
||||
<el-button color="#DED0B2" @click="handleSubmit">提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -29,7 +29,6 @@ const tagsViewStore = useTagsView()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const fileList = ref([])
|
||||
const tagsOption = ref([])
|
||||
const formData = ref({
|
||||
tagName:''
|
||||
})
|
||||
@@ -53,7 +52,7 @@ const tableConfig = reactive({
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'tag',
|
||||
prop: 'size',
|
||||
label: '文件大小',
|
||||
align: 'center'
|
||||
},
|
||||
@@ -72,28 +71,21 @@ const tableConfig = reactive({
|
||||
]
|
||||
})
|
||||
const showTable = ref(true)
|
||||
const tagForm = ref()
|
||||
const name = ref(router.currentRoute.value.name)
|
||||
const rules = reactive({
|
||||
tagName: [{required: true, message: '请输入标签名称', trigger: 'blur'}],
|
||||
})
|
||||
const compositeParam = (item) => {
|
||||
tagsOption.value.forEach(item => {
|
||||
if (item.value == formData.value.tagName) {
|
||||
formData.value.tagName = item.label
|
||||
}
|
||||
})
|
||||
return {
|
||||
fileId: item.id,
|
||||
size: item.size,
|
||||
originalFileName: item.originalFilename,
|
||||
fileType: item.fileType,
|
||||
url: item.url,
|
||||
tag: formData.value.tagName,
|
||||
tag:'需求上报',
|
||||
}
|
||||
}
|
||||
const getFile = (val) => {
|
||||
console.log('上传文件', val)
|
||||
showTable.value = false
|
||||
let fileObj = compositeParam(val)
|
||||
fileList.value.push(fileObj)
|
||||
@@ -103,21 +95,18 @@ const getFile = (val) => {
|
||||
}
|
||||
const getFileParam = (item) => {
|
||||
return {
|
||||
fileId: item.fileId
|
||||
fileId: item.fileId,
|
||||
tag:item.tag
|
||||
}
|
||||
}
|
||||
const handleSubmit = async (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
const handleSubmit = async () => {
|
||||
let files = []
|
||||
fileList.value.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
let params = {
|
||||
fileList: files,
|
||||
mosrUserFileDtoList: files,
|
||||
projectId: route.query.id,
|
||||
tag: formData.value.tagName
|
||||
}
|
||||
console.log('params', params)
|
||||
let res = await uploadCollectAttachment(params)
|
||||
@@ -135,7 +124,6 @@ const handleSubmit = async (instance) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -127,12 +127,22 @@ const changeFileList = (res) => {
|
||||
}
|
||||
}
|
||||
const upload = () => {
|
||||
router.push({
|
||||
name: switchUpload(activeName.value),
|
||||
query: {
|
||||
id: route.query.id
|
||||
}
|
||||
})
|
||||
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) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<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>
|
||||
<!-- <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" :disabled="!formData.tagName" :title="!formData.tagName?'请先输入标签!':''"/>
|
||||
<file-upload @getFile="getFile" />
|
||||
<fvTable style="width: 100%;max-height: 250px;height: 250px" v-if="showTable" :tableConfig="tableConfig"
|
||||
:data="fileList" :isSettingCol="false" :pagination="false">
|
||||
<template #empty>
|
||||
@@ -16,7 +16,7 @@
|
||||
</fvTable>
|
||||
</el-card>
|
||||
<div class="oper-page-btn">
|
||||
<el-button color="#DED0B2" @click="handleSubmit(tagForm)">提交</el-button>
|
||||
<el-button color="#DED0B2" @click="handleSubmit">提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -29,7 +29,6 @@ const tagsViewStore = useTagsView()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const fileList = ref([])
|
||||
const tagsOption = ref([])
|
||||
const formData = ref({
|
||||
tagName:''
|
||||
})
|
||||
@@ -53,7 +52,7 @@ const tableConfig = reactive({
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'tag',
|
||||
prop: 'size',
|
||||
label: '文件大小',
|
||||
align: 'center'
|
||||
},
|
||||
@@ -72,28 +71,21 @@ const tableConfig = reactive({
|
||||
]
|
||||
})
|
||||
const showTable = ref(true)
|
||||
const tagForm = ref()
|
||||
const name = ref(router.currentRoute.value.name)
|
||||
const rules = reactive({
|
||||
tagName: [{required: true, message: '请输入标签名称', trigger: 'blur'}],
|
||||
})
|
||||
const compositeParam = (item) => {
|
||||
tagsOption.value.forEach(item => {
|
||||
if (item.value == formData.value.tagName) {
|
||||
formData.value.tagName = item.label
|
||||
}
|
||||
})
|
||||
return {
|
||||
fileId: item.id,
|
||||
size: item.size,
|
||||
originalFileName: item.originalFilename,
|
||||
fileType: item.fileType,
|
||||
url: item.url,
|
||||
tag: formData.value.tagName,
|
||||
tag: '项目归档',
|
||||
}
|
||||
}
|
||||
const getFile = (val) => {
|
||||
console.log('上传文件', val)
|
||||
showTable.value = false
|
||||
let fileObj = compositeParam(val)
|
||||
fileList.value.push(fileObj)
|
||||
@@ -103,23 +95,19 @@ const getFile = (val) => {
|
||||
}
|
||||
const getFileParam = (item) => {
|
||||
return {
|
||||
fileId: item.fileId
|
||||
fileId: item.fileId,
|
||||
tag:item.tag
|
||||
}
|
||||
}
|
||||
const handleSubmit = async (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
const handleSubmit = async () => {
|
||||
let files = []
|
||||
fileList.value.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
let params = {
|
||||
fileList: files,
|
||||
mosrUserFileDtoList: files,
|
||||
projectId: route.query.id,
|
||||
tag: formData.value.tagName
|
||||
}
|
||||
console.log('params', params)
|
||||
let res = await uploadFilingAttachment(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
@@ -135,7 +123,6 @@ const handleSubmit = async (instance) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -160,12 +160,21 @@ const handleSubmit = async (instance) => {
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
await router.push({
|
||||
name: 'Implementation/attachment',
|
||||
query:{
|
||||
id: route.query.id
|
||||
}
|
||||
})
|
||||
if(route.query.type=='3'){
|
||||
await router.push({
|
||||
name: 'Filing/attachment',
|
||||
query:{
|
||||
id: route.query.id
|
||||
}
|
||||
})
|
||||
}else {
|
||||
await router.push({
|
||||
name: 'Implementation/attachment',
|
||||
query:{
|
||||
id: route.query.id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<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>
|
||||
<!-- <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" :disabled="!formData.tagName" :title="!formData.tagName?'请先输入标签!':''"/>
|
||||
<file-upload @getFile="getFile"/>
|
||||
<fvTable style="width: 100%;max-height: 250px;height: 250px" v-if="showTable" :tableConfig="tableConfig"
|
||||
:data="fileList" :isSettingCol="false" :pagination="false">
|
||||
<template #empty>
|
||||
@@ -16,7 +16,7 @@
|
||||
</fvTable>
|
||||
</el-card>
|
||||
<div class="oper-page-btn">
|
||||
<el-button color="#DED0B2" @click="handleSubmit(tagForm)">提交</el-button>
|
||||
<el-button color="#DED0B2" @click="handleSubmit">提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -29,7 +29,6 @@ const tagsViewStore = useTagsView()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const fileList = ref([])
|
||||
const tagsOption = ref([])
|
||||
const formData = ref({
|
||||
tagName:''
|
||||
})
|
||||
@@ -53,7 +52,7 @@ const tableConfig = reactive({
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'tag',
|
||||
prop: 'size',
|
||||
label: '文件大小',
|
||||
align: 'center'
|
||||
},
|
||||
@@ -72,28 +71,21 @@ const tableConfig = reactive({
|
||||
]
|
||||
})
|
||||
const showTable = ref(true)
|
||||
const tagForm = ref()
|
||||
const name = ref(router.currentRoute.value.name)
|
||||
const rules = reactive({
|
||||
tagName: [{required: true, message: '请输入标签名称', trigger: 'blur'}],
|
||||
})
|
||||
const compositeParam = (item) => {
|
||||
tagsOption.value.forEach(item => {
|
||||
if (item.value == formData.value.tagName) {
|
||||
formData.value.tagName = item.label
|
||||
}
|
||||
})
|
||||
return {
|
||||
fileId: item.id,
|
||||
size: item.size,
|
||||
originalFileName: item.originalFilename,
|
||||
fileType: item.fileType,
|
||||
url: item.url,
|
||||
tag: formData.value.tagName,
|
||||
tag: '项目立项',
|
||||
}
|
||||
}
|
||||
const getFile = (val) => {
|
||||
console.log('上传文件', val)
|
||||
showTable.value = false
|
||||
let fileObj = compositeParam(val)
|
||||
fileList.value.push(fileObj)
|
||||
@@ -103,23 +95,19 @@ const getFile = (val) => {
|
||||
}
|
||||
const getFileParam = (item) => {
|
||||
return {
|
||||
fileId: item.fileId
|
||||
fileId: item.fileId,
|
||||
tag:item.tag
|
||||
}
|
||||
}
|
||||
const handleSubmit = async (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
const handleSubmit = async () => {
|
||||
let files = []
|
||||
fileList.value.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
let params = {
|
||||
fileList: files,
|
||||
mosrUserFileDtoList: files,
|
||||
projectId: route.query.id,
|
||||
tag: formData.value.tagName
|
||||
}
|
||||
console.log('params', params)
|
||||
let res = await uploadInitiationAttachment(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
@@ -135,7 +123,6 @@ const handleSubmit = async (instance) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user