Commit 3ee6e3fd authored by 前端-钟卫鹏's avatar 前端-钟卫鹏
parents 00b920c2 afddf914
......@@ -86,6 +86,14 @@ const route: RouterChild = {
hideInMenu: true,
noMargin: true,
},
// 待新增退货发货单-新增
{
path: '/memberCenter/afterService/returnApplication/returnPrAddDeliver/add',
name: 'returnAddDeliverBill',
component: '@/pages/afterService/returnApplication/returnPrAddDeliver/addDeliverBill',
hideInMenu: true,
noMargin: true,
},
// 待新增退货发货单-订单详情
{
path: '/memberCenter/afterService/returnApplication/returnPrAddDeliver/orderDetail',
......
......@@ -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,
......
This diff is collapsed.
......@@ -146,6 +146,7 @@ registerVirtualBox('ColumnLayout', (_props) => {
const xComponentProps = props['x-component-props'] || {};
const {
column = 3,
gutter = 20,
} = xComponentProps;
const span = 24 / column;
......@@ -160,7 +161,7 @@ registerVirtualBox('ColumnLayout', (_props) => {
return (
<Row
gutter={20}
gutter={gutter}
>
{cols.map((item, index) => (
<Col key={index} span={span}>
......
......@@ -591,6 +591,7 @@ export default {
'menu.afterService.returnApplication.addReturnPrSubmit': '新建退货申请单',
'menu.afterService.returnApplication.editReturnPrSubmit': '编辑退货申请单',
'menu.afterService.returnApplication.returnPrAddDeliver': '待新增退货发货单',
'menu.afterService.returnApplication.returnAddDeliverBill': '新增退货发货单',
'menu.afterService.returnApplication.returnPrAddLogistics': '待新增物流单',
'menu.afterService.returnApplication.returnPrDeliver': '待退货发货',
'menu.afterService.returnApplication.verifyReturnPrDeliver': '退货发货',
......
/*
* @Author: XieZhiXiong
* @Date: 2021-08-04 15:53:06
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-04 16:49:47
* @Description: 新增退货发货单
*/
import React from 'react';
import { DOC_TYPE_RETURN_INVOICE } from '@/constants/commodity';
import BillsFormPage, { RelatedInfoType } from '@/pages/transaction/stockSellStorage/bills/components/BillsFormPage';
import { PATTERN_MAPS } from '@/constants/regExp';
import { usePageStatus } from '@/hooks/usePageStatus';
const ReturnAddDeliverBill = () => {
const { id } = usePageStatus();
const fetchRelatedInfo = (): Promise<RelatedInfoType> => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve({
relatedNo: 'FPTY12',
memberName: '温州龙昌手袋有限公司',
address: '张三 / 185 2929 6758 广东省广州市海珠区新港东路1068号中洲中心北塔6楼',
logisticsTypeName: '物流',
});
}, 2000);
});
};
return (
<BillsFormPage
billType={DOC_TYPE_RETURN_INVOICE}
fetchRelatedInfo={fetchRelatedInfo}
/>
);
};
export default ReturnAddDeliverBill;
/*
* @Author: XieZhiXiong
* @Date: 2021-01-06 11:36:34
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-04 11:29:53
* @Description:
*/
import React from 'react';
import { usePageStatus } from '@/hooks/usePageStatus';
import DetailInfo from '../components/DetailInfo';
const ReturnPrAddDeliverDetail: React.FC = () => {
const { id, creditId } = usePageStatus();
const { id } = usePageStatus();
return (
<DetailInfo
......
......@@ -426,7 +426,7 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
<div className={styles.upload_left}>
<LinkOutlined style={{ marginRight: '5px' }} />
<Typography.Link
href={`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumURL}`}
href={`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumUrl}`}
target="_blank"
>
{file.albumName}
......
......@@ -105,21 +105,21 @@ const ChannelSeoAdded = () => {
label={<RequireItem label="标题" isRequire={true} brief={<Tooltip placement="top" title="用于显示在页面title标签的内容,便于搜索引擎抓取"><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: "请输入标题" }]}
>
<Input maxLength={50} disabled={link === 'detail'} placeholder='最长100个字符,50个汉字' />
<Input maxLength={50} disabled={link === 'detail'} placeholder='最长50个汉字' />
</Form.Item>
<Form.Item
name='description'
label={<RequireItem label="描述" isRequire={true} brief={<Tooltip placement="top" title="用于显示在页面Description标签的内容,便于搜索引擎抓取"><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: "请输入描述" }]}
>
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长200个字符,100个汉字" maxLength={100} />
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长200个汉字" maxLength={200} />
</Form.Item>
<Form.Item
name='keywords'
label={<RequireItem label="关键字" isRequire={true} brief={<Tooltip placement="top" title="用于显示在页面Keywords标签的内容,便于搜索引擎通过关键词搜索时抓取页面,多个关键词用豆号分隔"><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: "请输入关键字" }]}
>
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长200个字符,100个汉字" maxLength={100} />
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长100个汉字" maxLength={100} />
</Form.Item>
</Form>
</TabPane>
......
......@@ -136,8 +136,8 @@ 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, ['', '', '', '']),
associatedBrand: _filter(sourceType, item, ['', 'productAttributeJson', '', '']),
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']), // 关联物料编号
associatedMaterielName: _filter(sourceType, item, ['', 'productName', 'commodityName']), // 关联商品名称
......@@ -147,6 +147,7 @@ const FormList = (props: any) => {
rowId: index,
}
})
console.log(data)
setData(data)
}
}).catch(err => {
......
......@@ -414,7 +414,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
<div className={styles.upload_left}>
<LinkOutlined style={{ marginRight: '5px' }} />
<Typography.Link
href={`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumURL}`}
href={`/api/contract/contractTemplate/downloadContract?contractName=${file.albumName}&contractUrl=${file.albumUrl}`}
target="_blank"
>
{file.albumName}
......
......@@ -106,21 +106,21 @@ const ShopSeoAdded = () => {
label={<RequireItem label="标题" isRequire={true} brief={<Tooltip placement="top" title="用于显示在页面title标签的内容,便于搜索引擎抓取"><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: "请输入标题" }]}
>
<Input maxLength={50} disabled={link === 'detail'} placeholder='最长100个字符,50个汉字' />
<Input maxLength={50} disabled={link === 'detail'} placeholder='最长50个汉字' />
</Form.Item>
<Form.Item
name='description'
label={<RequireItem label="描述" isRequire={true} brief={<Tooltip placement="top" title="用于显示在页面Description标签的内容,便于搜索引擎抓取"><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: "请输入描述" }]}
>
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长200个字符,100个汉字" maxLength={100} />
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长200个汉字" maxLength={200} />
</Form.Item>
<Form.Item
name='keywords'
label={<RequireItem label="关键字" isRequire={true} brief={<Tooltip placement="top" title="用于显示在页面Keywords标签的内容,便于搜索引擎通过关键词搜索时抓取页面,多个关键词用豆号分隔"><QuestionCircleOutlined /></Tooltip>} />}
rules={[{ required: true, message: "请输入关键字" }]}
>
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长200个字符,100个汉字" maxLength={100} />
<Input.TextArea disabled={link === 'detail'} rows={5} placeholder="最长100个汉字" maxLength={100} />
</Form.Item>
</Form>
</TabPane>
......
......@@ -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>}
......
import React, { useEffect, useState } from 'react';
import { Row, Col, Form, Input, DatePicker, Select } from 'antd';
import { Row, Col, Form, Input, DatePicker, Select, Button, Space } from 'antd';
import Card from '@/pages/transaction/components/card';
import moment from 'moment';
import { PublicApi } from '@/services/api';
import { isEmpty } from 'lodash';
import { LinkOutlined } from '@ant-design/icons';
const disabledDate = (current) => {
return current && current < moment().startOf('day');
......@@ -70,14 +71,47 @@ const TradeTermsLayout: React.FC<TradeTermsLayoutProps> = (props: any) => {
format="YYYY-MM-DD HH:mm:ss"
/>
</Form.Item>
<Form.Item label='报价要求' name='offer'>
<Input.TextArea maxLength={50} autoSize placeholder='最长100个字符,50个汉字' />
<Form.Item
label='询价联系人'
name='contacts'
rules={[{ required: true, message: '请选择询价联系人' }]}
>
<Input.Search readOnly enterButton={<Button style={{ height: '31.19px' }} icon={<LinkOutlined />}>选择</Button>} />
</Form.Item>
<Form.Item
label='联系人电话'
required
style={{ marginBottom: '0px' }}
>
<Row gutter={16}>
<Col span={8}>
<Form.Item
name='phoneCode'
rules={[{ required: true, message: '请选择' }]}
>
<Select>
<Select.Option value={86}>86</Select.Option>
</Select>
</Form.Item>
</Col>
<Col span={16}>
<Form.Item
name='contactsPhone'
rules={[{ required: true, message: '请选择' }]}
>
<Input type='number' maxLength={11} />
</Form.Item>
</Col>
</Row>
</Form.Item>
<Form.Item label='付款方式' name='paymentType'>
<Input.TextArea maxLength={50} autoSize placeholder='最长100个字符,50个汉字' />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item label='报价要求' name='offer'>
<Input.TextArea maxLength={50} autoSize placeholder='最长100个字符,50个汉字' />
</Form.Item>
<Form.Item label='税费要求' name='taxes'>
<Input.TextArea maxLength={50} autoSize placeholder='最长100个字符,50个汉字' />
</Form.Item>
......
......@@ -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])
......
......@@ -188,8 +188,8 @@ const BidInfoLayout: React.FC<BidInfoProps> = (props: any) => {
<Row>
<Col span={3}>
<div className={style.childrenTitle}>
<p>对应</p>
<p>招标商品</p>
<p>关联</p>
<p>报价商品</p>
</div>
</Col>
<Col span={6}>
......
......@@ -130,8 +130,8 @@ const BidResultLayout: React.FC<BidResultProps> = (props: any) => {
<Row>
<Col span={3}>
<div className={style.childrenTitle}>
<p>对应</p>
<p>招标商品</p>
<p>关联</p>
<p>报价商品</p>
</div>
</Col>
<Col span={6}>
......
......@@ -177,6 +177,8 @@ const AnchorModal: React.FC<AnchorModalProps> = (props: any) => {
name: Object.keys(product).length > 0 ? product.name : res.name,
category: Object.keys(product).length > 0 ? product.customerCategory.name : edit.category,
ids: res.ids,
categoryId: Object.keys(product).length > 0 ? product.customerCategory.id : edit.catcategoryIdegory,
memberCategoryId: (Object.keys(product).length > 0 && !isEmpty(product.customerCategory.category)) ? product.customerCategory.category.id : edit.memberCategoryId,
brand: res.brand,
model: res.model,
purchaseCount: res.purchaseCount,
......
/*
* @Author: XieZhiXiong
* @Date: 2021-08-04 14:42:57
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-04 17:59:35
* @Description:
*/
import { FormPath, FormEffectHooks } from '@formily/antd';
import { useAsyncSelect } from '@/formSchema/effects/useAsyncSelect';
import { PublicApi } from '@/services/api';
import { useBusinessEffects } from './useBusinessEffects';
const {
onFieldMount$,
} = FormEffectHooks;
// 获取单据类型
const fetchInvoicesType = (): Promise<any[]> => {
return new Promise((resolve, reject) => {
PublicApi.getProductInvoicesTypeAll().then(res => {
if (res.code === 1000) {
resolve(res.data);
}
reject();
}).catch(() => {
reject();
});
});
};
// 获取仓库
const fetchInventory = (): Promise<any[]> => {
return new Promise((resolve, reject) => {
PublicApi.getProductWarehouseAll().then(res => {
if (res.code === 1000) {
resolve(res.data);
}
reject();
}).catch(() => {
reject();
});
});
};
export const createEffects = (context, actions) => {
const { setFieldState } = actions;
useBusinessEffects(context, actions);
useAsyncSelect('billType', fetchInvoicesType, ['name', 'id']);
useAsyncSelect('inventoryId', fetchInventory, ['name', 'id']);
};
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-08-04 14:43:14
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-04 18:00:12
* @Description:
*/
import { FormEffectHooks, FormPath, IFormActions } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
const {
onFieldInputChange$,
onFieldValueChange$,
} = FormEffectHooks;
export const useBusinessEffects = (context, actions: IFormActions) => {
const { getFieldValue, setFieldState, setFieldValue, getFieldState } = actions;
const linkage = useLinkageUtils();
// 对应仓库改变
onFieldInputChange$('inventoryId').subscribe(fieldState => {
const current = fieldState.originAsyncData.find(item => item.id === fieldState.value);
if (current) {
linkage.value('inventoryRole', current.principal);
}
});
}
\ No newline at end of file
/*
* @Author: XieZhiXiong
* @Date: 2021-08-04 11:33:33
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-08-04 17:55:28
* @Description: 单据表单组件,提供基础的表单内容,单据明细相关由外部传入控制
*/
import React, { useEffect, useState } from 'react';
import { Button, Spin } from 'antd';
import { createFormActions, FormEffectHooks, ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd';
import { Radio, ArrayTable } from '@formily/antd-components';
import {
DOC_TYPE_PURCHASE_RECEIPT,
DOC_TYPE_SALES_INVOICE,
DOC_TYPE_PROCESS_RECEIPT,
DOC_TYPE_PROCESS_INVOICE,
DOC_TYPE_RETURN_INVOICE,
DOC_TYPE_RETURN_RECEIPT,
DOC_TYPE_EXCHANGE_RETURN_INVOICE,
DOC_TYPE_EXCHANGE_RETURN_RECEIPT,
DOC_TYPE_EXCHANGE_INVOICE,
DOC_TYPE_EXCHANGE_RECEIPT,
} from '@/constants/commodity';
import AnchorPage from '@/layouts/AnchorPage';
import NiceForm from '@/components/NiceForm';
import createSchema, { BillDetailSchemaType, BILL_DETAIL_KEY } from './schema';
import { createEffects } from './effects';
import EllipsisText from '../EllipsisText';
const TITLE_MAP = {
[DOC_TYPE_PURCHASE_RECEIPT]: '采购入库单',
[DOC_TYPE_SALES_INVOICE]: '销售发货单',
[DOC_TYPE_PROCESS_RECEIPT]: '加工入库单',
[DOC_TYPE_PROCESS_INVOICE]: '加工发货单',
[DOC_TYPE_RETURN_INVOICE]: '退货发货单',
[DOC_TYPE_RETURN_RECEIPT]: '退货入库单',
[DOC_TYPE_EXCHANGE_RETURN_INVOICE]: '换货退货发货单',
[DOC_TYPE_EXCHANGE_RETURN_RECEIPT]: '换货退货入货单',
[DOC_TYPE_EXCHANGE_INVOICE]: '换货发货单',
[DOC_TYPE_EXCHANGE_RECEIPT]: '换货入库单',
};
const formActions = createFormActions();
const {
onFieldValueChange$,
onFieldInputChange$,
onFormInputChange$,
} = FormEffectHooks;
export type RelatedInfoType = {
/**
* 关联单据编号
*/
relatedNo: string,
/**
* 会员名称
*/
memberName: string,
/**
* 收货地址 或 发货地址
*/
address: string,
/**
* 物流方式名称
*/
logisticsTypeName: string,
}
interface IProps {
/**
* 单据类型
*/
billType: number,
/**
* 是否可编辑的
*/
editable?: boolean,
/**
* 获取对应单据详情
*/
fetchRelatedInfo: () => Promise<RelatedInfoType>,
}
const BillsFormPage: React.FC<IProps> = (props: IProps) => {
const {
billType,
editable = true,
fetchRelatedInfo,
} = props;
const [relatedLoading, setRelatedLoading] = useState(false);
const [unsaved, setUnsaved] = useState(false);
const getRelatedInfo = () => {
if (fetchRelatedInfo) {
setRelatedLoading(true);
fetchRelatedInfo().then((res) => {
console.log('res', res)
}).finally(() => {
setRelatedLoading(false);
});
}
};
useEffect(() => {
getRelatedInfo();
}, []);
const anchorsArr = [
{
key: 'basicInfo',
name: '基本信息',
},
{
key: 'billDetail',
name: '单据明细',
},
];
const handleSubmit = (values: any) => {
};
return (
<Spin spinning={relatedLoading}>
<AnchorPage
title={TITLE_MAP[1]}
anchors={anchorsArr}
extra={(
<Button type="primary">保存</Button>
)}
>
<NiceForm
previewPlaceholder=" "
onSubmit={handleSubmit}
actions={formActions}
initialValues={{}}
components={{
RadioGroup: Radio.Group,
ArrayTable,
Text: EllipsisText,
}}
effects={($, actions) => {
createEffects($, actions);
onFormInputChange$().subscribe(() => {
if (!unsaved) {
setUnsaved(true);
}
});
}}
schema={createSchema(billType)}
editable={!!editable}
/>
</AnchorPage>
</Spin>
);
};
export default BillsFormPage;
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