Commit bd2ab9ff authored by Bill's avatar Bill

修改结算搜索bug, 以及消息列表页

parent 2c8bdd37
...@@ -54,7 +54,7 @@ const router = { ...@@ -54,7 +54,7 @@ const router = {
name: 'memberAuthManage', name: 'memberAuthManage',
component: '@/pages/ruleSettingManage/memberAuthManage', component: '@/pages/ruleSettingManage/memberAuthManage',
}, },
// 设置会员角色 // 设置会员角色
{ {
path: '/ruleSettingManager/memberAuthManage/detail', path: '/ruleSettingManager/memberAuthManage/detail',
name: 'memberAuthManageDetail', name: 'memberAuthManageDetail',
...@@ -62,7 +62,7 @@ const router = { ...@@ -62,7 +62,7 @@ const router = {
hideInMenu: true, hideInMenu: true,
hidePageHeader: true hidePageHeader: true
}, },
// 查看会员角色 // 查看会员角色
{ {
path: '/ruleSettingManager/memberAuthManage/preview', path: '/ruleSettingManager/memberAuthManage/preview',
name: 'memberAuthManageDetail', name: 'memberAuthManageDetail',
...@@ -91,7 +91,15 @@ const router = { ...@@ -91,7 +91,15 @@ const router = {
component: '@/pages/ruleSettingManage/platformSettlementStrategy/info', component: '@/pages/ruleSettingManage/platformSettlementStrategy/info',
hidePageHeader: true, hidePageHeader: true,
hideInMenu: true hideInMenu: true
} },
// 平台结算策略配置, 平台策略配置编辑
{
path: '/ruleSettingManager/platformSettlementStrategy/edit',
name: 'platformSettlementStrategyDetailEdit',
component: '@/pages/ruleSettingManage/platformSettlementStrategy/info',
hidePageHeader: true,
hideInMenu: true
}
] ]
} }
export default router export default router
\ No newline at end of file
...@@ -112,6 +112,7 @@ export default { ...@@ -112,6 +112,7 @@ export default {
'menu.ruleSettingManager.platformSettlementStrategy': '平台结算策略配置', 'menu.ruleSettingManager.platformSettlementStrategy': '平台结算策略配置',
'menu.ruleSettingManager.addplatformSettlementStrategy': '新增平台结算策略', 'menu.ruleSettingManager.addplatformSettlementStrategy': '新增平台结算策略',
'menu.ruleSettingManager.platformSettlementStrategyDetail': '平台结算策略详情', 'menu.ruleSettingManager.platformSettlementStrategyDetail': '平台结算策略详情',
'menu.ruleSettingManager.platformSettlementStrategyDetailEdit': '编辑平台结算策略',
// 品类和属性 // 品类和属性
'menu.classAndProperty': '平台品类及属性', 'menu.classAndProperty': '平台品类及属性',
...@@ -231,12 +232,12 @@ export default { ...@@ -231,12 +232,12 @@ export default {
'menu.exchangeManage': '换货申请单管理', 'menu.exchangeManage': '换货申请单管理',
'menu.exchangeManage.query': '换货申请单查询', 'menu.exchangeManage.query': '换货申请单查询',
'menu.exchangeManage.queryDetail': '换货申请单详情', 'menu.exchangeManage.queryDetail': '换货申请单详情',
// 维修管理 // 维修管理
'menu.repairManage': '维修申请单管理', 'menu.repairManage': '维修申请单管理',
'menu.repairManage.query': '维修申请单查询', 'menu.repairManage.query': '维修申请单查询',
'menu.repairManage.queryDetail': '维修申请单详情', 'menu.repairManage.queryDetail': '维修申请单详情',
// 退货管理 // 退货管理
'menu.returnManage': '退货申请单管理', 'menu.returnManage': '退货申请单管理',
'menu.returnManage.query': '退货申请单查询', 'menu.returnManage.query': '退货申请单查询',
...@@ -244,6 +245,6 @@ export default { ...@@ -244,6 +245,6 @@ export default {
'menu.returnManage.returnPrReturn': '待退款', 'menu.returnManage.returnPrReturn': '待退款',
'menu.returnManage.returnPrReturnDetail': '待退款详情', 'menu.returnManage.returnPrReturnDetail': '待退款详情',
'menu.returnManage.prReturnVerify': '退款', 'menu.returnManage.prReturnVerify': '退款',
} }
// export default utils.transformDataPre(data, 'menu') // export default utils.transformDataPre(data, 'menu')
...@@ -15,4 +15,21 @@ ...@@ -15,4 +15,21 @@
font-weight: 500; font-weight: 500;
color: #303133; color: #303133;
} }
}
\ No newline at end of file .header {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.time {
margin-left: 20px;
}
.section {
margin-left: 20px;
display: flex;
flex-direction: row;
align-items: center;
}
}
...@@ -9,50 +9,55 @@ import msg_system from '@/asserts/msg_system.png' ...@@ -9,50 +9,55 @@ import msg_system from '@/asserts/msg_system.png'
import msg_platform from '@/asserts/msg_platform.png' import msg_platform from '@/asserts/msg_platform.png'
import moment from 'moment'; import moment from 'moment';
import { PublicApi } from '@/services/api' import { PublicApi } from '@/services/api'
import { BookOutlined, ReadOutlined } from '@ant-design/icons';
const Message: React.FC<{}> = () => { const Message: React.FC<{}> = () => {
const [dataSource, setDataSource] = useState<any>([]) const [dataSource, setDataSource] = useState<any>([])
const [pagation, setPagation] = useState({ const [pagination, setPagination] = useState({
current: 1, current: 1,
pageSize: 10, pageSize: 10,
}) })
useEffect(() => { useEffect(() => {
// @ts-ignore getList(pagination)
async function init() {
const data = await getList(pagation);
setDataSource(data);
}
init()
}, []) }, [])
const getList = (params) => {
PublicApi.getReportMessagePlatformPage(params).
then(({data, code}) => {
if(code === 1000) {
setDataSource(data)
}
})
}
const getList = async (params) => { const handlePaginationChange = (page, pageSize) => {
const res = await PublicApi.getReportMessagePlatformPage(params); setPagination((state) => ({...state, current: page, pageSize: pageSize}))
if(res.code === 1000) { getList({current: page, pageSize})
return res.data
}
return {
totalCount: 0,
data: []
}
} }
const handlePaginationChange = (page: number, pageSize: number | undefined) => { const handleRead = (id, url: string) => {
//@ts-ignore console.log("当前功能还未开发")
setPagation((state) => ({...state, current: page, pageSize: pageSize})) // PublicApi.getReportMessageMemberRead({id: id})
getList({page, pageSize}) // .then((data) => {
.then((data) => { // if(url) {
setDataSource(data); // if(/http/.test(url)) {
}) // location.href = url
// } else {
// history.push(url);
// }
// } else {
// getList(pagination);
// }
// })
} }
const renderMessage = (data) => { const renderMessage = (data) => {
return ( return (
<> <div onClick={() => handleRead(data.id, data.url)}>
<StatusTag type={data.type == 1 ? 'primary' : 'success'} title={data.type === 1 ? '系统消息' : '平台消息'} /> <StatusTag type={data.type == 1 ? 'primary' : 'success'} title={data.type === 1 ? '系统消息' : '平台消息'} />
<span className={styles.messageTitle}>{data.title || ''}</span> <span className={styles.messageTitle}>{data.title || ''}</span>
<span className={styles.messageText}>{data.content || ''}</span> <span className={styles.messageText}>{data.content || ''}</span>
</> </div>
) )
} }
...@@ -62,17 +67,18 @@ const Message: React.FC<{}> = () => { ...@@ -62,17 +67,18 @@ const Message: React.FC<{}> = () => {
return ( return (
<PageHeaderWrapper> <PageHeaderWrapper>
<Card> <Card>
<p> <div className={styles.header}>
<Button type="primary" icon={<PlusOutlined />} onClick={()=>history.push('/message/messageList/add')} >新建</Button> <Button type="primary" icon={<PlusOutlined />} onClick={()=>history.push('/message/messageList/add')} >新建</Button>
</p> <Button type="link" >全部已读</Button>
</div>
<List <List
itemLayout="horizontal" itemLayout="horizontal"
dataSource={dataSource.data} dataSource={dataSource.data}
className={styles.customList} className={styles.customList}
pagination={{ pagination={{
onChange: handlePaginationChange, onChange: handlePaginationChange,
current: pagation.current, current: pagination.current,
pageSize: pagation.pageSize, pageSize: pagination.pageSize,
size: "small", size: "small",
showQuickJumper: true, showQuickJumper: true,
total: dataSource?.totalCount || 0, total: dataSource?.totalCount || 0,
...@@ -84,7 +90,16 @@ const Message: React.FC<{}> = () => { ...@@ -84,7 +90,16 @@ const Message: React.FC<{}> = () => {
avatar={<Avatar src={item.type == 1 ? msg_system : msg_platform} />} avatar={<Avatar src={item.type == 1 ? msg_system : msg_platform} />}
title={renderMessage(item)} title={renderMessage(item)}
/> />
<div>{moment(item.sendTime).format('YYYY-MM-DD HH:mm:ss')}</div> <div className={styles.section}>
{
item.status === 1
? <ReadOutlined style={{fontSize: '24px', color: '#909090'}}/>
: <BookOutlined style={{fontSize: '20px', color: '#909090'}} />
}
<span className={styles.time}>
{moment(item.sendTime).format('YYYY-MM-DD HH:mm:ss')}
</span>
</div>
</List.Item> </List.Item>
)} )}
/> />
...@@ -93,4 +108,4 @@ const Message: React.FC<{}> = () => { ...@@ -93,4 +108,4 @@ const Message: React.FC<{}> = () => {
); );
} }
export default Message export default Message
\ No newline at end of file
...@@ -43,7 +43,6 @@ const SettlementList = () => { ...@@ -43,7 +43,6 @@ const SettlementList = () => {
...params, ...params,
status: typeof params.status == 'undefined' ? 0 : params.status, status: typeof params.status == 'undefined' ? 0 : params.status,
} }
console.log(searchData);
const res = await PublicApi.getSettleAccountsPlatformSettlementPagePayableSettlement(searchData) const res = await PublicApi.getSettleAccountsPlatformSettlementPagePayableSettlement(searchData)
return res.data; return res.data;
} }
...@@ -106,7 +105,6 @@ const SettlementList = () => { ...@@ -106,7 +105,6 @@ const SettlementList = () => {
* @param params * @param params
*/ */
const handleUploadVoucher = (params: any) => { const handleUploadVoucher = (params: any) => {
console.log(params);
PublicApi.postSettleAccountsPlatformSettlementPay({id: params.id, proveList: params.fileList}) PublicApi.postSettleAccountsPlatformSettlementPay({id: params.id, proveList: params.fileList})
.then((data) => { .then((data) => {
if(data.code === 1000) { if(data.code === 1000) {
......
...@@ -22,8 +22,8 @@ export const schema: ISchema = { ...@@ -22,8 +22,8 @@ export const schema: ISchema = {
'x-component': 'Search', 'x-component': 'Search',
'x-component-props': { 'x-component-props': {
placeholder: '搜索(结算方)', placeholder: '搜索(结算方)',
align: 'flex-left', align: 'flex-left',
tip: '输入 结算方 进行搜索', tip: '输入 结算方 进行搜索',
}, },
}, },
[FORM_FILTER_PATH]: { [FORM_FILTER_PATH]: {
...@@ -40,14 +40,16 @@ export const schema: ISchema = { ...@@ -40,14 +40,16 @@ export const schema: ISchema = {
type: 'string', type: 'string',
'x-component': 'DatePicker', 'x-component': 'DatePicker',
'x-component-props': { 'x-component-props': {
allowClear: true allowClear: true,
placeholder: '结算日期(开始时间)'
} }
}, },
endTime: { endTime: {
type: 'string', type: 'string',
'x-component': 'DatePicker', 'x-component': 'DatePicker',
'x-component-props': { 'x-component-props': {
allowClear: true allowClear: true,
placeholder: '结算日期(结束时间)'
} }
}, },
status: { status: {
...@@ -61,8 +63,8 @@ export const schema: ISchema = { ...@@ -61,8 +63,8 @@ export const schema: ISchema = {
], ],
default: 0, default: 0,
'x-component-props': { 'x-component-props': {
placeholder: '结算状态(全部)', placeholder: '结算状态(全部)',
allowClear: true, allowClear: true,
}, },
}, },
submit: { submit: {
...@@ -141,9 +143,9 @@ export const detailSchema: ISchema = { ...@@ -141,9 +143,9 @@ export const detailSchema: ISchema = {
enum: orderTime, enum: orderTime,
default: 0, default: 0,
'x-component-props': { 'x-component-props': {
placeholder: '下单时间(全部)', placeholder: '下单时间(全部)',
allowClear: true, allowClear: true,
}, },
}, },
payTime: { payTime: {
...@@ -151,8 +153,8 @@ export const detailSchema: ISchema = { ...@@ -151,8 +153,8 @@ export const detailSchema: ISchema = {
enum: payTime, enum: payTime,
default: 0, default: 0,
'x-component-props': { 'x-component-props': {
placeholder: '支付时间(全部)', placeholder: '支付时间(全部)',
allowClear: true, allowClear: true,
}, },
}, },
submit: { submit: {
...@@ -169,4 +171,4 @@ export const detailSchema: ISchema = { ...@@ -169,4 +171,4 @@ export const detailSchema: ISchema = {
}, },
}, },
}, },
}; };
\ No newline at end of file
...@@ -21,7 +21,7 @@ interface VoucherFileProps { ...@@ -21,7 +21,7 @@ interface VoucherFileProps {
interface Iprops { interface Iprops {
fileList?: VoucherFileProps[], fileList?: VoucherFileProps[],
id: number, // 结算方id id: number, // 结算方id
getFileList: (params: any[]) => void getFileList: (params: any[]) => void
} }
...@@ -51,7 +51,7 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => { ...@@ -51,7 +51,7 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => {
if(code == 1000) { if(code == 1000) {
setAccountInfo(data); setAccountInfo(data);
} }
} }
getAccountInfo() getAccountInfo()
}, [props.id]) }, [props.id])
...@@ -123,7 +123,7 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => { ...@@ -123,7 +123,7 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => {
<div className={styles.upload}> <div className={styles.upload}>
<Upload {...uploadProps}> <Upload {...uploadProps}>
<Button icon={<UploadOutlined />}>上传凭证</Button> <Button icon={<UploadOutlined />}>上传凭证</Button>
<p className={styles.tips}>单个凭证文件大小不能超过200K</p> <p className={styles.tips}>单个凭证文件大小不能超过200K</p>
</Upload> </Upload>
</div> </div>
...@@ -131,4 +131,4 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => { ...@@ -131,4 +131,4 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => {
) )
} }
export default UploadPayVoucher; export default UploadPayVoucher;
\ No newline at end of file
...@@ -34,7 +34,7 @@ const columns = [ ...@@ -34,7 +34,7 @@ const columns = [
{title: '支付积分', dataIndex: 'payScore'}, {title: '支付积分', dataIndex: 'payScore'},
{title: '支付时间', dataIndex: 'payTime'}, {title: '支付时间', dataIndex: 'payTime'},
{ {
title: '兑换比率', title: '兑换比率',
dataIndex: 'ratio', dataIndex: 'ratio',
render: (text,record) => { render: (text,record) => {
return (record.ratio + '%'); return (record.ratio + '%');
...@@ -83,37 +83,38 @@ const ScoreInfo: React.FC = () => { ...@@ -83,37 +83,38 @@ const ScoreInfo: React.FC = () => {
const payTimeRange = payTime ? timeRange(values.payTime): null; const payTimeRange = payTime ? timeRange(values.payTime): null;
const payStartTime = payTimeRange ? moment(payTimeRange.st * 1000).format(format) : null; const payStartTime = payTimeRange ? moment(payTimeRange.st * 1000).format(format) : null;
const payEndTime = payTimeRange ? moment(payTimeRange.et * 1000).format(format) : null; const payEndTime = payTimeRange ? moment(payTimeRange.et * 1000).format(format) : null;
const orderTimeRange = orderTime ? timeRange(values.orderTime) : null; const orderTimeRange = orderTime ? timeRange(values.orderTime) : null;
const orderStartTime = orderTimeRange ? moment(orderTimeRange.st * 1000).format(format) : null; const orderStartTime = orderTimeRange ? moment(orderTimeRange.st * 1000).format(format) : null;
const orderEndTime = orderTimeRange ? moment(orderTimeRange.et * 1000).format(format) : null; const orderEndTime = orderTimeRange ? moment(orderTimeRange.et * 1000).format(format) : null;
ref.current.reload({...rest, payStartTime, payEndTime, orderStartTime, orderEndTime}); ref.current.reload({...rest, payStartTime, payEndTime, orderStartTime, orderEndTime});
} }
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()}
title={ title={
<> <>
<PageHeader <PageHeader
style={{ padding: '0' }} style={{ padding: '0' }}
onBack={() => history.goBack()} onBack={() => history.goBack()}
title={ title={
<AvatarWrap <AvatarWrap
info={{ info={{
aloneTxt: '单', aloneTxt: '单',
name: "结算单号:" name: "结算单号:"
}} }}
extra={( extra={(
<span style={{ fontSize: 12, fontWeight: 'normal' }}>{infoDetail?.settlementNo}</span> <span style={{ fontSize: 12, fontWeight: 'normal' }}>{infoDetail?.settlementNo}</span>
)} )}
/> />
} }
> >
<Descriptions <Descriptions
column={3} column={3}
style={{ style={{
padding: '0 32px', padding: '0 32px',
}} }}
> >
<Descriptions.Item label="结算日期:">{infoDetail?.settlementDate}</Descriptions.Item> <Descriptions.Item label="结算日期:">{infoDetail?.settlementDate}</Descriptions.Item>
...@@ -137,7 +138,7 @@ const ScoreInfo: React.FC = () => { ...@@ -137,7 +138,7 @@ const ScoreInfo: React.FC = () => {
currentRef={ref} currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)} fetchTableData={(params: any) => fetchListData(params)}
controlRender={ controlRender={
<NiceForm <NiceForm
actions={formActions} actions={formActions}
expressionScope={{ expressionScope={{
exportBtn: ( exportBtn: (
...@@ -164,4 +165,4 @@ const ScoreInfo: React.FC = () => { ...@@ -164,4 +165,4 @@ const ScoreInfo: React.FC = () => {
) )
} }
export default ScoreInfo export default ScoreInfo
\ No newline at end of file
...@@ -44,7 +44,6 @@ const SettlementList = () => { ...@@ -44,7 +44,6 @@ const SettlementList = () => {
...params, ...params,
status: typeof params.status == 'undefined' ? 0 : params.status, status: typeof params.status == 'undefined' ? 0 : params.status,
} }
console.log(searchData);
///settle/accounts/platform/score/settlement/pagePayableSettlement ///settle/accounts/platform/score/settlement/pagePayableSettlement
const res = await PublicApi.getSettleAccountsPlatformScoreSettlementPagePayableSettlement(searchData) const res = await PublicApi.getSettleAccountsPlatformScoreSettlementPagePayableSettlement(searchData)
return res.data; return res.data;
...@@ -83,7 +82,7 @@ const SettlementList = () => { ...@@ -83,7 +82,7 @@ const SettlementList = () => {
{ text: '待对账', value: 1 }, { text: '待对账', value: 1 },
{ text: '待付款', value: 2 }, { text: '待付款', value: 2 },
{ text: '待收款', value: 3 }, { text: '待收款', value: 3 },
{ text: '完成', value: 4 }, { text: '完成', value: 4 },
], ],
onFilter: (value, record: any) => record.status == value, onFilter: (value, record: any) => record.status == value,
render: (text, record: any) => { render: (text, record: any) => {
......
...@@ -22,8 +22,8 @@ export const schema: ISchema = { ...@@ -22,8 +22,8 @@ export const schema: ISchema = {
'x-component': 'Search', 'x-component': 'Search',
'x-component-props': { 'x-component-props': {
placeholder: '搜索(结算方)', placeholder: '搜索(结算方)',
align: 'flex-left', align: 'flex-left',
tip: '输入 结算方 进行搜索', tip: '输入 结算方 进行搜索',
}, },
}, },
[FORM_FILTER_PATH]: { [FORM_FILTER_PATH]: {
...@@ -40,14 +40,17 @@ export const schema: ISchema = { ...@@ -40,14 +40,17 @@ export const schema: ISchema = {
type: 'string', type: 'string',
'x-component': 'DatePicker', 'x-component': 'DatePicker',
'x-component-props': { 'x-component-props': {
allowClear: true allowClear: true,
placeholder: '结算日期(开始时间)'
} }
}, },
endTime: { endTime: {
type: 'string', type: 'string',
'x-component': 'DatePicker', 'x-component': 'DatePicker',
'x-component-props': { 'x-component-props': {
allowClear: true allowClear: true,
placeholder: '结算日期(结束时间)'
} }
}, },
status: { status: {
...@@ -61,8 +64,8 @@ export const schema: ISchema = { ...@@ -61,8 +64,8 @@ export const schema: ISchema = {
], ],
default: 0, default: 0,
'x-component-props': { 'x-component-props': {
placeholder: '结算状态(全部)', placeholder: '结算状态(全部)',
allowClear: true, allowClear: true,
}, },
}, },
submit: { submit: {
...@@ -79,4 +82,4 @@ export const schema: ISchema = { ...@@ -79,4 +82,4 @@ export const schema: ISchema = {
}, },
}, },
}, },
}; };
\ No newline at end of file
...@@ -16,7 +16,7 @@ const MONTH = 2; ...@@ -16,7 +16,7 @@ const MONTH = 2;
registerValidationRules({ registerValidationRules({
settleMethodRule: value => { settleMethodRule: value => {
const { active, otherValues } = value; const { active, otherValues } = value;
const isNumber = /^\d+$/; // 数字 const isNumber = /^\d+$/; // 数字
const pattern = /[0-9]+\.[0-9]*/; const pattern = /[0-9]+\.[0-9]*/;
if(active == MONTH) { if(active == MONTH) {
...@@ -33,7 +33,7 @@ const SettleMethod = (props) => { ...@@ -33,7 +33,7 @@ const SettleMethod = (props) => {
const handleChange = (e, type) => { const handleChange = (e, type) => {
if(active == type) { if(active == type) {
return ; return ;
} }
const previewValue = otherValues const previewValue = otherValues
// setActive(type) // setActive(type)
props.onChange({ props.onChange({
...@@ -51,6 +51,9 @@ const SettleMethod = (props) => { ...@@ -51,6 +51,9 @@ const SettleMethod = (props) => {
otherValues: temp otherValues: temp
}) })
} }
if(!monthVisible && !daysVisible ) {
return null
}
return ( return (
<div> <div>
...@@ -74,41 +77,35 @@ const SettleMethod = (props) => { ...@@ -74,41 +77,35 @@ const SettleMethod = (props) => {
? <div className={styles.days}> ? <div className={styles.days}>
<div style={{margin: '0 20px 0 0px'}}>账期天数</div> <div style={{margin: '0 20px 0 0px'}}>账期天数</div>
<div> <div>
<Input <Input
addonAfter={"天"} addonAfter={"天"}
value={otherValues[DAY - 1]} value={otherValues[DAY - 1]}
onChange={(e) => handleInputChange(e.target.value, DAY)} onChange={(e) => handleInputChange(e.target.value, DAY)}
disabled={active !== DAY} disabled={active !== DAY}
style={{width: '160px'}} style={{width: '160px'}}
/></div> /></div>
</div> </div>
: <div className={styles.days}> : <div className={styles.days}>
<div style={{marginRight: '20px'}}>每月结算日期:每月</div> <div style={{marginRight: '20px'}}>每月结算日期:每月</div>
<div> <div>
<Input <Input
addonAfter={"号"} addonAfter={"号"}
style={{width: '160px'}} style={{width: '160px'}}
value={otherValues[MONTH - 1]} value={otherValues[MONTH - 1]}
onChange={(e) => handleInputChange(e.target.value, MONTH)} onChange={(e) => handleInputChange(e.target.value, MONTH)}
disabled={active !== MONTH} disabled={active !== MONTH}
/> />
</div> </div>
</div> </div>
} }
</div> </div>
<div>
{
!monthVisible && !daysVisible
? <div>请在pass平台配置结算方式,否则无法创建会员策略</div>
: null
}
</div>
</div> </div>
) )
} }
const Index = (props) => { const Index = (props) => {
const editable = props.editable;
const value = props.value || {active: 0, otherValues: [30, 1]}; const value = props.value || {active: 0, otherValues: [30, 1]};
const componentProps = props.props['x-component-props'] || {}; const componentProps = props.props['x-component-props'] || {};
const options = componentProps.options || {}; const options = componentProps.options || {};
...@@ -117,7 +114,7 @@ const Index = (props) => { ...@@ -117,7 +114,7 @@ const Index = (props) => {
// const componentProps = props.props['x-component-props'] || {}; // const componentProps = props.props['x-component-props'] || {};
const defaultValue = componentProps.default || {}; const defaultValue = componentProps.default || {};
if(!options.days && !options.month) { if(!options.days && !options.month) {
return return
} }
if(typeof props.initialValue == 'undefined') { if(typeof props.initialValue == 'undefined') {
props.mutators.change(defaultValue) props.mutators.change(defaultValue)
...@@ -129,16 +126,19 @@ const Index = (props) => { ...@@ -129,16 +126,19 @@ const Index = (props) => {
const onChange = (value) => { const onChange = (value) => {
props.mutators.change(value); props.mutators.change(value);
} }
if(!editable) {
return value.active == 1 ? `账期(默认), 账期天数${value.otherValues[0]}天 ` : `月结: 每月${value.otherValues[1]}号`
}
return ( return (
<SettleMethod <SettleMethod
value={value} value={value}
daysVisible={options.days} daysVisible={options.days}
monthVisible={options.month} monthVisible={options.month}
onChange={onChange} onChange={onChange}
/> />
) )
} }
Index.isFieldComponent = true; Index.isFieldComponent = true;
export default Index; export default Index;
\ No newline at end of file
...@@ -66,33 +66,42 @@ const MemberSettleAdd: React.FC = () => { ...@@ -66,33 +66,42 @@ const MemberSettleAdd: React.FC = () => {
const [submitLoading, setSubmitLoading ] = useState(false); const [submitLoading, setSubmitLoading ] = useState(false);
const [unsaved, setUnsaved] = useState(true); const [unsaved, setUnsaved] = useState(true);
const isAdd = !id && !preview; const isAdd = !id && !preview;
const isEdit = history.location.pathname.includes("edit");
const tableAddButton = () => { const tableAddButton = () => {
return ( return (
<div> <div>
<Button {
onClick={() => setVisible(true)} isAdd || isEdit
style={{marginBottom: 16}} ? (
block <Button
icon={<PlusOutlined/>} onClick={() => setVisible(true)}
type='dashed' style={{marginBottom: 16}}
> block
选择适用会员 icon={<PlusOutlined/>}
</Button> type='dashed'
>
选择适用会员
</Button>
)
: null
}
</div> </div>
) )
} }
const columns = common_columns.concat( const columns = common_columns.concat(
[ isAdd || isEdit
{ ? [
title: '操作', {
render: (text, record) => { title: '操作',
return ( render: (text, record) => {
<a onClick={() => handleRemove(record.uniqueId)}>删除</a> return (
) <div onClick={() => handleRemove(record.uniqueId)}>删除</div>
)
}
} }
} ]
] : []
); );
const handleCancelAddMember = () => { const handleCancelAddMember = () => {
...@@ -240,13 +249,16 @@ const MemberSettleAdd: React.FC = () => { ...@@ -240,13 +249,16 @@ const MemberSettleAdd: React.FC = () => {
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => window.history.back()} onBack={() => window.history.back()}
extra={[ extra={[
<Button loading={submitLoading} key="1" type="primary" onClick={handleClick} > (
保存 <Button loading={submitLoading} key="1" type="primary" onClick={handleClick} style={{display: isAdd || isEdit ? 'block' : 'none'}}>
</Button>, 保存
</Button>
)
]} ]}
> >
<Card> <Card>
<NiceForm <NiceForm
editable={isAdd || isEdit}
actions={formActions} actions={formActions}
initialValues={initialValue} initialValues={initialValue}
expressionScope={{ expressionScope={{
......
...@@ -13,7 +13,7 @@ import StatusSwitch from '@/components/StatusSwitch'; ...@@ -13,7 +13,7 @@ import StatusSwitch from '@/components/StatusSwitch';
import { createFormActions } from '@formily/antd'; import { createFormActions } from '@formily/antd';
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import { ColumnsType } from 'antd/es/table'; import { ColumnsType } from 'antd/es/table';
import { history } from 'umi'; import { history, Link } from 'umi';
import schema from './schema' import schema from './schema'
const formActions = createFormActions(); const formActions = createFormActions();
...@@ -68,6 +68,17 @@ const MemberSettle: React.FC<{}> = () => { ...@@ -68,6 +68,17 @@ const MemberSettle: React.FC<{}> = () => {
) )
} }
}, },
{
title: '操作',
render: (text, record) => {
if(record.status == 1) {
return null
}
return (
<Link to={`/ruleSettingManager/platformSettlementStrategy/edit?id=${record.id}`}>修改</Link>
)
}
},
] ]
const goToCreate = () => { const goToCreate = () => {
...@@ -93,7 +104,7 @@ const MemberSettle: React.FC<{}> = () => { ...@@ -93,7 +104,7 @@ const MemberSettle: React.FC<{}> = () => {
) )
}} }}
onSubmit={values => ref.current.reload(values)} onSubmit={values => ref.current.reload(values)}
schema={schema} schema={schema}
/> />
} }
...@@ -102,4 +113,4 @@ const MemberSettle: React.FC<{}> = () => { ...@@ -102,4 +113,4 @@ const MemberSettle: React.FC<{}> = () => {
) )
} }
export default MemberSettle export default MemberSettle
\ No newline at end of file
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