1) 修复新建优惠券key批次查询错误

This commit is contained in:
zhangds 2022-09-16 15:35:52 +08:00
parent 7a21b16397
commit 5db99f4103
3 changed files with 630 additions and 599 deletions

View File

@ -257,6 +257,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
try { try {
queryPlans({ status: "3,4,5" }).then((res) => { queryPlans({ status: "3,4,5" }).then((res) => {
handelResponse(res, (req, msg) => { handelResponse(res, (req, msg) => {
console.log("计划:", req);
let arr = req.map((item) => { let arr = req.map((item) => {
return { return {
key: { key: item.id, reseller_id: item.reseller_id }, key: { key: item.id, reseller_id: item.reseller_id },
@ -402,8 +403,10 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
setForm_info_data({ plan_id: e }); setForm_info_data({ plan_id: e });
setState({ direct_reseller_id: e.key.reseller_id }); setState({ direct_reseller_id: e.key.reseller_id });
setForm_info_data({ key_batch_id: "" }); setForm_info_data({ key_batch_id: "" });
queryKeyBatch({ status: "4,5", plan_id: e.key.key }).then((res) => { queryKeyBatch({ status: "4,5", plan_id: e.key.key, bind_object: 2 }).then(
(res) => {
handelResponse(res, (req, msg) => { handelResponse(res, (req, msg) => {
console.log("req =>", req);
let arr = req.map((item) => { let arr = req.map((item) => {
return { return {
key: item.id, key: item.id,
@ -414,7 +417,8 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
key_OPTIONS: arr, key_OPTIONS: arr,
}); });
}); });
}); }
);
}; };
const onReturn = () => {}; const onReturn = () => {};

View File

@ -12,8 +12,8 @@ import "./style.less";
const tableColumn = [ const tableColumn = [
{ {
title: "商品编号", title: "商品编号",
name: "product_id", name: "id",
prop: "product_id", prop: "id",
type: "normal", type: "normal",
width: "auto", width: "auto",
}, },
@ -100,12 +100,12 @@ const UseCouponCommodity = () => {
tabList: [{ title: "商品范围列表", index: 0 }], tabList: [{ title: "商品范围列表", index: 0 }],
tableData: [], tableData: [],
tableHeight: 500, tableHeight: 500,
dataCount: 0,
lodgingTable: true, lodgingTable: true,
combinedValue: [], combinedValue: [],
key_word: "", key_word: "",
page: 1, page: 1,
limit: 10, limit: 10,
total: 0,
isQuery: false, isQuery: false,
}); });
const table_el = useRef(null); const table_el = useRef(null);
@ -136,6 +136,7 @@ const UseCouponCommodity = () => {
let param = getParam(); let param = getParam();
getCodeProductList(param).then((res) => { getCodeProductList(param).then((res) => {
handelResponse(res, (req, msg) => { handelResponse(res, (req, msg) => {
setState({ tableData: req.data });
console.log("res =>", req); console.log("res =>", req);
}); });
}); });
@ -186,12 +187,13 @@ const UseCouponCommodity = () => {
spliteColor={"#fff"} spliteColor={"#fff"}
tableData={state.tableData} tableData={state.tableData}
Column={tableColumn} Column={tableColumn}
countbarVisible={false}
maxheight={state.tableHeight} maxheight={state.tableHeight}
isSwitch={false} isSwitch={false}
isShowPageBar={false}
countbarVisible={false}
page={state.page} page={state.page}
ref={table_el} ref={table_el}
dataCount={state.dataCount} dataCount={state.total}
pageChange={(e) => onPageChange(e)} pageChange={(e) => onPageChange(e)}
emptyText={ emptyText={
state.lodgingTable state.lodgingTable

File diff suppressed because it is too large Load Diff