Commit 22403869 authored by 前端-许佳敏's avatar 前端-许佳敏

采购订单

parent 4f8e5742
......@@ -97,6 +97,12 @@ const TranactionRoute = {
key: 'purchaseOrderSearch',
component: '@/pages/transaction/purchaseOrder'
},
{
path: '/memberCenter/tranactionAbility/purchaseOrder/readyAddOrder',
name: 'readyAddOrder',
key: 'readyAddOrder',
component: '@/pages/transaction/purchaseOrder/readyAddOrder'
},
]
}
]
......
......@@ -118,3 +118,14 @@ export const UPLOAD_TYPE = isDev ? 2 : 1
export const VIP_RULE_TRANSACTION = 1; // 交易
export const VIP_RULE_LOGIN = 2; // 登录
export const VIP_RULE_COMMENT = 3; // 评论
export const ORDER_TYPE = ['',
'询价采购',
'需求采购',
'现货采购',
'集采',
'积分兑换',
'渠道直采',
'渠道现货',
'渠道积分兑换',
]
import React from 'react'
import { Tag } from 'antd'
export interface IStatusColor {
[key: string]: {
value: string | number,
color: string
}
}
// 用于标签状态控制
export interface StatusColorsProps {
status: number
}
export enum ORDER_EXAMINE_ENUM {
/**
* 新增订单
*/
ADD_ORDER = 1,
/**
* 一级审核
*/
ONE_LEVEL_VALIDATE,
/**
* 二级审核
*/
TWO_LEVEL_VALIDATE,
/**
* 提交订单中
*/
SUBMIT_ORDER_PROCESS,
/**
* 提交订单成功
*/
SUBMIT_ORDER_SUCCESS,
/**
* 一级审核失败
*/
ONE_LEVEL_VALIDATE_ERROR,
/**
* 二级审核失败
*/
TWO_LEVEL_VALIDATE_ERROR
}
export const ORDER_EXAMINE_LIST = ['',
'新增订单',
'一级审核中',
'二级审核中',
'提交订单',
'提交成功',
'一级审核不通过',
'二级审核不通过'
]
// 状态颜色映射
export const StatusColorsMaps = {
ready: '#C0C4CC',
process: '#FFC400',
submit: '#6C9CEB',
success: '#41CC9E',
error: '#EF6260'
}
const matchStatusColor = (status: number): string => {
const maps = {
[ORDER_EXAMINE_ENUM.ADD_ORDER]: StatusColorsMaps.ready,
[ORDER_EXAMINE_ENUM.ONE_LEVEL_VALIDATE]: StatusColorsMaps.process,
[ORDER_EXAMINE_ENUM.TWO_LEVEL_VALIDATE]: StatusColorsMaps.process,
[ORDER_EXAMINE_ENUM.SUBMIT_ORDER_PROCESS]: StatusColorsMaps.submit,
[ORDER_EXAMINE_ENUM.SUBMIT_ORDER_SUCCESS]: StatusColorsMaps.success
}
// 默认返回错误的状态颜色
return maps[status] || StatusColorsMaps.error
}
// 订单内部状态显示
const StatusColors:React.FC<StatusColorsProps> = (props) => {
const { status } = props
const statusShowColor = matchStatusColor(status)
return (<Tag color={statusShowColor}>{ORDER_EXAMINE_LIST[status]}</Tag>)
}
StatusColors.defaultProps = {}
export default StatusColors
\ No newline at end of file
import React from 'react'
import { Card } from 'antd'
import { StandardTable } from 'god'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import { PublicApi } from '@/services/api'
import { useReadyAddOrder } from './model/useReadyAddOrder'
// 待新增订单
export interface ReadyAddOrderProps {}
const fetchTableData = async (params) => {
const { data } = await PublicApi.getOrderProcurementStayAddList(params)
return data
}
// TODO
const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
const {
columns
} = useReadyAddOrder()
return <PageHeaderWrapper>
<Card>
<StandardTable
fetchTableData={params => fetchTableData(params)}
columns={columns}
formilyProps={{
ctx: {
}
}}
/>
</Card>
</PageHeaderWrapper>
}
ReadyAddOrder.defaultProps = {}
export default ReadyAddOrder
\ No newline at end of file
import React from 'react'
import { Button } from 'antd'
import { formatTimeString } from '@/utils'
import { ORDER_TYPE } from '@/constants'
import StatusColors from '../../components/StatusColors'
// 业务hooks, 待新增订单
export const useReadyAddOrder = () => {
const readyAddOrderColumns: any[] = [
{
title: '订单号',
align: 'center',
dataIndex: 'orderNo',
key: 'orderNo',
},
{
title: '订单摘要',
align: 'center',
dataIndex: 'orderThe',
key: 'orderThe',
},
{
title: '供应会员',
align: 'center',
dataIndex: 'supplyMembersName',
key: 'supplyMembersName',
},
{
title: '下单时间',
align: 'center',
dataIndex: 'createTime',
key: 'createTime',
render: (text) => formatTimeString(text)
},
{
title: '订单总额',
align: 'center',
dataIndex: 'sumPrice',
key: 'sumPrice',
},
{
title: '订单类型',
align: 'center',
dataIndex: 'type',
key: 'type',
render: (text) => ORDER_TYPE[text]
},
{
title: '外部状态',
align: 'center',
dataIndex: 'externalState',
key: 'externalState',
},
{
title: '内部状态',
align: 'center',
dataIndex: 'interiorState',
key: 'interiorState',
render: (text) => <StatusColors status={text}/>
},
{
title: '操作',
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
<Button type='link'>提交审核</Button>
</>
}
]
return {
columns: readyAddOrderColumns
}
}
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