fix : 修复页面

This commit is contained in:
2024-05-19 18:00:48 +08:00
parent 1fc0ae6ac0
commit 08a609e2a8
7 changed files with 291 additions and 156 deletions

View File

@@ -27,8 +27,8 @@ const showTable = ref(true)
const otherFileList = ref([])
const compositeParam = (item) => {
let tag=''
if(!formData.value.collectType&&router.currentRoute.value.name==='Implementation/check'){
tag='项目实施'
if(router.currentRoute.value.name==='Implementation/check'){
tag='项目验收'
}
return {
fileId: item.id,
@@ -42,25 +42,59 @@ const compositeParam = (item) => {
}
const getAttachment = (val) => {
console.log('上传文件getAttachment', val)
let fileObj = compositeParam(val)
// fileList.value.push(fileObj)
let fileObj = compositeParam(val, 1)
fileList.value.push(fileObj)
}
const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val)
showTable.value = false
let fileObj = compositeParam(val)
let fileObj = compositeParam(val, 2)
otherFileList.value.push(fileObj)
nextTick(() => {
showTable.value = true
})
}
const getFileParam = (item) => {
return {
fileId: item.fileId,
type: item.type
}
}
const handleSubmit = (instance) => {
if (!instance) return
instance.validate(async (valid) => {
if (!valid) return
if(fileList.value.length===0){
applyForm.value.validate()
}else {
applyForm.value.clearValidate()
}
if (!valid) return
let files = []
fileList.value.forEach(item => {
files.push(getFileParam(item))
})
otherFileList.value.forEach(item => {
files.push(getFileParam(item))
})
let params = {
// deploymentId: deploymentId.value,
files: files
}
console.log('params',params)
// let res = await requirementReported(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: 'Summary'
// })
// }
})
}
</script>

View File

@@ -121,11 +121,6 @@ const tableConfig = reactive({
label: '项目影响',
align: 'center'
},
{
prop: 'survey',
label: '经营概况',
align: 'center'
},
{
prop: 'time',
label: '起止时间',
@@ -146,11 +141,12 @@ const tableConfig = reactive({
currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
if (row.state === '3') {
btn.push({label: '验收', func: () => handleCheck(row), type: 'primary'})
} else if (row.state === '4') {
btn.push({label: '台账', func: () => handleStandingBook(row), type: 'primary'})
btn.push({label: '附件', func: () => handleAttachment(row), type: 'primary'})
btn.push({label: '查看分摊', func: () => handleShare(row), type: 'primary'})
btn.push(
{label: '验收', func: () => handleCheck(row), type: 'primary'},
{label: '台账', func: () => handleStandingBook(row), type: 'primary'},
{label: '附件', func: () => handleAttachment(row), type: 'primary'},
{label: '查看分摊', func: () => handleShare(row), type: 'primary'}
)
}
return (
<div style={{width: '100%'}}>
@@ -174,7 +170,7 @@ const tableConfig = reactive({
api: '',
params: {},
btns: [
{name: '生成分摊报表', key: '_export', color: '#DED0B2',auth: ''}
{name: '生成分摊报表', key: '_export', color: '#DED0B2', auth: ''}
]
})
@@ -185,11 +181,42 @@ const search = (val) => {
const handleDetail = (row) => {
router.push({
name:'Implementation/detail',
name: 'Implementation/detail',
query: {
id: row.requirementId
}
})
}
const handleCheck = (row) => {
router.push({
name: 'Implementation/check',
query: {
id: row.requirementId
}
})
}
const handleStandingBook = (row) => {
router.push({
name: 'Implementation/account',
query: {
id: row.requirementId
}
})
}
const handleAttachment = (row) => {
router.push({
name: 'Implementation/attachment',
query: {
id: row.requirementId
}
})
}
const handleShare = (row) => {
router.push({
name: 'Implementation/share',
query: {
id: row.requirementId
}
})
}
</script>

View File

@@ -8,26 +8,11 @@
<el-input v-model="formData.requirementName" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="项目立项附件" prop="attachment">
<file-upload @getFile="getAttachment" :showFileList="true"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="其他文件">
<el-card style="width: 100%">
<file-upload @getFile="getOtherFile" :showFileList="true"/>
<fvTable style="width: 100%;max-height: 250px" v-if="showTable" :tableConfig="tableConfig"
:data="otherFileList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-card>
</el-form-item>
</el-col>
</el-row>
</el-form>
<AttachmentUpload ref="attachment" label="需求申请书附件" :showTable="showTable" :otherFileList="otherFileList"
@getAttachment="getAttachment"
@getOtherFile="getOtherFile" :showFileList="true"/>
<div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button>
</div>
@@ -35,13 +20,14 @@
</template>
<script setup lang="jsx">
import FileUpload from "@/components/FileUpload.vue";
import {useTagsView} from '@/stores/tagsview.js'
const tagsViewStore = useTagsView()
const router = useRouter()
const formData = ref({})
const rules = reactive({
attachment: [{required: true, message: '请上传项目立项附件', trigger: 'blur'}],
})
const fileList = ref(null)
const fileList = ref([])
const applyForm = ref()
const showTable = ref(true)
const otherFileList = ref([])
@@ -70,65 +56,91 @@ const tableConfig = reactive({
align: 'center',
currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
},
{
prop: 'oper',
label: '操作',
align: 'center',
currentRender: ({row, index}) => {
return (
<div>
<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>
<el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
</div>
)
}
}
// {
// prop: 'oper',
// label: '操作',
// align: 'center',
// currentRender: ({row, index}) => {
// return (
// <div>
// <a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>
// <el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
// </div>
// )
// }
// }
]
})
const compositeParam = (item) => {
const compositeParam = (item, type) => {
let tag = ''
if (router.currentRoute.value.name === 'Initiation/apply') {
tag = '项目立项申请'
}
return {
fileId: item.id,
size: item.size,
type: type,
originalFileName: item.originalFilename,
fileType: item.fileType,
url: item.url,
processNodeTag: null,
tag: formData.value.collectType
tag:tag
}
}
const getAttachment = (val) => {
console.log('上传文件', val)
console.log('上传文件getAttachment', val)
let fileObj = compositeParam(val, 1)
fileList.value.push(fileObj)
}
const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val)
showTable.value = false
let fileObj = compositeParam(val, 2)
otherFileList.value.push(fileObj)
nextTick(() => {
showTable.value = true
})
let fileObj = {}
let newFileArray = []
if (route.query.isAdd === undefined) {
val.forEach(item => {
fileObj = compositeParam(item)
newFileArray.push(fileObj)
formData.value.fileList.push(fileObj)
})
fileList.value = formData.value.fileList
} else {
val.forEach(item => {
fileObj = compositeParam(item)
newFileArray.push(fileObj)
})
formData.value.fileList = newFileArray
fileList.value = newFileArray
}
}
const getOtherFile = () => {
const getFileParam = (item) => {
return {
fileId: item.fileId,
type: item.type
}
}
const handleSubmit = (instance) => {
if (!instance) return
instance.validate(async (valid) => {
if(fileList.value.length===0){
applyForm.value.validate()
}else {
applyForm.value.clearValidate()
}
if (!valid) return
let files = []
fileList.value.forEach(item => {
files.push(getFileParam(item))
})
otherFileList.value.forEach(item => {
files.push(getFileParam(item))
})
let params = {
// deploymentId: deploymentId.value,
files: files
}
console.log('params',params)
// let res = await requirementReported(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: 'Summary'
// })
// }
})
}
</script>

View File

@@ -93,15 +93,11 @@ const tableIns = ref()
const tableConfig = reactive({
columns: [
{
prop: 'requirementName',
prop: 'projectName',
label: '名称',
align: 'center'
},
{
prop: 'undertaker',
label: '承办单位',
align: 'center'
}, {
prop: 'affiliatedCompanyId',
label: '所属公司',
align: 'center'
@@ -121,14 +117,9 @@ const tableConfig = reactive({
label: '项目影响',
align: 'center'
},
{
prop: 'survey',
label: '经营概况',
align: 'center'
},
{
prop: 'startTime',
label: '起时间',
label: '起时间',
align: 'center'
},
{
@@ -136,7 +127,13 @@ const tableConfig = reactive({
label: '状态',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => (<Tag dictType={'project_initiation'} value={row.state}/>)
currentRender: ({row, index}) =>{
if (row.state !== null) {
return (<Tag dictType={'project_initiation'} value={row.state}/>)
} else {
return '--'
}
}
},
{
prop: 'oper',
@@ -145,11 +142,10 @@ const tableConfig = reactive({
showOverflowTooltip: false,
currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
if (row.state === '4') {
if (row.state === '3') {
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
} else if (row.state === '20') {
btn.push({label: '申请', func: () => handleApply(row), type: 'primary'})
} else if (row.state === '4') {
}
return (
<div style={{width: '100%'}}>