Commit cd578616 authored by XieZhiXiong's avatar XieZhiXiong

feat: 新增单据 换货发货单、入库单 相关逻辑

parent 945a00cf
...@@ -53,6 +53,8 @@ import { ...@@ -53,6 +53,8 @@ import {
getMachiningDeliveryList, getMachiningDeliveryList,
getRefundDeliveryList, getRefundDeliveryList,
getRefundWarehousingList, getRefundWarehousingList,
getExchangeReturnDeliveryList,
getExchangeReturnWarehousingList,
getExchangeDeliveryList, getExchangeDeliveryList,
getExchangeWarehousingList, getExchangeWarehousingList,
} from '../fetchBillList'; } from '../fetchBillList';
...@@ -158,7 +160,7 @@ const getParams = type => { ...@@ -158,7 +160,7 @@ const getParams = type => {
case DOC_TYPE_EXCHANGE_RETURN_INVOICE: { case DOC_TYPE_EXCHANGE_RETURN_INVOICE: {
basicParams.modalProps.title = '选择售后单'; basicParams.modalProps.title = '选择售后单';
basicParams.columns = getAfterSaleColumns(true); basicParams.columns = getAfterSaleColumns(true);
basicParams.fetchTableData = getExchangeDeliveryList; basicParams.fetchTableData = getExchangeReturnDeliveryList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(true); basicParams.formilyProps.ctx.schema = afterSaleBillSchema(true);
basicParams.tableProps.rowKey = 'applyNo'; basicParams.tableProps.rowKey = 'applyNo';
basicParams.tableProps.lableKey = 'applyNo'; basicParams.tableProps.lableKey = 'applyNo';
...@@ -169,7 +171,7 @@ const getParams = type => { ...@@ -169,7 +171,7 @@ const getParams = type => {
case DOC_TYPE_EXCHANGE_RETURN_RECEIPT: { case DOC_TYPE_EXCHANGE_RETURN_RECEIPT: {
basicParams.modalProps.title = '选择售后单'; basicParams.modalProps.title = '选择售后单';
basicParams.columns = getAfterSaleColumns(false); basicParams.columns = getAfterSaleColumns(false);
basicParams.fetchTableData = getExchangeWarehousingList; basicParams.fetchTableData = getExchangeReturnWarehousingList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(false); basicParams.formilyProps.ctx.schema = afterSaleBillSchema(false);
basicParams.tableProps.rowKey = 'applyNo'; basicParams.tableProps.rowKey = 'applyNo';
basicParams.tableProps.lableKey = 'applyNo'; basicParams.tableProps.lableKey = 'applyNo';
...@@ -178,13 +180,23 @@ const getParams = type => { ...@@ -178,13 +180,23 @@ const getParams = type => {
// 换货发货单 // 换货发货单
case DOC_TYPE_EXCHANGE_INVOICE: { case DOC_TYPE_EXCHANGE_INVOICE: {
basicParams.modalProps.title = '选择售后单';
basicParams.columns = getAfterSaleColumns(true);
basicParams.fetchTableData = getExchangeDeliveryList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(true);
basicParams.tableProps.rowKey = 'applyNo';
basicParams.tableProps.lableKey = 'applyNo';
break; break;
} }
// 换货入库单 // 换货入库单
case DOC_TYPE_EXCHANGE_RECEIPT: { case DOC_TYPE_EXCHANGE_RECEIPT: {
basicParams.modalProps.title = '选择售后单';
basicParams.columns = getAfterSaleColumns(false);
basicParams.fetchTableData = getExchangeWarehousingList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(false);
basicParams.tableProps.rowKey = 'applyNo';
basicParams.tableProps.lableKey = 'applyNo';
break; break;
} }
......
...@@ -151,7 +151,7 @@ export const getRefundWarehousingList = async (params: any) => { ...@@ -151,7 +151,7 @@ export const getRefundWarehousingList = async (params: any) => {
}; };
// 获取售后换货退货发货单单相关数据 // 获取售后换货退货发货单单相关数据
export const getExchangeDeliveryList = async (params: any) => { export const getExchangeReturnDeliveryList = async (params: any) => {
const { search, startTime, endTime, ...rest } = params; const { search, startTime, endTime, ...rest } = params;
const res = await PublicApi.getAsReplaceGoodsPageToBeAddReturnDeliveryGoods({ const res = await PublicApi.getAsReplaceGoodsPageToBeAddReturnDeliveryGoods({
applyNo: search, applyNo: search,
...@@ -180,7 +180,7 @@ export const getExchangeDeliveryList = async (params: any) => { ...@@ -180,7 +180,7 @@ export const getExchangeDeliveryList = async (params: any) => {
}; };
// 获取售后换货退货入库单单相关数据 // 获取售后换货退货入库单单相关数据
export const getExchangeWarehousingList = async (params: any) => { export const getExchangeReturnWarehousingList = async (params: any) => {
const { search, startTime, endTime, ...rest } = params; const { search, startTime, endTime, ...rest } = params;
const res = await PublicApi.getAsReplaceGoodsPageToBeAddReturnGoodsStorage({ const res = await PublicApi.getAsReplaceGoodsPageToBeAddReturnGoodsStorage({
applyNo: search, applyNo: search,
...@@ -193,7 +193,7 @@ export const getExchangeWarehousingList = async (params: any) => { ...@@ -193,7 +193,7 @@ export const getExchangeWarehousingList = async (params: any) => {
data: res.data.data.map(item => ({ data: res.data.data.map(item => ({
...item, ...item,
id: item.replaceId, id: item.replaceId,
memberName: item.supplierName, memberName: item.consumerName,
membersId: item.parentMemberId, membersId: item.parentMemberId,
membersRoleId: item.parentMemberRoleId, membersRoleId: item.parentMemberRoleId,
deliveryAddresId: item.returnGoodsAddress.receiveId, deliveryAddresId: item.returnGoodsAddress.receiveId,
...@@ -206,4 +206,62 @@ export const getExchangeWarehousingList = async (params: any) => { ...@@ -206,4 +206,62 @@ export const getExchangeWarehousingList = async (params: any) => {
}; };
} }
return []; return [];
};
// 获取售后换货发货单单相关数据
export const getExchangeDeliveryList = async (params: any) => {
const { search, startTime, endTime, ...rest } = params;
const res = await PublicApi.getAsReplaceGoodsPageToBeAddReplaceDeliveryGoods({
applyNo: search,
startTime: startTime ? moment(+startTime).format('YYYY-MM-DD HH:mm:ss') : null,
endTime: endTime ? moment(+endTime).format('YYYY-MM-DD HH:mm:ss') : null,
...rest,
})
if (res.code === 1000) {
return {
data: res.data.data.map(item => ({
...item,
id: item.replaceId,
memberName: item.supplierName,
membersId: item.parentMemberId,
membersRoleId: item.parentMemberRoleId,
deliveryAddresId: item.replaceGoodsAddress.receiveId,
fullAddress: item.replaceGoodsAddress.receiveAddress || '',
receiverName: item.replaceGoodsAddress.receiveUserName || '',
phone: item.replaceGoodsAddress.receiveUserTel || '',
deliveryType: item.replaceGoodsAddress.deliveryType || '',
})),
total: res.data.totalCount,
};
}
return [];
};
// 获取售后换货入库单单相关数据
export const getExchangeWarehousingList = async (params: any) => {
const { search, startTime, endTime, ...rest } = params;
const res = await PublicApi.getAsReplaceGoodsPageToBeAddReplaceGoodsStorage({
applyNo: search,
startTime: startTime ? moment(+startTime).format('YYYY-MM-DD HH:mm:ss') : null,
endTime: endTime ? moment(+endTime).format('YYYY-MM-DD HH:mm:ss') : null,
...rest,
})
if (res.code === 1000) {
return {
data: res.data.data.map(item => ({
...item,
id: item.replaceId,
memberName: item.consumerName,
membersId: item.parentMemberId,
membersRoleId: item.parentMemberRoleId,
deliveryAddresId: item.replaceGoodsAddress.receiveId,
fullAddress: item.replaceGoodsAddress.receiveAddress || '',
receiverName: item.replaceGoodsAddress.receiveUserName || '',
phone: item.replaceGoodsAddress.receiveUserTel || '',
deliveryType: item.replaceGoodsAddress.deliveryType || '',
})),
total: res.data.totalCount,
};
}
return [];
}; };
\ No newline at end of file
...@@ -682,15 +682,15 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -682,15 +682,15 @@ const BillsForm: React.FC<BillsFormProps> = ({
fullAddress: returnGoodsAddress.receiveAddress || '', fullAddress: returnGoodsAddress.receiveAddress || '',
receiverName: returnGoodsAddress.receiveUserName || '', receiverName: returnGoodsAddress.receiveUserName || '',
phone: returnGoodsAddress.receiveUserTel || '', phone: returnGoodsAddress.receiveUserTel || '',
supplyMembersName: supplierName,
supplyMembersId: parentMemberId,
supplyMembersRoleId: parentMemberRoleId,
} }
] : ] :
[] []
, ,
deliveryType: returnGoodsAddress.deliveryType, deliveryType: returnGoodsAddress.deliveryType,
transport: DELIVERY_TYPE[returnGoodsAddress.deliveryType], transport: DELIVERY_TYPE[returnGoodsAddress.deliveryType],
supplyMembersName: supplierName,
supplyMembersId: parentMemberId,
supplyMembersRoleId: parentMemberRoleId,
}); });
}).finally(() => { }).finally(() => {
setInfoLoading(false); setInfoLoading(false);
......
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