From 16b1153c4c70e88134d644fa1c04236768274cba Mon Sep 17 00:00:00 2001 From: ylj20011123 Date: Fri, 25 Jul 2025 20:16:04 +0800 Subject: [PATCH] update --- config/routes.ts | 23 + src/layouts/BasicLayout.tsx | 2 + .../components/selectServiceShop.tsx | 162 +++++- .../CardCouponApplicRules/index.less | 2 +- .../CardCouponApplicRules/index.tsx | 73 ++- src/pages/contract/components/editor.tsx | 18 +- .../reports/ContractAbnormality/index.tsx | 351 +++++++++++++ .../reports/contractWarningQuery/index.tsx | 23 +- .../component/HistoricalProjects.tsx | 90 +++- .../component/YearExamineDetailTable.tsx | 12 +- .../component/afterSettlement.tsx | 8 +- .../component/yearExamineProcess.tsx | 112 ++-- src/pages/reports/settlementDetail/service.ts | 2 +- .../ActiveMemberStatistics.less | 443 ++++++++++++++++ .../ActiveMemberStatistics/index.tsx | 273 ++++++++++ .../BusinessActivityStatistics.less | 444 ++++++++++++++++ .../BusinessActivityStatistics/index.tsx | 477 ++++++++++++++++++ .../ConsumptionRecordSearch/index.tsx | 22 +- .../GrowthValueRecordSearch/index.tsx | 58 ++- .../travelMember/PointsRecordSearch/index.tsx | 58 ++- .../ProductListingManagement/index.tsx | 41 +- .../SummaryOfIntegralGrowthValue.less | 443 ++++++++++++++++ .../SummaryOfIntegralGrowthValue/index.tsx | 254 ++++++++++ src/pages/travelMember/memberInfor/index.tsx | 81 ++- src/pages/travelMember/service.ts | 43 +- 25 files changed, 3354 insertions(+), 161 deletions(-) create mode 100644 src/pages/reports/ContractAbnormality/index.tsx create mode 100644 src/pages/travelMember/ActiveMemberStatistics/ActiveMemberStatistics.less create mode 100644 src/pages/travelMember/ActiveMemberStatistics/index.tsx create mode 100644 src/pages/travelMember/BusinessActivityStatistics/BusinessActivityStatistics.less create mode 100644 src/pages/travelMember/BusinessActivityStatistics/index.tsx create mode 100644 src/pages/travelMember/SummaryOfIntegralGrowthValue/SummaryOfIntegralGrowthValue.less create mode 100644 src/pages/travelMember/SummaryOfIntegralGrowthValue/index.tsx diff --git a/config/routes.ts b/config/routes.ts index 62254d2..3988c40 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -263,6 +263,11 @@ export default [ name: 'reports/warningQueryContract', component: './reports/contractWarningQuery/index', }, + { + path: 'reports/ContractAbnormality', + name: 'reports/ContractAbnormality', + component: './reports/ContractAbnormality/index', + }, ], }, { @@ -1051,6 +1056,24 @@ export default [ name: 'SupplierOrderStatistics', component: './travelMember/SupplierOrderStatistics/index' }, + // 积分成长值汇总表 + { + path: 'SummaryOfIntegralGrowthValue', + name: 'SummaryOfIntegralGrowthValue', + component: './travelMember/SummaryOfIntegralGrowthValue/index' + }, + // 运营活动拉新统计 + { + path: 'BusinessActivityStatistics', + name: 'BusinessActivityStatistics', + component: './travelMember/BusinessActivityStatistics/index' + }, + // 活跃会员统计 + { + path: 'ActiveMemberStatistics', + name: 'ActiveMemberStatistics', + component: './travelMember/ActiveMemberStatistics/index' + }, ] diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index 514e8e2..f34eeec 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -751,6 +751,8 @@ const BasicLayout: React.FC = (props) => { // 经营业态 // const BusinessTradeIdsList = await getFieldEnumTree({ FieldExplainField: 'BusinessTradeIds' }).then(BusinessTradeIdsList => { + console.log('BusinessTradeIdsListBusinessTradeIdsListBusinessTradeIdsList', BusinessTradeIdsList); + const BusinessTradeIdsObj: any = {} const BusinessTradeIdsBigObj: any = {} if (BusinessTradeIdsList && BusinessTradeIdsList.length > 0) { diff --git a/src/pages/CardInformation/CardCouponApplicRules/components/selectServiceShop.tsx b/src/pages/CardInformation/CardCouponApplicRules/components/selectServiceShop.tsx index daf66f9..e8c4a26 100644 --- a/src/pages/CardInformation/CardCouponApplicRules/components/selectServiceShop.tsx +++ b/src/pages/CardInformation/CardCouponApplicRules/components/selectServiceShop.tsx @@ -1,16 +1,31 @@ import { connect } from "umi"; import type { ConnectState } from "@/models/connect"; import ProTable, { ActionType } from "@ant-design/pro-table"; -import { useRef } from "react"; -import { FormInstance } from "antd"; +import { useEffect, useRef, useState } from "react"; +import { FormInstance, Modal, Space } from "antd"; +import { handeGetSERVERPARTSHOPList } from "@/pages/travelMember/service"; +import session from "@/utils/session"; type DetailProps = { - + currentUser: any + showDetail: boolean + onCancel: any + onOk: any + currentRow?: any } -const SelectServiceShop = ({ }: DetailProps) => { +const SelectServiceShop = ({ currentUser, showDetail, onCancel, onOk, currentRow }: DetailProps) => { const actionRef = useRef(); const formRef = useRef(); + const currentPageDataRef = useRef([]); + + // 点击确认之后的加载效果 + const [modalLoading, setModalLoading] = useState(false) + const BusinessTradeIdsObj = session.get('BusinessTradeIdsObj') + const selectedRowMapRef = useRef(new Map()); + const [selectedRowKeys, setSelectedRowKeys] = useState([]); + const [selectedRows, setSelectedRows] = useState([]); + const columns: any = [ { title: '查询内容', @@ -32,15 +47,115 @@ const SelectServiceShop = ({ }: DetailProps) => { { title: "门店名称", width: 150, - dataIndex: "", + dataIndex: "SHOPNAME", + hideInSearch: true, + align: 'center', + ellipsis: true, + }, + { + title: "经营业态", + width: 150, + dataIndex: "BUSINESS_TRADE", + valueType: 'select', + valueEnum: BusinessTradeIdsObj, + hideInSearch: true, + align: 'center', + ellipsis: true, + }, + { + title: "服务区名称", + width: 150, + dataIndex: "SERVERPART_NAME", hideInSearch: true, align: 'center', ellipsis: true, } ] + const rowSelection = { + selectedRowKeys, + onChange: (keys: React.Key[], currentPageSelectedRows: any[]) => { + const keySet = new Set(keys.map(k => String(k))); + const map = selectedRowMapRef.current; + + // ✅ 当前页所有数据 + const currentPageRows = currentPageDataRef.current; + + // ✅ 1. 删除当前页中“之前被选中过但现在没选中”的项 + currentPageRows.forEach(row => { + const id = String(row.SERVERPARTSHOP_ID); + const wasSelected = map.has(id); + const isNowSelected = keySet.has(id); + if (wasSelected && !isNowSelected) { + map.delete(id); + } + }); + + // ✅ 2. 合并当前页选中的项(添加或覆盖) + currentPageSelectedRows.forEach(row => { + const id = String(row.SERVERPARTSHOP_ID); + map.set(id, row); + }); + + // ✅ 3. 同步最终状态 + const finalKeys = Array.from(map.keys()); + const finalRows = Array.from(map.values()); + setSelectedRowKeys(finalKeys); + setSelectedRows(finalRows); + }, + onSelectNone: () => { + selectedRowMapRef.current.clear(); + setSelectedRowKeys([]); + setSelectedRows([]); + } + }; + + useEffect(() => { + if (showDetail) { + let list: any = [] + let listKey: any = [] + if (currentRow?.ShopItemList && currentRow?.ShopItemList.length > 0) { + currentRow?.ShopItemList.forEach((item: any) => { + listKey.push(item.SERVERPARTSHOP_ID.toString()) + list.push(item) + }) + setSelectedRowKeys(listKey) + setSelectedRows(list) + } + } + + }, [showDetail]) + + return ( -
+ { + setModalLoading(false) + if (onCancel) { + onCancel() + } + }} + afterClose={() => { + setSelectedRowKeys([]) + setSelectedRows([]) + }} + destroyOnClose + confirmLoading={modalLoading} + width={1300} + bodyStyle={{ + height: '700px', // 你可以根据需要调整高度 + overflowY: 'auto', + }} + title={"选择门店"} + onOk={async () => { + if (onOk) { + await onOk(selectedRows) + setModalLoading(false) + } + }} + > { expandable={{ expandRowByClick: true }} - scroll={{ x: "100%", y: "calc(100vh - 410px)" }} + rowKey={(record) => String(record.SERVERPARTSHOP_ID)} + scroll={{ x: "100%", y: "400px" }} headerTitle={'选择门店'} // 列表表头 - search={{ span: 6 }} + search={{ span: 12 }} + rowSelection={rowSelection} request={async (params) => { + if (!currentUser?.ProvinceCode) { + return + } + const req: any = { + SearchParameter: { + PROVINCE_CODE: currentUser?.ProvinceCode, + ISVALID: 1 + }, + PageIndex: params?.current, + PageSize: params?.pageSize, + keyWord: { + Key: "SHOPNAME", + Value: params?.searchText + } + } + console.log('reqreqreq', req); + const data = await handeGetSERVERPARTSHOPList(req) + console.log('datadatadatadata', data); + if (data.List && data.List.length > 0) { + currentPageDataRef.current = data.List; + return { data: data.List, success: true, total: data.TotalCount } + } + return { data: [], success: true } + }} + pagination={{ + pageSize: 20 }} toolbar={{ actions: [ @@ -62,7 +205,8 @@ const SelectServiceShop = ({ }: DetailProps) => { }} /> -
+ + ) } diff --git a/src/pages/CardInformation/CardCouponApplicRules/index.less b/src/pages/CardInformation/CardCouponApplicRules/index.less index 6db8db9..46aebbb 100644 --- a/src/pages/CardInformation/CardCouponApplicRules/index.less +++ b/src/pages/CardInformation/CardCouponApplicRules/index.less @@ -8,7 +8,7 @@ flex-wrap: wrap; .shopItem { - width: 20%; + width: 30%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; diff --git a/src/pages/CardInformation/CardCouponApplicRules/index.tsx b/src/pages/CardInformation/CardCouponApplicRules/index.tsx index 5165500..1aaed14 100644 --- a/src/pages/CardInformation/CardCouponApplicRules/index.tsx +++ b/src/pages/CardInformation/CardCouponApplicRules/index.tsx @@ -20,6 +20,7 @@ import ProForm, { ProFormSelect, ProFormText } from "@ant-design/pro-form"; import './index.less' import { handleSetlogSave } from "@/utils/format"; import ModalFooter from "@/pages/travelMember/scenicSpotConfig/component/modalFooter"; +import SelectServiceShop from "./components/selectServiceShop"; const CardCouponApplicRules: React.FC<{ currentUser: CurrentUser }> = (props) => { @@ -49,6 +50,9 @@ const CardCouponApplicRules: React.FC<{ currentUser: CurrentUser }> = (props) => const [currentRow, setCurrentRow] = useState() // 悬浮框 按钮加载的属性 const [modalLoading, setModalLoading] = useState(false) + // 显示选择门店 + const [showSelectShopModal, setShowSelectShopModal] = useState(false) + const columns: any = [ // { @@ -153,6 +157,32 @@ const CardCouponApplicRules: React.FC<{ currentUser: CurrentUser }> = (props) => const handleSynchroCOOPSHOPRULE = async (res: any) => { let req: any = {} setModalLoading(true) + + let shopList: any = [] + if (currentRow?.ShopItemList && currentRow?.ShopItemList.length > 0) { + currentRow?.ShopItemList.forEach((item: any) => { + shopList.push({ + SERVERPARTSHOP_ID: item.SERVERPARTSHOP_ID, + SHOPCODE: item.SHOPCODE, + SHOPNAME: item.SHOPNAME, + SERVERPART_ID: item.SERVERPART_ID, + SERVERPART_CODE: "", + SERVERPART_NAME: item.SERVERPART_NAME, + PROVINCE_CODE: item.PROVINCE_CODE, + ISVALID: item.ISVALID, + CREATE_STAFF_ID: item.CREATE_STAFF_ID || currentUser?.ID, + CREATE_STAFF_NAME: item.CREATE_STAFF_NAME || currentUser?.Name, + CREATE_DATE: item.CREATE_DATE || moment().format('YYYY-MM-DD HH:mm:ss'), + UPDATE_STAFF_ID: currentUser?.ID, + UPDATE_STAFF_NAME: currentUser?.Name, + UPDATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), + }) + }) + } + + + + if (currentRow?.COOPSHOP_RULE_ID) { req = { ...currentRow, @@ -160,6 +190,7 @@ const CardCouponApplicRules: React.FC<{ currentUser: CurrentUser }> = (props) => UPDATE_STAFF_ID: currentUser?.ID, UPDATE_STAFF_NAME: currentUser?.Name, UPDATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), + ShopItemList: shopList } } else { req = { @@ -171,10 +202,14 @@ const CardCouponApplicRules: React.FC<{ currentUser: CurrentUser }> = (props) => PROVINCE_CODE: currentUser?.ProvinceCode, OWNERUNIT_ID: currentUser?.OwnerUnitId, OWNERUNIT_NAME: currentUser?.OwnerUnitName, - ISOFFLINE: res.ISOFFLINE + ISOFFLINE: res.ISOFFLINE, + ShopItemList: shopList } } + console.log('req', req); + + const data = await handleSynchroCOOPSHOP_RULE(req) console.log('datadatadatadatadata', data); setModalLoading(false) @@ -208,6 +243,30 @@ const CardCouponApplicRules: React.FC<{ currentUser: CurrentUser }> = (props) => } } + // 关闭选择门店的方法 + const handleOnCancel = () => { + setShowSelectShopModal(false) + } + // 确认触发的方法 + const handleConfirm = (data: any) => { + // data 带出来的是 选择的门店 + setShowSelectShopModal(false) + + console.log('datadatadatadatadatadata', data); + + let list: any = [] + if (data && data.length > 0) { + data.forEach((item: any) => { + list.push(item) + }) + } + setCurrentRow({ + ...currentRow, + ShopItemList: list + }) + } + + return (
{ // 打印报表 @@ -289,7 +348,7 @@ const CardCouponApplicRules: React.FC<{ currentUser: CurrentUser }> = (props) => destroyOnClose confirmLoading={modalLoading} // width={'70%'} - width={900} + width={1400} bodyStyle={{ height: '700px', // 你可以根据需要调整高度 overflowY: 'auto', @@ -432,15 +491,23 @@ const CardCouponApplicRules: React.FC<{ currentUser: CurrentUser }> = (props) =>
{ currentRow?.ShopItemList.map((item: any) => { - return
+ return
{`${item.SERVERPART_NAME} ${item.SHOPNAME}`}
}) }
: "" } + + + + {/* 选择门店的组件 */} + +
) } diff --git a/src/pages/contract/components/editor.tsx b/src/pages/contract/components/editor.tsx index 96946e6..e090514 100644 --- a/src/pages/contract/components/editor.tsx +++ b/src/pages/contract/components/editor.tsx @@ -526,8 +526,12 @@ const EditContract = ({ contractId: id, actionRef, setShowDetail, showDelete, cu newValue.FIRSTPART_ID = fields?.FIRSTPART_ID; newValue.SECONDPART_ID = fields?.SECONDPART_ID; } + let [COMPACT_STARTDATE, COMPACT_ENDDATE] = ["", ""] // 格式化数据 - const [COMPACT_STARTDATE, COMPACT_ENDDATE] = values.contractRangeDate + if (values.contractRangeDate) { + [COMPACT_STARTDATE, COMPACT_ENDDATE] = values.contractRangeDate + } + newValue.COMPACT_STARTDATE = COMPACT_STARTDATE newValue.COMPACT_ENDDATE = COMPACT_ENDDATE newValue.REPAIR_TIME = values.REPAIR_TIME ? values.REPAIR_TIME : null @@ -1003,12 +1007,12 @@ const EditContract = ({ contractId: id, actionRef, setShowDetail, showDelete, cu { if (dates && dates[0] && dates[1]) { diff --git a/src/pages/reports/ContractAbnormality/index.tsx b/src/pages/reports/ContractAbnormality/index.tsx new file mode 100644 index 0000000..0389fe3 --- /dev/null +++ b/src/pages/reports/ContractAbnormality/index.tsx @@ -0,0 +1,351 @@ +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, Drawer, message, Space, Spin, Tree } from "antd"; +import useRequest from "@ahooksjs/use-request"; +import { getFieldEnumTree, getServerpartTree } from "@/services/options"; +import type { ActionType, ProColumns } 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 { AccountReceivablesModel } from "@/pages/busniess/PaymentConfirm/data"; +import { getShopReceivablesList } from "@/pages/basicManage/ServerpartShop/service"; +import { ServerpartShopModel } from "@/pages/basicManage/ServerpartShop/data"; +import ContractEdit from "@/pages/contract/components/editor" +import { getDetail, getSubDetail } from "@/pages/contract/service"; +import ProjectEditor from '@/pages/BussinessProject/editor' + +const ContractAbnormality: 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 [modalVisible, handleModalVisible] = useState(false) // 是否显示编辑 + const [showProjectDetail, setProjectDetail] = useState() + + + // 树相关的属性和方法 + const [selectedId, setSelectedId] = useState() + // 导出的加载效果 + const [showLoading, setShowLoading] = useState(false) + // 是否显示打印的表格 + const [showExportTable, setShowExportTable] = useState(false) + // 查询的条件 + const [searchParams, setSearchParams] = useState() + const [currentRow, setCurrentRow] = useState() + const [showDetail, setShowDetail] = useState() + + const columns: ProColumns[] = [ + { + dataIndex: 'SERVERPART_NAME', + title: '服务区名称', + width: 200, + hideInSearch: true, + hideInDescriptions: true, + ellipsis: true, + }, + { + dataIndex: 'SERVERPARTSHOP_NAME', + title: '门店名称', + width: 200, + hideInSearch: true, + hideInDescriptions: true, + ellipsis: true, + }, + { + dataIndex: 'COMPACT_NAME', + title: '合同名称', + hideInSearch: true, + render: (_, record) => { + return { + setCurrentRow({ ...record }) + setShowDetail(true) + }}>{record?.COMPACT_NAME || '添加合同'} + }, + ellipsis: true, + }, + { + dataIndex: 'BUSINESSPROJECT_NAME', + title: '经营项目', + hideInSearch: true, + render: (_, record) => { + return { + setCurrentRow({ ...record }) + if (record?.REGISTERCOMPACT_ID && !record?.BUSINESSPROJECT_ID) { + const contractData = await getDetail(record?.REGISTERCOMPACT_ID) + const contractSubData = await getSubDetail(record?.REGISTERCOMPACT_ID) + if (contractData && contractSubData) { + setCurrentRow({ + ...currentRow, MERCHANTS_ID: contractData?.SECONDPART_ID, + REGISTERCOMPACT_ID: contractData?.REGISTERCOMPACT_ID, + SERVERPART_NAME: contractData?.SERVERPART_NAME, + GUARANTEE_PRICE: contractData?.COMPACT_AMOUNT, + PROJECT_DAYS: contractData?.DURATIONDAY, + projectRangeDate: [contractData?.COMPACT_STARTDATE, contractData?.COMPACT_ENDDATE], + COMPACT_NAME: contractData?.COMPACT_NAME, + BUSINESSPROJECT_NAME: contractData?.COMPACT_NAME, + MERCHANTS_NAME: contractData?.SECONDPART_NAME, + serverpartId: contractData?.SERVERPART_IDS, + SERVERPART_IDS: contractData?.SERVERPART_IDS ? contractData?.SERVERPART_IDS.split(',').map(Number) : [], + SETTLEMENT_CYCLE: contractSubData?.SETTLEMENT_CYCLE, + BUSINESS_TYPE: contractSubData?.BUSINESS_TYPE, + SETTLEMENT_MODES: contractSubData?.SETTLEMENT_MODES, + PROJECT_VALID: 1, + serverpartShopIds: [] + }) + } + handleModalVisible(true) + } + else { + setProjectDetail(true) + } + }} style={{ color: record?.ProjectWarning && record?.BUSINESSPROJECT_NAME ? 'red' : 'normal' }}> + {record?.REGISTERCOMPACT_ID && !record?.BUSINESSPROJECT_ID ? '添加项目' : record?.BUSINESSPROJECT_NAME} + + }, + ellipsis: true, + }, + { + dataIndex: 'THREEPART_NAME', + title: '丙方联系人', + align: 'center', + width: 90, + }, + { + title: '开始日期', + hideInSearch: true, + dataIndex: 'PROJECT_STARTDATE', + valueType: 'date', + sorter: true, + // defaultSortOrder: 'descend', + width: 120 + }, + { + title: '结束日期', + hideInSearch: true, + dataIndex: 'PROJECT_ENDDATE', + valueType: 'date', + sorter: true, + width: 120 + }, + { + dataIndex: 'BUSINESS_TYPE', + title: '经营模式', + valueType: 'select', + align: 'center', + width: 80, + request: async () => { + const options = await getFieldEnumTree({ FieldExplainField: 'BUSINESS_TYPE', sessionName: 'BUSINESS_TYPE' }) + console.log('options', options) + return options + } + }, + { + dataIndex: 'BUSINESS_STATE', + title: '经营状态', + valueType: 'select', + align: 'center', + width: 80, + hideInSearch: false, + valueEnum: { + 1000: { text: '运营中', status: 'processing' }, + 2000: { text: '已暂停', status: 'warning' }, + 3000: { text: '已关闭', status: 'error' }, + 1010: { text: '待运营', status: 'default' } + } + }, + { + dataIndex: 'COOPMERCHANTS_NAME', + title: '经营单位', + hideInSearch: true, + render: (_, record) => { + return {record?.COOPMERCHANTS_NAME} + }, + ellipsis: true, + } + ] + + const exportTable = (e) => { + e.stopPropagation(); // 防止Collapse组件收起 + const main = document.getElementsByClassName(`saleReportHideBox${printIndex}`)[0] + const thead = main.querySelector('thead').cloneNode(true); // 深克隆DOM节点 + const tbody = main.querySelector('tbody').cloneNode(true); // 深克隆DOM节点 + const container = document.querySelector('#hiddenBox'); + + const tempTable = document.createElement('table'); + tempTable.appendChild(thead); + tempTable.appendChild(tbody); + + tempTable.setAttribute('id', 'table-to-xls-ContractAbnormality'); // 给table添加id,值与按钮上的table字段对应 + + container.appendChild(tempTable); // 把创建的节点添加到页面容器中 + + setShowLoading(false) + + downloadBtnRef.current.handleDownload(); + setShowExportTable(false) + tempTable.remove() // 防止重复打印一个内容 + } + + + return ( +
{ + // 打印报表 + if (!reqDetailList || reqDetailList.length === 0) return; + setPrintOut(el); + }} > + + { + showLoading ? +
+
+ + 数据导出中... +
+
: '' + } + +
+ { + showExportTable && reqDetailList && reqDetailList.length > 0 ? + : '' + } +
+
+ +
+ +
+ } // 列表表头 + search={{ span: 6 }} + request={async (params) => { + if (!selectedId) { + return + } + + setSearchParams(params) + const data = await getShopReceivablesList({ + ...params, + ServerpartId: selectedId, BusinessType: params?.BUSINESS_TYPE, + BusinessState: params?.BUSINESS_STATE, + AbnormalShop: true + }) + return data + }} + toolbar={{ + actions: [ + // + // + // , + // + ] + }} + /> +
+
+ + { + setCurrentRow(undefined); + setShowDetail(false); + }} + title={currentRow?.CompactWarning ?
+ {!currentRow?.REGISTERCOMPACT_ID ? "新增合同" : currentRow?.COMPACT_NAME} +
: ''} + closable={false} + bodyStyle={{ backgroundColor: "#f9f9f9", padding: 0 }} + > + {/* 编辑/查看合同 */} + { + showDetail && currentRow !== undefined && + } +
+ + {/* 新增经营项目弹出框 */} + +
+ ) +} + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.currentUser +}))(ContractAbnormality); diff --git a/src/pages/reports/contractWarningQuery/index.tsx b/src/pages/reports/contractWarningQuery/index.tsx index 7bc1add..93b2465 100644 --- a/src/pages/reports/contractWarningQuery/index.tsx +++ b/src/pages/reports/contractWarningQuery/index.tsx @@ -324,6 +324,20 @@ const contractWarningQuery: React.FC<{ currentUser: CurrentUser }> = (props) => ellipsis: true, initialValue: "1000" }, + { + title: '合同异常', + dataIndex: 'AbnormalContract', + valueType: 'select', + align: 'center', + width: 130, + valueEnum: { + '0': { text: '正常', status: 'success' }, + '1': { text: '异常', status: 'error' } + }, + initialValue: "0", + ellipsis: true, + hideInTable: true + }, { title: '开始日期', hideInSearch: true, @@ -598,10 +612,11 @@ const contractWarningQuery: React.FC<{ currentUser: CurrentUser }> = (props) => const searchWholeParams = { searchParameter: { ...params, - COMPACT_STARTDATE: start, - COMPACT_ENDDATE: end, - Due_StartDate: start, - Due_EndDate: end, + COMPACT_STARTDATE: params?.AbnormalContract === '0' ? start : '', + COMPACT_ENDDATE: params?.AbnormalContract === '0' ? end : '', + Due_StartDate: params?.AbnormalContract === '0' ? start : '', + Due_EndDate: params?.AbnormalContract === '0' ? end : '', + AbnormalContract: params?.AbnormalContract === '0' ? false : true // COMPACT_TYPE: "340001", // COMPACT_DETAILS: "1000" }, diff --git a/src/pages/reports/settlementAccount/component/HistoricalProjects.tsx b/src/pages/reports/settlementAccount/component/HistoricalProjects.tsx index 046a83d..ce972f7 100644 --- a/src/pages/reports/settlementAccount/component/HistoricalProjects.tsx +++ b/src/pages/reports/settlementAccount/component/HistoricalProjects.tsx @@ -1,7 +1,7 @@ import { connect } from "umi"; import type { ConnectState } from "@/models/connect"; import ProTable, { ActionType } from "@ant-design/pro-table"; -import { useImperativeHandle, useRef, useState } from "react"; +import { useEffect, useImperativeHandle, useRef, useState } from "react"; import { Button, Col, Divider, FormInstance, Input, InputNumber, Modal, Row, Tooltip } from "antd"; import { handleGetProjectPeriodAccount } from "../../ShopExpenseDetail/service"; import { wrapTreeNode } from "@/utils/format"; @@ -10,12 +10,13 @@ import numeral from 'numeral' import { handleGetShopRoyaltyList } from "../../comparisonOfBusiness/service"; import moment from 'moment' import ProForm, { ProFormDigit } from "@ant-design/pro-form"; - +const { confirm } = Modal; type DetailProps = { parentRow?: any // 外面的一些行数据 onRef?: any // 实例 + pageType?: string // 判断是编辑还是查看 } -const HistoricalProjects = ({ parentRow, onRef }: DetailProps) => { +const HistoricalProjects = ({ parentRow, onRef, pageType }: DetailProps) => { const actionRef = useRef(); const formRef = useRef(); const modalFormRef = useRef(); @@ -47,6 +48,13 @@ const HistoricalProjects = ({ parentRow, onRef }: DetailProps) => { } }, + { + title:
期数
, + dataIndex: 'BUSSINESS_PERIOD', + align: 'center', + width: 100, + hideInSearch: true, + }, { title:
结算状态
, dataIndex: 'IsApplySuccess', @@ -61,28 +69,28 @@ const HistoricalProjects = ({ parentRow, onRef }: DetailProps) => { children: [ { title:
保底/固定租金
, - dataIndex: 'MinturnOver', + dataIndex: 'MINTURNOVER', valueType: 'digit', align: 'right', width: 130, hideInSearch: true, render: (_, record) => { const str: string = record?.Remark - return record?.MinturnOver ? + return record?.MINTURNOVER ? - {handleFormatNumber(record?.MinturnOver)} + {handleFormatNumber(record?.MINTURNOVER * 10000)} - : record?.MinturnOver === 0 ? '0.00' : '-' + : record?.MINTURNOVER === 0 ? '0.00' : '-' } }, { title:
提成比率
, - dataIndex: 'GuaranteeRatio', + dataIndex: 'GUARANTEERATIO', hideInSearch: true, align: 'right', width: 100, render: (_, record) => { - return record?.GuaranteeRatio ? `${record?.GuaranteeRatio}%` : '' + return record?.GUARANTEERATIO ? `${record?.GUARANTEERATIO}%` : '' } } ] @@ -383,6 +391,11 @@ const HistoricalProjects = ({ parentRow, onRef }: DetailProps) => { tableData })); + // useEffect(() => { + + // }, [pageType]) + + return (
{ headerTitle={'往期项目'} // 列表表头 dataSource={tableData} request={async (params) => { + console.log('fkdjfksdjfsz', parentRow); + const req: any = { SearchParameter: { BUSINESSPROJECT_ID: parentRow?.BUSINESSPROJECT_ID, @@ -412,41 +427,78 @@ const HistoricalProjects = ({ parentRow, onRef }: DetailProps) => { SortStr: 'ENDDATE desc', } const data = await handleGetShopRoyaltyList(req) - console.log('datadatadatadatadata321', data); if (data && data.length > 0) { + data.forEach((item: any, index: number) => { + item.BUSSINESS_PERIOD = `第${data.length - index}期` + item.PERIOD_INDEX = data.length - index + }) + let SHOPROYALTY_IDList: any = [] let res = data.filter((item: any) => item.SHOPROYALTY_ID !== 0 && item.SHOPROYALTY_ID !== parentRow?.SHOPROYALTY_ID) - console.log('resresresresresresresresres', res); if (res && res.length > 0) { res.forEach((item: any, index: number) => { item.id = index + 1 SHOPROYALTY_IDList.push(item.SHOPROYALTY_ID) }) } - console.log('SHOPROYALTY_IDListSHOPROYALTY_IDListSHOPROYALTY_IDList', SHOPROYALTY_IDList); - const req: any = { BUSINESSPROJECT_ID: parentRow?.BUSINESSPROJECT_ID, } const data2 = await handleGetProjectPeriodAccount(req) - console.log('data2data2data2data2data2data2', data2); let list: any = [] if (data2.ProjectPeriodList && data2.ProjectPeriodList.length > 0) { list = wrapTreeNode(data2.ProjectPeriodList) - + list = list.filter((filterItem: any) => filterItem.PeriodIndex !== list.length) let resultList: any = [] if (list && list.length > 0) { list.forEach((item: any) => { if (SHOPROYALTY_IDList && SHOPROYALTY_IDList.length > 0 && SHOPROYALTY_IDList.indexOf(item.ShopRoyalty_Id) !== -1) { resultList.push(item) } + item.STARTDATE = item.StartDate + item.ENDDATE = item.EndDate + item.BUSSINESS_PERIOD = item.PeriodIndexStr + item.MINTURNOVER = item.MinturnOver + item.GUARANTEERATIO = item.GuaranteeRatio }) } - } - setTableData(res) + setTableData(list) + + if (pageType === 'edit') { + confirm({ + width: 500, + content:
{'当前处于退场结算阶段,允许录入历史期间的经营数据,以便完成最终对账与清算'}
, + onOk: async () => { + if (list && list.length > 0) { + setCurrentRow(list[0]) + setShowDetail(true) + } + } + }) + } + + return { data: list, success: true } + } else { + + if (pageType === 'edit') { + confirm({ + width: 500, + content:
{'当前处于退场结算阶段,允许录入历史期间的经营数据,以便完成最终对账与清算'}
, + onOk: async () => { + if (res && res.length > 0) { + setCurrentRow(res[0]) + setShowDetail(true) + } + } + }) + + } + + setTableData(res) + return { data: res, success: true } + } - return { data: res, success: true } } return { data: [], success: true } @@ -473,7 +525,7 @@ const HistoricalProjects = ({ parentRow, onRef }: DetailProps) => { { @@ -2768,10 +2766,10 @@ const YearExamineDetailTable = ({ parentRow, currentApprovalstate, onRef, setIsS {/* 判断当期项目 是不是最后一期 是最后一期的话 就显示 历史期的数据 */} {/* */} - {/* { - parentRow?.PROJECT_ENDDATE === parentRow?.ENDDATE && parentRow?.SETTLEMENT_STATE > 0 ? - < HistoricalProjects /> : "" - } */} + { + parentRow?.PROJECT_ENDDATE && parentRow?.ENDDATE && moment(parentRow?.PROJECT_ENDDATE).format('YYYY-MM-DD') === moment(parentRow?.ENDDATE).format('YYYY-MM-DD') && parentRow?.BUSINESSAPPROVAL_ID > 0 ? + : "" + } diff --git a/src/pages/reports/settlementAccount/component/afterSettlement.tsx b/src/pages/reports/settlementAccount/component/afterSettlement.tsx index 23d1a8a..e46998c 100644 --- a/src/pages/reports/settlementAccount/component/afterSettlement.tsx +++ b/src/pages/reports/settlementAccount/component/afterSettlement.tsx @@ -559,7 +559,13 @@ const AfterSettlement = ({ parentRow, dataRef, onShow, setIsFinishCalibration, o dataSource={tableData} /> - {/* */} + + { + parentRow?.PROJECT_ENDDATE && parentRow?.ENDDATE && moment(parentRow?.PROJECT_ENDDATE).format('YYYY-MM-DD') === moment(parentRow?.ENDDATE).format('YYYY-MM-DD') ? + + : "" + } + <> { tableLoading ? '' : diff --git a/src/pages/reports/settlementAccount/component/yearExamineProcess.tsx b/src/pages/reports/settlementAccount/component/yearExamineProcess.tsx index fe8a854..81e8254 100644 --- a/src/pages/reports/settlementAccount/component/yearExamineProcess.tsx +++ b/src/pages/reports/settlementAccount/component/yearExamineProcess.tsx @@ -398,7 +398,7 @@ const YearExamineProcess = ({ currentUser, onShow, setOnShow, parentRow, setPare } - + await handlePreviousPeriod(data.Result_Data.BUSINESSAPPROVAL_ID) message.success(data.Result_Desc) setOnShow(false) setParentRow(undefined) @@ -416,59 +416,60 @@ const YearExamineProcess = ({ currentUser, onShow, setOnShow, parentRow, setPare } // 往期项目存一下 - const handlePreviousPeriod = async () => { + const handlePreviousPeriod = async (BUSINESSAPPROVAL_ID: any) => { + // 这次年度结算的 业务id let historyList: any = AfterSettlementRef.current?.HistoricalProjectsRef.current console.log('historyListhistoryListhistoryList', historyList); console.log('parentRowparentRowparentRowparentRow', parentRow); const req: any = [] - if (historyList && historyList.length > 0) { - historyList.forEach((item: any) => { + if (historyList.tableData && historyList.tableData.length > 0) { + historyList.tableData.forEach((item: any) => { req.push({ - node: { - BUSINESSPROJECT_ID: item.BUSINESSPROJECT_ID, - BUSINESSPROJECT_NAME: parentRow?.BUSINESSPROJECT_NAME, - SHOPROYALTY_ID: item.SHOPROYALTY_ID, - SERVERPARTSHOP_ID: item.SERVERPARTSHOP_ID, - BUSINESS_TRADE: "", // 经营业态 - BUSINESS_BRAND: "",// 经营品牌 - BUSINESS_MONTH: "",// 经营年月 - BUSINESS_STARTDATE: "",// 开始日期 - BUSINESS_ENDDATE: "",// 结束日期 - BUSINESS_PERIOD: "",// 经营期数 - PERIOD_INDEX: "",// 第几期 - BUSINESS_DAYS: "",// 拆分天数 - GUARANTEE_AMOUNT: "",// 保底营业额 - GUARANTEERATIO: item.GUARANTEERATIO, - ACTUAL_REVENUE: item.RevenueAmount, // 实际营业额 营业额小计 - CORRECT_AMOUNT: "",// 冲正金额 - PARTYA_SHAREPROFIT: "",// 甲方分润 - PARTYB_SHAREPROFIT: "",// 乙方分润 - PARTYC_SHAREPROFIT: "",// 丙方分润 - LIQUIDATION_AMOUNT: item.RefundSupplement,// 清算金额 退补款 - ACTUAL_ACCOUNTS: item.GuaranteeFee,// 实际应收账款 应收费用租金 - ROYALTY_PRICE: item.RoyaltyAmount,// 甲方到账 业主收款 - SUBROYALTY_PRICE: "",// 乙方到账 - MOBILEPAY_AMOUNT: item.MobilePayAmount, - CASHPAY_AMOUNT: item.CashAmount, - OTHERPAY_AMOUNT: "",// 其他支付 - PROPERTYFEE: item.PropertyFee, - HOUSERENT: item.HouseRent, - BREACHPENALTY: item.BreachPenalty, - ELECTRICITYCHARGE: item.ElectricityCharge, - WATERCHARGE: item.WATERCHARGE, - OTHERFEE: item.OtherFee, - PAID_AMOUNT: item.PaidFee, - EARLY_SETTLEMENT: 1, - REVENUE_VALID: 1, - REVENUECONFIRM_DESC: `9010:${item.PaidFee_9010},9020:${item.PaidFee_9020},9030:${item.PaidFee_9030},9050:${item.PaidFee_9050},9090:${item.PaidFee_9090},9099:${item.PaidFee_9099}`, - MERCHANTS_ID: item.MERCHANTS_ID, - MERCHANTS_NAME: parentRow?.MERCHANTS_ID, - BUSINESSAPPROVAL_ID: "", - } + BUSINESSPROJECT_ID: item.BUSINESSPROJECT_ID, + BUSINESSPROJECT_NAME: parentRow?.BUSINESSPROJECT_NAME, + SHOPROYALTY_ID: item.SHOPROYALTY_ID, + SERVERPARTSHOP_ID: item.SERVERPARTSHOP_ID, + BUSINESS_TRADE: "", // 经营业态 + BUSINESS_BRAND: "",// 经营品牌 + BUSINESS_MONTH: "",// 经营年月 + BUSINESS_STARTDATE: item.STARTDATE ? moment(item.STARTDATE).format('YYYY-MM-DD') : "",// 开始日期 + BUSINESS_ENDDATE: item.ENDDATE ? moment(item.ENDDATE).format('YYYY-MM-DD') : "",// 结束日期 + BUSINESS_PERIOD: item.BUSSINESS_PERIOD,// 经营期数 + PERIOD_INDEX: item.PERIOD_INDEX,// 第几期 + BUSINESS_DAYS: item.NATUREDAY,// 拆分天数 + GUARANTEE_AMOUNT: item.MINTURNOVER * 10000,// 保底营业额 + GUARANTEERATIO: item.GUARANTEERATIO, + ACTUAL_REVENUE: item.RevenueAmount, // 实际营业额 营业额小计 + CORRECT_AMOUNT: "",// 冲正金额 + PARTYA_SHAREPROFIT: "",// 甲方分润 + PARTYB_SHAREPROFIT: "",// 乙方分润 + PARTYC_SHAREPROFIT: "",// 丙方分润 + LIQUIDATION_AMOUNT: item.RefundSupplement,// 清算金额 退补款 + ACTUAL_ACCOUNTS: item.GuaranteeFee,// 实际应收账款 应收费用租金 + ROYALTY_PRICE: item.RoyaltyAmount,// 甲方到账 业主收款 + SUBROYALTY_PRICE: "",// 乙方到账 + MOBILEPAY_AMOUNT: item.MobilePayAmount, + CASHPAY_AMOUNT: item.CashAmount, + OTHERPAY_AMOUNT: "",// 其他支付 + PROPERTYFEE: item.PropertyFee, + HOUSERENT: item.HouseRent, + BREACHPENALTY: item.BreachPenalty, + ELECTRICITYCHARGE: item.ElectricityCharge, + WATERCHARGE: item.WaterCharge, + OTHERFEE: item.OtherFee, + PAID_AMOUNT: item.PaidFee, + EARLY_SETTLEMENT: 1, + REVENUE_VALID: 0, + REVENUECONFIRM_DESC: `9010:${item.PaidFee_9010},9020:${item.PaidFee_9020},9030:${item.PaidFee_9030},9050:${item.PaidFee_9050},9090:${item.PaidFee_9090},9099:${item.PaidFee_9099}`, + MERCHANTS_ID: item.MERCHANTS_ID, + MERCHANTS_NAME: parentRow?.MERCHANTS_ID, + BUSINESSAPPROVAL_ID: BUSINESSAPPROVAL_ID, }) }) } + console.log('dajidasjodreq', req); + // 营业额小计 业主收款 应收费用合计 租金 水费 电费 住宿费 物业费 租金 其他 退补款 const data = await handleSynchroRevenueConfirmList(req) console.log('datadatadatadata', data); @@ -685,8 +686,8 @@ const YearExamineProcess = ({ currentUser, onShow, setOnShow, parentRow, setPare } - {/* - */} @@ -753,6 +754,7 @@ const YearExamineProcess = ({ currentUser, onShow, setOnShow, parentRow, setPare title={'确认发起结算?'} onConfirm={() => { + console.log('parentRowparentRowparentRow', parentRow); // handleCreateSettlementApplication() // return @@ -764,9 +766,21 @@ const YearExamineProcess = ({ currentUser, onShow, setOnShow, parentRow, setPare } if (res) { - handleCreateSettlementApplication() + if (parentRow?.PROJECT_ENDDATE && parentRow?.ENDDATE && moment(parentRow?.PROJECT_ENDDATE).format('YYYY-MM-DD') === moment(parentRow?.ENDDATE).format('YYYY-MM-DD')) { + confirm({ + width: 500, + content:
{'本次提交将一并提交往期结算数据,请确认所有往期数据无误后再操作'}
, + onOk: async () => { + handleCreateSettlementApplication() + } + }) + } else { + handleCreateSettlementApplication() + } } - }) + }).catch(error => { + message.warning('请检查填写是否完整!'); + }); }} > diff --git a/src/pages/reports/settlementDetail/service.ts b/src/pages/reports/settlementDetail/service.ts index a1a8bfd..53f58e0 100644 --- a/src/pages/reports/settlementDetail/service.ts +++ b/src/pages/reports/settlementDetail/service.ts @@ -24,7 +24,7 @@ export async function handleCreateSettlement(params?: any) { // 上传退场结算应收拆分数据 export async function handleSynchroRevenueConfirmList(params?: any) { - const data = await request(`/BusinessProject/SynchroRevenueConfirmList`, { + const data = await request(`/BusinessProject/UploadRevenueConfirmList`, { method: 'POST', data: params }); diff --git a/src/pages/travelMember/ActiveMemberStatistics/ActiveMemberStatistics.less b/src/pages/travelMember/ActiveMemberStatistics/ActiveMemberStatistics.less new file mode 100644 index 0000000..1c0e8de --- /dev/null +++ b/src/pages/travelMember/ActiveMemberStatistics/ActiveMemberStatistics.less @@ -0,0 +1,443 @@ +.ActiveMemberStatisticsMain { + width: 100%; + height: calc(100vh - 150px); + background: #FFFFFF; + position: relative; + + .ActiveMemberStatisticsTop { + width: 100%; + background: #FFFFFF; + // box-shadow: 0px 0px 6px 0px rgba(31, 48, 95, 0.2); + // border-radius: 4px; + box-sizing: border-box; + padding: 16px; + + .ActiveMemberStatisticsTitleBox { + width: 100%; + display: flex; + align-items: center; + // justify-content: space-between; + + + .ActiveMemberStatisticsTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 18px; + color: #757575; + line-height: 18px; + text-align: left; + font-style: normal; + margin-left: 12px; + position: relative; + cursor: pointer; + } + + .ActiveMemberStatisticsTitleSelect { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 18px; + color: #333333; + line-height: 18px; + text-align: left; + font-style: normal; + margin-left: 12px; + position: relative; + } + + .ActiveMemberStatisticsTitleSelect::after { + content: ""; + width: 4px; + height: 18px; + background: #1492FF; + border-radius: 2px; + position: absolute; + left: -12px; + top: 50%; + transform: translateY(-50%); + } + } + + .ActiveMemberStatisticsContentBox { + width: 100%; + margin-top: 16px; + display: flex; + align-items: center; + justify-content: space-between; + + // .ActiveMemberStatisticsItemFirst { + // width: 280px; + // height: 180px; + // background-image: url('../../../assets/detail/staticSumTotalBg.png'); + // background-size: 100% 100%; + // background-repeat: no-repeat; + // box-sizing: border-box; + // padding: 26px 39px; + // margin-right: 16px; + + // .firstItemTitle { + // font-family: PingFangSC, PingFang SC; + // font-weight: 500; + // font-size: 18px; + // color: #FFFFFF; + // line-height: 13px; + // text-align: left; + // font-style: normal; + // } + + // .firstItemValue { + // font-family: DINAlternate, DINAlternate; + // font-weight: bold; + // font-size: 28px; + // color: #FFFFFF; + // line-height: 32px; + // text-align: left; + // font-style: normal; + // margin-top: 12px; + // } + // } + + .ActiveMemberStatisticsItemOther { + width: 100%; + height: 180px; + display: flex; + align-items: center; + justify-content: space-between; + + .ActiveMemberStatisticsOtherItem { + width: calc((100% - 112px) / 7); + height: 100%; + background: #F6F9FF; + border-radius: 8px; + box-sizing: border-box; + padding: 20px 24px; + position: relative; + cursor: pointer; + + .otherItemTitle { + height: 36px; + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #333333; + line-height: 18px; + text-align: left; + font-style: normal; + } + + .otherItemValue { + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 32px; + color: #1492FF; + line-height: 38px; + text-align: left; + margin-top: 4px; + font-style: normal; + } + + .addLabel { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: rgba(0, 0, 0, 0.65); + line-height: 12px; + text-align: left; + font-style: normal; + margin-right: 5px; + margin-top: 10px; + } + + + .otherItemAddBox { + display: flex; + align-items: center; + margin-top: 10px; + + + .addIcon { + width: 7px; + height: 10px; + margin-right: 6px; + } + + .addValue { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 16px; + color: rgba(0, 0, 0, 0.65); + line-height: 16px; + text-align: center; + font-style: normal; + } + } + + // .otherBgIcon { + // width: 76px; + // height: 51px; + // position: absolute; + // top: 29px; + // right: 4px; + // background-image: url(../../../assets/detail/otherBgIcon.png); + // background-repeat: no-repeat; + // background-size: 100% 100%; + // } + } + + .ActiveMemberStatisticsOtherItemSelect { + background-image: url('../../../assets/detail/staticSumTotalBg.png'); + background-size: 100% 100%; + background-repeat: no-repeat; + + .otherItemTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #fff; + line-height: 18px; + text-align: left; + font-style: normal; + } + + .otherItemValue { + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 32px; + color: #fff; + line-height: 38px; + text-align: left; + margin-top: 17px; + font-style: normal; + } + + .addLabel { + color: #fff; + } + + .otherItemAddBox { + + .addValue { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 14px; + color: #fff; + line-height: 16px; + text-align: center; + font-style: normal; + } + } + } + } + } + } + + + .ActiveMemberStatisticsBottom { + width: 100%; + // margin-top: 16px; + box-sizing: border-box; + background: #FFFFFF; + // box-shadow: 0px 0px 6px 0px rgba(31, 48, 95, 0.2); + // border-radius: 4px; + padding: 16px; + + .ActiveMemberStatisticsTitleBox { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + + .ActiveMemberStatisticsTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 18px; + color: #333333; + line-height: 18px; + text-align: left; + font-style: normal; + margin-left: 12px; + position: relative; + } + + .ActiveMemberStatisticsTitle::after { + content: ""; + width: 4px; + height: 18px; + background: #1492FF; + border-radius: 2px; + position: absolute; + left: -12px; + top: 50%; + transform: translateY(-50%); + } + } + + + + .ActiveMemberStatisticsContentBox { + width: 100%; + margin-top: 16px; + display: flex; + align-items: center; + justify-content: space-between; + + .ActiveMemberStatisticsItemOther { + width: 100%; + height: 180px; + display: flex; + flex-wrap: wrap; + align-items: center; + // justify-content: space-between; + + .ActiveMemberStatisticsOtherItem { + width: calc((100% - 112px) / 7); + height: 100%; + background: #F6F9FF; + border-radius: 8px; + box-sizing: border-box; + padding: 29px 24px; + position: relative; + cursor: pointer; + margin-right: 16px; + + .otherItemTitle { + height: 36px; + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #333333; + line-height: 18px; + text-align: left; + font-style: normal; + } + + .otherItemValue { + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 32px; + color: #1492FF; + line-height: 38px; + text-align: left; + margin-top: 17px; + font-style: normal; + + .otherItemValueUnit { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: rgba(0, 0, 0, 0.65); + line-height: 12px; + text-align: left; + font-style: normal; + margin-right: 5px; + margin-top: 10px; + } + } + + .addLabel { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: rgba(0, 0, 0, 0.65); + line-height: 12px; + text-align: left; + font-style: normal; + margin-right: 5px; + margin-top: 10px; + } + + + .otherItemAddBox { + display: flex; + align-items: center; + margin-top: 10px; + + + .addIcon { + width: 7px; + height: 10px; + margin-right: 6px; + } + + .addValue { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 16px; + color: rgba(0, 0, 0, 0.65); + line-height: 16px; + text-align: center; + font-style: normal; + } + } + + // .otherBgIcon { + // width: 76px; + // height: 51px; + // position: absolute; + // top: 29px; + // right: 4px; + // background-image: url(../../../assets/detail/otherBgIcon.png); + // background-repeat: no-repeat; + // background-size: 100% 100%; + // } + } + + .ActiveMemberStatisticsOtherItemSelect { + background-image: url('../../../assets/detail/staticSumTotalBg.png'); + background-size: 100% 100%; + background-repeat: no-repeat; + + .otherItemTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #fff; + line-height: 18px; + text-align: left; + font-style: normal; + } + + .otherItemValue { + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 32px; + color: #fff; + line-height: 38px; + text-align: left; + margin-top: 17px; + font-style: normal; + + .otherItemValueUnit { + + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 14px; + color: #fff; + line-height: 20px; + text-align: left; + margin-top: 17px; + font-style: normal; + } + } + + .addLabel { + color: #fff; + } + + .otherItemAddBox { + + .addValue { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 14px; + color: #fff; + line-height: 16px; + text-align: center; + font-style: normal; + } + } + } + } + } + + } +} \ No newline at end of file diff --git a/src/pages/travelMember/ActiveMemberStatistics/index.tsx b/src/pages/travelMember/ActiveMemberStatistics/index.tsx new file mode 100644 index 0000000..e762374 --- /dev/null +++ b/src/pages/travelMember/ActiveMemberStatistics/index.tsx @@ -0,0 +1,273 @@ +// 活跃会员统计 +import { connect, CurrentUser } from "umi"; +import { ConnectState } from "@/models/connect"; +import { useEffect, useRef, useState } from "react"; +import { Button, Col, Drawer, FormInstance, Row, Spin } from "antd"; +import ProForm, { ProFormDateRangePicker, ProFormSelect } from "@ant-design/pro-form"; +import './ActiveMemberStatistics.less' +import { handeGetMembershipCount } from "../service"; +import session from "@/utils/session"; +import ProTable, { ActionType } from "@ant-design/pro-table"; +import MemberInfor from "../memberInfor"; +import moment from 'moment' + +const ActiveMemberStatistics: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => { + const { currentUser } = props + const formRef = useRef(); + const actionRef = useRef(); + + // 选择的tab + const [selectPageTab, setSelectPageTab] = useState(1) + // 会员类型数据 + const [membershipType, setMembershipType] = useState() + // 会员数量 + const [memberShipTotal, setMemberShipTotal] = useState(1) + // 会员等级数据 + const [revenueList, setRevenueList] = useState() + // 显示详情抽屉 + const [showDetail, setShowDetail] = useState(false) + const [currentRow, setCurrentRow] = useState() + // 抽屉显示的标题 + const [currentDrawerTitle, setCurrentDrawerTitle] = useState() + // 1 是 会员类型 2是 会员等级 + const [searchType, setSearchType] = useState() + // 对应的枚举类型 + const [valueType, setValueType] = useState() + // 显示加载效果 + const [showLoading, setShowLoading] = useState(false) + + let MEMBERSHIPLEVELYNObj = session.get('MEMBERSHIPLEVELYNObj') + let MEMBERSHIPLEVELYNList = session.get('MEMBERSHIPLEVELYNList') + let MEMBERSHIPTYPEYNObj = session.get('MEMBERSHIPTYPEYNObj') + let MEMBERSHIPTYPEYNList = session.get('MEMBERSHIPTYPEYNList') + + + const handleGetData = async (formData?: any) => { + console.log('formDataformDataformData', formData); + let [start, end] = ['', ''] + if (formData && formData?.searchTime) { + [start, end] = formData.searchTime + } + + const req: any = { + CalcType: 4, // 活跃会员 + OwnerUnitId: currentUser?.OwnerUnitId, + ExcludeTest: formData ? formData?.ExcludeTest === 1 ? true : false : true, + StartDate: start ? start : "", + EndDate: end ? end : "", + MembershipType: formData?.MembershipType || "", + // MembershipLevel: formData?.MembershipLevel || "", + MembershipLevel: "", + } + + setShowLoading(true) + const data = await handeGetMembershipCount(req) + setShowLoading(false) + console.log('datadatadatadata', data); + + setMembershipType(data.List) + setMemberShipTotal(data.OtherData) + } + + // 点击事件 + const handleShowTableData = async (type: number, memberType: any) => { + // type 1 的话是 会员类型 2 的话是 会员等级 memberType 对应的枚举值 + setCurrentDrawerTitle(`${type === 1 ? '会员类型' : type === 2 ? '会员等级' : ''}【${type === 1 ? MEMBERSHIPTYPEYNObj && memberType ? MEMBERSHIPTYPEYNObj[memberType] : '' : type === 2 ? MEMBERSHIPLEVELYNObj && memberType ? MEMBERSHIPLEVELYNObj[memberType] : '' : ''}】`) + setSearchType(type) + setValueType(memberType) + setShowDetail(true) + } + + useEffect(() => { + handleGetData() + }, []) + + return ( +
+ { + showLoading ? +
+
+ + 加载中... +
+
: '' + } + +
+ {/*
+
{ + setSelectPageTab(1) + }}>会员类型
+
{ + setSelectPageTab(2) + }}>会员等级
+
*/} + { + console.log('valuesvaluesvaluesvalues', values); + handleGetData(values) + }} + > + + + + + + + + + {/* + + */} + + + + + + {/* */} + +
+ + +
+ +
+
+
+ + +
+ { + membershipType && membershipType.length > 0 ? + <> +
+
会员类型{memberShipTotal ? `(${memberShipTotal}人)` : ""}
+
+ +
+
+ { + membershipType.map((item: any) => { + return
+
{item.label === '0' ? '未授权用户' : MEMBERSHIPLEVELYNObj && item.label ? MEMBERSHIPLEVELYNObj[item.label] : ''}
+
{item.value}
+
占比
+
+ {item.key ? item.key + '%' : ""} +
+
+ }) + } + +
+
+ + : "" + } + +
+ +
+ { + revenueList && revenueList.length > 0 ? + <> +
+
营销活动
+
+ +
+
+ { + revenueList.map((item: any) => { + return
+
{item.label}
+
{item.value}
+
占比
+
+ {item.key ? item.key + '%' : ""} +
+
+ }) + } + +
+
+ + : "" + } + +
+ { + setSearchType(null) + setValueType(null) + setShowDetail(false) + }} + > + + +
+ ) +} + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.currentUser +}))(ActiveMemberStatistics); \ No newline at end of file diff --git a/src/pages/travelMember/BusinessActivityStatistics/BusinessActivityStatistics.less b/src/pages/travelMember/BusinessActivityStatistics/BusinessActivityStatistics.less new file mode 100644 index 0000000..4b1dc8c --- /dev/null +++ b/src/pages/travelMember/BusinessActivityStatistics/BusinessActivityStatistics.less @@ -0,0 +1,444 @@ +.BusinessActivityStatisticsMain { + width: 100%; + height: calc(100vh - 150px); + background: #FFFFFF; + position: relative; + overflow-y: auto; + + .BusinessActivityStatisticsTop { + width: 100%; + background: #FFFFFF; + // box-shadow: 0px 0px 6px 0px rgba(31, 48, 95, 0.2); + // border-radius: 4px; + box-sizing: border-box; + padding: 16px; + + .BusinessActivityStatisticsTitleBox { + width: 100%; + display: flex; + align-items: center; + // justify-content: space-between; + + + .BusinessActivityStatisticsTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 18px; + color: #757575; + line-height: 18px; + text-align: left; + font-style: normal; + margin-left: 12px; + position: relative; + cursor: pointer; + } + + .BusinessActivityStatisticsTitleSelect { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 18px; + color: #333333; + line-height: 18px; + text-align: left; + font-style: normal; + margin-left: 12px; + position: relative; + } + + .BusinessActivityStatisticsTitleSelect::after { + content: ""; + width: 4px; + height: 18px; + background: #1492FF; + border-radius: 2px; + position: absolute; + left: -12px; + top: 50%; + transform: translateY(-50%); + } + } + + .BusinessActivityStatisticsContentBox { + width: 100%; + margin-top: 16px; + display: flex; + align-items: center; + justify-content: space-between; + + // .BusinessActivityStatisticsItemFirst { + // width: 280px; + // height: 180px; + // background-image: url('../../../assets/detail/staticSumTotalBg.png'); + // background-size: 100% 100%; + // background-repeat: no-repeat; + // box-sizing: border-box; + // padding: 26px 39px; + // margin-right: 16px; + + // .firstItemTitle { + // font-family: PingFangSC, PingFang SC; + // font-weight: 500; + // font-size: 18px; + // color: #FFFFFF; + // line-height: 13px; + // text-align: left; + // font-style: normal; + // } + + // .firstItemValue { + // font-family: DINAlternate, DINAlternate; + // font-weight: bold; + // font-size: 28px; + // color: #FFFFFF; + // line-height: 32px; + // text-align: left; + // font-style: normal; + // margin-top: 12px; + // } + // } + + .BusinessActivityStatisticsItemOther { + width: 100%; + height: 180px; + display: flex; + align-items: center; + justify-content: space-between; + + .BusinessActivityStatisticsOtherItem { + width: calc((100% - 112px) / 7); + height: 100%; + background: #F6F9FF; + border-radius: 8px; + box-sizing: border-box; + padding: 20px 24px; + position: relative; + cursor: pointer; + + .otherItemTitle { + height: 36px; + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #333333; + line-height: 18px; + text-align: left; + font-style: normal; + } + + .otherItemValue { + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 32px; + color: #1492FF; + line-height: 38px; + text-align: left; + margin-top: 4px; + font-style: normal; + } + + .addLabel { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: rgba(0, 0, 0, 0.65); + line-height: 12px; + text-align: left; + font-style: normal; + margin-right: 5px; + margin-top: 10px; + } + + + .otherItemAddBox { + display: flex; + align-items: center; + margin-top: 10px; + + + .addIcon { + width: 7px; + height: 10px; + margin-right: 6px; + } + + .addValue { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 16px; + color: rgba(0, 0, 0, 0.65); + line-height: 16px; + text-align: center; + font-style: normal; + } + } + + // .otherBgIcon { + // width: 76px; + // height: 51px; + // position: absolute; + // top: 29px; + // right: 4px; + // background-image: url(../../../assets/detail/otherBgIcon.png); + // background-repeat: no-repeat; + // background-size: 100% 100%; + // } + } + + .BusinessActivityStatisticsOtherItemSelect { + background-image: url('../../../assets/detail/staticSumTotalBg.png'); + background-size: 100% 100%; + background-repeat: no-repeat; + + .otherItemTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #fff; + line-height: 18px; + text-align: left; + font-style: normal; + } + + .otherItemValue { + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 32px; + color: #fff; + line-height: 38px; + text-align: left; + margin-top: 17px; + font-style: normal; + } + + .addLabel { + color: #fff; + } + + .otherItemAddBox { + + .addValue { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 14px; + color: #fff; + line-height: 16px; + text-align: center; + font-style: normal; + } + } + } + } + } + } + + + .BusinessActivityStatisticsBottom { + width: 100%; + // margin-top: 16px; + box-sizing: border-box; + background: #FFFFFF; + // box-shadow: 0px 0px 6px 0px rgba(31, 48, 95, 0.2); + // border-radius: 4px; + padding: 16px; + + .BusinessActivityStatisticsTitleBox { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + + .BusinessActivityStatisticsTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 18px; + color: #333333; + line-height: 18px; + text-align: left; + font-style: normal; + margin-left: 12px; + position: relative; + } + + .BusinessActivityStatisticsTitle::after { + content: ""; + width: 4px; + height: 18px; + background: #1492FF; + border-radius: 2px; + position: absolute; + left: -12px; + top: 50%; + transform: translateY(-50%); + } + } + + + + .BusinessActivityStatisticsContentBox { + width: 100%; + margin-top: 16px; + display: flex; + align-items: center; + justify-content: space-between; + + .BusinessActivityStatisticsItemOther { + width: 100%; + height: 180px; + display: flex; + flex-wrap: wrap; + align-items: center; + // justify-content: space-between; + + .BusinessActivityStatisticsOtherItem { + width: calc((100% - 112px) / 7); + height: 100%; + background: #F6F9FF; + border-radius: 8px; + box-sizing: border-box; + padding: 29px 24px; + position: relative; + cursor: pointer; + margin-right: 16px; + + .otherItemTitle { + height: 36px; + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #333333; + line-height: 18px; + text-align: left; + font-style: normal; + } + + .otherItemValue { + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 32px; + color: #1492FF; + line-height: 38px; + text-align: left; + margin-top: 17px; + font-style: normal; + + .otherItemValueUnit { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: rgba(0, 0, 0, 0.65); + line-height: 12px; + text-align: left; + font-style: normal; + margin-right: 5px; + margin-top: 10px; + } + } + + .addLabel { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: rgba(0, 0, 0, 0.65); + line-height: 12px; + text-align: left; + font-style: normal; + margin-right: 5px; + margin-top: 10px; + } + + + .otherItemAddBox { + display: flex; + align-items: center; + margin-top: 10px; + + + .addIcon { + width: 7px; + height: 10px; + margin-right: 6px; + } + + .addValue { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 16px; + color: rgba(0, 0, 0, 0.65); + line-height: 16px; + text-align: center; + font-style: normal; + } + } + + // .otherBgIcon { + // width: 76px; + // height: 51px; + // position: absolute; + // top: 29px; + // right: 4px; + // background-image: url(../../../assets/detail/otherBgIcon.png); + // background-repeat: no-repeat; + // background-size: 100% 100%; + // } + } + + .BusinessActivityStatisticsOtherItemSelect { + background-image: url('../../../assets/detail/staticSumTotalBg.png'); + background-size: 100% 100%; + background-repeat: no-repeat; + + .otherItemTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #fff; + line-height: 18px; + text-align: left; + font-style: normal; + } + + .otherItemValue { + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 32px; + color: #fff; + line-height: 38px; + text-align: left; + margin-top: 17px; + font-style: normal; + + .otherItemValueUnit { + + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 14px; + color: #fff; + line-height: 20px; + text-align: left; + margin-top: 17px; + font-style: normal; + } + } + + .addLabel { + color: #fff; + } + + .otherItemAddBox { + + .addValue { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 14px; + color: #fff; + line-height: 16px; + text-align: center; + font-style: normal; + } + } + } + } + } + + } +} \ No newline at end of file diff --git a/src/pages/travelMember/BusinessActivityStatistics/index.tsx b/src/pages/travelMember/BusinessActivityStatistics/index.tsx new file mode 100644 index 0000000..cb2e359 --- /dev/null +++ b/src/pages/travelMember/BusinessActivityStatistics/index.tsx @@ -0,0 +1,477 @@ +// 运营活动统计 +import { connect, CurrentUser } from "umi"; +import { ConnectState } from "@/models/connect"; +import { useEffect, useRef, useState } from "react"; +import { Button, Col, Drawer, FormInstance, Row, Spin, Tooltip } from "antd"; +import ProForm, { ProFormDateRangePicker, ProFormSelect } from "@ant-design/pro-form"; +import './BusinessActivityStatistics.less' +import { handeGetMarketingSummary, handeGetMembershipCount } from "../service"; +import session from "@/utils/session"; +import ProTable, { ActionType } from "@ant-design/pro-table"; +import MemberInfor from "../memberInfor"; +import moment from 'moment' +import addIcon from '@/assets/detail/addIcon.png' +import reduceIcon from '@/assets/detail/reduceIcon.png' + +const BusinessActivityStatistics: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => { + const { currentUser } = props + const formRef = useRef(); + const actionRef = useRef(); + + // 选择的tab + const [selectPageTab, setSelectPageTab] = useState(1) + // 会员类型数据 + const [membershipType, setMembershipType] = useState() + // 活动总数 + const [activityTotal, setActivityTotal] = useState() + // 会员等级数据 + const [revenueList, setRevenueList] = useState() + // 营收合计 + const [revenueTotal, setRevenueTotal] = useState() + // 显示详情抽屉 + const [showDetail, setShowDetail] = useState(false) + const [currentRow, setCurrentRow] = useState() + // 抽屉显示的标题 + const [currentDrawerTitle, setCurrentDrawerTitle] = useState() + // 1 是 会员类型 2是 会员等级 + const [searchType, setSearchType] = useState() + // 对应的枚举类型 + const [valueType, setValueType] = useState() + // 显示加载效果 + const [showLoading, setShowLoading] = useState(false) + + let MEMBERSHIPLEVELYNObj = session.get('MEMBERSHIPLEVELYNObj') + let MEMBERSHIPLEVELYNList = session.get('MEMBERSHIPLEVELYNList') + let MEMBERSHIPTYPEYNObj = session.get('MEMBERSHIPTYPEYNObj') + let MEMBERSHIPTYPEYNList = session.get('MEMBERSHIPTYPEYNList') + + + const handleGetData = async (formData?: any) => { + console.log('formDataformDataformData', formData); + let [start, end] = ['', ''] + if (formData && formData?.searchTime) { + [start, end] = formData.searchTime + } + + const req: any = { + CalcType: 3, // 拉新 + OwnerUnitId: currentUser?.OwnerUnitId, + ExcludeTest: formData ? formData?.ExcludeTest === 1 ? true : false : true, + StartDate: start ? start : "", + EndDate: end ? end : "", + MembershipType: formData?.MembershipType || "", + MembershipLevel: formData?.MembershipLevel || "", + } + + const req2: any = { + OwnerUnitId: currentUser?.OwnerUnitId, + StartDate: start ? start : "", + EndDate: end ? end : "", + SalebillType: "", + MembershipType: formData?.MembershipType || "", + MembershipLevel: formData?.MembershipLevel || "", + } + + + setShowLoading(true) + const data = await handeGetMembershipCount(req) + const data2 = await handeGetMarketingSummary(req2) + setShowLoading(false) + console.log('datadatadatadata', data); + + setMembershipType(data.List) + setActivityTotal(data.OtherData) + setRevenueList(data2.List) + } + + // 点击事件 + const handleShowTableData = async (type: number, memberType: any) => { + // type 1 的话是 会员类型 2 的话是 会员等级 memberType 对应的枚举值 + setCurrentDrawerTitle(`${type === 1 ? '会员类型' : type === 2 ? '会员等级' : ''}【${type === 1 ? MEMBERSHIPTYPEYNObj && memberType ? MEMBERSHIPTYPEYNObj[memberType] : '' : type === 2 ? MEMBERSHIPLEVELYNObj && memberType ? MEMBERSHIPLEVELYNObj[memberType] : '' : ''}】`) + setSearchType(type) + setValueType(memberType) + setShowDetail(true) + } + + useEffect(() => { + handleGetData({ searchTime: [moment().startOf('M').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')] }) + }, []) + + return ( +
+ { + showLoading ? +
+
+ + 加载中... +
+
: '' + } + +
+ {/*
+
{ + setSelectPageTab(1) + }}>会员类型
+
{ + setSelectPageTab(2) + }}>会员等级
+
*/} + { + console.log('valuesvaluesvaluesvalues', values); + handleGetData(values) + }} + > + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ + +
+ { + membershipType && membershipType.length > 0 ? + <> +
+
运营活动{activityTotal ? `(${activityTotal}人)` : ""}
+
+ +
+
+ { + membershipType.map((item: any) => { + return
+
{item.label}
+
{item.value}
+
占比
+
+ {item.key ? item.key + '%' : ""} +
+
+ }) + } + +
+
+ + : "" + } + +
+ +
+ { + revenueList && revenueList.length > 0 ? + revenueList.map((item: any) => { + return
+
+
{item.MarketingActivity}
+
+ +
+
+
+
实际销售金额(扣除退款)
+
{item && item?.TotalActualAmount ? item?.TotalActualAmount.summaryData : "-"}
+
环比增长
+
+ { + item && item?.TotalActualAmount && item?.TotalActualAmount.QOQData && item?.TotalActualAmount.summaryData ? + 0 ? addIcon : reduceIcon} /> : "" + } + { + item && item?.TotalActualAmount && item?.TotalActualAmount.QOQData && item?.TotalActualAmount.summaryData ? + + {(((item?.TotalActualAmount.summaryData - item?.TotalActualAmount.QOQData) / item?.TotalActualAmount.QOQData) * 100).toFixed(2) + '%'} + + : "-" + } +
+
+ +
+
成交销售金额
+
{item && item?.TotalSuccAmount ? item?.TotalSuccAmount.summaryData : "-"}
+
环比增长
+
+ { + item && item?.TotalSuccAmount && item?.TotalSuccAmount.QOQData && item?.TotalSuccAmount.summaryData ? + 0 ? addIcon : reduceIcon} /> : "" + } + { + item && item?.TotalSuccAmount && item?.TotalSuccAmount.QOQData && item?.TotalSuccAmount.summaryData ? + // {item && item?.TotalSuccAmount ? item?.TotalSuccAmount.QOQData : "-"} + + {(((item?.TotalSuccAmount.summaryData - item?.TotalSuccAmount.QOQData) / item?.TotalSuccAmount.QOQData) * 100).toFixed(2) + '%'} + + : "-" + } +
+
+ +
+
成交订单笔数
+
{item && item?.TotalSuccTicket ? item?.TotalSuccTicket.summaryData : "-"}
+
环比增长
+
+ { + item && item?.TotalSuccTicket && item?.TotalSuccTicket.QOQData && item?.TotalSuccTicket.summaryData ? + 0 ? addIcon : reduceIcon} /> : "" + } + { + item && item?.TotalSuccTicket && item?.TotalSuccTicket.QOQData && item?.TotalSuccTicket.summaryData ? + + {(((item?.TotalSuccTicket.summaryData - item?.TotalSuccTicket.QOQData) / item?.TotalSuccTicket.QOQData) * 100).toFixed(2) + '%'} + + : "-" + } +
+
+ + {/*
+
成交销售数量
+
{item && item?.TotalCount ? item?.TotalCount.summaryData : "-"}
+
环比增长
+
+ { + item && item?.TotalCount && item?.TotalCount.QOQData && item?.TotalCount.summaryData ? + 0 ? addIcon : reduceIcon} /> : "" + } + { + item && item?.TotalCount && item?.TotalCount.QOQData && item?.TotalCount.summaryData ? + // {item && item?.TotalCount ? item?.TotalCount.QOQData : "-"} + + {(((item?.TotalCount.summaryData - item?.TotalCount.QOQData) / item?.TotalCount.QOQData) * 100).toFixed(2) + '%'} + + : "-" + } +
+
+ +
+
交易失败笔数
+
{item && item?.TotalFailureTicket ? item?.TotalFailureTicket.summaryData : "-"}
+
环比增长
+
+ { + item && item?.TotalFailureTicket && item?.TotalFailureTicket.QOQData && item?.TotalFailureTicket.summaryData ? + 0 ? addIcon : reduceIcon} /> : "" + } + { + item && item?.TotalFailureTicket && item?.TotalFailureTicket.QOQData && item?.TotalFailureTicket.summaryData ? + // {item && item?.TotalFailureTicket ? item?.TotalFailureTicket.QOQData : "-"} + + {(((item?.TotalFailureTicket.summaryData - item?.TotalFailureTicket.QOQData) / item?.TotalFailureTicket.QOQData) * 100).toFixed(2) + '%'} + + : "-" + } +
+
+ +
+
退款订单笔数
+
{item && item?.TotalRefundTicket ? item?.TotalRefundTicket.summaryData : "-"}
+
环比增长
+
+ { + item && item?.TotalRefundTicket && item?.TotalRefundTicket.QOQData && item?.TotalRefundTicket.summaryData ? + 0 ? addIcon : reduceIcon} /> : "" + } + { + item && item?.TotalRefundTicket && item?.TotalRefundTicket.QOQData && item?.TotalRefundTicket.summaryData ? + // {item && item?.TotalRefundTicket ? item?.TotalRefundTicket.QOQData : "-"} + + {(((item?.TotalRefundTicket.summaryData - item?.TotalRefundTicket.QOQData) / item?.TotalRefundTicket.QOQData) * 100).toFixed(2) + '%'} + + : "-" + } +
+
+ +
+
退款订单金额
+
{item && item?.TotalRefundAmount ? item?.TotalRefundAmount.summaryData : "-"}
+
环比增长
+
+ { + item && item?.TotalRefundAmount && item?.TotalRefundAmount.QOQData && item?.TotalRefundAmount.summaryData ? + 0 ? addIcon : reduceIcon} /> : "" + } + { + item && item?.TotalRefundAmount && item?.TotalRefundAmount.QOQData && item?.TotalRefundAmount.summaryData ? + // {item && item?.TotalRefundAmount ? item?.TotalRefundAmount.QOQData : "-"} + + {(((item?.TotalRefundAmount.summaryData - item?.TotalRefundAmount.QOQData) / item?.TotalRefundAmount.QOQData) * 100).toFixed(2) + '%'} + + : "-" + } +
+
*/} + + +
+
优惠金额
+
{item && item?.CouponAmount ? item?.CouponAmount.summaryData : "-"}
+
环比增长
+
+ { + item && item?.CouponAmount && item?.CouponAmount.QOQData && item?.CouponAmount.summaryData ? + 0 ? addIcon : reduceIcon} /> : "" + } + { + item && item?.CouponAmount && item?.CouponAmount.QOQData && item?.CouponAmount.summaryData ? + + {(((item?.CouponAmount.summaryData - item?.CouponAmount.QOQData) / item?.CouponAmount.QOQData) * 100).toFixed(2) + '%'} + + : "-" + } +
+
+ +
+
积分抵扣
+
{item && item?.ConsumePoint ? item?.ConsumePoint.summaryData : "-"}
+
环比增长
+
+ { + item && item?.ConsumePoint && item?.ConsumePoint.QOQData && item?.ConsumePoint.summaryData ? + 0 ? addIcon : reduceIcon} /> : "" + } + { + item && item?.ConsumePoint && item?.ConsumePoint.QOQData && item?.ConsumePoint.summaryData ? + + {(((item?.ConsumePoint.summaryData - item?.ConsumePoint.QOQData) / item?.ConsumePoint.QOQData) * 100).toFixed(2) + '%'} + + : "-" + } +
+
+ +
+
积分抵扣
+
{item && item?.EarnPoint ? item?.EarnPoint.summaryData : "-"}
+
环比增长
+
+ { + item && item?.EarnPoint && item?.EarnPoint.QOQData && item?.EarnPoint.summaryData ? + 0 ? addIcon : reduceIcon} /> : "" + } + { + item && item?.EarnPoint && item?.EarnPoint.QOQData && item?.EarnPoint.summaryData ? + + {(((item?.EarnPoint.summaryData - item?.EarnPoint.QOQData) / item?.EarnPoint.QOQData) * 100).toFixed(2) + '%'} + + : "-" + } +
+
+ + + +
+
+ +
+ }) : "" + } + + + +
+ { + setSearchType(null) + setValueType(null) + setShowDetail(false) + }} + > + + +
+ ) +} + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.currentUser +}))(BusinessActivityStatistics); \ No newline at end of file diff --git a/src/pages/travelMember/ConsumptionRecordSearch/index.tsx b/src/pages/travelMember/ConsumptionRecordSearch/index.tsx index ccb5c2a..f2ac999 100644 --- a/src/pages/travelMember/ConsumptionRecordSearch/index.tsx +++ b/src/pages/travelMember/ConsumptionRecordSearch/index.tsx @@ -165,6 +165,24 @@ const ConsumptionRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent? }, initialValue: "0" }, + { + title: "订单状态", + width: 120, + dataIndex: "CONSUMPTIONRECORD_STATE", + align: 'center', + ellipsis: true, + valueType: 'select', + valueEnum: { + "1005": "订单待支付", + "1010": "订单待发货", + "2000": "订单待取餐", + "3000": "订单已完成", + "8000": "退款申请中", + "8900": "订单已退款", + "9000": "订单已关闭", + "9999": "订单已撤销", + }, + }, { title: "获得积分", width: 120, @@ -291,6 +309,7 @@ const ConsumptionRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent? PROVINCE_CODE: currentUser?.ProvinceCode || "", OWNERUNIT_ID: 911, MEMBERSHIP_ID: parentDetail?.MEMBERSHIP_ID, + CONSUMPTIONRECORD_STATES: '1010,2000,2010,3000,8000,8010,8020,8900,8999' }, PageIndex: params?.current, PageSize: params?.pageSize, @@ -307,7 +326,8 @@ const ConsumptionRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent? OWNERUNIT_ID: 911, CONSUMPTIONRECORD_DATE_Start: params?.CONSUMPTIONRECORD_DATE_Start || "", CONSUMPTIONRECORD_DATE_End: params?.CONSUMPTIONRECORD_DATE_End || "", - CONSUMPTIONRECORD_TYPE: params?.CONSUMPTIONRECORD_TYPE === '0' ? '' : params?.CONSUMPTIONRECORD_TYPE + CONSUMPTIONRECORD_TYPE: params?.CONSUMPTIONRECORD_TYPE === '0' ? '' : params?.CONSUMPTIONRECORD_TYPE, + CONSUMPTIONRECORD_STATES: '1010,2000,2010,3000,8000,8010,8020,8900,8999' }, PageIndex: params?.current, PageSize: params?.pageSize, diff --git a/src/pages/travelMember/GrowthValueRecordSearch/index.tsx b/src/pages/travelMember/GrowthValueRecordSearch/index.tsx index bb68262..aee15ed 100644 --- a/src/pages/travelMember/GrowthValueRecordSearch/index.tsx +++ b/src/pages/travelMember/GrowthValueRecordSearch/index.tsx @@ -18,6 +18,7 @@ import { handleGetMEMBERGROWTHList } from "../service"; import moment from 'moment' import session from "@/utils/session"; import { handleSetlogSave } from "@/utils/format"; +import OrderDetailModal from "../BookingMealOrder/components/orderDetailModal"; const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boolean, parentDetail?: any }> = (props) => { @@ -36,7 +37,9 @@ const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent? let MEMBERSHIPTYPEYNObj = session.get('MEMBERSHIPTYPEYNObj') - + // 显示订单详情的悬浮框 + const [showOrderModal, setShowOrderModal] = useState(false) + const [currentRow, setCurrentRow] = useState() // 树相关的属性和方法 @@ -82,22 +85,6 @@ const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent? } } }, - { - title: "服务区名称", - width: 150, - dataIndex: "SERVERPART_NAME", - hideInSearch: true, - align: 'center', - ellipsis: true, - }, - { - title: "门店名称", - width: 150, - dataIndex: "SHOPNAME", - hideInSearch: true, - align: 'center', - ellipsis: true, - }, { title: "会员昵称", width: 150, @@ -165,6 +152,21 @@ const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent? }, initialValue: "-2" }, + { + title: "订单编号", + width: 250, + dataIndex: "TICKET_CODE", + hideInSearch: true, + align: 'center', + ellipsis: true, + valueType: 'digit', + render: (_, record) => { + return record?.TICKET_CODE ? { + setCurrentRow(record) + setShowOrderModal(true) + }}>{record?.TICKET_CODE} : "-" + } + }, { title: "累计成长值", width: 120, @@ -192,6 +194,22 @@ const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent? ellipsis: true, valueType: 'digit' }, + { + title: "服务区名称", + width: 150, + dataIndex: "SERVERPART_NAME", + hideInSearch: true, + align: 'center', + ellipsis: true, + }, + { + title: "门店名称", + width: 150, + dataIndex: "SHOPNAME", + hideInSearch: true, + align: 'center', + ellipsis: true, + }, { title: "操作时间", width: 180, @@ -204,6 +222,9 @@ const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent? }, ] + const handleCloseModal = () => { + setShowOrderModal(false) + } @@ -282,6 +303,9 @@ const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent? />
+ + +
) } diff --git a/src/pages/travelMember/PointsRecordSearch/index.tsx b/src/pages/travelMember/PointsRecordSearch/index.tsx index 4fabb3a..933e6e2 100644 --- a/src/pages/travelMember/PointsRecordSearch/index.tsx +++ b/src/pages/travelMember/PointsRecordSearch/index.tsx @@ -18,6 +18,7 @@ import PageTitleBox from "@/components/PageTitleBox"; import moment from 'moment' import session from "@/utils/session"; import { handleSetlogSave } from "@/utils/format"; +import OrderDetailModal from "../BookingMealOrder/components/orderDetailModal"; const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boolean, parentDetail?: any }> = (props) => { @@ -45,6 +46,10 @@ const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boo // 查询的条件 const [searchParams, setSearchParams] = useState() + // 显示订单详情的悬浮框 + const [showOrderModal, setShowOrderModal] = useState(false) + const [currentRow, setCurrentRow] = useState() + const columns: any = [ { title: '查询内容', @@ -78,22 +83,6 @@ const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boo }, initialValue: [moment().startOf('M'), moment()], }, - { - title: "服务区名称", - width: 150, - dataIndex: "SERVERPART_NAME", - hideInSearch: true, - align: 'center', - ellipsis: true, - }, - { - title: "门店名称", - width: 150, - dataIndex: "SHOPNAME", - hideInSearch: true, - ellipsis: true, - align: 'center', - }, { title: "用户昵称", width: 150, @@ -159,6 +148,21 @@ const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boo // }, // initialValue: "0" }, + { + title: "订单编号", + width: 250, + dataIndex: "TICKET_CODE", + hideInSearch: true, + align: 'center', + ellipsis: true, + valueType: 'digit', + render: (_, record) => { + return record?.TICKET_CODE ? { + setCurrentRow(record) + setShowOrderModal(true) + }}>{record?.TICKET_CODE} : "-" + } + }, { title: "本次积分", width: 120, @@ -186,6 +190,22 @@ const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boo align: 'center', valueType: "digit" }, + { + title: "服务区名称", + width: 150, + dataIndex: "SERVERPART_NAME", + hideInSearch: true, + align: 'center', + ellipsis: true, + }, + { + title: "门店名称", + width: 150, + dataIndex: "SHOPNAME", + hideInSearch: true, + ellipsis: true, + align: 'center', + }, { title: "获取时间", width: 150, @@ -199,7 +219,9 @@ const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boo }, ] - + const handleCloseModal = () => { + setShowOrderModal(false) + } return (
{ @@ -274,6 +296,8 @@ const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boo />
+ + ) } diff --git a/src/pages/travelMember/ProductListingManagement/index.tsx b/src/pages/travelMember/ProductListingManagement/index.tsx index c43d682..eeec00f 100644 --- a/src/pages/travelMember/ProductListingManagement/index.tsx +++ b/src/pages/travelMember/ProductListingManagement/index.tsx @@ -101,8 +101,14 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop const [toListLoading, setToListLoading] = useState(false) // 预览上传后的图片 - 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) => { @@ -743,6 +749,25 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop }} /> + + {fileList && fileList.length > 0 &&
+ { + setImagePreviewVisible(vis) + } + + }}> + { + fileList.map((n) => + + ) + } + + +
} + {/* 添加商品的悬浮框 */} = (prop accept="image/*" fieldProps={{ beforeUpload, - onPreview: handlePreview, + onPreview: () => { + handlePreview(1) + }, fileList: mainImgList, // 绑定 fileList onChange: async (info: any) => { if (info.file.status === 'removed') { @@ -1395,7 +1422,9 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop accept="image/*" fieldProps={{ beforeUpload, - onPreview: handlePreview, + onPreview: () => { + handlePreview(2) + }, fileList: headerImgList, // 绑定 fileList onChange: async (info: any) => { if (info.file.status === 'removed') { @@ -1444,7 +1473,9 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop accept="image/*" fieldProps={{ beforeUpload, - onPreview: handlePreview, + onPreview: () => { + handlePreview(3) + }, fileList: detailImgList, // 绑定 fileList onChange: async (info: any) => { if (info.file.status === 'removed') { diff --git a/src/pages/travelMember/SummaryOfIntegralGrowthValue/SummaryOfIntegralGrowthValue.less b/src/pages/travelMember/SummaryOfIntegralGrowthValue/SummaryOfIntegralGrowthValue.less new file mode 100644 index 0000000..b418d43 --- /dev/null +++ b/src/pages/travelMember/SummaryOfIntegralGrowthValue/SummaryOfIntegralGrowthValue.less @@ -0,0 +1,443 @@ +.SummaryOfIntegralGrowthValueMain { + width: 100%; + height: calc(100vh - 150px); + background: #FFFFFF; + position: relative; + + .SummaryOfIntegralGrowthValueTop { + width: 100%; + background: #FFFFFF; + // box-shadow: 0px 0px 6px 0px rgba(31, 48, 95, 0.2); + // border-radius: 4px; + box-sizing: border-box; + padding: 16px; + + .SummaryOfIntegralGrowthValueTitleBox { + width: 100%; + display: flex; + align-items: center; + // justify-content: space-between; + + + .SummaryOfIntegralGrowthValueTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 18px; + color: #757575; + line-height: 18px; + text-align: left; + font-style: normal; + margin-left: 12px; + position: relative; + cursor: pointer; + } + + .SummaryOfIntegralGrowthValueTitleSelect { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 18px; + color: #333333; + line-height: 18px; + text-align: left; + font-style: normal; + margin-left: 12px; + position: relative; + } + + .SummaryOfIntegralGrowthValueTitleSelect::after { + content: ""; + width: 4px; + height: 18px; + background: #1492FF; + border-radius: 2px; + position: absolute; + left: -12px; + top: 50%; + transform: translateY(-50%); + } + } + + .SummaryOfIntegralGrowthValueContentBox { + width: 100%; + margin-top: 16px; + display: flex; + align-items: center; + justify-content: space-between; + + // .SummaryOfIntegralGrowthValueItemFirst { + // width: 280px; + // height: 180px; + // background-image: url('../../../assets/detail/staticSumTotalBg.png'); + // background-size: 100% 100%; + // background-repeat: no-repeat; + // box-sizing: border-box; + // padding: 26px 39px; + // margin-right: 16px; + + // .firstItemTitle { + // font-family: PingFangSC, PingFang SC; + // font-weight: 500; + // font-size: 18px; + // color: #FFFFFF; + // line-height: 13px; + // text-align: left; + // font-style: normal; + // } + + // .firstItemValue { + // font-family: DINAlternate, DINAlternate; + // font-weight: bold; + // font-size: 28px; + // color: #FFFFFF; + // line-height: 32px; + // text-align: left; + // font-style: normal; + // margin-top: 12px; + // } + // } + + .SummaryOfIntegralGrowthValueItemOther { + width: 100%; + height: 180px; + display: flex; + align-items: center; + justify-content: space-between; + + .SummaryOfIntegralGrowthValueOtherItem { + width: calc((100% - 112px) / 7); + height: 100%; + background: #F6F9FF; + border-radius: 8px; + box-sizing: border-box; + padding: 29px 24px; + position: relative; + cursor: pointer; + + .otherItemTitle { + height: 36px; + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #333333; + line-height: 18px; + text-align: left; + font-style: normal; + } + + .otherItemValue { + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 32px; + color: #1492FF; + line-height: 38px; + text-align: left; + margin-top: 17px; + font-style: normal; + } + + .addLabel { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: rgba(0, 0, 0, 0.65); + line-height: 12px; + text-align: left; + font-style: normal; + margin-right: 5px; + margin-top: 10px; + } + + + .otherItemAddBox { + display: flex; + align-items: center; + margin-top: 10px; + + + .addIcon { + width: 7px; + height: 10px; + margin-right: 6px; + } + + .addValue { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 16px; + color: rgba(0, 0, 0, 0.65); + line-height: 16px; + text-align: center; + font-style: normal; + } + } + + // .otherBgIcon { + // width: 76px; + // height: 51px; + // position: absolute; + // top: 29px; + // right: 4px; + // background-image: url(../../../assets/detail/otherBgIcon.png); + // background-repeat: no-repeat; + // background-size: 100% 100%; + // } + } + + .SummaryOfIntegralGrowthValueOtherItemSelect { + background-image: url('../../../assets/detail/staticSumTotalBg.png'); + background-size: 100% 100%; + background-repeat: no-repeat; + + .otherItemTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #fff; + line-height: 18px; + text-align: left; + font-style: normal; + } + + .otherItemValue { + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 32px; + color: #fff; + line-height: 38px; + text-align: left; + margin-top: 17px; + font-style: normal; + } + + .addLabel { + color: #fff; + } + + .otherItemAddBox { + + .addValue { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 14px; + color: #fff; + line-height: 16px; + text-align: center; + font-style: normal; + } + } + } + } + } + } + + + .SummaryOfIntegralGrowthValueBottom { + width: 100%; + // margin-top: 16px; + box-sizing: border-box; + background: #FFFFFF; + // box-shadow: 0px 0px 6px 0px rgba(31, 48, 95, 0.2); + // border-radius: 4px; + padding: 16px; + + .SummaryOfIntegralGrowthValueTitleBox { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + + .SummaryOfIntegralGrowthValueTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 18px; + color: #333333; + line-height: 18px; + text-align: left; + font-style: normal; + margin-left: 12px; + position: relative; + } + + .SummaryOfIntegralGrowthValueTitle::after { + content: ""; + width: 4px; + height: 18px; + background: #1492FF; + border-radius: 2px; + position: absolute; + left: -12px; + top: 50%; + transform: translateY(-50%); + } + } + + + + .SummaryOfIntegralGrowthValueContentBox { + width: 100%; + margin-top: 16px; + display: flex; + align-items: center; + justify-content: space-between; + + .SummaryOfIntegralGrowthValueItemOther { + width: 100%; + height: 180px; + display: flex; + flex-wrap: wrap; + align-items: center; + // justify-content: space-between; + + .SummaryOfIntegralGrowthValueOtherItem { + width: calc((100% - 112px) / 7); + height: 100%; + background: #F6F9FF; + border-radius: 8px; + box-sizing: border-box; + padding: 29px 24px; + position: relative; + cursor: pointer; + margin-right: 16px; + + .otherItemTitle { + height: 36px; + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #333333; + line-height: 18px; + text-align: left; + font-style: normal; + } + + .otherItemValue { + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 32px; + color: #1492FF; + line-height: 38px; + text-align: left; + margin-top: 17px; + font-style: normal; + + .otherItemValueUnit { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: rgba(0, 0, 0, 0.65); + line-height: 12px; + text-align: left; + font-style: normal; + margin-right: 5px; + margin-top: 10px; + } + } + + .addLabel { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 12px; + color: rgba(0, 0, 0, 0.65); + line-height: 12px; + text-align: left; + font-style: normal; + margin-right: 5px; + margin-top: 10px; + } + + + .otherItemAddBox { + display: flex; + align-items: center; + margin-top: 10px; + + + .addIcon { + width: 7px; + height: 10px; + margin-right: 6px; + } + + .addValue { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 16px; + color: rgba(0, 0, 0, 0.65); + line-height: 16px; + text-align: center; + font-style: normal; + } + } + + // .otherBgIcon { + // width: 76px; + // height: 51px; + // position: absolute; + // top: 29px; + // right: 4px; + // background-image: url(../../../assets/detail/otherBgIcon.png); + // background-repeat: no-repeat; + // background-size: 100% 100%; + // } + } + + .SummaryOfIntegralGrowthValueOtherItemSelect { + background-image: url('../../../assets/detail/staticSumTotalBg.png'); + background-size: 100% 100%; + background-repeat: no-repeat; + + .otherItemTitle { + font-family: PingFangSC, PingFang SC; + font-weight: 600; + font-size: 16px; + color: #fff; + line-height: 18px; + text-align: left; + font-style: normal; + } + + .otherItemValue { + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 32px; + color: #fff; + line-height: 38px; + text-align: left; + margin-top: 17px; + font-style: normal; + + .otherItemValueUnit { + + font-family: DINAlternate, DINAlternate; + font-weight: bold; + font-size: 14px; + color: #fff; + line-height: 20px; + text-align: left; + margin-top: 17px; + font-style: normal; + } + } + + .addLabel { + color: #fff; + } + + .otherItemAddBox { + + .addValue { + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 14px; + color: #fff; + line-height: 16px; + text-align: center; + font-style: normal; + } + } + } + } + } + + } +} \ No newline at end of file diff --git a/src/pages/travelMember/SummaryOfIntegralGrowthValue/index.tsx b/src/pages/travelMember/SummaryOfIntegralGrowthValue/index.tsx new file mode 100644 index 0000000..61d9028 --- /dev/null +++ b/src/pages/travelMember/SummaryOfIntegralGrowthValue/index.tsx @@ -0,0 +1,254 @@ +// 积分成长值汇总表 +import { connect, CurrentUser } from "umi"; +import { ConnectState } from "@/models/connect"; +import { useEffect, useRef, useState } from "react"; +import { Button, Col, Drawer, FormInstance, Row, Spin } from "antd"; +import ProForm, { ProFormSelect } from "@ant-design/pro-form"; +import './SummaryOfIntegralGrowthValue.less' +import { handeGetMembershipCount } from "../service"; +import session from "@/utils/session"; +import ProTable, { ActionType } from "@ant-design/pro-table"; +import MemberInfor from "../memberInfor"; + +const SummaryOfIntegralGrowthValue: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => { + const { currentUser } = props + const formRef = useRef(); + const actionRef = useRef(); + + // 选择的tab + const [selectPageTab, setSelectPageTab] = useState(1) + // 会员类型数据 + const [membershipType, setMembershipType] = useState() + // 会员等级数据 + const [membershipLevel, setMembershipLevel] = useState() + // 会员类型数量 + const [membershipTypeTotal, setMembershipTypeTotal] = useState(0) + // 会员等级数量 + const [membershipLevelTotal, setmembershipLevelTotal] = useState(0) + + // 显示详情抽屉 + const [showDetail, setShowDetail] = useState(false) + const [currentRow, setCurrentRow] = useState() + // 抽屉显示的标题 + const [currentDrawerTitle, setCurrentDrawerTitle] = useState() + // 1 是 会员类型 2是 会员等级 + const [searchType, setSearchType] = useState() + // 对应的枚举类型 + const [valueType, setValueType] = useState() + // 显示加载效果 + const [showLoading, setShowLoading] = useState(false) + + let MEMBERSHIPLEVELYNObj = session.get('MEMBERSHIPLEVELYNObj') + let MEMBERSHIPTYPEYNObj = session.get('MEMBERSHIPTYPEYNObj') + + const handleGetData = async (formData?: any) => { + console.log('formDataformDataformData', formData); + + const req: any = { + CalcType: 1, // 会员类型 + OwnerUnitId: currentUser?.OwnerUnitId, + ExcludeTest: formData ? formData?.ExcludeTest === 1 ? true : false : true, + StartDate: "", + EndDate: "", + MembershipType: "", + MembershipLevel: "" + } + const req2: any = { + CalcType: 2,// 会员等级 + OwnerUnitId: currentUser?.OwnerUnitId, + ExcludeTest: formData ? formData?.ExcludeTest === 1 ? true : false : true, + StartDate: "", + EndDate: "", + MembershipType: "", + MembershipLevel: "" + } + setShowLoading(true) + const data = await handeGetMembershipCount(req) + const data2 = await handeGetMembershipCount(req2) + setShowLoading(false) + console.log('datadatadatadata', data); + console.log('data2data2data2', data2); + + setMembershipType(data.List) + setMembershipLevel(data2.List) + setMembershipTypeTotal(data.OtherData) + setmembershipLevelTotal(data2.OtherData) + } + + // 点击事件 + const handleShowTableData = async (type: number, memberType: any) => { + // type 1 的话是 会员类型 2 的话是 会员等级 memberType 对应的枚举值 + setCurrentDrawerTitle(`${type === 1 ? '会员类型' : type === 2 ? '会员等级' : ''}【${type === 1 ? MEMBERSHIPTYPEYNObj && memberType ? MEMBERSHIPTYPEYNObj[memberType] : '' : type === 2 ? MEMBERSHIPLEVELYNObj && memberType ? MEMBERSHIPLEVELYNObj[memberType] : '' : ''}】`) + setSearchType(type) + setValueType(memberType) + setShowDetail(true) + } + + useEffect(() => { + handleGetData() + }, []) + + return ( +
+ { + showLoading ? +
+
+ + 加载中... +
+
: '' + } + +
+ {/*
+
{ + setSelectPageTab(1) + }}>会员类型
+
{ + setSelectPageTab(2) + }}>会员等级
+
*/} + + + + { + console.log('valuesvaluesvaluesvalues', values); + handleGetData(values) + }} + > + + + + + +
+ + +
+ +
+ +
+ + +
+ { + membershipType && membershipType.length > 0 ? + <> +
+
会员类型{membershipTypeTotal ? `(${membershipTypeTotal}人)` : ""}
+
+ + + +
+
+ { + membershipType.map((item: any) => { + return
{ + handleShowTableData(1, item.label) + }}> +
{item.label === '0' ? '未授权用户' : MEMBERSHIPTYPEYNObj && item.label ? MEMBERSHIPTYPEYNObj[item.label] : ''}
+
{item.value}
+
占比
+
+ {item.key ? item.key + '%' : ""} +
+
+ }) + } + +
+
+ + : "" + } + + + { + membershipLevel && membershipLevel.length > 0 ? + <> +
+
会员等级{membershipLevelTotal ? `(${membershipLevelTotal}人)` : ""}
+
+ + +
+
+ { + membershipLevel.map((item: any) => { + return
{ + handleShowTableData(2, item.label) + }}> +
{item.label === '0' ? '未授权用户' : MEMBERSHIPLEVELYNObj && item.label ? MEMBERSHIPLEVELYNObj[item.label] : ''}
+
{item.value}
+
占比
+
+ {item.key ? item.key + '%' : ""} +
+
+ }) + } + +
+
+ + : "" + } +
+ + + { + setSearchType(null) + setValueType(null) + setShowDetail(false) + }} + > + + +
+ ) +} + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.currentUser +}))(SummaryOfIntegralGrowthValue); \ No newline at end of file diff --git a/src/pages/travelMember/memberInfor/index.tsx b/src/pages/travelMember/memberInfor/index.tsx index 43c547d..48b8487 100644 --- a/src/pages/travelMember/memberInfor/index.tsx +++ b/src/pages/travelMember/memberInfor/index.tsx @@ -27,9 +27,12 @@ import { handleSetlogSave } from "@/utils/format"; import MemberDetail from "./component/memberDetail"; +// searchType 1 会员类型 2 会员等级 +// valueType 对应枚举值 +// isComponent 判断是不是以组件形式 -const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { - const { currentUser } = props +const memberInfor: React.FC<{ currentUser: CurrentUser, searchType?: any, valueType?: any, isComponent?: boolean }> = (props) => { + const { currentUser, searchType, valueType, isComponent } = props const downloadBtnRef = useRef() const draggleRef = React.createRef() const actionRef = useRef(); @@ -677,23 +680,62 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { return value ? `${n} ${value.replace('end', '')}` : '' }) console.log('sortstrsortstrsortstrsortstr', sortstr.toString()); - const req: any = { - SearchParameter: { - PROVINCE_CODE: currentUser?.ProvinceCode || "", - OWNERUNIT_ID: 911, - MEMBERSHIP_TYPE: params?.MEMBERSHIP_TYPE === "0" ? "0" : params?.MEMBERSHIP_TYPE, - MEMBERSHIP_LEVEL: params?.MEMBERSHIP_LEVEL === "0" ? "" : params?.MEMBERSHIP_LEVEL, - MEMBERSHIP_STATE: params?.MEMBERSHIP_STATE - }, - keyWord: { - // PLATE_NUMBER - Key: "MEMBERSHIP_NAME,MEMBERSHIP_MOBILEPHONE,CERTIFICATE_NUMBER,MEMBERSHIP_CARD,MEMBERSHIP_ADDRESS", - value: params?.MEMBERSHIP_NAME || "" - }, - PageIndex: params.current || 1, - PageSize: params?.pageSize, - sortstr: sortstr.length ? sortstr.toString() === "MEMBERGROWTH_VALUE asc" || sortstr.toString() === "MEMBERGROWTH_VALUE desc" ? "" : sortstr.toString() : "", + let req: any = {} + if (isComponent) { + req = { + SearchParameter: { + // PROVINCE_CODE: currentUser?.ProvinceCode || "", + OWNERUNIT_ID: 911, + MEMBERSHIP_TYPE: searchType === 1 ? valueType : '', + MEMBERSHIP_LEVEL: searchType === 2 ? valueType : '', + MEMBERSHIP_STATE: 1000 + }, + keyWord: { + // PLATE_NUMBER + Key: "MEMBERSHIP_NAME,MEMBERSHIP_MOBILEPHONE,CERTIFICATE_NUMBER,MEMBERSHIP_CARD,MEMBERSHIP_ADDRESS", + value: params?.MEMBERSHIP_NAME || "" + }, + PageIndex: params.current || 1, + PageSize: params?.pageSize, + sortstr: sortstr.length ? sortstr.toString() === "MEMBERGROWTH_VALUE asc" || sortstr.toString() === "MEMBERGROWTH_VALUE desc" ? "" : sortstr.toString() : "", + } + + } else { + req = { + SearchParameter: { + // PROVINCE_CODE: currentUser?.ProvinceCode || "", + OWNERUNIT_ID: 911, + MEMBERSHIP_TYPE: params?.MEMBERSHIP_TYPE === "0" ? "0" : params?.MEMBERSHIP_TYPE, + MEMBERSHIP_LEVEL: params?.MEMBERSHIP_LEVEL === "0" ? "" : params?.MEMBERSHIP_LEVEL, + MEMBERSHIP_STATE: params?.MEMBERSHIP_STATE + }, + keyWord: { + // PLATE_NUMBER + Key: "MEMBERSHIP_NAME,MEMBERSHIP_MOBILEPHONE,CERTIFICATE_NUMBER,MEMBERSHIP_CARD,MEMBERSHIP_ADDRESS", + value: params?.MEMBERSHIP_NAME || "" + }, + PageIndex: params.current || 1, + PageSize: params?.pageSize, + sortstr: sortstr.length ? sortstr.toString() === "MEMBERGROWTH_VALUE asc" || sortstr.toString() === "MEMBERGROWTH_VALUE desc" ? "" : sortstr.toString() : "", + } } + // const req: any = { + // SearchParameter: { + // PROVINCE_CODE: currentUser?.ProvinceCode || "", + // OWNERUNIT_ID: 911, + // MEMBERSHIP_TYPE: params?.MEMBERSHIP_TYPE === "0" ? "0" : params?.MEMBERSHIP_TYPE, + // MEMBERSHIP_LEVEL: params?.MEMBERSHIP_LEVEL === "0" ? "" : params?.MEMBERSHIP_LEVEL, + // MEMBERSHIP_STATE: params?.MEMBERSHIP_STATE + // }, + // keyWord: { + // // PLATE_NUMBER + // Key: "MEMBERSHIP_NAME,MEMBERSHIP_MOBILEPHONE,CERTIFICATE_NUMBER,MEMBERSHIP_CARD,MEMBERSHIP_ADDRESS", + // value: params?.MEMBERSHIP_NAME || "" + // }, + // PageIndex: params.current || 1, + // PageSize: params?.pageSize, + // sortstr: sortstr.length ? sortstr.toString() === "MEMBERGROWTH_VALUE asc" || sortstr.toString() === "MEMBERGROWTH_VALUE desc" ? "" : sortstr.toString() : "", + // } setSearchParams(params) handleSetlogSave(`查看了会员账户管理列表`) @@ -716,7 +758,8 @@ const memberInfor: React.FC<{ currentUser: CurrentUser }> = (props) => { // const allData = await handleGetMEMBERSHIPList(allReq) // setTableData(allData) - }} + } + } toolbar={{ actions: [] }} diff --git a/src/pages/travelMember/service.ts b/src/pages/travelMember/service.ts index a5c48b7..bdea0bc 100644 --- a/src/pages/travelMember/service.ts +++ b/src/pages/travelMember/service.ts @@ -982,4 +982,45 @@ export async function handeDeleteMembershipRecord(params: any) { return data } return data -} \ No newline at end of file +} + + +// 请求门店信息 +export async function handeGetSERVERPARTSHOPList(params: any) { + const data = await requestEncryption(`/BaseInfo/GetSERVERPARTSHOPList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return data + } + return data.Result_Data +} + + +// 统计积分成长值汇总报表 +export async function handeGetMembershipCount(params: any) { + const data = await requestEncryption(`/Member/GetMembershipCount`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return data + } + return data.Result_Data +} + + +// 营销活动销售额统计 +export async function handeGetMarketingSummary(params: any) { + const data = await requestEncryption(`/OnlineOrder/GetMarketingSummary`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return data + } + return data.Result_Data +} + +