Commit 9a3012a6 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:处理积分订单和订单类型显示异常

parent ff4e496d
......@@ -294,10 +294,10 @@ export const ORDER_TYPE = ['',
'需求采购',
'现货采购',
'集采',
'积分兑换',
'渠道直采',
'渠道现货',
'渠道积分兑换',
'积分兑换',
'渠道积分兑换'
]
// 提货方式
......
......@@ -62,13 +62,14 @@ const DirectChannel: React.FC<{}> = () => {
title: 'ID',
dataIndex: 'id',
key: 'id',
width: 60
},
{
title: '商品名称',
dataIndex: ['channelCommodity', 'commodity', 'name'],
key: 'id',
className: 'commonPickColor',
width: 300,
width: 240,
ellipsis: true,
render: (text:any, record:any) => <EyePreview
url={`/memberCenter/commodityAbility/commodity/products/directChannel/detail?id=${record.id}`}
......@@ -77,12 +78,12 @@ const DirectChannel: React.FC<{}> = () => {
</EyePreview>
},
{
title: '品类',
title: '商品品类',
dataIndex: ['channelCommodity', 'commodity', 'customerCategory', 'name'],
key: 'id',
},
{
title: '品牌',
title: '商品品牌',
dataIndex: ['channelCommodity', 'commodity', 'brand', 'name'],
key: 'id',
},
......@@ -151,7 +152,7 @@ const DirectChannel: React.FC<{}> = () => {
render: (text, record) => moment(text).format('YYYY-MM-DD HH:mm:ss')
},
{
title: '状态',
title: '商品状态',
dataIndex: 'status',
key: 'id',
render: (text:any, record:any) => {
......
......@@ -68,23 +68,24 @@ const Products: React.FC<{}> = () => {
title: 'ID',
dataIndex: 'id',
key: 'id',
width: 60
},
{
title: '商品名称',
dataIndex: 'name',
key: 'name',
className: 'commonPickColor',
width: 300,
width: 240,
ellipsis: true,
render: (text: any, record: any) => <a title={text} onClick={() => handleSee(record)}>{text}&nbsp;<EyeOutlined /></a>
},
{
title: '品类',
title: '商品品类',
dataIndex: ['customerCategory', 'name'],
key: 'customerCategory.name',
},
{
title: '品牌',
title: '商品品牌',
dataIndex: ['brand', 'name'],
key: 'brand.name',
},
......@@ -149,7 +150,7 @@ const Products: React.FC<{}> = () => {
render: (text:any, record:any)=>text && moment(text).format('YYYY-MM-DD HH:mm:ss')
},
{
title: '审核状态',
title: '商品状态',
dataIndex: 'status',
key: 'status',
render: (text: any, record: any) => {
......@@ -199,6 +200,7 @@ const Products: React.FC<{}> = () => {
{
title: '操作',
dataIndex: 'option',
width: 160,
render: (text: any, record: any) => renderOptionButton(record)
}
];
......
......@@ -124,27 +124,27 @@ export const channelSchema: ISchema = {
// style: { width: '174px' },
},
},
priceTypeList: {
type: 'string',
enum: [
{
label: '现货价格',
value: 1,
},
// {
// label: '价格需要询价',
// value: 2,
// },
{
label: '积分兑换商品',
value: 3,
}
],
'x-component-props': {
placeholder: '产品定价',
// style: { width: '174px' },
},
},
// priceTypeList: {
// type: 'string',
// enum: [
// {
// label: '现货价格',
// value: 1,
// },
// // {
// // label: '价格需要询价',
// // value: 2,
// // },
// {
// label: '积分兑换商品',
// value: 3,
// }
// ],
// 'x-component-props': {
// placeholder: '产品定价',
// // style: { width: '174px' },
// },
// },
'NO_NAME_FIELD_$2': {
type: 'object',
'x-component': 'layout',
......
......@@ -104,6 +104,10 @@ const StatusColors:React.FC<StatusColorsProps> = (props) => {
const { status, type } = props
const statusText = typeMaps[type]
const statusShowColor = matchStatusColor(status)
// 单独处理支付比例 确认到账的状态颜色
if(type === 'payOut' && status === 3) {
return (<Tag color="#41CC9E">{statusText[status]}</Tag>)
}
return (<Tag color={statusShowColor}>{statusText[status]}</Tag>)
}
......
......@@ -11,145 +11,6 @@ import { history } from 'umi'
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 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) => {
......@@ -163,7 +24,149 @@ const OrderDeleveRecord:React.FC<OrderDeleveRecordProps> = (props) => {
const dataRef = useRef<any>([])
const { data, reloadFormData } = useContext(OrderDetailContext)
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses } = data
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses, orderModel } = data
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
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: creditsCommodity ? '所需积分' : '单价',
dataIndex: 'unitPrice',
align: 'center',
key: 'unitPrice',
},
{
title: creditsCommodity ? '兑换数量' : '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
},
{
title: '含税',
dataIndex: 'no',
align: 'center',
key: 'no',
render: () => '是'
},
{
title: creditsCommodity ? '所需积分小计' : '金额',
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 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: creditsCommodity ? '兑换数量' : '采购数量',
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 sideOrderCols: any[] = [
{
title: '发货批次',
......
......@@ -44,7 +44,8 @@ const RowStyle = styled(props => <Row style={{marginTop: 12}} justify='end' {...
const modalPriceActions = createFormActions()
// 总计金额联动框
export const MoneyTotalBox = ({ dataSource, preview }) => {
const { orderProductRequests = [], deliveryAddressInfo, freight = 0, sumPrice, amount } = dataSource || {}
const { orderProductRequests = [], deliveryAddressInfo, freight = 0, sumPrice, amount, orderModel } = dataSource || {}
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
// 合计金额, 如果后端有传则用后端数据
const sum = amount || orderProductRequests.reduce((prev, next) => prev + parseInt((next.money || 0)), 0)
......@@ -84,7 +85,7 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
// }, [orderProductRequests])
return <RowStyle>
<Col span={2}>
<div>合计金额</div>
<div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div>
<div>{sum}</div>
</Col>
<Col span={2}>
......@@ -93,7 +94,7 @@ export const MoneyTotalBox = ({ dataSource, preview }) => {
<div>{freight}</div>
</Col>
<Col span={2}>
<div>总计金额</div>
<div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div>
<div>{amountMoney}</div>
</Col>
{/* <ModalForm
......@@ -196,7 +197,7 @@ const EditableCell: React.FC<EditableCellProps> = ({
rules={[
{
required: true,
message: `单价是必填的`,
message: `此项为必填项`,
},
]}
>
......@@ -215,7 +216,8 @@ const EditableCell: React.FC<EditableCellProps> = ({
const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
const { ctl, data, preview } = useContext(OrderDetailContext)
const { orderProductRequests = [] } = data || {}
const { orderProductRequests = [], orderModel } = data || {}
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const productComponents = {
body: {
......@@ -301,7 +303,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
key: 'unit',
},
{
title: '单价(元)',
title: creditsCommodity ? '所需积分' : '单价(元)',
dataIndex: 'price',
align: 'left',
key: 'price'
......@@ -314,7 +316,7 @@ const OrderProductTable:React.FC<OrderProductTableProps> = ({editable}) => {
render: (text, record) => record.isMemberPrice ? (text + '%') : null
},
{
title: '采购数量',
title: creditsCommodity ? '兑换数量' : '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
......
......@@ -17,145 +17,6 @@ export interface OrderSaleRecordProps {
const { confirm } = Modal;
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 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 OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
const pathname = history.location.pathname
......@@ -168,7 +29,148 @@ const OrderSaleRecord:React.FC<OrderSaleRecordProps> = (props) => {
// 用于储存已经修改过的订单id
const dataRef = useRef<any>([])
const { data, reloadFormData } = useContext(OrderDetailContext)
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses } = data
const { orderReceivingStatisticsResponses, orderDeliveryDetailsResponses, orderModel } = data
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
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: creditsCommodity ? '所需积分' : '单价',
dataIndex: 'unitPrice',
align: 'center',
key: 'unitPrice',
},
{
title: creditsCommodity ? '兑换数量' : '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount',
},
{
title: '含税',
dataIndex: 'no',
align: 'center',
key: 'no',
render: () => '是'
},
{
title: creditsCommodity ? '所需积分小计' : '金额',
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 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: creditsCommodity ? '兑换数量' : '采购数量',
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 sideOrderCols: any[] = [
{
......
......@@ -85,7 +85,9 @@ const warehouseColumns: any[] = [
const modalPriceActions = createFormActions()
// 总计金额联动框
export const MoneyTotalBox = ({ dataSource, isEditData }) => {
const { orderProductRequests = [], receiverAddressId, freight, amount } = dataSource || {}
const { orderProductRequests = [], receiverAddressId, freight, amount, orderModel } = dataSource || {}
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const modelRef = useRef<any>({})
const [freePrice, setFreePrice] = useState<number>(freight || 0)
const [sum, setSum] = useState<number>(0)
......@@ -141,7 +143,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
return <RowStyle>
<Col span={2}>
<div>合计金额</div>
<div>{creditsCommodity ? '合计所需积分' : '合计金额'}</div>
<div>{sum}</div>
</Col>
<Col span={2}>
......@@ -149,7 +151,7 @@ export const MoneyTotalBox = ({ dataSource, isEditData }) => {
<div>{freePrice}</div>
</Col>
<Col span={2}>
<div>总计金额</div>
<div>{creditsCommodity ? '总计所需积分' : '总计金额'}</div>
<div>{amountMoney}</div>
</Col>
<ModalForm
......@@ -267,11 +269,11 @@ const EditableCell: React.FC<EditableCellProps> = ({
rules={[
{
required: true,
message: `单价是必填的`,
message: `此项为必填项`,
},
{
pattern: /^\d+(\.\d{1,3})?$/,
message: '价格数值仅限三位小数',
message: '数值仅限三位小数',
}
]}
>
......@@ -291,7 +293,8 @@ const EditableCell: React.FC<EditableCellProps> = ({
const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
const { ctl, data } = useContext(OrderDetailContext)
const { page_type } = usePageStatus()
const { orderProductRequests = [] } = data || {}
const { orderProductRequests = [], orderModel } = data || {}
const creditsCommodity = (orderModel === 24 || orderModel === 25) // 积分或渠道积分下单模式
const [warehouseVisible, setWarehouseVisible] = useState(false)
const [checkProductId, setCheckProductId] = useState(0) // 选中的商品id
......@@ -392,7 +395,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
key: 'unit',
},
{
title: '单价(元)',
title: creditsCommodity ? '所需积分' : '单价(元)',
dataIndex: 'price',
align: 'left',
key: 'price',
......@@ -406,7 +409,7 @@ const SaleOrderProductTable:React.FC<OrderProductTableProps> = (props) => {
render: (text, record) => record.isMemberPrice ? (text + '%') : null
},
{
title: '采购数量',
title: creditsCommodity ? '兑换数量' : '采购数量',
dataIndex: 'purchaseCount',
align: 'center',
key: 'purchaseCount'
......
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