From a0d33c3275e4834d496c14041e385b31cbcc21da Mon Sep 17 00:00:00 2001 From: zhangds Date: Mon, 7 Nov 2022 15:25:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=90=A5=E9=94=80?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=A4=8D=E5=88=B6=E4=B8=8D=E7=8E=B0=E5=AE=9E?= =?UTF-8?q?=E5=95=86=E5=93=81=E7=BC=96=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UseCouponAddEdit/index.jsx | 14 ++++++++++++-- src/tools/index.js | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/UseCouponAddEdit/index.jsx b/src/components/UseCouponAddEdit/index.jsx index 5822034d..cd993ad0 100644 --- a/src/components/UseCouponAddEdit/index.jsx +++ b/src/components/UseCouponAddEdit/index.jsx @@ -49,7 +49,7 @@ const tableColumn = [ title: "商品编号", name: "product_id", prop: "product_id", - type: "normal", + type: "slot", width: "auto", }, { @@ -372,11 +372,11 @@ const UseCouponAddEdit = forwardRef((props, ref) => { // 如果是复制 删除id !!!!!!!! if (state.KeyPcType === "2") { delete item.id; + delete item.goods_id; } let table_obj = knockGoldFun(item); return table_obj; }); - let scope_data = goods_arr.concat(lj_arr); scope_data = _.map(scope_data, (o) => { if (o.type === 2) { @@ -1415,6 +1415,16 @@ const UseCouponAddEdit = forwardRef((props, ref) => { ); } + if (com === "product_id") { + return ( + + {state.KeyPcType === "2" && rowData.type === 2 + ? "-" + : rowData.product_id} + + ); + } + if (com === "type") { return {rowData.type === 1 ? "商品" : "立减金"}; } diff --git a/src/tools/index.js b/src/tools/index.js index 8d1207f2..d267d8fc 100644 --- a/src/tools/index.js +++ b/src/tools/index.js @@ -22,7 +22,7 @@ export const knockGoldFun = (item) => { table_obj.upstream = String(item.channel) === "1" ? "支付宝" : "微信"; // 上游平台 table_obj.only = item; // 存储就数据 编辑好用 - table_obj.product_id = item.goods_id; // 商品编号 + table_obj.product_id = item.goods_id ? item.goods_id : item.batch_goods_name; // 商品编号 table_obj.product_name = item.batch_goods_name; // 商品名 table_obj.official_price = item.reduce_amount; // 官方价 table_obj.contract_price = item.price; // 合同价格