diff --git a/src/components/UseCouponAddEdit/index.jsx b/src/components/UseCouponAddEdit/index.jsx index 5a2f9a71..e8a1e4a2 100644 --- a/src/components/UseCouponAddEdit/index.jsx +++ b/src/components/UseCouponAddEdit/index.jsx @@ -616,10 +616,12 @@ const UseCouponAddEdit = forwardRef((props, ref) => { let lj_arr = state.tableData.filter( (item) => item.checked && item.type === 2 ); + // 第二步:计算商品新增和编辑过滤 param.new_product.legal = goods_arr.filter( (item) => item.checked && !item.goods_id ); // 新增 + param.update_product.legal = goods_arr.filter( (item) => item.checked && item.goods_id ); // 编辑 @@ -893,6 +895,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => { // 编辑 const productEditShow = (rowData, index) => { + console.log("编辑数据 1 => ", rowData); try { // 第一步:获取直连天下的商品数据需要分销商 id const direct_reseller_ids = state.direct_reseller_id; @@ -1054,24 +1057,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => { } }; - // 商品范围删除 - const deleteGoodsScope = (index) => { - let new_table = state.tableData; - new_table.splice(index, 1); - let select_opt = []; - new_table.map((item) => { - let obj = {}; - obj.key = item.product_id; - obj.text = item.product_name; - select_opt.push(obj); - }); - selectionFun(new_table); - setState({ - tableData: new_table, - rankOptions: select_opt, - }); - }; - // 提交审核弹窗 const examinePop = () => { return ( diff --git a/src/components/UseProductPop/index.jsx b/src/components/UseProductPop/index.jsx index e6ca28a7..d610495a 100644 --- a/src/components/UseProductPop/index.jsx +++ b/src/components/UseProductPop/index.jsx @@ -196,6 +196,7 @@ const UseProductPop = forwardRef((props, ref) => { // 编辑 if (productData) { setModel({ + goods_id: productData.goods_id, cost_price: productData.cost_price, weight: productData.weight, quantity: productData.quantity, @@ -280,6 +281,7 @@ const UseProductPop = forwardRef((props, ref) => { detail_url: model.detail_url[0] ? model.detail_url[0].src : "", account_type: model.account_type, map_product_name: model.product_name, + goods_id: model.goods_id, }; };