Commit bd2ab9ff authored by Bill's avatar Bill

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

parent 2c8bdd37
...@@ -91,6 +91,14 @@ const router = { ...@@ -91,6 +91,14 @@ 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
} }
] ]
} }
......
...@@ -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': '平台品类及属性',
......
...@@ -15,4 +15,21 @@ ...@@ -15,4 +15,21 @@
font-weight: 500; font-weight: 500;
color: #303133; color: #303133;
} }
.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) => {
const getList = async (params) => { PublicApi.getReportMessagePlatformPage(params).
const res = await PublicApi.getReportMessagePlatformPage(params); then(({data, code}) => {
if(res.code === 1000) { if(code === 1000) {
return res.data setDataSource(data)
} }
return { })
totalCount: 0,
data: []
} }
const handlePaginationChange = (page, pageSize) => {
setPagination((state) => ({...state, current: page, pageSize: pageSize}))
getList({current: page, pageSize})
} }
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>
)} )}
/> />
......
...@@ -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) {
......
...@@ -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: {
......
...@@ -93,6 +93,7 @@ const ScoreInfo: React.FC = () => { ...@@ -93,6 +93,7 @@ const ScoreInfo: React.FC = () => {
return ( return (
<PageHeaderWrapper <PageHeaderWrapper
onBack={() => history.goBack()}
title={ title={
<> <>
<PageHeader <PageHeader
......
...@@ -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) => {
......
...@@ -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: {
......
...@@ -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>
...@@ -96,19 +99,13 @@ const SettleMethod = (props) => { ...@@ -96,19 +99,13 @@ const SettleMethod = (props) => {
</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 || {};
...@@ -129,6 +126,9 @@ const Index = (props) => { ...@@ -129,6 +126,9 @@ 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
......
...@@ -66,9 +66,13 @@ const MemberSettleAdd: React.FC = () => { ...@@ -66,9 +66,13 @@ 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>
{
isAdd || isEdit
? (
<Button <Button
onClick={() => setVisible(true)} onClick={() => setVisible(true)}
style={{marginBottom: 16}} style={{marginBottom: 16}}
...@@ -78,21 +82,26 @@ const MemberSettleAdd: React.FC = () => { ...@@ -78,21 +82,26 @@ const MemberSettleAdd: React.FC = () => {
> >
选择适用会员 选择适用会员
</Button> </Button>
)
: null
}
</div> </div>
) )
} }
const columns = common_columns.concat( const columns = common_columns.concat(
[ isAdd || isEdit
? [
{ {
title: '操作', title: '操作',
render: (text, record) => { render: (text, record) => {
return ( return (
<a onClick={() => handleRemove(record.uniqueId)}>删除</a> <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 = () => {
......
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