This commit is contained in:
ylj20011123 2025-09-19 18:26:19 +08:00
parent fbad9d08e7
commit c58125e253
5 changed files with 209 additions and 148 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "ant-design-pro", "name": "ant-design-pro",
"version": "4.5.58", "version": "4.5.60",
"private": true, "private": true,
"description": "An out-of-box UI solution for enterprise applications", "description": "An out-of-box UI solution for enterprise applications",
"scripts": { "scripts": {

View File

@ -40,12 +40,10 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) =
const [searchParams, setSearchParams] = useState<any>() const [searchParams, setSearchParams] = useState<any>()
// 表格表头 显示的时间 // 表格表头 显示的时间
const [tableTitle, setTableTitle] = useState<any>({ const [tableTitle, setTableTitle] = useState<any>({
thisMonthStart: "", staticDate: "",
thisMonthEnd: "", compareDate: "",
thisYearStart: "", AccDate: "",
thisYearEnd: "", AccCompareDate: "",
thisYear: "",
lastYear: ""
}) })
const columns: any = [ const columns: any = [
@ -64,14 +62,76 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) =
initialValue: 3 initialValue: 3
}, },
{ {
title: '统计月份', title: '统计日期',
dataIndex: 'searchMonth', dataIndex: 'statisticalDate',
valueType: "date", valueType: "dateRange",
hideInTable: true, hideInTable: true,
initialValue: moment(), initialValue: [moment().startOf('M').format('YYYY-MM-DD'), moment().subtract(1, 'd').format('YYYY-MM-DD')],
search: {
transform: (value: any) => {
return {
StartDate: moment(value[0]).format('YYYY-MM-DD'),
EndDate: moment(value[1]).format('YYYY-MM-DD'),
};
},
},
fieldProps: { fieldProps: {
picker: "month", picker: "date",
format: 'YYYY-MM', format: 'YYYY-MM-DD',
}
},
{
title: '对比日期',
dataIndex: 'CompareDate',
valueType: "dateRange",
hideInTable: true,
search: {
transform: (value: any) => {
return {
CompareStartDate: moment(value[0]).format('YYYY-MM-DD'),
CompareEndDate: moment(value[1]).format('YYYY-MM-DD'),
};
},
},
fieldProps: {
picker: "date",
format: 'YYYY-MM-DD',
}
},
{
title: '累计日期',
dataIndex: 'AccDate',
valueType: "dateRange",
hideInTable: true,
search: {
transform: (value: any) => {
return {
AccStartDate: moment(value[0]).format('YYYY-MM-DD'),
AccEndDate: moment(value[1]).format('YYYY-MM-DD'),
};
},
},
fieldProps: {
picker: "date",
format: 'YYYY-MM-DD',
}
},
{
title: '累计对比日期',
dataIndex: 'AccCompareDate',
valueType: "dateRange",
hideInTable: true,
search: {
transform: (value: any) => {
return {
AccCompareStartDate: moment(value[0]).format('YYYY-MM-DD'),
AccCompareEndDate: moment(value[1]).format('YYYY-MM-DD'),
};
},
},
fieldProps: {
picker: "date",
format: 'YYYY-MM-DD',
} }
}, },
{ {
@ -92,138 +152,123 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) =
dataIndex: "Serverpart_Name", dataIndex: "Serverpart_Name",
hideInSearch: true, hideInSearch: true,
ellipsis: true, ellipsis: true,
align: 'center',
}, },
] ]
}, },
{ {
title: `本月${tableTitle?.thisMonthStart && tableTitle?.thisMonthEnd ? `(${tableTitle?.thisMonthStart}-${tableTitle?.thisMonthEnd})` : ""}`, // title: <div style={{ textAlign: 'center' }}>{`${tableTitle?.lastYear}年`}</div>,
dataIndex: "RevenueAmount", title: <div style={{ textAlign: 'center' }}>{`${tableTitle?.compareDate || ""}`}</div>,
dataIndex: "RevenueAmountFirst",
hideInSearch: true, hideInSearch: true,
align: 'center', ellipsis: true,
children: [ children: [
{ {
title: <div style={{ textAlign: 'center' }}>{`${tableTitle?.lastYear}`}</div>, title: <div style={{ textAlign: 'center' }}></div>,
dataIndex: "RevenueAmountFirst", width: 150,
dataIndex: ["RevenueAmount", "compareData"],
hideInSearch: true, hideInSearch: true,
align: 'right',
valueType: 'digit',
ellipsis: true, ellipsis: true,
children: [
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 120,
dataIndex: ["RevenueAmount", "curData"],
hideInSearch: true,
align: 'right',
valueType: 'digit',
ellipsis: true,
},
]
},
{
title: <div style={{ textAlign: 'center' }}>{`${tableTitle?.thisYear}`}</div>,
dataIndex: "RevenueAmountSecond",
hideInSearch: true,
ellipsis: true,
children: [
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 120,
dataIndex: ["RevenueAmount", "compareData"],
hideInSearch: true,
ellipsis: true,
align: 'right',
valueType: 'digit',
},
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 120,
dataIndex: ["RevenueAmount", "increaseData"],
hideInSearch: true,
ellipsis: true,
align: 'right',
valueType: 'digit',
},
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 120,
dataIndex: "RevenueAmount.increaseRate",
hideInSearch: true,
ellipsis: true,
align: 'right',
valueType: 'digit',
render: (_, record) => {
return record?.RevenueAmount?.increaseRate ? `${record?.RevenueAmount?.increaseRate}%` : "-"
}
},
]
}, },
] ]
}, },
{ {
title: `年度累计${tableTitle?.thisYearStart && tableTitle?.thisYearEnd ? `(${tableTitle?.thisYearStart}-${tableTitle?.thisYearEnd})` : ""}`, // title: <div style={{ textAlign: 'center' }}>{`${tableTitle?.thisYear}年`}</div>,
dataIndex: "ACCRevenueAmount", title: <div style={{ textAlign: 'center' }}>{`${tableTitle?.staticDate || ""}`}</div>,
dataIndex: "RevenueAmountSecond",
hideInSearch: true, hideInSearch: true,
align: 'center', ellipsis: true,
children: [ children: [
{ {
title: <div style={{ textAlign: 'center' }}>{`${tableTitle?.lastYear}`}</div>, title: <div style={{ textAlign: 'center' }}></div>,
dataIndex: "ACCRevenueAmountFirst", width: 120,
dataIndex: ["RevenueAmount", "curData"],
hideInSearch: true, hideInSearch: true,
ellipsis: true, ellipsis: true,
children: [ align: 'right',
{ valueType: 'digit',
title: <div style={{ textAlign: 'center' }}></div>,
width: 120,
dataIndex: ["ACCRevenueAmount", "curData"],
hideInSearch: true,
ellipsis: true,
align: 'right',
valueType: 'digit',
},
]
}, },
{ {
title: <div style={{ textAlign: 'center' }}>{`${tableTitle?.thisYear}`}</div>, title: <div style={{ textAlign: 'center' }}></div>,
dataIndex: "ACCRevenueAmountSecond", width: 120,
dataIndex: ["RevenueAmount", "increaseData"],
hideInSearch: true, hideInSearch: true,
ellipsis: true, ellipsis: true,
children: [ align: 'right',
{ valueType: 'digit',
title: <div style={{ textAlign: 'center' }}></div>, },
width: 120, {
dataIndex: ["ACCRevenueAmount", "compareData"], title: <div style={{ textAlign: 'center' }}></div>,
hideInSearch: true, width: 120,
ellipsis: true, dataIndex: "RevenueAmount.increaseRate",
align: 'right', hideInSearch: true,
valueType: 'digit', ellipsis: true,
}, align: 'right',
{ valueType: 'digit',
title: <div style={{ textAlign: 'center' }}></div>, render: (_, record) => {
width: 120, return record?.RevenueAmount?.increaseRate ? `${record?.RevenueAmount?.increaseRate}%` : "-"
dataIndex: ["ACCRevenueAmount", "increaseData"], }
hideInSearch: true,
ellipsis: true,
align: 'right',
valueType: 'digit',
},
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 120,
dataIndex: "ACCRevenueAmount.increaseRate",
hideInSearch: true,
ellipsis: true,
align: 'right',
valueType: 'digit',
render: (_, record) => {
return record?.ACCRevenueAmount?.increaseRate ? `${record?.ACCRevenueAmount?.increaseRate}%` : "-"
}
},
]
}, },
] ]
} },
{
// title: <div style={{ textAlign: 'center' }}>{`${tableTitle?.lastYear}年`}</div>,
title: <div style={{ textAlign: 'center' }}>{`${tableTitle?.AccCompareDate || ""}`}</div>,
dataIndex: "ACCRevenueAmountFirst",
hideInSearch: true,
ellipsis: true,
children: [
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 150,
dataIndex: ["ACCRevenueAmount", "compareData"],
hideInSearch: true,
ellipsis: true,
align: 'right',
valueType: 'digit',
},
]
},
{
title: <div style={{ textAlign: 'center' }}>{`${tableTitle?.AccDate || ""}`}</div>,
dataIndex: "ACCRevenueAmountSecond",
hideInSearch: true,
ellipsis: true,
children: [
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 120,
dataIndex: ["ACCRevenueAmount", "curData"],
hideInSearch: true,
ellipsis: true,
align: 'right',
valueType: 'digit',
},
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 120,
dataIndex: ["ACCRevenueAmount", "increaseData"],
hideInSearch: true,
ellipsis: true,
align: 'right',
valueType: 'digit',
},
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 120,
dataIndex: "ACCRevenueAmount.increaseRate",
hideInSearch: true,
ellipsis: true,
align: 'right',
valueType: 'digit',
render: (_, record) => {
return record?.ACCRevenueAmount?.increaseRate ? `${record?.ACCRevenueAmount?.increaseRate}%` : "-"
}
},
]
},
] ]
@ -264,7 +309,7 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) =
} }
<div style={{ backgroundColor: '#fff', display: 'flex' }}> <div style={{ backgroundColor: '#fff', display: 'flex' }}>
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} /> <LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} noWj={true} />
<div style={{ <div style={{
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)', width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
paddingTop: 0, paddingTop: 0,
@ -280,9 +325,9 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) =
expandRowByClick: true expandRowByClick: true
}} }}
rowKey={'LineIndex'} rowKey={'LineIndex'}
scroll={{ x: "100%", y: "calc(100vh - 410px)" }} scroll={{ x: "100%", y: "calc(100vh - 520px)" }}
headerTitle={<PageTitleBox props={props} />} // 列表表头 headerTitle={<PageTitleBox props={props} />} // 列表表头
search={{ span: 6 }} search={{ span: 6, defaultCollapsed: false }}
request={async (params) => { request={async (params) => {
if (!selectedId) { if (!selectedId) {
return return
@ -293,23 +338,30 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) =
DataType: params?.DataType || 3, DataType: params?.DataType || 3,
ProvinceCode: currentUser?.ProvinceCode, ProvinceCode: currentUser?.ProvinceCode,
ServerpartId: selectedId, ServerpartId: selectedId,
StartDate: params?.searchMonth ? moment(params?.searchMonth).startOf('M').format('YYYY-MM-DD') : "", StartDate: params?.StartDate ? moment(params?.StartDate).startOf('M').format('YYYY-MM-DD') : "",
EndDate: params?.searchMonth ? new Date(moment().subtract(1, 'd').format('YYYY-MM-DD')).getTime() < new Date(moment(params?.searchMonth).endOf('M').format('YYYY-MM-DD')).getTime() ? moment().subtract(1, 'd').format('YYYY-MM-DD') : moment(params?.searchMonth).endOf('M').format('YYYY-MM-DD') : "", EndDate: params?.EndDate ? new Date(moment().subtract(1, 'd').format('YYYY-MM-DD')).getTime() < new Date(params?.EndDate).getTime() ? moment().subtract(1, 'd').format('YYYY-MM-DD') : params?.EndDate : "",
CompareStartDate: params?.CompareStartDate ? moment(params?.CompareStartDate).startOf('M').format('YYYY-MM-DD') : "",
CompareEndDate: params?.CompareEndDate ? new Date(moment().subtract(1, 'd').format('YYYY-MM-DD')).getTime() < new Date(params?.CompareEndDate).getTime() ? moment().subtract(1, 'd').format('YYYY-MM-DD') : params?.CompareEndDate : "",
AccStartDate: params?.AccStartDate ? moment(params?.AccStartDate).startOf('M').format('YYYY-MM-DD') : "",
AccEndDate: params?.AccEndDate ? new Date(moment().subtract(1, 'd').format('YYYY-MM-DD')).getTime() < new Date(params?.AccEndDate).getTime() ? moment().subtract(1, 'd').format('YYYY-MM-DD') : params?.AccEndDate : "",
AccCompareStartDate: params?.AccCompareStartDate ? moment(params?.AccCompareStartDate).startOf('M').format('YYYY-MM-DD') : "",
AccCompareEndDate: params?.AccCompareEndDate ? new Date(moment().subtract(1, 'd').format('YYYY-MM-DD')).getTime() < new Date(params?.AccCompareEndDate).getTime() ? moment().subtract(1, 'd').format('YYYY-MM-DD') : params?.AccCompareEndDate : "",
} }
setSearchParams(params) setSearchParams(params)
console.log('reqreqreq', req);
const data = await handleGetBusinessItemSummary(req) const data = await handleGetBusinessItemSummary(req)
if (params?.searchMonth) { setTableTitle(
setTableTitle( {
{ staticDate: `${params?.StartDate ? moment(params?.StartDate).format('YYYY.MM.DD') : ""}${params?.EndDate ? '-' + moment(params?.EndDate).format('YYYY.MM.DD') : ''}`,
thisMonthStart: moment(params?.searchMonth).startOf('M').format('MM.DD'), compareDate: `${params?.CompareStartDate ? moment(params?.CompareStartDate).format('YYYY.MM.DD') : ""}${params?.CompareEndDate ? '-' + moment(params?.CompareEndDate).format('YYYY.MM.DD') : ''}`,
thisMonthEnd: new Date(moment().subtract(1, 'd').format('YYYY-MM-DD')).getTime() < new Date(moment(params?.searchMonth).endOf('M').format('YYYY-MM-DD')).getTime() ? moment().subtract(1, 'd').format('MM.DD') : moment(params?.searchMonth).endOf('M').format('MM.DD'), AccDate: `${params?.AccStartDate ? moment(params?.AccStartDate).format('YYYY.MM.DD') : ""}${params?.AccEndDate ? '-' + moment(params?.AccEndDate).format('YYYY.MM.DD') : ''}`,
thisYearStart: moment(params?.searchMonth).startOf('y').format('MM.DD'), AccCompareDate: `${params?.AccCompareStartDate ? moment(params?.AccCompareStartDate).format('YYYY.MM.DD') : ""}${params?.AccCompareEndDate ? '-' + moment(params?.AccCompareEndDate).format('YYYY.MM.DD') : ''}`,
thisYearEnd: new Date(moment().subtract(1, 'd').format('YYYY-MM-DD')).getTime() < new Date(moment(params?.searchMonth).endOf('M').format('YYYY-MM-DD')).getTime() ? moment().subtract(1, 'd').format('MM.DD') : moment(params?.searchMonth).endOf('M').format('MM.DD'), }
thisYear: moment(params?.searchMonth).format('YYYY'), )
lastYear: moment(params?.searchMonth).subtract(1, 'y').format('YYYY')
}
)
}
console.log('data', data); console.log('data', data);
if (data && data.length > 0) { if (data && data.length > 0) {
let list: any = JSON.parse(JSON.stringify(data)) let list: any = JSON.parse(JSON.stringify(data))
@ -367,7 +419,7 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) =
reqDetailList, reqDetailList,
`月度营收分析${searchParams?.searchMonth ? moment(searchParams?.searchMonth).format('YYYYMM') : ""}`, `月度营收分析${searchParams?.searchMonth ? moment(searchParams?.searchMonth).format('YYYYMM') : ""}`,
{ {
topTitle: `服务区${searchParams?.searchMonth ? moment(searchParams?.searchMonth).format('MM') : ""}月营业额统计表`, // 顶部大标题 // topTitle: `服务区${searchParams?.searchMonth ? moment(searchParams?.searchMonth).format('MM') : ""}月营业额统计表`, // 顶部大标题
} }
) )
} else { } else {
@ -379,6 +431,7 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) =
</Button> </Button>
] ]
}} }}
pagination={false}
/> />
</div> </div>
</div> </div>

View File

@ -736,9 +736,14 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
modalApproveFormRef?.current?.submit() modalApproveFormRef?.current?.submit()
}) })
} else { } else {
modalFormRef?.current?.validateFields().then(() => { if (shopData && shopData.length > 0) {
modalFormRef?.current?.submit() modalFormRef?.current?.validateFields().then(() => {
}) modalFormRef?.current?.submit()
})
} else {
message.error("请选选择申请的商品!")
return
}
} }
}}></Button> }}></Button>
</div>} </div>}
@ -1214,10 +1219,10 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
</Card> </Card>
: '' : ''
} }
</Modal> </Modal >
{/* 新增商品的悬浮框 */} {/* 新增商品的悬浮框 */}
<Modal < Modal
open={showAddShopModal} open={showAddShopModal}
width={1200} width={1200}
wrapClassName={'shopModal'} wrapClassName={'shopModal'}
@ -1659,7 +1664,7 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props
</Col> </Col>
</Row> </Row>
</ProForm> </ProForm>
</Modal> </Modal >
</div > </div >
) )
} }

View File

@ -903,6 +903,9 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop
allRight = false allRight = false
} }
}) })
} else {
message.error("请选选择申请的商品!")
return
} }
if (!allRight) { if (!allRight) {
message.error("请先完善表格数据!") message.error("请先完善表格数据!")

View File

@ -1,4 +1,4 @@
// 由 scripts/writeVersion.js 自动生成 // 由 scripts/writeVersion.js 自动生成
export const VERSION = "4.5.58"; export const VERSION = "4.5.60";
export const GIT_HASH = "f7e3cc6"; export const GIT_HASH = "fbad9d0";
export const BUILD_TIME = "2025-09-18T14:27:48.181Z"; export const BUILD_TIME = "2025-09-19T09:46:28.489Z";