Commit c45aab7d authored by XieZhiXiong's avatar XieZhiXiong
parents 3637c1be 0d5fced6
......@@ -44,7 +44,7 @@
"antd-img-crop": "^3.12.0",
"bizcharts": "^4.0.14",
"copy-to-clipboard": "^3.3.1",
"god": "0.1.28",
"god": "0.1.29",
"lingxi-design": "^1.0.8",
"lingxi-design-ui": "^1.1.10",
"lingxi-editor-core": "^1.0.6",
......
......@@ -155,6 +155,10 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
const pathname = history.location.pathname
const isPreview = pathname.lastIndexOf('/preview') !== -1
// 是否是确认收货页
const isReceived = pathname.indexOf('readyReceiveOrder') !== -1
// 是否是确认回单页
const isReturn = pathname.indexOf('readyConfirmReturnOrder') !== -1
// 用于储存已经修改过的订单id
const dataRef = useRef<any>([])
......@@ -219,8 +223,8 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
key: 'ctl',
render: (text, record) => <>
{/* todo 需根据内部状态判断显示哪个按钮 */}
{ !isPreview && !dataRef.current.includes(record.id) && record.interiorState === DeliverySideState.CONFIRM_RECEIPT_ORDER && <Button type='link' onClick={() => handleReturn(record)}>确认回单</Button> }
{ !isPreview && !dataRef.current.includes(record.id) && record.interiorState === DeliverySideState.WAREHOUSE_ORDER && <Button type='link' onClick={() => handleConfirm(record)}>确认收货</Button> }
{ !isPreview && isReturn && !dataRef.current.includes(record.id) && record.interiorState === DeliverySideState.CONFIRM_RECEIPT_ORDER && <Button type='link' onClick={() => handleReturn(record)}>确认回单</Button> }
{ !isPreview && isReceived && !dataRef.current.includes(record.id) && record.interiorState === DeliverySideState.WAREHOUSE_ORDER && <Button type='link' onClick={() => handleConfirm(record)}>确认收货</Button> }
</>
},
]
......
......@@ -154,11 +154,15 @@ const sideChildrenCols: any[] = [
const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
const pathname = history.location.pathname
const isPreview = pathname.lastIndexOf('/preview') !== -1
// 是否是确认发货页
const isDeleved = pathname.indexOf('readyConfirmDelevedOrder') !== -1
// 是否是确认回单页
const isReturn = pathname.indexOf('readyConfirmReturnOrder') !== -1
// 用于储存已经修改过的订单id
const dataRef = useRef<any>([])
const { data, reloadFormData } = useContext(OrderDetailContext)
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses } = data
console.log(dataRef, isPreview)
const sideOrderCols: any[] = [
{
title: '发货批次',
......@@ -217,8 +221,8 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
align: 'center',
key: 'ctl',
render: (text, record) => <>
{ !isPreview && !dataRef.current.includes(record.id) && record.interiorState === DeliverySideState.CONFIRM_RECEIPT_ORDER && <Button type='link' onClick={() => handleReturn(record)}>确认回单</Button> }
{ !isPreview && !dataRef.current.includes(record.id) && record.interiorState === DeliverySideState.ADD_LOGISTICS_ORDER && <Button type='link' onClick={() => handleConfirm(record)}>确认发货</Button> }
{ !isPreview && isReturn && !dataRef.current.includes(record.id) && record.interiorState === DeliverySideState.CONFIRM_RECEIPT_ORDER && <Button type='link' onClick={() => handleReturn(record)}>确认回单</Button> }
{ !isPreview && isDeleved && !dataRef.current.includes(record.id) && record.interiorState === DeliverySideState.ADD_LOGISTICS_ORDER && <Button type='link' onClick={() => handleConfirm(record)}>确认发货</Button> }
</>
},
]
......
......@@ -51,7 +51,6 @@ const CircleChart = props => {
// 业务hooks, 待支付订单
export const useSelfTable = () => {
const ref = useRef<any>({})
const showOutPayState = PurchaseOrderOutWorkState.PAY_ORDER || PurchaseOrderOutWorkState.CONFIRM_NOT_ARRIVED_ACCOUNT
const payOrderColumns: any[] = [
{
title: '订单号',
......@@ -127,7 +126,8 @@ export const useSelfTable = () => {
<Col>{record.currentPayments} / {record.sum}</Col>
<Col>
{
record.currentPayments !== record.sum && showOutPayState &&
record.currentPayments !== record.sum &&
(record.externalState === PurchaseOrderOutWorkState.PAY_ORDER || record.externalState === PurchaseOrderOutWorkState.CONFIRM_NOT_ARRIVED_ACCOUNT) &&
<Link to={`/memberCenter/tranactionAbility/purchaseOrder/readyPayOrder/detail?id=${record.id}`}>去支付</Link>
}
</Col>
......
......@@ -10,7 +10,7 @@ import ApprovedOrderModal from '../../../components/approvedOrderModal';
import { history } from 'umi'
import { useHttpRequest } from '@/hooks/useHttpRequest';
import OrderDetailSection from '../../../components/orderDetailSection';
import { PurchaseOrderInsideWorkState } from '@/constants';
import { PurchaseOrderInsideWorkState, DeliverySideState } from '@/constants';
import OrderHandReceivedModal from '@/pages/transaction/components/orderHandReceivedModal';
const ReadyReceiveOrderDetail: React.FC = () => {
......@@ -20,6 +20,8 @@ const ReadyReceiveOrderDetail: React.FC = () => {
// 是否是手工收货
const isHeadReceipt = formContext.data && formContext.data.interiorState === PurchaseOrderInsideWorkState.HAND_RECEIPT_ORDER
// 所有收货订单都是否已经收货了
const isShowBtn = isHeadReceipt || formContext.data?.orderDeliveryDetailsResponses?.some(v => v.interiorState === DeliverySideState.WAREHOUSE_ORDER)
const handleClick = useCallback(() => {
if (isHeadReceipt) {
// 手工收货
......@@ -36,7 +38,7 @@ const ReadyReceiveOrderDetail: React.FC = () => {
<div>
<OrderDetailContext.Provider value={formContext}>
<OrderDetailHeader detailList={detailList} detailData={formContext.data} extraRight={
<Button type='primary' onClick={handleClick}>
isShowBtn && <Button type='primary' onClick={handleClick}>
{isHeadReceipt ? '手工收货' : '去确认收货'}
</Button>
} />
......
......@@ -14,6 +14,7 @@ import Submit from '@/components/NiceForm/components/Submit'
import { DatePicker } from '@formily/antd-components'
import { useRowSelectionTable } from '@/hooks/useRowSelectionTable'
import { PurchaseOrderInsideWorkState, SaleOrderInsideWorkState } from '@/constants'
import { useHttpRequest } from '@/hooks/useHttpRequest'
// 一级待审核订单
......@@ -33,19 +34,20 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
rowSelectionCtl
} = useSelfTable()
// const handleSubmitBatch = async () => {
// if (rowSelectionCtl.selectRow.length === 0) {
// message.error('请先勾选订单')
// return ;
// }
// const canBitch = !rowSelectionCtl.selectRow.some(v => v.purchaseOrderInteriorState !== SaleOrderInsideWorkState.ONE_LEVEL_AUDIT_ORDER)
// if (canBitch) {
// await PublicApi.postOrderSubmittedReviewOrderOneAll({ids: rowSelectionCtl.selectedRowKeys})
// ref.current.reload()
// } else {
// message.error('只能批量提交内部状态为审核中的订单')
// }
// }
const { run, loading } = useHttpRequest(PublicApi.postOrderSubmittedReviewOrderOneAll)
const handleBitchPush = async () => {
if (rowSelectionCtl.selectedRowKeys.length > 0) {
const { code } = await run({ids: rowSelectionCtl.selectedRowKeys})
if (code === 1000) {
rowSelectionCtl.setSelectRow([])
rowSelectionCtl.setSelectedRowKeys([])
ref.current.reload()
}
} else {
message.error('请勾选要审核的订单')
}
}
return <PageHeaderWrapper>
<Card>
<StandardTable
......@@ -74,19 +76,19 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
Submit
}
},
// layouts: {
// order: 2,
// span: 16
// }
layouts: {
order: 2,
span: 16
}
}}
formilyChilds={{
children: <Space>
<Button onClick={handleBitchPush} loading={loading}>批量提交审核</Button>
</Space>,
layouts: {
span: 8
}
}}
// formilyChilds={{
// children: <Space>
// <Button onClick={handleSubmitBatch}>批量提交审核</Button>
// </Space>,
// layouts: {
// span: 8
// }
// }}
/>
</Card>
</PageHeaderWrapper>
......
......@@ -12,7 +12,7 @@ export const tableListSchema: ISchema = {
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
align: 'flex-start',
align: 'flex-end',
},
},
[FORM_FILTER_PATH]: {
......@@ -21,7 +21,7 @@ export const tableListSchema: ISchema = {
'x-component-props': {
inline: true,
colStyle: {
marginRight: 20
marginLeft: 20
}
},
properties: {
......
......@@ -39,14 +39,6 @@ const ReadyApprovedOrder:React.FC<ReadyApprovedOrderProps> = (props) => {
} else {
message.error('请勾选要审核的订单')
}
// const canBitch = !rowSelectionCtl.selectRow.some(v => v.interiorState !== PurchaseOrderInsideWorkState.ADD_PURCHASE_ORDER)
// if (canBitch) {
// await PublicApi.postOrderSubmittedReviewOrderOneAll({ids: rowSelectionCtl.selectedRowKeys})
// ref.current.reload()
// } else {
// message.error('只能删除内部状态为未审核过的订单')
// }
}
return <PageHeaderWrapper>
......@@ -76,19 +68,19 @@ const ReadyApprovedOrder:React.FC<ReadyApprovedOrderProps> = (props) => {
Submit
}
},
layouts: {
order: 2,
span: 16
}
}}
formilyChilds={{
children: <Space>
<Button onClick={handleBitchPush} loading={loading}>批量提交审核</Button>
</Space>,
layouts: {
span: 8
}
// layouts: {
// order: 2,
// span: 16
// }
}}
// formilyChilds={{
// children: <Space>
// <Button onClick={handleBitchPush} loading={loading}>批量提交审核</Button>
// </Space>,
// layouts: {
// span: 8
// }
// }}
/>
</Card>
</PageHeaderWrapper>
......
......@@ -16,7 +16,7 @@ export const tableListSchema: ISchema = {
"x-component": 'SearchFilter',
'x-component-props': {
placeholder: '请输入订单编号',
align: 'flex-end',
align: 'flex-start',
},
},
[FORM_FILTER_PATH]: {
......@@ -25,7 +25,7 @@ export const tableListSchema: ISchema = {
'x-component-props': {
inline: true,
colStyle: {
marginLeft: 20
marginRight: 20
}
},
properties: {
......
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