From 97e6788347d8c2871ae55bd6b6292aa2744fa59e Mon Sep 17 00:00:00 2001 From: "853931625@qq.com" Date: Sat, 6 Dec 2025 15:25:49 +0800 Subject: [PATCH] no message --- jjb.config.js | 8 +- package.json | 2 +- src/api/enterprise/index.js | 6 + src/api/user/index.js | 17 + .../Enterprise/CorpInfo/Info/index.js | 184 ++++++- .../Enterprise/CorpInfo/Update/index.js | 11 +- .../ChangeList/index.js | 111 ++++ .../ChangeView/index.js | 190 +++++++ .../EnterpriseMiddleground/List/index.js | 300 +++++++++++ .../EnterpriseMiddleground/index.js | 4 + .../Enterprise/OrganizationStructure/index.js | 5 +- .../AccountManage/List/index.js | 489 ++++++++++++++++++ .../AccountManage/View/index.js | 350 +++++++++++++ .../StakeholderUnit/AccountManage/index.js | 4 + .../StakeholderUnit/User/List/index.js | 174 +++++++ .../StakeholderUnit/User/UserList/index.js | 413 +++++++++++++++ .../Enterprise/StakeholderUnit/User/index.js | 4 + .../Enterprise/StakeholderUnit/index.js | 4 + .../Container/Enterprise/User/List/index.js | 90 ++-- .../Container/Stakeholder/CorpInfo/index.js | 58 ++- .../Container/Stakeholder/Department/index.js | 26 +- .../Container/Stakeholder/User/Add/index.js | 19 +- .../Container/Stakeholder/User/List/index.js | 242 ++++++--- .../User/ResignationReview/index.js | 156 ++++++ .../BranchCompany/AccountManage/List/index.js | 6 +- .../DepartmentManage/List/index.js | 8 +- .../DepartmentManage/View/index.js | 1 + .../EnterpriseInfo/List/index.js | 37 +- .../EnterpriseInfo/View/index.js | 162 +++++- .../SubsidiaryUser/List/index.js | 8 +- .../SubsidiaryUser/UserList/index.js | 4 +- .../ChangeList/index.js | 137 ++--- .../ChangeView/index.js | 190 +++++++ .../EnterpriseMiddleground/List/index.js | 6 +- .../EnterpriseMiddleground/UserList/index.js | 221 ++++---- .../AccountManage/List/index.js | 61 ++- .../AccountManage/View/index.js | 169 ++++-- .../StakeholderUnit/User/List/index.js | 80 ++- .../StakeholderUnit/User/UserList/index.js | 199 +++---- .../Supervision/CorpInfo/Info/index.js | 86 +++ .../Supervision/CorpInfo/Update/index.js | 200 +++++++ .../Supervision/Supervision/CorpInfo/index.js | 4 + .../Supervision/Supervision/User/Add/index.js | 6 +- .../Supervision/User/List/index.js | 60 ++- src/utils/index.js | 22 + 45 files changed, 3988 insertions(+), 546 deletions(-) create mode 100644 src/pages/Container/Enterprise/EnterpriseMiddleground/ChangeList/index.js create mode 100644 src/pages/Container/Enterprise/EnterpriseMiddleground/ChangeView/index.js create mode 100644 src/pages/Container/Enterprise/EnterpriseMiddleground/List/index.js create mode 100644 src/pages/Container/Enterprise/EnterpriseMiddleground/index.js create mode 100644 src/pages/Container/Enterprise/StakeholderUnit/AccountManage/List/index.js create mode 100644 src/pages/Container/Enterprise/StakeholderUnit/AccountManage/View/index.js create mode 100644 src/pages/Container/Enterprise/StakeholderUnit/AccountManage/index.js create mode 100644 src/pages/Container/Enterprise/StakeholderUnit/User/List/index.js create mode 100644 src/pages/Container/Enterprise/StakeholderUnit/User/UserList/index.js create mode 100644 src/pages/Container/Enterprise/StakeholderUnit/User/index.js create mode 100644 src/pages/Container/Enterprise/StakeholderUnit/index.js create mode 100644 src/pages/Container/Stakeholder/User/ResignationReview/index.js create mode 100644 src/pages/Container/Supervision/EnterpriseMiddleground/ChangeView/index.js create mode 100644 src/pages/Container/Supervision/Supervision/CorpInfo/Info/index.js create mode 100644 src/pages/Container/Supervision/Supervision/CorpInfo/Update/index.js create mode 100644 src/pages/Container/Supervision/Supervision/CorpInfo/index.js diff --git a/jjb.config.js b/jjb.config.js index 210cb5f..ff0c1ad 100644 --- a/jjb.config.js +++ b/jjb.config.js @@ -16,8 +16,8 @@ module.exports = { // 应用后端分支名称,部署上线需要 javaGitBranch: "", // 接口服务地址 - // API_HOST: "https://gbs-gateway.qhdsafety.com", - API_HOST: "http://192.168.20.100:30140", + API_HOST: "https://gbs-gateway.qhdsafety.com", + // API_HOST: "http://192.168.20.100:30140", }, }, // 应用唯一标识符 @@ -26,8 +26,8 @@ module.exports = { contextInject: { // 应用Key appKey: "", - fileUrl: "http://192.168.20.240:9787/mnt/", - // fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/", + // fileUrl: "http://192.168.20.240:9787/mnt/", + fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/", }, // public/index.html注入全局变量 windowInject: { diff --git a/package.json b/package.json index c55218a..65747e3 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "relation-graph": "^2.2.11", - "zy-react-library": "^1.0.134" + "zy-react-library": "^1.0.141" }, "devDependencies": { "@antfu/eslint-config": "^5.4.1", diff --git a/src/api/enterprise/index.js b/src/api/enterprise/index.js index 8f82024..dc9ba65 100644 --- a/src/api/enterprise/index.js +++ b/src/api/enterprise/index.js @@ -58,3 +58,9 @@ export const corpDepartlist = declareRequest( "departmentLoading", "Post > @/basicInfo/corpInfo/corpDepartlist", ); + +// 根据登录人密码查手机号 +export const getEncryInfo = declareRequest( + "departmentLoading", + "Post > @/basicInfo/corpInfo/getEncryInfo", +); diff --git a/src/api/user/index.js b/src/api/user/index.js index 9d2c67d..cb05877 100644 --- a/src/api/user/index.js +++ b/src/api/user/index.js @@ -67,3 +67,20 @@ export const getEncryInfo = declareRequest( "userLoading", "Post > @/basicInfo/user/getEncryInfo", ); + +// 离职 +export const resignation = declareRequest( + "userLoading", + "Post > @/basicInfo/user/resignation", +); +// 通过驳回 +export const reviewStatus = declareRequest( + "userLoading", + "Post > @/basicInfo/user/reviewStatus", +); + +// 用户变更详情 +export const getChangerRecordInfoById = declareRequest( + "userLoading", + "Post > @/basicInfo/userChangeRecord/getChangerRecordInfoById", +); diff --git a/src/pages/Container/Enterprise/CorpInfo/Info/index.js b/src/pages/Container/Enterprise/CorpInfo/Info/index.js index 6d34242..014ace8 100644 --- a/src/pages/Container/Enterprise/CorpInfo/Info/index.js +++ b/src/pages/Container/Enterprise/CorpInfo/Info/index.js @@ -1,42 +1,27 @@ import { Permission } from "@cqsjjb/jjb-common-decorator/permission"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; -import { Button, Descriptions, Divider } from "antd"; +import { Button, Descriptions, Divider, Form, Input, Modal } from "antd"; import { useEffect, useState } from "react"; import PreviewImg from "zy-react-library/components/PreviewImg"; import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; import useGetFile from "zy-react-library/hooks/useGetFile"; import { NS_ENTERPRISE } from "~/enumerate/namespace"; +import { getAreaNamePath, getCorpTypeNamePath } from "~/utils"; function Info(props) { const [info, setInfo] = useState({}); + const [form] = Form.useForm(); const { loading: getFileLoading, getFile } = useGetFile(); - - const getCorpTypeNamePath = (item) => { - const names = [ - item.corpTypeName, - item.corpType2Name, - item.corpType3Name, - item.corpType4Name, - ].filter(name => name != null && name !== ""); - return names.join("/"); - }; - const getAreaNamePath = (item) => { - const names = [ - item.provinceName, - item.cityName, - item.countryName, - item.streetName, - item.villageName, - - ].filter(name => name != null && name !== ""); - return names.join("/"); - }; + const [viewType, setViewType] = useState(false); + const [viewData, setViewData] = useState(false); + const [encrypted, setEncrypted] = useState(false); + const [isModalOpen, setIsModalOpen] = useState(false); useEffect(() => { const fetchData = async () => { const { data } = await props["userGetInfo"](); - console.log(data); + const res = await props.corpInfoDetails({ id: data.corpinfoId, }); @@ -45,13 +30,22 @@ function Info(props) { eqForeignKey: res.data.corpinfoId, }); res.data.licenseFile = licenseFile; - console.log(res.data.licenseFile); + setInfo(res.data); - console.log(res.data); + // 不要在这里 log info,它还是旧的 }; fetchData(); }, []); + const handleOk = async () => { + const values = await form.validateFields(); + + const { data } = await props["getEncryInfo"]({ id: info.id, password: values.password, fieldKey: viewType, maskInfo: encrypted }); + + if (data) { + setViewData(data.maskDTO.label); + } + }; return (
+ + {info.lrMobile && info.lrMobile.label} + { (info.lrMobile && info.lrMobile.label) + && ( + + )} + +
+ ), }, { label: "主要负责人", @@ -146,7 +161,29 @@ function Info(props) { }, { label: "主要负责人手机号", - children: info.contactsPhone, + children: ( +
+ + { info.contactsPhone && info.contactsPhone.label} + { (info.contactsPhone && info.contactsPhone.label) + && ( + + )} + +
+ ), + }, { label: "安全负责人", @@ -154,7 +191,28 @@ function Info(props) { }, { label: "安全负责人手机号", - children: info.safetyPhone, + children: ( +
+ + {info.safetyPhone && info.safetyPhone.label} + { (info.safetyPhone && info.safetyPhone.label) + && ( + + )} + +
+ ), }, { @@ -216,6 +274,76 @@ function Info(props) { )} + {isModalOpen + && ( + setIsModalOpen(false)} + > +
+ + + + + + +
+
+ )} ); } diff --git a/src/pages/Container/Enterprise/CorpInfo/Update/index.js b/src/pages/Container/Enterprise/CorpInfo/Update/index.js index 64e38f2..dffa731 100644 --- a/src/pages/Container/Enterprise/CorpInfo/Update/index.js +++ b/src/pages/Container/Enterprise/CorpInfo/Update/index.js @@ -75,6 +75,7 @@ function Update(props) { const { loading: getFileLoading, getFile } = useGetFile(); const [codeValue, setCodeValue] = useState(""); const [corpNameValue, setCorpNameValue] = useState(""); + const debouncedCode = useDebounce(codeValue, 600); const debouncedCorpName = useDebounce(corpNameValue, 600); useEffect(() => { @@ -82,6 +83,9 @@ function Update(props) { const { data } = await props["corpInfoDetails"]({ id: queryParams["id"], }); + data.lrMobile = data.lrMobile && data.lrMobile.label; + data.contactsPhone = data.contactsPhone && data.contactsPhone.label; + data.safetyPhone = data.safetyPhone && data.safetyPhone.label; setKeyId(data.corpinfoId); data.region = data.village || data.street || data.country || data.city || data.province; const licenseFile = await getFile({ @@ -302,6 +306,9 @@ function Update(props) { label: "社会统一信用代码", name: "code", required: false, + componentProps: { + disabled: true, + }, span: 24, rules: [ { @@ -358,9 +365,7 @@ function Update(props) { required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_STATUS, - componentProps: { - disabled: true, - }, + }, { name: "map", diff --git a/src/pages/Container/Enterprise/EnterpriseMiddleground/ChangeList/index.js b/src/pages/Container/Enterprise/EnterpriseMiddleground/ChangeList/index.js new file mode 100644 index 0000000..5986464 --- /dev/null +++ b/src/pages/Container/Enterprise/EnterpriseMiddleground/ChangeList/index.js @@ -0,0 +1,111 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, Space } from "antd"; +import HeaderBack from "zy-react-library/components/HeaderBack"; + +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 + ? "离职" + : ""} +
+ ), + }, + { + title: "操作", + width: 200, + render: (_, record) => ( + + + + + + ), + }, + ]} + {...tableProps} + /> + + + ); +} +export default Connect([NS_USER], true)(List); diff --git a/src/pages/Container/Enterprise/EnterpriseMiddleground/ChangeView/index.js b/src/pages/Container/Enterprise/EnterpriseMiddleground/ChangeView/index.js new file mode 100644 index 0000000..9652ba5 --- /dev/null +++ b/src/pages/Container/Enterprise/EnterpriseMiddleground/ChangeView/index.js @@ -0,0 +1,190 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Descriptions, Divider, message, Modal } from "antd"; +import { useEffect, useState } from "react"; +import HeaderBack from "zy-react-library/components/HeaderBack"; +import Table from "zy-react-library/components/Table"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; + +import { NS_ENTERPRISE, NS_USER } from "~/enumerate/namespace"; + +function ChangeView(props) { + const queryParams = useGetUrlQuery(); + const [info, setInfo] = useState({}); + + useEffect(() => { + props["getChangerRecordInfoById"]({ corpinfoId: queryParams["corpinfoId"], userId: queryParams["id"] }).then((res) => { + console.log(res); + setInfo(res.data); + }); + }, []); + + const onSubmit = async () => { + Modal.confirm({ + title: "提示", + content: "确认后,该名员工的信息将处于离职状态,涉及的待完成相关工作,可能会受到异常。", + onOk: () => { + props["reviewStatus"]({ + corpinfoId: queryParams["corpinfoId"], + employmentFlag: queryParams["employmentFlag"], + reviewStatus: 2, + userId: queryParams["id"], + }).then((res) => { + if (res.success) { + message.success("审核成功"); + window.history.back(); + } + }); + }, + }); + }; + const handleReject = () => { + Modal.confirm({ + title: "提示", + content: "确定驳回吗?", + onOk: () => { + props["reviewStatus"]({ + corpinfoId: queryParams["corpinfoId"], + employmentFlag: queryParams["employmentFlag"], + reviewStatus: 3, + userId: queryParams["id"], + }).then((res) => { + if (res.success) { + message.success("驳回成功"); + window.history.back(); + } + }); + }, + }); + }; + + const onGoBack = () => { + window.history.back(); + }; + + return ( +
+ +
+ 变更前信息 + + 变更后信息 + + {queryParams["type"] === "disposal" ? "未完成工作" : "工作交接"} +
+ + + { + queryParams["type"] === "disposal" + + && ( +
+ + + + + + +
+ ) + } + + + + ); +} +export default Connect([NS_ENTERPRISE, NS_USER], true)(ChangeView); diff --git a/src/pages/Container/Enterprise/EnterpriseMiddleground/List/index.js b/src/pages/Container/Enterprise/EnterpriseMiddleground/List/index.js new file mode 100644 index 0000000..b401f8c --- /dev/null +++ b/src/pages/Container/Enterprise/EnterpriseMiddleground/List/index.js @@ -0,0 +1,300 @@ +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 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 { getLabelName } from "zy-react-library/utils"; + +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 [form] = Form.useForm(); + const { tableProps, getData } = useTable(props["userList"], { + form, + transform: (formData) => { + return { + ...formData, + eqDepartmentId: selectedNodeId, + + }; + }, + }); + 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(""); + }} + /> + + + ); +} +function AddModalComponent(props) { + const [form] = Form.useForm(); + const [info, setInfo] = useState({}); + const [rolesData, setRolesData] = useState([]); + useEffect(() => { + if (props.currentId) { + props.requwstRolesAll().then((res) => { + setRolesData(res.data); + }); + const fetchData = async () => { + const res = await props.requestDetails({ + id: props.currentId, + }); + res.data.userAvatarUrl = [ + { + filePath: res.data.userAvatarUrl, + }, + ]; + setInfo(res.data); + }; + fetchData(); + } + }, [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: , + }, + { + label: "部门排序", + children: info.sort, + }, + { + label: "邮箱", + children: info.email, + }, + { + label: "备注", + children: info.remarks, + }, + ]} + column={2} + labelStyle={{ + width: 200, + }} + /> + +
+ ); +} +const AddModal = AddModalComponent; +export default Connect([NS_USER], true)(List); diff --git a/src/pages/Container/Enterprise/EnterpriseMiddleground/index.js b/src/pages/Container/Enterprise/EnterpriseMiddleground/index.js new file mode 100644 index 0000000..8bfb5ed --- /dev/null +++ b/src/pages/Container/Enterprise/EnterpriseMiddleground/index.js @@ -0,0 +1,4 @@ +function EnterpriseMiddleground(props) { + return
{props.children}
; +} +export default EnterpriseMiddleground; diff --git a/src/pages/Container/Enterprise/OrganizationStructure/index.js b/src/pages/Container/Enterprise/OrganizationStructure/index.js index 4595406..a013717 100644 --- a/src/pages/Container/Enterprise/OrganizationStructure/index.js +++ b/src/pages/Container/Enterprise/OrganizationStructure/index.js @@ -41,7 +41,6 @@ function OrganizationStructure(props) { fetchData(); }, []); - // 核心:LeftTree 点击时提供完整路径 const onGetNodePaths = (nodes) => { if (!Array.isArray(nodes) || nodes.length === 0) return; @@ -69,7 +68,7 @@ function OrganizationStructure(props) { }); }; - // 返回上一级(仅基于 pathNodes) + // 返回上一级 const fnReturn = () => { if (pathNodes.length === 0 || (pathNodes.length === 1 && pathNodes[0].parentId === "0")) { message.warning("已是顶级部门,无法继续返回"); @@ -205,7 +204,7 @@ function OrganizationStructure(props) { onCancel={() => { setAddModalOpen(false); setCurrentId(""); - setSelectedNodeId(""); + // setSelectedNodeId(""); }} /> )} diff --git a/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/List/index.js b/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/List/index.js new file mode 100644 index 0000000..0142b41 --- /dev/null +++ b/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/List/index.js @@ -0,0 +1,489 @@ +import { Permission } from "@cqsjjb/jjb-common-decorator/permission"; +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 DictionarySelect from "zy-react-library/components/Select/Dictionary"; +import AreaSelect from "zy-react-library/components/SelectTree/Area"; +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"; +import { getAreaNamePath, useDebounce } from "~/utils"; + +const ENTERPRISE_TYPE = [ + { + bianma: 3, + name: "普通企业", + }, + { + bianma: 4, + name: "货主单位", + }, + { + bianma: 5, + name: "驻港单位", + }, +]; +function List(props) { + const [form] = Form.useForm(); + + const [cityData, setCityData] = useState([]); + const { tableProps, getData } = useTable(props["corpInfoList"], { + form, + transform: (formData) => { + return { + ...formData, + enterpriseType: 3, + geCreateTime: formData.CreateTime?.[0], + leCreateTime: formData.CreateTime?.[1], + eqProvince: formData.cityRecord?.[0], + eqCity: formData.cityRecord?.[1], + eqCountry: formData.cityRecord?.[2], + eqStreet: formData.cityRecord?.[3], + eqVillage: formData.cityRecord?.[4], + + }; + }, + }); + const [addModalOpen, setAddModalOpen] = useState(false); + const [currentId, setCurrentId] = useState(""); + const onResetPassword = (id) => { + Modal.confirm({ + title: "提示", + content: "是否重置密码为Aa12345678?", + onOk: () => { + props["corpInfoChangePassword"]({ + id, + }).then((res) => { + if (res.success) { + message.success("重置密码成功"); + getData(); + } + }); + }, + }); + }; + + const onDelete = (id) => { + Modal.confirm({ + title: "提示", + content: "确定删除吗?", + onOk: () => { + props["corpInfoRemove"]({ + id, + }).then((res) => { + if (res.success) { + message.success("删除成功"); + getData(); + } + }); + }, + }); + }; + const onFinish = async () => { + // 处理属地查询 + const arr = []; + cityData.forEach((item) => { + arr.push(item.value); + }); + form.setFieldValue("cityRecord", arr); + getData(); + }; + + const onReset = () => { + setCityData([]); + + form.setFieldValue("cityRecord", []); + }; + return ( +
+ + onFinish()} + onReset={onReset} + options={[ + { + name: "likecorpName", + label: "企业名称", + }, + { + name: "cityData", + label: "属地", + render: ( + + setCityData(nodes)} + /> + ), + }, + { + name: "CreateTime", + label: "开户时间", + render: FORM_ITEM_RENDER_ENUM.DATE_RANGE, + }, + { + name: "eqType", + label: "相关方企业类型", + render: FORM_ITEM_RENDER_ENUM.SELECT, + items: ENTERPRISE_TYPE, + }, + { + name: "cityRecord", + label: "属地", + render: FORM_ITEM_RENDER_ENUM.SELECT, + onlyForLabel: true, + }, + + ]} + + /> + +
( + <> + { + props.permission("qyd-xgf-zhgl-add") + && ( + + ) + } + + )} + columns={[ + { + title: "企业名称", + dataIndex: "corpName", + }, + { + title: "属地", + dataIndex: "cityName", + width: 300, + render: (_, record) => ( +
{getAreaNamePath(record)}
+ ), + }, + { + title: "创建单位", + dataIndex: "createName", + }, + { + title: "开户人", + dataIndex: "accountContactName", + }, + { + title: "社会统一信用代码", + dataIndex: "code", + width: 190, + }, + { + title: "开户时间", + dataIndex: "createTime", + width: 120, + }, + { + title: "相关方类型", + dataIndex: "type", + width: 120, + render: (_, record) => ( + getLabelName({ + status: record.type, + list: ENTERPRISE_TYPE, + }) + ), + + }, + { + title: "操作", + width: 300, + render: (_, record) => ( + + { + props.permission("qyd-xgf-zhgl-info") + && ( + + ) + } + { + + props.permission("qyd-xgf-zhgl-edit") + && ( + + ) + } + {props.permission("qyd-xgf-resetPassword") + && ( + + )} + {props.permission("qyd-xgf-zhgl-delete") + && ( + + )} + + ), + }, + ]} + {...tableProps} + /> + {addModalOpen && ( + { + setAddModalOpen(false); + setCurrentId(""); + }} + /> + )} + + ); +} +function AddModalComponent(props) { + const [form] = Form.useForm(); + const [codeValue, setCodeValue] = useState(""); + const [corpNameValue, setCorpNameValue] = useState(""); + const debouncedCode = useDebounce(codeValue, 600); + const debouncedCorpName = useDebounce(corpNameValue, 600); + const [selectfromData, setSelectfromData] = useState([]); + useEffect(() => { + if (props.currentId) { + props + .requestDetails({ + id: props.currentId, + }) + .then((res) => { + const arr = []; + if (res.data.selectfromList && res.data.selectfromList.length > 0) { + res.data.selectfromList.forEach((item) => { + arr.push(item.itemCode); + }); + + res.data.selectfromList = arr; + } + + form.setFieldsValue(res.data); + }); + } + }, [props.currentId]); + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + const onSubmit = async (values) => { + const arr = []; + + values.selectfromList.forEach((item) => { + selectfromData.forEach((row) => { + if (item === row.dictValue) { + arr.push({ + itemName: row.dictLabel, + itemCode: row.dictValue, + }); + } + }); + }); + values.selectfromList = arr; + + if (props.currentId) { + values.id = props.currentId; + await props.requestEdit(values); + } + else { + await props.requestAdd(values); + } + onCancel(); + props.getData(); + }; + + // 校验社会统一信用代码重复 + useEffect(() => { + if (!debouncedCode) { + form.setFields([ + { + name: "code", + errors: [], + }, + ]); + return; + } + props + .requestCorplnfoCheckCorpcode({ + code: debouncedCode, + id: props.currentId, + }) + .then((res) => { + if (!res.data) { + form.setFields([ + { + name: "code", + errors: ["该社会统一信用代码已被其他企业使用"], + }, + ]); + } + }); + }, [debouncedCode]); + + // 校验企业名称重复 + useEffect(() => { + if (!debouncedCorpName) { + form.setFields([ + { + name: "corpName", + errors: [], + }, + ]); + return; + } + props + .requestCorplnfoCheckCorpName({ + corpName: debouncedCorpName, + id: props.currentId, + }) + .then((res) => { + if (!res.data) { + form.setFields([ + { + name: "corpName", + errors: ["企业名称重复"], + }, + ]); + } + }); + }, [debouncedCorpName]); + const onValuesChange = (changed) => { + if ("code" in changed) + setCodeValue(changed.code ?? ""); + if ("corpName" in changed) + setCorpNameValue(changed.corpName ?? ""); + }; + return ( + + { + form.setFieldValue("ecoTypeName", label); + }} + /> + ), + }, + { + name: "ecoTypeName", + label: "经济类型名称", + onlyForLabel: true, + }, + { + name: "type", + label: "相关方企业类型", + render: FORM_ITEM_RENDER_ENUM.SELECT, + items: ENTERPRISE_TYPE, + }, + { + name: "selectfromList", + label: "选取形式", + + render: ( + { + setSelectfromData(data); + }} + + /> + ), + }, + ]} + labelCol={{ + span: 10, + }} + showActionButtons={false} + onFinish={onSubmit} + onValuesChange={onValuesChange} + /> + + ); +} +const AddModal = AddModalComponent; +export default Connect([NS_ENTERPRISE], true)(Permission(List)); diff --git a/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/View/index.js b/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/View/index.js new file mode 100644 index 0000000..ad9f97e --- /dev/null +++ b/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/View/index.js @@ -0,0 +1,350 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Descriptions, Divider, Form, Input, Modal, QRCode } from "antd"; +import { useEffect, useState } from "react"; +import HeaderBack from "zy-react-library/components/HeaderBack"; + +import PreviewImg from "zy-react-library/components/PreviewImg"; +import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; +import useGetFile from "zy-react-library/hooks/useGetFile"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import { getLabelName } from "zy-react-library/utils"; + +import { NS_ENTERPRISE } from "~/enumerate/namespace"; +import { getAreaNamePath, getCorpTypeNamePath } from "~/utils"; + +const ENTERPRISE_TYPE = [ + { + bianma: 3, + name: "相关方企业", + }, + { + bianma: 4, + name: "货主单位", + }, + { + bianma: 5, + name: "驻港单位", + }, +]; +function View(props) { + const [info, setInfo] = useState({}); + const [form] = Form.useForm(); + const { loading: getFileLoading, getFile } = useGetFile(); + const [corpInfoQrCodeOpen, setCorpInfoQrCodeOpen] = useState(false); + const [viewType, setViewType] = useState(false); + const [viewData, setViewData] = useState(false); + const [encrypted, setEncrypted] = useState(false); + const [isModalOpen, setIsModalOpen] = useState(false); + const queryParams = useGetUrlQuery(); + + useEffect(() => { + const fetchData = async () => { + const res = await props.corpInfoDetails({ + id: queryParams["id"], + }); + const arr = []; + + res.data.selectfromList && res.data.selectfromList.forEach((item) => { + arr.push(item.itemName); + }); + if (arr.length > 0) { + res.data.selectfromList = arr.join(","); + } + + const licenseFile = await getFile({ + eqType: UPLOAD_FILE_TYPE_ENUM["6"], + eqForeignKey: res.data.corpinfoId, + }); + res.data.licenseFile = licenseFile; + + setInfo(res.data); + // 不要在这里 log info,它还是旧的 + }; + fetchData(); + }, []); + + const handleOk = async () => { + const values = await form.validateFields(); + + const { data } = await props["getEncryInfo"]({ id: info.id, password: values.password, fieldKey: viewType, maskInfo: encrypted }); + + if (data) { + setViewData(data.maskDTO.label); + } + }; + return ( +
+ +
+ 基本信息 + {getAreaNamePath(info)}
, + }, + + { + label: "所属行业", + children:
{getCorpTypeNamePath(info)}
, + }, + + { + label: "经济类型", + children: info.ecoTypeName, + }, + { + label: "经度/纬度", + children: info.longitude && `${info.longitude}/${info.latitude}`, + }, + + { + label: "单位经营地址", + children: info.addressBusiness, + }, + { + label: "企业规模", + children: info.scaleName, + }, + + { + label: "法定代表人", + children: info.lrName, + }, + { + label: "法人手机号", + children: ( +
+ + {info.lrMobile && info.lrMobile.label} + { (info.lrMobile && info.lrMobile.label) + && ( + + )} + +
+ ), + }, + { + label: "主要负责人", + children: info.contacts, + }, + { + label: "主要负责人手机号", + children: ( +
+ + { info.contactsPhone && info.contactsPhone.label} + { (info.contactsPhone && info.contactsPhone.label) + && ( + + )} + +
+ ), + }, + { + label: "成立日期", + children: info.createDate, + }, + { + label: "职工人数", + children: info.employees, + }, + // { + // label: "占地面积(㎡)", + // children: info.areaCovered, + // }, + + { + label: "注册资金(万元)", + children: info.regcapital, + }, + { + label: "资产总额(万元)", + children: info.totalAssets, + }, + + { + label: "企业二维码", + children: ( + + ), + }, + { + label: "相关方类型", + children: getLabelName({ + status: info.type, + list: ENTERPRISE_TYPE, + }), + }, + { + label: "创建单位", + children: info.createName, + }, + { + label: "选取形式", + children: info.selectfromList, + }, + ]} + column={2} + loading={getFileLoading} + labelStyle={{ + width: 200, + }} + /> + 营业执照 + , + }, + { + label: "营业执照有效期", + children: info.licenseStart ? ` ${info.licenseStart} 至 ${info.licenseEnd}` : "", + }, + ]} + column={2} + labelStyle={{ + width: 200, + }} + contentStyle={{ width: "40%" }} + /> +
+ {corpInfoQrCodeOpen && ( + setCorpInfoQrCodeOpen(false)} + /> + )} + {isModalOpen + && ( + setIsModalOpen(false)} + > +
+ + + + + + + +
+ )} + + ); +} +const CorpInfoQrCode = (props) => { + return ( + + 关闭 + , + ]} + onCancel={props.onCancel} + > + + + ); +}; +export default Connect([NS_ENTERPRISE], true)(View); diff --git a/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/index.js b/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/index.js new file mode 100644 index 0000000..7f93f24 --- /dev/null +++ b/src/pages/Container/Enterprise/StakeholderUnit/AccountManage/index.js @@ -0,0 +1,4 @@ +function AccountManage(props) { + return
{props.children}
; +} +export default AccountManage; diff --git a/src/pages/Container/Enterprise/StakeholderUnit/User/List/index.js b/src/pages/Container/Enterprise/StakeholderUnit/User/List/index.js new file mode 100644 index 0000000..c16b604 --- /dev/null +++ b/src/pages/Container/Enterprise/StakeholderUnit/User/List/index.js @@ -0,0 +1,174 @@ +import { Permission } from "@cqsjjb/jjb-common-decorator/permission"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Form, Space } from "antd"; + +import { useState } from "react"; +import Search from "zy-react-library/components/Search"; +import AreaSelect from "zy-react-library/components/SelectTree/Area"; +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"; +import { getAreaNamePath } from "~/utils"; + +// import { getLabelName } from "zy-react-library/utils"; + +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 [cityData, setCityData] = useState([]); + const { tableProps, getData } = useTable(props["corpUserMiddlePage"], { + form, + transform: (formData) => { + return { + ...formData, + enterpriseType: 3, + eqProvince: formData.cityRecord?.[0], + eqCity: formData.cityRecord?.[1], + eqCountry: formData.cityRecord?.[2], + eqStreet: formData.cityRecord?.[3], + eqVillage: formData.cityRecord?.[4], + }; + }, + }); + const onFinish = async () => { + // 处理属地查询 + console.log(cityData); + const arr = []; + cityData.forEach((item) => { + arr.push(item.value); + }); + console.log(arr); + form.setFieldValue("cityRecord", arr); + getData(); + }; + + const onReset = () => { + setCityData([]); + + form.setFieldValue("cityRecord", []); + }; + return ( +
+ onFinish()} + onReset={onReset} + options={[ + { + name: "likeCorpName", + label: "企业名称", + }, + { + name: "cityData", + label: "属地", + render: ( + + setCityData(nodes)} + /> + ), + }, + { name: "eqType", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE }, + { + name: "cityRecord", + label: "属地", + render: FORM_ITEM_RENDER_ENUM.SELECT, + onlyForLabel: true, + }, + ]} + /> +
( + getLabelName({ + status: record.type, + list: ENTERPRISE_TYPE, + }) + ), + width: 120, + }, + { + title: "属地", + dataIndex: "cityName", + render: (_, record) => ( +
{getAreaNamePath(record)}
+ ), + }, + { + title: "创建单位", + dataIndex: "tenantName", + }, + { + title: "企业人数", + dataIndex: "userCount", + width: 120, + render: (_, record) => ( +
{record.userCount ? record.userCount : "0"}
+ ), + }, + { + title: "安全人员信息数", + dataIndex: "safetyUserCount", + width: 140, + }, + { + title: "特种作业人数", + dataIndex: "specialUserCount", + width: 120, + }, + // { title: "公司状态", dataIndex: "corpStateName" }, + + // { title: "启用状态", dataIndex: "useFlag", render: (_, record) => ( + // {record.useFlag === 1 ? "停用" : record.useFlag === 0 ? "启用" : ""} + // ) }, + + { + title: "操作", + width: 150, + hidden: !(props.permission("qyd-xgf-yhgl-userList")), + render: (_, record) => ( + + + + ), + }, + ]} + {...tableProps} + /> + + ); +} +export default Connect([NS_ENTERPRISE], true)(Permission(List)); diff --git a/src/pages/Container/Enterprise/StakeholderUnit/User/UserList/index.js b/src/pages/Container/Enterprise/StakeholderUnit/User/UserList/index.js new file mode 100644 index 0000000..4a6f4d9 --- /dev/null +++ b/src/pages/Container/Enterprise/StakeholderUnit/User/UserList/index.js @@ -0,0 +1,413 @@ +import { Permission } from "@cqsjjb/jjb-common-decorator/permission"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Descriptions, Form, Input, message, Modal, Space } from "antd"; +import { useEffect, useState } from "react"; +import HeaderBack from "zy-react-library/components/HeaderBack"; +import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; +import PreviewImg from "zy-react-library/components/PreviewImg"; + +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 { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; + +import useGetFile from "zy-react-library/hooks/useGetFile"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import useTable from "zy-react-library/hooks/useTable"; +import { NS_USER } from "~/enumerate/namespace"; + +const FLOW_USER_TYPE = [ + { + name: "流动人员", + bianma: 1, + }, + { + name: "非流动人员", + bianma: 0, + }, +]; +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, + eqCorpinfoId: queryParams["id"], + }; + }, + }); + const onResetPassword = (id) => { + Modal.confirm({ + title: "提示", + content: "确定要重置密码为Aa12345678吗?", + onOk: () => { + props["userChangePassword"]({ + id, + }).then((res) => { + if (res.success) { + message.success("重置密码成功"); + getData(); + } + }); + }, + }); + }; + const onTreeChange = (selectedKeys) => { + const key = selectedKeys[0] || null; + console.log(selectedKeys); + setSelectedNodeId(key); + getData(); + }; + return ( +
+ +
+
+ +
+ +
( +
{record.employmentFlag === 0 ? "非流动人员" : record.employmentFlag === 1 ? "流动人员" : ""}
+ ), + }, + + { + title: "操作", + render: (_, record) => ( + + { + props.permission("qyd-xgf-yhgl-info") + && ( + + + ) + } + {props.permission("qyd-xgf-yhgl-resetPassword") + && ( + + )} + + + ), + }, + ]} + {...tableProps} + /> + + + {addModalOpen && ( + { + setAddModalOpen(false); + setCurrentId(""); + }} + /> + )} + + + ); +} + +function AddModalComponent(props) { + const [form] = Form.useForm(); + const [info, setInfo] = useState({}); + const { loading: getFileLoading, getFile } = useGetFile(); + const [isModalOpen, setIsModalOpen] = useState(false); + const [viewType, setViewType] = useState(false); + const [viewData, setViewData] = useState(false); + + useEffect(() => { + if (props.currentId) { + const fetchData = async () => { + const res = await props.requestDetails({ + id: props.currentId, + }); + const userImg = await getFile({ + eqType: UPLOAD_FILE_TYPE_ENUM["13"], + eqForeignKey: res.data.userId, + }); + const cardImg = await getFile({ + eqType: UPLOAD_FILE_TYPE_ENUM["14"], + eqForeignKey: res.data.userId, + }); + res.data.userImg = userImg; + res.data.cardImg = cardImg; + console.log(res.data); + + setInfo(res.data); + }; + fetchData(); + + console.log(info); + } + }, [props.currentId]); + const onCancel = () => { + form.resetFields(); + props.onCancel(); + }; + const handleOk = async () => { + const values = await form.validateFields(); + + const { data } = await props.requestGetEncryInfo({ id: props.currentId, password: values.password }); + if (data) { + if (viewType === "phone") { + setViewData(data.phone); + } + else { + setViewData(data.userIdCard); + } + } + }; + return ( + <> + +
+ , + }, + { + label: "身份证照片", + children: , + }, + // { + // label: "用户角色", + // children: getLabelName({ + // status: info.roleId, + // list: rolesData, + // idKey: "id", + // nameKey: "roleName", + // }), + // }, + { + label: "姓名", + children: info.name, + }, + { + label: "性别", + children: info.sex, + }, + + { + label: "出生年月", + children: info.birthday, + }, + { + label: "年龄", + children: info.age, + }, + { + label: "手机号", + children: ( +
+ + {info.phone} + {info.phone + && ( + + )} + +
+ ), + }, + { + label: "身份证号", + children: ( +
+ {info.userIdCard} + { info.userIdCard + && ( + + )} +
+ ), + + }, + + { + label: "民族", + children: info.nationName, + }, + { + label: "婚姻状况", + children: info.maritalStatusName, + }, + { + label: "政治面貌", + children: info.politicalAffiliationName, + }, + { + label: "户口所在地", + children: info.locationAddress, + }, + { + label: "现住址", + children: info.currentAddress, + }, + { + label: "文化程度", + children: info.culturalLevelName, + }, + { + label: "岗位名称", + children: info.postName, + }, + ]} + column={2} + labelStyle={{ + width: 200, + }} + /> +
+
+ {isModalOpen + && ( + setIsModalOpen(false)} + > +
+ + + + + + +
+ )} + + ); +} +const AddModal = AddModalComponent; +export default Connect([NS_USER], true)(Permission(List)); diff --git a/src/pages/Container/Enterprise/StakeholderUnit/User/index.js b/src/pages/Container/Enterprise/StakeholderUnit/User/index.js new file mode 100644 index 0000000..05147ba --- /dev/null +++ b/src/pages/Container/Enterprise/StakeholderUnit/User/index.js @@ -0,0 +1,4 @@ +function User(props) { + return
{props.children}
; +} +export default User; diff --git a/src/pages/Container/Enterprise/StakeholderUnit/index.js b/src/pages/Container/Enterprise/StakeholderUnit/index.js new file mode 100644 index 0000000..2bb797b --- /dev/null +++ b/src/pages/Container/Enterprise/StakeholderUnit/index.js @@ -0,0 +1,4 @@ +function StakeholderUnit(props) { + return
{props.children}
; +} +export default StakeholderUnit; diff --git a/src/pages/Container/Enterprise/User/List/index.js b/src/pages/Container/Enterprise/User/List/index.js index 89f20ae..244839c 100644 --- a/src/pages/Container/Enterprise/User/List/index.js +++ b/src/pages/Container/Enterprise/User/List/index.js @@ -79,6 +79,22 @@ function List(props) { }, }); }; + const onResetPassword = (id) => { + Modal.confirm({ + title: "提示", + content: "确定要重置密码为Aa12345678吗?", + onOk: () => { + props["userChangePassword"]({ + id, + }).then((res) => { + if (res.success) { + message.success("重置密码成功"); + getData(); + } + }); + }, + }); + }; const onImportFileConfirm = (values) => { console.log(values); importFile("/basic-info/user/importUserTable", { @@ -123,7 +139,7 @@ function List(props) { label: "用户名", }, { - name: "人资系统是否存在", + name: "rzFlag", label: "人资系统是否存在", render: FORM_ITEM_RENDER_ENUM.SELECT, items: WHETHER_ENUM, @@ -140,18 +156,18 @@ function List(props) { toolBarRender={() => ( <> { - props.permission("yhglqyd-add") - && ( - - ) + // props.permission("yhglqyd-add") + // && ( + + // ) } @@ -185,8 +201,8 @@ function List(props) { )} columns={[ { - title: "用户名", - dataIndex: "username", + title: "手机号", + dataIndex: "phone", }, { title: "姓名", @@ -202,12 +218,12 @@ function List(props) { }, { title: "人资系统是否存在", - dataIndex: "flag", + dataIndex: "rzFlag", render: (_, record) => (
- {record.flag === 0 + {record.rzFlag === 0 ? "否" - : record.flag === 1 + : record.rzFlag === 1 ? "是" : ""}
@@ -218,19 +234,6 @@ function List(props) { width: 300, render: (_, record) => ( - { - props.permission("yhglqyd-edit") - && ( - - ) - } { props.permission("yhglqyd-info") && ( @@ -245,6 +248,30 @@ function List(props) { ) } + { + props.permission("yhglqyd-resetPassword") + && ( + + ) + } + { + props.permission("yhglqyd-edit") + && ( + + ) + } { (props.permission("yhglqyd-delete") @@ -319,7 +346,6 @@ function AddModalComponent(props) { setInfo(res.data); }; fetchData(); - console.log(info); } }, [props.currentId]); const onCancel = () => { diff --git a/src/pages/Container/Stakeholder/CorpInfo/index.js b/src/pages/Container/Stakeholder/CorpInfo/index.js index 5016942..45b065e 100644 --- a/src/pages/Container/Stakeholder/CorpInfo/index.js +++ b/src/pages/Container/Stakeholder/CorpInfo/index.js @@ -23,6 +23,24 @@ import { getLabelName } from "zy-react-library/utils"; import { NS_ENTERPRISE } from "~/enumerate/namespace"; import { useDebounce } from "~/utils"; +const REQUIRED_FIELDS = [ + "corpName", + "code", + "province", + "ecoType", + "addressBusiness", + "scale", + "lrName", + "lrMobile", + "contacts", + "contactsPhone", + "createDate", + "employees", + "regcapital", + "totalAssets", + "licenseStart", + "licenseEnd", +]; const ENTERPRISE_STATUS = [ { bianma: "filialstate01", @@ -45,16 +63,16 @@ const ENTERPRISE_STATUS = [ name: "破产", }, ]; -const WHETHER_ENUM = [ - { - bianma: 1, - name: "是", - }, - { - bianma: 0, - name: "否", - }, -]; +// const WHETHER_ENUM = [ +// { +// bianma: 1, +// name: "是", +// }, +// { +// bianma: 0, +// name: "否", +// }, +// ]; // const xgfStateMap = { // 0: "未填报", // 1: "待审核", @@ -69,6 +87,7 @@ function CorpInfo(props) { const { loading: deleteFileLoading, deleteFile } = useDeleteFile(); const { loading: uploadFileLoading, uploadFile } = useUploadFile(); const { loading: getFileLoading, getFile } = useGetFile(); + const [canShowQrCode, setCanShowQrCode] = useState(false); const [keyId, setKeyId] = useState({}); const [scaleData, setScaleData] = useState([]); @@ -105,6 +124,9 @@ function CorpInfo(props) { const { data } = await props["corpInfoDetails"]({ id: res.data.corpinfoId, }); + data.lrMobile = data.lrMobile && data.lrMobile.label; + data.contactsPhone = data.contactsPhone && data.contactsPhone.label; + data.region = data.village || data.street || data.country || data.city || data.province; setInfoData(data); setKeyId({ @@ -118,6 +140,18 @@ function CorpInfo(props) { data.INDUSTRYALL = getLastValidCorpTypeName(data); data.license = [data.licenseStart, data.licenseEnd]; data.scaleType = data.scaleType ?? 0; + + // 判断是否所有必填字段都有值(基于原始 data + licenseFile) + const hasLicenseFile = Array.isArray(licenseFile) && licenseFile.length > 0; + + const allRequiredFilled = REQUIRED_FIELDS.every((field) => { + const val = data[field]; + return val != null && val !== "" && !(typeof val === "number"); + }); + + // 最终条件:字段都填了 + 营业执照文件存在 + setCanShowQrCode(allRequiredFilled && hasLicenseFile); + const values = { licenseFile, ...data, @@ -445,6 +479,7 @@ function CorpInfo(props) { { name: "qrCode", label: "企业二维码", + hidden: canShowQrCode, required: false, render: ( - // ) + props.permission("bmglxgf-add") + && ( + + ) } - // ) + props.permission("yhglxgf-add") + && ( + + ) } )} columns={[ { - title: "用户名", - dataIndex: "username", + title: "手机号", + dataIndex: "phone", }, { title: "姓名", @@ -148,7 +142,11 @@ function List(props) { }, { title: "入职状态", - dataIndex: "departmentName", + dataIndex: "employmentFlag", + render: (_, record) => ( +
{JOB_STATUS[record.employmentFlag] || ""}
+ + ), }, { title: "部门", @@ -161,42 +159,43 @@ function List(props) { render: (_, record) => ( { - // props.permission("yhglxgf-info") - // && ( - - // ) + props.permission("yhglxgf-info") + && ( + + ) } { - // props.permission("yhglxgf-resetPassword") - // && ( - - // ) + props.permission("yhglxgf-resetPassword") + && ( + + ) } { - // props.permission("yhglxgf-edit") - // && ( - - // ) + props.permission("yhglxgf-edit") + && ( + + ) } {/* { */} @@ -230,17 +229,47 @@ function List(props) { {/* ) */} {/* } */} { - // props.permission("yhglxgf-delete") - // && ( - - // ) + (props.permission("yhglxgf-lizhi") && record.employmentFlag === 1) && ( + + + + ) + } + { (props.permission("yhglxgf-rzsh") && record.employmentFlag === 11) + && ( + + )} + { (props.permission("yhglxgf-lzsh") && record.employmentFlag === 10) + && ( + + )} ), }, @@ -256,6 +285,8 @@ function List(props) { currentId={currentId} requestDetails={props["userDetails"]} requestGetEncryInfo={props["getEncryInfo"]} + requestReviewStatus={props["reviewStatus"]} + modalType={modalType} onCancel={() => { setAddModalOpen(false); setCurrentId(""); @@ -313,11 +344,51 @@ function AddModalComponent(props) { } } }; + const handleReject = () => { + Modal.confirm({ + title: "提示", + content: "确定驳回吗?", + onOk: () => { + props.requestReviewStatus({ + corpinfoId: info.corpinfoId, + employmentFlag: info.employmentFlag, + reviewStatus: 3, + userId: info.id, + }).then((res) => { + if (res.success) { + message.success("驳回成功"); + props.getData(); + props.onCancel(); + } + }); + }, + }); + }; + const handlePass = () => { + Modal.confirm({ + title: "提示", + content: "确定审核通过吗?", + onOk: () => { + props.requestReviewStatus({ + corpinfoId: info.corpinfoId, + employmentFlag: info.employmentFlag, + reviewStatus: 2, + userId: info.id, + }).then((res) => { + if (res.success) { + message.success("审核成功"); + props.getData(); + props.onCancel(); + } + }); + }, + }); + }; return ( <> + 返回 + , + , + , + + ]} >
setIsModalOpen(false)} + >
{ + props["getChangerRecordInfoById"]({ corpinfoId: queryParams["corpinfoId"], userId: queryParams["id"] }).then((res) => { + console.log(res); + setInfo(res.data); + }); + }, []); + + const onSubmit = async () => { + Modal.confirm({ + title: "提示", + content: "确认后,该名员工的信息将处于离职状态,涉及的待完成相关工作,可能会受到异常。", + onOk: () => { + props["reviewStatus"]({ + corpinfoId: queryParams["corpinfoId"], + employmentFlag: queryParams["employmentFlag"], + reviewStatus: 2, + userId: queryParams["id"], + }).then((res) => { + if (res.success) { + message.success("审核成功"); + window.history.back(); + } + }); + }, + }); + }; + const handleReject = () => { + Modal.confirm({ + title: "提示", + content: "确定驳回吗?", + onOk: () => { + props["reviewStatus"]({ + corpinfoId: queryParams["corpinfoId"], + employmentFlag: queryParams["employmentFlag"], + reviewStatus: 3, + userId: queryParams["id"], + }).then((res) => { + if (res.success) { + message.success("驳回成功"); + window.history.back(); + } + }); + }, + }); + }; + + const onGoBack = () => { + window.history.back(); + }; + + return ( +
+ +
+ 人员信息 + + + 未完成工作 +
+ + +
+ + + + + + +
+ + + + ); +} +export default Connect([NS_USER], true)(ResignationReview); diff --git a/src/pages/Container/Supervision/BranchCompany/AccountManage/List/index.js b/src/pages/Container/Supervision/BranchCompany/AccountManage/List/index.js index aff786c..88e2531 100644 --- a/src/pages/Container/Supervision/BranchCompany/AccountManage/List/index.js +++ b/src/pages/Container/Supervision/BranchCompany/AccountManage/List/index.js @@ -170,8 +170,8 @@ function List(props) { toolBarRender={() => ( <> { - // props.permission("zgszhgl-add") - // && ( + props.permission("zgszhgl-add") + && ( - // ) + ) } )} diff --git a/src/pages/Container/Supervision/BranchCompany/DepartmentManage/List/index.js b/src/pages/Container/Supervision/BranchCompany/DepartmentManage/List/index.js index 51dd80b..1738858 100644 --- a/src/pages/Container/Supervision/BranchCompany/DepartmentManage/List/index.js +++ b/src/pages/Container/Supervision/BranchCompany/DepartmentManage/List/index.js @@ -92,7 +92,7 @@ function List(props) { }, { name: "eqUseFlag", - label: "启用状态", + label: "账户状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: STATUS, }, @@ -134,12 +134,12 @@ function List(props) { ), }, { - title: "分公司状态", + title: "公司状态", dataIndex: "corpStateName", }, { - title: "状态", + title: "账户状态", dataIndex: "corpOrder", render: (_, record) => (
@@ -154,7 +154,7 @@ function List(props) { { title: "操作", width: 200, - // hidden: !(props.permission("zgsbmgl-list")), + hidden: !(props.permission("zgsbmgl-list")), render: (_, record) => ( - // ) + props.permission("zgsqyxxgl-info") + && ( + + ) } { props.permission("zgsqyxxgl-location") diff --git a/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/View/index.js b/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/View/index.js index df92f42..84923bb 100644 --- a/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/View/index.js +++ b/src/pages/Container/Supervision/BranchCompany/EnterpriseInfo/View/index.js @@ -1,5 +1,5 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; -import { Descriptions, Divider } from "antd"; +import { Button, Descriptions, Divider, Form, Input, Modal } from "antd"; import { useEffect, useState } from "react"; import HeaderBack from "zy-react-library/components/HeaderBack"; @@ -7,22 +7,19 @@ import PreviewImg from "zy-react-library/components/PreviewImg"; import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; import useGetFile from "zy-react-library/hooks/useGetFile"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; - import { NS_ENTERPRISE } from "~/enumerate/namespace"; +import { getAreaNamePath, getCorpTypeNamePath } from "~/utils"; function View(props) { + const [form] = Form.useForm(); const [info, setInfo] = useState({}); const queryParams = useGetUrlQuery(); + const [isModalOpen, setIsModalOpen] = useState(false); + const [viewType, setViewType] = useState(false); + const [viewData, setViewData] = useState(false); + const [encrypted, setEncrypted] = useState(false); const { loading: getFileLoading, getFile } = useGetFile(); - const getCorpTypeNamePath = (item) => { - const names = [ - item.corpTypeName, - item.corpType2Name, - item.corpType3Name, - item.corpType4Name, - ].filter(name => name != null && name !== ""); - return names.join("/"); - }; + useEffect(() => { const fetchData = async () => { const res = await props.corpInfoDetails({ @@ -33,10 +30,19 @@ function View(props) { eqForeignKey: res.data.corpinfoId, }); res.data.licenseFile = licenseFile; - setInfo(res.data); + setInfo(res.data || {}); }; fetchData(); }, []); + const handleOk = async () => { + const values = await form.validateFields(); + + const { data } = await props["getEncryInfo"]({ id: info.id, password: values.password, fieldKey: viewType, maskInfo: encrypted }); + + if (data) { + setViewData(data.maskDTO.label); + } + }; return (
@@ -66,7 +72,7 @@ function View(props) { }, { label: "属地", - children: info.cityName, + children:
{getAreaNamePath(info) || ""}
, }, { label: "邮政编码", @@ -109,7 +115,7 @@ function View(props) { }, { label: "所属行业", - children:
{getCorpTypeNamePath(info)}
, + children:
{ getCorpTypeNamePath(info) || ""}
, }, { label: "是否规模以上", @@ -138,7 +144,7 @@ function View(props) { children: info.licenseStart ? ` ${info.licenseStart} 至 ${info.licenseEnd}` : "", }, { - label: "分公司状态", + label: "公司状态", children: info.corpStateName, }, ]} @@ -146,6 +152,7 @@ function View(props) { labelStyle={{ width: 200, }} + contentStyle={{ width: "36%" }} /> 公司法定代表人信息 {info.lrName}
, + }, { label: "手机号码", - children: info.lrMobile, + children: ( +
+ + {info.lrMobile && info.lrMobile.label} + { (info.lrMobile && info.lrMobile.label) + && ( + + )} + +
+ ), }, ]} column={2} labelStyle={{ - width: 200, + width: 210, }} + contentStyle={{ width: "37%" }} /> 主要负责人信息 + + { info.contactsPhone && info.contactsPhone.label} + { (info.contactsPhone && info.contactsPhone.label) + && ( + + )} + +
+ ), }, ]} column={2} labelStyle={{ - width: 200, + width: 210, }} + contentStyle={{ width: "37%" }} /> 安全负责人信息 + + {info.safetyPhone && info.safetyPhone.label} + { (info.safetyPhone && info.safetyPhone.label) + && ( + + )} + + + ), }, ]} column={2} labelStyle={{ - width: 200, + width: 210, }} + contentStyle={{ width: "37%" }} /> {/* 企业相关属性 */} {/* */} + {isModalOpen + && ( + setIsModalOpen(false)} + > + + + + + + + + + + )} ); } diff --git a/src/pages/Container/Supervision/BranchCompany/SubsidiaryUser/List/index.js b/src/pages/Container/Supervision/BranchCompany/SubsidiaryUser/List/index.js index 31b2618..6659537 100644 --- a/src/pages/Container/Supervision/BranchCompany/SubsidiaryUser/List/index.js +++ b/src/pages/Container/Supervision/BranchCompany/SubsidiaryUser/List/index.js @@ -74,7 +74,7 @@ function List(props) { }, { name: "eqUseFlag", - label: "启用状态", + label: "账户状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: USER_FLAG, }, @@ -95,11 +95,11 @@ function List(props) { ), }, { - title: "分公司状态", + title: "公司状态", dataIndex: "corpStateName", }, { - title: "启用状态", + title: "账户状态", dataIndex: "useFlag", render: (_, record) => ( @@ -114,7 +114,7 @@ function List(props) { { title: "操作", width: 200, - // hidden: !(props.permission("zgsyhgl-info")), + hidden: !(props.permission("zgsyhgl-info")), render: (_, record) => (
( -
- {record.employmentFlag === 1 - ? "在职" - : record.employmentFlag === 1 - ? "离职" - : ""} -
- ), - }, - ]} - {...tableProps} - /> +
+ +
+ +
( +
+ {record.employmentFlag === 1 + ? "在职" + : record.employmentFlag === 1 + ? "离职" + : ""} +
+ ), + }, + { + title: "操作", + width: 200, + render: (_, record) => ( + + + + + + ), + }, + ]} + {...tableProps} + /> + ); } diff --git a/src/pages/Container/Supervision/EnterpriseMiddleground/ChangeView/index.js b/src/pages/Container/Supervision/EnterpriseMiddleground/ChangeView/index.js new file mode 100644 index 0000000..9652ba5 --- /dev/null +++ b/src/pages/Container/Supervision/EnterpriseMiddleground/ChangeView/index.js @@ -0,0 +1,190 @@ +import { Connect } from "@cqsjjb/jjb-dva-runtime"; +import { Button, Descriptions, Divider, message, Modal } from "antd"; +import { useEffect, useState } from "react"; +import HeaderBack from "zy-react-library/components/HeaderBack"; +import Table from "zy-react-library/components/Table"; +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; + +import { NS_ENTERPRISE, NS_USER } from "~/enumerate/namespace"; + +function ChangeView(props) { + const queryParams = useGetUrlQuery(); + const [info, setInfo] = useState({}); + + useEffect(() => { + props["getChangerRecordInfoById"]({ corpinfoId: queryParams["corpinfoId"], userId: queryParams["id"] }).then((res) => { + console.log(res); + setInfo(res.data); + }); + }, []); + + const onSubmit = async () => { + Modal.confirm({ + title: "提示", + content: "确认后,该名员工的信息将处于离职状态,涉及的待完成相关工作,可能会受到异常。", + onOk: () => { + props["reviewStatus"]({ + corpinfoId: queryParams["corpinfoId"], + employmentFlag: queryParams["employmentFlag"], + reviewStatus: 2, + userId: queryParams["id"], + }).then((res) => { + if (res.success) { + message.success("审核成功"); + window.history.back(); + } + }); + }, + }); + }; + const handleReject = () => { + Modal.confirm({ + title: "提示", + content: "确定驳回吗?", + onOk: () => { + props["reviewStatus"]({ + corpinfoId: queryParams["corpinfoId"], + employmentFlag: queryParams["employmentFlag"], + reviewStatus: 3, + userId: queryParams["id"], + }).then((res) => { + if (res.success) { + message.success("驳回成功"); + window.history.back(); + } + }); + }, + }); + }; + + const onGoBack = () => { + window.history.back(); + }; + + return ( +
+ +
+ 变更前信息 + + 变更后信息 + + {queryParams["type"] === "disposal" ? "未完成工作" : "工作交接"} +
+ + + { + queryParams["type"] === "disposal" + + && ( +
+ + + + + + +
+ ) + } + + + + ); +} +export default Connect([NS_ENTERPRISE, NS_USER], true)(ChangeView); diff --git a/src/pages/Container/Supervision/EnterpriseMiddleground/List/index.js b/src/pages/Container/Supervision/EnterpriseMiddleground/List/index.js index 11f1bf7..bccac61 100644 --- a/src/pages/Container/Supervision/EnterpriseMiddleground/List/index.js +++ b/src/pages/Container/Supervision/EnterpriseMiddleground/List/index.js @@ -31,6 +31,7 @@ function List(props) { }, }); return ( +
( +
{record.middleUserCount ?? 0}
+ ), }, { title: "操作", diff --git a/src/pages/Container/Supervision/EnterpriseMiddleground/UserList/index.js b/src/pages/Container/Supervision/EnterpriseMiddleground/UserList/index.js index d4ee448..5258346 100644 --- a/src/pages/Container/Supervision/EnterpriseMiddleground/UserList/index.js +++ b/src/pages/Container/Supervision/EnterpriseMiddleground/UserList/index.js @@ -1,10 +1,11 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Descriptions, Form, Modal, Space } from "antd"; import { useEffect, useState } from "react"; +import HeaderBack from "zy-react-library/components/HeaderBack"; 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 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 useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; @@ -46,119 +47,131 @@ function List(props) { getData(); }; return ( -
+
+ +
-
- -
( -
- {record.employmentFlag === 1 - ? "在职" - : record.employmentFlag === 1 - ? "离职" - : ""} -
- ), - }, - { - title: "操作", - width: 180, - render: (_, record) => ( - - - - - ), - }, - ]} - {...tableProps} - /> + +
+ +
( +
+ {record.employmentFlag === 1 + ? "在职" + : record.employmentFlag === 1 + ? "离职" + : ""} +
+ ), + }, + { + title: "操作", + width: 180, + render: (_, record) => ( + + + + + + ), + }, + ]} + {...tableProps} + /> + - - { - setAddModalOpen(false); - setCurrentId(""); - }} - /> + { + setAddModalOpen(false); + setCurrentId(""); + }} + /> + ); } diff --git a/src/pages/Container/Supervision/StakeholderUnit/AccountManage/List/index.js b/src/pages/Container/Supervision/StakeholderUnit/AccountManage/List/index.js index f1ee535..12815c9 100644 --- a/src/pages/Container/Supervision/StakeholderUnit/AccountManage/List/index.js +++ b/src/pages/Container/Supervision/StakeholderUnit/AccountManage/List/index.js @@ -7,19 +7,20 @@ import AddIcon from "zy-react-library/components/Icon/AddIcon"; import Search from "zy-react-library/components/Search"; import DictionarySelect from "zy-react-library/components/Select/Dictionary"; +import AreaSelect from "zy-react-library/components/SelectTree/Area"; 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 { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular"; import { getLabelName } from "zy-react-library/utils"; import { NS_ENTERPRISE } from "~/enumerate/namespace"; -import { useDebounce } from "~/utils"; +import { getAreaNamePath, useDebounce } from "~/utils"; const ENTERPRISE_TYPE = [ { bianma: 3, - name: "相关方企业", + name: "普通企业", }, { bianma: 4, @@ -32,6 +33,8 @@ const ENTERPRISE_TYPE = [ ]; function List(props) { const [form] = Form.useForm(); + + const [cityData, setCityData] = useState([]); const { tableProps, getData } = useTable(props["corpInfoList"], { form, transform: (formData) => { @@ -40,9 +43,16 @@ function List(props) { enterpriseType: 3, geCreateTime: formData.CreateTime?.[0], leCreateTime: formData.CreateTime?.[1], + eqProvince: formData.cityRecord?.[0], + eqCity: formData.cityRecord?.[1], + eqCountry: formData.cityRecord?.[2], + eqStreet: formData.cityRecord?.[3], + eqVillage: formData.cityRecord?.[4], + }; }, }); + console.log(console.log(window.process.env.app.antd["ant-prefix"])); const [addModalOpen, setAddModalOpen] = useState(false); const [currentId, setCurrentId] = useState(""); const onResetPassword = (id) => { @@ -61,6 +71,7 @@ function List(props) { }, }); }; + const onDelete = (id) => { Modal.confirm({ title: "提示", @@ -77,24 +88,46 @@ function List(props) { }, }); }; + const onFinish = async () => { + // 处理属地查询 + const arr = []; + cityData.forEach((item) => { + arr.push(item.value); + }); + form.setFieldValue("cityRecord", arr); + getData(); + }; + + const onReset = () => { + setCityData([]); + + form.setFieldValue("cityRecord", []); + }; return (
+ onFinish()} + onReset={onReset} options={[ { name: "likecorpName", label: "相关方名称", }, { - name: "eqCity", + name: "cityData", label: "属地", - render: , + render: ( + + setCityData(nodes)} + /> + ), }, { name: "CreateTime", @@ -107,6 +140,12 @@ function List(props) { render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE, }, + { + name: "cityRecord", + label: "属地", + render: FORM_ITEM_RENDER_ENUM.SELECT, + onlyForLabel: true, + }, ]} @@ -139,6 +178,10 @@ function List(props) { { title: "属地", dataIndex: "cityName", + width: 300, + render: (_, record) => ( +
{getAreaNamePath(record)}
+ ), }, { title: "创建单位", @@ -151,15 +194,17 @@ function List(props) { { title: "社会统一信用代码", dataIndex: "code", + width: 190, }, { title: "开户时间", dataIndex: "createTime", + width: 120, }, { title: "相关方类型", dataIndex: "type", - + width: 120, render: (_, record) => ( getLabelName({ status: record.type, @@ -170,7 +215,7 @@ function List(props) { }, { title: "操作", - width: 350, + width: 300, render: (_, record) => ( { diff --git a/src/pages/Container/Supervision/StakeholderUnit/AccountManage/View/index.js b/src/pages/Container/Supervision/StakeholderUnit/AccountManage/View/index.js index b9c8316..bc27e1e 100644 --- a/src/pages/Container/Supervision/StakeholderUnit/AccountManage/View/index.js +++ b/src/pages/Container/Supervision/StakeholderUnit/AccountManage/View/index.js @@ -1,5 +1,5 @@ import { Connect } from "@cqsjjb/jjb-dva-runtime"; -import { Button, Descriptions, Divider, Modal, QRCode } from "antd"; +import { Button, Descriptions, Divider, Form, Input, Modal, QRCode } from "antd"; import { useEffect, useState } from "react"; import HeaderBack from "zy-react-library/components/HeaderBack"; @@ -7,34 +7,36 @@ import PreviewImg from "zy-react-library/components/PreviewImg"; import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; import useGetFile from "zy-react-library/hooks/useGetFile"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import { getLabelName } from "zy-react-library/utils"; import { NS_ENTERPRISE } from "~/enumerate/namespace"; +import { getAreaNamePath, getCorpTypeNamePath } from "~/utils"; +const ENTERPRISE_TYPE = [ + { + bianma: 3, + name: "相关方企业", + }, + { + bianma: 4, + name: "货主单位", + }, + { + bianma: 5, + name: "驻港单位", + }, +]; function View(props) { const [info, setInfo] = useState({}); + const [form] = Form.useForm(); const { loading: getFileLoading, getFile } = useGetFile(); const [corpInfoQrCodeOpen, setCorpInfoQrCodeOpen] = useState(false); + const [viewType, setViewType] = useState(false); + const [viewData, setViewData] = useState(false); + const [encrypted, setEncrypted] = useState(false); + const [isModalOpen, setIsModalOpen] = useState(false); const queryParams = useGetUrlQuery(); - const getCorpTypeNamePath = (item) => { - const names = [ - item.corpTypeName, - item.corpType2Name, - item.corpType3Name, - item.corpType4Name, - ].filter(name => name != null && name !== ""); - return names.join("/"); - }; - const getAreaNamePath = (item) => { - const names = [ - item.provinceName, - item.cityName, - item.countryName, - item.streetName, - item.villageName, - ].filter(name => name != null && name !== ""); - return names.join("/"); - }; useEffect(() => { const fetchData = async () => { const res = await props.corpInfoDetails({ @@ -42,10 +44,12 @@ function View(props) { }); const arr = []; - res.data.selectfromList.forEach((item) => { + res.data.selectfromList && res.data.selectfromList.forEach((item) => { arr.push(item.itemName); }); - res.data.selectfromList = arr.join(","); + if (arr.length > 0) { + res.data.selectfromList = arr.join(","); + } const licenseFile = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["6"], @@ -58,6 +62,16 @@ function View(props) { }; fetchData(); }, []); + + const handleOk = async () => { + const values = await form.validateFields(); + + const { data } = await props["getEncryInfo"]({ id: info.id, password: values.password, fieldKey: viewType, maskInfo: encrypted }); + + if (data) { + setViewData(data.maskDTO.label); + } + }; return (
@@ -69,6 +83,7 @@ function View(props) { 基本信息 + + {info.lrMobile && info.lrMobile.label} + { (info.lrMobile && info.lrMobile.label) + && ( + + )} + +
+ ), }, { label: "主要负责人", @@ -129,7 +165,28 @@ function View(props) { }, { label: "主要负责人手机号", - children: info.contactsPhone, + children: ( +
+ + { info.contactsPhone && info.contactsPhone.label} + { (info.contactsPhone && info.contactsPhone.label) + && ( + + )} + +
+ ), }, { label: "成立日期", @@ -139,10 +196,10 @@ function View(props) { label: "职工人数", children: info.employees, }, - { - label: "占地面积(㎡)", - children: info.areaCovered, - }, + // { + // label: "占地面积(㎡)", + // children: info.areaCovered, + // }, { label: "注册资金(万元)", @@ -166,6 +223,13 @@ function View(props) { ), }, + { + label: "相关方类型", + children: getLabelName({ + status: info.type, + list: ENTERPRISE_TYPE, + }), + }, { label: "创建单位", children: info.createName, @@ -184,6 +248,7 @@ function View(props) { 营业执照
{corpInfoQrCodeOpen && ( @@ -207,6 +273,50 @@ function View(props) { onCancel={() => setCorpInfoQrCodeOpen(false)} /> )} + {isModalOpen + && ( + setIsModalOpen(false)} + > +
+ + + + + + + +
+ )} ); } @@ -227,8 +337,9 @@ const CorpInfoQrCode = (props) => { > { return { ...formData, enterpriseType: 3, + eqProvince: formData.cityRecord?.[0], + eqCity: formData.cityRecord?.[1], + eqCountry: formData.cityRecord?.[2], + eqStreet: formData.cityRecord?.[3], + eqVillage: formData.cityRecord?.[4], }; }, }); + const onFinish = async () => { + // 处理属地查询 + console.log(cityData); + const arr = []; + cityData.forEach((item) => { + arr.push(item.value); + }); + console.log(arr); + form.setFieldValue("cityRecord", arr); + getData(); + }; + + const onReset = () => { + setCityData([]); + + form.setFieldValue("cityRecord", []); + }; return (
onFinish()} + onReset={onReset} options={[ { name: "likeCorpName", - label: "相关方单位名称", + label: "企业名称", + }, + { + name: "cityData", + label: "属地", + render: ( + + setCityData(nodes)} + /> + ), }, { name: "eqType", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE }, - { name: "selectFrom", label: "选取形式", render: ( - - ) }, + { + name: "cityRecord", + label: "属地", + render: FORM_ITEM_RENDER_ENUM.SELECT, + onlyForLabel: true, + }, ]} - onFinish={getData} />
( + getLabelName({ + status: record.type, + list: ENTERPRISE_TYPE, + }) + ), + width: 120, }, { title: "属地", dataIndex: "cityName", - + render: (_, record) => ( +
{getAreaNamePath(record)}
+ ), }, { title: "创建单位", - dataIndex: "createName", + dataIndex: "tenantName", }, { title: "企业人数", dataIndex: "userCount", + width: 120, render: (_, record) => (
{record.userCount ? record.userCount : "0"}
), @@ -88,10 +136,12 @@ function List(props) { { title: "安全人员信息数", dataIndex: "safetyUserCount", + width: 140, }, { title: "特种作业人数", dataIndex: "specialUserCount", + width: 120, }, // { title: "公司状态", dataIndex: "corpStateName" }, diff --git a/src/pages/Container/Supervision/StakeholderUnit/User/UserList/index.js b/src/pages/Container/Supervision/StakeholderUnit/User/UserList/index.js index e8cf3d1..e51c8ee 100644 --- a/src/pages/Container/Supervision/StakeholderUnit/User/UserList/index.js +++ b/src/pages/Container/Supervision/StakeholderUnit/User/UserList/index.js @@ -2,16 +2,17 @@ import { Permission } from "@cqsjjb/jjb-common-decorator/permission"; import { Connect } from "@cqsjjb/jjb-dva-runtime"; import { Button, Descriptions, Form, Input, message, Modal, Space } from "antd"; import { useEffect, useState } from "react"; +import HeaderBack from "zy-react-library/components/HeaderBack"; import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; import PreviewImg from "zy-react-library/components/PreviewImg"; -import Search from "zy-react-library/components/Search"; -import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary"; +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 { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj"; + import useGetFile from "zy-react-library/hooks/useGetFile"; import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; - import useTable from "zy-react-library/hooks/useTable"; import { NS_USER } from "~/enumerate/namespace"; @@ -31,6 +32,16 @@ function List(props) { }; }, }); + const FLOW_USER_TYPE = [ + { + name: "流动人员", + bianma: 1, + }, + { + name: "非流动人员", + bianma: 0, + }, + ]; const onResetPassword = (id) => { Modal.confirm({ title: "提示", @@ -54,107 +65,111 @@ function List(props) { getData(); }; return ( -
+
+
-
- , - }, - ]} - onFinish={getData} - /> -
+
+ +
( - - {props.permission("ryxxgl-resetPassword") - && ( - - )} - { - // props.permission("ryxxgl-info") - // && ( - + { + title: "操作", + render: (_, record) => ( + + {props.permission("ryxxgl-resetPassword") + && ( + + )} + { + props.permission("ryxxgl-info") + && ( + - // ) - } - - ), - }, - ]} - {...tableProps} - /> + ) + } + + ), + }, + ]} + {...tableProps} + /> + + {addModalOpen && ( + { + setAddModalOpen(false); + setCurrentId(""); + }} + /> + )} - {addModalOpen && ( - { - setAddModalOpen(false); - setCurrentId(""); - }} - /> - )} ); } diff --git a/src/pages/Container/Supervision/Supervision/CorpInfo/Info/index.js b/src/pages/Container/Supervision/Supervision/CorpInfo/Info/index.js new file mode 100644 index 0000000..41988b3 --- /dev/null +++ b/src/pages/Container/Supervision/Supervision/CorpInfo/Info/index.js @@ -0,0 +1,86 @@ +import { Permission } from "@cqsjjb/jjb-common-decorator/permission"; +import { Connect } from "@cqsjjb/jjb-dva-runtime"; + +import { Button, Descriptions, Divider } from "antd"; +import { useEffect, useState } from "react"; + +import { NS_ENTERPRISE } from "~/enumerate/namespace"; +import { getAreaNamePath } from "~/utils"; + +function Info(props) { + const [info, setInfo] = useState({}); + + useEffect(() => { + const fetchData = async () => { + const { data } = await props["userGetInfo"](); + + const res = await props.corpInfoDetails({ + id: data.corpinfoId, + }); + + setInfo(res.data); + }; + fetchData(); + }, []); + return ( +
+ 基本信息 + {getAreaNamePath(info)}
, + span: 4, + }, + + { + label: "成立时间", + children: info.createDate, + span: 4, + }, + + ]} + column={2} + labelStyle={{ + width: 200, + }} + /> + +
+ {props.permission("gfd-qyxxgl-edit") + && ( + + )} +
+ + ); +} +export default Connect([NS_ENTERPRISE], true)(Permission(Info)); diff --git a/src/pages/Container/Supervision/Supervision/CorpInfo/Update/index.js b/src/pages/Container/Supervision/Supervision/CorpInfo/Update/index.js new file mode 100644 index 0000000..eb094d6 --- /dev/null +++ b/src/pages/Container/Supervision/Supervision/CorpInfo/Update/index.js @@ -0,0 +1,200 @@ +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 AreaSelect from "zy-react-library/components/SelectTree/Area"; +import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; + +import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery"; +import { + UNIFIED_SOCIAL_CREDIT_CODE, +} from "zy-react-library/regular"; + +import { NS_ENTERPRISE } from "~/enumerate/namespace"; +import { useDebounce } from "~/utils"; + +function Update(props) { + const [form] = Form.useForm(); + const queryParams = useGetUrlQuery(); + + const [cityData, setCityData] = useState([]); + + const [codeValue, setCodeValue] = useState(""); + const [corpNameValue, setCorpNameValue] = useState(""); + const debouncedCode = useDebounce(codeValue, 600); + const debouncedCorpName = useDebounce(corpNameValue, 600); + useEffect(() => { + const fetchData = async () => { + const { data } = await props["corpInfoDetails"]({ + id: queryParams["id"], + }); + + data.region = data.village || data.street || data.country || data.city || data.province; + + const values = { + ...data, + }; + form.setFieldsValue({ + ...values, + }); + }; + fetchData(); + }, []); + + // 校验社会统一信用代码重复 + useEffect(() => { + if (!debouncedCode) { + form.setFields([ + { + name: "code", + errors: [], + }, + ]); + return; + } + props["corplnfoCheckCorpcode"]({ + code: debouncedCode, + id: queryParams["id"], + }).then((res) => { + if (!res.data) { + form.setFields([ + { + name: "code", + errors: ["该社会统一信用代码已被其他企业使用"], + }, + ]); + } + }); + }, [debouncedCode]); + + // 校验企业名称重复 + useEffect(() => { + if (!debouncedCorpName) { + form.setFields([ + { + name: "corpName", + errors: [], + }, + ]); + return; + } + props["corplnfoCheckCorpName"]({ + corpName: debouncedCorpName, + id: queryParams["id"], + }).then((res) => { + if (!res.data) { + form.setFields([ + { + name: "corpName", + errors: ["企业名称重复"], + }, + ]); + } + }); + }, [debouncedCorpName]); + + const onValuesChange = (changed) => { + if ("code" in changed) + setCodeValue(changed.code ?? ""); + if ("corpName" in changed) + setCorpNameValue(changed.corpName ?? ""); + }; + const onSubmit = async (values) => { + values.id = queryParams["id"]; + + if (cityData.length > 0) { + values.province = cityData[0].value; + values.provinceName = cityData[0].label; + values.city = cityData[1] && cityData[1].value; + values.cityName = cityData[1] && cityData[1].label; + values.country = cityData[2] && cityData[2].value; + values.countryName = cityData[2] && cityData[2].label; + values.street = cityData[3] && cityData[3].value; + values.streetName = cityData[3] && cityData[3].label; + values.village = cityData[4] && cityData[4].value; + values.villageName = cityData[4] && cityData[4].label; + } + + props["corpInfoEdit"](values).then((res) => { + if (res.success) { + message.success("操作成功!"); + window.history.back(); + } + }); + }; + + return ( + <> + +
+ + setCityData(nodes)} + /> + ), + }, + { + label: "成立时间", + name: "createDate", + span: 24, + + render: FORM_ITEM_RENDER_ENUM.DATE, + }, + + ]} + labelCol={{ + span: 6, + }} + onFinish={onSubmit} + onValuesChange={onValuesChange} + /> +
+ + ); +} +export default Connect([NS_ENTERPRISE], true)(Update); diff --git a/src/pages/Container/Supervision/Supervision/CorpInfo/index.js b/src/pages/Container/Supervision/Supervision/CorpInfo/index.js new file mode 100644 index 0000000..6401e7b --- /dev/null +++ b/src/pages/Container/Supervision/Supervision/CorpInfo/index.js @@ -0,0 +1,4 @@ +function CorpInfo(props) { + return
{props.children}
; +} +export default CorpInfo; diff --git a/src/pages/Container/Supervision/Supervision/User/Add/index.js b/src/pages/Container/Supervision/Supervision/User/Add/index.js index b8b572c..1a08a28 100644 --- a/src/pages/Container/Supervision/Supervision/User/Add/index.js +++ b/src/pages/Container/Supervision/Supervision/User/Add/index.js @@ -282,8 +282,9 @@ function Add(props) { name: "departmentId", label: "所属部门", render: ( - + ), + }, { @@ -302,6 +303,9 @@ function Add(props) { labelKey: "postName", valueKey: "id", }, + componentProps: { + disabled: queryParams["id"], + }, }, { name: "name", diff --git a/src/pages/Container/Supervision/Supervision/User/List/index.js b/src/pages/Container/Supervision/Supervision/User/List/index.js index 51fc3d2..7b415a7 100644 --- a/src/pages/Container/Supervision/Supervision/User/List/index.js +++ b/src/pages/Container/Supervision/Supervision/User/List/index.js @@ -10,11 +10,12 @@ import ImportFile from "zy-react-library/components/ImportFile"; import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"; import PreviewImg from "zy-react-library/components/PreviewImg"; import Search from "zy-react-library/components/Search"; +import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary"; import Table from "zy-react-library/components/Table"; import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender"; import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob"; -import useImportFile from "zy-react-library/hooks/useImportFile"; +import useImportFile from "zy-react-library/hooks/useImportFile"; import useTable from "zy-react-library/hooks/useTable"; import { getLabelName } from "zy-react-library/utils"; import { NS_USER } from "~/enumerate/namespace"; @@ -26,6 +27,7 @@ function List(props) { const [addModalOpen, setAddModalOpen] = useState(false); const [currentId, setCurrentId] = useState(""); const [selectedRowKeys, setSelectedRowKeys] = useState([]); + const [employmentFlagData, setEmploymentFlagData] = useState([]); const [rolesData, setRolesData] = useState([]); const { downloadBlob } = useDownloadBlob(); @@ -37,6 +39,7 @@ function List(props) { return { ...formData, eqDepartmentId: selectedNodeId, + menuPath: "/basicInfo/container/supervision/supervision/user/list", }; }, }); @@ -126,6 +129,7 @@ function List(props) { > setEmploymentFlagData(data)} + /> + ), + }, + ]} onFinish={getData} />
( +
+ { + getLabelName({ + status: String(record.employmentFlag), + list: employmentFlagData, + idKey: "dictAutoValue", + nameKey: "dictLabel", + }) + } +
+ ), + }, { title: "操作", width: 300, render: (_, record) => ( { - // props.permission("zhgl-info") - // && ( - - // ) + props.permission("zhgl-info") + && ( + + ) } { props.permission("zhgl-edit") @@ -434,6 +467,7 @@ function AddModalComponent(props) { { label: "所属部门", children: info.departmentName, + }, { label: "是否部门负责人", diff --git a/src/utils/index.js b/src/utils/index.js index 8925dcb..deb0044 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -133,3 +133,25 @@ export function maskIdCard(idCard) { return `${str.substring(0, 6)}********${str.substring(14)}`; } +// 属地 +export const getAreaNamePath = (item) => { + const names = [ + item.provinceName, + item.cityName, + item.countryName, + item.streetName, + item.villageName, + + ].filter(name => name != null && name !== ""); + return names.join("/"); +}; +// 行业类型 +export const getCorpTypeNamePath = (item) => { + const names = [ + item.corpTypeName, + item.corpType2Name, + item.corpType3Name, + item.corpType4Name, + ].filter(name => name != null && name !== ""); + return names.join("/"); +};