From 07d1135a1913a919679dc23f0a38b9b61987171f Mon Sep 17 00:00:00 2001 From: zhongshujie <2862698242@qq.com> Date: 星期五, 01 八月 2025 15:29:37 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/OAManage --- src/pages/HumanResourceManagement/contractManagement/index.tsx | 6 src/pages/HumanResourceManagement/changeRequest/index.tsx | 16 src/components/ApplyIndex/components/staff.tsx | 99 + src/access.ts | 6 src/pages/HumanResourceManagement/compulsoryRetirementApplication/index.tsx | 273 ++++ src/pages/HumanResourceManagement/nominationForAppointment/index.tsx | 9 src/pages/organizationDesign/JobInformationConfiguration/index.tsx | 114 + src/services/WebApi/trainAssess.ts | 33 src/components/selectUser/index.tsx | 163 ++ src/pages/HumanResourceManagement/retirementManagement/index.tsx | 45 src/services/WebApi/trainOrg.ts | 63 src/pages/HumanResourceManagement/dismissalApplication/index.tsx | 8 src/pages/Welcome.tsx | 810 +++++++++-- src/pages/organizationDesign/departmentalEmployeeInformation/index.tsx | 389 +++++ src/pages/HumanResourceManagement/applicationForSecondment/index.tsx | 9 src/pages/organizationDesign/postInformationConfiguration/index.tsx | 97 + config/routes.ts | 401 ++++- src/components/ApplyIndex/components/apply.tsx | 37 src/pages/organizationDesign/jobLevelInformationConfiguration/index.tsx | 149 + src/pages/HumanResourceManagement/challengeForCause/index.tsx | 15 src/services/WebApi/trainFee.ts | 48 src/pages/organizationDesign/DepartmentalInformationConfiguration/index.tsx | 159 ++ src/components/selectUser/index.less | 4 src/services/WebApi/trainCourse.ts | 78 + src/services/WebApi/trainSchedule.ts | 48 src/pages/organizationDesign/departmentalEmployeeInformation/index.less | 23 src/services/WebApi/index.ts | 16 src/services/WebApi/trainRules.ts | 63 src/pages/organizationDesign/OrganizationalStructureConfiguration/index.tsx | 378 ++--- src/pages/HumanResourceManagement/resignationApplication/index.tsx | 19 src/app.tsx | 34 src/pages/HumanResourceManagement/compulsoryRetirementApplication/index.less | 0 src/services/WebApi/trainPlan.ts | 78 + src/services/WebApi/trainRequirement.ts | 63 src/services/WebApi/typings.d.ts | 225 +++ 35 files changed, 3,306 insertions(+), 672 deletions(-) diff --git a/config/routes.ts b/config/routes.ts index 2cc0277..f35f2e7 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -1,19 +1,28 @@ -锘縤mport { access } from "fs"; - -export default [ +锘縠xport default [ { - path: '/user', + path: "/user", layout: false, - routes: [{ name: '鐧诲綍', path: '/user/login', component: './User/Login' }], + routes: [{ name: "鐧诲綍", path: "/user/login", component: "./User/Login" }], }, - { path: '/welcome', name: '娆㈣繋', icon: 'smile', component: './Welcome' }, { - path: '/admin', - name: '绠$悊椤�', - icon: 'crown', + // layout: false, + path: "/welcome", + name: "娆㈣繋", + icon: "smile", + component: "./Welcome", + }, + { + path: "/admin", + name: "绠$悊椤�", + icon: "crown", routes: [ - { path: '/admin', redirect: '/admin/sub-page' }, - { path: '/admin/sub-page', access: 'canAdmin', name: '浜岀骇绠$悊椤�', component: './Admin' }, + { path: "/admin", redirect: "/admin/sub-page" }, + { + path: "/admin/sub-page", + access: "canAdmin", + name: "浜岀骇绠$悊椤�", + component: "./Admin", + }, ], }, // { @@ -33,108 +42,286 @@ // ], // }, { - path: '/myWork', - name: '鎴戠殑宸ヤ綔', - icon: 'crown', + path: "/myWork", + name: "鎴戠殑宸ヤ綔", + icon: "crown", routes: [ - { path: '/myWork', redirect: '/admin/sub-page' }, - { path: '/myWork/taskManagement', name: '浠诲姟绠$悊', component: './myWork/taskManagement' }, - { path: '/myWork/AnnouncementManagement', name: '鍏憡绠$悊', component: './Admin' }, - { path: '/myWork/messageManagement', name: '娑堟伅绠$悊', component: './Admin' }, - ], - }, - { - path: '/organizationDesign', - name: '缁勭粐璁捐', - icon: 'crown', - routes: [ - { path: '/organizationDesign', redirect: '/admin/sub-page' }, - { path: '/organizationDesign/OrganizationalStructureConfiguration', name: '缁勭粐鏈烘瀯閰嶇疆', component: './organizationDesign/OrganizationalStructureConfiguration' }, - { path: '/organizationDesign/DepartmentalInformationConfiguration', name: '閮ㄩ棬淇℃伅閰嶇疆', component: './organizationDesign/DepartmentalInformationConfiguration' }, - { path: '/organizationDesign/JobInformationConfiguration', name: '鑱屼綅淇℃伅閰嶇疆', component: './organizationDesign/JobInformationConfiguration' }, - { path: '/organizationDesign/jobLevelInformationConfiguration', name: '鑱岀骇淇℃伅閰嶇疆', component: './organizationDesign/jobLevelInformationConfiguration' }, - { path: '/organizationDesign/postInformationConfiguration', name: '宀椾綅淇℃伅閰嶇疆', component: './organizationDesign/postInformationConfiguration' }, - { path: '/organizationDesign/departmentalEmployeeInformation', name: '閮ㄩ棬鍛樺伐淇℃伅', component: './Admin' }, - { path: '/organizationDesign/organizationChart', name: '缁勭粐缁撴瀯鍥�', component: './Admin' }, - { path: '/organizationDesign/organizationalStructureChanges', name: '缁勭粐缁撴瀯鍙樿縼', component: './Admin' }, - ], - }, - { - path: '/humanResourcePlanning', - name: '浜哄姏璧勬簮瑙勫垝', - icon: 'crown', - routes: [ - { path: '/humanResourcePlanning', redirect: '/admin/sub-page' }, - { path: '/humanResourcePlanning/organizationalStrategyFormulation', name: '缁勭粐鎴樼暐鍒跺畾', component: './humanResourcePlanning/organizationalStrategyFormulation' }, - { path: '/humanResourcePlanning/personnelRequirementAnalysis', name: '浜哄憳闇�姹傚垎鏋�', component: './humanResourcePlanning/personnelRequirementAnalysis' }, - { path: '/humanResourcePlanning/analysisOfHumanResourceSupply', name: '浜哄姏璧勬簮渚涚粰鍒嗘瀽', component: './Admin' }, - { path: '/humanResourcePlanning/humanResourcesBudget', name: '浜哄姏璧勬簮棰勭畻', component: './Admin' }, - { path: '/humanResourcePlanning/jobAnalysis', name: '宸ヤ綔鍒嗘瀽', component: './Admin' }, - { path: '/humanResourcePlanning/jobEvaluation', name: '宸ヤ綔璇勪环', component: './Admin' }, - ], - }, - { - path: '/Recruiting', - name: '鎷涜仒绠$悊', - icon: 'crown', - routes: [ - { path: '/Recruiting', redirect: '/admin/sub-page' }, - { path: '/Recruiting/recruitmentNeeds', name: '鎷涜仒闇�姹�', component: './Admin' }, - { path: '/Recruiting/recruitingPlan', name: '鎷涜仒璁″垝', component: './Admin' }, - { path: '/Recruiting/jobPosting', name: '宀椾綅鍙戝竷', component: './Admin' }, - { path: '/Recruiting/workApplicationApproval', name: '宸ヤ綔鐢宠瀹℃壒', component: './Admin' }, - { path: '/Recruiting/select', name: '鐢勯��', component: './Admin' }, - { path: '/Recruiting/physicalExamination', name: '浣撴', component: './Admin' }, + { path: "/myWork", redirect: "/admin/sub-page" }, { - path: '/Recruiting/employmentInformationRelease', - name: '褰曠敤淇℃伅鍙戝竷', - component: './Admin', + path: "/myWork/taskManagement", + name: "浠诲姟绠$悊", + component: "./myWork/taskManagement", }, - { path: '/Recruiting/newEmployeeRegistration', name: '鏂板憳宸ユ姤鍒�', component: './Admin' }, - { path: '/Recruiting/recruitmentEvaluation', name: '褰曠敤璇勪及', component: './Admin' }, - { path: '/Recruiting/costManagement', name: '璐圭敤绠$悊', component: './Admin' }, - { path: '/Recruiting/talentPoolMaintenance', name: '浜烘墠搴撶淮鎶�', component: './Admin' }, + { + path: "/myWork/AnnouncementManagement", + name: "鍏憡绠$悊", + component: "./Admin", + }, + { + path: "/myWork/messageManagement", + name: "娑堟伅绠$悊", + component: "./Admin", + }, ], }, { - path: '/humanResourceManagement', - name: '浜轰簨绠$悊', - icon: 'crown', + path: "/organizationDesign", + name: "缁勭粐璁捐", + icon: "crown", routes: [ - { path: '/humanResourceManagement', redirect: '/admin/sub-page' }, - { path: '/humanResourceManagement/employeeInformation', name: '鍛樺伐淇℃伅', component: './Admin' }, - { path: '/humanResourceManagement/contractManagement', name: '鍚堝悓绠$悊', component: './HumanResourceManagement/contractManagement' }, - { path: '/humanResourceManagement/nominationForAppointment', name: '浠昏亴鎻愬悕', component: './HumanResourceManagement/nominationForAppointment' }, - { path: '/humanResourceManagement/dismissalApplication', name: '鍏嶈亴鐢宠', component: './HumanResourceManagement/dismissalApplication' }, - - { path: '/humanResourceManagement/transferApplication', name: '璋冨叆鐢宠', component: './Admin' }, - { path: '/humanResourceManagement/transferOutApplication', name: '璋冨嚭鐢宠', component: './Admin' }, - { path: '/humanResourceManagement/changeRequest', name: '鍙樺姩鐢宠', component: './HumanResourceManagement/changeRequest' }, - // { path: '/humanResourceManagement/transferApplication', name: '杞换鐢宠', component: './Admin' }, - { path: '/humanResourceManagement/applicationForSecondment', name: '鎸傝亴鐢宠', component: './HumanResourceManagement/applicationForSecondment' }, - { path: '/humanResourceManagement/challengeForCause', name: '鍥為伩鐢宠', component: './HumanResourceManagement/challengeForCause' }, - { path: '/humanResourceManagement/resignationApplication', name: '绂昏亴鐢宠', component: './HumanResourceManagement/resignationApplication' }, - // { path: '/humanResourceManagement/dismissalApplication', name: '杈為��鐢宠', component: './Admin' }, - // { path: '/humanResourceManagement/retirementManagement', name: '绂讳紤绠$悊', component: './Admin' }, - { path: '/humanResourceManagement/retirementManagement', name: '閫�浼戠鐞�', component: './HumanResourceManagement/retirementManagement' }, - { path: '/humanResourceManagement/compulsoryRetirementApplication', name: '寮哄埗閫�浼戠敵璇�', component: './Admin' }, + { + path: "/organizationDesign", + redirect: "/organizationDesign/OrganizationalStructureConfiguration", + }, + { + path: "/organizationDesign/OrganizationalStructureConfiguration", + name: "缁勭粐鏈烘瀯閰嶇疆", + component: "./organizationDesign/OrganizationalStructureConfiguration", + }, + { + path: "/organizationDesign/DepartmentalInformationConfiguration", + name: "閮ㄩ棬淇℃伅閰嶇疆", + component: "./organizationDesign/DepartmentalInformationConfiguration", + }, + { + path: "/organizationDesign/JobInformationConfiguration", + name: "鑱屼綅淇℃伅閰嶇疆", + component: "./organizationDesign/JobInformationConfiguration", + }, + { + path: "/organizationDesign/jobLevelInformationConfiguration", + name: "鑱岀骇淇℃伅閰嶇疆", + component: "./organizationDesign/jobLevelInformationConfiguration", + }, + { + path: "/organizationDesign/postInformationConfiguration", + name: "宀椾綅淇℃伅閰嶇疆", + component: "./organizationDesign/postInformationConfiguration", + }, + { + path: "/organizationDesign/departmentalEmployeeInformation", + name: "閮ㄩ棬鍛樺伐淇℃伅", + component: "./organizationDesign/departmentalEmployeeInformation", + }, + { + path: "/organizationDesign/organizationChart", + name: "缁勭粐缁撴瀯鍥�", + component: "./Admin", + }, + { + path: "/organizationDesign/organizationalStructureChanges", + name: "缁勭粐缁撴瀯鍙樿縼", + component: "./Admin", + }, ], }, { - path: '/trainingManagement', - name: '鍩硅绠$悊', - icon: 'crown', + path: "/humanResourcePlanning", + name: "浜哄姏璧勬簮瑙勫垝", + icon: "crown", routes: [ - { path: '/trainingManagement', redirect: '/admin/sub-page' }, - { path: '/trainingManagement/鍩硅鏈烘瀯绠$悊', name: '鍩硅鏈烘瀯绠$悊', component: './Admin' }, - { path: '/trainingManagement/contractManagement', name: '鍩虹璧勬枡绠$悊', component: './Admin' }, - { path: '/trainingManagement/nominationForAppointment', name: '鍩硅闇�姹傜鐞�', component: './Admin' }, - // { path: '/trainingManagement/dismissalApplication', name: '鍩硅璁″垝绠$悊', component: './Admin' }, - { path: '/trainingManagement/transferApplication', name: '鍩硅璁″垝绠$悊', component: './Admin' }, - { path: '/trainingManagement/transferOutApplication', name: '鍩硅鏃ョ▼绠$悊', component: './Admin' }, - { path: '/trainingManagement/changeRequest', name: '鍩硅鏁堟灉绠$悊', component: './Admin' }, - // { path: '/trainingManagement/transferApplication', name: '鍩硅璐圭敤绠$悊', component: './Admin' }, + { path: "/humanResourcePlanning", redirect: "/admin/sub-page" }, + { + path: "/humanResourcePlanning/organizationalStrategyFormulation", + name: "缁勭粐鎴樼暐鍒跺畾", + component: "./humanResourcePlanning/organizationalStrategyFormulation", + }, + { + path: "/humanResourcePlanning/personnelRequirementAnalysis", + name: "浜哄憳闇�姹傚垎鏋�", + component: "./Admin", + }, + { + path: "/humanResourcePlanning/analysisOfHumanResourceSupply", + name: "浜哄姏璧勬簮渚涚粰鍒嗘瀽", + component: "./Admin", + }, + { + path: "/humanResourcePlanning/humanResourcesBudget", + name: "浜哄姏璧勬簮棰勭畻", + component: "./Admin", + }, + { + path: "/humanResourcePlanning/jobAnalysis", + name: "宸ヤ綔鍒嗘瀽", + component: "./Admin", + }, + { + path: "/humanResourcePlanning/jobEvaluation", + name: "宸ヤ綔璇勪环", + component: "./Admin", + }, + ], + }, + { + path: "/Recruiting", + name: "鎷涜仒绠$悊", + icon: "crown", + routes: [ + { path: "/Recruiting", redirect: "/admin/sub-page" }, + { + path: "/Recruiting/recruitmentNeeds", + name: "鎷涜仒闇�姹�", + component: "./Admin", + }, + { + path: "/Recruiting/recruitingPlan", + name: "鎷涜仒璁″垝", + component: "./Admin", + }, + { + path: "/Recruiting/jobPosting", + name: "宀椾綅鍙戝竷", + component: "./Admin", + }, + { + path: "/Recruiting/workApplicationApproval", + name: "宸ヤ綔鐢宠瀹℃壒", + component: "./Admin", + }, + { path: "/Recruiting/select", name: "鐢勯��", component: "./Admin" }, + { + path: "/Recruiting/physicalExamination", + name: "浣撴", + component: "./Admin", + }, + { + path: "/Recruiting/employmentInformationRelease", + name: "褰曠敤淇℃伅鍙戝竷", + component: "./Admin", + }, + { + path: "/Recruiting/newEmployeeRegistration", + name: "鏂板憳宸ユ姤鍒�", + component: "./Admin", + }, + { + path: "/Recruiting/recruitmentEvaluation", + name: "褰曠敤璇勪及", + component: "./Admin", + }, + { + path: "/Recruiting/costManagement", + name: "璐圭敤绠$悊", + component: "./Admin", + }, + { + path: "/Recruiting/talentPoolMaintenance", + name: "浜烘墠搴撶淮鎶�", + component: "./Admin", + }, + ], + }, + { + path: "/humanResourceManagement", + name: "浜轰簨绠$悊", + icon: "crown", + routes: [ + { path: "/humanResourceManagement", redirect: "/admin/sub-page" }, + { + path: "/humanResourceManagement/employeeInformation", + name: "鍛樺伐淇℃伅", + component: "./Admin", + }, + { + path: "/humanResourceManagement/contractManagement", + name: "鍚堝悓绠$悊", + component: "./HumanResourceManagement/contractManagement", + }, + { + path: "/humanResourceManagement/nominationForAppointment", + name: "浠昏亴鎻愬悕", + component: "./HumanResourceManagement/nominationForAppointment", + }, + { + path: "/humanResourceManagement/dismissalApplication", + name: "鍏嶈亴鐢宠", + component: "./HumanResourceManagement/dismissalApplication", + }, + { + path: "/humanResourceManagement/transferApplication", + name: "璋冨叆鐢宠", + component: "./Admin", + }, + { + path: "/humanResourceManagement/transferOutApplication", + name: "璋冨嚭鐢宠", + component: "./Admin", + }, + { + path: "/humanResourceManagement/changeRequest", + name: "鍙樺姩鐢宠", + component: "./HumanResourceManagement/changeRequest", + }, + // { path: '/humanResourceManagement/transferApplication', name: '杞换鐢宠', component: './Admin' }, + { + path: "/humanResourceManagement/applicationForSecondment", + name: "鎸傝亴鐢宠", + component: "./HumanResourceManagement/applicationForSecondment", + }, + { + path: "/humanResourceManagement/challengeForCause", + name: "鍥為伩鐢宠", + component: "./HumanResourceManagement/challengeForCause", + }, + { + path: "/humanResourceManagement/resignationApplication", + name: "绂昏亴鐢宠", + component: "./HumanResourceManagement/resignationApplication", + }, + // { path: '/humanResourceManagement/dismissalApplication', name: '杈為��鐢宠', component: './Admin' }, + // { path: '/humanResourceManagement/retirementManagement', name: '绂讳紤绠$悊', component: './Admin' }, + { + path: "/humanResourceManagement/retirementManagement", + name: "閫�浼戠鐞�", + component: "./HumanResourceManagement/retirementManagement", + }, + { + path: "/humanResourceManagement/compulsoryRetirementApplication", + name: "寮哄埗閫�浼戠敵璇�", + component: "./HumanResourceManagement/compulsoryRetirementApplication", + }, + ], + }, + { + path: "/trainingManagement", + name: "鍩硅绠$悊", + icon: "crown", + routes: [ + { path: "/trainingManagement", redirect: "/admin/sub-page" }, + { + path: "/trainingManagement/鍩硅鏈烘瀯绠$悊", + name: "鍩硅鏈烘瀯绠$悊", + component: "./Admin", + }, + { + path: "/trainingManagement/contractManagement", + name: "鍩虹璧勬枡绠$悊", + component: "./Admin", + }, + { + path: "/trainingManagement/nominationForAppointment", + name: "鍩硅闇�姹傜鐞�", + component: "./Admin", + }, + // { path: '/trainingManagement/dismissalApplication', name: '鍩硅璁″垝绠$悊', component: './Admin' }, + { + path: "/trainingManagement/transferApplication", + name: "鍩硅璁″垝绠$悊", + component: "./Admin", + }, + { + path: "/trainingManagement/transferOutApplication", + name: "鍩硅鏃ョ▼绠$悊", + component: "./Admin", + }, + { + path: "/trainingManagement/changeRequest", + name: "鍩硅鏁堟灉绠$悊", + component: "./Admin", + }, + // { path: '/trainingManagement/transferApplication', name: '鍩硅璐圭敤绠$悊', component: './Admin' }, ], }, // { name: '鏌ヨ琛ㄦ牸', icon: 'table', path: '/list', component: './TableList' }, @@ -356,12 +543,12 @@ // component: './orgManage', // }, { - name: '閮ㄩ棬绠$悊', - icon: 'crown', + name: "閮ㄩ棬绠$悊", + icon: "crown", headerRender: true, - access: 'canAdmin', - path: '/department', - component: './DepartmentManage', + access: "canAdmin", + path: "/department", + component: "./DepartmentManage", }, - { path: '*', layout: false, component: './404' }, + { path: "*", layout: false, component: "./404" }, ]; diff --git a/src/access.ts b/src/access.ts index 5dfc751..7038c95 100644 --- a/src/access.ts +++ b/src/access.ts @@ -4,9 +4,9 @@ export default function access( initialState: { currentUser?: API.CurrentUser } | undefined ) { - const { currentUser } = initialState ?? {}; - console.log(currentUser, "currentUser"); + const { currentUser, selectRole } = initialState ?? {}; + console.log(selectRole, "selectRole"); return { - canAdmin: currentUser && currentUser.id === 1, + canAdmin: currentUser && currentUser.id === 0, }; } diff --git a/src/app.tsx b/src/app.tsx index b67c68b..e72c2d6 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -19,14 +19,14 @@ * */ export async function getInitialState(): Promise<{ settings?: Partial<LayoutSettings>; - currentUser?: API.CurrentUser; + currentUser?: any; appInfo?: any; roleList?: any; selectRole?: any; loading?: boolean; - fetchUserInfo?: () => Promise<API.CurrentUser | undefined>; - fetchAppInfo?: () => Promise<API.CurrentUser | undefined>; - fetchRoleList?: () => Promise<API.CurrentUser | undefined>; + fetchUserInfo?: () => Promise<any>; + fetchAppInfo?: () => Promise<any>; + fetchRoleList?: () => Promise<any>; }> { const fetchAppInfo = async () => { try { @@ -53,25 +53,25 @@ } return undefined; }; + + // 濡傛灉涓嶆槸鐧诲綍椤甸潰锛屾墽琛� const { location } = history; - if (![loginPath, '/user/register', '/user/register-result'].includes(location.pathname)) { - const currentUser = await fetchUserInfo(); - const appInfo = await fetchAppInfo(); - const roleList = await fetchRoleList(); - return { - currentUser, - appInfo, - roleList, - selectRole: {}, - fetchUserInfo, - settings: defaultSettings as Partial<LayoutSettings>, - }; - } + const currentUser = await fetchUserInfo(); + const appInfo = await fetchAppInfo(); + const roleList = await fetchRoleList(); return { + currentUser, + appInfo, + roleList, + selectRole: {}, fetchUserInfo, settings: defaultSettings as Partial<LayoutSettings>, }; + // return { + // fetchUserInfo, + // settings: defaultSettings as Partial<LayoutSettings>, + // }; } diff --git a/src/components/ApplyIndex/components/apply.tsx b/src/components/ApplyIndex/components/apply.tsx index d8f2721..7d70625 100644 --- a/src/components/ApplyIndex/components/apply.tsx +++ b/src/components/ApplyIndex/components/apply.tsx @@ -10,6 +10,7 @@ Select, } from "antd"; import React, { useEffect, useState } from "react"; +import Staff from "./staff"; interface ApplyProps { visible: boolean; @@ -24,6 +25,7 @@ const { visible, setFormDat, onCancel, applyType, title, formItems } = props; const [staffVisible, setStaffVisible] = useState(false); + const [form] = Form.useForm(); const onFinish = (values: any) => { console.log(values); @@ -37,6 +39,9 @@ // 璁剧疆閫変腑鍛樺伐 const onSetStaff = (val: any) => { + if (val) { + form.setFieldsValue(val); + } console.log(val); }; @@ -46,12 +51,20 @@ } }, [visible]); + // 鍏抽棴涓旈噸缃〃鍗� + const closeForm = () => { + if (onCancel) { + onCancel(); + } + form.resetFields(); + }; + return ( <Modal width={910} title={title + "鐢宠"} open={visible} - onCancel={onCancel} + onCancel={closeForm} footer={null} className="ModelForm" > @@ -61,6 +74,7 @@ style={{ paddingTop: 20 }} onFinish={onFinish} autoComplete="off" + form={form} > <Row> {formItems?.length && @@ -74,7 +88,19 @@ name={item.name} rules={item.rules} > - <Input style={{ width: item.width }} /> + {item.name !== "name" && ( + <Input + readOnly={item.readOnly} + style={{ width: item.width }} + /> + )} + {item.name === "name" && ( + <Input + readOnly={item.readOnly} + style={{ width: item.width }} + onClick={onStaffVisible} + /> + )} </Form.Item> </Col> ); @@ -142,7 +168,12 @@ <Button type="primary" htmlType="submit"> 鎻愪氦 </Button> - <Button onClick={onCancel}>鍏抽棴</Button> + <Button onClick={closeForm}>鍏抽棴</Button> + <Staff + open={staffVisible} + onCancel={() => setStaffVisible(false)} + setData={onSetStaff} + /> </div> </Form.Item> </Form> diff --git a/src/components/ApplyIndex/components/staff.tsx b/src/components/ApplyIndex/components/staff.tsx index 9a1af18..5b82229 100644 --- a/src/components/ApplyIndex/components/staff.tsx +++ b/src/components/ApplyIndex/components/staff.tsx @@ -1,6 +1,7 @@ -import { postOaStaffGetStaffList } from '@/services/WebApi/oaStaff'; -import { Modal, Table } from 'antd'; -import React, { useEffect, useState } from 'react'; +import { postOaStaffGetStaffList } from "@/services/WebApi/oaStaff"; +import type { TableProps } from "antd"; +import { Modal, Table } from "antd"; +import React, { useEffect, useState } from "react"; interface StaffProps { open: boolean; @@ -8,37 +9,71 @@ onCancel: () => void; } +interface DataType { + id: number | string; + label: string; + value: number | string; + department?: string; + post?: string; +} + const Staff: React.FC<StaffProps> = (props) => { const { open, setData, onCancel } = props; - const [staffOptions, setStaffOptions] = useState([]); + const [staffOptions, setStaffOptions] = useState([]); // 鍛樺伐鏁版嵁 + const [currentRow, setRow] = useState<DataType>(); // 閫変腑琛� + const [loading, setLoading] = useState(false); const staffColums: any[] = [ { - title: '鍛樺伐濮撳悕', - dataIndex: 'label', + title: "鍛樺伐濮撳悕", + dataIndex: "label", }, { - title: '閮ㄩ棬', - dataIndex: 'tsetwe', + title: "閮ㄩ棬", + dataIndex: "department", }, { - title: '鑱屼綅', - dataIndex: 'post', + title: "鑱屼綅", + dataIndex: "post", }, ]; - // 鑾峰彇鍛樺伐鍒楄〃 - const getStaffList = async () => { - const res = await postOaStaffGetStaffList({ start: 0, size: 10, orgId: 4 }); - if (res && res.datas.length > 0) { - const data = res.datas.map((item: any) => ({ - label: item.name, - value: item.id, - })); - setStaffOptions(data); + // 鍏抽棴鍛樺伐寮规 + const onCloseStaff = () => { + if (onCancel) { + onCancel(); } - return []; + setData(null); + }; + + // 璁剧疆閫変腑琛� + const onSelectRow = () => { + setData(currentRow); + onCloseStaff(); + }; + + // 鑾峰彇鍛樺伐鍒楄〃 + const getStaffList = () => { + setLoading(true); + postOaStaffGetStaffList({ start: 0, size: 10, orgId: 4 }) + .then((res) => { + if (res && res.datas.length > 0) { + const data = res.datas.map((item: any) => ({ + label: item.name, + value: item.id, + ...item, + })); + setStaffOptions(data); + } + }) + .catch((err) => { + setLoading(false); + setStaffOptions([]); + }) + .finally(() => { + setLoading(false); + }); }; useEffect(() => { @@ -47,9 +82,29 @@ } }, [open]); + const rowSelection: TableProps<DataType>["rowSelection"] = { + onChange: (selectedRowKeys: React.Key[], selectedRows: DataType[]) => { + setRow(selectedRows[0]); + }, + }; + return ( - <Modal title={'鍛樺伐鍒楄〃'} width={600} open={open} onCancel={onCancel}> - <Table dataSource={staffOptions} columns={staffColums} pagination={false} /> + <Modal + title={"鍛樺伐鍒楄〃"} + width={600} + open={open} + onCancel={onCloseStaff} + onOk={onSelectRow} + > + <Table + dataSource={staffOptions} + columns={staffColums} + pagination={false} + loading={loading} + rowKey={(record) => record?.id} + rowSelection={{ type: "radio", ...rowSelection }} + scroll={{ y: 400 }} + /> </Modal> ); }; diff --git a/src/components/selectUser/index.less b/src/components/selectUser/index.less new file mode 100644 index 0000000..92906f5 --- /dev/null +++ b/src/components/selectUser/index.less @@ -0,0 +1,4 @@ +.dialogContent{ + padding: 24px; + overflow: auto; +} \ No newline at end of file diff --git a/src/components/selectUser/index.tsx b/src/components/selectUser/index.tsx new file mode 100644 index 0000000..1102bc2 --- /dev/null +++ b/src/components/selectUser/index.tsx @@ -0,0 +1,163 @@ +import { postOaStaffGetStaffList } from "@/services/WebApi/oaStaff"; +import { ProTable } from "@ant-design/pro-components"; +import { useModel } from "@umijs/max"; +import { Modal } from "antd"; +import React, { useRef, useState } from "react"; +import styles from "./index.less"; + +type SelectUserProps = { + title?: string; + mask?: boolean; + width?: string | number; + height?: string | number; + open?: boolean; + destroyOnClose?: boolean; + footerBtn?: FooterBtn; + onCancel?: () => void; + onConfirm?: (user: any) => void; +}; + +interface FooterBtn { + okBtn?: { + text?: string; + loading?: boolean; + disabled?: boolean; + click?: () => void; + }; + cancelBtn?: { + text?: string; + disabled?: boolean; + }; +} + +const SelectUser: React.FC<SelectUserProps> = (props) => { + const { + title, + mask, + width, + height, + open, + footerBtn, + destroyOnClose = false, + onConfirm, + onCancel, + } = props; + const [disabled, setDisabled] = useState(true); + const actionRef = useRef(null); + const { initialState, setInitialState } = useModel("@@initialState"); + const [selecRow, setSelecRow] = useState<any>([]) + const [selecRowKey, setSelecRowKey] = useState<any>([]) + + const columns = [ + { + title: "鍛樺伐濮撳悕", + key: "name", + dataIndex: "name", + align: "center", + search: false, + + }, + { + title: "閮ㄩ棬", + key: "department", + dataIndex: "department", + align: "center", + search: false, + render: (text, record) => { + return <span>{record.department.name}</span>; + }, + }, + { + title: "鑱屼綅", + key: "role", + dataIndex: "role", + align: "center", + search: false, + render: (text, record) => { + + return <span>{record?.role?.name || "-"}</span>; + }, + }, + { + title: "鍩庡競", + key: "city", + dataIndex: "city", + align: "center", + search: false, + render: (text, record) => { + console.log(record.city, "record"); + + return <span>{record?.city?.name || "-"}</span>; + }, + }, + ]; + + const handleOk = () => { + console.log(selecRow, "selecRow"); + onConfirm && onConfirm(selecRow[0]) + }; + const handleCancel = () => { }; + + const getTableData = (params: { current: number; pageSize: number }) => { + console.log(params, "params"); + const body = { + start: (params.current - 1) * params.pageSize, + size: params.pageSize, + filterList: [], + searchList: [], + orgId: 5, + // orgId: initialState?.appInfo?.org?.id, + }; + return postOaStaffGetStaffList(body).then((res) => { + console.log(res, "res"); + return { + data: res.datas, + total: res.totalSize, + }; + }); + }; + + return ( + <Modal + title={ + <div + onMouseOver={() => { + setDisabled(false); + }} + onMouseOut={() => { + setDisabled(true); + }} + > + {title} + </div> + } + open={true} + width={width || "50%"} + onOk={handleOk} + onCancel={onCancel} + centered={true} + > + <div style={{ height: height || "80vh" }} className={styles.dialogContent}> + <ProTable + actionRef={actionRef} + rowSelection={{ + type: 'radio', + fixed: 'left', + selectedRowKeys: selecRowKey, + onChange: (selectedRowKeys, selectedRows) => { + console.log(selectedRowKeys, selectedRows, 'selectedRows'); + setSelecRowKey(selectedRowKeys) + setSelecRow(selectedRows) + } + }} + rowKey="id" + columns={columns} + search={false} + request={getTableData} + /> + </div> + </Modal> + ); +}; + +export default SelectUser; diff --git a/src/pages/HumanResourceManagement/applicationForSecondment/index.tsx b/src/pages/HumanResourceManagement/applicationForSecondment/index.tsx index e437869..188ba1b 100644 --- a/src/pages/HumanResourceManagement/applicationForSecondment/index.tsx +++ b/src/pages/HumanResourceManagement/applicationForSecondment/index.tsx @@ -9,7 +9,7 @@ { label: "鍚嶇О", name: "applyName", - rules: [{ required: true, message: "璇疯緭鍏ュ悕绉�!" }], + rules: [{ required: true, message: "璇峰~鍐欏悕绉�!" }], type: "input", pageType: "applicationForSecondment", labelCol: 6, @@ -17,9 +17,10 @@ }, { label: "鍛樺伐濮撳悕", - name: "employeeName", - rules: [{ required: true, message: "璇疯緭鍏ュ憳宸ュ鍚�!" }], + name: "name", + rules: [{ required: true, message: "璇峰~鍐欏憳宸ュ鍚�!" }], type: "input", + readOnly: true, pageType: "applicationForSecondment", labelCol: 6, width: 300, @@ -61,7 +62,7 @@ { label: "鎸傝亴閮ㄩ棬", name: "secondmentDepartment", - rules: [{ required: true, message: "璇疯緭鍏ユ寕鑱岄儴闂�!" }], + rules: [{ required: true, message: "璇峰~鍐欐寕鑱岄儴闂�!" }], type: "input", pageType: "applicationForSecondment", labelCol: 6, diff --git a/src/pages/HumanResourceManagement/challengeForCause/index.tsx b/src/pages/HumanResourceManagement/challengeForCause/index.tsx index 8c85fd1..992c3e8 100644 --- a/src/pages/HumanResourceManagement/challengeForCause/index.tsx +++ b/src/pages/HumanResourceManagement/challengeForCause/index.tsx @@ -9,7 +9,7 @@ { label: "鍚嶇О", name: "applyName", - rules: [{ required: true, message: "璇疯緭鍏ュ悕绉�!" }], + rules: [{ required: true, message: "璇峰~鍐欏悕绉�!" }], type: "input", pageType: "challengeForCause", labelCol: 6, @@ -17,9 +17,10 @@ }, { label: "鍛樺伐濮撳悕", - name: "employeeName", - rules: [{ required: true, message: "璇疯緭鍏ュ憳宸ュ鍚�!" }], + name: "name", + rules: [{ required: true, message: "璇峰~鍐欏憳宸ュ鍚�!" }], type: "input", + readOnly: true, pageType: "challengeForCause", labelCol: 6, width: 300, @@ -27,7 +28,7 @@ { label: "寮�濮嬫椂闂�", name: "startTime", - rules: [{ required: true, message: "璇疯緭鍏ュ紑濮嬫椂闂�!" }], + rules: [{ required: true, message: "璇峰~鍐欏紑濮嬫椂闂�!" }], type: "date", pageType: "challengeForCause", labelCol: 6, @@ -36,7 +37,7 @@ { label: "缁撴潫鏃堕棿", name: "endTime", - rules: [{ required: true, message: "璇疯緭鍏ョ粨鏉熸椂闂�!" }], + rules: [{ required: true, message: "璇峰~鍐欑粨鏉熸椂闂�!" }], type: "date", pageType: "challengeForCause", labelCol: 6, @@ -45,7 +46,7 @@ { label: "鏇夸唬浜哄憳", name: "substitute", - rules: [{ required: true, message: "璇疯緭鍏ユ浛浠d汉鍛�!" }], + rules: [{ required: true, message: "璇峰~鍐欐浛浠d汉鍛�!" }], type: "input", pageType: "challengeForCause", labelCol: 6, @@ -54,7 +55,6 @@ { label: "鍥為伩鍘熺敱", name: "reason", - rules: [{ required: true, message: "璇疯緭鍏ュ洖閬垮師鐢�!" }], type: "textArea", pageType: "challengeForCause", labelCol: 3, @@ -63,7 +63,6 @@ { label: "鍥為伩鍐呭", name: "avoidContent", - rules: [{ required: true, message: "璇疯緭鍏ュ洖閬垮唴瀹�!" }], type: "textArea", pageType: "challengeForCause", labelCol: 3, diff --git a/src/pages/HumanResourceManagement/changeRequest/index.tsx b/src/pages/HumanResourceManagement/changeRequest/index.tsx index 6c33017..679b7c3 100644 --- a/src/pages/HumanResourceManagement/changeRequest/index.tsx +++ b/src/pages/HumanResourceManagement/changeRequest/index.tsx @@ -9,7 +9,7 @@ { label: "鍚嶇О", name: "applyName", - rules: [{ required: true, message: "璇疯緭鍏ュ悕绉�!" }], + rules: [{ required: true, message: "璇峰~鍐欏悕绉�!" }], type: "input", pageType: "changeRequest", labelCol: 6, @@ -17,9 +17,10 @@ }, { label: "鍛樺伐濮撳悕", - name: "employeeName", - rules: [{ required: true, message: "璇疯緭鍏ュ憳宸ュ鍚�!" }], + name: "name", + rules: [{ required: true, message: "璇峰~鍐欏憳宸ュ鍚�!" }], type: "input", + readOnly: true, pageType: "dismissalApplication", labelCol: 6, width: 300, @@ -45,7 +46,6 @@ { label: "璋冨墠閮ㄩ棬", name: "changeBeforeDepartment", - rules: [{ required: true, message: "璇烽�夋嫨璋冨墠閮ㄩ棬!" }], type: "select", pageType: "changeRequest", labelCol: 6, @@ -63,7 +63,6 @@ { label: "璋冨墠鑱屼綅", name: "changeBeforePosition", - rules: [{ required: true, message: "璇烽�夋嫨璋冨墠鑱屼綅!" }], type: "select", pageType: "changeRequest", labelCol: 6, @@ -81,7 +80,6 @@ { label: "璋冨墠鑱岀骇", name: "changeBeforeRank", - rules: [{ required: true, message: "璇烽�夋嫨璋冨墠鑱岀骇!" }], type: "select", pageType: "changeRequest", labelCol: 6, @@ -99,7 +97,6 @@ { label: "璋冨墠鍩烘湰宸ヨ祫", name: "changeBeforeMoney", - rules: [{ required: true, message: "璇疯緭鍏ヨ皟鍓嶅熀鏈伐璧�!" }], type: "input", pageType: "changeRequest", labelCol: 6, @@ -108,7 +105,7 @@ { label: "璋冨悗鍩烘湰宸ヨ祫", name: "changeAfterMoney", - rules: [{ required: true, message: "璇疯緭鍏ヨ皟鍚庡熀鏈伐璧�!" }], + rules: [{ required: true, message: "璇峰~鍐欒皟鍚庡熀鏈伐璧�!" }], type: "input", pageType: "changeRequest", labelCol: 6, @@ -117,7 +114,6 @@ { label: "璋冨墠宸ョ", name: "changeBeforeJob", - rules: [{ required: true, message: "璇烽�夋嫨璋冨墠宸ョ!" }], type: "select", pageType: "changeRequest", labelCol: 6, @@ -135,7 +131,6 @@ { label: "璋冨墠鐘舵��", name: "changeBeforeStatus", - rules: [{ required: true, message: "璇烽�夋嫨璋冨墠鐘舵��!" }], type: "select", pageType: "changeRequest", labelCol: 6, @@ -153,7 +148,6 @@ { label: "璋冨姩鍘熷洜", name: "reason", - rules: [{ required: true, message: "璇疯緭鍏ヨ皟鍔ㄥ師鍥�!" }], type: "textArea", pageType: "changeRequest", labelCol: 3, diff --git a/src/pages/HumanResourceManagement/compulsoryRetirementApplication/index.less b/src/pages/HumanResourceManagement/compulsoryRetirementApplication/index.less new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/pages/HumanResourceManagement/compulsoryRetirementApplication/index.less diff --git a/src/pages/HumanResourceManagement/compulsoryRetirementApplication/index.tsx b/src/pages/HumanResourceManagement/compulsoryRetirementApplication/index.tsx new file mode 100644 index 0000000..3f1aea6 --- /dev/null +++ b/src/pages/HumanResourceManagement/compulsoryRetirementApplication/index.tsx @@ -0,0 +1,273 @@ +import Apply from "@/components/ApplyIndex"; +import React from "react"; + +const NominationForAppointment: React.FC = () => { + const params = { + title: "寮哄埗閫�浼�", + applyType: "retirementManagement", + formItems: [ + { + label: "閫夋嫨鍛樺伐", + name: "selectStaff", + type: "select", + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "鍩虹淇℃伅", + type: "divider", + pageType: "retirementManagement", + }, + { + label: "鍛樺伐濮撳悕", + name: "name", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "閮ㄩ棬鍚嶇О", + name: "departmentName", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "韬唤璇佸彿", + name: "idNum", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "鎬у埆", + name: "sex", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "绫嶈疮", + name: "nativePlace", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "闆囦剑绫诲瀷", + name: "employmentType", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "鍑虹敓骞存湀", + name: "birthday", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "姘戞棌", + name: "race", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "濠氬Щ鐘跺喌", + name: "marriageStatus", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "鏀挎不闈㈣矊", + name: "politicalStatus", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "姣曚笟闄㈡牎", + name: "graduateSchool", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "涓撲笟", + name: "major", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "鏂囧寲绋嬪害", + name: "educationLevel", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "宸ョ", + name: "jobType", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "鑱岀О", + name: "workTitle", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "鎵嬫満", + name: "mobilePhone", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "鑱旂郴鍦板潃", + name: "contactAddress", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "鐢靛瓙閭欢", + name: "eMail", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "瀹跺涵浣忓潃", + name: "homeAddress", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "鑱旂郴鐢佃瘽", + name: "phone", + type: "input", + readOnly: true, + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "澶囨敞", + name: "remarks", + type: "textArea", + pageType: "retirementManagement", + labelCol: 3, + width: 730, + }, + { + label: "寮哄埗閫�浼戝緟閬�", + type: "divider", + pageType: "retirementManagement", + }, + { + label: "鐢宠鍚嶇О", + name: "applyName", + rules: [{ required: true, message: "璇峰~鍐欑敵璇峰悕绉�!" }], + type: "input", + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "娲ヨ创", + name: "allowance", + rules: [{ required: true, message: "璇峰~鍐欐触璐�!" }], + type: "input", + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "姣忔湀宸ヨ祫", + name: "monthlySalary", + rules: [{ required: true, message: "璇峰~鍐欐瘡鏈堝伐璧�!" }], + type: "input", + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "绂忓埄", + name: "welfare", + rules: [{ required: true, message: "璇峰~鍐欑鍒�!" }], + type: "input", + pageType: "retirementManagement", + labelCol: 6, + width: 300, + }, + { + label: "寮哄埗閫�浼戝師鍥�", + name: "retirementReason", + type: "textArea", + pageType: "retirementManagement", + labelCol: 3, + width: 730, + }, + { + label: "澶囨敞", + name: "retirementRemarks", + type: "textArea", + pageType: "retirementManagement", + labelCol: 3, + width: 730, + }, + ], + }; + + return <Apply {...params} />; +}; + +export default NominationForAppointment; diff --git a/src/pages/HumanResourceManagement/contractManagement/index.tsx b/src/pages/HumanResourceManagement/contractManagement/index.tsx index de0186e..6d9114d 100644 --- a/src/pages/HumanResourceManagement/contractManagement/index.tsx +++ b/src/pages/HumanResourceManagement/contractManagement/index.tsx @@ -139,7 +139,7 @@ <Form.Item label="鍛樺伐濮撳悕" name="name" - rules={[{ required: true, message: '璇疯緭鍏ユ満鏋勫悕绉�' }]} + rules={[{ required: true, message: '璇峰~鍐欐満鏋勫悕绉�' }]} > <Input suffix={<UserOutlined className="site-form-item-icon" />} /> </Form.Item> @@ -148,7 +148,7 @@ <Form.Item label="鎵�灞為儴闂�" name="name" - rules={[{ required: true, message: '璇疯緭鍏ユ満鏋勫悕绉�' }]} + rules={[{ required: true, message: '璇峰~鍐欐満鏋勫悕绉�' }]} > <Input /> </Form.Item> @@ -159,7 +159,7 @@ <Form.Item label="鍚堝悓绫诲瀷" name="name" - rules={[{ required: true, message: '璇疯緭鍏ユ満鏋勫悕绉�' }]} + rules={[{ required: true, message: '璇峰~鍐欐満鏋勫悕绉�' }]} > <Select defaultValue="lucy" diff --git a/src/pages/HumanResourceManagement/dismissalApplication/index.tsx b/src/pages/HumanResourceManagement/dismissalApplication/index.tsx index 4682eef..37eb0e7 100644 --- a/src/pages/HumanResourceManagement/dismissalApplication/index.tsx +++ b/src/pages/HumanResourceManagement/dismissalApplication/index.tsx @@ -9,7 +9,7 @@ { label: "鍚嶇О", name: "applyName", - rules: [{ required: true, message: "璇疯緭鍏ュ悕绉�!" }], + rules: [{ required: true, message: "璇峰~鍐欏悕绉�!" }], type: "input", pageType: "dismissalApplication", labelCol: 3, @@ -17,9 +17,10 @@ }, { label: "鍛樺伐濮撳悕", - name: "employeeName", - rules: [{ required: true, message: "璇疯緭鍏ュ憳宸ュ鍚�!" }], + name: "name", + rules: [{ required: true, message: "璇峰~鍐欏憳宸ュ鍚�!" }], type: "input", + readOnly: true, pageType: "dismissalApplication", labelCol: 6, width: 300, @@ -54,7 +55,6 @@ { label: "鍏嶈亴鍘熺敱", name: "reason", - rules: [{ required: true, message: "璇疯緭鍏ュ厤鑱屽師鐢�!" }], type: "textArea", pageType: "dismissalApplication", labelCol: 3, diff --git a/src/pages/HumanResourceManagement/nominationForAppointment/index.tsx b/src/pages/HumanResourceManagement/nominationForAppointment/index.tsx index 371f033..6b214f5 100644 --- a/src/pages/HumanResourceManagement/nominationForAppointment/index.tsx +++ b/src/pages/HumanResourceManagement/nominationForAppointment/index.tsx @@ -9,7 +9,7 @@ { label: "鍚嶇О", name: "applyName", - rules: [{ required: true, message: "璇疯緭鍏ュ悕绉�!" }], + rules: [{ required: true, message: "璇峰~鍐欏悕绉�!" }], type: "input", pageType: "nominationForAppointment", labelCol: 3, @@ -17,10 +17,11 @@ }, { label: "鍛樺伐濮撳悕", - name: "employeeName", - rules: [{ required: true, message: "璇疯緭鍏ュ憳宸ュ鍚�!" }], + name: "name", + rules: [{ required: true, message: "璇峰~鍐欏憳宸ュ鍚�!" }], type: "input", - pageType: "dismissalApplication", + readOnly: true, + pageType: "nominationForAppointment", labelCol: 6, width: 300, }, diff --git a/src/pages/HumanResourceManagement/resignationApplication/index.tsx b/src/pages/HumanResourceManagement/resignationApplication/index.tsx index 2bf415e..1428bf8 100644 --- a/src/pages/HumanResourceManagement/resignationApplication/index.tsx +++ b/src/pages/HumanResourceManagement/resignationApplication/index.tsx @@ -9,7 +9,7 @@ { label: "鍚嶇О", name: "applyName", - rules: [{ required: true, message: "璇疯緭鍏ュ悕绉�!" }], + rules: [{ required: true, message: "璇峰~鍐欏悕绉�!" }], type: "input", pageType: "resignationApplication", labelCol: 3, @@ -17,9 +17,10 @@ }, { label: "鍛樺伐濮撳悕", - name: "employeeName", - rules: [{ required: true, message: "璇疯緭鍏ュ憳宸ュ鍚�!" }], + name: "name", + rules: [{ required: true, message: "璇峰~鍐欏憳宸ュ鍚�!" }], type: "input", + readOnly: true, pageType: "resignationApplication", labelCol: 6, width: 300, @@ -27,7 +28,7 @@ { label: "鎵�灞為儴闂�", name: "department", - rules: [{ required: true, message: "璇疯緭鍏ユ墍灞為儴闂�!" }], + rules: [{ required: true, message: "璇峰~鍐欐墍灞為儴闂�!" }], type: "input", pageType: "resignationApplication", labelCol: 6, @@ -36,7 +37,7 @@ { label: "鎵�灞炶亴浣�", name: "position", - rules: [{ required: true, message: "璇疯緭鍏ユ墍灞為儴闂�!" }], + rules: [{ required: true, message: "璇峰~鍐欐墍灞為儴闂�!" }], type: "input", pageType: "resignationApplication", labelCol: 6, @@ -45,7 +46,7 @@ { label: "鎵�鍦ㄥ煄甯�", name: "address", - rules: [{ required: true, message: "璇疯緭鍏ユ墍鍦ㄥ煄甯�!" }], + rules: [{ required: true, message: "璇峰~鍐欐墍鍦ㄥ煄甯�!" }], type: "input", pageType: "resignationApplication", labelCol: 6, @@ -63,7 +64,7 @@ { label: "鐢宠鏃堕棿", name: "resignationTime", - rules: [{ required: true, message: "璇疯緭鍏ョ敵璇锋椂闂�!" }], + rules: [{ required: true, message: "璇峰~鍐欑敵璇锋椂闂�!" }], type: "date", pageType: "resignationApplication", labelCol: 6, @@ -72,7 +73,7 @@ { label: "绂昏亴鍘熷洜", name: "reason", - rules: [{ required: true, message: "璇疯緭鍏ョ鑱屽師鍥�!" }], + rules: [{ required: true, message: "璇峰~鍐欑鑱屽師鍥�!" }], type: "textArea", pageType: "resignationApplication", labelCol: 3, @@ -81,7 +82,7 @@ { label: "澶囨敞", name: "remarks", - rules: [{ required: true, message: "璇疯緭鍏ュ娉�!" }], + rules: [{ required: true, message: "璇峰~鍐欏娉�!" }], type: "textArea", pageType: "resignationApplication", labelCol: 3, diff --git a/src/pages/HumanResourceManagement/retirementManagement/index.tsx b/src/pages/HumanResourceManagement/retirementManagement/index.tsx index 0310518..3899b37 100644 --- a/src/pages/HumanResourceManagement/retirementManagement/index.tsx +++ b/src/pages/HumanResourceManagement/retirementManagement/index.tsx @@ -21,8 +21,9 @@ }, { label: "鍛樺伐濮撳悕", - name: "employeeName", + name: "name", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, @@ -31,14 +32,16 @@ label: "閮ㄩ棬鍚嶇О", name: "departmentName", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, }, { label: "韬唤璇佸彿", - name: "idCardNumber", + name: "idNum", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, @@ -47,14 +50,16 @@ label: "鎬у埆", name: "sex", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, }, { label: "绫嶈疮", - name: "origin", + name: "nativePlace", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, @@ -63,30 +68,34 @@ label: "闆囦剑绫诲瀷", name: "employmentType", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, }, { label: "鍑虹敓骞存湀", - name: "birthDate", + name: "birthday", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, }, { label: "姘戞棌", - name: "nationality", + name: "race", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, }, { label: "濠氬Щ鐘跺喌", - name: "maritalStatus", + name: "marriageStatus", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, @@ -95,14 +104,16 @@ label: "鏀挎不闈㈣矊", name: "politicalStatus", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, }, { label: "姣曚笟闄㈡牎", - name: "graduationSchool", + name: "graduateSchool", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, @@ -111,22 +122,25 @@ label: "涓撲笟", name: "major", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, }, { label: "鏂囧寲绋嬪害", - name: "culturalDegree", + name: "educationLevel", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, }, { label: "宸ョ", - name: "workType", + name: "jobType", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, @@ -135,14 +149,16 @@ label: "鑱岀О", name: "workTitle", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, }, { label: "鎵嬫満", - name: "mobile", + name: "mobilePhone", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, @@ -151,14 +167,16 @@ label: "鑱旂郴鍦板潃", name: "contactAddress", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, }, { label: "鐢靛瓙閭欢", - name: "email", + name: "eMail", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, @@ -167,14 +185,16 @@ label: "瀹跺涵浣忓潃", name: "homeAddress", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, }, { label: "鑱旂郴鐢佃瘽", - name: "contactPhone", + name: "phone", type: "input", + readOnly: true, pageType: "retirementManagement", labelCol: 6, width: 300, @@ -183,6 +203,7 @@ label: "澶囨敞", name: "remarks", type: "textArea", + readOnly: true, pageType: "retirementManagement", labelCol: 3, width: 730, diff --git a/src/pages/Welcome.tsx b/src/pages/Welcome.tsx index 5216d7f..b63bcb5 100644 --- a/src/pages/Welcome.tsx +++ b/src/pages/Welcome.tsx @@ -1,164 +1,664 @@ +import { postIdentityLoginLoginOa } from '@/services/WebApi/login'; +import { postOaRoleGetRoleList } from '@/services/WebApi/oaRole'; +import { postOaStaffGetStaffList, postOaStaffNewStaff } from '@/services/WebApi/oaStaff'; +import { DownOutlined } from '@ant-design/icons'; import { PageContainer } from '@ant-design/pro-components'; -import { useModel } from '@umijs/max'; -import { Card, theme } from 'antd'; -import React from 'react'; - -/** - * 姣忎釜鍗曠嫭鐨勫崱鐗囷紝涓轰簡澶嶇敤鏍峰紡鎶芥垚浜嗙粍浠� - * @param param0 - * @returns - */ -const InfoCard: React.FC<{ - title: string; - index: number; - desc: string; - href: string; -}> = ({ title, href, index, desc }) => { - const { useToken } = theme; - - const { token } = useToken(); - - return ( - <div - style={{ - backgroundColor: token.colorBgContainer, - boxShadow: token.boxShadow, - borderRadius: '8px', - fontSize: '14px', - color: token.colorTextSecondary, - lineHeight: '22px', - padding: '16px 19px', - minWidth: '220px', - flex: 1, - }} - > - <div - style={{ - display: 'flex', - gap: '4px', - alignItems: 'center', - }} - > - <div - style={{ - width: 48, - height: 48, - lineHeight: '22px', - backgroundSize: '100%', - textAlign: 'center', - padding: '8px 16px 16px 12px', - color: '#FFF', - fontWeight: 'bold', - backgroundImage: - "url('https://gw.alipayobjects.com/zos/bmw-prod/daaf8d50-8e6d-4251-905d-676a24ddfa12.svg')", - }} - > - {index} - </div> - <div - style={{ - fontSize: '16px', - color: token.colorText, - paddingBottom: 8, - }} - > - {title} - </div> - </div> - <div - style={{ - fontSize: '14px', - color: token.colorTextSecondary, - textAlign: 'justify', - lineHeight: '22px', - marginBottom: 8, - }} - > - {desc} - </div> - <a href={href} target="_blank" rel="noreferrer"> - 浜嗚В鏇村 {'>'} - </a> - </div> - ); -}; - +import { history, useModel } from '@umijs/max'; +import { Button, Col, DatePicker, Divider, Form, Input, Modal, Radio, Row, Select, Space, Tree } from 'antd'; +import TextArea from 'antd/es/input/TextArea'; +import { Router } from 'express'; +import React, { useEffect, useState } from 'react'; +import { flushSync } from 'react-dom'; +import moment from 'moment'; +import { postOaJobLevelGetJobLevelList } from '@/services/WebApi/oaJobLevel'; +import { postOaJobGetJobList } from '@/services/WebApi/oaJob'; +import { postOaDepartmentGetDepartmentList } from '@/services/WebApi/oaDepartment'; +import { postOaJobPositionGetJobPositionList } from '@/services/WebApi/oaJobPosition'; const Welcome: React.FC = () => { - const { token } = theme.useToken(); - const { initialState } = useModel('@@initialState'); + const [treeData, setTreeData] = useState([]); + const [expandedKeys, setExpandedKeys] = useState([]); + const { initialState, setInitialState, refresh } = useModel('@@initialState'); + const [dialogTitle, setDialogTitle] = useState('鏂板缓鐢ㄦ埛'); + const [addDialogVisible, setAddDialogVisible] = useState(false); + const [birthday, setBirthday] = useState("") + const [formRef] = Form.useForm(); + const [currentRoleId, setCurrentRoleId] = useState(''); + const [jobList, setJobList] = useState([]); + const [oaJobLevelList, setOaJobLevelList] = useState([]); + const [deplist, setDepList] = useState([]); + const [jobPositionList, setJobPositionList] = useState([]); + + const getStaffList = async (roleList) => { + const res = await postOaStaffGetStaffList({ start: 0, size: 100, orgId: 5 }); + const staffList = res.datas.map((item: any) => { + return { + key: item.id + 'staff', + title: item.name, + roleId: item.role?.id, + ...item, + }; + }); + for (let i = 0; i < roleList.length; i++) { + const item = roleList[i]; + item.children = staffList.filter((staff) => staff.roleId === item.id); + if (item.children && item.children.length > 0) { + item.children = item.children.map((staff) => { + return { + ...staff, + parent: item, + }; + }); + } + } + console.log(roleList, 'roleList'); + + setTreeData(roleList); + }; + const getRoleList = async () => { + const res = await postOaRoleGetRoleList({ start: 0, size: 100, orgId: 4 }); + if (res && res.datas.length > 0) { + const treeRoles = res.datas.map((item: any) => { + return { + key: item.id, + title: item.name, + children: [], + ...item, + }; + }); + + const keyList = treeRoles.map((item) => item.key); + setExpandedKeys(keyList); + getStaffList(treeRoles); + } + }; + + const selecStaff = (id, parent) => { + postIdentityLoginLoginOa({ staffId: id }).then((res) => { + flushSync(() => { + setInitialState((s: any) => ({ + ...s, + selectRole: parent, + })); + }); + // setInitialState({ + // ...initialState, + // selectRole: parent, + // }); + + refresh(); + history.push('/organizationDesign'); + }); + }; + + const addStaff = (id, parent) => { + setAddDialogVisible(true); + setDialogTitle('鏂板缓鐢ㄦ埛'); + setCurrentRoleId(id); + } + + const MyTreeNode = ({ title, children, id, parent }) => { + return ( + <div style={{ width: '200px', display: 'flex', justifyContent: 'space-between' }}> + <span>{title}</span> + + {children ? ( + <span + onClick={() => { + addStaff(id, parent); + }} + style={{ color: '#1890ff', cursor: 'pointer' }} + > + 鏂板鐢ㄦ埛 + </span> + ) : ( + <span + onClick={() => { + selecStaff(id, parent); + }} + style={{ color: '#1890ff', cursor: 'pointer' }} + > + 鎿嶄綔 + </span> + )} + </div> + ); + }; + + const handleOk = () => { + + formRef.validateFields().then((values) => { + + for (const key in values) { + if (values[key] === undefined) { + values[key] = "" + } + if (values[key] != null && typeof values[key] === 'object') { + values[key] = moment(values[key]).format('YYYY-MM-DD'); + } + } + const params = { + ...values, + sex: "1", + isOnJob: true, + roleId: currentRoleId, + PinYin: "pinyin", + positionSalary: 2, + performanceRates: 2, + performanceSalary: 2, + publicRates: 2, + socialRates: 2, + orgId: 5 + } + + postOaStaffNewStaff(params).then((res) => { + setAddDialogVisible(false); + getRoleList(); + }) + }) + } + const handleCancel = () => { + console.log('OK'); + setAddDialogVisible(false); + } + + const getJobPositionList = async () => { + const res = await postOaJobPositionGetJobPositionList({ start: 0, size: 100, orgId: 5 }); + const options = res.datas.map((item) => { + return { + value: item.id, + label: item.name, + } + }) + setJobPositionList(options); + console.log(res, "getDepList"); + } + const getDepList = async () => { + const res = await postOaDepartmentGetDepartmentList({ start: 0, size: 100, orgId: 5 }); + const options = res.datas.map((item) => { + return { + value: item.id, + label: item.name, + } + }) + setDepList(options); + console.log(res, "getDepList"); + } + const getJobLevelList = async () => { + const res = await postOaJobLevelGetJobLevelList({ start: 0, size: 100, orgId: 5 }); + const options = res.datas.map((item) => { + return { + value: item.id, + label: item.name, + } + }) + setOaJobLevelList(options); + console.log(res, "getJobLevelList"); + } + useEffect(() => { + getRoleList(); + getJobLevelList(); + getJobList(); + getDepList(); + getJobPositionList(); + console.log(initialState, "initialState"); + + }, []); + + + const getJobList = () => { + postOaJobGetJobList({ start: 0, size: 100, orgId: 5 }).then((res) => { + + const options = res.datas.map((item) => { + return { + value: item.id, + label: item.name, + } + }) + setJobList(options); + }) + } return ( <PageContainer> - <Card - style={{ - borderRadius: 8, - }} - styles={{ - body: { - backgroundImage: - initialState?.settings?.navTheme === 'realDark' - ? 'background-image: linear-gradient(75deg, #1A1B1F 0%, #191C1F 100%)' - : 'background-image: linear-gradient(75deg, #FBFDFF 0%, #F5F7FF 100%)', - }, - }} + <div> + <Tree + style={{ width: '300px' }} + titleRender={(nodeData) => <MyTreeNode {...nodeData} />} + defaultExpandAll + expandedKeys={expandedKeys} + showLine + switcherIcon={<DownOutlined />} + treeData={treeData} + /> + </div> + + <Modal + title={dialogTitle} + width={900} + onOk={handleOk} + open={addDialogVisible} + // confirmLoading={confirmLoading} + centered={true} + onCancel={handleCancel} > - <div - style={{ - backgroundPosition: '100% -30%', - backgroundRepeat: 'no-repeat', - backgroundSize: '274px auto', - backgroundImage: - "url('https://gw.alipayobjects.com/mdn/rms_a9745b/afts/img/A*BuFmQqsB2iAAAAAAAAAAAAAAARQnAQ')", - }} - > - <div - style={{ - fontSize: '20px', - color: token.colorTextHeading, - }} - > - 娆㈣繋浣跨敤 Ant Design Pro - </div> - <p - style={{ - fontSize: '14px', - color: token.colorTextSecondary, - lineHeight: '22px', - marginTop: 16, - marginBottom: 32, - width: '65%', - }} - > - Ant Design Pro 鏄竴涓暣鍚堜簡 umi锛孉nt Design 鍜� ProComponents - 鐨勮剼鎵嬫灦鏂规銆傝嚧鍔涗簬鍦ㄨ璁¤鑼冨拰鍩虹缁勪欢鐨勫熀纭�涓婏紝缁х画鍚戜笂鏋勫缓锛屾彁鐐煎嚭鍏稿瀷妯℃澘/涓氬姟缁勪欢/閰嶅璁捐璧勬簮锛岃繘涓�姝ユ彁鍗囦紒涓氱骇涓悗鍙颁骇鍝佽璁$爺鍙戣繃绋嬩腑鐨勩�庣敤鎴枫�忓拰銆庤璁¤�呫�忕殑浣撻獙銆� - </p> - <div - style={{ - display: 'flex', - flexWrap: 'wrap', - gap: 16, - }} - > - <InfoCard - index={1} - href="https://umijs.org/docs/introduce/introduce" - title="浜嗚В umi" - desc="umi 鏄竴涓彲鎵╁睍鐨勪紒涓氱骇鍓嶇搴旂敤妗嗘灦,umi 浠ヨ矾鐢变负鍩虹鐨勶紝鍚屾椂鏀寔閰嶇疆寮忚矾鐢卞拰绾﹀畾寮忚矾鐢憋紝淇濊瘉璺敱鐨勫姛鑳藉畬澶囷紝骞朵互姝よ繘琛屽姛鑳芥墿灞曘��" - /> - <InfoCard - index={2} - title="浜嗚В ant design" - href="https://ant.design" - desc="antd 鏄熀浜� Ant Design 璁捐浣撶郴鐨� React UI 缁勪欢搴擄紝涓昏鐢ㄤ簬鐮斿彂浼佷笟绾т腑鍚庡彴浜у搧銆�" - /> - <InfoCard - index={3} - title="浜嗚В Pro Components" - href="https://procomponents.ant.design" - desc="ProComponents 鏄竴涓熀浜� Ant Design 鍋氫簡鏇撮珮鎶借薄鐨勬ā鏉跨粍浠讹紝浠� 涓�涓粍浠跺氨鏄竴涓〉闈负寮�鍙戠悊蹇碉紝涓轰腑鍚庡彴寮�鍙戝甫鏉ユ洿濂界殑浣撻獙銆�" - /> - </div> + <div style={{ height: '80vh', overflow: 'auto' }}> + <Form form={formRef} layout="vertical" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}> + <Row> + <Col span={12}> + <Form.Item label="鍛樺伐濮撳悕" name="name" rules={[{ required: true, message: '璇疯緭鍏ュ憳宸ュ鍚�' }]}> + <Input /> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="閮ㄩ棬鍚嶇О" name="departmentId"> + <Select + options={deplist} + /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="韬唤璇佸彿" name="idNum" rules={[{ required: true, message: '璇疯緭鍏ュ憳宸ュ鍚�' }]}> + <Input /> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="鎬у埆" name="sex"> + <Select + defaultValue="1" + options={[ + { + value: '0', + label: '濂�', + }, + { + value: '1', + label: '鐢�', + }, + ]} + /> + </Form.Item> + </Col> + </Row> + + <Row> + <Col span={12}> + <Form.Item label="绫嶈疮" name="nativePlace"> + <Input /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="闆囦剑绫诲瀷" name="employmentType"> + <Select + defaultValue="1" + options={[ + { + value: '0', + label: '鍏艰亴', + }, + { + value: '1', + label: '鍏ㄨ亴', + }, + ]} + /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鍑虹敓骞存湀" name="birthday"> + <DatePicker value={birthday} /> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="姘戞棌" name="race"> + <Select + defaultValue="1" + options={[ + { + value: '1', + label: '姹夋棌', + }, + { + value: '2', + label: '钘忔棌', + }, + ]} + /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="濠氬Щ鐘跺喌" name="marriageStatus"> + <Select + defaultValue="1" + options={[ + { + value: '1', + label: '宸插', + }, + { + value: '2', + label: '鏈', + }, + ]} + /> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="鏀挎不闈㈣矊" name="politicalStatus"> + <Select + defaultValue="1" + options={[ + { + value: '1', + label: '缇や紬', + }, + { + value: '2', + label: '鍏氬憳', + }, + ]} + /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="姣曚笟闄㈡牎" name="graduateSchool"> + <Input /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="涓撲笟" name="major"> + <Input /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鑱岀О" name="title"> + <Select + defaultValue="1" + options={[ + { + value: '1', + label: '鏁欐巿', + }, + { + value: '2', + label: '鑰佸笀', + }, + ]} + /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="宸ョ" name="jobType"> + <Select + defaultValue="1" + options={[ + { + value: '1', + label: '鎶�宸�', + }, + { + value: '2', + label: '宸ョ▼甯�', + }, + ]} + /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鏂囧寲绋嬪害" name="educationLevel"> + <Select + defaultValue="1" + options={[ + { + value: '1', + label: '鍒濅腑', + }, + { + value: '2', + label: '楂樹腑', + }, + ]} + /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鎵嬫満" name="mobilePhone"> + <Input /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鑱旂郴鍦板潃" name="contactAddress"> + <Input /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鐢靛瓙閭欢" name="eMail"> + <Input /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="瀹跺涵浣忓潃" name="homeAddress"> + <Input /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鑱旂郴鐢佃瘽" name="phone"> + <Input /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={24}> + <Form.Item label="澶囨敞" name="remarks"> + <TextArea rows={4} /> + </Form.Item> + </Col> + </Row> + <Divider orientation="left">宀椾綅淇℃伅</Divider> + <Row> + <Col span={12}> + <Form.Item label="宸ュ彿" name="jobNumber"> + <Input /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鎵�鍦ㄥ煄甯�" name="city"> + <Select + defaultValue="1" + options={[ + { + value: '1', + label: '涓婃捣', + }, + { + value: '2', + label: '鍖椾含 ', + }, + ]} + /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="宀椾綅" name="station"> + <Select + options={jobPositionList} + /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鏄惁鍦ㄨ亴" name="isOnJob"> + <Radio.Group + options={[ + { value: 1, label: '绂昏亴' }, + { value: 2, label: '鍦ㄨ亴' }, + ]} + /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鍏ヨ亴鏃堕棿" name="joinDate"> + <DatePicker format="YYYY-MM-DD" /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="绂昏亴鏃堕棿" name="offJobDate"> + <DatePicker format="YYYY-MM-DD" /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={24}> + <Form.Item label="鏄惁閫�浼�" name="isRetire"> + <Radio.Group + options={[ + { value: 1, label: '鍚�' }, + { value: 2, label: '鏄�' }, + ]} + /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鍙傚姞宸ヤ綔鏃堕棿" name="beginWorkDate"> + <DatePicker format="YYYY-MM-DD" /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="甯﹁柂浼戝亣澶╂暟" name="payDayOffs"> + <Input /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鑱屼綅" name="jobId"> + <Select + options={jobList} + /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鑱岀骇" name="jobPositionId"> + <Select + options={oaJobLevelList} + /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鍩烘湰宸ヨ祫" name="name333"> + <Input /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鑱岀骇宸ヨ祫" name="positionSalary"> + <Input /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="缁╂晥绯绘暟" name="performanceRates"> + <Input /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="缁╂晥宸ヨ祫" name="performanceSalary"> + <Input /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="绀句繚鍩烘暟" name="socialRates"> + <Input /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鍏Н閲戝熀鏁�" name="publicRates"> + <Input /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="缁╂晥绛夌骇" name="performanceLevel"> + <Select + defaultValue="1" + options={[ + { + value: '1', + label: '1', + }, + ]} + /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鏅嬪崌娼滃姏" name="promoteLevel"> + <Select + defaultValue="1" + options={[ + { + value: '1', + label: 'A', + }, + ]} + /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="绀句繚璐︽埛" name="socialAccount"> + <Input /> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="閾惰璐﹀彿" name="bankAccount"> + <Input /> + </Form.Item> + </Col> + </Row> + </Form> </div> - </Card> + </Modal> </PageContainer> ); }; diff --git a/src/pages/organizationDesign/DepartmentalInformationConfiguration/index.tsx b/src/pages/organizationDesign/DepartmentalInformationConfiguration/index.tsx index 937655a..86bba8a 100644 --- a/src/pages/organizationDesign/DepartmentalInformationConfiguration/index.tsx +++ b/src/pages/organizationDesign/DepartmentalInformationConfiguration/index.tsx @@ -1,24 +1,34 @@ import { postOaContractGetContractList } from '@/services/WebApi/contract'; -import { PlusOutlined, UserOutlined } from '@ant-design/icons'; +import { ExclamationCircleOutlined, PlusOutlined, UserOutlined } from '@ant-design/icons'; import { PageContainer, ProTable } from '@ant-design/pro-components'; -import { Button, Col, Form, Input, Modal, Row, Select, Space } from 'antd'; +import { Button, Col, Form, Input, message, Modal, Row, Select, Space } from 'antd'; import TextArea from 'antd/es/input/TextArea'; -import React, { useRef, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import styles from './index.less'; -import { postOaDepartmentGetDepartmentList } from '@/services/WebApi/oaDepartment'; +import { postOaDepartmentDelDepartment, postOaDepartmentGetDepartmentList, postOaDepartmentNewDepartment, postOaDepartmentUpdateDepartment } from '@/services/WebApi/oaDepartment'; +import { useModel } from '@umijs/max'; +import { postOaOrgGetOrgList } from '@/services/WebApi/oaOrg'; +import { postIdentityDepartmentNewDepartment } from '@/services/WebApi/department'; +import SelectUser from '@/components/selectUser'; +import modal from 'antd/es/modal'; const DepartmentalInformationConfiguration: React.FC = () => { + const { initialState, setInitialState } = useModel('@@initialState'); + const [dialogTitle, setDialogTitle] = useState(''); const [addDialogVisible, setAddDialogVisible] = useState(false); - + const [selectUserDialogVisible, setSelectUserDialogVisible] = useState(false); + const [userDialogTitle, setUserDialogTitle] = useState("閫夋嫨閮ㄩ棬棰嗗"); + const [depLeader, setDepLeader] = useState<any>(null); + const [currentEditDepartment, setCurrentEditDepartment] = useState<any>(null); const actionRef = useRef(null); const [formRef] = Form.useForm(); const columns = [ { title: '閮ㄩ棬鍚嶇О', - key: 'code', - dataIndex: 'code', + key: 'name', + dataIndex: 'name', align: 'center', }, { @@ -27,6 +37,9 @@ dataIndex: 'name', align: 'center', search: false, + render: (_, rowData) => { + return rowData?.manager?.name || "-" + } }, { title: '閮ㄩ棬绫诲瀷', @@ -37,17 +50,20 @@ }, { title: '閮ㄩ棬鐢佃瘽', - key: 'date1', - dataIndex: 'date1', + key: 'phone', + dataIndex: 'phone', align: 'center', search: false, }, { title: '涓婄骇閮ㄩ棬', - key: 'date2', - dataIndex: 'date2', + key: 'parent', + dataIndex: 'parent', align: 'center', search: false, + render: (_, rowData) => { + return rowData?.parent?.name || "-" + } }, { @@ -64,33 +80,116 @@ search: false, render: (_, rowData) => ( <Space size="middle"> - <a onClick={() => {}} style={{ cursor: 'pointer', margin: ' 0 5px' }}> + <a onClick={() => { + formRef.setFieldsValue(rowData); + setDepLeader(rowData.manager) + formRef.setFieldValue('managerId', rowData.manager.name) + setDialogTitle('缂栬緫閮ㄩ棬'); + setCurrentEditDepartment(rowData); + setAddDialogVisible(true); + }} style={{ cursor: 'pointer', margin: ' 0 5px' }}> 缂栬緫 </a> + + <a onClick={() => { + handleDelete(rowData.id) + }} style={{ cursor: 'pointer', margin: ' 0 5px', color: 'red' }}> 鍒犻櫎</a> </Space> ), }, ]; - const handleOk = () => {}; + + useEffect(() => { + if (!addDialogVisible) { + formRef.resetFields(); + } + }, [addDialogVisible]) + + + //鍒犻櫎閮ㄩ棬 + const handleDelete = (id: number) => { + modal.confirm({ + title: '鍒犻櫎', + icon: <ExclamationCircleOutlined />, + content: '鏄惁鍒犻櫎璇ラ儴闂紵', + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + postOaDepartmentDelDepartment({ ids: [id] }).then((res) => { + message.success('鍒犻櫎鎴愬姛'); + actionRef.current?.reload(); + }) + }, + }); + } + + //鏂板or缂栬緫 + const handleOk = () => { + formRef.validateFields().then((values) => { + const body = { + orgId: initialState?.appInfo?.org?.id, + ...values + } + for (let key in body) { + if (body[key] === undefined) { + body[key] = '' + } + } + body.parentId = 14 + body.type = "Normal" + body.managerId = depLeader.id + if (dialogTitle == '缂栬緫閮ㄩ棬') { + body.id = currentEditDepartment.id + postOaDepartmentUpdateDepartment(body).then((res) => { + console.log(res, 'res'); + setAddDialogVisible(false); + message.success('缂栬緫鎴愬姛'); + actionRef.current?.reload(); + }) + } else { + postOaDepartmentNewDepartment(body).then((res) => { + console.log(res, 'res'); + setAddDialogVisible(false); + message.success('娣诲姞鎴愬姛'); + actionRef.current?.reload(); + }) + } + + }) + }; const handleCancel = () => { setAddDialogVisible(false); }; const getTableData = (params: { current: number; pageSize: number }) => { console.log(params, 'params'); + let searchList = []; + if (params?.name) { + searchList = [{ + field: 'name', keywords: params.name, compareType: 'Contains', domain: "", + type: "", + fieldBaseType: "", + subSearches: [ + ] + }]; + } const body = { start: (params.current - 1) * params.pageSize, size: params.pageSize, filterList: [], - searchList: [], + searchList, + orgId: initialState?.appInfo?.org?.id, }; + return postOaDepartmentGetDepartmentList(body).then((res) => { console.log(res, 'res'); return { data: res.datas, - total: res.data.totalSize, + total: res.totalSize, }; }); }; + + return ( <PageContainer> <ProTable @@ -119,22 +218,21 @@ width={900} onOk={handleOk} open={addDialogVisible} - // confirmLoading={confirmLoading} onCancel={handleCancel} > <div className={styles.addDialog}> <Form form={formRef} layout="vertical" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}> <Row> <Col span={12}> - <Form.Item label="閮ㄩ棬鍚嶇О" name="name"> + <Form.Item label="閮ㄩ棬鍚嶇О" name="name" rules={[{ required: true, message: '璇疯緭鍏ラ儴闂ㄥ悕绉�' }]}> <Input /> </Form.Item> </Col> <Col span={12}> <Form.Item label="閮ㄩ棬绫诲瀷" - name="name" - rules={[{ required: true, message: '璇疯緭鍏ユ満鏋勫悕绉�' }]} + name="type" + rules={[{ required: true, message: '璇烽�夋嫨閮ㄩ棬绫诲瀷' }]} > <Select defaultValue="lucy" @@ -163,12 +261,14 @@ </Row> <Row> <Col span={12}> - <Form.Item label="閮ㄩ棬棰嗗" name="name"> - <Input suffix={<UserOutlined className="site-form-item-icon" />} /> + <Form.Item label="閮ㄩ棬棰嗗" name="managerId"> + <Input suffix={<UserOutlined onClick={() => { + setSelectUserDialogVisible(true) + }} className="site-form-item-icon" />} /> </Form.Item> </Col> <Col span={12}> - <Form.Item label="涓婄骇閮ㄩ棬" name="name"> + <Form.Item label="涓婄骇閮ㄩ棬" name="parentId"> <Select defaultValue="lucy" options={[ @@ -197,14 +297,14 @@ <Row> <Col span={24}> - <Form.Item label="閮ㄩ棬鐢佃瘽" name="name"> + <Form.Item label="閮ㄩ棬鐢佃瘽" name="phone"> <Input /> </Form.Item> </Col> </Row> <Row> <Col span={24}> - <Form.Item label="閮ㄩ棬鎻忚堪" name="name"> + <Form.Item label="閮ㄩ棬鎻忚堪" name="description"> <TextArea rows={4} /> </Form.Item> </Col> @@ -212,6 +312,17 @@ </Form> </div> </Modal> + + { + selectUserDialogVisible && <SelectUser title={userDialogTitle} onConfirm={(user) => { + formRef.setFieldValue('managerId', user.name) + setDepLeader(user) + setSelectUserDialogVisible(false) + }} onCancel={() => { + setSelectUserDialogVisible(false) + }} /> + } + </PageContainer> ); }; diff --git a/src/pages/organizationDesign/JobInformationConfiguration/index.tsx b/src/pages/organizationDesign/JobInformationConfiguration/index.tsx index 08e4ffb..d46d59b 100644 --- a/src/pages/organizationDesign/JobInformationConfiguration/index.tsx +++ b/src/pages/organizationDesign/JobInformationConfiguration/index.tsx @@ -1,14 +1,20 @@ import { postOaContractGetContractList } from '@/services/WebApi/contract'; -import { PlusOutlined } from '@ant-design/icons'; +import { ExclamationCircleOutlined, PlusOutlined } from '@ant-design/icons'; import { PageContainer, ProTable } from '@ant-design/pro-components'; -import { Button, Col, Form, Input, Modal, Row, Select, Space } from 'antd'; +import { Button, Col, Form, Input, message, Modal, Row, Select, Space } from 'antd'; import TextArea from 'antd/es/input/TextArea'; -import React, { useRef, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import styles from './index.less'; +import { postOaJobDelJob, postOaJobGetJobList, postOaJobNewJob, postOaJobUpdateJob } from '@/services/WebApi/oaJob'; +import { useModel } from '@umijs/max'; +import modal from 'antd/es/modal'; -const DepartmentalInformationConfiguration: React.FC = () => { +const JobInformationConfiguration: React.FC = () => { + + const { initialState, setInitialState } = useModel('@@initialState'); const [dialogTitle, setDialogTitle] = useState(''); const [addDialogVisible, setAddDialogVisible] = useState(false); + const [currentEditJob, setCurrentEditJob] = useState<any>(null); const actionRef = useRef(null); const [formRef] = Form.useForm(); @@ -29,14 +35,14 @@ search: false, }, { - title: '鑱岀骇涓嬬嚎', + title: '鑱岀骇涓嬮檺', key: 'type', dataIndex: 'type', align: 'center', search: false, }, { - title: '鑱岀骇涓婄嚎', + title: '鑱岀骇涓婇檺', key: 'date1', dataIndex: 'date1', align: 'center', @@ -44,8 +50,8 @@ }, { title: '涓婄骇閮ㄩ棬', - key: 'date2', - dataIndex: 'date2', + key: 'parentJobId', + dataIndex: 'parentJobId', align: 'center', search: false, }, @@ -64,14 +70,75 @@ search: false, render: (_, rowData) => ( <Space size="middle"> - <a onClick={() => {}} style={{ cursor: 'pointer', margin: ' 0 5px' }}> + <a onClick={() => { + formRef.setFieldsValue(rowData); + setDialogTitle('缂栬緫鑱屼綅'); + setCurrentEditJob(rowData); + setAddDialogVisible(true); + }} style={{ cursor: 'pointer', margin: ' 0 5px' }}> 缂栬緫 </a> + <a onClick={() => { + handleDelete(rowData.id) + }} style={{ cursor: 'pointer', margin: ' 0 5px', color: 'red' }}> 鍒犻櫎</a> </Space> ), }, ]; - const handleOk = () => {}; + + useEffect(() => { + if (!addDialogVisible) { + formRef.resetFields(); + } + }, [addDialogVisible]) + + + //鍒犻櫎閮ㄩ棬 + const handleDelete = (id: number) => { + modal.confirm({ + title: '鍒犻櫎', + icon: <ExclamationCircleOutlined />, + content: '鏄惁鍒犻櫎璇ヨ亴浣嶏紵', + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + postOaJobDelJob({ ids: [id] }).then((res) => { + message.success('鍒犻櫎鎴愬姛'); + actionRef.current?.reload(); + }) + }, + }); + } + + + const handleOk = () => { + formRef.validateFields().then((values) => { + const body = { + ...values, + orgId: initialState?.appInfo?.org?.id, + }; + console.log(body, 'body'); + body.parentJobId = null; + body.type = 'Normal'; + + if (dialogTitle === '鏂板缓鑱屼綅') { + postOaJobNewJob(body).then((res) => { + console.log(res, 'res'); + actionRef.current?.reload(); + setAddDialogVisible(false); + message.success('娣诲姞鎴愬姛'); + }) + } else { + body.id = currentEditJob.id + postOaJobUpdateJob(body).then((res) => { + actionRef.current?.reload(); + setAddDialogVisible(false); + message.success('缂栬緫鎴愬姛'); + }) + } + + }) + }; const handleCancel = () => { setAddDialogVisible(false); }; @@ -82,12 +149,13 @@ size: params.pageSize, filterList: [], searchList: [], + orgId: initialState?.appInfo?.org?.id, }; - return postOaContractGetContractList(body).then((res) => { + return postOaJobGetJobList(body).then((res) => { console.log(res, 'res'); return { data: res.datas, - total: res.data.totalSize, + total: res.totalSize, }; }); }; @@ -106,7 +174,7 @@ icon={<PlusOutlined />} onClick={() => { setAddDialogVisible(true); - setDialogTitle('鏂板缓鍚堝悓'); + setDialogTitle('鏂板缓鑱屼綅'); }} type="primary" > @@ -127,19 +195,19 @@ <Form form={formRef} layout="vertical" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}> <Row> <Col span={12}> - <Form.Item label="鑱屼綅缂栧彿" name="name"> + <Form.Item label="鑱屼綅缂栧彿" name="code" rules={[{ required: true, message: '璇疯緭鍏ヨ亴浣嶇紪鍙�' }]}> <Input /> </Form.Item> </Col> <Col span={12}> - <Form.Item label="鑱屼綅鍚嶇О" name="name"> + <Form.Item label="鑱屼綅鍚嶇О" name="name" rules={[{ required: true, message: '璇疯緭鍏ヨ亴浣嶅悕绉�' }]}> <Input /> </Form.Item> </Col> </Row> <Row> <Col span={12}> - <Form.Item label="涓婄骇鑱屼綅" name="name"> + <Form.Item label="涓婄骇鑱屼綅" name="parentJobId"> <Select defaultValue="lucy" options={[ @@ -166,7 +234,7 @@ </Col> <Col span={12}> <Form.Item label="鑱屼綅涓嬮檺" name="name"> - <Input /> + <Input disabled /> </Form.Item> </Col> </Row> @@ -174,12 +242,12 @@ <Row> <Col span={12}> <Form.Item label="鑱屼綅涓婇檺" name="name"> - <Input /> + <Input disabled /> </Form.Item> </Col> <Col span={12}> - <Form.Item label="宸ヨ祫璇︽儏" name="name"> + <Form.Item label="宸ヨ祫璇︽儏" name="baseSalary"> {/* <TextArea rows={4} /> */} <Input /> </Form.Item> @@ -187,14 +255,14 @@ </Row> <Row> <Col span={24}> - <Form.Item label="鍩烘湰宸ヨ祫鍙傝��" name="name"> + <Form.Item label="鍩烘湰宸ヨ祫鍙傝��" name="baseSalary" rules={[{ required: true, message: '璇疯緭鍏ュ熀鏈伐璧勫弬鑰�' }]}> <Input /> </Form.Item> </Col> </Row> <Row> <Col span={24}> - <Form.Item label="鑱屼綅鍒嗙被" name="name"> + <Form.Item label="鑱屼綅鍒嗙被" name="type" rules={[{ required: true, message: '璇烽�夋嫨鑱屼綅鍒嗙被' }]}> <Select defaultValue="lucy" options={[ @@ -222,7 +290,7 @@ </Row> <Row> <Col span={24}> - <Form.Item label="澶囨敞" name="name"> + <Form.Item label="澶囨敞" name="remarks"> <TextArea rows={4} /> </Form.Item> </Col> @@ -234,4 +302,4 @@ ); }; -export default DepartmentalInformationConfiguration; +export default JobInformationConfiguration; diff --git a/src/pages/organizationDesign/OrganizationalStructureConfiguration/index.tsx b/src/pages/organizationDesign/OrganizationalStructureConfiguration/index.tsx index f1073a5..dba0f78 100644 --- a/src/pages/organizationDesign/OrganizationalStructureConfiguration/index.tsx +++ b/src/pages/organizationDesign/OrganizationalStructureConfiguration/index.tsx @@ -3,223 +3,183 @@ import { PageContainer, ProTable } from '@ant-design/pro-components'; import { Button, Col, DatePicker, Form, Input, Modal, Row, Select, Tabs } from 'antd'; import TextArea from 'antd/es/input/TextArea'; -import React, { useRef, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import styles from './index.less'; +import { useModel } from '@umijs/max'; const OrganizationalStructureConfiguration: React.FC = () => { - const [dialogTitle, setDialogTitle] = useState(''); - const [addDialogVisible, setAddDialogVisible] = useState(false); - - const actionRef = useRef(null); + const { initialState, setInitialState } = useModel('@@initialState'); const [formRef] = Form.useForm(); + useEffect(() => { + console.log(initialState); + formRef.setFieldsValue({ + name: initialState?.appInfo.org?.name, + }) + }, []) - const columns = [ - { - title: '鍚堝悓缂栧彿', - key: 'code', - dataIndex: 'code', - align: 'center', - search: false, - }, - { - title: '鍚堝悓鍚嶇О', - key: 'name', - dataIndex: 'name', - align: 'center', - search: false, - }, - { - title: '鍚堝悓绫诲瀷', - key: 'type', - dataIndex: 'type', - align: 'center', - valueEnum: { - all: { text: '鍏ㄩ儴' }, - 浠樺皬灏�: { text: '浠樺皬灏�' }, - 鏇蹭附涓�: { text: '鏇蹭附涓�' }, - 鏋椾笢涓�: { text: '鏋椾笢涓�' }, - 闄堝竻甯�: { text: '闄堝竻甯�' }, - 鍏兼煇鏌�: { text: '鍏兼煇鏌�' }, - }, - }, - { - title: '绛捐鏃ユ湡', - key: 'date1', - dataIndex: 'date1', - align: 'center', - search: false, - }, - { - title: '鐢熸晥鏃ユ湡', - key: 'date2', - dataIndex: 'date2', - align: 'center', - search: false, - }, - { - title: '缁堟鏃ユ湡', - key: 'date3', - dataIndex: 'date3', - align: 'center', - search: false, - }, - { - title: '鐘舵��', - key: 'status', - dataIndex: 'status', - align: 'center', - search: false, - }, - ]; - const handleOk = () => {}; - const handleCancel = () => { - setAddDialogVisible(false); - }; - const getTableData = (params: { current: number; pageSize: number }) => { - console.log(params, 'params'); - const body = { - start: (params.current - 1) * params.pageSize, - size: params.pageSize, - filterList: [], - searchList: [], - }; - return postOaContractGetContractList(body).then((res) => { - console.log(res, 'res'); - return { - data: res.datas, - total: res.data.totalSize, - }; - }); - }; return ( <PageContainer> - <Tabs style={{ minHeight: 500 }}> - <Tabs.TabPane key="1" tab={`鎴戠殑鍚堝悓`}> - <ProTable - headerTitle="鍚堝悓绠$悊" - actionRef={actionRef} - rowKey="id" - columns={columns} - request={getTableData} - toolBarRender={() => [ - <Button - key="button" - icon={<PlusOutlined />} - onClick={() => { - setAddDialogVisible(true); - setDialogTitle('鏂板缓鍚堝悓'); - }} - type="primary" + <div className={styles.addDialog}> + <Form form={formRef} layout="vertical" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}> + <Row> + <Col span={12}> + <Form.Item + label="缁勭粐鏈烘瀯鍚嶇О" + name="name" + rules={[{ required: true, message: '璇疯緭鍏ユ満鏋勫悕绉�' }]} > - 鏂板缓 - </Button>, - ]} - /> - </Tabs.TabPane> - <Tabs.TabPane key="2" tab={`鎴戠殑鍚堝悓`}> - 鎴戠殑鍚堝悓 - </Tabs.TabPane> - <Tabs.TabPane key="3" tab={`蹇埌鏈熷悎鍚宍}> - 蹇埌鏈熷悎鍚� - </Tabs.TabPane> - </Tabs> - - <Modal - title={dialogTitle} - width={900} - onOk={handleOk} - open={addDialogVisible} - // confirmLoading={confirmLoading} - onCancel={handleCancel} - > - <div className={styles.addDialog}> - <Form form={formRef} layout="vertical" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}> - <Row> - <Col span={12}> - <Form.Item - label="鍛樺伐濮撳悕" - name="name" - rules={[{ required: true, message: '璇疯緭鍏ユ満鏋勫悕绉�' }]} - > - <Input suffix={<UserOutlined className="site-form-item-icon" />} /> - </Form.Item> - </Col> - <Col span={12}> - <Form.Item - label="鎵�灞為儴闂�" - name="name" - rules={[{ required: true, message: '璇疯緭鍏ユ満鏋勫悕绉�' }]} - > - <Input /> - </Form.Item> - </Col> - </Row> - <Row> - <Col span={12}> - <Form.Item - label="鍚堝悓绫诲瀷" - name="name" - rules={[{ required: true, message: '璇疯緭鍏ユ満鏋勫悕绉�' }]} - > - <Select - defaultValue="lucy" - options={[ - { - value: 'jack', - label: 'Jack', - }, - { - value: 'lucy', - label: 'Lucy', - }, - { - value: 'disabled', - disabled: true, - label: 'Disabled', - }, - { - value: 'Yiminghe', - label: 'yiminghe', - }, - ]} - /> - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label="绛捐鏃ユ湡" name="name"> - <DatePicker style={{ width: '100%' }} /> - </Form.Item> - </Col> - </Row> - <Row> - <Col span={12}> - <Form.Item label="鐢熸晥鏃ユ湡" name="name"> - <DatePicker style={{ width: '100%' }} /> - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label="姝e父缁堟鏃ユ湡" name="name"> - <DatePicker style={{ width: '100%' }} /> - </Form.Item> - </Col> - </Row> - <Row> - <Col span={24}> - <Form.Item label="鍏宠仈鏂囦欢" name="name"> - <DatePicker style={{ width: '100%' }} /> - </Form.Item> - </Col> - </Row> - <Row> - <Col span={24}> - <Form.Item label="澶囨敞" name="name"> - <TextArea rows={4} /> - </Form.Item> - </Col> - </Row> - </Form> - </div> - </Modal> + <Input suffix={<UserOutlined className="site-form-item-icon" />} /> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item + label="鍏叡閮ㄩ棬鎬ц川" + name="name" + rules={[{ required: true, message: '璇疯緭鍏ユ満鏋勫悕绉�' }]} + > + <Select + defaultValue="lucy" + options={[ + { + value: 'jack', + label: 'Jack', + }, + { + value: 'lucy', + label: 'Lucy', + }, + { + value: 'disabled', + disabled: true, + label: 'Disabled', + }, + { + value: 'Yiminghe', + label: 'yiminghe', + }, + ]} + /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item + label="鎵�鍦ㄥ煄甯�" + name="city" + rules={[{ required: true, message: '璇疯緭鍏ユ満鏋勫悕绉�' }]} + > + <Select + defaultValue="lucy" + options={[ + { + value: 'jack', + label: 'Jack', + }, + { + value: 'lucy', + label: 'Lucy', + }, + { + value: 'disabled', + disabled: true, + label: 'Disabled', + }, + { + value: 'Yiminghe', + label: 'yiminghe', + }, + ]} + /> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="缁勭粐瑙勬ā" name="name"> + <Select + defaultValue="lucy" + options={[ + { + value: 'jack', + label: 'Jack', + }, + { + value: 'lucy', + label: 'Lucy', + }, + { + value: 'disabled', + disabled: true, + label: 'Disabled', + }, + { + value: 'Yiminghe', + label: 'yiminghe', + }, + ]} + /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="璐熻矗浜�" name="manager"> + <Input /> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="鑱旂郴鐢佃瘽" name="phone"> + <Input /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鑱旂郴鍦板潃" name="address"> + <Input /> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="鐢靛瓙閭" name="name"> + <Input /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="缃戝潃" name="webSite"> + <Input /> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="涓婄骇鏈哄叧" name="manageOrg"> + <Input /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={24}> + <Form.Item label="缁勭粐鑱岃矗" name="duty"> + <TextArea rows={4} /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={24}> + <Form.Item label="缁勭粐鏂囧寲" name="culture"> + <TextArea rows={4} /> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={24}> + <Form.Item label="缁勭粐鏍稿績浠峰�艰" name="name"> + <TextArea rows={4} /> + </Form.Item> + </Col> + </Row> + </Form> + + </div> </PageContainer> ); }; diff --git a/src/pages/organizationDesign/departmentalEmployeeInformation/index.less b/src/pages/organizationDesign/departmentalEmployeeInformation/index.less new file mode 100644 index 0000000..b4a9564 --- /dev/null +++ b/src/pages/organizationDesign/departmentalEmployeeInformation/index.less @@ -0,0 +1,23 @@ +.container { + display: flex; + height: calc(100vh - 340px); + + .leftTree { + width: 300px; + height: 100%; + border-right: 1px solid #e8e8e8; + + .leftTreeTitle { + height: 50px; + line-height: 50px; + padding-left: 20px; + border-bottom: 1px solid #e8e8e8; + } + } + + .rightTable { + width: calc(100% - 400px); + margin-left: 100px; + overflow-y: scroll; + } +} diff --git a/src/pages/organizationDesign/departmentalEmployeeInformation/index.tsx b/src/pages/organizationDesign/departmentalEmployeeInformation/index.tsx new file mode 100644 index 0000000..09daedd --- /dev/null +++ b/src/pages/organizationDesign/departmentalEmployeeInformation/index.tsx @@ -0,0 +1,389 @@ +import { PageContainer } from "@ant-design/pro-components" +import styles from './index.less' +import { Col, DatePicker, Divider, Form, Input, Radio, Row, Select, Tree } from "antd" +import { useEffect, useState } from "react"; +import { DownOutlined } from "@ant-design/icons"; +import { postOaDepartmentGetDepartmentList } from "@/services/WebApi/oaDepartment"; +import { postOaStaffGetStaffList } from "@/services/WebApi/oaStaff"; +import TextArea from "antd/es/input/TextArea"; + + +const departmentalEmployeeInformation: React.FC = () => { + const [expandedKeys, setExpandedKeys] = useState([]); + const [treeData, setTreeData] = useState([]); + const [deplist, setDepList] = useState([]); + const [birthday, setBirthday] = useState("") + const [jobList, setJobList] = useState([]); + const [oaJobLevelList, setOaJobLevelList] = useState([]); + const [formRef] = Form.useForm(); + const [jobPositionList, setJobPositionList] = useState([]); + const [currentTreeNode, setCurrentTreeNode] = useState({}); + useEffect(() => { + getDepList(); + }, []) + useEffect(() => { + console.log(currentTreeNode, "currentTreeNode"); + if (currentTreeNode && currentTreeNode?.roleId) { + formRef.setFieldsValue(currentTreeNode) + } + }, [currentTreeNode]) + + const findDepFun = (list, staff) => { + for (let i = 0; i < list.length; i++) { + const item = list[i]; + if (item.id === staff.department?.id) { + item.children.push(staff); + return; + } + } + } + const getStaffList = async (roleList) => { + const res = await postOaStaffGetStaffList({ start: 0, size: 100, orgId: 5 }); + const staffList = res.datas.map((item: any) => { + return { + key: item.id + 'staff', + title: item.name, + roleId: item.role?.id, + ...item, + }; + }); + for (let i = 0; i < staffList.length; i++) { + const item = staffList[i]; + findDepFun(roleList, item); + } + console.log(staffList, "staffList"); + console.log(roleList, "roleList"); + return roleList; + } + const getDepList = async () => { + const res = await postOaDepartmentGetDepartmentList({ start: 0, size: 100, orgId: 5 }); + const treeDep = res.datas.map((item: any) => { + return { + key: item.id, + title: item.name, + children: [], + ...item, + }; + }); + for (let i = 0; i < treeDep.length; i++) { + const item = treeDep[i]; + if (item.parent) { + const parent = treeDep.find((f) => f.id === item.parent?.id); + parent.children.push(item); + } + } + const haveStaffList = await getStaffList(treeDep); + console.log(haveStaffList, "haveStaffList"); + const treeData = haveStaffList.filter((item) => !item.parent); + console.log(treeData, "treeData"); + const keyList = treeDep.map((item) => item.key); + setTreeData(treeData); + setExpandedKeys(keyList); + setDepList(treeDep); + } + return ( + <PageContainer> + <div className={styles.container} style={{ padding: 24 }}> + <div className={styles.leftTree}> + <Tree + style={{ width: '300px' }} + defaultExpandAll + expandedKeys={expandedKeys} + showLine + switcherIcon={<DownOutlined />} + treeData={treeData} + onSelect={(selectedKeys, info) => { + console.log(selectedKeys, info); + setCurrentTreeNode(info.node); + }} + /> + </div> + <div className={styles.rightTable}> + { + currentTreeNode && + <Form form={formRef} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} disabled> + <Row> + <Col span={12}> + <Form.Item label="鍛樺伐濮撳悕" name="name" rules={[{ required: true, message: '璇疯緭鍏ュ憳宸ュ鍚�' }]}> + <span>{currentTreeNode?.name}</span> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="閮ㄩ棬鍚嶇О" name="departmentId"> + <span>{currentTreeNode?.department?.name}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="韬唤璇佸彿" name="idNum" rules={[{ required: true, message: '璇疯緭鍏ュ憳宸ュ鍚�' }]}> + <span>{currentTreeNode?.idNum}</span> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="鎬у埆" name="sex"> + <span>{currentTreeNode?.sex == 1 ? '鐢�' : '濂�'}</span> + </Form.Item> + </Col> + </Row> + + <Row> + <Col span={12}> + <Form.Item label="绫嶈疮" name="nativePlace"> + <span>{currentTreeNode?.nativePlace}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="闆囦剑绫诲瀷" name="employmentType"> + <span>{currentTreeNode?.employmentType}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鍑虹敓骞存湀" name="birthday"> + <span>{currentTreeNode?.birthday}</span> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="姘戞棌" name="race"> + <span>{currentTreeNode?.race}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="濠氬Щ鐘跺喌" name="marriageStatus"> + <span>{currentTreeNode?.marriageStatus}</span> + </Form.Item> + </Col> + <Col span={12}> + <Form.Item label="鏀挎不闈㈣矊" name="politicalStatus"> + <span>{currentTreeNode?.politicalStatus}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="姣曚笟闄㈡牎" name="graduateSchool"> + <span>{currentTreeNode?.graduateSchool}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="涓撲笟" name="major"> + <span>{currentTreeNode?.major}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鑱岀О" name="title"> + <span>{currentTreeNode?.title}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="宸ョ" name="jobType"> + <span>{currentTreeNode?.jobType}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鏂囧寲绋嬪害" name="educationLevel"> + <span>{currentTreeNode?.educationLevel}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鎵嬫満" name="mobilePhone"> + <span>{currentTreeNode?.mobilePhone}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鑱旂郴鍦板潃" name="contactAddress"> + <span>{currentTreeNode?.contactAddress}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鐢靛瓙閭欢" name="eMail"> + <span>{currentTreeNode?.eMail}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="瀹跺涵浣忓潃" name="homeAddress"> + <span>{currentTreeNode?.homeAddress}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鑱旂郴鐢佃瘽" name="phone"> + <span>{currentTreeNode?.phone}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="澶囨敞" name="remarks"> + <span>{currentTreeNode?.remarks}</span> + </Form.Item> + </Col> + </Row> + <Divider orientation="left">宀椾綅淇℃伅</Divider> + <Row> + <Col span={12}> + <Form.Item label="宸ュ彿" name="jobNumber"> + <span>{currentTreeNode?.jobNumber}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鎵�鍦ㄥ煄甯�" name="city"> + <span>{currentTreeNode?.jobPositionInfo?.city}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="宀椾綅" name="station"> + <span>{currentTreeNode?.jobPositionInfo?.jobPosition?.name}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鏄惁鍦ㄨ亴" name="isOnJob"> + <span>{currentTreeNode?.jobPositionInfo?.isOnJob ? '鏄�' : '鍚�'}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鍏ヨ亴鏃堕棿" name="joinDate"> + <span>{currentTreeNode?.jobPositionInfo?.joinDate}</span> + </Form.Item> + </Col> + + + <Col span={12}> + <Form.Item label="绂昏亴鏃堕棿" name="offJobDate"> + <span>{currentTreeNode?.jobPositionInfo?.offJobDate}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鏄惁閫�浼�" name="isRetire"> + <span>{currentTreeNode?.isRetire ? '鏄�' : '鍚�'}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鍙傚姞宸ヤ綔鏃堕棿" name="beginWorkDate"> + <span>{currentTreeNode?.jobPositionInfo?.beginWorkDate}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="甯﹁柂浼戝亣澶╂暟" name="payDayOffs"> + <span>{currentTreeNode?.jobPositionInfo?.payDayOffs}澶�</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鑱屼綅" name="jobId"> + <span>{currentTreeNode?.jobPositionInfo?.job.name}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鑱岀骇" name="jobPositionId"> + <span></span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="鍩烘湰宸ヨ祫" name="name333"> + <span></span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鑱岀骇宸ヨ祫" name="positionSalary"> + <span>{currentTreeNode?.jobPositionInfo?.positionSalary}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="缁╂晥绯绘暟" name="performanceRates"> + <span>{currentTreeNode?.jobPositionInfo?.performanceRates}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="缁╂晥宸ヨ祫" name="performanceSalary"> + <span>{currentTreeNode?.jobPositionInfo?.performanceSalary || '-'}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="绀句繚鍩烘暟" name="socialRates"> + <span>{currentTreeNode?.jobPositionInfo?.socialRates || '-'}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鍏Н閲戝熀鏁�" name="publicRates"> + <span>{currentTreeNode?.jobPositionInfo?.publicRates || '-'}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="缁╂晥绛夌骇" name="performanceLevel"> + <span>{currentTreeNode?.jobPositionInfo?.performanceLevel || '-'}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="鏅嬪崌娼滃姏" name="promoteLevel"> + <span>{currentTreeNode?.jobPositionInfo?.promoteLevel || '-'}</span> + </Form.Item> + </Col> + </Row> + <Row> + <Col span={12}> + <Form.Item label="绀句繚璐︽埛" name="socialAccount"> + <span>{currentTreeNode?.jobPositionInfo?.socialAccount || '-'}</span> + </Form.Item> + </Col> + + <Col span={12}> + <Form.Item label="閾惰璐﹀彿" name="bankAccount"> + <span>{currentTreeNode?.jobPositionInfo?.bankAccount || '-'}</span> + </Form.Item> + </Col> + </Row> + </Form> + } + + + </div> + </div> + </PageContainer> + ) +} + + +export default departmentalEmployeeInformation \ No newline at end of file diff --git a/src/pages/organizationDesign/jobLevelInformationConfiguration/index.tsx b/src/pages/organizationDesign/jobLevelInformationConfiguration/index.tsx index 3fcbd90..1ac2d09 100644 --- a/src/pages/organizationDesign/jobLevelInformationConfiguration/index.tsx +++ b/src/pages/organizationDesign/jobLevelInformationConfiguration/index.tsx @@ -1,15 +1,23 @@ import { postOaContractGetContractList } from '@/services/WebApi/contract'; -import { PlusOutlined } from '@ant-design/icons'; +import { ExclamationCircleOutlined, PlusOutlined } from '@ant-design/icons'; import { PageContainer, ProTable } from '@ant-design/pro-components'; -import { Button, Col, Form, Input, Modal, Row, Select, Space } from 'antd'; +import { Button, Col, Form, Input, message, Modal, Row, Select, Space } from 'antd'; import TextArea from 'antd/es/input/TextArea'; -import React, { useRef, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import styles from './index.less'; +import { useModel } from '@umijs/max'; +import { postOaJobLevelDelJobLevel, postOaJobLevelGetJobLevelList, postOaJobLevelNewJobLevel, postOaJobLevelUpdateJobLevel } from '@/services/WebApi/oaJobLevel'; +import { postOaJobGetJobList } from '@/services/WebApi/oaJob'; +import modal from 'antd/es/modal'; +import { postOaDepartmentDelDepartment } from '@/services/WebApi/oaDepartment'; -const DepartmentalInformationConfiguration: React.FC = () => { +const jobLevelInformationConfiguration: React.FC = () => { + const { initialState, setInitialState } = useModel('@@initialState'); + const [dialogTitle, setDialogTitle] = useState(''); const [addDialogVisible, setAddDialogVisible] = useState(false); - + const [currentEditJob, setCurrentEditJob] = useState(null); + const [jobSelectOptions, setJobSelectOptions] = useState([]); const actionRef = useRef(null); const [formRef] = Form.useForm(); @@ -23,8 +31,8 @@ }, { title: '宸ヨ祫棰�', - key: 'name', - dataIndex: 'name', + key: 'salary', + dataIndex: 'salary', align: 'center', search: false, }, @@ -35,14 +43,97 @@ search: false, render: (_, rowData) => ( <Space size="middle"> - <a onClick={() => {}} style={{ cursor: 'pointer', margin: ' 0 5px' }}> + <a onClick={() => { + formRef.setFieldsValue(rowData); + setDialogTitle('缂栬緫鑱岀骇'); + setCurrentEditJob(rowData); + setAddDialogVisible(true); + }} style={{ cursor: 'pointer', margin: ' 0 5px' }}> 缂栬緫 </a> + <a onClick={() => { + handleDelete(rowData.id) + }} style={{ cursor: 'pointer', margin: ' 0 5px', color: 'red' }}> 鍒犻櫎</a> </Space> ), }, ]; - const handleOk = () => {}; + + useEffect(() => { + getJobSelectOptions(); + }, []) + useEffect(() => { + if (!addDialogVisible) { + formRef.resetFields(); + } + }, [addDialogVisible]) + + + const handleDelete = (id) => { + modal.confirm({ + title: '鍒犻櫎', + icon: <ExclamationCircleOutlined />, + content: '鏄惁鍒犻櫎璇ヨ亴绾э紵', + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + postOaJobLevelDelJobLevel({ ids: [id] }).then((res) => { + message.success('鍒犻櫎鎴愬姛'); + actionRef.current?.reload(); + }) + }, + }); + } + + const getJobSelectOptions = () => { + const body = { + start: 0, + size: 99, + filterList: [], + searchList: [], + orgId: initialState?.appInfo?.org?.id, + }; + postOaJobGetJobList(body).then((res) => { + console.log(res, 'res'); + const options = res.datas.map((item) => { + return { + ...item, + label: item.name, + value: item.id, + } + }) + console.log(options, 'res'); + + setJobSelectOptions(options) + }); + } + + + const handleOk = () => { + formRef.validateFields().then((values) => { + const body = { + ...values, + orgId: initialState?.appInfo?.org?.id, + }; + + if (dialogTitle === '鏂板缓鑱岀骇') { + postOaJobLevelNewJobLevel(body).then((res) => { + console.log(res, 'res'); + actionRef.current?.reload(); + setAddDialogVisible(false); + message.success('娣诲姞鎴愬姛'); + }) + } else { + body.id = currentEditJob.id + postOaJobLevelUpdateJobLevel(body).then((res) => { + actionRef.current?.reload(); + setAddDialogVisible(false); + message.success('缂栬緫鎴愬姛'); + }) + } + + }) + }; const handleCancel = () => { setAddDialogVisible(false); }; @@ -53,12 +144,13 @@ size: params.pageSize, filterList: [], searchList: [], + orgId: initialState?.appInfo?.org?.id, }; - return postOaContractGetContractList(body).then((res) => { + return postOaJobLevelGetJobLevelList(body).then((res) => { console.log(res, 'res'); return { data: res.datas, - total: res.data.totalSize, + total: res.totalSize, }; }); }; @@ -77,7 +169,7 @@ icon={<PlusOutlined />} onClick={() => { setAddDialogVisible(true); - setDialogTitle('鏂板缓鍚堝悓'); + setDialogTitle('鏂板缓鑱岀骇'); }} type="primary" > @@ -98,49 +190,30 @@ <Form form={formRef} layout="vertical" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}> <Row> <Col span={12}> - <Form.Item label="鑱岀骇缂栧彿" name="name"> + <Form.Item label="鑱岀骇缂栧彿" name="code"> <Input /> </Form.Item> </Col> <Col span={12}> - <Form.Item label="宸ヨ祫棰�" name="name"> + <Form.Item label="宸ヨ祫棰�" name="salary"> <Input /> </Form.Item> </Col> </Row> <Row> <Col span={24}> - <Form.Item label="鎵�灞炲崟浣�" name="name"> + <Form.Item label="鎵�灞炶亴浣�" name="jobId"> <Select - defaultValue="lucy" - options={[ - { - value: 'jack', - label: 'Jack', - }, - { - value: 'lucy', - label: 'Lucy', - }, - { - value: 'disabled', - disabled: true, - label: 'Disabled', - }, - { - value: 'Yiminghe', - label: 'yiminghe', - }, - ]} + options={jobSelectOptions} /> </Form.Item> </Col> - + </Row> <Row> <Col span={24}> - <Form.Item label="澶囨敞" name="name"> + <Form.Item label="澶囨敞" name="remarks"> <TextArea rows={4} /> </Form.Item> </Col> @@ -152,4 +225,4 @@ ); }; -export default DepartmentalInformationConfiguration; +export default jobLevelInformationConfiguration; diff --git a/src/pages/organizationDesign/postInformationConfiguration/index.tsx b/src/pages/organizationDesign/postInformationConfiguration/index.tsx index 45ef41d..793e7e8 100644 --- a/src/pages/organizationDesign/postInformationConfiguration/index.tsx +++ b/src/pages/organizationDesign/postInformationConfiguration/index.tsx @@ -1,30 +1,43 @@ import { postOaContractGetContractList } from '@/services/WebApi/contract'; -import { PlusOutlined } from '@ant-design/icons'; +import { ExclamationCircleOutlined, PlusOutlined } from '@ant-design/icons'; import { PageContainer, ProTable } from '@ant-design/pro-components'; -import { Button, Col, Form, Input, Modal, Row, Select, Space } from 'antd'; +import { Button, Col, Form, Input, message, Modal, Row, Select, Space } from 'antd'; import TextArea from 'antd/es/input/TextArea'; -import React, { useRef, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import styles from './index.less'; +import { postOaJobPositionDelJobPosition, postOaJobPositionGetJobPositionList, postOaJobPositionNewJobPosition, postOaJobPositionUpdateJobPosition } from '@/services/WebApi/oaJobPosition'; +import { useModel } from '@umijs/max'; +import modal from 'antd/es/modal'; -const DepartmentalInformationConfiguration: React.FC = () => { +const postInformationConfiguration: React.FC = () => { + const { initialState, setInitialState } = useModel('@@initialState'); + const [dialogTitle, setDialogTitle] = useState(''); const [addDialogVisible, setAddDialogVisible] = useState(false); + const [currentEditJob, setCurrentEditJob] = useState(null); const actionRef = useRef(null); const [formRef] = Form.useForm(); + + useEffect(() => { + if (!addDialogVisible) { + formRef.resetFields(); + } + }, [addDialogVisible]) + const columns = [ { title: '宀椾綅鍚嶇О', - key: 'code', - dataIndex: 'code', + key: 'name', + dataIndex: 'name', align: 'center', search: false, }, { title: '宀椾綅鑱岃矗', - key: 'name', - dataIndex: 'name', + key: 'duty', + dataIndex: 'duty', align: 'center', search: false, }, @@ -35,14 +48,65 @@ search: false, render: (_, rowData) => ( <Space size="middle"> - <a onClick={() => {}} style={{ cursor: 'pointer', margin: ' 0 5px' }}> + <a onClick={() => { + formRef.setFieldsValue(rowData); + setDialogTitle('缂栬緫宀椾綅'); + setCurrentEditJob(rowData); + setAddDialogVisible(true); + }} style={{ cursor: 'pointer', margin: ' 0 5px' }}> 缂栬緫 </a> + <a onClick={() => { + handleDelete(rowData.id) + }} style={{ cursor: 'pointer', margin: ' 0 5px', color: 'red' }}> 鍒犻櫎</a> </Space> ), }, ]; - const handleOk = () => {}; + + + const handleDelete = (id) => { + modal.confirm({ + title: '鍒犻櫎', + icon: <ExclamationCircleOutlined />, + content: '鏄惁鍒犻櫎璇ュ矖浣嶏紵', + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + postOaJobPositionDelJobPosition({ ids: [id] }).then((res) => { + message.success('鍒犻櫎鎴愬姛'); + actionRef.current?.reload(); + }) + }, + }); + } + + const handleOk = () => { + formRef.validateFields().then((values) => { + const body = { + ...values, + orgId: initialState?.appInfo?.org?.id, + }; + + if (dialogTitle === '鏂板缓宀椾綅') { + postOaJobPositionNewJobPosition(body).then((res) => { + console.log(res, 'res'); + actionRef.current?.reload(); + setAddDialogVisible(false); + message.success('娣诲姞鎴愬姛'); + }) + } else { + body.id = currentEditJob.id + postOaJobPositionUpdateJobPosition(body).then((res) => { + actionRef.current?.reload(); + setAddDialogVisible(false); + message.success('缂栬緫鎴愬姛'); + }) + } + + }) + + }; const handleCancel = () => { setAddDialogVisible(false); }; @@ -53,12 +117,13 @@ size: params.pageSize, filterList: [], searchList: [], + orgId: initialState?.appInfo?.org?.id, }; - return postOaContractGetContractList(body).then((res) => { + return postOaJobPositionGetJobPositionList(body).then((res) => { console.log(res, 'res'); return { data: res.datas, - total: res.data.totalSize, + total: res.totalSize, }; }); }; @@ -77,7 +142,7 @@ icon={<PlusOutlined />} onClick={() => { setAddDialogVisible(true); - setDialogTitle('鏂板缓鍚堝悓'); + setDialogTitle('鏂板缓宀椾綅'); }} type="primary" > @@ -106,14 +171,14 @@ <Row> <Col span={24}> - <Form.Item label="宀椾綅鑱岃矗" name="name"> + <Form.Item label="宀椾綅鑱岃矗" name="duty"> <TextArea rows={4} /> </Form.Item> </Col> </Row> <Row> <Col span={24}> - <Form.Item label="宸ヤ綔鍐呭" name="name"> + <Form.Item label="宸ヤ綔鍐呭" name="description"> <TextArea rows={4} /> </Form.Item> </Col> @@ -125,4 +190,4 @@ ); }; -export default DepartmentalInformationConfiguration; +export default postInformationConfiguration; diff --git a/src/services/WebApi/index.ts b/src/services/WebApi/index.ts index 9bb0710..0537c56 100644 --- a/src/services/WebApi/index.ts +++ b/src/services/WebApi/index.ts @@ -40,6 +40,14 @@ import * as retire from "./retire"; import * as retiring from "./retiring"; import * as strategyPlan from "./strategyPlan"; +import * as trainAssess from "./trainAssess"; +import * as trainCourse from "./trainCourse"; +import * as trainFee from "./trainFee"; +import * as trainOrg from "./trainOrg"; +import * as trainPlan from "./trainPlan"; +import * as trainRequirement from "./trainRequirement"; +import * as trainRules from "./trainRules"; +import * as trainSchedule from "./trainSchedule"; import * as transfer from "./transfer"; import * as transferIn from "./transferIn"; import * as transferOut from "./transferOut"; @@ -83,6 +91,14 @@ retire, retiring, strategyPlan, + trainAssess, + trainCourse, + trainFee, + trainOrg, + trainPlan, + trainRequirement, + trainRules, + trainSchedule, transfer, transferIn, transferOut, diff --git a/src/services/WebApi/trainAssess.ts b/src/services/WebApi/trainAssess.ts new file mode 100644 index 0000000..0509a79 --- /dev/null +++ b/src/services/WebApi/trainAssess.ts @@ -0,0 +1,33 @@ +// @ts-ignore +/* eslint-disable */ +import { request } from "umi"; + +/** 鏂板缓鍩硅璇勪及 POST /oa/trainAssess/NewTrainAssess */ +export async function postOaTrainAssessNewTrainAssess( + body: API.NewTrainAssessRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainAssess/NewTrainAssess", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏇存柊鍩硅璇勪及 POST /oa/trainAssess/UpdateTrainAssess */ +export async function postOaTrainAssessUpdateTrainAssess( + body: API.UpdateTrainAssessRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainAssess/UpdateTrainAssess", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} diff --git a/src/services/WebApi/trainCourse.ts b/src/services/WebApi/trainCourse.ts new file mode 100644 index 0000000..f5f1a4c --- /dev/null +++ b/src/services/WebApi/trainCourse.ts @@ -0,0 +1,78 @@ +// @ts-ignore +/* eslint-disable */ +import { request } from "umi"; + +/** 鍒犻櫎鍩硅璇剧▼ POST /oa/trainCourse/DelTrainCourse */ +export async function postOaTrainCourseDelTrainCourse( + body: API.DelRequestBase, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainCourse/DelTrainCourse", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鑾峰彇鍩硅璇剧▼鍒楄〃 POST /oa/trainCourse/GetTrainCourseList */ +export async function postOaTrainCourseGetTrainCourseList( + body: API.GetTrainCourseListRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainCourse/GetTrainCourseList", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 瀹℃壒鍩硅璇剧▼ POST /oa/trainCourse/NewApprove */ +export async function postOaTrainCourseNewApprove( + body: API.NewApproveRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainCourse/NewApprove", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏂板缓鍩硅璇剧▼ POST /oa/trainCourse/NewTrainCourse */ +export async function postOaTrainCourseNewTrainCourse( + body: API.NewTrainCourseRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainCourse/NewTrainCourse", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏇存柊鍩硅璇剧▼ POST /oa/trainCourse/UpdateTrainCourse */ +export async function postOaTrainCourseUpdateTrainCourse( + body: API.UpdateTrainCourseRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainCourse/UpdateTrainCourse", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} diff --git a/src/services/WebApi/trainFee.ts b/src/services/WebApi/trainFee.ts new file mode 100644 index 0000000..8a188b5 --- /dev/null +++ b/src/services/WebApi/trainFee.ts @@ -0,0 +1,48 @@ +// @ts-ignore +/* eslint-disable */ +import { request } from "umi"; + +/** 鑾峰彇鍩硅璐圭敤鍒楄〃 POST /oa/trainFee/GetTrainFeeList */ +export async function postOaTrainFeeGetTrainFeeList( + body: API.GetTrainFeeListRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainFee/GetTrainFeeList", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏂板缓鍩硅璐圭敤 POST /oa/trainFee/NewTrainFee */ +export async function postOaTrainFeeNewTrainFee( + body: API.NewTrainFeeRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainFee/NewTrainFee", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏇存柊鍩硅璐圭敤 POST /oa/trainFee/UpdateTrainFee */ +export async function postOaTrainFeeUpdateTrainFee( + body: API.UpdateTrainFeeRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainFee/UpdateTrainFee", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} diff --git a/src/services/WebApi/trainOrg.ts b/src/services/WebApi/trainOrg.ts new file mode 100644 index 0000000..cf5aa0e --- /dev/null +++ b/src/services/WebApi/trainOrg.ts @@ -0,0 +1,63 @@ +// @ts-ignore +/* eslint-disable */ +import { request } from "umi"; + +/** 鍒犻櫎鍩硅鏈烘瀯 POST /oa/trainOrg/DelTrainOrg */ +export async function postOaTrainOrgDelTrainOrg( + body: API.DelRequestBase, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainOrg/DelTrainOrg", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鑾峰彇鍩硅鏈烘瀯鍒楄〃 POST /oa/trainOrg/GetTrainOrgList */ +export async function postOaTrainOrgGetTrainOrgList( + body: API.GetTrainOrgListRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainOrg/GetTrainOrgList", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏂板缓鍩硅鏈烘瀯 POST /oa/trainOrg/NewTrainOrg */ +export async function postOaTrainOrgNewTrainOrg( + body: API.NewTrainOrgRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainOrg/NewTrainOrg", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏇存柊鍩硅鏈烘瀯 POST /oa/trainOrg/UpdateTrainOrg */ +export async function postOaTrainOrgUpdateTrainOrg( + body: API.UpdateTrainOrgRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainOrg/UpdateTrainOrg", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} diff --git a/src/services/WebApi/trainPlan.ts b/src/services/WebApi/trainPlan.ts new file mode 100644 index 0000000..f2d2524 --- /dev/null +++ b/src/services/WebApi/trainPlan.ts @@ -0,0 +1,78 @@ +// @ts-ignore +/* eslint-disable */ +import { request } from "umi"; + +/** 鍒犻櫎鍩硅璁″垝 POST /oa/trainPlan/DelTrainPlan */ +export async function postOaTrainPlanDelTrainPlan( + body: API.DelRequestBase, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainPlan/DelTrainPlan", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鑾峰彇鍩硅璁″垝鍒楄〃 POST /oa/trainPlan/GetTrainPlanList */ +export async function postOaTrainPlanGetTrainPlanList( + body: API.GetTrainPlanListRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainPlan/GetTrainPlanList", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 瀹℃壒鍩硅璁″垝 POST /oa/trainPlan/NewApprove */ +export async function postOaTrainPlanNewApprove( + body: API.NewApproveRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainPlan/NewApprove", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏂板缓鍩硅璁″垝 POST /oa/trainPlan/NewTrainPlan */ +export async function postOaTrainPlanNewTrainPlan( + body: API.NewTrainPlanRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainPlan/NewTrainPlan", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏇存柊鍩硅璁″垝 POST /oa/trainPlan/UpdateTrainPlan */ +export async function postOaTrainPlanUpdateTrainPlan( + body: API.UpdateTrainPlanRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainPlan/UpdateTrainPlan", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} diff --git a/src/services/WebApi/trainRequirement.ts b/src/services/WebApi/trainRequirement.ts new file mode 100644 index 0000000..7d66562 --- /dev/null +++ b/src/services/WebApi/trainRequirement.ts @@ -0,0 +1,63 @@ +// @ts-ignore +/* eslint-disable */ +import { request } from "umi"; + +/** 鍒犻櫎鍩硅闇�姹� POST /oa/trainPlan/DelTrainRequirement */ +export async function postOaTrainPlanDelTrainRequirement( + body: API.DelRequestBase, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainPlan/DelTrainRequirement", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鑾峰彇鍩硅闇�姹傚垪琛� POST /oa/trainPlan/GetTrainRequirementList */ +export async function postOaTrainPlanGetTrainRequirementList( + body: API.GetTrainRequirementListRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainPlan/GetTrainRequirementList", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏂板缓鍩硅闇�姹� POST /oa/trainPlan/NewTrainRequirement */ +export async function postOaTrainPlanNewTrainRequirement( + body: API.NewTrainRequirementRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainPlan/NewTrainRequirement", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏇存柊鍩硅闇�姹� POST /oa/trainPlan/UpdateTrainRequirement */ +export async function postOaTrainPlanUpdateTrainRequirement( + body: API.UpdateTrainRequirementRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainPlan/UpdateTrainRequirement", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} diff --git a/src/services/WebApi/trainRules.ts b/src/services/WebApi/trainRules.ts new file mode 100644 index 0000000..099cd91 --- /dev/null +++ b/src/services/WebApi/trainRules.ts @@ -0,0 +1,63 @@ +// @ts-ignore +/* eslint-disable */ +import { request } from "umi"; + +/** 鍒犻櫎鍩硅瑙勭珷鍒跺害 POST /oa/trainRules/DelTrainOrg */ +export async function postOaTrainRulesDelTrainOrg( + body: API.DelRequestBase, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainRules/DelTrainOrg", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鑾峰彇鍩硅瑙勭珷鍒跺害鍒楄〃 POST /oa/trainRules/GetTrainRulesList */ +export async function postOaTrainRulesGetTrainRulesList( + body: API.GetTrainRulesListRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainRules/GetTrainRulesList", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏂板缓鍩硅瑙勭珷鍒跺害 POST /oa/trainRules/NewTrainRules */ +export async function postOaTrainRulesNewTrainRules( + body: API.NewTrainRulesRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainRules/NewTrainRules", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏇存柊鍩硅瑙勭珷鍒跺害 POST /oa/trainRules/UpdateTrainRules */ +export async function postOaTrainRulesUpdateTrainRules( + body: API.UpdateTrainRulesRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainRules/UpdateTrainRules", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} diff --git a/src/services/WebApi/trainSchedule.ts b/src/services/WebApi/trainSchedule.ts new file mode 100644 index 0000000..0cd958c --- /dev/null +++ b/src/services/WebApi/trainSchedule.ts @@ -0,0 +1,48 @@ +// @ts-ignore +/* eslint-disable */ +import { request } from "umi"; + +/** 鍒犻櫎鍩硅鏃ョ▼ POST /oa/trainSchedule/DelTrainSchedule */ +export async function postOaTrainScheduleDelTrainSchedule( + body: API.DelRequestBase, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainSchedule/DelTrainSchedule", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鑾峰彇鍩硅鏃ョ▼ POST /oa/trainSchedule/GetTrainScheduleList */ +export async function postOaTrainScheduleGetTrainScheduleList( + body: API.GetTrainScheduleListRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainSchedule/GetTrainScheduleList", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} + +/** 鏇存柊鍩硅鏃ョ▼ POST /oa/trainSchedule/UpdateTrainSchedule */ +export async function postOaTrainScheduleUpdateTrainSchedule( + body: API.UpdateTrainScheduleRequest, + options?: { [key: string]: any } +) { + return request<API.ResponseData>("/oa/trainSchedule/UpdateTrainSchedule", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: body, + ...(options || {}), + }); +} diff --git a/src/services/WebApi/typings.d.ts b/src/services/WebApi/typings.d.ts index 37d69b4..cf9ae6a 100644 --- a/src/services/WebApi/typings.d.ts +++ b/src/services/WebApi/typings.d.ts @@ -330,6 +330,69 @@ orgId?: number; }; + type GetTrainCourseListRequest = { + start: number; + size: number; + sort?: SortRequest; + filterList?: FilterRequest[]; + searchList?: SearchRequest[]; + orgId?: number; + }; + + type GetTrainFeeListRequest = { + start: number; + size: number; + sort?: SortRequest; + filterList?: FilterRequest[]; + searchList?: SearchRequest[]; + orgId?: number; + }; + + type GetTrainOrgListRequest = { + start: number; + size: number; + sort?: SortRequest; + filterList?: FilterRequest[]; + searchList?: SearchRequest[]; + orgId?: number; + }; + + type GetTrainPlanListRequest = { + start: number; + size: number; + sort?: SortRequest; + filterList?: FilterRequest[]; + searchList?: SearchRequest[]; + orgId?: number; + }; + + type GetTrainRequirementListRequest = { + start: number; + size: number; + sort?: SortRequest; + filterList?: FilterRequest[]; + searchList?: SearchRequest[]; + orgId?: number; + }; + + type GetTrainRulesListRequest = { + start: number; + size: number; + sort?: SortRequest; + filterList?: FilterRequest[]; + searchList?: SearchRequest[]; + orgId?: number; + }; + + type GetTrainScheduleListRequest = { + start: number; + size: number; + sort?: SortRequest; + filterList?: FilterRequest[]; + searchList?: SearchRequest[]; + orgId?: number; + }; + type GetTransferInListRequest = { start: number; size: number; @@ -570,6 +633,7 @@ orgId?: number; name?: string; type?: string; + description?: string; phone?: string; managerId?: number; parentId?: number; @@ -927,6 +991,84 @@ steps?: string; }; + type NewTrainAssessRequest = { + orgId?: number; + trainPlanId?: number; + model?: string; + content?: string; + actual?: string; + }; + + type NewTrainCourseRequest = { + orgId?: number; + name?: string; + trainOrgId?: number; + description?: string; + hours?: number; + teacher?: string; + file?: string; + }; + + type NewTrainFeeRequest = { + orgId?: number; + name?: string; + trainPlanId?: number; + type?: string; + fee?: number; + remarks?: string; + }; + + type NewTrainOrgRequest = { + orgId?: number; + name?: string; + type?: string; + position?: string; + aim?: string; + content?: string; + course?: string; + eduType?: string; + characteristic?: string; + address?: string; + phone?: string; + contactUser?: string; + }; + + type NewTrainPlanRequest = { + orgId?: number; + name?: string; + requirement?: string; + content?: string; + beginDate?: string; + endDate?: string; + staffIds?: number[]; + courseIds?: number[]; + newTrainScheduleRequests?: NewTrainScheduleRequest[]; + }; + + type NewTrainRequirementRequest = { + orgId?: number; + name?: string; + type?: string; + content?: string; + planDate?: string; + staffIds?: number[]; + }; + + type NewTrainRulesRequest = { + orgId?: number; + name?: string; + trainOrgId?: number; + description?: string; + file?: string; + }; + + type NewTrainScheduleRequest = { + staffId?: number; + content?: string; + planBeginDate?: string; + planEndDate?: string; + }; + type NewTransferInRequest = { orgId?: number; staffId?: number; @@ -1209,6 +1351,7 @@ type UpdateOADepartmentRequest = { id?: number; name?: string; + description?: string; type?: string; phone?: string; managerId?: number; @@ -1553,6 +1696,88 @@ steps?: string; }; + type UpdateTrainAssessRequest = { + id?: number; + model?: string; + content?: string; + actual?: string; + }; + + type UpdateTrainCourseRequest = { + id?: number; + name?: string; + trainOrgId?: number; + description?: string; + hours?: number; + teacher?: string; + file?: string; + }; + + type UpdateTrainFeeRequest = { + id?: number; + name?: string; + trainPlanId?: number; + type?: string; + fee?: number; + remarks?: string; + }; + + type UpdateTrainOrgRequest = { + id?: number; + name?: string; + type?: string; + position?: string; + aim?: string; + content?: string; + course?: string; + eduType?: string; + characteristic?: string; + address?: string; + phone?: string; + contactUser?: string; + }; + + type UpdateTrainPlanRequest = { + id?: number; + name?: string; + requirement?: string; + content?: string; + beginDate?: string; + endDate?: string; + staffIds?: number[]; + courseIds?: number[]; + }; + + type UpdateTrainRequirementRequest = { + id?: number; + name?: string; + type?: string; + content?: string; + planDate?: string; + staffIds?: number[]; + }; + + type UpdateTrainRulesRequest = { + id?: number; + name?: string; + trainOrgId?: number; + description?: string; + file?: string; + }; + + type UpdateTrainScheduleRequest = { + id?: number; + staffId?: number; + content?: string; + planBeginDate?: string; + planEndDate?: string; + beginDate?: string; + endDate?: string; + planUserCount?: number; + userCount?: number; + summarize?: string; + }; + type UpdateTransferInRequest = { id?: number; staffId?: number; -- Gitblit v1.9.1