fix: 修复立减金库存校验 优惠券列表出现222
This commit is contained in:
parent
8d00f01e46
commit
96e333acdc
|
@ -629,7 +629,7 @@ const UseCouponList = () => {
|
||||||
if (com === "dates") {
|
if (com === "dates") {
|
||||||
return (
|
return (
|
||||||
<span>
|
<span>
|
||||||
{rowData.begin_time} 至222 {rowData.end_time}
|
{rowData.begin_time} 至 {rowData.end_time}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -454,27 +454,31 @@ const UseKeyAddEdit = () => {
|
||||||
} else {
|
} else {
|
||||||
newData = data.coupon;
|
newData = data.coupon;
|
||||||
}
|
}
|
||||||
let temp = newData;
|
|
||||||
// 复制?
|
// 复制?
|
||||||
if (state.KeyPcType === "2") {
|
if (state.KeyPcType === "2") {
|
||||||
setModel({
|
setModel({
|
||||||
batch_name: `${data.batch_name}_${++data.copy_count}`,
|
batch_name: `${data.batch_name}_${++data.copy_count}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
temp = temp.map((item) => {
|
newData = newData.map((item) => {
|
||||||
delete item.id;
|
delete item.id;
|
||||||
let product = item.product;
|
let product = item.product;
|
||||||
product.legal.map((item1) => {
|
product.legal.map((item1) => {
|
||||||
delete item1.code_batch_id;
|
delete item1.code_batch_id;
|
||||||
|
delete item1.status;
|
||||||
|
delete item1.goods_id;
|
||||||
return item1;
|
return item1;
|
||||||
});
|
});
|
||||||
|
|
||||||
product.reduce.map((item1) => {
|
product.reduce.map((item1) => {
|
||||||
delete item1.id;
|
delete item1.id;
|
||||||
|
delete item1.status;
|
||||||
|
delete item1.goods_id;
|
||||||
return item1;
|
return item1;
|
||||||
});
|
});
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
|
console.log("newData 2 =>", newData);
|
||||||
} else {
|
} else {
|
||||||
// 注意!! -1创建中 可编辑 status 是优惠券或者兑换码的状态不是key批次状态!!!!!!!!!!!!!!!
|
// 注意!! -1创建中 可编辑 status 是优惠券或者兑换码的状态不是key批次状态!!!!!!!!!!!!!!!
|
||||||
_.map(newData, (o) => {
|
_.map(newData, (o) => {
|
||||||
|
@ -486,10 +490,11 @@ const UseKeyAddEdit = () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (Number(data.bind_object[0]) === 1) {
|
if (Number(data.bind_object[0]) === 1) {
|
||||||
setState({ distdata: temp });
|
setState({ distdata: newData });
|
||||||
} else {
|
} else {
|
||||||
setState({ couponData: temp });
|
setState({ couponData: newData });
|
||||||
}
|
}
|
||||||
|
console.log("newData 3 =>", newData);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 样式切换
|
// 样式切换
|
||||||
|
@ -812,6 +817,7 @@ const UseKeyAddEdit = () => {
|
||||||
create_param.coupon = data;
|
create_param.coupon = data;
|
||||||
}
|
}
|
||||||
create_param.copy_key_batch_id = state.keyCodeId;
|
create_param.copy_key_batch_id = state.keyCodeId;
|
||||||
|
|
||||||
addKeysBatchInfo(state.plan_id, create_param).then((res) => {
|
addKeysBatchInfo(state.plan_id, create_param).then((res) => {
|
||||||
handelResponse(
|
handelResponse(
|
||||||
res,
|
res,
|
||||||
|
|
|
@ -25,7 +25,7 @@ export const knockGoldFun = (item) => {
|
||||||
table_obj.product_name = item.batch_goods_name; // 商品名
|
table_obj.product_name = item.batch_goods_name; // 商品名
|
||||||
table_obj.official_price = item.reduce_amount; // 官方价
|
table_obj.official_price = item.reduce_amount; // 官方价
|
||||||
table_obj.contract_price = item.price; // 合同价格
|
table_obj.contract_price = item.price; // 合同价格
|
||||||
table_obj.quantity = item.total_stock; // 库存数量
|
table_obj.quantity = kgType(item); // 库存数量
|
||||||
table_obj.stock = kgType(item); // 剩余库存数量
|
table_obj.stock = kgType(item); // 剩余库存数量
|
||||||
table_obj.channel_activity_id = item.channel_activity_id; // 批次号
|
table_obj.channel_activity_id = item.channel_activity_id; // 批次号
|
||||||
table_obj.all_budget = Number(item.all_budget); // 总预算
|
table_obj.all_budget = Number(item.all_budget); // 总预算
|
||||||
|
|
Loading…
Reference in New Issue