Commit 52fbc939 authored by XieZhiXiong's avatar XieZhiXiong

feat: 处理saas多租户售后申请获取供应商逻辑

parent 38fa5150
......@@ -16,7 +16,7 @@ import {
ORDER_TYPE2_POINTS,
ORDER_TYPE2_CHANNEL_POINTS,
} from '@/constants/order';
import { isMaterialOrder } from '../../../../../utils';
import { isMaterialOrder, fetchSupplierList } from '../../../../../utils';
const intl = getIntl();
......@@ -49,17 +49,6 @@ const supplierColumns = [
},
];
// 获取供应会员
const getSupplier = async (params) => {
const res = await getMemberManageAftersaleReplacePage({
...params,
})
if (res.code === 1000) {
return res.data;
}
return { totalCount: 0, data: [] };
};
const supplierSchema: ISchema = {
type: 'object',
properties: {
......@@ -151,7 +140,7 @@ export const addSchema = (orderType: number): ISchema => {
keepAlive: false,
},
columns: supplierColumns,
fetchTableData: getSupplier,
fetchTableData: fetchSupplierList,
formilyProps: {
ctx: {
schema: supplierSchema,
......
......@@ -11,7 +11,7 @@ import {
ORDER_TYPE_POINTS,
ORDER_TYPE_CHANNEL_POINTS,
} from '@/constants/order';
import { isMaterialOrder } from '../../../../../utils';
import { isMaterialOrder, fetchSupplierList } from '../../../../../utils';
const intl = getIntl();
......@@ -44,17 +44,6 @@ const supplierColumns = [
},
];
// 获取供应会员
const getSupplier = async (params) => {
const res = await getMemberManageAftersaleReplacePage({
...params,
})
if (res.code === 1000) {
return res.data;
}
return { totalCount: 0, data: [] };
};
const supplierSchema: ISchema = {
type: 'object',
properties: {
......@@ -145,7 +134,7 @@ export const addSchema = (orderType: number): ISchema => {
keepAlive: false,
},
columns: supplierColumns,
fetchTableData: getSupplier,
fetchTableData: fetchSupplierList,
formilyProps: {
ctx: {
schema: supplierSchema,
......
......@@ -12,7 +12,7 @@ import {
ORDER_TYPE_POINTS,
ORDER_TYPE_CHANNEL_POINTS,
} from '@/constants/order';
import { isMaterialOrder } from '../../../../../utils';
import { isMaterialOrder, fetchSupplierList } from '../../../../../utils';
const intl = getIntl();
......@@ -45,17 +45,6 @@ const supplierColumns = [
},
];
// 获取供应会员
const getSupplier = async (params) => {
const res = await getMemberManageAftersaleReplacePage({
...params,
})
if (res.code === 1000) {
return res.data;
}
return { totalCount: 0, data: [] };
};
const supplierSchema: ISchema = {
type: 'object',
properties: {
......@@ -150,7 +139,7 @@ export const addSchema = (orderType: number): ISchema => {
keepAlive: false,
},
columns: supplierColumns,
fetchTableData: getSupplier,
fetchTableData: fetchSupplierList,
formilyProps: {
ctx: {
schema: supplierSchema,
......
......@@ -11,6 +11,8 @@ import {
ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE_REQUISITION,
} from '@/constants/order';
import { getMemberManageAftersaleReplacePage, getMemberManageUpperProviderMerchantPage } from '@/services/MemberV220318Api';
import BASE_CONFIG from '@/../config/base.config.json';
// 是否是采购订单
export const isMaterialOrder = (orderType: number) => {
......@@ -33,3 +35,19 @@ export type AsType = 2 | 3 | 4;
* 寄件人 'sender' 收件人 'receiver'
*/
export type AsAddressRole = 'sender' | 'receiver'
const SUPPLIER_LIST_MAP = {
0: getMemberManageAftersaleReplacePage,
1: getMemberManageUpperProviderMerchantPage,
};
export const fetchSupplierList = async (params) => {
const enableMultiTenancy = BASE_CONFIG.global.siteInfo.enableMultiTenancy || 0;
const res = await SUPPLIER_LIST_MAP[enableMultiTenancy]({
...params,
})
if (res.code === 1000) {
return res.data;
}
return { totalCount: 0, data: [] };
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment