no message
parent
f88c8573d8
commit
97e6788347
|
|
@ -16,8 +16,8 @@ module.exports = {
|
|||
// 应用后端分支名称,部署上线需要
|
||||
javaGitBranch: "<branch-name>",
|
||||
// 接口服务地址
|
||||
// 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: {
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -58,3 +58,9 @@ export const corpDepartlist = declareRequest(
|
|||
"departmentLoading",
|
||||
"Post > @/basicInfo/corpInfo/corpDepartlist",
|
||||
);
|
||||
|
||||
// 根据登录人密码查手机号
|
||||
export const getEncryInfo = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basicInfo/corpInfo/getEncryInfo",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div
|
||||
style={{
|
||||
|
|
@ -138,7 +132,28 @@ function Info(props) {
|
|||
},
|
||||
{
|
||||
label: "法人手机号",
|
||||
children: info.lrMobile,
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{info.lrMobile && info.lrMobile.label}
|
||||
{ (info.lrMobile && info.lrMobile.label)
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("lrMobile");
|
||||
setViewData("");
|
||||
setEncrypted(info.lrMobile);
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "主要负责人",
|
||||
|
|
@ -146,7 +161,29 @@ function Info(props) {
|
|||
},
|
||||
{
|
||||
label: "主要负责人手机号",
|
||||
children: info.contactsPhone,
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{ info.contactsPhone && info.contactsPhone.label}
|
||||
{ (info.contactsPhone && info.contactsPhone.label)
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("contactsPhone");
|
||||
setViewData("");
|
||||
setEncrypted(info.contactsPhone);
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
|
||||
},
|
||||
{
|
||||
label: "安全负责人",
|
||||
|
|
@ -154,7 +191,28 @@ function Info(props) {
|
|||
},
|
||||
{
|
||||
label: "安全负责人手机号",
|
||||
children: info.safetyPhone,
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{info.safetyPhone && info.safetyPhone.label}
|
||||
{ (info.safetyPhone && info.safetyPhone.label)
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("safetyPhone");
|
||||
setViewData("");
|
||||
setEncrypted(info.safetyPhone);
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
|
|
@ -216,6 +274,76 @@ function Info(props) {
|
|||
</Button>
|
||||
)}
|
||||
</div>
|
||||
{isModalOpen
|
||||
&& (
|
||||
<Modal
|
||||
title="查看"
|
||||
open={isModalOpen}
|
||||
onOk={handleOk}
|
||||
onCancel={() => setIsModalOpen(false)}
|
||||
>
|
||||
<Form
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
<Form.Item
|
||||
label="请输入登录密码"
|
||||
name="password"
|
||||
hidden={
|
||||
viewData
|
||||
}
|
||||
// rules={[
|
||||
// {
|
||||
// required: true,
|
||||
// message: "请输入密码",
|
||||
// },
|
||||
// {
|
||||
// min: 8,
|
||||
// max: 18,
|
||||
// message: "密码长度必须为8-18位",
|
||||
// },
|
||||
// {
|
||||
// validator: (_, value) => {
|
||||
// if (!value)
|
||||
// return Promise.resolve();
|
||||
// const hasUpper = /[A-Z]/.test(value);
|
||||
// const hasLower = /[a-z]/.test(value);
|
||||
// const hasNumber = /\d/.test(value);
|
||||
// const hasSpecial = /[!@#$%^&*(),.?":{}|<>[\]\\';`~+=\-_]/.test(value); // 可根据需求调整特殊字符范围
|
||||
//
|
||||
// if (hasUpper && hasLower && hasNumber && hasSpecial) {
|
||||
// return Promise.resolve();
|
||||
// }
|
||||
// return Promise.reject(new Error("密码必须包含大小写字母、数字和特殊字符"));
|
||||
// },
|
||||
// },
|
||||
// ]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="主要负责人手机号码"
|
||||
hidden={!(viewType === "contactsPhone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="法人手机号码"
|
||||
hidden={!(viewType === "lrMobile" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="安全负责人手机号码"
|
||||
hidden={!(viewType === "safetyPhone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
</Modal>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div>
|
||||
<HeaderBack title="变更记录列表" />
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "name",
|
||||
label: "公司名称",
|
||||
},
|
||||
{
|
||||
name: "eqtype",
|
||||
label: "企业类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_TYPE,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "变更时间",
|
||||
dataIndex: "updateTime",
|
||||
},
|
||||
{
|
||||
title: "企业名称",
|
||||
dataIndex: "corpinfoName",
|
||||
},
|
||||
{
|
||||
title: "部门名称",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
{
|
||||
title: "岗位名称",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "员工",
|
||||
dataIndex: "name",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{record.employmentFlag === 1
|
||||
? "在职"
|
||||
: record.employmentFlag === 1
|
||||
? "离职"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() =>
|
||||
props.history.push(`./ChangeView?id=${record.id}&type=record`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default Connect([NS_USER], true)(List);
|
||||
|
|
@ -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 (
|
||||
<div>
|
||||
<HeaderBack title="变更记录" />
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Divider orientation="left">变更前信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.username,
|
||||
},
|
||||
{
|
||||
label: "企业名称",
|
||||
children: info.corpinfoNameBefore,
|
||||
},
|
||||
{
|
||||
label: "部门名称",
|
||||
children: info.departmentNameBefore,
|
||||
},
|
||||
{
|
||||
label: "岗位名称",
|
||||
children: info.postNameBefore,
|
||||
},
|
||||
{
|
||||
label: "员工状态",
|
||||
children: info.userStatusBefore,
|
||||
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
<Divider orientation="left">变更后信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.username,
|
||||
},
|
||||
{
|
||||
label: "企业名称",
|
||||
children: info.corpinfoNameAfter,
|
||||
},
|
||||
{
|
||||
label: "部门名称",
|
||||
children: info.departmentNameAfter,
|
||||
},
|
||||
{
|
||||
label: "岗位名称",
|
||||
children: info.postNameAfter,
|
||||
},
|
||||
{
|
||||
label: "员工状态",
|
||||
children: info.userStatusAfter,
|
||||
},
|
||||
{
|
||||
label: "变更时间",
|
||||
children: info.changeTime,
|
||||
contentStyle: { display: queryParams["type"] === "disposal" ? "none" : "" },
|
||||
labelStyle: { display: queryParams["type"] === "disposal" ? "none" : "" },
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
<Divider orientation="left">{queryParams["type"] === "disposal" ? "未完成工作" : "工作交接"}</Divider>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "工作项目",
|
||||
dataIndex: "corpName",
|
||||
},
|
||||
{
|
||||
title: "工作内容",
|
||||
dataIndex: "type",
|
||||
},
|
||||
{
|
||||
title: "处理人",
|
||||
dataIndex: "departMentCount",
|
||||
hidden: queryParams["type"] === "disposal",
|
||||
},
|
||||
]}
|
||||
dataSource={info.userJobHandoverCOList}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{
|
||||
queryParams["type"] === "disposal"
|
||||
|
||||
&& (
|
||||
<div style={{ textAlign: "center", height: 50, marginTop: 20 }} className="no-print">
|
||||
|
||||
<Button style={{ marginRight: 20 }} onClick={onGoBack}>
|
||||
取消
|
||||
</Button>
|
||||
|
||||
<Button key="reject" onClick={handleReject} style={{ marginRight: 20 }}>
|
||||
驳回
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
type="primary"
|
||||
|
||||
onClick={onSubmit}
|
||||
|
||||
>
|
||||
通过
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE, NS_USER], true)(ChangeView);
|
||||
|
|
@ -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 (
|
||||
<div>
|
||||
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "name",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "eqtype",
|
||||
label: "人员状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: USER_TYPE,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "部门名称",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
{
|
||||
title: "岗位名称",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "身份证号",
|
||||
dataIndex: "userIdCard",
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "phone",
|
||||
},
|
||||
{
|
||||
title: "中台是否存在",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
dataIndex: "name",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{record.employmentFlag === 1
|
||||
? "在职"
|
||||
: record.employmentFlag === 1
|
||||
? "离职"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 180,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() =>
|
||||
props.history.push(`./ChangeList?id=${record.id}`)}
|
||||
>
|
||||
变更记录
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
onClick={() =>
|
||||
props.history.push(`./ChangeView?id=${record.id}&type=disposal`)}
|
||||
>
|
||||
变更处置
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
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 (
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={900}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
},
|
||||
}}
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "用户角色",
|
||||
children: getLabelName({
|
||||
status: info.roleId,
|
||||
list: rolesData,
|
||||
idKey: "id",
|
||||
nameKey: "roleName",
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "所属部门",
|
||||
children: info.departmentName,
|
||||
},
|
||||
{
|
||||
label: "是否部门负责人",
|
||||
children: (
|
||||
<div>{info.departmentLeaderFlag === 1 ? "是" : "否"}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
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: <TooltipPreviewImg files={info.userAvatarUrl} />,
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
children: info.sort,
|
||||
},
|
||||
{
|
||||
label: "邮箱",
|
||||
children: info.email,
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
children: info.remarks,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_USER], true)(List);
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
function EnterpriseMiddleground(props) {
|
||||
return <div>{props.children}</div>;
|
||||
}
|
||||
export default EnterpriseMiddleground;
|
||||
|
|
@ -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("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
|
||||
<Search
|
||||
form={form}
|
||||
onFinish={() => onFinish()}
|
||||
onReset={onReset}
|
||||
options={[
|
||||
{
|
||||
name: "likecorpName",
|
||||
label: "企业名称",
|
||||
},
|
||||
{
|
||||
name: "cityData",
|
||||
label: "属地",
|
||||
render: (
|
||||
<AreaSelect
|
||||
onGetNodePaths={nodes =>
|
||||
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,
|
||||
},
|
||||
|
||||
]}
|
||||
|
||||
/>
|
||||
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
{
|
||||
props.permission("qyd-xgf-zhgl-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{
|
||||
title: "企业名称",
|
||||
dataIndex: "corpName",
|
||||
},
|
||||
{
|
||||
title: "属地",
|
||||
dataIndex: "cityName",
|
||||
width: 300,
|
||||
render: (_, record) => (
|
||||
<div>{getAreaNamePath(record)}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
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) => (
|
||||
<Space>
|
||||
{
|
||||
props.permission("qyd-xgf-zhgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => props.history.push(`./View?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
|
||||
props.permission("qyd-xgf-zhgl-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{props.permission("qyd-xgf-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)}
|
||||
{props.permission("qyd-xgf-zhgl-delete")
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestAdd={props["corpInfoAdd"]}
|
||||
requestEdit={props["corpInfoEdit"]}
|
||||
requestDetails={props["corpInfoDetails"]}
|
||||
requestChangeCompanyName={props["corpInfoChangeCompanyName"]}
|
||||
requestCorplnfoCheckCorpcode={props["corplnfoCheckCorpcode"]}
|
||||
requestCorplnfoCheckCorpName={props["corplnfoCheckCorpName"]}
|
||||
loading={props.enterprise.enterpriseLoading}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
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 (
|
||||
<Modal
|
||||
open={props.open}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
span={24}
|
||||
|
||||
loading={props.loading}
|
||||
options={[
|
||||
{
|
||||
name: "corpName",
|
||||
label: "企业名称",
|
||||
},
|
||||
{
|
||||
name: "code",
|
||||
label: "社会统一信用代码",
|
||||
rules: [
|
||||
{
|
||||
pattern: UNIFIED_SOCIAL_CREDIT_CODE,
|
||||
message: "请输入正确的社会统一信用代码",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "ecoType",
|
||||
label: "经济类型",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="ECO_TYPE"
|
||||
onGetLabel={(label) => {
|
||||
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: (
|
||||
<DictionarySelect
|
||||
mode="multiple"
|
||||
dictValue="select_from_List"
|
||||
|
||||
onGetData={(data) => {
|
||||
setSelectfromData(data);
|
||||
}}
|
||||
|
||||
/>
|
||||
),
|
||||
},
|
||||
]}
|
||||
labelCol={{
|
||||
span: 10,
|
||||
}}
|
||||
showActionButtons={false}
|
||||
onFinish={onSubmit}
|
||||
onValuesChange={onValuesChange}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(List));
|
||||
|
|
@ -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 (
|
||||
<div>
|
||||
<HeaderBack title="查看" />
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
contentStyle={{ width: "40%" }}
|
||||
items={[
|
||||
{
|
||||
label: "企业名称",
|
||||
children: info.corpName && info.corpName,
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
children: info.corpStateName,
|
||||
},
|
||||
{
|
||||
label: "开户人",
|
||||
children: info.createName,
|
||||
},
|
||||
{
|
||||
label: "统一社会信用代码",
|
||||
children: info.code,
|
||||
},
|
||||
|
||||
{
|
||||
label: "属地",
|
||||
children: <div>{getAreaNamePath(info)}</div>,
|
||||
},
|
||||
|
||||
{
|
||||
label: "所属行业",
|
||||
children: <div>{getCorpTypeNamePath(info)}</div>,
|
||||
},
|
||||
|
||||
{
|
||||
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: (
|
||||
<div>
|
||||
|
||||
{info.lrMobile && info.lrMobile.label}
|
||||
{ (info.lrMobile && info.lrMobile.label)
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("lrMobile");
|
||||
setViewData("");
|
||||
setEncrypted(info.lrMobile);
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "主要负责人",
|
||||
children: info.contacts,
|
||||
},
|
||||
{
|
||||
label: "主要负责人手机号",
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{ info.contactsPhone && info.contactsPhone.label}
|
||||
{ (info.contactsPhone && info.contactsPhone.label)
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("contactsPhone");
|
||||
setViewData("");
|
||||
setEncrypted(info.contactsPhone);
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "成立日期",
|
||||
children: info.createDate,
|
||||
},
|
||||
{
|
||||
label: "职工人数",
|
||||
children: info.employees,
|
||||
},
|
||||
// {
|
||||
// label: "占地面积(㎡)",
|
||||
// children: info.areaCovered,
|
||||
// },
|
||||
|
||||
{
|
||||
label: "注册资金(万元)",
|
||||
children: info.regcapital,
|
||||
},
|
||||
{
|
||||
label: "资产总额(万元)",
|
||||
children: info.totalAssets,
|
||||
},
|
||||
|
||||
{
|
||||
label: "企业二维码",
|
||||
children: (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setCorpInfoQrCodeOpen(true);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "相关方类型",
|
||||
children: getLabelName({
|
||||
status: info.type,
|
||||
list: ENTERPRISE_TYPE,
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "创建单位",
|
||||
children: info.createName,
|
||||
},
|
||||
{
|
||||
label: "选取形式",
|
||||
children: info.selectfromList,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
loading={getFileLoading}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
<Divider orientation="left">营业执照</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
|
||||
items={[
|
||||
{
|
||||
label: "营业执照",
|
||||
children: <PreviewImg files={info.licenseFile} />,
|
||||
},
|
||||
{
|
||||
label: "营业执照有效期",
|
||||
children: info.licenseStart ? ` ${info.licenseStart} 至 ${info.licenseEnd}` : "",
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
contentStyle={{ width: "40%" }}
|
||||
/>
|
||||
</div>
|
||||
{corpInfoQrCodeOpen && (
|
||||
<CorpInfoQrCode
|
||||
row={info}
|
||||
open={corpInfoQrCodeOpen}
|
||||
onCancel={() => setCorpInfoQrCodeOpen(false)}
|
||||
/>
|
||||
)}
|
||||
{isModalOpen
|
||||
&& (
|
||||
<Modal
|
||||
title="查看"
|
||||
open={isModalOpen}
|
||||
onOk={handleOk}
|
||||
onCancel={() => setIsModalOpen(false)}
|
||||
>
|
||||
<Form
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
<Form.Item
|
||||
label="请输入登录密码"
|
||||
name="password"
|
||||
hidden={
|
||||
viewData
|
||||
}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="主要负责人手机号码"
|
||||
hidden={!(viewType === "contactsPhone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="法人手机号码"
|
||||
hidden={!(viewType === "lrMobile" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="安全负责人手机号码"
|
||||
hidden={!(viewType === "safetyPhone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
</Modal>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const CorpInfoQrCode = (props) => {
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="企业二维码"
|
||||
footer={[
|
||||
<Button
|
||||
key="cancel"
|
||||
onClick={props.onCancel}
|
||||
>
|
||||
关闭
|
||||
</Button>,
|
||||
]}
|
||||
onCancel={props.onCancel}
|
||||
>
|
||||
<QRCode
|
||||
value={JSON.stringify({
|
||||
corpName: props.row.corpName,
|
||||
corpinfoId: props.row.corpinfoId,
|
||||
})}
|
||||
style={{
|
||||
margin: "0 auto",
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
export default Connect([NS_ENTERPRISE], true)(View);
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
function AccountManage(props) {
|
||||
return <div>{props.children}</div>;
|
||||
}
|
||||
export default AccountManage;
|
||||
|
|
@ -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 (
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
onFinish={() => onFinish()}
|
||||
onReset={onReset}
|
||||
options={[
|
||||
{
|
||||
name: "likeCorpName",
|
||||
label: "企业名称",
|
||||
},
|
||||
{
|
||||
name: "cityData",
|
||||
label: "属地",
|
||||
render: (
|
||||
<AreaSelect
|
||||
onGetNodePaths={nodes =>
|
||||
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,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "企业名称",
|
||||
dataIndex: "corpName",
|
||||
|
||||
},
|
||||
{
|
||||
title: "相关方类型",
|
||||
dataIndex: "type",
|
||||
render: (_, record) => (
|
||||
getLabelName({
|
||||
status: record.type,
|
||||
list: ENTERPRISE_TYPE,
|
||||
})
|
||||
),
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: "属地",
|
||||
dataIndex: "cityName",
|
||||
render: (_, record) => (
|
||||
<div>{getAreaNamePath(record)}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "创建单位",
|
||||
dataIndex: "tenantName",
|
||||
},
|
||||
{
|
||||
title: "企业人数",
|
||||
dataIndex: "userCount",
|
||||
width: 120,
|
||||
render: (_, record) => (
|
||||
<div>{record.userCount ? record.userCount : "0"}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "安全人员信息数",
|
||||
dataIndex: "safetyUserCount",
|
||||
width: 140,
|
||||
},
|
||||
{
|
||||
title: "特种作业人数",
|
||||
dataIndex: "specialUserCount",
|
||||
width: 120,
|
||||
},
|
||||
// { title: "公司状态", dataIndex: "corpStateName" },
|
||||
|
||||
// { title: "启用状态", dataIndex: "useFlag", render: (_, record) => (
|
||||
// <span>{record.useFlag === 1 ? "停用" : record.useFlag === 0 ? "启用" : ""}</span>
|
||||
// ) },
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
width: 150,
|
||||
hidden: !(props.permission("qyd-xgf-yhgl-userList")),
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() =>
|
||||
props.history.push(`./UserList?id=${record.id}`)}
|
||||
>
|
||||
人员列表
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(List));
|
||||
|
|
@ -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 (
|
||||
<div>
|
||||
<HeaderBack title="相关方企业人员列表" />
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} params={{ eqCorpinfoId: queryParams["id"] }} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "likeName",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "eqEmploymentFlag",
|
||||
label: "人员类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: FLOW_USER_TYPE,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "用户名",
|
||||
dataIndex: "username",
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
{
|
||||
title: "人员类型",
|
||||
dataIndex: "employmentFlag",
|
||||
render: (_, record) => (
|
||||
<div>{record.employmentFlag === 0 ? "非流动人员" : record.employmentFlag === 1 ? "流动人员" : ""}</div>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
{
|
||||
props.permission("qyd-xgf-yhgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
|
||||
)
|
||||
}
|
||||
{props.permission("qyd-xgf-yhgl-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
requestGetEncryInfo={props["getEncryInfo"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
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 (
|
||||
<>
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={1200}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
},
|
||||
}}
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: <PreviewImg files={info.userImg} />,
|
||||
},
|
||||
{
|
||||
label: "身份证照片",
|
||||
children: <PreviewImg files={info.cardImg} />,
|
||||
},
|
||||
// {
|
||||
// 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: (
|
||||
<div>
|
||||
|
||||
{info.phone}
|
||||
{info.phone
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("phone");
|
||||
setViewData("");
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "身份证号",
|
||||
children: (
|
||||
<div>
|
||||
{info.userIdCard}
|
||||
{ info.userIdCard
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("userIdCard");
|
||||
form.resetFields();
|
||||
setViewData("");
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
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,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
{isModalOpen
|
||||
&& (
|
||||
<Modal
|
||||
title="查看"
|
||||
open={isModalOpen}
|
||||
onOk={handleOk}
|
||||
onCancel={() => setIsModalOpen(false)}
|
||||
>
|
||||
<Form
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
<Form.Item
|
||||
label="请输入登录密码"
|
||||
name="password"
|
||||
hidden={
|
||||
viewData
|
||||
}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="手机号"
|
||||
hidden={!(viewType === "phone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="身份证号"
|
||||
hidden={!(viewType === "userIdCard" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
</Modal>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_USER], true)(Permission(List));
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
function User(props) {
|
||||
return <div>{props.children}</div>;
|
||||
}
|
||||
export default User;
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
function StakeholderUnit(props) {
|
||||
return <div>{props.children}</div>;
|
||||
}
|
||||
export default StakeholderUnit;
|
||||
|
|
@ -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")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
props.history.push("./add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
// props.permission("yhglqyd-add")
|
||||
// && (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
props.history.push("./add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
// )
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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) => (
|
||||
<div>
|
||||
{record.flag === 0
|
||||
{record.rzFlag === 0
|
||||
? "否"
|
||||
: record.flag === 1
|
||||
: record.rzFlag === 1
|
||||
? "是"
|
||||
: ""}
|
||||
</div>
|
||||
|
|
@ -218,19 +234,6 @@ function List(props) {
|
|||
width: 300,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
{
|
||||
props.permission("yhglqyd-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("yhglqyd-info")
|
||||
&& (
|
||||
|
|
@ -245,6 +248,30 @@ function List(props) {
|
|||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("yhglqyd-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("yhglqyd-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
(props.permission("yhglqyd-delete")
|
||||
|
|
@ -319,7 +346,6 @@ function AddModalComponent(props) {
|
|||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
console.log(info);
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
|
|
|
|||
|
|
@ -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: (
|
||||
<Button
|
||||
|
|
@ -491,8 +526,9 @@ const CorpInfoQrCode = (props) => {
|
|||
>
|
||||
<QRCode
|
||||
value={JSON.stringify({
|
||||
corpName: props.row.corpName,
|
||||
corpinfoName: props.row.corpName,
|
||||
corpinfoId: props.row.corpinfoId,
|
||||
id: props.row.id,
|
||||
})}
|
||||
style={{
|
||||
margin: "0 auto",
|
||||
|
|
|
|||
|
|
@ -149,18 +149,18 @@ function Department(props) {
|
|||
<>
|
||||
{" "}
|
||||
{
|
||||
// props.permission("bmglxgf-add")
|
||||
// && (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
// )
|
||||
props.permission("bmglxgf-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
<Button icon={<LeftOutlined />} onClick={fnReturn}>
|
||||
返回
|
||||
|
|
@ -187,7 +187,7 @@ function Department(props) {
|
|||
},
|
||||
{
|
||||
title: "主管领导",
|
||||
dataIndex: "depOrder",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import useGetFile from "zy-react-library/hooks/useGetFile";
|
|||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
||||
import nation from "zy-react-library/json/nation.json";
|
||||
import { ID_NUMBER } from "zy-react-library/regular";
|
||||
import { ID_NUMBER, PHONE } from "zy-react-library/regular";
|
||||
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
|
@ -127,7 +127,8 @@ function Add(props) {
|
|||
status: values.maritalStatus,
|
||||
list: MARITAL_STATUS_ENUM,
|
||||
});
|
||||
await uploadFile({
|
||||
|
||||
const { id } = await uploadFile({
|
||||
single: false,
|
||||
files: values.userImg,
|
||||
params: {
|
||||
|
|
@ -140,16 +141,18 @@ function Add(props) {
|
|||
files: values.cardImg,
|
||||
params: {
|
||||
type: UPLOAD_FILE_TYPE_ENUM["14"],
|
||||
foreignKey: userID,
|
||||
foreignKey: userID || id,
|
||||
},
|
||||
});
|
||||
|
||||
if (Number.isInteger(values.age) && values.age < 0) {
|
||||
message.error("年龄请输入正整数!");
|
||||
return;
|
||||
}
|
||||
values.userId = userID || id;
|
||||
if (queryParams["id"]) {
|
||||
values.id = queryParams["id"];
|
||||
values.userId = userID;
|
||||
|
||||
props["userEdit"](values).then((res) => {
|
||||
if (res.success) {
|
||||
window.history.back();
|
||||
|
|
@ -339,9 +342,15 @@ function Add(props) {
|
|||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "username",
|
||||
name: "phone",
|
||||
label: "用户名",
|
||||
tip: "* 用户名为手机号,修改手机号,登录密码则会变成初始密码“Aa@123456789",
|
||||
rules: [
|
||||
{
|
||||
pattern: PHONE,
|
||||
message: "请输入正确的手机号",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,17 +9,25 @@ 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 useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
const JOB_STATUS = {
|
||||
1: "在职",
|
||||
0: "离职",
|
||||
3: "离职",
|
||||
11: "入职待审核",
|
||||
10: "离职待审核",
|
||||
};
|
||||
|
||||
function List(props) {
|
||||
const [selectedNodeId, setSelectedNodeId] = useState();
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [modalType, setModalType] = useState("");
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["userXgfList"], {
|
||||
form,
|
||||
|
|
@ -47,16 +55,17 @@ function List(props) {
|
|||
},
|
||||
});
|
||||
};
|
||||
const onDelete = (id) => {
|
||||
const onDelete = (row) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
content: "确定离职吗?",
|
||||
onOk: () => {
|
||||
props["userRemove"]({
|
||||
id,
|
||||
props["resignation"]({
|
||||
corpinfoId: row.corpinfoId,
|
||||
userId: row.id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
message.success("离职成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
|
|
@ -98,21 +107,6 @@ function List(props) {
|
|||
name: "likeUserIdCard",
|
||||
label: "身份证号",
|
||||
},
|
||||
{
|
||||
name: "eqPersonnelType",
|
||||
label: "基础信息填报状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [
|
||||
{
|
||||
bianma: "1",
|
||||
name: "已填报",
|
||||
},
|
||||
{
|
||||
bianma: "0",
|
||||
name: "未填报",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
|
|
@ -122,25 +116,25 @@ function List(props) {
|
|||
<>
|
||||
|
||||
{
|
||||
// props.permission("yhglxgf-add")
|
||||
// && (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
props.history.push("./add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
// )
|
||||
props.permission("yhglxgf-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
props.history.push("./add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{
|
||||
title: "用户名",
|
||||
dataIndex: "username",
|
||||
title: "手机号",
|
||||
dataIndex: "phone",
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
|
|
@ -148,7 +142,11 @@ function List(props) {
|
|||
},
|
||||
{
|
||||
title: "入职状态",
|
||||
dataIndex: "departmentName",
|
||||
dataIndex: "employmentFlag",
|
||||
render: (_, record) => (
|
||||
<div>{JOB_STATUS[record.employmentFlag] || ""}</div>
|
||||
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
|
|
@ -161,42 +159,43 @@ function List(props) {
|
|||
render: (_, record) => (
|
||||
<Space>
|
||||
{
|
||||
// props.permission("yhglxgf-info")
|
||||
// && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
// )
|
||||
props.permission("yhglxgf-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setModalType("see");
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
// props.permission("yhglxgf-resetPassword")
|
||||
// && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
// )
|
||||
props.permission("yhglxgf-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
// props.permission("yhglxgf-edit")
|
||||
// && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
// )
|
||||
props.permission("yhglxgf-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
{/* { */}
|
||||
|
|
@ -230,17 +229,47 @@ function List(props) {
|
|||
{/* ) */}
|
||||
{/* } */}
|
||||
{
|
||||
// props.permission("yhglxgf-delete")
|
||||
// && (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
// )
|
||||
(props.permission("yhglxgf-lizhi") && record.employmentFlag === 1) && (
|
||||
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record)}
|
||||
>
|
||||
离职
|
||||
</Button>
|
||||
|
||||
)
|
||||
|
||||
}
|
||||
{ (props.permission("yhglxgf-rzsh") && record.employmentFlag === 11)
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setModalType("review");
|
||||
}}
|
||||
>
|
||||
入职审核
|
||||
</Button>
|
||||
)}
|
||||
{ (props.permission("yhglxgf-lzsh") && record.employmentFlag === 10)
|
||||
&& (
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(
|
||||
`./ResignationReview?id=${record.id}&corpinfoId=${record.corpinfoId}&employmentFlag=${record.employmentFlag}`,
|
||||
);
|
||||
}}
|
||||
>
|
||||
离职审核
|
||||
</Button>
|
||||
)}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -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 (
|
||||
<>
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
title={props.modalType === "see" ? "查看" : "审核"}
|
||||
width={1200}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
|
|
@ -327,6 +398,18 @@ function AddModalComponent(props) {
|
|||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
loading={getFileLoading}
|
||||
footer={[
|
||||
<Button key="return" onClick={onCancel}>
|
||||
返回
|
||||
</Button>,
|
||||
<Button key="reject" onClick={handleReject} hidden={props.modalType === "see"}>
|
||||
驳回
|
||||
</Button>,
|
||||
<Button key="pass" type="primary" onClick={handlePass} hidden={props.modalType === "see"}>
|
||||
审核通过
|
||||
</Button>,
|
||||
|
||||
]}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
|
|
@ -452,6 +535,7 @@ function AddModalComponent(props) {
|
|||
open={isModalOpen}
|
||||
onOk={handleOk}
|
||||
onCancel={() => setIsModalOpen(false)}
|
||||
|
||||
>
|
||||
<Form
|
||||
name="basic"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,156 @@
|
|||
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_USER } from "~/enumerate/namespace";
|
||||
|
||||
const JOB_STATUS = {
|
||||
1: "在职",
|
||||
0: "离职",
|
||||
11: "入职待审核",
|
||||
10: "离职待审核",
|
||||
};
|
||||
function ResignationReview(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 (
|
||||
<div>
|
||||
<HeaderBack title="信息确认" />
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Divider orientation="left">人员信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.userName,
|
||||
},
|
||||
{
|
||||
label: "企业名称",
|
||||
// 离职取变更前 入职取变更后
|
||||
children: queryParams["employmentFlag"] === 10 ? info.corpinfoNameBefore : info.corpinfoNameAfter,
|
||||
},
|
||||
{
|
||||
label: "部门名称",
|
||||
children: queryParams["employmentFlag"] === 10 ? info.departmentNameBefore : info.departmentNameAfter,
|
||||
},
|
||||
{
|
||||
label: "岗位名称",
|
||||
children: queryParams["employmentFlag"] === 10 ? info.postNameBefore : info.postNameAfter,
|
||||
},
|
||||
{
|
||||
label: "员工状态",
|
||||
children: queryParams["employmentFlag"] === 10 ? JOB_STATUS[info.userStatusBefore] : JOB_STATUS[info.userStatusAfter],
|
||||
|
||||
},
|
||||
{
|
||||
label: "离职原因",
|
||||
children: info.resignationReason,
|
||||
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
|
||||
<Divider orientation="left"> 未完成工作</Divider>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "工作项目",
|
||||
dataIndex: "workProject",
|
||||
},
|
||||
{
|
||||
title: "工作内容",
|
||||
dataIndex: "workContent",
|
||||
},
|
||||
|
||||
]}
|
||||
dataSource={info.userJobHandoverCOList}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div style={{ textAlign: "center", height: 50, marginTop: 20 }} className="no-print">
|
||||
|
||||
<Button style={{ marginRight: 20 }} onClick={onGoBack}>
|
||||
取消
|
||||
</Button>
|
||||
|
||||
<Button key="reject" onClick={handleReject} style={{ marginRight: 20 }}>
|
||||
驳回
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
type="primary"
|
||||
|
||||
onClick={onSubmit}
|
||||
|
||||
>
|
||||
通过
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
);
|
||||
}
|
||||
export default Connect([NS_USER], true)(ResignationReview);
|
||||
|
|
@ -170,8 +170,8 @@ function List(props) {
|
|||
toolBarRender={() => (
|
||||
<>
|
||||
{
|
||||
// props.permission("zgszhgl-add")
|
||||
// && (
|
||||
props.permission("zgszhgl-add")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
|
|
@ -182,7 +182,7 @@ function List(props) {
|
|||
>
|
||||
新增
|
||||
</Button>
|
||||
// )
|
||||
)
|
||||
}
|
||||
</>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -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) => (
|
||||
<div>
|
||||
|
|
@ -154,7 +154,7 @@ function List(props) {
|
|||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
// hidden: !(props.permission("zgsbmgl-list")),
|
||||
hidden: !(props.permission("zgsbmgl-list")),
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ function View(props) {
|
|||
return {
|
||||
...formData,
|
||||
eqCorpinfoId: queryParams["id"],
|
||||
eqParentId: selectedNodeId,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -32,7 +32,16 @@ const ENTERPRISE_STATUS = [
|
|||
name: "破产",
|
||||
},
|
||||
];
|
||||
|
||||
const STATUS = [
|
||||
{
|
||||
bianma: 1,
|
||||
name: "启用",
|
||||
},
|
||||
{
|
||||
bianma: 0,
|
||||
name: "停用",
|
||||
},
|
||||
];
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||
|
|
@ -95,6 +104,12 @@ function List(props) {
|
|||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
},
|
||||
{
|
||||
name: "eqUseFlag",
|
||||
label: "账户状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: STATUS,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -128,7 +143,7 @@ function List(props) {
|
|||
dataIndex: "corpStateName",
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
title: "账户状态",
|
||||
dataIndex: "useFlag",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
|
|
@ -153,15 +168,15 @@ function List(props) {
|
|||
render: (_, record) => (
|
||||
<Space>
|
||||
{
|
||||
// props.permission("zgsqyxxgl-info")
|
||||
// && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => props.history.push(`./View?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
// )
|
||||
props.permission("zgsqyxxgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => props.history.push(`./View?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("zgsqyxxgl-location")
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div>
|
||||
|
|
@ -66,7 +72,7 @@ function View(props) {
|
|||
},
|
||||
{
|
||||
label: "属地",
|
||||
children: info.cityName,
|
||||
children: <div>{getAreaNamePath(info) || ""}</div>,
|
||||
},
|
||||
{
|
||||
label: "邮政编码",
|
||||
|
|
@ -109,7 +115,7 @@ function View(props) {
|
|||
},
|
||||
{
|
||||
label: "所属行业",
|
||||
children: <div>{getCorpTypeNamePath(info)}</div>,
|
||||
children: <div>{ getCorpTypeNamePath(info) || ""}</div>,
|
||||
},
|
||||
{
|
||||
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%" }}
|
||||
/>
|
||||
<Divider orientation="left">公司法定代表人信息</Divider>
|
||||
<Descriptions
|
||||
|
|
@ -153,17 +160,40 @@ function View(props) {
|
|||
items={[
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.lrName,
|
||||
children: <div style={{ width: "100%" }}>{info.lrName}</div>,
|
||||
|
||||
},
|
||||
{
|
||||
label: "手机号码",
|
||||
children: info.lrMobile,
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{info.lrMobile && info.lrMobile.label}
|
||||
{ (info.lrMobile && info.lrMobile.label)
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("lrMobile");
|
||||
setViewData("");
|
||||
setEncrypted(info.lrMobile);
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
width: 210,
|
||||
}}
|
||||
contentStyle={{ width: "37%" }}
|
||||
/>
|
||||
<Divider orientation="left">主要负责人信息</Divider>
|
||||
<Descriptions
|
||||
|
|
@ -175,13 +205,35 @@ function View(props) {
|
|||
},
|
||||
{
|
||||
label: "手机号码",
|
||||
children: info.contactsPhone,
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{ info.contactsPhone && info.contactsPhone.label}
|
||||
{ (info.contactsPhone && info.contactsPhone.label)
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("contactsPhone");
|
||||
setViewData("");
|
||||
setEncrypted(info.contactsPhone);
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
width: 210,
|
||||
}}
|
||||
contentStyle={{ width: "37%" }}
|
||||
/>
|
||||
<Divider orientation="left">安全负责人信息</Divider>
|
||||
<Descriptions
|
||||
|
|
@ -193,13 +245,35 @@ function View(props) {
|
|||
},
|
||||
{
|
||||
label: "手机号码",
|
||||
children: info.safetyPhone,
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{info.safetyPhone && info.safetyPhone.label}
|
||||
{ (info.safetyPhone && info.safetyPhone.label)
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("safetyPhone");
|
||||
setEncrypted(info.safetyPhone);
|
||||
setViewData("");
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
width: 210,
|
||||
}}
|
||||
contentStyle={{ width: "37%" }}
|
||||
/>
|
||||
{/* <Divider orientation="left">企业相关属性</Divider> */}
|
||||
{/* <Descriptions */}
|
||||
|
|
@ -226,6 +300,50 @@ function View(props) {
|
|||
{/* /> */}
|
||||
</div>
|
||||
</div>
|
||||
{isModalOpen
|
||||
&& (
|
||||
<Modal
|
||||
title="查看"
|
||||
open={isModalOpen}
|
||||
onOk={handleOk}
|
||||
onCancel={() => setIsModalOpen(false)}
|
||||
>
|
||||
<Form
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
<Form.Item
|
||||
label="请输入登录密码"
|
||||
name="password"
|
||||
hidden={
|
||||
viewData
|
||||
}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="主要负责人手机号码"
|
||||
hidden={!(viewType === "contactsPhone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="法人手机号码"
|
||||
hidden={!(viewType === "lrMobile" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="安全负责人手机号码"
|
||||
hidden={!(viewType === "safetyPhone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
</Modal>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) => (
|
||||
<span>
|
||||
|
|
@ -114,7 +114,7 @@ function List(props) {
|
|||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
// hidden: !(props.permission("zgsyhgl-info")),
|
||||
hidden: !(props.permission("zgsyhgl-info")),
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ function List(props) {
|
|||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "用户名",
|
||||
dataIndex: "username",
|
||||
title: "手机号",
|
||||
dataIndex: "phone",
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Form } from "antd";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
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 useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
const ENTERPRISE_TYPE = [
|
||||
|
|
@ -29,61 +30,81 @@ function List(props) {
|
|||
},
|
||||
});
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "name",
|
||||
label: "公司名称",
|
||||
},
|
||||
{
|
||||
name: "eqtype",
|
||||
label: "企业类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_TYPE,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "变更时间",
|
||||
dataIndex: "updateTime",
|
||||
},
|
||||
{
|
||||
title: "企业名称",
|
||||
dataIndex: "corpinfoName",
|
||||
},
|
||||
{
|
||||
title: "部门名称",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
{
|
||||
title: "岗位名称",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "员工",
|
||||
dataIndex: "name",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{record.employmentFlag === 1
|
||||
? "在职"
|
||||
: record.employmentFlag === 1
|
||||
? "离职"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
<div>
|
||||
<HeaderBack title="变更记录列表" />
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "name",
|
||||
label: "公司名称",
|
||||
},
|
||||
{
|
||||
name: "eqtype",
|
||||
label: "企业类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_TYPE,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "变更时间",
|
||||
dataIndex: "updateTime",
|
||||
},
|
||||
{
|
||||
title: "企业名称",
|
||||
dataIndex: "corpinfoName",
|
||||
},
|
||||
{
|
||||
title: "部门名称",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
{
|
||||
title: "岗位名称",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "员工",
|
||||
dataIndex: "name",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{record.employmentFlag === 1
|
||||
? "在职"
|
||||
: record.employmentFlag === 1
|
||||
? "离职"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() =>
|
||||
props.history.push(`./ChangeView?id=${record.id}&type=record`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div>
|
||||
<HeaderBack title="变更记录" />
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Divider orientation="left">变更前信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.username,
|
||||
},
|
||||
{
|
||||
label: "企业名称",
|
||||
children: info.corpinfoNameBefore,
|
||||
},
|
||||
{
|
||||
label: "部门名称",
|
||||
children: info.departmentNameBefore,
|
||||
},
|
||||
{
|
||||
label: "岗位名称",
|
||||
children: info.postNameBefore,
|
||||
},
|
||||
{
|
||||
label: "员工状态",
|
||||
children: info.userStatusBefore,
|
||||
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
<Divider orientation="left">变更后信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "姓名",
|
||||
children: info.username,
|
||||
},
|
||||
{
|
||||
label: "企业名称",
|
||||
children: info.corpinfoNameAfter,
|
||||
},
|
||||
{
|
||||
label: "部门名称",
|
||||
children: info.departmentNameAfter,
|
||||
},
|
||||
{
|
||||
label: "岗位名称",
|
||||
children: info.postNameAfter,
|
||||
},
|
||||
{
|
||||
label: "员工状态",
|
||||
children: info.userStatusAfter,
|
||||
},
|
||||
{
|
||||
label: "变更时间",
|
||||
children: info.changeTime,
|
||||
contentStyle: { display: queryParams["type"] === "disposal" ? "none" : "" },
|
||||
labelStyle: { display: queryParams["type"] === "disposal" ? "none" : "" },
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
<Divider orientation="left">{queryParams["type"] === "disposal" ? "未完成工作" : "工作交接"}</Divider>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "工作项目",
|
||||
dataIndex: "corpName",
|
||||
},
|
||||
{
|
||||
title: "工作内容",
|
||||
dataIndex: "type",
|
||||
},
|
||||
{
|
||||
title: "处理人",
|
||||
dataIndex: "departMentCount",
|
||||
hidden: queryParams["type"] === "disposal",
|
||||
},
|
||||
]}
|
||||
dataSource={info.userJobHandoverCOList}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{
|
||||
queryParams["type"] === "disposal"
|
||||
|
||||
&& (
|
||||
<div style={{ textAlign: "center", height: 50, marginTop: 20 }} className="no-print">
|
||||
|
||||
<Button style={{ marginRight: 20 }} onClick={onGoBack}>
|
||||
取消
|
||||
</Button>
|
||||
|
||||
<Button key="reject" onClick={handleReject} style={{ marginRight: 20 }}>
|
||||
驳回
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
type="primary"
|
||||
|
||||
onClick={onSubmit}
|
||||
|
||||
>
|
||||
通过
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE, NS_USER], true)(ChangeView);
|
||||
|
|
@ -31,6 +31,7 @@ function List(props) {
|
|||
},
|
||||
});
|
||||
return (
|
||||
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
|
|
@ -44,7 +45,7 @@ function List(props) {
|
|||
label: "公司名称",
|
||||
},
|
||||
{
|
||||
name: "eqtype",
|
||||
name: "eqType",
|
||||
label: "企业类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_TYPE,
|
||||
|
|
@ -85,6 +86,9 @@ function List(props) {
|
|||
{
|
||||
title: "中台人员存在数",
|
||||
dataIndex: "middleUserCount",
|
||||
render: (_, record) => (
|
||||
<div>{record.middleUserCount ?? 0}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<HeaderBack title="列表" />
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: 20,
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
display: "flex",
|
||||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "name",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "eqtype",
|
||||
label: "人员状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: USER_TYPE,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "部门名称",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
{
|
||||
title: "岗位名称",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "身份证号",
|
||||
dataIndex: "userIdCard",
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "phone",
|
||||
},
|
||||
{
|
||||
title: "中台是否存在",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
dataIndex: "name",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{record.employmentFlag === 1
|
||||
? "在职"
|
||||
: record.employmentFlag === 1
|
||||
? "离职"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 180,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() =>
|
||||
props.history.push(`./ChangeList?id=${record.id}`)}
|
||||
>
|
||||
变更记录
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
<LeftTree onSelect={onTreeChange} params={{ eqCorpinfoId: queryParams["id"] }} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "name",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "eqtype",
|
||||
label: "人员状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: USER_TYPE,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "部门名称",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
{
|
||||
title: "岗位名称",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "身份证号",
|
||||
dataIndex: "userIdCard",
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
dataIndex: "phone",
|
||||
},
|
||||
{
|
||||
title: "中台是否存在",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
dataIndex: "name",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{record.employmentFlag === 1
|
||||
? "在职"
|
||||
: record.employmentFlag === 1
|
||||
? "离职"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 180,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() =>
|
||||
props.history.push(`./ChangeList?id=${record.id}`)}
|
||||
>
|
||||
变更记录
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
danger
|
||||
onClick={() =>
|
||||
props.history.push(`./ChangeView?id=${record.id}&type=disposal`)}
|
||||
>
|
||||
变更处置
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
|
||||
<Search
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
onFinish={() => onFinish()}
|
||||
onReset={onReset}
|
||||
options={[
|
||||
{
|
||||
name: "likecorpName",
|
||||
label: "相关方名称",
|
||||
},
|
||||
{
|
||||
name: "eqCity",
|
||||
name: "cityData",
|
||||
label: "属地",
|
||||
render: <DictionarySelect dictValue="res_region_enum" />,
|
||||
render: (
|
||||
<AreaSelect
|
||||
onGetNodePaths={nodes =>
|
||||
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) => (
|
||||
<div>{getAreaNamePath(record)}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
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) => (
|
||||
<Space>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div>
|
||||
<HeaderBack title="查看" />
|
||||
|
|
@ -69,6 +83,7 @@ function View(props) {
|
|||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
contentStyle={{ width: "40%" }}
|
||||
items={[
|
||||
{
|
||||
label: "企业名称",
|
||||
|
|
@ -121,7 +136,28 @@ function View(props) {
|
|||
},
|
||||
{
|
||||
label: "法人手机号",
|
||||
children: info.lrMobile,
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{info.lrMobile && info.lrMobile.label}
|
||||
{ (info.lrMobile && info.lrMobile.label)
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("lrMobile");
|
||||
setViewData("");
|
||||
setEncrypted(info.lrMobile);
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "主要负责人",
|
||||
|
|
@ -129,7 +165,28 @@ function View(props) {
|
|||
},
|
||||
{
|
||||
label: "主要负责人手机号",
|
||||
children: info.contactsPhone,
|
||||
children: (
|
||||
<div>
|
||||
|
||||
{ info.contactsPhone && info.contactsPhone.label}
|
||||
{ (info.contactsPhone && info.contactsPhone.label)
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
setViewType("contactsPhone");
|
||||
setViewData("");
|
||||
setEncrypted(info.contactsPhone);
|
||||
form.resetFields();
|
||||
}}
|
||||
>
|
||||
点击查看
|
||||
</Button>
|
||||
)}
|
||||
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
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) {
|
|||
</Button>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "相关方类型",
|
||||
children: getLabelName({
|
||||
status: info.type,
|
||||
list: ENTERPRISE_TYPE,
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "创建单位",
|
||||
children: info.createName,
|
||||
|
|
@ -184,6 +248,7 @@ function View(props) {
|
|||
<Divider orientation="left">营业执照</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
|
||||
items={[
|
||||
{
|
||||
label: "营业执照",
|
||||
|
|
@ -198,6 +263,7 @@ function View(props) {
|
|||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
contentStyle={{ width: "40%" }}
|
||||
/>
|
||||
</div>
|
||||
{corpInfoQrCodeOpen && (
|
||||
|
|
@ -207,6 +273,50 @@ function View(props) {
|
|||
onCancel={() => setCorpInfoQrCodeOpen(false)}
|
||||
/>
|
||||
)}
|
||||
{isModalOpen
|
||||
&& (
|
||||
<Modal
|
||||
title="查看"
|
||||
open={isModalOpen}
|
||||
onOk={handleOk}
|
||||
onCancel={() => setIsModalOpen(false)}
|
||||
>
|
||||
<Form
|
||||
name="basic"
|
||||
form={form}
|
||||
>
|
||||
<Form.Item
|
||||
label="请输入登录密码"
|
||||
name="password"
|
||||
hidden={
|
||||
viewData
|
||||
}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="主要负责人手机号码"
|
||||
hidden={!(viewType === "contactsPhone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="法人手机号码"
|
||||
hidden={!(viewType === "lrMobile" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="安全负责人手机号码"
|
||||
hidden={!(viewType === "safetyPhone" && viewData)}
|
||||
>
|
||||
{viewData}
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
</Modal>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -227,8 +337,9 @@ const CorpInfoQrCode = (props) => {
|
|||
>
|
||||
<QRCode
|
||||
value={JSON.stringify({
|
||||
corpName: props.row.corpName,
|
||||
corpinfoName: props.row.corpName,
|
||||
corpinfoId: props.row.corpinfoId,
|
||||
id: props.row.id,
|
||||
})}
|
||||
style={{
|
||||
margin: "0 auto",
|
||||
|
|
|
|||
|
|
@ -2,14 +2,16 @@ 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 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 { 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";
|
||||
|
||||
|
|
@ -28,15 +30,38 @@ const ENTERPRISE_TYPE = [
|
|||
|
||||
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 (
|
||||
<div
|
||||
style={{
|
||||
|
|
@ -45,42 +70,65 @@ function List(props) {
|
|||
>
|
||||
<Search
|
||||
form={form}
|
||||
onFinish={() => onFinish()}
|
||||
onReset={onReset}
|
||||
options={[
|
||||
{
|
||||
name: "likeCorpName",
|
||||
label: "相关方单位名称",
|
||||
label: "企业名称",
|
||||
},
|
||||
{
|
||||
name: "cityData",
|
||||
label: "属地",
|
||||
render: (
|
||||
<AreaSelect
|
||||
onGetNodePaths={nodes =>
|
||||
setCityData(nodes)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{ name: "eqType", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
|
||||
{ name: "selectFrom", label: "选取形式", render: (
|
||||
<DictionarySelect
|
||||
dictValue="select_from_List"
|
||||
/>
|
||||
) },
|
||||
{
|
||||
name: "cityRecord",
|
||||
label: "属地",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
onlyForLabel: true,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "相关方单位名称",
|
||||
title: "企业名称",
|
||||
dataIndex: "corpName",
|
||||
|
||||
},
|
||||
{
|
||||
title: "选取形式",
|
||||
dataIndex: "selectfromString",
|
||||
title: "企业类型",
|
||||
dataIndex: "type",
|
||||
render: (_, record) => (
|
||||
getLabelName({
|
||||
status: record.type,
|
||||
list: ENTERPRISE_TYPE,
|
||||
})
|
||||
),
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: "属地",
|
||||
dataIndex: "cityName",
|
||||
|
||||
render: (_, record) => (
|
||||
<div>{getAreaNamePath(record)}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "创建单位",
|
||||
dataIndex: "createName",
|
||||
dataIndex: "tenantName",
|
||||
},
|
||||
{
|
||||
title: "企业人数",
|
||||
dataIndex: "userCount",
|
||||
width: 120,
|
||||
render: (_, record) => (
|
||||
<div>{record.userCount ? record.userCount : "0"}</div>
|
||||
),
|
||||
|
|
@ -88,10 +136,12 @@ function List(props) {
|
|||
{
|
||||
title: "安全人员信息数",
|
||||
dataIndex: "safetyUserCount",
|
||||
width: 140,
|
||||
},
|
||||
{
|
||||
title: "特种作业人数",
|
||||
dataIndex: "specialUserCount",
|
||||
width: 120,
|
||||
},
|
||||
// { title: "公司状态", dataIndex: "corpStateName" },
|
||||
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<HeaderBack title="相关方企业人员列表" />
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: 20,
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} params={{ eqCorpinfoId: queryParams["id"] }} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
display: "flex",
|
||||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "likeName",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "eqPersonnelType",
|
||||
label: "人员类型",
|
||||
render: <DictionarySelect dictValue="renyuanleixing" />,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "用户名",
|
||||
dataIndex: "username",
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
{
|
||||
title: "人员类型",
|
||||
dataIndex: "personnelTypeName",
|
||||
},
|
||||
<LeftTree onSelect={onTreeChange} params={{ eqCorpinfoId: queryParams["id"] }} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "likeName",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "eqEmploymentFlag",
|
||||
label: "人员类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: FLOW_USER_TYPE,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "用户名",
|
||||
dataIndex: "username",
|
||||
},
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "departmentName",
|
||||
},
|
||||
{
|
||||
title: "人员类型",
|
||||
dataIndex: "personnelTypeName",
|
||||
},
|
||||
|
||||
{
|
||||
title: "操作",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
{props.permission("ryxxgl-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)}
|
||||
{
|
||||
// props.permission("ryxxgl-info")
|
||||
// && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
{
|
||||
title: "操作",
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
{props.permission("ryxxgl-resetPassword")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => onResetPassword(record.id)}
|
||||
>
|
||||
重置密码
|
||||
</Button>
|
||||
)}
|
||||
{
|
||||
props.permission("ryxxgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
|
||||
// )
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
)
|
||||
}
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
requestGetEncryInfo={props["getEncryInfo"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
requwstRolesAll={props["rolesAll"]}
|
||||
requestGetEncryInfo={props["getEncryInfo"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "企业名称",
|
||||
children: info.corpName && info.corpName,
|
||||
span: 4,
|
||||
},
|
||||
{
|
||||
label: "统一社会信用代码",
|
||||
children: info.code,
|
||||
span: 4,
|
||||
},
|
||||
|
||||
{
|
||||
label: "所属区域",
|
||||
children: <div>{getAreaNamePath(info)}</div>,
|
||||
span: 4,
|
||||
},
|
||||
|
||||
{
|
||||
label: "成立时间",
|
||||
children: info.createDate,
|
||||
span: 4,
|
||||
},
|
||||
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
|
||||
<div
|
||||
style={{
|
||||
marginTop: 10,
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
{props.permission("gfd-qyxxgl-edit")
|
||||
&& (
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
props.history.push(`./update?id=${info.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE], true)(Permission(Info));
|
||||
|
|
@ -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 (
|
||||
<>
|
||||
<HeaderBack title="编辑" />
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
|
||||
loading={
|
||||
|
||||
props.enterprise.enterpriseLoading
|
||||
}
|
||||
options={[
|
||||
{
|
||||
label: "基本信息",
|
||||
render: FORM_ITEM_RENDER_ENUM.DIVIDER,
|
||||
},
|
||||
{
|
||||
label: "企业名称",
|
||||
name: "corpName",
|
||||
required: false,
|
||||
|
||||
span: 24,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "社会统一信用代码",
|
||||
name: "code",
|
||||
|
||||
span: 24,
|
||||
rules: [
|
||||
{
|
||||
pattern: UNIFIED_SOCIAL_CREDIT_CODE,
|
||||
message: "请输入正确的社会统一信用代码",
|
||||
},
|
||||
],
|
||||
|
||||
},
|
||||
{
|
||||
label: "所属区域",
|
||||
span: 24,
|
||||
name: "region",
|
||||
render: (
|
||||
<AreaSelect
|
||||
onGetNodePaths={nodes =>
|
||||
setCityData(nodes)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "成立时间",
|
||||
name: "createDate",
|
||||
span: 24,
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
},
|
||||
|
||||
]}
|
||||
labelCol={{
|
||||
span: 6,
|
||||
}}
|
||||
onFinish={onSubmit}
|
||||
onValuesChange={onValuesChange}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
export default Connect([NS_ENTERPRISE], true)(Update);
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
function CorpInfo(props) {
|
||||
return <div>{props.children}</div>;
|
||||
}
|
||||
export default CorpInfo;
|
||||
|
|
@ -282,8 +282,9 @@ function Add(props) {
|
|||
name: "departmentId",
|
||||
label: "所属部门",
|
||||
render: (
|
||||
<DepartmentSelectTree onGetNodePaths={fnChoiceDepartment} />
|
||||
<DepartmentSelectTree onGetNodePaths={fnChoiceDepartment} disabled={queryParams["id"]} />
|
||||
),
|
||||
|
||||
},
|
||||
|
||||
{
|
||||
|
|
@ -302,6 +303,9 @@ function Add(props) {
|
|||
labelKey: "postName",
|
||||
valueKey: "id",
|
||||
},
|
||||
componentProps: {
|
||||
disabled: queryParams["id"],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
|
|
|
|||
|
|
@ -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) {
|
|||
>
|
||||
<Search
|
||||
form={form}
|
||||
labelCol={{ span: 7 }}
|
||||
options={[
|
||||
{
|
||||
name: "likeName",
|
||||
|
|
@ -142,10 +146,23 @@ function List(props) {
|
|||
valueKey: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "eqEmploymentFlag",
|
||||
label: "人员在职状态",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="employmentFlag"
|
||||
idKey="dictAutoValue"
|
||||
onGetData={data => setEmploymentFlagData(data)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
loading={props.user.userLoading}
|
||||
rowSelection={{
|
||||
selectedRowKeys,
|
||||
|
|
@ -263,25 +280,41 @@ function List(props) {
|
|||
title: "所属岗位",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "人员在职状态",
|
||||
dataIndex: "employmentFlag",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{
|
||||
|
||||
getLabelName({
|
||||
status: String(record.employmentFlag),
|
||||
list: employmentFlagData,
|
||||
idKey: "dictAutoValue",
|
||||
nameKey: "dictLabel",
|
||||
})
|
||||
}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 300,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
{
|
||||
// props.permission("zhgl-info")
|
||||
// && (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
// )
|
||||
props.permission("zhgl-info")
|
||||
&& (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
{
|
||||
props.permission("zhgl-edit")
|
||||
|
|
@ -434,6 +467,7 @@ function AddModalComponent(props) {
|
|||
{
|
||||
label: "所属部门",
|
||||
children: info.departmentName,
|
||||
|
||||
},
|
||||
{
|
||||
label: "是否部门负责人",
|
||||
|
|
|
|||
|
|
@ -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("/");
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue