Commit 1ff86698 authored by 前端-彭佳文's avatar 前端-彭佳文

Merge branch 'v2-0418-transferOrder-molei' into 'v2-220418-order'

对接 送货单 SRM 的的接口 See merge request GavinPeng/pro-platform!13
parents 5e072012 f410645d
import { getOrderDeliveryOrderDetail, getOrderDeliveryOrderDetailProductPage, getOrderDeliveryOrderSrmPage } from '@/services/OrderNewV2Api';
/**
* 送货单服务基类
*/
class NoteService {
#deliveryType = new Map([[1, '物流'], [2, '自提'], [3, '无需配送']])
getQuery(params: any) {
return getOrderDeliveryOrderSrmPage(params).then(res => {
return res.data
})
}
getDetailInfoById(id: string) {
return getOrderDeliveryOrderDetail({
id
}).then(res => {
return res.data
})
}
getDetailInfoProductById(id: string, current: string = "1", pageSize: string = "10") {
return getOrderDeliveryOrderDetailProductPage({
id,
current,
pageSize
}).then(res => res.data)
}
getDeliveryType(type?: number) {
/**
* 默认是物流
*/
if (!this.#deliveryType.has(type)) {
return this.#deliveryType.get(1);
}
return this.#deliveryType.get(type)
}
}
export default class NoteFactoryService {
static getInstance() {
return new NoteService()
}
}
\ No newline at end of file
......@@ -44,6 +44,9 @@ export class HandleFormSubmit {
}
/**
* 新增后送货单 Service
*/
export class ReceivingNoteAddService extends HandleFormSubmit {
handleBeforeFields(): boolean {
let b = this.getTableData().some((v) => Number(v.ConsigneeNum) < v.DeliveryNum)
......
/**
* 收货单
*/
class ReceivingNoteService {
getQuery(){
}
}
\ No newline at end of file
......@@ -37,7 +37,7 @@ export const OutStatusLogTableColumn = [
]
export const DeliveryNoticeTableColumn = [
export const DeliveryNoticeTableColumn: any = [
CommodityIdColumn,
TradeNameColumn,
ClassColumn,
......@@ -78,10 +78,10 @@ export const PlannedDeliveryMaterialExpandableTableColumn: any = [
// // 外部单据流转记录
export const ExternalRoamRecordTableColumn: any = [
{ dataIndex: 'name1', ...FlowOnColumn, },
{ dataIndex: 'name2', ...FlowRoleColumn, },
{ dataIndex: 'name3', ...FlowStatusColumn, },
{ dataIndex: 'name4', ...FlowOptionsColumn, },
{ dataIndex: 'name5', ...FlowOptionsTimeColumn, },
{ dataIndex: 'name6', ...FlowNoteColumn },
{ dataIndex: 'id', ...FlowOnColumn, },
{ dataIndex: 'operatorRoleName', ...FlowRoleColumn, },
{ dataIndex: 'statusName', ...FlowStatusColumn, },
{ dataIndex: 'operation', ...FlowOptionsColumn, },
{ dataIndex: 'createTime', ...FlowOptionsTimeColumn, },
{ dataIndex: 'remark', ...FlowNoteColumn },
]
\ No newline at end of file
......@@ -92,6 +92,13 @@ class TagStatus {
}
class TagStatusFactory {
static getInstance(){
return new TagStatus();
}
}
export {
TagStatus
TagStatus,
TagStatusFactory
}
\ No newline at end of file
import dayjs from "dayjs"
/**
* 订单模块 Table Column 分离 (国际化统一配置)
* @author: 莫雷
*/
export const CommodityIdColumn = {
title: '商品ID',
dataIndex: 'productId',
key: 'productId',
align: 'center',
}
export const TradeNameColumn = {
title: '商品名称',
dataIndex: 'productName',
key: 'productName',
align: 'center',
}
......@@ -29,21 +35,29 @@ export const MaterialModelColumn = {
export const ClassColumn = {
title: '品类',
dataIndex: 'category',
key: 'category',
align: 'center',
}
export const BrandColumn = {
title: '品牌',
dataIndex: 'brand',
key: 'brand',
align: 'center',
}
export const UntilColumn = {
title: '单位',
dataIndex: 'unit',
key: 'unit',
align: 'center',
}
export const OrderNoColumn = {
title: '订单号',
dataIndex: 'orderNo',
key: 'orderNo',
align: 'center',
}
......@@ -55,16 +69,20 @@ export const OrderSummaryColumn = {
export const OrderCreatedAtColumn = {
title: '下单时间',
align: 'center',
render: (txt, rcoed) => rcoed.OrderCreatedAt
render: (txt, rcoed) => dayjs(rcoed.createTime).format('YYYY-MM-DD HH:mm:ss')
}
export const OredrNumColumn = {
title: '订单数量',
dataIndex: 'purchaseCount',
key: 'purchaseCount',
align: 'center',
}
export const DeliveryNumColumn = {
title: '送货数量',
dataIndex: 'deliveryCount',
key: 'deliveryCount',
align: 'center',
}
......
......@@ -4,23 +4,59 @@
* @description: 与B2B内容大致相同,文件分开方便后续对接以及日后变动修改二开
*/
import AnchorPage, { AnchorsItem } from '@/components/AnchorPage'
import React, { useState } from 'react'
import { BillsInfo, ConsigneeLabel, ConsigneePhoneLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryAddrLabel, DeliveryDateLabel, DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryNoLabel, DeliveryPhoneLabel, DeliverySlefAddrLabel, DeliveryTimeLabel, DeliveryTypeLabel, Distribution, LogisticsCarNoLabel, LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, OutStatusLabel } from '../../constants'
import React, { useEffect, useLayoutEffect, useState } from 'react'
import { BillsInfo, ConsigneeLabel, ConsigneePhoneLabel, ConsigneeTimeLabel, DeliveryAbstractLabel, DeliveryAddrLabel, DeliveryDateLabel, DeliveryGood, DeliveryInfo, DeliveryNameLabel, DeliveryNoLabel, DeliveryPhoneLabel, DeliverySlefAddrLabel, DeliveryTimeLabel, DeliveryTypeLabel, Distribution, ExternalRoamRecord, LogisticsCarNoLabel, LogisticsCompanyLabel, LogisticsInfo, LogisticsNoLabel, NoteLabel, OutStatusLabel } from '../../constants'
import { BaseInfo as ContentBox } from '@/components/BaseInfo'
import { Table } from 'antd';
import { DeliveryNoticeTableColumn } from '../../constants/page-table-column';
import { DeliveryNoticeTableColumn, ExternalRoamRecordTableColumn } from '../../constants/page-table-column';
import NoteFactoryService from '../../assets/handles/DeliveryNoteService';
import { useLocation } from 'umi';
import qs from 'query-string';
const ContentBoxItem = ContentBox.BaseInfoItem;
const DeliveryNoticeManageSRMDetails: React.FC = () => {
const location = useLocation();
const query = qs.parse(location.search);
const service = NoteFactoryService.getInstance();
const [anchors, setAnchors] = useState<AnchorsItem[]>([
BillsInfo,
Distribution,
DeliveryInfo,
LogisticsInfo,
DeliveryGood,
ExternalRoamRecord
])
const [info, setInfo] = useState<any>()
const [tableDataSource, setTableDataSource] = useState([]);
const [totalCount, setTotalCount] = useState(1);
const [outerHistoryList, setOuterHistoryList] = useState([]);
useEffect(() => {
service.getDetailInfoById(query.id as string).then(res => {
setInfo(res)
})
service.getDetailInfoProductById(query.id as string).then(res => {
setTableDataSource(res.data)
setTotalCount(res.totalCount)
})
}, [])
/**
* 如果info 更新 outerHistoryList也一起更新
*/
useEffect(() => {
setOuterHistoryList(info?.outerHistoryList)
}, [info])
return (
<AnchorPage title="送货单管理详情(SRM)"
anchors={anchors}
......@@ -28,29 +64,29 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<ContentBox title={BillsInfo.name} id={BillsInfo.key}>
<ContentBoxItem label={DeliveryNoLabel}>
{info?.deliveryNo}
</ContentBoxItem>
<ContentBoxItem label={DeliveryAbstractLabel}>
{info?.digest}
</ContentBoxItem>
<ContentBoxItem label={NoteLabel}>
{info?.remark}
</ContentBoxItem>
<ContentBoxItem label={OutStatusLabel}>
{info?.outerStatusName}
</ContentBoxItem>
</ContentBox>
<ContentBox title={Distribution.name} id={Distribution.key}>
<ContentBoxItem label={DeliveryDateLabel}>
{info?.deliveryTime}
</ContentBoxItem>
<ContentBoxItem label={DeliveryNameLabel}>
{info?.executorVO?.consignee}
</ContentBoxItem>
<ContentBoxItem label={DeliveryTimeLabel}>
......@@ -58,7 +94,7 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
</ContentBoxItem>
<ContentBoxItem label={DeliveryPhoneLabel}>
{info?.executorVO?.phone}
</ContentBoxItem>
</ContentBox>
......@@ -68,6 +104,17 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
</ContentBoxItem>
<ContentBoxItem label={DeliveryAddrLabel}>
<div>
{info?.receiverBO?.provinceName}
{info?.receiverBO?.cityName}
{info?.receiverBO?.districtName}
{info?.receiverBO?.streetName}
{info?.receiverBO?.address}
</div>
<div>
{info?.receiverBO.phone}
{info?.receiverBO.consignee}
</div>
</ContentBoxItem>
......@@ -80,26 +127,40 @@ const DeliveryNoticeManageSRMDetails: React.FC = () => {
<ContentBox title={LogisticsInfo.name} id={LogisticsInfo.key}>
<ContentBoxItem label={DeliveryTypeLabel}>
{service.getDeliveryType(info?.deliveryType)}
</ContentBoxItem>
<ContentBoxItem label={LogisticsCarNoLabel}>
{info?.executorVO?.carNumbers}
</ContentBoxItem>
<ContentBoxItem label={LogisticsCompanyLabel}>
{info?.logisticsCompany}
</ContentBoxItem>
<ContentBoxItem label={LogisticsNoLabel}>
{info?.logisticsNo}
</ContentBoxItem>
</ContentBox>
<ContentBox title={DeliveryGood.name} id={DeliveryGood.key} cols={1}>
<Table columns={DeliveryNoticeTableColumn} />
<Table
columns={DeliveryNoticeTableColumn}
rowKey="id"
dataSource={tableDataSource}
pagination={{
total: totalCount
}}
/>
</ContentBox>
<ContentBox title={ExternalRoamRecord.name} key={ExternalRoamRecord.key} cols={1}>
<Table
columns={ExternalRoamRecordTableColumn}
rowKey="id"
dataSource={outerHistoryList}
/>
</ContentBox>
</AnchorPage>
)
......
......@@ -3,41 +3,33 @@
* @author: Gavin
* @description: 与B2B内容大致相同,文件分开方便后续对接以及日后变动修改二开
*/
import React, { useRef, useState } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Button, Card, Space, Tag } from 'antd'
import { PlusOutlined } from '@ant-design/icons'
import StandardTable from '@/components/StandardTable'
import { ColumnType } from 'antd/lib/table'
import TableOperation from '@/components/TableOperation'
import EyePreview from '@/components/EyePreview'
import NiceForm from '@/components/NiceForm'
import { createFormActions } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { deliveryNoticeManageSRMSchema } from './schema'
const tagStatusColor = {
// 待提交
2: { color: '#f4f5f7', fontColor: '#5c626a' },
// 待确认
3: { color: '#ecf2fe', fontColor: '#4787f0' },
// 待修订
4: { color: '#eae6ff', fontColor: '#9963d8' },
// 已确认
5: { color: '#ebf9f6', fontColor: '#00a98f' },
// 已生产送货单
6: { color: '#f0f5ff', fontColor: '#f0f5ff' },
// 已作废
7: { color: '#fff2f0', fontColor: '#ff4d4f' },
}
import React, { useRef, useState } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Button, Card, Space, Tag } from 'antd'
import { PlusOutlined } from '@ant-design/icons'
import StandardTable from '@/components/StandardTable'
import { ColumnType } from 'antd/lib/table'
import TableOperation from '@/components/TableOperation'
import EyePreview from '@/components/EyePreview'
import NiceForm from '@/components/NiceForm'
import { createFormActions } from '@formily/antd'
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch'
import { FORM_FILTER_PATH } from '@/formSchema/const'
import { deliveryNoticeManageSRMSchema } from './schema'
import NoteFactoryService from '../../assets/handles/DeliveryNoteService'
import dayjs from 'dayjs'
import { TagStatus, TagStatusFactory } from '../../constants/status'
const DeliveryNoticeManageSRM: React.FC = () => {
const ref = useRef<any>({})
const formActions = createFormActions()
const service = NoteFactoryService.getInstance();
const tagStatus = TagStatusFactory.getInstance();
const statusTxt = new Map([[1, '已提交'], [2, '已收货'], [3, '已作废']]);
const controllerBtns = (<Space>
<Button type='primary' icon={<PlusOutlined/>} href="/memberCenter/order/deliveryNotice/manageSRM/add">新增</Button>
<Button type='primary' icon={<PlusOutlined />} href="/memberCenter/order/deliveryNotice/manageSRM/add">新增</Button>
</Space>)
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
......@@ -63,27 +55,39 @@ const DeliveryNoticeManageSRM: React.FC = () => {
/>
)
}
const columns: ColumnType<unknown>[] = [
const columns: ColumnType<any>[] = [
{
title: '送货单号',
dataIndex: 'id',
key: 'id',
width: 160,
render: (text: unknown, record: unknown) => <EyePreview url='/memberCenter/order/deliveryNotice/manageSRM/details'>{text}</EyePreview>
render: (t, r) =>
<EyePreview url={`/memberCenter/order/deliveryNotice/manageSRM/details?id=${r.id}`}>{r.deliveryNo}</EyePreview>
},
{ title: '送货单摘要', dataIndex: 'digest', key: 'digest' },
{
title: '送货日期', dataIndex: 'deliveryTime', key: 'deliveryTime', render: (t, r) => {
return dayjs(r.createTime).format('YYYY-MM-DD');
}
},
{ title: '采购会员', dataIndex: 'buyerMemberName', key: 'buyerMemberName' },
{
title: '单据时间', dataIndex: 'createTime', key: 'createTime', render: (t, r) => {
return dayjs(r.createTime).format('YYYY-MM-DD')
}
},
{ title: '送货单摘要', dataIndex: 'id2', key: 'id2' },
{ title: '送货日期', dataIndex: 'id3', key: 'id3' },
{ title: '采购会员', dataIndex: 'id5', key: 'id5' },
{ title: '单据时间', dataIndex: 'id4', key: 'id4' },
{
title: '外部状态',
dataIndex: 'id6',
key: 'id6',
render: (text: string, record: any) => (
<Tag color={tagStatusColor[record.id]?.color}>
<span style={{ color: tagStatusColor[record.id]?.fontColor }}>{text}</span>
</Tag>
)
dataIndex: 'outerStatus',
key: 'outerStatus',
render: (t: string, r: any) => {
const styles = tagStatus.getTagStyle(r.outerStatus);
return (
<Tag color={styles.bgColor}>
<span style={{ color: styles.fontColor }}>{statusTxt.get(r.outerStatus)}</span>
</Tag>
)
}
},
{
title: '操作',
......@@ -94,25 +98,6 @@ const DeliveryNoticeManageSRM: React.FC = () => {
},
]
const fetchData = (params: unknown) => {
console.log('params :>> ', params);
return new Promise((resolve) => {
const data = {
totalCount: 1, data: [
{ id: 1, id2: 2, id3: 3, id4: 4, id5: 5, id6: 6 },
{ id: 2, id2: 3, id3: 4, id4: 5, id5: 6, id6: 7 },
{ id: 3, id2: 3, id3: 4, id4: 5, id5: 6, id6: 7 },
{ id: 4, id2: 3, id3: 4, id4: 5, id5: 6, id6: 7 },
{ id: 5, id2: 3, id3: 4, id4: 5, id5: 6, id6: 7 },
{ id: 6, id2: 3, id3: 4, id4: 5, id5: 6, id6: 7 },
{ id: 7, id2: 3, id3: 4, id4: 5, id5: 6, id6: 7 },
{ id: 8, id2: 3, id3: 4, id4: 5, id5: 6, id6: 7 },
]
}
resolve(data)
})
}
return (
<PageHeaderWrapper>
<Card>
......@@ -121,7 +106,7 @@ const DeliveryNoticeManageSRM: React.FC = () => {
currentRef={ref}
columns={columns}
tableProps={{ rowKey: 'id', }}
fetchTableData={(params: unknown) => fetchData(params)}
fetchTableData={(params: unknown) => service.getQuery(params)}
controlRender={
<NiceForm
actions={formActions}
......
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