Commit e6bd3059 authored by FE-安焕焕's avatar FE-安焕焕 👣

导入提示信息

parent ad6307e9
...@@ -211,10 +211,12 @@ const TableList = props => { ...@@ -211,10 +211,12 @@ const TableList = props => {
}, []); }, []);
const uploadProps = { const uploadProps = {
name: 'file', name: 'file',
customRequest(info) { async customRequest(info) {
const result = uploadFile(info.file); const result = await uploadFile(info.file);
if (result) { if (result.businessCode === '0000') {
notification.success({ message: '导入成功' }); notification.success({ message: '导入成功' });
} else {
notification.error({ message: result.detail });
} }
}, },
accept: '.xlsx', accept: '.xlsx',
......
...@@ -54,7 +54,7 @@ export async function getLogistics(orderId) { ...@@ -54,7 +54,7 @@ export async function getLogistics(orderId) {
export async function uploadFile(file) { export async function uploadFile(file) {
const params = new FormData(); const params = new FormData();
params.append('file', file); params.append('file', file);
const { data } = await request.post('/api/kdsp/op/mch-order/order-logistics-batch-import', { const data = await request.post('/api/kdsp/op/mch-order/order-logistics-batch-import', {
data: params, data: params,
prefix: config.kdspApi, prefix: config.kdspApi,
}); });
......
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