var json = this.spread.toJSON();
let excelIo = new ExcelIO.IO();
let _this = this;
excelIo.save(
json,
function(blob) {
let fd = new FormData();
let config = {};
fd.append("file", blob); //Excel文件
axios
.post(url.dataEntry.templateSonPublish, fd)
.then(res => {
_this.show_disabled = false;
if (res.data.code == 0) {
if (
_this.$store.state.dataentry.editRowSelect
.isNeedApprove == 0
) {
_this.$message({
message: "入库成功!",
type: "success"
});
} else {
_this.$message({
message: "提交成功!",
type: "success"
});
}
_this.$router.push({
path: "./DataEntry"
});
} else {
_this.$message({
message: res.data.msg,
type: "error"
});
}
});
},
function(e) {
console.log(e);
}
)
- {errorCode: 1, errorMessage: "文件格式错误"}
- errorCode: 1
- errorMessage: "文件格式错误"
|