Commit f262b256 authored by Bill's avatar Bill
parents 7164a1cd 1faf6ec5
...@@ -117,6 +117,7 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -117,6 +117,7 @@ const MemberDetail: React.FC<{}> = () => {
}), }),
}); });
const actionRef = useRef<any>({}); const actionRef = useRef<any>({});
const formInitValue = nodeRecord ? getButtonAuth(nodeRecord.key) : {}; const formInitValue = nodeRecord ? getButtonAuth(nodeRecord.key) : {};
const [errors, setErrors] = useState<boolean>(false); const [errors, setErrors] = useState<boolean>(false);
...@@ -126,7 +127,7 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -126,7 +127,7 @@ const MemberDetail: React.FC<{}> = () => {
const [buttonInfos, setButtonInfos] = useState<any>([]); const [buttonInfos, setButtonInfos] = useState<any>([]);
// 储存的数据权限选项 // 储存的数据权限选项
const [authInfos, setAuthInfos] = useState<any>({}); const [authInfos, setAuthInfos] = useState<any>({});
const [plateformTreeList, setplateformTreeList] = useState<any>([])
// 存储默认勾选的id // 存储默认勾选的id
const [checkIds, setcheckIds] = useState<any>({}); const [checkIds, setcheckIds] = useState<any>({});
const modalRef = useRef<any>({}) const modalRef = useRef<any>({})
...@@ -157,6 +158,11 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -157,6 +158,11 @@ const MemberDetail: React.FC<{}> = () => {
menuId: node ? node.id : nodeRecord.id, menuId: node ? node.id : nodeRecord.id,
...params, ...params,
}); });
if (!isAdd && data.orgIds) {
let plateformTreeDataList = mapkey(plateformTreeData, data.orgIds)
setplateformTreeList(plateformTreeDataList)
}
setButtonAuth(node.id, data); setButtonAuth(node.id, data);
// 该配置由pass平台控制, 如果为1 则表示该角色可以配置数据权限 // 该配置由pass平台控制, 如果为1 则表示该角色可以配置数据权限
...@@ -382,12 +388,33 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -382,12 +388,33 @@ const MemberDetail: React.FC<{}> = () => {
</Space> </Space>
); );
const mapkey = (plateformTreeData: any, selectKeys: any) => {
let plateformTreeDataList = [];
plateformTreeData.map((item: any) => {
if (selectKeys.includes(item.id)) {
plateformTreeDataList.push(
{
id: item.id,
title: item.title
}
)
if (item.children) {
const arr = mapkey(item.children, selectKeys)
plateformTreeDataList = [...plateformTreeDataList, ...arr];
}
}
})
return plateformTreeDataList
}
const handleOrgSuccess = selectKeys => { const handleOrgSuccess = selectKeys => {
console.log(selectKeys, 'selectKeys') // console.log(selectKeys, 'selectKeys')
if (!dataId.includes(nodeRecord.id)) { if (!dataId.includes(nodeRecord.id)) {
dataId.push(nodeRecord.id) dataId.push(nodeRecord.id)
setdataId(dataId) setdataId(dataId)
} }
// console.log(dataId)
setAuthInfos({ setAuthInfos({
...authInfos, ...authInfos,
[nodeRecord.id]: Object.assign( [nodeRecord.id]: Object.assign(
...@@ -395,6 +422,9 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -395,6 +422,9 @@ const MemberDetail: React.FC<{}> = () => {
{ orgIds: selectKeys }, { orgIds: selectKeys },
), ),
}); });
let plateformTreeDataList = mapkey(plateformTreeData, selectKeys)
setplateformTreeList(plateformTreeDataList)
// console.log(plateformTreeDataList, 'plateformTreeData')
setOrgModalVisible(false); setOrgModalVisible(false);
}; };
const handleOrgCancel = () => { const handleOrgCancel = () => {
...@@ -507,17 +537,21 @@ const MemberDetail: React.FC<{}> = () => { ...@@ -507,17 +537,21 @@ const MemberDetail: React.FC<{}> = () => {
</Checkbox> </Checkbox>
<div style={{ marginTop: 16 }}> <div style={{ marginTop: 16 }}>
<p style={{ color: '#909399' }}>{intl.formatMessage({ id: 'authConfig.OrganizationAuthorization' })}</p> <p style={{ color: '#909399' }}>{intl.formatMessage({ id: 'authConfig.OrganizationAuthorization' })}</p>
{disabledCheckAuthConfig.orgIds.map(v => { {plateformTreeList.map(v => {
const node = getTreeNode(plateformTreeData, v); //
if (!node || !node.id) return null; // {disabledCheckAuthConfig.orgIds.map(v => {
// const node = getTreeNode(plateformTreeData, v);
// // console.log(node, '1111')
// if (!node || !node.id) return null;
return ( return (
<div className="org-tag-container" key={node.id}> <div className="org-tag-container" key={v.id}>
<Tag color={'#F4F5F7'} className="org-tag"> <Tag color={'#F4F5F7'} className="org-tag">
{node.title} {v.title}
</Tag> </Tag>
</div> </div>
); );
})} })}
<Button block type="dashed" onClick={handleOpenOrg}> <Button block type="dashed" onClick={handleOpenOrg}>
<PlusOutlined /> {intl.formatMessage({ id: 'authConfig.orientation' })} <PlusOutlined /> {intl.formatMessage({ id: 'authConfig.orientation' })}
</Button> </Button>
......
...@@ -70,8 +70,8 @@ const SearchDetail = () => { ...@@ -70,8 +70,8 @@ const SearchDetail = () => {
}, },
{ {
col: [ col: [
{ label: intl.formatMessage({ id: 'balance.shoukuanfang' }), extra: data.payer, type: 'text' }, { label: intl.formatMessage({ id: 'balance.shoukuanfang' }), extra: data.payee, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.fukuanfang' }), extra: data.payee, type: 'text' }, { label: intl.formatMessage({ id: 'balance.fukuanfang' }), extra: data.payer, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.faqiduizhangfang' }), extra: data.launchReconciliation, type: 'text' }, { label: intl.formatMessage({ id: 'balance.faqiduizhangfang' }), extra: data.launchReconciliation, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.duizhangzongjine' }), extra: ${priceFormat(data.reconciliationMoneyAmount)}`, type: 'text' }, { label: intl.formatMessage({ id: 'balance.duizhangzongjine' }), extra: ${priceFormat(data.reconciliationMoneyAmount)}`, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.danjushijian' }), extra: data.createTime, type: 'text' }, { label: intl.formatMessage({ id: 'balance.danjushijian' }), extra: data.createTime, type: 'text' },
......
...@@ -25,6 +25,8 @@ const TABLINK = [ ...@@ -25,6 +25,8 @@ const TABLINK = [
{ id: 'fileLayout', title: intl.formatMessage({ id: 'balance.fujian' }), }, { id: 'fileLayout', title: intl.formatMessage({ id: 'balance.fujian' }), },
] ]
const reg = /(^[1-9]{1}[0-9]*$)|(^[0-9]*\.[0-9]{0,3}$)/
const Add = () => { const Add = () => {
const { const {
query: { query: {
...@@ -77,8 +79,34 @@ const Add = () => { ...@@ -77,8 +79,34 @@ const Add = () => {
} }
const basicFormCol = [ const basicFormCol = [
{ label: intl.formatMessage({ id: 'balance.danjuzhaiyao' }), name: 'reconciliationAbstract', placeholder: '请输入对账单摘要', maxLength: 60, rules: [{ required: true, message: '请输入对账单摘要' }] }, {
{ label: intl.formatMessage({ id: 'balance.beizhu' }), name: 'remark', placeholder: '请输入对备注', maxLength: 120 }, label: intl.formatMessage({ id: 'balance.danjuzhaiyao' }), name: 'reconciliationAbstract', placeholder: '请输入对账单摘要', rules: [{ required: true, message: '请输入对账单摘要' }, {
validator: (_, value) => {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > 30 * 2) {
return Promise.reject(new Error(`最长60个字符,30个汉字`))
} else {
return Promise.resolve();
}
}
}]
},
{
label: intl.formatMessage({ id: 'balance.beizhu' }), name: 'remark', placeholder: '请输入对备注', rules: [
{
validator: (_, value) => {
let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (value.length > 60 * 2) {
return Promise.reject(new Error(`最长120个字符`))
} else {
return Promise.resolve();
}
}
}
]
},
] ]
const basicFormColRight = [ const basicFormColRight = [
...@@ -257,7 +285,13 @@ const Add = () => { ...@@ -257,7 +285,13 @@ const Add = () => {
{ required: true, message: intl.formatMessage({ id: 'balance.qingshuruduizhangshuliang' }) }, { required: true, message: intl.formatMessage({ id: 'balance.qingshuruduizhangshuliang' }) },
{ {
validator: (_, value) => { validator: (_, value) => {
return value > record.reconciliationQuantity ? Promise.reject(new Error('不能大于待对账数量')) : Promise.resolve() if (!reg.test(value)) {
return Promise.reject(new Error('数量需要大于0'))
}
if(value > record.reconciliationQuantity){
return Promise.reject(new Error('不能大于待对账数量'))
}
return Promise.resolve()
} }
}, },
]} ]}
...@@ -371,7 +405,7 @@ const Add = () => { ...@@ -371,7 +405,7 @@ const Add = () => {
<Form.Item <Form.Item
{...item} {...item}
> >
{_editAble ? <Input placeholder={item.placeholder} maxLength={item.maxLength} /> : dataSource[item.name]} {_editAble ? <Input placeholder={item.placeholder} /> : dataSource[item.name]}
</Form.Item> </Form.Item>
</Col> </Col>
))} ))}
......
...@@ -148,6 +148,10 @@ const ReadyReconciliation: React.FC = () => { ...@@ -148,6 +148,10 @@ const ReadyReconciliation: React.FC = () => {
key: 'receiveQuantity', key: 'receiveQuantity',
dataIndex: 'receiveQuantity', dataIndex: 'receiveQuantity',
}, { }, {
title: '已对账数量',
key: 'reconciledQuantity',
dataIndex: 'reconciledQuantity',
}, {
title: intl.formatMessage({ id: 'balance.yiduizhangjine' }), title: intl.formatMessage({ id: 'balance.yiduizhangjine' }),
key: 'reconciledMoney', key: 'reconciledMoney',
dataIndex: 'reconciledMoney', dataIndex: 'reconciledMoney',
......
...@@ -138,7 +138,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => { ...@@ -138,7 +138,7 @@ const ModalOperate: React.FC<IProps> = (props: any) => {
let _str = value; let _str = value;
_str = _str.replace(/[\u4E00-\u9FA5]/g, "AA"); _str = _str.replace(/[\u4E00-\u9FA5]/g, "AA");
if (_str.length > maxNumber * 2) { if (_str.length > maxNumber * 2) {
return { type: 'error', message: `${intl.formatMessage({ id: 'detail.purchase.tips19' })}${maxNumber * 2}${intl.formatMessage({ id: 'detail.purchase.tips20' })},${maxNumber}${intl.formatMessage({ id: 'detail.purchase.tips18' })}` }; return { type: 'error', message: `最长${maxNumber * 2}个字符,${maxNumber}个汉字` };
} else { } else {
return null; return null;
} }
......
...@@ -79,8 +79,8 @@ const SearchDetail = () => { ...@@ -79,8 +79,8 @@ const SearchDetail = () => {
}, },
{ {
col: [ col: [
{ label: intl.formatMessage({ id: 'balance.shoukuanfang' }), extra: data.payer, type: 'text' }, { label: intl.formatMessage({ id: 'balance.shoukuanfang' }), extra: data.payee, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.fukuanfang' }), extra: data.payee, type: 'text' }, { label: intl.formatMessage({ id: 'balance.fukuanfang' }), extra: data.payer, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.faqiduizhangfang' }), extra: data.launchReconciliation, type: 'text' }, { label: intl.formatMessage({ id: 'balance.faqiduizhangfang' }), extra: data.launchReconciliation, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.duizhangzongjine' }), extra: ${priceFormat(data.reconciliationMoneyAmount)}`, type: 'text' }, { label: intl.formatMessage({ id: 'balance.duizhangzongjine' }), extra: ${priceFormat(data.reconciliationMoneyAmount)}`, type: 'text' },
{ label: intl.formatMessage({ id: 'balance.danjushijian' }), extra: data.createTime, type: 'text' }, { label: intl.formatMessage({ id: 'balance.danjushijian' }), extra: data.createTime, type: 'text' },
......
...@@ -78,7 +78,7 @@ const ReadyConfirm: React.FC = () => { ...@@ -78,7 +78,7 @@ const ReadyConfirm: React.FC = () => {
title: intl.formatMessage({ id: 'balance.caozuo' }), title: intl.formatMessage({ id: 'balance.caozuo' }),
key: 'operate', key: 'operate',
dataIndex: 'operate', dataIndex: 'operate',
render: (text: any, record: any) => <Link to={`readyConfirm/detail?id=${record.reconciliationId}&no=${text}`}>{intl.formatMessage({ id: 'balance.queren' })}</Link> render: (text: any, record: any) => <Link to={`readyConfirm/detail?id=${record.reconciliationId}&no=${record.reconciliationNo}`}>{intl.formatMessage({ id: 'balance.queren' })}</Link>
}]; }];
return ( return (
......
...@@ -43,6 +43,9 @@ const TABLINK = [ ...@@ -43,6 +43,9 @@ const TABLINK = [
{ id: 'billLayout', title: '请款明细' }, { id: 'billLayout', title: '请款明细' },
] ]
const reg = /(^[1-9]{1}[0-9]*$)|(^[0-9]*\.[0-9]{0,3}$)/
const createMonthOrDays = (number: number, type: string) => { const createMonthOrDays = (number: number, type: string) => {
let _list = []; let _list = [];
for (let i = 1; i <= number; i++) { for (let i = 1; i <= number; i++) {
...@@ -510,6 +513,9 @@ const Add = () => { ...@@ -510,6 +513,9 @@ const Add = () => {
rules={[ rules={[
{ {
validator: (_, value) => { validator: (_, value) => {
if (!reg.test(value)) {
return Promise.reject(new Error('请款金额需要大于0'))
}
if (value > (record.billAmount - record.paid - record.appliedUnpaid)) { if (value > (record.billAmount - record.paid - record.appliedUnpaid)) {
return Promise.reject(new Error('请款金额不能超过单据金额减去已付款及已请款待付款的和')) return Promise.reject(new Error('请款金额不能超过单据金额减去已付款及已请款待付款的和'))
} }
......
...@@ -16,6 +16,8 @@ interface WriteOffDrawerProps { ...@@ -16,6 +16,8 @@ interface WriteOffDrawerProps {
onOk?: (rows: any[]) => void onOk?: (rows: any[]) => void
} }
const intl = getIntl(); const intl = getIntl();
const reg = /(^[1-9]{1}[0-9]*$)|(^[0-9]*\.[0-9]{0,3}$)/
const WriteOffDrawer: React.FC<WriteOffDrawerProps> = (props: WriteOffDrawerProps) => { const WriteOffDrawer: React.FC<WriteOffDrawerProps> = (props: WriteOffDrawerProps) => {
const { visible, record, editAble = false, onClose, onOk } = props; const { visible, record, editAble = false, onClose, onOk } = props;
const ref = useRef<any>({}) const ref = useRef<any>({})
...@@ -119,7 +121,10 @@ const WriteOffDrawer: React.FC<WriteOffDrawerProps> = (props: WriteOffDrawerProp ...@@ -119,7 +121,10 @@ const WriteOffDrawer: React.FC<WriteOffDrawerProps> = (props: WriteOffDrawerProp
rules={[ rules={[
{ {
validator: (_, value) => { validator: (_, value) => {
return value > record.canWriteAmount ? Promise.reject(new Error('可以核销金额')) : Promise.resolve() if (!reg.test(value)) {
return Promise.reject(new Error('本次核销金额需要大于0'))
}
return value > record.canWriteAmount ? Promise.reject(new Error('本次核销金额不能大于可以核销金额')) : Promise.resolve()
} }
}, },
]} ]}
......
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