Commit dda04320 authored by wzy's avatar wzy

Merge branch 'v2-220418' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into v2-220418

parents 69c10ada c3ee575a
......@@ -5,20 +5,50 @@
*/
const DeliveryPlanManagement = [
{
path: '/memberCenter/order/DeliveryPlanManagement',
path: '/memberCenter/order/deliveryPlanManagement',
name: '送货计划管理',
routes: [
{
/** 送货计划查询 */
path: '/memberCenter/order/DeliveryPlanManagement/query',
path: '/memberCenter/order/deliveryPlanManagement/query',
name: '送货计划查询',
component: '@/pages/order/deliveryPlanQuery/index'
component: '@/pages/order/deliveryPlanManagement/deliveryPlanQuery/index'
},
{
/** 送货计划详情 */
path: '/memberCenter/order/DeliveryPlanManagement/details',
path: '/memberCenter/order/deliveryPlanManagement/details',
name: '送货计划详情',
component: '@/pages/order/deliveryPlanQuery/details',
component: '@/pages/order/deliveryPlanManagement/deliveryPlanQuery/details',
hideInMenu: true,
},
{
/** 待提交送货计划 SRM*/
path: '/memberCenter/order/deliveryPlanManagement/awaitSRM',
name: '待提交送货计划(SRM)',
component: '@/pages/order/deliveryPlanManagement/deliveryPlanAwaitSRM'
},
{
/** 待提交送货计划 SRM 详情*/
path: '/memberCenter/order/deliveryPlanManagement/awaitSRMDetails',
name: '待提交送货计划(SRM)详情',
component: '@/pages/order/deliveryPlanManagement/deliveryPlanAwaitSRM/details',
hideInMenu: true,
},
{
/** 待提交送货计划 - B2B*/
path: '/memberCenter/order/deliveryPlanManagement/awaitB2B',
name: '待提交送货计划(B2B)',
component: '@/pages/order/deliveryPlanManagement/deliveryPlanAwaitB2B'
},
{
/** 待提交送货计划 - B2B 详情*/
path: '/memberCenter/order/deliveryPlanManagement/awaitB2BDetails',
name: '待提交送货计划(B2B)详情',
component: '@/pages/order/deliveryPlanManagement/deliveryPlanAwaitB2B/details',
hideInMenu: true,
},
]
......
......@@ -42,6 +42,6 @@ const AuthButton = (props: AuthButtonProps) => {
return false
}
}
return _authorityBtn() ? children : null
return _authorityBtn ? children : null
}
export default AuthButton;
/**
* 订单能力 -- 待提交送货计划 B2B 详情
* @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
/**
* 订单能力 -- 待提交送货计划 B2B
* @author: Gavin
* @description: 与SRM内容大致相同,文件分开方便后续对接以及日后变动修改二开
*/
import React, { useRef } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
const DeliveryPlanAwaitB2B: React.FC = () => {
return (
<PageHeaderWrapper>
<div>待提交送货计划 B2B</div>
</PageHeaderWrapper>
)
}
export default DeliveryPlanAwaitB2B
\ No newline at end of file
/**
* 订单能力 -- 待提交送货计划 SRM 详情
* @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
/**
* 订单能力 -- 待提交送货计划 SRM
* @author: Gavin
* @description: 与B2B内容大致相同,文件分开方便后续对接以及日后变动修改二开
*/
import React, { useRef } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
const DeliveryPlanAwaitSRM: React.FC = () => {
return (
<PageHeaderWrapper>
<div>待提交送货计划 SRM</div>
</PageHeaderWrapper>
)
}
export default DeliveryPlanAwaitSRM
\ No newline at end of file
/**
* 订单能力 -- 送货计划详情
* @author: Gavin
*/
import React, { useState } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { history } from 'umi'
import ReutrnEle from '@/components/ReturnEle'
import { Card, Descriptions } from 'antd'
const DeliveryPlanManagementDetails: React.FC = () => {
const [details, setDetails] = useState<unknown>({})
return (
<PageHeaderWrapper
title={details?.name}
onBack={() => history.goBack()}
backIcon={<ReutrnEle/>}
>
</PageHeaderWrapper>)
}
export default DeliveryPlanManagementDetails
\ No newline at end of file
/**
* 订单能力 -- 送货计划查询
* @author: Gavin
*/
import React, { useRef } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { 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 { deliveryPlanManagementQuerySchema } from './schema'
const tagStatusColor = {
// // 待提交
// 2: 'default',
// // 待确认
// 3: 'blue',
// // 待修改
// 4: 'purple',
// // 已确认
// 5: 'success'
// 待提交
1: {
color: '#f4f5f7',
fontColor: '#5c626a'
},
2: {
color: '#f4f5f7',
fontColor: '#5c626a'
},
// 待确认
3: {
color: '#ecf2fe',
fontColor: '#4787f0'
},
// 待修改
4: {
color: '#eae6ff',
fontColor: '#9963d8'
},
// 已确认
5: {
color: '#ebf9f6',
fontColor: '#00a98f'
}
}
const DeliveryPlanManagementQuery: React.FC = () => {
const ref = useRef<unknown>({})
const formActions = createFormActions()
const controllerBtns = (
<Space>
{/* 杰哥说没有新增按钮 */}
</Space>
)
const renderOptionButton = (record: unknown) => {
const btnAuthOfOperationTextMap = {
'查看': 'DevTest',
'变更': 'DevTest'
}
const buttonGroup = {
'查看': true,
'变更': record.id === 1
}
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/DeliveryPlanManagement/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={deliveryPlanManagementQuerySchema}
/>
}
/>
</Card>
</PageHeaderWrapper>)
}
export default DeliveryPlanManagementQuery
\ No newline at end of file
/**
* 订单能力 -- 送货计划查询 Schema
* @author: Gavin
*/
import { ISchema } from '@formily/antd'
import { FORM_FILTER_PATH } from '@/formSchema/const'
export const deliveryPlanManagementQuerySchema: 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
*/
import React, {} from 'react'
const DeliveryPlanManagementDetails: React.FC = () => {
return (<>
<div>送货计划详情</div>
</>)
}
export default DeliveryPlanManagementDetails
\ No newline at end of file
/**
* 订单能力 -- 送货计划查询
* @author: Gavin
*/
import React, { } from 'react'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { Card } from 'antd'
import StandardTable from '@/components/StandardTable'
import { ColumnType } from 'antd/lib/table'
import TableOperation from '@/components/TableOperation'
const DeliveryPlanManagementQuery: React.FC = () => {
const renderOptionButton = (record: unknown) => {
const btnAuthOfOperationTextMap = {
'查看': 'DevTest',
'变更': 'DevTest'
}
const buttonGroup = {
'查看': true,
'变更': record.id === 1
}
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 },
{ 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' },
{ title: '操作', dataIndex: '', key: 'x', render: (record) => renderOptionButton(record) },
]
const fetchData = (params: unknown) => {
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 }] }
resolve(data)
})
}
return (
<PageHeaderWrapper>
<Card>
<StandardTable
columns={columns}
tableProps={{ rowKey: 'id', }}
fetchTableData={(params: any) => fetchData(params)}
// controlRender={}
/>
</Card>
</PageHeaderWrapper>)
}
export default DeliveryPlanManagementQuery
\ No newline at end of file
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