Commit bd2ab9ff authored by Bill's avatar Bill

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

parent 2c8bdd37
......@@ -54,7 +54,7 @@ const router = {
name: 'memberAuthManage',
component: '@/pages/ruleSettingManage/memberAuthManage',
},
// 设置会员角色
// 设置会员角色
{
path: '/ruleSettingManager/memberAuthManage/detail',
name: 'memberAuthManageDetail',
......@@ -62,7 +62,7 @@ const router = {
hideInMenu: true,
hidePageHeader: true
},
// 查看会员角色
// 查看会员角色
{
path: '/ruleSettingManager/memberAuthManage/preview',
name: 'memberAuthManageDetail',
......@@ -91,7 +91,15 @@ 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
}
]
}
export default router
\ No newline at end of file
export default router
......@@ -112,6 +112,7 @@ export default {
'menu.ruleSettingManager.platformSettlementStrategy': '平台结算策略配置',
'menu.ruleSettingManager.addplatformSettlementStrategy': '新增平台结算策略',
'menu.ruleSettingManager.platformSettlementStrategyDetail': '平台结算策略详情',
'menu.ruleSettingManager.platformSettlementStrategyDetailEdit': '编辑平台结算策略',
// 品类和属性
'menu.classAndProperty': '平台品类及属性',
......@@ -231,12 +232,12 @@ export default {
'menu.exchangeManage': '换货申请单管理',
'menu.exchangeManage.query': '换货申请单查询',
'menu.exchangeManage.queryDetail': '换货申请单详情',
// 维修管理
'menu.repairManage': '维修申请单管理',
'menu.repairManage.query': '维修申请单查询',
'menu.repairManage.queryDetail': '维修申请单详情',
// 退货管理
'menu.returnManage': '退货申请单管理',
'menu.returnManage.query': '退货申请单查询',
......@@ -244,6 +245,6 @@ export default {
'menu.returnManage.returnPrReturn': '待退款',
'menu.returnManage.returnPrReturnDetail': '待退款详情',
'menu.returnManage.prReturnVerify': '退款',
}
// export default utils.transformDataPre(data, 'menu')
......@@ -15,4 +15,21 @@
font-weight: 500;
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'
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 = (params) => {
PublicApi.getReportMessagePlatformPage(params).
then(({data, code}) => {
if(code === 1000) {
setDataSource(data)
}
})
}
const getList = async (params) => {
const res = await PublicApi.getReportMessagePlatformPage(params);
if(res.code === 1000) {
return res.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>
)}
/>
......@@ -93,4 +108,4 @@ const Message: React.FC<{}> = () => {
);
}
export default Message
\ No newline at end of file
export default Message
......@@ -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) {
......
......@@ -22,8 +22,8 @@ export const schema: ISchema = {
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索(结算方)',
align: 'flex-left',
tip: '输入 结算方 进行搜索',
align: 'flex-left',
tip: '输入 结算方 进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -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: {
......@@ -61,8 +63,8 @@ export const schema: ISchema = {
],
default: 0,
'x-component-props': {
placeholder: '结算状态(全部)',
allowClear: true,
placeholder: '结算状态(全部)',
allowClear: true,
},
},
submit: {
......@@ -141,9 +143,9 @@ export const detailSchema: ISchema = {
enum: orderTime,
default: 0,
'x-component-props': {
placeholder: '下单时间(全部)',
allowClear: true,
placeholder: '下单时间(全部)',
allowClear: true,
},
},
payTime: {
......@@ -151,8 +153,8 @@ export const detailSchema: ISchema = {
enum: payTime,
default: 0,
'x-component-props': {
placeholder: '支付时间(全部)',
allowClear: true,
placeholder: '支付时间(全部)',
allowClear: true,
},
},
submit: {
......@@ -169,4 +171,4 @@ export const detailSchema: ISchema = {
},
},
},
};
\ No newline at end of file
};
......@@ -21,7 +21,7 @@ interface VoucherFileProps {
interface Iprops {
fileList?: VoucherFileProps[],
id: number, // 结算方id
id: number, // 结算方id
getFileList: (params: any[]) => void
}
......@@ -51,7 +51,7 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => {
if(code == 1000) {
setAccountInfo(data);
}
}
}
getAccountInfo()
}, [props.id])
......@@ -123,7 +123,7 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => {
<div className={styles.upload}>
<Upload {...uploadProps}>
<Button icon={<UploadOutlined />}>上传凭证</Button>
<p className={styles.tips}>单个凭证文件大小不能超过200K</p>
<p className={styles.tips}>单个凭证文件大小不能超过200K</p>
</Upload>
</div>
......@@ -131,4 +131,4 @@ const UploadPayVoucher: React.FC<Iprops> = (props) => {
)
}
export default UploadPayVoucher;
\ No newline at end of file
export default UploadPayVoucher;
......@@ -34,7 +34,7 @@ const columns = [
{title: '支付积分', dataIndex: 'payScore'},
{title: '支付时间', dataIndex: 'payTime'},
{
title: '兑换比率',
title: '兑换比率',
dataIndex: 'ratio',
render: (text,record) => {
return (record.ratio + '%');
......@@ -83,37 +83,38 @@ const ScoreInfo: React.FC = () => {
const payTimeRange = payTime ? timeRange(values.payTime): null;
const payStartTime = payTimeRange ? moment(payTimeRange.st * 1000).format(format) : null;
const payEndTime = payTimeRange ? moment(payTimeRange.et * 1000).format(format) : null;
const orderTimeRange = orderTime ? timeRange(values.orderTime) : null;
const orderStartTime = orderTimeRange ? moment(orderTimeRange.st * 1000).format(format) : null;
const orderEndTime = orderTimeRange ? moment(orderTimeRange.et * 1000).format(format) : null;
ref.current.reload({...rest, payStartTime, payEndTime, orderStartTime, orderEndTime});
}
}
return (
<PageHeaderWrapper
onBack={() => history.goBack()}
title={
<>
<PageHeader
style={{ padding: '0' }}
onBack={() => history.goBack()}
title={
<AvatarWrap
<AvatarWrap
info={{
aloneTxt: '单',
name: "结算单号:"
}}
}}
extra={(
<span style={{ fontSize: 12, fontWeight: 'normal' }}>{infoDetail?.settlementNo}</span>
)}
/>
}
>
<Descriptions
column={3}
style={{
padding: '0 32px',
<Descriptions
column={3}
style={{
padding: '0 32px',
}}
>
<Descriptions.Item label="结算日期:">{infoDetail?.settlementDate}</Descriptions.Item>
......@@ -137,7 +138,7 @@ const ScoreInfo: React.FC = () => {
currentRef={ref}
fetchTableData={(params: any) => fetchListData(params)}
controlRender={
<NiceForm
<NiceForm
actions={formActions}
expressionScope={{
exportBtn: (
......@@ -164,4 +165,4 @@ const ScoreInfo: React.FC = () => {
)
}
export default ScoreInfo
\ No newline at end of file
export default ScoreInfo
......@@ -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) => {
......
......@@ -22,8 +22,8 @@ export const schema: ISchema = {
'x-component': 'Search',
'x-component-props': {
placeholder: '搜索(结算方)',
align: 'flex-left',
tip: '输入 结算方 进行搜索',
align: 'flex-left',
tip: '输入 结算方 进行搜索',
},
},
[FORM_FILTER_PATH]: {
......@@ -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: {
......@@ -61,8 +64,8 @@ export const schema: ISchema = {
],
default: 0,
'x-component-props': {
placeholder: '结算状态(全部)',
allowClear: true,
placeholder: '结算状态(全部)',
allowClear: true,
},
},
submit: {
......@@ -79,4 +82,4 @@ export const schema: ISchema = {
},
},
},
};
\ No newline at end of file
};
......@@ -16,7 +16,7 @@ const MONTH = 2;
registerValidationRules({
settleMethodRule: value => {
const { active, otherValues } = value;
const isNumber = /^\d+$/; // 数字
const pattern = /[0-9]+\.[0-9]*/;
if(active == MONTH) {
......@@ -33,7 +33,7 @@ const SettleMethod = (props) => {
const handleChange = (e, type) => {
if(active == type) {
return ;
}
}
const previewValue = otherValues
// setActive(type)
props.onChange({
......@@ -51,6 +51,9 @@ const SettleMethod = (props) => {
otherValues: temp
})
}
if(!monthVisible && !daysVisible ) {
return null
}
return (
<div>
......@@ -74,41 +77,35 @@ const SettleMethod = (props) => {
? <div className={styles.days}>
<div style={{margin: '0 20px 0 0px'}}>账期天数</div>
<div>
<Input
addonAfter={"天"}
value={otherValues[DAY - 1]}
onChange={(e) => handleInputChange(e.target.value, DAY)}
disabled={active !== DAY}
<Input
addonAfter={"天"}
value={otherValues[DAY - 1]}
onChange={(e) => handleInputChange(e.target.value, DAY)}
disabled={active !== DAY}
style={{width: '160px'}}
/></div>
</div>
: <div className={styles.days}>
<div style={{marginRight: '20px'}}>每月结算日期:每月</div>
<div>
<Input
addonAfter={"号"}
style={{width: '160px'}}
value={otherValues[MONTH - 1]}
onChange={(e) => handleInputChange(e.target.value, MONTH)}
<Input
addonAfter={"号"}
style={{width: '160px'}}
value={otherValues[MONTH - 1]}
onChange={(e) => handleInputChange(e.target.value, MONTH)}
disabled={active !== MONTH}
/>
</div>
</div>
</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 || {};
......@@ -117,7 +114,7 @@ const Index = (props) => {
// const componentProps = props.props['x-component-props'] || {};
const defaultValue = componentProps.default || {};
if(!options.days && !options.month) {
return
return
}
if(typeof props.initialValue == 'undefined') {
props.mutators.change(defaultValue)
......@@ -129,16 +126,19 @@ const Index = (props) => {
const onChange = (value) => {
props.mutators.change(value);
}
if(!editable) {
return value.active == 1 ? `账期(默认), 账期天数${value.otherValues[0]}天 ` : `月结: 每月${value.otherValues[1]}号`
}
return (
<SettleMethod
value={value}
daysVisible={options.days}
monthVisible={options.month}
<SettleMethod
value={value}
daysVisible={options.days}
monthVisible={options.month}
onChange={onChange}
/>
)
}
Index.isFieldComponent = true;
export default Index;
\ No newline at end of file
export default Index;
......@@ -66,33 +66,42 @@ 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>
<Button
onClick={() => setVisible(true)}
style={{marginBottom: 16}}
block
icon={<PlusOutlined/>}
type='dashed'
>
选择适用会员
</Button>
{
isAdd || isEdit
? (
<Button
onClick={() => setVisible(true)}
style={{marginBottom: 16}}
block
icon={<PlusOutlined/>}
type='dashed'
>
选择适用会员
</Button>
)
: null
}
</div>
)
}
const columns = common_columns.concat(
[
{
title: '操作',
render: (text, record) => {
return (
<a onClick={() => handleRemove(record.uniqueId)}>删除</a>
)
isAdd || isEdit
? [
{
title: '操作',
render: (text, record) => {
return (
<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>,
(
<Button loading={submitLoading} key="1" type="primary" onClick={handleClick} style={{display: isAdd || isEdit ? 'block' : 'none'}}>
保存
</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 = () => {
......@@ -93,7 +104,7 @@ const MemberSettle: React.FC<{}> = () => {
)
}}
onSubmit={values => ref.current.reload(values)}
schema={schema}
/>
}
......@@ -102,4 +113,4 @@ const MemberSettle: React.FC<{}> = () => {
)
}
export default MemberSettle
\ No newline at end of file
export default MemberSettle
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