Commit 2427d0ee authored by rex's avatar rex

物料选择table

parent 86d30cb4
......@@ -40,7 +40,7 @@ class NoteService {
return this.#deliveryType.get(type)
}
}
}
export default class NoteFactoryService {
......
import { isDev } from '@/constants';
import { getOrderDeliveryPlanOrderSrmProductPage } from '@/services/OrderNewV2Api';
import DeliveryGoodTableSelectMock from '../mock/DeliveryGoodTableSelectMock';
class DeliveryNoticeOrder {
getOrderDeliveryPlanProduct() {
if (isDev) {
return Promise.resolve({
data: DeliveryGoodTableSelectMock
});
}
return getOrderDeliveryPlanOrderSrmProductPage().then(res => {
return res.data;
})
}
}
class DeliveryNoticeOrderFactory {
#instance
static getInstance() {
return new DeliveryNoticeOrder();
}
}
export default DeliveryNoticeOrderFactory;
\ No newline at end of file
export default [{
"skuId": "demoData",
"productNo": "demoData",
"orderProductId": 1,
"productName": "demoData",
"spec": "demoData",
"category": "demoData",
"brand": "demoData",
"unit": "demoData",
"purchaseCount": 1,
"receiveCount": 1,
"transitCount": 1,
"leftCount": 1,
"planCount": 1,
"orders": [{
"orderNo": "demoData",
"orderProductId": 1,
"orderDigest": "demoData",
"purchaseCount": 1,
"receiveCount": 1,
"transitCount": 1,
"leftCount": 1,
"planCount": 1,
"consigneeId": 1,
"consignee": "demoData",
"provinceName": "demoData",
"cityName": "demoData",
"districtName": "demoData",
"streetName": "demoData",
"address": "demoData",
"phone": "demoData"
}]
}]
\ No newline at end of file
import { Button, Drawer, Table } from "antd";
import { isNull } from "lodash";
import { useCallback, useEffect, useLayoutEffect, useState } from "react";
import DeliveryNoticeOrderFactory from "../../assets/handles/DeliveryNoticeOrder";
import { PlannedDeliveryMaterialExpandableTableColumn, PlannedDeliveryMaterialTableColumn } from "../../constants/page-table-column";
function DeliveryGoodTableModal() {
const [visible, setVisible] = useState(false)
const service = DeliveryNoticeOrderFactory.getInstance()
const [tableData, setTableData] = useState([])
const handleVisible = useCallback(() => {
setVisible(true)
}, [visible])
useEffect(() => {
service.getOrderDeliveryPlanProduct().then(res => {
if (isNull(res)) return;
const data = res.data
setTableData(data)
})
}, [])
const expandedRowRender = () => {
return (
<Table columns={PlannedDeliveryMaterialExpandableTableColumn} />
);
}
return (
<>
<div className='mt-16'>
<Button onClick={handleVisible}>选择物流</Button>
</div>
<Drawer
title="选择送货物料"
visible={visible}
width="90vw"
onClose={() => { setVisible(false) }}
>
<Table
columns={PlannedDeliveryMaterialTableColumn}
dataSource={tableData}
expandedRowRender={expandedRowRender}
/>
</Drawer>
</>
);
}
export default DeliveryGoodTableModal;
\ No newline at end of file
export { default as DeliveryGoodTableModal } from './DeliveryGoodTableSelect'
\ No newline at end of file
......@@ -5,7 +5,7 @@
import { HarvestMaterialInput } from "../assets/context";
import { BrandColumn, ClassColumn, CommodityIdColumn, ConsigneeNumColumn, DeliveredNumColumn, DeliveryNumColumn, FlowNoteColumn, FlowOnColumn, FlowOptionsColumn, FlowOptionsTimeColumn, FlowRoleColumn, FlowStatusColumn, MaterialModelColumn, MaterialNameColumn, MaterialNoColumn, OrderCreatedAtColumn, OrderNoColumn, OrderSummaryColumn, OredrNumColumn, PlannedDeliveryNumColumn, TradeNameColumn, TransitNumColumn, UntilColumn } from "./table-column";
export const DeliveryNoteAddFromTableColumn = [
export const DeliveryNoteAddFromTableColumn:any = [
MaterialNoColumn,
MaterialNameColumn,
ClassColumn,
......@@ -27,7 +27,7 @@ export const DeliveryNoteAddFromTableColumn = [
}
]
export const OutStatusLogTableColumn = [
export const OutStatusLogTableColumn:any = [
FlowOnColumn,
FlowRoleColumn,
FlowStatusColumn,
......
......@@ -14,6 +14,7 @@ import { DatePickerSelect } from '@/components/DatePickerSelect'
import DatePicker from '@/components/DatePicker';
import { AddressDrawer } from '@/components/AddressDrawer';
import { getLogisticsSelectListShipperAddress, postLogisticsShipperAddressAdd, postLogisticsShipperAddressUpdate } from '@/services/LogisticsV2Api';
import DeliveryGoodTableSelect from '../../components/DeliveryGoodTableSelect/DeliveryGoodTableSelect';
const ContentBoxItem = ContentBox.BaseInfoItem;
......@@ -117,7 +118,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<ContentBox title={DeliveryGood.name} id={DeliveryGood.key} cols={1}>
<DeliveryGoodTableSelect />
<Table columns={DeliveryNoticeTableColumn} />
</ContentBox>
......
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