审核页: 数据更新

perf/export-docx
Lei OT 2 years ago
parent 09091eaff5
commit 3a592a640d

@ -102,11 +102,11 @@ export const postProductsSave = async (products) => {
const initialState = {
loading: false,
searchValues: {},
agencyList: [],
activeAgency: {},
agencyProducts: {},
editingProduct: {},
searchValues: {}, // 客服首页: 搜索条件
agencyList: [], // 客服首页: 搜索结果
activeAgency: {}, // 审核/编辑 页: 当前的供应商
agencyProducts: {}, // 审核/编辑 页: 供应商产品列表
editingProduct: {}, // 编辑页: 当前编辑的产品
};
export const useProductsStore = create(
devtools((set, get) => ({
@ -135,7 +135,9 @@ export const useProductsStore = create(
getAgencyProducts: async (param) => {
const { setLoading, setActiveAgency, setAgencyProducts } = get();
setLoading(true);
setAgencyProducts({});
const res = await getAgencyProductsAction(param);
const productsData = groupBy(res.products, (row) => row.info.product_type_id);
setAgencyProducts(productsData);
setActiveAgency(res.agency);

@ -91,7 +91,7 @@ const Header = ({ refresh, ...props }) => {
<h2 className='m-0 leading-tight'>
{isPermitted(PERM_PRODUCTS_OFFER_AUDIT) ? (
<VendorSelector
value={pickAgency}
value={{label: activeAgency.travel_agency_name, value: activeAgency.travel_agency_id}}
onChange={handleAgencyChange}
allowClear={false}
mode={null}

Loading…
Cancel
Save