update
This commit is contained in:
parent
8244fac686
commit
1cd8c40653
@ -521,6 +521,12 @@ export default [
|
|||||||
name: 'NewCouponReview',
|
name: 'NewCouponReview',
|
||||||
component: './CardInformation/NewCouponReview/index'
|
component: './CardInformation/NewCouponReview/index'
|
||||||
},
|
},
|
||||||
|
// 卡券核销记录
|
||||||
|
{
|
||||||
|
path: 'CouponRedemption',
|
||||||
|
name: 'CouponRedemption',
|
||||||
|
component: './CardInformation/CouponRedemption/index'
|
||||||
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ant-design-pro",
|
"name": "ant-design-pro",
|
||||||
"version": "4.5.72",
|
"version": "4.5.74",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "An out-of-box UI solution for enterprise applications",
|
"description": "An out-of-box UI solution for enterprise applications",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { connect } from "umi";
|
|||||||
import type { ConnectState } from "@/models/connect";
|
import type { ConnectState } from "@/models/connect";
|
||||||
import { Col, Divider, FormInstance, message, Modal, Row } from "antd";
|
import { Col, Divider, FormInstance, message, Modal, Row } from "antd";
|
||||||
import { useRef, useState } from "react";
|
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 { handeGetCOUPONDetail, handeGetWECHATAPPSIGNList } from "@/pages/travelMember/service";
|
||||||
import session from "@/utils/session";
|
import session from "@/utils/session";
|
||||||
import { handleDeleteCOUPON, handleGetCOOPSHOP_RULEList, handleSynchroCOUPONService } from "../../service";
|
import { handleDeleteCOUPON, handleGetCOOPSHOP_RULEList, handleSynchroCOUPONService } from "../../service";
|
||||||
@ -49,6 +49,8 @@ const CardInfo = ({ showDetail, currentRow, currentUser, parentRef, setShowDetai
|
|||||||
const [modalLoading, setModalLoading] = useState<boolean>(false)
|
const [modalLoading, setModalLoading] = useState<boolean>(false)
|
||||||
// 当前选择的卡券类型
|
// 当前选择的卡券类型
|
||||||
const [COUPON_TYPE, setCOUPON_TYPE] = useState<any>()
|
const [COUPON_TYPE, setCOUPON_TYPE] = useState<any>()
|
||||||
|
// 当前选择得使用期限
|
||||||
|
const [VALID_TYPE, setVALID_TYPE] = useState<any>()
|
||||||
|
|
||||||
// 预览上传后的图片
|
// 预览上传后的图片
|
||||||
const handlePreview = async () => {
|
const handlePreview = async () => {
|
||||||
@ -155,6 +157,7 @@ const CardInfo = ({ showDetail, currentRow, currentUser, parentRef, setShowDetai
|
|||||||
setShowDetail(false)
|
setShowDetail(false)
|
||||||
setFileList([])
|
setFileList([])
|
||||||
setCOUPON_TYPE(null)
|
setCOUPON_TYPE(null)
|
||||||
|
setVALID_TYPE(null)
|
||||||
}}
|
}}
|
||||||
confirmLoading={modalLoading}
|
confirmLoading={modalLoading}
|
||||||
width={1400}
|
width={1400}
|
||||||
@ -181,6 +184,7 @@ const CardInfo = ({ showDetail, currentRow, currentUser, parentRef, setShowDetai
|
|||||||
setShowDetail(false)
|
setShowDetail(false)
|
||||||
setFileList([])
|
setFileList([])
|
||||||
setCOUPON_TYPE(null)
|
setCOUPON_TYPE(null)
|
||||||
|
setVALID_TYPE(null)
|
||||||
}}
|
}}
|
||||||
handleOK={() => {
|
handleOK={() => {
|
||||||
ModalFormRef?.current?.validateFields().then(async (res) => {
|
ModalFormRef?.current?.validateFields().then(async (res) => {
|
||||||
@ -202,13 +206,14 @@ const CardInfo = ({ showDetail, currentRow, currentUser, parentRef, setShowDetai
|
|||||||
const data = await handeGetCOUPONDetail(req)
|
const data = await handeGetCOUPONDetail(req)
|
||||||
setCouponDetail(data)
|
setCouponDetail(data)
|
||||||
setCOUPON_TYPE(currentRow?.COUPON_TYPE)
|
setCOUPON_TYPE(currentRow?.COUPON_TYPE)
|
||||||
|
setVALID_TYPE(currentRow?.VALID_TYPE)
|
||||||
return data
|
return data
|
||||||
} else {
|
} else {
|
||||||
setCOUPON_TYPE(1000)
|
setCOUPON_TYPE(1000)
|
||||||
|
setVALID_TYPE(1000)
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
>
|
>
|
||||||
<Divider orientation="left">基本信息</Divider>
|
<Divider orientation="left">基本信息</Divider>
|
||||||
|
|
||||||
@ -458,8 +463,17 @@ const CardInfo = ({ showDetail, currentRow, currentUser, parentRef, setShowDetai
|
|||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
readonly={readonly}
|
readonly={readonly}
|
||||||
|
fieldProps={{
|
||||||
|
onChange: (e) => {
|
||||||
|
console.log('eeee', e);
|
||||||
|
setVALID_TYPE(e)
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
initialValue={1000}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
{
|
||||||
|
VALID_TYPE === 1000 ?
|
||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
<Row gutter={16}>
|
<Row gutter={16}>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
@ -490,7 +504,19 @@ const CardInfo = ({ showDetail, currentRow, currentUser, parentRef, setShowDetai
|
|||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
|
</Col> : VALID_TYPE === 2000 ?
|
||||||
|
<Col span={8}>
|
||||||
|
<Col span={24}>
|
||||||
|
<ProFormDigit
|
||||||
|
label={"有效天数"}
|
||||||
|
name={"VALID_DAYS"}
|
||||||
|
readonly={readonly}
|
||||||
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
</Col>
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
|
||||||
<Col span={8}>
|
<Col span={8}>
|
||||||
<ProFormSelect
|
<ProFormSelect
|
||||||
label={"允许叠加"}
|
label={"允许叠加"}
|
||||||
|
|||||||
@ -11,6 +11,8 @@ import { handeGetCouponStockList } from "@/pages/travelMember/service";
|
|||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import { highlightText } from "@/utils/highlightText";
|
import { highlightText } from "@/utils/highlightText";
|
||||||
import CardInfo from "../CardInformationManager/components/CardInfo";
|
import CardInfo from "../CardInformationManager/components/CardInfo";
|
||||||
|
import session from "@/utils/session";
|
||||||
|
import { values } from "lodash";
|
||||||
|
|
||||||
|
|
||||||
const CardVoucherCollection: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
const CardVoucherCollection: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||||
@ -39,6 +41,8 @@ const CardVoucherCollection: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
|||||||
// 当前行数据
|
// 当前行数据
|
||||||
const [currentRow, setCurrentRow] = useState<any>()
|
const [currentRow, setCurrentRow] = useState<any>()
|
||||||
|
|
||||||
|
const COUPONTYPEObj = session.get('COUPONTYPEObj')
|
||||||
|
|
||||||
const columns: any = [
|
const columns: any = [
|
||||||
{
|
{
|
||||||
title: '查询内容',
|
title: '查询内容',
|
||||||
@ -55,14 +59,15 @@ const CardVoucherCollection: React.FC<{ currentUser: CurrentUser }> = (props) =>
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
valueEnum: {
|
valueEnum: COUPONTYPEObj,
|
||||||
"1000": "满减券",
|
// valueEnum: {
|
||||||
"2000": "折扣券",
|
// "1000": "满减券",
|
||||||
"3000": "抵扣券",
|
// "2000": "折扣券",
|
||||||
"4000": "兑换券",
|
// "3000": "抵扣券",
|
||||||
"5000": "代金券",
|
// "4000": "兑换券",
|
||||||
"9000": "实物券"
|
// "5000": "代金券",
|
||||||
}
|
// "9000": "实物券"
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '查询时间',
|
title: '查询时间',
|
||||||
|
|||||||
168
src/pages/CardInformation/CouponRedemption/index.tsx
Normal file
168
src/pages/CardInformation/CouponRedemption/index.tsx
Normal file
@ -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<ActionType>();
|
||||||
|
const formRef = useRef<FormInstance>();
|
||||||
|
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 (
|
||||||
|
<div>
|
||||||
|
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||||
|
<div style={{
|
||||||
|
width: '100%',
|
||||||
|
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) => {
|
||||||
|
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: [
|
||||||
|
|
||||||
|
]
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default connect(({ user }: ConnectState) => ({
|
||||||
|
currentUser: user.currentUser
|
||||||
|
}))(CouponRedemption);
|
||||||
@ -102,3 +102,19 @@ export async function handleDeleteCOUPON(params: any) {
|
|||||||
}
|
}
|
||||||
return data
|
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
|
||||||
|
}
|
||||||
|
|||||||
@ -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<ActionType>();
|
||||||
|
const formRef = useRef<FormInstance>();
|
||||||
|
// 选择的卡券id
|
||||||
|
const [selectShopRowKey, setSelectShopRowKey] = useState<any>([])
|
||||||
|
// 表格数据 可以传给父级 当作卡券的 选择列表
|
||||||
|
const [couponList, setCouponList] = useState<any>()
|
||||||
|
|
||||||
|
|
||||||
|
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 (
|
||||||
|
<div>
|
||||||
|
<ProTable
|
||||||
|
scroll={{ x: "100%", y: '450px' }}
|
||||||
|
rowKey={(record) => {
|
||||||
|
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)
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default connect(({ user, }: ConnectState) => ({
|
||||||
|
currentUser: user.currentUser,
|
||||||
|
}))(RelevanceCoupon);
|
||||||
@ -31,6 +31,8 @@ import { handleSetlogSave } from '@/utils/format';
|
|||||||
import { highlightText } from '@/utils/highlightText';
|
import { highlightText } from '@/utils/highlightText';
|
||||||
import { handlecsyncWeChatGetMallGoodsInfo, handlecsyncWeChatGetMallGoodsInfoAll } from '@/pages/operatingMerchants/service';
|
import { handlecsyncWeChatGetMallGoodsInfo, handlecsyncWeChatGetMallGoodsInfoAll } from '@/pages/operatingMerchants/service';
|
||||||
import { isEqual } from 'lodash';
|
import { isEqual } from 'lodash';
|
||||||
|
import RelevanceCoupon from './component/RelevanceCoupon';
|
||||||
|
import { handleGetCOUPONList } from '@/pages/CardInformation/service';
|
||||||
|
|
||||||
|
|
||||||
const beforeUpload = (file: any) => {
|
const beforeUpload = (file: any) => {
|
||||||
@ -48,6 +50,7 @@ const beforeUpload = (file: any) => {
|
|||||||
const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
|
const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => {
|
||||||
const { currentUser } = props
|
const { currentUser } = props
|
||||||
const { confirm } = Modal;
|
const { confirm } = Modal;
|
||||||
|
const associatedCouponsModalRef = useRef<any>()
|
||||||
const actionRef = useRef<ActionType>();
|
const actionRef = useRef<ActionType>();
|
||||||
const ruleActionRef = useRef<ActionType>();
|
const ruleActionRef = useRef<ActionType>();
|
||||||
// 税率的表单
|
// 税率的表单
|
||||||
@ -112,6 +115,12 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
|||||||
const [rateLoading, setRateLoading] = useState<boolean>(false)
|
const [rateLoading, setRateLoading] = useState<boolean>(false)
|
||||||
// 点开的商品详情信息
|
// 点开的商品详情信息
|
||||||
const [currentRowDetail, setCurrentRowDetail] = useState<any>()
|
const [currentRowDetail, setCurrentRowDetail] = useState<any>()
|
||||||
|
// 关联卡券的 悬浮框 显示
|
||||||
|
const [associatedCouponsModal, setAssociatedCouponsModal] = useState<boolean>(false)
|
||||||
|
// 关联卡券的选择列表
|
||||||
|
const [relevanceCouponList, setRelevanceCouponList] = useState<any>([])
|
||||||
|
// 当前选择的卡券行
|
||||||
|
const [selectRelevanceId, setSelectRelevanceId] = useState<any>([])
|
||||||
|
|
||||||
// 预览上传后的图片
|
// 预览上传后的图片
|
||||||
const handlePreview = async (type: number) => {
|
const handlePreview = async (type: number) => {
|
||||||
@ -524,6 +533,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
|||||||
...currentRow,
|
...currentRow,
|
||||||
...res,
|
...res,
|
||||||
UserDefinedTypeIds: res.USERDEFINEDTYPE_ID ? res.USERDEFINEDTYPE_ID.toString() : "",
|
UserDefinedTypeIds: res.USERDEFINEDTYPE_ID ? res.USERDEFINEDTYPE_ID.toString() : "",
|
||||||
|
CouponIds: res.relevanceCoupon ? res.relevanceCoupon.toString() : "",
|
||||||
BRAND_ID: res.BRAND_ID.split('-')[1],
|
BRAND_ID: res.BRAND_ID.split('-')[1],
|
||||||
BRAND_NAME: res.BRAND_ID.split('-')[0],
|
BRAND_NAME: res.BRAND_ID.split('-')[0],
|
||||||
MERCHANTS_ID: res.MERCHANTS_ID.split('-')[1],
|
MERCHANTS_ID: res.MERCHANTS_ID.split('-')[1],
|
||||||
@ -547,6 +557,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
|||||||
...res,
|
...res,
|
||||||
UserDefinedTypeIds: res.USERDEFINEDTYPE_ID ? res.USERDEFINEDTYPE_ID.toString() : "",
|
UserDefinedTypeIds: res.USERDEFINEDTYPE_ID ? res.USERDEFINEDTYPE_ID.toString() : "",
|
||||||
BRAND_ID: res.BRAND_ID.split('-')[1],
|
BRAND_ID: res.BRAND_ID.split('-')[1],
|
||||||
|
CouponIds: res.relevanceCoupon ? res.relevanceCoupon.toString() : "",
|
||||||
BRAND_NAME: res.BRAND_ID.split('-')[0],
|
BRAND_NAME: res.BRAND_ID.split('-')[0],
|
||||||
MERCHANTS_ID: res.MERCHANTS_ID.split('-')[1],
|
MERCHANTS_ID: res.MERCHANTS_ID.split('-')[1],
|
||||||
MERCHANTS_NAME: res.MERCHANTS_ID.split('-')[0],
|
MERCHANTS_NAME: res.MERCHANTS_ID.split('-')[0],
|
||||||
@ -588,6 +599,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
|||||||
setMainImgList([])
|
setMainImgList([])
|
||||||
setHeaderImgList([])
|
setHeaderImgList([])
|
||||||
setDetailImgList([])
|
setDetailImgList([])
|
||||||
|
setRelevanceCouponList([])
|
||||||
|
setSelectRelevanceId([])
|
||||||
|
|
||||||
|
|
||||||
let USERDEFINEDTYPEList: any = session.get('USERDEFINEDTYPEList')
|
let USERDEFINEDTYPEList: any = session.get('USERDEFINEDTYPEList')
|
||||||
@ -953,10 +966,17 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
|||||||
setMainImgList([])
|
setMainImgList([])
|
||||||
setHeaderImgList([])
|
setHeaderImgList([])
|
||||||
setDetailImgList([])
|
setDetailImgList([])
|
||||||
|
setRelevanceCouponList([])
|
||||||
|
setSelectRelevanceId([])
|
||||||
// setBRAND_NAMEList([])
|
// setBRAND_NAMEList([])
|
||||||
}}
|
}}
|
||||||
footer={<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
footer={<div style={{ width: '100%', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
||||||
<div>
|
<div style={{ display: 'flex', alignItems: 'center' }}>
|
||||||
|
<Button type={"primary"} style={{ marginRight: '8px' }} onClick={async () => {
|
||||||
|
const data = await formRef.current?.getFieldValue('relevanceCoupon')
|
||||||
|
setSelectRelevanceId(data && data.length > 0 && data[0] ? data : [])
|
||||||
|
setAssociatedCouponsModal(true)
|
||||||
|
}}>关联卡券</Button>
|
||||||
{
|
{
|
||||||
currentRow ?
|
currentRow ?
|
||||||
<div>
|
<div>
|
||||||
@ -974,7 +994,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
|||||||
删除
|
删除
|
||||||
</Button>
|
</Button>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
@ -1052,6 +1071,8 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
|||||||
setHeaderImgList([])
|
setHeaderImgList([])
|
||||||
setDetailImgList([])
|
setDetailImgList([])
|
||||||
setCurrentRowDetail(undefined)
|
setCurrentRowDetail(undefined)
|
||||||
|
setRelevanceCouponList([])
|
||||||
|
setSelectRelevanceId([])
|
||||||
}}>取 消</Button>
|
}}>取 消</Button>
|
||||||
<Button type={"primary"} loading={confirmLoading} onClick={() => {
|
<Button type={"primary"} loading={confirmLoading} onClick={() => {
|
||||||
formRef?.current?.validateFields().then(() => {
|
formRef?.current?.validateFields().then(() => {
|
||||||
@ -1139,6 +1160,7 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
|||||||
BRAND_ID: `${data?.BRAND_NAME}-${data?.BRAND_ID}`,
|
BRAND_ID: `${data?.BRAND_NAME}-${data?.BRAND_ID}`,
|
||||||
MERCHANTS_ID: `${data?.MERCHANTS_NAME}-${data?.MERCHANTS_ID}`,
|
MERCHANTS_ID: `${data?.MERCHANTS_NAME}-${data?.MERCHANTS_ID}`,
|
||||||
UPPER_DATE: data.UPPER_DATE && data.OFF_DATE ? [data.UPPER_DATE, data.OFF_DATE] : [],
|
UPPER_DATE: data.UPPER_DATE && data.OFF_DATE ? [data.UPPER_DATE, data.OFF_DATE] : [],
|
||||||
|
relevanceCoupon: data.CouponIds.split(',').map(Number)
|
||||||
// mainImgList: mainImgList,
|
// mainImgList: mainImgList,
|
||||||
// headerImgList: headerImgList,
|
// headerImgList: headerImgList,
|
||||||
// detailImgList: detailImgList,
|
// detailImgList: detailImgList,
|
||||||
@ -1587,6 +1609,37 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
|||||||
disabled
|
disabled
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
|
<ProFormSelect
|
||||||
|
label={'关联卡券'}
|
||||||
|
name={'relevanceCoupon'}
|
||||||
|
disabled
|
||||||
|
// options={relevanceCouponList}
|
||||||
|
request={async () => {
|
||||||
|
const req: any = {
|
||||||
|
SearchParameter: {
|
||||||
|
OWNERUNIT_ID: 911,
|
||||||
|
COUPON_TYPES: 9000,
|
||||||
|
COUPON_ISVALID: 1
|
||||||
|
},
|
||||||
|
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 })
|
||||||
|
})
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
}}
|
||||||
|
fieldProps={{
|
||||||
|
mode: 'multiple'
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
<Divider orientation="left">主图</Divider>
|
<Divider orientation="left">主图</Divider>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<ProFormUploadButton
|
<ProFormUploadButton
|
||||||
@ -1952,8 +2005,6 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
|||||||
|
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{/* 税率悬浮框 */}
|
{/* 税率悬浮框 */}
|
||||||
<Modal
|
<Modal
|
||||||
title={"设置税率"}
|
title={"设置税率"}
|
||||||
@ -2009,6 +2060,58 @@ const COMMODITYTable: React.FC<{ currentUser: CurrentUser | undefined }> = (prop
|
|||||||
</ProForm>
|
</ProForm>
|
||||||
|
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
{/* 关联卡券的悬浮框 */}
|
||||||
|
<Modal
|
||||||
|
title={
|
||||||
|
<div
|
||||||
|
className='associatedCouponsModal'
|
||||||
|
style={{
|
||||||
|
width: '100%',
|
||||||
|
cursor: 'move',
|
||||||
|
}}
|
||||||
|
onMouseOver={() => {
|
||||||
|
if (disabled) {
|
||||||
|
setDraggleDisabled(false)
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onMouseOut={() => {
|
||||||
|
setDraggleDisabled(true)
|
||||||
|
}}
|
||||||
|
|
||||||
|
onFocus={() => { }}
|
||||||
|
onBlur={() => { }}
|
||||||
|
>
|
||||||
|
关联卡券
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
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 <Draggable
|
||||||
|
disabled={disabled}
|
||||||
|
bounds={bounds}
|
||||||
|
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||||
|
handle='.associatedCouponsModal'
|
||||||
|
>
|
||||||
|
<div ref={draggleRef}>{modal}</div>
|
||||||
|
</Draggable>
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<RelevanceCoupon onRef={associatedCouponsModalRef} parentRow={currentRow} selectRow={selectRelevanceId} />
|
||||||
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
// 由 scripts/writeVersion.js 自动生成
|
// 由 scripts/writeVersion.js 自动生成
|
||||||
export const VERSION = "4.5.72";
|
export const VERSION = "4.5.74";
|
||||||
export const GIT_HASH = "9a7cf2f";
|
export const GIT_HASH = "8244fac";
|
||||||
export const BUILD_TIME = "2025-11-12T10:24:34.154Z";
|
export const BUILD_TIME = "2025-11-14T01:20:30.467Z";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user