物资类型导出修改
This commit is contained in:
parent
da7888a9d8
commit
9e90d6d352
|
|
@ -180,7 +180,7 @@
|
||||||
<el-upload
|
<el-upload
|
||||||
class = "upload-demo"
|
class = "upload-demo"
|
||||||
action="#"
|
action="#"
|
||||||
:file-list="businessLicenseList"
|
:file-list="businessLicenseListTemp"
|
||||||
:show-file-list="true"
|
:show-file-list="true"
|
||||||
:auto-upload="false"
|
:auto-upload="false"
|
||||||
list-type="picture-card"
|
list-type="picture-card"
|
||||||
|
|
@ -291,7 +291,8 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
fileList:[],
|
fileList:[],
|
||||||
businessLicenseList:[],
|
businessLicenseFileList:[],
|
||||||
|
businessLicenseListTemp:[],
|
||||||
delBusinessFileIdList:[],
|
delBusinessFileIdList:[],
|
||||||
//图片查看弹窗
|
//图片查看弹窗
|
||||||
dialogImageUrl: '',
|
dialogImageUrl: '',
|
||||||
|
|
@ -316,7 +317,7 @@
|
||||||
|
|
||||||
//图片上传1张后,隐藏上传框
|
//图片上传1张后,隐藏上传框
|
||||||
uploadDisabled() {
|
uploadDisabled() {
|
||||||
return this.businessLicenseList.length > 2
|
return this.businessLicenseListTemp.length > 2
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -326,7 +327,7 @@
|
||||||
//提交时循环fileList 获取raw文件
|
//提交时循环fileList 获取raw文件
|
||||||
getFileData() {
|
getFileData() {
|
||||||
const fileTwo = []
|
const fileTwo = []
|
||||||
this.businessLicenseList.forEach(item => {
|
this.businessLicenseListTemp.forEach(item => {
|
||||||
if (item?.hasOwnProperty('raw')) {
|
if (item?.hasOwnProperty('raw')) {
|
||||||
fileTwo.push(item.raw)
|
fileTwo.push(item.raw)
|
||||||
}
|
}
|
||||||
|
|
@ -336,13 +337,13 @@
|
||||||
|
|
||||||
// 图片上传
|
// 图片上传
|
||||||
async imgUpLoadTwoAll(param, name, index) {
|
async imgUpLoadTwoAll(param, name, index) {
|
||||||
console.log(param, 'image')
|
|
||||||
param.type = 'ma'
|
param.type = 'ma'
|
||||||
await imgUpLoadTwo(param)
|
imgUpLoadTwo(param)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.imageUrl = res.data.url
|
let obj = {'name':res.data.name,'url':res.data.url}
|
||||||
this.businessLicenseList.push(this.imageUrl);
|
console.log('obj',obj)
|
||||||
|
this.businessLicenseFileList.push(obj);
|
||||||
} else {
|
} else {
|
||||||
// this.$msgError(res.msg)
|
// this.$msgError(res.msg)
|
||||||
this.$modal.msgError(res.msg)
|
this.$modal.msgError(res.msg)
|
||||||
|
|
@ -368,14 +369,14 @@
|
||||||
},
|
},
|
||||||
handleRemoveElectricianImgList(file, fileList) {
|
handleRemoveElectricianImgList(file, fileList) {
|
||||||
let sum = 0
|
let sum = 0
|
||||||
this.businessLicenseList.forEach((item, index) => {
|
this.businessLicenseListTemp.forEach((item, index) => {
|
||||||
if (item.uid == file.uid) {
|
if (item.uid == file.uid) {
|
||||||
sum = index
|
sum = index
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
this.businessLicenseList.splice(sum, 1)
|
this.businessLicenseListTemp.splice(sum, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
isImage(file){
|
isImage(file){
|
||||||
|
|
@ -444,8 +445,8 @@
|
||||||
this.urlTemp = require('../../../../assets/file.png');
|
this.urlTemp = require('../../../../assets/file.png');
|
||||||
|
|
||||||
}
|
}
|
||||||
}),
|
});
|
||||||
this.businessLicenseList = fileList;
|
this.businessLicenseListTemp = fileList;
|
||||||
},
|
},
|
||||||
|
|
||||||
async getList() {
|
async getList() {
|
||||||
|
|
@ -488,8 +489,8 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
//** 提交按钮 */
|
//** 提交按钮 */
|
||||||
async submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(async valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.supplierId != undefined) {
|
if (this.form.supplierId != undefined) {
|
||||||
const reqData = new FormData();
|
const reqData = new FormData();
|
||||||
|
|
@ -498,34 +499,43 @@
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
this.showHouse = false;
|
this.showHouse = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
this.businessLicenseList=[];
|
this.businessLicenseListTemp=[];
|
||||||
this.delBusinessFileIdList=[];
|
this.delBusinessFileIdList=[];
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
await this.getImaUpload(),
|
||||||
|
console.log('businessLicenseFileList',this.businessLicenseFileList)
|
||||||
|
this.form.businessLicenseFileList=this.businessLicenseFileList
|
||||||
|
await this.addFacturerTemp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async getImaUpload(){
|
||||||
const reqData = new FormData()
|
const reqData = new FormData()
|
||||||
const {fileTwo} = this.getFileData()
|
const {fileTwo} = this.getFileData()
|
||||||
fileTwo.forEach(async item=>{
|
fileTwo.forEach( item=>{
|
||||||
let obj={file: item};
|
let obj={file: item};
|
||||||
await this.imgUpLoadTwoAll(obj,name,name);
|
this.imgUpLoadTwoAll(obj,name,name);
|
||||||
|
|
||||||
})
|
})
|
||||||
this.form.businessLicenseList=this.businessLicenseList
|
},
|
||||||
addFacturer(this.form).then(async response => {
|
async addFacturerTemp(form){
|
||||||
|
addFacturer(this.form).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.showHouse = false;
|
this.showHouse = false;
|
||||||
await this.getList();
|
this.getList();
|
||||||
this.businessLicenseList=[];
|
this.businessLicenseListTemp=[];
|
||||||
|
this.businessLicenseFileList=[];
|
||||||
this.delBusinessFileIdList=[];
|
this.delBusinessFileIdList=[];
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.showHouse = false;
|
this.showHouse = false;
|
||||||
this.businessLicenseList=[];
|
this.businessLicenseFileList=[];
|
||||||
this.reset();
|
this.reset();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1000,8 +1000,10 @@ export default {
|
||||||
// },
|
// },
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
|
let queryTemp = this.queryParams;
|
||||||
|
queryTemp.level = 0;
|
||||||
this.download('/material/ma_type/export', {
|
this.download('/material/ma_type/export', {
|
||||||
...this.queryParams
|
...queryTemp
|
||||||
}, `物资类型信息_${new Date().getTime()}.xlsx`)
|
}, `物资类型信息_${new Date().getTime()}.xlsx`)
|
||||||
},
|
},
|
||||||
/* 树节点操作 */
|
/* 树节点操作 */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue