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:
commit
aa49d82c16
@ -16,7 +16,7 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
<>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
// search={false}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{ ...params, companies_id: props?.item?.id },
|
||||
@ -34,28 +34,34 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
]}
|
||||
options={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '组织ID',
|
||||
dataIndex: 'id',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '上级组织',
|
||||
dataIndex: ['organization_parent', 'name'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '组织',
|
||||
title: '组织名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
title: '组织类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: OrganizationsTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '负责人',
|
||||
dataIndex: ['manager', 'name'],
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
dataIndex: 'manager_phone',
|
||||
},
|
||||
// {
|
||||
// title: '负责人',
|
||||
// dataIndex: ['manager', 'name'],
|
||||
// },
|
||||
// {
|
||||
// title: '联系电话',
|
||||
// dataIndex: 'manager_phone',
|
||||
// },
|
||||
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
|
||||
@ -7,7 +7,8 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
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) {
|
||||
return (
|
||||
@ -23,14 +24,14 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<OrganizationsCreate
|
||||
<PositionsCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
item={props?.item}
|
||||
title="组织"
|
||||
/>,
|
||||
]}
|
||||
options={false}
|
||||
// options={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
|
||||
@ -58,11 +59,15 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
{/* <Update item={item} reload={action?.reload} title={title} /> */}
|
||||
<PositionsUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="岗位"
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Common.Admins.Delete({ id: item.id }).then(() =>
|
||||
action?.reload(),
|
||||
Apis.Company.CompanyPositions.Delete({ id: item.id }).then(
|
||||
() => action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
|
||||
@ -4,7 +4,6 @@ import {
|
||||
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';
|
||||
@ -13,12 +12,15 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Company.CompanyPositions.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加${props.title}`}
|
||||
title={`添加岗位`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||
trigger={<MyButtons.Create title={`添加岗位`} />}
|
||||
onFinish={async (values) =>
|
||||
Apis.Company.CompanyPositions.Store(values)
|
||||
Apis.Company.CompanyPositions.Store({
|
||||
...values,
|
||||
companies_id: props?.item?.id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
@ -27,11 +29,11 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.Companies({
|
||||
title: '机构',
|
||||
key: 'companies_id',
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
// Selects?.Companies({
|
||||
// title: '机构',
|
||||
// key: 'companies_id',
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// }),
|
||||
{
|
||||
key: 'name',
|
||||
title: '岗位名称',
|
||||
|
||||
@ -5,7 +5,6 @@ import {
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
@ -21,14 +20,13 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue({
|
||||
...props.item,
|
||||
});
|
||||
form.setFieldsValue(props.item);
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Company.CompanyPositions.Update({
|
||||
...values,
|
||||
companies_id: props?.item?.companies_id,
|
||||
id: props.item?.id ?? 0,
|
||||
})
|
||||
.then(() => {
|
||||
@ -39,11 +37,6 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.Companies({
|
||||
title: '机构',
|
||||
key: 'companies_id',
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '岗位名称',
|
||||
@ -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>
|
||||
);
|
||||
}
|
||||
@ -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',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user