Commit 8f9b88c5 authored by 皮倩雯's avatar 皮倩雯

fix: '添加台账添加编辑分组名不能未全部验证'

parent 1e35bbac
Pipeline #50881 skipped with stages
...@@ -50,44 +50,44 @@ const BookConfig = props => { ...@@ -50,44 +50,44 @@ const BookConfig = props => {
const onSubmit = () => { const onSubmit = () => {
form.validateFields().then(validate => { form.validateFields().then(validate => {
if (validate) { if (validate) {
// let aa = form.getFieldsValue().Name; let aa = form.getFieldsValue().Type;
// if (keepTableData.find(i => i.name == aa) && aa != formObj.name) { if (aa == '全部') {
// notification.warning({ notification.warning({
// message: '提示', message: '提示',
// duration: 3, duration: 3,
// description: '台账名称已存在', description: '分组名称不能为全部',
// }); });
// } else { } else {
let obj = let obj =
type === 'add' type === 'add'
? { ...validate, Order: maxLength } ? { ...validate, Order: maxLength }
: { ...validate, Order, ID: formObj.ID }; : { ...validate, Order, ID: formObj.ID };
GetCMLedger_OperateLedger(obj) GetCMLedger_OperateLedger(obj)
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
form.resetFields(); form.resetFields();
callBackSubmit(); callBackSubmit();
notification.success({ notification.success({
message: '提示', message: '提示',
duration: 3, duration: 3,
description: type === 'add' ? '新增成功' : '编辑成功', description: type === 'add' ? '新增成功' : '编辑成功',
}); });
} else { } else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
})
.catch(() => {
notification.error({ notification.error({
message: '提示', message: '提示',
duration: 3, duration: 3,
description: res.msg, description: '网络异常请稍后再试',
}); });
}
})
.catch(() => {
notification.error({
message: '提示',
duration: 3,
description: '网络异常请稍后再试',
}); });
}); }
// }
} }
}); });
}; };
......
...@@ -1213,9 +1213,11 @@ const AddModal = props => { ...@@ -1213,9 +1213,11 @@ const AddModal = props => {
return arrRslt; return arrRslt;
}; };
const inputType = e => { const inputType = value => {
setType1(e.target.value); console.log(value);
form.setFieldsValue({ BusinessType: e.target.value }); if (value) {
form.setFieldsValue({ BusinessType: value });
}
}; };
const onCancel = () => { const onCancel = () => {
setIsVisible(false); setIsVisible(false);
...@@ -1224,6 +1226,13 @@ const AddModal = props => { ...@@ -1224,6 +1226,13 @@ const AddModal = props => {
setIsVisibleEdit(false); setIsVisibleEdit(false);
}; };
// 搜索框监听
const onSearch = value => {
if (value) {
form.setFieldsValue({ TableName: value });
}
};
return ( return (
<Drawer <Drawer
title={type === 'add' ? '添加事件类型' : '编辑事件类型'} title={type === 'add' ? '添加事件类型' : '编辑事件类型'}
...@@ -1296,7 +1305,7 @@ const AddModal = props => { ...@@ -1296,7 +1305,7 @@ const AddModal = props => {
}, },
]} ]}
> >
<div> {/* <div>
<Input <Input
className="ue-editable-select-input" className="ue-editable-select-input"
onChange={inputType} onChange={inputType}
...@@ -1338,7 +1347,23 @@ const AddModal = props => { ...@@ -1338,7 +1347,23 @@ const AddModal = props => {
<DownOutlined style={{ fontSize: '12px', color: 'rgba(0, 0, 0, 0.25)' }} /> <DownOutlined style={{ fontSize: '12px', color: 'rgba(0, 0, 0, 0.25)' }} />
</div> </div>
</Dropdown> </Dropdown>
</div> </div> */}
<Select
placeholder="选择业务类型"
// onChange={inputType}
onSearch={inputType}
showSearch
style={{ marginLeft: '-3px' }}
>
{treeData
? treeData.map((item, index) => (
<Option key={index} value={item}>
{item}
</Option>
))
: ''}
</Select>
</Item> </Item>
</Col> </Col>
<Col span={24}> <Col span={24}>
...@@ -1356,6 +1381,8 @@ const AddModal = props => { ...@@ -1356,6 +1381,8 @@ const AddModal = props => {
<Select <Select
placeholder="选择事件主表" placeholder="选择事件主表"
onChange={changTable} onChange={changTable}
onSearch={onSearch}
showSearch
style={{ marginLeft: '-3px' }} style={{ marginLeft: '-3px' }}
> >
{standingTable {standingTable
......
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