fix : 修复页面细节功能及附件上传组件

This commit is contained in:
2024-05-20 00:29:31 +08:00
parent 1f4389eb5e
commit 9661cdbb2b
10 changed files with 268 additions and 157 deletions

View File

@@ -17,17 +17,19 @@
</template>
<script setup lang="jsx">
import {useTagsView} from '@/stores/tagsview.js'
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {downloadFile} from "@/api/project-demand";
import { ElNotification} from "element-plus";
import {ElNotification} from "element-plus";
import {useProcessStore} from '@/stores/processStore.js';
import {getProjectConclusionProcess, projectConclusion} from "@/api/project-manage";
const tagsViewStore = useTagsView()
const formData = ref({})
const rules = reactive({
attachment: [{required: true, message: '请上传项目结项附件', trigger: 'blur'}],
})
const fileList = ref([])
const file = ref({})
const applyForm = ref()
const deploymentId = ref()
const showTable = ref(true)
@@ -103,13 +105,12 @@ const compositeParam = (item) => {
}
const getAttachment = (val) => {
console.log('上传文件getAttachment', val)
let fileObj = compositeParam(val, 1)
fileList.value.push(fileObj)
file.value=compositeParam(val)
}
const getOtherFile = (val) => {
console.log('上传文件getOtherFile', val)
showTable.value = false
let fileObj = compositeParam(val, 2)
let fileObj = compositeParam(val)
otherFileList.value.push(fileObj)
nextTick(() => {
showTable.value = true
@@ -126,16 +127,19 @@ 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(JSON.stringify(file.value) == "{}"){
// applyForm.value.validate()
// } else {
// applyForm.value.clearValidate()
// }
if (!valid) return
let files = []
fileList.value.forEach(item => {
files.push(getFileParam(item))
})
let singleFile={}
if(file.value.fileId!==undefined){
singleFile = {
fileId: file.value.fileId
}
}
otherFileList.value.forEach(item => {
files.push(getFileParam(item))
})
@@ -143,6 +147,7 @@ const handleSubmit = (instance) => {
deploymentId: deploymentId.value,
requirementId: route.query.id,
files: files,
singleFile: singleFile,
projectId:route.query.projectId,
}
console.log('params', params)