Commit 07bfe748 authored by alwayOnlie's avatar alwayOnlie

添加catch异常处理

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