Commit 753056c2 authored by Bill's avatar Bill

fix: 修改结算bug 以及装修列表筛选条件bug

parent 6ed8575b
......@@ -19,10 +19,14 @@ registerValidationRules({
const pattern = /[0-9]+\.[0-9]*/;
if (active == MONTH) {
return !isNumber.test(otherValues[1]) || ((otherValues[1] < 0 || otherValues[1] > 31) || pattern.test(otherValues[1])) ? getIntl().formatMessage({ id: 'balance.components.settleMethod.registerValidationRules.1' }) : ''
return !isNumber.test(otherValues[1]) || ((otherValues[1] < 0 || otherValues[1] > 31) || pattern.test(otherValues[1]))
? getIntl().formatMessage({ id: 'balance.components.settleMethod.registerValidationRules.1' })
: ''
}
return !isNumber.test(otherValues[0]) || pattern.test(otherValues[0]) ? getIntl().formatMessage({ id: 'balance.components.settleMethod.registerValidationRules.2' }) : ""
return !isNumber.test(otherValues[0]) || pattern.test(otherValues[0])
? getIntl().formatMessage({ id: 'balance.components.settleMethod.registerValidationRules.2' })
: ""
}
})
......
......@@ -33,6 +33,12 @@ const { RangePicker } = DatePicker;
// 平台代收账款结算 - 收款方查看凭证 能力中心
const PLATFORM_BENEFICIARY = 3;
/** 保留三位小数,然后丢弃最后一位小数,因为 priceFormat 保留两位小数会直接进位*/
const fomatNumber = (number) => {
const string = priceFormat(number, 3);
return string.substring(0, string.length - 1);
}
const AccountReceivable = () => {
const intl = useIntl();
const ref = useRef<any>({})
......@@ -57,9 +63,10 @@ const AccountReceivable = () => {
{title: intl.formatMessage({id: 'balance.platformSettlement.accountReceivable.columns.settlementDate'}), dataIndex: 'settlementDate'},
{title: intl.formatMessage({id: 'balance.platformSettlement.accountReceivable.columns.settlementWayName'}), dataIndex: 'settlementWayName'},
{title: intl.formatMessage({id: 'balance.platformSettlement.accountReceivable.columns.totalCount'}), dataIndex: 'totalCount', render: (text) => numFormat(text)},
{title: intl.formatMessage({id: 'balance.platformSettlement.accountReceivable.columns.collectAmount'}), dataIndex: 'collectAmount', render: (text) => `¥${priceFormat(text)}`},
{title: intl.formatMessage({id: 'balance.platformSettlement.accountReceivable.columns.collectAmount'}), dataIndex: 'collectAmount', render: (text) => `¥${fomatNumber(text)}`},
{title: intl.formatMessage({id: 'balance.platformSettlement.accountReceivable.columns.brokerage'}), dataIndex: 'brokerage'},
{title: intl.formatMessage({id: 'balance.platformSettlement.accountReceivable.columns.amount'}), dataIndex: 'amount', render: (text) => `¥${priceFormat(text)}`},
{title: intl.formatMessage({id: 'balance.platformSettlement.accountReceivable.columns.amount'}), dataIndex: 'amount', render: (text) => `¥${fomatNumber(text)}`},
// {title: intl.formatMessage({id: 'balance.platformSettlement.accountReceivable.columns.settlementTime'}), dataIndex: 'settlementDate'},
{title: intl.formatMessage({id: 'balance.platformSettlement.accountReceivable.columns.settlementTime'}), dataIndex: 'settlementTime'},
{title: intl.formatMessage({id: 'balance.platformSettlement.accountReceivable.columns.payWayName'}), dataIndex: 'payWayName'},
{
......
.status {
:global {
.ant-btn {
padding: 0px;
}
}
}
\ No newline at end of file
/*
* @Author: Bill
* @Date: 2020-10-19 14:46:33
* @desc: 会员结算策略列表页
*/
import React, { useRef } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Card, Space, Button, Input } from 'antd';
......@@ -21,6 +15,7 @@ import {
postSettleAccountsPlatformConfigDeleteMemberSettlementStrategy,
postSettleAccountsPlatformConfigSetMemberSettlementStrategyStatus
} from '@/services/SettleV2Api';
import styles from './index.less';
const formActions = createFormActions();
......@@ -67,11 +62,13 @@ const MemberSettle: React.FC<{}> = () => {
dataIndex: 'status',
render: (text, record) => {
return (
<StatusSwitch
handleConfirm={() => handleModify(record)}
record={record}
fieldNames="status"
/>
<div className={styles.status}>
<StatusSwitch
handleConfirm={() => handleModify(record)}
record={record}
fieldNames="status"
/>
</div>
)
}
},
......
......@@ -156,7 +156,7 @@ const MemberSettleAdd: React.FC = () => {
}
// 提交
const handleSubmit = (value) => {
const handleSubmit = async (value) => {
const memberList = value.someLists.map((item) => (
{
memberId: item.memberId,
......@@ -184,16 +184,19 @@ const MemberSettleAdd: React.FC = () => {
if (!isAdd) {
postData = { ...postData, id: id };
}
// return;
setSubmitLoading(true);
setUnsaved(false);
serviceActions(postData).then((data) => {
setSubmitLoading(false);
if (data.code === 1000) {
history.push('/memberCenter/balance/settleRules/memberSettleList')
try {
setSubmitLoading(true);
setUnsaved(false);
const { data, code, message: msg } = await serviceActions(postData, { ctlType: 'none' });
if (code !== 1000) {
message.error(msg);
return;
}
})
history.push('/memberCenter/balance/settleRules/memberSettleList')
} finally {
setSubmitLoading(false);
}
}
// 提交
const handleClick = () => {
......
......@@ -8,9 +8,15 @@ type CheckboxType = {
extra?: number | string
}
type XcomponentProps = {
/** 是否是单选按钮 */
isRadio: boolean
}
interface Iprops {
props: {
enum: CheckboxType[]
enum: CheckboxType[],
'x-component-props': XcomponentProps
},
mutators: {
change: (params: number[] | string[]) => void
......@@ -21,10 +27,21 @@ interface Iprops {
const FormilyCheckBox: React.FC<Iprops> & { isFieldComponent: boolean } = (props: Iprops) => {
const { value = [], mutators } = props;
const componentProps = props.props || {};
const xComponentProps = componentProps['x-component-props'] || {} as XcomponentProps;
const isRadio = xComponentProps?.isRadio || false;
const enumsMap: CheckboxType[] = componentProps?.enum || [];
const handleChange = (isChecked: boolean, _item: CheckboxType) => {
let newList: string[] | number[] = []
let newList: string[] | number[] = [];
console.log(isChecked)
if (isRadio) {
if (isChecked) {
newList = [_item.value as string];
}
mutators.change(newList)
return;
}
if (isChecked) {
newList = (value as string[]).concat(_item.value as string);
} else {
......
......@@ -4,7 +4,7 @@ import { DatePicker } from '@formily/antd-components';
import schema from './schema';
import VerticalLayout from './layout';
import FormilyCheckBox from '../FormilyCheckBox';
import FormilyRadio from '@/pages/mobileTemplate/categoryNavigation/components/FormilyRadio';
// import FormilyRadio from '@/pages/mobileTemplate/categoryNavigation/components/FormilyRadio';
const actions = createFormActions();
......@@ -20,7 +20,7 @@ const SearchPannel: React.FC<Iprops> = (props: Iprops) => {
};
return (
<SchemaForm
components={{VerticalLayout, FormilyCheckBox, DatePicker, FormilyRadio}}
components={{VerticalLayout, FormilyCheckBox, DatePicker}}
actions={actions}
schema={schema}
onSubmit={handleSubmit}
......
......@@ -23,7 +23,10 @@ const schema: ISchema = {
status: {
type: 'string',
title: '',
"x-component": 'FormilyRadio',
"x-component": 'FormilyCheckBox',
"x-component-props": {
isRadio: true,
},
enum: [
{
label: `${intl.formatMessage({ id: 'activePage.readyOnline'})}`,
......@@ -86,7 +89,10 @@ const schema: ISchema = {
environment: {
type: 'string',
title: '',
"x-component": 'FormilyRadio',
"x-component": 'FormilyCheckBox',
"x-component-props": {
isRadio: true,
},
enum: [
{
label: 'WEB',
......
......@@ -44,10 +44,13 @@ const ActivePage = () => {
};
const onSearchChange = (values: SearchParamsType) => {
const { startTime, endTime, ...rest } = values;
const { startTime, endTime, status, environment, ...rest } = values;
console.log(values, "values");
const postData = {
startTime: startTime && moment(startTime, 'YYYY-MM-DD HH:mm:ss').valueOf() || null,
endTime: endTime && moment(endTime, 'YYYY-MM-DD HH:mm:ss').valueOf() || null,
status: status?.join(""),
environment: environment?.join(""),
...rest,
};
setSearchParams(postData as any);
......@@ -56,7 +59,7 @@ const ActivePage = () => {
const getData = async (params: GetTemplateWebActivityPagePageRequest) => {
setLoading(true);
/** 这里type = 2 是能力中心, 因为平台后台跟能力中心用的是同一个接口 */
const { data, code } = await getTemplateWebActivityPagePage({ ...params, type: 2 });
const { data, code } = await getTemplateWebActivityPagePage({ ...params, type: '2' });
setLoading(false);
if (code === 1000) {
setTotal(data.totalCount);
......
......@@ -144,7 +144,7 @@ class ApiRequest {
if (url != '/member/loginInfo') {
// 这是展示接口错误信息,任何 ctlType 都可以,不然一些 get 请求出错了
// 错误信息无法展示给用户
res.message && message.info(intl.formatMessage({ id: res.code, defaultMessage: res.message}))
res.message && options.ctlType === 'message' && message.info(intl.formatMessage({ id: res.code, defaultMessage: res.message}))
}
}
......
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