Commit 587d9f2a authored by XieZhiXiong's avatar XieZhiXiong

fixbug

parent 91e12a92
......@@ -222,7 +222,7 @@ const MemberPr1: React.FC<{}> = props => {
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
rowKey: 'validateId',
}}
columns={columns}
currentRef={ref}
......
......@@ -222,7 +222,7 @@ const MemberPr2: React.FC<{}> = props => {
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
rowKey: 'validateId',
}}
columns={columns}
currentRef={ref}
......
......@@ -12,7 +12,7 @@ import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilte
import { FORM_FILTER_PATH } from '@/formSchema/const';
import { useAsyncInitSelect } from '@/formSchema/effects/useAsyncInitSelect';
import { PublicApi } from '@/services/api';
import { MEMBER_INNER_STATUS_SUCCESS } from '@/constants';
import { MEMBER_INNER_STATUS_FAILED } from '@/constants';
import { auditSchema } from '../schema/auditSchema';
import {
MEMBER_STATUS_TAG_MAP,
......@@ -126,7 +126,10 @@ const MemberPrConfirm: React.FC<{}> = props => {
setSelectedRowKeys(keys);
setSelectList(rows);
},
selectedRowKeys: selectedRowKeys,
selectedRowKeys: selectedRowKeys,
getCheckboxProps: record => ({
disabled: record.innerStatus === MEMBER_INNER_STATUS_FAILED,
}),
};
const fetchListData = async (params: any) => {
......@@ -225,7 +228,7 @@ const MemberPrConfirm: React.FC<{}> = props => {
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
rowKey: 'validateId',
}}
columns={columns}
currentRef={ref}
......
......@@ -222,7 +222,7 @@ const MemberPrSubmit: React.FC<{}> = props => {
<Card>
<StandardTable
tableProps={{
rowKey: 'memberId',
rowKey: 'validateId',
}}
columns={columns}
currentRef={ref}
......
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-07 16:33:12
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-23 19:44:24
* @LastEditTime: 2020-10-21 17:39:44
* @Description:
*/
import { ISchema } from '@formily/antd';
......@@ -70,17 +70,12 @@ export const channelSchema: ISchema = {
remark: {
type: 'string',
title: '渠道描述',
required: true,
'x-component': 'TextArea',
'x-component-props': {
rows: 5,
placeholder: '最大200个字符,100个汉字',
},
'x-rules': [
{
required: true,
message: '请填写渠道描述'
},
{
limitByte: true, // 自定义校验规则
maxByte: 200,
......
......@@ -2,9 +2,11 @@
* @Author: XieZhiXiong
* @Date: 2020-09-16 15:16:47
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-09-29 09:48:52
* @LastEditTime: 2020-10-21 19:09:27
* @Description: 联动逻辑相关
*/
import { Modal } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import { FormEffectHooks, FormPath } from '@formily/antd';
import { useLinkageUtils } from '@/utils/formEffectUtils';
import { useStateFilterSearchLinkageEffect } from '@/formSchema/effects/useFilterSearch';
......@@ -392,6 +394,51 @@ export const useBusinessEffects = (context, actions) => {
const { name, originAsyncData, value } = fieldState;
const current = originAsyncData.find(item => item.productId === value);
console.log('value', value)
// 取消选择
if (!value) {
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.productId`
}),
state => {
state.value = '';
}
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.productName`
}),
state => {
state.value = '';
}
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.price`
}),
state => {
state.value = '';
}
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.productCount`
}),
state => {
state.value = '';
}
);
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.amount`
}),
state => {
state.value = `¥0.00`;
}
);
}
if (!current) {
return;
}
......@@ -417,7 +464,7 @@ export const useBusinessEffects = (context, actions) => {
return `invoicesDetailsRequests.${$1}.price`
}),
state => {
state.value = current.price;
state.value = (current.price / current.purchaseCount).toFixed(2);
}
);
setFieldState(
......@@ -433,7 +480,7 @@ export const useBusinessEffects = (context, actions) => {
return `invoicesDetailsRequests.${$1}.amount`
}),
state => {
state.value = `¥${(1 * current.price).toFixed(2)}`;
state.value = `¥${(1 * (current.price / current.purchaseCount)).toFixed(2)}`;
}
);
});
......@@ -458,13 +505,22 @@ export const useBusinessEffects = (context, actions) => {
if (!current || isNaN(+value)) {
return;
}
if (value > current.purchaseCount) {
Modal.confirm({
title: '提示',
content: '单据数量已超过商品数量',
okText: '确认',
cancelText: '取消',
});
}
setFieldState(
FormPath.transform(name, /\d/, $1 => {
return `invoicesDetailsRequests.${$1}.amount`
}),
state => {
state.value = `¥${(+value * current.price).toFixed(2)}`;
state.value = `¥${(+value * (current.price / current.purchaseCount)).toFixed(2)}`;
}
);
});
......
......@@ -527,7 +527,7 @@ const AddBills: React.FC<{}> = (props: any) => {
product: undefined,
productName: item.productName,
productId: '',
price: 0,
price: '',
productCount: 0,
amount: '',
}));
......
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