Commit c8d80a89 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents a1df5c2f de9187bf
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-08-20 16:15:59
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-16 11:45:36
* @LastEditTime: 2021-07-28 17:39:18
* @Description: 可以带查询的表格,内置 formily,如果需要其他Form可以传入 customRenderSearchForm 配合 reload() 实现查询
*/
import React, { useState, useEffect, useRef, useImperativeHandle } from 'react';
......@@ -90,6 +90,7 @@ const NormalTable: React.ForwardRefRenderFunction<NormalTableRefHandleType, Norm
return {
...prevState,
data: props.dataSource as T[],
totalCount: props.dataSource.length,
}
});
}
......@@ -141,7 +142,7 @@ const NormalTable: React.ForwardRefRenderFunction<NormalTableRefHandleType, Norm
reload,
}));
const totalCount = tableData.totalCount || pagination?.total || 0;
const totalCount = pagination?.total || tableData.totalCount || 0;
const paginationProps: PaginationProps = pagination ? {
current: current,
......
......@@ -47,3 +47,22 @@ export const MERCHANT_COUPON_RECEIVE_ACTIVITY = 3;
* 会员运营用券
*/
export const MERCHANT_COUPON_RECEIVE_OPERATE = 4;
/* --------------------------------- 商家优惠券适用用户 -------------------------------- */
/**
* 新用户(不包含会员)
*/
export const SUITABLE_TYPE_NEW_USER = 1;
/**
* 老用户(不包含会员)
*/
export const SUITABLE_TYPE_OLD_USER = 2;
/**
* 新会员(仅会员用户)
*/
export const SUITABLE_TYPE_NEW_MEMBER = 3;
/**
* 老会员(仅会员用户)
*/
export const SUITABLE_TYPE_OLD_MEMBER = 4;
\ No newline at end of file
......@@ -24,6 +24,7 @@ const Roles: React.FC = () => {
}, []);
const handleSelect = (item: MemberRole) => {
console.log(item)
const { memberRoleId } = item;
if (memberRoleId === curRole.memberRoleId) {
return;
......
......@@ -283,6 +283,7 @@ const Create = () => {
}, [])
const handleBeforeProductChecked = useCallback(async (record: GetProductCommodityCommonGetCommodityListByBuyerResponseDetail, selected: boolean, list: GetProductCommodityCommonGetCommodityListByBuyerResponseDetail[]) => {
if (selected) {
const postData = list.map((item) => {
return {
/** * 这里指的是skuid, 而接口getProductCommodityCommonGetCommodityListByBuyer 的主键id 就是skuid, 不是(commodityId)*/
......@@ -296,6 +297,8 @@ const Create = () => {
})
const { flag } = await checkProcessEnum(postData);
return flag;
}
return true
}, [])
/** @review 总感觉这个接口有大问题,能力中心没办法拿到shopId,不知道这个shopId 的意义在哪里 */
......@@ -982,7 +985,7 @@ const Create = () => {
}}
components={{Cascader}}
effects={($, actions) => {
useStateFilterSearchLinkageEffect($, actions, 'name', FORM_FILTER_PATH);
useStateFilterSearchLinkageEffect($, actions, 'orderNo', FORM_FILTER_PATH);
}}
mode={"checkbox"}
beforeChecked={handleBeforeOrderChecked}
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-19 10:06:58
* @LastEditTime: 2021-07-28 10:02:03
* @Description: 会员基础信息详情
*/
import React from 'react';
......@@ -70,7 +70,7 @@ const MemberBasicInfo: React.FC<MemberBasicInfoProps> = ({
{/* 渠道信息 */}
{/* 平台录入的会员不需要填渠道信息的 */}
{/* {
{
memberInfo?.memberTypeEnum === MEMBER_TYPE_CHANNEL_CORPORATE
|| memberInfo?.memberTypeEnum === MEMBER_TYPE_CHANNEL_INDIVIDUAL
? (
......@@ -87,7 +87,7 @@ const MemberBasicInfo: React.FC<MemberBasicInfoProps> = ({
</Col>
)
: null
} */}
}
{/* 其他注册信息 */}
{
......
......@@ -112,16 +112,16 @@ const MemberQueryDetailed: React.FC<QueryProps> = props => {
key: 'basicInfo',
name: '基本信息',
},
// // 平台录入的会员不需要填渠道信息的
// (
// memberInfo?.memberTypeEnum === MEMBER_TYPE_CHANNEL_CORPORATE
// || memberInfo?.memberTypeEnum === MEMBER_TYPE_CHANNEL_INDIVIDUAL
// ? {
// key: 'channelInfo',
// name: '渠道信息',
// }
// : null
// ),
// 平台录入的会员不需要填渠道信息的
(
memberInfo?.memberTypeEnum === MEMBER_TYPE_CHANNEL_CORPORATE
|| memberInfo?.memberTypeEnum === MEMBER_TYPE_CHANNEL_INDIVIDUAL
? {
key: 'channelInfo',
name: '渠道信息',
}
: null
),
...(
memberInfo && memberInfo.groups
? memberInfo.groups.map((item, index) => ({
......
......@@ -228,9 +228,7 @@ const InquiryProductLayout: React.FC<InquiryProductLayoutProps> = (props: any) =
rowKey="productId"
columns={columns}
dataSource={dataSource}
pagination={{
size: 'small'
}}
pagination={false}
/>
</Form.Item>
<TableModal
......
......@@ -96,7 +96,9 @@ const ApplicableGoods: React.FC<IProps> = (props) => {
dataIndex: 'unitPrice',
render: (text) => {
const unitPrice = normalizeUnitPrice(text);
return ${unitPrice[0]?.price}~${unitPrice[unitPrice.length - 1]?.price}`;
const start = unitPrice[0]?.price;
const end = unitPrice[unitPrice.length - 1].price;
return start !== end ? ${start}~${end}` : ${start}`;
},
},
];
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-29 09:36:35
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-29 10:18:11
* @LastEditTime: 2021-07-28 17:49:07
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -31,7 +31,7 @@ export const querySchema: ISchema = {
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索',
tip: '输入 优惠劵名称 进行搜索',
tip: '输入 会员名称 进行搜索',
},
},
},
......@@ -45,33 +45,48 @@ export const querySchema: ISchema = {
},
},
properties: {
id: {
memberId: {
type: 'string',
'x-component-props': {
placeholder: '优惠劵ID',
placeholder: '会员ID',
allowClear: true,
style: {
width: 160,
},
},
memberType: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '会员类型(所有)',
allowClear: true,
},
},
'[startTime2, endTime2]': {
type: 'object',
'x-component': 'RangePicker',
level: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: ['劵有效期起始时间', '劵有效期截止时间'],
showTime: true,
placeholder: '会员等级(所有)',
allowClear: true,
},
},
type: {
suitableMemberType: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '优惠劵类型(所有)',
placeholder: '适用用户(所有)',
allowClear: true,
},
},
'[startTime2, endTime2]': {
type: 'string',
'x-component': 'RangePicker',
'x-component-props': {
placeholder: ['成为会员起始时间', '成为会员截止时间'],
showTime: true,
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
......@@ -105,17 +120,19 @@ export const drawerSchema: ISchema = {
'x-component': 'Mega-Layout',
'x-component-props': {
grid: true,
full: true,
autoRow: true,
columns: 4,
},
properties: {
id: {
memberId: {
type: 'string',
'x-component': 'NumberPicker',
'x-component-props': {
placeholder: '会员ID',
allowClear: true,
},
},
memberType: {
memberTypeEnum: {
type: 'string',
default: undefined,
enum: [],
......@@ -124,7 +141,7 @@ export const drawerSchema: ISchema = {
allowClear: true,
},
},
memberLevel: {
level: {
type: 'string',
default: undefined,
enum: [],
......@@ -133,7 +150,7 @@ export const drawerSchema: ISchema = {
allowClear: true,
},
},
applicable: {
suitableMemberType: {
type: 'string',
default: undefined,
enum: [],
......@@ -142,7 +159,7 @@ export const drawerSchema: ISchema = {
allowClear: true,
},
},
'[startTime2, endTime2]': {
'[becomeTimeStart, becomeTimeEnd]': {
type: 'string',
'x-component': 'RangePicker',
'x-component-props': {
......
......@@ -2,15 +2,21 @@
* @Author: XieZhiXiong
* @Date: 2021-06-28 17:51:33
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-06 14:07:32
* @Description:
* @LastEditTime: 2021-07-28 17:33:55
* @Description: 商家优惠劵发劵
*/
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, useRef } from 'react';
import {
Row,
Col,
Spin,
Button,
message,
} from 'antd';
import {
SendOutlined,
} from '@ant-design/icons';
import { history } from 'umi';
import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api';
import { GetMarketingCouponWaiteExecuteGetResponse } from '@/services/MarketingApi';
......@@ -19,18 +25,21 @@ import AnchorPage from '@/layouts/AnchorPage';
import AuditProcess from '@/components/AuditProcess';
import BacisInfo from '../../components/BacisInfo';
import CouponRules from '../../components/CouponRules';
import DeliverCoupon from '../../components/DeliverCoupon';
import DeliverCoupon, { SuitableMemberType } from '../../components/DeliverCoupon';
const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
const { id } = usePageStatus();
const [couponInfo, setCouponInfo] = useState<GetMarketingCouponWaiteExecuteGetResponse>(null);
const [infoLoading, setInfoLoaading] = useState(false);
const [infoLoading, setInfoLoading] = useState(false);
const [submitLoading, setSubmitLoading] = useState(false);
const deliverRef = useRef<SuitableMemberType[]>([]);
const getBasicInfo = () => {
if (!id) {
return;
}
setInfoLoaading(true);
setInfoLoading(true);
PublicApi.getMarketingCouponWaiteExecuteGet({
id,
}).then(res => {
......@@ -38,7 +47,7 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
setCouponInfo(res.data);
}
}).finally(() => {
setInfoLoaading(false);
setInfoLoading(false);
});
};
......@@ -46,6 +55,34 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
getBasicInfo();
}, []);
const handleDeliverChange = (value: SuitableMemberType[]) => {
deliverRef.current = value;
};
const handleSubmit = () => {
if (!id) {
return;
}
if (!deliverRef.current.length) {
message.warning('未选择任何会员');
return;
}
setSubmitLoading(true);
PublicApi.postMarketingCouponWaiteExecuteGrant({
id: +id,
grantMembers: deliverRef.current.map((item) => ({ subMemberId: item.memberId, subRoleId: item.roleId })),
}).then(res => {
if (res.code !== 1000) {
return;
}
setTimeout(() => {
history.goBack();
}, 800);
}).finally(() => {
setSubmitLoading(false);
});
};
const anchorsArr = [
{
key: 'verifySteps',
......@@ -70,6 +107,16 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
<AnchorPage
title={couponInfo?.name}
anchors={anchorsArr}
extra={(
<Button
type="primary"
icon={<SendOutlined style={{ transform: `rotate(-45deg)`, position: 'relative', top: -2 }} />}
onClick={handleSubmit}
loading={submitLoading}
>
提交
</Button>
)}
>
<Row gutter={[16, 16]}>
{/* 流转记录 */}
......@@ -121,6 +168,7 @@ const MerchantCouponAnalysisDeliver: React.FC<{}> = () => {
{/* 优惠券规则 */}
<Col span={24}>
<DeliverCoupon
onChange={handleDeliverChange}
id="deliverCoupon"
/>
</Col>
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-07-19 14:19:31
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-19 18:18:38
* @LastEditTime: 2021-07-28 11:01:30
* @Description: 适用商品 Form Item
*/
import React, { useState } from 'react';
......@@ -70,7 +70,9 @@ const ApplicableGoodsFormItem = (props) => {
align: 'center',
render: (text) => {
const unitPrice = normalizeUnitPrice(text);
return ${unitPrice[0]?.price}~${unitPrice[unitPrice.length - 1]?.price}`;
const start = unitPrice[0]?.price;
const end = unitPrice[unitPrice.length - 1].price;
return start !== end ? ${start}~${end}` : ${start}`;
},
},
(
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:03:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-08 16:35:58
* @LastEditTime: 2021-07-28 14:58:01
* @Description:
*/
import { FormPath, FormEffectHooks } from '@formily/antd';
......@@ -25,7 +25,10 @@ const fetchCouponTypes = async () => {
type: data.map(item => ({ label: item.name, value: item.value })),
};
}
return {};
return {
data: [],
totalCount: 0,
};
};
// 初始化 领券方式
......@@ -38,7 +41,10 @@ const fetchCouponGetWay = async () => {
getWay: data.map(item => ({ label: item.name, value: item.value })),
};
}
return {};
return {
data: [],
totalCount: 0,
};
};
// 初始化 适用用户角色
......@@ -60,7 +66,26 @@ const fetchApplicationUserRole = async () => {
applicationUserRole: options,
};
}
return {};
return {
data: [],
totalCount: 0,
};
};
// 初始化 适用用户
const fetchSuitableUser = async () => {
const res = await PublicApi.getMarketingCouponSuitableMemberTypeList();
if (res.code === 1000) {
const { data = [] } = res;
return {
suitableMemberTypes: data.map(item => ({ label: item.name, value: item.value })),
};
}
return {
data: [],
totalCount: 0,
};
};
// 获取 实用会员选项
......@@ -80,6 +105,10 @@ const fetchMemberOtions: (params: { current: string, pageSize: string, levelConf
totalCount: res.data.totalCount,
};
}
return {
data: [],
totalCount: 0,
};
};
export const createEffects = (context, actions) => {
......@@ -93,6 +122,8 @@ export const createEffects = (context, actions) => {
useAsyncInitSelect(['applicationUserRole'], fetchApplicationUserRole);
useAsyncInitSelect(['suitableMemberTypes'], fetchSuitableUser);
// 初始化 品牌数据
onFieldMount$('applicableBrands').subscribe(() => {
PublicApi.getProductSelectGetSelectBrand().then((res) => {
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:04:16
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-23 17:36:48
* @LastEditTime: 2021-07-28 14:33:19
* @Description:
*/
import { FormEffectHooks, FormPath, IFormActions } from '@formily/antd';
......@@ -16,6 +16,10 @@ import {
MERCHANT_COUPON_RECEIVE_DESIGNATED,
MERCHANT_COUPON_RECEIVE_ACTIVITY,
MERCHANT_COUPON_RECEIVE_OPERATE,
SUITABLE_TYPE_NEW_USER,
SUITABLE_TYPE_OLD_USER,
SUITABLE_TYPE_NEW_MEMBER,
SUITABLE_TYPE_OLD_MEMBER,
} from '@/constants/marketing';
const {
......@@ -31,8 +35,6 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
// 优惠券类型
onFieldInputChange$('type').subscribe(state => {
const { value } = state;
const denominationValue = getFieldValue('denomination'); // 券面额
const useConditionMoneyValue = getFieldValue('useConditionMoney'); // 使用条件
// 0元抵扣券
if (value === MERCHANT_COUPON_TYPE_VOUCHER) {
......@@ -192,8 +194,8 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
value === MERCHANT_COUPON_RECEIVE_DESIGNATED
|| value === MERCHANT_COUPON_RECEIVE_OPERATE
) && (
newItem.value === 1
|| newItem.value === 2
newItem.value === SUITABLE_TYPE_NEW_USER
|| newItem.value === SUITABLE_TYPE_OLD_USER
)
) {
newItem.disabled = true;
......@@ -233,7 +235,7 @@ export const useBusinessEffects = (context, actions: IFormActions) => {
const { value } = state;
// 包含新会员(仅会员用户) 或者 老会员(仅会员用户),展示 适用用户角色 与 会员等级列表
if (value && (value.includes(3) || value.includes(4))) {
if (value && (value.includes(SUITABLE_TYPE_NEW_MEMBER) || value.includes(SUITABLE_TYPE_OLD_MEMBER))) {
linkage.show('*(applicationUserRole,applicationMemberLevel)');
} else {
linkage.hide('*(applicationUserRole,applicationMemberLevel)');
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 14:05:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-19 17:20:56
* @LastEditTime: 2021-07-28 14:38:37
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -441,28 +441,7 @@ const schema: ISchema = {
suitableMemberTypes: {
title: '适用用户',
type: 'string',
enum: [
{
label: '新用户(不包含会员)',
value: 1,
disabled: false,
},
{
label: '老用户(不包含会员)',
value: 2,
disabled: false,
},
{
label: '新会员(仅会员用户)',
value: 3,
disabled: false,
},
{
label: '老会员(仅会员用户)',
value: 4,
disabled: false,
},
],
enum: [],
default: [],
required: true,
'x-component': 'TofuCheckGroup',
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 16:11:55
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-20 10:29:12
* @LastEditTime: 2021-07-28 14:13:43
* @Description: 商品选择抽屉
*/
import React, { useEffect } from 'react';
......@@ -101,13 +101,16 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
}, [checkeds]);
const fetchData = async (params: ExtraFetchType) => {
let res = await PublicApi.getProductCommodityGetCommoditySkuListByShopId({
const res = await PublicApi.getProductCommodityGetCommoditySkuListByShopId({
...params,
current: `${params.current}`,
pageSize: `${params.pageSize}`,
shopId: `${shopIds[0] || ''}`,
});
if (res.code === 1000) {
return res.data;
}
return { data: [], totalCount: 0 };
};
const handleClose = () => {
......@@ -150,11 +153,13 @@ const GoodsDrawer: React.FC<IProps> = (props) => {
},
{
title: '商品价格',
dataIndex: 'price',
dataIndex: 'unitPrice',
align: 'center',
render: (text) => {
const unitPrice = normalizeUnitPrice(text);
return ${unitPrice[0]?.price}~${unitPrice[unitPrice.length - 1]?.price}`;
const start = unitPrice[0]?.price;
const end = unitPrice[unitPrice.length - 1].price;
return start !== end ? ${start}~${end}` : ${start}`;
},
},
];
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-06-24 16:19:18
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-06-24 16:19:18
* @LastEditTime: 2021-07-28 10:54:23
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -26,11 +26,12 @@ export const querySchema: ISchema = {
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'flex-layout',
'x-component': 'mega-layout',
'x-component-props': {
colStyle: {
marginLeft: 20,
},
grid: true,
full: true,
autoRow: true,
columns: 6,
},
properties: {
category: {
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2021-07-20 10:10:55
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-07-23 15:00:55
* @LastEditTime: 2021-07-28 16:48:48
* @Description:
*/
import { OptionItemType } from '../components/ApplicableList';
......@@ -69,6 +69,9 @@ export type BrandItemType = {
}
export function normalizeUnitPrice(unitPrice: UnitPriceType): UnitPriceType[] {
if (!unitPrice) {
return;
}
const ret = [];
const objKeys = Object.keys(unitPrice).sort((a, b) => parseFloat(a) - parseFloat(b));
......
import React, { Fragment, useState } from 'react';
import React, { Fragment, useCallback, useState } from 'react';
import { Space, Tooltip } from 'antd';
import { history } from 'umi';
import { Context } from '@/pages/transaction/components/detailLayout/components/context';
import PeripheralLayout from '@/pages/transaction/components/detailLayout';
import { _data } from './data';
......@@ -16,6 +17,7 @@ import DemandLayout from '../../components/demandLayout';
import ListLayout from '@/pages/transaction/components/detailLayout/components/listLayout';
import { ColumnType } from 'antd/lib/table/interface';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
const TABLINK = [
{ id: 'progressLayout', title: '流转进度' },
......@@ -28,6 +30,9 @@ const TABLINK = [
]
const DetialLayout = () => {
const { query: { activityId }, pathname } = history.location;
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
}
......@@ -40,24 +45,23 @@ const DetialLayout = () => {
setBasicEffect([
{
col: [
{ label: '活动ID', extra: data.activityId },
{ label: '活动ID', extra: data.id },
{ label: '活动名称', extra: data.activityName },
{ label: '外部状态', extra: data.externalStateName },
{ label: '内部状态', extra: data.interiorStateName },
{ label: '外部状态', extra: data.outerStatusName },
{ label: '内部状态', extra: data.innerStatusName },
]
},
{
col: [
{ label: '活动类型', extra: ACTIVITYTYPENAME[data.activityType] },
{ label: '下单模式', extra: data.orderModal },
{ label: '活动开始时间', extra: format(data.activityStartTime) },
{ label: '活动结束时间', extra: format(data.activityEndTime) },
{ label: '活动类型', extra: data.activityTypeName },
{ label: '活动参与类型', extra: data.activitySignUpTypeName },
{ label: '活动开始时间', extra: format(data.startTime) },
{ label: '活动结束时间', extra: format(data.endTime) },
]
},
{
col: [
{ label: '会员名称', extra: data.membersName },
{ label: '创建时间', extra: format(data.creationTime) },
{ label: '要求报名时间', extra: <>{format(data.signUpStartTime)}~{format(data.signUpEndTime)}</> },
]
},
])
......@@ -161,8 +165,17 @@ const DetialLayout = () => {
},
]
const fetchDataSource = useCallback(async () => {
await PublicApi.getMarketingPlatformActivitySignupDetail({ activityId }).then(res => {
if (res.code !== 1000) {
return
}
handleBasicEffect(res.data)
}).catch(() => {})
}, [])
useEffect(() => {
handleBasicEffect(_data);
fetchDataSource();
handleGeneralEffect(_data);
}, [])
......
......@@ -21,7 +21,7 @@ const Search = () => {
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text) => <EyePreview>{text}</EyePreview>
render: (text, record) => <EyePreview url={`/memberCenter/marketingAbility/paltformSign/search/detail?activityId=${record.activityId}`}>{text}</EyePreview>
},
{
title: '活动类型',
......
......@@ -260,6 +260,7 @@ const Material: React.FC<Materialprops> = (props: any) => {
rowKey="id"
columns={columns}
dataSource={dataSource}
pagination={false}
/>
{/* 选择货品 */}
<SelectProduct
......
......@@ -166,22 +166,23 @@ const Demand: React.FC<Iprops> = (props: any) => {
/** 获取会员列表 */
const handleMenberList = (e: any) => {
const RowCtl = e.selectRow;
console.log(e)
if (RowCtl.length > 0) {
setMenberVidible(false)
const data: any = []
RowCtl.forEach(item => {
data.push({
id: item.id,
isSubMember: 1,
isSubMember: item.isSubMember || 1,
memberId: item.memberId,
memberName: item.name,
memberName: item.name || item.memberName,
memberTypeName: item.memberTypeName,
roleId: item.roleId,
roleName: item.roleName,
levelTag: item.levelTag,
membershipOrNot: 1,
state: 1,
type: 2,
membershipOrNot: item.membershipOrNot || 1,
state: item.state || 1,
type: item.type || 2,
})
})
form.setFieldsValue({ "rowCol": data })
......@@ -313,6 +314,7 @@ const Demand: React.FC<Iprops> = (props: any) => {
<Table
columns={columns}
dataSource={rowCtl}
pagination={false}
/>
</Form.Item>
)}
......
......@@ -24,7 +24,7 @@ interface Iprops {
const SelectMenber: React.FC<Iprops> = (props: any) => {
const ref = useRef({});
const { visible, onclose, confirm, rowCtl } = props;
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'id' });
const [rowSelection, RowCtl] = useRowSelectionTable({ customKey: 'memberId' });
const columns: ColumnType<any>[] = [
{
title: '会员ID',
......@@ -65,8 +65,9 @@ const SelectMenber: React.FC<Iprops> = (props: any) => {
useEffect(() => {
if (rowCtl) {
console.log(rowCtl)
RowCtl.setSelectRow(rowCtl)
RowCtl.setSelectedRowKeys(rowCtl.map(v => v.id))
RowCtl.setSelectedRowKeys(rowCtl.map(v => v.memberId))
}
}, [visible])
......@@ -94,7 +95,7 @@ const SelectMenber: React.FC<Iprops> = (props: any) => {
<StandardTable
currentRef={ref}
columns={columns}
tableProps={{ rowKew: 'id' }}
tableProps={{ rowKey: 'memberId' }}
rowSelection={rowSelection}
fetchTableData={(params) => fetchGoodsData(params)}
formilyProps={
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment