Commit 945a00cf authored by XieZhiXiong's avatar XieZhiXiong

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

parent 05669222
...@@ -54,6 +54,7 @@ import { ...@@ -54,6 +54,7 @@ import {
getRefundDeliveryList, getRefundDeliveryList,
getRefundWarehousingList, getRefundWarehousingList,
getExchangeDeliveryList, getExchangeDeliveryList,
getExchangeWarehousingList,
} from '../fetchBillList'; } from '../fetchBillList';
const { const {
...@@ -156,9 +157,9 @@ const getParams = type => { ...@@ -156,9 +157,9 @@ const getParams = type => {
// 换货退货发货单 // 换货退货发货单
case DOC_TYPE_EXCHANGE_RETURN_INVOICE: { case DOC_TYPE_EXCHANGE_RETURN_INVOICE: {
basicParams.modalProps.title = '选择售后单'; basicParams.modalProps.title = '选择售后单';
basicParams.columns = getAfterSaleColumns(false); basicParams.columns = getAfterSaleColumns(true);
basicParams.fetchTableData = getExchangeDeliveryList; basicParams.fetchTableData = getExchangeDeliveryList;
basicParams.formilyProps.ctx.schema = afterSaleBillSchema(false); basicParams.formilyProps.ctx.schema = afterSaleBillSchema(true);
basicParams.tableProps.rowKey = 'applyNo'; basicParams.tableProps.rowKey = 'applyNo';
basicParams.tableProps.lableKey = 'applyNo'; basicParams.tableProps.lableKey = 'applyNo';
break; break;
...@@ -166,7 +167,12 @@ const getParams = type => { ...@@ -166,7 +167,12 @@ const getParams = type => {
// 换货退货入库单 // 换货退货入库单
case DOC_TYPE_EXCHANGE_RETURN_RECEIPT: { case DOC_TYPE_EXCHANGE_RETURN_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;
} }
......
...@@ -177,4 +177,33 @@ export const getExchangeDeliveryList = async (params: any) => { ...@@ -177,4 +177,33 @@ export const getExchangeDeliveryList = async (params: any) => {
}; };
} }
return []; return [];
};
// 获取售后换货退货入库单单相关数据
export const getExchangeWarehousingList = async (params: any) => {
const { search, startTime, endTime, ...rest } = params;
const res = await PublicApi.getAsReplaceGoodsPageToBeAddReturnGoodsStorage({
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.returnGoodsAddress.receiveId,
fullAddress: item.returnGoodsAddress.receiveAddress || '',
receiverName: item.returnGoodsAddress.receiveUserName || '',
phone: item.returnGoodsAddress.receiveUserTel || '',
deliveryType: item.returnGoodsAddress.deliveryType || '',
})),
total: res.data.totalCount,
};
}
return [];
}; };
\ No newline at end of file
...@@ -540,15 +540,15 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -540,15 +540,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);
...@@ -1297,9 +1297,9 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -1297,9 +1297,9 @@ const BillsForm: React.FC<BillsFormProps> = ({
}), }),
relevanceInvoicesId: orderNo[0].id, relevanceInvoicesId: orderNo[0].id,
relevanceInvoices: rest.relevanceInvoices, relevanceInvoices: rest.relevanceInvoices,
supplyMembersName: billInfo.supplyMembersName, supplyMembersName: orderNo[0].supplyMembersName,
supplyMembersId: billInfo.supplyMembersId, supplyMembersId: orderNo[0].supplyMembersId,
supplyMembersRoleId: billInfo.supplyMembersRoleId, supplyMembersRoleId: orderNo[0].supplyMembersRoleId,
invoicesTypeId, invoicesTypeId,
}) })
.then(res => { .then(res => {
......
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