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

修复采购订单地址选择

parent 1a3a0dea
......@@ -670,27 +670,27 @@ export enum SaleOrderInsideWorkState {
CONFIRM_NOT_PAY_RESULT,
/**
* 订单销售,发货单创建
* 待新增销售发货单
*/
SALE_CREATE_DELIVED_ORDER,
/**
* 新增物流单
* 待新增物流单(发货单审核成功)
*/
ADD_LOGISTICS_ORDER,
/**
* 订单发货确认
* 待确认发货(物流单审核成功)
*/
CONFIRM_DELIVERY_ORDER,
/**
* 确认回单
* 待确认回单(已确认发货)
*/
CONFIRM_RECEIPT = 23,
/**
* 订单归档
* 待订单归档(已确认回单)
*/
FILLING_ORDER,
......@@ -700,7 +700,7 @@ export enum SaleOrderInsideWorkState {
READY_DELEVED_APPROVED,
/**
* 销售发货单审核成功
* 待审核物流单(新增物流单成功)
*/
DELIVERY_APPROVED_SUCCESS
}
......
......@@ -35,6 +35,8 @@ const DemandModalTable:React.FC<DemandModalTableProps> = (props) => {
id: item.id
})
schemaAction.setFieldValue('orderProductRequests', data)
schemaAction.setFieldValue('supplyMembersName', item.demandMembers)
schemaAction.setFieldValue('supplyMembersId', item.demandMemberId)
}
confirmModal && confirmModal()
setVisible(false)
......
......@@ -59,9 +59,12 @@ const SelectAddress = (props: ISchemaFieldComponentProps) => {
const modalRef = useRef<any>({})
const { dataSource, showMore } = state
const { value, mutators, editable } = props
const transformData = transformDefaultData(dataSource)
const showDataSource = showMore ? [...transformData].splice(0, 3) : transformData
// 当前选中的id
const checkedId = value ? value.id : dataSource[0]?.id
const handleAdd = () => {
setMode('add')
modalRef.current.setVisible(true)
......@@ -111,7 +114,7 @@ const SelectAddress = (props: ISchemaFieldComponentProps) => {
{ editable && <Button block onClick={handleAdd} icon={<PlusOutlined/>}>新建地址</Button> }
<SelectStyles>
{
showDataSource.map(v => <div key={v.id} onClick={() => handleCheck(v)} className={cx('select_style_border', value.id === v.id ? 'active' : '')}>
showDataSource.map(v => <div key={v.id} onClick={() => handleCheck(v)} className={cx('select_style_border', checkedId === v.id ? 'active' : '')}>
<div>
<Row style={{color: '#172B4D'}}>
<Col>{v.receiverName}</Col>
......
......@@ -275,6 +275,7 @@ export const productInfoColumns: any[] = [
dataIndex: 'none',
align: 'center',
key: 'none',
render: () => '是'
},
{
title: '金额',
......
......@@ -357,6 +357,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
{/* 询价报价单弹窗 */}
<InquiryModalTable currentRef={inquiryRef} schemaAction={addSchemaAction}/>
{/* 需求报价单弹窗 */}
<DemandModalTable currentRef={demandRef} schemaAction={addSchemaAction}/>
</ReadyAddOrderDetailContext.Provider>
</PageHeaderWrapper>
......
......@@ -318,6 +318,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
dataIndex: 'none',
align: 'center',
key: 'none',
render: () => '是'
},
{
title: '金额',
......
......@@ -318,6 +318,7 @@ export const productInfoColumns: any[] = [
dataIndex: 'none',
align: 'center',
key: 'none',
render: () => '是'
},
{
title: '金额',
......
......@@ -317,6 +317,7 @@ export const productInfoColumns: any[] = [
dataIndex: 'none',
align: 'center',
key: 'none',
render: () => '是'
},
{
title: '金额',
......
import React, { useContext } from 'react'
import { Tabs, Table, Button } from 'antd'
import StatusColors from '@/pages/transaction/components/StatusColors'
import { formatTimeString } from '@/utils'
import { OrderDetailContext } from '../../context'
import MellowCard from '@/components/MellowCard'
import NestTable from '@/components/NestTable'
export interface OrderDeleveRecordProps {}
const outOrderCols: any[] = [
{
title: '商品ID',
dataIndex: 'productId',
align: 'center',
key: 'productId'
},
{
title: '商品名称',
dataIndex: 'productName',
align: 'center',
key: 'productName',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category'
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit'
},
{
title: '单价',
dataIndex: 'unitPrice',
align: 'center',
key: 'unitPrice',
},
{
title: '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
},
{
title: '含税',
dataIndex: 'no',
align: 'center',
key: 'no',
render: () => '是'
},
{
title: '金额',
dataIndex: 'price',
align: 'center',
key: 'price',
},
{
title: '已发货',
dataIndex: 'delivered',
align: 'center',
key: 'delivered',
},
{
title: '未发货',
dataIndex: 'notDelivered',
align: 'center',
key: 'notDelivered',
},
{
title: '已收货',
dataIndex: 'goodsReceived',
align: 'center',
key: 'goodsReceived',
},
{
title: '差异数量',
dataIndex: 'differenceCount',
align: 'center',
key: 'differenceCount',
},
]
const sideOrderCols: any[] = [
{
title: '发货批次',
dataIndex: 'deliveryBatch',
align: 'center',
key: 'deliveryBatch'
},
{
title: '发货单号',
dataIndex: 'deliveryNo',
align: 'center',
key: 'deliveryNo',
},
{
title: '发货时间',
dataIndex: 'deliveryTime',
align: 'center',
key: 'deliveryTime',
render: text => formatTimeString(text)
},
{
title: '物流单号',
dataIndex: 'logisticsNo',
align: 'center',
key: 'logisticsNo',
},
{
title: '物流公司',
dataIndex: 'logisticsCompanyName',
align: 'center',
key: 'logisticsCompanyName'
},
{
title: '入库单号',
dataIndex: 'storageNo',
align: 'center',
key: 'storageNo',
},
{
title: '入库时间',
dataIndex: 'storageTime',
align: 'center',
key: 'storageTime',
render: text => formatTimeString(text)
},
{
title: '内部状态',
dataIndex: 'interiorState',
align: 'center',
key: 'interiorState',
render: text => <StatusColors type='saleInside' status={text}/>
},
{
title: '操作',
dataIndex: 'ctl',
align: 'center',
key: 'ctl',
render: record => <>
{/* todo 需根据内部状态判断显示哪个按钮 */}
<Button type='link'>确认回单</Button>
<Button type='link'>确认发货</Button>
</>
},
]
const sideChildrenCols: any[] = [
{
title: '商品ID',
dataIndex: 'productId',
align: 'center',
key: 'productId',
},
{
title: '商品名称',
dataIndex: 'productName',
align: 'center',
key: 'productName',
},
{
title: '品类',
dataIndex: 'category',
align: 'center',
key: 'category',
},
{
title: '品牌',
dataIndex: 'brand',
align: 'center',
key: 'brand',
},
{
title: '单位',
dataIndex: 'unit',
align: 'center',
key: 'unit',
},
{
title: '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
},
{
title: '发货数量',
dataIndex: 'deliverGoodsCount',
align: 'center',
key: 'deliverGoodsCount',
},
{
title: '入库数量',
dataIndex: 'storageCount',
align: 'center',
key: 'storageCount',
},
{
title: '差异数量',
dataIndex: 'differenceCount',
align: 'center',
key: 'differenceCount',
},
]
// 订单发货记录
const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
const { data } = useContext(OrderDetailContext)
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses } = data
return (
<MellowCard style={{marginTop: 24}} bordered={false}>
<Tabs defaultActiveKey="1" animated={false}>
<Tabs.TabPane tab='订单发货统计' key="1">
<Table
columns={outOrderCols}
dataSource={orderReceivingStatisticsResponses}
pagination={false}
rowKey="id"
/>
</Tabs.TabPane>
<Tabs.TabPane tab='订单发货明细' key="2">
<NestTable
NestColumns={[sideOrderCols, sideChildrenCols]}
childrenDataKey='orderDeliveryProducts'
dataSource={orderDeliveryDetailsResponses}
/>
</Tabs.TabPane>
</Tabs>
</MellowCard>
)
}
OrderDeleveRecord.defaultProps = {}
export default OrderDeleveRecord
\ No newline at end of file
......@@ -321,6 +321,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = (props) => {
dataIndex: 'none',
align: 'center',
key: 'none',
render: () => '是'
},
{
title: '金额',
......
......@@ -118,7 +118,7 @@ const OrderTransformRecord:React.FC<OrderTransformRecordProps> = (props) => {
</Tabs.TabPane>
<Tabs.TabPane tab='内部订单流转记录' key="2">
<Table
columns={outOrderCols}
columns={sideOrderCols}
dataSource={interiorProcurementOrderLogResponses}
pagination={false}
rowKey="id"
......
......@@ -306,6 +306,7 @@ export const productInfoColumns: any[] = [
dataIndex: 'none',
align: 'center',
key: 'none',
render: () => '是'
},
{
title: '金额',
......
......@@ -19,6 +19,7 @@ import OrderTransformRecord from './components/orderTransformRecord'
import OrderPayTabs from './components/orderPayTabs'
import StatusColors from '@/pages/transaction/components/StatusColors'
import OrderPayResultModal from './components/orderPayResultModal'
import OrderDeleveRecord from './components/orderDeleveRecord'
export interface CommonOrderDetailProps {}
......@@ -156,6 +157,9 @@ const CommonOrderDetail:React.FC<CommonOrderDetailProps> = (props) => {
{/* 杂项 */}
<OrderMergeInfo/>
{/* 订单发货记录 */}
<OrderDeleveRecord/>
{/* 订单流转记录 */}
<OrderTransformRecord/>
</div>
......
......@@ -54,7 +54,7 @@ export const useSelfTable = () => {
key: 'supplyMembersName',
},
{
title: '总金额/已支付(元)',
title: '总金额',
align: 'center',
dataIndex: 'sumPrice',
key: 'sumPrice',
......@@ -91,10 +91,12 @@ export const useSelfTable = () => {
dataIndex: 'ctl',
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.ADD_LOGISTICS_ORDER &&
<Button type='link' onClick={() => handleConfirm(record.id)}>新增物流单</Button>
}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.DELIVERY_APPROVED_SUCCESS &&
<Button type='link' onClick={() => handleConfirm(record.id)}>查看物流单</Button>
}
</>
}
]
......
......@@ -317,6 +317,7 @@ export const productInfoColumns: any[] = [
dataIndex: 'none',
align: 'center',
key: 'none',
render: () => '是'
},
{
title: '金额',
......
......@@ -54,7 +54,7 @@ export const useSelfTable = () => {
key: 'supplyMembersName',
},
{
title: '总金额/已支付(元)',
title: '总金额',
align: 'center',
dataIndex: 'sumPrice',
key: 'sumPrice',
......@@ -92,15 +92,15 @@ export const useSelfTable = () => {
key: 'ctl',
render: (text, record) => <>
{/* 支付结果确认到账= 待审核状态 */}
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.ADD_LOGISTICS_ORDER &&
<Button type='link' onClick={() => handleConfirm(record.id)}>新增物流单</Button>
{ record.purchaseOrderInteriorState === SaleOrderInsideWorkState.CONFIRM_DELIVERY_ORDER &&
<Button type='link' onClick={() => handleConfirm(record.id)}>确认发货</Button>
}
</>
}
]
const handleConfirm = async (record) => {
history.push(`/memberCenter/tranactionAbility/saleOrder/orderPreview?page_type=4&id=${record.id}&preview=0`)
history.push(`/memberCenter/tranactionAbility/saleOrder/orderPreview?page_type=7&id=${record.id}&preview=0`)
}
return {
......
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