diff --git a/package.json b/package.json index 42c8c01..cbe8cab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "4.5.51", + "version": "4.5.53", "private": true, "description": "An out-of-box UI solution for enterprise applications", "scripts": { diff --git a/src/components/SmartLoading/index.tsx b/src/components/SmartLoading/index.tsx index 91fefa4..d5756bf 100644 --- a/src/components/SmartLoading/index.tsx +++ b/src/components/SmartLoading/index.tsx @@ -16,10 +16,42 @@ const SmartLoading: React.FC = ({ fallback, enablePreload = true }) => { - const location = useLocation(); const [loadingType, setLoadingType] = useState<'page' | 'table' | 'form' | 'card'>('page'); + const [shouldShow, setShouldShow] = useState(false); + const [location, setLocation] = useState(null); + + // 安全获取location,避免在路由未准备好时出错 + try { + const currentLocation = useLocation(); + if (!location) { + setLocation(currentLocation); + } + } catch (error) { + // 如果useLocation失败,使用window.location作为fallback + if (!location && typeof window !== 'undefined') { + setLocation({ pathname: window.location.pathname }); + } + } useEffect(() => { + // 对于页面切换,立即显示骨架屏,但对于初始加载延迟显示 + const isInitialLoad = !location?.pathname || location.pathname === '/'; + + if (isInitialLoad) { + // 初始加载时延迟显示,避免刷新时闪烁 + const timer = setTimeout(() => { + setShouldShow(true); + }, 200); + return () => clearTimeout(timer); + } else { + // 页面切换时立即显示,保持骨架屏效果 + setShouldShow(true); + } + }, [location?.pathname]); + + useEffect(() => { + if (!location?.pathname) return; + // 根据路径判断页面类型,选择合适的骨架屏 const path = location.pathname; @@ -33,17 +65,24 @@ const SmartLoading: React.FC = ({ setLoadingType('page'); } - // 预加载相关路由 + // 预加载相关路由(降低优先级,避免影响主流程) if (enablePreload) { - routePreloader.preloadBasedOnUserBehavior(path); + setTimeout(() => { + routePreloader.preloadBasedOnUserBehavior(path); + }, 500); } - }, [location.pathname, enablePreload]); + }, [location?.pathname, enablePreload]); // 如果提供了自定义fallback,使用它 if (fallback) { return <>{fallback}; } + // 延迟显示,避免闪烁 + if (!shouldShow) { + return null; + } + // 根据页面类型返回对应的骨架屏 return ; }; diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index 343a9d5..f38739d 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -1041,7 +1041,7 @@ const BasicLayout: React.FC = (props) => { tab={item.title} key={item?.path} style={{ padding: 24, paddingTop: 0 }}> - Loading...}> + {item.children} diff --git a/src/layouts/SecurityLayout.tsx b/src/layouts/SecurityLayout.tsx index e208fb0..f2cd8db 100644 --- a/src/layouts/SecurityLayout.tsx +++ b/src/layouts/SecurityLayout.tsx @@ -15,68 +15,101 @@ type SecurityLayoutProps = { type SecurityLayoutState = { isReady: boolean; + shouldShowLoading: boolean; + initialLoadComplete: boolean; }; class SecurityLayout extends React.Component { state: SecurityLayoutState = { isReady: false, - + shouldShowLoading: false, + initialLoadComplete: false, }; + private loadingTimer?: NodeJS.Timeout; + componentDidMount() { - - const { location } = history - + const { location } = history; const { dispatch } = this.props; - if (dispatch) { + + // 检查是否有缓存的用户信息,避免不必要的加载状态 + const cachedUser = session.get("currentUser"); + + // 设置防闪烁定时器,只有加载时间超过300ms才显示loading + this.loadingTimer = setTimeout(() => { + if (!this.state.isReady && !this.state.initialLoadComplete) { + this.setState({ + shouldShowLoading: true, + }); + } + }, 300); + if (dispatch) { dispatch({ - type: 'user/fetch', callback: (user) => { + type: 'user/fetch', + callback: (user) => { + // 清除定时器 + if (this.loadingTimer) { + clearTimeout(this.loadingTimer); + } if (user.code && location.pathname !== '/user/login') { history.push('/user/login'); - return + return; } - console.log('secur') + dispatch({ - type: 'global/getMenuData', payload: user.ID, callback: (menu) => { + type: 'global/getMenuData', + payload: user.ID, + callback: (menu) => { if (menu) { - this.setState({ isReady: true, + shouldShowLoading: false, + initialLoadComplete: true, }); } } - }) - + }); } - }) - + }); } else { + // 清除定时器 + if (this.loadingTimer) { + clearTimeout(this.loadingTimer); + } + this.setState({ isReady: true, + shouldShowLoading: false, + initialLoadComplete: true, }); } + } + componentWillUnmount() { + if (this.loadingTimer) { + clearTimeout(this.loadingTimer); + } } render() { - const { isReady } = this.state; - const { children, loading, currentUser } = this.props; - // const { location } = history; - - - // You can replace it to your authentication rule (such as check token exists) - // You can replace it with your own login authentication rules (such as judging whether the token exists) + const { isReady, shouldShowLoading, initialLoadComplete } = this.state; + const { children, currentUser } = this.props; + + // 用户认证规则 const isLogin = currentUser && currentUser.ID; - - - if ((!isLogin && loading) || !isReady) { + + // 如果初始化未完成且需要显示加载状态,才显示骨架屏 + if (!isReady && shouldShowLoading) { return ; } - // if (!isLogin && location.pathname !== '/user/login') { - // history.push('/user/login'); - // } + + // 如果还在初始化过程中,但不需要显示loading,返回null(避免闪烁) + if (!isReady && !shouldShowLoading) { + return null; + } + return children; } } diff --git a/src/pages/basicManage/Brand/serverpart.tsx b/src/pages/basicManage/Brand/serverpart.tsx index 521590e..0042f20 100644 --- a/src/pages/basicManage/Brand/serverpart.tsx +++ b/src/pages/basicManage/Brand/serverpart.tsx @@ -1298,7 +1298,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => 占地面积 -
{serviceDetail?.ServerpartInfo?.FLOORAREA ? fmoney(serviceDetail.ServerpartInfo.FLOORAREA, 2) : '-'}m²
+
{serviceDetail?.ServerpartInfo?.FLOORAREA ? fmoney(serviceDetail?.ServerpartInfo?.FLOORAREA, 2) : '-'}m²
@@ -1306,7 +1306,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => 停车场面积
-
{serviceDetail?.ServerpartInfo?.SHAREAREA ? fmoney(serviceDetail.ServerpartInfo.SHAREAREA, 2) : '-'}m²
+
{serviceDetail?.ServerpartInfo?.SHAREAREA ? fmoney(serviceDetail?.ServerpartInfo?.SHAREAREA, 2) : '-'}m²
@@ -1314,7 +1314,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => 建筑面积
-
{serviceDetail?.ServerpartInfo?.SERVERPART_AREA ? fmoney(serviceDetail.ServerpartInfo.SERVERPART_AREA, 2) : '-'}m²
+
{serviceDetail?.ServerpartInfo?.SERVERPART_AREA ? fmoney(serviceDetail?.ServerpartInfo?.SERVERPART_AREA, 2) : '-'}m²
@@ -1322,7 +1322,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => 取水方式
-
{serviceDetail?.ServerpartInfo?.WATERINTAKE_TYPE === 1 ? '自来水' : serviceDetail.ServerpartInfo.WATERINTAKE_TYPE === 2 ? '井水' : ''}
+
{serviceDetail?.ServerpartInfo?.WATERINTAKE_TYPE === 1 ? '自来水' : serviceDetail?.ServerpartInfo?.WATERINTAKE_TYPE === 2 ? '井水' : ''}
@@ -1330,7 +1330,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => 污水处理
-
{serviceDetail?.ServerpartInfo?.SEWAGEDISPOSAL_TYPE === 1 ? '市政' : serviceDetail.ServerpartInfo?.SEWAGEDISPOSAL_TYPE === 2 ? '污水处理设备' : ''}
+
{serviceDetail?.ServerpartInfo?.SEWAGEDISPOSAL_TYPE === 1 ? '市政' : serviceDetail?.ServerpartInfo?.SEWAGEDISPOSAL_TYPE === 2 ? '污水处理设备' : ''}
@@ -1338,7 +1338,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => 市区县镇
-
{serviceDetail?.ServerpartInfo?.SERVERPART_ADDRESS ? serviceDetail.ServerpartInfo.SERVERPART_ADDRESS : ''}
+
{serviceDetail?.ServerpartInfo?.SERVERPART_ADDRESS ? serviceDetail?.ServerpartInfo?.SERVERPART_ADDRESS : ''}
@@ -1346,7 +1346,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => 管理单位
-
{serviceDetail?.ServerpartInfo?.MANAGERCOMPANY ? serviceDetail.ServerpartInfo.MANAGERCOMPANY : ''}
+
{serviceDetail?.ServerpartInfo?.MANAGERCOMPANY ? serviceDetail?.ServerpartInfo?.MANAGERCOMPANY : ''}
@@ -1354,7 +1354,7 @@ const BrandTable: React.FC<{ currentUser: CurrentUser }> = ({ currentUser }) => 产权单位
-
{serviceDetail?.ServerpartInfo?.OWNEDCOMPANY ? serviceDetail.ServerpartInfo.OWNEDCOMPANY : ''}
+
{serviceDetail?.ServerpartInfo?.OWNEDCOMPANY ? serviceDetail?.ServerpartInfo?.OWNEDCOMPANY : ''}
: '' diff --git a/src/pages/basicManage/BusinessTrade/index.tsx b/src/pages/basicManage/BusinessTrade/index.tsx index 867ef0d..0a8455b 100644 --- a/src/pages/basicManage/BusinessTrade/index.tsx +++ b/src/pages/basicManage/BusinessTrade/index.tsx @@ -333,6 +333,7 @@ const BusinessTradeModelTable: React.FC<{ currentUser: CurrentUser }> = (props) { setCurrentRow(undefined); setShowDetail(false); diff --git a/src/pages/basicManage/serviceArea/index.tsx b/src/pages/basicManage/serviceArea/index.tsx index 7a7d716..66d7192 100644 --- a/src/pages/basicManage/serviceArea/index.tsx +++ b/src/pages/basicManage/serviceArea/index.tsx @@ -141,6 +141,7 @@ const serviceArea: React.FC<{ currentUser: CurrentUser }> = (props) => { dataIndex: 'BUSINESS_UNIT', align: 'center', hideInSearch: true, + ellipsis: true }, ] @@ -271,6 +272,7 @@ const serviceArea: React.FC<{ currentUser: CurrentUser }> = (props) => { }} headerTitle={} search={{ span: 6 }} + scroll={{ x: "100%", y: 'calc(100vh - 430px)' }} request={async (params) => { if (!selectedId) { return diff --git a/src/pages/newDataAnalysis/serviceAreaPersonnel/index.tsx b/src/pages/newDataAnalysis/serviceAreaPersonnel/index.tsx index af80825..34d6159 100644 --- a/src/pages/newDataAnalysis/serviceAreaPersonnel/index.tsx +++ b/src/pages/newDataAnalysis/serviceAreaPersonnel/index.tsx @@ -354,6 +354,7 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => setEditModal(false) setCurrentRow(undefined) setPersonDetail(undefined) + setShowPROWERSETList([]) }} footer={
@@ -418,6 +419,7 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => setEditModal(false) setCurrentRow(undefined) setPersonDetail(undefined) + setShowPROWERSETList([]) }}>取消
} @@ -444,6 +446,25 @@ const serviceAreaPersonnel: React.FC<{ currentUser: CurrentUser }> = (props) => }) } console.log('author', author); + let list: any = [] + let nowValueList: any = [] + if (currentRow?.CASHWORKER_TYPE === 1) { + nowValueList = ['1', '2', '4', '5', '6', '8', '9', '10', '13', '15', '35', '47', '52', '53'] + } else if (currentRow?.CASHWORKER_TYPE === 2) { + nowValueList = ['1', '2', '3', '4', '5', '6', '8', '9', '10', '13', '15', '18', '35', '36', '47', '50', '51', '52', '53', '120'] + } else if (currentRow?.CASHWORKER_TYPE === 20) { + nowValueList = ['2', '3', '4', '6', '8', '9', '10', '18', '35', '47', '51'] + } + if (PROWERSET && PROWERSET.length > 0) { + PROWERSET.forEach((item: any) => { + if (nowValueList.indexOf(item.value.toString()) !== -1) { + list.push(item) + } + }) + } + + setShowPROWERSETList(list) + setPersonDetail({ ...data, WORKER_OTHER: author diff --git a/src/pages/operatingMerchants/MerchantInformation/index.tsx b/src/pages/operatingMerchants/MerchantInformation/index.tsx index 93e56a5..99d759b 100644 --- a/src/pages/operatingMerchants/MerchantInformation/index.tsx +++ b/src/pages/operatingMerchants/MerchantInformation/index.tsx @@ -944,7 +944,7 @@ const MerchantInformation: React.FC<{ currentUser: CurrentUser | undefined }> =
= formRef?.current?.validateFields().then(() => { handleConfirmLoading(true) formRef?.current?.submit() + }).catch((err) => { + message.error('请检查表单输入是否完整!') }) }}>保存
diff --git a/src/pages/reports/BusinessProject/index.tsx b/src/pages/reports/BusinessProject/index.tsx index 1472276..31b9343 100644 --- a/src/pages/reports/BusinessProject/index.tsx +++ b/src/pages/reports/BusinessProject/index.tsx @@ -16,7 +16,7 @@ import useRequest from "@ahooksjs/use-request"; import SubMenu from 'antd/lib/menu/SubMenu'; import { PageContainer } from '@ant-design/pro-layout'; import { MenuFoldOutlined } from '@ant-design/icons'; -import {fmoney, getServerpartTree} from '@/services/options'; +import { fmoney, getServerpartTree } from '@/services/options'; import { contractType } from '@/pages/contract/emun'; import { connect, history } from 'umi'; import { useEffect, useRef, useState } from 'react'; @@ -31,35 +31,35 @@ import type { RevenueConfirmModel, RevenueConfirmParams } from './data'; import type { BusinessProjectModel } from '@/pages/BussinessProject/data'; import { getRevenueConfirmList } from './service'; -import {printContract,handlePrint} from "@/utils/utils"; +import { printContract, handlePrint } from "@/utils/utils"; import { getProjectDetail } from '@/pages/BussinessProject/service'; import { exportExcel, printOutBody } from '@/utils/utils'; import RevenueList from '@/pages/BussinessProject/components/RevenueList'; import '@/pages/merchantManagement/style.less'; import session from "@/utils/session"; -import {getDetail} from "@/pages/basicManage/Serverpart/service"; +import { getDetail } from "@/pages/basicManage/Serverpart/service"; import PageTitleBox from '@/components/PageTitleBox'; const { Text } = Typography; // 标题金额拆分小数点前后显示大小 const amountDom = (value: any) => { - const stringValue = `${value}` - const [intValue, floatValue] = stringValue.split(".") - return floatValue ? - <>{numeral(intValue || 0).format("0,0")}.{floatValue} - - : - <>{intValue} + const stringValue = `${value}` + const [intValue, floatValue] = stringValue.split(".") + return floatValue ? + <>{numeral(intValue || 0).format("0,0")}.{floatValue} + + : + <>{intValue} } /** @@ -68,551 +68,553 @@ const amountDom = (value: any) => { * @return { React.FC } 页面主体 */ const ShareBenefit: React.FC<{ currentUser?: CurrentUser }> = (props) => { - const { currentUser } = props - const actionRef = useRef() // 表格对应的对象 - const [showDetail, setShowDetail] = useState(false) // 是否显示详情 - const [currentRow, setCurrentRow] = useState(undefined) // 选中的当前行 - const [selectShops, setSelectShops] = useState() // 选中的数量 - const [curProject, setProject] = useState(undefined) // 选中的当前行 - const [printOut, setPrintOut] = useState(); // 打印数据的内容 - const [currentServiceName,setServiceName] = useState();// 拿到服务区的名字还为截取 - // 树相关的属性和方法 - const [currenMenu, setCurrenMenu] = useState(); // 当前选中的左侧菜单 - const [selectedId, setSelectedId] = useState([]) - const [collapsible, setCollapsible] = useState(false) - // 选中的服务区名称 - const [serviceName,setSelectServiceName] = useState() - // 加载服务区树 - const { loading: treeLoading, data: treeView = [] } = useRequest(() => { return getServerpartTree(currentUser?.ProvinceCode) }) - // 表格数据 - const [tableData,setTableData] = useState()// 表格数据 + const { currentUser } = props + const actionRef = useRef() // 表格对应的对象 + const [showDetail, setShowDetail] = useState(false) // 是否显示详情 + const [currentRow, setCurrentRow] = useState(undefined) // 选中的当前行 + const [selectShops, setSelectShops] = useState() // 选中的数量 + const [curProject, setProject] = useState(undefined) // 选中的当前行 + const [printOut, setPrintOut] = useState(); // 打印数据的内容 + const [currentServiceName, setServiceName] = useState();// 拿到服务区的名字还为截取 + // 树相关的属性和方法 + const [currenMenu, setCurrenMenu] = useState(); // 当前选中的左侧菜单 + const [selectedId, setSelectedId] = useState([]) + const [collapsible, setCollapsible] = useState(false) + // 选中的服务区名称 + const [serviceName, setSelectServiceName] = useState() + // 加载服务区树 + const { loading: treeLoading, data: treeView = [] } = useRequest(() => { return getServerpartTree(currentUser?.ProvinceCode) }) + // 表格数据 + const [tableData, setTableData] = useState()// 表格数据 // 根据左侧选中的菜单加载右侧数据 - const loadSelectedId = async (item?: any) => { - setSelectedId(item.selectedKeys || []) // 选中的子菜单key - const [type, value] = item.key.split('-') - if (type === '1' && item.keyPath) { - const newCurrentMenu = item.keyPath[0].split('-').length > 1 ? item.keyPath[0].split('-')[1] : item.keyPath[0] - setCurrenMenu(newCurrentMenu) - const service = await getDetail(newCurrentMenu); - setServiceName(service.SERVERPART_NAME) - } - else { - const newCurrentMenu = value - // 父级菜单新老相等 并且触发点击为 点击父级菜单 - if (newCurrentMenu === currenMenu && type === '0') { - return - } - setCurrenMenu(newCurrentMenu) - - } - actionRef?.current?.reload() + const loadSelectedId = async (item?: any) => { + setSelectedId(item.selectedKeys || []) // 选中的子菜单key + const [type, value] = item.key.split('-') + if (type === '1' && item.keyPath) { + const newCurrentMenu = item.keyPath[0].split('-').length > 1 ? item.keyPath[0].split('-')[1] : item.keyPath[0] + setCurrenMenu(newCurrentMenu) + const service = await getDetail(newCurrentMenu); + setServiceName(service.SERVERPART_NAME) } - // 生成左侧菜单 - const getMenuDom = (data: any[], callback: (item: any) => void) => { - return (data.map((element: any) => { - if (element.children && element.children.length > 0) { - return ( - : null} - key={`${element.key || element.value}`} - onTitleClick={(item) => { - // 选中一级菜单 - if (!currenMenu || item.key !== `${currenMenu?.key}`) { - callback.call(callback, item) - } - item.domEvent.stopPropagation(); - }} - > - {element.children && element.children.length > 0 && getMenuDom(element.children, callback)} - - ) - } - return ( : null} - key={`${element.key || element.value}`}>{element.label}) - })) + else { + const newCurrentMenu = value + // 父级菜单新老相等 并且触发点击为 点击父级菜单 + if (newCurrentMenu === currenMenu && type === '0') { + return + } + setCurrenMenu(newCurrentMenu) + } + actionRef?.current?.reload() + } + // 生成左侧菜单 + const getMenuDom = (data: any[], callback: (item: any) => void) => { + return (data.map((element: any) => { + if (element.children && element.children.length > 0) { + return ( + : null} + key={`${element.key || element.value}`} + onTitleClick={(item) => { + // 选中一级菜单 + if (!currenMenu || item.key !== `${currenMenu?.key}`) { + callback.call(callback, item) + } + item.domEvent.stopPropagation(); + }} + > + {element.children && element.children.length > 0 && getMenuDom(element.children, callback)} + + ) + } + return ( : null} + key={`${element.key || element.value}`}>{element.label}) + })) + } - const revenuenColumns: ProColumns[] = [ - { - title: '合作单位', - dataIndex: 'MERCHANTS_NAME', - align: 'center', - hideInSearch: true, + const revenuenColumns: ProColumns[] = [ + { + title: '合作单位', + dataIndex: 'MERCHANTS_NAME', + align: 'center', + hideInSearch: true, + }, + { + title: '统计时间', + dataIndex: 'search_date', + valueType: 'dateRange', + hideInTable: true, + colSize: 2, + initialValue: [moment().add(-1, 'day').format('YYYY-01-01'), moment().add(-1, 'day').format('YYYY-MM-DD')], + search: { + transform: (value) => { + return { + StartDate: value[0], + EndDate: value[1], + }; }, - { - title: '统计时间', - dataIndex: 'search_date', - valueType: 'dateRange', - hideInTable: true, - colSize: 2, - initialValue: [moment().add(-1, 'day').format('YYYY-01-01'), moment().add(-1, 'day').format('YYYY-MM-DD')], - search: { - transform: (value) => { - return { - StartDate: value[0], - EndDate: value[1], - }; - }, - }, - }, - { - title: '开始日期', - dataIndex: 'BUSINESS_STARTDATE', - valueType: "date", - width: 110, - align: 'center', - hideInSearch: true, - }, - { - title: '结束日期', - dataIndex: 'BUSINESS_ENDDATE', - valueType: "date", - width: 110, - align: 'center', - hideInSearch: true, - }, - { - title: '经营模式', - dataIndex: 'BUSINESS_TYPE', - valueType: 'select', - valueEnum: contractType, - width: 110, - align: "center", - hideInTable: true, - initialValue: '1000' - }, - { - title: '营业额', - dataIndex: 'ACTUAL_REVENUE', - valueType: "money", - width: 140, - align: "center", - hideInSearch: true, - render: (_, record) => { - return { - console.log('record',record) - // 查询经营项目信息详情 - const project = await getProjectDetail(record.BUSINESSPROJECT_ID); - // 点击实际营业额时 打开抽屉 展示每日营收数据 - setCurrentRow(record) - setProject(project) - setShowDetail(true) - }}>{record.ACTUAL_REVENUE?fmoney(record.ACTUAL_REVENUE,2):''} - }, - }, - { - title: '提成', - dataIndex: 'GUARANTEERATIO', - valueType: 'digit', - align: "center", - width: 110, - hideInSearch: true, - render: (_, record) => { - return `${record.GUARANTEERATIO}%` - }, - }, - { - title: '提成额', - dataIndex: 'PARTYA_SHAREPROFIT', - valueType: "money", - align: "center", - width: 140, - hideInSearch: true - }, - { - title: '保证租金', - dataIndex: 'GUARANTEE_AMOUNT', - valueType: "money", - width: 140, - align: "center", - hideInSearch: true - }, - { - title: '备注说明', - dataIndex: 'REVENUECONFIRM_DESC', - hideInSearch: true, - render: () => { - return '' - }, - } - ] + }, + }, + { + title: '开始日期', + dataIndex: 'BUSINESS_STARTDATE', + valueType: "date", + width: 110, + align: 'center', + hideInSearch: true, + }, + { + title: '结束日期', + dataIndex: 'BUSINESS_ENDDATE', + valueType: "date", + width: 110, + align: 'center', + hideInSearch: true, + }, + { + title: '经营模式', + dataIndex: 'BUSINESS_TYPE', + valueType: 'select', + valueEnum: contractType, + width: 110, + align: "center", + hideInTable: true, + initialValue: '1000' + }, + { + title: '营业额', + dataIndex: 'ACTUAL_REVENUE', + valueType: "money", + width: 140, + align: "center", + hideInSearch: true, + render: (_, record) => { + return { + // 查询经营项目信息详情 + // const project = await getProjectDetail(record.BUSINESSPROJECT_ID); + getProjectDetail(record.BUSINESSPROJECT_ID).then((project) => { + setProject({ ...project, BUSINESSPROJECT_ID: project.BUSINESSPROJECT_ID }) + }) - return ( -
{ - // 打印报表 - setPrintOut(el); - }}> - {record.ACTUAL_REVENUE ? fmoney(record.ACTUAL_REVENUE, 2) : ''} + }, + }, + { + title: '提成', + dataIndex: 'GUARANTEERATIO', + valueType: 'digit', + align: "center", + width: 110, + hideInSearch: true, + render: (_, record) => { + return `${record.GUARANTEERATIO}%` + }, + }, + { + title: '提成额', + dataIndex: 'PARTYA_SHAREPROFIT', + valueType: "money", + align: "center", + width: 140, + hideInSearch: true + }, + { + title: '保证租金', + dataIndex: 'GUARANTEE_AMOUNT', + valueType: "money", + width: 140, + align: "center", + hideInSearch: true + }, + { + title: '备注说明', + dataIndex: 'REVENUECONFIRM_DESC', + hideInSearch: true, + render: () => { + return '' + }, + } + ] + + return ( +
{ + // 打印报表 + setPrintOut(el); + }}> + - - { setCollapsible(!collapsible) }} />} - colSpan={!collapsible ? "300px" : "60px"} - title={!collapsible ? "请选择服务区" : ""} - headerBordered - collapsed={collapsible} - > - {!treeLoading && { - // 拿到选择的服务区名称给导出的文件赋值 - if (treeView && treeView.length>0){ - treeView.forEach((i: any)=>{ - if (i.children && i.children.length>0){ - i.children.forEach((subItem: any)=>{ - if (subItem.key===item.key){ - setSelectServiceName(subItem.label) - } - }) - } - }) - } - loadSelectedId(item) - }} - > - {getMenuDom(treeView, loadSelectedId)} - } - - - - cardProps={{ // 去除表格内边距 - bodyStyle: { padding: 24 } - }} - bordered={true} - rowKey="REVENUECONFIRM_ID" - headerTitle={} - actionRef={actionRef} - search={{ span: 6, labelWidth: 'auto' }} - // manualRequest={true} // 是否需要手动触发首次请求, 配置为 true 时不可隐藏搜索表单 - request={async (pramas, sorter) => { - const sortstr = Object.keys(sorter).map(n => { - const value = sorter[n] - return value ? `${n} ${value.replace('end', '')}` : '' - }) - - const data = await getRevenueConfirmList({ - ServerpartId: selectedId && selectedId.length > 0 ? selectedId[0].split('-')[1] : currenMenu || '0', - StartDate: pramas.StartDate || '', - EndDate: pramas.EndDate || '', - sortstr: sortstr.toString() - } as RevenueConfirmParams - ) - setTableData(data.data) - return { - ...data, data: data.data.map((n: RevenueConfirmModel) => { - return { ...n, shopids: n.SERVERPARTSHOP_ID ? n.SERVERPARTSHOP_ID.split(',') : [] } - }) - } - }} - options={false} - columns={revenuenColumns} - pagination={false} - rowSelection={{ - onChange:(selectedRowKeys, selectedRows)=>{ - setSelectShops(selectedRows) - } - }} - toolbar={{ - actions:[ - // react打印插件 - ( - - )} - // 点击触发的事件 - content={() => { - // printOut是整个页面的dom 一般情况都是有的 - if (printOut){ - // 标题 先找到标题的dom元素 - const title = document.createElement('p') - // 设置标题dom元素的内容 - title.innerHTML = `${currentServiceName}合作单位保底提成结算表` - // 给标题dom设置样式 - title.setAttribute('style','font-size:20px;font-weight:600;display:flex;width:100%;justify-content: center;') - - // 日期时间 timeUnit为父节点 time和date为子节点 显示打印内容标题下面 表格上面的那一块区域 - const timeUnit = document.createElement('div') - const time = document.createElement('div') - const date = document.createElement('div') - // 时间显示的内容 - time.innerHTML = `日期: ${moment().format('YYYY年MM月DD日')}` - date.innerHTML = `单位: 元` - // 加入到父节点中去 - timeUnit.appendChild(time) - timeUnit.appendChild(date) - // 样式 - timeUnit.setAttribute('style','width:100%;display:flex;justify-content: space-between;margin-bottom:15px;') - - // 数据内容 打印的表格dom - // 表格的dom元素 - const dataList = document.getElementsByClassName('ant-table-content') - // 克隆出来不影响原页面 - const domNoChange = dataList[0].cloneNode(true) - // 拿到是不是有已经被选中的行 - const length = selectShops?selectShops.length:false - if (length){ - // 拿到表头的dom - const tableHeader = domNoChange.getElementsByClassName('ant-table-thead') - // 表头增加样式 - tableHeader[0].setAttribute('style','width:100%;background: #fafafa;') - // 拿到每一列的标题 - const th = tableHeader[0].getElementsByTagName("th"); - // 由于页面的表头和效果图要的不一样 所以就自定义一个效果图上要的表头数组 - // 由于这个页面莫名其妙在每行的后面都有一个空节点,所以最后给他赋值个空的 - const titleText = ['合作单位','结算起止时间','营业额','提成标准','提成额','保证租金','备注说明',''] - const headList: { innerHTML: string; }[] = [] - // th的第一个节点删除是因为要把选择框的节点去掉 打印不能有选择框出现 - th.forEach((item: { innerHTML: string; }, index: string | number)=>{ - if(index===0){ - item.remove() - } else if(index<=7 && index!==0){ - // 页面需要的节点 给他赋值上需要的标题 然后添加到一个数组里面 - item.innerHTML = titleText[index] - headList.push(item) - } - }) - // 不让标题内容换行 minWidth无法适配 只能不换行来满足需求 - th.forEach((item: { innerHTML: string; }, index: string | number)=>{ - // 因为最后一个节点还是空节点所以不让最后一个不换行 其实问题也不大 - if (index !== th.length-1 ){ - item.style.whiteSpace = 'nowrap' - } - }) - // 表单打印的数据内容 - // 表单的数据节点 - const tableBody = domNoChange.getElementsByClassName('ant-table-tbody') - // 每一行数据 - const tr = tableBody[0].getElementsByTagName('tr') - // 哪几行是没被选中的索引列表 - const numList: any[] = [] - // 遍历每一行数据 - tr.forEach((item: { getElementsByClassName: (arg0: string) => any; }, index: any)=>{ - // 拿到打钩的那个节点 如果这个节点下的checked节点为true那就是被选中了 false就是没选中 - const isChecked = item.getElementsByClassName('ant-checkbox-input') - // 没被选中的行数的索引被添加到数组中 - if (!isChecked[0].checked){ - numList.push(index) - } - }) - // 倒序的for循环 正序的话当一个节点删除时 下一个节点会到刚刚删除的节点位置 无法参与判断 - // 如果是没选中的节点就直接移除掉 留下来的节点都是选中的节点 - for(let i=tr.length - 1;i>=0;i-=1){ - numList.forEach(item=>{ - if (i === item){ - tr[i].remove() - } - }) - } - // 选中的节点继续遍历 - tr.forEach((item: { getElementsByClassName: (arg0: string) => any; }, index: any)=>{ - // 因为页面的dom元素和要求图的dom元素不一样 所以用list先存页面中的数据 - const list: any[] = [] - // 获得每一行的 每一列对应的节点 - const td = item.getElementsByTagName('td') - // 遍历一行的数据 - td.forEach((subItem: { innerHTML: any; },subIndex: number) =>{ - // 背景都变成白色 - subItem.style.backgroundColor = 'white' - // 因为td的第一项是选择框 所以不放进数据列表中 - if (subIndex>=1){ - list.push(subItem.innerHTML) - } - }) - // 把选择框的dom节点移除 - td[0].remove() - // 拼接数据 - td.forEach((subItem: { innerHTML: string; }, subIndex: number)=>{ - subItem.style.backgroundColor = 'white' - if (subIndex === 0){ - subItem.innerHTML = list[0] - subItem.style.whiteSpace = 'nowrap' - }else if (subIndex === 1){ - // 时间数据的拼接 - subItem.innerHTML = `${moment(list[1]).format('YYYY年MM月DD日')} - ${moment(list[2]).format('YYYY年MM月DD日')}` - subItem.style.whiteSpace = 'nowrap' - }else if (subIndex >1 && subIndex<=6){ - // 因为上面拼接了一个 所以索引加1 小于6 是因为 要求的数据只有七行 但是会有一个空节点 - subItem.innerHTML = list[subIndex + 1] - if (subIndex!==6){ - // 备注就让它可以换行 - subItem.style.whiteSpace = 'nowrap' - } - }else{ - subItem.style.backgroundColor = 'white' - } - }) - }) - }else{ - // 没有选中任何一行 就默认打印全部 - // 表头dom节点 逻辑和上面差不多 就是没有了是否选中的判断 - const tableHeader = domNoChange.getElementsByClassName('ant-table-thead') - const th = tableHeader[0].getElementsByTagName("th"); - const titleText = ['合作单位','结算起止时间','营业额','提成标准','提成额','保证租金','备注说明',''] - const headList: { innerHTML: string; }[] = [] - th[0].remove() - th.forEach((item: { innerHTML: string; }, index: string | number)=>{ - if (index !== th.length-1){ - item.style.whiteSpace = 'nowrap' - } - if(index<=7 && index>=0){ - item.innerHTML = titleText[index] - headList.push(item) - }else{ - item.style.maxWidth = '0px' - } - }) - // 数据内容 - const tableBody = domNoChange.getElementsByClassName('ant-table-tbody') - const tr = tableBody[0].getElementsByTagName('tr') - // 先遍历每一行的数据 拿到每一行中的数据 - tr.forEach((item: { getElementsByTagName: (arg0: string) => any; }, index: any)=>{ - const list: any[] = [] - const td = item.getElementsByTagName('td') - // 再对每一行的数据进行遍历 把原本的值先存一份 - td.forEach((subItem: { innerHTML: any; },subIndex: number) =>{ - if (subIndex>=1){ - list.push(subItem.innerHTML) - } - }) - td[0].remove() - td.forEach((subItem: { innerHTML: string; }, subIndex: number)=>{ - if (subIndex === 0){ - subItem.innerHTML = list[0] - subItem.style.whiteSpace = 'nowrap' - }else if (subIndex === 1){ - subItem.innerHTML = `${moment(list[1]).format('YYYY年MM月DD日')} - ${moment(list[2]).format('YYYY年MM月DD日')}` - subItem.style.whiteSpace = 'nowrap' - }else if (subIndex >1 && subIndex<=6){ - subItem.innerHTML = list[subIndex + 1] - if (subIndex!==6){ - subItem.style.whiteSpace = 'nowrap' - } - }else{ - item.setAttribute('style','width: 0%') - } - }) - }) - } - // 表单底部签字盖章数据 - // 创建一个父节点 下面三个子节点 然后flex布局变掉 加一个当前用户的名称就可以 - const currentUser = session.get('currentUser'); - const signAndSeal = document.createElement('div') - signAndSeal.setAttribute('style','width:100%;display:flex;align-item:center;justify-content: space-between;margin-top:20px') - const serviceSeal = document.createElement('div') - const companySeal = document.createElement('div') - const makeExcel = document.createElement('div') - serviceSeal.innerHTML = '服务区 (签字盖章) :' - companySeal.innerHTML = '合作单位 (签字盖章) :' - makeExcel.innerHTML = `制表人 : ${currentUser.Name}` - makeExcel.setAttribute('style','text-align:right') - signAndSeal.appendChild(serviceSeal) - signAndSeal.appendChild(companySeal) - signAndSeal.appendChild(makeExcel) - // printContract方法也就是把第一个形参数组里面的每一项拼到一个父节点的里面 然后return出来 - const ele = printContract( [title || '',timeUnit || '',domNoChange || '',signAndSeal || ''], ''); - // content方法中return出来的值 就会自动调起ReactToPrint依赖 然后根据ele来打印 - return ele - } - // 拿不到整个页面dom就输出空 但是一般不会拿不到 - return '' - }} - />, - - // ( - // - // )} - // content={() => { - // // printOut是整个页面的dom 一般情况都是有的 - // if (printOut){ - // const ele = handlePrint(printOut) - // return ele - // } - // return '' - // }} - // /> - ] - }} - /> - - - {/* 查看项目详情 右侧弹出的抽屉 */} - { // 关闭抽屉 设置抽屉状态为关闭 - setShowDetail(false); - setProject(undefined); - setCurrentRow(undefined); - }} - bodyStyle={{ backgroundColor: "#f9f9f9", padding: 0 }} - closable={false} + + { setCollapsible(!collapsible) }} />} + colSpan={!collapsible ? "300px" : "60px"} + title={!collapsible ? "请选择服务区" : ""} + headerBordered + collapsed={collapsible} > - {/* 抽屉打开时 加载项目详情组件 */} - {showDetail && } - - -
+ {!treeLoading && { + // 拿到选择的服务区名称给导出的文件赋值 + if (treeView && treeView.length > 0) { + treeView.forEach((i: any) => { + if (i.children && i.children.length > 0) { + i.children.forEach((subItem: any) => { + if (subItem.key === item.key) { + setSelectServiceName(subItem.label) + } + }) + } + }) + } + loadSelectedId(item) + }} + > + {getMenuDom(treeView, loadSelectedId)} + } + + + + cardProps={{ // 去除表格内边距 + bodyStyle: { padding: 24 } + }} + bordered={true} + rowKey="REVENUECONFIRM_ID" + headerTitle={} + actionRef={actionRef} + search={{ span: 6, labelWidth: 'auto' }} + // manualRequest={true} // 是否需要手动触发首次请求, 配置为 true 时不可隐藏搜索表单 + request={async (pramas, sorter) => { + const sortstr = Object.keys(sorter).map(n => { + const value = sorter[n] + return value ? `${n} ${value.replace('end', '')}` : '' + }) - ); + const data = await getRevenueConfirmList({ + ServerpartId: selectedId && selectedId.length > 0 ? selectedId[0].split('-')[1] : currenMenu || '0', + StartDate: pramas.StartDate || '', + EndDate: pramas.EndDate || '', + sortstr: sortstr.toString() + } as RevenueConfirmParams + ) + setTableData(data.data) + return { + ...data, data: data.data.map((n: RevenueConfirmModel) => { + return { ...n, shopids: n.SERVERPARTSHOP_ID ? n.SERVERPARTSHOP_ID.split(',') : [] } + }) + } + }} + options={false} + columns={revenuenColumns} + pagination={false} + rowSelection={{ + onChange: (selectedRowKeys, selectedRows) => { + setSelectShops(selectedRows) + } + }} + toolbar={{ + actions: [ + // react打印插件 + ( + + )} + // 点击触发的事件 + content={() => { + // printOut是整个页面的dom 一般情况都是有的 + if (printOut) { + // 标题 先找到标题的dom元素 + const title = document.createElement('p') + // 设置标题dom元素的内容 + title.innerHTML = `${currentServiceName}合作单位保底提成结算表` + // 给标题dom设置样式 + title.setAttribute('style', 'font-size:20px;font-weight:600;display:flex;width:100%;justify-content: center;') + + // 日期时间 timeUnit为父节点 time和date为子节点 显示打印内容标题下面 表格上面的那一块区域 + const timeUnit = document.createElement('div') + const time = document.createElement('div') + const date = document.createElement('div') + // 时间显示的内容 + time.innerHTML = `日期: ${moment().format('YYYY年MM月DD日')}` + date.innerHTML = `单位: 元` + // 加入到父节点中去 + timeUnit.appendChild(time) + timeUnit.appendChild(date) + // 样式 + timeUnit.setAttribute('style', 'width:100%;display:flex;justify-content: space-between;margin-bottom:15px;') + + // 数据内容 打印的表格dom + // 表格的dom元素 + const dataList = document.getElementsByClassName('ant-table-content') + // 克隆出来不影响原页面 + const domNoChange = dataList[0].cloneNode(true) + // 拿到是不是有已经被选中的行 + const length = selectShops ? selectShops.length : false + if (length) { + // 拿到表头的dom + const tableHeader = domNoChange.getElementsByClassName('ant-table-thead') + // 表头增加样式 + tableHeader[0].setAttribute('style', 'width:100%;background: #fafafa;') + // 拿到每一列的标题 + const th = tableHeader[0].getElementsByTagName("th"); + // 由于页面的表头和效果图要的不一样 所以就自定义一个效果图上要的表头数组 + // 由于这个页面莫名其妙在每行的后面都有一个空节点,所以最后给他赋值个空的 + const titleText = ['合作单位', '结算起止时间', '营业额', '提成标准', '提成额', '保证租金', '备注说明', ''] + const headList: { innerHTML: string; }[] = [] + // th的第一个节点删除是因为要把选择框的节点去掉 打印不能有选择框出现 + th.forEach((item: { innerHTML: string; }, index: string | number) => { + if (index === 0) { + item.remove() + } else if (index <= 7 && index !== 0) { + // 页面需要的节点 给他赋值上需要的标题 然后添加到一个数组里面 + item.innerHTML = titleText[index] + headList.push(item) + } + }) + // 不让标题内容换行 minWidth无法适配 只能不换行来满足需求 + th.forEach((item: { innerHTML: string; }, index: string | number) => { + // 因为最后一个节点还是空节点所以不让最后一个不换行 其实问题也不大 + if (index !== th.length - 1) { + item.style.whiteSpace = 'nowrap' + } + }) + // 表单打印的数据内容 + // 表单的数据节点 + const tableBody = domNoChange.getElementsByClassName('ant-table-tbody') + // 每一行数据 + const tr = tableBody[0].getElementsByTagName('tr') + // 哪几行是没被选中的索引列表 + const numList: any[] = [] + // 遍历每一行数据 + tr.forEach((item: { getElementsByClassName: (arg0: string) => any; }, index: any) => { + // 拿到打钩的那个节点 如果这个节点下的checked节点为true那就是被选中了 false就是没选中 + const isChecked = item.getElementsByClassName('ant-checkbox-input') + // 没被选中的行数的索引被添加到数组中 + if (!isChecked[0].checked) { + numList.push(index) + } + }) + // 倒序的for循环 正序的话当一个节点删除时 下一个节点会到刚刚删除的节点位置 无法参与判断 + // 如果是没选中的节点就直接移除掉 留下来的节点都是选中的节点 + for (let i = tr.length - 1; i >= 0; i -= 1) { + numList.forEach(item => { + if (i === item) { + tr[i].remove() + } + }) + } + // 选中的节点继续遍历 + tr.forEach((item: { getElementsByClassName: (arg0: string) => any; }, index: any) => { + // 因为页面的dom元素和要求图的dom元素不一样 所以用list先存页面中的数据 + const list: any[] = [] + // 获得每一行的 每一列对应的节点 + const td = item.getElementsByTagName('td') + // 遍历一行的数据 + td.forEach((subItem: { innerHTML: any; }, subIndex: number) => { + // 背景都变成白色 + subItem.style.backgroundColor = 'white' + // 因为td的第一项是选择框 所以不放进数据列表中 + if (subIndex >= 1) { + list.push(subItem.innerHTML) + } + }) + // 把选择框的dom节点移除 + td[0].remove() + // 拼接数据 + td.forEach((subItem: { innerHTML: string; }, subIndex: number) => { + subItem.style.backgroundColor = 'white' + if (subIndex === 0) { + subItem.innerHTML = list[0] + subItem.style.whiteSpace = 'nowrap' + } else if (subIndex === 1) { + // 时间数据的拼接 + subItem.innerHTML = `${moment(list[1]).format('YYYY年MM月DD日')} - ${moment(list[2]).format('YYYY年MM月DD日')}` + subItem.style.whiteSpace = 'nowrap' + } else if (subIndex > 1 && subIndex <= 6) { + // 因为上面拼接了一个 所以索引加1 小于6 是因为 要求的数据只有七行 但是会有一个空节点 + subItem.innerHTML = list[subIndex + 1] + if (subIndex !== 6) { + // 备注就让它可以换行 + subItem.style.whiteSpace = 'nowrap' + } + } else { + subItem.style.backgroundColor = 'white' + } + }) + }) + } else { + // 没有选中任何一行 就默认打印全部 + // 表头dom节点 逻辑和上面差不多 就是没有了是否选中的判断 + const tableHeader = domNoChange.getElementsByClassName('ant-table-thead') + const th = tableHeader[0].getElementsByTagName("th"); + const titleText = ['合作单位', '结算起止时间', '营业额', '提成标准', '提成额', '保证租金', '备注说明', ''] + const headList: { innerHTML: string; }[] = [] + th[0].remove() + th.forEach((item: { innerHTML: string; }, index: string | number) => { + if (index !== th.length - 1) { + item.style.whiteSpace = 'nowrap' + } + if (index <= 7 && index >= 0) { + item.innerHTML = titleText[index] + headList.push(item) + } else { + item.style.maxWidth = '0px' + } + }) + // 数据内容 + const tableBody = domNoChange.getElementsByClassName('ant-table-tbody') + const tr = tableBody[0].getElementsByTagName('tr') + // 先遍历每一行的数据 拿到每一行中的数据 + tr.forEach((item: { getElementsByTagName: (arg0: string) => any; }, index: any) => { + const list: any[] = [] + const td = item.getElementsByTagName('td') + // 再对每一行的数据进行遍历 把原本的值先存一份 + td.forEach((subItem: { innerHTML: any; }, subIndex: number) => { + if (subIndex >= 1) { + list.push(subItem.innerHTML) + } + }) + td[0].remove() + td.forEach((subItem: { innerHTML: string; }, subIndex: number) => { + if (subIndex === 0) { + subItem.innerHTML = list[0] + subItem.style.whiteSpace = 'nowrap' + } else if (subIndex === 1) { + subItem.innerHTML = `${moment(list[1]).format('YYYY年MM月DD日')} - ${moment(list[2]).format('YYYY年MM月DD日')}` + subItem.style.whiteSpace = 'nowrap' + } else if (subIndex > 1 && subIndex <= 6) { + subItem.innerHTML = list[subIndex + 1] + if (subIndex !== 6) { + subItem.style.whiteSpace = 'nowrap' + } + } else { + item.setAttribute('style', 'width: 0%') + } + }) + }) + } + // 表单底部签字盖章数据 + // 创建一个父节点 下面三个子节点 然后flex布局变掉 加一个当前用户的名称就可以 + const currentUser = session.get('currentUser'); + const signAndSeal = document.createElement('div') + signAndSeal.setAttribute('style', 'width:100%;display:flex;align-item:center;justify-content: space-between;margin-top:20px') + const serviceSeal = document.createElement('div') + const companySeal = document.createElement('div') + const makeExcel = document.createElement('div') + serviceSeal.innerHTML = '服务区 (签字盖章) :' + companySeal.innerHTML = '合作单位 (签字盖章) :' + makeExcel.innerHTML = `制表人 : ${currentUser.Name}` + makeExcel.setAttribute('style', 'text-align:right') + signAndSeal.appendChild(serviceSeal) + signAndSeal.appendChild(companySeal) + signAndSeal.appendChild(makeExcel) + // printContract方法也就是把第一个形参数组里面的每一项拼到一个父节点的里面 然后return出来 + const ele = printContract([title || '', timeUnit || '', domNoChange || '', signAndSeal || ''], ''); + // content方法中return出来的值 就会自动调起ReactToPrint依赖 然后根据ele来打印 + return ele + } + // 拿不到整个页面dom就输出空 但是一般不会拿不到 + return '' + }} + />, + + // ( + // + // )} + // content={() => { + // // printOut是整个页面的dom 一般情况都是有的 + // if (printOut){ + // const ele = handlePrint(printOut) + // return ele + // } + // return '' + // }} + // /> + ] + }} + /> + + + {/* 查看项目详情 右侧弹出的抽屉 */} + { // 关闭抽屉 设置抽屉状态为关闭 + setShowDetail(false); + setProject(undefined); + setCurrentRow(undefined); + }} + bodyStyle={{ backgroundColor: "#f9f9f9", padding: 0 }} + closable={false} + > + {/* 抽屉打开时 加载项目详情组件 */} + {showDetail && } + + +
+ + ); } export default ShareBenefit; diff --git a/src/pages/reports/Finance/TradeWarning/components/serviceAreaDetails.tsx b/src/pages/reports/Finance/TradeWarning/components/serviceAreaDetails.tsx index b9e33c2..9638efc 100644 --- a/src/pages/reports/Finance/TradeWarning/components/serviceAreaDetails.tsx +++ b/src/pages/reports/Finance/TradeWarning/components/serviceAreaDetails.tsx @@ -99,7 +99,7 @@ const serviceAreaDetails = ({ onRef, onShow, id, width, onClose }: DetailProps) if (element) { element.scrollIntoView({ behavior: 'auto', block: 'start' }); } - }; + }; // 在营项目列表的请求方法 const handleTableList = async (id: any, type?: number, shopList?: any) => { // 需要默认选中的门店数组 @@ -369,7 +369,7 @@ const serviceAreaDetails = ({ onRef, onShow, id, width, onClose }: DetailProps) 占地面积
-
{serviceDetail?.ServerpartInfo?.FLOORAREA ? fmoney(serviceDetail.ServerpartInfo.FLOORAREA, 2) : '-'}m²
+
{serviceDetail?.ServerpartInfo?.FLOORAREA ? fmoney(serviceDetail?.ServerpartInfo?.FLOORAREA, 2) : '-'}m²
@@ -377,7 +377,7 @@ const serviceAreaDetails = ({ onRef, onShow, id, width, onClose }: DetailProps) 停车场面积
-
{serviceDetail?.ServerpartInfo?.SHAREAREA ? fmoney(serviceDetail.ServerpartInfo.SHAREAREA, 2) : '-'}m²
+
{serviceDetail?.ServerpartInfo?.SHAREAREA ? fmoney(serviceDetail?.ServerpartInfo?.SHAREAREA, 2) : '-'}m²
@@ -385,7 +385,7 @@ const serviceAreaDetails = ({ onRef, onShow, id, width, onClose }: DetailProps) 建筑面积
-
{serviceDetail?.ServerpartInfo?.SERVERPART_AREA ? fmoney(serviceDetail.ServerpartInfo.SERVERPART_AREA, 2) : '-'}m²
+
{serviceDetail?.ServerpartInfo?.SERVERPART_AREA ? fmoney(serviceDetail?.ServerpartInfo?.SERVERPART_AREA, 2) : '-'}m²
@@ -393,7 +393,7 @@ const serviceAreaDetails = ({ onRef, onShow, id, width, onClose }: DetailProps) 取水方式
-
{serviceDetail?.ServerpartInfo?.WATERINTAKE_TYPE === 1 ? '自来水' : serviceDetail.ServerpartInfo.WATERINTAKE_TYPE === 2 ? '井水' : ''}
+
{serviceDetail?.ServerpartInfo?.WATERINTAKE_TYPE === 1 ? '自来水' : serviceDetail?.ServerpartInfo?.WATERINTAKE_TYPE === 2 ? '井水' : ''}
@@ -401,7 +401,7 @@ const serviceAreaDetails = ({ onRef, onShow, id, width, onClose }: DetailProps) 污水处理
-
{serviceDetail?.ServerpartInfo?.SEWAGEDISPOSAL_TYPE === 1 ? '市政' : serviceDetail.ServerpartInfo?.SEWAGEDISPOSAL_TYPE === 2 ? '污水处理设备' : ''}
+
{serviceDetail?.ServerpartInfo?.SEWAGEDISPOSAL_TYPE === 1 ? '市政' : serviceDetail?.ServerpartInfo?.SEWAGEDISPOSAL_TYPE === 2 ? '污水处理设备' : ''}
@@ -409,7 +409,7 @@ const serviceAreaDetails = ({ onRef, onShow, id, width, onClose }: DetailProps) 市区县镇
-
{serviceDetail?.ServerpartInfo?.SERVERPART_ADDRESS ? serviceDetail.ServerpartInfo.SERVERPART_ADDRESS : ''}
+
{serviceDetail?.ServerpartInfo?.SERVERPART_ADDRESS ? serviceDetail?.ServerpartInfo?.SERVERPART_ADDRESS : ''}
@@ -417,7 +417,7 @@ const serviceAreaDetails = ({ onRef, onShow, id, width, onClose }: DetailProps) 管理单位
-
{serviceDetail?.ServerpartInfo?.MANAGERCOMPANY ? serviceDetail.ServerpartInfo.MANAGERCOMPANY : ''}
+
{serviceDetail?.ServerpartInfo?.MANAGERCOMPANY ? serviceDetail?.ServerpartInfo?.MANAGERCOMPANY : ''}
@@ -425,7 +425,7 @@ const serviceAreaDetails = ({ onRef, onShow, id, width, onClose }: DetailProps) 产权单位
-
{serviceDetail?.ServerpartInfo?.OWNEDCOMPANY ? serviceDetail.ServerpartInfo.OWNEDCOMPANY : ''}
+
{serviceDetail?.ServerpartInfo?.OWNEDCOMPANY ? serviceDetail?.ServerpartInfo?.OWNEDCOMPANY : ''}
: '' @@ -693,7 +693,7 @@ const serviceAreaDetails = ({ onRef, onShow, id, width, onClose }: DetailProps) } -
+
提成比例 diff --git a/src/pages/reports/audit/feedback/index.tsx b/src/pages/reports/audit/feedback/index.tsx index 2c1f8bf..904c105 100644 --- a/src/pages/reports/audit/feedback/index.tsx +++ b/src/pages/reports/audit/feedback/index.tsx @@ -1,25 +1,25 @@ -import {connect} from "umi"; -import type {CurrentUser} from "umi"; -import type {ConnectState} from "@/models/connect"; -import React, {useRef, useState} from "react"; +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 {Avatar, Button, Drawer, Menu, message, Space, Spin, Tree} from "antd"; +import { MenuFoldOutlined } from "@ant-design/icons"; +import type { FormInstance } from "antd"; +import { Avatar, Button, Drawer, Menu, message, Space, Spin, Tree } from "antd"; import useRequest from "@ahooksjs/use-request"; -import {getServerpartTree, handleCallLogs} from "@/services/options"; -import type {ActionType} from "@ant-design/pro-table"; +import { getServerpartTree, handleCallLogs } 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 SubMenu from "antd/lib/menu/SubMenu"; import moment from "moment/moment"; -import {handleGetCHECKACCOUNTList, handleUpLoadAuditExplain} from "@/pages/reports/audit/feedback/service"; +import { handleGetCHECKACCOUNTList, handleUpLoadAuditExplain } from "@/pages/reports/audit/feedback/service"; import AuditDetail from "@/pages/DataVerification/list/components/auditDetail"; import upload from '@/assets/upload.png' import PageTitleBox from "@/components/PageTitleBox"; -const checkAcount: React.FC<{ currentUser: CurrentUser}> = (props) => { +const checkAcount: React.FC<{ currentUser: CurrentUser }> = (props) => { const { currentUser } = props const downloadBtnRef = useRef() const actionRef = useRef(); @@ -27,24 +27,24 @@ const checkAcount: React.FC<{ currentUser: CurrentUser}> = (props) => { const [reqDetailList, setReqDetailList] = useState(); // 合计项数据源 const [printOut, setPrintOut] = useState(); // 打印数据的内容 const [collapsible, setCollapsible] = useState(false) - const [treeView,setTreeView] = useState() + const [treeView, setTreeView] = useState() // 加载服务区树 const { loading: treeLoading, data: treeViews } = useRequest(async () => { const data = await getServerpartTree(currentUser?.ProvinceCode, currentUser?.CityAuthority, true, true, true) setTreeView(data) return data }) -// 树相关的属性和方法 + // 树相关的属性和方法 const [selectedId, setSelectedId] = useState() -// 导出的加载效果 - const [showLoading,setShowLoading] = useState(false) + // 导出的加载效果 + const [showLoading, setShowLoading] = useState(false) // 是否显示打印的表格 - const [showExportTable,setShowExportTable] = useState(false) + const [showExportTable, setShowExportTable] = useState(false) const [currenMenu, setCurrenMenu] = useState(); // 当前选中左侧菜单的服务区节点 // 点击稽查反馈出现的弹框 - const [inspectionModal,setInspectionModal] = useState(false) + const [inspectionModal, setInspectionModal] = useState(false) const auditDetailRef = useRef() - const [currentRow,setCurrentRow] = useState() + const [currentRow, setCurrentRow] = useState() const columns: any = [ { @@ -53,9 +53,9 @@ const checkAcount: React.FC<{ currentUser: CurrentUser}> = (props) => { dataIndex: 'TREATMENT_MARKSTATE', valueType: 'select', valueEnum: { - 0:'全部', - 1:'未反馈', - 2:'未冲正' + 0: '全部', + 1: '未反馈', + 2: '未冲正' }, initialValue: '0' }, @@ -66,7 +66,7 @@ const checkAcount: React.FC<{ currentUser: CurrentUser}> = (props) => { hideInTable: true, hideInDescriptions: true, colSize: 1, - initialValue: [moment().add(-1, 'month').format('YYYY-MM-DD'), moment().add(-1,"day").format('YYYY-MM-DD')], + initialValue: [moment().add(-1, 'month').format('YYYY-MM-DD'), moment().add(-1, "day").format('YYYY-MM-DD')], search: { transform: (value) => { return { @@ -80,20 +80,20 @@ const checkAcount: React.FC<{ currentUser: CurrentUser}> = (props) => { } }, { - title:'稽查类型', + title: '稽查类型', hideInTable: true, - dataIndex:'CHECK_TYPE', + dataIndex: 'CHECK_TYPE', valueType: 'select', - valueEnum:{ - "":"全部", - "现场稽查":"现场稽查", - "区域稽查":"区域稽查", - "公司稽查":"公司稽查", + valueEnum: { + "": "全部", + "现场稽查": "现场稽查", + "区域稽查": "区域稽查", + "公司稽查": "公司稽查", }, initialValue: "" }, { - title:'图片上传', + title: '图片上传', hideInTable: true, hideInSearch: true, dataIndex: '' @@ -115,23 +115,25 @@ const checkAcount: React.FC<{ currentUser: CurrentUser}> = (props) => { dataIndex: 'HasImage', valueType: 'select', valueEnum: { - "0":'全部', + "0": '全部', "1": '支持', "2": '不支持' }, initialValue: "0" }, { - title:
{'序号'}
, + title:
{'序号'}
, hideInSearch: true, width: 70, + align: 'center', valueType: 'index', - dataIndex: '' + dataIndex: 'index' }, { - title:
{'服务区名称'}
, + title:
{'服务区名称'}
, hideInSearch: true, width: 120, + ellipsis: true, dataIndex: 'SERVERPART_NAME', // render:(_,record)=>{ // return
@@ -145,34 +147,34 @@ const checkAcount: React.FC<{ currentUser: CurrentUser}> = (props) => { // } }, { - title:
{'门店名称'}
, + title:
{'门店名称'}
, hideInSearch: true, ellipsis: true, width: 150, dataIndex: 'SHOPNAME', - render:(_,record)=>{ - return
+ render: (_, record) => { + return
{ record?.HasImage ? - - :'' + + : '' } - {record?.SHOPNAME ||''} + {record?.SHOPNAME || ''}
} }, { - title:
{'稽核反馈'}
, + title:
{'稽核反馈'}
, width: 200, ellipsis: true, hideInSearch: true, dataIndex: 'CHECKACCOUNT_DESC', - render:(_,record)=>{ - return { + render: (_, record) => { + return { setCurrentRow({ ...record, Audit_Id: record.CHECKACCOUNT_ID, - MachineCode:record.MACHINECODE + MachineCode: record.MACHINECODE }) setInspectionModal(true) }}> @@ -181,54 +183,54 @@ const checkAcount: React.FC<{ currentUser: CurrentUser}> = (props) => { } }, { - title:
{'稽核误差率'}
, + title:
{'稽核误差率'}
, width: 140, hideInSearch: true, align: 'right', dataIndex: 'ERROR_RATE', - render:(_,record)=>{ - return record?.ERROR_RATE? - {`${record?.ERROR_RATE}%`} - :'-' + render: (_, record) => { + return record?.ERROR_RATE ? + {`${record?.ERROR_RATE}%`} + : '-' } }, { - title:
{'长短款/冲正流水'}
, + title:
{'长短款/冲正流水'}
, width: 160, hideInSearch: true, align: 'right', dataIndex: 'DIFFERENT_PRICE', - render:(_,record)=>{ - return 0||record?.REPLENISH_AMOUNT>0?'#008000':'',fontWeight:'bold' }}> + render: (_, record) => { + return 0 || record?.REPLENISH_AMOUNT > 0 ? '#008000' : '', fontWeight: 'bold' }}> {`${record.DIFFERENT_PRICE || '0'}/${record?.REPLENISH_AMOUNT || '0'}`} } }, { - title:
{'稽核现金/对客现金'}
, + title:
{'稽核现金/对客现金'}
, width: 160, hideInSearch: true, dataIndex: 'CASH', align: 'right', - render:(_,record)=>{ + render: (_, record) => { return `${record.CASHPAY || ''}/${record?.CASH || ''}` } }, { - title:
{'对客营收'}
, + title:
{'对客营收'}
, width: 120, hideInSearch: true, align: 'right', dataIndex: 'TOTALSELLAMOUNT' }, { - title:
{'稽查时间'}
, + title:
{'稽查时间'}
, width: 160, hideInSearch: true, align: 'right', dataIndex: 'CHECK_ENDDATE', - render: (_,record)=>{ - return record?.CALIBRATOR_DATE?moment(record?.CHECK_ENDDATE).format('YYYY-MM-DD HH:mm:ss'):'-' + render: (_, record) => { + return record?.CALIBRATOR_DATE ? moment(record?.CHECK_ENDDATE).format('YYYY-MM-DD HH:mm:ss') : '-' } } ] @@ -255,7 +257,7 @@ const checkAcount: React.FC<{ currentUser: CurrentUser}> = (props) => { tempTable.remove() // 防止重复打印一个内容 } // 查询的条件 - const [searchParams,setSearchParams] = useState() + const [searchParams, setSearchParams] = useState() return (
{ @@ -287,13 +289,13 @@ const checkAcount: React.FC<{ currentUser: CurrentUser}> = (props) => { borderRadius: '8px', width: '200px' }}> - - 数据导出中... + + 数据导出中...
: '' } -
+
{ showExportTable && reqDetailList && reqDetailList.length > 0 ? = (props) => { /> : '' }
-
+
-
+
{ setCollapsible(!collapsible) - }}/>} + }} />} colSpan={!collapsible ? "300px" : "60px"} title={!collapsible ? "请选择服务区" : ""} headerBordered @@ -341,11 +343,11 @@ const checkAcount: React.FC<{ currentUser: CurrentUser}> = (props) => { // actionRef?.current?.reload() // getData(selectedIds.map(n => n?.value)?.toString() || '') }} - // switcherIcon={} + // switcherIcon={} /> : ''}
= (props) => { columns={columns} bordered headerTitle={} - search={{span: 6}} - request={async(params)=>{ - if (!selectedId){ + search={{ span: 6 }} + request={async (params) => { + if (!selectedId) { return } const req = { - SearchParameter:{ + SearchParameter: { ...params, - TREATMENT_MARKSTATE:params.TREATMENT_MARKSTATE==='0'?'':params.TREATMENT_MARKSTATE, + TREATMENT_MARKSTATE: params.TREATMENT_MARKSTATE === '0' ? '' : params.TREATMENT_MARKSTATE, SERVERPART_IDS: selectedId, - HasImage: params.HasImage==='0'?null:params.HasImage==='1'?true:params.HasImage==='2'?false:'', - VALID:1 ,// 有效 + HasImage: params.HasImage === '0' ? null : params.HasImage === '1' ? true : params.HasImage === '2' ? false : '', + VALID: 1,// 有效 }, - PageIndex:1, - PageSize:99999 + PageIndex: 1, + PageSize: 99999 } handleCallLogs() setSearchParams(params) const data = await handleGetCHECKACCOUNTList(req) - if (data && data.length>0){ + if (data && data.length > 0) { setReqDetailList(data) - return {data,success: true} + return { data, success: true } } - return {data: [],success: true} + return { data: [], success: true } }} toolbar={{ actions: [ - + = (props) => { setInspectionModal(false); }} destroyOnClose={true} - footer={
+ footer={
-
} > - +
) } -export default connect(({user}: ConnectState) => ({ +export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser }))(checkAcount); diff --git a/src/pages/reports/productControl/commodityInfo/index.tsx b/src/pages/reports/productControl/commodityInfo/index.tsx index 69d0152..c14106a 100644 --- a/src/pages/reports/productControl/commodityInfo/index.tsx +++ b/src/pages/reports/productControl/commodityInfo/index.tsx @@ -110,17 +110,6 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => { }) const [customClassList, setCustomClassList] = useState() const columns: any = [ - { - title: '状态', - dataIndex: 'CommodityState', - hideInTable: true, - valueType: 'select', - valueEnum: { - 0: { text: '无效' }, - 1: { text: '有效' } - }, - initialValue: '1' - }, { title: '服务区', dataIndex: 'ServerpartID', @@ -152,6 +141,17 @@ const commodityInfo: React.FC<{ currentUser: CurrentUser }> = (props) => { filterOption: (input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), } }, + { + title: '状态', + dataIndex: 'CommodityState', + hideInTable: true, + valueType: 'select', + valueEnum: { + 0: { text: '无效' }, + 1: { text: '有效' } + }, + initialValue: '1' + }, { dataIndex: 'searchText', title: '查询内容', diff --git a/src/pages/reports/productControl/commoditySearch/index.tsx b/src/pages/reports/productControl/commoditySearch/index.tsx index c8acee3..045714f 100644 --- a/src/pages/reports/productControl/commoditySearch/index.tsx +++ b/src/pages/reports/productControl/commoditySearch/index.tsx @@ -104,17 +104,6 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => { }) const columns: any = [ - { - title: '状态', - dataIndex: 'COMMODITY_STATE', - hideInTable: true, - valueType: 'select', - valueEnum: { - 0: { text: '无效' }, - 1: { text: '有效' } - }, - initialValue: '1' - }, { title: '服务区', dataIndex: 'ServerpartID', @@ -131,11 +120,32 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => { filterOption: (input, option) => (option?.label ?? '').toLowerCase().includes(input.toLowerCase()), } }, + { + title: '状态', + dataIndex: 'COMMODITY_STATE', + hideInTable: true, + valueType: 'select', + valueEnum: { + 0: { text: '无效' }, + 1: { text: '有效' } + }, + initialValue: '1' + }, + { + dataIndex: 'searchText', + title: '查询内容', + hideInTable: true, + fieldProps: { + placeholder: "请输入商品名称/商品条码/商品类型" + } + }, + { title:
序号
, width: 70, dataIndex: 'index', hideInSearch: true, + align: 'center', valueType: 'index' }, { @@ -404,12 +414,14 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => { } const req: any = { SearchType: 3, - ProvinceCode: currentUser?.USER_PROVINCE, + ProvinceCode: currentUser?.ProvinceCode, CommodityTypeId: currenMenu === '999999' ? '' : currenMenu, CommodityState: params?.COMMODITY_STATE, ServerpartID: params?.ServerpartID, PageIndex: 1, - PageSize: 999999 + PageSize: 999999, + SearchKey: "COMMODITY_NAME,COMMODITY_BARCODE", + SearchValue: params?.searchText || "" // PageSize: 20 } handleCallLogs() @@ -868,7 +880,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => { { setCurrentRow(undefined) @@ -876,6 +888,7 @@ const commoditySearch: React.FC<{ currentUser: CurrentUser }> = (props) => { }} closable={false} destroyOnClose + bodyStyle={{ padding: "24px" }} > diff --git a/src/pages/reports/productControl/components/detail.tsx b/src/pages/reports/productControl/components/detail.tsx index 17215a8..8ea08c6 100644 --- a/src/pages/reports/productControl/components/detail.tsx +++ b/src/pages/reports/productControl/components/detail.tsx @@ -1,7 +1,7 @@ -import type { CurrentUser} from "umi"; -import {connect} from "umi"; -import type {ConnectState} from "@/models/connect"; -import {Col, Row} from "antd"; +import type { CurrentUser } from "umi"; +import { connect } from "umi"; +import type { ConnectState } from "@/models/connect"; +import { Col, Row } from "antd"; import ProForm, { ProFormDateTimePicker, ProFormDigit, ProFormSelect, @@ -9,35 +9,35 @@ import ProForm, { ProFormTextArea, ProFormTreeSelect } from "@ant-design/pro-form"; -import {getServerpartTree} from "@/services/options"; +import { getServerpartTree } from "@/services/options"; import moment from "moment/moment"; -import React, {useEffect, useRef, useState} from "react"; +import React, { useEffect, useRef, useState } from "react"; import './detail.less' -import {handleGetServerpartShopTrade} from "@/pages/reports/productControl/commodityInfo/service"; +import { handleGetServerpartShopTrade } from "@/pages/reports/productControl/commodityInfo/service"; -const detail = ({currentUser,treeView,currentRow,showHotKeyEdit,setGetNewHotKey}: {currentUser?: any,treeView?: any,currentRow: any,showHotKeyEdit?: boolean,setGetNewHotKey: any}) => { +const detail = ({ currentUser, treeView, currentRow, showHotKeyEdit, setGetNewHotKey }: { currentUser?: any, treeView?: any, currentRow: any, showHotKeyEdit?: boolean, setGetNewHotKey: any }) => { const modalFormRef = useRef(); - const [commodityList,setCommodityList] = useState([]) + const [commodityList, setCommodityList] = useState([]) - useEffect(()=>{ + useEffect(() => { handleGetCommodity() - },[currentRow]) - const handleGetCommodity = async (id: any)=>{ + }, [currentRow]) + const handleGetCommodity = async (id: any) => { const req: any = { ProvinceCode: currentUser?.USER_PROVINCE, ServerpartId: currentRow?.SERVERPART_ID } const data = await handleGetServerpartShopTrade(req) - console.log('data',data) + console.log('data', data) setCommodityList(data) } return ( -
+
商品基本信息
@@ -70,12 +70,12 @@ const detail = ({currentUser,treeView,currentRow,showHotKeyEdit,setGetNewHotKey} data.forEach((item: any) => { if (item.children && item.children.length > 0) { item.children.forEach((subItem: any) => { - list.push({label: subItem.label, value: subItem.value}) + list.push({ label: subItem.label, value: subItem.value }) }) } }) data.forEach((item: any) => { - list.push({label: item.label, value: item.value}) + list.push({ label: item.label, value: item.value }) }) } return list @@ -133,7 +133,7 @@ const detail = ({currentUser,treeView,currentRow,showHotKeyEdit,setGetNewHotKey} label="快捷键值" readonly={!showHotKeyEdit} fieldProps={{ - onChange:(e: any)=>{ + onChange: (e: any) => { setGetNewHotKey(e.target.value) } }} @@ -145,7 +145,7 @@ const detail = ({currentUser,treeView,currentRow,showHotKeyEdit,setGetNewHotKey} label="质量等级" readonly initialValue={1000} - options={[{label:'一等品',value:1000},{label:'二等品',value:2000},{label:'三等品',value:5000},{label:'优等品',value:3000},{label:'合格品',value:4000},]} + options={[{ label: '一等品', value: 1000 }, { label: '二等品', value: 2000 }, { label: '三等品', value: 5000 }, { label: '优等品', value: 3000 }, { label: '合格品', value: 4000 },]} /> @@ -179,9 +179,9 @@ const detail = ({currentUser,treeView,currentRow,showHotKeyEdit,setGetNewHotKey} -
- 商品说明: - {currentRow?.COMMODITY_DESC} +
+ 商品说明: + {currentRow?.COMMODITY_DESC}
{/* @@ -207,7 +207,7 @@ const detail = ({currentUser,treeView,currentRow,showHotKeyEdit,setGetNewHotKey} label="是否散装" readonly initialValue={0} - options={[{label:'是',value:1},{label:'否',value:0}]} + options={[{ label: '是', value: 1 }, { label: '否', value: 0 }]} /> @@ -216,7 +216,7 @@ const detail = ({currentUser,treeView,currentRow,showHotKeyEdit,setGetNewHotKey} label="称重方式" readonly initialValue={1} - options={[{label:'计价',value:1},{label:'散装称重',value:0}]} + options={[{ label: '计价', value: 1 }, { label: '散装称重', value: 0 }]} /> @@ -227,7 +227,7 @@ const detail = ({currentUser,treeView,currentRow,showHotKeyEdit,setGetNewHotKey} label="审核状态" readonly initialValue={1} - options={[{label:'有效',value:1},{label:'审核中',value:2},{label:'无效',value:0}]} + options={[{ label: '有效', value: 1 }, { label: '审核中', value: 2 }, { label: '无效', value: 0 }]} /> @@ -314,7 +314,7 @@ const detail = ({currentUser,treeView,currentRow,showHotKeyEdit,setGetNewHotKey} name="COMMODITY_FROZENCOUNT" label="采购状态" readonly - options={[{label:'允许',value:1000},{label:'禁止',value:2000}]} + options={[{ label: '允许', value: 1000 }, { label: '禁止', value: 2000 }]} /> @@ -322,6 +322,6 @@ const detail = ({currentUser,treeView,currentRow,showHotKeyEdit,setGetNewHotKey}
) } -export default connect(({user}: ConnectState) => ({ +export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser }))(detail); diff --git a/src/pages/reports/productControl/hotkeyset/index.tsx b/src/pages/reports/productControl/hotkeyset/index.tsx index 27c244f..7ef6d40 100644 --- a/src/pages/reports/productControl/hotkeyset/index.tsx +++ b/src/pages/reports/productControl/hotkeyset/index.tsx @@ -432,13 +432,14 @@ const hotkeyset: React.FC<{ currentUser: CurrentUser }> = (props) => {
{ setCurrentRow(undefined) setShowDetail(false) setShowHotKeyEdit(false) }} + bodyStyle={{ padding: '24px' }} closable={false} destroyOnClose footer={ diff --git a/src/pages/travelMember/ShoppingMallProductSearch/index.tsx b/src/pages/travelMember/ShoppingMallProductSearch/index.tsx index 438983e..d36a7b1 100644 --- a/src/pages/travelMember/ShoppingMallProductSearch/index.tsx +++ b/src/pages/travelMember/ShoppingMallProductSearch/index.tsx @@ -100,8 +100,14 @@ const ShoppingMallProductSearch: React.FC<{ currentUser: CurrentUser | undefined // 当前查询的文字 const [currentSearchText, setCurrentSearchText] = useState('') // 预览上传后的图片 - const handlePreview = async () => { - setFileList(fileList) + const handlePreview = async (type: number) => { + if (type === 1) { + setFileList(mainImgList) + } else if (type === 2) { + setFileList(headerImgList) + } else if (type === 3) { + setFileList(detailImgList) + } setImagePreviewVisible(true) }; const handleChangePreview = (val: any) => { @@ -689,6 +695,26 @@ const ShoppingMallProductSearch: React.FC<{ currentUser: CurrentUser | undefined pagination={{ defaultPageSize: 10 }} />
+ + {fileList && fileList.length > 0 &&
+ { + setImagePreviewVisible(vis) + } + + }}> + { + fileList.map((n) => + + ) + } + + +
} + + {/* 添加商品的悬浮框 */} { + handlePreview(1) + }, fileList: mainImgList, // 绑定 fileList customRequest: ({ file, onSuccess }) => { // 自定义上传,不实际发送请求 @@ -1372,7 +1400,9 @@ const ShoppingMallProductSearch: React.FC<{ currentUser: CurrentUser | undefined accept="image/*" fieldProps={{ beforeUpload, - onPreview: handlePreview, + onPreview: () => { + handlePreview(2) + }, fileList: headerImgList, // 绑定 fileList customRequest: ({ file, onSuccess }) => { // 自定义上传,不实际发送请求 @@ -1432,7 +1462,9 @@ const ShoppingMallProductSearch: React.FC<{ currentUser: CurrentUser | undefined accept="image/*" fieldProps={{ beforeUpload, - onPreview: handlePreview, + onPreview: () => { + handlePreview(3) + }, fileList: detailImgList, // 绑定 fileList customRequest: ({ file, onSuccess }) => { // 自定义上传,不实际发送请求 diff --git a/src/pages/travelMember/scenicSpotConfig/index.tsx b/src/pages/travelMember/scenicSpotConfig/index.tsx index b278b06..806adb6 100644 --- a/src/pages/travelMember/scenicSpotConfig/index.tsx +++ b/src/pages/travelMember/scenicSpotConfig/index.tsx @@ -552,6 +552,7 @@ const scenicSpotConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr // 编辑数据 newValue = { ...values, SCENICAREA_ID: currentRow.SCENICAREA_ID }; } + handleConfirmLoading(true) // 如果有开关,要把开关的代码写进去 await handleAddUpdate(newValue); diff --git a/src/versionEnv.ts b/src/versionEnv.ts index 44e0854..20eb4d1 100644 --- a/src/versionEnv.ts +++ b/src/versionEnv.ts @@ -1,4 +1,4 @@ // 由 scripts/writeVersion.js 自动生成 -export const VERSION = "4.5.51"; -export const GIT_HASH = "a4729f7"; -export const BUILD_TIME = "2025-09-08T03:14:16.308Z"; +export const VERSION = "4.5.53"; +export const GIT_HASH = "4073d23"; +export const BUILD_TIME = "2025-09-09T01:03:58.611Z";