Merge pull request 'fix : 修改提交/重新提交功能文件传参问题' (#301) from dj into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/301
This commit is contained in:
@@ -115,7 +115,7 @@ const tableConfig = reactive({
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
row.newFile||props.preview ? <popover-delete name={row.originalFileName} type={'文件'} btnType={'danger'}
|
row.newFile||props.preview||!props.preview ? <popover-delete name={row.originalFileName} type={'文件'} btnType={'danger'}
|
||||||
perm={['mosr:requirement:del']}
|
perm={['mosr:requirement:del']}
|
||||||
onDelete={() => handleDelete(row)}/>
|
onDelete={() => handleDelete(row)}/>
|
||||||
: ''
|
: ''
|
||||||
|
|||||||
@@ -428,21 +428,19 @@ const handleSubmit = debounce(async (instance) => {
|
|||||||
})
|
})
|
||||||
const handleResubmit = debounce(() => {
|
const handleResubmit = debounce(() => {
|
||||||
let otherFiles = []
|
let otherFiles = []
|
||||||
let fileArray
|
|
||||||
if (name.value === 'Summary/edit') {
|
if (name.value === 'Summary/edit') {
|
||||||
fileArray = attachment.value.allFileList
|
attachment.value.allFileList.forEach(item => {
|
||||||
|
otherFiles.push(getFileParam(item))
|
||||||
|
})
|
||||||
}
|
}
|
||||||
fileArray.forEach(item => {
|
|
||||||
otherFiles.push(getFileParam(item))
|
|
||||||
})
|
|
||||||
let params = {
|
let params = {
|
||||||
...formData.value,
|
...formData.value,
|
||||||
deploymentId: deploymentId.value,
|
deploymentId: deploymentId.value,
|
||||||
fileList: otherFiles,
|
fileList: otherFiles,
|
||||||
requirementId: route.query.id ? route.query.id : '-1'
|
requirementId: route.query.id ? route.query.id : '-1'
|
||||||
}
|
}
|
||||||
console.log('重新提交params', params, formData.value)
|
console.log('重新提交params', params)
|
||||||
if (!attachment.value.isSingleFile&&!formData.value.singleFile) {
|
if (!attachment.value.isSingleFile || !formData.value.singleFile) {
|
||||||
attachment.value.validate()
|
attachment.value.validate()
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ const compositeParam = (item) => {
|
|||||||
}
|
}
|
||||||
const getAttachment = (val) => {
|
const getAttachment = (val) => {
|
||||||
console.log('上传文件getAttachment', val)
|
console.log('上传文件getAttachment', val)
|
||||||
file.value = compositeParam(val)
|
|
||||||
formData.value.singleFile = compositeParam(val)
|
formData.value.singleFile = compositeParam(val)
|
||||||
}
|
}
|
||||||
const getOtherFile = (val) => {
|
const getOtherFile = (val) => {
|
||||||
@@ -130,23 +129,20 @@ const getFileParam = (item) => {
|
|||||||
}
|
}
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
let files = []
|
let files = []
|
||||||
let singleFile = {}
|
|
||||||
if (file.value.fileId !== undefined) {
|
|
||||||
singleFile = {
|
|
||||||
fileId: file.value.fileId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
otherFileList.value.forEach(item => {
|
otherFileList.value.forEach(item => {
|
||||||
files.push(getFileParam(item))
|
files.push(getFileParam(item))
|
||||||
})
|
})
|
||||||
|
if (formData.value.singleFile !== undefined) {
|
||||||
|
formData.value.singleFile = getFileParam(formData.value.singleFile)
|
||||||
|
}
|
||||||
let params = {
|
let params = {
|
||||||
deploymentId: deploymentId.value,
|
deploymentId: deploymentId.value,
|
||||||
requirementId: route.query.id,
|
requirementId: route.query.id,
|
||||||
fileList: files,
|
fileList: files,
|
||||||
singleFile: singleFile,
|
singleFile: formData.value.singleFile,
|
||||||
projectId: route.query.projectId,
|
projectId: route.query.projectId,
|
||||||
}
|
}
|
||||||
if (JSON.stringify(singleFile) === "{}") {
|
if (!attachment.value.isSingleFile) {
|
||||||
attachment.value.validate()
|
attachment.value.validate()
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -154,7 +150,7 @@ const handleSubmit = async () => {
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}else {
|
} else {
|
||||||
attachment.value.clearValidate()
|
attachment.value.clearValidate()
|
||||||
}
|
}
|
||||||
console.log('params', params)
|
console.log('params', params)
|
||||||
@@ -172,34 +168,20 @@ const handleSubmit = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleResubmit = () => {
|
const handleResubmit = () => {
|
||||||
let singleFile = {}
|
|
||||||
let otherFiles = []
|
let otherFiles = []
|
||||||
let fileArray
|
if (name.value === 'Filing/edit') {
|
||||||
if (attachment.value.singleFile !== null && name.value === 'Filing/edit') {
|
attachment.value.allFileList?.forEach(item => {
|
||||||
singleFile = {
|
otherFiles.push(getFileParam(item))
|
||||||
fileId: attachment.value.singleFile.fileId
|
})
|
||||||
}
|
|
||||||
fileArray = attachment.value.allFileList
|
|
||||||
} else {
|
|
||||||
if (file.value.fileId !== undefined) {
|
|
||||||
singleFile = {
|
|
||||||
fileId: file.value.fileId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fileArray = otherFileList.value
|
|
||||||
}
|
}
|
||||||
fileArray.forEach(item => {
|
|
||||||
otherFiles.push(getFileParam(item))
|
|
||||||
})
|
|
||||||
//todo requirementId
|
|
||||||
let params = {
|
let params = {
|
||||||
deploymentId: deploymentId.value,
|
deploymentId: deploymentId.value,
|
||||||
requirementId: route.query.id,
|
requirementId: route.query.id,
|
||||||
fileList: otherFiles,
|
fileList: otherFiles,
|
||||||
singleFile: singleFile,
|
singleFile: formData.value.singleFile,
|
||||||
projectId: route.query.projectId,
|
projectId: route.query.projectId,
|
||||||
}
|
}
|
||||||
if (JSON.stringify(singleFile) === "{}") {
|
if (!attachment.value.isSingleFile || !formData.value.singleFile) {
|
||||||
attachment.value.validate()
|
attachment.value.validate()
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -207,7 +189,7 @@ const handleResubmit = () => {
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}else {
|
} else {
|
||||||
attachment.value.clearValidate()
|
attachment.value.clearValidate()
|
||||||
}
|
}
|
||||||
console.log('重新提交params', params)
|
console.log('重新提交params', params)
|
||||||
@@ -254,7 +236,7 @@ const init = () => {
|
|||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
processDiagramViewer.value = true
|
processDiagramViewer.value = true
|
||||||
})
|
})
|
||||||
}else {
|
} else {
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<AttachmentUpload ref="attachment" label="项目验收附件" :showTable="showTable" :otherFileList="otherFileList"
|
<AttachmentUpload ref="attachment" label="项目验收附件" :showTable="showTable" :otherFileList="otherFileList"
|
||||||
@getAttachment="getAttachment"
|
@getAttachment="getAttachment"
|
||||||
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData" :preview="name === 'Implementation/edit'"/>
|
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData"
|
||||||
|
:preview="name === 'Implementation/edit'"/>
|
||||||
<div class="approval-record">
|
<div class="approval-record">
|
||||||
<baseTitle title="流程"></baseTitle>
|
<baseTitle title="流程"></baseTitle>
|
||||||
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
|
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
|
||||||
@@ -26,18 +27,18 @@
|
|||||||
|
|
||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
||||||
import {getProjectCheckProcess, projectCheck,getCheckDetail,resubmitCheck} from "@/api/project-manage";
|
import {getProjectCheckProcess, projectCheck, getCheckDetail, resubmitCheck} from "@/api/project-manage";
|
||||||
import {ElNotification} from "element-plus";
|
import {ElNotification} from "element-plus";
|
||||||
import {useProcessStore} from '@/stores/processStore.js';
|
import {useProcessStore} from '@/stores/processStore.js';
|
||||||
import {useTagsView} from '@/stores/tagsview.js'
|
import {useTagsView} from '@/stores/tagsview.js'
|
||||||
|
|
||||||
const tagsViewStore = useTagsView()
|
const tagsViewStore = useTagsView()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const attachment = ref()
|
const attachment = ref()
|
||||||
const name=ref(router.currentRoute.value.name)
|
const name = ref(router.currentRoute.value.name)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const formData = ref({})
|
const formData = ref({})
|
||||||
const file = ref({})
|
|
||||||
const applyForm = ref()
|
const applyForm = ref()
|
||||||
const deploymentId = ref()
|
const deploymentId = ref()
|
||||||
const showTable = ref(true)
|
const showTable = ref(true)
|
||||||
@@ -46,9 +47,9 @@ const processInstanceData = ref()
|
|||||||
const processDiagramViewer = ref(true)
|
const processDiagramViewer = ref(true)
|
||||||
const processStore = useProcessStore()
|
const processStore = useProcessStore()
|
||||||
const compositeParam = (item) => {
|
const compositeParam = (item) => {
|
||||||
let tag=''
|
let tag = ''
|
||||||
if(name.value==='Implementation/check'||name.value === 'Implementation/edit'){
|
if (name.value === 'Implementation/check' || name.value === 'Implementation/edit') {
|
||||||
tag='项目验收'
|
tag = '项目验收'
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
fileId: item.id,
|
fileId: item.id,
|
||||||
@@ -62,7 +63,6 @@ const compositeParam = (item) => {
|
|||||||
}
|
}
|
||||||
const getAttachment = (val) => {
|
const getAttachment = (val) => {
|
||||||
console.log('上传文件getAttachment', val)
|
console.log('上传文件getAttachment', val)
|
||||||
file.value=compositeParam(val)
|
|
||||||
formData.value.singleFile = compositeParam(val)
|
formData.value.singleFile = compositeParam(val)
|
||||||
}
|
}
|
||||||
const getOtherFile = (val) => {
|
const getOtherFile = (val) => {
|
||||||
@@ -86,32 +86,20 @@ const handleSubmit = (instance) => {
|
|||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
let files = []
|
let files = []
|
||||||
let singleFile={}
|
otherFileList.value.forEach(item => {
|
||||||
let fileArray
|
|
||||||
if(name.value === 'Implementation/edit'){
|
|
||||||
singleFile = {
|
|
||||||
fileId: attachment.value.singleFile.fileId
|
|
||||||
}
|
|
||||||
fileArray=attachment.value.allFileList
|
|
||||||
}else {
|
|
||||||
if (file.value.fileId !== undefined) {
|
|
||||||
singleFile = {
|
|
||||||
fileId: file.value.fileId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fileArray=otherFileList.value
|
|
||||||
}
|
|
||||||
fileArray.forEach(item => {
|
|
||||||
files.push(getFileParam(item))
|
files.push(getFileParam(item))
|
||||||
})
|
})
|
||||||
|
if (formData.value.singleFile !== undefined) {
|
||||||
|
formData.value.singleFile = getFileParam(formData.value.singleFile)
|
||||||
|
}
|
||||||
let params = {
|
let params = {
|
||||||
deploymentId: deploymentId.value,
|
deploymentId: deploymentId.value,
|
||||||
requirementId: route.query.id,
|
requirementId: route.query.id,
|
||||||
fileList: files,
|
fileList: files,
|
||||||
singleFile: singleFile,
|
singleFile: formData.value.singleFile,
|
||||||
projectId:route.query.projectId,
|
projectId: route.query.projectId,
|
||||||
}
|
}
|
||||||
if (JSON.stringify(singleFile) === "{}") {
|
if (!attachment.value.isSingleFile) {
|
||||||
attachment.value.validate()
|
attachment.value.validate()
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -119,10 +107,10 @@ const handleSubmit = (instance) => {
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}else {
|
} else {
|
||||||
attachment.value.clearValidate()
|
attachment.value.clearValidate()
|
||||||
}
|
}
|
||||||
console.log('params-提交',params)
|
console.log('params-提交', params)
|
||||||
let res = await projectCheck(params)
|
let res = await projectCheck(params)
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -141,34 +129,21 @@ const handleResubmit = (instance) => {
|
|||||||
if (!instance) return
|
if (!instance) return
|
||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
let singleFile = {}
|
|
||||||
let otherFiles = []
|
let otherFiles = []
|
||||||
let fileArray
|
if (name.value === 'Implementation/edit') {
|
||||||
if (attachment.value.singleFile!==null&&name.value === 'Implementation/edit') {
|
attachment.value.allFileList?.forEach(item => {
|
||||||
singleFile = {
|
otherFiles.push(getFileParam(item))
|
||||||
fileId: attachment.value.singleFile.fileId
|
})
|
||||||
}
|
|
||||||
fileArray = attachment.value.allFileList
|
|
||||||
} else {
|
|
||||||
if (file.value.fileId !== undefined) {
|
|
||||||
singleFile = {
|
|
||||||
fileId: file.value.fileId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fileArray = otherFileList.value
|
|
||||||
}
|
}
|
||||||
fileArray.forEach(item => {
|
|
||||||
otherFiles.push(getFileParam(item))
|
|
||||||
})
|
|
||||||
//todo requirementId
|
|
||||||
let params = {
|
let params = {
|
||||||
deploymentId: deploymentId.value,
|
deploymentId: deploymentId.value,
|
||||||
requirementId: route.query.id,
|
requirementId: route.query.id,
|
||||||
fileList: otherFiles,
|
fileList: otherFiles,
|
||||||
singleFile: singleFile,
|
singleFile: formData.value.singleFile,
|
||||||
projectId: route.query.projectId,
|
projectId: route.query.projectId,
|
||||||
}
|
}
|
||||||
if (JSON.stringify(singleFile) === "{}") {
|
if (!attachment.value.isSingleFile || !formData.value.singleFile) {
|
||||||
attachment.value.validate()
|
attachment.value.validate()
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -176,7 +151,7 @@ const handleResubmit = (instance) => {
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
return;
|
return;
|
||||||
}else {
|
} else {
|
||||||
attachment.value.clearValidate()
|
attachment.value.clearValidate()
|
||||||
}
|
}
|
||||||
console.log('重新提交params', params)
|
console.log('重新提交params', params)
|
||||||
@@ -204,16 +179,16 @@ const getDetailInfo = async () => {
|
|||||||
})
|
})
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
formData.value = res.data.formData
|
formData.value = res.data.formData
|
||||||
loading.value=false
|
loading.value = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const init = () => {
|
const init = () => {
|
||||||
getProjectCheckProcess(route.query.projectId).then(res => {
|
getProjectCheckProcess(route.query.projectId).then(res => {
|
||||||
processDiagramViewer.value = false
|
processDiagramViewer.value = false
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
let data = res.data
|
let data = res.data
|
||||||
deploymentId.value=data.deploymentId
|
deploymentId.value = data.deploymentId
|
||||||
processInstanceData.value = data
|
processInstanceData.value = data
|
||||||
processStore.setDesign(data)
|
processStore.setDesign(data)
|
||||||
processStore.runningList.value = data.runningList;
|
processStore.runningList.value = data.runningList;
|
||||||
@@ -224,7 +199,7 @@ const init = () => {
|
|||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
processDiagramViewer.value = true
|
processDiagramViewer.value = true
|
||||||
})
|
})
|
||||||
}else {
|
} else {
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
@@ -235,8 +210,8 @@ const init = () => {
|
|||||||
}
|
}
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await init()
|
await init()
|
||||||
if (name.value === 'Implementation/edit'){
|
if (name.value === 'Implementation/edit') {
|
||||||
loading.value=true
|
loading.value = true
|
||||||
await getDetailInfo()
|
await getDetailInfo()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<AttachmentUpload ref="attachment" label="需求申请书附件" :showTable="showTable" :otherFileList="otherFileList"
|
<AttachmentUpload ref="attachment" label="项目立项附件" :showTable="showTable" :otherFileList="otherFileList"
|
||||||
@getAttachment="getAttachment"
|
@getAttachment="getAttachment"
|
||||||
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData"
|
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData"
|
||||||
:preview="name === 'Initiation/edit'"/>
|
:preview="name === 'Initiation/edit'"/>
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
<script setup lang="jsx">
|
<script setup lang="jsx">
|
||||||
import {useTagsView} from '@/stores/tagsview.js'
|
import {useTagsView} from '@/stores/tagsview.js'
|
||||||
import { ElNotification} from "element-plus";
|
import {ElNotification} from "element-plus";
|
||||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
|
||||||
import {getApplyProcess, projectApply, resubmitApply, getApplyDetail} from "@/api/project-manage";
|
import {getApplyProcess, projectApply, resubmitApply, getApplyDetail} from "@/api/project-manage";
|
||||||
import {useProcessStore} from '@/stores/processStore.js';
|
import {useProcessStore} from '@/stores/processStore.js';
|
||||||
@@ -43,7 +43,6 @@ const rules = reactive({
|
|||||||
const processStore = useProcessStore()
|
const processStore = useProcessStore()
|
||||||
const deploymentId = ref()
|
const deploymentId = ref()
|
||||||
const attachment = ref()
|
const attachment = ref()
|
||||||
const file = ref({})
|
|
||||||
const applyForm = ref()
|
const applyForm = ref()
|
||||||
const showTable = ref(true)
|
const showTable = ref(true)
|
||||||
const otherFileList = ref([])
|
const otherFileList = ref([])
|
||||||
@@ -114,7 +113,6 @@ const compositeParam = (item) => {
|
|||||||
}
|
}
|
||||||
const getAttachment = (val) => {
|
const getAttachment = (val) => {
|
||||||
console.log('上传文件getAttachment', val)
|
console.log('上传文件getAttachment', val)
|
||||||
file.value = compositeParam(val)
|
|
||||||
formData.value.singleFile = compositeParam(val)
|
formData.value.singleFile = compositeParam(val)
|
||||||
}
|
}
|
||||||
const getOtherFile = (val) => {
|
const getOtherFile = (val) => {
|
||||||
@@ -137,16 +135,20 @@ const handleSubmit = (instance) => {
|
|||||||
instance.validate(async (valid) => {
|
instance.validate(async (valid) => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
let files = []
|
let files = []
|
||||||
let singleFile = {}
|
|
||||||
if (file.value.fileId !== undefined) {
|
|
||||||
singleFile = {
|
|
||||||
fileId: file.value.fileId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
otherFileList.value.forEach(item => {
|
otherFileList.value.forEach(item => {
|
||||||
files.push(getFileParam(item))
|
files.push(getFileParam(item))
|
||||||
})
|
})
|
||||||
if (JSON.stringify(singleFile) === "{}") {
|
if (formData.value.singleFile !== undefined) {
|
||||||
|
formData.value.singleFile = getFileParam(formData.value.singleFile)
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
deploymentId: deploymentId.value,
|
||||||
|
requirementId: route.query.id,
|
||||||
|
fileList: files,
|
||||||
|
singleFile: formData.value.singleFile,
|
||||||
|
projectId: route.query.projectId,
|
||||||
|
}
|
||||||
|
if (!attachment.value.isSingleFile) {
|
||||||
attachment.value.validate()
|
attachment.value.validate()
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -157,13 +159,6 @@ const handleSubmit = (instance) => {
|
|||||||
} else {
|
} else {
|
||||||
attachment.value.clearValidate()
|
attachment.value.clearValidate()
|
||||||
}
|
}
|
||||||
let params = {
|
|
||||||
deploymentId: deploymentId.value,
|
|
||||||
requirementId: route.query.id,
|
|
||||||
fileList: files,
|
|
||||||
singleFile: singleFile,
|
|
||||||
projectId: route.query.projectId,
|
|
||||||
}
|
|
||||||
console.log('params', params)
|
console.log('params', params)
|
||||||
let res = await projectApply(params)
|
let res = await projectApply(params)
|
||||||
ElNotification({
|
ElNotification({
|
||||||
@@ -181,32 +176,21 @@ const handleSubmit = (instance) => {
|
|||||||
}
|
}
|
||||||
const handleResubmit = async () => {
|
const handleResubmit = async () => {
|
||||||
let files = []
|
let files = []
|
||||||
let singleFile = {}
|
if (name.value === 'Initiation/edit') {
|
||||||
let fileArray
|
attachment.value.allFileList.forEach(item => {
|
||||||
if (attachment.value.singleFile !== null && name.value === 'Initiation/edit') {
|
files.push(getFileParam(item))
|
||||||
singleFile = {
|
})
|
||||||
fileId: attachment.value.singleFile.fileId
|
|
||||||
}
|
|
||||||
fileArray = attachment.value.allFileList
|
|
||||||
} else {
|
|
||||||
if (file.value.fileId !== undefined) {
|
|
||||||
singleFile = {
|
|
||||||
fileId: file.value.fileId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fileArray = otherFileList.value
|
|
||||||
}
|
}
|
||||||
fileArray.forEach(item => {
|
|
||||||
files.push(getFileParam(item))
|
|
||||||
})
|
|
||||||
let params = {
|
let params = {
|
||||||
deploymentId: deploymentId.value,
|
deploymentId: deploymentId.value,
|
||||||
requirementId: route.query.id,
|
requirementId: route.query.id,
|
||||||
fileList: files,
|
fileList: files,
|
||||||
singleFile: singleFile,
|
singleFile: formData.value.singleFile,
|
||||||
projectId: route.query.projectId,
|
projectId: route.query.projectId,
|
||||||
}
|
}
|
||||||
if (JSON.stringify(singleFile) === "{}") {
|
console.log('params', params, attachment.value.isSingleFile)
|
||||||
|
if (!attachment.value.isSingleFile || !formData.value.singleFile) {
|
||||||
attachment.value.validate()
|
attachment.value.validate()
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
@@ -217,7 +201,6 @@ const handleResubmit = async () => {
|
|||||||
} else {
|
} else {
|
||||||
attachment.value.clearValidate()
|
attachment.value.clearValidate()
|
||||||
}
|
}
|
||||||
console.log('params', params)
|
|
||||||
let res = await resubmitApply(params)
|
let res = await resubmitApply(params)
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
|
|||||||
Reference in New Issue
Block a user