物资文件上传

This commit is contained in:
jjLv 2024-10-30 11:27:42 +08:00
parent de858331a0
commit 0596f2a887
2 changed files with 26 additions and 5 deletions

View File

@ -30,8 +30,6 @@ export function imgUpLoad(param){
formData.append('files', item)
})
// formData.append('files', param)
console.log('param',param)
console.log('formData',formData)
return request({
url: '/file/uploadFiles',
method: 'post',

View File

@ -234,6 +234,7 @@
import { imgUpLoadThree, fileUpLoad } from '@/api/system/upload'
import { downloadFile,downloadFileData } from '@/utils/download'
import { getToken } from '@/utils/auth'
import { forEach } from 'jszip';
export default {
name: "supplier",
data() {
@ -383,8 +384,6 @@
sum = index
}
})
this.businessLicenseListTemp.splice(sum, 1)
},
@ -530,7 +529,7 @@
if (this.form.supplierId != undefined) {
const reqData = new FormData();
if(this.businessLicenseListTemp.length!=0){
await this.getImaUpload(),
await this.getImaUploadEdit(),
await this.editFacturerTemp(this.form);
}else{
await this.editFacturerTemp(this.form);
@ -554,6 +553,7 @@
const reqData = new FormData()
const {fileTwo} = await this.getFileData()
let res = await imgUpLoadThree(fileTwo);
console.log('res',res)
if (res.code === 200) {
res.data.forEach(item=>{
let objTwo = { 'name': item.name, 'url': item.url,'modelId': null, 'dicId':4 };
@ -563,6 +563,29 @@
this.$modal.msgError(res.msg);
}
},
async getImaUploadEdit(){
this.businessLicenseFileList = []
const {fileTwo} = await this.getFileData()
console.log('fileTwo',fileTwo)
this.businessLicenseListTemp.forEach(item=>{
if(item.status=='success'){
let objThree = { 'name': item.name, 'url': item.url,'modelId': null, 'dicId':4 };
this.businessLicenseFileList.push(objThree);
}
})
if(fileTwo.length!=0){
let res = await imgUpLoadThree(fileTwo);
if (res.code === 200) {
res.data.forEach(item=>{
let objTwo = { 'name': item.name, 'url': item.url,'modelId': null, 'dicId':4 };
this.businessLicenseFileList.push(objTwo);
})
} else {
this.$modal.msgError(res.msg);
}
}
},
async addFacturerTemp(form){
this.form.bmFileInfos=this.businessLicenseFileList