fix: 修复立减金库存校验 优惠券列表出现222

This commit is contained in:
zhangds 2022-11-01 09:48:47 +08:00
parent 8d00f01e46
commit 96e333acdc
3 changed files with 12 additions and 6 deletions

View File

@ -629,7 +629,7 @@ const UseCouponList = () => {
if (com === "dates") {
return (
<span>
{rowData.begin_time} 222 {rowData.end_time}
{rowData.begin_time} {rowData.end_time}
</span>
);
}

View File

@ -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,

View File

@ -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); // 总预算