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

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

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