Commit 12342a2d authored by GuanHua's avatar GuanHua
parents 42187ee2 25a5f615
......@@ -78,7 +78,7 @@ const memberCenterRoute = {
// MemberRoute,
// HandlingRoute,
marketingRoute,
...asyncRoutes,
// ...asyncRoutes,
{
path: '/memberCenter/noAuth',
auth: false,
......
......@@ -18,7 +18,7 @@ export const paltformSignRoute = [
},
// 平台营销活动详情
{
path: '/memberCenter/marketingAbility/paltformSign/search/detail',
path: '/memberCenter/marketingAbility/paltformSign/search/preview',
name: '平台营销活动详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
......@@ -48,7 +48,7 @@ export const paltformSignRoute = [
},
// 待提交审核报名资料详情
{
path: '/memberCenter/marketingAbility/paltformSign/readySubmitExamine/detail',
path: '/memberCenter/marketingAbility/paltformSign/readySubmitExamine/preview',
name: '待提交审核报名资料详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
......@@ -62,7 +62,7 @@ export const paltformSignRoute = [
},
// 待审核报名资料 (一级)详情
{
path: '/memberCenter/marketingAbility/paltformSign/readyExamineOne/detail',
path: '/memberCenter/marketingAbility/paltformSign/readyExamineOne/preview',
name: '待审核报名资料 (一级)详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
......@@ -76,7 +76,7 @@ export const paltformSignRoute = [
},
// 待审核报名资料 (二级)详情
{
path: '/memberCenter/marketingAbility/paltformSign/readyExamineTwo/detail',
path: '/memberCenter/marketingAbility/paltformSign/readyExamineTwo/preview',
name: '待审核报名资料 (二级)详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
......@@ -90,7 +90,7 @@ export const paltformSignRoute = [
},
// 待提交报名资料详情
{
path: '/memberCenter/marketingAbility/paltformSign/readySubmit/detail',
path: '/memberCenter/marketingAbility/paltformSign/readySubmit/preview',
name: '待提交报名资料详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
......
......@@ -136,7 +136,7 @@ const FormList = (props: any) => {
bidCount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 : item.purchaseCount,
bidAmount: sourceType == '1' ? item.awardTaxProbability * item.purchaseCount / 100 * item.taxUnitPrice : sourceType == '2' ? item.awardTenderRatio * item.inviteTenderMateriel.count / 100 * item.price : item.price,
// productBrand
associatedType: _filter(sourceType, item, ['', '', '', '']),
associatedType: _filter(sourceType, item, ['', 'productAttributeJson', '', '']).split('-')[1],
associatedBrand: _filter(sourceType, item, ['', 'productBrand', '', '']),
associatedDataId: _filter(sourceType, item, ['', 'productId', 'commoditySkuId']), // 关联商品id
associatedMaterielNo: _filter(sourceType, item, ['', 'number', 'commodityAttribute']), // 关联物料编号
......@@ -147,6 +147,7 @@ const FormList = (props: any) => {
rowId: index,
}
})
console.log(data)
setData(data)
}
}).catch(err => {
......
......@@ -23,13 +23,13 @@ export interface ProgressProps {
const ProgressLayout: React.FC<ProgressProps> = (props: any) => {
const { logstate } = props;
const context = useContext(Context);
console.log(context)
const [logStatesStatus, setLogStatesStatus] = useState<number>(1);
const [data, setData] = useState<any>({})
useEffect(() => {
if (!isEmpty(context)) {
setLogStatesStatus(context.externalLogs ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES)
console.log(context)
setLogStatesStatus(context.externalLogStates ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES)
setData(context)
}
}, [context])
......@@ -43,7 +43,7 @@ const ProgressLayout: React.FC<ProgressProps> = (props: any) => {
{!isEmpty(data) && (
<Radio.Group
onChange={(e) => setLogStatesStatus(e.target.value)}
defaultValue={data.externalLogs ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES}
defaultValue={data.externalLogStates ? LOGSTATESTYPE.EXTERNALSTATES : LOGSTATESTYPE.INTERIORSTATES}
>
{data.externalLogStates && <Radio.Button value={LOGSTATESTYPE.EXTERNALSTATES}>外部流转</Radio.Button>}
{data.interiorLogStates && <Radio.Button value={LOGSTATESTYPE.INTERIORSTATES}>内部流转</Radio.Button>}
......
......@@ -108,7 +108,7 @@ const ActivityUserLayout: React.FC<ActivityUserLayoutProps> = (props: any) => {
}
ActivityUserLayout.defaultProps = {
title: "参与用户"
title: "参与活动用户"
}
export default ActivityUserLayout
import React, { useState } from 'react';
import { Row, Col, Avatar } from 'antd';
import Card from '@/pages/transaction/components/card';
import { isEmpty } from 'lodash';
const ColStyle = {
display: 'flex',
......@@ -15,34 +16,28 @@ const TextStyle = {
}
export interface DemandLayoutIProps {
// storeList?: any,
/** 商城列表 */
storeList?: any,
/** 标题 */
title?: string
}
const DemandLayout: React.FC<DemandLayoutIProps> = (props: any) => {
// const { storeList } = props;
const [storeList] = useState([
{ id: 1, logoUrl: '', name: 'WEB-渠道商城' },
{ id: 2, logoUrl: '', name: 'H5-渠道商城' },
{ id: 3, logoUrl: '', name: '小程序-渠道商城' },
{ id: 4, logoUrl: '', name: 'APP-渠道商城' },
{ id: 5, logoUrl: '', name: 'WEB-渠道自有商品商城' },
])
const { storeList } = props;
return (
<Card
id='demandLayout'
title='适用商城'
>
<Row gutter={[16, 16]}>
{storeList.map(item => (
{!isEmpty(storeList) && storeList.map(item => (
<Col
span={6}
key={item.id}
>
<div style={ColStyle}>
<Avatar size={32} src={item.logoUrl} style={{ color: '#FFFFFF', backgroundColor: '#00A98F' }}>logo</Avatar>
<span style={TextStyle}>{item.name}</span>
<Avatar size={32} src={item.logo} style={{ color: '#FFFFFF', backgroundColor: '#00A98F' }} />
<span style={TextStyle}>{item.shopName}</span>
</div>
</Col>
))}
......
/**
* 活动类型
*/
export enum ACTIVITYTYPE {
/** 特价促销 */
SALE = 1,
/** 直降促销 */
DOWNSALE,
/** 折扣促销 */
DISCOUNT,
/** 满量促销 */
FULLCAPACITY,
/** 满额促销 */
FULFILTHEQUOTA,
/** 赠送促销 */
PRESENTED,
/** 多件促销 */
EXCESSIVEPARTS,
/** 组合促销 */
GROUPS,
/** 拼团 */
TOURDIY,
/** 抽奖 */
LOTTERY,
/** 砍价 */
BARGAIN,
/** 秒杀 */
SECKILL,
/** 换购 */
GIFT,
/** 预售 */
PRESELL,
/** 套餐 */
SETMEAL,
/** 试用 */
TRYOUT,
}
/**
* 活动类型文字
*/
export const ACTIVITYTYPENAME = {
1: "特价促销",
2: "直降促销",
3: "折扣促销",
4: "满量促销",
5: "满额促销",
6: "赠送促销",
7: "多件促销",
8: "组合促销",
9: "拼团",
10: "抽奖",
11: "砍价",
12: "秒杀",
13: "换购",
14: "预售",
15: "套餐",
16: "试用",
}
......@@ -10,7 +10,7 @@ import RecordLyout from '@/pages/transaction/components/detailLayout/components/
import BasicLayout from '@/pages/transaction/components/detailLayout/components/basicLayout';
import moment from 'moment';
import { useEffect } from 'react';
import { ACTIVITYTYPE, ACTIVITYTYPENAME } from './constants';
import { ACTIVITYTYPENAME, GeneralEffect } from './constants';
import StatusTag from '@/components/StatusTag';
import ActivityUserLayout from '../../components/activityUserLayout';
import DemandLayout from '../../components/demandLayout';
......@@ -18,6 +18,7 @@ import ListLayout from '@/pages/transaction/components/detailLayout/components/l
import { ColumnType } from 'antd/lib/table/interface';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { PublicApi } from '@/services/api';
import { isEmpty } from 'lodash';
const TABLINK = [
{ id: 'progressLayout', title: '流转进度' },
......@@ -36,7 +37,7 @@ const DetialLayout = () => {
const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
}
const [dataSource] = useState<any>(_data);
const [dataSource, setDataSource] = useState<any>({});
const [basicEffect, setBasicEffect] = useState<any>([]);
const [generalEffect, setGeneralEffect] = useState<any>([]);
......@@ -67,47 +68,10 @@ const DetialLayout = () => {
])
}
const handleGeneralEffect = (data: any) => {
setGeneralEffect([
{
col: [
{ label: '满量促销类型', extra: '' },
{ label: '满量减', extra: '' },
{ label: '赠送促销类型', extra: '' },
{ label: '优惠规则', extra: '' },
{ label: '换购类型', extra: '' },
{ label: '叠加活动类型', extra: <Space><StatusTag type="default" title='满量促销' /><StatusTag type="default" title='满额促销' /></Space> },
{ label: '成团人数', extra: '' },
{ label: '抽奖类型', extra: '' },
{ label: '抽奖次数', extra: '' },
{ label: '每次砍价金额', extra: '' },
{ label: '用户限制次数', extra: '' },
{ label: '每日秒杀时间段', extra: '' },
{ label: '定金支付时间', extra: '' },
{ label: '抽取用户时间', extra: '' },
{ label: '活动描述', extra: '活动期内仅允许用户以活动价格购买一件,超过一件用户须以原价购买' },
],
},
{
col: [
{ label: '赠品类型', extra: '' },
{ label: '叠加优惠券', extra: '允许叠加' },
{ label: '成团时间', extra: '' },
{ label: '每次砍价金额', extra: '' },
{ label: '尾款支付时间', extra: '' },
{ label: '试用结束时间', extra: '' },
],
},
{
col: [
{ label: '满量促销类型', extra: '' },
{ label: '满量折', extra: '' },
{ label: '超限规则', extra: '原价购买' },
{ label: '用户参团限制', extra: '' },
{ label: '开始发货时间', extra: '' },
],
},
])
const handleGeneralEffect = (data: any, int?: number) => {
if (!isEmpty(data)) {
setGeneralEffect(GeneralEffect(int, data))
}
}
const columns: ColumnType<any>[] = [
......@@ -166,17 +130,31 @@ const DetialLayout = () => {
]
const fetchDataSource = useCallback(async () => {
await PublicApi.getMarketingPlatformActivitySignupDetail({ activityId }).then(res => {
await PublicApi.getMarketingPlatformActivitySignupDetail({ activityId }).then((res: any) => {
if (res.code !== 1000) {
return
}
handleBasicEffect(res.data)
}).catch(() => {})
let { data } = res;
let externalLogStates: any = []
data.outerTaskStepList.forEach((item: any) => {
externalLogStates.push({
state: item.step,
stateName: null,
isExecute: item.isExecute,
operationalProcess: item.taskName,
roleName: item.roleName,
})
})
data.externalLogStates = externalLogStates;
setDataSource(data);
handleBasicEffect(data)
handleGeneralEffect(data.activityDefinedBO, data.activityType)
}).catch(() => { })
}, [])
useEffect(() => {
fetchDataSource();
handleGeneralEffect(_data);
// handleGeneralEffect(_data);
}, [])
return (
......@@ -202,7 +180,7 @@ const DetialLayout = () => {
columns={columns}
/>
<ActivityUserLayout />
<DemandLayout />
<DemandLayout storeList={dataSource.shopList} />
<RecordLyout />
</Fragment>
}
......
import React 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 ProgressLayout from '@/pages/transaction/components/detailLayout/components/progressLayout';
import GeneralLayout from '@/pages/transaction/components/detailLayout/components/generalLayout';
import RecordLyout from '@/pages/transaction/components/detailLayout/components/recordLyout';
import BasicLayout from '@/pages/transaction/components/detailLayout/components/basicLayout';
import moment from 'moment';
import { useEffect } from 'react';
import { ACTIVITYTYPENAME, GeneralEffect } from './constants';
import StatusTag from '@/components/StatusTag';
import ActivityUserLayout from '../../components/activityUserLayout';
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';
import { isEmpty } from 'lodash';
import ProductListLayout from './components/productListLayout';
const TABLINK = [
{ id: 'progressLayout', title: '流转进度' },
{ id: 'basicLayout', title: '基本信息' },
{ id: 'activityRuleLayout', title: '活动规则' },
{ id: 'activityProductLayout', title: '活动商品' },
{ id: 'activityUserLayout', title: '活动用户' },
{ id: 'applyMallLayout', title: '适用商城' },
{ id: 'recordLyout', title: '流转记录' },
]
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")}</>
}
const [dataSource, setDataSource] = useState<any>({});
const [basicEffect, setBasicEffect] = useState<any>([]);
const [generalEffect, setGeneralEffect] = useState<any>([]);
const handleBasicEffect = (data: any) => {
setBasicEffect([
{
col: [
{ label: '活动ID', extra: data.id },
{ label: '活动名称', extra: data.activityName },
{ label: '外部状态', extra: data.outerStatusName },
{ label: '内部状态', extra: data.innerStatusName },
]
},
{
col: [
{ label: '活动类型', extra: data.activityTypeName },
{ label: '活动参与类型', extra: data.activitySignUpTypeName },
{ label: '活动开始时间', extra: format(data.startTime) },
{ label: '活动结束时间', extra: format(data.endTime) },
]
},
{
col: [
{ label: '要求报名时间', extra: <>{format(data.signUpStartTime)}~{format(data.signUpEndTime)}</> },
]
},
])
}
const handleGeneralEffect = (data: any, int?: number) => {
if (!isEmpty(data)) {
setGeneralEffect(GeneralEffect(int, data))
}
}
const columns: ColumnType<any>[] = [
{
title: '商品图片',
key: '',
dataIndex: '',
},
{
title: '商品ID',
key: '',
dataIndex: '',
},
{
title: '商品名称',
key: '',
dataIndex: '',
},
{
title: '品类',
key: '',
dataIndex: '',
},
{
title: '品牌',
key: '',
dataIndex: '',
},
{
title: '单位',
key: '',
dataIndex: '',
},
{
title: '商品价格',
key: '',
dataIndex: '',
},
{
title: <Tooltip placement="top" title="活动价格表示商城直接以该商品的活动价格进行销售">
活动价格 <QuestionCircleOutlined />
</Tooltip>,
key: '',
dataIndex: '',
},
{
title: '个人限购数量',
key: '',
dataIndex: '',
},
{
title: '活动限购总数量',
key: '',
dataIndex: '',
},
]
const fetchDataSource = useCallback(async () => {
await PublicApi.getMarketingPlatformActivitySignupDetail({ activityId }).then((res: any) => {
if (res.code !== 1000) {
return
}
let { data } = res;
let externalLogStates: any = []
data.outerTaskStepList.forEach((item: any) => {
externalLogStates.push({
state: item.step,
stateName: null,
isExecute: item.isExecute,
operationalProcess: item.taskName,
roleName: item.roleName,
})
})
data.externalLogStates = externalLogStates;
setDataSource(data);
handleBasicEffect(data)
handleGeneralEffect(data.activityDefinedBO, data.activityType)
}).catch(() => { })
}, [])
useEffect(() => {
fetchDataSource();
// handleGeneralEffect(_data);
}, [])
function Add() {
return (
<div>
Add
</div>
);
<Context.Provider value={dataSource}>
<PeripheralLayout
no={dataSource.activityId}
detail={dataSource.activityName}
tabLink={TABLINK}
components={
<Fragment>
<ProgressLayout />
<BasicLayout effect={basicEffect} />
<GeneralLayout
visible
title={`活动规则-${ACTIVITYTYPENAME[dataSource.activityType]}`}
anchor="activityRuleLayout"
effect={generalEffect}
/>
<ProductListLayout data={dataSource} />
<ActivityUserLayout />
<DemandLayout storeList={dataSource.shopList} />
<RecordLyout />
</Fragment>
}
/>
</Context.Provider>
)
}
export default Add;
export default DetialLayout;
import React, { useState, useMemo, useEffect } from 'react';
import { Table } from 'antd';
import Card from '@/pages/transaction/components/card';
import { Columns } from '../columns';
import { isEmpty } from 'lodash';
interface ProductListLayoutProps {
/** 详情数据 */
data?: any,
}
const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
const { data } = props;
const [type, setType] = useState<number>(0);
const [dataSource, setDataSource] = useState<any>([{
productId: 1,
productName: '商品名称',
category: '品类',
brand: '品牌',
unit: '',
price: '',
}])
const columns = useMemo(() => {
return Columns(type || 1)
}, [type])
useEffect(() => {
if (!isEmpty(data)) {
setType(data.activityType)
}
}, [data])
return (
<Card
id="productListLayout"
title="活动商品"
>
<Table
columns={columns}
dataSource={dataSource}
/>
</Card>
)
}
export default ProductListLayout;
import React from 'react';
import { history } from 'umi';
import TableLayout from '../../../components/TableLayout';
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { ColumnType } from 'antd/lib/table/interface';
......@@ -23,7 +24,7 @@ const ReadySubmitExamine = () => {
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text) => <EyePreview>{text}</EyePreview>
render: (text, record) => <EyePreview url={`/memberCenter/marketingAbility/paltformSign/readySubmitExamine/preview?activityId=${record.activityId}`}>{text}</EyePreview>
},
{
title: '活动类型',
......@@ -78,7 +79,7 @@ const ReadySubmitExamine = () => {
render: (text, record) => (
<>
<Button type='link'>提交审核</Button>
<Button type='link'>填写报名资料</Button>
<Button type='link' onClick={() => history.push(`/memberCenter/marketingAbility/paltformSign/readySubmitExamine/add?activityId=${record.activityId}`)}>填写报名资料</Button>
</>
)
},
......
......@@ -21,7 +21,7 @@ const Search = () => {
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text, record) => <EyePreview url={`/memberCenter/marketingAbility/paltformSign/search/detail?activityId=${record.activityId}`}>{text}</EyePreview>
render: (text, record) => <EyePreview url={`/memberCenter/marketingAbility/paltformSign/search/preview?activityId=${record.activityId}`}>{text}</EyePreview>
},
{
title: '活动类型',
......
......@@ -39,7 +39,8 @@ const Add = () => {
const _handleSave = async () => {
const basicRef = await basicForm.current.get();
console.log(basicRef)
const rulesRef = await rulesForm.current.get()
console.log(basicRef, rulesRef)
}
return (
......
......@@ -948,6 +948,22 @@ const AddFormRule: React.FC<AddFormRuleProps> = (props: any) => {
const [form] = Form.useForm();
useEffect(() => {
currentRef.current = {
get: () => new Promise((resolve: any) => {
form.validateFields().then(res => {
resolve({
state: true,
name: 'rules',
data: { ...res },
})
}).catch(err => {
console.log(err)
})
})
}
})
useEffect(() => {
form.resetFields();
}, [ruleType])
......
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