Commit 22d91c26 authored by Gavin Peng's avatar Gavin Peng

feat: 送货计划协同

parent afa6c34a
/**
* 订单能力 -- 送货计划协同
* @author: Gavin
*/
const DeliveryPlanCollaboration = [
{
path: '/memberCenter/order/deliveryPlanCollaboration',
name: '送货计划协同',
routes: [
{
/** 送货计划查询 */
path: '/memberCenter/order/deliveryPlanCollaboration/query',
name: '送货计划查询',
component: '@/pages/order/deliveryPlanCollaboration/deliveryPlanQuery'
},
{
/** 送货计划详情 */
path: '/memberCenter/order/deliveryPlanCollaboration/details',
name: '送货计划详情',
component: '@/pages/order/deliveryPlanCollaboration/deliveryPlanQuery/details',
hideInMenu: true,
},
{
/** 待确认送货计划 */
path: '/memberCenter/order/deliveryPlanCollaboration/undetermined',
name: '待确认送货计划',
component: '@/pages/order/deliveryPlanCollaboration/deliveryPlanUndetermined'
},
{
/** 待确认送货计划详情 */
path: '/memberCenter/order/deliveryPlanCollaboration/undeterminedDetails',
name: '待确认送货计划详情',
component: '@/pages/order/deliveryPlanCollaboration/deliveryPlanUndetermined/details',
hideInMenu: true,
},
],
}
]
export default DeliveryPlanCollaboration
\ No newline at end of file
......@@ -54,4 +54,4 @@ const DeliveryPlanManagement = [
]
}
]
export default DeliveryPlanManagement;
\ No newline at end of file
export default DeliveryPlanManagement
\ No newline at end of file
......@@ -2,7 +2,8 @@
* 订单能力路由
* @author: Gavin
*/
import DeliveryPlanManagement from './deliveryPlanManagement'
import DeliveryPlanCollaboration from './deliveryPlanCollaboration'
import DeliveryPlanManagement from './deliveryPlanManagement'
const OrderRoute = {
path: "/memberCenter/order",
......@@ -10,6 +11,7 @@ const OrderRoute = {
icon: "order",
routes: [
...DeliveryPlanManagement,
...DeliveryPlanCollaboration,
]
}
......
/**
* 订单能力 - 送货计划协同 - 送货计划详情
* @author: Gavin
* @description:
*/
import React, { useState } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { history } from 'umi'
import ReutrnEle from '@/components/ReturnEle'
const DeliveryPlanCollaborationDetails: React.FC = () => {
const [details, setDetails] = useState<any>({})
return (
<PageHeaderWrapper
title={details?.name}
onBack={() => history.goBack()}
backIcon={<ReutrnEle />}
>
<div>送货计划协同 - 送货计划详情</div>
</PageHeaderWrapper>
)
}
export default DeliveryPlanCollaborationDetails
\ No newline at end of file
/**
* 订单能力 - 送货计划协同 - 送货计划查询
* @author: Gavin
* @description:
*/
import React, { useRef, useState } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Button, Card, Space, Tag } from 'antd'
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 { deliveryPlanCollaborationQuerySchema } from './schema'
const tagStatusColor = {
// 待提交
2: { color: '#f4f5f7', fontColor: '#5c626a' },
// 待确认
3: { color: '#ecf2fe', fontColor: '#4787f0' },
// 待修改
4: { color: '#eae6ff', fontColor: '#9963d8' },
// 已确认
5: { color: '#ebf9f6', fontColor: '#00a98f' }
}
const DeliveryPlanCollaborationQuery: React.FC = () => {
const ref = useRef<any>({})
const formActions = createFormActions()
const controllerBtns = (
<Space>
{/* 杰哥说没有新增 */}
</Space>
)
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'查看': 'DevTest',
'生成送货通知单': 'DevTest',
'生成送货单': 'DevTest',
}
const buttonGroup = {
'查看': true,
'生成送货通知单': true,
'生成送货单': true,
}
const operationHandler = {
'查看': () => { console.log('查看 :>> ',) },
'生成送货通知单': () => { console.log('生成送货通知单 :>> ',) },
'生成送货单': () => { console.log('生成送货通知单 :>> ',) },
}
return (
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={btnAuthOfOperationTextMap}
/>
)
}
const columns: ColumnType<unknown>[] = [
{
title: '计划编号',
dataIndex: 'id',
key: 'id',
width: 160,
render: (text: unknown, record: unknown) => <EyePreview url='/memberCenter/order/deliveryPlanCollaboration/details'>{text}</EyePreview>
},
{ title: '计划摘要', dataIndex: 'id2', key: 'id2' },
{ title: '计划开始日期', dataIndex: 'id3', key: 'id3' },
{ title: '计划结束日期', dataIndex: 'id4', key: 'id4' },
{ title: '供应会员', dataIndex: 'id5', key: 'id5' },
{
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>
)
},
{
title: '操作',
dataIndex: '',
key: 'x',
align: 'center',
render: (record) => renderOptionButton(record)
},
]
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 }
]
}
resolve(data)
})
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
// keepAlive={false}
currentRef={ref}
columns={columns}
tableProps={{ rowKey: 'id', }}
fetchTableData={(params: unknown) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'planCode',
FORM_FILTER_PATH,
)
}}
schema={deliveryPlanCollaborationQuerySchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default DeliveryPlanCollaborationQuery
\ No newline at end of file
/**
* 订单能力 -- 送货计划查询 Schema
* @author: Gavin
*/
import { ISchema } from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
export const deliveryPlanCollaborationQuerySchema: ISchema = {
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
planCode: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
allowClear: true,
placeholder: '请输入计划编号查询'
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20,
},
},
properties: {
'[startTime, endTime]': {
type: 'daterange',
'x-component-props': {
allowClear: true,
placeholder: ['计划开始日期','计划结束日期'],
},
},
supplyMember: {
type: 'string',
'x-component-props': {
allowClear: true,
placeholder: '供应会员'
}
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
}
}
}
}
}
}
\ No newline at end of file
/**
* 订单能力 - 送货计划协同 - 待确认送货计划详情
* @author: Gavin
* @description:
*/
import React, { useState } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { history } from 'umi'
import ReutrnEle from '@/components/ReturnEle'
const DeliveryPlanUndeterminedDetails: React.FC = () => {
const [details, setDetails] = useState<any>({})
return (
<PageHeaderWrapper
title={details?.name}
onBack={() => history.goBack()}
backIcon={<ReutrnEle />}
>
<div>送货计划协同 - 待确认送货计划详情</div>
</PageHeaderWrapper>
)
}
export default DeliveryPlanUndeterminedDetails
\ No newline at end of file
/**
* 订单能力 - 送货计划协同 - 待确认送货计划
* @author: Gavin
* @description:
*/
import React, { useRef, useState } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Button, Card, Space, Tag } from 'antd'
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 { deliveryPlanUndeterminedSchema } from './schema'
const tagStatusColor = {
// 待提交
2: { color: '#f4f5f7', fontColor: '#5c626a' },
// 待确认
3: { color: '#ecf2fe', fontColor: '#4787f0' },
// 待修改
4: { color: '#eae6ff', fontColor: '#9963d8' },
// 已确认
5: { color: '#ebf9f6', fontColor: '#00a98f' }
}
const DeliveryPlanUndetermined: React.FC = () => {
const ref = useRef<any>({})
const formActions = createFormActions()
const controllerBtns = (<Space></Space>)
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'确认': 'DevTest',
'查看': 'DevTest',
}
const buttonGroup = {
'确认': true,
'查看': true,
}
const operationHandler = {
'确认': () => { console.log('确认 :>> ',) },
'查看': () => { console.log('查看 :>> ',) },
}
return (
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={btnAuthOfOperationTextMap}
/>
)
}
const columns: ColumnType<unknown>[] = [
{
title: '计划编号',
dataIndex: 'id',
key: 'id',
width: 160,
render: (text: unknown, record: unknown) => <EyePreview url='/memberCenter/order/deliveryPlanCollaboration/undeterminedDetails'>{text}</EyePreview>
},
{ title: '计划摘要', dataIndex: 'id2', key: 'id2' },
{ title: '计划开始日期', dataIndex: 'id3', key: 'id3' },
{ title: '计划结束日期', dataIndex: 'id4', key: 'id4' },
{ title: '供应会员', dataIndex: 'id5', key: 'id5' },
{
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>
)
},
{
title: '操作',
dataIndex: '',
key: 'x',
align: 'center',
render: (record) => renderOptionButton(record)
},
]
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 }
]
}
resolve(data)
})
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
// keepAlive={false}
currentRef={ref}
columns={columns}
tableProps={{ rowKey: 'id', }}
fetchTableData={(params: unknown) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'planCode',
FORM_FILTER_PATH,
)
}}
schema={deliveryPlanUndeterminedSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default DeliveryPlanUndetermined
\ No newline at end of file
/**
* 订单能力 -- 送货计划查询 Schema
* @author: Gavin
*/
import { ISchema } from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
export const deliveryPlanUndeterminedSchema: ISchema = {
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
planCode: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
allowClear: true,
placeholder: '请输入计划编号查询'
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20,
},
},
properties: {
'[startTime, endTime]': {
type: 'daterange',
'x-component-props': {
allowClear: true,
placeholder: ['计划开始日期','计划结束日期'],
},
},
supplyMember: {
type: 'string',
'x-component-props': {
allowClear: true,
placeholder: '供应会员'
}
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
}
}
}
}
}
}
\ No newline at end of file
......@@ -3,15 +3,23 @@
* @author: Gavin
* @description: 与SRM内容大致相同,文件分开方便后续对接以及日后变动修改二开
*/
import React, { useRef } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
const DeliveryPlanAwaitB2BDetails: React.FC = () => {
return (
<PageHeaderWrapper>
<div>待提交送货计划 B2B 详情</div>
</PageHeaderWrapper>
)
}
export default DeliveryPlanAwaitB2BDetails
\ No newline at end of file
import React, { useState } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { history } from 'umi'
import ReutrnEle from '@/components/ReturnEle'
const DeliveryPlanAwaitB2BDetails: React.FC = () => {
const [details, setDetails] = useState<any>({})
return (
<PageHeaderWrapper
title={details?.name}
onBack={() => history.goBack()}
backIcon={<ReutrnEle />}
>
<div>待提交送货计划 B2B 详情</div>
</PageHeaderWrapper>
)
}
export default DeliveryPlanAwaitB2BDetails
\ No newline at end of file
......@@ -5,13 +5,142 @@
*/
import React, { useRef } 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 { deliveryPlanAwaitB2BSchema } from './schema'
const DeliveryPlanAwaitB2B: React.FC = () => {
return (
<PageHeaderWrapper>
<div>待提交送货计划 B2B</div>
</PageHeaderWrapper>
)
}
const tagStatusColor = {
// 待提交
2: { color: '#f4f5f7', fontColor: '#5c626a' },
// 待确认
3: { color: '#ecf2fe', fontColor: '#4787f0' },
// 待修改
4: { color: '#eae6ff', fontColor: '#9963d8' },
// 已确认
5: { color: '#ebf9f6', fontColor: '#00a98f' }
}
const DeliveryPlanAwaitB2B: React.FC = () => {
const ref = useRef<any>({})
const formActions = createFormActions()
export default DeliveryPlanAwaitB2B
\ No newline at end of file
const controllerBtns = (
<Space>
<Button type='primary' icon={<PlusOutlined />}>新增</Button>
</Space>
)
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'提交': 'DevTest',
'修改': 'DevTest',
'删除': 'DevTest',
'查看': 'DevTest',
}
const buttonGroup = {
'提交': true,
'修改': true,
'删除': true,
'查看': true,
}
const operationHandler = {
'提交': () => { console.log('提交 :>> ',) },
'修改': () => { console.log('修改 :>> ',) },
'删除': () => { console.log('删除 :>> ',) },
'查看': () => { console.log('查看 :>> ',) },
}
return (
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={btnAuthOfOperationTextMap}
/>
)
}
const columns: ColumnType<unknown>[] = [
{
title: '计划编号',
dataIndex: 'id',
key: 'id',
width: 160,
render: (text: unknown, record: unknown) => <EyePreview url='/memberCenter/order/deliveryPlanManagement/awaitB2BDetails'>{text}</EyePreview>
},
{ title: '计划摘要', dataIndex: 'id2', key: 'id2' },
{ title: '计划开始日期', dataIndex: 'id3', key: 'id3' },
{ title: '计划结束日期', dataIndex: 'id4', key: 'id4' },
{ title: '供应会员', dataIndex: 'id5', key: 'id5' },
{
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>
)
},
{
title: '操作',
dataIndex: '',
key: 'x',
align: 'center',
render: (record) => renderOptionButton(record)
},
]
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 }
]
}
resolve(data)
})
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
// keepAlive={false}
currentRef={ref}
columns={columns}
tableProps={{ rowKey: 'id', }}
fetchTableData={(params: unknown) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'planCode',
FORM_FILTER_PATH,
)
}}
schema={deliveryPlanAwaitB2BSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
export default DeliveryPlanAwaitB2B
\ No newline at end of file
/**
* 订单能力 -- 送货计划查询 Schema
* @author: Gavin
*/
import { ISchema } from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
export const deliveryPlanAwaitB2BSchema: ISchema = {
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
planCode: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
allowClear: true,
placeholder: '请输入计划编号查询'
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20,
},
},
properties: {
'[startTime, endTime]': {
type: 'daterange',
'x-component-props': {
allowClear: true,
placeholder: ['计划开始日期','计划结束日期'],
},
},
supplyMember: {
type: 'string',
'x-component-props': {
allowClear: true,
placeholder: '供应会员'
}
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
}
}
}
}
}
}
\ No newline at end of file
......@@ -3,15 +3,23 @@
* @author: Gavin
* @description: 与B2B内容大致相同,文件分开方便后续对接以及日后变动修改二开
*/
import React, { useRef } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
const DeliveryPlanAwaitSRMDetails: React.FC = () => {
return (
<PageHeaderWrapper>
<div>待提交送货计划 SRM 详情</div>
</PageHeaderWrapper>
)
}
export default DeliveryPlanAwaitSRMDetails
\ No newline at end of file
import React, { useState } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { history } from 'umi'
import ReutrnEle from '@/components/ReturnEle'
const DeliveryPlanAwaitSRMDetails: React.FC = () => {
const [details, setDetails] = useState<any>({})
return (
<PageHeaderWrapper
title={details?.name}
onBack={() => history.goBack()}
backIcon={<ReutrnEle />}
>
<div>待提交送货计划 SRM 详情</div>
</PageHeaderWrapper>
)
}
export default DeliveryPlanAwaitSRMDetails
\ No newline at end of file
......@@ -5,11 +5,141 @@
*/
import React, { useRef } 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 { deliveryPlanAwaitSRMSchema } from './schema'
const tagStatusColor = {
// 待提交
2: { color: '#f4f5f7', fontColor: '#5c626a' },
// 待确认
3: { color: '#ecf2fe', fontColor: '#4787f0' },
// 待修改
4: { color: '#eae6ff', fontColor: '#9963d8' },
// 已确认
5: { color: '#ebf9f6', fontColor: '#00a98f' }
}
const DeliveryPlanAwaitSRM: React.FC = () => {
const ref = useRef<any>({})
const formActions = createFormActions()
const controllerBtns = (
<Space>
<Button type='primary' icon={<PlusOutlined/>}>新增</Button>
</Space>
)
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'提交': 'DevTest',
'修改': 'DevTest',
'删除': 'DevTest',
'查看': 'DevTest',
}
const buttonGroup = {
'提交': true,
'修改': true,
'删除': true,
'查看': true,
}
const operationHandler = {
'提交': () => { console.log('提交 :>> ',) },
'修改': () => { console.log('修改 :>> ',) },
'删除': () => { console.log('删除 :>> ',) },
'查看': () => { console.log('查看 :>> ',) },
}
return (
<TableOperation
buttonTextFieldMap={buttonGroup}
operationHandler={operationHandler}
buttonPermissionsMap={btnAuthOfOperationTextMap}
/>
)
}
const columns: ColumnType<unknown>[] = [
{
title: '计划编号',
dataIndex: 'id',
key: 'id',
width: 160,
render: (text: unknown, record: unknown) => <EyePreview url='/memberCenter/order/deliveryPlanManagement/awaitSRMDetails'>{text}</EyePreview>
},
{ title: '计划摘要', dataIndex: 'id2', key: 'id2' },
{ title: '计划开始日期', dataIndex: 'id3', key: 'id3' },
{ title: '计划结束日期', dataIndex: 'id4', key: 'id4' },
{ title: '供应会员', dataIndex: 'id5', key: 'id5' },
{
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>
)
},
{
title: '操作',
dataIndex: '',
key: 'x',
align: 'center',
render: (record) => renderOptionButton(record)
},
]
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 }
]
}
resolve(data)
})
}
return (
<PageHeaderWrapper>
<div>待提交送货计划 SRM</div>
<Card>
<StandardTable
// keepAlive={false}
currentRef={ref}
columns={columns}
tableProps={{ rowKey: 'id', }}
fetchTableData={(params: unknown) => fetchData(params)}
controlRender={
<NiceForm
actions={formActions}
onSubmit={values => ref.current.reload(values)}
expressionScope={{
controllerBtns,
}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect(
$,
actions,
'planCode',
FORM_FILTER_PATH,
)
}}
schema={deliveryPlanAwaitSRMSchema}
/>
}
/>
</Card>
</PageHeaderWrapper>
)
}
......
/**
* 订单能力 -- 送货计划查询 Schema
* @author: Gavin
*/
import { ISchema } from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
export const deliveryPlanAwaitSRMSchema: ISchema = {
type: 'object',
properties: {
mageLayout: {
type: 'object',
'x-component': 'mega-layout',
properties: {
topLayout: {
type: 'object',
'x-component': 'mega-layout',
'x-component-props': {
grid: true,
},
properties: {
ctl: {
type: 'object',
'x-component': 'Children',
'x-component-props': {
children: '{{controllerBtns}}',
},
},
planCode: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
allowClear: true,
placeholder: '请输入计划编号查询'
},
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component-props': {
rowStyle: {
flexWrap: 'nowrap',
},
colStyle: {
marginLeft: 20,
},
},
properties: {
'[startTime, endTime]': {
type: 'daterange',
'x-component-props': {
allowClear: true,
placeholder: ['计划开始日期','计划结束日期'],
},
},
supplyMember: {
type: 'string',
'x-component-props': {
allowClear: true,
placeholder: '供应会员'
}
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
}
}
}
}
}
}
\ No newline at end of file
......@@ -9,15 +9,15 @@ import ReutrnEle from '@/components/ReturnEle'
import { Card, Descriptions } from 'antd'
const DeliveryPlanManagementDetails: React.FC = () => {
const [details, setDetails] = useState<unknown>({})
const [details, setDetails] = useState<any>({})
return (
<PageHeaderWrapper
title={details?.name}
onBack={() => history.goBack()}
backIcon={<ReutrnEle/>}
title={details?.name}
onBack={() => history.goBack()}
backIcon={<ReutrnEle />}
>
</PageHeaderWrapper>)
}
......
......@@ -16,19 +16,7 @@ import { FORM_FILTER_PATH } from '@/formSchema/const'
import { deliveryPlanManagementQuerySchema } from './schema'
const tagStatusColor = {
// // 待提交
// 2: 'default',
// // 待确认
// 3: 'blue',
// // 待修改
// 4: 'purple',
// // 已确认
// 5: 'success'
// 待提交
1: {
color: '#f4f5f7',
fontColor: '#5c626a'
},
2: {
color: '#f4f5f7',
fontColor: '#5c626a'
......@@ -51,7 +39,7 @@ const tagStatusColor = {
}
const DeliveryPlanManagementQuery: React.FC = () => {
const ref = useRef<unknown>({})
const ref = useRef<any>({})
const formActions = createFormActions()
const controllerBtns = (
......@@ -59,7 +47,7 @@ const DeliveryPlanManagementQuery: React.FC = () => {
{/* 杰哥说没有新增按钮 */}
</Space>
)
const renderOptionButton = (record: unknown) => {
const renderOptionButton = (record: any) => {
const btnAuthOfOperationTextMap = {
'查看': 'DevTest',
'变更': 'DevTest'
......@@ -97,8 +85,8 @@ const DeliveryPlanManagementQuery: React.FC = () => {
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 color={tagStatusColor[record.id]?.color}>
<span style={{ color: tagStatusColor[record.id]?.fontColor }}>{text}</span>
</Tag>
)
},
......@@ -111,7 +99,6 @@ const DeliveryPlanManagementQuery: React.FC = () => {
},
]
const fetchData = (params: unknown) => {
console.log('params :>> ', params);
return new Promise((resolve) => {
......
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