diff --git a/package.json b/package.json index 0c80f38..dbbb655 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index f34eeec..43fca5c 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -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 = (props) => { return obj } + // 把树形的数据 全部层级的value 和label都匹配上 + const flattenGrowthType = (list: any[], nameKey: string, valueKey: any) => { + const result: Record = {} + + 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 = (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 = (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); } }) diff --git a/src/pages/travelMember/BookingMealOrder/components/orderDetailModal.tsx b/src/pages/travelMember/BookingMealOrder/components/orderDetailModal.tsx index 7fdf1fb..1684301 100644 --- a/src/pages/travelMember/BookingMealOrder/components/orderDetailModal.tsx +++ b/src/pages/travelMember/BookingMealOrder/components/orderDetailModal.tsx @@ -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') : '' + // } : {}} >
@@ -169,7 +229,7 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy
-
订单信息
+ {/*
订单信息
*/} @@ -180,36 +240,6 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy style={{ marginBottom: '16px' }} /> - { - detailType === 'food' ? - - - : "" - } - { - detailType === 'food' ? - - - : "" - } - - - - - - - - - - - - - - - - - - - - - - - - - - - { detailType === 'food' ? @@ -319,6 +285,122 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy /> } + + + + + + + + + + + + + { + detailType === 'food' ? + <> + + + + + + + + + + + + + : + <> + + + + + + + + + + + } + + + + + + + - - - - - - - - - + + { + detailType === 'food' ? + + + : "" + } + { + detailType === 'food' ? + + + : "" + } + + + + + + + + + + + +
@@ -461,7 +556,7 @@ const OrderDetailModal = ({ modalVisible, handleCloseModal, currentRow, detailTy /> -
+ ) } diff --git a/src/pages/travelMember/ConsumptionRecordSearch/index.tsx b/src/pages/travelMember/ConsumptionRecordSearch/index.tsx index 91a1d39..cfddedb 100644 --- a/src/pages/travelMember/ConsumptionRecordSearch/index.tsx +++ b/src/pages/travelMember/ConsumptionRecordSearch/index.tsx @@ -50,6 +50,24 @@ const ConsumptionRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent? const [searchParams, setSearchParams] = useState() // 显示详情抽屉 const [showDetailDrawer, setShowDetailDrawer] = useState(false) + // 当前查询的文字 + const [currentSearchText, setCurrentSearchText] = useState('') + + // 给颜色标红的 + const highlightText = (text: string, searchText: string) => { + if (!text || !searchText) return text; + const regex = new RegExp(`(${searchText})`, 'gi'); + const parts = text.split(regex); + return ( + + {parts.map((part, i) => + part.toLowerCase() === searchText.toLowerCase() ? + {part} : + part + )} + + ); + }; 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)} : "-" } }, @@ -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 ? { setCurrentRow(record) setShowOrderModal(true) - }}>{record?.TICKET_CODE} : "-" + }}> + {/* {record?.TICKET_CODE} */} + {highlightText(record?.TICKET_CODE, currentSearchText)} + : "-" } }, { @@ -306,7 +330,7 @@ const ConsumptionRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent? expandable={{ expandRowByClick: true }} - headerTitle={} + headerTitle={isComponent ? '' : } 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 } diff --git a/src/pages/travelMember/GrowthValueRecordSearch/index.tsx b/src/pages/travelMember/GrowthValueRecordSearch/index.tsx index e7cfa6c..b7b4f3f 100644 --- a/src/pages/travelMember/GrowthValueRecordSearch/index.tsx +++ b/src/pages/travelMember/GrowthValueRecordSearch/index.tsx @@ -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() const actionRef = useRef(); const formRef = useRef(); @@ -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 ? { + return isComponent && !searchReq ? record?.MEMBERSHIP_NAME || "" : record?.MEMBERSHIP_NAME ? { 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={} - scroll={{ x: '100%', y: isComponent ? '300px' : 'calc(100vh - 430px)' }} + headerTitle={isComponent ? '' : } + 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, diff --git a/src/pages/travelMember/GrowthValueRuleConfig/index.tsx b/src/pages/travelMember/GrowthValueRuleConfig/index.tsx index d51c5f6..cf9e7ea 100644 --- a/src/pages/travelMember/GrowthValueRuleConfig/index.tsx +++ b/src/pages/travelMember/GrowthValueRuleConfig/index.tsx @@ -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(MEMBERSHIPLEVELYNList) // 晋升后会员等级列表 const [promotionMemberLevel, setPromotionMemberLevel] = useState(MEMBERSHIPLEVELYNList) + // 先存表格数据 + const [tableData, setTableData] = useState([]); + // 判断是不是第一次进入页面 + const [isFirst, setIsFirst] = useState(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 ? { + return record?.GROWTHSETTING_TYPE && GROWTHTYPEObj && GROWTHTYPEObj[record?.GROWTHSETTING_TYPE] ? { + console.log('recordrecordrecord', record); + handleSetlogSave(`查看【${record?.GROWTHSETTING_NAME}】规则详情`) setCurrentRow({ ...record }); handleModalVisible(true); - }}>{record?.GROWTHSETTING_NAME} : '-' + }}> + {GROWTHTYPEObj[record?.GROWTHSETTING_TYPE]} + : '-' } }, + // { + // dataIndex: 'GROWTHSETTING_NAME', + // title: '规则名称', + // align: 'center', + // width: 120, + // hideInSearch: true, + // hideInDescriptions: true, + // render: (_, record) => { + // return record?.GROWTHSETTING_NAME ? { + // handleSetlogSave(`查看【${record?.GROWTHSETTING_NAME}】规则详情`) + // setCurrentRow({ ...record }); + // handleModalVisible(true); + // }}>{record?.GROWTHSETTING_NAME} : '-' + // } + // }, { 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: , + 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 ( 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: , + // 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); + // } }} > @@ -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} /> - + {/* } ]} /> - - - { - 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) - } - } - }} - /> - + */} { - 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 }} /> + + { + 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) + // } + } + }} + /> + @@ -560,6 +856,12 @@ const GrowthValueRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> name="GROWTH_VALUE" label="所需成长值" tooltip="用户从当前等级晋升到下一等级需要累积的成长值" + rules={[ + { + required: true, + message: '请输入所需成长值' + } + ]} /> {/* diff --git a/src/pages/travelMember/MallEvaluationManage/index.tsx b/src/pages/travelMember/MallEvaluationManage/index.tsx index d250518..e390104 100644 --- a/src/pages/travelMember/MallEvaluationManage/index.tsx +++ b/src/pages/travelMember/MallEvaluationManage/index.tsx @@ -279,7 +279,7 @@ const MallEvaluationManage: React.FC<{ currentUser: CurrentUser | undefined, isC formRef={formRef} bordered options={false} - headerTitle={} // 列表表头 + headerTitle={isComponent ? '' : } // 列表表头 actionRef={actionRef} search={isComponent ? false : { span: 6, labelWidth: 'auto' }} // 请求数据 diff --git a/src/pages/travelMember/MemberAddress/components/addressDetail.tsx b/src/pages/travelMember/MemberAddress/components/addressDetail.tsx index a6d58df..8be8ea6 100644 --- a/src/pages/travelMember/MemberAddress/components/addressDetail.tsx +++ b/src/pages/travelMember/MemberAddress/components/addressDetail.tsx @@ -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(); const formRef = useRef(); const [province, setProvince] = useState(''); @@ -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) => { diff --git a/src/pages/travelMember/MemberSummaryStatistics/index.tsx b/src/pages/travelMember/MemberSummaryStatistics/index.tsx index b984c60..9417ce8 100644 --- a/src/pages/travelMember/MemberSummaryStatistics/index.tsx +++ b/src/pages/travelMember/MemberSummaryStatistics/index.tsx @@ -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(); const formRef = useRef(); + const PointsRecordSearchRef = useRef(); + const GrowthValueRecordSearchRef = useRef(); // 顶部内容的对象值 const [topData, setTopData] = useState() @@ -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({ TotalPointQOQData: { show: false }, @@ -41,13 +49,23 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined } EarnGrowthQOQData: { show: false }, ConsumeGrowthQOQData: { show: false }, }) + // 显示订单详情的悬浮框 + const [showOrderModal, setShowOrderModal] = useState(false) + const [currentRow, setCurrentRow] = useState() + // 显示详情抽屉 + const [showDetailDrawer, setShowDetailDrawer] = useState(false) + // 传入给子组件的搜索内容 + const [toChildrenSearchParams, setToChildrenSearchParams] = useState() // 积分的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 ? { + setCurrentRow(record) + setShowDetailDrawer(true) + handleSetlogSave(`查看${record?.MEMBERSHIP_NAME}【${record?.MEMBERSHIP_ID}】会员信息`) + }}> + {record?.MEMBERSHIP_NAME} + : "-" + } }, { - 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 ? { + setCurrentRow(record) + setShowOrderModal(true) + }}>{record?.TICKET_CODE} : "-" + } + }, { 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) + 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 (
@@ -322,6 +456,7 @@ const MemberSummaryStatistics: React.FC<{ currentUser: CurrentUser | undefined } EndDate: EndDate }) actionRef.current?.reload() + PointsRecordSearchRef.current?.actionRef?.current?.reload() }} > - : + selectTab > 3 ? + : "" + } + + + + {/* 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, }} - /> + /> */}
diff --git a/src/pages/travelMember/MembershipLevelStatistics/index.tsx b/src/pages/travelMember/MembershipLevelStatistics/index.tsx index 038a79e..9416efa 100644 --- a/src/pages/travelMember/MembershipLevelStatistics/index.tsx +++ b/src/pages/travelMember/MembershipLevelStatistics/index.tsx @@ -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(); const formRef = useRef(); - + const PointsRecordSearchRef = useRef(); + const GrowthValueRecordSearchRef = useRef(); // 顶部内容的对象值 const [topData, setTopData] = useState() // 当前顶部的选择到了第几个 @@ -59,6 +62,8 @@ const MembershipLevelStatistics: React.FC<{ currentUser: CurrentUser | undefined const [showDetail, setShowDetail] = useState(false) // 顶部的数组内容 const [topListData, setTopListData] = useState([]) + // 传入给子组件的搜索内容 + const [toChildrenSearchParams, setToChildrenSearchParams] = useState() // 积分的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) }} > - : + selectTab > 3 ? + : "" + } + + {/* + /> */} diff --git a/src/pages/travelMember/MembershipTypeStatistics/index.tsx b/src/pages/travelMember/MembershipTypeStatistics/index.tsx index f05ebfa..50ead18 100644 --- a/src/pages/travelMember/MembershipTypeStatistics/index.tsx +++ b/src/pages/travelMember/MembershipTypeStatistics/index.tsx @@ -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(); const formRef = useRef(); + const PointsRecordSearchRef = useRef(); + const GrowthValueRecordSearchRef = useRef(); // 顶部内容的对象值 const [topData, setTopData] = useState() @@ -44,6 +48,8 @@ const MembershipTypeStatistics: React.FC<{ currentUser: CurrentUser | undefined const [currentRow, setCurrentRow] = useState() // 抽屉显示的值 const [currentDrawerTitle, setCurrentDrawerTitle] = useState('') + // 传入给子组件的搜索内容 + const [toChildrenSearchParams, setToChildrenSearchParams] = useState() 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(false) + // 显示订单详情的悬浮框 + const [showOrderModal, setShowOrderModal] = useState(false) + const [currentTableRow, setCurrentTableRow] = useState() + // 显示详情抽屉 + const [showDetailDrawer, setShowDetailDrawer] = useState(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 ? { + setCurrentRow(record) + setShowDetailDrawer(true) + handleSetlogSave(`查看${record?.MEMBERSHIP_NAME}【${record?.MEMBERSHIP_ID}】会员信息`) + }}> + {record?.MEMBERSHIP_NAME} + : "-" + } }, { - 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 ? { + setCurrentRow(record) + setShowOrderModal(true) + }}>{record?.TICKET_CODE} : "-" + } + }, { 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 } - - - - : + selectTab > 3 ? + : "" + } + + + + + + {/* + /> */} ) diff --git a/src/pages/travelMember/MerchantEvaluationManage/index.tsx b/src/pages/travelMember/MerchantEvaluationManage/index.tsx index fe59082..7d2c1e8 100644 --- a/src/pages/travelMember/MerchantEvaluationManage/index.tsx +++ b/src/pages/travelMember/MerchantEvaluationManage/index.tsx @@ -271,7 +271,7 @@ const MerchantEvaluationManage: React.FC<{ currentUser: CurrentUser, isComponent }} options={false} scroll={{ x: "100%", y: isComponent ? '300px' : "calc(100vh - 410px)" }} - headerTitle={} // 列表表头 + headerTitle={isComponent ? '' : } // 列表表头 search={isComponent ? false : { span: 8 }} request={async (params) => { if (!selectedId && !isComponent) { diff --git a/src/pages/travelMember/MerchantSalesRanking/index.tsx b/src/pages/travelMember/MerchantSalesRanking/index.tsx index 0527562..befe837 100644 --- a/src/pages/travelMember/MerchantSalesRanking/index.tsx +++ b/src/pages/travelMember/MerchantSalesRanking/index.tsx @@ -1,11 +1,198 @@ // 商户销售排行 -import { ConnectState } from "@/models/connect"; +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 ( -
+ const actionRef = useRef(); + const formRef = useRef(); + const [collapsible, setCollapsible] = useState(false) + // 树相关的属性和方法 + const [selectedId, setSelectedId] = useState() + // 查询的条件 + const [searchParams, setSearchParams] = useState() + // 当前查询的文字 + const [currentSearchText, setCurrentSearchText] = useState('') + + 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:
平均评分
, + align: 'right', + width: 120, + hideInSearch: true, + sorter: true + }, + { + dataIndex: 'COMMENT_COUNT', + title:
评价数量
, + align: 'right', + width: 120, + hideInSearch: true, + sorter: true + }, + { + dataIndex: 'MONTHLYSALES', + title:
销量
, + align: 'right', + width: 120, + hideInSearch: true, + sorter: true + }, + { + dataIndex: 'CASHPAY', + title:
销售额
, + align: 'right', + width: 120, + hideInSearch: true, + sorter: true, + defaultSortOrder: 'descend', + }, + { + dataIndex: 'PERCAPITA', + title:
人均
, + 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 ( + + {parts.map((part, i) => + part.toLowerCase() === searchText.toLowerCase() ? + {part} : + part + )} + + ); + }; + + return ( +
+ + + +
+ } // 列表表头 + 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: [ + + ] + }} + /> + +
) } diff --git a/src/pages/travelMember/PointsRecordSearch/index.tsx b/src/pages/travelMember/PointsRecordSearch/index.tsx index c33505c..132bb85 100644 --- a/src/pages/travelMember/PointsRecordSearch/index.tsx +++ b/src/pages/travelMember/PointsRecordSearch/index.tsx @@ -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() const actionRef = useRef(); const formRef = useRef(); @@ -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 ? { + return isComponent && !searchReq ? record?.MEMBERSHIP_NAME || "" : record?.MEMBERSHIP_NAME ? { 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 (
{ // 打印报表 @@ -259,16 +265,20 @@ const PointsRecordSearch: React.FC<{ currentUser: CurrentUser, isComponent?: Boo expandable={{ expandRowByClick: true }} - headerTitle={} + headerTitle={isComponent ? '' : } 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, diff --git a/src/pages/travelMember/PointsRuleConfig/index.tsx b/src/pages/travelMember/PointsRuleConfig/index.tsx index 7180b0f..d50e240 100644 --- a/src/pages/travelMember/PointsRuleConfig/index.tsx +++ b/src/pages/travelMember/PointsRuleConfig/index.tsx @@ -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() // 弹出框拖动效果 const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置 const [disabled, setDraggleDisabled] = useState() // 是否拖动 const draggleRef = React.createRef() + // 第一次请求全部 + const [isFirst, setIsFirst] = useState(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 ? { + return record?.SCORE_TYPE && SCORETYPEObj && SCORETYPEObj[record?.SCORE_TYPE] ? { setCurrentRow({ ...record }); handleModalVisible(true); }}> - {record?.SCORE_NAME} - : '-' + {SCORETYPEObj[record?.SCORE_TYPE]} + : "-" } + // valueEnum: SCORETYPEObj }, + // { + // dataIndex: 'SCORE_NAME', + // title: '规则名称', + // width: 200, + // align: 'center', + // hideInSearch: true, + // render: (_, record) => { + // return record?.SCORE_NAME ? { + // setCurrentRow({ ...record }); + // handleModalVisible(true); + // }}> + // {record?.SCORE_NAME} + // : '-' + // } + // }, { 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: , + 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 ( = (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={{ - ...currentRow, - SCORESETTING_STATE: (currentRow?.SCORESETTING_STATE || currentRow?.SCORESETTING_STATE === 0) ? currentRow?.SCORESETTING_STATE : 1, - MEMBERSHIP_LEVEL: currentRow?.MEMBERSHIP_LEVEL ? currentRow?.MEMBERSHIP_LEVEL.toString() : "" + 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) }} > @@ -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 ]} /> - + {/* = (pr } ]} /> - + */} { + 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} /> { + 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} + /> + + + - @@ -580,16 +823,7 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr label="获得成长值" /> - - - + {/* -
+
: '' + selectTab === 5 ? : '' } {/* 活动轨迹 */} diff --git a/src/pages/travelMember/service.ts b/src/pages/travelMember/service.ts index b9fe5be..d87f68a 100644 --- a/src/pages/travelMember/service.ts +++ b/src/pages/travelMember/service.ts @@ -1033,4 +1033,42 @@ export async function handeGetMEMBERSHIPDetail(params: any) { return data } return data.Result_Data -} \ No newline at end of file +} + + +// 获取服务区商家信息表列表 +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 +} diff --git a/src/versionEnv.ts b/src/versionEnv.ts index c025a6b..1290f45 100644 --- a/src/versionEnv.ts +++ b/src/versionEnv.ts @@ -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";