Merge branch 'develop' of ssh://code.juyouwu.cn:2222/pay/pay-admin into develop

* 'develop' of ssh://code.juyouwu.cn:2222/pay/pay-admin:
  fix:岗位调整
This commit is contained in:
zsqtony 2025-07-01 16:23:06 +08:00
commit aa49d82c16
6 changed files with 42 additions and 123 deletions

View File

@ -16,7 +16,7 @@ export default function Organizations(props: MyBetaModalFormProps) {
<> <>
<ProTable <ProTable
{...MyProTableProps.props} {...MyProTableProps.props}
search={false} // search={false}
request={async (params, sort) => request={async (params, sort) =>
MyProTableProps.request( MyProTableProps.request(
{ ...params, companies_id: props?.item?.id }, { ...params, companies_id: props?.item?.id },
@ -34,28 +34,34 @@ export default function Organizations(props: MyBetaModalFormProps) {
]} ]}
options={false} options={false}
columns={[ columns={[
MyColumns.ID(), {
title: '组织ID',
dataIndex: 'id',
search: false,
},
{ {
title: '上级组织', title: '上级组织',
dataIndex: ['organization_parent', 'name'], dataIndex: ['organization_parent', 'name'],
search: false,
}, },
{ {
title: '组织', title: '组织名称',
dataIndex: 'name', dataIndex: 'name',
}, },
MyColumns.EnumTag({ MyColumns.EnumTag({
title: '类型', title: '组织类型',
dataIndex: 'type', dataIndex: 'type',
valueEnum: OrganizationsTypeEnum, valueEnum: OrganizationsTypeEnum,
search: false,
}), }),
{ // {
title: '负责人', // title: '负责人',
dataIndex: ['manager', 'name'], // dataIndex: ['manager', 'name'],
}, // },
{ // {
title: '联系电话', // title: '联系电话',
dataIndex: 'manager_phone', // dataIndex: 'manager_phone',
}, // },
MyColumns.Option({ MyColumns.Option({
render: (_, item: any, index, action) => ( render: (_, item: any, index, action) => (

View File

@ -7,7 +7,8 @@ import {
import { Apis } from '@/gen/Apis'; import { Apis } from '@/gen/Apis';
import { ProTable } from '@ant-design/pro-components'; import { ProTable } from '@ant-design/pro-components';
import { Space } from 'antd'; import { Space } from 'antd';
import OrganizationsCreate from '../modals/OrganizationsCreate'; import PositionsCreate from '../modals/PositionsCreate';
import PositionsUpdate from '../modals/PositionsUpdate';
export default function Organizations(props: MyBetaModalFormProps) { export default function Organizations(props: MyBetaModalFormProps) {
return ( return (
@ -23,14 +24,14 @@ export default function Organizations(props: MyBetaModalFormProps) {
) )
} }
toolBarRender={(action) => [ toolBarRender={(action) => [
<OrganizationsCreate <PositionsCreate
key="Create" key="Create"
reload={action?.reload} reload={action?.reload}
item={props?.item} item={props?.item}
title="组织" title="组织"
/>, />,
]} ]}
options={false} // options={false}
columns={[ columns={[
MyColumns.ID(), MyColumns.ID(),
@ -58,11 +59,15 @@ export default function Organizations(props: MyBetaModalFormProps) {
MyColumns.Option({ MyColumns.Option({
render: (_, item: any, index, action) => ( render: (_, item: any, index, action) => (
<Space key={index}> <Space key={index}>
{/* <Update item={item} reload={action?.reload} title={title} /> */} <PositionsUpdate
item={item}
reload={action?.reload}
title="岗位"
/>
<MyButtons.Delete <MyButtons.Delete
onConfirm={() => onConfirm={() =>
Apis.Common.Admins.Delete({ id: item.id }).then(() => Apis.Company.CompanyPositions.Delete({ id: item.id }).then(
action?.reload(), () => action?.reload(),
) )
} }
/> />

View File

@ -4,7 +4,6 @@ import {
MyModalFormProps, MyModalFormProps,
rulesHelper, rulesHelper,
} from '@/common'; } from '@/common';
import { Selects } from '@/components/Select';
import { Apis } from '@/gen/Apis'; import { Apis } from '@/gen/Apis';
import { BetaSchemaForm } from '@ant-design/pro-components'; import { BetaSchemaForm } from '@ant-design/pro-components';
import { message } from 'antd'; import { message } from 'antd';
@ -13,12 +12,15 @@ export default function Create(props: MyBetaModalFormProps) {
return ( return (
<BetaSchemaForm<ApiTypes.Company.CompanyPositions.Store> <BetaSchemaForm<ApiTypes.Company.CompanyPositions.Store>
{...MyModalFormProps.props} {...MyModalFormProps.props}
title={`添加${props.title}`} title={`添加岗位`}
wrapperCol={{ span: 24 }} wrapperCol={{ span: 24 }}
width="500px" width="500px"
trigger={<MyButtons.Create title={`添加${props.title}`} />} trigger={<MyButtons.Create title={`添加岗位`} />}
onFinish={async (values) => onFinish={async (values) =>
Apis.Company.CompanyPositions.Store(values) Apis.Company.CompanyPositions.Store({
...values,
companies_id: props?.item?.id,
})
.then(() => { .then(() => {
props.reload?.(); props.reload?.();
message.success(props.title + '成功'); message.success(props.title + '成功');
@ -27,11 +29,11 @@ export default function Create(props: MyBetaModalFormProps) {
.catch(() => false) .catch(() => false)
} }
columns={[ columns={[
Selects?.Companies({ // Selects?.Companies({
title: '机构', // title: '机构',
key: 'companies_id', // key: 'companies_id',
formItemProps: { ...rulesHelper.text }, // formItemProps: { ...rulesHelper.text },
}), // }),
{ {
key: 'name', key: 'name',
title: '岗位名称', title: '岗位名称',

View File

@ -5,7 +5,6 @@ import {
rulesHelper, rulesHelper,
} from '@/common'; } from '@/common';
import { Selects } from '@/components/Select';
import { Apis } from '@/gen/Apis'; import { Apis } from '@/gen/Apis';
import { BetaSchemaForm } from '@ant-design/pro-components'; import { BetaSchemaForm } from '@ant-design/pro-components';
import { Form, message } from 'antd'; import { Form, message } from 'antd';
@ -21,14 +20,13 @@ export default function Update(props: MyBetaModalFormProps) {
form={form} form={form}
onOpenChange={(open: any) => { onOpenChange={(open: any) => {
if (open && props.item) { if (open && props.item) {
form.setFieldsValue({ form.setFieldsValue(props.item);
...props.item,
});
} }
}} }}
onFinish={async (values) => onFinish={async (values) =>
Apis.Company.CompanyPositions.Update({ Apis.Company.CompanyPositions.Update({
...values, ...values,
companies_id: props?.item?.companies_id,
id: props.item?.id ?? 0, id: props.item?.id ?? 0,
}) })
.then(() => { .then(() => {
@ -39,11 +37,6 @@ export default function Update(props: MyBetaModalFormProps) {
.catch(() => false) .catch(() => false)
} }
columns={[ columns={[
Selects?.Companies({
title: '机构',
key: 'companies_id',
formItemProps: { ...rulesHelper.text },
}),
{ {
key: 'name', key: 'name',
title: '岗位名称', title: '岗位名称',

View File

@ -1,25 +0,0 @@
import { MyPageContainer, MyProTableProps } from '@/common';
import { Apis } from '@/gen/Apis';
import { ProTable } from '@ant-design/pro-components';
import Create from './modals/Create';
export default function Index({ title = '岗位管理' }) {
return (
<MyPageContainer title={title}>
<ProTable
{...MyProTableProps.props}
// search={false}
request={async (params, sort) =>
MyProTableProps.request(
params,
sort,
Apis.Company.CompanyPositions.List,
)
}
toolBarRender={(action) => [
<Create key="Create" reload={action?.reload} title={title} />,
]}
/>
</MyPageContainer>
);
}

View File

@ -1,62 +0,0 @@
import {
MyBetaModalFormProps,
MyButtons,
MyModalFormProps,
rulesHelper,
} from '@/common';
import { Selects } from '@/components/Select';
import { Apis } from '@/gen/Apis';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { message } from 'antd';
export default function Create(props: MyBetaModalFormProps) {
return (
<BetaSchemaForm<ApiTypes.Company.CompanyPositions.Store>
{...MyModalFormProps.props}
title={`添加${props.title}`}
wrapperCol={{ span: 24 }}
width="500px"
trigger={<MyButtons.Create title={`添加${props.title}`} />}
onFinish={async (values) =>
Apis.Company.CompanyPositions.Store(values)
.then(() => {
props.reload?.();
message.success(props.title + '成功');
return true;
})
.catch(() => false)
}
columns={[
Selects?.Companies({
title: '机构',
key: 'companies_id',
formItemProps: { ...rulesHelper.text },
}),
{
key: 'name',
title: '岗位名称',
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
},
{
key: 'code',
title: '岗位编号',
colProps: { span: 12 },
// formItemProps: { ...rulesHelper.text },
},
// {
// key: 'sort',
// title: '岗位排序',
// colProps: { span: 24 },
// valueType: 'number',
// },
{
key: 'remark',
title: '备注',
colProps: { span: 24 },
valueType: 'textarea',
},
]}
/>
);
}