This commit is contained in:
ylj20011123 2025-11-07 09:08:32 +08:00
parent f3703b1f81
commit 5e6a50df08
8 changed files with 279 additions and 20 deletions

View File

@ -240,6 +240,12 @@ export default [
path: 'serviceAreaPersonnel',
name: 'serviceAreaPersonnel',
component: './newDataAnalysis/serviceAreaPersonnel/index',
},
// 车流客流分析
{
path: 'trafficAnalysis',
name: 'trafficAnalysis',
component: './newDataAnalysis/trafficAnalysis/index',
}
]
},

View File

@ -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": {

View File

@ -48,3 +48,18 @@ export async function handleSynchroSERVERPART(params?: any) {
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;
}

View File

@ -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<any>()
const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
const [collapsible, setCollapsible] = useState<boolean>(false)
const [treeView, setTreeView] = useState<any>()
const [printIndex, setPrintIndex] = useState<number>(new Date().getTime())
// 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>()
// 导出的加载效果
const [showLoading, setShowLoading] = useState<boolean>(false)
// 是否显示打印的表格
const [showExportTable, setShowExportTable] = useState<boolean>(false)
// 查询的条件
const [searchParams, setSearchParams] = useState<any>()
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: <div style={{ textAlign: 'center' }}></div>,
width: 150,
dataIndex: "SECTIONFLOW_NUM",
hideInSearch: true,
valueType: 'digit',
ellipsis: true,
align: 'right'
},
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 150,
dataIndex: "SERVERPART_FLOW",
hideInSearch: true,
ellipsis: true,
align: 'right'
},
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 150,
dataIndex: "MALE_COUNT",
hideInSearch: true,
ellipsis: true,
align: 'right'
},
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 150,
dataIndex: "FEMALE_COUNT",
hideInSearch: true,
ellipsis: true,
align: 'right'
},
{
title: "统计日期",
width: 150,
dataIndex: "STATISTICS_DATE",
hideInSearch: true,
ellipsis: true,
align: 'center'
}
]
return (
<div ref={(el) => {
// 打印报表
if (!reqDetailList || reqDetailList.length === 0) return;
setPrintOut(el);
}} >
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
<div style={{
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
paddingTop: 0,
paddingBottom: 0,
paddingRight: 0
}}>
<ProTable
actionRef={actionRef}
formRef={formRef}
columns={columns}
bordered
expandable={{
expandRowByClick: true
}}
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
headerTitle={<PageTitleBox props={props} />} // 列表表头
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: [
]
}}
/>
</div>
</div>
</div>
)
}
export default connect(({ user }: ConnectState) => ({
currentUser: user.currentUser
}))(trafficAnalysis);

View File

@ -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: <div style={{ textAlign: 'center' }}></div>,
title: <div style={{ textAlign: 'center', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Tooltip title={'实际未盘点,进价仅供参考!'}>
<div style={{ width: '15px', height: '15px', borderRadius: '50%', display: 'flex', alignItems: 'center', justifyContent: 'center', border: '1px solid red', color: 'red', marginLeft: '8px' }}>!</div>
</Tooltip>
</div>,
dataIndex: 'Commodity_PurchasePrice',
valueType: 'digit',
hideInSearch: true,

View File

@ -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: <div style={{ textAlign: 'center', display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<Tooltip title={'实际未盘点,进价仅供参考!'}>
<div style={{ width: '15px', height: '15px', borderRadius: '50%', display: 'flex', alignItems: 'center', justifyContent: 'center', border: '1px solid red', color: 'red', marginLeft: '8px' }}>!</div>
</Tooltip>
</div>,
width: 120,
hideInSearch: true,
valueType: "money",
align: 'right',
},
{
width: 120,
title: <div style={{ textAlign: 'center' }}></div>,

View File

@ -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<boolean>(false)
const [currenMenu, setCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点
const [ABNORMALITY_TYPEObj, setABNORMALITY_TYPEObj] = useState<any>()
const [serverpartShopObj, setServerpartShopObj] = useState<any>()
// 显示详情抽屉
const [showDetail, setShowDetail] = useState<boolean>(false)
// 当前行数据
const [currentRow, setCurrentRow] = useState<any>()
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 ? <a onClick={() => {
setCurrentRow(record)
setShowDetail(true)
}}>{record?.SHOPNAME}</a> : ""
}
},
{
title: '异常类型',
@ -158,10 +165,13 @@ const abnormalExamine: React.FC<{ currentUser: CurrentUser }> = (props) => {
},
{
title: <div style={{ textAlign: 'center' }}></div>,
width: 200,
dataIndex: 'ABNORMALITY_DESC',
width: 250,
dataIndex: 'ApprovalComments',
ellipsis: true,
hideInSearch: true,
render: (_, record) => {
return record?.ApprovalComments ? <span style={{ color: "#27B25F" }}>{record?.ApprovalComments}</span> : ""
}
},
{
title: '服务区',
@ -434,6 +444,30 @@ const abnormalExamine: React.FC<{ currentUser: CurrentUser }> = (props) => {
/>
</div>
</div>
<Drawer
width={'80vw'}
title={'稽核详情'}
open={showDetail}
onClose={() => {
setShowDetail(false)
setCurrentRow(undefined)
actionRef.current?.reload()
}}
destroyOnClose
bodyStyle={{
padding: 0
}}
>
<iframe
style={{ borderWidth: '0px' }}
width={'100%'}
height={'100%'}
// src={`http://saas.eshangtech.com/auditVideo/index.html?abnormalityCode=${currentRow?.ABNORMALITY_CODE}&userID=${currentUser?.ID}&userNAME=${currentUser?.Name}`}
src={`http://117.69.255.207:7080/AuditDetail/index.html?abnormalityCode=${currentRow?.ABNORMALITY_CODE}&userID=${currentUser?.ID}&userNAME=${currentUser?.Name}`}
/>
</Drawer>
</div>
)
}

View File

@ -1,4 +1,4 @@
// 由 scripts/writeVersion.js 自动生成
export const VERSION = "4.5.73";
export const GIT_HASH = "27ce6e9";
export const BUILD_TIME = "2025-10-15T08:25:48.245Z";
export const VERSION = "4.5.78";
export const GIT_HASH = "f3703b1";
export const BUILD_TIME = "2025-11-06T08:28:02.745Z";