diff --git a/config/routes.ts b/config/routes.ts index 64b625c..3942e73 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -521,6 +521,12 @@ export default [ name: 'NewCouponReview', component: './CardInformation/NewCouponReview/index' }, + // 卡券核销记录 + { + path: 'CouponRedemption', + name: 'CouponRedemption', + component: './CardInformation/CouponRedemption/index' + }, ] }, diff --git a/dist.zip b/dist.zip index c3f8fa5..76dee89 100644 Binary files a/dist.zip and b/dist.zip differ diff --git a/package.json b/package.json index a7b685a..498bff1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "4.5.72", + "version": "4.5.74", "private": true, "description": "An out-of-box UI solution for enterprise applications", "scripts": { diff --git a/src/pages/CardInformation/CardInformationManager/components/CardInfo.tsx b/src/pages/CardInformation/CardInformationManager/components/CardInfo.tsx index f1e7f6d..fc18722 100644 --- a/src/pages/CardInformation/CardInformationManager/components/CardInfo.tsx +++ b/src/pages/CardInformation/CardInformationManager/components/CardInfo.tsx @@ -2,7 +2,7 @@ import { connect } from "umi"; import type { ConnectState } from "@/models/connect"; import { Col, Divider, FormInstance, message, Modal, Row } from "antd"; import { useRef, useState } from "react"; -import ProForm, { ProFormDatePicker, ProFormSelect, ProFormText, ProFormTextArea, ProFormUploadButton } from "@ant-design/pro-form"; +import ProForm, { ProFormDatePicker, ProFormDigit, ProFormSelect, ProFormText, ProFormTextArea, ProFormUploadButton } from "@ant-design/pro-form"; import { handeGetCOUPONDetail, handeGetWECHATAPPSIGNList } from "@/pages/travelMember/service"; import session from "@/utils/session"; import { handleDeleteCOUPON, handleGetCOOPSHOP_RULEList, handleSynchroCOUPONService } from "../../service"; @@ -49,6 +49,8 @@ const CardInfo = ({ showDetail, currentRow, currentUser, parentRef, setShowDetai const [modalLoading, setModalLoading] = useState(false) // 当前选择的卡券类型 const [COUPON_TYPE, setCOUPON_TYPE] = useState() + // 当前选择得使用期限 + const [VALID_TYPE, setVALID_TYPE] = useState() // 预览上传后的图片 const handlePreview = async () => { @@ -155,6 +157,7 @@ const CardInfo = ({ showDetail, currentRow, currentUser, parentRef, setShowDetai setShowDetail(false) setFileList([]) setCOUPON_TYPE(null) + setVALID_TYPE(null) }} confirmLoading={modalLoading} width={1400} @@ -181,6 +184,7 @@ const CardInfo = ({ showDetail, currentRow, currentUser, parentRef, setShowDetai setShowDetail(false) setFileList([]) setCOUPON_TYPE(null) + setVALID_TYPE(null) }} handleOK={() => { ModalFormRef?.current?.validateFields().then(async (res) => { @@ -202,13 +206,14 @@ const CardInfo = ({ showDetail, currentRow, currentUser, parentRef, setShowDetai const data = await handeGetCOUPONDetail(req) setCouponDetail(data) setCOUPON_TYPE(currentRow?.COUPON_TYPE) + setVALID_TYPE(currentRow?.VALID_TYPE) return data } else { setCOUPON_TYPE(1000) + setVALID_TYPE(1000) return {} } }} - > 基本信息 @@ -458,39 +463,60 @@ const CardInfo = ({ showDetail, currentRow, currentUser, parentRef, setShowDetai } ]} readonly={readonly} + fieldProps={{ + onChange: (e) => { + console.log('eeee', e); + setVALID_TYPE(e) + } + }} + initialValue={1000} /> - - - - - - - - - + { + VALID_TYPE === 1000 ? + + + + + + + + + + + : VALID_TYPE === 2000 ? + + + + + + : '' + } - = (props) => { @@ -39,6 +41,8 @@ const CardVoucherCollection: React.FC<{ currentUser: CurrentUser }> = (props) => // 当前行数据 const [currentRow, setCurrentRow] = useState() + const COUPONTYPEObj = session.get('COUPONTYPEObj') + const columns: any = [ { title: '查询内容', @@ -55,14 +59,15 @@ const CardVoucherCollection: React.FC<{ currentUser: CurrentUser }> = (props) => align: 'center', ellipsis: true, valueType: 'select', - valueEnum: { - "1000": "满减券", - "2000": "折扣券", - "3000": "抵扣券", - "4000": "兑换券", - "5000": "代金券", - "9000": "实物券" - } + valueEnum: COUPONTYPEObj, + // valueEnum: { + // "1000": "满减券", + // "2000": "折扣券", + // "3000": "抵扣券", + // "4000": "兑换券", + // "5000": "代金券", + // "9000": "实物券" + // } }, { title: '查询时间', diff --git a/src/pages/CardInformation/CouponRedemption/index.tsx b/src/pages/CardInformation/CouponRedemption/index.tsx new file mode 100644 index 0000000..84fef56 --- /dev/null +++ b/src/pages/CardInformation/CouponRedemption/index.tsx @@ -0,0 +1,168 @@ +import { connect } from "umi"; +import type { CurrentUser } from "umi"; +import type { ConnectState } from "@/models/connect"; +import React, { useRef, useState } from "react"; +import type { FormInstance } from "antd"; +import type { ActionType } from "@ant-design/pro-table"; +import ProTable from "@ant-design/pro-table"; +import PageTitleBox from "@/components/PageTitleBox"; +import { handleGetCOUPONRECORDList } from "../service"; +import moment from 'moment' +import session from "@/utils/session"; + + +const CouponRedemption: React.FC<{ currentUser: CurrentUser }> = (props) => { + const { currentUser } = props + const actionRef = useRef(); + const formRef = useRef(); + const COUPONTYPEObj = session.get('COUPONTYPEObj') + + const columns: any = [ + { + title: '统计时间', + dataIndex: 'search_date', + valueType: 'dateRange', + hideInTable: true, + hideInDescriptions: true, + hideInSearch: false, + initialValue: [moment().add(-7, 'day'), moment()], + search: { + transform: (value) => { + return { + CREATE_DATE_Start: value[0], + CREATE_DATE_End: value[1], + }; + }, + }, + }, + { + title: "卡券名称", + dataIndex: "COUPON_NAME", + width: 150, + align: 'center', + hideInSearch: true, + ellipsis: true, + }, + { + title: "卡券编码", + dataIndex: "COUPON_CODE", + width: 150, + align: 'center', + hideInSearch: true, + ellipsis: true, + }, + { + title: "卡券类型", + dataIndex: "COUPON_TYPE", + valueType: 'select', + valueEnum: COUPONTYPEObj, + width: 150, + align: 'center', + hideInSearch: true, + ellipsis: true, + }, + + { + title: "核销人员名称", + dataIndex: "UPDATEMEMBER_NAME", + width: 150, + align: 'center', + hideInSearch: true, + ellipsis: true, + }, + { + title: "优惠金额", + dataIndex: "COUPON_PRICE", + width: 150, + align: 'center', + hideInSearch: true, + ellipsis: true, + valueType: 'digit' + }, + { + title: "会员名称", + dataIndex: "MEMBERSHIP_NAME", + width: 150, + align: 'center', + hideInSearch: true, + ellipsis: true, + }, + { + title: "联系电话", + dataIndex: "MEMBERSHIP_MOBILEPHONE", + width: 150, + align: 'center', + hideInSearch: true, + ellipsis: true, + }, + { + title: "核销时间", + dataIndex: "CREATE_DATE", + width: 150, + align: 'center', + hideInSearch: true, + ellipsis: true, + render: (_, record) => { + return record?.CREATE_DATE ? moment(record?.CREATE_DATE).format('YYYY-MM-DD HH:mm:ss') : "" + } + } + ] + + return ( +
+
+
+ } // 列表表头 + search={{ span: 6 }} + request={async (params) => { + console.log('paramsparams', params); + + const req: any = { + searchParameter: { + CREATE_DATE_Start: params?.CREATE_DATE_Start, + CREATE_DATE_End: params?.CREATE_DATE_End, + }, + sortStr: "CREATE_DATE desc", + PageIndex: 1, + PageSize: 999999, + // PageIndex: params?.current, + // PageSize: params?.pageSize, + + } + const data = await handleGetCOUPONRECORDList(req) + console.log('datadata212', data); + + if (data.List && data.List.length > 0) { + return { data: data.List, success: true, total: data.TotalCount } + } + return { data: [], success: true } + }} + toolbar={{ + actions: [ + + ] + }} + /> +
+
+
+ ) +} + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.currentUser +}))(CouponRedemption); diff --git a/src/pages/CardInformation/service.ts b/src/pages/CardInformation/service.ts index 26733a6..0bd6764 100644 --- a/src/pages/CardInformation/service.ts +++ b/src/pages/CardInformation/service.ts @@ -102,3 +102,19 @@ export async function handleDeleteCOUPON(params: any) { } return data } + + +// 获取优惠券操作记录表列表 +export async function handleGetCOUPONRECORDList(params: any) { + const data = await requestEncryption(`/Coupon/GetCOUPONRECORDList`, { + method: 'POST', + data: { + ...params, + requestEncryption: true + } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data +} diff --git a/src/pages/travelMember/ProductListingManagement/component/RelevanceCoupon.tsx b/src/pages/travelMember/ProductListingManagement/component/RelevanceCoupon.tsx new file mode 100644 index 0000000..3e15b21 --- /dev/null +++ b/src/pages/travelMember/ProductListingManagement/component/RelevanceCoupon.tsx @@ -0,0 +1,147 @@ +import { connect } from "umi"; +import type { ConnectState } from "@/models/connect"; +import ProTable, { ActionType } from "@ant-design/pro-table"; +import { useEffect, useImperativeHandle, useRef, useState } from "react"; +import { FormInstance } from "antd"; +import { handleGetCOUPONList } from "@/pages/CardInformation/service"; + +type DetailProps = { + parentRow: any // 父级传入的行数据 + onRef: any// 当前组件的父级里面的实例 + selectRow: any // 选择的行数据 +} +const RelevanceCoupon = ({ parentRow, onRef, selectRow }: DetailProps) => { + const actionRef = useRef(); + const formRef = useRef(); + // 选择的卡券id + const [selectShopRowKey, setSelectShopRowKey] = useState([]) + // 表格数据 可以传给父级 当作卡券的 选择列表 + const [couponList, setCouponList] = useState() + + + const columns: any = [ + { + title: "卡券名称", + dataIndex: "COUPON_NAME", + align: 'left', + hideInSearch: true, + ellipsis: true, + }, + { + title: "使用说明", + dataIndex: "COUPON_INSTRUCTIONS", + width: 250, + align: 'center', + hideInSearch: true, + ellipsis: true, + }, + { + title: "适用门店", + dataIndex: "COOPSHOP_DESC", + width: 250, + align: 'center', + hideInSearch: true, + ellipsis: true, + }, + // { + // title: "发放数量", + // dataIndex: "COUPON_QUOTA", + // width: 120, + // align: 'center', + // hideInSearch: true, + // ellipsis: true, + // render: (_, record) => { + // return record?.COUPON_QUOTA === -1 ? '不限量' : record?.COUPON_QUOTA + // } + // }, + { + title: "活动开始时间", + dataIndex: "START_TIME", + width: 150, + align: 'center', + hideInSearch: true, + ellipsis: true, + }, + { + title: "活动结束时间", + dataIndex: "END_TIME", + width: 150, + align: 'center', + hideInSearch: true, + ellipsis: true, + } + ] + + useImperativeHandle(onRef, () => ({ + couponList, + selectShopRowKey + })); + + useEffect(() => { + if (selectRow && selectRow.length > 0) { + setSelectShopRowKey(selectRow.map(String)) + } + }, []) + + + return ( +
+ { + return `${record?.COUPON_ID}` + }} + formRef={formRef} + bordered + headerTitle={'卡券列表'} // 列表表头 + actionRef={actionRef} + search={{ span: 6, labelWidth: 'auto' }} + // 请求数据 + request={async (params, sorter) => { + const req: any = { + SearchParameter: { + OWNERUNIT_ID: 911, + COUPON_TYPES: 9000, + COUPON_ISVALID: 1 + }, + keyWord: { + key: "COUPON_NAME", + value: params?.searchValue || "" + }, + PageIndex: 1, + PageSize: 999999 + } + const data = await handleGetCOUPONList(req) + if (data && data.length > 0) { + let list: any = [] + data.forEach((item: any) => { + list.push({ label: item.COUPON_NAME, value: item.COUPON_ID }) + }) + setCouponList(list) + return { data, success: true } + } + setCouponList([]) + return { data: [], success: true } + }} + columns={columns} + toolbar={{ + actions: [ + ], + }} + rowSelection={{ + type: 'checkbox', + selectedRowKeys: selectShopRowKey, + onChange: (rowKeys, rowDetail) => { + console.log('rowKeysrowKeysrowKeys', rowKeys); + console.log('rowDetailrowDetailrowDetail', rowDetail); + setSelectShopRowKey(rowKeys) + }, + }} + /> +
+ ) +} + +export default connect(({ user, }: ConnectState) => ({ + currentUser: user.currentUser, +}))(RelevanceCoupon); diff --git a/src/pages/travelMember/ProductListingManagement/index.tsx b/src/pages/travelMember/ProductListingManagement/index.tsx index 451eacb..6cdde20 100644 --- a/src/pages/travelMember/ProductListingManagement/index.tsx +++ b/src/pages/travelMember/ProductListingManagement/index.tsx @@ -31,6 +31,8 @@ import { handleSetlogSave } from '@/utils/format'; import { highlightText } from '@/utils/highlightText'; import { handlecsyncWeChatGetMallGoodsInfo, handlecsyncWeChatGetMallGoodsInfoAll } from '@/pages/operatingMerchants/service'; import { isEqual } from 'lodash'; +import RelevanceCoupon from './component/RelevanceCoupon'; +import { handleGetCOUPONList } from '@/pages/CardInformation/service'; const beforeUpload = (file: any) => { @@ -48,6 +50,7 @@ const beforeUpload = (file: any) => { const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => { const { currentUser } = props const { confirm } = Modal; + const associatedCouponsModalRef = useRef() const actionRef = useRef(); const ruleActionRef = useRef(); // 税率的表单 @@ -112,6 +115,12 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop const [rateLoading, setRateLoading] = useState(false) // 点开的商品详情信息 const [currentRowDetail, setCurrentRowDetail] = useState() + // 关联卡券的 悬浮框 显示 + const [associatedCouponsModal, setAssociatedCouponsModal] = useState(false) + // 关联卡券的选择列表 + const [relevanceCouponList, setRelevanceCouponList] = useState([]) + // 当前选择的卡券行 + const [selectRelevanceId, setSelectRelevanceId] = useState([]) // 预览上传后的图片 const handlePreview = async (type: number) => { @@ -524,6 +533,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop ...currentRow, ...res, UserDefinedTypeIds: res.USERDEFINEDTYPE_ID ? res.USERDEFINEDTYPE_ID.toString() : "", + CouponIds: res.relevanceCoupon ? res.relevanceCoupon.toString() : "", BRAND_ID: res.BRAND_ID.split('-')[1], BRAND_NAME: res.BRAND_ID.split('-')[0], MERCHANTS_ID: res.MERCHANTS_ID.split('-')[1], @@ -547,6 +557,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop ...res, UserDefinedTypeIds: res.USERDEFINEDTYPE_ID ? res.USERDEFINEDTYPE_ID.toString() : "", BRAND_ID: res.BRAND_ID.split('-')[1], + CouponIds: res.relevanceCoupon ? res.relevanceCoupon.toString() : "", BRAND_NAME: res.BRAND_ID.split('-')[0], MERCHANTS_ID: res.MERCHANTS_ID.split('-')[1], MERCHANTS_NAME: res.MERCHANTS_ID.split('-')[0], @@ -588,6 +599,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop setMainImgList([]) setHeaderImgList([]) setDetailImgList([]) + setRelevanceCouponList([]) + setSelectRelevanceId([]) let USERDEFINEDTYPEList: any = session.get('USERDEFINEDTYPEList') @@ -953,10 +966,17 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop setMainImgList([]) setHeaderImgList([]) setDetailImgList([]) + setRelevanceCouponList([]) + setSelectRelevanceId([]) // setBRAND_NAMEList([]) }} footer={
-
+
+ { currentRow ?
@@ -974,7 +994,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop 删除 -
: "" } @@ -1052,6 +1071,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop setHeaderImgList([]) setDetailImgList([]) setCurrentRowDetail(undefined) + setRelevanceCouponList([]) + setSelectRelevanceId([]) }}>取 消
+ } + destroyOnClose + width={1200} + open={associatedCouponsModal} + onCancel={() => { + setAssociatedCouponsModal(false) + }} + onOk={async () => { // 提交框内的数据 + let res: any = associatedCouponsModalRef.current + console.log('resdada', res); + // setRelevanceCouponList(res.couponList) + formRef.current?.setFieldsValue({ relevanceCoupon: res.selectShopRowKey.map(Number) }) + + setAssociatedCouponsModal(false) + }} + modalRender={(modal) => { + return onDraggaleStart(event, uiData)} + handle='.associatedCouponsModal' + > +
{modal}
+
+ }} + > + +
); diff --git a/src/versionEnv.ts b/src/versionEnv.ts index d3b5074..0e594d1 100644 --- a/src/versionEnv.ts +++ b/src/versionEnv.ts @@ -1,4 +1,4 @@ // 由 scripts/writeVersion.js 自动生成 -export const VERSION = "4.5.72"; -export const GIT_HASH = "9a7cf2f"; -export const BUILD_TIME = "2025-11-12T10:24:34.154Z"; +export const VERSION = "4.5.74"; +export const GIT_HASH = "8244fac"; +export const BUILD_TIME = "2025-11-14T01:20:30.467Z";