Commit 2342bc4d authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents ead944a8 d75d1caf
......@@ -183,14 +183,21 @@ const marketingRoutes = {
noLayout: true,
hideInMenu: true,
},
// {
// /** 平台营销活动执行 - marketingExecute */
// path: '/marketingManage/marketing/marketingExecute',
// name: '平台营销活动执行',
// hidePageHeader: true,
// : true,
// component: '@/pages/marketingManage/marketing/marketingExecute',
// },
{
/** 平台营销活动执行 - marketingExecute */
path: '/marketingManage/marketing/marketingExecute',
name: '平台营销活动执行',
hidePageHeader: true,
component: '@/pages/marketingManage/marketing/marketingExecute',
},
{
/** 平台营销活动执行详情 - marketingExecute */
path: '/marketingManage/marketing/marketingExecute/detail',
name: '平台营销活动执行详情',
hidePageHeader: true,
hideInMenu: true,
component: '@/pages/marketingManage/marketing/marketingExecute/detail',
},
// {
// /** 平台营销活动监控 - marketingMonitor */
// path: '/marketingManage/marketing/marketingMonitor',
......
......@@ -384,7 +384,31 @@ const router = {
hidePageHeader: true,
hideInMenu: true,
component: '@/pages/systemManage/appVersion/add',
}
},
{
// APP版本管理
path: '/system/appLink/index',
name: 'APP下载',
hidePageHeader: true,
// hideInMenu: true,
component: '@/pages/systemManage/appLink',
},
{
// APP版本管理
path: '/system/appLink/add',
name: '新增APP下载',
hidePageHeader: true,
hideInMenu: true,
component: '@/pages/systemManage/appLink/edit',
},
{
// APP版本管理
path: '/system/appLink/edit',
name: '编辑APP下载',
hidePageHeader: true,
hideInMenu: true,
component: '@/pages/systemManage/appLink/edit',
},
]
}
export default router
......@@ -75,7 +75,7 @@ const AnchorPage = (props: IProps) => {
useEffect(() => {
const firstKey = anchors.length ? `#${anchors[0].key}` : '';
if (firstKey && firstKey !== current) {
setCurrent(firstKey);
mounted.current && setCurrent(firstKey);
}
}, [anchors]);
......
......@@ -68,7 +68,7 @@ registerShape('point', 'pointer', {
attrs: {
x: center.x,
y: center.y,
r: 6,
r: 4,
stroke: cfg.color,
lineWidth: 3,
fill: '#fff',
......
......@@ -6,12 +6,14 @@ import style from './index.less';
export interface BasicInfoProps {
effect?: any,
/** 栅格 */
span?: number
}
const count = 0;
const BasicLayout: React.FC<BasicInfoProps> = (props: any) => {
const { effect } = props;
const { effect, span } = props;
return (
<Card
......@@ -20,7 +22,7 @@ const BasicLayout: React.FC<BasicInfoProps> = (props: any) => {
>
<Row gutter={[8, 8]}>
{effect.length > count && effect.map((item, index) => (
<Col key={`effect_${index + 1}`} span={8}>
<Col key={`effect_${index + 1}`} span={span}>
{ item.col.map((it, idx) => (
<div className={style.cell} key={`effect_col_${idx + 1}`}>
<h5 className={style.label}>{it.label}: </h5>
......@@ -33,5 +35,7 @@ const BasicLayout: React.FC<BasicInfoProps> = (props: any) => {
</Card>
)
}
BasicLayout.defaultProps = {
span: 8,
}
export default BasicLayout
......@@ -15,12 +15,14 @@ export interface GeneraInfoProps {
extra?: ReactNode,
/** 是否开启没数据不显示字段 */
visible?: boolean,
/** 栅格 */
span?: number
}
const count = 0;
const GeneralLayout: React.FC<GeneraInfoProps> = (props: any) => {
const { effect, anchor, title, extra, visible } = props;
const { effect, anchor, title, extra, visible, span } = props;
return (
<Card
......@@ -30,7 +32,7 @@ const GeneralLayout: React.FC<GeneraInfoProps> = (props: any) => {
>
<Row gutter={[8, 8]}>
{effect.length > count && effect.map((item, index) => (
<Col key={`effect_${index + 1}`} span={8}>
<Col key={`effect_${index + 1}`} span={span}>
{item.col.map((it, idx) => (
<Fragment key={`effect_col_${idx + 1}`}>
{visible ? <>
......@@ -56,5 +58,7 @@ const GeneralLayout: React.FC<GeneraInfoProps> = (props: any) => {
</Card>
)
}
GeneralLayout.defaultProps = {
span: 8
}
export default GeneralLayout
......@@ -5,7 +5,7 @@
* @LastEditTime: 2020-09-22 18:04:44
* @Description: 评价笑脸组件
*/
import React from 'react';
import React, { CSSProperties } from 'react';
import {
SmileFilled,
MehFilled,
......@@ -13,30 +13,40 @@ import {
} from '@ant-design/icons';
interface MoodProps {
/**
* 类型
*/
type: 'smile' | 'notBad' | 'sad';
/**
* 自定义外部样式
*/
customStyle?: CSSProperties,
};
const Mood: React.FC<MoodProps> = ({ type = 'smile' }) => {
let node = null;
const Mood: React.FC<MoodProps> = ({ type = 'smile', customStyle = {} }) => {
let node: any = null;
switch (type) {
case 'smile':
node = <><SmileFilled style={{ color: '#41CC9E', marginRight: 4 }} /></>;
node = <><SmileFilled style={{ color: '#41CC9E', ...customStyle }} /></>;
break;
case 'notBad':
node = <><MehFilled style={{ color: '#FFC400', marginRight: 4 }} /></>;
node = <><MehFilled style={{ color: '#FFC400', ...customStyle }} /></>;
break;
case 'sad':
node = <><FrownFilled style={{ color: '#EF6260', marginRight: 4 }} /></>;
node = <><FrownFilled style={{ color: '#EF6260', ...customStyle }} /></>;
break;
default:
break;
}
return node;
};
Mood.defaultProps = {
customStyle: {},
};
export default Mood;
\ No newline at end of file
......@@ -179,6 +179,7 @@ export interface IUploaderProps {
value: any[]
listType?: UploadListType
readOnly?: boolean
maxCount?: number
}
export const Upload = connect({
......@@ -274,7 +275,7 @@ export const Upload = connect({
public render() {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { listType, locale, onChange, value = [], ...others } = this.props
if (listType.indexOf('card') > -1) {
if (listType!.indexOf('card') > -1) {
return (
<AntdUpload
{...others}
......@@ -283,13 +284,13 @@ export const Upload = connect({
onRemove={this.onRemoveHandler}
listType={'picture-card'}
>
{!others.readOnly ? (
{!others.readOnly && (others.maxCount !== undefined ? this.state.value.length < others.maxCount : true) ? (
<UploadPlaceholder />
) : null}
</AntdUpload>
)
}
if (listType.indexOf('dragger') > -1) {
if (listType!.indexOf('dragger') > -1) {
return (
<UploadDragger
{...others}
......@@ -297,7 +298,7 @@ export const Upload = connect({
onChange={this.onChangeHandler}
onRemove={this.onRemoveHandler}
// TODO image 类型是跟 picture 一样 ?
listType={listType.indexOf('image') > -1 ? 'picture' : 'text'}
listType={listType!.indexOf('image') > -1 ? 'picture' : 'text'}
>
<p className={'ant-upload-drag-icon'}>
<InboxOutlined />
......
import React from 'react';
import Mood from '@/components/Mood';
import { getIntl } from 'umi';
const intl = getIntl();
interface SmilingFaceProps {
value: number;
};
const SmilingFace: React.FC<SmilingFaceProps> = ({
value,
}) => {
let node = null;
const SmilingFace = (props) => {
const { value, schema } = props
const componentProps = schema?.getExtendsComponentProps() || {};
let node: any = null;
switch (value) {
case 1:
case 0:
case 1:
case 2: {
node = (
<>
<Mood type="sad" />
<span>差评</span>
</>
<div {...componentProps}>
<Mood type="sad" customStyle={{ marginRight: 8 }} />
<span>{intl.formatMessage({id: 'components.chaping'})}</span>
</div>
);
break;
}
case 3: {
node = (
<>
<Mood type="notBad" />
<span>中评</span>
</>
<div {...componentProps}>
<Mood type="notBad" customStyle={{ marginRight: 8 }} />
<span>{intl.formatMessage({id: 'components.zhongping'})}</span>
</div>
);
break;
}
case 4:
case 4:
case 5: {
node = (
<>
<Mood type="smile" />
<span>好评</span>
</>
<div {...componentProps}>
<Mood type="smile" customStyle={{ marginRight: 8 }} />
<span>{intl.formatMessage({id: 'components.haoping'})}</span>
</div>
);
break;
}
default:
break;
}
return node;
};
export default SmilingFace;
\ No newline at end of file
SmilingFace.isFieldComponent = true;
export default SmilingFace;
import React, { useEffect } from 'react';
import SchemaForm, {
IAntdSchemaFormProps, createVirtualBox, registerVirtualBox, Schema, SchemaField, FormButtonGroup, Reset, createControllerBox, registerValidationRules,
IAntdSchemaFormProps, createVirtualBox, registerVirtualBox, Schema, SchemaField, FormButtonGroup, Reset, createControllerBox, registerValidationRules
} from '@formily/antd';
import { Button, Space, Row, Col, DatePicker } from 'antd';
import CustomUpload from './components/CustomUpload';
......
......@@ -51,11 +51,13 @@ interface Iprops {
onClose: () => void,
onOk: (selectRow: number[] | string[], selectedRows: { [key: string]: any }[]) => void,
/** customKey */
customKey?: string
customKey?: string,
/** 宽度 */
width?: number
}
const TableModal: React.FC<Iprops> = (props: Iprops) => {
const { title, visible, schema, columns, effects, tableProps, mode, expressionScope, fetchData, onClose, onOk, value, format, customizeRadio, modalType, footer, customKey } = props;
const { title, visible, schema, columns, effects, tableProps, mode, expressionScope, fetchData, onClose, onOk, value, format, customizeRadio, modalType, footer, customKey, width } = props;
const ref = useRef<any>({});
const [rowSelection, RowCtl] = useRowSelectionTable({ type: customizeRadio && mode === 'radio' ? 'checkbox' : mode, customKey: customKey });
const isFirstLoad = useRef<boolean>(true);
......@@ -120,7 +122,7 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => {
onClose={handleOnClose}
onCancel={handleOnClose}
// onOk={handleOk}
width={900}
width={width}
{...otherProps}
>
<StandardTable
......@@ -168,7 +170,8 @@ TableModal.defaultProps = {
format: null,
customizeRadio: false,
modalType: "Modal",
footer: null
footer: null,
width: 900
}
export default TableModal;
import React from 'react';
import { Image, Button, Typography } from 'antd';
const columns_10 = ({
value,
handlCollocation
}) => {
return (
[
{
title: '商品ID',
key: 'productId',
dataIndex: 'productId',
render: (text) => <Typography.Link target="_blank" href={`/productManage/commodity/products/detail?id=${text}`}>{text}</Typography.Link>
},
{
title: '商品图片',
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品名称',
key: 'productName',
dataIndex: 'productName'
},
{
title: '品类',
key: 'category',
dataIndex: 'category'
},
{
title: '品牌',
key: 'brand',
dataIndex: 'brand'
},
{
title: '单位',
key: 'unit',
dataIndex: 'unit'
},
{
title: '商品价格',
key: 'price',
dataIndex: 'price',
render: (text) => `¥${Number(text).toFixed(2)}`
},
{
title: '个人限购数量',
key: 'restrictNum',
dataIndex: 'restrictNum',
},
{
title: '活动限购总数量',
key: 'restrictTotalNum',
dataIndex: 'restrictTotalNum',
},
{
title: '操作',
key: 'operation',
dataIndex: 'operation',
render: (_text, _record) => (
<>
{(value === 6) && (
<Button type='link' onClick={() => handlCollocation(_record)}>查看赠品</Button>
)}
{(value === 13) && (
<Button type='link' onClick={() => handlCollocation(_record)}>查看换购商品</Button>
)}
{(value === 15) && (
<Button type='link' onClick={() => handlCollocation(_record)}>查看搭配商品</Button>
)}
</>
)
},
]
)
}
export default columns_10
......@@ -55,24 +55,6 @@ const columns_4 = ({
key: 'restrictTotalNum',
dataIndex: 'restrictTotalNum',
},
{
title: '操作',
key: 'operation',
dataIndex: 'operation',
render: (_text, _record) => (
<>
{(value === 6) && (
<Button type='link' onClick={() => handlCollocation(_record)}>查看赠品</Button>
)}
{(value === 13) && (
<Button type='link' onClick={() => handlCollocation(_record)}>查看换购商品</Button>
)}
{(value === 15) && (
<Button type='link' onClick={() => handlCollocation(_record)}>查看搭配商品</Button>
)}
</>
)
},
]
)
}
......
......@@ -3,33 +3,49 @@ import columns_2 from './columns_2';
import columns_3 from './columns_3';
import columns_4 from './columns_4';
import columns_5 from './columns_4';
import columns_6 from './columns_4';
import columns_6 from './columns_10';
import columns_7 from './columns_4';
import columns_8 from './columns_4';
import columns_9 from './columns_5';
import columns_10 from './columns_9';
import columns_11 from './columns_6';
import columns_12 from './columns_7';
import columns_13 from './columns_4';
import columns_13 from './columns_10';
import columns_14 from './columns_8';
import columns_15 from './columns_4';
import columns_15 from './columns_10';
import columns_16 from './columns_4';
export const Columns = {
/** 特价促销 */
1: columns_1,
/** 直降促销 */
2: columns_2,
/** 折价促销 */
3: columns_3,
/** 满量促销 */
4: columns_4,
/** 满额促销 */
5: columns_5,
/** 赠送促销 */
6: columns_6,
/** 多件促销 */
7: columns_7,
/** 组合促销 */
8: columns_8,
/** 拼团 */
9: columns_9,
/** 抽奖 */
10: columns_10,
/** 砍价 */
11: columns_11,
/** 秒杀 */
12: columns_12,
/** 换购 */
13: columns_13,
/** 预售 */
14: columns_14,
/** 套餐 */
15: columns_15,
/** 试用 */
16: columns_16,
}
import React from 'react';
import { Space, Tooltip, Typography } from 'antd';
import StatusTag from '@/components/StatusTag';
import { format } from '@/pages/transaction/common/dateFormat';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { format } from '@/constants/dateFormat';
import { isEmpty } from '@formily/antd/esm/shared';
/** * 活动类型 */
export enum ACTIVITYTYPE {
/** 特价促销 */
......@@ -65,6 +66,7 @@ const lotteryNumType = {
}
/** 活动类型 */
export const GeneralEffect = (int, data) => {
const allowActivity = (data?.allowActivity ? data.allowActivity : []);
switch (Number(int)) {
case 1:
case 2:
......@@ -73,7 +75,7 @@ export const GeneralEffect = (int, data) => {
{
col: [
{
label: '叠加活动类型', extra: <Space wrap>{data.allowActivity.map((item, index) => (
label: '叠加活动类型', extra: <Space wrap>{allowActivity.map((item, index) => (
<StatusTag key={`default_key_${index}`} type="default" title={ACTIVITYTYPENAME[item]} />
))}
</Space>
......@@ -115,21 +117,21 @@ export const GeneralEffect = (int, data) => {
{(int === 5 && data.type === 2) && '满额折'}
</>, extra: <>
{(int === 4 && data.type === 1) && <Space direction='vertical'>
{data.ladderBOList.map(item => (<div>{`满 ${item.key} 个, 减 ${Number(item.value).toFixed(2)} 元`}</div>))}
{!isEmpty(data.ladderBOList) && data.ladderBOList.map(item => (<div>{`满 ${item.key} 个, 减 ${Number(item.value).toFixed(2)} 元`}</div>))}
</Space>}
{(int === 4 && data.type === 2) && <Space direction='vertical'>
{data.ladderBOList.map(item => (<div>{`满 ${item.key} 个, 打 ${item.value} 折`}</div>))}
{!isEmpty(data.ladderBOList) && data.ladderBOList.map(item => (<div>{`满 ${item.key} 个, 打 ${item.value} 折`}</div>))}
</Space>}
{(int === 5 && data.type === 1) && <Space direction='vertical'>
{data.ladderBOList.map(item => (<div>{`满 ${Number(item.key).toFixed(2)} 元, 减 ${Number(item.value).toFixed(2)} 元`}</div>))}
{!isEmpty(data.ladderBOList) && data.ladderBOList.map(item => (<div>{`满 ${Number(item.key).toFixed(2)} 元, 减 ${Number(item.value).toFixed(2)} 元`}</div>))}
</Space>}
{(int === 5 && data.type === 2) && <Space direction='vertical'>
{data.ladderBOList.map(item => (<div>{`满 ${Number(item.key).toFixed(2)} 元, 打 ${item.value} 折`}</div>))}
{!isEmpty(data.ladderBOList) && data.ladderBOList.map(item => (<div>{`满 ${Number(item.key).toFixed(2)} 元, 打 ${item.value} 折`}</div>))}
</Space>}
</>
},
{
label: '叠加活动类型', extra: <Space wrap>{data.allowActivity.map((item, index) => (
label: '叠加活动类型', extra: <Space wrap>{allowActivity.map((item, index) => (
<StatusTag key={`default_key_${index}`} type="default" title={ACTIVITYTYPENAME[item]} />
))}
</Space>
......@@ -159,7 +161,7 @@ export const GeneralEffect = (int, data) => {
</>
},
{
label: '叠加活动类型', extra: <Space wrap>{data.allowActivity.map((item, index) => (
label: '叠加活动类型', extra: <Space wrap>{allowActivity.map((item, index) => (
<StatusTag key={`default_key_${index}`} type="default" title={ACTIVITYTYPENAME[item]} />
))}
</Space>
......@@ -190,11 +192,11 @@ export const GeneralEffect = (int, data) => {
col: [
{
label: '优惠规则', extra: <Space direction='vertical'>
{data.ladderBOList.map(item => (<div>{`满 ${item.discount} 件, 打 ${item.num} 折`}</div>))}
{!isEmpty(data.ladderBOList) && data.ladderBOList.map(item => (<div>{`满 ${item.discount} 件, 打 ${item.num} 折`}</div>))}
</Space>
},
{
label: '叠加活动类型', extra: <Space wrap>{data.allowActivity.map((item, index) => (
label: '叠加活动类型', extra: <Space wrap>{allowActivity.map((item, index) => (
<StatusTag key={`default_key_${index}`} type="default" title={ACTIVITYTYPENAME[item]} />
))}
</Space>
......@@ -219,7 +221,7 @@ export const GeneralEffect = (int, data) => {
col: [
{ label: '优惠规则', extra: `任选 ${data.num} 件, 付 ${data.price} 元` },
{
label: '叠加活动类型', extra: <Space wrap>{data.allowActivity.map((item, index) => (
label: '叠加活动类型', extra: <Space wrap>{allowActivity.map((item, index) => (
<StatusTag key={`default_key_${index}`} type="default" title={ACTIVITYTYPENAME[item]} />
))}
</Space>
......@@ -319,7 +321,7 @@ export const GeneralEffect = (int, data) => {
</>
},
{
label: '叠加活动类型', extra: <Space wrap>{data.allowActivity.map((item, index) => (
label: '叠加活动类型', extra: <Space wrap>{allowActivity.map((item, index) => (
<StatusTag key={`default_key_${index}`} type="default" title={ACTIVITYTYPENAME[item]} />
))}
</Space>
......
export const OuterStatusColor = (type) => {
switch (type) {
case 1:
case 2:
case 3:
case 6:
return 'warning'
case 4:
return 'success'
case 5:
return 'error'
case 7:
return 'processing'
default:
return 'default'
}
}
export const InnerStatusColor = (type) => {
switch (type) {
case 1:
case 2:
case 4:
case 6:
return 'warning'
case 3:
case 5:
return 'error'
case 7:
return 'processing'
case 9:
return 'success'
default:
return 'default'
}
}
......@@ -239,7 +239,7 @@ function useGetLayout() {
const props = _row.key === 'top' ? {
imageUrl: currentProps.imageUrl
} : {
visible: currentProps.visible || true,
visible: currentProps.visible ?? true,
theme: currentProps.theme || 0,
title: currentProps.title,
};
......
......@@ -93,7 +93,7 @@ const columns: ColumnsType<GoodListType[0]> = [
render: (_text, _record) => {
return (
<div className={styles.priceInfo}>
<span>{_record.activityPrice}</span>
<span>{_record.activityPrice || _record.plummetPrice}</span>
<span className={styles.unit}>({_record.unit})</span>
</div>
);
......
/** 平台营销活动执行 */
import React from 'react';
import { history } from 'umi';
import { Button, Tag, Typography } from 'antd';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { format } from '@/constants/dateFormat';
import { ColumnType } from 'antd/lib/table/interface';
import TableLayout from '@/components/TableLayout';
import { OuterStatusColor } from '../../common/tagColor';
import { PATTERN_MAPS } from '@/constants/regExp';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { FormEffectHooks } from '@formily/antd';
import { getMarketingPlatformActivityExecutePage, getMarketingPlatformActivityGetOuterStatusList, getMarketingPlatformActivitySignupGetActivityTypeList } from '@/services/MarketingV2Api';
const { onFormMount$ } = FormEffectHooks;
const Search = () => {
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
render: (text, record) =>
<Button type='link' target='_blank' style={{ padding: 0 }} onClick={() => history.push(`/marketingManage/marketing/marketingSearch/preview?id=${text}`)}>{text}</Button>
},
{
title: '活动名称',
dataIndex: 'activityName',
},
{
title: '活动类型',
dataIndex: 'activityTypeName',
},
{
title: '活动开始时间',
dataIndex: 'startTime',
render: (text) => format(text)
},
{
title: '活动结束时间',
dataIndex: 'endTime',
render: (text) => format(text)
},
{
title: '参与客户数',
dataIndex: 'customerCount',
},
{
title: '已执行订单单数',
dataIndex: 'orderCount',
},
{
title: '已执行订单金额',
dataIndex: 'orderAmount',
render: (text) => (
<Typography.Text>{Number(text).toFixed(2)}</Typography.Text>
)
},
{
title: '外部状态',
dataIndex: 'statusName',
render: (text, _) => (
<Tag color={OuterStatusColor(_.status)}>{text}</Tag>
)
},
{
title: '操作',
dataIndex: 'opertion',
render: (_text, _) => (
<Button type='link' onClick={() => history.push(`/marketingManage/marketing/marketingExecute/detail?id=${_.id}`)}>查看</Button>
)
}
]
const useStateEffects = () => {
const linkage = useLinkageUtils();
onFormMount$().subscribe(() => {
/** 活动类型 */
getMarketingPlatformActivitySignupGetActivityTypeList().then(res => {
const _enum = res.data.map((item) => { return { label: item.name, value: item.status } });
linkage.enum('activityType', _enum);
}).catch(err => {
console.warn(err)
})
/** 外部状态 */
getMarketingPlatformActivityGetOuterStatusList().then(res => {
const _enum = res.data.map((item) => { return { label: item.name, value: item.status } });
linkage.enum('outerStatus', _enum);
}).catch(err => {
console.warn(err)
})
})
}
const MarketingExecute = () => {
return (
<div>123</div>
)
<TableLayout
columns={columns}
effects="id"
fetch={getMarketingPlatformActivityExecutePage}
useStateEffects={useStateEffects}
schema={{
type: 'object',
properties: {
mageLayout: {
type: "object",
"x-component": "flex-layout",
"x-component-props": {
rowStyle: {
justifyContent: 'space-between'
}
},
properties: {
id: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
placeholder: '活动ID'
},
'x-rules': [
{
pattern: PATTERN_MAPS.quantity,
message: '请输入ID',
},
],
},
},
},
[FORM_FILTER_PATH]: {
type: 'object',
'x-component': 'Flex-Layout',
"x-component-props": {
rowStyle: {
justifyContent: "flex-start",
flexWrap: "nowrap"
},
colStyle: {//改变间隔
marginRight: 20
}
},
properties: {
activityName: {
type: 'string',
'x-component-props': {
placeholder: '活动名称',
allowClear: true,
style: {
width: 160,
},
},
},
'[startTime,endTime]': {
type: 'daterange',
'x-component-props': {
placeholder: ['开始时间', '结束时间'],
allowClear: true,
style: {
width: 240,
},
},
},
activityType: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '活动类型',
allowClear: true,
style: {
width: 160,
},
},
},
outerStatus: {
type: 'string',
default: undefined,
enum: [],
'x-component-props': {
placeholder: '外部状态',
allowClear: true,
style: {
width: 160,
},
},
},
submit: {
'x-component': 'Submit',
'x-mega-props': {
span: 1,
},
'x-component-props': {
children: '查询',
},
},
},
},
},
}}
/>
);
}
export default MarketingExecute;
export default Search;
......@@ -4,6 +4,7 @@ import StatusTag from '@/components/StatusTag';
import moment from 'moment';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { isEmpty } from '@formily/shared';
import { ACTIVITY_TYPE_1, ACTIVITY_TYPE_10, ACTIVITY_TYPE_11, ACTIVITY_TYPE_12, ACTIVITY_TYPE_13, ACTIVITY_TYPE_14, ACTIVITY_TYPE_15, ACTIVITY_TYPE_16, ACTIVITY_TYPE_2, ACTIVITY_TYPE_3, ACTIVITY_TYPE_4, ACTIVITY_TYPE_5, ACTIVITY_TYPE_6, ACTIVITY_TYPE_7, ACTIVITY_TYPE_8, ACTIVITY_TYPE_9 } from '@/constants/const/marketing';
export const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm")}</>
......@@ -72,9 +73,9 @@ const lotteryNumType = {
/** 活动类型 */
export const GeneralEffect = (int, data) => {
switch (Number(int)) {
case 1:
case 2:
case 3:
case ACTIVITY_TYPE_1:
case ACTIVITY_TYPE_2:
case ACTIVITY_TYPE_3:
return [
{
col: [
......@@ -100,36 +101,36 @@ export const GeneralEffect = (int, data) => {
]
}
]
case 4:
case 5:
case ACTIVITY_TYPE_4:
case ACTIVITY_TYPE_5:
return [
{
col: [
{
label: `满${int === 4 ? '量' : '额'}促销类型`, extra: <>
{(int === 4 && data.type === 1) && <StatusTag type="default" title="满量减" />}
{(int === 4 && data.type === 2) && <StatusTag type="default" title="满量折" />}
{(int === 5 && data.type === 1) && <StatusTag type="default" title="满额减" />}
{(int === 5 && data.type === 2) && <StatusTag type="default" title="满额折" />}
label: `满${int === ACTIVITY_TYPE_4 ? '量' : '额'}促销类型`, extra: <>
{(int === ACTIVITY_TYPE_4 && data.type === 1) && <StatusTag type="default" title="满量减" />}
{(int === ACTIVITY_TYPE_4 && data.type === 2) && <StatusTag type="default" title="满量折" />}
{(int === ACTIVITY_TYPE_5 && data.type === 1) && <StatusTag type="default" title="满额减" />}
{(int === ACTIVITY_TYPE_5 && data.type === 2) && <StatusTag type="default" title="满额折" />}
</>
},
{
label: <>
{(int === 4 && data.type === 1) && '满量减'}
{(int === 4 && data.type === 2) && '满量折'}
{(int === 5 && data.type === 1) && '满额减'}
{(int === 5 && data.type === 2) && '满额折'}
{(int === ACTIVITY_TYPE_4 && data.type === 1) && '满量减'}
{(int === ACTIVITY_TYPE_4 && data.type === 2) && '满量折'}
{(int === ACTIVITY_TYPE_5 && data.type === 1) && '满额减'}
{(int === ACTIVITY_TYPE_5 && data.type === 2) && '满额折'}
</>, extra: <>
{(int === 4 && data.type === 1) && <Space direction='vertical'>
{(int === ACTIVITY_TYPE_4 && data.type === 1) && <Space direction='vertical'>
{!isEmpty(data.ladderList) && data.ladderList.map(item => (<div>{`满 ${item.key} 个, 减 ${Number(item.value).toFixed(2)} 元`}</div>))}
</Space>}
{(int === 4 && data.type === 2) && <Space direction='vertical'>
{(int === ACTIVITY_TYPE_4 && data.type === 2) && <Space direction='vertical'>
{!isEmpty(data.ladderList) && data.ladderList.map(item => (<div>{`满 ${item.key} 个, 打 ${item.value / 10} 折`}</div>))}
</Space>}
{(int === 5 && data.type === 1) && <Space direction='vertical'>
{(int === ACTIVITY_TYPE_5 && data.type === 1) && <Space direction='vertical'>
{!isEmpty(data.ladderList) && data.ladderList.map(item => (<div>{`满 ${Number(item.key).toFixed(2)} 元, 减 ${Number(item.value).toFixed(2)} 元`}</div>))}
</Space>}
{(int === 5 && data.type === 2) && <Space direction='vertical'>
{(int === ACTIVITY_TYPE_5 && data.type === 2) && <Space direction='vertical'>
{!isEmpty(data.ladderList) && data.ladderList.map(item => (<div>{`满 ${Number(item.key).toFixed(2)} 元, 打 ${item.value /10} 折`}</div>))}
</Space>}
</>
......@@ -154,7 +155,7 @@ export const GeneralEffect = (int, data) => {
]
}
]
case 6:
case ACTIVITY_TYPE_6:
return [
{
col: [
......@@ -190,7 +191,7 @@ export const GeneralEffect = (int, data) => {
]
}
]
case 7:
case ACTIVITY_TYPE_7:
return [
{
col: [
......@@ -219,7 +220,7 @@ export const GeneralEffect = (int, data) => {
]
}
]
case 8:
case ACTIVITY_TYPE_8:
return [
{
col: [
......@@ -244,7 +245,7 @@ export const GeneralEffect = (int, data) => {
]
}
]
case 9:
case ACTIVITY_TYPE_9:
return [
{
col: [
......@@ -263,7 +264,7 @@ export const GeneralEffect = (int, data) => {
]
},
]
case 10:
case ACTIVITY_TYPE_10:
return [
{
col: [
......@@ -273,7 +274,7 @@ export const GeneralEffect = (int, data) => {
]
},
]
case 11:
case ACTIVITY_TYPE_11:
return [
{
col: [
......@@ -288,7 +289,7 @@ export const GeneralEffect = (int, data) => {
]
},
]
case 12:
case ACTIVITY_TYPE_12:
return [
{
col: [
......@@ -307,7 +308,7 @@ export const GeneralEffect = (int, data) => {
]
}
]
case 13:
case ACTIVITY_TYPE_13:
return [
{
col: [
......@@ -337,7 +338,7 @@ export const GeneralEffect = (int, data) => {
]
}
]
case 14:
case ACTIVITY_TYPE_14:
return [
{
col: [
......@@ -356,7 +357,7 @@ export const GeneralEffect = (int, data) => {
]
}
]
case 15:
case ACTIVITY_TYPE_15:
return [
{
col: [
......@@ -365,7 +366,7 @@ export const GeneralEffect = (int, data) => {
]
}
]
case 16:
case ACTIVITY_TYPE_16:
return [
{
col: [
......
......@@ -21,6 +21,7 @@ import { remindLayout, RemindLayoutProps } from '@/pages/marketingManage/common/
import ListModalLayout from '../../components/listModalLayout';
import CouponsListLayout from '../../components/couponsListLayout';
import { getMarketingPlatformMerchantActivityDetail, getMarketingPlatformMerchantActivityDetailGoodsPage, postMarketingPlatformMerchantActivityExamine } from '@/services/MarketingV2Api';
import { ACTIVITY_TYPE_13, ACTIVITY_TYPE_15, ACTIVITY_TYPE_6 } from '@/constants/const/marketing';
const TABLINK = [
{ id: 'progressLayout', title: '流转进度' },
......@@ -120,13 +121,13 @@ const DetialLayout = () => {
})
data.externalLogs = externalLogs;
}
if (data.activityType === 6) {
if (data.activityType === ACTIVITY_TYPE_6) {
setRemind(remindLayout(data.activityType, data.activityDefined.giveType, data.activityDefined.giftType));
}
if (data.activityType === 13) {
if (data.activityType === ACTIVITY_TYPE_13) {
setRemind(remindLayout(data.activityType, data.activityDefined.swapType));
}
if (data.activityType === 15) {
if (data.activityType === ACTIVITY_TYPE_15) {
setRemind(remindLayout(data.activityType));
}
setAllusers([
......
......@@ -26,7 +26,7 @@ const Offter = () => {
key: 'purchaseInquiryNo',
dataIndex: 'purchaseInquiryNo',
render: (text: any, record: any) => (
<EyePreview url={`/purchase/demandBidMgt/demand/detail?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}>{text}</EyePreview>
<EyePreview url={`/purchase/demandVouch/demandBidMgt/demand/detail?id=${record.purchaseInquiryId}&number=${record.purchaseInquiryNo}`}>{text}</EyePreview>
)
}, {
title: '需求摘要',
......@@ -88,7 +88,7 @@ const Offter = () => {
key: 'operate',
dataIndex: 'operate',
render: (text: any, record: any) => (
<Button type='link' onClick={() => history.push(`/purchase/demandBidMgt/offer/preview?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`)}>查看</Button>
<Button type='link' onClick={() => history.push(`/purchase/demandVouch/demandBidMgt/offer/preview?id=${record.id}&number=${record.quotedPriceNo}&turn=${record.turn}`)}>查看</Button>
)
}];
......
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