Commit 8bb0885e authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 销售订单表格操作变更为后端字段控制

parent 37d451f1
......@@ -8,11 +8,33 @@ import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons'
import { ORDER_TYPE, PurchaseOrderInsideWorkState } from '@/constants/order'
import { DOC_TYPE_PURCHASE_RECEIPT } from '@/constants/commodity'
import TableOperation from '@/components/TableOperation'
// 业务hooks, 待支付订单
export const useSelfTable = () => {
const ref = useRef<any>({})
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const statusAndOperationList = {
'9': ['新增入库单'],
'10': ['审核'],
}
const operationHandler = {
'审核': () => handleConfirm(record),
'新增入库单': () => handleAdd(record),
}
return (
<TableOperation
record={record}
customField='button'
statusOperationMap={statusAndOperationList}
operationHandler={operationHandler}
priorityOperationName='审核'
/>
)
}
const customOrderColumns: any[] = [
{
title: '订单号',
......@@ -86,15 +108,16 @@ export const useSelfTable = () => {
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ record.interiorState === PurchaseOrderInsideWorkState.READY_WAREHOUSE_APPROVED_ORDER &&
<Button type='link' onClick={() => handleConfirm(record)}>审核</Button>
}
{ record.interiorState === PurchaseOrderInsideWorkState.WAREHOUSE_ORDER &&
<Button type='link' onClick={() => handleAdd(record)}>新增入库单</Button>
}
</>
render: (text: any, record: any) => renderOptionButton(record)
// render: (text, record) => <>
// {/* 支付结果确认到账= 待审核状态 */}
// { record.interiorState === PurchaseOrderInsideWorkState.READY_WAREHOUSE_APPROVED_ORDER &&
// <Button type='link' onClick={() => handleConfirm(record)}>审核</Button>
// }
// { record.interiorState === PurchaseOrderInsideWorkState.WAREHOUSE_ORDER &&
// <Button type='link' onClick={() => handleAdd(record)}>新增入库单</Button>
// }
// </>
}
]
......
......@@ -22,10 +22,10 @@ export const useSelfTable = () => {
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{
record.interiorState === PurchaseOrderInsideWorkState.FILLING_ORDER &&
{/* {
record.interiorState === PurchaseOrderInsideWorkState.FILLING_ORDER && */}
<Button type='link' onClick={() => handleSubmit(record)}>归档</Button>
}
{/* } */}
</>
}
])
......
......@@ -85,10 +85,10 @@ export const useSelfTable = () => {
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ (record.interiorState === PurchaseOrderInsideWorkState.CONFIRM_RECEIPT || record.interiorState === PurchaseOrderInsideWorkState.HAND_RECEIPT_ORDER) &&
{/* 支付结果确认到账= 待审核状态
{ (record.interiorState === PurchaseOrderInsideWorkState.CONFIRM_RECEIPT || record.interiorState === PurchaseOrderInsideWorkState.HAND_RECEIPT_ORDER) && */}
<Button type='link' onClick={() => handleConfirm(record)}>确认收货</Button>
}
{/* } */}
</>
}
]
......
......@@ -8,11 +8,36 @@ import { ORDER_TYPE, SaleOrderInsideWorkState } from '@/constants/order'
import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons'
import { DOC_TYPE_SALES_INVOICE } from '@/constants/commodity'
import TableOperation from '@/components/TableOperation'
// 业务hooks, 待支付订单
export const useSelfTable = () => {
const ref = useRef<any>({})
// 1.(查看)2.(查看、取消订单)3.(查看售后),4.(评价查看售后)5.(提交审核修改删除查看)6.(修改查看),7.(查看中止)8.查看评价9.待新增采购入库单
// 10.审核采购入库单,11.待新增销售发货单12.审核销售发货单13.待新增物流单,14.查看物流单15.修改物流单
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const statusAndOperationList = {
'11': ['新增发货单'],
'12': ['审核'],
}
const operationHandler = {
'审核': () => handleConfirm(record),
'新增发货单': () => handleAdd(record),
}
return (
<TableOperation
record={record}
customField='button'
statusOperationMap={statusAndOperationList}
operationHandler={operationHandler}
priorityOperationName='审核'
/>
)
}
const customOrderColumns: any[] = [
{
title: '订单号',
......@@ -87,15 +112,16 @@ export const useSelfTable = () => {
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.READY_DELEVED_APPROVED &&
<Button type='link' onClick={() => handleConfirm(record)}>审核</Button>
}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.SALE_CREATE_DELIVED_ORDER &&
<Button type='link' onClick={() => handleAdd(record)}>新增发货单</Button>
}
</>
render: (text: any, record: any) => renderOptionButton(record)
// render: (text, record) => <>
// {/* 支付结果确认到账= 待审核状态 */}
// { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.READY_DELEVED_APPROVED &&
// <Button type='link' onClick={() => handleConfirm(record)}>审核</Button>
// }
// { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.SALE_CREATE_DELIVED_ORDER &&
// <Button type='link' onClick={() => handleAdd(record)}>新增发货单</Button>
// }
// </>
}
]
......
......@@ -21,12 +21,13 @@ export const useSelfTable = () => {
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{
record.purchaseOrderInteriorState === SaleOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER &&
render: (text, record) =>
// <>
// {
// record.purchaseOrderInteriorState === SaleOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER &&
<Button type='link' onClick={() => handleSubmit(record)}>提交审核</Button>
}
</>
// }
// </>
}
])
......
......@@ -13,6 +13,7 @@ import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePicke
import Submit from '@/components/NiceForm/components/Submit'
import NiceForm from '@/components/NiceForm'
import { createFormActions } from '@formily/antd'
import TableOperation from '@/components/TableOperation'
// 销售订单查询
......@@ -25,18 +26,44 @@ const fetchTableData = async (params) => {
const formActions = createFormActions();
// 最后一步开始调试 TODO
const SaleOrder: React.FC<SaleOrderProps> = (props) => {
const ref = useRef<any>({})
const [saleVisible, setSaleVisible] = useState<any>(false)
// 售后唤起弹窗 @todo
const handleSaleAfter = (id) => {
const handleEvaluate = (id) => {
history.push(`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated`)
}
const handleCancel = (r) => {
console.log('TODO')
}
const handleEvaluate = (id) => {
history.push(`/memberCenter/tranactionAbility/supplierEvaluation/unevaluated`)
const handleSuspend = (r) => {
console.log('TODO')
}
// 1.(查看)2.(查看、取消订单)3.(查看售后),4.(评价查看售后)5.(提交审核修改删除查看)6.(修改查看),7.(查看中止)8.查看评价9.待新增采购入库单
// 10.审核采购入库单,11.待新增销售发货单12.审核销售发货单13.待新增物流单,14.查看物流单15.修改物流单
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const statusAndOperationList = {
'3': ['取消订单'],
'7': ['中止'],
'8': ['评价'],
}
const operationHandler = {
'取消订单': () => handleCancel(record),
'中止': () => handleSuspend(record),
'评价': () => handleEvaluate(record.id),
}
return (
<TableOperation
record={record}
customField='button'
statusOperationMap={statusAndOperationList}
operationHandler={operationHandler}
priorityOperationName='审核'
/>
)
}
const secondColumns: any[] = baseOrderListColumns().concat([
......@@ -45,11 +72,10 @@ const SaleOrder: React.FC<SaleOrderProps> = (props) => {
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{ record.externalState === PurchaseOrderOutWorkState.FINISH_ORDER && !record.procurementEevaluateState && <Button type='link' onClick={() => handleEvaluate(record.id)}>评价</Button> }
{/* todo */}
{/* <Button type='link' onClick={() => handleSaleAfter(record.id)}>售后</Button> */}
</>
render: (text: any, record: any) => renderOptionButton(record)
// render: (text, record) => <>
// { record.externalState === PurchaseOrderOutWorkState.FINISH_ORDER && !record.procurementEevaluateState && <Button type='link' onClick={() => handleEvaluate(record.id)}>评价</Button> }
// </>
}
])
......
......@@ -7,11 +7,38 @@ import { ORDER_TYPE, SaleOrderInsideWorkState } from '@/constants/order'
import StatusColors from '@/pages/transaction/components/StatusColors'
import { FieldTimeOutlined } from '@ant-design/icons'
import qs from 'querystring'
import TableOperation from '@/components/TableOperation'
// 业务hooks, 待支付订单
export const useSelfTable = () => {
const ref = useRef<any>({})
// 1.(查看)2.(查看、取消订单)3.(查看售后),4.(评价查看售后)5.(提交审核修改删除查看)6.(修改查看),7.(查看中止)8.查看评价9.待新增采购入库单
// 10.审核采购入库单,11.待新增销售发货单12.审核销售发货单13.待新增物流单,14.查看物流单15.修改物流单
/** 参照后台数据生成 */
const renderOptionButton = (record: any) => {
const statusAndOperationList = {
'13': ['新增物流单'],
'14': ['查看物流单'],
'15': ['修改物流单'],
}
const operationHandler = {
'新增物流单': () => handleConfirm(record),
'查看物流单': () => handlePreview(record),
'修改物流单': () => handleModify(record),
}
return (
<TableOperation
record={record}
customField='button'
statusOperationMap={statusAndOperationList}
operationHandler={operationHandler}
priorityOperationName='审核'
/>
)
}
const customOrderColumns: any[] = [
{
title: '订单号',
......@@ -86,17 +113,18 @@ export const useSelfTable = () => {
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.ADD_LOGISTICS_ORDER &&
<Button type='link' onClick={() => handleConfirm(record)}>新增物流单</Button>
}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.DELIVERY_APPROVED_SUCCESS &&
<Button type='link' onClick={() => handlePreview(record)}>查看物流单</Button>
}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.NOT_ACCEPTED_DELIVERY &&
<Button type='link' onClick={() => handleModify(record)}>修改物流单</Button>
}
</>
render: (text: any, record: any) => renderOptionButton(record)
// render: (text, record) => <>
// { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.ADD_LOGISTICS_ORDER &&
// <Button type='link' onClick={() => handleConfirm(record)}>新增物流单</Button>
// }
// { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.DELIVERY_APPROVED_SUCCESS &&
// <Button type='link' onClick={() => handlePreview(record)}>查看物流单</Button>
// }
// { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.NOT_ACCEPTED_DELIVERY &&
// <Button type='link' onClick={() => handleModify(record)}>修改物流单</Button>
// }
// </>
}
]
......
......@@ -84,12 +84,12 @@ export const useSelfTable = () => {
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ (record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_DELIVERY_ORDER || record.purchaseOrderInteriorState === SaleOrderInsideWorkState.HAND_DELEVED_ORDER) &&
render: (text, record) =>
// <>
// { (record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_DELIVERY_ORDER || record.purchaseOrderInteriorState === SaleOrderInsideWorkState.HAND_DELEVED_ORDER) &&
<Button type='link' onClick={() => handleConfirm(record)}>确认发货</Button>
}
</>
// }
// </>
}
]
......
......@@ -84,12 +84,12 @@ export const useSelfTable = () => {
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_RECEIPT &&
render: (text, record) =>
// <>
// { record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_RECEIPT &&
<Button type='link' onClick={() => handleConfirm(record)}>确认回单</Button>
}
</>
// }
// </>
}
]
......
......@@ -21,12 +21,13 @@ export const useSelfTable = () => {
align: 'center',
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{
record.purchaseOrderInteriorState === SaleOrderInsideWorkState.FILLING_ORDER &&
render: (text, record) =>
// <>
// {
// record.purchaseOrderInteriorState === SaleOrderInsideWorkState.FILLING_ORDER &&
<Button type='link' onClick={() => handleSubmit(record)}>归档</Button>
}
</>
// }
// </>
}
])
......
import React, {useState, useRef, useEffect} from 'react'
import React, {useState} from 'react'
import { history } from 'umi'
import { Button, Card } from 'antd'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
......@@ -8,8 +8,8 @@ import {
import ReutrnEle from '@/components/ReturnEle';
import './index.less'
import { ruleDetailSchema } from './schema'
import { createFormActions, ISchema, FormEffectHooks } from '@formily/antd'
import { findItemAndDelete, omit } from '@/utils'
import { createFormActions } from '@formily/antd'
import { omit } from '@/utils'
import { PublicApi } from '@/services/api'
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'
import RuleSetting from './components/RuleSetting'
......
......@@ -259,6 +259,9 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
state.visible = true
})
}
if(pageStatus === PageStatus.PREVIEW) {
data.time = data.time + '小时'
}
setInitialValue(data)
}
if(id != '') {
......
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