Commit 0e4f5df9 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:

parent 252817f1
...@@ -84,6 +84,7 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => { ...@@ -84,6 +84,7 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
dataIndex: 'amount', dataIndex: 'amount',
align: 'center', align: 'center',
key: 'amount', key: 'amount',
render: (t) => creditsCommodity ? t : `¥${t}`
}, },
{ {
title: '已发货', title: '已发货',
...@@ -174,6 +175,7 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => { ...@@ -174,6 +175,7 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
dataIndex: 'amount', dataIndex: 'amount',
align: 'center', align: 'center',
key: 'amount', key: 'amount',
render: (t) => `¥${t}`
}, },
{ {
title: '已发货', title: '已发货',
......
...@@ -10,7 +10,7 @@ import cx from 'classnames' ...@@ -10,7 +10,7 @@ import cx from 'classnames'
export interface OrderMergeInfoProps { } export interface OrderMergeInfoProps { }
const payInfo = [ const payInfo = [
{ title: '交付日期:', name: 'deliverDate', render: (text) => formatTimeString(text) }, { title: '交付日期:', name: 'deliverDate', render: (text) => formatTimeString(text, 'YYYY-MM-DD') },
{ {
title: '交付地址:', name: 'areaName', render: (_, record) => title: '交付地址:', name: 'areaName', render: (_, record) =>
<div> <div>
......
...@@ -2,11 +2,10 @@ import React, { useContext, useState, useRef, useEffect } from 'react' ...@@ -2,11 +2,10 @@ import React, { useContext, useState, useRef, useEffect } from 'react'
import { Table, Form, Input, Row, Col } from 'antd' import { Table, Form, Input, Row, Col } from 'antd'
import { OrderDetailContext } from '../../_public/order/context' import { OrderDetailContext } from '../../_public/order/context'
import { EditOutlined } from '@ant-design/icons' import { EditOutlined } from '@ant-design/icons'
import { PublicApi } from '@/services/api'
import styled from 'styled-components' import styled from 'styled-components'
import { createFormActions } from '@formily/antd' import { createFormActions } from '@formily/antd'
import MellowCard from '@/components/MellowCard' import MellowCard from '@/components/MellowCard'
import { DELIVERY_TYPE, OrderKindType, OrderModalType } from '@/constants/order' import { OrderKindType } from '@/constants/order'
import { AddressPop } from '../addressPop' import { AddressPop } from '../addressPop'
export interface OrderProductTableProps { export interface OrderProductTableProps {
...@@ -38,13 +37,13 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {... ...@@ -38,13 +37,13 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...
} }
` `
const modalPriceActions = createFormActions()
// 总计金额联动框 // 总计金额联动框
export const MoneyTotalBox = ({ dataSource, preview }) => { export const MoneyTotalBox = ({ dataSource, preview }) => {
const { product, orderMode } = dataSource || {} const { product, orderMode, orderKind } = dataSource || {}
const { couponAmount, freight, productAmount, promotionAmount, totalAmount, products } = product const { couponAmount, freight, productAmount, promotionAmount, totalAmount, products } = product
const creditsCommodity = (orderMode === 24 || orderMode === 25) // @todo 积分或渠道积分下单模式 const creditsCommodity = (orderMode === 24 || orderMode === 25) // @todo 积分或渠道积分下单模式
const contractOrder = (orderKind === OrderKindType.SRM_ORDER)
// 合计金额, 如果后端有传则用后端数据 // 合计金额, 如果后端有传则用后端数据
const sum = productAmount || products.reduce((prev, next) => prev + parseInt((next.amount || 0)), 0) const sum = productAmount || products.reduce((prev, next) => prev + parseInt((next.amount || 0)), 0)
...@@ -55,16 +54,20 @@ export const MoneyTotalBox = ({ dataSource, preview }) => { ...@@ -55,16 +54,20 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
return <RowStyle> return <RowStyle>
<Col span={2}> <Col span={2}>
<div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div> <div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div>
<div>{sum}</div> <div>{creditsCommodity ? sum : `¥${sum}`}</div>
</Col> </Col>
{
contractOrder ? null : <>
<Col span={2}> <Col span={2}>
<div>运费</div> <div>运费</div>
<div>{freight}</div> <div>{`¥${freight}`}</div>
</Col> </Col>
<Col span={2}> <Col span={2}>
<div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div> <div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div>
<div>{amountMoney}</div> <div>{creditsCommodity ? amountMoney : `¥${amountMoney}`}</div>
</Col> </Col>
</>
}
</RowStyle> </RowStyle>
} }
......
...@@ -89,6 +89,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -89,6 +89,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
dataIndex: 'amount', dataIndex: 'amount',
align: 'center', align: 'center',
key: 'amount', key: 'amount',
render: (t) => creditsCommodity ? t : `¥${t}`
}, },
{ {
title: '已发货', title: '已发货',
...@@ -179,6 +180,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -179,6 +180,7 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
dataIndex: 'amount', dataIndex: 'amount',
align: 'center', align: 'center',
key: 'amount', key: 'amount',
render: (t) => `¥${t}`
}, },
{ {
title: '已发货', title: '已发货',
...@@ -361,7 +363,8 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => { ...@@ -361,7 +363,8 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
dataIndex: 'logisticsNo', dataIndex: 'logisticsNo',
align: 'center', align: 'center',
key: 'logisticsNo', key: 'logisticsNo',
render: text => <a target="blank" href={`/memberCenter/logisticsAbility/logisticsBillSubmit/logisticsBillQuery/preview?code=${text}`}>{text}</a> // render: text => <a target="blank" href={`/memberCenter/logisticsAbility/logisticsBillSubmit/logisticsBillQuery/preview?code=${text}`}>{text}</a>
render: t => <a href={`https://www.kuaidi100.com/chaxun?nu=${t}`} target="blank">{t}</a>
}, },
{ {
title: '物流公司', title: '物流公司',
......
...@@ -93,8 +93,10 @@ const modalPriceActions = createFormActions() ...@@ -93,8 +93,10 @@ const modalPriceActions = createFormActions()
// 总计金额联动框 // 总计金额联动框
export const MoneyTotalBox = ({ dataSource, isEditData }) => { export const MoneyTotalBox = ({ dataSource, isEditData }) => {
const { reloadFormData } = useContext(OrderDetailContext) const { reloadFormData } = useContext(OrderDetailContext)
const { product, orderProductRequests = [], receiverAddressId, amount, orderMode, sumPrice, type } = dataSource || {} const { product, orderProductRequests = [], receiverAddressId, amount, orderMode, sumPrice, orderKind } = dataSource || {}
const creditsCommodity = (orderMode === 24 || orderMode === 25) // @todo 积分或渠道积分下单模式 const creditsCommodity = (orderMode === 24 || orderMode === 25) // @todo 积分或渠道积分下单模式
const contractOrder = (orderKind === OrderKindType.SRM_ORDER)
const { productAmount, freight, totalAmount } = product const { productAmount, freight, totalAmount } = product
const modelRef = useRef<any>({}) const modelRef = useRef<any>({})
const [freePrice, setFreePrice] = useState<number>(freight || 0) const [freePrice, setFreePrice] = useState<number>(freight || 0)
...@@ -146,22 +148,23 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => { ...@@ -146,22 +148,23 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
setSum(_sum) setSum(_sum)
}, [orderProductRequests]) }, [orderProductRequests])
/** 采购合同下单下不显示设置运费按钮 */
const notShowSet = type === ORDER_TYPE2_ENQUIRY_CONTRACT || type === ORDER_TYPE2_BIDDING_CONTRACT || type === ORDER_TYPE2_TENDER_CONTRACT
return <RowStyle> return <RowStyle>
<Col span={2}> <Col span={2}>
<div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div> <div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div>
<div>{productAmount}</div> <div>{creditsCommodity ? sum : `¥${sum}`}</div>
</Col> </Col>
{
contractOrder ? null : <>
<Col span={2}> <Col span={2}>
<div>运费 { isEditData && !creditsCommodity && !notShowSet && <SettingOutlined style={{marginLeft: 8}} onClick={handleSetting}/>}</div> <div>运费 { isEditData && !creditsCommodity && !contractOrder && <SettingOutlined style={{marginLeft: 8}} onClick={handleSetting}/>}</div>
<div>{freePrice}</div> <div>{`¥${freight}`}</div>
</Col> </Col>
<Col span={2}> <Col span={2}>
<div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div> <div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div>
<div>{totalAmount}</div> <div>{creditsCommodity ? amountMoney : `¥${amountMoney}`}</div>
</Col> </Col>
</>
}
<ModalForm <ModalForm
modalTitle='设置运费' modalTitle='设置运费'
currentRef={modelRef} currentRef={modelRef}
......
...@@ -48,6 +48,7 @@ export const baseOrderListColumns: any = () => { ...@@ -48,6 +48,7 @@ export const baseOrderListColumns: any = () => {
dataIndex: 'amount', dataIndex: 'amount',
key: 'amount', key: 'amount',
ellipsis: true, ellipsis: true,
render: (t) => `¥${t}`
}, },
{ {
title: '订单类型', title: '订单类型',
......
...@@ -100,16 +100,15 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => { ...@@ -100,16 +100,15 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
return <RowStyle> return <RowStyle>
<Col span={2}> <Col span={2}>
<div>合计金额</div> <div>合计金额</div>
<div>{sum.toFixed(2)}</div> <div>{`¥${sum.toFixed(2)}`}</div>
</Col> </Col>
<Col span={2}> <Col span={2}>
<div>运费</div> <div>运费</div>
{/* 缺乏字段 @todo */} <div>{`¥${freePrice.toFixed(2)}`}</div>
<div>{freePrice.toFixed(2)}</div>
</Col> </Col>
<Col span={2}> <Col span={2}>
<div>总计金额</div> <div>总计金额</div>
<div>{(sum + freePrice).toFixed(2)}</div> <div>{`¥${(sum + freePrice).toFixed(2)}`}</div>
</Col> </Col>
</RowStyle> </RowStyle>
}) })
......
...@@ -88,15 +88,15 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => { ...@@ -88,15 +88,15 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
return <RowStyle> return <RowStyle>
<Col span={2}> <Col span={2}>
<div>合计金额</div> <div>合计金额</div>
<div>{sum.toFixed(2)}</div> <div>{`¥${sum.toFixed(2)}`}</div>
</Col> </Col>
<Col span={2}> <Col span={2}>
<div>运费</div> <div>运费</div>
<div>{freePrice.toFixed(2)}</div> <div>{`¥${freePrice.toFixed(2)}`}</div>
</Col> </Col>
<Col span={2}> <Col span={2}>
<div>总计金额</div> <div>总计金额</div>
<div>{(sum + freePrice).toFixed(2)}</div> <div>{`¥${(sum + freePrice).toFixed(2)}`}</div>
</Col> </Col>
</RowStyle> </RowStyle>
}) })
......
import React from 'react' import React from 'react'
import { formatTimeString } from '@/utils' import { formatTimeString } from '@/utils'
import { Row } from 'antd' import { Row } from 'antd'
import { DELIVERY_TYPE, OrderModalType, PurchaseOrderOutWorkStateTexts } from '@/constants/order' import { OrderModalType } from '@/constants/order'
import moment from 'moment'
import { GlobalConfig } from '@/global/config';
import { AddressPop } from '@/pages/transaction/components/addressPop'
// 简单控制价格区间的组件 // 简单控制价格区间的组件
// @todo 后续需要优化, 样式,目录文件等。 // @todo 后续需要优化, 样式,目录文件等。
...@@ -43,7 +40,7 @@ export const procurmentRenderInit = (initValue: any) => { ...@@ -43,7 +40,7 @@ export const procurmentRenderInit = (initValue: any) => {
type: initValue.orderTypeName, type: initValue.orderTypeName,
digest: initValue.digest, digest: initValue.digest,
deliverDate: initValue.consignee.deliverDate, deliverDate: initValue.consignee.deliverDate,
theInvoiceId: initValue.invoice.invoiceId, theInvoiceId: initValue.invoice?.invoiceId || null,
hasContract: initValue.hasContract, hasContract: initValue.hasContract,
contractNo: initValue.contract.contractNo, contractNo: initValue.contract.contractNo,
contract: {...initValue.contract}, contract: {...initValue.contract},
...@@ -51,7 +48,8 @@ export const procurmentRenderInit = (initValue: any) => { ...@@ -51,7 +48,8 @@ export const procurmentRenderInit = (initValue: any) => {
} }
/** 修改采购合同下单 回显商品字段转换 */ /** 修改采购合同下单 回显商品字段转换 */
export const procurementRenderField = (_orderProductRequests) => { export const procurementRenderField = (data) => {
const _orderProductRequests = data.product.products
return _orderProductRequests.map(item => { return _orderProductRequests.map(item => {
return { return {
...item, ...item,
...@@ -66,6 +64,9 @@ export const procurementRenderField = (_orderProductRequests) => { ...@@ -66,6 +64,9 @@ export const procurementRenderField = (_orderProductRequests) => {
id: item.productId, id: item.productId,
code: item.productNo, code: item.productNo,
type: item.spec, type: item.spec,
// 冗余memberId memberRoleId查询自提地址使用
memberId: data.vendorMemberId,
memberRoleId: data.vendorRoleId,
} }
}) })
} }
...@@ -125,14 +126,6 @@ export const orderTypeLabel = ['', ...@@ -125,14 +126,6 @@ export const orderTypeLabel = ['',
'渠道现货', '渠道现货',
] ]
// export const orderTypeLabelMap = () => {
// let tempObject: { [key: number]: string } = {}
// GlobalConfig['web']['orderMode'].map(item => {
// tempObject[item['value']] = item['label']
// })
// return tempObject;
// }
export const orderTypeLabelMap = { export const orderTypeLabelMap = {
'3': '询价采购', '3': '询价采购',
'12': '采购询价合同', '12': '采购询价合同',
...@@ -272,6 +265,7 @@ export const contractColumns: any[] = [ ...@@ -272,6 +265,7 @@ export const contractColumns: any[] = [
title: '合同剩余金额', title: '合同剩余金额',
dataIndex: 'freeAmount', dataIndex: 'freeAmount',
key: 'freeAmount', key: 'freeAmount',
render: (t) => `¥${t}`
}, },
{ {
title: '寻源类型', title: '寻源类型',
...@@ -345,10 +339,11 @@ export const materialInfoColumns: any[] = [ ...@@ -345,10 +339,11 @@ export const materialInfoColumns: any[] = [
render: (t, r) => t ? `${t}/${r.relevanceProductName || ''}/${r.relevanceProductSpec || ''}/${r.relevanceProductCategory || ''}/${r.relevanceProductBrand || ''}` : '' render: (t, r) => t ? `${t}/${r.relevanceProductName || ''}/${r.relevanceProductSpec || ''}/${r.relevanceProductCategory || ''}/${r.relevanceProductBrand || ''}` : ''
}, },
{ {
title: '单价(元)', title: '单价',
dataIndex: 'price', dataIndex: 'price',
align: 'left', align: 'left',
key: 'price', key: 'price',
render: (t) => `¥${t}`
}, },
// { // {
// title: '供方库存', // title: '供方库存',
...@@ -384,6 +379,7 @@ export const materialInfoColumns: any[] = [ ...@@ -384,6 +379,7 @@ export const materialInfoColumns: any[] = [
dataIndex: 'amount', dataIndex: 'amount',
align: 'center', align: 'center',
key: 'amount', key: 'amount',
render: (t) => `¥${t}`
}, },
// 接口调用 // 接口调用
{ {
......
...@@ -3,7 +3,6 @@ import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'; ...@@ -3,7 +3,6 @@ import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { useLinkageUtils } from '@/utils/formEffectUtils'; import { useLinkageUtils } from '@/utils/formEffectUtils';
import { fetchOrderApi } from '../apis'; import { fetchOrderApi } from '../apis';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import moment from 'moment';
export const useModelTypeChange = (callback) => { export const useModelTypeChange = (callback) => {
const utils = useLinkageUtils() const utils = useLinkageUtils()
...@@ -78,57 +77,57 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor ...@@ -78,57 +77,57 @@ export const useProductTableChangeForPay = (ctx: ISchemaFormActions | ISchemaFor
// 编辑订单 地址和发票变动 触发订单更新 // 编辑订单 地址和发票变动 触发订单更新
export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => { export const useOrderUpdateChangeOther = (ctx: ISchemaFormActions | ISchemaFormAsyncActions) => {
const { pageStatus, id } = usePageStatus() // const { pageStatus, id } = usePageStatus()
FormEffectHooks.onFieldValueChange$('theInvoiceId').subscribe(state => { // FormEffectHooks.onFieldValueChange$('theInvoiceId').subscribe(state => {
const { value, path } = state // const { value, path } = state
if(pageStatus === PageStatus.EDIT){ // if(pageStatus === PageStatus.EDIT){
if(state?.dataSource?.length && state.loading && state.props["x-component-props"].times > 2) { // if(state?.dataSource?.length && state.loading && state.props["x-component-props"].times > 2) {
ctx.submit((values) => { // ctx.submit((values) => {
if(values){ // if(values){
PublicApi.postOrderProcurementOrderUpdate({ // PublicApi.postOrderProcurementOrderUpdate({
...values, // ...values,
deliveryTime: moment(values.deliveryTime).valueOf(), // deliveryTime: moment(values.deliveryTime).valueOf(),
theInvoiceId: value?.id || null, // theInvoiceId: value?.id || null,
hasInvoice: Number(values.hasInvoice), // hasInvoice: Number(values.hasInvoice),
deliveryAddresId: values.deliveryAddresId, // deliveryAddresId: values.deliveryAddresId,
id, // id,
}, { ctlType: "none" }) // }, { ctlType: "none" })
} // }
}) // })
} else { // } else {
ctx.setFieldState(path, _state => { // ctx.setFieldState(path, _state => {
_state.loading = true // _state.loading = true
_state.props["x-component-props"].times++ // _state.props["x-component-props"].times++
}) // })
} // }
} // }
}) // })
FormEffectHooks.onFieldValueChange$('deliveryAddresId').subscribe(state => { // FormEffectHooks.onFieldValueChange$('deliveryAddresId').subscribe(state => {
const { value, path } = state // const { value, path } = state
if(pageStatus === PageStatus.EDIT){ // if(pageStatus === PageStatus.EDIT){
if(state?.dataSource?.length && state.loading && state.props["x-component-props"].times > 2) { // if(state?.dataSource?.length && state.loading && state.props["x-component-props"].times > 2) {
ctx.submit((values) => { // ctx.submit((values) => {
if(values){ // if(values){
PublicApi.postOrderProcurementOrderUpdate({ // PublicApi.postOrderProcurementOrderUpdate({
...values, // ...values,
deliveryTime: moment(values.deliveryTime).valueOf(), // deliveryTime: moment(values.deliveryTime).valueOf(),
theInvoiceId: values.theInvoiceId, // theInvoiceId: values.theInvoiceId,
hasInvoice: Number(values.hasInvoice), // hasInvoice: Number(values.hasInvoice),
deliveryAddresId: value?.id ? value.id : value, // deliveryAddresId: value?.id ? value.id : value,
id, // id,
}, { ctlType: "none" }) // }, { ctlType: "none" })
} // }
}) // })
} else { // } else {
ctx.setFieldState(path, _state => { // ctx.setFieldState(path, _state => {
_state.loading = true // _state.loading = true
_state.props["x-component-props"].times++ // _state.props["x-component-props"].times++
}) // })
} // }
} // }
}) // })
} }
......
...@@ -16,7 +16,7 @@ import TheInvoiceList from './components/theInvoiceList' ...@@ -16,7 +16,7 @@ import TheInvoiceList from './components/theInvoiceList'
import styled from 'styled-components' import styled from 'styled-components'
import { useUpdate } from '@umijs/hooks' import { useUpdate } from '@umijs/hooks'
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { formatTimeString, omit, findLastIndexFlowState } from '@/utils' import { findLastIndexFlowState } from '@/utils'
import { changeRouterTitleByStatus } from '../../_public/order/utils' import { changeRouterTitleByStatus } from '../../_public/order/utils'
import { help } from '../../common' import { help } from '../../common'
import { ReadyAddOrderDetailContext } from '../context' import { ReadyAddOrderDetailContext } from '../context'
...@@ -25,9 +25,7 @@ import styles from './index.less' ...@@ -25,9 +25,7 @@ import styles from './index.less'
import { useMaterialTable } from './model/useMaterialTable' import { useMaterialTable } from './model/useMaterialTable'
import ContractModalTable from './components/contractModalTable' import ContractModalTable from './components/contractModalTable'
import MaterialModalTable from './components/materialModalTable' import MaterialModalTable from './components/materialModalTable'
import { PATTERN_MAPS } from '@/constants/regExp'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect' import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
import moment from 'moment'
export interface PurchaseOrderDetailProps {} export interface PurchaseOrderDetailProps {}
...@@ -67,11 +65,11 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => { ...@@ -67,11 +65,11 @@ export const MoneyTotalBox = registerVirtualBox('moneyTotalBox', props => {
return <RowStyle> return <RowStyle>
<Col span={2}> <Col span={2}>
<div>合计金额</div> <div>合计金额</div>
<div>{sum.toFixed(2)}</div> <div>{`¥${sum.toFixed(2)}`}</div>
</Col> </Col>
<Col span={2}> <Col span={2}>
<div>总计金额</div> <div>总计金额</div>
<div>{(sum + freePrice).toFixed(2)}</div> <div>{`¥${(sum + freePrice).toFixed(2)}`}</div>
</Col> </Col>
</RowStyle> </RowStyle>
}) })
...@@ -99,14 +97,12 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -99,14 +97,12 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const { materialAddButton, materialRef, materialColumns, materialComponents, ...surplusProps } = useMaterialTable(addSchemaAction) const { materialAddButton, materialRef, materialColumns, materialComponents, ...surplusProps } = useMaterialTable(addSchemaAction)
let timerSignature = null let timerSignature = null
// 页面进入时, 当前所处的下单模式
useEffect(() => { useEffect(() => {
if (id) { if (id) {
setFormLoading(true) setFormLoading(true)
// @ts-ignore
PublicApi.getOrderBuyerCreateDetail({ orderId: id }).then(res => { PublicApi.getOrderBuyerCreateDetail({ orderId: id }).then(res => {
const { data } = res const { data } = res
const _orderProductRequests = procurementRenderField(data.product.products) const _orderProductRequests = procurementRenderField(data)
setInitFormValue(() => procurmentRenderInit(data)) setInitFormValue(() => procurmentRenderInit(data))
setTimeout(() => { setTimeout(() => {
addSchemaAction.setFieldValue('products', _orderProductRequests) addSchemaAction.setFieldValue('products', _orderProductRequests)
...@@ -155,7 +151,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -155,7 +151,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
memberId: params.vendorMemberId, memberId: params.vendorMemberId,
roleId: params.vendorRoleId roleId: params.vendorRoleId
}) })
console.log(deliveryAddress)
params.products = params.products.map(item => { params.products = params.products.map(item => {
const address = deliveryAddress[0] const address = deliveryAddress[0]
return { return {
...@@ -203,7 +198,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -203,7 +198,6 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
const { data: addressDetail} = await PublicApi.getLogisticsReceiverAddressGet({ const { data: addressDetail} = await PublicApi.getLogisticsReceiverAddressGet({
id: params.deliveryAddresId?.id || params.deliveryAddresId id: params.deliveryAddresId?.id || params.deliveryAddresId
}) })
const { data: countryCode } = await PublicApi.getManageCountryAreaGetTelCode({})
params.consignee = { params.consignee = {
deliverDate: params.deliverDate, deliverDate: params.deliverDate,
consigneeId: addressDetail.id, consigneeId: addressDetail.id,
...@@ -213,7 +207,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => { ...@@ -213,7 +207,7 @@ const PurchaseOrderDetail:React.FC<PurchaseOrderDetailProps> = (props) => {
districtCode: addressDetail.districtCode, districtCode: addressDetail.districtCode,
address: addressDetail.address, address: addressDetail.address,
postalCode: addressDetail.postalCode, postalCode: addressDetail.postalCode,
countryCode: countryCode[0], countryCode: addressDetail.areaCode,
phone: addressDetail.phone, phone: addressDetail.phone,
telephone: addressDetail.tel, telephone: addressDetail.tel,
defaultConsignee: addressDetail.isDefault, defaultConsignee: addressDetail.isDefault,
......
...@@ -16,22 +16,8 @@ interface DetailOptionsProps { ...@@ -16,22 +16,8 @@ interface DetailOptionsProps {
addSchemaAction: ISchemaFormActions addSchemaAction: ISchemaFormActions
} }
const mockDefaultValue: DetailOrderLocationState = {
productList: [
{
id: 1,
name: '甲商品',
customerCategoryName: '假品类',
brandName: '假品牌'
}
],
modelType: 5
}
export const useDetailOrder = (options: DetailOptionsProps) => { export const useDetailOrder = (options: DetailOptionsProps) => {
const { addSchemaAction } = options const { addSchemaAction } = options
const formilyUtils = useLinkageUtils()
// const [productDataSource, setProductDataSource] = useState
const locationState = useLocation<DetailOrderLocationState>().state || {} const locationState = useLocation<DetailOrderLocationState>().state || {}
const { productList } = locationState const { productList } = locationState
const { modelType } = history.location.query const { modelType } = history.location.query
......
import React, { useRef, useState } from 'react' import React, { useRef, useState } from 'react'
import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'; import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd';
import { Button, message } from 'antd'; import { Button, message } from 'antd';
import { PriceComp, materialInfoColumns } from '../constant'; import { materialInfoColumns } from '../constant';
import MaterialTableCell, { MaterialEditableRow } from '../components/materialTableCell'; import MaterialTableCell, { MaterialEditableRow } from '../components/materialTableCell';
import { useModalTable } from './useModalTable'; import { useModalTable } from './useModalTable';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'; import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { OrderModalType } from '@/constants/order';
const { pageStatus } = usePageStatus()
let orderMode = null; let orderMode = null;
...@@ -85,8 +82,6 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio ...@@ -85,8 +82,6 @@ export const useMaterialTable = (ctx: ISchemaFormActions | ISchemaFormAsyncActio
} }
const handleSave = row => { const handleSave = row => {
const { pageStatus } = usePageStatus()
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const newData = [...ctx.getFieldValue('products')]; const newData = [...ctx.getFieldValue('products')];
const index = newData.findIndex(item => row.id === item.id); const index = newData.findIndex(item => row.id === item.id);
......
...@@ -229,7 +229,8 @@ export const paymentInformationColumns: any[] = [ ...@@ -229,7 +229,8 @@ export const paymentInformationColumns: any[] = [
title: '支付金额', title: '支付金额',
dataIndex: 'payPrice', dataIndex: 'payPrice',
align: 'center', align: 'center',
key: 'payPrice' key: 'payPrice',
render: (t) => `¥${t}`
}, },
{ {
title: '支付方式', title: '支付方式',
...@@ -287,7 +288,7 @@ export const productInfoColumns: any[] = [ ...@@ -287,7 +288,7 @@ export const productInfoColumns: any[] = [
key: 'unitName', key: 'unitName',
}, },
{ {
title: '单价(元)', title: '单价',
dataIndex: 'unitPrice', dataIndex: 'unitPrice',
align: 'left', align: 'left',
key: 'unitPrice', key: 'unitPrice',
...@@ -321,6 +322,7 @@ export const productInfoColumns: any[] = [ ...@@ -321,6 +322,7 @@ export const productInfoColumns: any[] = [
dataIndex: 'price', dataIndex: 'price',
align: 'center', align: 'center',
key: 'price', key: 'price',
render: (t) => `¥${t}`
}, },
// 接口调用 // 接口调用
{ {
......
...@@ -17,7 +17,6 @@ import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePicke ...@@ -17,7 +17,6 @@ import DateRangePickerUnix from '@/components/NiceForm/components/DateRangePicke
import '../index.less' import '../index.less'
import ModalForm from '@/components/ModalForm' import ModalForm from '@/components/ModalForm'
import { createFormActions } from '@formily/antd' import { createFormActions } from '@formily/antd'
import { GlobalConfig } from '@/global/config'
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect' import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect'
// 待新增订单 // 待新增订单
...@@ -98,6 +97,7 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => { ...@@ -98,6 +97,7 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
rowSelection={rowSelection} rowSelection={rowSelection}
columns={columns} columns={columns}
currentRef={ref} currentRef={ref}
rowKey="orderId"
formilyLayouts={{ formilyLayouts={{
justify: 'space-between' justify: 'space-between'
}} }}
...@@ -132,7 +132,7 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => { ...@@ -132,7 +132,7 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
> >
新建 新建
</Button> </Button>
<Button onClick={handleBitchPush} loading={submitLoading}>批量提交审核</Button> <Button onClick={handleBitchPush} loading={submitLoading}>批量提交</Button>
<DropDeleteDown> <DropDeleteDown>
<Menu onClick={(e) => handleMenuClick(e)}> <Menu onClick={(e) => handleMenuClick(e)}>
<Menu.Item key="1" icon={<DeleteOutlined />}> <Menu.Item key="1" icon={<DeleteOutlined />}>
...@@ -167,7 +167,6 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => { ...@@ -167,7 +167,6 @@ const ReadyAddOrder:React.FC<ReadyAddOrderProps> = (props) => {
type: 'string', type: 'string',
title: '选择下单模式', title: '选择下单模式',
required: true, required: true,
// enum: GlobalConfig.web.orderMode.map(v => { delete v.platformType; return v}),
enum: [], enum: [],
"x-component-props": { "x-component-props": {
placeholder: '请选择下单模式' placeholder: '请选择下单模式'
......
...@@ -9,7 +9,7 @@ import { CaretDownOutlined } from '@ant-design/icons' ...@@ -9,7 +9,7 @@ import { CaretDownOutlined } from '@ant-design/icons'
// 业务hooks, 待新增订单 // 业务hooks, 待新增订单
export const useSelfTable = () => { export const useSelfTable = () => {
const ref = useRef<any>({}) const ref = useRef<any>({})
const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'id'}) const [rowSelection, rowSelectionCtl] = useRowSelectionTable({customKey: 'orderId'})
const handleSubmit = async (id) => { const handleSubmit = async (id) => {
await PublicApi.postOrderBuyerCreateSubmit({orderId: id}) await PublicApi.postOrderBuyerCreateSubmit({orderId: id})
......
...@@ -47,7 +47,7 @@ export const useSelfTable = () => { ...@@ -47,7 +47,7 @@ export const useSelfTable = () => {
align: 'center', align: 'center',
dataIndex: 'amount', dataIndex: 'amount',
key: 'amount', key: 'amount',
render: (t, r) => r.orderType === 7 || r.orderType === 8 ? t : '¥' + t render: (t, r) => '¥' + t
}, },
{ {
title: '已发货批次', title: '已发货批次',
......
...@@ -7,7 +7,6 @@ import PreLoading from '@/components/PreLoading'; ...@@ -7,7 +7,6 @@ import PreLoading from '@/components/PreLoading';
import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail'; import { useOrderDetail } from '../../../_public/order/effects/useOrderDetail';
import OrderHandDeleved from '../../../components/orderHandDeleved'; import OrderHandDeleved from '../../../components/orderHandDeleved';
import OrderDetailSection from '../../../components/orderDetailSection'; import OrderDetailSection from '../../../components/orderDetailSection';
import { SaleOrderInsideWorkState, DeliverySideState } from '@/constants/order';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
const ReadyConfirmDelevedOrderDetail: React.FC = () => { const ReadyConfirmDelevedOrderDetail: React.FC = () => {
......
import React, { useRef } from 'react' import React, { useRef } from 'react'
import { history, Link } from 'umi' import { history } from 'umi'
import { Button } from 'antd' import { Button } from 'antd'
import EyePreview from '@/components/EyePreview' import EyePreview from '@/components/EyePreview'
import { formatTimeString } from '@/utils' import { formatTimeString } from '@/utils'
...@@ -47,7 +47,7 @@ export const useSelfTable = () => { ...@@ -47,7 +47,7 @@ export const useSelfTable = () => {
align: 'center', align: 'center',
dataIndex: 'amount', dataIndex: 'amount',
key: 'amount', key: 'amount',
render: (t, r) => (r.orderType === 7 || r.orderType === 8) ? t : '¥' + t render: (t, r) => '¥' + t
}, },
{ {
title: '已发货批次', title: '已发货批次',
......
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