准入品类增加单位ID

This commit is contained in:
孙景学
2025-07-21 15:10:34 +08:00
parent 7baf43e21a
commit 5eb1e054bb

View File

@ -109,13 +109,17 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi
form.setFieldsValue({ accessWorkName: autoTitle });
}
};
//获取 cuCompanyNumber
const onChangeDepartmentSelect = (value: any, label: any, extra: any) => {
form.setFieldsValue({ orgId: extra?.triggerNode?.props.cuCompanyNumber });
}
// 提交
const onFinish = async (values: any) => {
const finalPayload: {
coscoAccessWork: {
accessWorkName: string;
deptId: string;
orgId: string;
};
categoryIds: string[];
supplierIds: string[];
@ -123,6 +127,7 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi
coscoAccessWork: {
accessWorkName: '',
deptId: '',
orgId: '',
},
categoryIds: [],
supplierIds: [],
@ -131,6 +136,8 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi
finalPayload.coscoAccessWork.accessWorkName = values.accessWorkName;
//准入部门
finalPayload.coscoAccessWork.deptId = values.deptId;
//准入单位
finalPayload.coscoAccessWork.orgId = values.orgId;
//品类选择
finalPayload.categoryIds = values.categoryIds;
//选择供应商
@ -207,9 +214,11 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi
name="deptId"
rules={[{ required: true, message: '请选择准入部门' }]}
>
<AccessDepartmentSelect style={{ width: '100%' }} orgCategory='' />
<AccessDepartmentSelect style={{ width: '100%' }} orgCategory='' onChange={onChangeDepartmentSelect} />
</Form.Item>
<Form.Item name="orgId" noStyle>
<Input type="hidden" />
</Form.Item>
<Form.Item
label="选择供应商"
@ -245,7 +254,7 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi
</Form.Item>
<Form.Item wrapperCol={{ offset: 6 }}>
<Button type="primary" htmlType="submit" style={{ marginRight: 8 }} disabled={submitting}>
<Button type="primary" htmlType="submit" style={{ marginRight: 8 }} disabled={submitting}>
</Button>
<Button