diff --git a/config/routes.ts b/config/routes.ts index b7b8fac..46a9e4a 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -43,7 +43,7 @@ export default [ name: 'dashboard', icon: 'DashboardOutlined', routes: [ - + ], }, { @@ -240,6 +240,12 @@ export default [ path: 'serviceAreaPersonnel', name: 'serviceAreaPersonnel', component: './newDataAnalysis/serviceAreaPersonnel/index', + }, + // 车流客流分析 + { + path: 'trafficAnalysis', + name: 'trafficAnalysis', + component: './newDataAnalysis/trafficAnalysis/index', } ] }, diff --git a/package.json b/package.json index 8e197a9..c2bb001 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "4.5.73", + "version": "4.5.78", "private": true, "description": "An out-of-box UI solution for enterprise applications", "scripts": { diff --git a/src/pages/newDataAnalysis/service.ts b/src/pages/newDataAnalysis/service.ts index 1c3e431..7f37f14 100644 --- a/src/pages/newDataAnalysis/service.ts +++ b/src/pages/newDataAnalysis/service.ts @@ -26,7 +26,7 @@ export async function handleNewGetSERVERPARTDetail(params?: any) { } } - return data.Result_Data; + return data.Result_Data; } // 同步服务区详情 @@ -46,5 +46,20 @@ export async function handleSynchroSERVERPART(params?: any) { } } - return data; + return data; } + + +// 获取断面流量表列表 +export async function handleGetSECTIONFLOWList(params?: any) { + const data = await request(`/BigData/GetSECTIONFLOWList`, { + method: 'POST', + data: params, + }); + + if (data.Result_Code !== 100) { + return data + } + + return data.Result_Data.List; +} \ No newline at end of file diff --git a/src/pages/newDataAnalysis/trafficAnalysis/index.tsx b/src/pages/newDataAnalysis/trafficAnalysis/index.tsx new file mode 100644 index 0000000..4ce514b --- /dev/null +++ b/src/pages/newDataAnalysis/trafficAnalysis/index.tsx @@ -0,0 +1,187 @@ +import { connect } from "umi"; +import type { CurrentUser } from "umi"; +import type { ConnectState } from "@/models/connect"; +import React, { useRef, useState } from "react"; +import ProCard from "@ant-design/pro-card"; +import { MenuFoldOutlined } from "@ant-design/icons"; +import type { FormInstance } from "antd"; +import { Button, message, Space, Spin, Tree } from "antd"; +import useRequest from "@ahooksjs/use-request"; +import { getServerpartTree } from "@/services/options"; +import type { ActionType } from "@ant-design/pro-table"; +import ProTable from "@ant-design/pro-table"; +import ReactHTMLTableToExcel from "react-html-table-to-excel"; +import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree"; +import PageTitleBox from "@/components/PageTitleBox"; +import { handleGetSECTIONFLOWList } from "../service"; +import moment from 'moment' + +const trafficAnalysis: React.FC<{ currentUser: CurrentUser }> = (props) => { + const { currentUser } = props + const downloadBtnRef = useRef() + const actionRef = useRef(); + const formRef = useRef(); + const [reqDetailList, setReqDetailList] = useState(); // 合计项数据源 + const [printOut, setPrintOut] = useState(); // 打印数据的内容 + const [collapsible, setCollapsible] = useState(false) + const [treeView, setTreeView] = useState() + const [printIndex, setPrintIndex] = useState(new Date().getTime()) + + + // 树相关的属性和方法 + const [selectedId, setSelectedId] = useState() + // 导出的加载效果 + const [showLoading, setShowLoading] = useState(false) + // 是否显示打印的表格 + const [showExportTable, setShowExportTable] = useState(false) + // 查询的条件 + const [searchParams, setSearchParams] = useState() + + const columns: any = [ + { + title: '统计时间', + dataIndex: 'search_date', + valueType: 'dateRange', + hideInTable: true, + hideInDescriptions: true, + search: { + transform: (value) => { + return { + STATISTICS_DATE_Start: value[0], + STATISTICS_DATE_End: value[1], + }; + }, + }, + fieldProps: { + ranges: { + "本月": [moment().startOf('M'), moment()], + "上月": [moment().subtract(1, 'M').startOf('M'), moment().subtract(1, 'M').endOf('M')], + "近三月": [moment().subtract(3, 'M').startOf('M'), moment().endOf('M')], + "近半年": [moment().subtract(6, 'M').startOf('M'), moment().endOf('M')], + } + }, + initialValue: [moment(moment().subtract(8, 'd')), moment(moment().subtract(1, 'd'))], + }, + { + title: "服务区名称", + width: 150, + dataIndex: "SERVERPART_NAME", + hideInSearch: true, + ellipsis: true, + align: 'center' + }, + { + title: "服务区方位", + width: 150, + dataIndex: "SERVERPART_REGION", + hideInSearch: true, + ellipsis: true, + align: 'center' + }, + { + title:
断面流量
, + width: 150, + dataIndex: "SECTIONFLOW_NUM", + hideInSearch: true, + valueType: 'digit', + ellipsis: true, + align: 'right' + }, + { + title:
服务区流量
, + width: 150, + dataIndex: "SERVERPART_FLOW", + hideInSearch: true, + ellipsis: true, + align: 'right' + }, + { + title:
男性数量
, + width: 150, + dataIndex: "MALE_COUNT", + hideInSearch: true, + ellipsis: true, + align: 'right' + }, + { + title:
女性数量
, + width: 150, + dataIndex: "FEMALE_COUNT", + hideInSearch: true, + ellipsis: true, + align: 'right' + }, + { + title: "统计日期", + width: 150, + dataIndex: "STATISTICS_DATE", + hideInSearch: true, + ellipsis: true, + align: 'center' + } + ] + + return ( +
{ + // 打印报表 + if (!reqDetailList || reqDetailList.length === 0) return; + setPrintOut(el); + }} > + +
+ +
+ } // 列表表头 + search={{ span: 6 }} + request={async (params) => { + if (!selectedId) { + return + } + + const req: any = { + SearchParameter: { + STATISTICS_DATE_Start: params.STATISTICS_DATE_Start, + STATISTICS_DATE_End: params.STATISTICS_DATE_End, + SERVERPART_IDS: selectedId, + }, + PageIndex: 1, + PageSize: 999999 + } + + setSearchParams(params) + + const data = await handleGetSECTIONFLOWList(req) + if (data && data.length > 0) { + return { data, success: true } + } + return { data: [], success: true } + }} + toolbar={{ + actions: [ + + ] + }} + /> +
+
+
+ ) +} + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.currentUser +}))(trafficAnalysis); diff --git a/src/pages/reports/BusinessAnalysis/saleHisReport/index.tsx b/src/pages/reports/BusinessAnalysis/saleHisReport/index.tsx index cd43876..3ef4898 100644 --- a/src/pages/reports/BusinessAnalysis/saleHisReport/index.tsx +++ b/src/pages/reports/BusinessAnalysis/saleHisReport/index.tsx @@ -7,7 +7,7 @@ import React, { useRef, useState } from "react"; import ProCard from "@ant-design/pro-card"; import { MenuFoldOutlined } from "@ant-design/icons"; import type { FormInstance } from "antd"; -import { Button, message, Space, Spin, Tree } from "antd"; +import { Button, message, Space, Spin, Tooltip, Tree } from "antd"; import useRequest from "@ahooksjs/use-request"; import { getFieldEnumTree, getServerpartTree, getSPRegionShopTree, handleCallLogs, handleGetServiceShopTreeList } from "@/services/options"; import type { ActionType } from "@ant-design/pro-table"; @@ -71,7 +71,7 @@ const saleHisReport: React.FC<{ currentUser: CurrentUser }> = (props) => { hideInTable: true, colSize: 1, hideInDescriptions: true, - initialValue: [moment().add(-2, 'month').endOf("month"), moment().add(-2, 'month').endOf("month")], + initialValue: [moment().add(-2, 'month').startOf("month"), moment()], search: { transform: (value) => { return { @@ -81,9 +81,8 @@ const saleHisReport: React.FC<{ currentUser: CurrentUser }> = (props) => { }, }, fieldProps: { - picker: "month", format: 'YYYY-MM', - disabledDate: (current: any) => current && current > moment().startOf("month") + // disabledDate: (current: any) => current && current > moment().startOf("month") } }, { @@ -203,7 +202,12 @@ const saleHisReport: React.FC<{ currentUser: CurrentUser }> = (props) => { align: 'right', }, { - title:
进货单价
, + title:
+ 商品进价 + +
!
+
+
, dataIndex: 'Commodity_PurchasePrice', valueType: 'digit', hideInSearch: true, diff --git a/src/pages/reports/BusinessAnalysis/saleReport/index.tsx b/src/pages/reports/BusinessAnalysis/saleReport/index.tsx index 828e37c..25e709e 100644 --- a/src/pages/reports/BusinessAnalysis/saleReport/index.tsx +++ b/src/pages/reports/BusinessAnalysis/saleReport/index.tsx @@ -6,7 +6,7 @@ import React, { useRef, useState } from "react"; import ProCard from "@ant-design/pro-card"; import { MenuFoldOutlined } from "@ant-design/icons"; import type { FormInstance } from "antd"; -import { Button, message, Space, Spin, Tree } from "antd"; +import { Button, message, Space, Spin, Tooltip, Tree } from "antd"; import useRequest from "@ahooksjs/use-request"; import { getFieldEnum, @@ -123,7 +123,7 @@ const saleReport: React.FC<{ currentUser: CurrentUser }> = (props) => { }, }, fieldProps: { - disabledDate: (current: any) => current && current < moment().subtract(1, 'months').startOf("month") + // disabledDate: (current: any) => current && current < moment().subtract(1, 'months').startOf("month") } }, { @@ -249,6 +249,19 @@ const saleReport: React.FC<{ currentUser: CurrentUser }> = (props) => { align: 'right', sorter: (a, b) => a.Commodity_RetailPrice - b.Commodity_RetailPrice }, + { + dataIndex: 'Commodity_PurchasePrice', + title:
+ 商品进价 + +
!
+
+
, + width: 120, + hideInSearch: true, + valueType: "money", + align: 'right', + }, { width: 120, title:
优惠金额
, diff --git a/src/pages/reports/audit/abnormalExamine/index.tsx b/src/pages/reports/audit/abnormalExamine/index.tsx index 5256141..8411859 100644 --- a/src/pages/reports/audit/abnormalExamine/index.tsx +++ b/src/pages/reports/audit/abnormalExamine/index.tsx @@ -6,7 +6,7 @@ import React, { useRef, useState } from "react"; import ProCard from "@ant-design/pro-card"; import { MenuFoldOutlined } from "@ant-design/icons"; import type { FormInstance } from "antd"; -import { Avatar, Button, Menu, message, Space, Spin, Tree } from "antd"; +import { Avatar, Button, Drawer, Menu, message, Space, Spin, Tree } from "antd"; import useRequest from "@ahooksjs/use-request"; import { getFieldEnum, @@ -52,9 +52,11 @@ const abnormalExamine: React.FC<{ currentUser: CurrentUser }> = (props) => { const [showExportTable, setShowExportTable] = useState(false) const [currenMenu, setCurrenMenu] = useState(); // 当前选中左侧菜单的服务区节点 const [ABNORMALITY_TYPEObj, setABNORMALITY_TYPEObj] = useState() - - const [serverpartShopObj, setServerpartShopObj] = useState() + // 显示详情抽屉 + const [showDetail, setShowDetail] = useState(false) + // 当前行数据 + const [currentRow, setCurrentRow] = useState() const columns: any = [ { @@ -88,7 +90,6 @@ const abnormalExamine: React.FC<{ currentUser: CurrentUser }> = (props) => { disabledDate: (current: any) => current && current > moment() } }, - { title: '序号', dataIndex: 'index', @@ -103,6 +104,12 @@ const abnormalExamine: React.FC<{ currentUser: CurrentUser }> = (props) => { align: 'left', dataIndex: 'SHOPNAME', hideInSearch: true, + render: (_, record) => { + return record?.SHOPNAME ? { + setCurrentRow(record) + setShowDetail(true) + }}>{record?.SHOPNAME} : "" + } }, { title: '异常类型', @@ -158,10 +165,13 @@ const abnormalExamine: React.FC<{ currentUser: CurrentUser }> = (props) => { }, { title:
审核意见
, - width: 200, - dataIndex: 'ABNORMALITY_DESC', + width: 250, + dataIndex: 'ApprovalComments', ellipsis: true, hideInSearch: true, + render: (_, record) => { + return record?.ApprovalComments ? {record?.ApprovalComments} : "" + } }, { title: '服务区', @@ -434,6 +444,30 @@ const abnormalExamine: React.FC<{ currentUser: CurrentUser }> = (props) => { /> + + + { + setShowDetail(false) + setCurrentRow(undefined) + actionRef.current?.reload() + }} + destroyOnClose + bodyStyle={{ + padding: 0 + }} + > +