Commit 29d51a8a by Jaxon

Merge branch 'feature/goods-shelf' into 'SAAS+V5.8.0'

fix(profitMarginTable): 修复利润率表格的初始化和数据计算逻辑

See merge request !636
2 parents 93220793 22dc23b9
...@@ -272,17 +272,24 @@ export default { ...@@ -272,17 +272,24 @@ export default {
}, },
async mounted() { async mounted() {
if (this.useEdit) {
await this.getCalculateData();
}
await this.withLoading(async () => { await this.withLoading(async () => {
const { profitRateCalFinish } = await getShelfProductUpdateStep({ businessCode: this.businessCode });
if (profitRateCalFinish === "Y") {
await this.getTableData(); await this.getTableData();
await this.$nextTick(); await this.$nextTick();
await this.setTableHeight(); await this.setTableHeight();
if (this.$refs.tableRef) { if (this.$refs.tableRef) {
this.$refs.tableRef.doLayout(); this.$refs.tableRef.doLayout();
} }
}); return;
}
if (this.useEdit) { if (this.useEdit) {
await this.getCalculateData(); await this.getCalculateData(profitRateCalFinish);
} }
});
window.addEventListener("resize", this.setTableHeight); window.addEventListener("resize", this.setTableHeight);
}, },
beforeDestroy() { beforeDestroy() {
...@@ -293,18 +300,18 @@ export default { ...@@ -293,18 +300,18 @@ export default {
}, },
methods: { methods: {
isZeroOrNumber, isZeroOrNumber,
async getCalculateData() { async getCalculateData(profitRateCalFinish) {
const { profitRateCalFinish } = await getShelfProductUpdateStep({ businessCode: this.businessCode });
const that = this; const that = this;
const requestFn = () => { const requestFn = () => {
return getShelfProductUpdateStep({ businessCode: that.businessCode }); return getShelfProductUpdateStep({ businessCode: that.businessCode });
}; };
async function stopCondition({ profitRateCalFinish }) { async function stopCondition({ profitRateCalFinish }) {
console.log("profitRateCalFinish", profitRateCalFinish);
// // 更新数据 // // 更新数据
if (profitRateCalFinish === "Y") { if (profitRateCalFinish === "Y") {
await that.getTableData(); await that.getTableData();
await that.$nextTick();
await that.setTableHeight();
that.dialog.profitRateCalFinish.show = false; that.dialog.profitRateCalFinish.show = false;
return true; return true;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!