From 80dd9b0de0870a99be28ef13af9f96001ead9abc Mon Sep 17 00:00:00 2001 From: "853931625@qq.com" Date: Sat, 8 Nov 2025 17:22:58 +0800 Subject: [PATCH] no message --- src/api/businessLicense/index.js | 22 + src/api/department/index.js | 25 + src/api/enterprise/index.js | 44 + src/api/personnelCertificate/index.js | 26 + src/api/post/index.js | 25 + src/api/user/index.js | 52 + src/enumerate/namespace/index.js | 6 + src/pages/Container/BusinessLicense/index.js | 178 +++ .../Enterprise/CorpInfo/Info/index.js | 111 +- .../Enterprise/CorpInfo/Update/index.js | 363 +++--- .../IndustryQualification/Add/index.js | 8 +- .../IndustryQualification/List/index.js | 2 +- .../Enterprise/OrganizationStructure/index.js | 108 +- src/pages/Container/Enterprise/Post/index.js | 119 +- .../Container/Enterprise/User/Add/index.js | 136 +- .../Container/Enterprise/User/List/index.js | 133 +- .../Container/PersonnelCertificate/index.js | 183 +++ .../CorpInfo/components/Qualification.js | 4 +- .../Container/Stakeholder/CorpInfo/index.js | 178 ++- .../Container/Stakeholder/Department/index.js | 103 +- .../SecurityPersonnelInfo/index.js | 81 +- .../SpecialOperationPersonnel/index.js | 84 +- .../Container/Stakeholder/User/Add/index.js | 421 +++--- .../Container/Stakeholder/User/List/index.js | 225 +++- .../User/SecurityPersonnel/index.js | 198 +++ .../User/SpecialPersonnel/index.js | 199 +++ .../Container/Stakeholder/User/View/index.js | 1126 ----------------- .../BranchCompany/AccountManage/List/index.js | 118 +- .../BranchCompany/AccountManage/View/index.js | 67 +- .../DepartmentManage/List/index.js | 49 +- .../DepartmentManage/View/index.js | 55 +- .../BranchCompany/EnterpriseInfo/Add/index.js | 64 - .../EnterpriseInfo/List/index.js | 221 ++-- .../EnterpriseInfo/Search/index.js | 164 --- .../EnterpriseInfo/View/index.js | 128 +- .../SubsidiaryUser/List/index.js | 104 +- .../SubsidiaryUser/UserList/index.js | 119 +- .../ChangeList/index.js | 57 + .../EnterpriseMiddleground/List/index.js | 64 + .../EnterpriseMiddleground/UserList/index.js | 167 +++ .../EnterpriseMiddleground/index.js | 9 + .../AccountManage/Add/index.js | 90 -- .../AccountManage/List/index.js | 178 ++- .../AccountManage/UserView}/index.js | 0 .../AccountManage/View/index.js | 77 +- .../CertificateList/index.js | 201 +++ .../SecurityPersonnel/List/index.js | 74 ++ .../SecurityPersonnel/index.js | 9 + .../SpecialPersonnel/CertificateList/index.js | 203 +++ .../SpecialPersonnel/List/index.js | 74 ++ .../StakeholderUnit/SpecialPersonnel/index.js | 9 + .../StakeholderUnit/User/Add/index.js | 272 ---- .../StakeholderUnit/User/List/index.js | 77 +- .../StakeholderUnit/User/UserList/index.js | 160 ++- .../StakeholderUnit/User/UserView/index.js | 941 -------------- .../StakeholderUnit/User/View/index.js | 2 +- .../Supervision/Department/index.js | 98 +- .../Supervision/Supervision/Post/index.js | 106 +- .../Supervision/Supervision/User/Add/index.js | 138 +- .../Supervision/User/List/index.js | 177 ++- 60 files changed, 4488 insertions(+), 3944 deletions(-) create mode 100644 src/api/businessLicense/index.js create mode 100644 src/api/department/index.js create mode 100644 src/api/enterprise/index.js create mode 100644 src/api/personnelCertificate/index.js create mode 100644 src/api/post/index.js create mode 100644 src/api/user/index.js create mode 100644 src/pages/Container/BusinessLicense/index.js create mode 100644 src/pages/Container/PersonnelCertificate/index.js create mode 100644 src/pages/Container/Stakeholder/User/SecurityPersonnel/index.js create mode 100644 src/pages/Container/Stakeholder/User/SpecialPersonnel/index.js delete mode 100644 src/pages/Container/Stakeholder/User/View/index.js delete mode 100644 src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/Add/index.js delete mode 100644 src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/Search/index.js create mode 100644 src/pages/Container/Supervision/EnterpriseMiddleground/ChangeList/index.js create mode 100644 src/pages/Container/Supervision/EnterpriseMiddleground/List/index.js create mode 100644 src/pages/Container/Supervision/EnterpriseMiddleground/UserList/index.js create mode 100644 src/pages/Container/Supervision/EnterpriseMiddleground/index.js delete mode 100644 src/pages/Container/Supervision/StakeholderUnit/AccountManage/Add/index.js rename src/pages/Container/Supervision/{BranchCompany/SubsidiaryUser/View => StakeholderUnit/AccountManage/UserView}/index.js (100%) create mode 100644 src/pages/Container/Supervision/StakeholderUnit/SecurityPersonnel/CertificateList/index.js create mode 100644 src/pages/Container/Supervision/StakeholderUnit/SecurityPersonnel/List/index.js create mode 100644 src/pages/Container/Supervision/StakeholderUnit/SecurityPersonnel/index.js create mode 100644 src/pages/Container/Supervision/StakeholderUnit/SpecialPersonnel/CertificateList/index.js create mode 100644 src/pages/Container/Supervision/StakeholderUnit/SpecialPersonnel/List/index.js create mode 100644 src/pages/Container/Supervision/StakeholderUnit/SpecialPersonnel/index.js delete mode 100644 src/pages/Container/Supervision/StakeholderUnit/User/Add/index.js delete mode 100644 src/pages/Container/Supervision/StakeholderUnit/User/UserView/index.js diff --git a/src/api/businessLicense/index.js b/src/api/businessLicense/index.js new file mode 100644 index 0000000..eebd291 --- /dev/null +++ b/src/api/businessLicense/index.js @@ -0,0 +1,22 @@ +import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; + +export const corpQualificationInfoList = declareRequest( + "corpQualificationLoading", + "Post > @/basic-info/corpQualificationInfo/list", +); +export const corpQualificationInfoDetails = declareRequest( + "corpQualificationLoading", + "Post > @/basic-info/corpQualificationInfo/info/{id}", +); +export const corpQualificationInfoAdd = declareRequest( + "corpQualificationLoading", + "Post > @/basic-info/corpQualificationInfo/save", +); +export const corpQualificationInfoEdit = declareRequest( + "corpQualificationLoading", + "Post > @/basic-info/corpQualificationInfo/edit", +); +export const corpQualificationInfoRemove = declareRequest( + "corpQualificationLoading", + "Post > @/basic-info/corpQualificationInfo/remove/{id}", +); diff --git a/src/api/department/index.js b/src/api/department/index.js new file mode 100644 index 0000000..ffc2bd5 --- /dev/null +++ b/src/api/department/index.js @@ -0,0 +1,25 @@ +import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; + +export const departmentList = declareRequest( + "departmentLoading", + "Post > @/basic-info/department/list", +); + +export const departmentAdd = declareRequest( + "departmentLoading", + "Post > @/basic-info/department/save", +); + +export const departmentEdit = declareRequest( + "departmentLoading", + "Post > @/basic-info/department/edit", +); +export const departmentDetails = declareRequest( + "departmentLoading", + "Post > @/basic-info/department/info/{id}", +); + +export const departmentRemove = declareRequest( + "departmentLoading", + "Post > @/basic-info/department/remove/{id}", +); diff --git a/src/api/enterprise/index.js b/src/api/enterprise/index.js new file mode 100644 index 0000000..0fbe148 --- /dev/null +++ b/src/api/enterprise/index.js @@ -0,0 +1,44 @@ +import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; + +export const corpInfoList = declareRequest( + "enterpriseLoading", + "Post > @/basic-info/corpInfo/list", +); +export const corpInfoRemoveDetails = declareRequest( + "enterpriseLoading", + "Post > @/basic-info/corpInfo/info/{id}", +); +export const corpInfoAdd = declareRequest( + "enterpriseLoading", + "Post > @/basic-info/corpInfo/save", +); +export const corpInfoEdit = declareRequest( + "enterpriseLoading", + "Post > @/basic-info/corpInfo/edit", +); +export const corpInfoChangePassword = declareRequest( + "enterpriseLoading", + "Post > @/basic-info/corpInfo/changePassword/{id}", +); +export const corpInfoChangeCompanyName = declareRequest( + "enterpriseLoading", + "Post > @/basic-info/corpInfo/changeCompanyName", +); +export const corpInfoChangeUseFlag = declareRequest( + "enterpriseLoading", + "Post > @/basic-info/corpInfo/changeUseFlag", +); + +export const corpInfoRemove = declareRequest( + "enterpriseLoading", + "Post > @/basic-info/corpInfo/remove/{id}", +); +export const corpInfoRemoveMultiple = declareRequest( + "enterpriseLoading", + "Post > @/basic-info/corpInfo/ids", +); + +export const corpUserMiddlePage = declareRequest( + "enterpriseLoading", + "Post > @/basic-info/corpInfo/corpUserMiddlePage", +); diff --git a/src/api/personnelCertificate/index.js b/src/api/personnelCertificate/index.js new file mode 100644 index 0000000..978069b --- /dev/null +++ b/src/api/personnelCertificate/index.js @@ -0,0 +1,26 @@ +import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; + +export const userQualificationInfoList = declareRequest( + "userQualificationLoading", + "Post > @/basic-info/userQualificationInfo/list", +); +export const userQualificationInfoDetails = declareRequest( + "userQualificationLoading", + "Get > /basic-info/userQualificationInfo/getInfoById?id={id}", +); +export const userQualificationInfoAdd = declareRequest( + "userQualificationLoading", + "Post > @/basic-info/userQualificationInfo/save", +); +export const userQualificationInfoEdit = declareRequest( + "userQualificationLoading", + "Put > @/basic-info/userQualificationInfo/edit", +); +export const userQualificationInfoRemove = declareRequest( + "userQualificationLoading", + "Put > @/basic-info/userQualificationInfo/remove?id={id}", +); +export const dictData = declareRequest( + "userLoading", + "Get > /config/dict-trees/list/by/dictValues?", +); diff --git a/src/api/post/index.js b/src/api/post/index.js new file mode 100644 index 0000000..c6e9cf2 --- /dev/null +++ b/src/api/post/index.js @@ -0,0 +1,25 @@ +import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; + +export const postList = declareRequest( + "postLoading", + "Post > @/basic-info/post/list", +); + +export const postAdd = declareRequest( + "postLoading", + "Post > @/basic-info/post/save", +); + +export const postEdit = declareRequest( + "postLoading", + "Put > @/basic-info/post/edit", +); +export const postDetails = declareRequest( + "postLoading", + "Get > /basic-info/post/getInfoById?id={id}", +); + +export const postRemove = declareRequest( + "postLoading", + "Put > @/basic-info/post/remove?id={id}", +); diff --git a/src/api/user/index.js b/src/api/user/index.js new file mode 100644 index 0000000..ff94764 --- /dev/null +++ b/src/api/user/index.js @@ -0,0 +1,52 @@ +import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; + +export const userList = declareRequest( + "userLoading", + "Post > @/basic-info/user/list", +); +export const userAdd = declareRequest( + "userLoading", + "Post > @/basic-info/user/save", +); + +export const userEdit = declareRequest( + "userLoading", + "Put > @/basic-info/user/edit", +); +export const userDetails = declareRequest( + "userLoading", + "Get > /basic-info/user/{id}", +); + +export const userSaveXgfAdd = declareRequest( + "userLoading", + "Post > @/basic-info/user/saveXgf", +); +export const userRemove = declareRequest( + "userLoading", + "Delete > @/basic-info/user/{id}", +); +export const userRemoveIds = declareRequest( + "userLoading", + "Delete > @/basic-info/user/ids?ids={ids}", +); +export const postAll = declareRequest( + "userLoading", + "Post > @/basic-info/post/listAll", +); +// 获取角色 +export const rolesAll = declareRequest( + "userLoading", + "Get > /system/operation/roles", +); +export const dictData = declareRequest( + "userLoading", + "Get > /config/dict-trees/list/by/dictValues?", +); + +export const userEmploymentLogAll = declareRequest( + "userLoading", + "Get > /basic-info/userEmploymentLog/listAll", +); + + diff --git a/src/enumerate/namespace/index.js b/src/enumerate/namespace/index.js index b392d90..934ce90 100644 --- a/src/enumerate/namespace/index.js +++ b/src/enumerate/namespace/index.js @@ -5,3 +5,9 @@ import { defineNamespace } from "@cqsjjb/jjb-dva-runtime"; export const NS_GLOBAL = defineNamespace("global"); +export const NS_ENTERPRISE = defineNamespace("enterprise"); +export const NS_DEPARTMENT = defineNamespace("department"); +export const NS_POST = defineNamespace("post"); +export const NS_USER = defineNamespace("user"); +export const NS_PERSNONEL_CERTFICATE = defineNamespace("personnelCertificate"); +export const NS_BUSINESSLICENSE = defineNamespace("businessLicense"); diff --git a/src/pages/Container/BusinessLicense/index.js b/src/pages/Container/BusinessLicense/index.js new file mode 100644 index 0000000..913af69 --- /dev/null +++ b/src/pages/Container/BusinessLicense/index.js @@ -0,0 +1,178 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, message, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; +import FormBuilder from "zy-react-library/components/FormBuilder"; +import AddIcon from "zy-react-library/components/Icon/AddIcon"; + +import Search from "zy-react-library/components/Search"; +import Table from "zy-react-library/components/Table"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useTable from "zy-react-library/hooks/useTable"; +import { NS_BUSINESSLICENSE } from "~/enumerate/namespace"; + +const CorpinfoId = "1983773013086048256"; +function Department(props) { + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); + const [form] = Form.useForm(); + const { tableProps, getData } = useTable(props["corpQualificationInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + corpinfoIdString: CorpinfoId, + }; + }, + }); + + const onDelete = (id) => { + Modal.confirm({ + title: "提示", + content: "确定删除吗?", + onOk: () => { + props["corpQualificationInfoRemove"]({ id }); + + message.success("删除成功"); + getData(); + }, + }); + }; + return ( +
+
+ +
+ + ( + <> + + + + )} + columns={[ + { title: "资质名称", dataIndex: "qualificationName" }, + { title: "证书编号", dataIndex: "certificateNo" }, + { title: "证书有效期", dataIndex: "ValidityTime", render: (text, record) => ({`${record.startValidityTime}至${record.endValidityTime}`}) }, + { + title: "操作", + width: 200, + render: (_, record) => ( + + + + + ), + }, + ]} + {...tableProps} + /> + + + { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} + /> + + ); +} + +function AddModalComponent(props) { + const [form] = Form.useForm(); + + useEffect(() => { + if (props.currentId) { + props.requestDetails({ id: props.currentId }).then((res) => { + res.data.startValidity = [res.data.startValidityTime, res.data.endValidityTime]; + form.setFieldsValue(res.data); + }); + } + }, [props.currentId]); + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + const onSubmit = async (values) => { + values.corpinfoId = CorpinfoId; + values.startValidityTime = values.startValidity[0]; + values.endValidityTime = values.startValidity[1]; + values.userIdString = "1985635856156274689"; + + delete values.startValidity; + if (props.currentId) { + values.id = props.currentId; + await props.requestEdit(values); + } + else { + await props.requestAdd(values); + } + + onCancel(); + props.getData(); + }; + return ( + + + + ); +} + +const AddModal = AddModalComponent; +export default Connect([NS_BUSINESSLICENSE], true)(Department); diff --git a/src/pages/Container/Enterprise/CorpInfo/Info/index.js b/src/pages/Container/Enterprise/CorpInfo/Info/index.js index d19a418..81ad0f5 100644 --- a/src/pages/Container/Enterprise/CorpInfo/Info/index.js +++ b/src/pages/Container/Enterprise/CorpInfo/Info/index.js @@ -1,63 +1,76 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Descriptions, Divider } from "antd"; +import { useEffect, useState } from "react"; +import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; function Info(props) { + const [info, setInfo] = useState({}); + useEffect(() => { + const fetchData = async () => { + const res = await props.corpInfoRemoveDetails({ id: "1985906265017954306" }); + setInfo(res.data); + // 不要在这里 log info,它还是旧的 + }; + fetchData(); + }, []); return (
基本信息 - 企业相关属性 - {info.scaleType === 1 ? "是" : info.scaleType === 0 ? "否" : ""} }, + { label: "企事业单位经营地址", children: info.addressBusiness }, + { label: "企业状态", children: info.corpStateName }, + { label: "营业执照", children: "Zhou", render: }, + { label: "营业执照有效期", children: `${info.licenseStart} 至 ${info.licenseEnd}` }, ]} /> + {/* 企业相关属性 */} + {/* {info.whetherHygieneFlag === 1 ? "是" : "否"} }, */} + {/* { label: "有无重大危险源", children: {info.whetherHazardsFlag === 1 ? "是" : "否"} }, */} + {/* { label: "是否有稀缺大型应急物资和设施", children: {info.whetherScarceFlag === 1 ? "是" : "否"} }, */} + {/* { label: "有无涉及危化品", children: {info.whetherChemicalsFlag === 1 ? "是" : "否"} }, */} + {/* { label: "有无特种设备", children: {info.whetherSpecialequipmentFlag === 1 ? "是" : "否"} }, */} + {/* { label: "有无特种工作人员", children: {info.whetherSpecialpeopleFlag === 1 ? "是" : "否"} }, */} + {/* { label: "是否涉及煤气", children: {info.whetherCoalgasFlag === 1 ? "是" : "否"} }, */} + {/* { label: "是否属于消防重点单位", children: {info.whetherFireFlag === 1 ? "是" : "否"} }, */} + {/* { label: "是否在有限空间作业", children: {info.whetherConfinedFlag === 1 ? "是" : "否"} }, */} + {/* { label: "是否存在涉爆粉尘作业", children: {info.whetherPowderFlag === 1 ? "是" : "否"} }, */} + {/* { label: "是否涉及防雷防静电", children: {info.whetherLightningFlag === 1 ? "是" : "否"} }, */} + {/* { label: "是否持有放射源", children: {info.whetherActinogenFlag === 1 ? "是" : "否"} }, */} + {/* { label: "是否涉及液氨制冷", children: {info.whetherLiquidammoniaFlag === 1 ? "是" : "否"} }, */} + {/* { label: "是否涉及危险品管道", children: {info.whetherPipelineFlag === 1 ? "是" : "否"} }, */} + {/* ]} */} + {/* /> */}
+ ) }, diff --git a/src/pages/Container/Enterprise/OrganizationStructure/index.js b/src/pages/Container/Enterprise/OrganizationStructure/index.js index 4f682e5..a4538fd 100644 --- a/src/pages/Container/Enterprise/OrganizationStructure/index.js +++ b/src/pages/Container/Enterprise/OrganizationStructure/index.js @@ -1,29 +1,47 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Form, message, Modal, Space, Tag } from "antd"; import { useEffect, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import AddIcon from "zy-react-library/components/Icon/AddIcon"; -import BackIcon from "zy-react-library/components/Icon/BackIcon"; import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; +import { getLabelName } from "zy-react-library/utils"; +import { NS_DEPARTMENT } from "~/enumerate/namespace"; -const DEPARTMENT_LEVEL_ENUM = [ - { id: "departmentLevel0001", name: "分公司" }, - { id: "departmentLevel0002", name: "科/厂队" }, - { id: "departmentLevel0003", name: "班组" }, -]; -function OrganizationStructure() { +const CorpinfoId = "1985906265017954306"; +function OrganizationStructure(props) { const [addModalOpen, setAddModalOpen] = useState(false); const [currentId, setCurrentId] = useState(""); + const [selectedNodeId, setSelectedNodeId] = useState(null); + const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["departmentList"], { + form, + transform: (formData) => { + return { + ...formData, + eqParentId: selectedNodeId, + eqCorpinfoId: CorpinfoId, + }; + }, + }); + + const onTreeChange = (selectedKeys) => { + const key = selectedKeys[0] || null; + setSelectedNodeId(key); + getData(); + }; + const onDelete = (id) => { Modal.confirm({ title: "提示", content: "确定删除吗?", onOk: () => { + props["departmentRemove"]({ id }); + message.success("删除成功"); getData(); }, @@ -32,22 +50,23 @@ function OrganizationStructure() { return (
- +
( <> - + )} columns={[ - { title: "部门名称", dataIndex: "name" }, - { title: "部门级别", dataIndex: "name" }, - { title: "主管领导", dataIndex: "name" }, + { title: "部门名称", dataIndex: "name", render: (_, record) => ( + + ) }, { title: "操作", width: 200, @@ -76,6 +104,8 @@ function OrganizationStructure() { onClick={() => { setAddModalOpen(true); setCurrentId(record.id); + + setSelectedNodeId(record.parentId); }} > 修改 @@ -91,7 +121,12 @@ function OrganizationStructure() { { setAddModalOpen(false); setCurrentId(""); @@ -104,9 +139,13 @@ function OrganizationStructure() { function AddModalComponent(props) { const [form] = Form.useForm(); + const [parentName, setParentName] = useState(null); useEffect(() => { if (props.currentId) { - console.log(props.currentId); + props.requestDetails({ id: props.currentId }).then((res) => { + form.setFieldsValue(res.data); + setParentName(res.data.parentName); + }); } }, [props.currentId]); const onCancel = () => { @@ -114,7 +153,18 @@ function AddModalComponent(props) { props.onCancel(); }; const onSubmit = async (values) => { - console.log(values); + values.levelName = getLabelName({ status: values.level, list: [{ bianma: "1", name: "一级部门" }] }); + values.parentId = props.parentId; + values.corpinfoId = CorpinfoId; + if (props.currentId) { + values.parentId = props.parentId; + values.id = props.currentId; + await props.requestEdit(values); + } + else { + await props.requestAdd(values); + } + onCancel(); props.getData(); }; @@ -123,12 +173,12 @@ function AddModalComponent(props) { open={props.open} onCancel={onCancel} onOk={form.submit} - title={props.currentId ? "修改" : "新增"} + title={props.currentId ? "编辑" : "新增"} width={800} > (111) }, + { name: "parentName", required: false, label: "上级部门", render: {parentName} }, { name: "name", label: "部门名称" }, - { name: "level", label: "部门级别", render: FORM_ITEM_RENDER_ENUM.SELECT, items: DEPARTMENT_LEVEL_ENUM }, - { name: "isRegulatory", label: "是否安全监管部门", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: [{ id: "0", name: "是" }, { id: "2", name: "否" }], tip: "安全监管部门负责人在“安委会办公室副主任核实”菜单处理重大较大隐患" }, - { name: "bz", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, - { name: "sort", label: "排序", render: FORM_ITEM_RENDER_ENUM.NUMBER }, + { name: "level", label: "部门级别", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ bianma: "1", name: "一级部门" }] }, + { name: "depOrder", label: "部门排序", render: FORM_ITEM_RENDER_ENUM.NUMBER }, + { + name: "securityFlag", + label: "是否安全管理部门", + required: false, + render: FORM_ITEM_RENDER_ENUM.RADIO, + items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }], + }, + { name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, ]} /> @@ -149,4 +205,4 @@ function AddModalComponent(props) { } const AddModal = AddModalComponent; -export default OrganizationStructure; +export default Connect([NS_DEPARTMENT], true)(OrganizationStructure); diff --git a/src/pages/Container/Enterprise/Post/index.js b/src/pages/Container/Enterprise/Post/index.js index 974c4af..de503ad 100644 --- a/src/pages/Container/Enterprise/Post/index.js +++ b/src/pages/Container/Enterprise/Post/index.js @@ -1,48 +1,55 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Form, message, Modal, Space, Tag } from "antd"; import { useEffect, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import AddIcon from "zy-react-library/components/Icon/AddIcon"; -import BackIcon from "zy-react-library/components/Icon/BackIcon"; import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; -import Search from "zy-react-library/components/Search"; +import SelectTree from "zy-react-library/components/SelectTree/Department/Gwj"; import Table from "zy-react-library/components/Table"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; +import { NS_POST } from "~/enumerate/namespace"; -function Post() { +function Post(props) { const [addModalOpen, setAddModalOpen] = useState(false); const [currentId, setCurrentId] = useState(""); + const [selectedNodeId, setSelectedNodeId] = useState("0"); + const [selectedNodeName, setSelectedNodeName] = useState(""); const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => { - }, { form }); + const { tableProps, getData } = useTable(props["postList"], { + form, + transform: (formData) => { + return { + ...formData, + departmentIdString: selectedNodeId, + corpFlag: 2, + }; + }, + }); const onDelete = (id) => { Modal.confirm({ title: "提示", content: "确定删除吗?", onOk: () => { + props["postRemove"]({ id }); + message.success("删除成功"); getData(); }, }); }; + const onTreeChange = (selectedKeys, event) => { + const key = selectedKeys[0] || null; + setSelectedNodeName(event.node.name); + console.log(selectedKeys); + setSelectedNodeId(key); + getData(); + }; return (
- +
-
( <> @@ -55,13 +62,11 @@ function Post() { > 新增 - )} columns={[ - { title: "部门名称", dataIndex: "name" }, - { title: "岗位名称", dataIndex: "name" }, - { title: "状态", dataIndex: "name", width: 100 }, + { title: "所属部门", required: false, dataIndex: "departmentName" }, + { title: "岗位名称", dataIndex: "postName" }, { title: "操作", width: 200, @@ -88,6 +93,12 @@ function Post() { { setAddModalOpen(false); setCurrentId(""); @@ -100,31 +111,58 @@ function Post() { function AddModalComponent(props) { const [form] = Form.useForm(); + const [parentName, setParentName] = useState(null); useEffect(() => { if (props.currentId) { - console.log(props.currentId); + props.requestDetails({ id: props.currentId }).then((res) => { + const arr = []; + res.data.departmentList && res.data.departmentList.forEach((item) => { + arr.push(item.departmentId); + }); + res.data.departmentIdsString = arr; + form.setFieldsValue(res.data); + console.log(res.data); + setParentName(res.data.departmentName); + }); } - }, [props.currentId]); + else { + setParentName(props.selectedNodeName); + } + }, [props.currentId, props.selectedNodeName]); + const onCancel = () => { form.resetFields(); props.onCancel(); }; const onSubmit = async (values) => { - console.log(values); - onCancel(); - props.getData(); + values.departmentIdString = props.parentId; + values.corpFlag = 2; + if (props.currentId) { + values.idString = props.currentId; + props.requestEdit(values).then(() => { + onCancel(); + props.getData(); + }); + } + else { + props.requestAdd(values).then(() => { + onCancel(); + props.getData(); + }); + } }; return ( (111) }, - { name: "post", label: "岗位名称" }, + { name: "parentName", required: false, label: "所属部门", render: {parentName } }, + { name: "postName", label: "岗位名称" }, { - name: "status", - label: "状态", - render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ id: "0", name: "启用" }, { id: "1", name: "禁用" }], - }, - { - name: "regPost", + name: "supervisionFlag", label: "是否监管岗位", + required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, - items: [{ id: "1", name: "是" }, { id: "2", name: "否" }], + items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }], }, - { name: "bz", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, + { name: "departmentIdsString", label: "数据权限", required: false, render: , dependencies: ["supervisionFlag"], hidden: formValues => (formValues.supervisionFlag === 0) }, + { name: "remarks", label: "岗位职责", render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, ]} /> @@ -154,4 +188,5 @@ function AddModalComponent(props) { } const AddModal = AddModalComponent; -export default Post; + +export default Connect([NS_POST], true)(Post); diff --git a/src/pages/Container/Enterprise/User/Add/index.js b/src/pages/Container/Enterprise/User/Add/index.js index 7754f33..630efb5 100644 --- a/src/pages/Container/Enterprise/User/Add/index.js +++ b/src/pages/Container/Enterprise/User/Add/index.js @@ -1,52 +1,138 @@ -import { tools } from "@cqsjjb/jjb-common-lib"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Form, message } from "antd"; +import { useEffect, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import HeaderBack from "zy-react-library/components/HeaderBack"; import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj"; import Upload from "zy-react-library/components/Upload"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; -import { ID_NUMBER } from "zy-react-library/regular"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import nation from "zy-react-library/json/nation.json"; +import { ID_NUMBER, PHONE } from "zy-react-library/regular"; +import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils"; +import { NS_USER } from "~/enumerate/namespace"; -const { query } = tools.router; const WHETHER_ENUM = [ - { id: "1", name: "是" }, - { id: "0", name: "否" }, + { bianma: 1, name: "是" }, + { bianma: 0, name: "否" }, +]; +const SEX = [ + { bianma: 1, name: "男" }, + { bianma: 2, name: "女" }, ]; -function Add() { - const onSubmit = (values) => { - console.log(values); +function Add(props) { + const [form] = Form.useForm(); + const [postData, setPostData] = useState([]); + const [rolesData, setRolesData] = useState([]); + // const [rankData, getRankData] = useState([]); + const [userTypeData, setUserTypeData] = useState([]); + const [userID, setUserID] = useState(null); + const queryParams = useGetUrlQuery(); + useEffect(() => { + if (queryParams["id"]) { + const fetchData = async () => { + const res = await props["userDetails"]({ id: queryParams["id"] }); + console.log(res.data); + setUserID(res.data.userId); + form.setFieldsValue(res.data); + }; + fetchData(); + } + props["rolesAll"]().then((res) => { + setRolesData(res.data); + }); + + // 部门级别 + // props["dictData"]({ appKey: "0bb989ecada5470c87635018ece9f327", dictValue: "departmentLevel" }).then((res) => { + // console.log(res); + // getRankData(res.data); + // }); + // 人员类型 + props["dictData"]({ appKey: "0bb989ecada5470c87635018ece9f327", dictValue: "renyuanleixing" }).then((res) => { + console.log(res); + setUserTypeData(res.data); + }); + }, []); + + const onSubmit = async (values) => { + values.nationName = getLabelName({ status: values.nation, list: nation }); + values.personnelTypeName = getLabelName({ status: values.personnelType, list: userTypeData, idKey: "dictValue", nameKey: "labelKey" }); + // values.rank_level_name = getLabelName({ status: values.rank_level, list: rankData, idKey: "dictValue", nameKey: "labelKey" }); + idCardGetDateAndGender(values.userIdCard); + + console.log(idCardGetDateAndGender(values.userIdCard)); + values.mainCorpFlag = 0; + values.userType = 2; + if (queryParams["id"]) { + values.id = queryParams["id"]; + values.userId = userID; + props["userEdit"](values).then((res) => { + if (res.success) { + window.history.back(); + message.success("编辑成功!"); + } + }); + } + else { + props["userAdd"](values).then((res) => { + if (res.success) { + window.history.back(); + message.success("新增成功!"); + } + }); + } }; + + const fnChoiceDepartment = async (event) => { + console.log(event); + form.setFieldsValue({ postId: undefined }); + // setDepartmentName(event[0].name) + props["postAll"]({ corpFlag: 1, departmentIdString: event[0].id }).then((res) => { + console.log(res); + setPostData(res.data); + }); + }; + return ( <> - +
}, + { name: "roleId", label: "用户角色", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: rolesData, itemsField: { labelKey: "roleName", valueKey: "id" } }, + { name: "departmentId", label: "所属部门", render: }, + { name: "postId", label: "所属岗位", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], + items: postData, + itemsField: { labelKey: "postName", valueKey: "id" }, }, { name: "username", label: "用户名", tip: "* 如果修改手机号,登录密码则会变成初始密码“Aa@123456789”" }, { name: "name", label: "姓名" }, + { name: "phone", label: "手机号", rules: [{ pattern: PHONE, message: "请输入正确的手机号" }] }, { - name: "personType", + name: "personnelType", label: "人员类型", render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], + items: userTypeData, + itemsField: { labelKey: "dictLabel", valueKey: "dictValue" }, }, { name: "userIdCard", label: "身份证号", + required: false, rules: [{ pattern: ID_NUMBER, message: "请输入正确的身份证号" }], }, { @@ -54,25 +140,25 @@ function Add() { label: "民族", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], + items: nation, }, { name: "sex", label: "性别", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], + componentProps: { disabled: true }, + items: SEX, }, { name: "faceFile", label: "上传人脸照片", required: false, span: 24, - render: ({ value, onChange }) => ( + render: (
* 图像格式:JPG、JPEG、PNG
@@ -85,15 +171,15 @@ function Add() { /> ), }, - { name: "sort", label: "部门排序", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER }, + { name: "sort", label: "部门排序", render: FORM_ITEM_RENDER_ENUM.NUMBER }, + // { name: "rank_level", label: "人员职级", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: rankData, itemsField: { labelKey: "dictLabel", valueKey: "dictValue" } }, { name: "email", label: "邮箱", required: false, rules: [{ type: "email", message: "请输入正确的邮箱" }] }, - { name: "isHeadOfDepartment", label: "是否为部门负责人", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM }, - { name: "bz", label: "备注", span: 24, required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, + { name: "remarks", label: "备注", span: 24, required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, + { name: "departmentLeaderFlag", label: "是否为部门负责人", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM }, ]} />
); } - -export default Add; +export default Connect([NS_USER], true)(Add); diff --git a/src/pages/Container/Enterprise/User/List/index.js b/src/pages/Container/Enterprise/User/List/index.js index 07e99a6..bc69692 100644 --- a/src/pages/Container/Enterprise/User/List/index.js +++ b/src/pages/Container/Enterprise/User/List/index.js @@ -1,5 +1,6 @@ -import { Button, Form, message, Modal, Space } from "antd"; -import { useState } from "react"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Descriptions, Form, message, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; import AddIcon from "zy-react-library/components/Icon/AddIcon"; import ExportIcon from "zy-react-library/components/Icon/ExportIcon"; import ImportIcon from "zy-react-library/components/Icon/ImportIcon"; @@ -8,16 +9,31 @@ import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index" import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; import useTable from "zy-react-library/hooks/useTable"; +import { NS_USER } from "~/enumerate/namespace"; function List(props) { const [importOpen, setImportOpen] = useState(false); + const [selectedNodeId, setSelectedNodeId] = useState(); + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["userList"], { + form, + transform: (formData) => { + return { + ...formData, + eqDepartmentId: selectedNodeId, + userType: 2, + }; + }, + }); const onDelete = (id) => { Modal.confirm({ title: "提示", content: "确定删除吗?", onOk: () => { + props["userRemove"]({ id }); + message.success("删除成功"); getData(); }, @@ -32,30 +48,26 @@ function List(props) { }, }); }; - const onResetPassword = () => { - Modal.confirm({ - title: "提示", - content: "确定要重置密码为Aa@123456789吗?", - onOk: () => { - message.success("重置密码成功"); - }, - }); - }; - const onUnlock = (id) => { - message.success("解锁成功"); - }; + const onImportFileConfirm = (values) => { console.log(values); message.success("导入成功"); }; + const onTreeChange = (selectedKeys) => { + const key = selectedKeys[0] || null; + console.log(selectedKeys); + setSelectedNodeId(key); + getData(); + }; return (
- +
)} columns={[ - { title: "用户名", dataIndex: "name" }, + { title: "用户名", dataIndex: "username" }, { title: "姓名", dataIndex: "name" }, - { title: "部门", dataIndex: "name" }, - { title: "岗位", dataIndex: "name" }, + { title: "部门", dataIndex: "departmentName" }, + { title: "岗位", dataIndex: "postName" }, { title: "操作", width: 300, render: (_, record) => ( - + - + ), @@ -119,8 +139,77 @@ function List(props) { onConfirm={onImportFileConfirm} onCancel={() => { setImportOpen(false); }} /> + { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} + />
); +}; + +function AddModalComponent(props) { + const [form] = Form.useForm(); + const [info, setInfo] = useState({}); + useEffect(() => { + if (props.currentId) { + const fetchData = async () => { + const res = await props.requestDetails({ id: props.currentId }); + console.log(res.data); + setInfo(res.data); + }; + fetchData(); + console.log(info); + } + }, [props.currentId]); + + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + + return ( + +
+ {info.departmentLeaderFlag === 1 ? "是" : "否"} }, + { label: "所属岗位", children: info.postName }, + { label: "用户名", children: info.username }, + { label: "姓名", children: info.name }, + { label: "手机号", children: info.phone }, + { label: "人员类型", children: info.personnelTypeName }, + { label: "身份证号", children: info.userIdCard }, + { label: "民族", children: info.nationName }, + { label: "性别", children: info.sex }, + + { label: "人脸照片", children: info.nationName }, + { label: "部门排序", children: info.sort }, + { label: "邮箱", children: info.email }, + { label: "备注", children: info.remarks }, + ]} + /> +
+
+ ); } -export default List; +const AddModal = AddModalComponent; +export default Connect([NS_USER], true)(List); diff --git a/src/pages/Container/PersonnelCertificate/index.js b/src/pages/Container/PersonnelCertificate/index.js new file mode 100644 index 0000000..9914744 --- /dev/null +++ b/src/pages/Container/PersonnelCertificate/index.js @@ -0,0 +1,183 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, message, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; +import FormBuilder from "zy-react-library/components/FormBuilder"; +import AddIcon from "zy-react-library/components/Icon/AddIcon"; + +import Search from "zy-react-library/components/Search"; +import Table from "zy-react-library/components/Table"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useTable from "zy-react-library/hooks/useTable"; +import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace"; + +const CorpinfoId = "1983773013086048256"; +function Department(props) { + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); + + const [form] = Form.useForm(); + const { tableProps, getData } = useTable(props["userQualificationInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + corpinfoIdString: CorpinfoId, + }; + }, + }); + + const onDelete = (id) => { + Modal.confirm({ + title: "提示", + content: "确定删除吗?", + onOk: () => { + props["userQualificationInfoRemove"]({ id }); + + message.success("删除成功"); + getData(); + }, + }); + }; + return ( +
+
+ +
+ +
( + <> + + + + )} + columns={[ + { title: "资质名称", dataIndex: "qualificationName" }, + { title: "证书编号", dataIndex: "certificateNo" }, + { title: "证书有效期", dataIndex: "ValidityTime", render: (text, record) => ({`${record.startValidityTime}至${record.endValidityTime}`}) }, + { + title: "操作", + width: 200, + render: (_, record) => ( + + + + + ), + }, + ]} + {...tableProps} + /> + + + { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} + /> + + ); +} + +function AddModalComponent(props) { + const [form] = Form.useForm(); + const [qualificationinfoId, setQualificationinfoId] = useState(false); + useEffect(() => { + if (props.currentId) { + props.requestDetails({ id: props.currentId }).then((res) => { + res.data.startValidity = [res.data.startValidityTime, res.data.endValidityTime]; + setQualificationinfoId(res.data.userQualificationinfoId); + form.setFieldsValue(res.data); + }); + } + }, [props.currentId]); + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + const onSubmit = async (values) => { + values.parentId = props.parentId; + values.corpinfoId = CorpinfoId; + values.startValidityTime = values.startValidity[0]; + values.endValidityTime = values.startValidity[1]; + values.userIdString = "1985635856156274689"; + values.userQualificationinfoId = qualificationinfoId; + + console.log(values.startValidity); + delete values.startValidity; + if (props.currentId) { + values.idString = props.currentId; + await props.requestEdit(values); + } + else { + await props.requestAdd(values); + } + + onCancel(); + props.getData(); + }; + return ( + + + + ); +} + +const AddModal = AddModalComponent; +export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department); diff --git a/src/pages/Container/Stakeholder/CorpInfo/components/Qualification.js b/src/pages/Container/Stakeholder/CorpInfo/components/Qualification.js index 0843ffd..1ba227b 100644 --- a/src/pages/Container/Stakeholder/CorpInfo/components/Qualification.js +++ b/src/pages/Container/Stakeholder/CorpInfo/components/Qualification.js @@ -112,7 +112,7 @@ function AddModalComponent(props) { open={props.open} onCancel={onCancel} onOk={form.submit} - title={props.currentId ? "修改" : "新增"} + title={props.currentId ? "编辑" : "新增"} width={800} > }, + { name: "QUALIFICATION_PIC", label: "照片", render: }, ]} /> diff --git a/src/pages/Container/Stakeholder/CorpInfo/index.js b/src/pages/Container/Stakeholder/CorpInfo/index.js index 92c75d2..4604cc2 100644 --- a/src/pages/Container/Stakeholder/CorpInfo/index.js +++ b/src/pages/Container/Stakeholder/CorpInfo/index.js @@ -1,53 +1,153 @@ -import { Button, Modal, QRCode } from "antd"; -import { useState } from "react"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, message, Modal, QRCode } from "antd"; +import { useEffect, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import Map from "zy-react-library/components/Map"; import Upload from "zy-react-library/components/Upload"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; -import { PHONE, UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular"; -// import Qualification from "./components/Qualification"; +import { PHONE, POSTAL_CODE, UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular"; +import { getLabelName } from "zy-react-library/utils"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; +import Qualification from "./components/Qualification"; -const xgfStateMap = { - 0: "未填报", - 1: "待审核", - 2: "已审核", - 3: 已打回, - 4: "已填报", -}; -function CorpInfo() { +const ENTERPRISE_STATUS = [ + { bianma: "filialstate01", name: "在产" }, + { bianma: "filialstate02", name: "在建" }, + { bianma: "filialstate03", name: "代建" }, + { bianma: "filialstate04", name: "停产" }, + { bianma: "filialstate05", name: "破产" }, +]; +const ECONOMY_TYPE = [ + { bianma: "economic_type19", name: "外资" }, + { bianma: "economic_type18", name: "中外合作" }, + { bianma: "economic_type17", name: "中外合资" }, + +]; +const WHETHER_ENUM = [ + { bianma: 1, name: "是" }, + { bianma: 0, name: "否" }, +]; +// const xgfStateMap = { +// 0: "未填报", +// 1: "待审核", +// 2: "已审核", +// 3: 已打回, +// 4: "已填报", +// }; +function CorpInfo(props) { const [corpInfoQrCodeOpen, setCorpInfoQrCodeOpen] = useState(false); - const onSubmit = (values) => { + const [form] = Form.useForm(); + useEffect(() => { + const fetchData = async () => { + const res = await props.corpInfoRemoveDetails({ id: "1985906265017954306" }); + res.data.license = [res.data.licenseStart, res.data.licenseEnd]; + form.setFieldsValue(res.data); + }; + fetchData(); + }, []); + + const onSubmit = async (values) => { console.log(values); + values.id = "1985906265017954306"; + values.ecoTypeName = getLabelName({ status: values.ecoType, list: ECONOMY_TYPE }); + values.scaleName = getLabelName({ status: values.scale, list: [{ bianma: "1-10人", name: "1-10人" }] }); + values.corpStateName = getLabelName({ status: values.corpState, list: ENTERPRISE_STATUS }); + values.licenseStart = values.license[0]; + values.licenseEnd = values.license[1]; + delete values.license; + props["corpInfoEdit"](values).then(() => { + message.success("操作成功!"); + }); }; return ( <>
xgfStateMap[formValues?.xgfState] || "未填报" }, - { name: "holderName", label: "开户人", required: false }, - { name: "code", label: "统一社会信用代码", rules: [{ pattern: UNIFIED_SOCIAL_CREDIT_CODE, message: "请输入正确的统一社会信用代码" }] }, - { name: "companyAreas", label: "属地" }, - { name: "industryNames", label: "所属行业", required: false }, - { name: "map", customizeRender: true, render: () => , span: 24 }, - { name: "ecoType", label: "经济类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }] }, - { name: "address", label: "单位经营地址" }, - { name: "scale", label: "企业规模", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }] }, - { name: "lrName", label: "法定代表人姓名" }, - { name: "lrPhone", label: "法定代表人手机号", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }], required: false }, - { name: "contacts", label: "主要负责人" }, - { name: "contactsPhone", label: "主要负责人联系电话", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }] }, - { name: "createDate", label: "成立日期", render: FORM_ITEM_RENDER_ENUM.DATE }, - { name: "employees", label: "职工人数(人)", render: FORM_ITEM_RENDER_ENUM.NUMBER }, - { name: "totalassets", label: "资产总额(万元)", render: FORM_ITEM_RENDER_ENUM.NUMBER }, - { name: "regcapital", label: "注册资金(万元)", render: FORM_ITEM_RENDER_ENUM.NUMBER }, - { name: "employmentForm", label: "用工形式", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }] }, - // { name: "selectForms", label: "选取形式", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }] }, - { name: "businessLicense", label: "营业执照", render: ({ value, onChange }) => }, - { name: "businessLicenseDate", label: "营业执照有效期", render: FORM_ITEM_RENDER_ENUM.DATE }, + { label: "基本信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER }, + { label: "企业名称", name: "corpName", span: 24, componentProps: { disabled: true } }, + { + label: "社会统一信用代码", + name: "code", + rules: [{ pattern: UNIFIED_SOCIAL_CREDIT_CODE, message: "请输入正确的社会统一信用代码" }], + }, + { label: "所属区域", required: false, name: "POSSESSION", componentProps: { disabled: true } }, + { + label: "邮政编码", + name: "postalCode", + required: false, + rules: [{ pattern: POSTAL_CODE, message: "请输入正确的邮政编码" }], + }, + { + label: "规模", + name: "scale", + required: false, + render: FORM_ITEM_RENDER_ENUM.SELECT, + items: [{ bianma: "1-10人", name: "1-10人" }], + }, + { label: "成立时间", name: "createDate", required: false, render: FORM_ITEM_RENDER_ENUM.DATE }, + { + label: "企业状态", + name: "corpState", + render: FORM_ITEM_RENDER_ENUM.SELECT, + items: ENTERPRISE_STATUS, + }, + { name: "map", customizeRender: true, render: , span: 24 }, + { label: "职工人数", name: "employees", render: FORM_ITEM_RENDER_ENUM.NUMBER }, + { label: "占地面积(㎡)", name: "areaCovered", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER }, + { label: "注册资金(万元)", name: "regcapital", render: FORM_ITEM_RENDER_ENUM.NUMBER }, + { label: "资产总额(万元)", name: "totalAssets", render: FORM_ITEM_RENDER_ENUM.NUMBER }, + { + label: "经济类型", + name: "ecoType", + render: FORM_ITEM_RENDER_ENUM.SELECT, + items: ECONOMY_TYPE, + }, + { + label: "所属行业", + name: "INDUSTRYALL", + required: false, + render: FORM_ITEM_RENDER_ENUM.SELECT, + items: [{ bianma: "1-10人", name: "1-10人" }], + }, + { label: "法定代表人", name: "lrName", required: false }, + { + label: "法人手机号", + name: "lrMobile", + required: false, + rules: [{ pattern: PHONE, message: "请输入正确的手机号" }], + }, + { label: "主要负责人", name: "contacts" }, + { label: "主要负责人手机号", name: "contactsPhone", rules: [{ pattern: PHONE, message: "请输入正确的手机号" }] }, + { label: "安全负责人", name: "safetyName", required: false }, + { + label: "安全负责人电话手机号", + name: "safetyPhone", + required: false, + rules: [{ pattern: PHONE, message: "请输入正确的手机号" }], + }, + { + label: "是否规模以上", + name: "scaleType", + required: false, + render: FORM_ITEM_RENDER_ENUM.RADIO, + items: WHETHER_ENUM, + }, + { label: "企事业单位经营地址", name: "addressBusiness" }, + { + label: "营业执照", + name: "BUS_IMAGES", + required: false, + render: , + }, + { + label: "营业执照有效期", + name: "license", + + render: FORM_ITEM_RENDER_ENUM.DATE_RANGE, + }, { name: "qrCode", label: "企业二维码", required: false, hidden: formValues => !(formValues.xgfState !== 2), render: () => (
@@ -85,4 +185,4 @@ const CorpInfoQrCode = (props) => { ); }; -export default CorpInfo; +export default Connect([NS_ENTERPRISE], true)(CorpInfo); diff --git a/src/pages/Container/Stakeholder/Department/index.js b/src/pages/Container/Stakeholder/Department/index.js index 63d8db0..a4dc38f 100644 --- a/src/pages/Container/Stakeholder/Department/index.js +++ b/src/pages/Container/Stakeholder/Department/index.js @@ -1,28 +1,48 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Form, message, Modal, Space, Tag } from "antd"; import { useEffect, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; +import AddIcon from "zy-react-library/components/Icon/AddIcon"; import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; -import { PHONE } from "zy-react-library/regular"; +import { getLabelName } from "zy-react-library/utils"; +import { NS_DEPARTMENT } from "~/enumerate/namespace"; -const DEPARTMENT_LEVEL_ENUM = [ - { id: "1", name: "公司级" }, - { id: "2", name: "部门级" }, - { id: "3", name: "小组级" }, -]; -function Department() { +const CorpinfoId = "1985906265017954306"; +function Department(props) { const [addModalOpen, setAddModalOpen] = useState(false); const [currentId, setCurrentId] = useState(""); + const [selectedNodeId, setSelectedNodeId] = useState(null); + const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["departmentList"], { + form, + transform: (formData) => { + return { + ...formData, + eqParentId: selectedNodeId, + eqCorpinfoId: CorpinfoId, + }; + }, + }); + + const onTreeChange = (selectedKeys) => { + const key = selectedKeys[0] || null; + + setSelectedNodeId(key); + getData(); + }; + const onDelete = (id) => { Modal.confirm({ title: "提示", content: "确定删除吗?", onOk: () => { + props["departmentRemove"]({ id }); + message.success("删除成功"); getData(); }, @@ -31,38 +51,39 @@ function Department() { return (
- +
( <> - + )} columns={[ { title: "部门名称", dataIndex: "name" }, - { title: "部门级别", dataIndex: "name" }, - { title: "主管领导", dataIndex: "name" }, { title: "操作", width: 200, @@ -73,6 +94,8 @@ function Department() { onClick={() => { setAddModalOpen(true); setCurrentId(record.id); + + setSelectedNodeId(record.parentId); }} > 修改 @@ -88,7 +111,12 @@ function Department() { { setAddModalOpen(false); setCurrentId(""); @@ -101,9 +129,13 @@ function Department() { function AddModalComponent(props) { const [form] = Form.useForm(); + const [parentName, setParentName] = useState(null); useEffect(() => { if (props.currentId) { - console.log(props.currentId); + props.requestDetails({ id: props.currentId }).then((res) => { + form.setFieldsValue(res.data); + setParentName(res.data.parentName); + }); } }, [props.currentId]); const onCancel = () => { @@ -111,7 +143,18 @@ function AddModalComponent(props) { props.onCancel(); }; const onSubmit = async (values) => { - console.log(values); + values.levelName = getLabelName({ status: values.level, list: [{ bianma: "1", name: "一级部门" }] }); + values.parentId = props.parentId; + values.corpinfoId = CorpinfoId; + if (props.currentId) { + values.parentId = props.parentId; + values.id = props.currentId; + await props.requestEdit(values); + } + else { + await props.requestAdd(values); + } + onCancel(); props.getData(); }; @@ -120,22 +163,32 @@ function AddModalComponent(props) { open={props.open} onCancel={onCancel} onOk={form.submit} - title={props.currentId ? "修改" : "新增"} + title={props.currentId ? "编辑" : "新增"} + loading={props.loading} width={800} > (111) }, - { name: "name", label: "部门级别", render: FORM_ITEM_RENDER_ENUM.SELECT, items: DEPARTMENT_LEVEL_ENUM }, - { name: "name", label: "部门负责人", required: false }, - { name: "name", label: "部门负责人手机号", required: false, rules: [{ pattern: PHONE, message: "请输入正确的手机号" }] }, - { name: "name", label: "排序", render: FORM_ITEM_RENDER_ENUM.NUMBER }, - { name: "name", label: "备注", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false }, + { name: "parentName", required: false, label: "上级部门", render: {parentName} }, + { name: "name", label: "部门名称" }, + { name: "level", label: "部门级别", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ bianma: "1", name: "一级部门" }] }, + { name: "depOrder", label: "部门排序", render: FORM_ITEM_RENDER_ENUM.NUMBER }, + { + name: "securityFlag", + label: "是否安全管理部门", + required: false, + render: FORM_ITEM_RENDER_ENUM.RADIO, + items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }], + }, + { name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, ]} /> @@ -143,4 +196,4 @@ function AddModalComponent(props) { } const AddModal = AddModalComponent; -export default Department; +export default Connect([NS_DEPARTMENT], true)(Department); diff --git a/src/pages/Container/Stakeholder/SecurityPersonnelInfo/index.js b/src/pages/Container/Stakeholder/SecurityPersonnelInfo/index.js index a5effa2..0d51644 100644 --- a/src/pages/Container/Stakeholder/SecurityPersonnelInfo/index.js +++ b/src/pages/Container/Stakeholder/SecurityPersonnelInfo/index.js @@ -1,49 +1,58 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Form } from "antd"; + import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg"; -import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; -import useTable from "zy-react-library/hooks/useTable"; -import { PERSONNEL_TYPE_ENUM } from "~/pages/Container/Stakeholder/User/List"; -function SpecialOperationPersonnel() { +import useTable from "zy-react-library/hooks/useTable"; +import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace"; + +function Department(props) { const [form] = Form.useForm(); - const { tableProps } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["userQualificationInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + eqQualificationinfoType: 1, + corpinfoIdString: "1983773013086048256", + eqUserId: "1986628687154974721", + }; + }, + }); return (
- -
}, - ]} - {...tableProps} - /> +
+ +
+ +
{record.employmentFlag === 1 ? "就职" : record.employmentFlag === 0 ? "离职" : ""} }, + { title: "图片", dataIndex: "name", render: (_, record) => () }, + + ]} + {...tableProps} + /> + + + ); } -export default SpecialOperationPersonnel; +export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department); diff --git a/src/pages/Container/Stakeholder/SpecialOperationPersonnel/index.js b/src/pages/Container/Stakeholder/SpecialOperationPersonnel/index.js index 2355eff..2a0a9a3 100644 --- a/src/pages/Container/Stakeholder/SpecialOperationPersonnel/index.js +++ b/src/pages/Container/Stakeholder/SpecialOperationPersonnel/index.js @@ -1,51 +1,59 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Form } from "antd"; + import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg"; -import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; -import useTable from "zy-react-library/hooks/useTable"; -import { PERSONNEL_TYPE_ENUM } from "~/pages/Container/Stakeholder/User/List"; -function SpecialOperationPersonnel() { +import useTable from "zy-react-library/hooks/useTable"; +import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace"; + +function Department(props) { const [form] = Form.useForm(); - const { tableProps } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["userQualificationInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + eqQualificationinfoType: 1, + corpinfoIdString: "1983773013086048256", + eqUserId: "1986628687154974721", + }; + }, + }); return (
- -
}, - ]} - {...tableProps} - /> +
+ +
+ +
{record.employmentFlag === 1 ? "就职" : record.employmentFlag === 0 ? "离职" : ""} }, + { title: "图片", dataIndex: "name", render: (_, record) => () }, + + ]} + {...tableProps} + /> + + + ); } -export default SpecialOperationPersonnel; +export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department); diff --git a/src/pages/Container/Stakeholder/User/Add/index.js b/src/pages/Container/Stakeholder/User/Add/index.js index 53d1977..2857f5e 100644 --- a/src/pages/Container/Stakeholder/User/Add/index.js +++ b/src/pages/Container/Stakeholder/User/Add/index.js @@ -1,36 +1,83 @@ -import { tools } from "@cqsjjb/jjb-common-lib"; -import { Alert, Form } from "antd"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Form, message } from "antd"; +import { useEffect, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import HeaderBack from "zy-react-library/components/HeaderBack"; +import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj"; import Upload from "zy-react-library/components/Upload"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import nation from "zy-react-library/json/nation.json"; import { ID_NUMBER } from "zy-react-library/regular"; +import { getLabelName } from "zy-react-library/utils"; +import { NS_USER } from "~/enumerate/namespace"; -const { query } = tools.router; export const WHETHER_ENUM = [ - { name: "是", id: "1" }, - { name: "否", id: "0" }, + { name: "是", bianma: "1" }, + { name: "否", bianma: "0" }, ]; export const SEX_ENUM = [ - { name: "男", id: "0" }, - { name: "女", id: "1" }, + { name: "男", bianma: "0" }, + { name: "女", bianma: "1" }, ]; export const MARITAL_STATUS_ENUM = [ - { name: "已婚", id: "1" }, - { name: "未婚", id: "0" }, + { name: "已婚", bianma: "1" }, + { name: "未婚", bianma: "0" }, ]; -function Add() { + +function Add(props) { + const queryParams = useGetUrlQuery(); const [form] = Form.useForm(); + const [userID, setUserID] = useState(null); + + useEffect(() => { + console.log(queryParams["id"]); + + if (queryParams["id"]) { + const fetchData = async () => { + const res = await props["userDetails"]({ id: queryParams["id"] }); + setUserID(res.data.userId); + form.setFieldsValue(res.data); + }; + fetchData(); + } + }, [queryParams["id"]]); + const onSubmit = (values) => { - console.log(values); + values.mainCorpFlag = 0; + values.userType = 1; + values.nationName = getLabelName({ status: values.nation, list: nation }); + values.politicalAffiliationName = getLabelName({ status: values.politicalAffiliation, list: [{ name: "党员", bianma: "1" }, { name: "群众", bianma: "2" }] }); + values.culturalLevelName = getLabelName({ status: values.culturalLevel, list: [{ name: "大学", bianma: "1" }] }); + values.maritalStatusName = getLabelName({ status: values.maritalStatus, list: MARITAL_STATUS_ENUM }); + if (queryParams["id"]) { + values.id = queryParams["id"]; + values.userId = userID; + props["userEdit"](values).then((res) => { + if (res.success) { + window.history.back(); + message.success("编辑成功!"); + } + }); + } + else { + props["userSaveXgfAdd"](values).then((res) => { + if (res.success) { + window.history.back(); + message.success("新增成功!"); + } + }); + } }; + return ( <> - +
( + render: (
* 图像格式:JPG、JPEG、PNG
@@ -55,18 +101,19 @@ function Add() { /> ), }, + + { name: "username", label: "用户名", tip: "* 如果修改手机号,登录密码则会变成初始密码“Aa@123456789”" }, { name: "name", label: "姓名" }, - { name: "username", label: "用户名", componentProps: { disabled: query.id } }, - { name: "departmentId", label: "所属部门" }, - { name: "cardId", label: "身份证号", rules: [{ pattern: ID_NUMBER, message: "请输入正确的身份证号" }] }, + { name: "departmentId", label: "所属部门", render: }, + { name: "userIdCard", label: "身份证号", rules: [{ pattern: ID_NUMBER, message: "请输入正确的身份证号" }] }, { name: "userCardFile", label: "身份证照片", - render: ({ value, onChange }) => ( + required: false, + render: (
温馨提示:用户要上传身份证正反面(身份证照片数量是2张), 才能进行人员培训
@@ -77,10 +124,11 @@ function Add() { }, { name: "email", label: "电子邮箱", required: false, rules: [{ type: "email", message: "请输入正确的邮箱" }] }, { - name: "nationality", + name: "nation", label: "民族", + required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], + items: nation, }, { name: "sex", @@ -91,185 +139,186 @@ function Add() { }, { name: "dateOfBirth", label: "出生年月", render: FORM_ITEM_RENDER_ENUM.DATE }, { name: "age", label: "年龄", render: FORM_ITEM_RENDER_ENUM.NUMBER }, - { name: "hklocal", label: "户口所在地" }, - { name: "address", label: "现住址" }, + { name: "locationAddress", label: "户口所在地" }, + { name: "currentAddress", label: "现住址" }, { - name: "degreeOfEducation", + name: "culturalLevel", label: "文化程度", render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], + items: [{ name: "大学", bianma: "1" }], }, { - name: "maritalstatus", + name: "maritalStatus", label: "婚姻状况", render: FORM_ITEM_RENDER_ENUM.RADIO, items: MARITAL_STATUS_ENUM, }, { - name: "politicalStatus", + name: "politicalAffiliation", label: "政治面貌", render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], + items: [{ name: "党员", bianma: "1" }, { name: "群众", bianma: "2" }], componentProps: { onChange: () => { form.setFieldValue("politicalTime", undefined); }, }, }, - { - name: "politicalTime", - label: "入党时间", - render: FORM_ITEM_RENDER_ENUM.DATE, - dependencies: ["politicalStatus"], - hidden: formValues => !(formValues.politicalStatus === "zhonggongdangyuan"), - }, - { name: "postId", label: "岗位名称(工种)" }, - { - name: "isSocial", - label: "是否缴纳社保", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - componentProps: { - onChange: () => { - form.setFieldValue("socialNumber", undefined); - form.setFieldValue("socSecurity", undefined); - }, - }, - }, - { - name: "socialNumber", - label: "社会保障号码", - dependencies: ["isSocial"], - hidden: formValues => !(formValues.isSocial === "1"), - }, - { - name: "socSecurity", - label: "社保卡照片", - render: ({ value, onChange }) => , - dependencies: ["isSocial"], - hidden: formValues => !(formValues.isSocial === "1"), - }, - { - name: "isBf", - label: "是否缴纳保险", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - }, - { - name: "isSignLabor", - label: "是否签订劳动合同", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - componentProps: { - onChange: () => { - form.setFieldValue("contract", undefined); - }, - }, - }, - { - name: "contract", - label: "合同图片", - render: ({ value, onChange }) => , - dependencies: ["isSignLabor"], - hidden: formValues => !(formValues.isSignLabor === "1"), - }, - { - name: "ispay", - label: "是否缴纳商业保险", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - componentProps: { - onChange: () => { - form.setFieldValue("ispayNumber", undefined); - form.setFieldValue("insurance", undefined); - }, - }, - }, - { - name: "ispayNumber", - label: "商业保险单号", - dependencies: ["ispay"], - hidden: formValues => !(formValues.ispay === "1"), - }, - { - name: "insurance", - label: "保险图片", - render: ({ value, onChange }) => , - dependencies: ["ispay"], - hidden: formValues => !(formValues.ispay === "1"), - }, - { - name: "isInjuriesPay", - label: "是否按期缴纳工伤保险", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - componentProps: { - onChange: () => { - form.setFieldValue("isInjuriesPayTime", undefined); - form.setFieldValue("empInsurance", undefined); - }, - }, - }, - { - name: "isInjuriesPayTime", - label: "工伤保险有效期", - dependencies: ["isInjuriesPay"], - render: FORM_ITEM_RENDER_ENUM.DATE, - hidden: formValues => !(formValues.isInjuriesPay === "1"), - }, - { - name: "empInsurance", - label: "工伤保险凭证", - render: ({ value, onChange }) => , - dependencies: ["isInjuriesPay"], - hidden: formValues => !(formValues.isInjuriesPay === "1"), - }, - { - name: "isLevelThree", - label: "是否参加三级安全培训", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - componentProps: { - onChange: () => { - form.setFieldValue("threeLevel", undefined); - }, - }, - }, - { - name: "threeLevel", - label: "三级安全培训照片", - render: ({ value, onChange }) => , - dependencies: ["isLevelThree"], - hidden: formValues => !(formValues.isLevelThree === "1"), - }, - { - name: "isflow", - label: "是否流动人员", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - }, - { - name: "IS_SPECIAL_JOB", - label: "是否特殊工种", - required: false, - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - // componentProps: { disabled: true }, - }, - { - name: "IS_DEPARTMENT_HEAD", - label: "是否为部门负责人", - required: false, - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - // componentProps: { disabled: true }, - }, - { - name: "alert", - span: 24, - customizeRender: true, - render: () => (), - }, + // { name: "deputyLeaderFlag", label: "是否为分管领导", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM }, + // { + // name: "politicalTime", + // label: "入党时间", + // render: FORM_ITEM_RENDER_ENUM.DATE, + // dependencies: ["politicalStatus"], + // hidden: formValues => !(formValues.politicalStatus === "zhonggongdangyuan"), + // }, + // { name: "postId", label: "岗位名称(工种)" }, + // { + // name: "isSocial", + // label: "是否缴纳社保", + // render: FORM_ITEM_RENDER_ENUM.RADIO, + // items: WHETHER_ENUM, + // componentProps: { + // onChange: () => { + // form.setFieldValue("socialNumber", undefined); + // form.setFieldValue("socSecurity", undefined); + // }, + // }, + // }, + // { + // name: "socialNumber", + // label: "社会保障号码", + // dependencies: ["isSocial"], + // hidden: formValues => !(formValues.isSocial === "1"), + // }, + // { + // name: "socSecurity", + // label: "社保卡照片", + // render: , + // dependencies: ["isSocial"], + // hidden: formValues => !(formValues.isSocial === "1"), + // }, + // { + // name: "isBf", + // label: "是否缴纳保险", + // render: FORM_ITEM_RENDER_ENUM.RADIO, + // items: WHETHER_ENUM, + // }, + // { + // name: "isSignLabor", + // label: "是否签订劳动合同", + // render: FORM_ITEM_RENDER_ENUM.RADIO, + // items: WHETHER_ENUM, + // componentProps: { + // onChange: () => { + // form.setFieldValue("contract", undefined); + // }, + // }, + // }, + // { + // name: "contract", + // label: "合同图片", + // render: , + // dependencies: ["isSignLabor"], + // hidden: formValues => !(formValues.isSignLabor === "1"), + // }, + // { + // name: "ispay", + // label: "是否缴纳商业保险", + // render: FORM_ITEM_RENDER_ENUM.RADIO, + // items: WHETHER_ENUM, + // componentProps: { + // onChange: () => { + // form.setFieldValue("ispayNumber", undefined); + // form.setFieldValue("insurance", undefined); + // }, + // }, + // }, + // { + // name: "ispayNumber", + // label: "商业保险单号", + // dependencies: ["ispay"], + // hidden: formValues => !(formValues.ispay === "1"), + // }, + // { + // name: "insurance", + // label: "保险图片", + // render: , + // dependencies: ["ispay"], + // hidden: formValues => !(formValues.ispay === "1"), + // }, + // { + // name: "isInjuriesPay", + // label: "是否按期缴纳工伤保险", + // render: FORM_ITEM_RENDER_ENUM.RADIO, + // items: WHETHER_ENUM, + // componentProps: { + // onChange: () => { + // form.setFieldValue("isInjuriesPayTime", undefined); + // form.setFieldValue("empInsurance", undefined); + // }, + // }, + // }, + // { + // name: "isInjuriesPayTime", + // label: "工伤保险有效期", + // dependencies: ["isInjuriesPay"], + // render: FORM_ITEM_RENDER_ENUM.DATE, + // hidden: formValues => !(formValues.isInjuriesPay === "1"), + // }, + // { + // name: "empInsurance", + // label: "工伤保险凭证", + // render: , + // dependencies: ["isInjuriesPay"], + // hidden: formValues => !(formValues.isInjuriesPay === "1"), + // }, + // { + // name: "isLevelThree", + // label: "是否参加三级安全培训", + // render: FORM_ITEM_RENDER_ENUM.RADIO, + // items: WHETHER_ENUM, + // componentProps: { + // onChange: () => { + // form.setFieldValue("threeLevel", undefined); + // }, + // }, + // }, + // { + // name: "threeLevel", + // label: "三级安全培训照片", + // render: , + // dependencies: ["isLevelThree"], + // hidden: formValues => !(formValues.isLevelThree === "1"), + // }, + // { + // name: "isflow", + // label: "是否流动人员", + // render: FORM_ITEM_RENDER_ENUM.RADIO, + // items: WHETHER_ENUM, + // }, + // { + // name: "IS_SPECIAL_JOB", + // label: "是否特殊工种", + // required: false, + // render: FORM_ITEM_RENDER_ENUM.RADIO, + // items: WHETHER_ENUM, + // // componentProps: { disabled: true }, + // }, + // { + // name: "IS_DEPARTMENT_HEAD", + // label: "是否为部门负责人", + // required: false, + // render: FORM_ITEM_RENDER_ENUM.RADIO, + // items: WHETHER_ENUM, + // // componentProps: { disabled: true }, + // }, + // { + // name: "alert", + // span: 24, + // customizeRender: true, + // render: () => (), + // }, ]} />
@@ -277,4 +326,4 @@ function Add() { ); } -export default Add; +export default Connect([NS_USER], true)(Add); diff --git a/src/pages/Container/Stakeholder/User/List/index.js b/src/pages/Container/Stakeholder/User/List/index.js index 2dc54e2..89a68ad 100644 --- a/src/pages/Container/Stakeholder/User/List/index.js +++ b/src/pages/Container/Stakeholder/User/List/index.js @@ -1,112 +1,211 @@ -import { Button, Form, message, Modal } from "antd"; -import { useState } from "react"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Descriptions, Form, message, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; import AddIcon from "zy-react-library/components/Icon/AddIcon"; -import ImportIcon from "zy-react-library/components/Icon/ImportIcon"; -import ImportFile from "zy-react-library/components/ImportFile"; + import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; -import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; +import { NS_USER } from "~/enumerate/namespace"; -export const PERSONNEL_TYPE_ENUM = [ - { id: "0", name: "非流动人员" }, - { id: "1", name: "流动人员" }, -]; function List(props) { - const [importOpen, setImportOpen] = useState(false); + const [selectedNodeId, setSelectedNodeId] = useState(); + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["userList"], { + form, + transform: (formData) => { + return { + ...formData, + eqDepartmentId: selectedNodeId, + userType: 3, + }; + }, + }); - const onImportFileConfirm = (values) => { - console.log(values); - message.success("导入成功"); - }; - const onResignation = (id) => { + const onResetPassword = () => { Modal.confirm({ title: "提示", - content: "确定离职吗?", - onOk: () => { - message.success("离职成功"); - getData(); - }, - }); - }; - const onResetPassword = (id) => { - Modal.confirm({ - title: "提示", - content: "是否重置密码为Bb@123456789?", + content: "确定要重置密码为Aa@123456789吗?", onOk: () => { message.success("重置密码成功"); - getData(); }, }); }; + const onDelete = (id) => { + Modal.confirm({ + title: "提示", + content: "确定删除吗?", + onOk: () => { + props["userRemove"]({ id }); + message.success("删除成功"); + getData(); + }, + }); + }; + const onTreeChange = (selectedKeys) => { + const key = selectedKeys[0] || null; + setSelectedNodeId(key); + getData(); + }; return (
- +
( <> - - + + )} columns={[ - { title: "用户名", dataIndex: "name" }, + { title: "用户名", dataIndex: "username" }, { title: "姓名", dataIndex: "name" }, - { title: "部门", dataIndex: "name" }, - { title: "人员类型", dataIndex: "name" }, - { title: "培训状态", dataIndex: "name" }, - { title: "基础信息填报状态", dataIndex: "name" }, + { title: "部门", dataIndex: "departmentName" }, + { title: "岗位", dataIndex: "postName" }, { title: "操作", - width: 300, + width: 600, render: (_, record) => ( - <> - - - + - + + + + + + ), }, ]} {...tableProps} - dataSource={[{}]} /> - { setImportOpen(false); }} + + { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} /> ); +}; + +function AddModalComponent(props) { + const [form] = Form.useForm(); + const [info, setInfo] = useState({}); + useEffect(() => { + if (props.currentId) { + const fetchData = async () => { + const res = await props.requestDetails({ id: props.currentId }); + console.log(res.data); + setInfo(res.data); + }; + fetchData(); + console.log(info); + } + }, [props.currentId]); + + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + + return ( + + +
+ {info.departmentLeaderFlag === 1 ? "是" : "否"} }, + { label: "所属岗位", children: info.postName }, + { label: "用户名", children: info.username }, + { label: "姓名", children: info.name }, + { label: "手机号", children: info.phone }, + { label: "人员类型", children: info.personnelTypeName }, + { label: "身份证号", children: info.userIdCard }, + { label: "民族", children: info.nationName }, + { label: "性别", children: info.sex }, + + { label: "人脸照片", children: info.nationName }, + { label: "部门排序", children: info.sort }, + { label: "邮箱", children: info.email }, + { label: "备注", children: info.remarks }, + ]} + /> +
+
+ ); } -export default List; + +const AddModal = AddModalComponent; +export default Connect([NS_USER], true)(List); diff --git a/src/pages/Container/Stakeholder/User/SecurityPersonnel/index.js b/src/pages/Container/Stakeholder/User/SecurityPersonnel/index.js new file mode 100644 index 0000000..0562355 --- /dev/null +++ b/src/pages/Container/Stakeholder/User/SecurityPersonnel/index.js @@ -0,0 +1,198 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; +import FormBuilder from "zy-react-library/components/FormBuilder"; +import HeaderBack from "zy-react-library/components/HeaderBack"; + +import AddIcon from "zy-react-library/components/Icon/AddIcon"; +import Search from "zy-react-library/components/Search"; +import Dictionary from "zy-react-library/components/Select/Dictionary"; +import Table from "zy-react-library/components/Table"; +import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg"; +import Upload from "zy-react-library/components/Upload"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import useTable from "zy-react-library/hooks/useTable"; + +import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace"; + +function Department(props) { + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); + const queryParams = useGetUrlQuery(); + + const [form] = Form.useForm(); + const { tableProps, getData } = useTable(props["userQualificationInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + eqQualificationinfoType: 2, + corpinfoIdString: queryParams["corpinfoId"], + eqUserId: queryParams["id"], + }; + }, + }); + + const onDelete = (id) => { + Modal.confirm({ + title: "提示", + content: "确定删除吗?", + onOk: () => { + props["userQualificationInfoRemove"]({ id }); + + getData(); + }, + }); + }; + return ( +
+ + + +
+
+ +
+ +
( + <> + + + + )} + columns={[ + { title: "姓名", dataIndex: "qualificationName" }, + { title: "证书名称", dataIndex: "qualificationName" }, + { title: "证书编号", dataIndex: "certificateNo" }, + { title: "就职状态", dataIndex: "certificateNo", render: (_, record) => {record.employmentFlag === 1 ? "就职" : record.employmentFlag === 0 ? "离职" : ""} }, + { title: "图片", dataIndex: "name", render: (_, record) => () }, + { + title: "操作", + width: 200, + render: (_, record) => ( + + + + + ), + }, + ]} + {...tableProps} + /> + + + { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} + /> + + + ); +} + +function AddModalComponent(props) { + const [form] = Form.useForm(); + + const queryParams = useGetUrlQuery(); + const [userQualificationinfoId, setUserQualificationinfoId] = useState(""); + useEffect(() => { + if (props.currentId) { + props.requestDetails({ id: props.currentId }).then((res) => { + form.setFieldsValue(res.data); + setUserQualificationinfoId(res.data.userQualificationinfoId); + }); + } + }, [props.currentId]); + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + const onSubmit = async (values) => { + values.corpinfoId = queryParams["corpinfoId"]; + values.userIdString = queryParams["id"]; + + values.qualificationinfoType = 2; + values.userQualificationinfoId = userQualificationinfoId; + values.qualificationinfoCategory = "qyzyfzr"; + values.qualificationinfoCategoryName = "企业主要负责人"; + if (props.currentId) { + values.idString = props.currentId; + await props.requestEdit(values); + } + else { + await props.requestAdd(values); + } + + onCancel(); + props.getData(); + }; + return ( + + }, + + { name: "certificateNo", label: "证书编号" }, + { name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, + { name: "name", required: false, label: "证书图片", render: }, + + ]} + s + /> + + ); +} + +const AddModal = AddModalComponent; +export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department); diff --git a/src/pages/Container/Stakeholder/User/SpecialPersonnel/index.js b/src/pages/Container/Stakeholder/User/SpecialPersonnel/index.js new file mode 100644 index 0000000..fe609ce --- /dev/null +++ b/src/pages/Container/Stakeholder/User/SpecialPersonnel/index.js @@ -0,0 +1,199 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; +import FormBuilder from "zy-react-library/components/FormBuilder"; +import HeaderBack from "zy-react-library/components/HeaderBack"; + +import AddIcon from "zy-react-library/components/Icon/AddIcon"; +import Search from "zy-react-library/components/Search"; +import Table from "zy-react-library/components/Table"; +import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg"; +import Upload from "zy-react-library/components/Upload"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import useTable from "zy-react-library/hooks/useTable"; +import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace"; + +function Department(props) { + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); + const queryParams = useGetUrlQuery(); + + const [form] = Form.useForm(); + const { tableProps, getData } = useTable(props["userQualificationInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + eqQualificationinfoType: 1, + corpinfoIdString: queryParams["corpinfoId"], + eqUserId: queryParams["id"], + }; + }, + }); + + const onDelete = (id) => { + Modal.confirm({ + title: "提示", + content: "确定删除吗?", + onOk: () => { + props["userQualificationInfoRemove"]({ id }); + + getData(); + }, + }); + }; + return ( +
+ + +
+
+ +
+ +
( + <> + + + + )} + columns={[ + { title: "姓名", dataIndex: "qualificationName" }, + { title: "证书名称", dataIndex: "qualificationName" }, + { title: "证书作业类别", dataIndex: "qualificationinfoCategoryName" }, + { title: "操作项目", dataIndex: "operatingProjectName" }, + { title: "证书编号", dataIndex: "certificateNo" }, + { title: "就职状态", dataIndex: "certificateNo", render: (_, record) => {record.employmentFlag === 1 ? "就职" : record.employmentFlag === 0 ? "离职" : ""} }, + { title: "图片", dataIndex: "name", render: (_, record) => () }, + { + title: "操作", + width: 200, + render: (_, record) => ( + + + + + ), + }, + ]} + {...tableProps} + /> + + + { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} + /> + + + ); +} + +function AddModalComponent(props) { + const [form] = Form.useForm(); + + const queryParams = useGetUrlQuery(); + const [userQualificationinfoId, setUserQualificationinfoId] = useState(""); + useEffect(() => { + if (props.currentId) { + props.requestDetails({ id: props.currentId }).then((res) => { + form.setFieldsValue(res.data); + setUserQualificationinfoId(res.data.userQualificationinfoId); + }); + } + }, [props.currentId]); + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + const onSubmit = async (values) => { + values.corpinfoId = queryParams["corpinfoId"]; + values.userIdString = queryParams["id"]; + values.operatingProject = "DGZY_dgzy"; + values.operatingProjectName = "电工作业"; + values.qualificationinfoType = 1; + values.userQualificationinfoId = userQualificationinfoId; + values.qualificationinfoCategory = "DYDGZY"; + values.qualificationinfoCategoryName = "低压电工作业"; + if (props.currentId) { + values.idString = props.currentId; + await props.requestEdit(values); + } + else { + await props.requestAdd(values); + } + + onCancel(); + props.getData(); + }; + return ( + + }, + + ]} + s + /> + + ); +} + +const AddModal = AddModalComponent; +export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department); diff --git a/src/pages/Container/Stakeholder/User/View/index.js b/src/pages/Container/Stakeholder/User/View/index.js deleted file mode 100644 index 83647f3..0000000 --- a/src/pages/Container/Stakeholder/User/View/index.js +++ /dev/null @@ -1,1126 +0,0 @@ -import { Alert, Button, Descriptions, Divider, Steps } from "antd"; -import { useState } from "react"; -import HeaderBack from "zy-react-library/components/HeaderBack"; -import PreviewImg from "zy-react-library/components/PreviewImg"; -import Table from "zy-react-library/components/Table"; -import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg"; -import useDownloadFile from "zy-react-library/hooks/useDownloadFile"; -import { getLabelName } from "zy-react-library/utils"; -import { MARITAL_STATUS_ENUM, SEX_ENUM, WHETHER_ENUM } from "../Add"; - -function View() { - const { downloadFile } = useDownloadFile(); - const [info] = useState({ - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - selectUserId: null, - username: "13058604112", - password: "16758a08251b174145edfb6188bcb5dd51a827f1", - name: "0513-1", - roleId: "fhadminzhuche", - rolesName: null, - lastLogin: null, - ip: null, - status: 0, - bz: "注册用户", - sex: null, - skin: "pcoded-navbar navbar-image-3,navbar pcoded-header navbar-expand-lg navbar-light header-dark,", - email: null, - number: null, - phone: "13058604112", - roleIds: null, - departmentId: "dd5ab430a9f442a0be64c61a9645b904", - departmentName: null, - departmentNameAll: null, - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - funIds: null, - appid: null, - postId: "jhsdGsdghbs", - postName: "jhsdGsdghbs", - ismain: "0", - errorCount: 0, - sort: null, - learnercategory: null, - useravatarprefix: null, - useravatarurl: null, - shiftdutyone: null, - shiftdutytwo: null, - duration: null, - workstatus: null, - workperiod: null, - isRecorder: null, - personnelType: null, - personnelTypeName: null, - isHazardconfirmer: null, - isAccessauditor: null, - isOnlinelearning: null, - personType: null, - jcr: null, - pushCid: null, - empno: null, - cfdStatus: null, - cardno: null, - userIdCard: null, - isPolice: null, - userIdentity: null, - baseimgpath: null, - backendaddr: null, - mkmjcard: null, - ispush: "1", - userType: "3", - inHrUser: "0", - isDelete: 0, - creator: null, - createTime: "2025-04-20 14:41:54", - operat: "87ef258559e6430aa837e0f38062e250", - operatTime: "2025-08-29 11:05:09", - mkmjVehicleReviewer: null, - userIds: null, - departSort: null, - corpinfoName: null, - classCount: null, - completeCount: null, - studystate: null, - corpInfoStatus: null, - busImgList: null, - faceFile: null, - facePermissions: null, - job: null, - jobLevel: null, - jobLevelName: null, - nation: null, - nationName: null, - basicinfoId: null, - precinctId: null, - roleName: null, - isassess: null, - mkmjPermissions: "1", - inMkmjBlacklist: null, - disableMkmj: null, - employCorpName: null, - validityPeriodStart: null, - validityPeriodEnd: null, - classNo: null, - employCorpId: null, - xgfUserId: "5d8dcfbcd27741c79efaa6ca31941b9e", - loginUser: null, - isFlow: "0", - isFlowName: null, - trainStatus: null, - trainStatusName: null, - basicState: null, - basicStateName: null, - userPhoto: null, - userPhotoInfo: [ - { - imgfilesId: "4a7197ac1f844466a592f5ac54bb7071", - filepath: "/uploadFiles/file/xgf/920fa607d47c431b9142912801d10047.jpg", - }, - ], - userCard: null, - userCardInfo: [ - { - imgfilesId: "4a3a9d1cca0b463290afbe2da7f86fcd", - filepath: "/uploadFiles/file/xgf/887b696c5593413f9c108111ef111c1f.jpg", - }, - { - imgfilesId: "70972a9e21e3448d9dbfffae02f442ba", - filepath: "/uploadFiles/file/xgf/51588b4531a449b58ace522928c75166.png", - }, - ], - socSecurity: null, - socSecurityInfo: [ - { - imgfilesId: "c733ce9c56e746c99814503dbd09992e", - filepath: "/uploadFiles/file/xgf/082c6408413648879f53bd02f5c6059b.png", - }, - { - imgfilesId: "efaa255ef2e64da7920e2b4415a0e250", - filepath: "/uploadFiles/file/xgf/dde0abbe4c494111bc1e7533bda76178.png", - }, - ], - contract: null, - contractInfo: [], - insurance: null, - insuranceInfo: [], - empInsurance: null, - empInsuranceInfo: [], - threeLevel: null, - threeLevelInfo: [], - deleteFileIds: null, - emp: { - employmentApplyManagementId: "50b9c363d6584072a7a14b1ef6fc3468", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - relevantUnitName: "测试相关方", - startDate: "2025-04-20 14:43:50", - endDate: null, - leaveReason: null, - applyTime: null, - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - creator: "5d8dcfbcd27741c79efaa6ca31941b9e", - createtime: "2025-04-20 14:43:51", - operator: "87ef258559e6430aa837e0f38062e250", - operatetime: "2025-08-11 18:20:32", - isdelete: "0", - auditState: "2", - departState: "0", - reviewState: "", - departmentId: "dd5ab430a9f442a0be64c61a9645b904", - remarks: null, - auditRemarks: null, - auditTime: null, - auditPerson: null, - corpStartDate: "2025-04-20", - postId: "jhsdGsdghbs", - entryDate: null, - isSignLabor: "0", - isInjuriesPay: "0", - socialNumber: "462218514G0CB1PQ55", - ispay: "0", - isLevelThree: "0", - isSafetyTell: "0", - isBodyAdapt: "0", - isSpecialJob: "0", - isflow: "0", - isSocial: "1", - socialType: null, - isBf: "0", - }, - userDetails: { - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - name: "0513-1", - phone: "13058604112", - creattime: "2025-08-11 18:20:31", - departState: "0", - isdelete: "0", - personWorkType: null, - personWorkTypeName: null, - age: "21", - hklocal: "11112", - address: "1111", - degreeOfEducation: "dxbk", - degreeOfEducationName: "大学本科", - corpStartDate: null, - postId: "jhsdGsdghbs", - postName: "jhsdGsdghbs", - workSign: null, - joinedDate: null, - workDate: null, - photo: "/uploadFiles/file/xgf/920fa607d47c431b9142912801d10047.jpg", - dateOfBirth: "2004-06-07", - ispay: "0", - ispayNumber: "", - isSafetyTell: "0", - isSafetyTime: null, - isInjuriesPay: "0", - isSignLabor: "0", - sex: "0", - entryDate: null, - nationality: "mz", - nationalityName: "满族", - maritalstatus: "0", - politicalTime: null, - politicalStatus: "zgybdy01", - politicalStatusName: "中共预备党员", - isInjuriesPayTime: "", - isLevelThree: "0", - isBodyAdapt: "0", - isSpecialJob: null, - belongToCorp: "dd5ab430a9f442a0be64c61a9645b904", - belongToCorpName: "测试相关方", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - managerDepartmentId: null, - managerDepartmentName: null, - competentDepartmentId: null, - competentDepartmentName: null, - mainDepartmentId: null, - mainDepartmentName: null, - cardId: "130726200406079838", - departmentId: "dd5ab430a9f442a0be64c61a9645b904", - departmentName: "测试相关方", - isSocial: "1", - isBf: "0", - socialNumber: "462218514G0CB1PQ55", - zzname: null, - annex: "/uploadFiles/file/xgf/94212aec9b66433ca3b665a68251d8b5.zip", - attorney: null, - commitmentLetter: null, - }, - trainingRec: [ - { - classInfoId: "7a3ab8fabd8a4b51a8e2ed1d081b19b3", - createTime: "2025-05-19 00:00:00", - creator: "1", - operateTime: "2025-05-19 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "65a5b863a20a4f85b43dc63dc0bd9308", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-15 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "0515-1222", - openingTime: "2025-05-15 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "a14252d3baed49f3b694d51f8a01a543", - createTime: "2025-06-01 00:00:00", - creator: "1", - operateTime: "2025-06-01 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "3bbc4df4bcef4de698fea4c6fdc963ea", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-15 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "666666", - openingTime: "2025-05-15 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "be1a01e7bbde4c6cacbc0a7bd437687e", - createTime: "2025-05-18 00:00:00", - creator: "1", - operateTime: "2025-05-18 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "1", - classMessageId: "0e46e74fce7d4b038a5409633750722c", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-15 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "0515-111", - openingTime: "2025-05-15 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "0ba29ef2449d4c35a74fa20f15840f63", - createTime: "2025-05-17 19:00:00", - creator: "1", - operateTime: "2025-05-17 19:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "8b03ba6329ff4807abdf758e3ed8e53b", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-14 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "0514-111", - openingTime: "2025-05-14 00:00:00", - place: "d7d30999957a46d6a647fe8e168fb960", - placeName: "铁运开站小教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "28800a073d8e4afb945aeb61b364d093", - createTime: "2025-06-01 00:00:00", - creator: "1", - operateTime: "2025-06-01 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "0dd69622dc5e4e27a142f9a07f7b4a9a", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-14 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "123", - openingTime: "2025-05-14 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "75bafd4545484f739d03c5b1228e187a", - createTime: "2025-06-01 00:00:01", - creator: "1", - operateTime: "2025-06-01 00:00:01", - operator: "1", - isdelete: "0", - corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "de07771f21344c7e9e8b40ed26a221b8", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-14 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "0514-1", - openingTime: "2025-05-14 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "8a85c80f40774b1a8a11b97b06328f40", - createTime: "2025-05-16 00:00:00", - creator: "1", - operateTime: "2025-05-16 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "53c1f413ad564dadb3139346be548a7d", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-14 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "12121", - openingTime: "2025-05-14 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "9a6cf3a55ae2497e9ac7fddca29395af", - createTime: "2025-06-01 00:00:01", - creator: "1", - operateTime: "2025-06-01 00:00:01", - operator: "1", - isdelete: "0", - corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "f18561c4f3304de2abb3abf3447c1f42", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-14 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "888888", - openingTime: "2025-05-14 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "c0b73248951647fdacbc0135435c35b6", - createTime: "2025-05-16 00:00:00", - creator: "1", - operateTime: "2025-05-16 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "1f60ce32b7824c7c8f528dfec2f486f6", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-14 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "新建班级", - openingTime: "2025-05-14 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "8c0bd01a749a4ab9a9debbb502e2fc8b", - createTime: "2025-05-17 00:00:00", - creator: "1", - operateTime: "2025-05-17 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "2902e676235441f9b0a9b0b04e2323c4", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-13 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "测试测试", - openingTime: "2025-05-13 00:00:00", - place: "", - placeName: null, - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "c5b2fb9938584f9eb31a8695c6b17b1f", - createTime: "2025-06-01 00:00:00", - creator: "1", - operateTime: "2025-06-01 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "23dbed8a477c45f790739ff6c739a010", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-13 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "0513-1", - openingTime: "2025-05-13 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "ce21960b2c304134af6e96a26cff1f70", - createTime: "2025-05-14 18:50:00", - creator: "1", - operateTime: "2025-05-14 18:50:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "61ab001c98d54c5e8db53de675445523", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250514/c3e85138dea843578204357528f1611b.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-12 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "测试一个教育培训", - openingTime: "2025-05-12 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - ], - special: [], - flows: [ - { - flowId: "fd58bf5ad97847419f8de769639947f5", - type: "1", - creator: null, - creatorName: null, - creatorTime: "2025-05-13 14:30:18", - validFlag: "1", - foreignKey: "5d8dcfbcd27741c79efaa6ca31941b9e", - isdelete: "0", - endFlag: "1", - details: [ - { - flowDetailId: "33ec9909844b482fbcdb8c6cc1e8a9db", - flowId: "fd58bf5ad97847419f8de769639947f5", - stepFlag: "0", - stepName: "相关方提交人员信息到发包单位", - sort: 0, - parentId: "0", - approverId: "87ef258559e6430aa837e0f38062e250", - approverName: "测试相关方", - approverOpinion: null, - approverCorpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - approverCorpinfoName: "测试相关方", - approverTime: "2025-05-13 14:30:18", - passFlag: "1", - endFlag: "0", - isdelete: "0", - foreignKey: null, - appointAnnex: "/uploadFiles/file/xgf/94212aec9b66433ca3b665a68251d8b5.zip", - appointAnnexName: null, - }, - { - flowDetailId: "b6e4612892b14a73b8aa4324c69c85d3", - flowId: "fd58bf5ad97847419f8de769639947f5", - stepFlag: "0", - stepName: null, - sort: 1, - parentId: "33ec9909844b482fbcdb8c6cc1e8a9db", - approverId: "94407a4e15ec46b5974b128e124fa661", - approverName: "齐津铖", - approverOpinion: "", - approverCorpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - approverCorpinfoName: "卓云企业", - approverTime: "2025-05-13 14:38:39", - passFlag: "1", - endFlag: "0", - isdelete: "0", - foreignKey: null, - appointAnnex: null, - appointAnnexName: null, - }, - { - flowDetailId: "1ef915958e5e4eba872c55588524b168", - flowId: "fd58bf5ad97847419f8de769639947f5", - stepFlag: "1", - stepName: null, - sort: 2, - parentId: "b6e4612892b14a73b8aa4324c69c85d3", - approverId: "94407a4e15ec46b5974b128e124fa661", - approverName: "齐津铖", - approverOpinion: "", - approverCorpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - approverCorpinfoName: "卓云企业", - approverTime: "2025-05-13 14:39:43", - passFlag: "1", - endFlag: "1", - isdelete: "0", - foreignKey: null, - appointAnnex: null, - appointAnnexName: null, - }, - ], - }, - ], - lastFlow: { - flowsId: "5d8dcfbcd27741c79efaa6ca31941b9e", - foreignKeyId: "5d8dcfbcd27741c79efaa6ca31941b9e", - foreignKeyName: "sys_user=>user_id", - flowsStep: 1, - flowsType: "0", - isDelete: "0", - appointZeroCorpId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - appointZeroCorpType: null, - appointZeroCorpName: "卓云企业", - appointZeroDepartmentId: "16579f1de79743198884a56350c113cc", - appointZeroDepartmentName: "分公司级测试部门", - appointZeroUserId: "94407a4e15ec46b5974b128e124fa661", - appointZeroUserName: "齐津铖", - appointZeroStatus: "1", - appointZeroOpinion: "", - appointZeroTime: "2025-05-13 14:38:39", - appointOneCorpId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - appointOneCorpName: "卓云企业", - appointOneCorpType: "0", - appointOneDepartmentId: "16579f1de79743198884a56350c113cc", - appointOneDepartmentName: "", - appointOneUserId: "94407a4e15ec46b5974b128e124fa661", - appointOneUserName: "齐津铖", - appointOneStatus: "1", - appointOneOpinion: "", - appointOneTime: "2025-05-13 14:39:42", - appointTwoCorpId: null, - appointTwoCorpName: null, - appointTwoCorpType: null, - appointTwoDepartmentId: null, - appointTwoDepartmentName: null, - appointTwoUserId: null, - appointTwoUserName: null, - appointTwoStatus: null, - appointTwoOpinion: null, - appointTwoTime: null, - appointThreeCorpId: null, - appointThreeCorpName: null, - appointThreeCorpType: null, - appointThreeDepartmentId: null, - appointThreeDepartmentName: null, - appointThreeUserId: null, - appointThreeUserName: null, - appointThreeStatus: null, - appointThreeOpinion: null, - appointThreeTime: null, - appointFourCorpId: null, - appointFourCorpName: null, - appointFourCorpType: null, - appointFourDepartmentId: null, - appointFourDepartmentName: null, - appointFourUserId: null, - appointFourUserName: null, - appointFourStatus: null, - appointFourOpinion: null, - appointFiveCorpId: null, - appointFiveCorpName: null, - appointFiveCorpType: null, - appointFiveDepartmentId: null, - appointFiveDepartmentName: null, - appointFiveUserId: null, - appointFiveUserName: null, - appointFiveStatus: null, - appointFiveOpinion: null, - appointSixCorpId: null, - appointSixCorpName: null, - appointSixCorpType: null, - appointSixDepartmentId: null, - appointSixDepartmentName: null, - appointSixUserId: null, - appointSixUserName: null, - appointSixStatus: null, - appointSixOpinion: null, - appointSevenCorpId: null, - appointSevenCorpName: null, - appointSevenCorpType: null, - appointSevenDepartmentId: null, - appointSevenDepartmentName: null, - appointSevenUserId: null, - appointSevenUserName: null, - appointSevenStatus: null, - appointSevenOpinion: null, - sendType: "1", - checkStatus: "2", - checkStatusName: "审核结束", - }, - powerFlag: null, - entrustFlag: null, - lastStepFlag: null, - checkStep: null, - flowsStep: null, - flowsType: null, - attorney: null, - appointZeroUserId: null, - appointZeroCorpName: "卓云企业", - appointZeroTime: null, - appointOneUserId: null, - appointOneCorpName: "卓云企业", - appointOneTime: null, - appointTwoUserId: null, - appointTwoCorpName: null, - appointTwoTime: null, - appointThreeUserId: null, - appointThreeCorpName: null, - appointThreeTime: null, - appointFourUserId: null, - appointFourCorpName: null, - appointFiveUserId: null, - appointFiveCorpName: null, - appointSixUserId: null, - appointSixCorpName: null, - appointSevenUserId: null, - appointSevenCorpName: null, - appointTime: "2025-05-13 14:39:42", - cardId: null, - belongToCorp: "dd5ab430a9f442a0be64c61a9645b904", - belongToCorpName: "测试相关方", - degreeOfEducation: null, - isSocial: null, - isInjuriesPay: null, - ispay: null, - isBf: null, - age: null, - unValidFlag: "1", - unValidInfo: "合格证有效期", - checkStatus: null, - classStatus: null, - }); - const [selectedStep, setSelectedStep] = useState(null); - - return ( - <> - -
- 人员信息 - 0 ? : "暂无信息" }, - { label: "姓名", children: info.name }, - { label: "性别", children: getLabelName({ status: info.sex, list: SEX_ENUM }) }, - { label: "出生年月", children: info.dateOfBirth }, - { label: "年龄", children: info.age }, - { label: "身份证照片", children: info.userCardFile?.length > 0 ? : "暂无信息" }, - { label: "手机号", children: info.phone }, - { label: "身份证", children: info.cardId }, - { label: "民族", children: info.nationalityName || "暂无信息" }, - { label: "婚姻状况", children: getLabelName({ status: info.maritalstatus, list: MARITAL_STATUS_ENUM }) }, - { label: "政治面貌", children: info.politicalStatusName }, - ...(info.politicalStatusName === "中共党员" ? [{ label: "入党时间", children: info.politicalTime }] : []), - { label: "户口所在地", children: info.hklocal || "暂无信息" }, - { label: "现住址", children: info.address || "暂无信息" }, - { label: "联系电话", children: info.phone }, - { label: "文化程度", children: info.degreeOfEducationName }, - { label: "岗位名称(工种)", children: info.postId }, - { label: "是否缴纳社保", children: getLabelName({ status: info.isSocial, list: WHETHER_ENUM }) }, - ...(info.isSocial === "1" - ? [ - { label: "社会保障号码", children: info.socialNumber }, - { label: "社保卡照片", children: info.socSecurity?.length > 0 ? : "暂无信息" }, - ] - : []), - { label: "是否按期缴纳工伤保险", children: getLabelName({ status: info.isInjuriesPay, list: WHETHER_ENUM }) }, - ...(info.isInjuriesPay === "1" - ? [ - { label: "工伤保险有效期", children: info.isInjuriesPayTime }, - { label: "工伤保险凭证", children: info.empInsurance?.length > 0 ? : "暂无信息" }, - ] - : []), - { label: "是否缴纳商业保险", children: getLabelName({ status: info.ispay, list: WHETHER_ENUM }) }, - ...(info.ispay === "1" - ? [ - { label: "商业保险单号", children: info.ispayNumber }, - { label: "商业保险附件", children: info.insurance?.length > 0 ? : "暂无信息" }, - ] - : []), - { label: "是否签订劳动合同", children: getLabelName({ status: info.isSignLabor, list: WHETHER_ENUM }) }, - ...(info.isSignLabor === "1" - ? [ - { label: "劳动合同附件", children: info.contract?.length > 0 ? : "暂无信息" }, - ] - : []), - { label: "是否参加三级安全培训", children: getLabelName({ status: info.isLevelThree, list: WHETHER_ENUM }) }, - ...(info.isLevelThree === "1" - ? [ - { label: "三级安全培训照片", children: info.threeLevel?.length > 0 ? : "暂无信息" }, - ] - : []), - { label: "是否缴纳保险", children: getLabelName({ status: info.isBf, list: WHETHER_ENUM }) }, - { label: "是否特殊工种", children: getLabelName({ status: info.isSpecialJob, list: WHETHER_ENUM }) }, - { label: "是否流动人员", children: getLabelName({ status: info.isflow, list: WHETHER_ENUM }) }, - ]} - /> - 培训记录 -
- 特证信息 -
() }, - { title: "作业类别", dataIndex: "specialTypeName" }, - { title: "操作项目", dataIndex: "operationTypeName" }, - { title: "证书名称", dataIndex: "certificate" }, - { title: "发证机关", dataIndex: "issuingAuthority" }, - { title: "证书类型", dataIndex: "cerTypeName" }, - { title: "有效期", dataIndex: "time" }, - ]} - pagination={false} - dataSource={info.special} - disabledResizer={true} - /> - 信息审核信息 - - - 审核操作历史记录 -
setSelectedStep(null), - expandedRowRender: record => ( - <> -
- ({ - key: item.flowDetailId, - title: `${item.approverCorpinfoName}/${item.approverName && item.approverName !== "" ? item.approverName : "推送"}`, - description: ( -
-
- {(item.stepName - ? item.stepName - : item.passFlag === "1" - ? "通过" - : `不通过/${item.approverOpinion}`)} -
-
- ( - {item.approverTime} - ) -
-
- ), - status: "process", - onClick: () => setSelectedStep(item), - })) || []} - /> -
- - {selectedStep && ( - downloadFile({ url: selectedStep.appointAnnex })} - > - 下载 - - ), - }, - ]} - /> - )} - - ), - }} - pagination={false} - dataSource={info.flows} - disabledResizer={true} - /> - - - ); -} - -export default View; diff --git a/src/pages/Container/Supervision/BranchCompany/AccountManage/List/index.js b/src/pages/Container/Supervision/BranchCompany/AccountManage/List/index.js index b074bdb..fc3858d 100644 --- a/src/pages/Container/Supervision/BranchCompany/AccountManage/List/index.js +++ b/src/pages/Container/Supervision/BranchCompany/AccountManage/List/index.js @@ -1,3 +1,4 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Form, message, Modal, Space } from "antd"; import { useEffect, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; @@ -6,10 +7,39 @@ import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; +import { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular"; +import { getLabelName } from "zy-react-library/utils"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; + +const ENTERPRISE_TYPE = [ + { bianma: 0, name: "普通企业" }, + { bianma: 1, name: "集团单位" }, +]; +const ENTERPRISE_STATUS = [ + { bianma: "filialstate01", name: "在产" }, + { bianma: "filialstate02", name: "在建" }, + { bianma: "filialstate03", name: "代建" }, + { bianma: "filialstate04", name: "停产" }, + { bianma: "filialstate05", name: "破产" }, +]; +const ECONOMY_TYPE = [ + { bianma: "economic_type19", name: "外资" }, + { bianma: "economic_type18", name: "中外合作" }, + { bianma: "economic_type17", name: "中外合资" }, + +]; function List(props) { const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["corpInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + enterpriseType: 2, + }; + }, + }); const [addModalOpen, setAddModalOpen] = useState(false); const [currentId, setCurrentId] = useState(""); const [openType, setOpenType] = useState(""); @@ -19,6 +49,7 @@ function List(props) { title: "提示", content: "是否重置密码为Bb@123456789?", onOk: () => { + props["corpInfoChangePassword"]({ id }); message.success("重置密码成功"); getData(); }, @@ -29,17 +60,20 @@ function List(props) { title: "提示", content: "确定删除吗?", onOk: () => { + props["corpInfoRemove"]({ id }); + message.success("删除成功"); getData(); }, }); }; - const fnIsEnable = (id) => { + const fnIsEnable = (row) => { Modal.confirm({ title: "提示", - content: "确定删除吗?", + content: `确定${row.useFlag === 1 ? "停用" : row.useFlag === 0 ? "启用" : ""}吗?`, onOk: () => { - message.success("删除成功"); + props["corpInfoChangeUseFlag"]({ id: row.id, useFlag: row.useFlag === 0 ? 1 : 0 }); + message.success(`${row.useFlag === 1 ? "停用" : row.useFlag === 0 ? "启用" : ""}成功`); getData(); }, }); @@ -49,21 +83,22 @@ function List(props) {
( )} columns={[ - { title: "分公司名称", dataIndex: "name" }, - { title: "社会统一信用代码", dataIndex: "name" }, - { title: "经济类型", dataIndex: "name" }, - { title: "分公司状态", dataIndex: "name" }, - { title: "状态", dataIndex: "name" }, - { title: "操作", width: 200, render: (_, record) => ( + { title: "分公司名称", dataIndex: "corpName" }, + { title: "社会统一信用代码", dataIndex: "code" }, + { title: "企业类型", dataIndex: "type", render: (_, record) => ( +
+ {getLabelName({ status: record.type, list: ENTERPRISE_TYPE })} +
+ ) }, + { title: "经济类型", dataIndex: "ecoTypeName" }, + { title: "分公司状态", dataIndex: "corpStateName" }, + { title: "状态", dataIndex: "corpStateName", render: (_, record) => ({record.useFlag === 0 ? "停用" : record.useFlag === 1 ? "启用" : ""}) }, + { title: "操作", width: 550, render: (_, record) => ( - + @@ -110,8 +150,13 @@ function List(props) { /> { setAddModalOpen(false); setCurrentId(""); @@ -124,9 +169,12 @@ function List(props) { function AddModalComponent(props) { const [form] = Form.useForm(); + console.log(props.loading); useEffect(() => { if (props.currentId) { - console.log(props.currentId); + props.requestDetails({ id: props.currentId }).then((res) => { + form.setFieldsValue(res.data); + }); } }, [props.currentId]); const onCancel = () => { @@ -134,7 +182,20 @@ function AddModalComponent(props) { props.onCancel(); }; const onSubmit = async (values) => { - console.log(values); + values.ecoTypeName = getLabelName({ status: values.ecoType, list: ECONOMY_TYPE }); + values.corpStateName = getLabelName({ status: values.corpState, list: ENTERPRISE_STATUS }); + if (props.openType === "editName") { + values.id = props.currentId; + await props.requestChangeCompanyName(values); + } + if (props.openType === "edit") { + values.id = props.currentId; + await props.requestEdit(values); + } + if (props.openType === "add") { + await props.requestAdd(values); + } + onCancel(); props.getData(); }; @@ -143,8 +204,9 @@ function AddModalComponent(props) { open={props.open} onCancel={onCancel} onOk={form.submit} - title={props.currentId ? "修改" : "新增"} + title={props.currentId ? "编辑" : "新增"} width={800} + loading={props.loading} > @@ -166,4 +228,4 @@ function AddModalComponent(props) { } const AddModal = AddModalComponent; -export default List; +export default Connect([NS_ENTERPRISE], true)(List); diff --git a/src/pages/Container/Supervision/BranchCompany/AccountManage/View/index.js b/src/pages/Container/Supervision/BranchCompany/AccountManage/View/index.js index 5cbcc29..f82e215 100644 --- a/src/pages/Container/Supervision/BranchCompany/AccountManage/View/index.js +++ b/src/pages/Container/Supervision/BranchCompany/AccountManage/View/index.js @@ -1,7 +1,32 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Descriptions, Divider } from "antd"; +import { useEffect, useState } from "react"; import HeaderBack from "zy-react-library/components/HeaderBack"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import { getLabelName } from "zy-react-library/utils"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; + +const ENTERPRISE_TYPE = [ + { bianma: 0, name: "普通企业" }, + { bianma: 1, name: "集团单位" }, + { bianma: 2, name: "股份单位" }, + { bianma: 3, name: "相关方企业" }, + { bianma: 4, name: "货主单位" }, + { bianma: 5, name: "驻港单位" }, +]; + +function View(props) { + const queryParams = useGetUrlQuery(); + const [info, setInfo] = useState({}); + useEffect(() => { + const fetchData = async () => { + const res = await props.corpInfoRemoveDetails({ id: queryParams["id"] }); + setInfo(res.data); + // 不要在这里 log info,它还是旧的 + }; + fetchData(); + }, []); -function View() { return (
@@ -9,33 +34,21 @@ function View() { 企业信息 + + {getLabelName({ status: info.type, list: ENTERPRISE_TYPE })} + + ) }, + { label: "经济类型", children: info.ecoTypeName }, + { label: "分公司状态", children: info.corpStateName }, + { label: "列表排序", children: info.corpOrder }, + ]} />
@@ -43,4 +56,4 @@ function View() { ); } -export default View; +export default Connect([NS_ENTERPRISE], true)(View); diff --git a/src/pages/Container/Supervision/BranchCompany/DepartmentManage/List/index.js b/src/pages/Container/Supervision/BranchCompany/DepartmentManage/List/index.js index ab5c2aa..359d865 100644 --- a/src/pages/Container/Supervision/BranchCompany/DepartmentManage/List/index.js +++ b/src/pages/Container/Supervision/BranchCompany/DepartmentManage/List/index.js @@ -1,21 +1,36 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Form, Space } from "antd"; import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; +import { getLabelName } from "zy-react-library/utils"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; +const ENTERPRISE_TYPE = [ + { bianma: 0, name: "普通企业" }, + { bianma: 1, name: "集团单位" }, +]; const BRANCH_CONPANY_STATUS = [ - { id: 1, name: "在产" }, - { id: 0, name: "在建" }, + { bianma: 1, name: "在产" }, + { bianma: 0, name: "在建" }, ]; const STATUS = [ - { id: 1, name: "启用" }, - { id: 0, name: "停用" }, + { bianma: 1, name: "启用" }, + { bianma: 0, name: "停用" }, ]; function List(props) { const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["corpInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + enterpriseType: 2, + }; + }, + }); return (
@@ -24,15 +39,15 @@ function List(props) {
( +
+ {getLabelName({ status: record.type, list: ENTERPRISE_TYPE })} +
+ ) }, + { title: "经济类型", dataIndex: "ecoTypeName" }, + { title: "分公司状态", dataIndex: "corpStateName" }, + { title: "列表排序", dataIndex: "corpOrder" }, { title: "操作", width: 200, @@ -70,4 +89,4 @@ function List(props) { ); } -export default List; +export default Connect([NS_ENTERPRISE], true)(List); diff --git a/src/pages/Container/Supervision/BranchCompany/DepartmentManage/View/index.js b/src/pages/Container/Supervision/BranchCompany/DepartmentManage/View/index.js index fe75dd6..8984091 100644 --- a/src/pages/Container/Supervision/BranchCompany/DepartmentManage/View/index.js +++ b/src/pages/Container/Supervision/BranchCompany/DepartmentManage/View/index.js @@ -1,20 +1,43 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Descriptions, Form, Modal, Space } from "antd"; + import { useEffect, useState } from "react"; import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; - import Table from "zy-react-library/components/Table"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useTable from "zy-react-library/hooks/useTable"; +import { NS_DEPARTMENT } from "~/enumerate/namespace"; -function View() { +function View(props) { const [addModalOpen, setAddModalOpen] = useState(false); const [currentId, setCurrentId] = useState(""); + + const queryParams = useGetUrlQuery(); + + const [selectedNodeId, setSelectedNodeId] = useState(null); const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["departmentList"], { + form, + transform: (formData) => { + return { + ...formData, + eqParentId: selectedNodeId, + eqCorpInfoId: queryParams["id"], + }; + }, + }); + + const onTreeChange = (selectedKeys, event) => { + const key = selectedKeys[0] || null; + + setSelectedNodeId(key); + getData(); + }; return (
- +
@@ -58,14 +82,15 @@ function View() { } function AddModalComponent(props) { - const [form] = Form.useForm(); + const [info, setInfo] = useState({}); useEffect(() => { if (props.currentId) { - console.log(props.currentId); + props.requestDetails({ id: props.currentId }).then((res) => { + setInfo(res.data); + }); } }, [props.currentId]); const onCancel = () => { - form.resetFields(); props.onCancel(); }; @@ -73,7 +98,7 @@ function AddModalComponent(props) { @@ -82,12 +107,12 @@ function AddModalComponent(props) { column={1} bordered items={[ - { label: "上级部门", children: "Zhou" }, - { label: "部门名称", children: "Zhou" }, - { label: "部门级别", children: "Zhou" }, - { label: "是否监督部门", children: "Zhou" }, - { label: "备注", children: "Zhou" }, - { label: "排序", children: "Zhou" }, + { label: "上级部门", children: info.parentName }, + { label: "部门名称", children: info.parentName }, + { label: "部门级别", children: info.levelName }, + { label: "是否安全部门", children: {info.securityFlag === 1 ? "是" : info.securityFlag === 0 ? "否" : ""} }, + { label: "备注", children: info.remarks }, + { label: "排序", children: info.depOrder }, ]} /> @@ -96,4 +121,4 @@ function AddModalComponent(props) { } const AddModal = AddModalComponent; -export default View; +export default Connect([NS_DEPARTMENT], true)(View); diff --git a/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/Add/index.js b/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/Add/index.js deleted file mode 100644 index 9f420b8..0000000 --- a/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/Add/index.js +++ /dev/null @@ -1,64 +0,0 @@ -import { tools } from "@cqsjjb/jjb-common-lib"; - -import FormBuilder from "zy-react-library/components/FormBuilder"; -import HeaderBack from "zy-react-library/components/HeaderBack"; -import Map from "zy-react-library/components/Map"; -import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; -import { PHONE, UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular"; - -// const xgfStateMap = { -// 0: "未填报", -// 1: "待审核", -// 2: "已审核", -// 3: 已打回, -// 4: "已填报", -// }; -const { query } = tools.router; -function Add() { - const onSubmit = (values) => { - console.log(values); - }; - return ( - <> - -
- , span: 24 }, - { name: "lrName", label: "公司法定代表人", required: false, hidden: (!query.id) }, - { name: "lrPhone", label: "公司法定代表人手机号", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }], required: false, hidden: (!query.id) }, - { name: "contacts", label: "主要负责人", required: false, hidden: (!query.id) }, - { name: "contactsPhone", label: "主要负责人联系电话", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }], required: false, hidden: (!query.id) }, - { name: "contacts", label: "安全负责人", required: false, hidden: (!query.id) }, - { name: "contactsPhone", label: "安全负责人联系电话", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }], required: false, hidden: (!query.id) }, - { name: "scale", label: "企业规模", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }], required: false, hidden: (!query.id) }, - { name: "createDate", label: "占地面积(平方米)", render: FORM_ITEM_RENDER_ENUM.DATE, required: false, hidden: (!query.id) }, - { name: "employees", label: "职工人数(人)", render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (!query.id) }, - { name: "employees", label: "成立时间", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (!query.id) }, - { name: "employees", label: "注册资金(万元)", render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (!query.id) }, - { name: "employees", label: "资产总额(万元)", render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (!query.id) }, - { name: "employees", label: "规模", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (!query.id) }, - { name: "employees", label: "是否规模以上", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (!query.id) }, - { name: "employees", label: "列表排序", render: FORM_ITEM_RENDER_ENUM.NUMBER }, - ]} - /> -
- - - ); -} - -export default Add; diff --git a/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/List/index.js b/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/List/index.js index 7b318b5..e1fd84c 100644 --- a/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/List/index.js +++ b/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/List/index.js @@ -1,163 +1,89 @@ -import { Button, Form, Space } from "antd"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, message, Space } from "antd"; import { useState } from "react"; import MapSelector from "zy-react-library/components/Map/MapSelector"; import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; + +const ENTERPRISE_TYPE = [ + { bianma: 0, name: "普通企业" }, + { bianma: 1, name: "集团单位" }, +]; +const ENTERPRISE_STATUS = [ + { bianma: "filialstate01", name: "在产" }, + { bianma: "filialstate02", name: "在建" }, + { bianma: "filialstate03", name: "代建" }, + { bianma: "filialstate04", name: "停产" }, + { bianma: "filialstate05", name: "破产" }, +]; +const ECONOMY_TYPE = [ + { bianma: "economic_type19", name: "外资" }, + { bianma: "economic_type18", name: "中外合作" }, + { bianma: "economic_type17", name: "中外合资" }, -const WHETHER_ENUM = [ - { bianma: "1", name: "是" }, - { bianma: "0", name: "否" }, ]; function List(props) { const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["corpInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + enterpriseType: 2, + }; + }, + }); const [visible, setVisible] = useState(false); - const [selectedLng, setSelectedLng] = useState("119.69457721306945"); - const [selectedLat, setSelectedLat] = useState("39.940504336846665"); + const [selectedLng, setSelectedLng] = useState(""); + const [selectedLat, setSelectedLat] = useState(""); + const [rowData, setRowData] = useState({}); - const handleOpen = () => { + const handleOpen = (row) => { + setSelectedLng(row.longitude); + setSelectedLat(row.latitude); + setRowData(row); setVisible(true); }; const handleConfirm = (lng, lat) => { console.log("选中的坐标:", lng, lat); - setSelectedLng(lng); - setSelectedLat(lat); + console.log(rowData); + rowData.latitude = lng; + rowData.longitude = lat; + props["corpInfoEdit"](rowData).then(() => { + message.success("定位成功!"); + }); + // props. }; return (
props.history.push("./Search")} icon={}>高级搜索 // )} columns={[ - { title: "分公司名称", dataIndex: "name" }, - { title: "注册地址", dataIndex: "name" }, - { title: "所属行业", dataIndex: "name" }, - { title: "主要负责人", dataIndex: "name" }, - { title: "联系方式", dataIndex: "name" }, - { title: "公司状态", dataIndex: "name" }, - { title: "开户人", dataIndex: "name" }, - { title: "状态", dataIndex: "name" }, - { title: "定位状态", dataIndex: "name" }, + { title: "分公司名称", dataIndex: "corpName" }, + { title: "经营地址", dataIndex: "addressBusiness" }, + { title: "所属行业", dataIndex: "corpTypeName" }, + { title: "主要负责人", dataIndex: "contacts" }, + { title: "主要负责人电话", dataIndex: "contactsPhone" }, + { title: "公司状态", dataIndex: "corpStateName" }, + { title: "状态", dataIndex: "useFlag", render: (_, record) => ( + {record.useFlag === 0 ? "停用" : record.useFlag === 1 ? "启用" : ""} + ) }, + { title: "定位状态", dataIndex: "name", render: (_, record) => ( + {record.longitude ? "已定位" : "未定位" } + ) }, { title: "操作", width: 200, render: (_, record) => ( - + @@ -197,4 +126,4 @@ function List(props) { ); } -export default List; +export default Connect([NS_ENTERPRISE], true)(List); diff --git a/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/Search/index.js b/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/Search/index.js deleted file mode 100644 index ee0c3fc..0000000 --- a/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/Search/index.js +++ /dev/null @@ -1,164 +0,0 @@ -import { Form } from "antd"; -import HeaderBack from "zy-react-library/components/HeaderBack"; -import Search from "zy-react-library/components/Search"; -import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; - -const WHETHER_ENUM = [ - { bianma: "1", name: "是" }, - { bianma: "0", name: "否" }, -]; -function View() { - const [form] = Form.useForm(); - const onSearch = (value) => { - console.log(value); - }; - - return ( -
- -
- - - -
- -
- ); -} - -export default View; diff --git a/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/View/index.js b/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/View/index.js index ff85c75..aef5bbb 100644 --- a/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/View/index.js +++ b/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/View/index.js @@ -1,42 +1,60 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Descriptions, Divider, Tabs } from "antd"; +import { useEffect, useState } from "react"; import HeaderBack from "zy-react-library/components/HeaderBack"; import Table from "zy-react-library/components/Table"; import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; -const info = { - special: [], -}; -function View() { +function View(props) { + const [info, setInfo] = useState({}); + const queryParams = useGetUrlQuery(); + + useEffect(() => { + const fetchData = async () => { + const res = await props.corpInfoRemoveDetails({ id: queryParams["id"] }); + setInfo(res.data); + }; + fetchData(); + }, []); const items = [ { key: "1", label: "基础信息", children: (
- {" "} 基本信息 {info.scaleType === 1 ? "是" : info.scaleType === 0 ? "否" : ""} }, + { label: "企事业单位经营地址", children: info.addressBusiness }, + { label: "企业状态", children: info.corpStateName }, { label: "营业执照", children: "Zhou" }, - { label: "营业执照有效期", children: "Zhou" }, + { label: "营业执照有效期", children: `${info.licenseStart} 至 ${info.licenseEnd}` }, ]} /> @@ -47,8 +65,8 @@ function View() { bordered items={[ - { label: "姓名", children: "Zhou" }, - { label: "手机号码", children: "Zhou" }, + { label: "姓名", children: info.lrName }, + { label: "手机号码", children: info.lrMobile }, ]} /> @@ -59,8 +77,8 @@ function View() { bordered items={[ - { label: "姓名", children: "Zhou" }, - { label: "手机号码", children: "Zhou" }, + { label: "姓名", children: info.contacts }, + { label: "手机号码", children: info.contactsPhone }, ]} /> @@ -71,62 +89,40 @@ function View() { bordered items={[ - { label: "姓名", children: "Zhou" }, - { label: "手机号码", children: "Zhou" }, + { label: "姓名", children: info.safetyName }, + { label: "手机号码", children: info.safetyPhone }, ]} /> - + 企业相关属性 {info.whetherHygieneFlag === 1 ? "是" : "否"} }, + { label: "有无重大危险源", children: {info.whetherHazardsFlag === 1 ? "是" : "否"} }, + { label: "是否有稀缺大型应急物资和设施", children: {info.whetherScarceFlag === 1 ? "是" : "否"} }, + { label: "有无涉及危化品", children: {info.whetherChemicalsFlag === 1 ? "是" : "否"} }, + { label: "有无特种设备", children: {info.whetherSpecialequipmentFlag === 1 ? "是" : "否"} }, + { label: "有无特种工作人员", children: {info.whetherSpecialpeopleFlag === 1 ? "是" : "否"} }, + { label: "是否涉及煤气", children: {info.whetherCoalgasFlag === 1 ? "是" : "否"} }, + { label: "是否属于消防重点单位", children: {info.whetherFireFlag === 1 ? "是" : "否"} }, + { label: "是否在有限空间作业", children: {info.whetherConfinedFlag === 1 ? "是" : "否"} }, + { label: "是否存在涉爆粉尘作业", children: {info.whetherPowderFlag === 1 ? "是" : "否"} }, + { label: "是否涉及防雷防静电", children: {info.whetherLightningFlag === 1 ? "是" : "否"} }, + { label: "是否持有放射源", children: {info.whetherActinogenFlag === 1 ? "是" : "否"} }, + { label: "是否涉及液氨制冷", children: {info.whetherLiquidammoniaFlag === 1 ? "是" : "否"} }, + { label: "是否涉及危险品管道", children: {info.whetherPipelineFlag === 1 ? "是" : "否"} }, ]} />
), }, + { key: "2", - label: "资质证照管理", - children: ( -
() }, - - ]} - pagination={false} - dataSource={info.special} - disabledResizer={true} - /> - ), - }, - { - key: "3", - label: "入职从业人员登记", - children: "Content of Tab Pane 3", - }, - { - key: "4", label: "人员证照管理", children: (
{}, { form }); - const BRANCH_CONPANY_STATUS = [ - { id: 1, name: "在产" }, - { id: 0, name: "在建" }, - ]; - const STATUS = [ - { id: 1, name: "启用" }, - { id: 0, name: "停用" }, - ]; + const { tableProps, getData } = useTable(props["corpUserMiddlePage"], { + form, + transform: (formData) => { + return { + ...formData, + enterpriseType: 2, + }; + }, + }); + return (
-
+ +
- -
( + {record.userCount ? record.userCount : "0"} + ) }, - columns={[ - { title: "分公司名称", dataIndex: "name" }, - { title: "属地", dataIndex: "name" }, - { title: "所属行业", dataIndex: "name" }, - { title: "人数", dataIndex: "name" }, - { title: "分公司状态", dataIndex: "name" }, - { - title: "操作", - width: 200, - render: (_, record) => ( - + { title: "公司状态", dataIndex: "corpStateName" }, + { title: "启用状态", dataIndex: "useFlag", render: (_, record) => ( + {record.useFlag === 0 ? "停用" : record.useFlag === 1 ? "启用" : ""} + ) }, - - - ), - }, - ]} - {...tableProps} - /> - - + { title: "操作", width: 200, render: (_, record) => ( + + + + ) }, + ]} + {...tableProps} + /> ); } -export default List; +export default Connect([NS_ENTERPRISE], true)(List); diff --git a/src/pages/Container/Supervision/BranchCompany/SubsidiaryUser/UserList/index.js b/src/pages/Container/Supervision/BranchCompany/SubsidiaryUser/UserList/index.js index 56a187e..da9d921 100644 --- a/src/pages/Container/Supervision/BranchCompany/SubsidiaryUser/UserList/index.js +++ b/src/pages/Container/Supervision/BranchCompany/SubsidiaryUser/UserList/index.js @@ -1,35 +1,64 @@ -import { Button, Form, Space } from "antd"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Descriptions, Form, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; + import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; - import Table from "zy-react-library/components/Table"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useTable from "zy-react-library/hooks/useTable"; +import { NS_USER } from "~/enumerate/namespace"; -function UserList(props) { +function List(props) { + const queryParams = useGetUrlQuery(); + const [selectedNodeId, setSelectedNodeId] = useState(); + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["userList"], { + form, + transform: (formData) => { + return { + ...formData, + eqDepartmentId: selectedNodeId, + corpinfoId: queryParams["id"], + }; + }, + }); + const onTreeChange = (selectedKeys) => { + const key = selectedKeys[0] || null; + console.log(selectedKeys); + setSelectedNodeId(key); + getData(); + }; return (
- +
( + + ), }, @@ -39,7 +68,77 @@ function UserList(props) { + { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} + /> ); +}; + +function AddModalComponent(props) { + const [form] = Form.useForm(); + const [info, setInfo] = useState({}); + useEffect(() => { + if (props.currentId) { + const fetchData = async () => { + const res = await props.requestDetails({ id: props.currentId }); + console.log(res.data); + setInfo(res.data); + }; + fetchData(); + console.log(info); + } + }, [props.currentId]); + + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + + return ( + + +
+ {info.departmentLeaderFlag === 1 ? "是" : "否"} }, + { label: "所属岗位", children: info.postName }, + { label: "用户名", children: info.username }, + { label: "姓名", children: info.name }, + { label: "手机号", children: info.phone }, + { label: "人员类型", children: info.personnelTypeName }, + { label: "身份证号", children: info.userIdCard }, + { label: "民族", children: info.nationName }, + { label: "性别", children: info.sex }, + + { label: "人脸照片", children: info.nationName }, + { label: "部门排序", children: info.sort }, + { label: "邮箱", children: info.email }, + { label: "备注", children: info.remarks }, + ]} + /> +
+
+ ); } -export default UserList; + +const AddModal = AddModalComponent; +export default Connect([NS_USER], true)(List); diff --git a/src/pages/Container/Supervision/EnterpriseMiddleground/ChangeList/index.js b/src/pages/Container/Supervision/EnterpriseMiddleground/ChangeList/index.js new file mode 100644 index 0000000..23cbd09 --- /dev/null +++ b/src/pages/Container/Supervision/EnterpriseMiddleground/ChangeList/index.js @@ -0,0 +1,57 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Form } from "antd"; +import Search from "zy-react-library/components/Search"; +import Table from "zy-react-library/components/Table"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useTable from "zy-react-library/hooks/useTable"; +import { NS_USER } from "~/enumerate/namespace"; + +const ENTERPRISE_TYPE = [ + { bianma: 0, name: "普通企业" }, + { bianma: 1, name: "集团单位" }, +]; +function List(props) { + const [form] = Form.useForm(); + const { tableProps, getData } = useTable(props["userEmploymentLogAll"], { + form, + transform: (formData) => { + return { + ...formData, + + }; + }, + }); + + return ( +
+ +
( +
+ {record.employmentFlag === 1 ? "在职" : record.employmentFlag === 1 ? "离职" : ""} +
+ ) }, + + ]} + {...tableProps} + /> + + + ); +} + +export default Connect([NS_USER], true)(List); diff --git a/src/pages/Container/Supervision/EnterpriseMiddleground/List/index.js b/src/pages/Container/Supervision/EnterpriseMiddleground/List/index.js new file mode 100644 index 0000000..fd78ae8 --- /dev/null +++ b/src/pages/Container/Supervision/EnterpriseMiddleground/List/index.js @@ -0,0 +1,64 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, Space } from "antd"; +import Search from "zy-react-library/components/Search"; +import Table from "zy-react-library/components/Table"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useTable from "zy-react-library/hooks/useTable"; +import { getLabelName } from "zy-react-library/utils"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; + +const ENTERPRISE_TYPE = [ + { bianma: 0, name: "普通企业" }, + { bianma: 1, name: "集团单位" }, +]; +function List(props) { + const [form] = Form.useForm(); + const { tableProps, getData } = useTable(props["corpUserMiddlePage"], { + form, + transform: (formData) => { + return { + ...formData, + enterpriseType: 2, + }; + }, + }); + + return ( +
+ +
( +
+ {getLabelName({ status: record.type, list: ENTERPRISE_TYPE })} +
+ ) }, + + { title: "部门数", dataIndex: "departMentCount" }, + { title: "岗位数", dataIndex: "postCount" }, + { title: "用户数", dataIndex: "userCount" }, + { title: "中台人员存在数", dataIndex: "middleUserCount" }, + + { title: "操作", width: 200, render: (_, record) => ( + + + + ) }, + ]} + {...tableProps} + /> + + + ); +} + +export default Connect([NS_ENTERPRISE], true)(List); diff --git a/src/pages/Container/Supervision/EnterpriseMiddleground/UserList/index.js b/src/pages/Container/Supervision/EnterpriseMiddleground/UserList/index.js new file mode 100644 index 0000000..9ebe4a1 --- /dev/null +++ b/src/pages/Container/Supervision/EnterpriseMiddleground/UserList/index.js @@ -0,0 +1,167 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Descriptions, Form, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; +import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; +import Search from "zy-react-library/components/Search"; +import Table from "zy-react-library/components/Table"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import useTable from "zy-react-library/hooks/useTable"; +import { NS_USER } from "~/enumerate/namespace"; + +const USER_TYPE = [ + + { bianma: 1, name: "在职" }, + { bianma: 2, name: "离职" }, + +]; +function List(props) { + const [selectedNodeId, setSelectedNodeId] = useState(); + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); + const queryParams = useGetUrlQuery(); + const [form] = Form.useForm(); + const { tableProps, getData } = useTable(props["userList"], { + form, + transform: (formData) => { + return { + ...formData, + eqDepartmentId: selectedNodeId, + corpinfoId: queryParams["id"], + }; + }, + }); + + const onTreeChange = (selectedKeys) => { + const key = selectedKeys[0] || null; + console.log(selectedKeys); + setSelectedNodeId(key); + getData(); + }; + return ( +
+
+ +
+ +
( +
+ {record.employmentFlag === 1 ? "在职" : record.employmentFlag === 1 ? "离职" : ""} +
+ ) }, + { + title: "操作", + width: 180, + render: (_, record) => ( + + + + + + ), + }, + ]} + {...tableProps} + /> + + + + { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} + /> + + ); +}; + +function AddModalComponent(props) { + const [form] = Form.useForm(); + const [info, setInfo] = useState({}); + useEffect(() => { + if (props.currentId) { + const fetchData = async () => { + const res = await props.requestDetails({ id: props.currentId }); + console.log(res.data); + setInfo(res.data); + }; + fetchData(); + console.log(info); + } + }, [props.currentId]); + + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + + return ( + + +
+ {info.departmentLeaderFlag === 1 ? "是" : "否"} }, + { label: "所属岗位", children: info.postName }, + { label: "用户名", children: info.username }, + { label: "姓名", children: info.name }, + { label: "手机号", children: info.phone }, + { label: "人员类型", children: info.personnelTypeName }, + { label: "身份证号", children: info.userIdCard }, + { label: "民族", children: info.nationName }, + { label: "性别", children: info.sex }, + + { label: "人脸照片", children: info.nationName }, + { label: "部门排序", children: info.sort }, + { label: "邮箱", children: info.email }, + { label: "备注", children: info.remarks }, + ]} + /> +
+
+ ); +} + +const AddModal = AddModalComponent; +export default Connect([NS_USER], true)(List); diff --git a/src/pages/Container/Supervision/EnterpriseMiddleground/index.js b/src/pages/Container/Supervision/EnterpriseMiddleground/index.js new file mode 100644 index 0000000..7e00623 --- /dev/null +++ b/src/pages/Container/Supervision/EnterpriseMiddleground/index.js @@ -0,0 +1,9 @@ +function EnterpriseMiddleground(props) { + return ( +
+ {props.children} +
+ ); +} + +export default EnterpriseMiddleground; diff --git a/src/pages/Container/Supervision/StakeholderUnit/AccountManage/Add/index.js b/src/pages/Container/Supervision/StakeholderUnit/AccountManage/Add/index.js deleted file mode 100644 index 9de9949..0000000 --- a/src/pages/Container/Supervision/StakeholderUnit/AccountManage/Add/index.js +++ /dev/null @@ -1,90 +0,0 @@ -import { tools } from "@cqsjjb/jjb-common-lib"; - -import { Button, Modal, QRCode } from "antd"; -import { useState } from "react"; -import FormBuilder from "zy-react-library/components/FormBuilder"; -import HeaderBack from "zy-react-library/components/HeaderBack"; -import Map from "zy-react-library/components/Map"; -import Upload from "zy-react-library/components/Upload"; -import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; -import { PHONE, UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular"; - -const xgfStateMap = { - 0: "未填报", - 1: "待审核", - 2: "已审核", - 3: 已打回, - 4: "已填报", -}; -const { query } = tools.router; -function Add() { - const [corpInfoQrCodeOpen, setCorpInfoQrCodeOpen] = useState(false); - const onSubmit = (values) => { - console.log(values); - }; - return ( - <> - -
- xgfStateMap[formValues?.xgfState] || "未填报" }, - { name: "holderName", label: "开户人", required: false, componentProps: { disabled: true }, hidden: (!query.id) }, - { name: "code", label: "统一社会信用代码", rules: [{ pattern: UNIFIED_SOCIAL_CREDIT_CODE, message: "请输入正确的统一社会信用代码" }] }, - { name: "companyAreas", label: "属地", required: false, hidden: (!query.id) }, - { name: "industryNames", label: "所属行业", required: false, hidden: (!query.id) }, - { name: "map", customizeRender: true, render: () => , span: 24, hidden: (!query.id) }, - { name: "ecoType", label: "经济类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }], required: false }, - { name: "address", label: "单位经营地址", required: false, hidden: (!query.id) }, - { name: "scale", label: "企业规模", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }], required: false, hidden: (!query.id) }, - { name: "lrName", label: "法人姓名", required: false, hidden: (!query.id) }, - { name: "lrPhone", label: "联系电话", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }], required: false, hidden: (!query.id) }, - { name: "contacts", label: "主要负责人", required: false, hidden: (!query.id) }, - { name: "contactsPhone", label: "主要负责人联系电话", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }], required: false, hidden: (!query.id) }, - { name: "createDate", label: "成立日期", render: FORM_ITEM_RENDER_ENUM.DATE, required: false, hidden: (!query.id) }, - { name: "employees", label: "职工人数(人)", render: FORM_ITEM_RENDER_ENUM.NUMBER, required: false, hidden: (!query.id) }, - { name: "totalassets", label: "资产总额(万元)", render: FORM_ITEM_RENDER_ENUM.NUMBER, required: false, hidden: (!query.id) }, - { name: "regcapital", label: "注册资金(万元)", render: FORM_ITEM_RENDER_ENUM.NUMBER, required: false, hidden: (!query.id) }, - { name: "employmentForm", label: "用工形式", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }], required: false, hidden: (!query.id) }, - { name: "selectForms", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }], required: false, hidden: (!query.id) }, - { name: "businessLicense", label: "营业执照", render: ({ value, onChange }) => , hidden: (!query.id) }, - { name: "businessLicenseDate", label: "营业执照有效期", render: FORM_ITEM_RENDER_ENUM.DATE, hidden: (!query.id) }, - { name: "qrCode", label: "企业二维码", required: false, hidden: formValues => !(formValues.xgfState !== 2 && query.id), render: () => ( - - ) }, - ]} - /> -
- setCorpInfoQrCodeOpen(false)} /> - - ); -} -const CorpInfoQrCode = (props) => { - return ( - - 关闭 - , - ]} - > - - - ); -}; -export default Add; diff --git a/src/pages/Container/Supervision/StakeholderUnit/AccountManage/List/index.js b/src/pages/Container/Supervision/StakeholderUnit/AccountManage/List/index.js index 785fb8d..902dd52 100644 --- a/src/pages/Container/Supervision/StakeholderUnit/AccountManage/List/index.js +++ b/src/pages/Container/Supervision/StakeholderUnit/AccountManage/List/index.js @@ -1,66 +1,111 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Form, message, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; +import FormBuilder from "zy-react-library/components/FormBuilder"; import AddIcon from "zy-react-library/components/Icon/AddIcon"; import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; +import { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular"; +import { getLabelName } from "zy-react-library/utils"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; + +const ENTERPRISE_TYPE = [ + { bianma: 3, name: "相关方企业" }, + { bianma: 4, name: "货主单位" }, + { bianma: 5, name: "驻港单位" }, +]; + +const ECONOMY_TYPE = [ + { bianma: "economic_type19", name: "外资" }, + { bianma: "economic_type18", name: "中外合作" }, + { bianma: "economic_type17", name: "中外合资" }, + +]; function List(props) { const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["corpInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + enterpriseType: 3, + }; + }, + }); + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); + + const onResetPassword = (id) => { + Modal.confirm({ + title: "提示", + content: "是否重置密码为Bb@123456789?", + onOk: () => { + props["corpInfoChangePassword"]({ id }); + message.success("重置密码成功"); + getData(); + }, + }); + }; const onDelete = (id) => { Modal.confirm({ title: "提示", content: "确定删除吗?", onOk: () => { + props["corpInfoRemove"]({ id }); + message.success("删除成功"); getData(); }, }); }; - const onResetPassword = () => { - Modal.confirm({ - title: "提示", - content: "确定要重置密码为Aa@123456789吗?", - onOk: () => { - message.success("重置密码成功"); - }, - }); - }; return (
( - + )} columns={[ - { title: "集团单位", dataIndex: "name" }, - { title: "相关单位名称", dataIndex: "name" }, - { title: "属地", dataIndex: "name" }, - { title: "股份主管部门", dataIndex: "name" }, - { title: "股份监管部门", dataIndex: "name" }, - { title: "基层单位主管部门", dataIndex: "name" }, - { title: "基层单位监督部门", dataIndex: "name" }, - { title: "开户人", dataIndex: "name" }, - { title: "状态", dataIndex: "name" }, - { title: "操作", width: 200, render: (_, record) => ( + { title: "单位名称", dataIndex: "corpName" }, + { title: "属地", dataIndex: "corpName" }, + { title: "开户人", dataIndex: "createName" }, + { title: "社会统一信用代码", dataIndex: "code" }, + + { title: "开户时间", dataIndex: "createDate" }, + + { title: "操作", width: 350, render: (_, record) => ( - - + + @@ -68,8 +113,77 @@ function List(props) { ]} {...tableProps} /> + { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} + /> ); } +function AddModalComponent(props) { + const [form] = Form.useForm(); + console.log(props); + useEffect(() => { + if (props.currentId) { + props.requestDetails({ id: props.currentId }).then((res) => { + form.setFieldsValue(res.data); + }); + } + }, [props.currentId]); + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + const onSubmit = async (values) => { + values.ecoTypeName = getLabelName({ status: values.ecoType, list: ECONOMY_TYPE }); -export default List; + if (props.currentId) { + values.id = props.currentId; + await props.requestEdit(values); + } + else { + await props.requestAdd(values); + } + + onCancel(); + props.getData(); + }; + return ( + + + + ); +} + +const AddModal = AddModalComponent; + +export default Connect([NS_ENTERPRISE], true)(List); diff --git a/src/pages/Container/Supervision/BranchCompany/SubsidiaryUser/View/index.js b/src/pages/Container/Supervision/StakeholderUnit/AccountManage/UserView/index.js similarity index 100% rename from src/pages/Container/Supervision/BranchCompany/SubsidiaryUser/View/index.js rename to src/pages/Container/Supervision/StakeholderUnit/AccountManage/UserView/index.js diff --git a/src/pages/Container/Supervision/StakeholderUnit/AccountManage/View/index.js b/src/pages/Container/Supervision/StakeholderUnit/AccountManage/View/index.js index 9875b67..ba0d98b 100644 --- a/src/pages/Container/Supervision/StakeholderUnit/AccountManage/View/index.js +++ b/src/pages/Container/Supervision/StakeholderUnit/AccountManage/View/index.js @@ -1,7 +1,24 @@ -import { Descriptions, Divider } from "antd"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Descriptions, Divider, Form } from "antd"; +import { useEffect, useState } from "react"; import HeaderBack from "zy-react-library/components/HeaderBack"; +import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; -function View() { +function View(props) { + const [info, setInfo] = useState({}); + const [form] = Form.useForm(); + const fnSearch = (values) => { + console.log(values); + }; + useEffect(() => { + const fetchData = async () => { + const res = await props.corpInfoRemoveDetails({ id: "1985906265017954306" }); + setInfo(res.data); + // 不要在这里 log info,它还是旧的 + }; + fetchData(); + }, []); return (
@@ -9,35 +26,45 @@ function View() { 基本信息 + 营业执照 + }, + { label: "营业执照有效期", children: `${info.licenseStart} 至 ${info.licenseEnd}` }, + ]} + /> +
); } -export default View; +export default Connect([NS_ENTERPRISE], true)(View); diff --git a/src/pages/Container/Supervision/StakeholderUnit/SecurityPersonnel/CertificateList/index.js b/src/pages/Container/Supervision/StakeholderUnit/SecurityPersonnel/CertificateList/index.js new file mode 100644 index 0000000..28d35f3 --- /dev/null +++ b/src/pages/Container/Supervision/StakeholderUnit/SecurityPersonnel/CertificateList/index.js @@ -0,0 +1,201 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; +import FormBuilder from "zy-react-library/components/FormBuilder"; +import HeaderBack from "zy-react-library/components/HeaderBack"; + +import AddIcon from "zy-react-library/components/Icon/AddIcon"; +import Search from "zy-react-library/components/Search"; +import Table from "zy-react-library/components/Table"; +import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg"; +import Upload from "zy-react-library/components/Upload"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import useTable from "zy-react-library/hooks/useTable"; +import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace"; + +function Department(props) { + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); + const queryParams = useGetUrlQuery(); + + const [form] = Form.useForm(); + const { tableProps, getData } = useTable(props["userQualificationInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + eqQualificationinfoType: 2, + corpinfoIdString: queryParams["id"], + }; + }, + }); + + const onDelete = (id) => { + Modal.confirm({ + title: "提示", + content: "确定删除吗?", + onOk: () => { + props["userQualificationInfoRemove"]({ id }); + + getData(); + }, + }); + }; + return ( +
+ + + +
+
+ +
+ +
( + <> + + + + )} + columns={[ + { title: "姓名", dataIndex: "qualificationName" }, + { title: "证书名称", dataIndex: "qualificationName" }, + { title: "证书编号", dataIndex: "certificateNo" }, + { title: "就职状态", dataIndex: "certificateNo", render: (_, record) => {record.employmentFlag === 1 ? "就职" : record.employmentFlag === 0 ? "离职" : ""} }, + { title: "图片", dataIndex: "name", render: (_, record) => () }, + { + title: "操作", + width: 200, + render: (_, record) => ( + + + + + ), + }, + ]} + {...tableProps} + /> + + + + { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} + /> + + ); +} + +function AddModalComponent(props) { + const [form] = Form.useForm(); + + const queryParams = useGetUrlQuery(); + const [userQualificationinfoId, setUserQualificationinfoId] = useState(""); + useEffect(() => { + // 证书作业类别 + // props.dictData({ appKey: "0bb989ecada5470c87635018ece9f327", dictValue: "zylb" }).then((res) => { + // setQualificationinfo(res.data); + // }); + + if (props.currentId) { + props.requestDetails({ id: props.currentId }).then((res) => { + form.setFieldsValue(res.data); + setUserQualificationinfoId(res.data.userQualificationinfoId); + }); + } + }, [props.currentId]); + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + const onSubmit = async (values) => { + values.corpinfoId = queryParams["corpinfoId"]; + values.userIdString = queryParams["id"]; + + values.qualificationinfoType = 2; + values.userQualificationinfoId = userQualificationinfoId; + values.qualificationinfoCategory = "qyzyfzr"; + values.qualificationinfoCategoryName = "企业主要负责人"; + if (props.currentId) { + values.idString = props.currentId; + await props.requestEdit(values); + } + else { + await props.requestAdd(values); + } + + onCancel(); + props.getData(); + }; + return ( + + }, + + ]} + s + /> + + ); +} + +const AddModal = AddModalComponent; +export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department); diff --git a/src/pages/Container/Supervision/StakeholderUnit/SecurityPersonnel/List/index.js b/src/pages/Container/Supervision/StakeholderUnit/SecurityPersonnel/List/index.js new file mode 100644 index 0000000..55876a9 --- /dev/null +++ b/src/pages/Container/Supervision/StakeholderUnit/SecurityPersonnel/List/index.js @@ -0,0 +1,74 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, Space } from "antd"; +import Search from "zy-react-library/components/Search"; +import Table from "zy-react-library/components/Table"; +// import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useTable from "zy-react-library/hooks/useTable"; +// import { getLabelName } from "zy-react-library/utils"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; + +// const ENTERPRISE_TYPE = [ +// { bianma: 3, name: "相关方企业" }, +// { bianma: 4, name: "货主单位" }, +// { bianma: 5, name: "驻港单位" }, +// ]; +// const ENTERPRISE_STATUS = [ +// { bianma: "filialstate01", name: "在产" }, +// { bianma: "filialstate02", name: "在建" }, +// { bianma: "filialstate03", name: "代建" }, +// { bianma: "filialstate04", name: "停产" }, +// { bianma: "filialstate05", name: "破产" }, +// ]; + +function List(props) { + const [form] = Form.useForm(); + const { tableProps, getData } = useTable(props["corpUserMiddlePage"], { + form, + transform: (formData) => { + return { + ...formData, + enterpriseType: 3, + }; + }, + }); + + return ( +
+ +
( + {record.userCount ? record.userCount : "0"} + ) }, + { title: "安全人员信息数", dataIndex: "safetyUserCount" }, + { title: "特种作业人数", dataIndex: "specialUserCount" }, + // { title: "公司状态", dataIndex: "corpStateName" }, + + // { title: "启用状态", dataIndex: "useFlag", render: (_, record) => ( + // {record.useFlag === 1 ? "停用" : record.useFlag === 0 ? "启用" : ""} + // ) }, + + { title: "操作", width: 150, render: (_, record) => ( + + + + ) }, + ]} + {...tableProps} + /> + + + ); +} + +export default Connect([NS_ENTERPRISE], true)(List); diff --git a/src/pages/Container/Supervision/StakeholderUnit/SecurityPersonnel/index.js b/src/pages/Container/Supervision/StakeholderUnit/SecurityPersonnel/index.js new file mode 100644 index 0000000..b5ee55d --- /dev/null +++ b/src/pages/Container/Supervision/StakeholderUnit/SecurityPersonnel/index.js @@ -0,0 +1,9 @@ +function SecurityPersonnel(props) { + return ( +
+ {props.children} +
+ ); +} + +export default SecurityPersonnel; diff --git a/src/pages/Container/Supervision/StakeholderUnit/SpecialPersonnel/CertificateList/index.js b/src/pages/Container/Supervision/StakeholderUnit/SpecialPersonnel/CertificateList/index.js new file mode 100644 index 0000000..21e678c --- /dev/null +++ b/src/pages/Container/Supervision/StakeholderUnit/SpecialPersonnel/CertificateList/index.js @@ -0,0 +1,203 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; +import FormBuilder from "zy-react-library/components/FormBuilder"; +import HeaderBack from "zy-react-library/components/HeaderBack"; + +import AddIcon from "zy-react-library/components/Icon/AddIcon"; +import Search from "zy-react-library/components/Search"; +import Table from "zy-react-library/components/Table"; +import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg"; +import Upload from "zy-react-library/components/Upload"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import useTable from "zy-react-library/hooks/useTable"; +import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace"; + +function Department(props) { + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); + const queryParams = useGetUrlQuery(); + + const [form] = Form.useForm(); + const { tableProps, getData } = useTable(props["userQualificationInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + eqQualificationinfoType: 1, + corpinfoIdString: queryParams["id"], + }; + }, + }); + + const onDelete = (id) => { + Modal.confirm({ + title: "提示", + content: "确定删除吗?", + onOk: () => { + props["userQualificationInfoRemove"]({ id }); + + getData(); + }, + }); + }; + return ( +
+ + +
+
+ +
+ +
( + <> + + + + )} + columns={[ + { title: "姓名", dataIndex: "qualificationName" }, + { title: "证书名称", dataIndex: "qualificationName" }, + { title: "证书作业类别", dataIndex: "qualificationinfoCategoryName" }, + { title: "操作项目", dataIndex: "operatingProjectName" }, + { title: "证书编号", dataIndex: "certificateNo" }, + { title: "就职状态", dataIndex: "certificateNo", render: (_, record) => {record.employmentFlag === 1 ? "就职" : record.employmentFlag === 0 ? "离职" : ""} }, + { title: "图片", dataIndex: "name", render: (_, record) => () }, + { + title: "操作", + width: 200, + render: (_, record) => ( + + + + + ), + }, + ]} + {...tableProps} + /> + + + { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} + /> + + + ); +} + +function AddModalComponent(props) { + const [form] = Form.useForm(); + + const queryParams = useGetUrlQuery(); + const [userQualificationinfoId, setUserQualificationinfoId] = useState(""); + useEffect(() => { + // 证书作业类别 + // props.dictData({ appKey: "0bb989ecada5470c87635018ece9f327", dictValue: "zylb" }).then((res) => { + // setQualificationinfo(res.data); + // }); + + if (props.currentId) { + props.requestDetails({ id: props.currentId }).then((res) => { + form.setFieldsValue(res.data); + setUserQualificationinfoId(res.data.userQualificationinfoId); + }); + } + }, [props.currentId]); + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + const onSubmit = async (values) => { + values.corpinfoId = queryParams["corpinfoId"]; + values.userIdString = queryParams["id"]; + values.operatingProject = "DGZY_dgzy"; + values.operatingProjectName = "电工作业"; + values.qualificationinfoType = 1; + values.userQualificationinfoId = userQualificationinfoId; + values.qualificationinfoCategory = "DYDGZY"; + values.qualificationinfoCategoryName = "低压电工作业"; + if (props.currentId) { + values.idString = props.currentId; + await props.requestEdit(values); + } + else { + await props.requestAdd(values); + } + + onCancel(); + props.getData(); + }; + return ( + + }, + + ]} + s + /> + + ); +} + +const AddModal = AddModalComponent; +export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department); diff --git a/src/pages/Container/Supervision/StakeholderUnit/SpecialPersonnel/List/index.js b/src/pages/Container/Supervision/StakeholderUnit/SpecialPersonnel/List/index.js new file mode 100644 index 0000000..55876a9 --- /dev/null +++ b/src/pages/Container/Supervision/StakeholderUnit/SpecialPersonnel/List/index.js @@ -0,0 +1,74 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, Space } from "antd"; +import Search from "zy-react-library/components/Search"; +import Table from "zy-react-library/components/Table"; +// import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useTable from "zy-react-library/hooks/useTable"; +// import { getLabelName } from "zy-react-library/utils"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; + +// const ENTERPRISE_TYPE = [ +// { bianma: 3, name: "相关方企业" }, +// { bianma: 4, name: "货主单位" }, +// { bianma: 5, name: "驻港单位" }, +// ]; +// const ENTERPRISE_STATUS = [ +// { bianma: "filialstate01", name: "在产" }, +// { bianma: "filialstate02", name: "在建" }, +// { bianma: "filialstate03", name: "代建" }, +// { bianma: "filialstate04", name: "停产" }, +// { bianma: "filialstate05", name: "破产" }, +// ]; + +function List(props) { + const [form] = Form.useForm(); + const { tableProps, getData } = useTable(props["corpUserMiddlePage"], { + form, + transform: (formData) => { + return { + ...formData, + enterpriseType: 3, + }; + }, + }); + + return ( +
+ +
( + {record.userCount ? record.userCount : "0"} + ) }, + { title: "安全人员信息数", dataIndex: "safetyUserCount" }, + { title: "特种作业人数", dataIndex: "specialUserCount" }, + // { title: "公司状态", dataIndex: "corpStateName" }, + + // { title: "启用状态", dataIndex: "useFlag", render: (_, record) => ( + // {record.useFlag === 1 ? "停用" : record.useFlag === 0 ? "启用" : ""} + // ) }, + + { title: "操作", width: 150, render: (_, record) => ( + + + + ) }, + ]} + {...tableProps} + /> + + + ); +} + +export default Connect([NS_ENTERPRISE], true)(List); diff --git a/src/pages/Container/Supervision/StakeholderUnit/SpecialPersonnel/index.js b/src/pages/Container/Supervision/StakeholderUnit/SpecialPersonnel/index.js new file mode 100644 index 0000000..5e26c06 --- /dev/null +++ b/src/pages/Container/Supervision/StakeholderUnit/SpecialPersonnel/index.js @@ -0,0 +1,9 @@ +function SpecialPersonnel(props) { + return ( +
+ {props.children} +
+ ); +} + +export default SpecialPersonnel; diff --git a/src/pages/Container/Supervision/StakeholderUnit/User/Add/index.js b/src/pages/Container/Supervision/StakeholderUnit/User/Add/index.js deleted file mode 100644 index 0f48219..0000000 --- a/src/pages/Container/Supervision/StakeholderUnit/User/Add/index.js +++ /dev/null @@ -1,272 +0,0 @@ -import { tools } from "@cqsjjb/jjb-common-lib"; -import { Alert, Form } from "antd"; -import FormBuilder from "zy-react-library/components/FormBuilder"; -import HeaderBack from "zy-react-library/components/HeaderBack"; -import Upload from "zy-react-library/components/Upload"; -import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; -import { ID_NUMBER } from "zy-react-library/regular"; - -const { query } = tools.router; -export const WHETHER_ENUM = [ - { name: "是", id: "1" }, - { name: "否", id: "0" }, -]; -export const SEX_ENUM = [ - { name: "男", id: "0" }, - { name: "女", id: "1" }, -]; -export const MARITAL_STATUS_ENUM = [ - { name: "已婚", id: "1" }, - { name: "未婚", id: "0" }, -]; -function Add() { - const [form] = Form.useForm(); - const onSubmit = (values) => { - console.log(values); - }; - return ( - <> - -
- ( - -
* 图像格式:JPG、JPEG、PNG
-
* 图像大小:不超过4M。
-
* 照片大小: 推荐 500*500
-
* 人脸无遮挡(如戴帽子、口罩、眼镜等)、无修图
-
* 人脸需双眼睁开、表情自然、露额,头发不要遮挡
-
- )} - /> - ), - }, - { name: "name", label: "姓名" }, - { name: "username", label: "用户名", componentProps: { disabled: query.id } }, - { name: "departmentId", label: "部门" }, - { name: "email", label: "电子邮箱", required: false, rules: [{ type: "email", message: "请输入正确的邮箱" }] }, - { name: "cardId", label: "身份证号", rules: [{ pattern: ID_NUMBER, message: "请输入正确的身份证号" }] }, - { - name: "userCardFile", - label: "身份证照片", - render: ({ value, onChange }) => ( - -
温馨提示:用户要上传身份证正反面(身份证照片数量是2张), 才能进行人员培训
- - )} - /> - ), - }, - { - name: "nationality", - label: "民族", - render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], - }, - { - name: "sex", - label: "性别", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: SEX_ENUM, - componentProps: { disabled: true }, - }, - { name: "dateOfBirth", label: "出生年月", render: FORM_ITEM_RENDER_ENUM.DATE }, - { name: "age", label: "年龄", render: FORM_ITEM_RENDER_ENUM.NUMBER }, - { name: "hklocal", label: "户口所在地" }, - { name: "address", label: "现住址" }, - { - name: "degreeOfEducation", - label: "文化程度", - render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], - }, - { - name: "maritalstatus", - label: "婚姻状况", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: MARITAL_STATUS_ENUM, - }, - { - name: "politicalStatus", - label: "政治面貌", - render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], - componentProps: { - onChange: () => { - form.setFieldValue("politicalTime", undefined); - }, - }, - }, - { - name: "politicalTime", - label: "入党时间", - render: FORM_ITEM_RENDER_ENUM.DATE, - dependencies: ["politicalStatus"], - hidden: formValues => !(formValues.politicalStatus === "zhonggongdangyuan"), - }, - { name: "postId", label: "岗位名称(工种)" }, - { - name: "isSocial", - label: "是否缴纳社保", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - componentProps: { - onChange: () => { - form.setFieldValue("socialNumber", undefined); - form.setFieldValue("socSecurity", undefined); - }, - }, - }, - { - name: "socialNumber", - label: "社会保障号码", - dependencies: ["isSocial"], - hidden: formValues => !(formValues.isSocial === "1"), - }, - { - name: "socSecurity", - label: "社保卡照片", - render: ({ value, onChange }) => , - dependencies: ["isSocial"], - hidden: formValues => !(formValues.isSocial === "1"), - }, - { - name: "isBf", - label: "是否缴纳保险", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - }, - { - name: "isSignLabor", - label: "是否签订劳动合同", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - componentProps: { - onChange: () => { - form.setFieldValue("contract", undefined); - }, - }, - }, - { - name: "contract", - label: "合同图片", - render: ({ value, onChange }) => , - dependencies: ["isSignLabor"], - hidden: formValues => !(formValues.isSignLabor === "1"), - }, - { - name: "ispay", - label: "是否缴纳商业保险", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - componentProps: { - onChange: () => { - form.setFieldValue("ispayNumber", undefined); - form.setFieldValue("insurance", undefined); - }, - }, - }, - { - name: "ispayNumber", - label: "商业保险单号", - dependencies: ["ispay"], - hidden: formValues => !(formValues.ispay === "1"), - }, - { - name: "insurance", - label: "保险图片", - render: ({ value, onChange }) => , - dependencies: ["ispay"], - hidden: formValues => !(formValues.ispay === "1"), - }, - { - name: "isInjuriesPay", - label: "是否按期缴纳工伤保险", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - componentProps: { - onChange: () => { - form.setFieldValue("isInjuriesPayTime", undefined); - form.setFieldValue("empInsurance", undefined); - }, - }, - }, - { - name: "isInjuriesPayTime", - label: "工伤保险有效期", - dependencies: ["isInjuriesPay"], - render: FORM_ITEM_RENDER_ENUM.DATE, - hidden: formValues => !(formValues.isInjuriesPay === "1"), - }, - { - name: "empInsurance", - label: "工伤保险凭证", - render: ({ value, onChange }) => , - dependencies: ["isInjuriesPay"], - hidden: formValues => !(formValues.isInjuriesPay === "1"), - }, - { - name: "isLevelThree", - label: "是否参加三级安全培训", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - componentProps: { - onChange: () => { - form.setFieldValue("threeLevel", undefined); - }, - }, - }, - { - name: "threeLevel", - label: "三级安全培训照片", - render: ({ value, onChange }) => , - dependencies: ["isLevelThree"], - hidden: formValues => !(formValues.isLevelThree === "1"), - }, - { - name: "isflow", - label: "是否流动人员", - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - }, - { - name: "IS_SPECIAL_JOB", - label: "是否特殊工种", - required: false, - render: FORM_ITEM_RENDER_ENUM.RADIO, - items: WHETHER_ENUM, - componentProps: { disabled: true }, - }, - { - name: "alert", - span: 24, - customizeRender: true, - render: () => (), - }, - ]} - /> - - - ); -} - -export default Add; diff --git a/src/pages/Container/Supervision/StakeholderUnit/User/List/index.js b/src/pages/Container/Supervision/StakeholderUnit/User/List/index.js index 102efd0..0c5718f 100644 --- a/src/pages/Container/Supervision/StakeholderUnit/User/List/index.js +++ b/src/pages/Container/Supervision/StakeholderUnit/User/List/index.js @@ -1,57 +1,74 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Form, Space } from "antd"; -import AddIcon from "zy-react-library/components/Icon/AddIcon"; import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; -import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +// import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; +// import { getLabelName } from "zy-react-library/utils"; +import { NS_ENTERPRISE } from "~/enumerate/namespace"; + +// const ENTERPRISE_TYPE = [ +// { bianma: 3, name: "相关方企业" }, +// { bianma: 4, name: "货主单位" }, +// { bianma: 5, name: "驻港单位" }, +// ]; +// const ENTERPRISE_STATUS = [ +// { bianma: "filialstate01", name: "在产" }, +// { bianma: "filialstate02", name: "在建" }, +// { bianma: "filialstate03", name: "代建" }, +// { bianma: "filialstate04", name: "停产" }, +// { bianma: "filialstate05", name: "破产" }, +// ]; function List(props) { const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["corpUserMiddlePage"], { + form, + transform: (formData) => { + return { + ...formData, + enterpriseType: 3, + }; + }, + }); return (
( - - )} - columns={[ - { title: "集团单位", dataIndex: "name" }, - { title: "相关单位名称", dataIndex: "name" }, - { title: "属地", dataIndex: "name" }, - { title: "股份主管部门", dataIndex: "name" }, - { title: "股份监管部门", dataIndex: "name" }, - { title: "基层单位主管部门", dataIndex: "name" }, - { title: "基层单位监督部门", dataIndex: "name" }, - { title: "开户人", dataIndex: "name" }, - { title: "状态", dataIndex: "name" }, - { title: "操作", width: 200, render: (_, record) => ( - - {/* */} - {/* */} + columns={[ + { title: "相关方单位名称", dataIndex: "corpName" }, + { title: "企业人数", dataIndex: "userCount", render: (_, record) => ( + {record.userCount ? record.userCount : "0"} + ) }, + { title: "安全人员信息数", dataIndex: "safetyUserCount" }, + { title: "特种作业人数", dataIndex: "specialUserCount" }, + // { title: "公司状态", dataIndex: "corpStateName" }, + + // { title: "启用状态", dataIndex: "useFlag", render: (_, record) => ( + // {record.useFlag === 1 ? "停用" : record.useFlag === 0 ? "启用" : ""} + // ) }, + + { title: "操作", width: 150, render: (_, record) => ( + + ) }, ]} {...tableProps} /> + ); } -export default List; +export default Connect([NS_ENTERPRISE], true)(List); diff --git a/src/pages/Container/Supervision/StakeholderUnit/User/UserList/index.js b/src/pages/Container/Supervision/StakeholderUnit/User/UserList/index.js index 21914ee..3df1fc9 100644 --- a/src/pages/Container/Supervision/StakeholderUnit/User/UserList/index.js +++ b/src/pages/Container/Supervision/StakeholderUnit/User/UserList/index.js @@ -1,51 +1,55 @@ -import { Button, Form, message, Modal } from "antd"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Descriptions, Form, message, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; -import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; import useTable from "zy-react-library/hooks/useTable"; +import { NS_USER } from "~/enumerate/namespace"; -export const PERSONNEL_TYPE_ENUM = [ - { id: "0", name: "非流动人员" }, - { id: "1", name: "流动人员" }, -]; -function UserList(props) { +function List(props) { + const [selectedNodeId, setSelectedNodeId] = useState(); + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); + const queryParams = useGetUrlQuery(); const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["userList"], { + form, + transform: (formData) => { + return { + ...formData, + eqDepartmentId: selectedNodeId, + corpinfoId: queryParams["id"], + }; + }, + }); - const onResetPassword = (id) => { + const onResetPassword = () => { Modal.confirm({ title: "提示", - content: "是否重置密码为Bb@123456789?", + content: "确定要重置密码为Aa@123456789吗?", onOk: () => { message.success("重置密码成功"); - getData(); }, }); }; + const onTreeChange = (selectedKeys) => { + const key = selectedKeys[0] || null; + console.log(selectedKeys); + setSelectedNodeId(key); + getData(); + }; return (
- +
( - <> - + - + + + + ), }, ]} {...tableProps} - dataSource={[{}]} />
+ { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} + />
); +}; + +function AddModalComponent(props) { + const [form] = Form.useForm(); + const [info, setInfo] = useState({}); + useEffect(() => { + if (props.currentId) { + const fetchData = async () => { + const res = await props.requestDetails({ id: props.currentId }); + console.log(res.data); + setInfo(res.data); + }; + fetchData(); + console.log(info); + } + }, [props.currentId]); + + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + + return ( + +
+ {info.departmentLeaderFlag === 1 ? "是" : "否"} }, + { label: "所属岗位", children: info.postName }, + { label: "用户名", children: info.username }, + { label: "姓名", children: info.name }, + { label: "手机号", children: info.phone }, + { label: "人员类型", children: info.personnelTypeName }, + { label: "身份证号", children: info.userIdCard }, + { label: "民族", children: info.nationName }, + { label: "性别", children: info.sex }, + + { label: "人脸照片", children: info.nationName }, + { label: "部门排序", children: info.sort }, + { label: "邮箱", children: info.email }, + // { label: "文化程度", children: info.culturalLevelName }, + // { label: "婚姻状况", children: info.maritalStatusName }, + // { label: "政治面貌", children: info.politicalAffiliationName }, + { label: "备注", children: info.remarks }, + ]} + /> +
+
+ ); } -export default UserList; + +const AddModal = AddModalComponent; +export default Connect([NS_USER], true)(List); diff --git a/src/pages/Container/Supervision/StakeholderUnit/User/UserView/index.js b/src/pages/Container/Supervision/StakeholderUnit/User/UserView/index.js deleted file mode 100644 index 8e12d59..0000000 --- a/src/pages/Container/Supervision/StakeholderUnit/User/UserView/index.js +++ /dev/null @@ -1,941 +0,0 @@ -import { Descriptions, Divider } from "antd"; -import { useState } from "react"; -import HeaderBack from "zy-react-library/components/HeaderBack"; -import PreviewImg from "zy-react-library/components/PreviewImg"; -import Table from "zy-react-library/components/Table"; -import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg"; -import useDownloadFile from "zy-react-library/hooks/useDownloadFile"; -import { getLabelName } from "zy-react-library/utils"; -import { MARITAL_STATUS_ENUM, SEX_ENUM, WHETHER_ENUM } from "../Add"; - -function UserView() { - const { downloadFile } = useDownloadFile(); - const [info] = useState({ - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - selectUserId: null, - username: "13058604112", - password: "16758a08251b174145edfb6188bcb5dd51a827f1", - name: "0513-1", - roleId: "fhadminzhuche", - rolesName: null, - lastLogin: null, - ip: null, - status: 0, - bz: "注册用户", - sex: null, - skin: "pcoded-navbar navbar-image-3,navbar pcoded-header navbar-expand-lg navbar-light header-dark,", - email: null, - number: null, - phone: "13058604112", - roleIds: null, - departmentId: "dd5ab430a9f442a0be64c61a9645b904", - departmentName: null, - departmentNameAll: null, - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - funIds: null, - appid: null, - postId: "jhsdGsdghbs", - postName: "jhsdGsdghbs", - ismain: "0", - errorCount: 0, - sort: null, - learnercategory: null, - useravatarprefix: null, - useravatarurl: null, - shiftdutyone: null, - shiftdutytwo: null, - duration: null, - workstatus: null, - workperiod: null, - isRecorder: null, - personnelType: null, - personnelTypeName: null, - isHazardconfirmer: null, - isAccessauditor: null, - isOnlinelearning: null, - personType: null, - jcr: null, - pushCid: null, - empno: null, - cfdStatus: null, - cardno: null, - userIdCard: null, - isPolice: null, - userIdentity: null, - baseimgpath: null, - backendaddr: null, - mkmjcard: null, - ispush: "1", - userType: "3", - inHrUser: "0", - isDelete: 0, - creator: null, - createTime: "2025-04-20 14:41:54", - operat: "87ef258559e6430aa837e0f38062e250", - operatTime: "2025-08-29 11:05:09", - mkmjVehicleReviewer: null, - userIds: null, - departSort: null, - corpinfoName: null, - classCount: null, - completeCount: null, - studystate: null, - corpInfoStatus: null, - busImgList: null, - faceFile: null, - facePermissions: null, - job: null, - jobLevel: null, - jobLevelName: null, - nation: null, - nationName: null, - basicinfoId: null, - precinctId: null, - roleName: null, - isassess: null, - mkmjPermissions: "1", - inMkmjBlacklist: null, - disableMkmj: null, - employCorpName: null, - validityPeriodStart: null, - validityPeriodEnd: null, - classNo: null, - employCorpId: null, - xgfUserId: "5d8dcfbcd27741c79efaa6ca31941b9e", - loginUser: null, - isFlow: "0", - isFlowName: null, - trainStatus: null, - trainStatusName: null, - basicState: null, - basicStateName: null, - userPhoto: null, - userPhotoInfo: [ - { - imgfilesId: "4a7197ac1f844466a592f5ac54bb7071", - filepath: "/uploadFiles/file/xgf/920fa607d47c431b9142912801d10047.jpg", - }, - ], - userCard: null, - userCardInfo: [ - { - imgfilesId: "4a3a9d1cca0b463290afbe2da7f86fcd", - filepath: "/uploadFiles/file/xgf/887b696c5593413f9c108111ef111c1f.jpg", - }, - { - imgfilesId: "70972a9e21e3448d9dbfffae02f442ba", - filepath: "/uploadFiles/file/xgf/51588b4531a449b58ace522928c75166.png", - }, - ], - socSecurity: null, - socSecurityInfo: [ - { - imgfilesId: "c733ce9c56e746c99814503dbd09992e", - filepath: "/uploadFiles/file/xgf/082c6408413648879f53bd02f5c6059b.png", - }, - { - imgfilesId: "efaa255ef2e64da7920e2b4415a0e250", - filepath: "/uploadFiles/file/xgf/dde0abbe4c494111bc1e7533bda76178.png", - }, - ], - contract: null, - contractInfo: [], - insurance: null, - insuranceInfo: [], - empInsurance: null, - empInsuranceInfo: [], - threeLevel: null, - threeLevelInfo: [], - deleteFileIds: null, - emp: { - employmentApplyManagementId: "50b9c363d6584072a7a14b1ef6fc3468", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - relevantUnitName: "测试相关方", - startDate: "2025-04-20 14:43:50", - endDate: null, - leaveReason: null, - applyTime: null, - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - creator: "5d8dcfbcd27741c79efaa6ca31941b9e", - createtime: "2025-04-20 14:43:51", - operator: "87ef258559e6430aa837e0f38062e250", - operatetime: "2025-08-11 18:20:32", - isdelete: "0", - auditState: "2", - departState: "0", - reviewState: "", - departmentId: "dd5ab430a9f442a0be64c61a9645b904", - remarks: null, - auditRemarks: null, - auditTime: null, - auditPerson: null, - corpStartDate: "2025-04-20", - postId: "jhsdGsdghbs", - entryDate: null, - isSignLabor: "0", - isInjuriesPay: "0", - socialNumber: "462218514G0CB1PQ55", - ispay: "0", - isLevelThree: "0", - isSafetyTell: "0", - isBodyAdapt: "0", - isSpecialJob: "0", - isflow: "0", - isSocial: "1", - socialType: null, - isBf: "0", - }, - userDetails: { - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - name: "0513-1", - phone: "13058604112", - creattime: "2025-08-11 18:20:31", - departState: "0", - isdelete: "0", - personWorkType: null, - personWorkTypeName: null, - age: "21", - hklocal: "11112", - address: "1111", - degreeOfEducation: "dxbk", - degreeOfEducationName: "大学本科", - corpStartDate: null, - postId: "jhsdGsdghbs", - postName: "jhsdGsdghbs", - workSign: null, - joinedDate: null, - workDate: null, - photo: "/uploadFiles/file/xgf/920fa607d47c431b9142912801d10047.jpg", - dateOfBirth: "2004-06-07", - ispay: "0", - ispayNumber: "", - isSafetyTell: "0", - isSafetyTime: null, - isInjuriesPay: "0", - isSignLabor: "0", - sex: "0", - entryDate: null, - nationality: "mz", - nationalityName: "满族", - maritalstatus: "0", - politicalTime: null, - politicalStatus: "zgybdy01", - politicalStatusName: "中共预备党员", - isInjuriesPayTime: "", - isLevelThree: "0", - isBodyAdapt: "0", - isSpecialJob: null, - belongToCorp: "dd5ab430a9f442a0be64c61a9645b904", - belongToCorpName: "测试相关方", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - managerDepartmentId: null, - managerDepartmentName: null, - competentDepartmentId: null, - competentDepartmentName: null, - mainDepartmentId: null, - mainDepartmentName: null, - cardId: "130726200406079838", - departmentId: "dd5ab430a9f442a0be64c61a9645b904", - departmentName: "测试相关方", - isSocial: "1", - isBf: "0", - socialNumber: "462218514G0CB1PQ55", - zzname: null, - annex: "/uploadFiles/file/xgf/94212aec9b66433ca3b665a68251d8b5.zip", - attorney: null, - commitmentLetter: null, - }, - trainingRec: [ - { - classInfoId: "7a3ab8fabd8a4b51a8e2ed1d081b19b3", - createTime: "2025-05-19 00:00:00", - creator: "1", - operateTime: "2025-05-19 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "65a5b863a20a4f85b43dc63dc0bd9308", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-15 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "0515-1222", - openingTime: "2025-05-15 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "a14252d3baed49f3b694d51f8a01a543", - createTime: "2025-06-01 00:00:00", - creator: "1", - operateTime: "2025-06-01 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "3bbc4df4bcef4de698fea4c6fdc963ea", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-15 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "666666", - openingTime: "2025-05-15 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "be1a01e7bbde4c6cacbc0a7bd437687e", - createTime: "2025-05-18 00:00:00", - creator: "1", - operateTime: "2025-05-18 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "1", - classMessageId: "0e46e74fce7d4b038a5409633750722c", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-15 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "0515-111", - openingTime: "2025-05-15 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "0ba29ef2449d4c35a74fa20f15840f63", - createTime: "2025-05-17 19:00:00", - creator: "1", - operateTime: "2025-05-17 19:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "8b03ba6329ff4807abdf758e3ed8e53b", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-14 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "0514-111", - openingTime: "2025-05-14 00:00:00", - place: "d7d30999957a46d6a647fe8e168fb960", - placeName: "铁运开站小教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "28800a073d8e4afb945aeb61b364d093", - createTime: "2025-06-01 00:00:00", - creator: "1", - operateTime: "2025-06-01 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "0dd69622dc5e4e27a142f9a07f7b4a9a", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-14 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "123", - openingTime: "2025-05-14 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "75bafd4545484f739d03c5b1228e187a", - createTime: "2025-06-01 00:00:01", - creator: "1", - operateTime: "2025-06-01 00:00:01", - operator: "1", - isdelete: "0", - corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "de07771f21344c7e9e8b40ed26a221b8", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-14 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "0514-1", - openingTime: "2025-05-14 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "8a85c80f40774b1a8a11b97b06328f40", - createTime: "2025-05-16 00:00:00", - creator: "1", - operateTime: "2025-05-16 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "53c1f413ad564dadb3139346be548a7d", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-14 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "12121", - openingTime: "2025-05-14 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "9a6cf3a55ae2497e9ac7fddca29395af", - createTime: "2025-06-01 00:00:01", - creator: "1", - operateTime: "2025-06-01 00:00:01", - operator: "1", - isdelete: "0", - corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "f18561c4f3304de2abb3abf3447c1f42", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-14 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "888888", - openingTime: "2025-05-14 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "c0b73248951647fdacbc0135435c35b6", - createTime: "2025-05-16 00:00:00", - creator: "1", - operateTime: "2025-05-16 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "1f60ce32b7824c7c8f528dfec2f486f6", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-14 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "新建班级", - openingTime: "2025-05-14 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "8c0bd01a749a4ab9a9debbb502e2fc8b", - createTime: "2025-05-17 00:00:00", - creator: "1", - operateTime: "2025-05-17 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "2902e676235441f9b0a9b0b04e2323c4", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-13 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "测试测试", - openingTime: "2025-05-13 00:00:00", - place: "", - placeName: null, - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "c5b2fb9938584f9eb31a8695c6b17b1f", - createTime: "2025-06-01 00:00:00", - creator: "1", - operateTime: "2025-06-01 00:00:00", - operator: "1", - isdelete: "0", - corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "23dbed8a477c45f790739ff6c739a010", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-13 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "0513-1", - openingTime: "2025-05-13 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - { - classInfoId: "ce21960b2c304134af6e96a26cff1f70", - createTime: "2025-05-14 18:50:00", - creator: "1", - operateTime: "2025-05-14 18:50:00", - operator: "1", - isdelete: "0", - corpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - userId: "5d8dcfbcd27741c79efaa6ca31941b9e", - status: "0", - classMessageId: "61ab001c98d54c5e8db53de675445523", - username: "13058604112", - name: "0513-1", - sex: "0", - cardId: "130726200406079838", - belongToCorpName: "测试相关方", - departmentName: "测试相关方", - photo: "/uploadFiles/file/education/face/20250514/c3e85138dea843578204357528f1611b.jpeg", - phone: "13058604112", - personWorkType: null, - certificate: null, - classNo: null, - trainUsersId: null, - validityPeriodStart: "2025-05-12 00:00:00", - validityPeriodEnd: "2025-05-14", - className: "测试一个教育培训", - openingTime: "2025-05-12 00:00:00", - place: "3725a5aa60da407e87b7931e311da192", - placeName: "教育培训中心(东山校区)阶梯教室", - postName: null, - deptName: "测试相关方", - }, - ], - special: [], - flows: [ - { - flowId: "fd58bf5ad97847419f8de769639947f5", - type: "1", - creator: null, - creatorName: null, - creatorTime: "2025-05-13 14:30:18", - validFlag: "1", - foreignKey: "5d8dcfbcd27741c79efaa6ca31941b9e", - isdelete: "0", - endFlag: "1", - details: [ - { - flowDetailId: "33ec9909844b482fbcdb8c6cc1e8a9db", - flowId: "fd58bf5ad97847419f8de769639947f5", - stepFlag: "0", - stepName: "相关方提交人员信息到发包单位", - sort: 0, - parentId: "0", - approverId: "87ef258559e6430aa837e0f38062e250", - approverName: "测试相关方", - approverOpinion: null, - approverCorpinfoId: "dd5ab430a9f442a0be64c61a9645b904", - approverCorpinfoName: "测试相关方", - approverTime: "2025-05-13 14:30:18", - passFlag: "1", - endFlag: "0", - isdelete: "0", - foreignKey: null, - appointAnnex: "/uploadFiles/file/xgf/94212aec9b66433ca3b665a68251d8b5.zip", - appointAnnexName: null, - }, - { - flowDetailId: "b6e4612892b14a73b8aa4324c69c85d3", - flowId: "fd58bf5ad97847419f8de769639947f5", - stepFlag: "0", - stepName: null, - sort: 1, - parentId: "33ec9909844b482fbcdb8c6cc1e8a9db", - approverId: "94407a4e15ec46b5974b128e124fa661", - approverName: "齐津铖", - approverOpinion: "", - approverCorpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - approverCorpinfoName: "卓云企业", - approverTime: "2025-05-13 14:38:39", - passFlag: "1", - endFlag: "0", - isdelete: "0", - foreignKey: null, - appointAnnex: null, - appointAnnexName: null, - }, - { - flowDetailId: "1ef915958e5e4eba872c55588524b168", - flowId: "fd58bf5ad97847419f8de769639947f5", - stepFlag: "1", - stepName: null, - sort: 2, - parentId: "b6e4612892b14a73b8aa4324c69c85d3", - approverId: "94407a4e15ec46b5974b128e124fa661", - approverName: "齐津铖", - approverOpinion: "", - approverCorpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - approverCorpinfoName: "卓云企业", - approverTime: "2025-05-13 14:39:43", - passFlag: "1", - endFlag: "1", - isdelete: "0", - foreignKey: null, - appointAnnex: null, - appointAnnexName: null, - }, - ], - }, - ], - lastFlow: { - flowsId: "5d8dcfbcd27741c79efaa6ca31941b9e", - foreignKeyId: "5d8dcfbcd27741c79efaa6ca31941b9e", - foreignKeyName: "sys_user=>user_id", - flowsStep: 1, - flowsType: "0", - isDelete: "0", - appointZeroCorpId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - appointZeroCorpType: null, - appointZeroCorpName: "卓云企业", - appointZeroDepartmentId: "16579f1de79743198884a56350c113cc", - appointZeroDepartmentName: "分公司级测试部门", - appointZeroUserId: "94407a4e15ec46b5974b128e124fa661", - appointZeroUserName: "齐津铖", - appointZeroStatus: "1", - appointZeroOpinion: "", - appointZeroTime: "2025-05-13 14:38:39", - appointOneCorpId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c", - appointOneCorpName: "卓云企业", - appointOneCorpType: "0", - appointOneDepartmentId: "16579f1de79743198884a56350c113cc", - appointOneDepartmentName: "", - appointOneUserId: "94407a4e15ec46b5974b128e124fa661", - appointOneUserName: "齐津铖", - appointOneStatus: "1", - appointOneOpinion: "", - appointOneTime: "2025-05-13 14:39:42", - appointTwoCorpId: null, - appointTwoCorpName: null, - appointTwoCorpType: null, - appointTwoDepartmentId: null, - appointTwoDepartmentName: null, - appointTwoUserId: null, - appointTwoUserName: null, - appointTwoStatus: null, - appointTwoOpinion: null, - appointTwoTime: null, - appointThreeCorpId: null, - appointThreeCorpName: null, - appointThreeCorpType: null, - appointThreeDepartmentId: null, - appointThreeDepartmentName: null, - appointThreeUserId: null, - appointThreeUserName: null, - appointThreeStatus: null, - appointThreeOpinion: null, - appointThreeTime: null, - appointFourCorpId: null, - appointFourCorpName: null, - appointFourCorpType: null, - appointFourDepartmentId: null, - appointFourDepartmentName: null, - appointFourUserId: null, - appointFourUserName: null, - appointFourStatus: null, - appointFourOpinion: null, - appointFiveCorpId: null, - appointFiveCorpName: null, - appointFiveCorpType: null, - appointFiveDepartmentId: null, - appointFiveDepartmentName: null, - appointFiveUserId: null, - appointFiveUserName: null, - appointFiveStatus: null, - appointFiveOpinion: null, - appointSixCorpId: null, - appointSixCorpName: null, - appointSixCorpType: null, - appointSixDepartmentId: null, - appointSixDepartmentName: null, - appointSixUserId: null, - appointSixUserName: null, - appointSixStatus: null, - appointSixOpinion: null, - appointSevenCorpId: null, - appointSevenCorpName: null, - appointSevenCorpType: null, - appointSevenDepartmentId: null, - appointSevenDepartmentName: null, - appointSevenUserId: null, - appointSevenUserName: null, - appointSevenStatus: null, - appointSevenOpinion: null, - sendType: "1", - checkStatus: "2", - checkStatusName: "审核结束", - }, - powerFlag: null, - entrustFlag: null, - lastStepFlag: null, - checkStep: null, - flowsStep: null, - flowsType: null, - attorney: null, - appointZeroUserId: null, - appointZeroCorpName: "卓云企业", - appointZeroTime: null, - appointOneUserId: null, - appointOneCorpName: "卓云企业", - appointOneTime: null, - appointTwoUserId: null, - appointTwoCorpName: null, - appointTwoTime: null, - appointThreeUserId: null, - appointThreeCorpName: null, - appointThreeTime: null, - appointFourUserId: null, - appointFourCorpName: null, - appointFiveUserId: null, - appointFiveCorpName: null, - appointSixUserId: null, - appointSixCorpName: null, - appointSevenUserId: null, - appointSevenCorpName: null, - appointTime: "2025-05-13 14:39:42", - cardId: null, - belongToCorp: "dd5ab430a9f442a0be64c61a9645b904", - belongToCorpName: "测试相关方", - degreeOfEducation: null, - isSocial: null, - isInjuriesPay: null, - ispay: null, - isBf: null, - age: null, - unValidFlag: "1", - unValidInfo: "合格证有效期", - checkStatus: null, - classStatus: null, - }); - - return ( - <> - -
- 人员信息 - 0 ? : "暂无信息" }, - { label: "身份证照片", children: info.userImg?.length > 0 ? : "暂无信息" }, - { label: "社保卡照片", children: info.userImg?.length > 0 ? : "暂无信息" }, - { label: "工伤保险凭证", span: 3, children: info.userImg?.length > 0 ? : "暂无信息" }, - { label: "姓名", children: info.name }, - { label: "性别", children: getLabelName({ status: info.sex, list: SEX_ENUM }) }, - { label: "出生年月", children: info.dateOfBirth }, - { label: "年龄", children: info.age }, - { label: "手机号", children: info.phone }, - { label: "身份证", children: info.cardId }, - { label: "民族", children: info.nationalityName || "暂无信息" }, - { label: "婚姻状况", children: getLabelName({ status: info.maritalstatus, list: MARITAL_STATUS_ENUM }) }, - { label: "政治面貌", children: info.politicalStatusName }, - ...(info.politicalStatusName === "中共党员" ? [{ label: "入党时间", children: info.politicalTime }] : []), - { label: "户口所在地", children: info.hklocal || "暂无信息" }, - { label: "现住址", children: info.address || "暂无信息" }, - { label: "文化程度", children: info.degreeOfEducationName }, - { label: "岗位名称(工种)", children: info.postId }, - { label: "是否缴纳社保", children: getLabelName({ status: info.isSocial, list: WHETHER_ENUM }) }, - ...(info.isSocial === "1" - ? [ - { label: "社会保障号码", children: info.socialNumber }, - { label: "社保卡照片", children: info.socSecurity?.length > 0 ? : "暂无信息" }, - ] - : []), - { label: "是否按期缴纳工伤保险", children: getLabelName({ status: info.isInjuriesPay, list: WHETHER_ENUM }) }, - ...(info.isInjuriesPay === "1" - ? [ - { label: "工伤保险有效期", children: info.isInjuriesPayTime }, - { label: "工伤保险凭证", children: info.empInsurance?.length > 0 ? : "暂无信息" }, - ] - : []), - { label: "是否缴纳商业保险", children: getLabelName({ status: info.ispay, list: WHETHER_ENUM }) }, - ...(info.ispay === "1" - ? [ - { label: "商业保险单号", children: info.ispayNumber }, - { label: "商业保险附件", children: info.insurance?.length > 0 ? : "暂无信息" }, - ] - : []), - { label: "是否签订劳动合同", children: getLabelName({ status: info.isSignLabor, list: WHETHER_ENUM }) }, - ...(info.isSignLabor === "1" - ? [ - { label: "劳动合同附件", children: info.contract?.length > 0 ? : "暂无信息" }, - ] - : []), - { label: "是否参加三级安全培训", children: getLabelName({ status: info.isLevelThree, list: WHETHER_ENUM }) }, - ...(info.isLevelThree === "1" - ? [ - { label: "三级安全培训照片", children: info.threeLevel?.length > 0 ? : "暂无信息" }, - ] - : []), - { label: "是否缴纳保险", children: getLabelName({ status: info.isBf, list: WHETHER_ENUM }) }, - { label: "是否特殊工种", children: getLabelName({ status: info.isSpecialJob, list: WHETHER_ENUM }) }, - { label: "是否流动人员", children: getLabelName({ status: info.isflow, list: WHETHER_ENUM }) }, - ]} - /> - 培训记录 -
- 特证信息 -
() }, - { title: "作业类别", dataIndex: "specialTypeName" }, - { title: "操作项目", dataIndex: "operationTypeName" }, - { title: "证书名称", dataIndex: "certificate" }, - { title: "发证机关", dataIndex: "issuingAuthority" }, - { title: "证书类型", dataIndex: "cerTypeName" }, - { title: "有效期", dataIndex: "time" }, - ]} - pagination={false} - dataSource={info.special} - disabledResizer={true} - /> - - - - ); -} - -export default UserView; diff --git a/src/pages/Container/Supervision/StakeholderUnit/User/View/index.js b/src/pages/Container/Supervision/StakeholderUnit/User/View/index.js index 33ec52a..5b83dce 100644 --- a/src/pages/Container/Supervision/StakeholderUnit/User/View/index.js +++ b/src/pages/Container/Supervision/StakeholderUnit/User/View/index.js @@ -528,7 +528,7 @@ function View(props) { labelStyle={{ width: 200 }} items={[ // { label: "照片", children: info.userImg?.length > 0 ? : "暂无信息"}, - { label: "企业名称", children: info.corpName }, + { label: "企业名称", children: info.corpName && info.corpName }, { label: "企业状态", children: info.xgfState, span: 5 }, { label: "股份被监督部门", children: info.managerDepIds }, diff --git a/src/pages/Container/Supervision/Supervision/Department/index.js b/src/pages/Container/Supervision/Supervision/Department/index.js index bec7a08..50a7a69 100644 --- a/src/pages/Container/Supervision/Supervision/Department/index.js +++ b/src/pages/Container/Supervision/Supervision/Department/index.js @@ -1,25 +1,46 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Form, message, Modal, Space, Tag } from "antd"; import { useEffect, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import AddIcon from "zy-react-library/components/Icon/AddIcon"; -import BackIcon from "zy-react-library/components/Icon/BackIcon"; import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; +import { getLabelName } from "zy-react-library/utils"; +import { NS_DEPARTMENT } from "~/enumerate/namespace"; -function Department() { +function Department(props) { const [addModalOpen, setAddModalOpen] = useState(false); const [currentId, setCurrentId] = useState(""); + const [selectedNodeId, setSelectedNodeId] = useState(null); + const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => { - }, { form }); + const { tableProps, getData } = useTable(props["departmentList"], { + form, + transform: (formData) => { + return { + ...formData, + eqParentId: selectedNodeId, + }; + }, + }); + + const onTreeChange = (selectedKeys) => { + const key = selectedKeys[0] || null; + + setSelectedNodeId(key); + getData(); + }; + const onDelete = (id) => { Modal.confirm({ title: "提示", content: "确定删除吗?", onOk: () => { + props["departmentRemove"]({ id }); + message.success("删除成功"); getData(); }, @@ -28,22 +49,29 @@ function Department() { return (
- +
( <> - + )} columns={[ @@ -70,6 +98,8 @@ function Department() { onClick={() => { setAddModalOpen(true); setCurrentId(record.id); + + setSelectedNodeId(record.parentId); }} > 修改 @@ -85,7 +115,12 @@ function Department() { { setAddModalOpen(false); setCurrentId(""); @@ -98,9 +133,13 @@ function Department() { function AddModalComponent(props) { const [form] = Form.useForm(); + const [parentName, setParentName] = useState(null); useEffect(() => { if (props.currentId) { - console.log(props.currentId); + props.requestDetails({ id: props.currentId }).then((res) => { + form.setFieldsValue(res.data); + setParentName(res.data.parentName); + }); } }, [props.currentId]); const onCancel = () => { @@ -108,21 +147,34 @@ function AddModalComponent(props) { props.onCancel(); }; const onSubmit = async (values) => { - console.log(values); - onCancel(); - props.getData(); + values.levelName = getLabelName({ status: values.level, list: [{ bianma: "1", name: "一级部门" }] }); + values.parentId = props.parentId; + if (props.currentId) { + values.id = props.currentId; + props.requestEdit(values).then(() => { + onCancel(); + props.getData(); + }); + } + else { + await props.requestAdd(values).then(() => { + onCancel(); + props.getData(); + }); + } }; return ( (111) }, - { name: "department", label: "部门名称" }, - { name: "level", label: "部门级别", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ id: "1", name: "一级部门" }] }, - { name: "sort", label: "部门排序", render: FORM_ITEM_RENDER_ENUM.NUMBER }, + { name: "parentName", required: false, label: "上级部门", render: {parentName} }, + { name: "name", label: "部门名称" }, + { name: "level", label: "部门级别", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ bianma: "1", name: "一级部门" }] }, + { name: "depOrder", label: "部门排序", render: FORM_ITEM_RENDER_ENUM.NUMBER }, { - name: "regDepartment", + name: "securityFlag", label: "是否安全管理部门", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, - items: [{ id: "1", name: "是" }, { id: "2", name: "否" }], + items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }], }, - { name: "bz", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, + { name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, ]} /> @@ -149,4 +201,4 @@ function AddModalComponent(props) { } const AddModal = AddModalComponent; -export default Department; +export default Connect([NS_DEPARTMENT], true)(Department); diff --git a/src/pages/Container/Supervision/Supervision/Post/index.js b/src/pages/Container/Supervision/Supervision/Post/index.js index d93af30..c5f48ee 100644 --- a/src/pages/Container/Supervision/Supervision/Post/index.js +++ b/src/pages/Container/Supervision/Supervision/Post/index.js @@ -1,42 +1,55 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Form, message, Modal, Space, Tag } from "antd"; import { useEffect, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import AddIcon from "zy-react-library/components/Icon/AddIcon"; -import BackIcon from "zy-react-library/components/Icon/BackIcon"; import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; -import Search from "zy-react-library/components/Search"; +import SelectTree from "zy-react-library/components/SelectTree/Department/Gwj"; import Table from "zy-react-library/components/Table"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; +import { NS_POST } from "~/enumerate/namespace"; -function Post() { +function Post(props) { const [addModalOpen, setAddModalOpen] = useState(false); const [currentId, setCurrentId] = useState(""); + const [selectedNodeId, setSelectedNodeId] = useState("0"); + const [selectedNodeName, setSelectedNodeName] = useState(""); const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => { - }, { form }); + const { tableProps, getData } = useTable(props["postList"], { + form, + transform: (formData) => { + return { + ...formData, + departmentIdString: selectedNodeId, + corpFlag: 1, + }; + }, + }); const onDelete = (id) => { Modal.confirm({ title: "提示", content: "确定删除吗?", onOk: () => { + props["postRemove"]({ id }); + message.success("删除成功"); getData(); }, }); }; + const onTreeChange = (selectedKeys, event) => { + const key = selectedKeys[0] || null; + setSelectedNodeName(event.node.name); + console.log(selectedKeys); + setSelectedNodeId(key); + getData(); + }; return (
- +
-
( <> @@ -49,12 +62,11 @@ function Post() { > 新增 - )} columns={[ - { title: "所属部门", dataIndex: "name" }, - { title: "岗位名称", dataIndex: "name" }, + { title: "所属部门", required: false, dataIndex: "departmentName" }, + { title: "岗位名称", dataIndex: "postName" }, { title: "操作", width: 200, @@ -81,6 +93,12 @@ function Post() { { setAddModalOpen(false); setCurrentId(""); @@ -93,31 +111,58 @@ function Post() { function AddModalComponent(props) { const [form] = Form.useForm(); + const [parentName, setParentName] = useState(null); useEffect(() => { if (props.currentId) { - console.log(props.currentId); + props.requestDetails({ id: props.currentId }).then((res) => { + const arr = []; + res.data.departmentList && res.data.departmentList.forEach((item) => { + arr.push(item.departmentId); + }); + res.data.departmentIdsString = arr; + form.setFieldsValue(res.data); + console.log(res.data); + setParentName(res.data.departmentName); + }); } - }, [props.currentId]); + else { + setParentName(props.selectedNodeName); + } + }, [props.currentId, props.selectedNodeName]); + const onCancel = () => { form.resetFields(); props.onCancel(); }; const onSubmit = async (values) => { - console.log(values); - onCancel(); - props.getData(); + values.departmentIdString = props.parentId; + values.corpFlag = 1; + if (props.currentId) { + values.idString = props.currentId; + props.requestEdit(values).then(() => { + onCancel(); + props.getData(); + }); + } + else { + props.requestAdd(values).then(() => { + onCancel(); + props.getData(); + }); + } }; return ( (111) }, - { name: "department", label: "岗位名称" }, + { name: "parentName", required: false, label: "所属部门", render: {parentName } }, + { name: "postName", label: "岗位名称" }, { - name: "regPost", + name: "supervisionFlag", label: "是否监管岗位", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, - items: [{ id: "1", name: "是" }, { id: "2", name: "否" }], + items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }], }, - { name: "permission", label: "数据权限", required: false, dependencies: ["regPost"], hidden: formValues => !(formValues.regPost === "1") }, - { name: "bz", label: "岗位职责", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, + { name: "departmentIdsString", label: "数据权限", required: false, render: , dependencies: ["supervisionFlag"], hidden: formValues => (formValues.supervisionFlag === 0) }, + { name: "remarks", label: "岗位职责", render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, ]} /> @@ -143,4 +188,5 @@ function AddModalComponent(props) { } const AddModal = AddModalComponent; -export default Post; + +export default Connect([NS_POST], true)(Post); diff --git a/src/pages/Container/Supervision/Supervision/User/Add/index.js b/src/pages/Container/Supervision/Supervision/User/Add/index.js index 6ab8be8..a2507a2 100644 --- a/src/pages/Container/Supervision/Supervision/User/Add/index.js +++ b/src/pages/Container/Supervision/Supervision/User/Add/index.js @@ -1,55 +1,139 @@ -import { tools } from "@cqsjjb/jjb-common-lib"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Form, message } from "antd"; +import { useEffect, useState } from "react"; import FormBuilder from "zy-react-library/components/FormBuilder"; import HeaderBack from "zy-react-library/components/HeaderBack"; import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj"; import Upload from "zy-react-library/components/Upload"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import nation from "zy-react-library/json/nation.json"; import { ID_NUMBER, PHONE } from "zy-react-library/regular"; +import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils"; +import { NS_USER } from "~/enumerate/namespace"; -const { query } = tools.router; const WHETHER_ENUM = [ - { id: "1", name: "是" }, - { id: "0", name: "否" }, + { bianma: 1, name: "是" }, + { bianma: 0, name: "否" }, +]; +const SEX = [ + { bianma: 1, name: "男" }, + { bianma: 2, name: "女" }, ]; -function Add() { - const onSubmit = (values) => { - console.log(values); +function Add(props) { + const [form] = Form.useForm(); + const [postData, setPostData] = useState([]); + const [rolesData, setRolesData] = useState([]); + const [rankData, getRankData] = useState([]); + const [userTypeData, setUserTypeData] = useState([]); + const [userID, setUserID] = useState(null); + const queryParams = useGetUrlQuery(); + + useEffect(() => { + if (queryParams["id"]) { + const fetchData = async () => { + const res = await props["userDetails"]({ id: queryParams["id"] }); + console.log(res.data); + setUserID(res.data.userId); + form.setFieldsValue(res.data); + }; + fetchData(); + } + props["rolesAll"]().then((res) => { + setRolesData(res.data); + }); + + // 部门级别 + props["dictData"]({ appKey: "0bb989ecada5470c87635018ece9f327", dictValue: "departmentLevel" }).then((res) => { + console.log(res); + getRankData(res.data); + }); + // 人员类型 + props["dictData"]({ appKey: "0bb989ecada5470c87635018ece9f327", dictValue: "renyuanleixing" }).then((res) => { + console.log(res); + setUserTypeData(res.data); + }); + }, []); + + const onSubmit = async (values) => { + values.nationName = getLabelName({ status: values.nation, list: nation }); + values.personnelTypeName = getLabelName({ status: values.personnelType, list: userTypeData, idKey: "dictValue", nameKey: "labelKey" }); + values.rank_level_name = getLabelName({ status: values.rank_level, list: rankData, idKey: "dictValue", nameKey: "labelKey" }); + idCardGetDateAndGender(values.userIdCard); + + console.log(idCardGetDateAndGender(values.userIdCard)); + values.mainCorpFlag = 0; + values.userType = 1; + if (queryParams["id"]) { + values.id = queryParams["id"]; + values.userId = userID; + props["userEdit"](values).then((res) => { + if (res.success) { + window.history.back(); + message.success("编辑成功!"); + } + }); + } + else { + props["userAdd"](values).then((res) => { + if (res.success) { + window.history.back(); + message.success("新增成功!"); + } + }); + } }; + + const fnChoiceDepartment = async (event) => { + console.log(event); + form.setFieldsValue({ postId: undefined }); + // setDepartmentName(event[0].name) + props["postAll"]({ corpFlag: 1, departmentIdString: event[0].id }).then((res) => { + console.log(res); + setPostData(res.data); + }); + }; + return ( <> - +
}, { name: "postId", label: "所属岗位", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], + items: postData, + itemsField: { labelKey: "postName", valueKey: "id" }, }, - { name: "username", label: "用户名", tip: "* 如果修改手机号,登录密码则会变成初始密码“Aa@123456789”" }, + { name: "username", label: "用户名" }, { name: "name", label: "姓名" }, { name: "phone", label: "手机号", rules: [{ pattern: PHONE, message: "请输入正确的手机号" }] }, { - name: "personType", + name: "personnelType", label: "人员类型", render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], + items: userTypeData, + itemsField: { labelKey: "dictLabel", valueKey: "dictValue" }, }, { name: "userIdCard", label: "身份证号", required: false, + rules: [{ pattern: ID_NUMBER, message: "请输入正确的身份证号" }], }, { @@ -57,25 +141,27 @@ function Add() { label: "民族", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], + items: nation, }, { name: "sex", label: "性别", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, - items: [{ name: "一级部门", id: "1" }], + componentProps: { disabled: true }, + dependencies: ["userIdCard"], + // shouldUpdate:{(prevValues, curValues)=>{}} + items: SEX, }, { name: "faceFile", label: "上传人脸照片", required: false, span: 24, - render: ({ value, onChange }) => ( + render: (
* 图像格式:JPG、JPEG、PNG
@@ -89,16 +175,14 @@ function Add() { ), }, { name: "sort", label: "部门排序", render: FORM_ITEM_RENDER_ENUM.NUMBER }, - { name: "level", label: "部门级别", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "一级部门", id: "1" }] }, + { name: "rank_level", label: "人员职级", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: rankData, itemsField: { labelKey: "dictLabel", valueKey: "dictValue" } }, { name: "email", label: "邮箱", required: false, rules: [{ type: "email", message: "请输入正确的邮箱" }] }, - { name: "isHeadOfDepartment", label: "是否为部门负责人", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM }, - { name: "isDeputyInCharge", label: "是否为分管领导", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM }, - { name: "bz", label: "备注", span: 24, required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, + { name: "remarks", label: "备注", span: 24, required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA }, + { name: "departmentLeaderFlag", label: "是否为部门负责人", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM }, ]} />
); } - -export default Add; +export default Connect([NS_USER], true)(Add); diff --git a/src/pages/Container/Supervision/Supervision/User/List/index.js b/src/pages/Container/Supervision/Supervision/User/List/index.js index 07e99a6..ad1cf25 100644 --- a/src/pages/Container/Supervision/Supervision/User/List/index.js +++ b/src/pages/Container/Supervision/Supervision/User/List/index.js @@ -1,23 +1,59 @@ -import { Button, Form, message, Modal, Space } from "antd"; -import { useState } from "react"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Descriptions, Form, message, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; import AddIcon from "zy-react-library/components/Icon/AddIcon"; +import DeleteIcon from "zy-react-library/components/Icon/DeleteIcon"; import ExportIcon from "zy-react-library/components/Icon/ExportIcon"; import ImportIcon from "zy-react-library/components/Icon/ImportIcon"; import ImportFile from "zy-react-library/components/ImportFile"; import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; import Search from "zy-react-library/components/Search"; import Table from "zy-react-library/components/Table"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useTable from "zy-react-library/hooks/useTable"; +import { NS_USER } from "~/enumerate/namespace"; function List(props) { const [importOpen, setImportOpen] = useState(false); + const [selectedNodeId, setSelectedNodeId] = useState(); + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); + const [selectedRowKeys, setSelectedRowKeys] = useState([]); + const [postData, setPostData] = useState([]); const [form] = Form.useForm(); - const { tableProps, getData } = useTable(() => {}, { form }); + const { tableProps, getData } = useTable(props["userList"], { + form, + transform: (formData) => { + return { + ...formData, + eqDepartmentId: selectedNodeId, + }; + }, + }); + + useEffect(() => { + const fetchPostData = async () => { + const deptId = selectedNodeId ?? "0"; + try { + const res = await props["postAll"]({ corpFlag: 1, departmentIdString: deptId }); + setPostData(res?.data || []); + } + catch (err) { + message.error("岗位数据加载失败"); + setPostData([]); + } + }; + + fetchPostData(); + }, [selectedNodeId]); + const onDelete = (id) => { Modal.confirm({ title: "提示", content: "确定删除吗?", onOk: () => { + props["userRemove"]({ id }); + message.success("删除成功"); getData(); }, @@ -41,26 +77,42 @@ function List(props) { }, }); }; - const onUnlock = (id) => { - message.success("解锁成功"); - }; + const onImportFileConfirm = (values) => { console.log(values); message.success("导入成功"); }; + const onTreeChange = (selectedKeys) => { + const key = selectedKeys[0] || null; + setSelectedNodeId(key); + getData(); + }; return (
- +
setSelectedRowKeys(selectedRowKeys), + }} toolBarRender={() => ( <> + - + ), @@ -119,8 +200,78 @@ function List(props) { onConfirm={onImportFileConfirm} onCancel={() => { setImportOpen(false); }} /> + { + setAddModalOpen(false); + setCurrentId(""); + }} + getData={getData} + /> ); +}; + +function AddModalComponent(props) { + const [form] = Form.useForm(); + const [info, setInfo] = useState({}); + useEffect(() => { + if (props.currentId) { + const fetchData = async () => { + const res = await props.requestDetails({ id: props.currentId }); + console.log(res.data); + setInfo(res.data); + }; + fetchData(); + console.log(info); + } + }, [props.currentId]); + + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + + return ( + + +
+ {info.departmentLeaderFlag === 1 ? "是" : "否"} }, + { label: "所属岗位", children: info.postName }, + { label: "用户名", children: info.username }, + { label: "姓名", children: info.name }, + { label: "手机号", children: info.phone }, + { label: "人员类型", children: info.personnelTypeName }, + { label: "身份证号", children: info.userIdCard }, + { label: "民族", children: info.nationName }, + { label: "性别", children: info.sex }, + + { label: "人脸照片", children: info.nationName }, + { label: "部门排序", children: info.sort }, + { label: "邮箱", children: info.email }, + { label: "备注", children: info.remarks }, + ]} + /> +
+
+ ); } -export default List; +const AddModal = AddModalComponent; +export default Connect([NS_USER], true)(List);