Commit 52fbc939 authored by XieZhiXiong's avatar XieZhiXiong

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

parent 38fa5150
...@@ -16,7 +16,7 @@ import { ...@@ -16,7 +16,7 @@ import {
ORDER_TYPE2_POINTS, ORDER_TYPE2_POINTS,
ORDER_TYPE2_CHANNEL_POINTS, ORDER_TYPE2_CHANNEL_POINTS,
} from '@/constants/order'; } from '@/constants/order';
import { isMaterialOrder } from '../../../../../utils'; import { isMaterialOrder, fetchSupplierList } from '../../../../../utils';
const intl = getIntl(); const intl = getIntl();
...@@ -49,17 +49,6 @@ const supplierColumns = [ ...@@ -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 = { const supplierSchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
...@@ -151,7 +140,7 @@ export const addSchema = (orderType: number): ISchema => { ...@@ -151,7 +140,7 @@ export const addSchema = (orderType: number): ISchema => {
keepAlive: false, keepAlive: false,
}, },
columns: supplierColumns, columns: supplierColumns,
fetchTableData: getSupplier, fetchTableData: fetchSupplierList,
formilyProps: { formilyProps: {
ctx: { ctx: {
schema: supplierSchema, schema: supplierSchema,
......
...@@ -11,7 +11,7 @@ import { ...@@ -11,7 +11,7 @@ import {
ORDER_TYPE_POINTS, ORDER_TYPE_POINTS,
ORDER_TYPE_CHANNEL_POINTS, ORDER_TYPE_CHANNEL_POINTS,
} from '@/constants/order'; } from '@/constants/order';
import { isMaterialOrder } from '../../../../../utils'; import { isMaterialOrder, fetchSupplierList } from '../../../../../utils';
const intl = getIntl(); const intl = getIntl();
...@@ -44,17 +44,6 @@ const supplierColumns = [ ...@@ -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 = { const supplierSchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
...@@ -145,7 +134,7 @@ export const addSchema = (orderType: number): ISchema => { ...@@ -145,7 +134,7 @@ export const addSchema = (orderType: number): ISchema => {
keepAlive: false, keepAlive: false,
}, },
columns: supplierColumns, columns: supplierColumns,
fetchTableData: getSupplier, fetchTableData: fetchSupplierList,
formilyProps: { formilyProps: {
ctx: { ctx: {
schema: supplierSchema, schema: supplierSchema,
......
...@@ -12,7 +12,7 @@ import { ...@@ -12,7 +12,7 @@ import {
ORDER_TYPE_POINTS, ORDER_TYPE_POINTS,
ORDER_TYPE_CHANNEL_POINTS, ORDER_TYPE_CHANNEL_POINTS,
} from '@/constants/order'; } from '@/constants/order';
import { isMaterialOrder } from '../../../../../utils'; import { isMaterialOrder, fetchSupplierList } from '../../../../../utils';
const intl = getIntl(); const intl = getIntl();
...@@ -45,17 +45,6 @@ const supplierColumns = [ ...@@ -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 = { const supplierSchema: ISchema = {
type: 'object', type: 'object',
properties: { properties: {
...@@ -150,7 +139,7 @@ export const addSchema = (orderType: number): ISchema => { ...@@ -150,7 +139,7 @@ export const addSchema = (orderType: number): ISchema => {
keepAlive: false, keepAlive: false,
}, },
columns: supplierColumns, columns: supplierColumns,
fetchTableData: getSupplier, fetchTableData: fetchSupplierList,
formilyProps: { formilyProps: {
ctx: { ctx: {
schema: supplierSchema, schema: supplierSchema,
......
...@@ -11,6 +11,8 @@ import { ...@@ -11,6 +11,8 @@ import {
ORDER_TYPE_TENDER_CONTRACT, ORDER_TYPE_TENDER_CONTRACT,
ORDER_TYPE_REQUISITION, ORDER_TYPE_REQUISITION,
} from '@/constants/order'; } from '@/constants/order';
import { getMemberManageAftersaleReplacePage, getMemberManageUpperProviderMerchantPage } from '@/services/MemberV220318Api';
import BASE_CONFIG from '@/../config/base.config.json';
// 是否是采购订单 // 是否是采购订单
export const isMaterialOrder = (orderType: number) => { export const isMaterialOrder = (orderType: number) => {
...@@ -32,4 +34,20 @@ export type AsType = 2 | 3 | 4; ...@@ -32,4 +34,20 @@ export type AsType = 2 | 3 | 4;
* 售后地址角色 * 售后地址角色
* 寄件人 'sender' 收件人 'receiver' * 寄件人 'sender' 收件人 'receiver'
*/ */
export type AsAddressRole = 'sender' | 'receiver' export type AsAddressRole = 'sender' | 'receiver'
\ No newline at end of file
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