From 6ef022a3f58a618a70dbd3a108728643c30acfd5 Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 26 Oct 2022 14:16:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=88=B8=E6=96=B0=E5=BB=BA=E5=95=86=E5=93=81=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UseGoodsScopePop/index.jsx | 8 ++++++-- src/components/UseProductPop/index.jsx | 4 ++-- src/tools/index.js | 1 - 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/UseGoodsScopePop/index.jsx b/src/components/UseGoodsScopePop/index.jsx index 51d2259d..ce51787c 100644 --- a/src/components/UseGoodsScopePop/index.jsx +++ b/src/components/UseGoodsScopePop/index.jsx @@ -42,10 +42,12 @@ const UseGoodsScopePop = forwardRef((props, ref) => { Number(form_model.quantity) ); form_model.effectDate = "-"; + console.log("new_tableData[table_index] 1=>", new_tableData[table_index]); if (product_title === "编辑商品") { if (table_index !== -1) { - form_model.checked = false; + let ck = new_tableData[table_index].checked; new_tableData[table_index] = form_model; + new_tableData[table_index].checked = ck; } } else { new_tableData.push(form_model); @@ -58,11 +60,13 @@ const UseGoodsScopePop = forwardRef((props, ref) => { let new_tableData = tableData; let form_model = knockGold_el.current.state.form_data; let table_obj = knockGoldFun(form_model); + console.log("new_tableData[table_index] 2=>", new_tableData[table_index]); if (product_title === "编辑立减金") { if (table_index !== -1) { - table_obj.checked = false; + let ck = new_tableData[table_index].checked; new_tableData[table_index] = table_obj; new_tableData[table_index].only = form_model; + new_tableData[table_index].checked = ck; } } else { new_tableData.push(table_obj); diff --git a/src/components/UseProductPop/index.jsx b/src/components/UseProductPop/index.jsx index d610495a..686d3ce7 100644 --- a/src/components/UseProductPop/index.jsx +++ b/src/components/UseProductPop/index.jsx @@ -198,7 +198,7 @@ const UseProductPop = forwardRef((props, ref) => { setModel({ goods_id: productData.goods_id, cost_price: productData.cost_price, - weight: productData.weight, + weight: String(productData.weight), quantity: productData.quantity, contract_price: productData.contract_price, product_name: productData.product_name, @@ -532,7 +532,7 @@ const UseProductPop = forwardRef((props, ref) => { setModel({ weight: e }); }} onClearItem={(e) => { - setModel({ weight: "" }); + setModel({ weight: 0 }); }} value={model.weight} placeholder={"请输入"} diff --git a/src/tools/index.js b/src/tools/index.js index 92d66a7e..4ae68846 100644 --- a/src/tools/index.js +++ b/src/tools/index.js @@ -1,7 +1,6 @@ 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" ? "支付宝" : "微信"; // 上游平台