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