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

@@ -19,16 +19,18 @@
</div>
<div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button>
<el-button color="#DED0B2" @click="handleResubmit">重新提交</el-button>
</div>
</div>
</template>
<script setup lang="jsx">
import {useTagsView} from '@/stores/tagsview.js'
import {ElNotification} from "element-plus";
import {ElMessage, ElNotification} from "element-plus";
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import {getProcessInfo,projectApply} from "@/api/project-manage";
import {getProcessInfo, projectApply} from "@/api/project-manage";
import {useProcessStore} from '@/stores/processStore.js';
const tagsViewStore = useTagsView()
const router = useRouter()
const route = useRoute()
@@ -38,7 +40,7 @@ const rules = reactive({
})
const processStore = useProcessStore()
const deploymentId = ref()
const fileList = ref([])
const file = ref({})
const applyForm = ref()
const showTable = ref(true)
const otherFileList = ref([])
@@ -102,13 +104,12 @@ const compositeParam = (item, type) => {
}
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
@@ -123,16 +124,19 @@ const getFileParam = (item) => {
const handleSubmit = (instance) => {
if (!instance) return
instance.validate(async (valid) => {
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))
})
@@ -140,6 +144,7 @@ const handleSubmit = (instance) => {
deploymentId: deploymentId.value,
requirementId: route.query.id,
files: files,
singleFile: singleFile,
projectId:route.query.projectId,
}
console.log('params',params)
@@ -157,6 +162,19 @@ const handleSubmit = (instance) => {
}
})
}
const handleResubmit = () => {
resubmit(submitParam(formData.value)).then(res => {
if (res.code === 1000) {
ElMessage.success(res.msg)
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
router.push({
name: 'Collection'
})
} else {
ElMessage.error(res.msg)
}
})
}
const init = () => {
getProcessInfo().then(res => {
processDiagramViewer.value = false

View File

@@ -200,6 +200,7 @@ const handleApply = (row) => {
router.push({
name:'Initiation/apply',
query: {
isAdd: 1,
id: row.requirementId,
projectId: row.projectId
}