Commit ed06dd7f authored by rex's avatar rex

新增收货单

parent f0a8637e
......@@ -21,6 +21,7 @@ export function HarvestMaterialInput(props: {
value: any, //input 显示的值
index: number // table 当前的 index下标
keyUp: string // dataSource 对应的row key
min?: number
}) {
const context = useContext(HarvestMaterialContext);
......@@ -35,5 +36,5 @@ export function HarvestMaterialInput(props: {
setInputVal(targetVal)
}
return <Input value={inputVal} onChange={handleChange} />
return <Input {...props} value={inputVal} onChange={handleChange} />
}
\ No newline at end of file
......@@ -5,7 +5,14 @@ import DeliveryNoticeOrderFactory from "../../assets/handles/DeliveryNoticeOrder
import { PlannedDeliveryMaterialExpandableTableColumn, PlannedDeliveryMaterialTableColumn } from "../../constants/page-table-column";
import ExpandedRowTableRender from "./ExpandedRowTableRender";
function DeliveryGoodTableModal() {
interface DeliveryGoodTableModalProps {
onChange: (value) => void
}
function DeliveryGoodTableModal(props: DeliveryGoodTableModalProps) {
const { onChange } = props;
const [visible, setVisible] = useState(false)
const service = DeliveryNoticeOrderFactory.getInstance()
......@@ -22,8 +29,8 @@ function DeliveryGoodTableModal() {
for (const v of selectedRowKeys) {
result.push(...v[1])
}
console.log(result);
// setVisible(false)
setVisible(false)
onChange(result)
}, [visible])
useEffect(() => {
......@@ -35,10 +42,19 @@ function DeliveryGoodTableModal() {
}, [])
const expandedRowRender = (record, index) => {
let data = record;
let combination = (record.orders as any[]).map(v => {
return {
...record,
...v,
}
})
return (
<ExpandedRowTableRender
row={index}
dataSource={record.orders}
dataSource={combination}
onChange={(keys, index) => {
selectedRowKeys.set(index, keys);
}}
......@@ -66,7 +82,7 @@ function DeliveryGoodTableModal() {
<Table
columns={PlannedDeliveryMaterialTableColumn}
rowKey={row=>row.orderProductId}
rowKey={row => row.orderProductId}
dataSource={tableData}
expandedRowRender={expandedRowRender}
/>
......
......@@ -22,7 +22,7 @@ function ExpandedRowTableRender(props: ExpandedRowTableRenderProps) {
const onSelectChange = (selectedRowKeys: any[]) => {
setSelectedRowKeys(selectedRowKeys)
let result = props.dataSource.filter(v => selectedRowKeys.includes(v.orderProductId));
let result = props.dataSource.filter(v => selectedRowKeys.includes(v.orderNo));
onChange(result, row)
};
......
......@@ -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:any = [
export const DeliveryNoteAddFromTableColumn: any = [
MaterialNoColumn,
MaterialNameColumn,
ClassColumn,
......@@ -27,7 +27,7 @@ export const DeliveryNoteAddFromTableColumn:any = [
}
]
export const OutStatusLogTableColumn:any = [
export const OutStatusLogTableColumn: any = [
FlowOnColumn,
FlowRoleColumn,
FlowStatusColumn,
......@@ -46,7 +46,18 @@ export const DeliveryNoticeTableColumn: any = [
OrderNoColumn,
OrderCreatedAtColumn,
OredrNumColumn,
DeliveryNumColumn
{
...DeliveryNumColumn,
render: (t, rcode, index) => {
return (
<HarvestMaterialInput
value={rcode[OredrNumColumn.key]}
index={index}
keyUp="deliveryCount"
/>
)
}
}
];
// 计划送货物料表格
......
......@@ -6,8 +6,8 @@ import dayjs from "dayjs"
*/
export const CommodityIdColumn = {
title: '商品ID',
dataIndex: 'productId',
key: 'productId',
dataIndex: 'orderProductId',
key: 'orderProductId',
align: 'center',
}
......@@ -20,16 +20,22 @@ export const TradeNameColumn = {
export const MaterialNoColumn = {
title: '物料编号',
dataIndex: 'orderProductId',
key: 'orderProductId',
align: 'center',
}
export const MaterialNameColumn = {
title: '物料名称',
dataIndex: 'productName',
key: 'productName',
align: 'center',
}
export const MaterialModelColumn = {
title: '规格型号',
dataIndex: 'spec',
key: 'spec',
align: 'center',
}
......@@ -81,8 +87,7 @@ export const OredrNumColumn = {
export const DeliveryNumColumn = {
title: '送货数量',
dataIndex: 'deliveryCount',
key: 'deliveryCount',
width: 100,
align: 'center',
}
......
......@@ -4,10 +4,10 @@
* @description: 与B2B内容大致相同,文件分开方便后续对接以及日后变动修改二开
*/
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import React, { useState } from 'react'
import React, { useCallback, useState } from 'react'
import { BillsInfo, BuyerLabel, ConsigneeLabel, ConsigneePhoneLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryAddrLabel, DeliveryDateLabel, DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryNoLabel, DeliveryPhoneLabel, DeliverySlefAddrLabel, DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel, LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, OutStatusLabel } from '../../constants'
import { BaseInfo as ContentBox } from '@/components/BaseInfo'
import { Input, Table, Row, Col, Select, Radio, Form } from 'antd';
import { Input, Table, Row, Col, Select, Radio, Form, Button } from 'antd';
import { DeliveryNoticeTableColumn } from '../../constants/page-table-column';
import { FormItem } from '@/components/FormItem';
import { DatePickerSelect } from '@/components/DatePickerSelect'
......@@ -15,10 +15,15 @@ import DatePicker from '@/components/DatePicker';
import { AddressDrawer } from '@/components/AddressDrawer';
import { getLogisticsSelectListShipperAddress, postLogisticsShipperAddressAdd, postLogisticsShipperAddressUpdate } from '@/services/LogisticsV2Api';
import DeliveryGoodTableSelect from '../../components/DeliveryGoodTableSelect/DeliveryGoodTableSelect';
import { HarvestMaterialContextProvider } from '../../assets/context';
const ContentBoxItem = ContentBox.BaseInfoItem;
const DeliveryNoticeManageSRMDetails: React.FC = () => {
const [tableDataSource, setTableDataSource] = useState([]);
const [form] = Form.useForm()
const [anchors, setAnchors] = useState<AnchorsItem[]>([
BillsInfo,
Distribution,
......@@ -27,54 +32,65 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
DeliveryGood,
])
const handleSubmit = useCallback(() => {
console.log(form.getFieldsValue())
}, [])
return (
<AnchorPage title="送货单管理详情(SRM)"
anchors={anchors}
extra={
<Button.Group>
<Button onClick={handleSubmit}>提交</Button>
</Button.Group>
}
>
<Form>
<Form
form={form}
>
<ContentBox title={BillsInfo.name} id={BillsInfo.key}>
<FormItem label={DeliveryAbstractLabel}>
<FormItem label={DeliveryAbstractLabel} name="digest">
<Input />
</FormItem>
<FormItem label={NoteLabel}>
<FormItem label={NoteLabel} name="remark">
<Input />
</FormItem>
<FormItem label={BuyerLabel}>
<FormItem label={BuyerLabel} name="buyerMemberId">
<Input />
</FormItem>
</ContentBox>
<ContentBox title={Distribution.name} id={Distribution.key}>
<FormItem label={DeliveryDateLabel}>
<FormItem label={DeliveryDateLabel} name="deliveryTime">
<DatePickerSelect className='w-full' />
</FormItem>
<FormItem label={DeliveryNameLabel}>
<FormItem label={DeliveryNameLabel} name="executorVO.consignee">
<Input />
</FormItem>
<FormItem label={DeliveryTimeLabel}>
<FormItem label={DeliveryTimeLabel} name="deliveryTime">
<DatePickerSelect.RangePicker className="w-full" picker='time' />
</FormItem>
<FormItem label={DeliveryPhoneLabel}>
<FormItem label={DeliveryPhoneLabel} name="executorVO.phone">
<Input />
</FormItem>
</ContentBox>
<ContentBox title={DeliveryInfo.name} id={DeliveryInfo.key}>
<FormItem label={ConsigneeTimeLabel}>
<FormItem label={ConsigneeTimeLabel} name="sendTime">
<DatePickerSelect className="w-full" />
</FormItem>
<FormItem label={DeliveryAddrLabel}>
<FormItem label={DeliveryAddrLabel} name="receiveVO">
<Input />
</FormItem>
<FormItem name={"DeliverySlefAddrLabel"} label={DeliverySlefAddrLabel}>
<FormItem name="receiveVO" label={DeliverySlefAddrLabel}>
<AddressDrawer
addressListRequest={(val) => {
return getLogisticsSelectListShipperAddress(val)
......@@ -94,32 +110,44 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<ContentBox title={LogisticsInfo.name} id={LogisticsInfo.key}>
<FormItem label={DeliveryTypeLabel}>
<FormItem label={DeliveryTypeLabel} name="deliveryType">
<Radio.Group>
<Radio.Button value={1}>物流</Radio.Button>
<Radio.Button value={2}>自提</Radio.Button>
<Radio.Button value={3}>无效配送</Radio.Button>
</Radio.Group>
</FormItem>
<FormItem label={LogisticsCarNoLabel}>
<FormItem label={LogisticsCarNoLabel} name="executorVO.carNumbers">
<Input />
</FormItem>
<FormItem label={LogisticsCompanyLabel}>
<FormItem label={LogisticsCompanyLabel} name="logisticsCompanyId">
<Select>
<Select.Option>顺丰快递</Select.Option>
</Select>
</FormItem>
<FormItem label={LogisticsNoLabel}>
<FormItem label={LogisticsNoLabel} name="logisticsNo">
<Input />
</FormItem>
</ContentBox>
<ContentBox title={DeliveryGood.name} id={DeliveryGood.key} cols={1}>
<DeliveryGoodTableSelect />
<Table columns={DeliveryNoticeTableColumn} />
<DeliveryGoodTableSelect
onChange={(value) => {
setTableDataSource(value)
}}
/>
<HarvestMaterialContextProvider value={{
dataSource: tableDataSource
}}>
<Table
rowKey={row => row.orderNo}
columns={DeliveryNoticeTableColumn}
dataSource={tableDataSource}
/>
</HarvestMaterialContextProvider>
</ContentBox>
</Form>
......
......@@ -28,7 +28,7 @@ const DeliveryNoticeManageSRM: React.FC = () => {
const tagStatus = TagStatusFactory.getInstance();
const statusTxt = new Map([[1, '已提交'], [2, '已收货'], [3, '已作废']]);
const controllerBtns = (
<Space>
<Link to="/memberCenter/order/deliveryNotice/manageSRM/add">
......
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