This commit is contained in:
ylj20011123 2025-07-29 20:03:02 +08:00
parent 158052ef6e
commit edeca3457f
19 changed files with 1594 additions and 337 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ant-design-pro",
"version": "4.5.8",
"version": "4.5.10",
"private": true,
"description": "An out-of-box UI solution for enterprise applications",
"scripts": {
@ -19,7 +19,7 @@
"lint:prettier": "prettier --check \"src/**/*\" --end-of-line auto",
"lint:style": "stylelint --fix \"src/**/*.less\" --syntax less",
"prettier": "prettier -c --write \"src/**/*\"",
"start": "cross-env UMI_ENV=dev umi dev",
"start": "cross-env NODE_OPTIONS=--max-old-space-size=8192 UMI_ENV=dev umi dev",
"start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev",
"start:no-mock": "cross-env MOCK=none UMI_ENV=dev umi dev",
"start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev",

View File

@ -32,6 +32,7 @@ import upMenu from '@/assets/tab/upMenu.svg'
import { getFieldEnum, getFieldEnumTravel, getFieldEnumTree, getFieldGetFieEnumList, getTravelFieldEnumTree, handleGetFieldEnumTreeTravel, handleGetNestingFIELDENUMList } from "@/services/options";
import { handleGetServerpartTree } from '@/pages/basicManage/serverpartAssets/service';
import { handeGetNestingFIELDENUMList } from '@/pages/travelMember/service';
import list from '@/pages/Invoicing/list';
const { TabPane } = Tabs;
@ -203,6 +204,23 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
return obj
}
// 把树形的数据 全部层级的value 和label都匹配上
const flattenGrowthType = (list: any[], nameKey: string, valueKey: any) => {
const result: Record<string, string> = {}
function traverse(items: any[]) {
items.forEach(item => {
result[item[valueKey]] = item[nameKey]
if (Array.isArray(item.children) && item.children.length > 0) {
traverse(item.children)
}
})
}
traverse(list)
return result
}
// 拿到所有枚举的方法
const handleGetAllFieldEnum = async () => {
@ -300,7 +318,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
obj[item.FIELDENUM_VALUE] = item.FIELDENUM_NAME
})
session.set('GROWTHTYPEList', list);
session.set('GROWTHTYPEObj', obj);
session.set('GROWTHTYPEObj', flattenGrowthType(GROWTHTYPE, 'FIELDENUM_NAME', 'FIELDENUM_VALUE'));
session.set('GROWTHTYPETree', GROWTHTYPE);
}
})
@ -391,7 +409,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
obj[item.value] = item.label
})
session.set('SCORETYPEList', list);
session.set('SCORETYPEObj', obj);
session.set('SCORETYPEObj', flattenGrowthType(SCORETYPE, 'label', 'value'));
session.set('SCORETYPETree', SCORETYPE);
}
})

View File

@ -1,6 +1,6 @@
import { connect } from "umi";
import type { ConnectState } from "@/models/connect";
import { Col, FormInstance, Modal, Row } from "antd";
import { Col, FormInstance, message, Modal, Row } from "antd";
import { useRef, useState } from "react";
import Draggable from "react-draggable";
import React from "react";
@ -9,7 +9,7 @@ import moment from 'moment'
import orderIcon from '@/assets/detail/orderIcon.png'
import closeIcon from '@/assets/detail/closeIcon.png'
import ProTable from "@ant-design/pro-table";
import { handeGetSALEBILLList, handeGetSALEDETAILList } from "../../service";
import { handeGetSALEADDRESSList, handeGetSALEBILLDetail, handeGetSALEBILLList, handeGetSALEDETAILDetail, handeGetSALEDETAILList } from "../../service";
import './style.less'
type DetailProps = {
@ -139,20 +139,80 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy
layout={'horizontal'}
formRef={modalRef}
submitter={false}
// request={async () => {
// console.log('currentRow', currentRow);
// if (currentRow) {
// return {
// ...currentRow
// }
// } else {
// return {}
// }
// }}
initialValues={currentRow ? {
...currentRow,
ORDER_DATE: currentRow?.ORDER_DATE ? moment(currentRow?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : ''
} : {}}
request={async () => {
console.log('currentRow', currentRow);
if (currentRow?.SALEBILL_ID) {
const req: any = {
SALEBILLId: currentRow?.SALEBILL_ID
}
const data = await handeGetSALEBILLDetail(req)
// 查地址信息
const addressData = await handeGetSALEADDRESSList({
searchParameter: {
SALEBILL_ID: currentRow?.SALEBILL_ID
},
PageIndex: 1,
PageSize: 10,
})
console.log('dasdas44444', addressData);
let addressObj: any = addressData[0]
return {
...data,
ORDER_PERSON: addressObj?.USER_NAME || "",
ORDER_ADDRESS: `${addressObj?.ADDRESS || ""}${addressObj?.DOORPLATE || ""}`,
CURRENT_POINT: currentRow?.CURRENT_POINT || ""
}
} else {
const req: any = {
searchParameter: {
SALEBILL_CODE: currentRow?.TICKET_CODE
},
PageIndex: 1,
PageSize: 1,
}
const data = await handeGetSALEBILLList(req)
console.log('dasdas22222', data);
if (data.List && data.List.length > 0) {
let obj: any = data.List[0]
const req: any = {
SALEBILLId: obj?.SALEBILL_ID
}
const res = await handeGetSALEBILLDetail(req)
console.log('dasdas33333', res);
// 查地址信息
const addressData = await handeGetSALEADDRESSList({
searchParameter: {
SALEBILL_ID: obj?.SALEBILL_ID
},
PageIndex: 1,
PageSize: 10,
})
console.log('dasdas44444', addressData);
let addressObj: any = addressData.List && addressData.List.length > 0 ? addressData.List[0] : {}
console.log('dmsakldmas', {
...res,
ORDER_PERSON: addressObj?.USER_NAME || "",
ORDER_ADDRESS: `${addressObj?.ADDRESS || ""}${addressObj?.DOORPLATE || ""}`,
});
return {
...res,
ORDER_PERSON: addressObj?.USER_NAME || "",
ORDER_ADDRESS: `${addressObj?.ADDRESS || ""}${addressObj?.DOORPLATE || ""}`,
CURRENT_POINT: currentRow?.CURRENT_POINT || ""
}
} else {
message.error('当前订单数据异常,请联系管理员!')
return {}
}
}
}}
// initialValues={currentRow ? {
// ...currentRow,
// ORDER_DATE: currentRow?.ORDER_DATE ? moment(currentRow?.ORDER_DATE).format('YYYY-MM-DD HH:mm:ss') : ''
// } : {}}
>
<div className="bookingOrderModalTop">
<div className="modalTopLeft">
@ -169,7 +229,7 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy
</div>
<div className="bookingOrderModalCenter">
<div className="smallTitle"></div>
{/* <div className="smallTitle">订单信息</div> */}
<Row gutter={8}>
<Col span={8} className="memberInfoDetailItem">
@ -180,36 +240,6 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy
style={{ marginBottom: '16px' }}
/>
</Col>
{
detailType === 'food' ?
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"SERVERPART_NAME"}
label={"服务区"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col> : ""
}
{
detailType === 'food' ?
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"SHOPNAME"}
label={"门店"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col> : ""
}
<Col span={8} className="memberInfoDetailItem">
<ProFormSelect
name={"CHANNEL_TYPE"}
label={"支付渠道"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"ORDER_DATE"}
@ -218,70 +248,6 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"RECORD_COUNT"}
label={"商品种类"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"TOTAL_COUNT"}
label={"商品件数"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem SALEBILLSTATE">
<ProFormText
name={"ORDER_AMOUNT"}
label={"订单金额"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"COUPON_AMOUNT"}
label={"优惠金额"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"PACK_AMOUNT"}
label={"打包金额"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"CONSUME_SCORE"}
label={"使用积分"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem SALEBILLSTATE">
<ProFormText
name={"PAY_AMOUNT"}
label={"实付金额"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"COST_AMOUNT"}
label={"成本金额"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem SALEBILLSTATE">
{
detailType === 'food' ?
@ -319,16 +285,42 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy
/>
}
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormSelect
name={"COMMENT_STATE"}
label={"订单评价状态"}
<Col span={8} className="memberInfoDetailItem SALEBILLSTATE">
<ProFormText
name={"ORDER_AMOUNT"}
label={"订单金额"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem SALEBILLSTATE">
<ProFormText
name={"PAY_AMOUNT"}
label={"实付金额"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"COUPON_AMOUNT"}
label={"优惠金额"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
{
detailType === 'food' ?
<>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"PACK_AMOUNT"}
label={"打包金额"}
readonly
style={{ marginBottom: '16px' }}
options={[
{ label: "未评价", value: 0 },
{ label: "已评价", value: 1 },
]}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
@ -363,6 +355,16 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy
style={{ marginBottom: '16px' }}
/>
</Col>
</> :
<>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"COST_AMOUNT"}
label={"成本金额"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"ORDER_PERSON"}
@ -371,6 +373,99 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"ORDER_ADDRESS"}
label={"收货地址"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
</>
}
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"TOTAL_COUNT"}
label={"商品件数"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormSelect
name={"PAY_METHOD"}
// name={"CHANNEL_TYPE"}
label={"支付方式"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormSelect
name={"COMMENT_STATE"}
label={"订单评价状态"}
readonly
style={{ marginBottom: '16px' }}
options={[
{ label: "未评价", value: 0 },
{ label: "已评价", value: 1 },
]}
/>
</Col>
{
detailType === 'food' ?
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"SERVERPART_NAME"}
label={"服务区"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col> : ""
}
{
detailType === 'food' ?
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"SHOPNAME"}
label={"门店"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col> : ""
}
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"RECORD_COUNT"}
label={"商品种类"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"CURRENT_POINT"}
label={"获得积分"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
<Col span={8} className="memberInfoDetailItem">
<ProFormText
name={"CONSUME_SCORE"}
label={"获得成长值"}
readonly
style={{ marginBottom: '16px' }}
/>
</Col>
</Row>
</div>
</ProForm>
@ -461,7 +556,7 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy
/>
</Modal>
</div>
</div >
)
}

View File

@ -50,6 +50,24 @@ const ConsumptionRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?
const [searchParams, setSearchParams] = useState<any>()
// 显示详情抽屉
const [showDetailDrawer, setShowDetailDrawer] = useState<boolean>(false)
// 当前查询的文字
const [currentSearchText, setCurrentSearchText] = useState<string>('')
// 给颜色标红的
const highlightText = (text: string, searchText: string) => {
if (!text || !searchText) return text;
const regex = new RegExp(`(${searchText})`, 'gi');
const parts = text.split(regex);
return (
<span>
{parts.map((part, i) =>
part.toLowerCase() === searchText.toLowerCase() ?
<span key={i} style={{ color: 'red' }}>{part}</span> :
part
)}
</span>
);
};
const columns: any = [
{
@ -106,7 +124,7 @@ const ConsumptionRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?
setShowDetailDrawer(true)
handleSetlogSave(`查看${record?.MEMBERSHIP_NAME}${record?.MEMBERSHIP_ID}】会员信息`)
}}>
{record?.MEMBERSHIP_NAME}
{highlightText(record?.MEMBERSHIP_NAME, currentSearchText)}
</a> : "-"
}
},
@ -117,6 +135,9 @@ const ConsumptionRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?
hideInSearch: true,
align: 'center',
ellipsis: true,
render: (_, record) => {
return highlightText(record?.MEMBERSHIP_MOBILEPHONE, currentSearchText)
}
},
{
title: "会员等级",
@ -151,7 +172,10 @@ const ConsumptionRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?
return record?.TICKET_CODE ? <a onClick={() => {
setCurrentRow(record)
setShowOrderModal(true)
}}>{record?.TICKET_CODE}</a> : "-"
}}>
{/* {record?.TICKET_CODE} */}
{highlightText(record?.TICKET_CODE, currentSearchText)}
</a> : "-"
}
},
{
@ -306,7 +330,7 @@ const ConsumptionRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?
expandable={{
expandRowByClick: true
}}
headerTitle={<PageTitleBox props={props} />}
headerTitle={isComponent ? '' : <PageTitleBox props={props} />}
scroll={{ x: '100%', y: isComponent ? '300px' : 'calc(100vh - 430px)' }}
search={isComponent ? false : { span: 6 }}
options={isComponent ? false : {
@ -354,6 +378,7 @@ const ConsumptionRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?
}
const data = await handleGetCONSUMPTIONRECORDList(req)
setCurrentSearchText(params?.searchText || '')
handleSetlogSave(`点击查询按钮`)
if (data.List && data.List.length > 0) {
return { data: data.List, success: true, total: data.TotalCount }

View File

@ -2,7 +2,7 @@
import { connect } from "umi";
import type { CurrentUser } from "umi";
import type { ConnectState } from "@/models/connect";
import React, { useRef, useState } from "react";
import React, { useImperativeHandle, useRef, useState } from "react";
import ProCard from "@ant-design/pro-card";
import { MenuFoldOutlined } from "@ant-design/icons";
import type { FormInstance } from "antd";
@ -22,8 +22,8 @@ import OrderDetailModal from "../BookingMealOrder/components/orderDetailModal";
import MemberDetail from "../memberInfor/component/memberDetail";
const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boolean, parentDetail?: any }> = (props) => {
const { currentUser, isComponent, parentDetail } = props
const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boolean, parentDetail?: any, searchReq?: any, onRef?: any, height?: any }> = (props) => {
const { currentUser, isComponent, parentDetail, searchReq, onRef, height } = props
const downloadBtnRef = useRef<any>()
const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
@ -97,7 +97,7 @@ const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?
align: 'center',
ellipsis: true,
render: (_, record) => {
return isComponent ? record?.MEMBERSHIP_NAME || "" : record?.MEMBERSHIP_NAME ? <a onClick={() => {
return isComponent && !searchReq ? record?.MEMBERSHIP_NAME || "" : record?.MEMBERSHIP_NAME ? <a onClick={() => {
setCurrentRow(record)
setShowDetailDrawer(true)
handleSetlogSave(`查看${record?.MEMBERSHIP_NAME}${record?.MEMBERSHIP_ID}】会员信息`)
@ -240,7 +240,9 @@ const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?
setCurrentRow(null)
setShowDetailDrawer(false)
}
useImperativeHandle(onRef, () => ({
actionRef
}));
return (
@ -266,8 +268,8 @@ const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?
expandable={{
expandRowByClick: true
}}
headerTitle={<PageTitleBox props={props} />}
scroll={{ x: '100%', y: isComponent ? '300px' : 'calc(100vh - 430px)' }}
headerTitle={isComponent ? '' : <PageTitleBox props={props} />}
scroll={{ x: '100%', y: isComponent ? height ? `${height}` : '300px' : 'calc(100vh - 430px)' }}
search={isComponent ? false : { span: 6 }}
options={isComponent ? false : {
density: true,
@ -275,7 +277,11 @@ const GrowthValueRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?
setting: true
}}
request={async (params) => {
const req: any = isComponent ? {
const req: any = isComponent ? searchReq ? {
...searchReq,
PageIndex: params?.current,
PageSize: 20,
} : {
searchParameter: {
OWNERUNIT_ID: 911,
SCORESETTING_STATE: 1,

View File

@ -29,6 +29,7 @@ import GrowthConfig from './components/growthConfig';
import { handleSetlogSave } from '@/utils/format';
import MembershipTypeConfig from './components/MEMBERSHIPTYPEConfig';
const { confirm } = Modal;
const GrowthValueRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
@ -60,6 +61,10 @@ const GrowthValueRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }>
const [defaultMemberLevel, setDefaultMemberLevel] = useState<any>(MEMBERSHIPLEVELYNList)
// 晋升后会员等级列表
const [promotionMemberLevel, setPromotionMemberLevel] = useState<any>(MEMBERSHIPLEVELYNList)
// 先存表格数据
const [tableData, setTableData] = useState<any>([]);
// 判断是不是第一次进入页面
const [isFirst, setIsFirst] = useState<boolean>(true)
const onDraggaleStart = (event, uiData) => {
const { clientWidth, clientHeight } = window.document.documentElement;
@ -88,23 +93,34 @@ const GrowthValueRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }>
request: () => {
let GROWTHTYPEList = session.get('GROWTHTYPEList')
return GROWTHTYPEList
}
},
{
dataIndex: 'GROWTHSETTING_NAME',
title: '规则名称',
align: 'center',
width: 120,
hideInSearch: true,
hideInDescriptions: true,
render: (_, record) => {
return record?.GROWTHSETTING_NAME ? <a onClick={() => {
return record?.GROWTHSETTING_TYPE && GROWTHTYPEObj && GROWTHTYPEObj[record?.GROWTHSETTING_TYPE] ? <a onClick={() => {
console.log('recordrecordrecord', record);
handleSetlogSave(`查看【${record?.GROWTHSETTING_NAME}】规则详情`)
setCurrentRow({ ...record });
handleModalVisible(true);
}}>{record?.GROWTHSETTING_NAME}</a> : '-'
}}>
{GROWTHTYPEObj[record?.GROWTHSETTING_TYPE]}
</a> : '-'
}
},
// {
// dataIndex: 'GROWTHSETTING_NAME',
// title: '规则名称',
// align: 'center',
// width: 120,
// hideInSearch: true,
// hideInDescriptions: true,
// render: (_, record) => {
// return record?.GROWTHSETTING_NAME ? <a onClick={() => {
// handleSetlogSave(`查看【${record?.GROWTHSETTING_NAME}】规则详情`)
// setCurrentRow({ ...record });
// handleModalVisible(true);
// }}>{record?.GROWTHSETTING_NAME}</a> : '-'
// }
// },
{
dataIndex: 'MEMBERSHIP_TYPE',
title: '会员类型',
@ -192,12 +208,14 @@ const GrowthValueRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }>
// align: 'center',
// hideInSearch: true,
// },
// {
// dataIndex: 'GROWTHSETTING_DESC',
// title: '备注说明',
// align: 'center',
// hideInSearch: true,
// },
{
dataIndex: 'GROWTHSETTING_DESC',
title: '备注说明',
width: 250,
ellipsis: true,
align: 'center',
hideInSearch: true,
},
// {
// dataIndex: 'option',
// title: '操作',
@ -248,7 +266,7 @@ const GrowthValueRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }>
const handleAddUpdate = async (res: any) => {
let req: any = {}
if (currentRow?.GROWTHSETTING_ID) {
if (res?.GROWTHSETTING_ID) {
req = {
...currentRow,
...res
@ -278,6 +296,113 @@ const GrowthValueRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }>
};
// 支持会员类型单个选择或者多个选择的
const handleNewAddUpdate = (newValue: any, newList: any) => {
// newValue 表单数据 会员类型的数组 选择单个或所有类型
// 入参列表
let reqList: any = []
// 入参列表的提示信息 更新的
let reqListUpdateMsg: any = []
// 入参列表的提示信息 新增的
let reqListAddMsg: any = []
// for 循环 遍历去调用 批量新增
for (let i = 0; i < newList.length; i++) {
let nowItem = newList[i];
// 找到当前项的会员类型 会员等级 规则类型 外面表格数据是否已经存在了
console.log('nowItemnowItemnowItemnowItem', nowItem);
console.log('table', tableData);
let req: any = {}
if (tableData && tableData.length > 0) {
tableData.forEach((item: any) => {
// 判断 会员类型、会员等级、规则类型 是否一致
if (Number(item.MEMBERSHIP_TYPE) === Number(nowItem.value) && Number(newValue?.MEMBERSHIP_LEVEL) === Number(item.MEMBERSHIP_LEVEL) && Number(newValue?.GROWTHSETTING_TYPE) === Number(item.GROWTHSETTING_TYPE) && item.GROWTHSETTING_STATE === 1) {
console.log('itemitemitemitem', item);
req = {
...item
}
}
})
}
// 如果req 里面 有 GROWTHSETTING_ID 说明是更新的
console.log('reqreqreqreqreq', req);
if (req?.GROWTHSETTING_ID) {
reqList.push({
...req,
...newValue,
MEMBERSHIP_TYPE: nowItem.value
})
reqListUpdateMsg.push(`${nowItem.label}${GROWTHTYPEObj[newValue.GROWTHSETTING_TYPE]}${MEMBERSHIPLEVELYNObj[newValue.PROMOTION_LEVEL]}`)
} else {
req = {
...newValue,
MEMBERSHIP_TYPE: nowItem.value
}
reqList.push(req)
reqListAddMsg.push(`${nowItem.label}${GROWTHTYPEObj[newValue.GROWTHSETTING_TYPE]}${MEMBERSHIPLEVELYNObj[newValue.PROMOTION_LEVEL]}`)
}
}
console.log('reqListreqListreqListreqList', reqList);
console.log('reqListUpdateMsgreqListUpdateMsgreqListUpdateMsg', reqListUpdateMsg);
console.log('reqListAddMsgreqListAddMsgreqListAddMsgreqListAddMsg', reqListAddMsg);
confirm({
title: '提示',
content: `本次操作将 ${reqListUpdateMsg && reqListUpdateMsg.length > 0 ? '更新:' + reqListUpdateMsg.toString() : ""}${reqListAddMsg && reqListAddMsg.length > 0 ? ',新增:' + reqListAddMsg.toString() : ""},是否确认此次操作?`,
width: 600,
icon: <ExclamationCircleOutlined />,
async onOk() {
let isOK: boolean = await handleBatchUpdate(reqList)
if (isOK) {
formRef?.current?.resetFields()
setCurrentRow(undefined)
handleModalVisible(false)
actionRef.current?.reload()
}
},
onCancel() {
},
});
}
// 批量更新的方法
const handleBatchUpdate = async (reqList: any) => {
// reqList 入参列表
for (let i = 0; i < reqList.length; i++) {
let res: any = reqList[i]
let req: any = {}
if (res?.GROWTHSETTING_ID) {
req = {
...res
}
} else {
req = {
...res,
ADDTIME: moment().format('YYYY-MM-DD HH:mm:ss'),
STAFF_ID: currentUser?.ID,
STAFF_NAME: currentUser?.Name,
OWNERUNIT_ID: currentUser?.OwnerUnitId,
OWNERUNIT_NAME: currentUser?.OwnerUnitName,
PROVINCE_CODE: currentUser?.ProvinceCode
}
}
const data = await handleSynchroGROWTHSETTING(req);
console.log('datadatadatadata', data);
handleSetlogSave(`${currentRow?.GROWTHSETTING_ID ? '更新' : '新增'}${data.Result_Data.GROWTHSETTING_NAME}】成功`)
}
return true
}
return (
<PageContainer header={{
title: '',
@ -310,6 +435,10 @@ const GrowthValueRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }>
const data = await handleGetGROWTHSETTINGList(req);
if (data.List && data.List.length > 0) {
handleSetlogSave(`查看了成长规则配置列表`)
if (isFirst) {
setTableData(data.List);
setIsFirst(false)
}
return { data: data.List, success: true, total: data.TotalCount }
}
return { data: [], success: true }
@ -458,24 +587,145 @@ const GrowthValueRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }>
submitter={false}
preserve={false}
labelCol={{ style: { width: 120 } }}
initialValues={{
initialValues={currentRow?.GROWTHSETTING_ID ? {
...currentRow,
SCORESETTING_STATE: (currentRow?.GROWTHSETTING_STATE || currentRow?.GROWTHSETTING_STATE === 0) ? currentRow?.GROWTHSETTING_STATE : 1,
GROWTHSETTING_TYPE: currentRow?.GROWTHSETTING_TYPE ? currentRow?.GROWTHSETTING_TYPE.toString() : "",
MEMBERSHIP_LEVEL: currentRow?.MEMBERSHIP_LEVEL ? currentRow?.MEMBERSHIP_LEVEL.toString() : "",
// MEMBERSHIP_LEVEL: currentRow?.MEMBERSHIP_LEVEL ? currentRow?.MEMBERSHIP_LEVEL.toString() : "",
PROMOTION_LEVEL: currentRow?.PROMOTION_LEVEL ? currentRow?.PROMOTION_LEVEL.toString() : "",
MEMBERSHIP_TYPE: currentRow?.MEMBERSHIP_TYPE ? currentRow?.MEMBERSHIP_TYPE.toString() : "",
// MEMBERSHIP_TYPE: currentRow?.MEMBERSHIP_TYPE ? currentRow?.MEMBERSHIP_TYPE.toString() : "",
} : {
MEMBERSHIP_TYPE: 1,
MEMBERSHIP_LEVEL: 1000,
PROMOTION_LEVEL: '2000',
GROWTH_VALUE: 1,
// GROWTHTOTAL_CAP: 1,
GROWTHSETTING_TYPE: '90'
}}
onFinish={async (values) => {
let newValue: any = { ...values };
if (currentRow) {
// 编辑数据
newValue = { ...values, GROWTHSETTING_ID: currentRow.GROWTHSETTING_ID };
newValue = { ...currentRow, ...values, GROWTHSETTING_ID: currentRow.GROWTHSETTING_ID };
}
await handleAddUpdate(newValue);
console.log('newValuenewValuenewValue', newValue);
let newList: any = []
if (newValue?.MEMBERSHIP_TYPE === 1) {
let list: any = JSON.parse(JSON.stringify(MEMBERSHIPTYPEYNList))
if (list && list.length > 0) {
list.forEach((item: any) => {
if (item.value < 9000 && Number(item.value) !== 1) {
newList.push({
label: item.label,
value: Number(item.value)
})
}
})
}
console.log('newListnewListnewListnewList', newList);
} else {
newList = [{ label: MEMBERSHIPTYPEYNObj[newValue.MEMBERSHIP_TYPE], value: newValue.MEMBERSHIP_TYPE }]
}
// 判断会员类型 是不是选了所有类型 所有类型的话 需要遍历操作下 不然就走正常的
handleNewAddUpdate(newValue, newList)
handleConfirmLoading(false)
// return
// if (newValue?.MEMBERSHIP_TYPE === 1) {
// let list: any = JSON.parse(JSON.stringify(MEMBERSHIPTYPEYNList))
// let newList: any = []
// if (list && list.length > 0) {
// list.forEach((item: any) => {
// if (item.value < 9000 && Number(item.value) !== 1) {
// newList.push({
// label: item.label,
// value: Number(item.value)
// })
// }
// })
// }
// console.log('newListnewListnewListnewList', newList);
// // 入参列表
// let reqList: any = []
// // 入参列表的提示信息 更新的
// let reqListUpdateMsg: any = []
// // 入参列表的提示信息 新增的
// let reqListAddMsg: any = []
// // for 循环 遍历去调用 批量新增
// for (let i = 0; i < newList.length; i++) {
// let nowItem = newList[i];
// // 找到当前项的会员类型 会员等级 规则类型 外面表格数据是否已经存在了
// console.log('nowItemnowItemnowItemnowItem', nowItem);
// console.log('table', tableData);
// let req: any = {}
// if (tableData && tableData.length > 0) {
// tableData.forEach((item: any) => {
// // 判断 会员类型、会员等级、规则类型 是否一致
// if (Number(item.MEMBERSHIP_TYPE) === Number(nowItem.value) && Number(newValue?.MEMBERSHIP_LEVEL) === Number(item.MEMBERSHIP_LEVEL) && Number(newValue?.GROWTHSETTING_TYPE) === Number(item.GROWTHSETTING_TYPE)) {
// req = {
// ...item
// }
// }
// })
// }
// // 如果req 里面 有 GROWTHSETTING_ID 说明是更新的
// console.log('reqreqreqreqreq', req);
// if (req?.GROWTHSETTING_ID) {
// reqList.push({
// ...req,
// ...newValue,
// MEMBERSHIP_TYPE: nowItem.value
// })
// reqListUpdateMsg.push(`${nowItem.label}【${GROWTHTYPEObj[newValue.GROWTHSETTING_TYPE]}】${MEMBERSHIPLEVELYNObj[newValue.PROMOTION_LEVEL]}`)
// } else {
// req = {
// ...newValue,
// MEMBERSHIP_TYPE: nowItem.value
// }
// reqList.push(req)
// reqListAddMsg.push(`${nowItem.label}【${GROWTHTYPEObj[newValue.GROWTHSETTING_TYPE]}】${MEMBERSHIPLEVELYNObj[newValue.PROMOTION_LEVEL]}`)
// }
// }
// console.log('reqListreqListreqListreqList', reqList);
// console.log('reqListUpdateMsgreqListUpdateMsgreqListUpdateMsg', reqListUpdateMsg);
// console.log('reqListAddMsgreqListAddMsgreqListAddMsgreqListAddMsg', reqListAddMsg);
// confirm({
// title: '提示',
// content: `本次操作将 ${reqListUpdateMsg && reqListUpdateMsg.length > 0 ? '更新:' + reqListUpdateMsg.toString() : ""}${reqListAddMsg && reqListAddMsg.length > 0 ? ',新增:' + reqListAddMsg.toString() : ""},是否确认此次操作?`,
// width: 600,
// icon: <ExclamationCircleOutlined />,
// async onOk() {
// let isOK: boolean = await handleBatchUpdate(reqList)
// if (isOK) {
// formRef?.current?.resetFields()
// setCurrentRow(undefined)
// handleModalVisible(false)
// actionRef.current?.reload()
// }
// },
// onCancel() {
// },
// });
// } else {
// await handleAddUpdate(newValue);
// }
}}
>
<Row gutter={8}>
@ -491,12 +741,20 @@ const GrowthValueRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }>
]}
request={() => {
let GROWTHTYPEList = session.get('GROWTHTYPEList')
return GROWTHTYPEList
let newList: any = []
if (GROWTHTYPEList && GROWTHTYPEList.length > 0) {
GROWTHTYPEList.forEach((item: any) => {
if (item.value === '90') {
newList.push(item)
}
})
}
return newList
}}
// options={GROWTHTYPEList}
/>
</Col>
<Col span={12}>
{/* <Col span={12}>
<ProFormText
name="GROWTHSETTING_NAME"
label="规则名称"
@ -507,51 +765,89 @@ const GrowthValueRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }>
}
]}
/>
</Col>
<Col span={12}>
<ProFormSelect
name="MEMBERSHIP_LEVEL"
label="会员等级"
options={defaultMemberLevel}
fieldProps={{
onChange: (e: any) => {
console.log('e', e);
console.log('promotionMemberLevel', promotionMemberLevel);
if (promotionMemberLevel && promotionMemberLevel.length > 0) {
let list: any = JSON.parse(JSON.stringify(promotionMemberLevel))
list.forEach((item: any) => {
item.disabled = false
})
list.forEach((item: any) => {
if (Number(item.value) <= Number(e)) {
item.disabled = true
}
})
setPromotionMemberLevel(list)
}
}
}}
/>
</Col>
</Col> */}
<Col span={12}>
<ProFormSelect
name="MEMBERSHIP_TYPE"
label="会员类型"
// options={MEMBERSHIPTYPEYNList}
request={async () => {
return MEMBERSHIPTYPEYNList
let list: any = JSON.parse(JSON.stringify(MEMBERSHIPTYPEYNList))
let newList: any = []
if (list && list.length > 0) {
list.forEach((item: any) => {
if (item.value < 9000) {
newList.push({
label: item.label,
value: Number(item.value)
})
}
})
}
return newList
}}
/>
</Col>
<Col span={12}>
<ProFormSelect
name="MEMBERSHIP_LEVEL"
label="会员等级"
// options={}
request={async () => {
let list: any = JSON.parse(JSON.stringify(defaultMemberLevel))
let newList: any = []
if (list && list.length > 0) {
list.forEach((item: any) => {
if (Number(item.value) !== 1 && Number(item.value) < 9000) {
newList.push({
label: item.label,
value: Number(item.value),
})
}
})
}
return newList
}}
fieldProps={{
onChange: (e: any) => {
console.log('e', e);
let newList: any = []
if (defaultMemberLevel && defaultMemberLevel.length > 0) {
defaultMemberLevel.forEach((item: any) => {
if (Number(item.value) !== 1 && Number(item.value) < 9000 && Number(e) < Number(item.value)) {
newList.push({
label: item.label,
value: item.value.toString(),
})
}
})
}
formRef.current?.setFieldsValue({ PROMOTION_LEVEL: newList && newList.length > 0 ? newList[0].value : "" })
// console.log('promotionMemberLevel', promotionMemberLevel);
// if (promotionMemberLevel && promotionMemberLevel.length > 0) {
// let list: any = JSON.parse(JSON.stringify(promotionMemberLevel))
// list.forEach((item: any) => {
// item.disabled = false
// })
// list.forEach((item: any) => {
// if (Number(item.value) <= Number(e)) {
// item.disabled = true
// }
// })
// setPromotionMemberLevel(list)
// }
}
}}
/>
</Col>
<Col span={12}>
<ProFormSelect
name="PROMOTION_LEVEL"
label="晋升等级"
options={promotionMemberLevel}
disabled
tooltip="用户晋升后的目标等级,必须选择当前会员等级的下一级"
/>
</Col>
@ -560,6 +856,12 @@ const GrowthValueRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }>
name="GROWTH_VALUE"
label="所需成长值"
tooltip="用户从当前等级晋升到下一等级需要累积的成长值"
rules={[
{
required: true,
message: '请输入所需成长值'
}
]}
/>
</Col>
{/* <Col span={12}>

View File

@ -279,7 +279,7 @@ const MallEvaluationManage: React.FC<{ currentUser: CurrentUser | undefined, isC
formRef={formRef}
bordered
options={false}
headerTitle={<PageTitleBox props={props} />} // 列表表头
headerTitle={isComponent ? '' : <PageTitleBox props={props} />} // 列表表头
actionRef={actionRef}
search={isComponent ? false : { span: 6, labelWidth: 'auto' }}
// 请求数据

View File

@ -14,8 +14,9 @@ import { handleSetlogSave } from "@/utils/format";
type DetailProps = {
currentBigRow: any
currentUser: any
isComponent?: boolean
}
const AddressDetail = ({ currentBigRow, currentUser }: DetailProps) => {
const AddressDetail = ({ currentBigRow, currentUser, isComponent }: DetailProps) => {
const modalActionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
const [province, setProvince] = useState<string>('');
@ -298,7 +299,7 @@ const AddressDetail = ({ currentBigRow, currentUser }: DetailProps) => {
options={false}
scroll={{ x: "100%", y: '500px' }}
columns={drawerColumns}
headerTitle={"用户地址"}
headerTitle={isComponent ? '' : "用户地址"}
actionRef={modalActionRef}
bordered
request={async (params, sorter) => {

View File

@ -13,6 +13,10 @@ import staticSumTotalBg from '@/assets/detail/staticSumTotalBg.png'
import session from "@/utils/session";
import ProForm, { ProFormDateRangePicker } from "@ant-design/pro-form";
import { handleSetlogSave } from "@/utils/format";
import OrderDetailModal from "../BookingMealOrder/components/orderDetailModal";
import MemberDetail from "../memberInfor/component/memberDetail";
import PointsRecordSearch from "../PointsRecordSearch";
import GrowthValueRecordSearch from "../GrowthValueRecordSearch";
@ -20,6 +24,8 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
const { currentUser } = props
const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
const PointsRecordSearchRef = useRef<any>();
const GrowthValueRecordSearchRef = useRef<any>();
// 顶部内容的对象值
const [topData, setTopData] = useState<any>()
@ -32,6 +38,8 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
})
let SCORETYPETree = session.get('SCORETYPETree')
let MEMBERSHIPLEVELYNObj = session.get('MEMBERSHIPLEVELYNObj')
let MEMBERSHIPTYPEYNObj = session.get('MEMBERSHIPTYPEYNObj')
// 主表隐藏的字段
const [columnsStateMap, setColumnsStateMap] = useState<any>({
TotalPointQOQData: { show: false },
@ -41,13 +49,23 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
EarnGrowthQOQData: { show: false },
ConsumeGrowthQOQData: { show: false },
})
// 显示订单详情的悬浮框
const [showOrderModal, setShowOrderModal] = useState<boolean>(false)
const [currentRow, setCurrentRow] = useState<any>()
// 显示详情抽屉
const [showDetailDrawer, setShowDetailDrawer] = useState<boolean>(false)
// 传入给子组件的搜索内容
const [toChildrenSearchParams, setToChildrenSearchParams] = useState<any>()
// 积分的columns
const columns: any = [
{
title: '查询内容',
dataIndex: 'searchText',
hideInTable: true
hideInTable: true,
fieldProps: {
placeholder: '请输入门店名称/用户昵称'
}
},
{
title: '查询时间',
@ -56,30 +74,61 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
hideInTable: true,
hideInDescriptions: true,
search: {
transform: (value: any) => {
transform: (value) => {
return {
StartDate: value[0],
EndDate: value[1],
OPERATE_DATE_Start: value[0],
OPERATE_DATE_End: value[1],
};
},
},
initialValue: [moment().startOf('M').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')],
fieldProps: {
ranges: {
"本月": [moment().startOf('M'), moment()],
"上月": [moment().subtract(1, 'M').startOf('M'), moment().subtract(1, 'M').endOf('M')],
"近三月": [moment().subtract(3, 'M').startOf('M'), moment().endOf('M')],
"近半年": [moment().subtract(6, 'M').startOf('M'), moment().endOf('M')],
}
},
initialValue: [moment().startOf('M'), moment()],
},
{
title: "服务区名称",
title: "会员昵称",
width: 150,
dataIndex: "SERVERPART_NAME",
dataIndex: "MEMBERSHIP_NAME",
hideInSearch: true,
align: 'center',
ellipsis: true,
render: (_, record) => {
return record?.MEMBERSHIP_NAME ? <a onClick={() => {
setCurrentRow(record)
setShowDetailDrawer(true)
handleSetlogSave(`查看${record?.MEMBERSHIP_NAME}${record?.MEMBERSHIP_ID}】会员信息`)
}}>
{record?.MEMBERSHIP_NAME}
</a> : "-"
}
},
{
title: "门店名称",
title: "会员等级",
width: 150,
dataIndex: "SHOPNAME",
dataIndex: "MEMBERSHIP_LEVEL",
hideInSearch: true,
ellipsis: true,
align: 'center',
ellipsis: true,
valueType: 'select',
valueEnum: MEMBERSHIPLEVELYNObj
},
{
title: "会员类型",
width: 120,
dataIndex: "MEMBERSHIP_TYPE",
ellipsis: true,
hideInSearch: true,
align: 'center',
valueType: 'select',
valueEnum: {
...MEMBERSHIPTYPEYNObj,
},
},
{
title: "积分方式",
@ -89,11 +138,11 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
valueType: 'select',
align: 'center',
valueEnum: {
"-2": "全部",
"0": "全部",
"1": "累计",
"-1": "消耗"
},
initialValue: "-2"
initialValue: "0"
},
{
title: "积分来源",
@ -104,6 +153,9 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
align: 'center',
request: () => {
return SCORETYPETree
},
fieldProps: {
allowClear: true
}
// valueEnum: {
// "0": "全部",
@ -113,6 +165,21 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
// },
// initialValue: "0"
},
{
title: "订单编号",
width: 250,
dataIndex: "TICKET_CODE",
hideInSearch: true,
align: 'center',
ellipsis: true,
valueType: 'digit',
render: (_, record) => {
return record?.TICKET_CODE ? <a onClick={() => {
setCurrentRow(record)
setShowOrderModal(true)
}}>{record?.TICKET_CODE}</a> : "-"
}
},
{
title: "本次积分",
width: 120,
@ -140,6 +207,22 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
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,
@ -293,9 +376,60 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
// 改变顶部的选择
const handleChangeTab = (value: number) => {
setSelectTab(value)
actionRef.current?.reload()
let req: any = {}
if (value <= 3) {
req = {
SearchParameter: {
// PROVINCE_CODE: currentUser?.ProvinceCode || "",
OPERATE_DATE_Start: searchParams?.StartDate || "",
OPERATE_DATE_End: searchParams?.EndDate || "",
OWNERUNIT_ID: 911,
POINT_TYPE: value === 1 ? '' : value === 2 ? '1' : value === 3 ? '-1' : '',
POINT_SOURCE: ''
},
keyWord: {
Key: "MEMBERSHIP_NAME",
Value: searchParams?.searchText || ""
},
PageIndex: searchParams?.current,
PageSize: 20,
sortstr: "OPERATE_DATE desc",
}
} else {
req = {
searchParameter: {
// PROVINCE_CODE: currentUser?.ProvinceCode || "",
OPERATE_DATE_Start: searchParams?.StartDate || "",
OPERATE_DATE_End: searchParams?.EndDate || "",
OWNERUNIT_ID: 911,
SCORESETTING_STATE: 1,
GROWTH_SOURCES: "",
GROWTH_TYPE: value === 4 ? '' : value === 5 ? '1' : value === 6 ? '-1' : ''
},
PageIndex: searchParams?.current,
PageSize: 20,
sortstr: "OPERATE_DATE desc",
keyWord: {
Key: "MEMBERSHIP_NAME",
Value: searchParams?.searchText || ""
},
}
}
setToChildrenSearchParams(req)
actionRef.current?.reload()
if (value <= 3) {
PointsRecordSearchRef.current?.actionRef?.current?.reload()
} else {
GrowthValueRecordSearchRef.current?.actionRef?.current?.reload()
}
}
const handleCloseModal = () => {
setShowOrderModal(false)
setCurrentRow(null)
setShowDetailDrawer(false)
}
return (
<div className="MemberSummaryStatisticsMain">
@ -322,6 +456,7 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
EndDate: EndDate
})
actionRef.current?.reload()
PointsRecordSearchRef.current?.actionRef?.current?.reload()
}}
>
<ProFormDateRangePicker
@ -500,7 +635,16 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
<div className="MemberSummaryStatisticsBottom">
<ProTable
{
selectTab <= 3 ?
<PointsRecordSearch onRef={PointsRecordSearchRef} isComponent={true} searchReq={toChildrenSearchParams} /> :
selectTab > 3 ?
<GrowthValueRecordSearch onRef={GrowthValueRecordSearchRef} isComponent={true} searchReq={toChildrenSearchParams} /> : ""
}
{/* <ProTable
actionRef={actionRef}
columns={selectTab <= 3 ? columns : growthColumns}
bordered
@ -552,13 +696,9 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
}
data = await handleGetMEMBERGROWTHList(req);
}
// if (searchParams.StartDate !== params?.StartDate || searchParams.EndDate !== params?.EndDate) {
// await handleGetTopData(params?.StartDate, params?.EndDate)
// }
setSearchParams(params)
handleSetlogSave(`查询${selectTab === 1 ? '总积分' : selectTab === 2 ? '赚取积分' : selectTab === 3 ? '消耗积分' : selectTab === 4 ? '总成长值' : selectTab === 5 ? '赚取成长值' : selectTab === 6 ? '消耗成长值' : ''}数据汇总`)
if (data.List && data.List.length > 0) {
return { data: data.List, success: true, total: data.TotalCount }
}
@ -568,7 +708,7 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined }
value: columnsStateMap,
onChange: setColumnsStateMap,
}}
/>
/> */}
</div>
</div>

View File

@ -12,6 +12,8 @@ import reduceIcon from '@/assets/detail/reduceIcon.png'
import session from "@/utils/session";
import ProForm, { ProFormDateRangePicker } from "@ant-design/pro-form";
import { handleSetlogSave } from "@/utils/format";
import PointsRecordSearch from "../PointsRecordSearch";
import GrowthValueRecordSearch from "../GrowthValueRecordSearch";
@ -19,7 +21,8 @@ const MembershipLevelStatistics: React.FC<{ currentUser: CurrentUser | undefined
const { currentUser } = props
const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
const PointsRecordSearchRef = useRef<any>();
const GrowthValueRecordSearchRef = useRef<any>();
// 顶部内容的对象值
const [topData, setTopData] = useState<any>()
// 当前顶部的选择到了第几个
@ -59,6 +62,8 @@ const MembershipLevelStatistics: React.FC<{ currentUser: CurrentUser | undefined
const [showDetail, setShowDetail] = useState<boolean>(false)
// 顶部的数组内容
const [topListData, setTopListData] = useState<any>([])
// 传入给子组件的搜索内容
const [toChildrenSearchParams, setToChildrenSearchParams] = useState<any>()
// 积分的columns
const columns: any = [
{
@ -274,8 +279,6 @@ const MembershipLevelStatistics: React.FC<{ currentUser: CurrentUser | undefined
},
]
useEffect(() => {
const initData = async () => {
await handleGetTopData();
@ -346,6 +349,54 @@ const MembershipLevelStatistics: React.FC<{ currentUser: CurrentUser | undefined
setSelectTab(typeTab)
let str: string = `${item.StatisticalName && MEMBERSHIPLEVELYNObj && MEMBERSHIPLEVELYNObj[item.StatisticalName] ? MEMBERSHIPLEVELYNObj[item.StatisticalName.toString()] : ""}${type}`
setCurrentDrawerTitle(str)
let req: any = {}
// 确保使用最新的状态值
const currentTabValue = topListData[index].StatisticalName;
if (typeTab <= 3) {
req = {
SearchParameter: {
MEMBERSHIP_TYPE: currentTabValue || "",
// PROVINCE_CODE: currentUser?.ProvinceCode || "",
OPERATE_DATE_Start: searchParams?.StartDate || "",
OPERATE_DATE_End: searchParams?.EndDate || "",
OWNERUNIT_ID: 911,
POINT_TYPE: typeTab === 1 ? '' : typeTab === 2 ? '1' : typeTab === 3 ? '-1' : '',
POINT_SOURCE: ''
},
keyWord: {
Key: "MEMBERSHIP_NAME",
Value: searchParams?.searchText || ""
},
PageIndex: searchParams?.current,
PageSize: 20,
sortstr: "OPERATE_DATE desc",
}
} else {
req = {
searchParameter: {
// PROVINCE_CODE: currentUser?.ProvinceCode || "",
OPERATE_DATE_Start: searchParams?.StartDate || "",
OPERATE_DATE_End: searchParams?.EndDate || "",
OWNERUNIT_ID: 911,
SCORESETTING_STATE: 1,
GROWTH_SOURCES: "",
GROWTH_TYPE: typeTab === 4 ? '' : typeTab === 5 ? '1' : typeTab === 6 ? '-1' : ''
},
PageIndex: searchParams?.current,
PageSize: 20,
sortstr: "OPERATE_DATE desc",
keyWord: {
Key: "MEMBERSHIP_NAME",
Value: searchParams?.searchText || ""
},
}
}
setToChildrenSearchParams(req)
setShowDetail(true)
}
@ -622,7 +673,15 @@ const MembershipLevelStatistics: React.FC<{ currentUser: CurrentUser | undefined
setShowDetail(false)
}}
>
<ProTable
{
selectTab <= 3 ?
<PointsRecordSearch onRef={PointsRecordSearchRef} isComponent={true} searchReq={toChildrenSearchParams} height={'calc(100vh - 200px)'} /> :
selectTab > 3 ?
<GrowthValueRecordSearch onRef={GrowthValueRecordSearchRef} isComponent={true} searchReq={toChildrenSearchParams} height={'calc(100vh - 200px)'} /> : ""
}
{/* <ProTable
actionRef={actionRef}
// formRef={formRef}
columns={selectTab <= 3 ? columns : growthColumns}
@ -689,7 +748,7 @@ const MembershipLevelStatistics: React.FC<{ currentUser: CurrentUser | undefined
value: columnsStateMap,
onChange: setColumnsStateMap,
}}
/>
/> */}
</Drawer>
</div>

View File

@ -12,6 +12,8 @@ import reduceIcon from '@/assets/detail/reduceIcon.png'
import session from "@/utils/session";
import ProForm, { ProFormDateRangePicker } from "@ant-design/pro-form";
import { handleSetlogSave } from "@/utils/format";
import PointsRecordSearch from "../PointsRecordSearch";
import GrowthValueRecordSearch from "../GrowthValueRecordSearch";
@ -19,6 +21,8 @@ const MembershipTypeStatistics: React.FC<{ currentUser: CurrentUser | undefined
const { currentUser } = props
const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
const PointsRecordSearchRef = useRef<any>();
const GrowthValueRecordSearchRef = useRef<any>();
// 顶部内容的对象值
const [topData, setTopData] = useState<any>()
@ -44,6 +48,8 @@ const MembershipTypeStatistics: React.FC<{ currentUser: CurrentUser | undefined
const [currentRow, setCurrentRow] = useState<any>()
// 抽屉显示的值
const [currentDrawerTitle, setCurrentDrawerTitle] = useState<string>('')
// 传入给子组件的搜索内容
const [toChildrenSearchParams, setToChildrenSearchParams] = useState<any>()
let SCORETYPETree = session.get('SCORETYPETree')
let MEMBERSHIPTYPEYNObj = session.get('MEMBERSHIPTYPEYNObj')
@ -59,45 +65,84 @@ const MembershipTypeStatistics: React.FC<{ currentUser: CurrentUser | undefined
})
// 显示详情抽屉
const [showDetail, setShowDetail] = useState<boolean>(false)
// 显示订单详情的悬浮框
const [showOrderModal, setShowOrderModal] = useState<boolean>(false)
const [currentTableRow, setCurrentTableRow] = useState<any>()
// 显示详情抽屉
const [showDetailDrawer, setShowDetailDrawer] = useState<boolean>(false)
// 积分的columns
const columns: any = [
{
title: '查询内容',
dataIndex: 'searchText',
hideInTable: true
hideInTable: true,
fieldProps: {
placeholder: '请输入门店名称/用户昵称'
}
},
// {
// title: '查询时间',
// dataIndex: 'search_date',
// valueType: 'dateRange',
// hideInTable: true,
// hideInDescriptions: true,
// search: {
// transform: (value: any) => {
// return {
// StartDate: value[0],
// EndDate: value[1],
// };
// },
// },
// initialValue: [moment().startOf('M').format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')],
// },
{
title: "服务区名称",
title: '查询时间',
dataIndex: 'search_date',
valueType: 'dateRange',
hideInTable: true,
hideInDescriptions: true,
search: {
transform: (value) => {
return {
OPERATE_DATE_Start: value[0],
OPERATE_DATE_End: value[1],
};
},
},
fieldProps: {
ranges: {
"本月": [moment().startOf('M'), moment()],
"上月": [moment().subtract(1, 'M').startOf('M'), moment().subtract(1, 'M').endOf('M')],
"近三月": [moment().subtract(3, 'M').startOf('M'), moment().endOf('M')],
"近半年": [moment().subtract(6, 'M').startOf('M'), moment().endOf('M')],
}
},
initialValue: [moment().startOf('M'), moment()],
},
{
title: "会员昵称",
width: 150,
dataIndex: "SERVERPART_NAME",
dataIndex: "MEMBERSHIP_NAME",
hideInSearch: true,
align: 'center',
ellipsis: true,
render: (_, record) => {
return isComponent ? record?.MEMBERSHIP_NAME || "" : record?.MEMBERSHIP_NAME ? <a onClick={() => {
setCurrentRow(record)
setShowDetailDrawer(true)
handleSetlogSave(`查看${record?.MEMBERSHIP_NAME}${record?.MEMBERSHIP_ID}】会员信息`)
}}>
{record?.MEMBERSHIP_NAME}
</a> : "-"
}
},
{
title: "门店名称",
title: "会员等级",
width: 150,
dataIndex: "SHOPNAME",
dataIndex: "MEMBERSHIP_LEVEL",
hideInSearch: true,
ellipsis: true,
align: 'center',
ellipsis: true,
valueType: 'select',
valueEnum: MEMBERSHIPLEVELYNObj
},
{
title: "会员类型",
width: 120,
dataIndex: "MEMBERSHIP_TYPE",
ellipsis: true,
hideInSearch: true,
align: 'center',
valueType: 'select',
valueEnum: {
...MEMBERSHIPTYPEYNObj,
},
},
{
title: "积分方式",
@ -107,11 +152,11 @@ const MembershipTypeStatistics: React.FC<{ currentUser: CurrentUser | undefined
valueType: 'select',
align: 'center',
valueEnum: {
"-2": "全部",
"0": "全部",
"1": "累计",
"-1": "消耗"
},
initialValue: "-2"
initialValue: "0"
},
{
title: "积分来源",
@ -122,6 +167,9 @@ const MembershipTypeStatistics: React.FC<{ currentUser: CurrentUser | undefined
align: 'center',
request: () => {
return SCORETYPETree
},
fieldProps: {
allowClear: true
}
// valueEnum: {
// "0": "全部",
@ -131,6 +179,21 @@ const MembershipTypeStatistics: React.FC<{ currentUser: CurrentUser | undefined
// },
// initialValue: "0"
},
{
title: "订单编号",
width: 250,
dataIndex: "TICKET_CODE",
hideInSearch: true,
align: 'center',
ellipsis: true,
valueType: 'digit',
render: (_, record) => {
return record?.TICKET_CODE ? <a onClick={() => {
setCurrentRow(record)
setShowOrderModal(true)
}}>{record?.TICKET_CODE}</a> : "-"
}
},
{
title: "本次积分",
width: 120,
@ -149,6 +212,31 @@ const MembershipTypeStatistics: React.FC<{ currentUser: CurrentUser | undefined
align: 'center',
valueType: "digit"
},
{
title: "实付金额",
width: 120,
dataIndex: "PAY_AMOUNT",
hideInSearch: true,
ellipsis: true,
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,
@ -347,6 +435,52 @@ const MembershipTypeStatistics: React.FC<{ currentUser: CurrentUser | undefined
setSelectTab(typeTab)
let str: string = `${item.StatisticalName && MEMBERSHIPTYPEYNObj && MEMBERSHIPTYPEYNObj[item.StatisticalName] ? MEMBERSHIPTYPEYNObj[item.StatisticalName.toString()] : ""}${type}`
setCurrentDrawerTitle(str)
let req: any = {}
// 确保使用最新的状态值
const currentTabValue = topListData[index].StatisticalName;
if (typeTab <= 3) {
req = {
SearchParameter: {
MEMBERSHIP_TYPE: currentTabValue || "",
// PROVINCE_CODE: currentUser?.ProvinceCode || "",
OPERATE_DATE_Start: searchParams?.StartDate || "",
OPERATE_DATE_End: searchParams?.EndDate || "",
OWNERUNIT_ID: 911,
POINT_TYPE: typeTab === 1 ? '' : typeTab === 2 ? '1' : typeTab === 3 ? '-1' : '',
POINT_SOURCE: ''
},
keyWord: {
Key: "MEMBERSHIP_NAME",
Value: searchParams?.searchText || ""
},
PageIndex: searchParams?.current,
PageSize: 20,
sortstr: "OPERATE_DATE desc",
}
} else {
req = {
searchParameter: {
// PROVINCE_CODE: currentUser?.ProvinceCode || "",
OPERATE_DATE_Start: searchParams?.StartDate || "",
OPERATE_DATE_End: searchParams?.EndDate || "",
OWNERUNIT_ID: 911,
SCORESETTING_STATE: 1,
GROWTH_SOURCES: "",
GROWTH_TYPE: selectTab === 4 ? '' : selectTab === 5 ? '1' : selectTab === 6 ? '-1' : ''
},
keyWord: {
Key: "MEMBERSHIP_NAME",
Value: searchParams?.searchText || ""
},
PageIndex: searchParams?.current,
PageSize: 20,
sortstr: "OPERATE_DATE desc",
}
}
setToChildrenSearchParams(req)
setShowDetail(true)
}
@ -609,9 +743,6 @@ const MembershipTypeStatistics: React.FC<{ currentUser: CurrentUser | undefined
}
<Drawer
width={'80%'}
title={currentDrawerTitle || ""}
@ -626,7 +757,18 @@ const MembershipTypeStatistics: React.FC<{ currentUser: CurrentUser | undefined
setShowDetail(false)
}}
>
<ProTable
{
selectTab <= 3 ?
<PointsRecordSearch onRef={PointsRecordSearchRef} isComponent={true} searchReq={toChildrenSearchParams} height={'calc(100vh - 200px)'} /> :
selectTab > 3 ?
<GrowthValueRecordSearch onRef={GrowthValueRecordSearchRef} isComponent={true} searchReq={toChildrenSearchParams} height={'calc(100vh - 200px)'} /> : ""
}
{/* <ProTable
actionRef={actionRef}
// formRef={formRef}
columns={selectTab <= 3 ? columns : growthColumns}
@ -716,7 +858,7 @@ const MembershipTypeStatistics: React.FC<{ currentUser: CurrentUser | undefined
value: columnsStateMap,
onChange: setColumnsStateMap,
}}
/>
/> */}
</Drawer>
</div>
)

View File

@ -271,7 +271,7 @@ const MerchantEvaluationManage: React.FC<{ currentUser: CurrentUser, isComponent
}}
options={false}
scroll={{ x: "100%", y: isComponent ? '300px' : "calc(100vh - 410px)" }}
headerTitle={<PageTitleBox props={props} />} // 列表表头
headerTitle={isComponent ? '' : <PageTitleBox props={props} />} // 列表表头
search={isComponent ? false : { span: 8 }}
request={async (params) => {
if (!selectedId && !isComponent) {

View File

@ -1,11 +1,198 @@
// 商户销售排行
import { ConnectState } from "@/models/connect";
import { Button, FormInstance } from "antd";
import { connect, CurrentUser } from "umi";
import { handeGetSERVERPARTSELLERList } from "../service";
import { useRef, useState } from "react";
import ProTable, { ActionType } from "@ant-design/pro-table";
import PageTitleBox from "@/components/PageTitleBox";
import LeftSelectTree from "@/pages/reports/settlementAccount/component/leftSelectTree";
const MerchantSalesRanking: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
return (
<div>
const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
const [collapsible, setCollapsible] = useState<boolean>(false)
// 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>()
// 查询的条件
const [searchParams, setSearchParams] = useState<any>()
// 当前查询的文字
const [currentSearchText, setCurrentSearchText] = useState<string>('')
const columns: any = [
{
dataIndex: 'searchText',
title: '查询内容',
align: 'center',
hideInTable: true,
width: 120,
ellipsis: true,
fieldProps: {
placeholder: "请输入服务区名称/商家名称"
}
},
{
dataIndex: "index",
title: "序号",
align: 'center',
hideInSearch: true,
valueType: "index",
width: 70,
ellipsis: true,
},
{
dataIndex: "SERVERPART_NAME",
title: "服务区名称",
align: 'center',
hideInSearch: true,
width: 150,
ellipsis: true,
render: (_, record) => {
return highlightText(record?.SERVERPART_NAME, currentSearchText)
}
},
{
dataIndex: "SELLER_NAME",
title: "商家名称",
align: 'center',
hideInSearch: true,
width: 150,
ellipsis: true,
render: (_, record) => {
return highlightText(record?.SELLER_NAME, currentSearchText)
}
},
{
dataIndex: 'ShopTrade',
title: '门店业态',
align: 'center',
width: 120,
valueType: 'select',
hideInSearch: true,
},
{
dataIndex: 'SELLER_SCORE',
title: <div style={{ textAlign: 'center' }}></div>,
align: 'right',
width: 120,
hideInSearch: true,
sorter: true
},
{
dataIndex: 'COMMENT_COUNT',
title: <div style={{ textAlign: 'center' }}></div>,
align: 'right',
width: 120,
hideInSearch: true,
sorter: true
},
{
dataIndex: 'MONTHLYSALES',
title: <div style={{ textAlign: 'center' }}></div>,
align: 'right',
width: 120,
hideInSearch: true,
sorter: true
},
{
dataIndex: 'CASHPAY',
title: <div style={{ textAlign: 'center' }}></div>,
align: 'right',
width: 120,
hideInSearch: true,
sorter: true,
defaultSortOrder: 'descend',
},
{
dataIndex: 'PERCAPITA',
title: <div style={{ textAlign: 'center' }}></div>,
align: 'right',
width: 120,
hideInSearch: true,
sorter: true
}
]
// 给颜色标红的
const highlightText = (text: string, searchText: string) => {
if (!text || !searchText) return text;
const regex = new RegExp(`(${searchText})`, 'gi');
const parts = text.split(regex);
return (
<span>
{parts.map((part, i) =>
part.toLowerCase() === searchText.toLowerCase() ?
<span key={i} style={{ color: 'red' }}>{part}</span> :
part
)}
</span>
);
};
return (
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
<LeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} />
<div style={{
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
paddingTop: 0,
paddingBottom: 0,
paddingRight: 0
}}>
<ProTable
actionRef={actionRef}
formRef={formRef}
columns={columns}
bordered
expandable={{
expandRowByClick: true
}}
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
headerTitle={<PageTitleBox props={props} />} // 列表表头
search={{ span: 6 }}
request={async (params, sorter) => {
if (!selectedId) {
return
}
console.log('sortersortersorter', sorter);
// 排序字段
const sortstr = Object.keys(sorter).map(n => {
const value = sorter[n]
return value ? `${n} ${value.replace('end', '')}` : ''
})
console.log('sortstrsortstrsortstrsortstrsortstrsortstr', sortstr);
const req: any = {
searchParameter: {
SERVERPART_IDS: selectedId
},
keyWord: {
Key: "SERVERPART_NAME,SELLER_NAME",
Value: params?.searchText
},
sortstr: sortstr.toString(),
PageIndex: params.current,
PageSize: params.pageSize
}
setSearchParams(params)
setCurrentSearchText(params.searchText || '')
const data = await handeGetSERVERPARTSELLERList(req)
if (data.List && data.List.length > 0) {
return { data: data.List, success: true, total: data.TotalCount }
}
return { data: [], success: true }
}}
toolbar={{
actions: [
]
}}
/>
</div>
</div>
)
}

View File

@ -2,7 +2,7 @@
import { connect } from "umi";
import type { CurrentUser } from "umi";
import type { ConnectState } from "@/models/connect";
import React, { useRef, useState } from "react";
import React, { useImperativeHandle, useRef, useState } from "react";
import ProCard from "@ant-design/pro-card";
import { MenuFoldOutlined } from "@ant-design/icons";
import type { FormInstance } from "antd";
@ -22,8 +22,9 @@ import OrderDetailModal from "../BookingMealOrder/components/orderDetailModal";
import MemberDetail from "../memberInfor/component/memberDetail";
const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boolean, parentDetail?: any }> = (props) => {
const { currentUser, isComponent, parentDetail } = props
const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boolean, parentDetail?: any, searchReq?: any, onRef?: any, height?: any }> = (props) => {
// searchReq 传入的自定义参数
const { currentUser, isComponent, parentDetail, searchReq, onRef, height } = props
const downloadBtnRef = useRef<any>()
const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
@ -94,7 +95,7 @@ const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boo
align: 'center',
ellipsis: true,
render: (_, record) => {
return isComponent ? record?.MEMBERSHIP_NAME || "" : record?.MEMBERSHIP_NAME ? <a onClick={() => {
return isComponent && !searchReq ? record?.MEMBERSHIP_NAME || "" : record?.MEMBERSHIP_NAME ? <a onClick={() => {
setCurrentRow(record)
setShowDetailDrawer(true)
handleSetlogSave(`查看${record?.MEMBERSHIP_NAME}${record?.MEMBERSHIP_ID}】会员信息`)
@ -237,6 +238,11 @@ const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boo
setShowDetailDrawer(false)
}
useImperativeHandle(onRef, () => ({
actionRef
}));
return (
<div ref={(el) => {
// 打印报表
@ -259,16 +265,20 @@ const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boo
expandable={{
expandRowByClick: true
}}
headerTitle={<PageTitleBox props={props} />}
headerTitle={isComponent ? '' : <PageTitleBox props={props} />}
search={isComponent ? false : { span: 6 }}
scroll={{ x: '100%', y: isComponent ? '300px' : 'calc(100vh - 430px)' }}
scroll={{ x: '100%', y: isComponent ? height ? `${height}` : '300px' : 'calc(100vh - 430px)' }}
options={isComponent ? false : {
density: true,
reload: true,
setting: true
}}
request={async (params) => {
const req: any = isComponent ? {
const req: any = isComponent ? searchReq ? {
...searchReq,
PageIndex: params?.current,
PageSize: 20,
} : {
SearchParameter: {
OWNERUNIT_ID: 911,
MEMBERSHIP_IDS: parentDetail?.MEMBERSHIP_ID,

View File

@ -28,7 +28,7 @@ import ModalFooter from '../scenicSpotConfig/component/modalFooter';
import PointConfig from './PointConfig';
import { handleSetlogSave } from '@/utils/format';
const { confirm } = Modal;
const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
const { currentUser } = props
@ -51,10 +51,14 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
let MEMBERSHIPTYPEYNList = session.get('MEMBERSHIPTYPEYNList')
let MEMBERSHIPTYPEYNObj = session.get('MEMBERSHIPTYPEYNObj')
// 表格数据
const [tableData, setTableData] = useState<any>()
// 弹出框拖动效果
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
const [disabled, setDraggleDisabled] = useState<boolean>() // 是否拖动
const draggleRef = React.createRef<any>()
// 第一次请求全部
const [isFirst, setIsFirst] = useState<boolean>(true)
const onDraggaleStart = (event, uiData) => {
const { clientWidth, clientHeight } = window.document.documentElement;
@ -78,29 +82,40 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
title: '积分类别',
align: 'center',
width: 200,
hideInSearch: true,
valueType: 'treeSelect',
fieldProps: {
allowClear: true, // ✅ 允许清除
treeDefaultExpandAll: true, // 可选:展开全部
},
request: () => {
let SCORETYPETree = session.get('SCORETYPETree')
return SCORETYPETree
}
// valueEnum: SCORETYPEObj
},
{
dataIndex: 'SCORE_NAME',
title: '规则名称',
width: 200,
align: 'center',
hideInSearch: true,
render: (_, record) => {
return record?.SCORE_NAME ? <a onClick={() => {
return record?.SCORE_TYPE && SCORETYPEObj && SCORETYPEObj[record?.SCORE_TYPE] ? <a onClick={() => {
setCurrentRow({ ...record });
handleModalVisible(true);
}}>
{record?.SCORE_NAME}
</a> : '-'
{SCORETYPEObj[record?.SCORE_TYPE]}
</a> : "-"
}
// valueEnum: SCORETYPEObj
},
// {
// dataIndex: 'SCORE_NAME',
// title: '规则名称',
// width: 200,
// align: 'center',
// hideInSearch: true,
// render: (_, record) => {
// return record?.SCORE_NAME ? <a onClick={() => {
// setCurrentRow({ ...record });
// handleModalVisible(true);
// }}>
// {record?.SCORE_NAME}
// </a> : '-'
// }
// },
{
dataIndex: 'MEMBERSHIP_LEVEL',
title: '会员等级',
@ -195,18 +210,19 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
// align: 'center',
// hideInSearch: true,
// },
// {
// dataIndex: 'SCORESETTING_STATE',
// title: '有效状态',
// width: 120,
// align: 'center',
// valueType: 'select',
// valueEnum: {
// "1": "有效",
// "0": "无效"
// },
// initialValue: "1"
// },
{
dataIndex: 'SCORESETTING_STATE',
title: '有效状态',
width: 120,
align: 'center',
valueType: 'select',
valueEnum: {
"1": "有效",
"0": "无效"
},
initialValue: "1",
hideInTable: true
},
// {
// dataIndex: 'OPERATE_DATE',
// title: '操作时间',
@ -327,6 +343,115 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
}
}
// 支持会员类型
const handleNewAddUpdate = async (newValue: any, typeList: any, levelList: any) => {
console.log('newValuenewValuenewValuenewValue', newValue);
console.log('typeListtypeListtypeListtypeList', typeList);
console.log('levelListlevelListlevelListlevelList', levelList);
// newValue 表单数据 typeList 会员类型的数组 选择单个或所有类型 levelList 会员等级的数组 选择单个或所有类型
// 入参列表
let reqList: any = []
// 入参列表的提示信息 更新的
let reqListUpdateMsg: any = []
// 入参列表的提示信息 新增的
let reqListAddMsg: any = []
typeList.forEach((item: any) => {
levelList.forEach((subItem: any) => {
let req: any = {}
if (tableData && tableData.length > 0) {
tableData.forEach((tableItem: any) => {
// 判断 会员类型、会员等级、规则类型 是否一致
if (Number(tableItem.MEMBERSHIP_TYPE) === Number(item.value) && Number(subItem?.value) === Number(tableItem.MEMBERSHIP_LEVEL) && Number(newValue?.SCORE_TYPE) === Number(tableItem.SCORE_TYPE) && tableItem.SCORESETTING_STATE === 1) {
console.log('tableItemtableItemtableItem', tableItem);
req = {
...tableItem
}
}
})
}
// 如果req 里面 有 SCORESETTING_ID 说明是更新的
console.log('reqreqreqreqreq', req);
if (req?.SCORESETTING_ID) {
reqList.push({
...req,
...newValue,
MEMBERSHIP_TYPE: item.value,
MEMBERSHIP_LEVEL: subItem.value
})
reqListUpdateMsg.push(`${item.label}${subItem.label}${SCORETYPEObj[newValue.SCORE_TYPE]}`)
} else {
req = {
...newValue,
MEMBERSHIP_TYPE: item.value,
MEMBERSHIP_LEVEL: subItem.value
}
reqList.push(req)
reqListAddMsg.push(`${item.label}${subItem.label}${SCORETYPEObj[newValue.SCORE_TYPE]}`)
}
})
})
confirm({
title: '提示',
content: `本次操作将 ${reqListUpdateMsg && reqListUpdateMsg.length > 0 ? '更新:' + reqListUpdateMsg.toString() : ""}${reqListAddMsg && reqListAddMsg.length > 0 ? ';新增:' + reqListAddMsg.toString() : ""},是否确认此次操作?`,
width: 600,
icon: <ExclamationCircleOutlined />,
async onOk() {
let isOK: boolean = await handleBatchUpdate(reqList)
if (isOK) {
formRef?.current?.resetFields()
setCurrentRow(undefined)
handleModalVisible(false)
actionRef.current?.reload()
}
},
onCancel() {
},
});
}
// 根据入参 遍历去更新 或者新增
const handleBatchUpdate = async (reqList: any) => {
// reqList 入参列表
for (let i = 0; i < reqList.length; i++) {
let res: any = reqList[i]
let req: any = {}
if (res?.SCORESETTING_ID) {
req = {
...res,
MEMBERSHIP_TYPE: res.MEMBERSHIP_TYPE === 0 ? '' : res.MEMBERSHIP_TYPE,
MEMBERSHIP_LEVEL: res.MEMBERSHIP_LEVEL === 0 ? '' : res.MEMBERSHIP_LEVEL,
}
} else {
req = {
...res,
MEMBERSHIP_TYPE: res.MEMBERSHIP_TYPE === 0 ? '' : res.MEMBERSHIP_TYPE,
MEMBERSHIP_LEVEL: res.MEMBERSHIP_LEVEL === 0 ? '' : res.MEMBERSHIP_LEVEL,
ADDTIME: moment().format('YYYY-MM-DD HH:mm:ss'),
STAFF_ID: currentUser?.ID,
STAFF_NAME: currentUser?.Name,
OWNERUNIT_ID: currentUser?.OwnerUnitId,
OWNERUNIT_NAME: currentUser?.OwnerUnitName,
PROVINCE_CODE: currentUser?.ProvinceCode
}
}
const data = await handleSynchroSCORESETTING(req)
console.log('datadatadatadata', data);
handleSetlogSave(`${currentRow?.GROWTHSETTING_ID ? '更新' : '新增'}${data.Result_Data.GROWTHSETTING_NAME}】成功`)
}
return true
}
return (
<PageContainer header={{
@ -348,6 +473,7 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
request={async (params, sorter) => {
const searchWholeParams = {
searchParameter: {
SCORE_TYPES: params?.SCORE_TYPE || "",
PROVINCE_CODE: currentUser?.ProvinceCode || "",
OWNERUNIT_ID: 911,
SCORESETTING_STATE: params?.SCORESETTING_STATE,
@ -362,6 +488,11 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
const data = await handleGetSCORESETTINGList(searchWholeParams);
handleSetlogSave(`点击查询按钮`)
if (data.List && data.List.length > 0) {
if (isFirst) {
setTableData(data.List)
setIsFirst(false)
}
return { data: data.List, success: true, total: data.TotalCount }
}
return { data: [], success: true }
@ -475,20 +606,92 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
submitter={false}
preserve={false}
labelCol={{ style: { width: 130 } }}
initialValues={{
request={async () => {
let res: any = {}
if (currentRow?.SCORESETTING_ID) {
res = {
...currentRow,
SCORESETTING_STATE: (currentRow?.SCORESETTING_STATE || currentRow?.SCORESETTING_STATE === 0) ? currentRow?.SCORESETTING_STATE : 1,
MEMBERSHIP_LEVEL: currentRow?.MEMBERSHIP_LEVEL ? currentRow?.MEMBERSHIP_LEVEL.toString() : ""
}
} else {
res = {
EXCHANGE_BASE: "1",
EARN_POINTS: "1",
CONVERTIBLE_PROPORTION: "1",
GROWTH_VALUE: "1",
SCORESETTING_STATE: 1,
MEMBERSHIP_LEVEL: '1',
MEMBERSHIP_TYPE: 1
}
}
return res
}}
// initialValues={currentRow?.SCORESETTING_ID ? {
// ...currentRow,
// SCORESETTING_STATE: (currentRow?.SCORESETTING_STATE || currentRow?.SCORESETTING_STATE === 0) ? currentRow?.SCORESETTING_STATE : 1,
// MEMBERSHIP_LEVEL: currentRow?.MEMBERSHIP_LEVEL ? currentRow?.MEMBERSHIP_LEVEL.toString() : ""
// } : {
// EXCHANGE_BASE: "1",
// EARN_POINTS: "1",
// CONVERTIBLE_PROPORTION: "1",
// GROWTH_VALUE: "1",
// }}
onFinish={async (values) => {
let newValue: any = { ...values };
if (currentRow) {
// 编辑数据
newValue = { ...values, SCORESETTING_ID: currentRow.SCORESETTING_ID };
}
await handleAddUpdate(newValue);
console.log('newValuenewValuenewValuenewValue', newValue);
let typeList: any = []
let levelList: any = []
// 等级选择所有 和 选择单个的情况
if (newValue.MEMBERSHIP_LEVEL === 1) {
let MEMBERSHIPLEVELYNList = session.get('MEMBERSHIPLEVELYNList')
if (MEMBERSHIPLEVELYNList && MEMBERSHIPLEVELYNList.length > 0) {
MEMBERSHIPLEVELYNList.forEach((item: any) => {
if (Number(item.value) < 9000 && Number(item.value) !== 1) {
levelList.push({
label: item.label,
value: Number(item.value),
})
}
})
}
} else {
levelList = [{ label: MEMBERSHIPLEVELYNObj[newValue.MEMBERSHIP_LEVEL], value: newValue.MEMBERSHIP_LEVEL }]
}
// 会员类型选择 所有和单个
if (newValue.MEMBERSHIP_TYPE === 1) {
let list: any = JSON.parse(JSON.stringify(MEMBERSHIPTYPEYNList))
if (list && list.length > 0) {
list.forEach((item: any) => {
if (item.value < 9000 && Number(item.value) !== 1) {
typeList.push({
label: item.label,
value: Number(item.value)
})
}
})
}
} else {
typeList = [{ label: MEMBERSHIPTYPEYNObj[newValue.MEMBERSHIP_TYPE], value: newValue.MEMBERSHIP_TYPE }]
}
await handleNewAddUpdate(newValue, typeList, levelList)
handleConfirmLoading(false)
// return
// await handleAddUpdate(newValue);
// handleConfirmLoading(false)
}}
>
<Row gutter={8}>
@ -510,6 +713,7 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
return treeNode.label.toLowerCase().includes(inputValue.toLowerCase());
},
}}
disabled={currentRow?.SCORESETTING_ID}
// options={SCORETYPEList}
rules={[
{
@ -519,7 +723,7 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
]}
/>
</Col>
<Col span={12}>
{/* <Col span={12}>
<ProFormText
name="SCORE_NAME"
label="规则名称"
@ -530,26 +734,65 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
}
]}
/>
</Col>
</Col> */}
<Col span={12}>
<ProFormSelect
name="MEMBERSHIP_LEVEL"
label="会员等级"
options={MEMBERSHIPLEVELYNList}
request={async () => {
let MEMBERSHIPLEVELYNList = session.get('MEMBERSHIPLEVELYNList')
let newList: any = []
if (MEMBERSHIPLEVELYNList && MEMBERSHIPLEVELYNList.length > 0) {
MEMBERSHIPLEVELYNList.forEach((item: any) => {
if (Number(item.value) < 9000) {
newList.push({
label: item.label,
value: item.value,
})
}
})
}
return newList
}}
// options={MEMBERSHIPLEVELYNList}
/>
</Col>
<Col span={12}>
<ProFormSelect
name="MEMBERSHIP_TYPE"
label="会员类型"
options={MEMBERSHIPTYPEYNList}
request={async () => {
let list: any = JSON.parse(JSON.stringify(MEMBERSHIPTYPEYNList))
let newList: any = []
if (list && list.length > 0) {
list.forEach((item: any) => {
if (item.value < 9000) {
newList.push({
label: item.label,
value: Number(item.value)
})
}
})
}
return newList
}}
// options={MEMBERSHIPTYPEYNList}
/>
</Col>
<Col span={12}>
<ProFormSelect
name="SCORESETTING_STATE"
label="有效状态"
options={[
{ label: '有效', value: 1 },
{ label: '无效', value: 0 },
]}
/>
</Col>
<Col span={12}>
<ProFormText
name="EXCHANGE_BASE"
label="兑换基数"
label="积分兑换基数"
tooltip="获得1积分需要消费的金额"
/>
</Col>
@ -580,16 +823,7 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
label="获得成长值"
/>
</Col>
<Col span={12}>
<ProFormSelect
name="SCORESETTING_STATE"
label="有效状态"
options={[
{ label: '有效', value: 1 },
{ label: '无效', value: 0 },
]}
/>
</Col>
{/* <Col span={12}>
<ProFormDatePicker
width="lg"

View File

@ -514,7 +514,7 @@ const RegistrationRetentionAnalysis: React.FC<{ currentUser: CurrentUser, isComp
// return { data: [], success: true }
}}
toolbar={{
actions: [
actions: isComponent ? [] : [
<span style={{ visibility: 'hidden' }}>
<ReactHTMLTableToExcel
buttonText={'导出excel'}

View File

@ -514,7 +514,7 @@ const MemberDetail = ({ showDetailDrawer, currentRow, handleCloseModal, currentU
<div style={{ height: '400px' }}>
<div className="bottomDetailBox" style={{ display: selectTab === 1 ? 'block' : "none" }}>
<div className="bottomDetailBox" style={{ display: selectTab === 1 ? 'block' : "none", marginTop: '12px' }}>
<Row gutter={8}>
<Col span={6} className="memberInfoDetailItem">
<ProFormText
@ -630,7 +630,7 @@ const MemberDetail = ({ showDetailDrawer, currentRow, handleCloseModal, currentU
{/* 地址管理 */}
{
selectTab === 5 ? <AddressDetail currentBigRow={userDetailInfo} currentUser={currentUser} /> : ''
selectTab === 5 ? <AddressDetail currentBigRow={userDetailInfo} currentUser={currentUser} isComponent={true} /> : ''
}
{/* 活动轨迹 */}

View File

@ -1034,3 +1034,41 @@ export async function handeGetMEMBERSHIPDetail(params: any) {
}
return data.Result_Data
}
// 获取服务区商家信息表列表
export async function handeGetSERVERPARTSELLERList(params: any) {
const data = await requestEncryption(`/BaseInfo/GetSERVERPARTSELLERList`, {
method: 'POST',
data: { ...params, requestEncryption: true }
})
if (data.Result_Code !== 100) {
return data
}
return data.Result_Data
}
// 查询订单详情
export async function handeGetSALEDETAILDetail(params: any) {
const data = await requestEncryption(`/OnlineOrder/GetSALEDETAILDetail`, {
method: 'POST',
data: { ...params, requestEncryption: true }
})
if (data.Result_Code !== 100) {
return data
}
return data.Result_Data
}
// 订单详情查询地址信息
export async function handeGetSALEADDRESSList(params: any) {
const data = await requestEncryption(`/OnlineOrder/GetSALEADDRESSList`, {
method: 'POST',
data: { ...params, requestEncryption: true }
})
if (data.Result_Code !== 100) {
return data
}
return data.Result_Data
}

View File

@ -1,4 +1,4 @@
// 由 scripts/writeVersion.js 自动生成
export const VERSION = "4.5.8";
export const GIT_HASH = "16b1153";
export const BUILD_TIME = "2025-07-28T11:27:27.820Z";
export const VERSION = "4.5.10";
export const GIT_HASH = "158052e";
export const BUILD_TIME = "2025-07-29T11:53:30.567Z";