物资文件上传
This commit is contained in:
parent
de858331a0
commit
0596f2a887
|
|
@ -30,8 +30,6 @@ export function imgUpLoad(param){
|
||||||
formData.append('files', item)
|
formData.append('files', item)
|
||||||
})
|
})
|
||||||
// formData.append('files', param)
|
// formData.append('files', param)
|
||||||
console.log('param',param)
|
|
||||||
console.log('formData',formData)
|
|
||||||
return request({
|
return request({
|
||||||
url: '/file/uploadFiles',
|
url: '/file/uploadFiles',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
|
|
||||||
|
|
@ -234,6 +234,7 @@
|
||||||
import { imgUpLoadThree, fileUpLoad } from '@/api/system/upload'
|
import { imgUpLoadThree, fileUpLoad } from '@/api/system/upload'
|
||||||
import { downloadFile,downloadFileData } from '@/utils/download'
|
import { downloadFile,downloadFileData } from '@/utils/download'
|
||||||
import { getToken } from '@/utils/auth'
|
import { getToken } from '@/utils/auth'
|
||||||
|
import { forEach } from 'jszip';
|
||||||
export default {
|
export default {
|
||||||
name: "supplier",
|
name: "supplier",
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -383,8 +384,6 @@
|
||||||
sum = index
|
sum = index
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
this.businessLicenseListTemp.splice(sum, 1)
|
this.businessLicenseListTemp.splice(sum, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -530,7 +529,7 @@
|
||||||
if (this.form.supplierId != undefined) {
|
if (this.form.supplierId != undefined) {
|
||||||
const reqData = new FormData();
|
const reqData = new FormData();
|
||||||
if(this.businessLicenseListTemp.length!=0){
|
if(this.businessLicenseListTemp.length!=0){
|
||||||
await this.getImaUpload(),
|
await this.getImaUploadEdit(),
|
||||||
await this.editFacturerTemp(this.form);
|
await this.editFacturerTemp(this.form);
|
||||||
}else{
|
}else{
|
||||||
await this.editFacturerTemp(this.form);
|
await this.editFacturerTemp(this.form);
|
||||||
|
|
@ -554,6 +553,7 @@
|
||||||
const reqData = new FormData()
|
const reqData = new FormData()
|
||||||
const {fileTwo} = await this.getFileData()
|
const {fileTwo} = await this.getFileData()
|
||||||
let res = await imgUpLoadThree(fileTwo);
|
let res = await imgUpLoadThree(fileTwo);
|
||||||
|
console.log('res',res)
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
res.data.forEach(item=>{
|
res.data.forEach(item=>{
|
||||||
let objTwo = { 'name': item.name, 'url': item.url,'modelId': null, 'dicId':4 };
|
let objTwo = { 'name': item.name, 'url': item.url,'modelId': null, 'dicId':4 };
|
||||||
|
|
@ -563,6 +563,29 @@
|
||||||
this.$modal.msgError(res.msg);
|
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){
|
async addFacturerTemp(form){
|
||||||
this.form.bmFileInfos=this.businessLicenseFileList
|
this.form.bmFileInfos=this.businessLicenseFileList
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue