Merge branch 'couponV2.0' of codeup.aliyun.com:5f9118049cffa29cfdd3be1c/marketing/frontend into couponV2.0

This commit is contained in:
wangsongsole 2022-11-01 13:51:14 +08:00
commit 92ef1332f1
4 changed files with 21 additions and 14 deletions

View File

@ -662,16 +662,16 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
console.log("编辑 大提交 =>", param); console.log("编辑 大提交 =>", param);
editCoupon(editData.id, param).then((res) => { editCoupon(editData.id, param).then((res) => {
setState({
isLoadingBtn: false,
});
handelResponse( handelResponse(
res, res,
(req, msg) => { (req, msg) => {
Notify.success(res.message); Notify.success(res.message);
setTimeout(() => { setTimeout(() => {
setState({
isLoadingBtn: false,
});
window.history.back(); window.history.back();
}, 2000); }, 500);
}, },
(err) => { (err) => {
Notify.error(err); Notify.error(err);
@ -721,16 +721,17 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
}); });
} }
addCoupon(param).then((res) => { addCoupon(param).then((res) => {
setState({
isLoadingBtn: false,
});
handelResponse( handelResponse(
res, res,
(req, msg) => { (req, msg) => {
Notify.success(res.message); Notify.success(res.message);
setTimeout(() => { setTimeout(() => {
setState({
isLoadingBtn: false,
});
window.history.back(); window.history.back();
}, 2000); }, 500);
}, },
(err) => { (err) => {
Notify.error(err); Notify.error(err);

View File

@ -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>
); );
} }

View File

@ -454,23 +454,27 @@ 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;
delete item.status;
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;
@ -485,10 +489,11 @@ const UseKeyAddEdit = () => {
return o; return o;
}); });
} }
console.log("newData =>", newData);
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 });
} }
}; };
@ -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,

View File

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