Commit bc342a24 authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加采购订单列表跳转售后换货申请逻辑

parent 24a3f573
......@@ -3,10 +3,10 @@ import { usePageStatus } from '@/hooks/usePageStatus';
import ExchangeForm from './components/ExchangeForm';
const AddExchange: React.FC = () => {
const { orderId } = usePageStatus();
const { orderId, orderType } = usePageStatus();
return (
<ExchangeForm orderId={orderId} isEdit />
<ExchangeForm orderId={orderId} orderType={+orderType} isEdit />
);
};
......
......@@ -49,6 +49,10 @@ interface BillsFormProps {
* 订单id,从订单列表跳转过来的
*/
orderId?: number,
/**
* 订单类型
*/
orderType?: number,
}
type ReplaceGoodsListItemType = {
......@@ -143,6 +147,10 @@ interface DetailInfo {
*/
orderNo?: string,
/**
* 订单类型
*/
orderType?: number,
/**
* 商品数据
*/
replaceGoodsList?: ReplaceGoodsListItemType[],
......@@ -173,6 +181,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
id,
isEdit = false,
orderId,
orderType: outerOrderType,
}) => {
const [detailInfo, setDetailInfo] = useState<DetailInfo>({
applyTime: moment().format('YYYY-MM-DD HH:mm:ss'),
......@@ -419,16 +428,15 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
return;
}
setInfoLoading(true);
PublicApi.getOrderProcurementOrderDetails({
id: `${orderId}`,
orderNo: '',
PublicApi.getOrderBuyerDetail({
orderId: `${orderId}`,
} as any)
.then(res => {
if (res.code === 1000) {
const {
supplyMembersName,
supplyMembersId,
supplyMembersRoleId,
vendorMemberName,
vendorMemberId,
vendorRoleId,
orderNo,
} = res.data;
......@@ -440,20 +448,22 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
);
setDetailInfo({
applyTime: moment().format('YYYY-MM-DD HH:mm:ss'),
applyTime: moment().format('YYYY-MM-DD HH:mm:ss'),
supplierMember:
supplyMembersName ?
vendorMemberName ?
[
{
name: supplyMembersName,
memberId: supplyMembersId,
roleId: supplyMembersRoleId,
name: vendorMemberName,
memberId: vendorMemberId,
roleId: vendorRoleId,
},
] :
[]
,
orderNo,
,
orderNo,
orderType: +outerOrderType,
});
setOrderTypeValue(+outerOrderType);
}
})
.catch((err) => {
......
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