From c31f1f697feab56c9373f10a58ae321bf882cdb4 Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 26 Oct 2022 11:38:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E7=AB=8B=E5=87=8F?= =?UTF-8?q?=E9=87=91=E5=BA=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UseCouponAddEdit/index.jsx | 4 ++-- src/components/UseGoodsScopePop/index.jsx | 1 + src/tools/index.js | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/UseCouponAddEdit/index.jsx b/src/components/UseCouponAddEdit/index.jsx index e8a1e4a2..5ef106be 100644 --- a/src/components/UseCouponAddEdit/index.jsx +++ b/src/components/UseCouponAddEdit/index.jsx @@ -75,8 +75,8 @@ const tableColumn = [ }, { title: "库存数量", - name: "quantity", - prop: "quantity", + name: "stock", + prop: "stock", type: "normal", width: "auto", }, diff --git a/src/components/UseGoodsScopePop/index.jsx b/src/components/UseGoodsScopePop/index.jsx index 23590452..51d2259d 100644 --- a/src/components/UseGoodsScopePop/index.jsx +++ b/src/components/UseGoodsScopePop/index.jsx @@ -36,6 +36,7 @@ const UseGoodsScopePop = forwardRef((props, ref) => { let form_model = productEl.current.getFormModel(); form_model.upstream = "直连天下"; form_model.type = 1; + form_model.stock = form_model.quantity; form_model.all_budget = mulNum( Number(form_model.contract_price), Number(form_model.quantity) diff --git a/src/tools/index.js b/src/tools/index.js index 91f7e61d..92d66a7e 100644 --- a/src/tools/index.js +++ b/src/tools/index.js @@ -1,5 +1,7 @@ +import { divNum } from "./number"; // 立减金对象重构 export const knockGoldFun = (item) => { + console.log("库存", item.stock); let table_obj = {}; table_obj.type = 2; // 类型 table_obj.upstream = String(item.channel) === "1" ? "支付宝" : "微信"; // 上游平台 @@ -10,6 +12,9 @@ export const knockGoldFun = (item) => { table_obj.official_price = item.reduce_amount; // 官方价 table_obj.contract_price = item.price; // 合同价格 table_obj.quantity = item.total_stock; // 库存数量 + table_obj.stock = item.stock + ? item.stock + : divNum(item.all_budget, item.reduce_amount); // 剩余库存数量 table_obj.channel_activity_id = item.channel_activity_id; // 批次号 table_obj.all_budget = Number(item.all_budget); // 总预算 table_obj.effectDate = `${item.time_limit.effect_time.start_time} 至 ${item.time_limit.effect_time.end_time}`; // 有效时间段