fix : 修复项目实施附件查询及上传功能、代码文件优化
This commit is contained in:
@@ -247,7 +247,7 @@
|
||||
|
||||
<script setup lang="jsx">
|
||||
import {debounce} from 'lodash'
|
||||
import {getDetail, getProcessInfo, requirementReported, resubmitReported} from "./api";
|
||||
import {getDetail, getProcessInfo, requirementReported, resubmitReported} from "@/api/project-demand/summary";
|
||||
import {ElNotification} from "element-plus";
|
||||
import {useTagsView} from '@/stores/tagsview.js'
|
||||
import {useCacheStore} from '@/stores/cache.js'
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export const fileUp = (url, data) => {
|
||||
return request({
|
||||
url,
|
||||
method: 'post',
|
||||
data,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const requirementReported = (data) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/requirement/reported',
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
};
|
||||
export const getProcessInfo = () => {
|
||||
return request({
|
||||
url: '/workflow/mosr/requirement/collect/process',
|
||||
method: "get"
|
||||
});
|
||||
};
|
||||
export const getDetail = (projectId) => {
|
||||
return request({
|
||||
url: `/workflow/mosr/requirement/collect/info/${projectId}`,
|
||||
method: "get"
|
||||
});
|
||||
};
|
||||
|
||||
export const resubmitReported = (data) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/requirement/collect/resubmit',
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
export const getCollectAttachment = (params) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/requirement/collect/attachments',
|
||||
method: "get",
|
||||
params:params
|
||||
});
|
||||
};
|
||||
export const uploadCollectAttachment= (data) => {
|
||||
return request({
|
||||
url: '/workflow/mosr/requirement/collect/upload',
|
||||
method: "post",
|
||||
data: data
|
||||
});
|
||||
};
|
||||
@@ -1,75 +0,0 @@
|
||||
<template>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
class="upload-demo"
|
||||
v-bind="$attrs"
|
||||
drag
|
||||
:action="url"
|
||||
multiple
|
||||
:on-change="change"
|
||||
:on-progress="progress"
|
||||
:on-remove="remove"
|
||||
:before-remove="beforeRemove"
|
||||
v-model:file-list="fileList"
|
||||
:http-request="uploadRequest"
|
||||
style="width: 50%;"
|
||||
>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">
|
||||
拖拽上传/<em>点击上传</em>
|
||||
</div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">
|
||||
{{ tip }}
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import { reactive, ref } from 'vue';
|
||||
import { fileUp } from '../api';
|
||||
|
||||
const props = defineProps({
|
||||
url: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
tip: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
const fileList = ref([])
|
||||
const uploadRef = ref()
|
||||
|
||||
const localData = reactive({
|
||||
|
||||
})
|
||||
|
||||
const change = (file, files) => {
|
||||
console.log(file, 'file');
|
||||
}
|
||||
|
||||
const progress = (UploadProgressEvent, UploadFile, UploadFiles) => {
|
||||
|
||||
}
|
||||
|
||||
const remove = (file, files) => {}
|
||||
|
||||
const beforeRemove = (file, files) => {}
|
||||
|
||||
const uploadRequest = (UploadRequestOptions) => {
|
||||
console.log(UploadRequestOptions, 'UploadRequestOptions');
|
||||
// UploadRequestOptions.data = {}
|
||||
const formData = new FormData()
|
||||
formData.append('file', UploadRequestOptions.file)
|
||||
// formData.append('params', UploadRequestOptions.data)
|
||||
fileUp(url, formData)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
@@ -48,7 +48,6 @@ const getInfo = async (state) => {
|
||||
processStore.passList.value = data.passList;
|
||||
nextTick(() => {
|
||||
summaryProcessViewer.value = true
|
||||
console.log('data.formPermMap["fileList"]',data.formPermMap["fileList"])
|
||||
if (data.formPermMap["fileList"]) {
|
||||
fileListShow.value = data.formPermMap["fileList"].perm
|
||||
}
|
||||
|
||||
@@ -4,11 +4,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import {reactive, ref, shallowRef} from 'vue';
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
import {useRouter} from 'vue-router';
|
||||
|
||||
const localData = reactive({})
|
||||
|
||||
const tableIns = ref()
|
||||
const router = useRouter()
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
<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"/>
|
||||
<fvTable style="width: 100%;max-height: 300px;" v-if="showTable" :tableConfig="tableConfig"
|
||||
:data="fileList" :isSettingCol="false" :pagination="false">
|
||||
<template #empty>
|
||||
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
|
||||
</template>
|
||||
</fvTable>
|
||||
</el-card>
|
||||
<div class="oper-page-btn">
|
||||
<el-button color="#DED0B2" @click="handleSubmit">提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import {ElNotification} from "element-plus";
|
||||
import {useTagsView} from '@/stores/tagsview.js'
|
||||
import {uploadCollectAttachment} from "./api";
|
||||
|
||||
const tagsViewStore = useTagsView()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const fileList = ref([])
|
||||
const formData = ref({
|
||||
tagName:''
|
||||
})
|
||||
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'
|
||||
},
|
||||
{
|
||||
prop: 'oper',
|
||||
label: '操作',
|
||||
align: 'center',
|
||||
currentRender: ({row, index}) => {
|
||||
return (
|
||||
<div>
|
||||
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
const showTable = ref(true)
|
||||
const name = ref(router.currentRoute.value.name)
|
||||
const rules = reactive({
|
||||
tagName: [{required: true, message: '请输入标签名称', trigger: 'blur'}],
|
||||
})
|
||||
const compositeParam = (item) => {
|
||||
return {
|
||||
fileId: item.id,
|
||||
size: item.size,
|
||||
originalFileName: item.originalFilename,
|
||||
fileType: item.fileType,
|
||||
url: item.url,
|
||||
newFile: true,
|
||||
tag:'需求上报',
|
||||
}
|
||||
}
|
||||
const getFile = (val) => {
|
||||
showTable.value = false
|
||||
let fileObj = compositeParam(val)
|
||||
fileList.value.push(fileObj)
|
||||
nextTick(() => {
|
||||
showTable.value = true
|
||||
})
|
||||
}
|
||||
const getFileParam = (item) => {
|
||||
return {
|
||||
fileId: item.fileId,
|
||||
tag:item.tag
|
||||
}
|
||||
}
|
||||
const handleSubmit = async () => {
|
||||
let files = []
|
||||
fileList.value.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
let params = {
|
||||
mosrUserFileDtoList: files,
|
||||
projectId: route.query.id,
|
||||
}
|
||||
console.log('params', params)
|
||||
let res = await uploadCollectAttachment(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
await router.push({
|
||||
name: 'Filing/attachment',
|
||||
query:{
|
||||
id: route.query.id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
:deep(.el-table--fit ){
|
||||
height: 300px!important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user