fix : 详情修改为一个文件上传入口及测试校验,同步移动端详情展示

This commit is contained in:
2024-08-28 14:18:55 +08:00
parent 50504f4e94
commit d59c9d8cca
12 changed files with 380 additions and 388 deletions

View File

@@ -491,17 +491,17 @@ const handleSubmit = async () => {
files.push(getFileParam(item))
})
}
// if (!attachment.value.isHaveOneFile) {
// attachment.value.validate()
// ElNotification({
// title: '提示',
// message: '请上传附件',
// type: 'error'
// })
// return;
// } else {
// attachment.value.clearValidate()
// }
if (!attachment.value.isHaveOneFile) {
attachment.value.validate()
ElNotification({
title: '提示',
message: '请上传附件',
type: 'error'
})
return;
} else {
attachment.value.clearValidate()
}
let projectPersonIds = []
for (const item of projectPersonUserList.value) {
projectPersonIds.push(parseInt(item.id))
@@ -616,6 +616,7 @@ const init = async () => {
}
watchEffect(() => {
console.info("🚀 ~method:;props.formData.projectChargePerson -----", props.formData.projectChargePerson)
if (props.formData.projectChargePerson == null) {
projectChargePersonUserList.value = []
} else {
@@ -628,9 +629,9 @@ watchEffect(() => {
}
projectPersonUserList.value = props.formData.projectPersonList ? props.formData.projectPersonList : []
let flag = Object.keys(props.formData).length && (localFormData.value = props.formData)
if (props.formData.projectChargePerson != null) {
localFormData.value.projectChargePerson = props.formData.projectChargePerson.id
}
// if (props.formData.projectChargePerson != null) {
// localFormData.value.projectChargePerson = props.formData.projectChargePerson.id
// }
if (localStorage.getItem('preProcess')) {
let param = JSON.parse(localStorage.getItem('preProcess'))

View File

@@ -1,5 +1,5 @@
<template>
<el-row>
<el-row style="padding-bottom: 20px">
<el-col :span="24">
<baseTitle :title="'项目附件'"></baseTitle>
</el-col>
@@ -16,9 +16,10 @@
</el-form-item>
<el-form-item>
<el-button @click="handleSearch" color="#DED0B2">搜索</el-button>
<el-button v-if="uploadState&&isLineBtn" color="#DED0B2" @click="handleUpload">上传附件</el-button>
</el-form-item>
</el-form>
<el-col :span="24" style="margin-bottom: 8px;margin-left: 15px">
<el-col v-if="!isLineBtn" :span="24" style="margin-bottom: 8px;margin-left: 15px">
<el-button v-if="uploadState" color="#DED0B2" @click="handleUpload">上传附件</el-button>
</el-col>
<fvTable style="width: 100%;min-height:311px;max-height: 311px" v-if="showAttachmentTable" height="311"
@@ -44,6 +45,17 @@ const attachmentParam = reactive({
const uploadState = ref(false)
const tagsOption = ref([])
const showAttachmentTable = ref(true)
const props = defineProps({
fileNameTableWidth: {
type: String,
default: '400'
},
isLineBtn: {
type: Boolean,
default: false
},
})
const executeTableConfig = reactive({
columns: [
{
@@ -57,6 +69,7 @@ const executeTableConfig = reactive({
prop: 'originalFileName',
label: '文件名',
align: 'center',
width: props.fileNameTableWidth,
currentRender: ({row, index}) => (
<div style="color: #2a99ff;cursor: pointer;" onClick={() => clickToPreview(row)}>{row.originalFileName}</div>)
},

View File

@@ -56,19 +56,19 @@
</el-col>
</el-row>
<baseTitle title="需求上报申请书" style="margin-bottom: 10px">></baseTitle>
<el-row gutter="20" style="margin-bottom: -15px;">
<el-col :span="24">
<single-file-component tag="需求上报" v-model:value="localFormData.singleFile" :processViewer="processViewer"/>
<!-- <el-form-item>-->
<!-- {{localFormData.singleFile}}-->
<!-- <el-button type="primary" link @click="handleDownload(localFormData.singleFile)" style="font-size: 16px">-->
<!-- {{ localFormData.singleFile?.originalFileName }}-->
<!-- </el-button>-->
<!-- </el-form-item>-->
</el-col>
</el-row>
<baseTitle title="附件文件" style="margin-bottom: 0"></baseTitle>
<baseTitle title="需求上报申请书" style="margin-bottom: -3px;"></baseTitle>
<!-- <el-row gutter="20" style="margin-bottom: -15px;">-->
<!-- <el-col :span="24">-->
<!-- <single-file-component tag="需求上报" v-model:value="localFormData.singleFile" :processViewer="processViewer"/>-->
<!-- &lt;!&ndash; <el-form-item>&ndash;&gt;-->
<!-- &lt;!&ndash; {{localFormData.singleFile}}&ndash;&gt;-->
<!-- &lt;!&ndash; <el-button type="primary" link @click="handleDownload(localFormData.singleFile)" style="font-size: 16px">&ndash;&gt;-->
<!-- &lt;!&ndash; {{ localFormData.singleFile?.originalFileName }}&ndash;&gt;-->
<!-- &lt;!&ndash; </el-button>&ndash;&gt;-->
<!-- &lt;!&ndash; </el-form-item>&ndash;&gt;-->
<!-- </el-col>-->
<!-- </el-row>-->
<!--/* <baseTitle title="附件文件" style="margin-bottom: 0"></baseTitle>*/-->
<el-row gutter="20" style="margin-bottom: -18px;">
<el-col :span="24">
<file-component tag="需求上报"