Commit fdf6051b authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents aeb81bbb 22403869
......@@ -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 = ['',
'询价采购',
'需求采购',
'现货采购',
'集采',
'积分兑换',
'渠道直采',
'渠道现货',
'渠道积分兑换',
]
......@@ -106,6 +106,7 @@ export default {
'menu.tranactionAbility.enquirySubmit.addEnquiry': '新增需求单',
'menu.tranactionAbility.purchaseOrder': '采购订单',
'menu.tranactionAbility.purchaseOrder.purchaseOrderSearch': '订单查询',
'menu.tranactionAbility.purchaseOrder.readyAddOrder': '待新增订单',
//物流能力
'menu.logisticsAbility': '物流',
......
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
}
}
......@@ -65,6 +65,7 @@ const actions = createFormActions()
const UserRegistry = () => {
const [current, setCurrent] = useState(0)
const [subStep, setSubStep] = useState(false)
const [submitLoading, setSubmitLoading] = useState(false)
const stepList = [
{ title: '填写信息', key: 'message', name: 'message' },
{ title: '完善资料', key: 'over', name: 'over' },
......@@ -151,6 +152,7 @@ const UserRegistry = () => {
const { values } = data
formCache = Object.assign({},formCache, filterUndef(values))
const { businessTypeId, typeId } = values
setSubmitLoading(true)
PublicApi.getMemberMenuRegisterDetail({
businessTypeId,
memberTypeId: typeId
......@@ -163,6 +165,8 @@ const UserRegistry = () => {
}
}).catch(() => {
}).finally(() => {
setSubmitLoading(false)
})
})
}
......@@ -175,6 +179,7 @@ const UserRegistry = () => {
// 写死传入的区号
formCache.countryCode = '+86'
const params = omit(formCache, ['isRead', 'confirmPassword'])
setSubmitLoading(true)
PublicApi.postMemberRegister(params).then(({code}) => {
if (code === 1000) {
actions.dispatch('onFormStepNext', {})
......@@ -184,6 +189,8 @@ const UserRegistry = () => {
}).catch(() => {
// 调用接口后 失败需清空缓存的数据
formCache = {}
}).finally(() => {
setSubmitLoading(false)
})
})
}
......@@ -221,11 +228,11 @@ const UserRegistry = () => {
}
{
current === 1 && !subStep &&
<Button type='primary' className={'continueButton'} onClick={nextStepAction}>下一步:继续完善</Button>
<Button type='primary' className={'continueButton'} onClick={nextStepAction} loading={submitLoading}>下一步:继续完善</Button>
}
{
current === 1 && subStep &&
<Button type='primary' className={'continueButton'} onClick={submitForm}>提交注册资料</Button>
<Button type='primary' className={'continueButton'} onClick={submitForm} loading={submitLoading}>提交注册资料</Button>
}
</div>
{
......
......@@ -13,6 +13,10 @@ export function isObject(obj: any) {
return Object.prototype.toString.call(obj) === '[object Object]'
}
export function formatTimeString(date, format: string = 'YYYY-MM-DD HH:MM:SS') {
return date ? moment(date).format(format) : ''
}
export function timeRange(val: number) {
let st, et;
switch (val) {
......
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