Commit 001b6ec7 authored by FE-安焕焕's avatar FE-安焕焕 👣

修改问题

parent eb7aa7f1
......@@ -41,12 +41,12 @@ const LogisticsForm = props => {
orderSkuIds = [...orderSkuIds, ...data.selectedGoods];
});
if (orderSkuIds.length !== Array.from(new Set(orderSkuIds)).length) {
notification.open({ message: '商品选择重复!' });
notification.error({ message: '商品选择重复!' });
return;
}
if (skuList.length !== orderSkuIds.length) {
notification.open({ message: '该订单下的所有商品必须设置物流信息!' });
notification.error({ message: '该订单下的所有商品必须设置物流信息!' });
return;
}
await updateExpress(resultData);
......
import { Button, Upload, message } from 'antd';
import { Button, Upload, notification } from 'antd';
import React, { useState, useEffect, useRef } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import ProTable from '@ant-design/pro-table';
......@@ -66,6 +66,7 @@ const TableList = props => {
dataIndex: 'orderStatus',
key: 'orderStatus',
width: 200,
hideInSearch: true,
valueEnum: {
12: '待发货',
13: '待收货',
......@@ -104,14 +105,12 @@ const TableList = props => {
const skuListData = await getGoods(record.orderId);
let logisticsData = [{}];
setSkuList(skuListData);
if (props.type === 2) {
const data = await getLogistics(record.orderId);
logisticsData = data.map(item => ({
selectedGoods: item.skus.map(sku => sku.orderSkuId),
selectedCompany: `${item.expressCompanyCode}-${item.expressCompanyName}`,
orderNum: item.deliveryNo,
}));
}
const data = await getLogistics(record.orderId);
logisticsData = data.map(item => ({
selectedGoods: item.skus.map(sku => sku.orderSkuId),
selectedCompany: `${item.expressCompanyCode}-${item.expressCompanyName}`,
orderNum: item.deliveryNo,
}));
setLogisticsData(logisticsData);
handleModalVisible(true);
}}
......@@ -158,17 +157,13 @@ const TableList = props => {
const uploadProps = {
name: 'file',
customRequest(info) {
uploadFile(info.file);
const result = uploadFile(info.file);
if (result) {
notification.success({ message: '导入成功' });
}
},
accept: '.xlsx',
showUploadList: false,
onChange(info) {
if (info.file.status === 'done') {
message.success(`${info.file.name}导入成功`);
} else if (info.file.status === 'error') {
message.error(`${info.file.name}导入失败`);
}
},
};
const queryToSendFn = params => {
......@@ -216,6 +211,7 @@ const TableList = props => {
onClick={() => {
// eslint-disable-next-line no-unused-expressions
form?.resetFields();
setQueryData({});
}}
>
{resetText}
......
......@@ -52,13 +52,11 @@ export async function getLogistics(orderId) {
export async function uploadFile(file) {
const params = new FormData();
params.append('file', file);
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,
prefix: config.kdspApi,
// headers: {
// 'Content-Type': 'multipart/form-data',
// },
});
return data;
}
export function downTemplate() {
window.location.href = `${config.kdspApi}/api/kdsp/op/mch-order/import-mould-download`;
......
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