Commit 07bfe748 authored by alwayOnlie's avatar alwayOnlie

添加catch异常处理

parent d87a9ce6
...@@ -102,7 +102,10 @@ const Examine: React.FC<Iprops> = ({ ...@@ -102,7 +102,10 @@ const Examine: React.FC<Iprops> = ({
} }
}).finally(() => { }).finally(() => {
msg(); msg();
}).catch((err) => {
}); });
}; };
const onFinishFailed = (errorInfo: any) => { const onFinishFailed = (errorInfo: any) => {
console.log('Failed:', errorInfo); console.log('Failed:', errorInfo);
......
...@@ -144,7 +144,9 @@ const contractexecutionList = () => { ...@@ -144,7 +144,9 @@ const contractexecutionList = () => {
...params, ...params,
}).then(res => { }).then(res => {
resolve(res.data) resolve(res.data)
}) }).catch((err) => {
resolve([])
});
}) })
} }
return ( return (
......
...@@ -82,7 +82,9 @@ const DetailedList: React.FC<Iprops> = ({ ...@@ -82,7 +82,9 @@ const DetailedList: React.FC<Iprops> = ({
} else { } else {
} }
}) }).catch((err) => {
resolve([])
});
}) })
} }
return ( return (
......
...@@ -83,7 +83,9 @@ const DrawerModal: React.FC<Iprops> = ({ ...@@ -83,7 +83,9 @@ const DrawerModal: React.FC<Iprops> = ({
console.log(res.data, '请求查看付款明细') console.log(res.data, '请求查看付款明细')
resolve(res) resolve(res)
} }
}) }).catch((err) => {
resolve([])
});
}) })
} }
......
...@@ -90,6 +90,8 @@ const Details = (props: any) => { ...@@ -90,6 +90,8 @@ const Details = (props: any) => {
} }
}).finally(() => { }).finally(() => {
setListLoading(false); setListLoading(false);
}).catch((err) => {
resolve([])
}); });
} }
/* 执行请款的选中 */ /* 执行请款的选中 */
......
...@@ -56,7 +56,9 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => { ...@@ -56,7 +56,9 @@ const CrossSellProducts: React.FC<IProps> = (props: any) => {
let { data } = res || {} let { data } = res || {}
setAttribute(data) setAttribute(data)
} }
}) }).catch((err) => {
});
} }
/**选择报价商品回调 */ /**选择报价商品回调 */
......
...@@ -55,7 +55,9 @@ const SelectProduct: React.FC<Iprops> = (props: any) => { ...@@ -55,7 +55,9 @@ const SelectProduct: React.FC<Iprops> = (props: any) => {
return new Promise(resolve => { return new Promise(resolve => {
PublicApi.getProductCommodityCommonGetCommodityListBySeller({ ...params, environment: 1, shopType: 1 }).then(res => { PublicApi.getProductCommodityCommonGetCommodityListBySeller({ ...params, environment: 1, shopType: 1 }).then(res => {
resolve(res.data) resolve(res.data)
}) }).catch((err) => {
resolve([])
});
}) })
} }
/** 关闭 */ /** 关闭 */
......
...@@ -75,7 +75,9 @@ const DetailedList: React.FC<Iprops> = ({ ...@@ -75,7 +75,9 @@ const DetailedList: React.FC<Iprops> = ({
} else { } else {
} }
}) }).catch((err) => {
resolve([])
});
}) })
} }
return ( return (
......
...@@ -110,7 +110,9 @@ const PopupDrawer: React.FC<Iprops> = ({ ...@@ -110,7 +110,9 @@ const PopupDrawer: React.FC<Iprops> = ({
setpayAmount(payAmount) setpayAmount(payAmount)
setorderAmount(orderAmount) setorderAmount(orderAmount)
} }
}) }).catch((err) => {
resolve([])
});
}) })
} }
......
...@@ -157,6 +157,8 @@ const purchaseList: React.FC<Iprops> = ({ ...@@ -157,6 +157,8 @@ const purchaseList: React.FC<Iprops> = ({
} }
}).finally(() => { }).finally(() => {
setListLoading(false); setListLoading(false);
}).catch((err) => {
}); });
} }
......
...@@ -76,6 +76,8 @@ const situationList: React.FC<Iprops> = ({ contractId }) => { ...@@ -76,6 +76,8 @@ const situationList: React.FC<Iprops> = ({ contractId }) => {
} }
}).finally(() => { }).finally(() => {
setListLoading(false); setListLoading(false);
}).catch((err) => {
}); });
} }
const rowSelection: any = { const rowSelection: any = {
......
...@@ -128,7 +128,9 @@ const Details = (props: any) => { ...@@ -128,7 +128,9 @@ const Details = (props: any) => {
setcontractNo(basics.contractNo) setcontractNo(basics.contractNo)
setcontractAbstract(contractAbstract) setcontractAbstract(contractAbstract)
} }
}) }).catch((err) => {
});
} }
useEffect(() => { useEffect(() => {
let tab = [] let tab = []
......
...@@ -57,7 +57,8 @@ const AddContract: React.FC<parmas> = (props) => { ...@@ -57,7 +57,8 @@ const AddContract: React.FC<parmas> = (props) => {
useEffect(() => { useEffect(() => {
PublicApi.getContractContractTemplateExample().then(res => { PublicApi.getContractContractTemplateExample().then(res => {
setFileExampleUrl(res.data) setFileExampleUrl(res.data)
}) }).catch((err) => {
});
}, []) }, [])
/**新增&修改 */ /**新增&修改 */
...@@ -67,14 +68,16 @@ const AddContract: React.FC<parmas> = (props) => { ...@@ -67,14 +68,16 @@ const AddContract: React.FC<parmas> = (props) => {
setTimeout(() => { setTimeout(() => {
history.goBack() history.goBack()
}, 1000) }, 1000)
}) }).catch((err) => {
});
} else { } else {
parmas.id = id; parmas.id = id;
await PublicApi.postContractContractTemplateUpdate(parmas).then(res => { await PublicApi.postContractContractTemplateUpdate(parmas).then(res => {
setTimeout(() => { setTimeout(() => {
history.goBack() history.goBack()
}, 1000) }, 1000)
}) }).catch((err) => {
});
} }
} }
...@@ -131,7 +134,8 @@ const AddContract: React.FC<parmas> = (props) => { ...@@ -131,7 +134,8 @@ const AddContract: React.FC<parmas> = (props) => {
form.setFieldsValue(res.data) form.setFieldsValue(res.data)
} }
}) }).catch((err) => {
});
} }
}, [id]) }, [id])
...@@ -149,7 +153,8 @@ const AddContract: React.FC<parmas> = (props) => { ...@@ -149,7 +153,8 @@ const AddContract: React.FC<parmas> = (props) => {
if (res.code === 1000) { if (res.code === 1000) {
window.open(res.data.contractUrl) window.open(res.data.contractUrl)
} }
}) }).catch((err) => {
});
} }
......
...@@ -38,7 +38,9 @@ const ClassSearch = () => { ...@@ -38,7 +38,9 @@ const ClassSearch = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
PublicApi.getContractContractParamPage({ ...filterParams, ...params }).then(res => { PublicApi.getContractContractParamPage({ ...filterParams, ...params }).then(res => {
resolve(res.data) resolve(res.data)
}) }).catch(() => {
reject();
});
}) })
} }
// 搜索 // 搜索
......
...@@ -99,7 +99,9 @@ const Template: React.FC<{}> = () => { ...@@ -99,7 +99,9 @@ const Template: React.FC<{}> = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
PublicApi.getContractContractTemplatePage({ ...params }).then(res => { PublicApi.getContractContractTemplatePage({ ...params }).then(res => {
resolve(res.data) resolve(res.data)
}) }).catch(() => {
reject();
});
}) })
} }
......
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