|
|
@ -158,6 +158,24 @@ |
|
|
|
@click="handleImportSap()" |
|
|
|
>同步到SAP |
|
|
|
</el-button> |
|
|
|
<div v-if="this.resultData && this.resultData.errSize > 0"> |
|
|
|
<el-card shadow="always"> |
|
|
|
<!-- <i class="el-icon-error" /> --> |
|
|
|
<p> |
|
|
|
<span style="color: red" |
|
|
|
>{{ this.resultData.successMessage }} |
|
|
|
</span> |
|
|
|
<el-button type="text" @click="downloadErrData" |
|
|
|
>下载错误数据</el-button |
|
|
|
> |
|
|
|
</p> |
|
|
|
</el-card> |
|
|
|
</div> |
|
|
|
<div v-else-if="this.resultData.errSize === 0"> |
|
|
|
<p> |
|
|
|
<span>{{ this.resultData.successMessage }} </span> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</flexbox> |
|
|
@ -438,6 +456,13 @@ export default { |
|
|
|
userId: "", |
|
|
|
accountDate: undefined, |
|
|
|
}, |
|
|
|
resultData: { |
|
|
|
totalSize: 0, |
|
|
|
errSize: 0, |
|
|
|
errTemplate: "", |
|
|
|
errMessage: "", |
|
|
|
successMessage: "", |
|
|
|
}, |
|
|
|
materialGroupList: [], |
|
|
|
getmaterialGroupValue: "", |
|
|
|
page: 1, |
|
|
@ -530,6 +555,42 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
/** |
|
|
|
* 下载错误模板 |
|
|
|
*/ |
|
|
|
downloadErrData() { |
|
|
|
let fileNameOfProject = this.resultData.errTemplate; |
|
|
|
this.$axios |
|
|
|
.BolbGets( |
|
|
|
"/api/settleaccount/getblobfile/download/" + fileNameOfProject |
|
|
|
) |
|
|
|
.then((response) => { |
|
|
|
if (fileNameOfProject.indexOf("_") != -1) { |
|
|
|
let downName = |
|
|
|
fileNameOfProject.slice(0, fileNameOfProject.lastIndexOf("_")) + |
|
|
|
fileNameOfProject.slice(fileNameOfProject.lastIndexOf(".")); |
|
|
|
downloadFile(response, downName); |
|
|
|
this.$notify({ |
|
|
|
title: "成功", |
|
|
|
message: "错误数据-导出成功!", |
|
|
|
type: "success", |
|
|
|
duration: 2000, |
|
|
|
}); |
|
|
|
} else { |
|
|
|
downloadFile(response, fileNameOfProject); |
|
|
|
this.$notify({ |
|
|
|
title: "成功", |
|
|
|
message: "错误数据-导出成功!", |
|
|
|
type: "success", |
|
|
|
duration: 2000, |
|
|
|
}); |
|
|
|
} |
|
|
|
this.listLoading = false; |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
this.listLoading = false; |
|
|
|
}); |
|
|
|
}, |
|
|
|
valueChange(data) { |
|
|
|
this.getmaterialGroupValue = ""; |
|
|
|
this.getmaterialGroupValue += data + ","; |
|
|
@ -644,6 +705,7 @@ export default { |
|
|
|
this.isEdit = false; |
|
|
|
this.form = {}; |
|
|
|
this.dialogAccounDateVisible = true; |
|
|
|
this.resultData = {}; |
|
|
|
}, |
|
|
|
//生成出库单数据 |
|
|
|
save() { |
|
|
@ -695,6 +757,7 @@ export default { |
|
|
|
this.$refs.formCount.validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.formLoading = true; |
|
|
|
this.resultData.errSize == 0; //重新弹窗 |
|
|
|
if (this.dataValue === "") { |
|
|
|
this.$message.error("必需选择过账日期!"); |
|
|
|
this.formLoading = false; |
|
|
@ -713,22 +776,23 @@ export default { |
|
|
|
this.listQuery |
|
|
|
) |
|
|
|
.then((res) => { |
|
|
|
if (res == true) { |
|
|
|
if (res === "Success") { |
|
|
|
this.$notify({ |
|
|
|
title: "成功", |
|
|
|
message: "数据同步成功!", |
|
|
|
message: "数据同步SAP成功!", |
|
|
|
type: "success", |
|
|
|
duration: 2000, |
|
|
|
}); |
|
|
|
this.resultData.errSize = 0; |
|
|
|
this.resultData.successMessage = "同步SAP成功!"; |
|
|
|
this.getList(); |
|
|
|
this.formLoading = false; |
|
|
|
this.dialogAccounDateVisible = false; |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
message: "数据同步失败!", |
|
|
|
type: "warning", |
|
|
|
}); |
|
|
|
this.resultData.errTemplate = res; //指定错误模板名称,作为参数,用于错误模板下载 |
|
|
|
this.resultData.errSize = 1; //保持大于0,用于控制错误数据下载按钮的可不可见 |
|
|
|
this.resultData.successMessage = "同步SAP失败,单击下载!"; |
|
|
|
} |
|
|
|
this.formLoading = false; |
|
|
|
this.dialogAccounDateVisible = false; |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
this.formLoading = false; |
|
|
|