Commit c3c01833 authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复单据来源值为 undefined 的问题

parent 53bc5c81
...@@ -7,7 +7,7 @@ const AddBills: React.FC = () => { ...@@ -7,7 +7,7 @@ const AddBills: React.FC = () => {
invoicesTypeId, // 单据类型ID invoicesTypeId, // 单据类型ID
relevanceInvoices, // 对应单据 relevanceInvoices, // 对应单据
relevanceInvoicesId, // 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的 relevanceInvoicesId, // 单据id,可能是待新增销售发货单,待新增采购入库单跳转过来的
source, source = 2,
} = usePageStatus(); } = usePageStatus();
return ( return (
......
...@@ -232,7 +232,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -232,7 +232,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
fullAddress: fullAddress || '', fullAddress: fullAddress || '',
receiverName: receiverName || '', receiverName: receiverName || '',
phone: phone || '', phone: phone || '',
// deliveryType, deliveryType,
isDefault, isDefault,
} }
] : ] :
...@@ -240,8 +240,6 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -240,8 +240,6 @@ const BillsForm: React.FC<BillsFormProps> = ({
, ,
invoicesDetailsRequests: details, invoicesDetailsRequests: details,
...rest, ...rest,
deliveryType,
transport: DELIVERY_TYPE[deliveryType],
}); });
}).finally(() => { }).finally(() => {
setInfoLoading(false); setInfoLoading(false);
...@@ -271,6 +269,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -271,6 +269,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
setInfoLoading(true); setInfoLoading(true);
PublicApi.getOrderProcurementOrderDetails({ PublicApi.getOrderProcurementOrderDetails({
id: relevanceInvoicesId, id: relevanceInvoicesId,
orderNo: '',
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
return; return;
...@@ -317,6 +316,7 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -317,6 +316,7 @@ const BillsForm: React.FC<BillsFormProps> = ({
setInfoLoading(true); setInfoLoading(true);
PublicApi.getOrderPurchaseOrderDetails({ PublicApi.getOrderPurchaseOrderDetails({
id: relevanceInvoicesId, id: relevanceInvoicesId,
orderNo: '',
}).then(res => { }).then(res => {
if (res.code !== 1000) { if (res.code !== 1000) {
return; return;
...@@ -392,12 +392,11 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -392,12 +392,11 @@ const BillsForm: React.FC<BillsFormProps> = ({
fullAddress: receiveAddress || '', fullAddress: receiveAddress || '',
receiverName: receiveUserName || '', receiverName: receiveUserName || '',
phone: receiveUserTel || '', phone: receiveUserTel || '',
deliveryType,
} }
] : ] :
[] []
, ,
deliveryType,
transport: DELIVERY_TYPE[deliveryType],
}); });
}).finally(() => { }).finally(() => {
setInfoLoading(false); setInfoLoading(false);
...@@ -439,12 +438,11 @@ const BillsForm: React.FC<BillsFormProps> = ({ ...@@ -439,12 +438,11 @@ const BillsForm: React.FC<BillsFormProps> = ({
fullAddress: receiveAddress || '', fullAddress: receiveAddress || '',
receiverName: receiveUserName || '', receiverName: receiveUserName || '',
phone: receiveUserTel || '', phone: receiveUserTel || '',
deliveryType,
} }
] : ] :
[] []
, ,
deliveryType,
transport: DELIVERY_TYPE[deliveryType],
}); });
}).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