jinhui.wang

白名单导入校验修改

......@@ -100,13 +100,13 @@ export default {
trigger: "change",
},
],
file: [
{
required: true,
message: "文件不能为空",
trigger: "change",
},
]
// file: [
// {
// required: true,
// message: "文件不能为空",
// trigger: "change",
// },
// ]
},
fileList: [],
errorData: [],
......@@ -176,37 +176,41 @@ export default {
},
//导入Excel
upload() {
this.$refs['addForm'].validate(val => {
if (val) {
const file = this.formData.file;
let goodsStation = this.formData.uploadGoodsStation
this.loading = true;
uploadGoodsExcel(file, goodsStation).then((res) => {
this.loading = false;
if (res.code != 200) {
if (res.code == 603) {
this.$alert(res.msg, "提示", {
confirmButtonText: "确定",
type: "warning",
});
} else if (res.code === 201) {
this.$message.warning(res.msg);
if (res.data) {
this.errorData = res.data;
this.$router.push({ name: 'UpDateResult', params: { data: this.errorData, from: 'FlightInformationImport' } })
if (this.formData.file != null && this.formData.file != '') {
this.$refs['addForm'].validate(val => {
if (val) {
const file = this.formData.file;
let goodsStation = this.formData.uploadGoodsStation
this.loading = true;
uploadGoodsExcel(file, goodsStation).then((res) => {
this.loading = false;
if (res.code != 200) {
if (res.code == 603) {
this.$alert(res.msg, "提示", {
confirmButtonText: "确定",
type: "warning",
});
} else if (res.code === 201) {
this.$message.warning(res.msg);
if (res.data) {
this.errorData = res.data;
this.$router.push({ name: 'UpDateResult', params: { data: this.errorData, from: 'FlightInformationImport' } })
}
} else {
this.$message.warning(res.msg);
}
} else {
this.$message.warning(res.msg);
this.$message.success(res.msg);
}
} else {
this.$message.success(res.msg);
}
setTimeout(() => {
this.close()
}, 1000);
});
}
})
setTimeout(() => {
this.close()
}, 1000);
});
}
})
} else {
this.msgWarning('请选择文件后再导入!')
}
},
//导出Excel
download() {
......