From c58125e253d662e3a64f58e3411589e35532d386 Mon Sep 17 00:00:00 2001 From: ylj20011123 Date: Fri, 19 Sep 2025 18:26:19 +0800 Subject: [PATCH] update --- package.json | 2 +- .../monthlyRevenueAnalysis/index.tsx | 329 ++++++++++-------- .../NewProductApproval/index.tsx | 17 +- .../ProductChangePriceApproval/index.tsx | 3 + src/versionEnv.ts | 6 +- 5 files changed, 209 insertions(+), 148 deletions(-) diff --git a/package.json b/package.json index 2b9e042..5ca5887 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "4.5.58", + "version": "4.5.60", "private": true, "description": "An out-of-box UI solution for enterprise applications", "scripts": { diff --git a/src/pages/reports/BusinessAnalysis/monthlyRevenueAnalysis/index.tsx b/src/pages/reports/BusinessAnalysis/monthlyRevenueAnalysis/index.tsx index c0fe7e9..354b8e3 100644 --- a/src/pages/reports/BusinessAnalysis/monthlyRevenueAnalysis/index.tsx +++ b/src/pages/reports/BusinessAnalysis/monthlyRevenueAnalysis/index.tsx @@ -40,12 +40,10 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) = const [searchParams, setSearchParams] = useState() // 表格表头 显示的时间 const [tableTitle, setTableTitle] = useState({ - thisMonthStart: "", - thisMonthEnd: "", - thisYearStart: "", - thisYearEnd: "", - thisYear: "", - lastYear: "" + staticDate: "", + compareDate: "", + AccDate: "", + AccCompareDate: "", }) const columns: any = [ @@ -64,14 +62,76 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) = initialValue: 3 }, { - title: '统计月份', - dataIndex: 'searchMonth', - valueType: "date", + title: '统计日期', + dataIndex: 'statisticalDate', + valueType: "dateRange", 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: { - picker: "month", - format: 'YYYY-MM', + picker: "date", + 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", hideInSearch: true, ellipsis: true, + align: 'center', }, ] }, { - title: `本月${tableTitle?.thisMonthStart && tableTitle?.thisMonthEnd ? `(${tableTitle?.thisMonthStart}-${tableTitle?.thisMonthEnd})` : ""}`, - dataIndex: "RevenueAmount", + // title:
{`${tableTitle?.lastYear}年`}
, + title:
{`${tableTitle?.compareDate || ""}`}
, + dataIndex: "RevenueAmountFirst", hideInSearch: true, - align: 'center', + ellipsis: true, children: [ { - title:
{`${tableTitle?.lastYear}年`}
, - dataIndex: "RevenueAmountFirst", + title:
总额
, + width: 150, + dataIndex: ["RevenueAmount", "compareData"], hideInSearch: true, + align: 'right', + valueType: 'digit', ellipsis: true, - children: [ - { - title:
总额
, - width: 120, - dataIndex: ["RevenueAmount", "curData"], - hideInSearch: true, - align: 'right', - valueType: 'digit', - ellipsis: true, - }, - ] - }, - - - { - title:
{`${tableTitle?.thisYear}年`}
, - dataIndex: "RevenueAmountSecond", - hideInSearch: true, - ellipsis: true, - children: [ - { - title:
总额
, - width: 120, - dataIndex: ["RevenueAmount", "compareData"], - hideInSearch: true, - ellipsis: true, - align: 'right', - valueType: 'digit', - }, - { - title:
增长
, - width: 120, - dataIndex: ["RevenueAmount", "increaseData"], - hideInSearch: true, - ellipsis: true, - align: 'right', - valueType: 'digit', - }, - { - title:
增幅
, - 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})` : ""}`, - dataIndex: "ACCRevenueAmount", + // title:
{`${tableTitle?.thisYear}年`}
, + title:
{`${tableTitle?.staticDate || ""}`}
, + dataIndex: "RevenueAmountSecond", hideInSearch: true, - align: 'center', + ellipsis: true, children: [ { - title:
{`${tableTitle?.lastYear}年`}
, - dataIndex: "ACCRevenueAmountFirst", + title:
总额
, + width: 120, + dataIndex: ["RevenueAmount", "curData"], hideInSearch: true, ellipsis: true, - children: [ - { - title:
总额
, - width: 120, - dataIndex: ["ACCRevenueAmount", "curData"], - hideInSearch: true, - ellipsis: true, - align: 'right', - valueType: 'digit', - }, - ] + align: 'right', + valueType: 'digit', }, { - title:
{`${tableTitle?.thisYear}年`}
, - dataIndex: "ACCRevenueAmountSecond", + title:
增长
, + width: 120, + dataIndex: ["RevenueAmount", "increaseData"], hideInSearch: true, ellipsis: true, - children: [ - { - title:
总额
, - width: 120, - dataIndex: ["ACCRevenueAmount", "compareData"], - hideInSearch: true, - ellipsis: true, - align: 'right', - valueType: 'digit', - }, - { - title:
增长
, - width: 120, - dataIndex: ["ACCRevenueAmount", "increaseData"], - hideInSearch: true, - ellipsis: true, - align: 'right', - valueType: 'digit', - }, - { - title:
增幅
, - width: 120, - dataIndex: "ACCRevenueAmount.increaseRate", - hideInSearch: true, - ellipsis: true, - align: 'right', - valueType: 'digit', - render: (_, record) => { - return record?.ACCRevenueAmount?.increaseRate ? `${record?.ACCRevenueAmount?.increaseRate}%` : "-" - } - }, - ] + align: 'right', + valueType: 'digit', + }, + { + title:
增幅
, + width: 120, + dataIndex: "RevenueAmount.increaseRate", + hideInSearch: true, + ellipsis: true, + align: 'right', + valueType: 'digit', + render: (_, record) => { + return record?.RevenueAmount?.increaseRate ? `${record?.RevenueAmount?.increaseRate}%` : "-" + } }, ] - } + }, + { + // title:
{`${tableTitle?.lastYear}年`}
, + title:
{`${tableTitle?.AccCompareDate || ""}`}
, + dataIndex: "ACCRevenueAmountFirst", + hideInSearch: true, + ellipsis: true, + children: [ + { + title:
总额
, + width: 150, + dataIndex: ["ACCRevenueAmount", "compareData"], + hideInSearch: true, + ellipsis: true, + align: 'right', + valueType: 'digit', + }, + ] + }, + { + title:
{`${tableTitle?.AccDate || ""}`}
, + dataIndex: "ACCRevenueAmountSecond", + hideInSearch: true, + ellipsis: true, + children: [ + { + title:
总额
, + width: 120, + dataIndex: ["ACCRevenueAmount", "curData"], + hideInSearch: true, + ellipsis: true, + align: 'right', + valueType: 'digit', + }, + { + title:
增长
, + width: 120, + dataIndex: ["ACCRevenueAmount", "increaseData"], + hideInSearch: true, + ellipsis: true, + align: 'right', + valueType: 'digit', + }, + { + title:
增幅
, + 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) = }
- +
= (props) = expandRowByClick: true }} rowKey={'LineIndex'} - scroll={{ x: "100%", y: "calc(100vh - 410px)" }} + scroll={{ x: "100%", y: "calc(100vh - 520px)" }} headerTitle={} // 列表表头 - search={{ span: 6 }} + search={{ span: 6, defaultCollapsed: false }} request={async (params) => { if (!selectedId) { return @@ -293,23 +338,30 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) = DataType: params?.DataType || 3, ProvinceCode: currentUser?.ProvinceCode, ServerpartId: selectedId, - StartDate: params?.searchMonth ? moment(params?.searchMonth).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') : "", + StartDate: params?.StartDate ? moment(params?.StartDate).startOf('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) + console.log('reqreqreq', req); + const data = await handleGetBusinessItemSummary(req) - if (params?.searchMonth) { - setTableTitle( - { - thisMonthStart: moment(params?.searchMonth).startOf('M').format('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'), - thisYearStart: moment(params?.searchMonth).startOf('y').format('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') - } - ) - } + setTableTitle( + { + staticDate: `${params?.StartDate ? moment(params?.StartDate).format('YYYY.MM.DD') : ""}${params?.EndDate ? '-' + moment(params?.EndDate).format('YYYY.MM.DD') : ''}`, + compareDate: `${params?.CompareStartDate ? moment(params?.CompareStartDate).format('YYYY.MM.DD') : ""}${params?.CompareEndDate ? '-' + moment(params?.CompareEndDate).format('YYYY.MM.DD') : ''}`, + AccDate: `${params?.AccStartDate ? moment(params?.AccStartDate).format('YYYY.MM.DD') : ""}${params?.AccEndDate ? '-' + moment(params?.AccEndDate).format('YYYY.MM.DD') : ''}`, + AccCompareDate: `${params?.AccCompareStartDate ? moment(params?.AccCompareStartDate).format('YYYY.MM.DD') : ""}${params?.AccCompareEndDate ? '-' + moment(params?.AccCompareEndDate).format('YYYY.MM.DD') : ''}`, + } + ) console.log('data', data); if (data && data.length > 0) { let list: any = JSON.parse(JSON.stringify(data)) @@ -367,7 +419,7 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) = reqDetailList, `月度营收分析${searchParams?.searchMonth ? moment(searchParams?.searchMonth).format('YYYYMM') : ""}`, { - topTitle: `服务区${searchParams?.searchMonth ? moment(searchParams?.searchMonth).format('MM') : ""}月营业额统计表`, // 顶部大标题 + // topTitle: `服务区${searchParams?.searchMonth ? moment(searchParams?.searchMonth).format('MM') : ""}月营业额统计表`, // 顶部大标题 } ) } else { @@ -379,6 +431,7 @@ const monthlyRevenueAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) = ] }} + pagination={false} />
diff --git a/src/pages/reports/productControl/NewProductApproval/index.tsx b/src/pages/reports/productControl/NewProductApproval/index.tsx index 4a35fbe..1e71d0f 100644 --- a/src/pages/reports/productControl/NewProductApproval/index.tsx +++ b/src/pages/reports/productControl/NewProductApproval/index.tsx @@ -736,9 +736,14 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props modalApproveFormRef?.current?.submit() }) } else { - modalFormRef?.current?.validateFields().then(() => { - modalFormRef?.current?.submit() - }) + if (shopData && shopData.length > 0) { + modalFormRef?.current?.validateFields().then(() => { + modalFormRef?.current?.submit() + }) + } else { + message.error("请选选择申请的商品!") + return + } } }}>确认 } @@ -1214,10 +1219,10 @@ const ProductChangeInfoApproval: React.FC<{ currentUser: CurrentUser }> = (props : '' } - + {/* 新增商品的悬浮框 */} - = (props - + ) } diff --git a/src/pages/reports/productControl/ProductChangePriceApproval/index.tsx b/src/pages/reports/productControl/ProductChangePriceApproval/index.tsx index 238073e..255757e 100644 --- a/src/pages/reports/productControl/ProductChangePriceApproval/index.tsx +++ b/src/pages/reports/productControl/ProductChangePriceApproval/index.tsx @@ -903,6 +903,9 @@ const ProductChangePriceApproval: React.FC<{ currentUser: CurrentUser }> = (prop allRight = false } }) + } else { + message.error("请选选择申请的商品!") + return } if (!allRight) { message.error("请先完善表格数据!") diff --git a/src/versionEnv.ts b/src/versionEnv.ts index f48e350..d42900c 100644 --- a/src/versionEnv.ts +++ b/src/versionEnv.ts @@ -1,4 +1,4 @@ // 由 scripts/writeVersion.js 自动生成 -export const VERSION = "4.5.58"; -export const GIT_HASH = "f7e3cc6"; -export const BUILD_TIME = "2025-09-18T14:27:48.181Z"; +export const VERSION = "4.5.60"; +export const GIT_HASH = "fbad9d0"; +export const BUILD_TIME = "2025-09-19T09:46:28.489Z";