Commit bd2ab9ff authored by Bill's avatar Bill

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

parent 2c8bdd37
......@@ -91,6 +91,14 @@ const router = {
component: '@/pages/ruleSettingManage/platformSettlementStrategy/info',
hidePageHeader: true,
hideInMenu: true
},
// 平台结算策略配置, 平台策略配置编辑
{
path: '/ruleSettingManager/platformSettlementStrategy/edit',
name: 'platformSettlementStrategyDetailEdit',
component: '@/pages/ruleSettingManage/platformSettlementStrategy/info',
hidePageHeader: true,
hideInMenu: true
}
]
}
......
......@@ -112,6 +112,7 @@ export default {
'menu.ruleSettingManager.platformSettlementStrategy': '平台结算策略配置',
'menu.ruleSettingManager.addplatformSettlementStrategy': '新增平台结算策略',
'menu.ruleSettingManager.platformSettlementStrategyDetail': '平台结算策略详情',
'menu.ruleSettingManager.platformSettlementStrategyDetailEdit': '编辑平台结算策略',
// 品类和属性
'menu.classAndProperty': '平台品类及属性',
......
......@@ -15,4 +15,21 @@
font-weight: 500;
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'
import msg_platform from '@/asserts/msg_platform.png'
import moment from 'moment';
import { PublicApi } from '@/services/api'
import { BookOutlined, ReadOutlined } from '@ant-design/icons';
const Message: React.FC<{}> = () => {
const [dataSource, setDataSource] = useState<any>([])
const [pagation, setPagation] = useState({
const [pagination, setPagination] = useState({
current: 1,
pageSize: 10,
})
useEffect(() => {
// @ts-ignore
async function init() {
const data = await getList(pagation);
setDataSource(data);
}
init()
getList(pagination)
}, [])
const getList = async (params) => {
const res = await PublicApi.getReportMessagePlatformPage(params);
if(res.code === 1000) {
return res.data
const getList = (params) => {
PublicApi.getReportMessagePlatformPage(params).
then(({data, code}) => {
if(code === 1000) {
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) => {
//@ts-ignore
setPagation((state) => ({...state, current: page, pageSize: pageSize}))
getList({page, pageSize})
.then((data) => {
setDataSource(data);
})
const handleRead = (id, url: string) => {
console.log("当前功能还未开发")
// PublicApi.getReportMessageMemberRead({id: id})
// .then((data) => {
// if(url) {
// if(/http/.test(url)) {
// location.href = url
// } else {
// history.push(url);
// }
// } else {
// getList(pagination);
// }
// })
}
const renderMessage = (data) => {
return (
<>
<div onClick={() => handleRead(data.id, data.url)}>
<StatusTag type={data.type == 1 ? 'primary' : 'success'} title={data.type === 1 ? '系统消息' : '平台消息'} />
<span className={styles.messageTitle}>{data.title || ''}</span>
<span className={styles.messageText}>{data.content || ''}</span>
</>
</div>
)
}
......@@ -62,17 +67,18 @@ const Message: React.FC<{}> = () => {
return (
<PageHeaderWrapper>
<Card>
<p>
<div className={styles.header}>
<Button type="primary" icon={<PlusOutlined />} onClick={()=>history.push('/message/messageList/add')} >新建</Button>
</p>
<Button type="link" >全部已读</Button>
</div>
<List
itemLayout="horizontal"
dataSource={dataSource.data}
className={styles.customList}
pagination={{
onChange: handlePaginationChange,
current: pagation.current,
pageSize: pagation.pageSize,
current: pagination.current,
pageSize: pagination.pageSize,
size: "small",
showQuickJumper: true,
total: dataSource?.totalCount || 0,
......@@ -84,7 +90,16 @@ const Message: React.FC<{}> = () => {
avatar={<Avatar src={item.type == 1 ? msg_system : msg_platform} />}
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>
)}
/>
......
......@@ -43,7 +43,6 @@ const SettlementList = () => {
...params,
status: typeof params.status == 'undefined' ? 0 : params.status,
}
console.log(searchData);
const res = await PublicApi.getSettleAccountsPlatformSettlementPagePayableSettlement(searchData)
return res.data;
}
......@@ -106,7 +105,6 @@ const SettlementList = () => {
* @param params
*/
const handleUploadVoucher = (params: any) => {
console.log(params);
PublicApi.postSettleAccountsPlatformSettlementPay({id: params.id, proveList: params.fileList})
.then((data) => {
if(data.code === 1000) {
......
......@@ -40,14 +40,16 @@ export const schema: ISchema = {
type: 'string',
'x-component': 'DatePicker',
'x-component-props': {
allowClear: true
allowClear: true,
placeholder: '结算日期(开始时间)'
}
},
endTime: {
type: 'string',
'x-component': 'DatePicker',
'x-component-props': {
allowClear: true
allowClear: true,
placeholder: '结算日期(结束时间)'
}
},
status: {
......
......@@ -93,6 +93,7 @@ const ScoreInfo: React.FC = () => {
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
title={
<>
<PageHeader
......
......@@ -44,7 +44,6 @@ const SettlementList = () => {
...params,
status: typeof params.status == 'undefined' ? 0 : params.status,
}
console.log(searchData);
///settle/accounts/platform/score/settlement/pagePayableSettlement
const res = await PublicApi.getSettleAccountsPlatformScoreSettlementPagePayableSettlement(searchData)
return res.data;
......@@ -83,7 +82,7 @@ const SettlementList = () => {
{ text: '待对账', value: 1 },
{ text: '待付款', value: 2 },
{ text: '待收款', value: 3 },
{ text: '完成', value: 4 },
{ text: '完成', value: 4 },
],
onFilter: (value, record: any) => record.status == value,
render: (text, record: any) => {
......
......@@ -40,14 +40,17 @@ export const schema: ISchema = {
type: 'string',
'x-component': 'DatePicker',
'x-component-props': {
allowClear: true
allowClear: true,
placeholder: '结算日期(开始时间)'
}
},
endTime: {
type: 'string',
'x-component': 'DatePicker',
'x-component-props': {
allowClear: true
allowClear: true,
placeholder: '结算日期(结束时间)'
}
},
status: {
......
......@@ -51,6 +51,9 @@ const SettleMethod = (props) => {
otherValues: temp
})
}
if(!monthVisible && !daysVisible ) {
return null
}
return (
<div>
......@@ -96,19 +99,13 @@ const SettleMethod = (props) => {
</div>
}
</div>
<div>
{
!monthVisible && !daysVisible
? <div>请在pass平台配置结算方式,否则无法创建会员策略</div>
: null
}
</div>
</div>
)
}
const Index = (props) => {
const editable = props.editable;
const value = props.value || {active: 0, otherValues: [30, 1]};
const componentProps = props.props['x-component-props'] || {};
const options = componentProps.options || {};
......@@ -129,6 +126,9 @@ const Index = (props) => {
const onChange = (value) => {
props.mutators.change(value);
}
if(!editable) {
return value.active == 1 ? `账期(默认), 账期天数${value.otherValues[0]}天 ` : `月结: 每月${value.otherValues[1]}号`
}
return (
<SettleMethod
......
......@@ -66,9 +66,13 @@ const MemberSettleAdd: React.FC = () => {
const [submitLoading, setSubmitLoading ] = useState(false);
const [unsaved, setUnsaved] = useState(true);
const isAdd = !id && !preview;
const isEdit = history.location.pathname.includes("edit");
const tableAddButton = () => {
return (
<div>
{
isAdd || isEdit
? (
<Button
onClick={() => setVisible(true)}
style={{marginBottom: 16}}
......@@ -78,21 +82,26 @@ const MemberSettleAdd: React.FC = () => {
>
选择适用会员
</Button>
)
: null
}
</div>
)
}
const columns = common_columns.concat(
[
isAdd || isEdit
? [
{
title: '操作',
render: (text, record) => {
return (
<a onClick={() => handleRemove(record.uniqueId)}>删除</a>
<div onClick={() => handleRemove(record.uniqueId)}>删除</div>
)
}
}
]
: []
);
const handleCancelAddMember = () => {
......@@ -240,13 +249,16 @@ const MemberSettleAdd: React.FC = () => {
<PageHeaderWrapper
onBack={() => window.history.back()}
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>
<NiceForm
editable={isAdd || isEdit}
actions={formActions}
initialValues={initialValue}
expressionScope={{
......
......@@ -13,7 +13,7 @@ import StatusSwitch from '@/components/StatusSwitch';
import { createFormActions } from '@formily/antd';
import { PlusOutlined } from '@ant-design/icons';
import { ColumnsType } from 'antd/es/table';
import { history } from 'umi';
import { history, Link } from 'umi';
import schema from './schema'
const formActions = createFormActions();
......@@ -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 = () => {
......
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