Commit d88c37e4 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents b912f6e0 d1176412
......@@ -94,7 +94,7 @@ const logisticsDetail: React.FC = () => {
expressionScope={{
exportBtn: (
<div>
<Button>{intl.formatMessage({ id: 'balance.accountsPayable.settlementList.logisticsDetail.exportBtn' })}</Button>
{/* <Button>{intl.formatMessage({ id: 'balance.accountsPayable.settlementList.logisticsDetail.exportBtn' })}</Button> */}
</div>
)
}}
......
......@@ -59,7 +59,7 @@ const OrderDetail: React.FC = () => {
expressionScope={{
exportBtn: (
<div>
<Button>{intl.formatMessage({ id: 'balance.accountsPayable.settlementList.orderDetail.exportBtn' })}</Button>
{/* <Button>{intl.formatMessage({ id: 'balance.accountsPayable.settlementList.orderDetail.exportBtn' })}</Button> */}
</div>
)
}}
......
......@@ -82,7 +82,7 @@ const ProductNoticeSettlementDetail: React.FC = () => {
expressionScope={{
exportBtn: (
<div>
<Button>{intl.formatMessage({ id: 'balance.accountsPayable.settlementList.productNoticeSettlementDetail.exportBtn' })}</Button>
{/* <Button>{intl.formatMessage({ id: 'balance.accountsPayable.settlementList.productNoticeSettlementDetail.exportBtn' })}</Button> */}
</div>
)
}}
......
......@@ -390,7 +390,7 @@ const SettlementList: React.FC = () => {
exportBtn: () => (
<Space>
<Button onClick={_handleBatchInvoiceProve}>批量开票</Button>
<Button>{intl.formatMessage({ id: 'balance.accountsReceivable.invoice.exportBtn' })}</Button>
{/* <Button>{intl.formatMessage({ id: 'balance.accountsReceivable.invoice.exportBtn' })}</Button> */}
</Space>
)
}}
......
......@@ -80,7 +80,7 @@ const logisticsDetail: React.FC = () => {
expressionScope={{
exportBtn: (
<div>
<Button>{intl.formatMessage({ id: 'balance.accountsReceivable.settlementList.logisticsDetail.exportBtn' })}</Button>
{/* <Button>{intl.formatMessage({ id: 'balance.accountsReceivable.settlementList.logisticsDetail.exportBtn' })}</Button> */}
</div>
)
}}
......
......@@ -57,7 +57,7 @@ const OrderDetail: React.FC = () => {
expressionScope={{
exportBtn: (
<div>
<Button>{intl.formatMessage({ id: 'balance.accountsReceivable.settlementList.orderDetail.exportBtn' })}</Button>
{/* <Button>{intl.formatMessage({ id: 'balance.accountsReceivable.settlementList.orderDetail.exportBtn' })}</Button> */}
</div>
)
}}
......
......@@ -83,7 +83,7 @@ const ProductNoticeSettlementDetail: React.FC = () => {
expressionScope={{
exportBtn: (
<div>
<Button>{intl.formatMessage({ id: 'balance.accountsReceivable.settlementList.productNoticeSettlementDetail.exportBtn' })}</Button>
{/* <Button>{intl.formatMessage({ id: 'balance.accountsReceivable.settlementList.productNoticeSettlementDetail.exportBtn' })}</Button> */}
</div>
)
}}
......
......@@ -156,7 +156,7 @@ const Info: React.FC = () => {
expressionScope={{
exportBtn: (
<div>
<Button>{intl.formatMessage({ id: 'balance.platformSettlement.accountReceivable.info.exportBtn' })}</Button>
{/* <Button>{intl.formatMessage({ id: 'balance.platformSettlement.accountReceivable.info.exportBtn' })}</Button> */}
</div>
)
}}
......
......@@ -105,7 +105,7 @@ const Info: React.FC = () => {
expressionScope={{
exportBtn: (
<div>
<Button>{intl.formatMessage({ id: 'balance.platformSettlement.integral.info.exportBtn' })}</Button>
{/* <Button>{intl.formatMessage({ id: 'balance.platformSettlement.integral.info.exportBtn' })}</Button> */}
</div>
)
}}
......
import { useIntl } from 'umi';
import React, { Fragment, useCallback, useMemo, useState } from 'react';
import { Badge, Button, Tag, Typography, Image } from 'antd';
import { Badge, Button, Tag, Typography, Image, Space } from 'antd';
import { history } from 'umi';
import { Context } from '@/pages/transaction/components/detailLayout/components/context';
import PeripheralLayout from '@/pages/transaction/components/detailLayout';
......@@ -29,6 +29,12 @@ import { postManageWebShopWebAll } from '@/services/ManageV2Api';
import { GlobalConfig } from '@/global/config';
const { onFormMount$ } = FormEffectHooks;
/** 订单 */
const ORDER_TYPE = 1;
/** 退货订单 */
const REFUND_TYPE = 2;
const DetialLayout = () => {
const intl = useIntl();
const { query: { id } } = history.location;
......@@ -45,6 +51,7 @@ const DetialLayout = () => {
const [collocation, setCollocation] = useState<any[]>([]);
const [listModalVisible, setListModalVisible] = useState<boolean>(false);
const [tableModalVisible, setTableModalVisible] = useState<boolean>(false);
const [idata, setIdata] = useState<any[]>([]);
const [param, setParam] = useState<any>({});
......@@ -135,7 +142,8 @@ const DetialLayout = () => {
{
title: '实购金额',
key: 'amount',
dataIndex: 'amount'
dataIndex: 'amount',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: '操作',
......@@ -206,7 +214,8 @@ const DetialLayout = () => {
{
title: '实购金额',
key: 'amount',
dataIndex: 'amount'
dataIndex: 'amount',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: `${intl.formatMessage({ id: 'marketingAbility.operation' })}`,
......@@ -236,6 +245,22 @@ const DetialLayout = () => {
return taxText
}
const hasQuantity = (DATA: any[], name?: string, name1?: string) => {
let buy_no = 0;
let refund_no = 0;
if (!isEmpty(DATA)) {
DATA.forEach(item => {
if ((item.recordType === ORDER_TYPE) && name) {
buy_no += item[name]
} else if ((item.recordType === REFUND_TYPE) && name1) {
refund_no += item[name1].toString().split('-')[1]
console.log(typeof item[name1], item[name1])
}
})
}
return buy_no - refund_no
}
const tableModalColumns: ColumnType<any>[] = [
{
title: '单据号',
......@@ -261,7 +286,7 @@ const DetialLayout = () => {
{
title: '客户名称',
key: 'memberName',
dataIndex: 'memberName'
dataIndex: 'memberName',
},
{
title: '单据时间',
......@@ -281,27 +306,39 @@ const DetialLayout = () => {
render: (text, record) => `${isHasTax(text)} / ${record.taxRate}%`
},
{
title: '购买数量',
title: <Space direction='vertical' size={0}>
<Typography.Text>购买数量</Typography.Text>
<Typography.Text type='secondary'>{hasQuantity(idata, 'quantity', 'quantity')}</Typography.Text>
</Space>,
key: 'quantity',
dataIndex: 'quantity'
},
{
title: '应付金额',
title: <Space direction='vertical' size={0}>
<Typography.Text>应付金额</Typography.Text>
<Typography.Text type='secondary'>{Number(hasQuantity(idata, 'skuPrice')).toFixed(2)}</Typography.Text>
</Space>,
key: 'skuPrice',
dataIndex: 'skuPrice',
render: (text) => `¥${Number(text).toFixed(2)}`
render: (text, record) => record.recordType === ORDER_TYPE ? `¥${Number(text).toFixed(2)}` : '-'
},
{
title: '实付金额',
title: <Space direction='vertical' size={0}>
<Typography.Text>实付金额</Typography.Text>
<Typography.Text type='secondary'>{Number(hasQuantity(idata, 'amount', 'amount')).toFixed(2)}</Typography.Text>
</Space>,
key: 'amount',
dataIndex: 'amount',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: '优惠金额',
title: <Space direction='vertical' size={0}>
<Typography.Text>优惠金额</Typography.Text>
<Typography.Text type='secondary'>{(Number(hasQuantity(idata, 'skuPrice')) - Number(hasQuantity(idata, 'amount'))).toFixed(2)}</Typography.Text>
</Space>,
key: 'discountPrice',
dataIndex: 'discountPrice',
render: (_text, record) => `¥${(record.skuPrice - record.amount).toFixed(2)}`
render: (_text, record) => record.recordType === ORDER_TYPE ? `¥${(record.skuPrice - record.amount).toFixed(2)}` : '-'
},
]
......@@ -310,6 +347,7 @@ const DetialLayout = () => {
if (!Array.isArray(fetch)) {
getMarketingAbilityActivityExecutePlatformDetailGoodsExecuteDetailPage({ ...params, ...param }).then(res => {
resolve(res.data)
setIdata(res.data.data)
}).catch(error => {
console.warn(error)
})
......
import { useIntl } from 'umi';
import React, { Fragment, useCallback, useMemo, useState } from 'react';
import { Badge, Button, Typography, Image } from 'antd';
import { Badge, Button, Typography, Image, Space } from 'antd';
import { history } from 'umi';
import { Context } from '@/pages/transaction/components/detailLayout/components/context';
import PeripheralLayout from '@/pages/transaction/components/detailLayout';
......@@ -29,6 +29,12 @@ import { postManageWebShopWebAll } from '@/services/ManageV2Api';
import { GlobalConfig } from '@/global/config';
const { onFormMount$ } = FormEffectHooks;
/** 订单 */
const ORDER_TYPE = 1;
/** 退货订单 */
const REFUND_TYPE = 2;
const DetialLayout = () => {
const intl = useIntl();
const { query: { id } } = history.location;
......@@ -45,6 +51,7 @@ const DetialLayout = () => {
const [collocation, setCollocation] = useState<any[]>([]);
const [listModalVisible, setListModalVisible] = useState<boolean>(false);
const [tableModalVisible, setTableModalVisible] = useState<boolean>(false);
const [idata, setIdata] = useState<any[]>([]);
const [param, setParam] = useState<any>({});
......@@ -133,7 +140,8 @@ const DetialLayout = () => {
{
title: '实购金额',
key: 'amount',
dataIndex: 'amount'
dataIndex: 'amount',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: '操作',
......@@ -204,7 +212,8 @@ const DetialLayout = () => {
{
title: '实购金额',
key: 'amount',
dataIndex: 'amount'
dataIndex: 'amount',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: `${intl.formatMessage({ id: 'marketingAbility.operation' })}`,
......@@ -234,6 +243,23 @@ const DetialLayout = () => {
return taxText
}
const hasQuantity = (DATA: any[], name?: string, name1?: string) => {
let buy_no = 0;
let refund_no = 0;
if (!isEmpty(DATA)) {
DATA.forEach(item => {
if ((item.recordType === ORDER_TYPE) && name) {
buy_no += item[name]
} else if ((item.recordType === REFUND_TYPE) && name1) {
refund_no += item[name1].toString().split('-')[1]
console.log(typeof item[name1], item[name1])
}
})
}
return buy_no - refund_no
}
const tableModalColumns: ColumnType<any>[] = [
{
title: '单据号',
......@@ -279,27 +305,39 @@ const DetialLayout = () => {
render: (text, record) => `${isHasTax(text)} / ${record.taxRate}%`
},
{
title: '购买数量',
title: <Space direction='vertical' size={0}>
<Typography.Text>购买数量</Typography.Text>
<Typography.Text type='secondary'>{hasQuantity(idata, 'quantity', 'quantity')}</Typography.Text>
</Space>,
key: 'quantity',
dataIndex: 'quantity'
},
{
title: '应付金额',
title: <Space direction='vertical' size={0}>
<Typography.Text>应付金额</Typography.Text>
<Typography.Text type='secondary'>{Number(hasQuantity(idata, 'skuPrice')).toFixed(2)}</Typography.Text>
</Space>,
key: 'skuPrice',
dataIndex: 'skuPrice',
render: (text) => `¥${Number(text).toFixed(2)}`
render: (text, record) => record.recordType === ORDER_TYPE ? `¥${Number(text).toFixed(2)}` : '-'
},
{
title: '实付金额',
title: <Space direction='vertical' size={0}>
<Typography.Text>实付金额</Typography.Text>
<Typography.Text type='secondary'>{Number(hasQuantity(idata, 'amount', 'amount')).toFixed(2)}</Typography.Text>
</Space>,
key: 'amount',
dataIndex: 'amount',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: '优惠金额',
title: <Space direction='vertical' size={0}>
<Typography.Text>优惠金额</Typography.Text>
<Typography.Text type='secondary'>{(Number(hasQuantity(idata, 'skuPrice')) - Number(hasQuantity(idata, 'amount'))).toFixed(2)}</Typography.Text>
</Space>,
key: 'discountPrice',
dataIndex: 'discountPrice',
render: (_text, record) => `¥${(record.skuPrice - record.amount).toFixed(2)}`
render: (_text, record) => record.recordType === ORDER_TYPE ? `¥${(record.skuPrice - record.amount).toFixed(2)}` : '-'
},
]
......@@ -308,6 +346,7 @@ const DetialLayout = () => {
if (!Array.isArray(fetch)) {
getMarketingAbilityActivityExecuteMerchantDetailGoodsExecuteDetailPage({ ...params, ...param }).then(res => {
resolve(res.data)
setIdata(res.data.data)
}).catch(error => {
console.warn(error)
})
......@@ -403,7 +442,7 @@ const DetialLayout = () => {
visible={tableModalVisible}
columns={tableModalColumns}
tableProps={{
rowKey: 'orderId',
rowKey: (record) => `${record.orderNo}`,
}}
ctl={false}
effects={($, actions) => {
......
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