From 96e333acdc49e916a6c696bb0bf68fdca108363c Mon Sep 17 00:00:00 2001 From: zhangds Date: Tue, 1 Nov 2022 09:48:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AB=8B=E5=87=8F?= =?UTF-8?q?=E9=87=91=E5=BA=93=E5=AD=98=E6=A0=A1=E9=AA=8C=20=E4=BC=98?= =?UTF-8?q?=E6=83=A0=E5=88=B8=E5=88=97=E8=A1=A8=E5=87=BA=E7=8E=B0222?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/coupon/list/index.jsx | 2 +- src/pages/plan/key/UseKeyAddEdit.jsx | 14 ++++++++++---- src/tools/index.js | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/pages/coupon/list/index.jsx b/src/pages/coupon/list/index.jsx index 6e662043..bbeedfb2 100644 --- a/src/pages/coupon/list/index.jsx +++ b/src/pages/coupon/list/index.jsx @@ -629,7 +629,7 @@ const UseCouponList = () => { if (com === "dates") { return ( - {rowData.begin_time} 至222 {rowData.end_time} + {rowData.begin_time} 至 {rowData.end_time} ); } diff --git a/src/pages/plan/key/UseKeyAddEdit.jsx b/src/pages/plan/key/UseKeyAddEdit.jsx index 4ed26e39..6d0a6a31 100644 --- a/src/pages/plan/key/UseKeyAddEdit.jsx +++ b/src/pages/plan/key/UseKeyAddEdit.jsx @@ -454,27 +454,31 @@ const UseKeyAddEdit = () => { } else { newData = data.coupon; } - let temp = newData; // 复制? if (state.KeyPcType === "2") { setModel({ batch_name: `${data.batch_name}_${++data.copy_count}`, }); - temp = temp.map((item) => { + newData = newData.map((item) => { delete item.id; let product = item.product; product.legal.map((item1) => { delete item1.code_batch_id; + delete item1.status; + delete item1.goods_id; return item1; }); product.reduce.map((item1) => { delete item1.id; + delete item1.status; + delete item1.goods_id; return item1; }); return item; }); + console.log("newData 2 =>", newData); } else { // 注意!! -1创建中 可编辑 status 是优惠券或者兑换码的状态不是key批次状态!!!!!!!!!!!!!!! _.map(newData, (o) => { @@ -486,10 +490,11 @@ const UseKeyAddEdit = () => { }); } if (Number(data.bind_object[0]) === 1) { - setState({ distdata: temp }); + setState({ distdata: newData }); } else { - setState({ couponData: temp }); + setState({ couponData: newData }); } + console.log("newData 3 =>", newData); }; // 样式切换 @@ -812,6 +817,7 @@ const UseKeyAddEdit = () => { create_param.coupon = data; } create_param.copy_key_batch_id = state.keyCodeId; + addKeysBatchInfo(state.plan_id, create_param).then((res) => { handelResponse( res, diff --git a/src/tools/index.js b/src/tools/index.js index 0427ec07..2117281d 100644 --- a/src/tools/index.js +++ b/src/tools/index.js @@ -25,7 +25,7 @@ export const knockGoldFun = (item) => { table_obj.product_name = item.batch_goods_name; // 商品名 table_obj.official_price = item.reduce_amount; // 官方价 table_obj.contract_price = item.price; // 合同价格 - table_obj.quantity = item.total_stock; // 库存数量 + table_obj.quantity = kgType(item); // 库存数量 table_obj.stock = kgType(item); // 剩余库存数量 table_obj.channel_activity_id = item.channel_activity_id; // 批次号 table_obj.all_budget = Number(item.all_budget); // 总预算