企标编写汇总节点-上传发布稿-上传两个文件后,页面只显示一个文件

This commit is contained in:
zeng yuneng
2022-12-01 15:23:00 +08:00
parent a8e0634eb3
commit e8ebf622f8
2 changed files with 66 additions and 18 deletions
@@ -348,7 +348,8 @@ export default {
_this: this _this: this
}, res => { }, res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) // this.$message.success(res.message)
this.$message.success('驳回成功')
this.$router.push('/processCenter') this.$router.push('/processCenter')
} }
this.isSubmit = false this.isSubmit = false
@@ -1246,6 +1246,7 @@
this.XGDFileList = list3 this.XGDFileList = list3
this.QTWJBUSSFileList = list4 this.QTWJBUSSFileList = list4
this.GLWJBUSSFileList = list5 this.GLWJBUSSFileList = list5
console.log(fileType)
if(fileMadel){ if(fileMadel){
this.fileType = fileType this.fileType = fileType
this.fileUpload(fileType) this.fileUpload(fileType)
@@ -2134,42 +2135,88 @@
// fileList = fileList.splice(0, 1) // fileList = fileList.splice(0, 1)
// } // }
if (response.ok) { if (response.ok) {
const fileObj = {} // debugger
fileObj.id = file.response.data.id for(let i = 0 ; i < fileList.length ; i++){
fileObj.name = file.response.data.name const fileObj = {}
switch (this.fileType){ console.log(fileList[i],'fileList[i]')
fileObj.id = fileList[i].response ? fileList[i].response.data.id : fileList[i].id
fileObj.name =fileList[i].response? fileList[i].response.data.name : fileList[i].name
switch (this.fileType){
case 'FBGBUSS': case 'FBGBUSS':
this.FBGBUSSFileList = this.FBGBUSSFileList.filter ( item => item.response === undefined); this.FBGBUSSFileList = this.FBGBUSSFileList.filter ( item => item.response === undefined);
if(this.FBGBUSSFileList.every((item)=>item.id !== fileObj.id) && fileObj.id!==undefined){
this.FBGBUSSFileList.push(fileObj) this.FBGBUSSFileList.push(fileObj)
break; }
break;
case 'BZSMBUSS' : case 'BZSMBUSS' :
this.BZSMBUSSFileList = this.BZSMBUSSFileList.filter ( item => item.response === undefined); this.BZSMBUSSFileList = this.BZSMBUSSFileList.filter ( item => item.response === undefined);
if(this.BZSMBUSSFileList.every((item)=>item.id !== fileObj.id) && fileObj.id!==undefined)
this.BZSMBUSSFileList.push(fileObj) this.BZSMBUSSFileList.push(fileObj)
break; break;
case 'LSBBBUSS': case 'LSBBBUSS':
this.LSBBBUSSFileList = this.LSBBBUSSFileList.filter ( item => item.response === undefined); this.LSBBBUSSFileList = this.LSBBBUSSFileList.filter ( item => item.response === undefined);
if(this.LSBBBUSSFileList.every((item)=>item.id !== fileObj.id) && fileObj.id!==undefined)
this.LSBBBUSSFileList.push(fileObj) this.LSBBBUSSFileList.push(fileObj)
break; break;
case 'QTWJBUSS': case 'QTWJBUSS':
this.QTWJBUSSFileList = this.QTWJBUSSFileList.filter ( item => item.response === undefined); this.QTWJBUSSFileList = this.QTWJBUSSFileList.filter ( item => item.response === undefined);
if(this.QTWJBUSSFileList.every((item)=>item.id !== fileObj.id) && fileObj.id!==undefined)
this.QTWJBUSSFileList.push(fileObj) this.QTWJBUSSFileList.push(fileObj)
break; break;
case 'GLWJBUSS': case 'GLWJBUSS':
this.GLWJBUSSFileList = this.GLWJBUSSFileList.filter ( item => item.response === undefined); this.GLWJBUSSFileList = this.GLWJBUSSFileList.filter ( item => item.response === undefined);
if(this.GLWJBUSSFileList.every((item)=>item.id !== fileObj.id) && fileObj.id!==undefined)
this.GLWJBUSSFileList.push(fileObj) this.GLWJBUSSFileList.push(fileObj)
break; break;
case 'XGD': case 'XGD':
this.XGDFileList = this.XGDFileList.filter ( item => item.response === undefined); this.XGDFileList = this.XGDFileList.filter ( item => item.response === undefined);
if(this.XGDFileList.every((item)=>item.id !== fileObj.id) && fileObj.id!==undefined)
this.XGDFileList.push(fileObj) this.XGDFileList.push(fileObj)
break; break;
default : ; default : ;
} }
// }
console.log(this.FBGBUSSFileList)
}
// const fileObj = {}
// fileObj.id = file.response.data.id
// fileObj.name = file.response.data.name
// console.log(fileObj.name,'fileObj.name')
// switch (this.fileType){
// case 'FBGBUSS':
// this.FBGBUSSFileList = this.FBGBUSSFileList.filter ( item => item.response === undefined);
// this.FBGBUSSFileList.push(fileObj)
// break;
// case 'BZSMBUSS' :
// this.BZSMBUSSFileList = this.BZSMBUSSFileList.filter ( item => item.response === undefined);
// this.BZSMBUSSFileList.push(fileObj)
// break;
// case 'LSBBBUSS':
// this.LSBBBUSSFileList = this.LSBBBUSSFileList.filter ( item => item.response === undefined);
// this.LSBBBUSSFileList.push(fileObj)
// break;
// case 'QTWJBUSS':
// this.QTWJBUSSFileList = this.QTWJBUSSFileList.filter ( item => item.response === undefined);
// this.QTWJBUSSFileList.push(fileObj)
// break;
// case 'GLWJBUSS':
// this.GLWJBUSSFileList = this.GLWJBUSSFileList.filter ( item => item.response === undefined);
// this.GLWJBUSSFileList.push(fileObj)
// break;
// case 'XGD':
// this.XGDFileList = this.XGDFileList.filter ( item => item.response === undefined);
// this.XGDFileList.push(fileObj)
// break;
// default : ;
// }
this.formKey++ this.formKey++
this.$message({ this.$message({
showClose: true, showClose: true,
message: response.message, message: response.message,
type: 'success' type: 'success'
}) })
this.fileMadel = false
} }
}, },
downloadFile (data) { downloadFile (data) {