Commit a92e4fc4 authored by XieZhiXiong's avatar XieZhiXiong

chore: 添加 catch

parent 68aa56a6
......@@ -46,6 +46,8 @@ const Balance: React.FC<BalanceProps> = ({
if (res.code === 1000) {
setBalance(res.data);
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setLoading(false);
});
......
......@@ -75,6 +75,8 @@ const Credit: React.FC<BalanceProps> = ({
if (res.code === 1000) {
setCredit(res.data);
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setLoading(false);
});
......
......@@ -155,6 +155,8 @@ const UploadPaymentVoucher: React.FC<IProps> = (props: IProps) => {
if (res.code === 1000) {
setBankAccount(res.data);
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setLoading(false);
});
......
......@@ -232,10 +232,12 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
setDetailInfo({
faultFileList,
fileList: faultFileList.map(item => normalizeFiledata(item.filePath)),
fileList: faultFileList?.map(item => normalizeFiledata(item.filePath)),
...rest,
});
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setInfoloading(false);
});
......@@ -255,6 +257,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
if (res.code === 1000) {
setReplaceGoodsList(res.data);
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setExchangeGoodsLoading(false);
});
......
......@@ -33,7 +33,7 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
content: `您还有未退货发货的商品,是否确认全部退货发货都已完成?`,
onOk() {
return PublicApi.postAsReplaceGoodsConfirmAllReturnGoodsReceipt({
dataId: id,
dataId: +id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
......@@ -55,7 +55,7 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
content: `是否确认全部退货发货单已收到回单?`,
onOk() {
return PublicApi.postAsReplaceGoodsConfirmAllReturnGoodsReceipt({
dataId: id,
dataId: +id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
......@@ -85,7 +85,7 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
content: `您商品都已退货发货,是否确认还需要继续退货发货?`,
onOk() {
return PublicApi.postAsReplaceGoodsContinueReturnDeliveryGoods({
dataId: id,
dataId: +id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
......@@ -106,7 +106,7 @@ const ExchangePrConfirmBackVerify: React.FC = () => {
content: `是否继续退货发货?`,
onOk() {
return PublicApi.postAsReplaceGoodsContinueReturnDeliveryGoods({
dataId: id,
dataId: +id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
......
......@@ -25,7 +25,7 @@ const ExchangePrFinishedDetailVerify: React.FC = () => {
}
setConfirmLoading(true);
PublicApi.postAsReplaceGoodsConfirmComplete({
replaceId: id,
replaceId: +id,
evaluate: values,
}).then(res => {
if (res.code === 1000) {
......
......@@ -26,7 +26,7 @@ const ExchangePrReceivedVerify: React.FC = () => {
}
setSubmitLoading(true);
PublicApi.postAsReplaceGoodsConfirmManualReplaceReceiveGoods({
dataId: id,
dataId: +id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
......
......@@ -21,6 +21,8 @@ export const createEffects = (context, actions) => {
state.props['x-component-props'].dataSource = res.data;
});
}
}).catch((err) => {
console.warn(err);
});
// 获取发货地址
......@@ -30,5 +32,7 @@ export const createEffects = (context, actions) => {
state.props['x-component-props'].dataSource = res.data;
});
}
}).catch((err) => {
console.warn(err);
});
};
\ No newline at end of file
......@@ -351,7 +351,7 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
PublicApi.getOrderProcurementOrderDetails({
id: `${orderId}`,
orderNo: '',
})
} as any)
.then(res => {
if (res.code === 1000) {
const {
......@@ -385,6 +385,9 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
});
}
})
.catch((err) => {
console.warn(err);
})
.finally(() => {
setInfoLoading(false);
});
......
......@@ -131,10 +131,12 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
setDetailInfo({
faultFileList,
fileList: faultFileList.map(item => normalizeFiledata(item.filePath)),
fileList: faultFileList?.map(item => normalizeFiledata(item.filePath)),
...rest,
});
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setInfoloading(false);
});
......@@ -154,6 +156,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
if (res.code === 1000) {
setReplaceGoodsList(res.data);
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setExchangeGoodsLoading(false);
});
......
......@@ -26,7 +26,7 @@ const ExchangePrReceivedVerify: React.FC = () => {
}
setSubmitLoading(true);
PublicApi.postAsReplaceGoodsConfirmManualReturnReceiveGoods({
dataId: id,
dataId: +id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
......
......@@ -182,7 +182,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
supplierMemberId,
supplierRoleId,
...rest
} = res.data;
} = res.data as any;
setDetailInfo({
faultFileList,
......@@ -211,6 +211,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
if (res.code === 1000) {
setRepairGoodsList(res.data);
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setRepairGoodsLoading(false);
});
......
......@@ -234,6 +234,8 @@ const RepairForm: React.FC<BillsFormProps> = ({
})));
setGoodsValue(res.data && res.data.data ? res.data.data.map(item => item.orderRecordId) : []);
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setRepairGoodsLoading(false);
});
......@@ -292,6 +294,8 @@ const RepairForm: React.FC<BillsFormProps> = ({
...rest,
});
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setInfoLoading(false);
});
......@@ -306,7 +310,7 @@ const RepairForm: React.FC<BillsFormProps> = ({
PublicApi.getOrderProcurementOrderDetails({
id: `${orderId}`,
orderNo: '',
})
} as any)
.then(res => {
if (res.code === 1000) {
const {
......@@ -340,6 +344,9 @@ const RepairForm: React.FC<BillsFormProps> = ({
});
}
})
.catch((err) => {
console.warn(err);
})
.finally(() => {
setInfoLoading(false);
});
......
......@@ -190,6 +190,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
repairAddress: isJSONStr(repairAddress) || null,
});
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setInfoLoading(false);
});
......@@ -209,6 +211,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
if (res.code === 1000) {
setRepairGoodsList(res.data);
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setRepairGoodsLoading(false);
});
......
......@@ -295,6 +295,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
...rest,
});
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setInfoloading(false);
});
......@@ -314,6 +316,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
if (res.code === 1000) {
setReturnGoodsList(res.data);
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setReturnGoodsLoading(false);
});
......
......@@ -25,7 +25,7 @@ const ReturnPrConfirmFinishVerify: React.FC = () => {
}
setConfirmLoading(true);
PublicApi.postAsReturnGoodsConfirmComplete({
returnId: id,
returnId: +id,
evaluate: values,
}).then(res => {
if (res.code === 1000) {
......
......@@ -21,5 +21,7 @@ export const createEffects = (context, actions) => {
state.props['x-component-props'].dataSource = res.data;
});
}
}).catch((err) => {
console.warn(err);
});
};
\ No newline at end of file
......@@ -340,6 +340,8 @@ const ReturnForm: React.FC<BillsFormProps> = ({
})));
setGoodsValue(goodsDetailList.map(item => item.orderRecordId));
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setInfoLoading(false);
});
......@@ -354,7 +356,7 @@ const ReturnForm: React.FC<BillsFormProps> = ({
PublicApi.getOrderProcurementOrderDetails({
id: `${orderId}`,
orderNo: '',
})
} as any)
.then(res => {
if (res.code === 1000) {
const {
......@@ -388,6 +390,9 @@ const ReturnForm: React.FC<BillsFormProps> = ({
});
}
})
.catch((err) => {
console.warn(err);
})
.finally(() => {
setInfoLoading(false);
});
......
......@@ -332,10 +332,12 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
setDetailInfo({
faultFileList,
fileList: faultFileList.map(item => normalizeFiledata(item.filePath)),
fileList: faultFileList?.map(item => normalizeFiledata(item.filePath)),
...rest,
});
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setInfoloading(false);
});
......@@ -355,6 +357,8 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
if (res.code === 1000) {
setReturnGoodsList(res.data);
}
}).catch((err) => {
console.warn(err);
}).finally(() => {
setReturnGoodsLoading(false);
});
......
......@@ -26,7 +26,7 @@ const ReturnPrReceivedVerify: React.FC = () => {
}
setSubmitLoading(true);
PublicApi.postAsReturnGoodsConfirmManualReturnReceiveGoods({
dataId: id,
dataId: +id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
......
......@@ -24,7 +24,7 @@ const ReturnPrReturnVerify: React.FC = () => {
}
setSubmitLoading(true);
PublicApi.postAsReturnGoodsCompleteRefund({
dataId: id,
dataId: +id,
}).then(res => {
if (res.code === 1000) {
history.goBack();
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-11-05 14:25:41
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-13 15:32:32
* @LastEditTime: 2021-07-30 13:45:07
* @Description: 退货申请单查询
*/
import React, { useState, useRef } from 'react';
......
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