Commit bae7094c authored by XieZhiXiong's avatar XieZhiXiong
parents a4ba0c61 ab074862
......@@ -40,7 +40,7 @@ export const paltformSignRoute = [
},
// 修改报名资料
{
path: '/memberCenter/marketingAbility/paltformSign/readySubmitExamine/modify',
path: '/memberCenter/marketingAbility/paltformSign/readySubmitExamine/edit',
name: '修改报名资料',
component: '@/pages/transaction/marketingAbility/paltformSign/readySubmitExamine/add',
hideInMenu: true,
......@@ -54,6 +54,14 @@ export const paltformSignRoute = [
hideInMenu: true,
noMargin: true,
},
// 待提交审核报名资料详情
{
path: '/memberCenter/marketingAbility/paltformSign/readySubmitExamine/detail',
name: '待提交审核报名资料详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
noMargin: true,
},
// 待审核报名资料 (一级)
{
path: '/memberCenter/marketingAbility/paltformSign/readyExamineOne',
......@@ -68,6 +76,13 @@ export const paltformSignRoute = [
hideInMenu: true,
noMargin: true,
},
{
path: '/memberCenter/marketingAbility/paltformSign/readyExamineOne/detail',
name: '待审核报名资料 (一级)详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
noMargin: true,
},
// 待审核报名资料 (二级)
{
path: '/memberCenter/marketingAbility/paltformSign/readyExamineTwo',
......@@ -82,6 +97,13 @@ export const paltformSignRoute = [
hideInMenu: true,
noMargin: true,
},
{
path: '/memberCenter/marketingAbility/paltformSign/readyExamineTwo/detail',
name: '待审核报名资料 (二级)详情',
component: '@/pages/transaction/marketingAbility/paltformSign/detail',
hideInMenu: true,
noMargin: true,
},
// 待提交报名资料
{
path: '/memberCenter/marketingAbility/paltformSign/readySubmit',
......
import React, { useEffect } from 'react';
import React, { useEffect, useState } from 'react';
import { Modal } from 'antd';
import {
SchemaForm, SchemaMarkupField as Field,
......@@ -19,7 +19,7 @@ export interface IProps {
visible: boolean,
data?: any,
id: number,
modalType: 'audit' | 'abandon' | 'date' | 'next' | 'key' | 'discard' | 'planAudit' | 'billBack',
modalType: 'audit' | 'abandon' | 'date' | 'next' | 'key' | 'discard' | 'planAudit' | 'billBack' | 'merkeingAudit',
onCancel?: () => void,
onOk?: () => void,
fetch?: () => Promise<unknown>,
......@@ -39,6 +39,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
maxNumber,
} = props;
const [loading, setLoading] = useState<boolean>(false);
const useFormEffects = () => {
const { setFieldState } = createFormActions()
if (modalType === 'audit') {
......@@ -63,6 +64,19 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
})
})
}
if (modalType === 'merkeingAudit') {
onFieldChange$('agree').subscribe(({ value }) => {
setFieldState('reason', state => {
if (value == 1) {
state.visible = false
} else {
state.visible = true
}
})
})
}
if (modalType === 'date') {
onFieldChange$('checkbox').subscribe(({ value }) => {
if (value && value.length > 0) {
......@@ -189,6 +203,18 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
x-component="Radio"
x-component-props={{}}
/>
case 'merkeingAudit':
return <Field
enum={
[
{ label: '审核通过', value: 1 },
{ label: '审核不通过', value: 0 }
]}
name='agree'
required
x-component="Radio"
x-component-props={{}}
/>
}
}
......@@ -208,6 +234,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
const handleSubmit = (val: any) => {
let value = { ...val }
let params: any = {}
setLoading(true)
if (modalType === 'audit') {
params.state = value.state;
value.state !== 1 && (params.auditOpinion = value.auditOpinion);
......@@ -228,13 +255,18 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
} else if (modalType === 'billBack') {
params.status = 0;
params.cause = value.cause;
} else if (modalType === 'merkeingAudit') {
params.agree = value.agree;
params.reason = value.reason;
} else {
params.password = value.password;
}
fetch({ id, ...params }).then(res => {
if (res.code === 1000) {
onOk && onOk()
if (res.code !== 1000) {
setLoading(false)
return
}
onOk && onOk()
})
}
......@@ -260,6 +292,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
title={title}
visible={visible}
onCancel={handleClose}
confirmLoading={loading}
onOk={() => actions.submit()}
afterClose={() => actions.reset()}
>
......@@ -280,11 +313,12 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
onSubmit={(values) => handleSubmit(values)}
initialValues={{
state: 1,
status: 1
status: 1,
agree: 1,
}}
>
{modalNode()}
{(modalType === 'audit' || modalType === 'abandon' || modalType === 'discard' || modalType === 'planAudit' || modalType === 'billBack')
{(modalType === 'audit' || modalType === 'abandon' || modalType === 'discard' || modalType === 'planAudit' || modalType === 'billBack' || modalType === 'merkeingAudit')
&& (<Field
title={modalText()}
name={causeName(modalType)}
......
import React, { useState, useEffect, useMemo } from 'react';
import React, { useState, useEffect, useMemo, useRef } from 'react';
import { Card, Spin, Button } from 'antd';
import { history, Prompt } from 'umi';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
......@@ -44,6 +44,7 @@ interface AddressFormProps {
};
const AddressForm: React.FC<AddressFormProps> = (props: any) => {
const addressData = useRef<any[]>([])
const { id, isEdit, title, fetch, schema, detail } = props;
const [submitLoading, setSubmitLoading] = useState(false);
const [unsaved, setUnsaved] = useState(false);
......@@ -56,48 +57,6 @@ const AddressForm: React.FC<AddressFormProps> = (props: any) => {
return data;
};
/** 获取地区地址 */
const handleAddressSelesed = async () => {
await PublicApi.getManageAreaAll().then(res => {
const { code, data } = res
if (code !== 1000) {
return
}
formActions.setFieldState('provinceCode', targetState => {
targetState.originData = data;
targetState.props.enum = data.map(v => ({
label: v.name,
value: v.code,
}));
});
if (initialValue) {
const { provinceCode, cityCode } = initialValue
const cityData: any[] = data.find(v => v.code === provinceCode).areaResponses || []
formActions.setFieldState('cityCode', targetState => {
targetState.originData = cityData
targetState.props.enum = cityData.map(v => ({
label: v.name,
value: v.code,
}))
})
formActions.setFieldState('districtCode', targetState => {
const districtData: any[] = cityData.find(v => v.code === cityCode).areaResponses || []
targetState.originData = districtData
targetState.props.enum = districtData.map(v => ({
label: v.name,
value: v.code,
}))
})
}
}).catch(error => {
console.warn(error)
})
}
useEffect(() => {
handleAddressSelesed()
}, [initialValue])
const AddressLabel = (
<div className={styles.label}>
{title}
......@@ -110,29 +69,36 @@ const AddressForm: React.FC<AddressFormProps> = (props: any) => {
</div>
);
const findAreaNameByCode = (dataSource, code) => {
return dataSource.find(v => v.code === code).name
}
const handleSubmit = (value: any) => {
setSubmitLoading(true)
const provinceName = formActions.getFieldState('provinceCode', ({ values }) => {
return { provinceName: values[1].title }
})
const cityName = formActions.getFieldState('cityCode', ({ values }) => {
return { cityName: values[1].title }
})
const districtName = formActions.getFieldState('districtCode', ({ values }) => {
return { districtName: values[1].title }
})
const provinceCode = formActions.getFieldValue('provinceCode')
const cityCode = formActions.getFieldValue('cityCode')
const districtCode = formActions.getFieldValue('districtCode')
const provinceData = addressData.current
const cityData = provinceData.find(v => v.code === provinceCode).areaResponses
const districtData = cityData.find(v => v.code === cityCode).areaResponses
const provinceName = findAreaNameByCode(provinceData, provinceCode)
const cityName = findAreaNameByCode(cityData, cityCode)
const districtName = findAreaNameByCode(districtData, districtCode)
const params = {
...value,
isDefault: value.isDefault ? 1 : 0,
...provinceName,
...cityName,
...districtName
isDefault: Number(!!value.isDefault),
provinceName,
cityName,
districtName
}
id && (params.id = id)
fetch(params).then(res => {
setUnsaved(false)
setSubmitLoading(false)
if (res.code !== 1000) {
setSubmitLoading(false)
return
}
history.goBack();
......@@ -148,18 +114,22 @@ const AddressForm: React.FC<AddressFormProps> = (props: any) => {
return initialValue
}, [initialValue])
const getFetchData = async () => {
await detail({ id }).then(res => {
setInfoLoading(false)
if (res.code !== 1000) {
return
}
setTimeout(() => { setInitialValue(res.data) }, 500)
}).catch(error => {
console.warn(error)
})
}
useEffect(() => {
if (id) {
setInfoLoading(true)
detail({ id }).then(res => {
setInfoLoading(false)
if (res.code !== 1000) {
return
}
setInitialValue(res.data)
}).catch(error => {
console.warn(error)
})
getFetchData()
}
}, [])
......@@ -189,7 +159,42 @@ const AddressForm: React.FC<AddressFormProps> = (props: any) => {
AddressLabel,
PhoneLabel,
}}
effects={() => {
effects={($, { setFieldState, setFieldValue }) => {
$('onFormMount').subscribe(async () => {
await PublicApi.getManageAreaAll().then(res => {
if (res.code === 1000) {
const { data } = res;
addressData.current = data
setFieldState('provinceCode', targetState => {
targetState.originData = data;
targetState.props.enum = data.map(v => ({
label: v.name,
value: v.code,
}));
});
if (initialValue) {
const { provinceCode, cityCode } = initialValue
const cityData: any[] = data.find(v => v.code === provinceCode).areaResponses || []
setFieldState('cityCode', targetState => {
targetState.originData = cityData
targetState.props.enum = cityData.map(v => ({
label: v.name,
value: v.code,
}))
})
setFieldState('districtCode', targetState => {
const districtData: any[] = cityData.find(v => v.code === cityCode).areaResponses || []
targetState.originData = districtData
targetState.props.enum = districtData.map(v => ({
label: v.name,
value: v.code,
}))
})
}
}
});
})
useLinkEnumEffect('areaResponses', result =>
result.map(v => ({
label: v.name,
......@@ -197,7 +202,15 @@ const AddressForm: React.FC<AddressFormProps> = (props: any) => {
})),
'code'
);
useAsyncSelect('areaCode', fetchTelCode);
useAsyncSelect('areaCode', fetchTelCode)
$('onFieldChange', 'areaCode').subscribe(result => {
if (result.props.enum.length) {
setFieldValue('areaCode', '86')
}
})
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
......
......@@ -54,7 +54,7 @@ export const shipperAddress: ISchema = {
'x-linkages': [
{
type: 'value:linkage',
condition: '{{!!$value}}',
condition: '{{!!$self.value}}',
origin: 'provinceCode',
target: 'cityCode',
},
......@@ -70,7 +70,7 @@ export const shipperAddress: ISchema = {
'x-linkages': [
{
type: 'value:linkage',
condition: '{{!!$value}}',
condition: '{{!!$self.value}}',
origin: 'cityCode',
target: 'districtCode',
},
......@@ -235,7 +235,7 @@ export const receiverAddress: ISchema = {
'x-linkages': [
{
type: 'value:linkage',
condition: '{{!!$value}}',
condition: '{{!!$self.value}}',
origin: 'provinceCode',
target: 'cityCode',
},
......@@ -251,7 +251,7 @@ export const receiverAddress: ISchema = {
'x-linkages': [
{
type: 'value:linkage',
condition: '{{!!$value}}',
condition: '{{!!$self.value}}',
origin: 'cityCode',
target: 'districtCode',
},
......
import React from 'react';
import { Row, Col, Space } from 'antd';
import React, { useEffect, useState } from 'react';
import { Row, Col, Space, Image } from 'antd';
import style from './index.less';
import Card from '@/pages/transaction/components/card';
import { isEmpty } from 'lodash';
import IMG_LEVEL1 from '@/assets/imgs/level1.png';
import IMG_LEVEL2 from '@/assets/imgs/level2.png';
import IMG_LEVEL3 from '@/assets/imgs/level3.png';
import IMG_LEVEL4 from '@/assets/imgs/level4.png';
interface ActivityUserLayoutProps {
/** 标题 */
title?: string,
/** 适用用户 */
isFlag?: boolean,
/** 数据回显 */
dataScoure?: any
}
const PIC_MAP = {
1: IMG_LEVEL1,
2: IMG_LEVEL2,
3: IMG_LEVEL3,
4: IMG_LEVEL4,
};
const ActivityUserLayout: React.FC<ActivityUserLayoutProps> = (props: any) => {
const { title, isFlag } = props;
const { title, isFlag, dataScoure } = props;
const [data, setData] = useState<any>({});
const [memberLevelList, setMemberLevelList] = useState<any[]>([]);
useEffect(() => {
if (!isEmpty(dataScoure)) {
setData(dataScoure)
setMemberLevelList(dataScoure.memberLevelList || [])
}
}, [dataScoure])
return (
<Card
id="activityUserLayout"
......@@ -40,66 +63,38 @@ const ActivityUserLayout: React.FC<ActivityUserLayoutProps> = (props: any) => {
</Row>
{!isFlag && (
<Row gutter={[24, 24]}>
<Col span={12}>
<div className={style.colStyle}>
<Row>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>会员类型: </h5>
<h5 className={style.content}>企业会员</h5>
</div>
</Col>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>会员角色: </h5>
<h5 className={style.content}>采购商</h5>
</div>
</Col>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>等级类型: </h5>
<h5 className={style.content}>商户会员</h5>
</div>
</Col>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>等级标签: </h5>
<h5 className={style.content}>倔强青铜</h5>
</div>
</Col>
</Row>
</div>
</Col>
<Col span={12}>
<div className={style.colStyle}>
<Row>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>会员类型: </h5>
<h5 className={style.content}>企业会员</h5>
</div>
</Col>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>会员角色: </h5>
<h5 className={style.content}>采购商</h5>
</div>
</Col>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>等级类型: </h5>
<h5 className={style.content}>商户会员</h5>
</div>
</Col>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>等级标签: </h5>
<h5 className={style.content}>倔强青铜</h5>
</div>
</Col>
</Row>
</div>
</Col>
{memberLevelList.map((item: any) => (
<Col span={12} key={item.id}>
<div className={style.colStyle}>
<Row>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>会员类型: </h5>
<h5 className={style.content}>{item.memberTypeName}</h5>
</div>
</Col>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>会员角色: </h5>
<h5 className={style.content}>{item.roleTypeName}</h5>
</div>
</Col>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>等级类型: </h5>
<h5 className={style.content}>{item.levelTypeName}</h5>
</div>
</Col>
<Col span={6}>
<div className={style.cell}>
<h5 className={style.label}>等级标签: </h5>
<h5 className={style.content}><Image width={56} height={16} preview={false} src={PIC_MAP[item.level]} /></h5>
</div>
</Col>
</Row>
</div>
</Col>
))}
</Row>
)}
......
import React, { Fragment, useCallback, useState } from 'react';
import { Tooltip } from 'antd';
import React, { Fragment, useCallback, useMemo, useState } from 'react';
import { Button } from 'antd';
import { history } from 'umi';
import { Context } from '@/pages/transaction/components/detailLayout/components/context';
import PeripheralLayout from '@/pages/transaction/components/detailLayout';
......@@ -14,11 +14,11 @@ import { ACTIVITYTYPENAME, GeneralEffect } from './constants';
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 { Columns } from './columns';
import { PublicApi } from '@/services/api';
import { isEmpty } from 'lodash';
import { stringify } from 'query-string';
import { CheckCircleOutlined } from '@ant-design/icons';
import ModalOperate from '@/pages/transaction/components/modalOperate';
const TABLINK = [
{ id: 'progressLayout', title: '流转进度' },
......@@ -34,6 +34,7 @@ const DetialLayout = () => {
const { query: { activityId, signUpId }, pathname } = history.location;
const [path] = useState(pathname.split('/')[pathname.split('/').length - 1]);
const [pathPci] = useState(pathname.split('/')[pathname.split('/').length - 2]);
const [visible, setVisible] = useState<boolean>(false)
const format = (text, fmt?: string) => {
return <>{moment(text).format(fmt || "YYYY-MM-DD HH:mm:ss")}</>
}
......@@ -74,61 +75,6 @@ const DetialLayout = () => {
}
}
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) {
......@@ -157,13 +103,43 @@ const DetialLayout = () => {
// handleGeneralEffect(_data);
}, [])
console.log(typeof JSON.parse(signUpId))
const columns = useMemo(() => {
return Columns(dataSource.activityType || 1)
}, [dataSource.activityType])
const fetchLink = () => {
let fetchSoure: any = null;
switch (pathPci) {
case 'readyExamineOne':
fetchSoure = PublicApi.postMarketingPlatformActivitySignupExamineStep1
break;
case 'readyExamineTwo':
fetchSoure = PublicApi.postMarketingPlatformActivitySignupExamineStep2
break;
}
return fetchSoure
}
return (
<Context.Provider value={dataSource}>
<PeripheralLayout
no={dataSource.activityId}
detail={dataSource.activityName}
tabLink={TABLINK}
effect={
<>
{path === 'detail'
&& (
<Button
type='primary'
onClick={() => setVisible(true)}
>
<CheckCircleOutlined />
单据审核
</Button>
)}
</>
}
components={
<Fragment>
<ProgressLayout />
......@@ -181,12 +157,22 @@ const DetialLayout = () => {
fetch={PublicApi.getMarketingPlatformActivitySignupDetailGoodsPage}
columns={columns}
/>
<ActivityUserLayout />
<ActivityUserLayout dataScoure={dataSource} />
<DemandLayout storeList={dataSource.shopList} />
<RecordLyout />
</Fragment>
}
/>
{/* 审核 */}
<ModalOperate
id={signUpId}
title="单据审核"
modalType="merkeingAudit"
visible={visible}
fetch={fetchLink()}
onCancel={() => setVisible(false)}
onOk={() => history.goBack()}
/>
</Context.Provider>
)
}
......
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 ReadyExamineOne = () => {
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text) => <EyePreview>{text}</EyePreview>
render: (text, record) => <EyePreview url={`/memberCenter/marketingAbility/paltformSign/readyExamineOne/preview?activityId=${record.activityId}&signUpId=${record.id}`}>{text}</EyePreview>
},
{
title: '活动类型',
......@@ -59,7 +60,7 @@ const ReadyExamineOne = () => {
title: '外部状态',
key: 'outerStatus',
dataIndex: 'outerStatus',
render: (text, record) => (
render: (_, record) => (
<StatusTag type="danger" title={record.outerStatusName} />
)
},
......@@ -67,7 +68,7 @@ const ReadyExamineOne = () => {
title: '内部状态',
key: 'innerStatus',
dataIndex: 'innerStatus',
render: (text, record) => (
render: (_, record) => (
<StatusTag type="danger" title={record.innerStatusName} />
)
},
......@@ -75,12 +76,7 @@ const ReadyExamineOne = () => {
title: '操作',
key: 'state',
dataIndex: 'state',
render: (text, record) => (
<>
<Button type='link'>提交审核</Button>
<Button type='link'>填写报名资料</Button>
</>
)
render: (_, record) => <Button type='link' onClick={() => history.push(`/memberCenter/marketingAbility/paltformSign/readyExamineOne/detail?activityId=${record.activityId}&signUpId=${record.id}`)}>审核</Button>
},
]
/* 多选返回的 */
......@@ -111,6 +107,7 @@ const ReadyExamineOne = () => {
<TableLayout
columns={columns}
effects="id"
rowKey="activityId"
fetch={PublicApi.getMarketingPlatformActivitySignupPageTobeExamineStep1}
selectedRow={true}
fetchRowkeys={fetchRowkeys}
......
......@@ -3,6 +3,7 @@
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';
......@@ -12,100 +13,74 @@ import { format } from '@/pages/transaction/common/dateFormat';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api';
import EyePreview from '@/components/EyePreview';
const { onFormMount$ } = FormEffectHooks;
const ReadyExamineTwo = () => {
const columns: ColumnType<any>[] = [{
title: 'ID',
dataIndex: 'id',
align: 'left',
},
{
title: '活动名称',
dataIndex: 'activityName',
align: 'left',
render: (text) =>
<span style={{ color: '#00B37A' }}>{text}</span>
},
{
title: '活动类型',
dataIndex: 'activityType',
align: 'left',
},
{
title: '活动开始时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '活动结束时间',
dataIndex: 'endTime',
align: 'left',
},
{
title: '报名开始时间',
dataIndex: 'startTime',
align: 'left',
},
{
title: '报名结束时间',
dataIndex: 'endTime',
align: 'left',
},
{
title: '外部状态',
dataIndex: 'outerStatus',
align: 'left',
render: (text) => (
<StatusTag type="danger" title={text} />
)
},
{
title: '内部状态',
dataIndex: 'innerStatus',
align: 'left',
},
{
title: '操作',
dataIndex: 'state',
align: 'left',
render: (_, record) => {
return (
<div>
<span style={{ color: '#00B37A', cursor: 'pointer', marginRight: 10 }}>提交</span>
</div>
)
}
}
]
const mokiData = [
const columns: ColumnType<any>[] = [
{
title: '活动ID',
key: 'activityId',
dataIndex: 'activityId',
},
{
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text, record) => <EyePreview url={`/memberCenter/marketingAbility/paltformSign/readyExamineTwo/preview?activityId=${record.activityId}&signUpId=${record.id}`}>{text}</EyePreview>
},
{
title: '活动类型',
key: 'activityType',
dataIndex: 'activityType',
render: (_text, record) => <>{record.activityTypeName}</>,
},
{
title: '活动开始时间',
key: 'startTime',
dataIndex: 'startTime',
render: (text) => format(text)
},
{
title: '活动结束时间',
key: 'endTime',
dataIndex: 'endTime',
render: (text) => format(text)
},
{
title: '报名开始时间',
key: 'signUpStartTime',
dataIndex: 'signUpStartTime',
render: (text) => format(text)
},
{
id: '1',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
title: '报名结束时间',
key: 'signUpEndTime',
dataIndex: 'signUpEndTime',
render: (text) => format(text)
},
{
id: '2',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
title: '外部状态',
key: 'outerStatus',
dataIndex: 'outerStatus',
render: (_, record) => (
<StatusTag type="danger" title={record.outerStatusName} />
)
},
{
id: '3',
activityName: 'tony',
activityType: '秒杀',
startTime: '2020-05-12 08:08',
endTime: '还剩 59 秒',
outerStatus: "待提交报平台审核",
innerStatus: '待提交审核',
}
title: '内部状态',
key: 'innerStatus',
dataIndex: 'innerStatus',
render: (_, record) => (
<StatusTag type="danger" title={record.innerStatusName} />
)
},
{
title: '操作',
key: 'state',
dataIndex: 'state',
render: (_, record) => <Button type='link' onClick={() => history.push(`/memberCenter/marketingAbility/paltformSign/readyExamineTwo/detail?activityId=${record.activityId}&signUpId=${record.id}`)}>审核</Button>
},
]
/* 多选返回的 */
const fetchRowkeys = (row) => {
......@@ -135,6 +110,7 @@ const ReadyExamineTwo = () => {
<TableLayout
columns={columns}
effects="id"
rowKey="activityId"
fetch={PublicApi.getMarketingPlatformActivitySignupPageTobeExamineStep2}
selectedRow={true}
fetchRowkeys={fetchRowkeys}
......
......@@ -28,7 +28,7 @@ const TABLINK = [
]
const DetialLayout = () => {
const { query: { activityId } } = history.location;
const { query: { activityId, signUpId } } = history.location;
const [loading, setLoading] = useState<boolean>(false)
const [unsaved, setUnsaved] = useState<boolean>(false);
const [productList, setProductList] = useState<any[]>([]);
......@@ -100,10 +100,11 @@ const DetialLayout = () => {
}, [])
const handleSubmit = useCallback(async () => {
const params = {
const params: any = {
activityId,
productList,
}
signUpId !== null && (params.id = signUpId)
if (!isEmpty(productList)) {
setLoading(true)
PublicApi.postMarketingPlatformActivitySignupSave({ ...params }).then(res => {
......@@ -156,8 +157,8 @@ const DetialLayout = () => {
anchor="activityRuleLayout"
effect={generalEffect}
/>
<ProductListLayout data={dataSource} getDataSource={handleGetDataSoure} />
<ActivityUserLayout />
<ProductListLayout signUpId={signUpId !== 'null' && signUpId} data={dataSource} getDataSource={handleGetDataSoure} />
<ActivityUserLayout dataScoure={dataSource} />
<DemandLayout storeList={dataSource.shopList} />
<RecordLyout />
</Fragment>
......
import React from 'react';
import { Tooltip, Popconfirm } from 'antd';
import { Tooltip, Image } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
export const Columns = (int) => {
......@@ -8,8 +8,9 @@ export const Columns = (int) => {
return [
{
title: '商品图片',
key: '',
dataIndex: ''
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品ID',
......@@ -64,16 +65,18 @@ export const Columns = (int) => {
},
{
title: '操作',
key: '',
dataIndex: ''
key: 'operation',
dataIndex: 'operation',
operation: true,
},
]
case 2:
return [
{
title: '商品图片',
key: '',
dataIndex: ''
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品ID',
......@@ -143,8 +146,9 @@ export const Columns = (int) => {
return [
{
title: '商品图片',
key: '',
dataIndex: ''
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品ID',
......@@ -215,8 +219,9 @@ export const Columns = (int) => {
return [
{
title: '商品图片',
key: '',
dataIndex: ''
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品ID',
......@@ -268,8 +273,9 @@ export const Columns = (int) => {
return [
{
title: '商品图片',
key: '',
dataIndex: ''
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品ID',
......@@ -326,8 +332,9 @@ export const Columns = (int) => {
return [
{
title: '商品图片',
key: '',
dataIndex: ''
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品ID',
......@@ -398,8 +405,9 @@ export const Columns = (int) => {
return [
{
title: '商品图片',
key: '',
dataIndex: ''
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品ID',
......@@ -458,8 +466,9 @@ export const Columns = (int) => {
return [
{
title: '商品图片',
key: '',
dataIndex: ''
key: 'productImgUrl',
dataIndex: 'productImgUrl',
render: (text) => <Image width={32} height={32} src={text} />
},
{
title: '商品ID',
......
......@@ -54,6 +54,7 @@ const EditableCell = ({
margin: 0,
}}
name={dataIndex}
initialValue={record[dataIndex]}
rules={[
{
required: true,
......@@ -86,11 +87,11 @@ interface ProductListLayoutProps {
/** 返回表格数据给父级 */
getDataSource?: (e: any[]) => void,
/** ref */
currentRef?: any,
signUpId?: string | number,
}
/** 主体内容 */
const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
const { data, getDataSource, currentRef } = props;
const { data, getDataSource, signUpId } = props;
const [type, setType] = useState<number>(0);
const [visible, setVisible] = useState<boolean>(false);
const [dataSource, setDataSource] = useState<any>([])
......@@ -181,6 +182,9 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
category: item.categoryName,
brand: item.brandName,
status: item.status,
productImgUrl: item.mainPic,
unit: item.unitName,
price: item.unitPrice['0-0']
}
})
})
......@@ -192,22 +196,23 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
const handleOk = (selectRowKeys: string[] | number[], selectRowRecord: any) => {
const rowRecord: any[] = [...selectRowRecord]
console.log(rowRecord, 10086)
const productList = rowRecord.map(item => {
return {
id: item.id,
productImgUrl: item.productImgUrl,
productId: item.productId,
productName: item.productName,
category: item.category,
brand: item.brand,
unit: "尺",
price: 20,
plummetPrice: "",
activityPrice: "",
deductionPrice: "",
discount: "",
restrictNum: "",
restrictTotalNum: "",
unit: item.unit,
price: item.price,
plummetPrice: item.price,
activityPrice: item.activityPrice,
deductionPrice: item.deductionPrice,
discount: item.discount,
restrictNum: item.restrictNum,
restrictTotalNum: item.restrictTotalNum,
}
})
getDataSource(productList)
......@@ -223,6 +228,18 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
}
}
useEffect(() => {
if (signUpId) {
PublicApi.getMarketingPlatformActivitySignupDetailGoodsPage({ signUpId, current: '1', pageSize: '999' }).then(res => {
if (res.code !== 1000) {
return
}
getDataSource(res.data.data)
setDataSource(res.data.data)
})
}
}, [signUpId])
return (
<Card
id="productListLayout"
......@@ -263,9 +280,9 @@ const ProductListLayout: React.FC<ProductListLayoutProps> = (props: any) => {
columns={TableModalColumns}
mode="checkbox"
tableProps={{
rowKey: 'id',
rowKey: 'productId',
}}
customKey="id"
customKey="productId"
onClose={() => toggle(false)}
onOk={handleOk}
effects={($, actions) => {
......
import React from 'react';
import React, { useRef } 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';
import StatusTag from '@/components/StatusTag';
import { Button, Space } from 'antd'
import { Button, Space, Popconfirm } from 'antd'
import EyePreview from '@/components/EyePreview';
import { format } from '@/pages/transaction/common/dateFormat';
import { useLinkageUtils } from '@/utils/formEffectUtils';
......@@ -14,6 +14,17 @@ import { PublicApi } from '@/services/api';
const { onFormMount$ } = FormEffectHooks;
const ReadySubmitExamine = () => {
const ref = useRef<any>({});
/** 提交审核 */
const handleSubmit = async (signUpId?: number) => {
await PublicApi.postMarketingPlatformActivitySignupSubmit({ id: signUpId }).then(res => {
if (res.code !== 1000) {
return
}
ref.current.reload();
})
}
const columns: ColumnType<any>[] = [
{
title: '活动ID',
......@@ -78,8 +89,13 @@ const ReadySubmitExamine = () => {
dataIndex: 'state',
render: (text, record) => (
<>
<Button type='link'>提交审核</Button>
<Button type='link' onClick={() => history.push(`/memberCenter/marketingAbility/paltformSign/readySubmitExamine/add?activityId=${record.activityId}`)}>填写报名资料</Button>
<Popconfirm title="确定要提交吗?" disabled={!record.id} okText="是" cancelText="否" onConfirm={() => handleSubmit(record.id)}>
<Button type='link' disabled={!record.id}>
提交审核
</Button>
</Popconfirm>
{record.id && <Button type='link' onClick={() => history.push(`/memberCenter/marketingAbility/paltformSign/readySubmitExamine/edit?activityId=${record.activityId}&signUpId=${record.id}`)}>修改报名资料</Button>}
{!record.id && <Button type='link' onClick={() => history.push(`/memberCenter/marketingAbility/paltformSign/readySubmitExamine/add?activityId=${record.activityId}`)}>填写报名资料</Button>}
</>
)
},
......@@ -110,6 +126,7 @@ const ReadySubmitExamine = () => {
return (
<TableLayout
reload={ref}
columns={columns}
effects="id"
rowKey="activityId"
......
......@@ -21,7 +21,7 @@ const Search = () => {
title: '活动名称',
key: 'activityName',
dataIndex: 'activityName',
render: (text, record) => <EyePreview url={`/memberCenter/marketingAbility/paltformSign/search/preview?activityId=${record.activityId}`}>{text}</EyePreview>
render: (text, record) => <EyePreview url={`/memberCenter/marketingAbility/paltformSign/search/preview?activityId=${record.activityId}&signUpId=${record.id}`}>{text}</EyePreview>
},
{
title: '活动类型',
......
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