Commit a92e4fc4 authored by XieZhiXiong's avatar XieZhiXiong

chore: 添加 catch

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