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);
editCoupon(editData.id, param).then((res) => {
setState({
isLoadingBtn: false,
});
handelResponse(
res,
(req, msg) => {
Notify.success(res.message);
setTimeout(() => {
setState({
isLoadingBtn: false,
});
window.history.back();
}, 2000);
}, 500);
},
(err) => {
Notify.error(err);
@ -721,16 +721,17 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
});
}
addCoupon(param).then((res) => {
setState({
isLoadingBtn: false,
});
handelResponse(
res,
(req, msg) => {
Notify.success(res.message);
setTimeout(() => {
setState({
isLoadingBtn: false,
});
window.history.back();
}, 2000);
}, 500);
},
(err) => {
Notify.error(err);

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,23 +454,27 @@ 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;
delete item.status;
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;
@ -485,10 +489,11 @@ const UseKeyAddEdit = () => {
return o;
});
}
console.log("newData =>", newData);
if (Number(data.bind_object[0]) === 1) {
setState({ distdata: temp });
setState({ distdata: newData });
} else {
setState({ couponData: temp });
setState({ couponData: 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); // 总预算