no message
parent
0c481644fb
commit
80dd9b0de0
|
|
@ -0,0 +1,22 @@
|
|||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||
|
||||
export const corpQualificationInfoList = declareRequest(
|
||||
"corpQualificationLoading",
|
||||
"Post > @/basic-info/corpQualificationInfo/list",
|
||||
);
|
||||
export const corpQualificationInfoDetails = declareRequest(
|
||||
"corpQualificationLoading",
|
||||
"Post > @/basic-info/corpQualificationInfo/info/{id}",
|
||||
);
|
||||
export const corpQualificationInfoAdd = declareRequest(
|
||||
"corpQualificationLoading",
|
||||
"Post > @/basic-info/corpQualificationInfo/save",
|
||||
);
|
||||
export const corpQualificationInfoEdit = declareRequest(
|
||||
"corpQualificationLoading",
|
||||
"Post > @/basic-info/corpQualificationInfo/edit",
|
||||
);
|
||||
export const corpQualificationInfoRemove = declareRequest(
|
||||
"corpQualificationLoading",
|
||||
"Post > @/basic-info/corpQualificationInfo/remove/{id}",
|
||||
);
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||
|
||||
export const departmentList = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basic-info/department/list",
|
||||
);
|
||||
|
||||
export const departmentAdd = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basic-info/department/save",
|
||||
);
|
||||
|
||||
export const departmentEdit = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basic-info/department/edit",
|
||||
);
|
||||
export const departmentDetails = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basic-info/department/info/{id}",
|
||||
);
|
||||
|
||||
export const departmentRemove = declareRequest(
|
||||
"departmentLoading",
|
||||
"Post > @/basic-info/department/remove/{id}",
|
||||
);
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||
|
||||
export const corpInfoList = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/list",
|
||||
);
|
||||
export const corpInfoRemoveDetails = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/info/{id}",
|
||||
);
|
||||
export const corpInfoAdd = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/save",
|
||||
);
|
||||
export const corpInfoEdit = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/edit",
|
||||
);
|
||||
export const corpInfoChangePassword = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/changePassword/{id}",
|
||||
);
|
||||
export const corpInfoChangeCompanyName = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/changeCompanyName",
|
||||
);
|
||||
export const corpInfoChangeUseFlag = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/changeUseFlag",
|
||||
);
|
||||
|
||||
export const corpInfoRemove = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/remove/{id}",
|
||||
);
|
||||
export const corpInfoRemoveMultiple = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/ids",
|
||||
);
|
||||
|
||||
export const corpUserMiddlePage = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/corpUserMiddlePage",
|
||||
);
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||
|
||||
export const userQualificationInfoList = declareRequest(
|
||||
"userQualificationLoading",
|
||||
"Post > @/basic-info/userQualificationInfo/list",
|
||||
);
|
||||
export const userQualificationInfoDetails = declareRequest(
|
||||
"userQualificationLoading",
|
||||
"Get > /basic-info/userQualificationInfo/getInfoById?id={id}",
|
||||
);
|
||||
export const userQualificationInfoAdd = declareRequest(
|
||||
"userQualificationLoading",
|
||||
"Post > @/basic-info/userQualificationInfo/save",
|
||||
);
|
||||
export const userQualificationInfoEdit = declareRequest(
|
||||
"userQualificationLoading",
|
||||
"Put > @/basic-info/userQualificationInfo/edit",
|
||||
);
|
||||
export const userQualificationInfoRemove = declareRequest(
|
||||
"userQualificationLoading",
|
||||
"Put > @/basic-info/userQualificationInfo/remove?id={id}",
|
||||
);
|
||||
export const dictData = declareRequest(
|
||||
"userLoading",
|
||||
"Get > /config/dict-trees/list/by/dictValues?",
|
||||
);
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||
|
||||
export const postList = declareRequest(
|
||||
"postLoading",
|
||||
"Post > @/basic-info/post/list",
|
||||
);
|
||||
|
||||
export const postAdd = declareRequest(
|
||||
"postLoading",
|
||||
"Post > @/basic-info/post/save",
|
||||
);
|
||||
|
||||
export const postEdit = declareRequest(
|
||||
"postLoading",
|
||||
"Put > @/basic-info/post/edit",
|
||||
);
|
||||
export const postDetails = declareRequest(
|
||||
"postLoading",
|
||||
"Get > /basic-info/post/getInfoById?id={id}",
|
||||
);
|
||||
|
||||
export const postRemove = declareRequest(
|
||||
"postLoading",
|
||||
"Put > @/basic-info/post/remove?id={id}",
|
||||
);
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||
|
||||
export const userList = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/user/list",
|
||||
);
|
||||
export const userAdd = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/user/save",
|
||||
);
|
||||
|
||||
export const userEdit = declareRequest(
|
||||
"userLoading",
|
||||
"Put > @/basic-info/user/edit",
|
||||
);
|
||||
export const userDetails = declareRequest(
|
||||
"userLoading",
|
||||
"Get > /basic-info/user/{id}",
|
||||
);
|
||||
|
||||
export const userSaveXgfAdd = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/user/saveXgf",
|
||||
);
|
||||
export const userRemove = declareRequest(
|
||||
"userLoading",
|
||||
"Delete > @/basic-info/user/{id}",
|
||||
);
|
||||
export const userRemoveIds = declareRequest(
|
||||
"userLoading",
|
||||
"Delete > @/basic-info/user/ids?ids={ids}",
|
||||
);
|
||||
export const postAll = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/post/listAll",
|
||||
);
|
||||
// 获取角色
|
||||
export const rolesAll = declareRequest(
|
||||
"userLoading",
|
||||
"Get > /system/operation/roles",
|
||||
);
|
||||
export const dictData = declareRequest(
|
||||
"userLoading",
|
||||
"Get > /config/dict-trees/list/by/dictValues?",
|
||||
);
|
||||
|
||||
export const userEmploymentLogAll = declareRequest(
|
||||
"userLoading",
|
||||
"Get > /basic-info/userEmploymentLog/listAll",
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -5,3 +5,9 @@
|
|||
import { defineNamespace } from "@cqsjjb/jjb-dva-runtime";
|
||||
|
||||
export const NS_GLOBAL = defineNamespace("global");
|
||||
export const NS_ENTERPRISE = defineNamespace("enterprise");
|
||||
export const NS_DEPARTMENT = defineNamespace("department");
|
||||
export const NS_POST = defineNamespace("post");
|
||||
export const NS_USER = defineNamespace("user");
|
||||
export const NS_PERSNONEL_CERTFICATE = defineNamespace("personnelCertificate");
|
||||
export const NS_BUSINESSLICENSE = defineNamespace("businessLicense");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,178 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_BUSINESSLICENSE } from "~/enumerate/namespace";
|
||||
|
||||
const CorpinfoId = "1983773013086048256";
|
||||
function Department(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["corpQualificationInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
corpinfoIdString: CorpinfoId,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["corpQualificationInfoRemove"]({ id });
|
||||
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "keyWords", label: "证书名称" },
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
loading={props.businessLicense.corpQualificationLoading}
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "资质名称", dataIndex: "qualificationName" },
|
||||
{ title: "证书编号", dataIndex: "certificateNo" },
|
||||
{ title: "证书有效期", dataIndex: "ValidityTime", render: (text, record) => (<sapn>{`${record.startValidityTime}至${record.endValidityTime}`}</sapn>) },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</Button>
|
||||
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
requestAdd={props["corpQualificationInfoAdd"]}
|
||||
requestEdit={props["corpQualificationInfoEdit"]}
|
||||
requestDetails={props["corpQualificationInfoDetails"]}
|
||||
open={addModalOpen}
|
||||
loding={props.businessLicense.corpQualificationLoading}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
res.data.startValidity = [res.data.startValidityTime, res.data.endValidityTime];
|
||||
form.setFieldsValue(res.data);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
values.corpinfoId = CorpinfoId;
|
||||
values.startValidityTime = values.startValidity[0];
|
||||
values.endValidityTime = values.startValidity[1];
|
||||
values.userIdString = "1985635856156274689";
|
||||
|
||||
delete values.startValidity;
|
||||
if (props.currentId) {
|
||||
values.id = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values);
|
||||
}
|
||||
|
||||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
loading={props.loding}
|
||||
>
|
||||
<FormBuilder
|
||||
values={{
|
||||
securityFlag: 0,
|
||||
}}
|
||||
form={form}
|
||||
span={24}
|
||||
labelCol={{ span: 10 }}
|
||||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "qualificationName", label: "资质名称" },
|
||||
{ name: "certificateNo", label: "证书编号" },
|
||||
{ name: "startValidity", label: "证书有效期", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||
{ name: "version", label: "版本号" },
|
||||
{ name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
|
||||
]}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_BUSINESSLICENSE], true)(Department);
|
||||
|
|
@ -1,63 +1,76 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Divider } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
function Info(props) {
|
||||
const [info, setInfo] = useState({});
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props.corpInfoRemoveDetails({ id: "1985906265017954306" });
|
||||
setInfo(res.data);
|
||||
// 不要在这里 log info,它还是旧的
|
||||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={1}
|
||||
column={2}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "企业名称", children: "Zhou" },
|
||||
{ label: "统一社会信用代码", children: "Zhou" },
|
||||
{ label: "所属区域", children: "Zhou" },
|
||||
{ label: "邮政编码", children: "Zhou" },
|
||||
{ label: "成立时间", children: "Zhou" },
|
||||
{ label: "规模", children: "Zhou" },
|
||||
{ label: "经度", children: "Zhou" },
|
||||
{ label: "纬度", children: "Zhou" },
|
||||
{ label: "职工人数", children: "Zhou" },
|
||||
{ label: "占地面积(㎡)", children: "Zhou" },
|
||||
{ label: "资产总额(万元)", children: "Zhou" },
|
||||
{ label: "注册资金(万元)", children: "Zhou" },
|
||||
{ label: "经济类型", children: "Zhou" },
|
||||
{ label: "所属行业", children: "Zhou" },
|
||||
{ label: "法定代表人", children: "Zhou" },
|
||||
{ label: "法人手机号", children: "Zhou" },
|
||||
{ label: "主要负责人", children: "Zhou" },
|
||||
{ label: "主要负责人手机号", children: "Zhou" },
|
||||
{ label: "安全负责人", children: "Zhou" },
|
||||
{ label: "安全负责人手机号", children: "Zhou" },
|
||||
{ label: "是否规模以上", children: "Zhou" },
|
||||
{ label: "企事业单位经营地址", children: "Zhou" },
|
||||
{ label: "企业状态", children: "Zhou" },
|
||||
{ label: "营业执照", children: "Zhou" },
|
||||
{ label: "营业执照有效期", children: "Zhou" },
|
||||
]}
|
||||
/>
|
||||
<Divider orientation="left">企业相关属性</Divider>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={1}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "有无职业卫生信息", children: "Zhou" },
|
||||
{ label: "有无重大危险源", children: "Zhou" },
|
||||
{ label: "是否有稀缺大型应急物资和设施", children: "Zhou" },
|
||||
{ label: "有无涉及危化品", children: "Zhou" },
|
||||
{ label: "有无特种设备", children: "Zhou" },
|
||||
{ label: "有无特种工作人员", children: "Zhou" },
|
||||
{ label: "是否涉及煤气", children: "Zhou" },
|
||||
{ label: "是否属于消防重点单位", children: "Zhou" },
|
||||
{ label: "是否在有限空间作业", children: "Zhou" },
|
||||
{ label: "是否存在涉爆粉尘作业", children: "Zhou" },
|
||||
{ label: "是否涉及防雷防静电", children: "Zhou" },
|
||||
{ label: "是否持有放射源", children: "Zhou" },
|
||||
{ label: "是否涉及液氨制冷", children: "Zhou" },
|
||||
{ label: "是否涉及危险品管道", children: "Zhou" },
|
||||
{ label: "企业名称", children: info.corpName && info.corpName },
|
||||
{ label: "统一社会信用代码", children: info.code },
|
||||
{ label: "所属区域", children: info.companyArea },
|
||||
{ label: "邮政编码", children: info.postalCode },
|
||||
{ label: "成立时间", children: info.createDate },
|
||||
{ label: "规模", children: info.scaleName },
|
||||
{ label: "经度", children: info.longitude },
|
||||
{ label: "纬度", children: info.latitude },
|
||||
{ label: "职工人数", children: info.employees },
|
||||
{ label: "占地面积(㎡)", children: info.areaCovered },
|
||||
{ label: "资产总额(万元)", children: info.totalAssets },
|
||||
{ label: "注册资金(万元)", children: info.regcapital },
|
||||
{ label: "经济类型", children: info.ecoTypeName },
|
||||
{ label: "所属行业", children: info.regcapital },
|
||||
{ label: "法定代表人", children: info.lrName },
|
||||
{ label: "法人手机号", children: info.lrMobile },
|
||||
{ label: "主要负责人", children: info.contacts },
|
||||
{ label: "主要负责人手机号", children: info.contactsPhone },
|
||||
{ label: "安全负责人", children: info.safetyName },
|
||||
{ label: "安全负责人手机号", children: info.safetyPhone },
|
||||
{ label: "是否规模以上", children: <span>{info.scaleType === 1 ? "是" : info.scaleType === 0 ? "否" : ""}</span> },
|
||||
{ label: "企事业单位经营地址", children: info.addressBusiness },
|
||||
{ label: "企业状态", children: info.corpStateName },
|
||||
{ label: "营业执照", children: "Zhou", render: <TooltipPreviewImg files={{ file: "" }} /> },
|
||||
{ label: "营业执照有效期", children: `${info.licenseStart} 至 ${info.licenseEnd}` },
|
||||
]}
|
||||
/>
|
||||
{/* <Divider orientation="left">企业相关属性</Divider> */}
|
||||
{/* <Descriptions */}
|
||||
{/* labelStyle={{ width: 200 }} */}
|
||||
{/* column={2} */}
|
||||
{/* bordered */}
|
||||
{/* items={[ */}
|
||||
{/* { label: "有无职业卫生信息", children: <span>{info.whetherHygieneFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "有无重大危险源", children: <span>{info.whetherHazardsFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "是否有稀缺大型应急物资和设施", children: <span>{info.whetherScarceFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "有无涉及危化品", children: <span>{info.whetherChemicalsFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "有无特种设备", children: <span>{info.whetherSpecialequipmentFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "有无特种工作人员", children: <span>{info.whetherSpecialpeopleFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "是否涉及煤气", children: <span>{info.whetherCoalgasFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "是否属于消防重点单位", children: <span>{info.whetherFireFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "是否在有限空间作业", children: <span>{info.whetherConfinedFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "是否存在涉爆粉尘作业", children: <span>{info.whetherPowderFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "是否涉及防雷防静电", children: <span>{info.whetherLightningFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "是否持有放射源", children: <span>{info.whetherActinogenFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "是否涉及液氨制冷", children: <span>{info.whetherLiquidammoniaFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* { label: "是否涉及危险品管道", children: <span>{info.whetherPipelineFlag === 1 ? "是" : "否"}</span> }, */}
|
||||
{/* ]} */}
|
||||
{/* /> */}
|
||||
<div style={{ marginTop: 10, textAlign: "center" }}>
|
||||
<Button
|
||||
type="primary"
|
||||
|
|
@ -72,4 +85,4 @@ function Info(props) {
|
|||
);
|
||||
}
|
||||
|
||||
export default Info;
|
||||
export default Connect([NS_ENTERPRISE], true)(Info);
|
||||
|
|
|
|||
|
|
@ -1,227 +1,288 @@
|
|||
import { Form } from "antd";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Form, message } from "antd";
|
||||
import { useEffect } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Map from "zy-react-library/components/Map";
|
||||
import Area from "zy-react-library/components/SelectTree/Area";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import { PHONE, POSTAL_CODE, UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
const PRESENCE_OR_ABSENCE_ENUM = [
|
||||
{ id: "1", name: "有" },
|
||||
{ id: "0", name: "无" },
|
||||
const ENTERPRISE_STATUS = [
|
||||
{ bianma: "filialstate01", name: "在产" },
|
||||
{ bianma: "filialstate02", name: "在建" },
|
||||
{ bianma: "filialstate03", name: "代建" },
|
||||
{ bianma: "filialstate04", name: "停产" },
|
||||
{ bianma: "filialstate05", name: "破产" },
|
||||
];
|
||||
const ECONOMY_TYPE = [
|
||||
{ bianma: "economic_type19", name: "外资" },
|
||||
{ bianma: "economic_type18", name: "中外合作" },
|
||||
{ bianma: "economic_type17", name: "中外合资" },
|
||||
|
||||
];
|
||||
// const PRESENCE_OR_ABSENCE_ENUM = [
|
||||
// { bianma: 1, name: "有" },
|
||||
// { bianma: 0, name: "无" },
|
||||
// ];
|
||||
const WHETHER_ENUM = [
|
||||
{ id: "1", name: "是" },
|
||||
{ id: "0", name: "否" },
|
||||
{ bianma: 1, name: "是" },
|
||||
{ bianma: 0, name: "否" },
|
||||
];
|
||||
|
||||
function Update() {
|
||||
function Update(props) {
|
||||
const [form] = Form.useForm();
|
||||
const onSubmit = (values) => {
|
||||
console.log(values);
|
||||
const onSubmit = async (values) => {
|
||||
values.id = "1985906265017954306";
|
||||
values.ecoTypeName = getLabelName({ status: values.ecoType, list: ECONOMY_TYPE });
|
||||
values.scaleName = getLabelName({ status: values.scale, list: [{ bianma: "1-10人", name: "1-10人" }] });
|
||||
values.corpStateName = getLabelName({ status: values.corpState, list: ENTERPRISE_STATUS });
|
||||
values.licenseStart = values.license[0];
|
||||
values.licenseEnd = values.license[1];
|
||||
delete values.license;
|
||||
props["corpInfoEdit"](values).then(() => {
|
||||
message.success("操作成功!");
|
||||
window.history.back();
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props["corpInfoRemoveDetails"]({ id: "1985906265017954306" });
|
||||
res.data.scaleType = res.data.scaleType ?? 0;
|
||||
res.data.whetherHygieneFlag = res.data.whetherHygieneFlag ?? 0;
|
||||
res.data.whetherHazardsFlag = res.data.whetherHazardsFlag ?? 0;
|
||||
res.data.whetherScarceFlag = res.data.whetherScarceFlag ?? 0;
|
||||
res.data.whetherChemicalsFlag = res.data.whetherChemicalsFlag ?? 0;
|
||||
res.data.whetherSpecialequipmentFlag = res.data.whetherSpecialequipmentFlag ?? 0;
|
||||
res.data.whetherSpecialpeopleFlag = res.data.whetherSpecialpeopleFlag ?? 0;
|
||||
res.data.whetherCoalgasFlag = res.data.whetherCoalgasFlag ?? 0;
|
||||
res.data.whetherFireFlag = res.data.whetherFireFlag ?? 0;
|
||||
res.data.whetherConfinedFlag = res.data.whetherConfinedFlag ?? 0;
|
||||
res.data.whetherPowderFlag = res.data.whetherPowderFlag ?? 0;
|
||||
res.data.whetherLightningFlag = res.data.whetherLightningFlag ?? 0;
|
||||
res.data.whetherActinogenFlag = res.data.whetherActinogenFlag ?? 0;
|
||||
res.data.whetherLiquidammoniaFlag = res.data.whetherLiquidammoniaFlag ?? 0;
|
||||
res.data.whetherPipeline = res.data.whetherPipeline ?? 0;
|
||||
res.data.license = [res.data.licenseStart, res.data.licenseEnd];
|
||||
|
||||
form.setFieldsValue(res.data);
|
||||
// 不要在这里 log info,它还是旧的
|
||||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title="修改" />
|
||||
<HeaderBack title="编辑" />
|
||||
<div style={{ paddingBottom: 10 }}>
|
||||
<FormBuilder
|
||||
loading={props.enterprise.enterpriseLoading}
|
||||
values={{
|
||||
SCALE_TYPE: "0",
|
||||
WHETHER_HYGIENE: "0",
|
||||
WHETHER_HAZARDS: "0",
|
||||
WHETHER_SCARCE: "0",
|
||||
WHETHER_CHEMICALS: "0",
|
||||
WHETHER_SPECIALEQUIPMENT: "0",
|
||||
WHETHER_SPECIALPEOPLE: "0",
|
||||
WHETHER_COALGAS: "0",
|
||||
WHETHER_FIRE: "0",
|
||||
WHETHER_CONFINED: "0",
|
||||
WHETHER_POWDER: "0",
|
||||
WHETHER_LIGHTNING: "0",
|
||||
WHETHER_ACTINOGEN: "0",
|
||||
WHETHER_LIQUIDAMMONIA: "0",
|
||||
WHETHER_PIPELINE: "0",
|
||||
scaleType: 0,
|
||||
whetherHygieneFlag: 0,
|
||||
whetherHazardsFlag: 0,
|
||||
whetherScarceFlag: 0,
|
||||
whetherChemicalsFlag: 0,
|
||||
whetherSpecialequipmentFlag: 0,
|
||||
whetherSpecialpeopleFlag: 0,
|
||||
whetherCoalgasFlag: 0,
|
||||
whetherFireFlag: 0,
|
||||
whetherConfinedFlag: 0,
|
||||
whetherPowderFlag: 0,
|
||||
whetherLightningFlag: 0,
|
||||
whetherActinogenFlag: 0,
|
||||
whetherLiquidammoniaFlag: 0,
|
||||
whetherPipelineFlag: 0,
|
||||
}}
|
||||
form={form}
|
||||
labelCol={{ span: 6 }}
|
||||
onFinish={onSubmit}
|
||||
options={[
|
||||
{ label: "基本信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{ label: "企业名称", name: "CORP_NAME", span: 24, componentProps: { disabled: true } },
|
||||
{ label: "企业名称", name: "corpName", span: 24, componentProps: { disabled: true } },
|
||||
{
|
||||
label: "社会统一信用代码",
|
||||
name: "CODE",
|
||||
name: "code",
|
||||
rules: [{ pattern: UNIFIED_SOCIAL_CREDIT_CODE, message: "请输入正确的社会统一信用代码" }],
|
||||
},
|
||||
{ label: "所属区域", name: "POSSESSION", componentProps: { disabled: true } },
|
||||
{ label: "所属区域", required: false, name: "POSSESSION", render: <Area /> },
|
||||
{
|
||||
label: "邮政编码",
|
||||
name: "POSTAL_CODE",
|
||||
name: "postalCode",
|
||||
required: false,
|
||||
rules: [{ pattern: POSTAL_CODE, message: "请输入正确的邮政编码" }],
|
||||
},
|
||||
{
|
||||
label: "规模",
|
||||
name: "SCALE",
|
||||
name: "scale",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ id: "1-10人", name: "1-10人" }],
|
||||
items: [{ bianma: "1-10人", name: "1-10人" }],
|
||||
},
|
||||
{ label: "成立时间", name: "CREATE_DATE", required: false, render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{ label: "成立时间", name: "createDate", required: false, render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{
|
||||
label: "企业状态",
|
||||
name: "CORP_STATE",
|
||||
name: "corpState",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ id: "1-10人", name: "1-10人" }],
|
||||
items: ENTERPRISE_STATUS,
|
||||
},
|
||||
{ name: "map", customizeRender: true, render: Map, span: 24 },
|
||||
{ label: "职工人数", name: "LR_NAME", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ label: "占地面积(㎡)", name: "LR_NAME", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ label: "注册资金(万元)", name: "REGCAPITAL", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ label: "资产总额(万元)", name: "TOTALASSETS", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ name: "map", customizeRender: true, render: <Map required={false} />, span: 24 },
|
||||
{ label: "职工人数", name: "employees", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ label: "占地面积(㎡)", name: "areaCovered", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ label: "注册资金(万元)", name: "regcapital", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ label: "资产总额(万元)", name: "totalAssets", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{
|
||||
label: "经济类型",
|
||||
name: "ECO_TYPE",
|
||||
name: "ecoType",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ id: "1-10人", name: "1-10人" }],
|
||||
items: ECONOMY_TYPE,
|
||||
},
|
||||
{
|
||||
label: "所属行业",
|
||||
name: "INDUSTRYALL",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ id: "1-10人", name: "1-10人" }],
|
||||
items: [{ bianma: "1-10人", name: "1-10人" }],
|
||||
},
|
||||
{ label: "法定代表人", name: "LR_NAME", required: false },
|
||||
{ label: "法定代表人", name: "lrName", required: false },
|
||||
{
|
||||
label: "法人手机号",
|
||||
name: "LR_PHONE",
|
||||
name: "lrMobile",
|
||||
required: false,
|
||||
rules: [{ pattern: PHONE, message: "请输入正确的手机号" }],
|
||||
},
|
||||
{ label: "主要负责人", name: "CONTACTS" },
|
||||
{ label: "主要负责人手机号", name: "CONTACTS_PHONE", rules: [{ pattern: PHONE, message: "请输入正确的手机号" }] },
|
||||
{ label: "安全负责人", name: "SAFETY_NAME", required: false },
|
||||
{ label: "主要负责人", name: "contacts" },
|
||||
{ label: "主要负责人手机号", name: "contactsPhone", rules: [{ pattern: PHONE, message: "请输入正确的手机号" }] },
|
||||
{ label: "安全负责人", name: "safetyName", required: false },
|
||||
{
|
||||
label: "安全负责人电话手机号",
|
||||
name: "SAFETY_PHONE",
|
||||
name: "safetyPhone",
|
||||
required: false,
|
||||
rules: [{ pattern: PHONE, message: "请输入正确的手机号" }],
|
||||
},
|
||||
{
|
||||
label: "是否规模以上",
|
||||
name: "SCALE_TYPE",
|
||||
name: "scaleType",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{ label: "企事业单位经营地址", name: "ADDRESS_BUSINESS" },
|
||||
{ label: "成立时间", name: "CREATE_DATE", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{ label: "企事业单位经营地址", name: "addressBusiness" },
|
||||
{
|
||||
label: "营业执照",
|
||||
name: "BUS_IMAGES",
|
||||
span: 24,
|
||||
render: ({ value, onChange }) => <Upload value={value} onChange={onChange} />,
|
||||
},
|
||||
{ label: "企业相关属性", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{
|
||||
label: "有无职业卫生信息",
|
||||
name: "WHETHER_HYGIENE",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: PRESENCE_OR_ABSENCE_ENUM,
|
||||
render: <Upload fileType="image" />,
|
||||
},
|
||||
{
|
||||
label: "有无重大污染源",
|
||||
name: "WHETHER_HAZARDS",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: PRESENCE_OR_ABSENCE_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否有稀缺大型应急物资或设施",
|
||||
name: "WHETHER_SCARCE",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
formItemProps: {},
|
||||
},
|
||||
{
|
||||
label: "是否涉及危化品",
|
||||
name: "WHETHER_CHEMICALS",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "有无特种设备",
|
||||
name: "WHETHER_SPECIALEQUIPMENT",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: PRESENCE_OR_ABSENCE_ENUM,
|
||||
},
|
||||
{
|
||||
label: "有无特种作业人员",
|
||||
name: "WHETHER_SPECIALPEOPLE",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: PRESENCE_OR_ABSENCE_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及煤气",
|
||||
name: "WHETHER_COALGAS",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否属于消防重点单位",
|
||||
name: "WHETHER_FIRE",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否在受限空间作业",
|
||||
name: "WHETHER_CONFINED",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否存在涉爆粉尘作业",
|
||||
name: "WHETHER_POWDER",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及防雷防静电",
|
||||
name: "WHETHER_LIGHTNING",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否持有放射源",
|
||||
name: "WHETHER_ACTINOGEN",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及液氨制冷",
|
||||
name: "WHETHER_LIQUIDAMMONIA",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及危化品管道",
|
||||
name: "WHETHER_PIPELINE",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
label: "营业执照有效期",
|
||||
name: "license",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
|
||||
},
|
||||
// { label: "企业相关属性", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
// {
|
||||
// label: "有无职业卫生信息",
|
||||
// name: "whetherHygieneFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: PRESENCE_OR_ABSENCE_ENUM,
|
||||
// },
|
||||
// {
|
||||
// label: "有无重大污染源",
|
||||
// name: "whetherHazardsFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: PRESENCE_OR_ABSENCE_ENUM,
|
||||
// },
|
||||
// {
|
||||
// label: "是否有稀缺大型应急物资或设施",
|
||||
// name: "whetherScarceFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// formItemProps: {},
|
||||
// },
|
||||
// {
|
||||
// label: "是否涉及危化品",
|
||||
// name: "whetherChemicalsFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// },
|
||||
// {
|
||||
// label: "有无特种设备",
|
||||
// name: "whetherSpecialequipmentFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: PRESENCE_OR_ABSENCE_ENUM,
|
||||
// },
|
||||
// {
|
||||
// label: "有无特种作业人员",
|
||||
// name: "whetherSpecialpeopleFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: PRESENCE_OR_ABSENCE_ENUM,
|
||||
// },
|
||||
// {
|
||||
// label: "是否涉及煤气",
|
||||
// name: "whetherCoalgasFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// },
|
||||
// {
|
||||
// label: "是否属于消防重点单位",
|
||||
// name: "whetherFireFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// },
|
||||
// {
|
||||
// label: "是否在受限空间作业",
|
||||
// name: "whetherConfinedFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// },
|
||||
// {
|
||||
// label: "是否存在涉爆粉尘作业",
|
||||
// name: "whetherPowderFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// },
|
||||
// {
|
||||
// label: "是否涉及防雷防静电",
|
||||
// name: "whetherLightningFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// },
|
||||
// {
|
||||
// label: "是否持有放射源",
|
||||
// name: "whetherActinogenFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// },
|
||||
// {
|
||||
// label: "是否涉及液氨制冷",
|
||||
// name: "whetherLiquidammoniaFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// },
|
||||
// {
|
||||
// label: "是否涉及危化品管道",
|
||||
// name: "whetherPipelineFlag",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -229,4 +290,4 @@ function Update() {
|
|||
);
|
||||
}
|
||||
|
||||
export default Update;
|
||||
export default Connect([NS_ENTERPRISE], true)(Update);
|
||||
|
|
|
|||
|
|
@ -3,16 +3,16 @@ import FormBuilder from "zy-react-library/components/FormBuilder";
|
|||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
|
||||
const { query } = tools.router;
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
|
||||
function Add() {
|
||||
const queryParams = useGetUrlQuery();
|
||||
const onSubmit = (values) => {
|
||||
console.log(values);
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title={query.id ? "修改" : "新增"} />
|
||||
<HeaderBack title={queryParams["id"] ? "编辑" : "新增"} />
|
||||
<FormBuilder
|
||||
onFinish={onSubmit}
|
||||
span={24}
|
||||
|
|
@ -21,7 +21,7 @@ function Add() {
|
|||
{ name: "name", label: "证书有效期", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{ name: "name", label: "证书编号" },
|
||||
{ name: "name", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "name", label: "证书图片", render: ({ value, onChange }) => <Upload maxCount={9} value={value} onChange={onChange} /> },
|
||||
{ name: "name", label: "证书图片", render: <Upload fileType="image" /> },
|
||||
]}
|
||||
/>
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ function List(props) {
|
|||
{ title: "照片", dataIndex: "name", render: () => (<TooltipPreviewImg files={[]} />) },
|
||||
{ title: "操作", width: 200, render: (_, record) => (
|
||||
<Space>
|
||||
<Button type="link" onClick={() => props.history.push(`./add?id=${record.id}`)}>修改</Button>
|
||||
<Button type="link" onClick={() => props.history.push(`./add?id=${record.id}`)}>编辑</Button>
|
||||
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</Space>
|
||||
) },
|
||||
|
|
|
|||
|
|
@ -1,29 +1,47 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import BackIcon from "zy-react-library/components/Icon/BackIcon";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_DEPARTMENT } from "~/enumerate/namespace";
|
||||
|
||||
const DEPARTMENT_LEVEL_ENUM = [
|
||||
{ id: "departmentLevel0001", name: "分公司" },
|
||||
{ id: "departmentLevel0002", name: "科/厂队" },
|
||||
{ id: "departmentLevel0003", name: "班组" },
|
||||
];
|
||||
function OrganizationStructure() {
|
||||
const CorpinfoId = "1985906265017954306";
|
||||
function OrganizationStructure(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState(null);
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["departmentList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqParentId: selectedNodeId,
|
||||
eqCorpinfoId: CorpinfoId,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["departmentRemove"]({ id });
|
||||
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
|
|
@ -32,22 +50,23 @@ function OrganizationStructure() {
|
|||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "名称" },
|
||||
{ name: "likeName", label: "部门名称" },
|
||||
{
|
||||
name: "name",
|
||||
name: "eqLevel",
|
||||
label: "部门级别",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: DEPARTMENT_LEVEL_ENUM,
|
||||
items: [{ name: "一级部门", bianma: "1" }],
|
||||
},
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
|
|
@ -59,13 +78,22 @@ function OrganizationStructure() {
|
|||
>
|
||||
新增
|
||||
</Button>
|
||||
<Button icon={<BackIcon />}>返回</Button>
|
||||
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "部门名称", dataIndex: "name" },
|
||||
{ title: "部门级别", dataIndex: "name" },
|
||||
{ title: "主管领导", dataIndex: "name" },
|
||||
{ title: "部门名称", dataIndex: "name", render: (_, record) => (
|
||||
<Button
|
||||
type="link"
|
||||
block
|
||||
onClick={() => {
|
||||
setSelectedNodeId(record.id);
|
||||
getData();
|
||||
}}
|
||||
>
|
||||
{`${record.name}>`}
|
||||
</Button>
|
||||
) },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
|
|
@ -76,6 +104,8 @@ function OrganizationStructure() {
|
|||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
|
||||
setSelectedNodeId(record.parentId);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
|
|
@ -91,7 +121,12 @@ function OrganizationStructure() {
|
|||
</div>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
requestAdd={props["departmentAdd"]}
|
||||
requestEdit={props["departmentEdit"]}
|
||||
requestDetails={props["departmentDetails"]}
|
||||
loading={props.department.departmentLoading}
|
||||
open={addModalOpen}
|
||||
parentId={selectedNodeId}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -104,9 +139,13 @@ function OrganizationStructure() {
|
|||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [parentName, setParentName] = useState(null);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
console.log(props.currentId);
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
form.setFieldsValue(res.data);
|
||||
setParentName(res.data.parentName);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
|
|
@ -114,7 +153,18 @@ function AddModalComponent(props) {
|
|||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
console.log(values);
|
||||
values.levelName = getLabelName({ status: values.level, list: [{ bianma: "1", name: "一级部门" }] });
|
||||
values.parentId = props.parentId;
|
||||
values.corpinfoId = CorpinfoId;
|
||||
if (props.currentId) {
|
||||
values.parentId = props.parentId;
|
||||
values.id = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values);
|
||||
}
|
||||
|
||||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
|
|
@ -123,12 +173,12 @@ function AddModalComponent(props) {
|
|||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "修改" : "新增"}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
>
|
||||
<FormBuilder
|
||||
values={{
|
||||
isRegulatory: "2",
|
||||
securityFlag: 0,
|
||||
}}
|
||||
form={form}
|
||||
span={24}
|
||||
|
|
@ -136,12 +186,18 @@ function AddModalComponent(props) {
|
|||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "parentName", label: "上级部门", render: () => (<Tag color="processing">111</Tag>) },
|
||||
{ name: "parentName", required: false, label: "上级部门", render: <Tag color="processing">{parentName}</Tag> },
|
||||
{ name: "name", label: "部门名称" },
|
||||
{ name: "level", label: "部门级别", render: FORM_ITEM_RENDER_ENUM.SELECT, items: DEPARTMENT_LEVEL_ENUM },
|
||||
{ name: "isRegulatory", label: "是否安全监管部门", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: [{ id: "0", name: "是" }, { id: "2", name: "否" }], tip: "安全监管部门负责人在“安委会办公室副主任核实”菜单处理重大较大隐患" },
|
||||
{ name: "bz", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "sort", label: "排序", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ name: "level", label: "部门级别", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ bianma: "1", name: "一级部门" }] },
|
||||
{ name: "depOrder", label: "部门排序", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{
|
||||
name: "securityFlag",
|
||||
label: "是否安全管理部门",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }],
|
||||
},
|
||||
{ name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
]}
|
||||
/>
|
||||
</Modal>
|
||||
|
|
@ -149,4 +205,4 @@ function AddModalComponent(props) {
|
|||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default OrganizationStructure;
|
||||
export default Connect([NS_DEPARTMENT], true)(OrganizationStructure);
|
||||
|
|
|
|||
|
|
@ -1,48 +1,55 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import BackIcon from "zy-react-library/components/Icon/BackIcon";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import SelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_POST } from "~/enumerate/namespace";
|
||||
|
||||
function Post() {
|
||||
function Post(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState("0");
|
||||
const [selectedNodeName, setSelectedNodeName] = useState("");
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {
|
||||
}, { form });
|
||||
const { tableProps, getData } = useTable(props["postList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
departmentIdString: selectedNodeId,
|
||||
corpFlag: 2,
|
||||
};
|
||||
},
|
||||
});
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["postRemove"]({ id });
|
||||
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
const onTreeChange = (selectedKeys, event) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeName(event.node.name);
|
||||
console.log(selectedKeys);
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "岗位名称" },
|
||||
{
|
||||
name: "name",
|
||||
label: "部门级别",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
},
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
|
|
@ -55,13 +62,11 @@ function Post() {
|
|||
>
|
||||
新增
|
||||
</Button>
|
||||
<Button icon={<BackIcon />}>返回</Button>
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "部门名称", dataIndex: "name" },
|
||||
{ title: "岗位名称", dataIndex: "name" },
|
||||
{ title: "状态", dataIndex: "name", width: 100 },
|
||||
{ title: "所属部门", required: false, dataIndex: "departmentName" },
|
||||
{ title: "岗位名称", dataIndex: "postName" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
|
|
@ -88,6 +93,12 @@ function Post() {
|
|||
<AddModal
|
||||
currentId={currentId}
|
||||
open={addModalOpen}
|
||||
requestAdd={props["postAdd"]}
|
||||
requestEdit={props["postEdit"]}
|
||||
requestDetails={props["postDetails"]}
|
||||
selectedNodeName={selectedNodeName}
|
||||
parentId={selectedNodeId}
|
||||
loding={props.post.postLoading}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -100,31 +111,58 @@ function Post() {
|
|||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [parentName, setParentName] = useState(null);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
console.log(props.currentId);
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
const arr = [];
|
||||
res.data.departmentList && res.data.departmentList.forEach((item) => {
|
||||
arr.push(item.departmentId);
|
||||
});
|
||||
res.data.departmentIdsString = arr;
|
||||
form.setFieldsValue(res.data);
|
||||
console.log(res.data);
|
||||
setParentName(res.data.departmentName);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
else {
|
||||
setParentName(props.selectedNodeName);
|
||||
}
|
||||
}, [props.currentId, props.selectedNodeName]);
|
||||
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
console.log(values);
|
||||
onCancel();
|
||||
props.getData();
|
||||
values.departmentIdString = props.parentId;
|
||||
values.corpFlag = 2;
|
||||
if (props.currentId) {
|
||||
values.idString = props.currentId;
|
||||
props.requestEdit(values).then(() => {
|
||||
onCancel();
|
||||
props.getData();
|
||||
});
|
||||
}
|
||||
else {
|
||||
props.requestAdd(values).then(() => {
|
||||
onCancel();
|
||||
props.getData();
|
||||
});
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "修改" : "新增"}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
loading={props.loding}
|
||||
>
|
||||
<FormBuilder
|
||||
values={{
|
||||
regPost: "2",
|
||||
supervisionFlag: 0,
|
||||
}}
|
||||
form={form}
|
||||
span={24}
|
||||
|
|
@ -132,21 +170,17 @@ function AddModalComponent(props) {
|
|||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "parentName", label: "部门名称", render: () => (<Tag color="processing">111</Tag>) },
|
||||
{ name: "post", label: "岗位名称" },
|
||||
{ name: "parentName", required: false, label: "所属部门", render: <Tag color="processing">{parentName }</Tag> },
|
||||
{ name: "postName", label: "岗位名称" },
|
||||
{
|
||||
name: "status",
|
||||
label: "状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ id: "0", name: "启用" }, { id: "1", name: "禁用" }],
|
||||
},
|
||||
{
|
||||
name: "regPost",
|
||||
name: "supervisionFlag",
|
||||
label: "是否监管岗位",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [{ id: "1", name: "是" }, { id: "2", name: "否" }],
|
||||
items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }],
|
||||
},
|
||||
{ name: "bz", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "departmentIdsString", label: "数据权限", required: false, render: <SelectTree multiple />, dependencies: ["supervisionFlag"], hidden: formValues => (formValues.supervisionFlag === 0) },
|
||||
{ name: "remarks", label: "岗位职责", render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
]}
|
||||
/>
|
||||
</Modal>
|
||||
|
|
@ -154,4 +188,5 @@ function AddModalComponent(props) {
|
|||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Post;
|
||||
|
||||
export default Connect([NS_POST], true)(Post);
|
||||
|
|
|
|||
|
|
@ -1,52 +1,138 @@
|
|||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Form, message } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import { ID_NUMBER } from "zy-react-library/regular";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import nation from "zy-react-library/json/nation.json";
|
||||
import { ID_NUMBER, PHONE } from "zy-react-library/regular";
|
||||
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
const { query } = tools.router;
|
||||
const WHETHER_ENUM = [
|
||||
{ id: "1", name: "是" },
|
||||
{ id: "0", name: "否" },
|
||||
{ bianma: 1, name: "是" },
|
||||
{ bianma: 0, name: "否" },
|
||||
];
|
||||
const SEX = [
|
||||
{ bianma: 1, name: "男" },
|
||||
{ bianma: 2, name: "女" },
|
||||
];
|
||||
|
||||
function Add() {
|
||||
const onSubmit = (values) => {
|
||||
console.log(values);
|
||||
function Add(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [postData, setPostData] = useState([]);
|
||||
const [rolesData, setRolesData] = useState([]);
|
||||
// const [rankData, getRankData] = useState([]);
|
||||
const [userTypeData, setUserTypeData] = useState([]);
|
||||
const [userID, setUserID] = useState(null);
|
||||
const queryParams = useGetUrlQuery();
|
||||
useEffect(() => {
|
||||
if (queryParams["id"]) {
|
||||
const fetchData = async () => {
|
||||
const res = await props["userDetails"]({ id: queryParams["id"] });
|
||||
console.log(res.data);
|
||||
setUserID(res.data.userId);
|
||||
form.setFieldsValue(res.data);
|
||||
};
|
||||
fetchData();
|
||||
}
|
||||
props["rolesAll"]().then((res) => {
|
||||
setRolesData(res.data);
|
||||
});
|
||||
|
||||
// 部门级别
|
||||
// props["dictData"]({ appKey: "0bb989ecada5470c87635018ece9f327", dictValue: "departmentLevel" }).then((res) => {
|
||||
// console.log(res);
|
||||
// getRankData(res.data);
|
||||
// });
|
||||
// 人员类型
|
||||
props["dictData"]({ appKey: "0bb989ecada5470c87635018ece9f327", dictValue: "renyuanleixing" }).then((res) => {
|
||||
console.log(res);
|
||||
setUserTypeData(res.data);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const onSubmit = async (values) => {
|
||||
values.nationName = getLabelName({ status: values.nation, list: nation });
|
||||
values.personnelTypeName = getLabelName({ status: values.personnelType, list: userTypeData, idKey: "dictValue", nameKey: "labelKey" });
|
||||
// values.rank_level_name = getLabelName({ status: values.rank_level, list: rankData, idKey: "dictValue", nameKey: "labelKey" });
|
||||
idCardGetDateAndGender(values.userIdCard);
|
||||
|
||||
console.log(idCardGetDateAndGender(values.userIdCard));
|
||||
values.mainCorpFlag = 0;
|
||||
values.userType = 2;
|
||||
if (queryParams["id"]) {
|
||||
values.id = queryParams["id"];
|
||||
values.userId = userID;
|
||||
props["userEdit"](values).then((res) => {
|
||||
if (res.success) {
|
||||
window.history.back();
|
||||
message.success("编辑成功!");
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
props["userAdd"](values).then((res) => {
|
||||
if (res.success) {
|
||||
window.history.back();
|
||||
message.success("新增成功!");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const fnChoiceDepartment = async (event) => {
|
||||
console.log(event);
|
||||
form.setFieldsValue({ postId: undefined });
|
||||
// setDepartmentName(event[0].name)
|
||||
props["postAll"]({ corpFlag: 1, departmentIdString: event[0].id }).then((res) => {
|
||||
console.log(res);
|
||||
setPostData(res.data);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title={query.id ? "修改" : "新增"} />
|
||||
<HeaderBack title={queryParams["id"] ? "编辑" : "新增"} />
|
||||
<div style={{ paddingBottom: 10 }}>
|
||||
<FormBuilder
|
||||
values={{
|
||||
isHeadOfDepartment: "0",
|
||||
departmentLeaderFlag: "0",
|
||||
|
||||
}}
|
||||
form={form}
|
||||
onFinish={onSubmit}
|
||||
labelCol={{ span: 6 }}
|
||||
loading={props.user.userLoading}
|
||||
options={[
|
||||
{ name: "roleId", label: "用户角色", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "一级部门", id: "1" }] },
|
||||
{ name: "departmentId", label: "所属部门", render: ({ value, onChange }) => <DepartmentSelectTree value={value} onChange={onChange} /> },
|
||||
{ name: "roleId", label: "用户角色", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: rolesData, itemsField: { labelKey: "roleName", valueKey: "id" } },
|
||||
{ name: "departmentId", label: "所属部门", render: <DepartmentSelectTree onGetNodePaths={fnChoiceDepartment} /> },
|
||||
|
||||
{
|
||||
name: "postId",
|
||||
label: "所属岗位",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
items: postData,
|
||||
itemsField: { labelKey: "postName", valueKey: "id" },
|
||||
},
|
||||
{ name: "username", label: "用户名", tip: "* 如果修改手机号,登录密码则会变成初始密码“Aa@123456789”" },
|
||||
{ name: "name", label: "姓名" },
|
||||
{ name: "phone", label: "手机号", rules: [{ pattern: PHONE, message: "请输入正确的手机号" }] },
|
||||
{
|
||||
name: "personType",
|
||||
name: "personnelType",
|
||||
label: "人员类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
items: userTypeData,
|
||||
itemsField: { labelKey: "dictLabel", valueKey: "dictValue" },
|
||||
},
|
||||
{
|
||||
name: "userIdCard",
|
||||
label: "身份证号",
|
||||
required: false,
|
||||
rules: [{ pattern: ID_NUMBER, message: "请输入正确的身份证号" }],
|
||||
},
|
||||
{
|
||||
|
|
@ -54,25 +140,25 @@ function Add() {
|
|||
label: "民族",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
items: nation,
|
||||
},
|
||||
{
|
||||
name: "sex",
|
||||
label: "性别",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
componentProps: { disabled: true },
|
||||
items: SEX,
|
||||
},
|
||||
{
|
||||
name: "faceFile",
|
||||
label: "上传人脸照片",
|
||||
required: false,
|
||||
span: 24,
|
||||
render: ({ value, onChange }) => (
|
||||
render: (
|
||||
<Upload
|
||||
size={4}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
fileType="image"
|
||||
tipContent={(
|
||||
<div style={{ lineHeight: 1.6, color: "red", fontSize: 12 }}>
|
||||
<div>* 图像格式:JPG、JPEG、PNG</div>
|
||||
|
|
@ -85,15 +171,15 @@ function Add() {
|
|||
/>
|
||||
),
|
||||
},
|
||||
{ name: "sort", label: "部门排序", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ name: "sort", label: "部门排序", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
// { name: "rank_level", label: "人员职级", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: rankData, itemsField: { labelKey: "dictLabel", valueKey: "dictValue" } },
|
||||
{ name: "email", label: "邮箱", required: false, rules: [{ type: "email", message: "请输入正确的邮箱" }] },
|
||||
{ name: "isHeadOfDepartment", label: "是否为部门负责人", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM },
|
||||
{ name: "bz", label: "备注", span: 24, required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "remarks", label: "备注", span: 24, required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "departmentLeaderFlag", label: "是否为部门负责人", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Add;
|
||||
export default Connect([NS_USER], true)(Add);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { Button, Form, message, Modal, Space } from "antd";
|
||||
import { useState } from "react";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import ExportIcon from "zy-react-library/components/Icon/ExportIcon";
|
||||
import ImportIcon from "zy-react-library/components/Icon/ImportIcon";
|
||||
|
|
@ -8,16 +9,31 @@ import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index"
|
|||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
const [importOpen, setImportOpen] = useState(false);
|
||||
const [selectedNodeId, setSelectedNodeId] = useState();
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["userList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
userType: 2,
|
||||
};
|
||||
},
|
||||
});
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["userRemove"]({ id });
|
||||
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
|
|
@ -32,30 +48,26 @@ function List(props) {
|
|||
},
|
||||
});
|
||||
};
|
||||
const onResetPassword = () => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定要重置密码为Aa@123456789吗?",
|
||||
onOk: () => {
|
||||
message.success("重置密码成功");
|
||||
},
|
||||
});
|
||||
};
|
||||
const onUnlock = (id) => {
|
||||
message.success("解锁成功");
|
||||
};
|
||||
|
||||
const onImportFileConfirm = (values) => {
|
||||
console.log(values);
|
||||
message.success("导入成功");
|
||||
};
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
console.log(selectedKeys);
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "关键字", tip: "用户名/姓名" },
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
|
|
@ -85,16 +97,16 @@ function List(props) {
|
|||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "用户名", dataIndex: "name" },
|
||||
{ title: "用户名", dataIndex: "username" },
|
||||
{ title: "姓名", dataIndex: "name" },
|
||||
{ title: "部门", dataIndex: "name" },
|
||||
{ title: "岗位", dataIndex: "name" },
|
||||
{ title: "部门", dataIndex: "departmentName" },
|
||||
{ title: "岗位", dataIndex: "postName" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 300,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button type="link" onClick={() => onResetPassword(record.id)}>重置密码</Button>
|
||||
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
|
|
@ -103,7 +115,15 @@ function List(props) {
|
|||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button type="link" onClick={() => onUnlock(record.id)}>解锁</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</Space>
|
||||
),
|
||||
|
|
@ -119,8 +139,77 @@ function List(props) {
|
|||
onConfirm={onImportFileConfirm}
|
||||
onCancel={() => { setImportOpen(false); }}
|
||||
/>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
open={addModalOpen}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({ id: props.currentId });
|
||||
console.log(res.data);
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
console.log(info);
|
||||
}
|
||||
}, [props.currentId]);
|
||||
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
okButtonProps={{ style: { display: "none" } }}
|
||||
title="查看"
|
||||
width={900}
|
||||
>
|
||||
<div style={{ padding: 20 }}>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={2}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "用户角色", children: info.username },
|
||||
{ label: "所属部门", children: info.departmentName },
|
||||
{ label: "是否部门负责人", children: <span>{info.departmentLeaderFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "所属岗位", children: info.postName },
|
||||
{ label: "用户名", children: info.username },
|
||||
{ label: "姓名", children: info.name },
|
||||
{ label: "手机号", children: info.phone },
|
||||
{ label: "人员类型", children: info.personnelTypeName },
|
||||
{ label: "身份证号", children: info.userIdCard },
|
||||
{ label: "民族", children: info.nationName },
|
||||
{ label: "性别", children: info.sex },
|
||||
|
||||
{ label: "人脸照片", children: info.nationName },
|
||||
{ label: "部门排序", children: info.sort },
|
||||
{ label: "邮箱", children: info.email },
|
||||
{ label: "备注", children: info.remarks },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
export default List;
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_USER], true)(List);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,183 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace";
|
||||
|
||||
const CorpinfoId = "1983773013086048256";
|
||||
function Department(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["userQualificationInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
corpinfoIdString: CorpinfoId,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["userQualificationInfoRemove"]({ id });
|
||||
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "keyWords", label: "证书名称" },
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "资质名称", dataIndex: "qualificationName" },
|
||||
{ title: "证书编号", dataIndex: "certificateNo" },
|
||||
{ title: "证书有效期", dataIndex: "ValidityTime", render: (text, record) => (<sapn>{`${record.startValidityTime}至${record.endValidityTime}`}</sapn>) },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</Button>
|
||||
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
open={addModalOpen}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [qualificationinfoId, setQualificationinfoId] = useState(false);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
res.data.startValidity = [res.data.startValidityTime, res.data.endValidityTime];
|
||||
setQualificationinfoId(res.data.userQualificationinfoId);
|
||||
form.setFieldsValue(res.data);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
values.parentId = props.parentId;
|
||||
values.corpinfoId = CorpinfoId;
|
||||
values.startValidityTime = values.startValidity[0];
|
||||
values.endValidityTime = values.startValidity[1];
|
||||
values.userIdString = "1985635856156274689";
|
||||
values.userQualificationinfoId = qualificationinfoId;
|
||||
|
||||
console.log(values.startValidity);
|
||||
delete values.startValidity;
|
||||
if (props.currentId) {
|
||||
values.idString = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values);
|
||||
}
|
||||
|
||||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
loading={props.loding}
|
||||
>
|
||||
<FormBuilder
|
||||
values={{
|
||||
securityFlag: 0,
|
||||
}}
|
||||
form={form}
|
||||
span={24}
|
||||
labelCol={{ span: 10 }}
|
||||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "qualificationName", label: "资质名称" },
|
||||
{ name: "certificateNo", label: "证书编号" },
|
||||
{ name: "startValidity", label: "证书有效期", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||
{ name: "version", label: "版本号" },
|
||||
{ name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
|
||||
]}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department);
|
||||
|
|
@ -112,7 +112,7 @@ function AddModalComponent(props) {
|
|||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "修改" : "新增"}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
>
|
||||
<FormBuilder
|
||||
|
|
@ -125,7 +125,7 @@ function AddModalComponent(props) {
|
|||
{ name: "QUALIFICATION_NAME", label: "资质正式名称" },
|
||||
{ name: "date", label: "证书有限期", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||
{ name: "CERTIFICATE_NO", label: "证书编号" },
|
||||
{ name: "QUALIFICATION_PIC", label: "照片", render: ({ value, onChange }) => <Upload size={5} value={value} onChange={onChange} /> },
|
||||
{ name: "QUALIFICATION_PIC", label: "照片", render: <Upload fileType="image" /> },
|
||||
]}
|
||||
/>
|
||||
</Modal>
|
||||
|
|
|
|||
|
|
@ -1,53 +1,153 @@
|
|||
import { Button, Modal, QRCode } from "antd";
|
||||
import { useState } from "react";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, QRCode } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import Map from "zy-react-library/components/Map";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import { PHONE, UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
// import Qualification from "./components/Qualification";
|
||||
import { PHONE, POSTAL_CODE, UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
import Qualification from "./components/Qualification";
|
||||
|
||||
const xgfStateMap = {
|
||||
0: "未填报",
|
||||
1: "待审核",
|
||||
2: "已审核",
|
||||
3: <span style={{ color: "red" }}>已打回</span>,
|
||||
4: "已填报",
|
||||
};
|
||||
function CorpInfo() {
|
||||
const ENTERPRISE_STATUS = [
|
||||
{ bianma: "filialstate01", name: "在产" },
|
||||
{ bianma: "filialstate02", name: "在建" },
|
||||
{ bianma: "filialstate03", name: "代建" },
|
||||
{ bianma: "filialstate04", name: "停产" },
|
||||
{ bianma: "filialstate05", name: "破产" },
|
||||
];
|
||||
const ECONOMY_TYPE = [
|
||||
{ bianma: "economic_type19", name: "外资" },
|
||||
{ bianma: "economic_type18", name: "中外合作" },
|
||||
{ bianma: "economic_type17", name: "中外合资" },
|
||||
|
||||
];
|
||||
const WHETHER_ENUM = [
|
||||
{ bianma: 1, name: "是" },
|
||||
{ bianma: 0, name: "否" },
|
||||
];
|
||||
// const xgfStateMap = {
|
||||
// 0: "未填报",
|
||||
// 1: "待审核",
|
||||
// 2: "已审核",
|
||||
// 3: <span style={{ color: "red" }}>已打回</span>,
|
||||
// 4: "已填报",
|
||||
// };
|
||||
function CorpInfo(props) {
|
||||
const [corpInfoQrCodeOpen, setCorpInfoQrCodeOpen] = useState(false);
|
||||
const onSubmit = (values) => {
|
||||
const [form] = Form.useForm();
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props.corpInfoRemoveDetails({ id: "1985906265017954306" });
|
||||
res.data.license = [res.data.licenseStart, res.data.licenseEnd];
|
||||
form.setFieldsValue(res.data);
|
||||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
const onSubmit = async (values) => {
|
||||
console.log(values);
|
||||
values.id = "1985906265017954306";
|
||||
values.ecoTypeName = getLabelName({ status: values.ecoType, list: ECONOMY_TYPE });
|
||||
values.scaleName = getLabelName({ status: values.scale, list: [{ bianma: "1-10人", name: "1-10人" }] });
|
||||
values.corpStateName = getLabelName({ status: values.corpState, list: ENTERPRISE_STATUS });
|
||||
values.licenseStart = values.license[0];
|
||||
values.licenseEnd = values.license[1];
|
||||
delete values.license;
|
||||
props["corpInfoEdit"](values).then(() => {
|
||||
message.success("操作成功!");
|
||||
});
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<div style={{ paddingBottom: 10 }}>
|
||||
<FormBuilder
|
||||
onFinish={onSubmit}
|
||||
form={form}
|
||||
options={[
|
||||
{ label: "基础信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{ name: "corpName", label: "单位名称" },
|
||||
{ name: "xgfState", label: "企业状态", required: false, render: ({ formValues }) => xgfStateMap[formValues?.xgfState] || "未填报" },
|
||||
{ name: "holderName", label: "开户人", required: false },
|
||||
{ name: "code", label: "统一社会信用代码", rules: [{ pattern: UNIFIED_SOCIAL_CREDIT_CODE, message: "请输入正确的统一社会信用代码" }] },
|
||||
{ name: "companyAreas", label: "属地" },
|
||||
{ name: "industryNames", label: "所属行业", required: false },
|
||||
{ name: "map", customizeRender: true, render: () => <Map required={false} />, span: 24 },
|
||||
{ name: "ecoType", label: "经济类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }] },
|
||||
{ name: "address", label: "单位经营地址" },
|
||||
{ name: "scale", label: "企业规模", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }] },
|
||||
{ name: "lrName", label: "法定代表人姓名" },
|
||||
{ name: "lrPhone", label: "法定代表人手机号", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }], required: false },
|
||||
{ name: "contacts", label: "主要负责人" },
|
||||
{ name: "contactsPhone", label: "主要负责人联系电话", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }] },
|
||||
{ name: "createDate", label: "成立日期", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{ name: "employees", label: "职工人数(人)", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ name: "totalassets", label: "资产总额(万元)", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ name: "regcapital", label: "注册资金(万元)", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ name: "employmentForm", label: "用工形式", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }] },
|
||||
// { name: "selectForms", label: "选取形式", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }] },
|
||||
{ name: "businessLicense", label: "营业执照", render: ({ value, onChange }) => <Upload maxCount={5} size={5} value={value} onChange={onChange} /> },
|
||||
{ name: "businessLicenseDate", label: "营业执照有效期", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{ label: "基本信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{ label: "企业名称", name: "corpName", span: 24, componentProps: { disabled: true } },
|
||||
{
|
||||
label: "社会统一信用代码",
|
||||
name: "code",
|
||||
rules: [{ pattern: UNIFIED_SOCIAL_CREDIT_CODE, message: "请输入正确的社会统一信用代码" }],
|
||||
},
|
||||
{ label: "所属区域", required: false, name: "POSSESSION", componentProps: { disabled: true } },
|
||||
{
|
||||
label: "邮政编码",
|
||||
name: "postalCode",
|
||||
required: false,
|
||||
rules: [{ pattern: POSTAL_CODE, message: "请输入正确的邮政编码" }],
|
||||
},
|
||||
{
|
||||
label: "规模",
|
||||
name: "scale",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ bianma: "1-10人", name: "1-10人" }],
|
||||
},
|
||||
{ label: "成立时间", name: "createDate", required: false, render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{
|
||||
label: "企业状态",
|
||||
name: "corpState",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
},
|
||||
{ name: "map", customizeRender: true, render: <Map required={false} />, span: 24 },
|
||||
{ label: "职工人数", name: "employees", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ label: "占地面积(㎡)", name: "areaCovered", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ label: "注册资金(万元)", name: "regcapital", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ label: "资产总额(万元)", name: "totalAssets", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{
|
||||
label: "经济类型",
|
||||
name: "ecoType",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ECONOMY_TYPE,
|
||||
},
|
||||
{
|
||||
label: "所属行业",
|
||||
name: "INDUSTRYALL",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ bianma: "1-10人", name: "1-10人" }],
|
||||
},
|
||||
{ label: "法定代表人", name: "lrName", required: false },
|
||||
{
|
||||
label: "法人手机号",
|
||||
name: "lrMobile",
|
||||
required: false,
|
||||
rules: [{ pattern: PHONE, message: "请输入正确的手机号" }],
|
||||
},
|
||||
{ label: "主要负责人", name: "contacts" },
|
||||
{ label: "主要负责人手机号", name: "contactsPhone", rules: [{ pattern: PHONE, message: "请输入正确的手机号" }] },
|
||||
{ label: "安全负责人", name: "safetyName", required: false },
|
||||
{
|
||||
label: "安全负责人电话手机号",
|
||||
name: "safetyPhone",
|
||||
required: false,
|
||||
rules: [{ pattern: PHONE, message: "请输入正确的手机号" }],
|
||||
},
|
||||
{
|
||||
label: "是否规模以上",
|
||||
name: "scaleType",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{ label: "企事业单位经营地址", name: "addressBusiness" },
|
||||
{
|
||||
label: "营业执照",
|
||||
name: "BUS_IMAGES",
|
||||
required: false,
|
||||
render: <Upload fileType="image" />,
|
||||
},
|
||||
{
|
||||
label: "营业执照有效期",
|
||||
name: "license",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
|
||||
},
|
||||
{ name: "qrCode", label: "企业二维码", required: false, hidden: formValues => !(formValues.xgfState !== 2), render: () => (
|
||||
<Button
|
||||
type="link"
|
||||
|
|
@ -58,8 +158,8 @@ function CorpInfo() {
|
|||
查看
|
||||
</Button>
|
||||
) },
|
||||
// { label: "单位资质信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
// { name: "qualification", customizeRender: true, span: 24, render: Qualification },
|
||||
{ label: "单位资质信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{ name: "qualification", customizeRender: true, span: 24, render: <Qualification /> },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -85,4 +185,4 @@ const CorpInfoQrCode = (props) => {
|
|||
);
|
||||
};
|
||||
|
||||
export default CorpInfo;
|
||||
export default Connect([NS_ENTERPRISE], true)(CorpInfo);
|
||||
|
|
|
|||
|
|
@ -1,28 +1,48 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { PHONE } from "zy-react-library/regular";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_DEPARTMENT } from "~/enumerate/namespace";
|
||||
|
||||
const DEPARTMENT_LEVEL_ENUM = [
|
||||
{ id: "1", name: "公司级" },
|
||||
{ id: "2", name: "部门级" },
|
||||
{ id: "3", name: "小组级" },
|
||||
];
|
||||
function Department() {
|
||||
const CorpinfoId = "1985906265017954306";
|
||||
function Department(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState(null);
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["departmentList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqParentId: selectedNodeId,
|
||||
eqCorpinfoId: CorpinfoId,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["departmentRemove"]({ id });
|
||||
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
|
|
@ -31,38 +51,39 @@ function Department() {
|
|||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "部门名称" },
|
||||
{ name: "likeName", label: "部门名称" },
|
||||
{
|
||||
name: "name",
|
||||
name: "eqLevel",
|
||||
label: "部门级别",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: DEPARTMENT_LEVEL_ENUM,
|
||||
items: [{ name: "一级部门", bianma: "1" }],
|
||||
},
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
<Button>返回</Button>
|
||||
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "部门名称", dataIndex: "name" },
|
||||
{ title: "部门级别", dataIndex: "name" },
|
||||
{ title: "主管领导", dataIndex: "name" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
|
|
@ -73,6 +94,8 @@ function Department() {
|
|||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
|
||||
setSelectedNodeId(record.parentId);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
|
|
@ -88,7 +111,12 @@ function Department() {
|
|||
</div>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
requestAdd={props["departmentAdd"]}
|
||||
requestEdit={props["departmentEdit"]}
|
||||
requestDetails={props["departmentDetails"]}
|
||||
loading={props.department.departmentLoading}
|
||||
open={addModalOpen}
|
||||
parentId={selectedNodeId}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -101,9 +129,13 @@ function Department() {
|
|||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [parentName, setParentName] = useState(null);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
console.log(props.currentId);
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
form.setFieldsValue(res.data);
|
||||
setParentName(res.data.parentName);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
|
|
@ -111,7 +143,18 @@ function AddModalComponent(props) {
|
|||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
console.log(values);
|
||||
values.levelName = getLabelName({ status: values.level, list: [{ bianma: "1", name: "一级部门" }] });
|
||||
values.parentId = props.parentId;
|
||||
values.corpinfoId = CorpinfoId;
|
||||
if (props.currentId) {
|
||||
values.parentId = props.parentId;
|
||||
values.id = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values);
|
||||
}
|
||||
|
||||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
|
|
@ -120,22 +163,32 @@ function AddModalComponent(props) {
|
|||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "修改" : "新增"}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
loading={props.loading}
|
||||
width={800}
|
||||
>
|
||||
<FormBuilder
|
||||
values={{
|
||||
securityFlag: 0,
|
||||
}}
|
||||
form={form}
|
||||
span={24}
|
||||
labelCol={{ span: 10 }}
|
||||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "name", label: "上级部门", render: () => (<Tag color="processing">111</Tag>) },
|
||||
{ name: "name", label: "部门级别", render: FORM_ITEM_RENDER_ENUM.SELECT, items: DEPARTMENT_LEVEL_ENUM },
|
||||
{ name: "name", label: "部门负责人", required: false },
|
||||
{ name: "name", label: "部门负责人手机号", required: false, rules: [{ pattern: PHONE, message: "请输入正确的手机号" }] },
|
||||
{ name: "name", label: "排序", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ name: "name", label: "备注", render: FORM_ITEM_RENDER_ENUM.TEXTAREA, required: false },
|
||||
{ name: "parentName", required: false, label: "上级部门", render: <Tag color="processing">{parentName}</Tag> },
|
||||
{ name: "name", label: "部门名称" },
|
||||
{ name: "level", label: "部门级别", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ bianma: "1", name: "一级部门" }] },
|
||||
{ name: "depOrder", label: "部门排序", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{
|
||||
name: "securityFlag",
|
||||
label: "是否安全管理部门",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }],
|
||||
},
|
||||
{ name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
]}
|
||||
/>
|
||||
</Modal>
|
||||
|
|
@ -143,4 +196,4 @@ function AddModalComponent(props) {
|
|||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Department;
|
||||
export default Connect([NS_DEPARTMENT], true)(Department);
|
||||
|
|
|
|||
|
|
@ -1,49 +1,58 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Form } from "antd";
|
||||
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { PERSONNEL_TYPE_ENUM } from "~/pages/Container/Stakeholder/User/List";
|
||||
|
||||
function SpecialOperationPersonnel() {
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["userQualificationInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqQualificationinfoType: 1,
|
||||
corpinfoIdString: "1983773013086048256",
|
||||
eqUserId: "1986628687154974721",
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "姓名" },
|
||||
{
|
||||
name: "name",
|
||||
label: "人员类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: PERSONNEL_TYPE_ENUM,
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
label: "证书类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ id: "0", name: "证书类型" }],
|
||||
},
|
||||
]}
|
||||
form={form}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{ title: "姓名", dataIndex: "name" },
|
||||
{ title: "部门", dataIndex: "name" },
|
||||
{ title: "人员类型", dataIndex: "name" },
|
||||
{ title: "证书类型", dataIndex: "name" },
|
||||
{ title: "证书编号", dataIndex: "name" },
|
||||
{ title: "就职状态", dataIndex: "name" },
|
||||
{ title: "图片", dataIndex: "name", render: text => <TooltipPreviewImg files={text} /> },
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "keyWords", label: "证书名称" },
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
columns={[
|
||||
{ title: "姓名", dataIndex: "qualificationName" },
|
||||
{ title: "证书作业类别", dataIndex: "qualificationinfoCategoryName" },
|
||||
{ title: "证书编号", dataIndex: "certificateNo" },
|
||||
|
||||
{ title: "就职状态", dataIndex: "certificateNo", render: (_, record) => <sapn>{record.employmentFlag === 1 ? "就职" : record.employmentFlag === 0 ? "离职" : ""}</sapn> },
|
||||
{ title: "图片", dataIndex: "name", render: (_, record) => (<TooltipPreviewImg files={[]} />) },
|
||||
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default SpecialOperationPersonnel;
|
||||
export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department);
|
||||
|
|
|
|||
|
|
@ -1,51 +1,59 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Form } from "antd";
|
||||
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { PERSONNEL_TYPE_ENUM } from "~/pages/Container/Stakeholder/User/List";
|
||||
|
||||
function SpecialOperationPersonnel() {
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["userQualificationInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqQualificationinfoType: 1,
|
||||
corpinfoIdString: "1983773013086048256",
|
||||
eqUserId: "1986628687154974721",
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "姓名" },
|
||||
{
|
||||
name: "name",
|
||||
label: "人员类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: PERSONNEL_TYPE_ENUM,
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
label: "证书作业类别",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ id: "0", name: "证书作业类别" }],
|
||||
},
|
||||
]}
|
||||
form={form}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{ title: "姓名", dataIndex: "name" },
|
||||
{ title: "部门", dataIndex: "name" },
|
||||
{ title: "人员类型", dataIndex: "name" },
|
||||
{ title: "证书名称", dataIndex: "name" },
|
||||
{ title: "证书作业类别", dataIndex: "name" },
|
||||
{ title: "操作项目", dataIndex: "name" },
|
||||
{ title: "证书编号", dataIndex: "name" },
|
||||
{ title: "就职状态", dataIndex: "name" },
|
||||
{ title: "图片", dataIndex: "name", render: text => <TooltipPreviewImg files={text} /> },
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "keyWords", label: "证书名称" },
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
columns={[
|
||||
{ title: "姓名", dataIndex: "qualificationName" },
|
||||
{ title: "证书作业类别", dataIndex: "qualificationinfoCategoryName" },
|
||||
{ title: "操作项目", dataIndex: "operatingProjectName" },
|
||||
{ title: "证书编号", dataIndex: "certificateNo" },
|
||||
|
||||
{ title: "就职状态", dataIndex: "certificateNo", render: (_, record) => <sapn>{record.employmentFlag === 1 ? "就职" : record.employmentFlag === 0 ? "离职" : ""}</sapn> },
|
||||
{ title: "图片", dataIndex: "name", render: (_, record) => (<TooltipPreviewImg files={[]} />) },
|
||||
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default SpecialOperationPersonnel;
|
||||
export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department);
|
||||
|
|
|
|||
|
|
@ -1,36 +1,83 @@
|
|||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import { Alert, Form } from "antd";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Form, message } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import nation from "zy-react-library/json/nation.json";
|
||||
import { ID_NUMBER } from "zy-react-library/regular";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
const { query } = tools.router;
|
||||
export const WHETHER_ENUM = [
|
||||
{ name: "是", id: "1" },
|
||||
{ name: "否", id: "0" },
|
||||
{ name: "是", bianma: "1" },
|
||||
{ name: "否", bianma: "0" },
|
||||
];
|
||||
export const SEX_ENUM = [
|
||||
{ name: "男", id: "0" },
|
||||
{ name: "女", id: "1" },
|
||||
{ name: "男", bianma: "0" },
|
||||
{ name: "女", bianma: "1" },
|
||||
];
|
||||
export const MARITAL_STATUS_ENUM = [
|
||||
{ name: "已婚", id: "1" },
|
||||
{ name: "未婚", id: "0" },
|
||||
{ name: "已婚", bianma: "1" },
|
||||
{ name: "未婚", bianma: "0" },
|
||||
];
|
||||
function Add() {
|
||||
|
||||
function Add(props) {
|
||||
const queryParams = useGetUrlQuery();
|
||||
const [form] = Form.useForm();
|
||||
const [userID, setUserID] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
console.log(queryParams["id"]);
|
||||
|
||||
if (queryParams["id"]) {
|
||||
const fetchData = async () => {
|
||||
const res = await props["userDetails"]({ id: queryParams["id"] });
|
||||
setUserID(res.data.userId);
|
||||
form.setFieldsValue(res.data);
|
||||
};
|
||||
fetchData();
|
||||
}
|
||||
}, [queryParams["id"]]);
|
||||
|
||||
const onSubmit = (values) => {
|
||||
console.log(values);
|
||||
values.mainCorpFlag = 0;
|
||||
values.userType = 1;
|
||||
values.nationName = getLabelName({ status: values.nation, list: nation });
|
||||
values.politicalAffiliationName = getLabelName({ status: values.politicalAffiliation, list: [{ name: "党员", bianma: "1" }, { name: "群众", bianma: "2" }] });
|
||||
values.culturalLevelName = getLabelName({ status: values.culturalLevel, list: [{ name: "大学", bianma: "1" }] });
|
||||
values.maritalStatusName = getLabelName({ status: values.maritalStatus, list: MARITAL_STATUS_ENUM });
|
||||
if (queryParams["id"]) {
|
||||
values.id = queryParams["id"];
|
||||
values.userId = userID;
|
||||
props["userEdit"](values).then((res) => {
|
||||
if (res.success) {
|
||||
window.history.back();
|
||||
message.success("编辑成功!");
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
props["userSaveXgfAdd"](values).then((res) => {
|
||||
if (res.success) {
|
||||
window.history.back();
|
||||
message.success("新增成功!");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title={query.id ? "修改" : "新增"} />
|
||||
<HeaderBack title={queryParams["id"] ? "编辑" : "新增"} />
|
||||
<div style={{ paddingBottom: 10 }}>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
values={{ sex: "0", isSocial: "0", isBf: "0", ispay: "0", isInjuriesPay: "0", isflow: "0", IS_SPECIAL_JOB: "0", isSignLabor: "0", isLevelThree: "0", IS_DEPARTMENT_HEAD: "0" }}
|
||||
values={{ sex: "0" }}
|
||||
loading={props.user.userLoading}
|
||||
onFinish={onSubmit}
|
||||
options={[
|
||||
{
|
||||
|
|
@ -38,11 +85,10 @@ function Add() {
|
|||
name: "userImg",
|
||||
span: 24,
|
||||
required: false,
|
||||
render: ({ value, onChange }) => (
|
||||
render: (
|
||||
<Upload
|
||||
size={4}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
fileType="image"
|
||||
tipContent={(
|
||||
<div style={{ lineHeight: 1.6, color: "red", fontSize: 12 }}>
|
||||
<div>* 图像格式:JPG、JPEG、PNG</div>
|
||||
|
|
@ -55,18 +101,19 @@ function Add() {
|
|||
/>
|
||||
),
|
||||
},
|
||||
|
||||
{ name: "username", label: "用户名", tip: "* 如果修改手机号,登录密码则会变成初始密码“Aa@123456789”" },
|
||||
{ name: "name", label: "姓名" },
|
||||
{ name: "username", label: "用户名", componentProps: { disabled: query.id } },
|
||||
{ name: "departmentId", label: "所属部门" },
|
||||
{ name: "cardId", label: "身份证号", rules: [{ pattern: ID_NUMBER, message: "请输入正确的身份证号" }] },
|
||||
{ name: "departmentId", label: "所属部门", render: <DepartmentSelectTree /> },
|
||||
{ name: "userIdCard", label: "身份证号", rules: [{ pattern: ID_NUMBER, message: "请输入正确的身份证号" }] },
|
||||
{
|
||||
name: "userCardFile",
|
||||
label: "身份证照片",
|
||||
render: ({ value, onChange }) => (
|
||||
required: false,
|
||||
render: (
|
||||
<Upload
|
||||
maxCount={2}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
fileType="image"
|
||||
tipContent={(
|
||||
<div style={{ lineHeight: 1.6, color: "red", fontSize: 12 }}>
|
||||
<div>温馨提示:用户要上传身份证正反面(身份证照片数量是2张), 才能进行人员培训</div>
|
||||
|
|
@ -77,10 +124,11 @@ function Add() {
|
|||
},
|
||||
{ name: "email", label: "电子邮箱", required: false, rules: [{ type: "email", message: "请输入正确的邮箱" }] },
|
||||
{
|
||||
name: "nationality",
|
||||
name: "nation",
|
||||
label: "民族",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
items: nation,
|
||||
},
|
||||
{
|
||||
name: "sex",
|
||||
|
|
@ -91,185 +139,186 @@ function Add() {
|
|||
},
|
||||
{ name: "dateOfBirth", label: "出生年月", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{ name: "age", label: "年龄", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ name: "hklocal", label: "户口所在地" },
|
||||
{ name: "address", label: "现住址" },
|
||||
{ name: "locationAddress", label: "户口所在地" },
|
||||
{ name: "currentAddress", label: "现住址" },
|
||||
{
|
||||
name: "degreeOfEducation",
|
||||
name: "culturalLevel",
|
||||
label: "文化程度",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
items: [{ name: "大学", bianma: "1" }],
|
||||
},
|
||||
{
|
||||
name: "maritalstatus",
|
||||
name: "maritalStatus",
|
||||
label: "婚姻状况",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: MARITAL_STATUS_ENUM,
|
||||
},
|
||||
{
|
||||
name: "politicalStatus",
|
||||
name: "politicalAffiliation",
|
||||
label: "政治面貌",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
items: [{ name: "党员", bianma: "1" }, { name: "群众", bianma: "2" }],
|
||||
componentProps: {
|
||||
onChange: () => {
|
||||
form.setFieldValue("politicalTime", undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "politicalTime",
|
||||
label: "入党时间",
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
dependencies: ["politicalStatus"],
|
||||
hidden: formValues => !(formValues.politicalStatus === "zhonggongdangyuan"),
|
||||
},
|
||||
{ name: "postId", label: "岗位名称(工种)" },
|
||||
{
|
||||
name: "isSocial",
|
||||
label: "是否缴纳社保",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
componentProps: {
|
||||
onChange: () => {
|
||||
form.setFieldValue("socialNumber", undefined);
|
||||
form.setFieldValue("socSecurity", undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "socialNumber",
|
||||
label: "社会保障号码",
|
||||
dependencies: ["isSocial"],
|
||||
hidden: formValues => !(formValues.isSocial === "1"),
|
||||
},
|
||||
{
|
||||
name: "socSecurity",
|
||||
label: "社保卡照片",
|
||||
render: ({ value, onChange }) => <Upload value={value} onChange={onChange} maxCount={2} />,
|
||||
dependencies: ["isSocial"],
|
||||
hidden: formValues => !(formValues.isSocial === "1"),
|
||||
},
|
||||
{
|
||||
name: "isBf",
|
||||
label: "是否缴纳保险",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
name: "isSignLabor",
|
||||
label: "是否签订劳动合同",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
componentProps: {
|
||||
onChange: () => {
|
||||
form.setFieldValue("contract", undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "contract",
|
||||
label: "合同图片",
|
||||
render: ({ value, onChange }) => <Upload value={value} onChange={onChange} maxCount={4} />,
|
||||
dependencies: ["isSignLabor"],
|
||||
hidden: formValues => !(formValues.isSignLabor === "1"),
|
||||
},
|
||||
{
|
||||
name: "ispay",
|
||||
label: "是否缴纳商业保险",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
componentProps: {
|
||||
onChange: () => {
|
||||
form.setFieldValue("ispayNumber", undefined);
|
||||
form.setFieldValue("insurance", undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ispayNumber",
|
||||
label: "商业保险单号",
|
||||
dependencies: ["ispay"],
|
||||
hidden: formValues => !(formValues.ispay === "1"),
|
||||
},
|
||||
{
|
||||
name: "insurance",
|
||||
label: "保险图片",
|
||||
render: ({ value, onChange }) => <Upload value={value} onChange={onChange} maxCount={4} />,
|
||||
dependencies: ["ispay"],
|
||||
hidden: formValues => !(formValues.ispay === "1"),
|
||||
},
|
||||
{
|
||||
name: "isInjuriesPay",
|
||||
label: "是否按期缴纳工伤保险",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
componentProps: {
|
||||
onChange: () => {
|
||||
form.setFieldValue("isInjuriesPayTime", undefined);
|
||||
form.setFieldValue("empInsurance", undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "isInjuriesPayTime",
|
||||
label: "工伤保险有效期",
|
||||
dependencies: ["isInjuriesPay"],
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
hidden: formValues => !(formValues.isInjuriesPay === "1"),
|
||||
},
|
||||
{
|
||||
name: "empInsurance",
|
||||
label: "工伤保险凭证",
|
||||
render: ({ value, onChange }) => <Upload value={value} onChange={onChange} maxCount={4} />,
|
||||
dependencies: ["isInjuriesPay"],
|
||||
hidden: formValues => !(formValues.isInjuriesPay === "1"),
|
||||
},
|
||||
{
|
||||
name: "isLevelThree",
|
||||
label: "是否参加三级安全培训",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
componentProps: {
|
||||
onChange: () => {
|
||||
form.setFieldValue("threeLevel", undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "threeLevel",
|
||||
label: "三级安全培训照片",
|
||||
render: ({ value, onChange }) => <Upload value={value} onChange={onChange} maxCount={4} />,
|
||||
dependencies: ["isLevelThree"],
|
||||
hidden: formValues => !(formValues.isLevelThree === "1"),
|
||||
},
|
||||
{
|
||||
name: "isflow",
|
||||
label: "是否流动人员",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
name: "IS_SPECIAL_JOB",
|
||||
label: "是否特殊工种",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
// componentProps: { disabled: true },
|
||||
},
|
||||
{
|
||||
name: "IS_DEPARTMENT_HEAD",
|
||||
label: "是否为部门负责人",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
// componentProps: { disabled: true },
|
||||
},
|
||||
{
|
||||
name: "alert",
|
||||
span: 24,
|
||||
customizeRender: true,
|
||||
render: () => (<Alert message="新增完成后请提示该用户去相关方app端完善特种证书信息,特种证书完善后用户的'是否特殊工种'将变为'是'" type="error" />),
|
||||
},
|
||||
// { name: "deputyLeaderFlag", label: "是否为分管领导", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM },
|
||||
// {
|
||||
// name: "politicalTime",
|
||||
// label: "入党时间",
|
||||
// render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
// dependencies: ["politicalStatus"],
|
||||
// hidden: formValues => !(formValues.politicalStatus === "zhonggongdangyuan"),
|
||||
// },
|
||||
// { name: "postId", label: "岗位名称(工种)" },
|
||||
// {
|
||||
// name: "isSocial",
|
||||
// label: "是否缴纳社保",
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// componentProps: {
|
||||
// onChange: () => {
|
||||
// form.setFieldValue("socialNumber", undefined);
|
||||
// form.setFieldValue("socSecurity", undefined);
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: "socialNumber",
|
||||
// label: "社会保障号码",
|
||||
// dependencies: ["isSocial"],
|
||||
// hidden: formValues => !(formValues.isSocial === "1"),
|
||||
// },
|
||||
// {
|
||||
// name: "socSecurity",
|
||||
// label: "社保卡照片",
|
||||
// render: <Upload fileType="image" />,
|
||||
// dependencies: ["isSocial"],
|
||||
// hidden: formValues => !(formValues.isSocial === "1"),
|
||||
// },
|
||||
// {
|
||||
// name: "isBf",
|
||||
// label: "是否缴纳保险",
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// },
|
||||
// {
|
||||
// name: "isSignLabor",
|
||||
// label: "是否签订劳动合同",
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// componentProps: {
|
||||
// onChange: () => {
|
||||
// form.setFieldValue("contract", undefined);
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: "contract",
|
||||
// label: "合同图片",
|
||||
// render: <Upload fileType="image" />,
|
||||
// dependencies: ["isSignLabor"],
|
||||
// hidden: formValues => !(formValues.isSignLabor === "1"),
|
||||
// },
|
||||
// {
|
||||
// name: "ispay",
|
||||
// label: "是否缴纳商业保险",
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// componentProps: {
|
||||
// onChange: () => {
|
||||
// form.setFieldValue("ispayNumber", undefined);
|
||||
// form.setFieldValue("insurance", undefined);
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: "ispayNumber",
|
||||
// label: "商业保险单号",
|
||||
// dependencies: ["ispay"],
|
||||
// hidden: formValues => !(formValues.ispay === "1"),
|
||||
// },
|
||||
// {
|
||||
// name: "insurance",
|
||||
// label: "保险图片",
|
||||
// render: <Upload fileType="image" />,
|
||||
// dependencies: ["ispay"],
|
||||
// hidden: formValues => !(formValues.ispay === "1"),
|
||||
// },
|
||||
// {
|
||||
// name: "isInjuriesPay",
|
||||
// label: "是否按期缴纳工伤保险",
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// componentProps: {
|
||||
// onChange: () => {
|
||||
// form.setFieldValue("isInjuriesPayTime", undefined);
|
||||
// form.setFieldValue("empInsurance", undefined);
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: "isInjuriesPayTime",
|
||||
// label: "工伤保险有效期",
|
||||
// dependencies: ["isInjuriesPay"],
|
||||
// render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
// hidden: formValues => !(formValues.isInjuriesPay === "1"),
|
||||
// },
|
||||
// {
|
||||
// name: "empInsurance",
|
||||
// label: "工伤保险凭证",
|
||||
// render: <Upload fileType="image" />,
|
||||
// dependencies: ["isInjuriesPay"],
|
||||
// hidden: formValues => !(formValues.isInjuriesPay === "1"),
|
||||
// },
|
||||
// {
|
||||
// name: "isLevelThree",
|
||||
// label: "是否参加三级安全培训",
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// componentProps: {
|
||||
// onChange: () => {
|
||||
// form.setFieldValue("threeLevel", undefined);
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: "threeLevel",
|
||||
// label: "三级安全培训照片",
|
||||
// render: <Upload fileType="image" />,
|
||||
// dependencies: ["isLevelThree"],
|
||||
// hidden: formValues => !(formValues.isLevelThree === "1"),
|
||||
// },
|
||||
// {
|
||||
// name: "isflow",
|
||||
// label: "是否流动人员",
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// },
|
||||
// {
|
||||
// name: "IS_SPECIAL_JOB",
|
||||
// label: "是否特殊工种",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// // componentProps: { disabled: true },
|
||||
// },
|
||||
// {
|
||||
// name: "IS_DEPARTMENT_HEAD",
|
||||
// label: "是否为部门负责人",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
// items: WHETHER_ENUM,
|
||||
// // componentProps: { disabled: true },
|
||||
// },
|
||||
// {
|
||||
// name: "alert",
|
||||
// span: 24,
|
||||
// customizeRender: true,
|
||||
// render: () => (<Alert message="新增完成后请提示该用户去相关方app端完善特种证书信息,特种证书完善后用户的'是否特殊工种'将变为'是'" type="error" />),
|
||||
// },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -277,4 +326,4 @@ function Add() {
|
|||
);
|
||||
}
|
||||
|
||||
export default Add;
|
||||
export default Connect([NS_USER], true)(Add);
|
||||
|
|
|
|||
|
|
@ -1,112 +1,211 @@
|
|||
import { Button, Form, message, Modal } from "antd";
|
||||
import { useState } from "react";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import ImportIcon from "zy-react-library/components/Icon/ImportIcon";
|
||||
import ImportFile from "zy-react-library/components/ImportFile";
|
||||
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
export const PERSONNEL_TYPE_ENUM = [
|
||||
{ id: "0", name: "非流动人员" },
|
||||
{ id: "1", name: "流动人员" },
|
||||
];
|
||||
function List(props) {
|
||||
const [importOpen, setImportOpen] = useState(false);
|
||||
const [selectedNodeId, setSelectedNodeId] = useState();
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["userList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
userType: 3,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onImportFileConfirm = (values) => {
|
||||
console.log(values);
|
||||
message.success("导入成功");
|
||||
};
|
||||
const onResignation = (id) => {
|
||||
const onResetPassword = () => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定离职吗?",
|
||||
onOk: () => {
|
||||
message.success("离职成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
const onResetPassword = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "是否重置密码为Bb@123456789?",
|
||||
content: "确定要重置密码为Aa@123456789吗?",
|
||||
onOk: () => {
|
||||
message.success("重置密码成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["userRemove"]({ id });
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
labelCol={{ span: 8 }}
|
||||
options={[
|
||||
{ name: "name", label: "姓名" },
|
||||
{ name: "name", label: "身份证" },
|
||||
{
|
||||
name: "name",
|
||||
label: "人员类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: PERSONNEL_TYPE_ENUM,
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
label: "基础信息填报状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ id: "0", name: "未填报" }, { id: "1", name: "已填报" }],
|
||||
},
|
||||
{ name: "userIdCard", label: "身份证号" },
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button type="primary" icon={<AddIcon />} onClick={() => props.history.push("./add")}>新增</Button>
|
||||
<Button type="primary" icon={<ImportIcon />} onClick={() => setImportOpen(true)}>导入</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
props.history.push("./add");
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "用户名", dataIndex: "name" },
|
||||
{ title: "用户名", dataIndex: "username" },
|
||||
{ title: "姓名", dataIndex: "name" },
|
||||
{ title: "部门", dataIndex: "name" },
|
||||
{ title: "人员类型", dataIndex: "name" },
|
||||
{ title: "培训状态", dataIndex: "name" },
|
||||
{ title: "基础信息填报状态", dataIndex: "name" },
|
||||
{ title: "部门", dataIndex: "departmentName" },
|
||||
{ title: "岗位", dataIndex: "postName" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 300,
|
||||
width: 600,
|
||||
render: (_, record) => (
|
||||
<>
|
||||
<Button type="link" onClick={() => props.history.push(`./view?id=${record.id}`)}>查看</Button>
|
||||
<Button type="link" onClick={() => props.history.push(`./add?id=${record.id}`)}>修改</Button>
|
||||
<Button type="link" onClick={() => onResignation(record.id)}>离职</Button>
|
||||
<Space>
|
||||
<Button type="link" onClick={() => onResetPassword(record.id)}>重置密码</Button>
|
||||
</>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./add?id=${record.id}`);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./SpecialPersonnel?id=${record.id}&corpinfoId=${record.corpinfoId}`);
|
||||
}}
|
||||
>
|
||||
特种作业人员证书
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
props.history.push(`./SecurityPersonnel?id=${record.id}&corpinfoId=${record.corpinfoId}`);
|
||||
}}
|
||||
>
|
||||
安全人员证书
|
||||
</Button>
|
||||
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
dataSource={[{}]}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<ImportFile
|
||||
visible={importOpen}
|
||||
templateUrl=""
|
||||
onConfirm={onImportFileConfirm}
|
||||
onCancel={() => { setImportOpen(false); }}
|
||||
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
open={addModalOpen}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({ id: props.currentId });
|
||||
console.log(res.data);
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
console.log(info);
|
||||
}
|
||||
}, [props.currentId]);
|
||||
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
okButtonProps={{ style: { display: "none" } }}
|
||||
title="查看"
|
||||
width={900}
|
||||
>
|
||||
|
||||
<div style={{ padding: 20 }}>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={2}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "用户角色", children: info.username },
|
||||
{ label: "所属部门", children: info.departmentName },
|
||||
{ label: "是否部门负责人", children: <span>{info.departmentLeaderFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "所属岗位", children: info.postName },
|
||||
{ label: "用户名", children: info.username },
|
||||
{ label: "姓名", children: info.name },
|
||||
{ label: "手机号", children: info.phone },
|
||||
{ label: "人员类型", children: info.personnelTypeName },
|
||||
{ label: "身份证号", children: info.userIdCard },
|
||||
{ label: "民族", children: info.nationName },
|
||||
{ label: "性别", children: info.sex },
|
||||
|
||||
{ label: "人脸照片", children: info.nationName },
|
||||
{ label: "部门排序", children: info.sort },
|
||||
{ label: "邮箱", children: info.email },
|
||||
{ label: "备注", children: info.remarks },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
export default List;
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_USER], true)(List);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,198 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Dictionary from "zy-react-library/components/Select/Dictionary";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const queryParams = useGetUrlQuery();
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["userQualificationInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqQualificationinfoType: 2,
|
||||
corpinfoIdString: queryParams["corpinfoId"],
|
||||
eqUserId: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["userQualificationInfoRemove"]({ id });
|
||||
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
|
||||
<HeaderBack title="证书列表" />
|
||||
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "keyWords", label: "证书名称" },
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "姓名", dataIndex: "qualificationName" },
|
||||
{ title: "证书名称", dataIndex: "qualificationName" },
|
||||
{ title: "证书编号", dataIndex: "certificateNo" },
|
||||
{ title: "就职状态", dataIndex: "certificateNo", render: (_, record) => <sapn>{record.employmentFlag === 1 ? "就职" : record.employmentFlag === 0 ? "离职" : ""}</sapn> },
|
||||
{ title: "图片", dataIndex: "name", render: (_, record) => (<TooltipPreviewImg files={[]} />) },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</Button>
|
||||
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
open={addModalOpen}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const queryParams = useGetUrlQuery();
|
||||
const [userQualificationinfoId, setUserQualificationinfoId] = useState("");
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
form.setFieldsValue(res.data);
|
||||
setUserQualificationinfoId(res.data.userQualificationinfoId);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
values.corpinfoId = queryParams["corpinfoId"];
|
||||
values.userIdString = queryParams["id"];
|
||||
|
||||
values.qualificationinfoType = 2;
|
||||
values.userQualificationinfoId = userQualificationinfoId;
|
||||
values.qualificationinfoCategory = "qyzyfzr";
|
||||
values.qualificationinfoCategoryName = "企业主要负责人";
|
||||
if (props.currentId) {
|
||||
values.idString = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values);
|
||||
}
|
||||
|
||||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
loading={props.loding}
|
||||
>
|
||||
<FormBuilder
|
||||
values={{
|
||||
securityFlag: 0,
|
||||
}}
|
||||
form={form}
|
||||
span={24}
|
||||
labelCol={{ span: 10 }}
|
||||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "qualificationName", label: "证书名称" },
|
||||
{ name: "qualificationinfoCategory", required: false, label: "证书作业类别", render: <Dictionary dictValue="zslx" /> },
|
||||
|
||||
{ name: "certificateNo", label: "证书编号" },
|
||||
{ name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "name", required: false, label: "证书图片", render: <Upload size={10} fileType="image" /> },
|
||||
|
||||
]}
|
||||
s
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department);
|
||||
|
|
@ -0,0 +1,199 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const queryParams = useGetUrlQuery();
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["userQualificationInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqQualificationinfoType: 1,
|
||||
corpinfoIdString: queryParams["corpinfoId"],
|
||||
eqUserId: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["userQualificationInfoRemove"]({ id });
|
||||
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="证书列表" />
|
||||
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "keyWords", label: "证书名称" },
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "姓名", dataIndex: "qualificationName" },
|
||||
{ title: "证书名称", dataIndex: "qualificationName" },
|
||||
{ title: "证书作业类别", dataIndex: "qualificationinfoCategoryName" },
|
||||
{ title: "操作项目", dataIndex: "operatingProjectName" },
|
||||
{ title: "证书编号", dataIndex: "certificateNo" },
|
||||
{ title: "就职状态", dataIndex: "certificateNo", render: (_, record) => <sapn>{record.employmentFlag === 1 ? "就职" : record.employmentFlag === 0 ? "离职" : ""}</sapn> },
|
||||
{ title: "图片", dataIndex: "name", render: (_, record) => (<TooltipPreviewImg files={[]} />) },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</Button>
|
||||
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
dictData={props["dictData"]}
|
||||
open={addModalOpen}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const queryParams = useGetUrlQuery();
|
||||
const [userQualificationinfoId, setUserQualificationinfoId] = useState("");
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
form.setFieldsValue(res.data);
|
||||
setUserQualificationinfoId(res.data.userQualificationinfoId);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
values.corpinfoId = queryParams["corpinfoId"];
|
||||
values.userIdString = queryParams["id"];
|
||||
values.operatingProject = "DGZY_dgzy";
|
||||
values.operatingProjectName = "电工作业";
|
||||
values.qualificationinfoType = 1;
|
||||
values.userQualificationinfoId = userQualificationinfoId;
|
||||
values.qualificationinfoCategory = "DYDGZY";
|
||||
values.qualificationinfoCategoryName = "低压电工作业";
|
||||
if (props.currentId) {
|
||||
values.idString = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values);
|
||||
}
|
||||
|
||||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
loading={props.loding}
|
||||
>
|
||||
<FormBuilder
|
||||
values={{
|
||||
securityFlag: 0,
|
||||
}}
|
||||
form={form}
|
||||
span={24}
|
||||
labelCol={{ span: 10 }}
|
||||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "qualificationName", label: "证书名称" },
|
||||
{ name: "qualificationinfoCategory", required: false, label: "证书作业类别", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [], itemsField: { labelKey: "dictLabel", valueKey: "dictValue" } },
|
||||
{ name: "operatingProject", required: false, label: "操作项目" },
|
||||
{ name: "certificateNo", label: "证书编号" },
|
||||
{ name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "name", required: false, label: "证书图片", render: <Upload size={10} fileType="image" /> },
|
||||
|
||||
]}
|
||||
s
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department);
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,3 +1,4 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
|
|
@ -6,10 +7,39 @@ import Search from "zy-react-library/components/Search";
|
|||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
const ENTERPRISE_TYPE = [
|
||||
{ bianma: 0, name: "普通企业" },
|
||||
{ bianma: 1, name: "集团单位" },
|
||||
];
|
||||
const ENTERPRISE_STATUS = [
|
||||
{ bianma: "filialstate01", name: "在产" },
|
||||
{ bianma: "filialstate02", name: "在建" },
|
||||
{ bianma: "filialstate03", name: "代建" },
|
||||
{ bianma: "filialstate04", name: "停产" },
|
||||
{ bianma: "filialstate05", name: "破产" },
|
||||
];
|
||||
const ECONOMY_TYPE = [
|
||||
{ bianma: "economic_type19", name: "外资" },
|
||||
{ bianma: "economic_type18", name: "中外合作" },
|
||||
{ bianma: "economic_type17", name: "中外合资" },
|
||||
|
||||
];
|
||||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 2,
|
||||
};
|
||||
},
|
||||
});
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [openType, setOpenType] = useState("");
|
||||
|
|
@ -19,6 +49,7 @@ function List(props) {
|
|||
title: "提示",
|
||||
content: "是否重置密码为Bb@123456789?",
|
||||
onOk: () => {
|
||||
props["corpInfoChangePassword"]({ id });
|
||||
message.success("重置密码成功");
|
||||
getData();
|
||||
},
|
||||
|
|
@ -29,17 +60,20 @@ function List(props) {
|
|||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["corpInfoRemove"]({ id });
|
||||
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
const fnIsEnable = (id) => {
|
||||
const fnIsEnable = (row) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
content: `确定${row.useFlag === 1 ? "停用" : row.useFlag === 0 ? "启用" : ""}吗?`,
|
||||
onOk: () => {
|
||||
message.success("删除成功");
|
||||
props["corpInfoChangeUseFlag"]({ id: row.id, useFlag: row.useFlag === 0 ? 1 : 0 });
|
||||
message.success(`${row.useFlag === 1 ? "停用" : row.useFlag === 0 ? "启用" : ""}成功`);
|
||||
getData();
|
||||
},
|
||||
});
|
||||
|
|
@ -49,21 +83,22 @@ function List(props) {
|
|||
<Search
|
||||
labelCol={{ span: 7 }}
|
||||
options={[
|
||||
{ name: "name", label: "分公司名称", placeholder: "请输入分公司名称,支持模糊搜索" },
|
||||
{ name: "name", label: "分公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "time", label: "开户时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||
{ name: "name", label: "经济类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "likecorpName", label: "分公司名称" },
|
||||
{ name: "eqCorpState", label: "分公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_STATUS },
|
||||
// { name: "createDate", label: "开户时间", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||
{ name: "eqEcoType", label: "经济类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ECONOMY_TYPE },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
loading={props.enterprise.enterpriseLoading}
|
||||
toolBarRender={() => (
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setOpenType("");
|
||||
setOpenType("add");
|
||||
}}
|
||||
icon={<AddIcon />}
|
||||
>
|
||||
|
|
@ -71,22 +106,27 @@ function List(props) {
|
|||
</Button>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "分公司名称", dataIndex: "name" },
|
||||
{ title: "社会统一信用代码", dataIndex: "name" },
|
||||
{ title: "经济类型", dataIndex: "name" },
|
||||
{ title: "分公司状态", dataIndex: "name" },
|
||||
{ title: "状态", dataIndex: "name" },
|
||||
{ title: "操作", width: 200, render: (_, record) => (
|
||||
{ title: "分公司名称", dataIndex: "corpName" },
|
||||
{ title: "社会统一信用代码", dataIndex: "code" },
|
||||
{ title: "企业类型", dataIndex: "type", render: (_, record) => (
|
||||
<div>
|
||||
{getLabelName({ status: record.type, list: ENTERPRISE_TYPE })}
|
||||
</div>
|
||||
) },
|
||||
{ title: "经济类型", dataIndex: "ecoTypeName" },
|
||||
{ title: "分公司状态", dataIndex: "corpStateName" },
|
||||
{ title: "状态", dataIndex: "corpStateName", render: (_, record) => (<span>{record.useFlag === 0 ? "停用" : record.useFlag === 1 ? "启用" : ""}</span>) },
|
||||
{ title: "操作", width: 550, render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
setOpenType("");
|
||||
setOpenType("edit");
|
||||
}}
|
||||
>
|
||||
修改
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
type="link"
|
||||
|
|
@ -100,7 +140,7 @@ function List(props) {
|
|||
</Button>
|
||||
<Button type="link" onClick={() => props.history.push(`./View?id=${record.id}`)}>查看</Button>
|
||||
<Button type="link" onClick={() => onResetPassword(record.id)}>重置密码</Button>
|
||||
<Button type="link" danger onClick={() => fnIsEnable(record.id)}>启用</Button>
|
||||
<Button type="link" danger onClick={() => fnIsEnable(record)}>{record.useFlag === 1 ? "停用" : record.useFlag === 0 ? "启用" : ""}</Button>
|
||||
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
|
||||
|
||||
</Space>
|
||||
|
|
@ -110,8 +150,13 @@ function List(props) {
|
|||
/>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
requestAdd={props["corpInfoAdd"]}
|
||||
requestEdit={props["corpInfoEdit"]}
|
||||
requestDetails={props["corpInfoRemoveDetails"]}
|
||||
requestChangeCompanyName={props["corpInfoChangeCompanyName"]}
|
||||
open={addModalOpen}
|
||||
openType={openType}
|
||||
loading={props.enterprise.enterpriseLoading}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -124,9 +169,12 @@ function List(props) {
|
|||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
console.log(props.loading);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
console.log(props.currentId);
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
form.setFieldsValue(res.data);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
|
|
@ -134,7 +182,20 @@ function AddModalComponent(props) {
|
|||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
console.log(values);
|
||||
values.ecoTypeName = getLabelName({ status: values.ecoType, list: ECONOMY_TYPE });
|
||||
values.corpStateName = getLabelName({ status: values.corpState, list: ENTERPRISE_STATUS });
|
||||
if (props.openType === "editName") {
|
||||
values.id = props.currentId;
|
||||
await props.requestChangeCompanyName(values);
|
||||
}
|
||||
if (props.openType === "edit") {
|
||||
values.id = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
}
|
||||
if (props.openType === "add") {
|
||||
await props.requestAdd(values);
|
||||
}
|
||||
|
||||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
|
|
@ -143,8 +204,9 @@ function AddModalComponent(props) {
|
|||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "修改" : "新增"}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
loading={props.loading}
|
||||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
|
|
@ -153,12 +215,12 @@ function AddModalComponent(props) {
|
|||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "name", label: "分公司名称" },
|
||||
{ name: "name", label: "社会统一信用代码", hidden: (props.openType === "editName") },
|
||||
{ name: "name", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, hidden: (props.openType === "editName") },
|
||||
{ name: "name", label: "经济类型", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: [{ id: "0", name: "是" }, { id: "2", name: "否" }], hidden: (props.openType === "editName") },
|
||||
{ name: "name", label: "分公司状态", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ id: "1-10人", name: "1-10人" }], hidden: (props.openType === "editName") },
|
||||
{ name: "name", label: "列表排序", render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (props.openType === "editName") },
|
||||
{ name: "corpName", label: "分公司名称" },
|
||||
{ name: "code", label: "社会统一信用代码", rules: [{ pattern: UNIFIED_SOCIAL_CREDIT_CODE, message: "请输入正确的社会统一信用代码" }], hidden: (props.openType === "editName") },
|
||||
{ name: "type", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE, hidden: (props.openType === "editName") },
|
||||
{ name: "ecoType", label: "经济类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ECONOMY_TYPE, hidden: (props.openType === "editName") },
|
||||
{ name: "corpState", label: "分公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_STATUS, hidden: (props.openType === "editName") },
|
||||
{ name: "corpOrder", label: "列表排序", render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (props.openType === "editName") },
|
||||
]}
|
||||
/>
|
||||
</Modal>
|
||||
|
|
@ -166,4 +228,4 @@ function AddModalComponent(props) {
|
|||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default List;
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,32 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Descriptions, Divider } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
const ENTERPRISE_TYPE = [
|
||||
{ bianma: 0, name: "普通企业" },
|
||||
{ bianma: 1, name: "集团单位" },
|
||||
{ bianma: 2, name: "股份单位" },
|
||||
{ bianma: 3, name: "相关方企业" },
|
||||
{ bianma: 4, name: "货主单位" },
|
||||
{ bianma: 5, name: "驻港单位" },
|
||||
];
|
||||
|
||||
function View(props) {
|
||||
const queryParams = useGetUrlQuery();
|
||||
const [info, setInfo] = useState({});
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props.corpInfoRemoveDetails({ id: queryParams["id"] });
|
||||
setInfo(res.data);
|
||||
// 不要在这里 log info,它还是旧的
|
||||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
function View() {
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="查看" />
|
||||
|
|
@ -9,33 +34,21 @@ function View() {
|
|||
<Divider orientation="left">企业信息</Divider>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={2}
|
||||
column={1}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "公司名称", children: "Zhou" },
|
||||
{ label: "邮政编码", children: "Zhou" },
|
||||
{ label: "社会统一信用代码", children: "Zhou" },
|
||||
{ label: "属地", children: "Zhou" },
|
||||
{ label: "所属行业", children: "Zhou" },
|
||||
{ label: "经济类型", children: "Zhou" },
|
||||
{ label: "企事业单位地址", children: "Zhou" },
|
||||
{ label: "分公司类型", children: "Zhou" },
|
||||
{ label: "经度", children: "Zhou" },
|
||||
{ label: "纬度", children: "Zhou" },
|
||||
{ label: "公司法定代表人", children: "Zhou" },
|
||||
{ label: "公司法定代表人手机号", children: "Zhou" },
|
||||
{ label: "主要分责人", children: "Zhou" },
|
||||
{ label: "主要分责人手机号", children: "Zhou" },
|
||||
{ label: "安全分责人", children: "Zhou" },
|
||||
{ label: "安全分责人手机号", children: "Zhou" },
|
||||
{ label: "职工人数", children: "Zhou" },
|
||||
{ label: "占地面积(m2)", children: "Zhou" },
|
||||
{ label: "注册资金(万元)", children: "Zhou" },
|
||||
{ label: "资产总额(万元)", children: "Zhou" },
|
||||
{ label: "成立时间", children: "Zhou" },
|
||||
{ label: "规模", children: "Zhou" },
|
||||
{ label: "是否规模以上", children: "Zhou" },
|
||||
{ label: "列表排序", children: "Zhou" },
|
||||
{ label: "分公司名称", children: info.corpName && info.corpName },
|
||||
{ label: "社会统一信用代码", children: info.code, width: 200 },
|
||||
{ label: "企业类型", children: (
|
||||
<span>
|
||||
|
||||
{getLabelName({ status: info.type, list: ENTERPRISE_TYPE })}
|
||||
</span>
|
||||
) },
|
||||
{ label: "经济类型", children: info.ecoTypeName },
|
||||
{ label: "分公司状态", children: info.corpStateName },
|
||||
{ label: "列表排序", children: info.corpOrder },
|
||||
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -43,4 +56,4 @@ function View() {
|
|||
);
|
||||
}
|
||||
|
||||
export default View;
|
||||
export default Connect([NS_ENTERPRISE], true)(View);
|
||||
|
|
|
|||
|
|
@ -1,21 +1,36 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
const ENTERPRISE_TYPE = [
|
||||
{ bianma: 0, name: "普通企业" },
|
||||
{ bianma: 1, name: "集团单位" },
|
||||
];
|
||||
const BRANCH_CONPANY_STATUS = [
|
||||
{ id: 1, name: "在产" },
|
||||
{ id: 0, name: "在建" },
|
||||
{ bianma: 1, name: "在产" },
|
||||
{ bianma: 0, name: "在建" },
|
||||
];
|
||||
const STATUS = [
|
||||
{ id: 1, name: "启用" },
|
||||
{ id: 0, name: "停用" },
|
||||
{ bianma: 1, name: "启用" },
|
||||
{ bianma: 0, name: "停用" },
|
||||
];
|
||||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 2,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
|
|
@ -24,15 +39,15 @@ function List(props) {
|
|||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "分公司名称" },
|
||||
{ name: "likecorpName", label: "分公司名称" },
|
||||
{
|
||||
name: "name",
|
||||
name: "corpState",
|
||||
label: "分公司状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: BRANCH_CONPANY_STATUS,
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
name: "useFlag",
|
||||
label: "启用状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: STATUS,
|
||||
|
|
@ -44,12 +59,16 @@ function List(props) {
|
|||
<Table
|
||||
|
||||
columns={[
|
||||
{ title: "分公司名称", dataIndex: "name" },
|
||||
{ title: "厂级部门数", dataIndex: "name" },
|
||||
{ title: "科/队部门数", dataIndex: "name" },
|
||||
{ title: "班组级部门数", dataIndex: "name" },
|
||||
{ title: "分公司状态", dataIndex: "name" },
|
||||
{ title: "状态", dataIndex: "name" },
|
||||
{ title: "分公司名称", dataIndex: "corpName" },
|
||||
{ title: "社会统一信用代码", dataIndex: "code" },
|
||||
{ title: "企业类型", dataIndex: "type", render: (_, record) => (
|
||||
<div>
|
||||
{getLabelName({ status: record.type, list: ENTERPRISE_TYPE })}
|
||||
</div>
|
||||
) },
|
||||
{ title: "经济类型", dataIndex: "ecoTypeName" },
|
||||
{ title: "分公司状态", dataIndex: "corpStateName" },
|
||||
{ title: "列表排序", dataIndex: "corpOrder" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
|
|
@ -70,4 +89,4 @@ function List(props) {
|
|||
);
|
||||
}
|
||||
|
||||
export default List;
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
|
|
|
|||
|
|
@ -1,20 +1,43 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, Modal, Space } from "antd";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_DEPARTMENT } from "~/enumerate/namespace";
|
||||
|
||||
function View() {
|
||||
function View(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
|
||||
const queryParams = useGetUrlQuery();
|
||||
|
||||
const [selectedNodeId, setSelectedNodeId] = useState(null);
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["departmentList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqParentId: selectedNodeId,
|
||||
eqCorpInfoId: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onTreeChange = (selectedKeys, event) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div style={{ flex: 1 }}>
|
||||
|
||||
<Table
|
||||
|
|
@ -51,6 +74,7 @@ function View() {
|
|||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
requestDetails={props["departmentDetails"]}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -58,14 +82,15 @@ function View() {
|
|||
}
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
console.log(props.currentId);
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
setInfo(res.data);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
|
||||
|
|
@ -73,7 +98,7 @@ function AddModalComponent(props) {
|
|||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
okButtonProps={{ style: { display: "none" } }}
|
||||
title="查看"
|
||||
width={800}
|
||||
>
|
||||
|
|
@ -82,12 +107,12 @@ function AddModalComponent(props) {
|
|||
column={1}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "上级部门", children: "Zhou" },
|
||||
{ label: "部门名称", children: "Zhou" },
|
||||
{ label: "部门级别", children: "Zhou" },
|
||||
{ label: "是否监督部门", children: "Zhou" },
|
||||
{ label: "备注", children: "Zhou" },
|
||||
{ label: "排序", children: "Zhou" },
|
||||
{ label: "上级部门", children: info.parentName },
|
||||
{ label: "部门名称", children: info.parentName },
|
||||
{ label: "部门级别", children: info.levelName },
|
||||
{ label: "是否安全部门", children: <span>{info.securityFlag === 1 ? "是" : info.securityFlag === 0 ? "否" : ""}</span> },
|
||||
{ label: "备注", children: info.remarks },
|
||||
{ label: "排序", children: info.depOrder },
|
||||
|
||||
]}
|
||||
/>
|
||||
|
|
@ -96,4 +121,4 @@ function AddModalComponent(props) {
|
|||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default View;
|
||||
export default Connect([NS_DEPARTMENT], true)(View);
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Map from "zy-react-library/components/Map";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import { PHONE, UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
|
||||
// const xgfStateMap = {
|
||||
// 0: "未填报",
|
||||
// 1: "待审核",
|
||||
// 2: "已审核",
|
||||
// 3: <span style={{ color: "red" }}>已打回</span>,
|
||||
// 4: "已填报",
|
||||
// };
|
||||
const { query } = tools.router;
|
||||
function Add() {
|
||||
const onSubmit = (values) => {
|
||||
console.log(values);
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title={query.id ? "修改" : "新增"} />
|
||||
<div style={{ paddingBottom: 10 }}>
|
||||
<FormBuilder
|
||||
onFinish={onSubmit}
|
||||
span={12}
|
||||
labelCol={{ span: 8 }}
|
||||
options={[
|
||||
{ label: "基础信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{ name: "corpName", label: "分公司名称" },
|
||||
{ name: "corpName", label: "邮政编码", required: false, hidden: (!query.id) },
|
||||
{ name: "code", label: "统一社会信用代码", rules: [{ pattern: UNIFIED_SOCIAL_CREDIT_CODE, message: "请输入正确的统一社会信用代码" }] },
|
||||
{ name: "companyAreas", label: "属地", hidden: (!query.id) },
|
||||
{ name: "industryNames", label: "所属行业", hidden: (!query.id) },
|
||||
{ name: "ecoType", label: "经济类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }] },
|
||||
{ name: "ecoType", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }] },
|
||||
{ name: "address", label: "企事业单位经营地址", required: false, hidden: (!query.id) },
|
||||
{ name: "ecoType", label: "分公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }] },
|
||||
{ name: "map", customizeRender: true, render: () => <Map required={false} />, span: 24 },
|
||||
{ name: "lrName", label: "公司法定代表人", required: false, hidden: (!query.id) },
|
||||
{ name: "lrPhone", label: "公司法定代表人手机号", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }], required: false, hidden: (!query.id) },
|
||||
{ name: "contacts", label: "主要负责人", required: false, hidden: (!query.id) },
|
||||
{ name: "contactsPhone", label: "主要负责人联系电话", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }], required: false, hidden: (!query.id) },
|
||||
{ name: "contacts", label: "安全负责人", required: false, hidden: (!query.id) },
|
||||
{ name: "contactsPhone", label: "安全负责人联系电话", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }], required: false, hidden: (!query.id) },
|
||||
{ name: "scale", label: "企业规模", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }], required: false, hidden: (!query.id) },
|
||||
{ name: "createDate", label: "占地面积(平方米)", render: FORM_ITEM_RENDER_ENUM.DATE, required: false, hidden: (!query.id) },
|
||||
{ name: "employees", label: "职工人数(人)", render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (!query.id) },
|
||||
{ name: "employees", label: "成立时间", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (!query.id) },
|
||||
{ name: "employees", label: "注册资金(万元)", render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (!query.id) },
|
||||
{ name: "employees", label: "资产总额(万元)", render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (!query.id) },
|
||||
{ name: "employees", label: "规模", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (!query.id) },
|
||||
{ name: "employees", label: "是否规模以上", required: false, render: FORM_ITEM_RENDER_ENUM.NUMBER, hidden: (!query.id) },
|
||||
{ name: "employees", label: "列表排序", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Add;
|
||||
|
|
@ -1,163 +1,89 @@
|
|||
import { Button, Form, Space } from "antd";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Space } from "antd";
|
||||
import { useState } from "react";
|
||||
import MapSelector from "zy-react-library/components/Map/MapSelector";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
const ENTERPRISE_TYPE = [
|
||||
{ bianma: 0, name: "普通企业" },
|
||||
{ bianma: 1, name: "集团单位" },
|
||||
];
|
||||
const ENTERPRISE_STATUS = [
|
||||
{ bianma: "filialstate01", name: "在产" },
|
||||
{ bianma: "filialstate02", name: "在建" },
|
||||
{ bianma: "filialstate03", name: "代建" },
|
||||
{ bianma: "filialstate04", name: "停产" },
|
||||
{ bianma: "filialstate05", name: "破产" },
|
||||
];
|
||||
const ECONOMY_TYPE = [
|
||||
{ bianma: "economic_type19", name: "外资" },
|
||||
{ bianma: "economic_type18", name: "中外合作" },
|
||||
{ bianma: "economic_type17", name: "中外合资" },
|
||||
|
||||
const WHETHER_ENUM = [
|
||||
{ bianma: "1", name: "是" },
|
||||
{ bianma: "0", name: "否" },
|
||||
];
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 2,
|
||||
};
|
||||
},
|
||||
});
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [selectedLng, setSelectedLng] = useState("119.69457721306945");
|
||||
const [selectedLat, setSelectedLat] = useState("39.940504336846665");
|
||||
const [selectedLng, setSelectedLng] = useState("");
|
||||
const [selectedLat, setSelectedLat] = useState("");
|
||||
const [rowData, setRowData] = useState({});
|
||||
|
||||
const handleOpen = () => {
|
||||
const handleOpen = (row) => {
|
||||
setSelectedLng(row.longitude);
|
||||
setSelectedLat(row.latitude);
|
||||
setRowData(row);
|
||||
setVisible(true);
|
||||
};
|
||||
const handleConfirm = (lng, lat) => {
|
||||
console.log("选中的坐标:", lng, lat);
|
||||
setSelectedLng(lng);
|
||||
setSelectedLat(lat);
|
||||
console.log(rowData);
|
||||
rowData.latitude = lng;
|
||||
rowData.longitude = lat;
|
||||
props["corpInfoEdit"](rowData).then(() => {
|
||||
message.success("定位成功!");
|
||||
});
|
||||
// props.
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Search
|
||||
labelCol={{ span: 12 }}
|
||||
labelCol={{ span: 10 }}
|
||||
options={[
|
||||
{ name: "name", label: "分公司名称", placeholder: "请输入分公司名称,支持模糊搜索" },
|
||||
{ name: "name", label: "隶属关系", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "name", label: "企业状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ label: "基本信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{ name: "name", label: "企业名称", required: false },
|
||||
{ name: "name", label: "登录账号", required: false },
|
||||
{ name: "name", label: "属地", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }], required: false },
|
||||
{ name: "name", label: "注册地址", required: false },
|
||||
{ name: "name", label: "企业办公地址", required: false },
|
||||
{ name: "name", label: "社会统一信用代码", required: false },
|
||||
{ name: "name", label: "企业状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }], required: false },
|
||||
{ name: "name", label: "经济状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }], required: false },
|
||||
{ name: "name", label: "成立时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{ name: "name", label: "注册资金", required: false },
|
||||
{ name: "name", label: "固定资产", required: false },
|
||||
{ name: "name", label: "隶属关系", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }], required: false },
|
||||
{ name: "name", label: "年产值(万元)", required: false },
|
||||
{ name: "name", label: "年利润(万元)", required: false },
|
||||
{ name: "name", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }], required: false },
|
||||
{ name: "name", label: "企业规模", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }], required: false },
|
||||
{ name: "likecorpName", label: "分公司名称" },
|
||||
{ name: "likeCorpAccount", label: "登录账号" },
|
||||
{ name: "province", label: "属地", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "eqAddressBusiness", label: "企业经营地址" },
|
||||
{ name: "eqAddressOffice", label: "企业办公地址" },
|
||||
{ name: "eqCode", label: "社会统一信用代码" },
|
||||
{ name: "eqCorpState", label: "分公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_STATUS },
|
||||
{ name: "eqEcoType", label: "经济状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ECONOMY_TYPE },
|
||||
{ name: "eqCreateDate", label: "成立时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{ name: "eqRegcapital", label: "注册资金" },
|
||||
{ name: "eqTotalAssets", label: "固定资产" },
|
||||
|
||||
{ name: "enterpriseType", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
|
||||
{ name: "eqScale", label: "企业规模", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ label: "法定代表人信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{ name: "name", label: "法人姓名", required: false },
|
||||
{ name: "name", label: "手机号", required: false },
|
||||
{ name: "eqLrName", label: "法人姓名" },
|
||||
{ name: "eqLrMobile", label: "手机号" },
|
||||
{ label: "主要负责人信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{ name: "name", label: "主要负责人姓名", required: false },
|
||||
{ name: "name", label: "手机号", required: false },
|
||||
{ label: "企业相关属性", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{
|
||||
label: "有无职业卫生信息",
|
||||
name: "name",
|
||||
{ name: "eqContacts", label: "主要负责人姓名" },
|
||||
{ name: "eqContactsPhone", label: "手机号" },
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "有无重大危险源",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否有稀缺大型应急物资和设备",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "有无涉及危化品",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "有无特种设备",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "有无特种工作人员",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "有无特种工作人员",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及煤气",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否属于消费重点单位",
|
||||
name: "name",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否在有限空间作业",
|
||||
name: "name",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及涉尘涉爆作业",
|
||||
name: "name",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及防雷防静电",
|
||||
name: "name",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否持有放射源",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及液氮制冷",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及危险品管道",
|
||||
name: "name",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
|
|
@ -167,18 +93,21 @@ function List(props) {
|
|||
// <Button type="primary" onClick={() => props.history.push("./Search")} icon={<AddIcon />}>高级搜索</Button>
|
||||
// )}
|
||||
columns={[
|
||||
{ title: "分公司名称", dataIndex: "name" },
|
||||
{ title: "注册地址", dataIndex: "name" },
|
||||
{ title: "所属行业", dataIndex: "name" },
|
||||
{ title: "主要负责人", dataIndex: "name" },
|
||||
{ title: "联系方式", dataIndex: "name" },
|
||||
{ title: "公司状态", dataIndex: "name" },
|
||||
{ title: "开户人", dataIndex: "name" },
|
||||
{ title: "状态", dataIndex: "name" },
|
||||
{ title: "定位状态", dataIndex: "name" },
|
||||
{ title: "分公司名称", dataIndex: "corpName" },
|
||||
{ title: "经营地址", dataIndex: "addressBusiness" },
|
||||
{ title: "所属行业", dataIndex: "corpTypeName" },
|
||||
{ title: "主要负责人", dataIndex: "contacts" },
|
||||
{ title: "主要负责人电话", dataIndex: "contactsPhone" },
|
||||
{ title: "公司状态", dataIndex: "corpStateName" },
|
||||
{ title: "状态", dataIndex: "useFlag", render: (_, record) => (
|
||||
<span>{record.useFlag === 0 ? "停用" : record.useFlag === 1 ? "启用" : ""}</span>
|
||||
) },
|
||||
{ title: "定位状态", dataIndex: "name", render: (_, record) => (
|
||||
<span>{record.longitude ? "已定位" : "未定位" }</span>
|
||||
) },
|
||||
{ title: "操作", width: 200, render: (_, record) => (
|
||||
<Space>
|
||||
<Button type="link" onClick={() => props.history.push(`./Add?id=${record.id}`)}>查看</Button>
|
||||
<Button type="link" onClick={() => props.history.push(`./View?id=${record.id}`)}>查看</Button>
|
||||
<Button type="link" onClick={() => handleOpen(record)}>定位</Button>
|
||||
|
||||
</Space>
|
||||
|
|
@ -197,4 +126,4 @@ function List(props) {
|
|||
);
|
||||
}
|
||||
|
||||
export default List;
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
|
|
|
|||
|
|
@ -1,164 +0,0 @@
|
|||
import { Form } from "antd";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
|
||||
const WHETHER_ENUM = [
|
||||
{ bianma: "1", name: "是" },
|
||||
{ bianma: "0", name: "否" },
|
||||
];
|
||||
function View() {
|
||||
const [form] = Form.useForm();
|
||||
const onSearch = (value) => {
|
||||
console.log(value);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="查看" />
|
||||
<div style={{ padding: 20 }}>
|
||||
|
||||
<Search
|
||||
labelCol={{ span: 7 }}
|
||||
options={[
|
||||
{ label: "基本信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{ name: "name", label: "企业名称", required: false },
|
||||
{ name: "name", label: "登录账号", required: false },
|
||||
{ name: "name", label: "属地", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }], required: false },
|
||||
{ name: "name", label: "注册地址", required: false },
|
||||
{ name: "name", label: "企业办公地址", required: false },
|
||||
{ name: "name", label: "社会统一信用代码", required: false },
|
||||
{ name: "name", label: "企业状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }], required: false },
|
||||
{ name: "name", label: "经济状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }], required: false },
|
||||
{ name: "name", label: "成立时间", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{ name: "name", label: "注册资金", required: false },
|
||||
{ name: "name", label: "固定资产", required: false },
|
||||
{ name: "name", label: "隶属关系", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }], required: false },
|
||||
{ name: "name", label: "年产值(万元)", required: false },
|
||||
{ name: "name", label: "年利润(万元)", required: false },
|
||||
{ name: "name", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }], required: false },
|
||||
{ name: "name", label: "企业规模", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }], required: false },
|
||||
{ label: "法定代表人信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{ name: "name", label: "法人姓名", required: false },
|
||||
{ name: "name", label: "手机号", required: false },
|
||||
{ label: "主要负责人信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{ name: "name", label: "主要负责人姓名", required: false },
|
||||
{ name: "name", label: "手机号", required: false },
|
||||
{ label: "企业相关属性", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{
|
||||
label: "有无职业卫生信息",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "有无重大危险源",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否有稀缺大型应急物资和设备",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "有无涉及危化品",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "有无特种设备",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "有无特种工作人员",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "有无特种工作人员",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及煤气",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否属于消费重点单位",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否在有限空间作业",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及涉尘涉爆作业",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及防雷防静电",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否持有放射源",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及液氮制冷",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
label: "是否涉及危险品管道",
|
||||
name: "name",
|
||||
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
]}
|
||||
form={form}
|
||||
onFinish={onSearch}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default View;
|
||||
|
|
@ -1,42 +1,60 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Descriptions, Divider, Tabs } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
const info = {
|
||||
special: [],
|
||||
};
|
||||
function View() {
|
||||
function View(props) {
|
||||
const [info, setInfo] = useState({});
|
||||
const queryParams = useGetUrlQuery();
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props.corpInfoRemoveDetails({ id: queryParams["id"] });
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
const items = [
|
||||
{
|
||||
key: "1",
|
||||
label: "基础信息",
|
||||
children: (
|
||||
<div>
|
||||
{" "}
|
||||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={2}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "企业名称", children: "Zhou" },
|
||||
{ label: "登录账号", children: "Zhou" },
|
||||
{ label: "统一社会信用代码", children: "Zhou" },
|
||||
{ label: "所属区域", children: "Zhou" },
|
||||
{ label: "规模", children: "Zhou" },
|
||||
{ label: "成立时间", children: "Zhou" },
|
||||
{ label: "经度/维度", children: "Zhou" },
|
||||
{ label: "职工人数", children: "Zhou" },
|
||||
{ label: "占地面积(m2)", children: "Zhou" },
|
||||
{ label: "注册资金(万元)", children: "Zhou" },
|
||||
{ label: "资产总额(万元)", children: "Zhou" },
|
||||
{ label: "经济类型", children: "Zhou" },
|
||||
{ label: "所属行业", children: "Zhou" },
|
||||
{ label: "是否规模以上", children: "Zhou" },
|
||||
{ label: "企事业单位经营地址", children: "Zhou" },
|
||||
{ label: "企业名称", children: info.corpName && info.corpName },
|
||||
{ label: "统一社会信用代码", children: info.code },
|
||||
{ label: "所属区域", children: info.companyArea },
|
||||
{ label: "邮政编码", children: info.postalCode },
|
||||
{ label: "成立时间", children: info.createDate },
|
||||
{ label: "规模", children: info.scaleName },
|
||||
{ label: "经度", children: info.longitude },
|
||||
{ label: "纬度", children: info.latitude },
|
||||
{ label: "职工人数", children: info.employees },
|
||||
{ label: "占地面积(㎡)", children: info.areaCovered },
|
||||
{ label: "资产总额(万元)", children: info.totalAssets },
|
||||
{ label: "注册资金(万元)", children: info.regcapital },
|
||||
{ label: "经济类型", children: info.ecoTypeName },
|
||||
{ label: "所属行业", children: info.regcapital },
|
||||
{ label: "法定代表人", children: info.lrName },
|
||||
{ label: "法人手机号", children: info.lrMobile },
|
||||
{ label: "主要负责人", children: info.contacts },
|
||||
{ label: "主要负责人手机号", children: info.contactsPhone },
|
||||
{ label: "安全负责人", children: info.safetyName },
|
||||
{ label: "安全负责人手机号", children: info.safetyPhone },
|
||||
{ label: "是否规模以上", children: <span>{info.scaleType === 1 ? "是" : info.scaleType === 0 ? "否" : ""}</span> },
|
||||
{ label: "企事业单位经营地址", children: info.addressBusiness },
|
||||
{ label: "企业状态", children: info.corpStateName },
|
||||
{ label: "营业执照", children: "Zhou" },
|
||||
{ label: "营业执照有效期", children: "Zhou" },
|
||||
{ label: "营业执照有效期", children: `${info.licenseStart} 至 ${info.licenseEnd}` },
|
||||
|
||||
]}
|
||||
/>
|
||||
|
|
@ -47,8 +65,8 @@ function View() {
|
|||
bordered
|
||||
items={[
|
||||
|
||||
{ label: "姓名", children: "Zhou" },
|
||||
{ label: "手机号码", children: "Zhou" },
|
||||
{ label: "姓名", children: info.lrName },
|
||||
{ label: "手机号码", children: info.lrMobile },
|
||||
|
||||
]}
|
||||
/>
|
||||
|
|
@ -59,8 +77,8 @@ function View() {
|
|||
bordered
|
||||
items={[
|
||||
|
||||
{ label: "姓名", children: "Zhou" },
|
||||
{ label: "手机号码", children: "Zhou" },
|
||||
{ label: "姓名", children: info.contacts },
|
||||
{ label: "手机号码", children: info.contactsPhone },
|
||||
|
||||
]}
|
||||
/>
|
||||
|
|
@ -71,62 +89,40 @@ function View() {
|
|||
bordered
|
||||
items={[
|
||||
|
||||
{ label: "姓名", children: "Zhou" },
|
||||
{ label: "手机号码", children: "Zhou" },
|
||||
{ label: "姓名", children: info.safetyName },
|
||||
{ label: "手机号码", children: info.safetyPhone },
|
||||
|
||||
]}
|
||||
/>
|
||||
|
||||
<Divider orientation="left">企业相关属性</Divider>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={2}
|
||||
bordered
|
||||
items={[
|
||||
|
||||
{ label: "有无职业卫生信息", children: "Zhou" },
|
||||
{ label: "有无重大危险源", children: "Zhou" },
|
||||
{ label: "是否有稀缺大型应急物资和设备", children: "Zhou" },
|
||||
{ label: "有无涉及危化品", children: "Zhou" },
|
||||
{ label: "有无特种设备", children: "Zhou" },
|
||||
{ label: "有无特种工作人员", children: "Zhou" },
|
||||
{ label: "是否涉及煤气", children: "Zhou" },
|
||||
{ label: "是否属于消费重点单位", children: "Zhou" },
|
||||
{ label: "是否在有限空间作业", children: "Zhou" },
|
||||
{ label: "是否涉及涉尘涉爆作业", children: "Zhou" },
|
||||
{ label: "是否涉及防雷防静电", children: "Zhou" },
|
||||
{ label: "是否持有放射源", children: "Zhou" },
|
||||
{ label: "是否涉及液氮制冷", children: "Zhou" },
|
||||
{ label: "是否涉及危险品管道", children: "Zhou" },
|
||||
{ label: "有无职业卫生信息", children: <span>{info.whetherHygieneFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "有无重大危险源", children: <span>{info.whetherHazardsFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "是否有稀缺大型应急物资和设施", children: <span>{info.whetherScarceFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "有无涉及危化品", children: <span>{info.whetherChemicalsFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "有无特种设备", children: <span>{info.whetherSpecialequipmentFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "有无特种工作人员", children: <span>{info.whetherSpecialpeopleFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "是否涉及煤气", children: <span>{info.whetherCoalgasFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "是否属于消防重点单位", children: <span>{info.whetherFireFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "是否在有限空间作业", children: <span>{info.whetherConfinedFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "是否存在涉爆粉尘作业", children: <span>{info.whetherPowderFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "是否涉及防雷防静电", children: <span>{info.whetherLightningFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "是否持有放射源", children: <span>{info.whetherActinogenFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "是否涉及液氨制冷", children: <span>{info.whetherLiquidammoniaFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "是否涉及危险品管道", children: <span>{info.whetherPipelineFlag === 1 ? "是" : "否"}</span> },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
key: "2",
|
||||
label: "资质证照管理",
|
||||
children: (
|
||||
<Table
|
||||
columns={[
|
||||
{ title: "证件名称", dataIndex: "specialTypeName" },
|
||||
{ title: "证书有效期", dataIndex: "operationTypeName" },
|
||||
{ title: "证书编号", dataIndex: "certificate" },
|
||||
{ title: "照片", dataIndex: "filepath", render: (_, record) => (<TooltipPreviewImg files={[]} />) },
|
||||
|
||||
]}
|
||||
pagination={false}
|
||||
dataSource={info.special}
|
||||
disabledResizer={true}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "3",
|
||||
label: "入职从业人员登记",
|
||||
children: "Content of Tab Pane 3",
|
||||
},
|
||||
{
|
||||
key: "4",
|
||||
label: "人员证照管理",
|
||||
children: (
|
||||
<Table
|
||||
|
|
@ -157,4 +153,4 @@ function View() {
|
|||
);
|
||||
}
|
||||
|
||||
export default View;
|
||||
export default Connect([NS_ENTERPRISE], true)(View);
|
||||
|
|
|
|||
|
|
@ -1,70 +1,70 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
const ENTERPRISE_STATUS = [
|
||||
{ bianma: "filialstate01", name: "在产" },
|
||||
{ bianma: "filialstate02", name: "在建" },
|
||||
{ bianma: "filialstate03", name: "代建" },
|
||||
{ bianma: "filialstate04", name: "停产" },
|
||||
{ bianma: "filialstate05", name: "破产" },
|
||||
];
|
||||
const USER_FLAG = [
|
||||
{ bianma: 1, name: "启用" },
|
||||
{ bianma: 0, name: "停用" },
|
||||
|
||||
];
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const BRANCH_CONPANY_STATUS = [
|
||||
{ id: 1, name: "在产" },
|
||||
{ id: 0, name: "在建" },
|
||||
];
|
||||
const STATUS = [
|
||||
{ id: 1, name: "启用" },
|
||||
{ id: 0, name: "停用" },
|
||||
];
|
||||
const { tableProps, getData } = useTable(props["corpUserMiddlePage"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 2,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "分公司名称", placeholder: "请输入分公司名称,支持模糊搜索" },
|
||||
{ name: "corpState", label: "公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_STATUS },
|
||||
{ name: "useFlag", label: "启用状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: USER_FLAG },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "分公司名称" },
|
||||
{
|
||||
name: "name",
|
||||
label: "分公司状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: BRANCH_CONPANY_STATUS,
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
label: "启用状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: STATUS,
|
||||
},
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{ title: "分公司名称", dataIndex: "corpName" },
|
||||
{ title: "人数", dataIndex: "userCount", render: (_, record) => (
|
||||
<span>{record.userCount ? record.userCount : "0"}</span>
|
||||
) },
|
||||
|
||||
columns={[
|
||||
{ title: "分公司名称", dataIndex: "name" },
|
||||
{ title: "属地", dataIndex: "name" },
|
||||
{ title: "所属行业", dataIndex: "name" },
|
||||
{ title: "人数", dataIndex: "name" },
|
||||
{ title: "分公司状态", dataIndex: "name" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
{ title: "公司状态", dataIndex: "corpStateName" },
|
||||
{ title: "启用状态", dataIndex: "useFlag", render: (_, record) => (
|
||||
<span>{record.useFlag === 0 ? "停用" : record.useFlag === 1 ? "启用" : ""}</span>
|
||||
) },
|
||||
|
||||
<Button type="link" danger onClick={() => props.history.push(`./UserList?id=${record.id}`)}>查看</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
{ title: "操作", width: 200, render: (_, record) => (
|
||||
<Space>
|
||||
<Button type="link" onClick={() => props.history.push(`./UserList?id=${record.id}`)}>查看</Button>
|
||||
</Space>
|
||||
) },
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default List;
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
|
|
|
|||
|
|
@ -1,35 +1,64 @@
|
|||
import { Button, Form, Space } from "antd";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function UserList(props) {
|
||||
function List(props) {
|
||||
const queryParams = useGetUrlQuery();
|
||||
const [selectedNodeId, setSelectedNodeId] = useState();
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["userList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
corpinfoId: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
console.log(selectedKeys);
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div style={{ flex: 1 }}>
|
||||
|
||||
<Table
|
||||
|
||||
columns={[
|
||||
{ title: "用户名", dataIndex: "name" },
|
||||
{ title: "用户名", dataIndex: "username" },
|
||||
{ title: "姓名", dataIndex: "name" },
|
||||
{ title: "部门", dataIndex: "name" },
|
||||
{ title: "部门", dataIndex: "departmentName" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
width: 300,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => props.history.push(`./View?id=${record.id}`)}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
|
|
@ -39,7 +68,77 @@ function UserList(props) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
open={addModalOpen}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({ id: props.currentId });
|
||||
console.log(res.data);
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
console.log(info);
|
||||
}
|
||||
}, [props.currentId]);
|
||||
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
okButtonProps={{ style: { display: "none" } }}
|
||||
title="查看"
|
||||
width={900}
|
||||
>
|
||||
|
||||
<div style={{ padding: 20 }}>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={2}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "用户角色", children: info.username },
|
||||
{ label: "所属部门", children: info.departmentName },
|
||||
{ label: "是否部门负责人", children: <span>{info.departmentLeaderFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "所属岗位", children: info.postName },
|
||||
{ label: "用户名", children: info.username },
|
||||
{ label: "姓名", children: info.name },
|
||||
{ label: "手机号", children: info.phone },
|
||||
{ label: "人员类型", children: info.personnelTypeName },
|
||||
{ label: "身份证号", children: info.userIdCard },
|
||||
{ label: "民族", children: info.nationName },
|
||||
{ label: "性别", children: info.sex },
|
||||
|
||||
{ label: "人脸照片", children: info.nationName },
|
||||
{ label: "部门排序", children: info.sort },
|
||||
{ label: "邮箱", children: info.email },
|
||||
{ label: "备注", children: info.remarks },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
export default UserList;
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_USER], true)(List);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Form } from "antd";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
const ENTERPRISE_TYPE = [
|
||||
{ bianma: 0, name: "普通企业" },
|
||||
{ bianma: 1, name: "集团单位" },
|
||||
];
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["userEmploymentLogAll"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "公司名称" },
|
||||
{ name: "eqtype", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
|
||||
]}
|
||||
form={form}
|
||||
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>
|
||||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_USER], true)(List);
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
const ENTERPRISE_TYPE = [
|
||||
{ bianma: 0, name: "普通企业" },
|
||||
{ bianma: 1, name: "集团单位" },
|
||||
];
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["corpUserMiddlePage"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 2,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "公司名称" },
|
||||
{ name: "eqtype", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
columns={[
|
||||
{ title: "公司名称", dataIndex: "corpName" },
|
||||
{ title: "公司类型", dataIndex: "type", render: (_, record) => (
|
||||
<div>
|
||||
{getLabelName({ status: record.type, list: ENTERPRISE_TYPE })}
|
||||
</div>
|
||||
) },
|
||||
|
||||
{ title: "部门数", dataIndex: "departMentCount" },
|
||||
{ title: "岗位数", dataIndex: "postCount" },
|
||||
{ title: "用户数", dataIndex: "userCount" },
|
||||
{ title: "中台人员存在数", dataIndex: "middleUserCount" },
|
||||
|
||||
{ title: "操作", width: 200, render: (_, record) => (
|
||||
<Space>
|
||||
<Button type="link" onClick={() => props.history.push(`./UserList?id=${record.id}`)}>查看</Button>
|
||||
</Space>
|
||||
) },
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
const USER_TYPE = [
|
||||
|
||||
{ bianma: 1, name: "在职" },
|
||||
{ bianma: 2, name: "离职" },
|
||||
|
||||
];
|
||||
function List(props) {
|
||||
const [selectedNodeId, setSelectedNodeId] = useState();
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const queryParams = useGetUrlQuery();
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["userList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
corpinfoId: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
console.log(selectedKeys);
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "关键字", tip: "用户名/姓名" },
|
||||
{ name: "eqtype", label: "人员状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: USER_TYPE },
|
||||
]}
|
||||
form={form}
|
||||
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}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
open={addModalOpen}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({ id: props.currentId });
|
||||
console.log(res.data);
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
console.log(info);
|
||||
}
|
||||
}, [props.currentId]);
|
||||
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
okButtonProps={{ style: { display: "none" } }}
|
||||
title="查看"
|
||||
width={900}
|
||||
>
|
||||
|
||||
<div style={{ padding: 20 }}>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={2}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "用户角色", children: info.username },
|
||||
{ label: "所属部门", children: info.departmentName },
|
||||
{ label: "是否部门负责人", children: <span>{info.departmentLeaderFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "所属岗位", children: info.postName },
|
||||
{ label: "用户名", children: info.username },
|
||||
{ label: "姓名", children: info.name },
|
||||
{ label: "手机号", children: info.phone },
|
||||
{ label: "人员类型", children: info.personnelTypeName },
|
||||
{ label: "身份证号", children: info.userIdCard },
|
||||
{ label: "民族", children: info.nationName },
|
||||
{ label: "性别", children: info.sex },
|
||||
|
||||
{ label: "人脸照片", children: info.nationName },
|
||||
{ label: "部门排序", children: info.sort },
|
||||
{ label: "邮箱", children: info.email },
|
||||
{ label: "备注", children: info.remarks },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_USER], true)(List);
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
function EnterpriseMiddleground(props) {
|
||||
return (
|
||||
<div>
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default EnterpriseMiddleground;
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
|
||||
import { Button, Modal, QRCode } from "antd";
|
||||
import { useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Map from "zy-react-library/components/Map";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import { PHONE, UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
|
||||
const xgfStateMap = {
|
||||
0: "未填报",
|
||||
1: "待审核",
|
||||
2: "已审核",
|
||||
3: <span style={{ color: "red" }}>已打回</span>,
|
||||
4: "已填报",
|
||||
};
|
||||
const { query } = tools.router;
|
||||
function Add() {
|
||||
const [corpInfoQrCodeOpen, setCorpInfoQrCodeOpen] = useState(false);
|
||||
const onSubmit = (values) => {
|
||||
console.log(values);
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title={query.id ? "修改" : "新增"} />
|
||||
<div style={{ paddingBottom: 10 }}>
|
||||
<FormBuilder
|
||||
onFinish={onSubmit}
|
||||
span={12}
|
||||
labelCol={{ span: 8 }}
|
||||
options={[
|
||||
{ label: "相关方单位基础信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
{ name: "corpName", label: "单位名称" },
|
||||
{ name: "xgfState", label: "企业状态", required: false, render: ({ formValues }) => xgfStateMap[formValues?.xgfState] || "未填报" },
|
||||
{ name: "holderName", label: "开户人", required: false, componentProps: { disabled: true }, hidden: (!query.id) },
|
||||
{ name: "code", label: "统一社会信用代码", rules: [{ pattern: UNIFIED_SOCIAL_CREDIT_CODE, message: "请输入正确的统一社会信用代码" }] },
|
||||
{ name: "companyAreas", label: "属地", required: false, hidden: (!query.id) },
|
||||
{ name: "industryNames", label: "所属行业", required: false, hidden: (!query.id) },
|
||||
{ name: "map", customizeRender: true, render: () => <Map required={false} />, span: 24, hidden: (!query.id) },
|
||||
{ name: "ecoType", label: "经济类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }], required: false },
|
||||
{ name: "address", label: "单位经营地址", required: false, hidden: (!query.id) },
|
||||
{ name: "scale", label: "企业规模", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }], required: false, hidden: (!query.id) },
|
||||
{ name: "lrName", label: "法人姓名", required: false, hidden: (!query.id) },
|
||||
{ name: "lrPhone", label: "联系电话", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }], required: false, hidden: (!query.id) },
|
||||
{ name: "contacts", label: "主要负责人", required: false, hidden: (!query.id) },
|
||||
{ name: "contactsPhone", label: "主要负责人联系电话", rules: [{ pattern: PHONE, message: "请输入正确的手机号码" }], required: false, hidden: (!query.id) },
|
||||
{ name: "createDate", label: "成立日期", render: FORM_ITEM_RENDER_ENUM.DATE, required: false, hidden: (!query.id) },
|
||||
{ name: "employees", label: "职工人数(人)", render: FORM_ITEM_RENDER_ENUM.NUMBER, required: false, hidden: (!query.id) },
|
||||
{ name: "totalassets", label: "资产总额(万元)", render: FORM_ITEM_RENDER_ENUM.NUMBER, required: false, hidden: (!query.id) },
|
||||
{ name: "regcapital", label: "注册资金(万元)", render: FORM_ITEM_RENDER_ENUM.NUMBER, required: false, hidden: (!query.id) },
|
||||
{ name: "employmentForm", label: "用工形式", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }], required: false, hidden: (!query.id) },
|
||||
{ name: "selectForms", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "集团单位1", id: "1" }], required: false, hidden: (!query.id) },
|
||||
{ name: "businessLicense", label: "营业执照", render: ({ value, onChange }) => <Upload maxCount={5} size={5} value={value} onChange={onChange} />, hidden: (!query.id) },
|
||||
{ name: "businessLicenseDate", label: "营业执照有效期", render: FORM_ITEM_RENDER_ENUM.DATE, hidden: (!query.id) },
|
||||
{ name: "qrCode", label: "企业二维码", required: false, hidden: formValues => !(formValues.xgfState !== 2 && query.id), render: () => (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setCorpInfoQrCodeOpen(true);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
) },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
<CorpInfoQrCode open={corpInfoQrCodeOpen} onCancel={() => setCorpInfoQrCodeOpen(false)} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
const CorpInfoQrCode = (props) => {
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={props.onCancel}
|
||||
title="企业二维码"
|
||||
footer={[
|
||||
<Button key="cancel" onClick={props.onCancel}>
|
||||
关闭
|
||||
</Button>,
|
||||
]}
|
||||
>
|
||||
<QRCode value="-" style={{ margin: "0 auto" }} />
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
export default Add;
|
||||
|
|
@ -1,66 +1,111 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
const ENTERPRISE_TYPE = [
|
||||
{ bianma: 3, name: "相关方企业" },
|
||||
{ bianma: 4, name: "货主单位" },
|
||||
{ bianma: 5, name: "驻港单位" },
|
||||
];
|
||||
|
||||
const ECONOMY_TYPE = [
|
||||
{ bianma: "economic_type19", name: "外资" },
|
||||
{ bianma: "economic_type18", name: "中外合作" },
|
||||
{ bianma: "economic_type17", name: "中外合资" },
|
||||
|
||||
];
|
||||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 3,
|
||||
};
|
||||
},
|
||||
});
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
|
||||
const onResetPassword = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "是否重置密码为Bb@123456789?",
|
||||
onOk: () => {
|
||||
props["corpInfoChangePassword"]({ id });
|
||||
message.success("重置密码成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["corpInfoRemove"]({ id });
|
||||
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
const onResetPassword = () => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定要重置密码为Aa@123456789吗?",
|
||||
onOk: () => {
|
||||
message.success("重置密码成功");
|
||||
},
|
||||
});
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Search
|
||||
|
||||
options={[
|
||||
// { name: "name", label: "关键字", tip: "证书名称/证书编号" },
|
||||
{ name: "name", label: "单位名称", placeholder: "请输入单位名称,支持模糊搜索" },
|
||||
{ name: "name", label: "属地", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "time", label: "证书有效期", render: FORM_ITEM_RENDER_ENUM.DATE_RANGE },
|
||||
{ name: "name", label: "集团单位", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "name", label: "股份主管部门", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "name", label: "主管部门(指定)", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "name", label: "主管部门(级联)", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "corpName", label: "分公司名称" },
|
||||
{ name: "corpName", label: "属地" },
|
||||
{ name: "eqtype", label: "相关方企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<Button type="primary" onClick={() => props.history.push("./add")} icon={<AddIcon />}>新增</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
icon={<AddIcon />}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "集团单位", dataIndex: "name" },
|
||||
{ title: "相关单位名称", dataIndex: "name" },
|
||||
{ title: "属地", dataIndex: "name" },
|
||||
{ title: "股份主管部门", dataIndex: "name" },
|
||||
{ title: "股份监管部门", dataIndex: "name" },
|
||||
{ title: "基层单位主管部门", dataIndex: "name" },
|
||||
{ title: "基层单位监督部门", dataIndex: "name" },
|
||||
{ title: "开户人", dataIndex: "name" },
|
||||
{ title: "状态", dataIndex: "name" },
|
||||
{ title: "操作", width: 200, render: (_, record) => (
|
||||
{ title: "单位名称", dataIndex: "corpName" },
|
||||
{ title: "属地", dataIndex: "corpName" },
|
||||
{ title: "开户人", dataIndex: "createName" },
|
||||
{ title: "社会统一信用代码", dataIndex: "code" },
|
||||
|
||||
{ title: "开户时间", dataIndex: "createDate" },
|
||||
|
||||
{ title: "操作", width: 350, render: (_, record) => (
|
||||
<Space>
|
||||
<Button type="link" onClick={() => props.history.push(`./add?id=${record.id}`)}>查看</Button>
|
||||
<Button type="link" onClick={() => props.history.push(`./add?id=${record.id}`)}>编辑</Button>
|
||||
<Button type="link" onClick={() => props.history.push(`./View?id=${record.id}`)}>查看</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button type="link" onClick={() => onResetPassword(record.id)}>重置密码</Button>
|
||||
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</Space>
|
||||
|
|
@ -68,8 +113,77 @@ function List(props) {
|
|||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
requestAdd={props["corpInfoAdd"]}
|
||||
requestEdit={props["corpInfoEdit"]}
|
||||
requestDetails={props["corpInfoRemoveDetails"]}
|
||||
requestChangeCompanyName={props["corpInfoChangeCompanyName"]}
|
||||
open={addModalOpen}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
console.log(props);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
form.setFieldsValue(res.data);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
values.ecoTypeName = getLabelName({ status: values.ecoType, list: ECONOMY_TYPE });
|
||||
|
||||
export default List;
|
||||
if (props.currentId) {
|
||||
values.id = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values);
|
||||
}
|
||||
|
||||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
span={24}
|
||||
labelCol={{ span: 10 }}
|
||||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "corpName", label: "单位名称" },
|
||||
{ name: "code", label: "社会统一信用代码", rules: [{ pattern: UNIFIED_SOCIAL_CREDIT_CODE, message: "请输入正确的社会统一信用代码" }] },
|
||||
{ name: "ecoType", label: "经济类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ECONOMY_TYPE },
|
||||
{ name: "type", label: "相关方企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
|
||||
|
||||
|
||||
]}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,24 @@
|
|||
import { Descriptions, Divider } from "antd";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Descriptions, Divider, Form } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
function View() {
|
||||
function View(props) {
|
||||
const [info, setInfo] = useState({});
|
||||
const [form] = Form.useForm();
|
||||
const fnSearch = (values) => {
|
||||
console.log(values);
|
||||
};
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props.corpInfoRemoveDetails({ id: "1985906265017954306" });
|
||||
setInfo(res.data);
|
||||
// 不要在这里 log info,它还是旧的
|
||||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="查看" />
|
||||
|
|
@ -9,35 +26,45 @@ function View() {
|
|||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={1}
|
||||
column={2}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "企业名称", children: "Zhou" },
|
||||
{ label: "企业状态", children: "Zhou" },
|
||||
{ label: "开户人", children: "Zhou" },
|
||||
{ label: "统一社会信用代码", children: "Zhou" },
|
||||
{ label: "属地", children: "Zhou" },
|
||||
{ label: "所属行业", children: "Zhou" },
|
||||
{ label: "经济类型", children: "Zhou" },
|
||||
{ label: "经度", children: "Zhou" },
|
||||
{ label: "纬度", children: "Zhou" },
|
||||
{ label: "单位经营地址", children: "Zhou" },
|
||||
{ label: "企业规模", children: "Zhou" },
|
||||
{ label: "法定代表人", children: "Zhou" },
|
||||
{ label: "法人手机号", children: "Zhou" },
|
||||
{ label: "主要负责人", children: "Zhou" },
|
||||
{ label: "主要负责人手机号", children: "Zhou" },
|
||||
{ label: "成立日期", children: "Zhou" },
|
||||
{ label: "职工人数", children: "Zhou" },
|
||||
{ label: "资产总额(万元)", children: "Zhou" },
|
||||
{ label: "注册资金(万元)", children: "Zhou" },
|
||||
{ label: "营业执照", children: "Zhou" },
|
||||
{ label: "企业二维码", children: "Zhou" },
|
||||
{ label: "单位名称", children: info.corpName && info.corpName },
|
||||
{ label: "企业状态", children: info.corpStateName },
|
||||
{ label: "开户人", children: info.createName },
|
||||
{ label: "统一社会信用代码", children: info.code },
|
||||
{ label: "属地", children: info.companyArea },
|
||||
{ label: "所属行业", children: info.companyArea },
|
||||
{ label: "企业规模", children: info.scaleName },
|
||||
{ label: "经度", children: info.longitude },
|
||||
{ label: "纬度", children: info.latitude },
|
||||
{ label: "单位经营地址", children: info.addressBusiness },
|
||||
{ label: "法定代表人", children: info.lrName },
|
||||
{ label: "法人手机号", children: info.lrMobile },
|
||||
{ label: "主要负责人", children: info.contacts },
|
||||
{ label: "主要负责人手机号", children: info.contactsPhone },
|
||||
{ label: "职工人数", children: info.employees },
|
||||
{ label: "占地面积(㎡)", children: info.areaCovered },
|
||||
{ label: "资产总额(万元)", children: info.totalAssets },
|
||||
{ label: "注册资金(万元)", children: info.regcapital },
|
||||
{ label: "经济类型", children: info.ecoTypeName },
|
||||
|
||||
]}
|
||||
/>
|
||||
<Divider orientation="left">营业执照</Divider>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={2}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "营业执照", children: "Zhou", render: <TooltipPreviewImg files={{ file: "" }} /> },
|
||||
{ label: "营业执照有效期", children: `${info.licenseStart} 至 ${info.licenseEnd}` },
|
||||
]}
|
||||
/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default View;
|
||||
export default Connect([NS_ENTERPRISE], true)(View);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,201 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const queryParams = useGetUrlQuery();
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["userQualificationInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqQualificationinfoType: 2,
|
||||
corpinfoIdString: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["userQualificationInfoRemove"]({ id });
|
||||
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
|
||||
<HeaderBack title="证书列表" />
|
||||
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "keyWords", label: "证书名称" },
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "姓名", dataIndex: "qualificationName" },
|
||||
{ title: "证书名称", dataIndex: "qualificationName" },
|
||||
{ title: "证书编号", dataIndex: "certificateNo" },
|
||||
{ title: "就职状态", dataIndex: "certificateNo", render: (_, record) => <sapn>{record.employmentFlag === 1 ? "就职" : record.employmentFlag === 0 ? "离职" : ""}</sapn> },
|
||||
{ title: "图片", dataIndex: "name", render: (_, record) => (<TooltipPreviewImg files={[]} />) },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</Button>
|
||||
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
dictData={props["dictData"]}
|
||||
open={addModalOpen}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const queryParams = useGetUrlQuery();
|
||||
const [userQualificationinfoId, setUserQualificationinfoId] = useState("");
|
||||
useEffect(() => {
|
||||
// 证书作业类别
|
||||
// props.dictData({ appKey: "0bb989ecada5470c87635018ece9f327", dictValue: "zylb" }).then((res) => {
|
||||
// setQualificationinfo(res.data);
|
||||
// });
|
||||
|
||||
if (props.currentId) {
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
form.setFieldsValue(res.data);
|
||||
setUserQualificationinfoId(res.data.userQualificationinfoId);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
values.corpinfoId = queryParams["corpinfoId"];
|
||||
values.userIdString = queryParams["id"];
|
||||
|
||||
values.qualificationinfoType = 2;
|
||||
values.userQualificationinfoId = userQualificationinfoId;
|
||||
values.qualificationinfoCategory = "qyzyfzr";
|
||||
values.qualificationinfoCategoryName = "企业主要负责人";
|
||||
if (props.currentId) {
|
||||
values.idString = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values);
|
||||
}
|
||||
|
||||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
loading={props.loding}
|
||||
>
|
||||
<FormBuilder
|
||||
values={{
|
||||
securityFlag: 0,
|
||||
}}
|
||||
form={form}
|
||||
span={24}
|
||||
labelCol={{ span: 10 }}
|
||||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "qualificationName", label: "证书名称" },
|
||||
{ name: "qualificationinfoCategory", required: false, label: "证书作业类别", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [], itemsField: { labelKey: "dictLabel", valueKey: "dictValue" } },
|
||||
|
||||
{ name: "certificateNo", label: "证书编号" },
|
||||
{ name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "name", required: false, label: "证书图片", render: <Upload size={10} fileType="image" /> },
|
||||
|
||||
]}
|
||||
s
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department);
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
// import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
// import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
// const ENTERPRISE_TYPE = [
|
||||
// { bianma: 3, name: "相关方企业" },
|
||||
// { bianma: 4, name: "货主单位" },
|
||||
// { bianma: 5, name: "驻港单位" },
|
||||
// ];
|
||||
// const ENTERPRISE_STATUS = [
|
||||
// { bianma: "filialstate01", name: "在产" },
|
||||
// { bianma: "filialstate02", name: "在建" },
|
||||
// { bianma: "filialstate03", name: "代建" },
|
||||
// { bianma: "filialstate04", name: "停产" },
|
||||
// { bianma: "filialstate05", name: "破产" },
|
||||
// ];
|
||||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["corpUserMiddlePage"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 3,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "相关方单位名称" },
|
||||
// { name: "corpState", label: "公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_STATUS },
|
||||
// { name: "eqtype", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
columns={[
|
||||
{ title: "相关方单位名称", dataIndex: "corpName" },
|
||||
{ title: "企业人数", dataIndex: "userCount", render: (_, record) => (
|
||||
<span>{record.userCount ? record.userCount : "0"}</span>
|
||||
) },
|
||||
{ title: "安全人员信息数", dataIndex: "safetyUserCount" },
|
||||
{ title: "特种作业人数", dataIndex: "specialUserCount" },
|
||||
// { title: "公司状态", dataIndex: "corpStateName" },
|
||||
|
||||
// { title: "启用状态", dataIndex: "useFlag", render: (_, record) => (
|
||||
// <span>{record.useFlag === 1 ? "停用" : record.useFlag === 0 ? "启用" : ""}</span>
|
||||
// ) },
|
||||
|
||||
{ title: "操作", width: 150, render: (_, record) => (
|
||||
<Space>
|
||||
<Button type="link" onClick={() => props.history.push(`./CertificateList?id=${record.id}`)}>人员列表</Button>
|
||||
</Space>
|
||||
) },
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
function SecurityPersonnel(props) {
|
||||
return (
|
||||
<div>
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default SecurityPersonnel;
|
||||
|
|
@ -0,0 +1,203 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const queryParams = useGetUrlQuery();
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["userQualificationInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqQualificationinfoType: 1,
|
||||
corpinfoIdString: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["userQualificationInfoRemove"]({ id });
|
||||
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<HeaderBack title="证书列表" />
|
||||
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "keyWords", label: "证书名称" },
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "姓名", dataIndex: "qualificationName" },
|
||||
{ title: "证书名称", dataIndex: "qualificationName" },
|
||||
{ title: "证书作业类别", dataIndex: "qualificationinfoCategoryName" },
|
||||
{ title: "操作项目", dataIndex: "operatingProjectName" },
|
||||
{ title: "证书编号", dataIndex: "certificateNo" },
|
||||
{ title: "就职状态", dataIndex: "certificateNo", render: (_, record) => <sapn>{record.employmentFlag === 1 ? "就职" : record.employmentFlag === 0 ? "离职" : ""}</sapn> },
|
||||
{ title: "图片", dataIndex: "name", render: (_, record) => (<TooltipPreviewImg files={[]} />) },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</Button>
|
||||
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
dictData={props["dictData"]}
|
||||
open={addModalOpen}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const queryParams = useGetUrlQuery();
|
||||
const [userQualificationinfoId, setUserQualificationinfoId] = useState("");
|
||||
useEffect(() => {
|
||||
// 证书作业类别
|
||||
// props.dictData({ appKey: "0bb989ecada5470c87635018ece9f327", dictValue: "zylb" }).then((res) => {
|
||||
// setQualificationinfo(res.data);
|
||||
// });
|
||||
|
||||
if (props.currentId) {
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
form.setFieldsValue(res.data);
|
||||
setUserQualificationinfoId(res.data.userQualificationinfoId);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
values.corpinfoId = queryParams["corpinfoId"];
|
||||
values.userIdString = queryParams["id"];
|
||||
values.operatingProject = "DGZY_dgzy";
|
||||
values.operatingProjectName = "电工作业";
|
||||
values.qualificationinfoType = 1;
|
||||
values.userQualificationinfoId = userQualificationinfoId;
|
||||
values.qualificationinfoCategory = "DYDGZY";
|
||||
values.qualificationinfoCategoryName = "低压电工作业";
|
||||
if (props.currentId) {
|
||||
values.idString = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values);
|
||||
}
|
||||
|
||||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
loading={props.loding}
|
||||
>
|
||||
<FormBuilder
|
||||
values={{
|
||||
securityFlag: 0,
|
||||
}}
|
||||
form={form}
|
||||
span={24}
|
||||
labelCol={{ span: 10 }}
|
||||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "qualificationName", label: "证书名称" },
|
||||
{ name: "qualificationinfoCategory", required: false, label: "证书作业类别", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [], itemsField: { labelKey: "dictLabel", valueKey: "dictValue" } },
|
||||
{ name: "operatingProject", required: false, label: "操作项目" },
|
||||
{ name: "certificateNo", label: "证书编号" },
|
||||
{ name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "name", required: false, label: "证书图片", render: <Upload size={10} fileType="image" /> },
|
||||
|
||||
]}
|
||||
s
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_PERSNONEL_CERTFICATE], true)(Department);
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
// import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
// import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
// const ENTERPRISE_TYPE = [
|
||||
// { bianma: 3, name: "相关方企业" },
|
||||
// { bianma: 4, name: "货主单位" },
|
||||
// { bianma: 5, name: "驻港单位" },
|
||||
// ];
|
||||
// const ENTERPRISE_STATUS = [
|
||||
// { bianma: "filialstate01", name: "在产" },
|
||||
// { bianma: "filialstate02", name: "在建" },
|
||||
// { bianma: "filialstate03", name: "代建" },
|
||||
// { bianma: "filialstate04", name: "停产" },
|
||||
// { bianma: "filialstate05", name: "破产" },
|
||||
// ];
|
||||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["corpUserMiddlePage"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 3,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "相关方单位名称" },
|
||||
// { name: "corpState", label: "公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_STATUS },
|
||||
// { name: "eqtype", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
columns={[
|
||||
{ title: "相关方单位名称", dataIndex: "corpName" },
|
||||
{ title: "企业人数", dataIndex: "userCount", render: (_, record) => (
|
||||
<span>{record.userCount ? record.userCount : "0"}</span>
|
||||
) },
|
||||
{ title: "安全人员信息数", dataIndex: "safetyUserCount" },
|
||||
{ title: "特种作业人数", dataIndex: "specialUserCount" },
|
||||
// { title: "公司状态", dataIndex: "corpStateName" },
|
||||
|
||||
// { title: "启用状态", dataIndex: "useFlag", render: (_, record) => (
|
||||
// <span>{record.useFlag === 1 ? "停用" : record.useFlag === 0 ? "启用" : ""}</span>
|
||||
// ) },
|
||||
|
||||
{ title: "操作", width: 150, render: (_, record) => (
|
||||
<Space>
|
||||
<Button type="link" onClick={() => props.history.push(`./CertificateList?id=${record.id}`)}>人员列表</Button>
|
||||
</Space>
|
||||
) },
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
function SpecialPersonnel(props) {
|
||||
return (
|
||||
<div>
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default SpecialPersonnel;
|
||||
|
|
@ -1,272 +0,0 @@
|
|||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import { Alert, Form } from "antd";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import { ID_NUMBER } from "zy-react-library/regular";
|
||||
|
||||
const { query } = tools.router;
|
||||
export const WHETHER_ENUM = [
|
||||
{ name: "是", id: "1" },
|
||||
{ name: "否", id: "0" },
|
||||
];
|
||||
export const SEX_ENUM = [
|
||||
{ name: "男", id: "0" },
|
||||
{ name: "女", id: "1" },
|
||||
];
|
||||
export const MARITAL_STATUS_ENUM = [
|
||||
{ name: "已婚", id: "1" },
|
||||
{ name: "未婚", id: "0" },
|
||||
];
|
||||
function Add() {
|
||||
const [form] = Form.useForm();
|
||||
const onSubmit = (values) => {
|
||||
console.log(values);
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title={query.id ? "修改" : "新增"} />
|
||||
<div style={{ paddingBottom: 10 }}>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
values={{ sex: "0" }}
|
||||
onFinish={onSubmit}
|
||||
options={[
|
||||
{
|
||||
label: "照片",
|
||||
name: "userImg",
|
||||
span: 24,
|
||||
required: false,
|
||||
render: ({ value, onChange }) => (
|
||||
<Upload
|
||||
size={4}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
tipContent={(
|
||||
<div style={{ lineHeight: 1.6, color: "red", fontSize: 12 }}>
|
||||
<div>* 图像格式:JPG、JPEG、PNG</div>
|
||||
<div>* 图像大小:不超过4M。</div>
|
||||
<div>* 照片大小: 推荐 500*500</div>
|
||||
<div>* 人脸无遮挡(如戴帽子、口罩、眼镜等)、无修图</div>
|
||||
<div>* 人脸需双眼睁开、表情自然、露额,头发不要遮挡</div>
|
||||
</div>
|
||||
)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{ name: "name", label: "姓名" },
|
||||
{ name: "username", label: "用户名", componentProps: { disabled: query.id } },
|
||||
{ name: "departmentId", label: "部门" },
|
||||
{ name: "email", label: "电子邮箱", required: false, rules: [{ type: "email", message: "请输入正确的邮箱" }] },
|
||||
{ name: "cardId", label: "身份证号", rules: [{ pattern: ID_NUMBER, message: "请输入正确的身份证号" }] },
|
||||
{
|
||||
name: "userCardFile",
|
||||
label: "身份证照片",
|
||||
render: ({ value, onChange }) => (
|
||||
<Upload
|
||||
maxCount={2}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
tipContent={(
|
||||
<div style={{ lineHeight: 1.6, color: "red", fontSize: 12 }}>
|
||||
<div>温馨提示:用户要上传身份证正反面(身份证照片数量是2张), 才能进行人员培训</div>
|
||||
</div>
|
||||
)}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
name: "nationality",
|
||||
label: "民族",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
},
|
||||
{
|
||||
name: "sex",
|
||||
label: "性别",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: SEX_ENUM,
|
||||
componentProps: { disabled: true },
|
||||
},
|
||||
{ name: "dateOfBirth", label: "出生年月", render: FORM_ITEM_RENDER_ENUM.DATE },
|
||||
{ name: "age", label: "年龄", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ name: "hklocal", label: "户口所在地" },
|
||||
{ name: "address", label: "现住址" },
|
||||
{
|
||||
name: "degreeOfEducation",
|
||||
label: "文化程度",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
},
|
||||
{
|
||||
name: "maritalstatus",
|
||||
label: "婚姻状况",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: MARITAL_STATUS_ENUM,
|
||||
},
|
||||
{
|
||||
name: "politicalStatus",
|
||||
label: "政治面貌",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
componentProps: {
|
||||
onChange: () => {
|
||||
form.setFieldValue("politicalTime", undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "politicalTime",
|
||||
label: "入党时间",
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
dependencies: ["politicalStatus"],
|
||||
hidden: formValues => !(formValues.politicalStatus === "zhonggongdangyuan"),
|
||||
},
|
||||
{ name: "postId", label: "岗位名称(工种)" },
|
||||
{
|
||||
name: "isSocial",
|
||||
label: "是否缴纳社保",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
componentProps: {
|
||||
onChange: () => {
|
||||
form.setFieldValue("socialNumber", undefined);
|
||||
form.setFieldValue("socSecurity", undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "socialNumber",
|
||||
label: "社会保障号码",
|
||||
dependencies: ["isSocial"],
|
||||
hidden: formValues => !(formValues.isSocial === "1"),
|
||||
},
|
||||
{
|
||||
name: "socSecurity",
|
||||
label: "社保卡照片",
|
||||
render: ({ value, onChange }) => <Upload value={value} onChange={onChange} maxCount={2} />,
|
||||
dependencies: ["isSocial"],
|
||||
hidden: formValues => !(formValues.isSocial === "1"),
|
||||
},
|
||||
{
|
||||
name: "isBf",
|
||||
label: "是否缴纳保险",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
name: "isSignLabor",
|
||||
label: "是否签订劳动合同",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
componentProps: {
|
||||
onChange: () => {
|
||||
form.setFieldValue("contract", undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "contract",
|
||||
label: "合同图片",
|
||||
render: ({ value, onChange }) => <Upload value={value} onChange={onChange} maxCount={4} />,
|
||||
dependencies: ["isSignLabor"],
|
||||
hidden: formValues => !(formValues.isSignLabor === "1"),
|
||||
},
|
||||
{
|
||||
name: "ispay",
|
||||
label: "是否缴纳商业保险",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
componentProps: {
|
||||
onChange: () => {
|
||||
form.setFieldValue("ispayNumber", undefined);
|
||||
form.setFieldValue("insurance", undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "ispayNumber",
|
||||
label: "商业保险单号",
|
||||
dependencies: ["ispay"],
|
||||
hidden: formValues => !(formValues.ispay === "1"),
|
||||
},
|
||||
{
|
||||
name: "insurance",
|
||||
label: "保险图片",
|
||||
render: ({ value, onChange }) => <Upload value={value} onChange={onChange} maxCount={4} />,
|
||||
dependencies: ["ispay"],
|
||||
hidden: formValues => !(formValues.ispay === "1"),
|
||||
},
|
||||
{
|
||||
name: "isInjuriesPay",
|
||||
label: "是否按期缴纳工伤保险",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
componentProps: {
|
||||
onChange: () => {
|
||||
form.setFieldValue("isInjuriesPayTime", undefined);
|
||||
form.setFieldValue("empInsurance", undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "isInjuriesPayTime",
|
||||
label: "工伤保险有效期",
|
||||
dependencies: ["isInjuriesPay"],
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
hidden: formValues => !(formValues.isInjuriesPay === "1"),
|
||||
},
|
||||
{
|
||||
name: "empInsurance",
|
||||
label: "工伤保险凭证",
|
||||
render: ({ value, onChange }) => <Upload value={value} onChange={onChange} maxCount={4} />,
|
||||
dependencies: ["isInjuriesPay"],
|
||||
hidden: formValues => !(formValues.isInjuriesPay === "1"),
|
||||
},
|
||||
{
|
||||
name: "isLevelThree",
|
||||
label: "是否参加三级安全培训",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
componentProps: {
|
||||
onChange: () => {
|
||||
form.setFieldValue("threeLevel", undefined);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "threeLevel",
|
||||
label: "三级安全培训照片",
|
||||
render: ({ value, onChange }) => <Upload value={value} onChange={onChange} maxCount={4} />,
|
||||
dependencies: ["isLevelThree"],
|
||||
hidden: formValues => !(formValues.isLevelThree === "1"),
|
||||
},
|
||||
{
|
||||
name: "isflow",
|
||||
label: "是否流动人员",
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
name: "IS_SPECIAL_JOB",
|
||||
label: "是否特殊工种",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
componentProps: { disabled: true },
|
||||
},
|
||||
{
|
||||
name: "alert",
|
||||
span: 24,
|
||||
customizeRender: true,
|
||||
render: () => (<Alert message="新增完成后请提示该用户去相关方app端完善特种证书信息,特种证书完善后用户的'是否特殊工种'将变为'是'" type="error" />),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Add;
|
||||
|
|
@ -1,57 +1,74 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Space } from "antd";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
// import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
// import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
// const ENTERPRISE_TYPE = [
|
||||
// { bianma: 3, name: "相关方企业" },
|
||||
// { bianma: 4, name: "货主单位" },
|
||||
// { bianma: 5, name: "驻港单位" },
|
||||
// ];
|
||||
// const ENTERPRISE_STATUS = [
|
||||
// { bianma: "filialstate01", name: "在产" },
|
||||
// { bianma: "filialstate02", name: "在建" },
|
||||
// { bianma: "filialstate03", name: "代建" },
|
||||
// { bianma: "filialstate04", name: "停产" },
|
||||
// { bianma: "filialstate05", name: "破产" },
|
||||
// ];
|
||||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["corpUserMiddlePage"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 3,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<Search
|
||||
options={[
|
||||
// { name: "name", label: "关键字", tip: "证书名称/证书编号" },
|
||||
{ name: "name", label: "相关单位名称" },
|
||||
{ name: "name", label: "属地", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "name", label: "审核状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "name", label: "用工形式", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "name", label: "选取形式", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "name", label: "集团单位", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "name", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "111", id: "1" }] },
|
||||
{ name: "name", label: "人员姓名" },
|
||||
{ name: "name", label: "相关方单位名称" },
|
||||
// { name: "corpState", label: "公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_STATUS },
|
||||
// { name: "eqtype", label: "企业类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<Button type="primary" onClick={() => props.history.push("./add")} icon={<AddIcon />}>新增</Button>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "集团单位", dataIndex: "name" },
|
||||
{ title: "相关单位名称", dataIndex: "name" },
|
||||
{ title: "属地", dataIndex: "name" },
|
||||
{ title: "股份主管部门", dataIndex: "name" },
|
||||
{ title: "股份监管部门", dataIndex: "name" },
|
||||
{ title: "基层单位主管部门", dataIndex: "name" },
|
||||
{ title: "基层单位监督部门", dataIndex: "name" },
|
||||
{ title: "开户人", dataIndex: "name" },
|
||||
{ title: "状态", dataIndex: "name" },
|
||||
{ title: "操作", width: 200, render: (_, record) => (
|
||||
<Space>
|
||||
{/* <Button type="link" onClick={() => props.history.push(`./add?id=${record.id}`)}>查看</Button> */}
|
||||
{/* <Button type="link" onClick={() => props.history.push(`./add?id=${record.id}`)}>编辑</Button> */}
|
||||
|
||||
columns={[
|
||||
{ title: "相关方单位名称", dataIndex: "corpName" },
|
||||
{ title: "企业人数", dataIndex: "userCount", render: (_, record) => (
|
||||
<span>{record.userCount ? record.userCount : "0"}</span>
|
||||
) },
|
||||
{ title: "安全人员信息数", dataIndex: "safetyUserCount" },
|
||||
{ title: "特种作业人数", dataIndex: "specialUserCount" },
|
||||
// { title: "公司状态", dataIndex: "corpStateName" },
|
||||
|
||||
// { title: "启用状态", dataIndex: "useFlag", render: (_, record) => (
|
||||
// <span>{record.useFlag === 1 ? "停用" : record.useFlag === 0 ? "启用" : ""}</span>
|
||||
// ) },
|
||||
|
||||
{ title: "操作", width: 150, render: (_, record) => (
|
||||
<Space>
|
||||
<Button type="link" onClick={() => props.history.push(`./UserList?id=${record.id}`)}>人员列表</Button>
|
||||
</Space>
|
||||
) },
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default List;
|
||||
export default Connect([NS_ENTERPRISE], true)(List);
|
||||
|
|
|
|||
|
|
@ -1,51 +1,55 @@
|
|||
import { Button, Form, message, Modal } from "antd";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
export const PERSONNEL_TYPE_ENUM = [
|
||||
{ id: "0", name: "非流动人员" },
|
||||
{ id: "1", name: "流动人员" },
|
||||
];
|
||||
function UserList(props) {
|
||||
function List(props) {
|
||||
const [selectedNodeId, setSelectedNodeId] = useState();
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const queryParams = useGetUrlQuery();
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["userList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
corpinfoId: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onResetPassword = (id) => {
|
||||
const onResetPassword = () => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "是否重置密码为Bb@123456789?",
|
||||
content: "确定要重置密码为Aa@123456789吗?",
|
||||
onOk: () => {
|
||||
message.success("重置密码成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
console.log(selectedKeys);
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
labelCol={{ span: 8 }}
|
||||
options={[
|
||||
{ name: "name", label: "姓名" },
|
||||
{ name: "name", label: "身份证" },
|
||||
{
|
||||
name: "name",
|
||||
label: "人员类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: PERSONNEL_TYPE_ENUM,
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
label: "基础信息填报状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ id: "0", name: "未填报" }, { id: "1", name: "已填报" }],
|
||||
},
|
||||
{ name: "name", label: "关键字", tip: "用户名/姓名" },
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
|
|
@ -53,30 +57,110 @@ function UserList(props) {
|
|||
<Table
|
||||
|
||||
columns={[
|
||||
{ title: "用户名", dataIndex: "name" },
|
||||
{ title: "用户名", dataIndex: "username" },
|
||||
{ title: "姓名", dataIndex: "name" },
|
||||
{ title: "部门", dataIndex: "name" },
|
||||
{ title: "人员类型", dataIndex: "name" },
|
||||
{ title: "培训状态", dataIndex: "name" },
|
||||
{ title: "基础信息填报状态", dataIndex: "name" },
|
||||
{ title: "部门", dataIndex: "departmentName" },
|
||||
{ title: "岗位", dataIndex: "postName" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 300,
|
||||
|
||||
render: (_, record) => (
|
||||
<>
|
||||
<Button type="link" onClick={() => props.history.push(`./UserView?id=${record.id}`)}>查看</Button>
|
||||
<Space>
|
||||
<Button type="link" onClick={() => onResetPassword(record.id)}>重置密码</Button>
|
||||
</>
|
||||
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
dataSource={[{}]}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
open={addModalOpen}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({ id: props.currentId });
|
||||
console.log(res.data);
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
console.log(info);
|
||||
}
|
||||
}, [props.currentId]);
|
||||
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
okButtonProps={{ style: { display: "none" } }}
|
||||
title="查看"
|
||||
width={900}
|
||||
>
|
||||
<div style={{ padding: 20 }}>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={2}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "用户角色", children: info.username },
|
||||
{ label: "所属部门", children: info.departmentName },
|
||||
{ label: "是否部门负责人", children: <span>{info.departmentLeaderFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "所属岗位", children: info.postName },
|
||||
{ label: "用户名", children: info.username },
|
||||
{ label: "姓名", children: info.name },
|
||||
{ label: "手机号", children: info.phone },
|
||||
{ label: "人员类型", children: info.personnelTypeName },
|
||||
{ label: "身份证号", children: info.userIdCard },
|
||||
{ label: "民族", children: info.nationName },
|
||||
{ label: "性别", children: info.sex },
|
||||
|
||||
{ label: "人脸照片", children: info.nationName },
|
||||
{ label: "部门排序", children: info.sort },
|
||||
{ label: "邮箱", children: info.email },
|
||||
// { label: "文化程度", children: info.culturalLevelName },
|
||||
// { label: "婚姻状况", children: info.maritalStatusName },
|
||||
// { label: "政治面貌", children: info.politicalAffiliationName },
|
||||
{ label: "备注", children: info.remarks },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
export default UserList;
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_USER], true)(List);
|
||||
|
|
|
|||
|
|
@ -1,941 +0,0 @@
|
|||
import { Descriptions, Divider } from "antd";
|
||||
import { useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import PreviewImg from "zy-react-library/components/PreviewImg";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import useDownloadFile from "zy-react-library/hooks/useDownloadFile";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { MARITAL_STATUS_ENUM, SEX_ENUM, WHETHER_ENUM } from "../Add";
|
||||
|
||||
function UserView() {
|
||||
const { downloadFile } = useDownloadFile();
|
||||
const [info] = useState({
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
selectUserId: null,
|
||||
username: "13058604112",
|
||||
password: "16758a08251b174145edfb6188bcb5dd51a827f1",
|
||||
name: "0513-1",
|
||||
roleId: "fhadminzhuche",
|
||||
rolesName: null,
|
||||
lastLogin: null,
|
||||
ip: null,
|
||||
status: 0,
|
||||
bz: "注册用户",
|
||||
sex: null,
|
||||
skin: "pcoded-navbar navbar-image-3,navbar pcoded-header navbar-expand-lg navbar-light header-dark,",
|
||||
email: null,
|
||||
number: null,
|
||||
phone: "13058604112",
|
||||
roleIds: null,
|
||||
departmentId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
departmentName: null,
|
||||
departmentNameAll: null,
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
funIds: null,
|
||||
appid: null,
|
||||
postId: "jhsdGsdghbs",
|
||||
postName: "jhsdGsdghbs",
|
||||
ismain: "0",
|
||||
errorCount: 0,
|
||||
sort: null,
|
||||
learnercategory: null,
|
||||
useravatarprefix: null,
|
||||
useravatarurl: null,
|
||||
shiftdutyone: null,
|
||||
shiftdutytwo: null,
|
||||
duration: null,
|
||||
workstatus: null,
|
||||
workperiod: null,
|
||||
isRecorder: null,
|
||||
personnelType: null,
|
||||
personnelTypeName: null,
|
||||
isHazardconfirmer: null,
|
||||
isAccessauditor: null,
|
||||
isOnlinelearning: null,
|
||||
personType: null,
|
||||
jcr: null,
|
||||
pushCid: null,
|
||||
empno: null,
|
||||
cfdStatus: null,
|
||||
cardno: null,
|
||||
userIdCard: null,
|
||||
isPolice: null,
|
||||
userIdentity: null,
|
||||
baseimgpath: null,
|
||||
backendaddr: null,
|
||||
mkmjcard: null,
|
||||
ispush: "1",
|
||||
userType: "3",
|
||||
inHrUser: "0",
|
||||
isDelete: 0,
|
||||
creator: null,
|
||||
createTime: "2025-04-20 14:41:54",
|
||||
operat: "87ef258559e6430aa837e0f38062e250",
|
||||
operatTime: "2025-08-29 11:05:09",
|
||||
mkmjVehicleReviewer: null,
|
||||
userIds: null,
|
||||
departSort: null,
|
||||
corpinfoName: null,
|
||||
classCount: null,
|
||||
completeCount: null,
|
||||
studystate: null,
|
||||
corpInfoStatus: null,
|
||||
busImgList: null,
|
||||
faceFile: null,
|
||||
facePermissions: null,
|
||||
job: null,
|
||||
jobLevel: null,
|
||||
jobLevelName: null,
|
||||
nation: null,
|
||||
nationName: null,
|
||||
basicinfoId: null,
|
||||
precinctId: null,
|
||||
roleName: null,
|
||||
isassess: null,
|
||||
mkmjPermissions: "1",
|
||||
inMkmjBlacklist: null,
|
||||
disableMkmj: null,
|
||||
employCorpName: null,
|
||||
validityPeriodStart: null,
|
||||
validityPeriodEnd: null,
|
||||
classNo: null,
|
||||
employCorpId: null,
|
||||
xgfUserId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
loginUser: null,
|
||||
isFlow: "0",
|
||||
isFlowName: null,
|
||||
trainStatus: null,
|
||||
trainStatusName: null,
|
||||
basicState: null,
|
||||
basicStateName: null,
|
||||
userPhoto: null,
|
||||
userPhotoInfo: [
|
||||
{
|
||||
imgfilesId: "4a7197ac1f844466a592f5ac54bb7071",
|
||||
filepath: "/uploadFiles/file/xgf/920fa607d47c431b9142912801d10047.jpg",
|
||||
},
|
||||
],
|
||||
userCard: null,
|
||||
userCardInfo: [
|
||||
{
|
||||
imgfilesId: "4a3a9d1cca0b463290afbe2da7f86fcd",
|
||||
filepath: "/uploadFiles/file/xgf/887b696c5593413f9c108111ef111c1f.jpg",
|
||||
},
|
||||
{
|
||||
imgfilesId: "70972a9e21e3448d9dbfffae02f442ba",
|
||||
filepath: "/uploadFiles/file/xgf/51588b4531a449b58ace522928c75166.png",
|
||||
},
|
||||
],
|
||||
socSecurity: null,
|
||||
socSecurityInfo: [
|
||||
{
|
||||
imgfilesId: "c733ce9c56e746c99814503dbd09992e",
|
||||
filepath: "/uploadFiles/file/xgf/082c6408413648879f53bd02f5c6059b.png",
|
||||
},
|
||||
{
|
||||
imgfilesId: "efaa255ef2e64da7920e2b4415a0e250",
|
||||
filepath: "/uploadFiles/file/xgf/dde0abbe4c494111bc1e7533bda76178.png",
|
||||
},
|
||||
],
|
||||
contract: null,
|
||||
contractInfo: [],
|
||||
insurance: null,
|
||||
insuranceInfo: [],
|
||||
empInsurance: null,
|
||||
empInsuranceInfo: [],
|
||||
threeLevel: null,
|
||||
threeLevelInfo: [],
|
||||
deleteFileIds: null,
|
||||
emp: {
|
||||
employmentApplyManagementId: "50b9c363d6584072a7a14b1ef6fc3468",
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
relevantUnitName: "测试相关方",
|
||||
startDate: "2025-04-20 14:43:50",
|
||||
endDate: null,
|
||||
leaveReason: null,
|
||||
applyTime: null,
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
creator: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
createtime: "2025-04-20 14:43:51",
|
||||
operator: "87ef258559e6430aa837e0f38062e250",
|
||||
operatetime: "2025-08-11 18:20:32",
|
||||
isdelete: "0",
|
||||
auditState: "2",
|
||||
departState: "0",
|
||||
reviewState: "",
|
||||
departmentId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
remarks: null,
|
||||
auditRemarks: null,
|
||||
auditTime: null,
|
||||
auditPerson: null,
|
||||
corpStartDate: "2025-04-20",
|
||||
postId: "jhsdGsdghbs",
|
||||
entryDate: null,
|
||||
isSignLabor: "0",
|
||||
isInjuriesPay: "0",
|
||||
socialNumber: "462218514G0CB1PQ55",
|
||||
ispay: "0",
|
||||
isLevelThree: "0",
|
||||
isSafetyTell: "0",
|
||||
isBodyAdapt: "0",
|
||||
isSpecialJob: "0",
|
||||
isflow: "0",
|
||||
isSocial: "1",
|
||||
socialType: null,
|
||||
isBf: "0",
|
||||
},
|
||||
userDetails: {
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
name: "0513-1",
|
||||
phone: "13058604112",
|
||||
creattime: "2025-08-11 18:20:31",
|
||||
departState: "0",
|
||||
isdelete: "0",
|
||||
personWorkType: null,
|
||||
personWorkTypeName: null,
|
||||
age: "21",
|
||||
hklocal: "11112",
|
||||
address: "1111",
|
||||
degreeOfEducation: "dxbk",
|
||||
degreeOfEducationName: "大学本科",
|
||||
corpStartDate: null,
|
||||
postId: "jhsdGsdghbs",
|
||||
postName: "jhsdGsdghbs",
|
||||
workSign: null,
|
||||
joinedDate: null,
|
||||
workDate: null,
|
||||
photo: "/uploadFiles/file/xgf/920fa607d47c431b9142912801d10047.jpg",
|
||||
dateOfBirth: "2004-06-07",
|
||||
ispay: "0",
|
||||
ispayNumber: "",
|
||||
isSafetyTell: "0",
|
||||
isSafetyTime: null,
|
||||
isInjuriesPay: "0",
|
||||
isSignLabor: "0",
|
||||
sex: "0",
|
||||
entryDate: null,
|
||||
nationality: "mz",
|
||||
nationalityName: "满族",
|
||||
maritalstatus: "0",
|
||||
politicalTime: null,
|
||||
politicalStatus: "zgybdy01",
|
||||
politicalStatusName: "中共预备党员",
|
||||
isInjuriesPayTime: "",
|
||||
isLevelThree: "0",
|
||||
isBodyAdapt: "0",
|
||||
isSpecialJob: null,
|
||||
belongToCorp: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
belongToCorpName: "测试相关方",
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
managerDepartmentId: null,
|
||||
managerDepartmentName: null,
|
||||
competentDepartmentId: null,
|
||||
competentDepartmentName: null,
|
||||
mainDepartmentId: null,
|
||||
mainDepartmentName: null,
|
||||
cardId: "130726200406079838",
|
||||
departmentId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
departmentName: "测试相关方",
|
||||
isSocial: "1",
|
||||
isBf: "0",
|
||||
socialNumber: "462218514G0CB1PQ55",
|
||||
zzname: null,
|
||||
annex: "/uploadFiles/file/xgf/94212aec9b66433ca3b665a68251d8b5.zip",
|
||||
attorney: null,
|
||||
commitmentLetter: null,
|
||||
},
|
||||
trainingRec: [
|
||||
{
|
||||
classInfoId: "7a3ab8fabd8a4b51a8e2ed1d081b19b3",
|
||||
createTime: "2025-05-19 00:00:00",
|
||||
creator: "1",
|
||||
operateTime: "2025-05-19 00:00:00",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "65a5b863a20a4f85b43dc63dc0bd9308",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-15 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "0515-1222",
|
||||
openingTime: "2025-05-15 00:00:00",
|
||||
place: "3725a5aa60da407e87b7931e311da192",
|
||||
placeName: "教育培训中心(东山校区)阶梯教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
{
|
||||
classInfoId: "a14252d3baed49f3b694d51f8a01a543",
|
||||
createTime: "2025-06-01 00:00:00",
|
||||
creator: "1",
|
||||
operateTime: "2025-06-01 00:00:00",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "3bbc4df4bcef4de698fea4c6fdc963ea",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-15 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "666666",
|
||||
openingTime: "2025-05-15 00:00:00",
|
||||
place: "3725a5aa60da407e87b7931e311da192",
|
||||
placeName: "教育培训中心(东山校区)阶梯教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
{
|
||||
classInfoId: "be1a01e7bbde4c6cacbc0a7bd437687e",
|
||||
createTime: "2025-05-18 00:00:00",
|
||||
creator: "1",
|
||||
operateTime: "2025-05-18 00:00:00",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "1",
|
||||
classMessageId: "0e46e74fce7d4b038a5409633750722c",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-15 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "0515-111",
|
||||
openingTime: "2025-05-15 00:00:00",
|
||||
place: "3725a5aa60da407e87b7931e311da192",
|
||||
placeName: "教育培训中心(东山校区)阶梯教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
{
|
||||
classInfoId: "0ba29ef2449d4c35a74fa20f15840f63",
|
||||
createTime: "2025-05-17 19:00:00",
|
||||
creator: "1",
|
||||
operateTime: "2025-05-17 19:00:00",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "8b03ba6329ff4807abdf758e3ed8e53b",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-14 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "0514-111",
|
||||
openingTime: "2025-05-14 00:00:00",
|
||||
place: "d7d30999957a46d6a647fe8e168fb960",
|
||||
placeName: "铁运开站小教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
{
|
||||
classInfoId: "28800a073d8e4afb945aeb61b364d093",
|
||||
createTime: "2025-06-01 00:00:00",
|
||||
creator: "1",
|
||||
operateTime: "2025-06-01 00:00:00",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "0dd69622dc5e4e27a142f9a07f7b4a9a",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-14 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "123",
|
||||
openingTime: "2025-05-14 00:00:00",
|
||||
place: "3725a5aa60da407e87b7931e311da192",
|
||||
placeName: "教育培训中心(东山校区)阶梯教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
{
|
||||
classInfoId: "75bafd4545484f739d03c5b1228e187a",
|
||||
createTime: "2025-06-01 00:00:01",
|
||||
creator: "1",
|
||||
operateTime: "2025-06-01 00:00:01",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "de07771f21344c7e9e8b40ed26a221b8",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-14 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "0514-1",
|
||||
openingTime: "2025-05-14 00:00:00",
|
||||
place: "3725a5aa60da407e87b7931e311da192",
|
||||
placeName: "教育培训中心(东山校区)阶梯教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
{
|
||||
classInfoId: "8a85c80f40774b1a8a11b97b06328f40",
|
||||
createTime: "2025-05-16 00:00:00",
|
||||
creator: "1",
|
||||
operateTime: "2025-05-16 00:00:00",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "53c1f413ad564dadb3139346be548a7d",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-14 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "12121",
|
||||
openingTime: "2025-05-14 00:00:00",
|
||||
place: "3725a5aa60da407e87b7931e311da192",
|
||||
placeName: "教育培训中心(东山校区)阶梯教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
{
|
||||
classInfoId: "9a6cf3a55ae2497e9ac7fddca29395af",
|
||||
createTime: "2025-06-01 00:00:01",
|
||||
creator: "1",
|
||||
operateTime: "2025-06-01 00:00:01",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "f18561c4f3304de2abb3abf3447c1f42",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-14 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "888888",
|
||||
openingTime: "2025-05-14 00:00:00",
|
||||
place: "3725a5aa60da407e87b7931e311da192",
|
||||
placeName: "教育培训中心(东山校区)阶梯教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
{
|
||||
classInfoId: "c0b73248951647fdacbc0135435c35b6",
|
||||
createTime: "2025-05-16 00:00:00",
|
||||
creator: "1",
|
||||
operateTime: "2025-05-16 00:00:00",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "1f60ce32b7824c7c8f528dfec2f486f6",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-14 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "新建班级",
|
||||
openingTime: "2025-05-14 00:00:00",
|
||||
place: "3725a5aa60da407e87b7931e311da192",
|
||||
placeName: "教育培训中心(东山校区)阶梯教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
{
|
||||
classInfoId: "8c0bd01a749a4ab9a9debbb502e2fc8b",
|
||||
createTime: "2025-05-17 00:00:00",
|
||||
creator: "1",
|
||||
operateTime: "2025-05-17 00:00:00",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "2902e676235441f9b0a9b0b04e2323c4",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-13 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "测试测试",
|
||||
openingTime: "2025-05-13 00:00:00",
|
||||
place: "",
|
||||
placeName: null,
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
{
|
||||
classInfoId: "c5b2fb9938584f9eb31a8695c6b17b1f",
|
||||
createTime: "2025-06-01 00:00:00",
|
||||
creator: "1",
|
||||
operateTime: "2025-06-01 00:00:00",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "23dbed8a477c45f790739ff6c739a010",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo: "/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-13 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "0513-1",
|
||||
openingTime: "2025-05-13 00:00:00",
|
||||
place: "3725a5aa60da407e87b7931e311da192",
|
||||
placeName: "教育培训中心(东山校区)阶梯教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
{
|
||||
classInfoId: "ce21960b2c304134af6e96a26cff1f70",
|
||||
createTime: "2025-05-14 18:50:00",
|
||||
creator: "1",
|
||||
operateTime: "2025-05-14 18:50:00",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "61ab001c98d54c5e8db53de675445523",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo: "/uploadFiles/file/education/face/20250514/c3e85138dea843578204357528f1611b.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-12 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "测试一个教育培训",
|
||||
openingTime: "2025-05-12 00:00:00",
|
||||
place: "3725a5aa60da407e87b7931e311da192",
|
||||
placeName: "教育培训中心(东山校区)阶梯教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
],
|
||||
special: [],
|
||||
flows: [
|
||||
{
|
||||
flowId: "fd58bf5ad97847419f8de769639947f5",
|
||||
type: "1",
|
||||
creator: null,
|
||||
creatorName: null,
|
||||
creatorTime: "2025-05-13 14:30:18",
|
||||
validFlag: "1",
|
||||
foreignKey: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
isdelete: "0",
|
||||
endFlag: "1",
|
||||
details: [
|
||||
{
|
||||
flowDetailId: "33ec9909844b482fbcdb8c6cc1e8a9db",
|
||||
flowId: "fd58bf5ad97847419f8de769639947f5",
|
||||
stepFlag: "0",
|
||||
stepName: "相关方提交人员信息到发包单位",
|
||||
sort: 0,
|
||||
parentId: "0",
|
||||
approverId: "87ef258559e6430aa837e0f38062e250",
|
||||
approverName: "测试相关方",
|
||||
approverOpinion: null,
|
||||
approverCorpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
approverCorpinfoName: "测试相关方",
|
||||
approverTime: "2025-05-13 14:30:18",
|
||||
passFlag: "1",
|
||||
endFlag: "0",
|
||||
isdelete: "0",
|
||||
foreignKey: null,
|
||||
appointAnnex: "/uploadFiles/file/xgf/94212aec9b66433ca3b665a68251d8b5.zip",
|
||||
appointAnnexName: null,
|
||||
},
|
||||
{
|
||||
flowDetailId: "b6e4612892b14a73b8aa4324c69c85d3",
|
||||
flowId: "fd58bf5ad97847419f8de769639947f5",
|
||||
stepFlag: "0",
|
||||
stepName: null,
|
||||
sort: 1,
|
||||
parentId: "33ec9909844b482fbcdb8c6cc1e8a9db",
|
||||
approverId: "94407a4e15ec46b5974b128e124fa661",
|
||||
approverName: "齐津铖",
|
||||
approverOpinion: "",
|
||||
approverCorpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
approverCorpinfoName: "卓云企业",
|
||||
approverTime: "2025-05-13 14:38:39",
|
||||
passFlag: "1",
|
||||
endFlag: "0",
|
||||
isdelete: "0",
|
||||
foreignKey: null,
|
||||
appointAnnex: null,
|
||||
appointAnnexName: null,
|
||||
},
|
||||
{
|
||||
flowDetailId: "1ef915958e5e4eba872c55588524b168",
|
||||
flowId: "fd58bf5ad97847419f8de769639947f5",
|
||||
stepFlag: "1",
|
||||
stepName: null,
|
||||
sort: 2,
|
||||
parentId: "b6e4612892b14a73b8aa4324c69c85d3",
|
||||
approverId: "94407a4e15ec46b5974b128e124fa661",
|
||||
approverName: "齐津铖",
|
||||
approverOpinion: "",
|
||||
approverCorpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
approverCorpinfoName: "卓云企业",
|
||||
approverTime: "2025-05-13 14:39:43",
|
||||
passFlag: "1",
|
||||
endFlag: "1",
|
||||
isdelete: "0",
|
||||
foreignKey: null,
|
||||
appointAnnex: null,
|
||||
appointAnnexName: null,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
lastFlow: {
|
||||
flowsId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
foreignKeyId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
foreignKeyName: "sys_user=>user_id",
|
||||
flowsStep: 1,
|
||||
flowsType: "0",
|
||||
isDelete: "0",
|
||||
appointZeroCorpId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
appointZeroCorpType: null,
|
||||
appointZeroCorpName: "卓云企业",
|
||||
appointZeroDepartmentId: "16579f1de79743198884a56350c113cc",
|
||||
appointZeroDepartmentName: "分公司级测试部门",
|
||||
appointZeroUserId: "94407a4e15ec46b5974b128e124fa661",
|
||||
appointZeroUserName: "齐津铖",
|
||||
appointZeroStatus: "1",
|
||||
appointZeroOpinion: "",
|
||||
appointZeroTime: "2025-05-13 14:38:39",
|
||||
appointOneCorpId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
appointOneCorpName: "卓云企业",
|
||||
appointOneCorpType: "0",
|
||||
appointOneDepartmentId: "16579f1de79743198884a56350c113cc",
|
||||
appointOneDepartmentName: "",
|
||||
appointOneUserId: "94407a4e15ec46b5974b128e124fa661",
|
||||
appointOneUserName: "齐津铖",
|
||||
appointOneStatus: "1",
|
||||
appointOneOpinion: "",
|
||||
appointOneTime: "2025-05-13 14:39:42",
|
||||
appointTwoCorpId: null,
|
||||
appointTwoCorpName: null,
|
||||
appointTwoCorpType: null,
|
||||
appointTwoDepartmentId: null,
|
||||
appointTwoDepartmentName: null,
|
||||
appointTwoUserId: null,
|
||||
appointTwoUserName: null,
|
||||
appointTwoStatus: null,
|
||||
appointTwoOpinion: null,
|
||||
appointTwoTime: null,
|
||||
appointThreeCorpId: null,
|
||||
appointThreeCorpName: null,
|
||||
appointThreeCorpType: null,
|
||||
appointThreeDepartmentId: null,
|
||||
appointThreeDepartmentName: null,
|
||||
appointThreeUserId: null,
|
||||
appointThreeUserName: null,
|
||||
appointThreeStatus: null,
|
||||
appointThreeOpinion: null,
|
||||
appointThreeTime: null,
|
||||
appointFourCorpId: null,
|
||||
appointFourCorpName: null,
|
||||
appointFourCorpType: null,
|
||||
appointFourDepartmentId: null,
|
||||
appointFourDepartmentName: null,
|
||||
appointFourUserId: null,
|
||||
appointFourUserName: null,
|
||||
appointFourStatus: null,
|
||||
appointFourOpinion: null,
|
||||
appointFiveCorpId: null,
|
||||
appointFiveCorpName: null,
|
||||
appointFiveCorpType: null,
|
||||
appointFiveDepartmentId: null,
|
||||
appointFiveDepartmentName: null,
|
||||
appointFiveUserId: null,
|
||||
appointFiveUserName: null,
|
||||
appointFiveStatus: null,
|
||||
appointFiveOpinion: null,
|
||||
appointSixCorpId: null,
|
||||
appointSixCorpName: null,
|
||||
appointSixCorpType: null,
|
||||
appointSixDepartmentId: null,
|
||||
appointSixDepartmentName: null,
|
||||
appointSixUserId: null,
|
||||
appointSixUserName: null,
|
||||
appointSixStatus: null,
|
||||
appointSixOpinion: null,
|
||||
appointSevenCorpId: null,
|
||||
appointSevenCorpName: null,
|
||||
appointSevenCorpType: null,
|
||||
appointSevenDepartmentId: null,
|
||||
appointSevenDepartmentName: null,
|
||||
appointSevenUserId: null,
|
||||
appointSevenUserName: null,
|
||||
appointSevenStatus: null,
|
||||
appointSevenOpinion: null,
|
||||
sendType: "1",
|
||||
checkStatus: "2",
|
||||
checkStatusName: "审核结束",
|
||||
},
|
||||
powerFlag: null,
|
||||
entrustFlag: null,
|
||||
lastStepFlag: null,
|
||||
checkStep: null,
|
||||
flowsStep: null,
|
||||
flowsType: null,
|
||||
attorney: null,
|
||||
appointZeroUserId: null,
|
||||
appointZeroCorpName: "卓云企业",
|
||||
appointZeroTime: null,
|
||||
appointOneUserId: null,
|
||||
appointOneCorpName: "卓云企业",
|
||||
appointOneTime: null,
|
||||
appointTwoUserId: null,
|
||||
appointTwoCorpName: null,
|
||||
appointTwoTime: null,
|
||||
appointThreeUserId: null,
|
||||
appointThreeCorpName: null,
|
||||
appointThreeTime: null,
|
||||
appointFourUserId: null,
|
||||
appointFourCorpName: null,
|
||||
appointFiveUserId: null,
|
||||
appointFiveCorpName: null,
|
||||
appointSixUserId: null,
|
||||
appointSixCorpName: null,
|
||||
appointSevenUserId: null,
|
||||
appointSevenCorpName: null,
|
||||
appointTime: "2025-05-13 14:39:42",
|
||||
cardId: null,
|
||||
belongToCorp: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
belongToCorpName: "测试相关方",
|
||||
degreeOfEducation: null,
|
||||
isSocial: null,
|
||||
isInjuriesPay: null,
|
||||
ispay: null,
|
||||
isBf: null,
|
||||
age: null,
|
||||
unValidFlag: "1",
|
||||
unValidInfo: "合格证有效期",
|
||||
checkStatus: null,
|
||||
classStatus: null,
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title="查看" />
|
||||
<div style={{ padding: 20 }}>
|
||||
<Divider orientation="left">人员信息</Divider>
|
||||
<Descriptions
|
||||
column={6}
|
||||
labelStyle={{ width: 200 }}
|
||||
items={[
|
||||
{ label: "照片", children: info.userImg?.length > 0 ? <PreviewImg files={info.userImg} /> : "暂无信息" },
|
||||
{ label: "身份证照片", children: info.userImg?.length > 0 ? <PreviewImg files={info.userImg} /> : "暂无信息" },
|
||||
{ label: "社保卡照片", children: info.userImg?.length > 0 ? <PreviewImg files={info.userImg} /> : "暂无信息" },
|
||||
{ label: "工伤保险凭证", span: 3, children: info.userImg?.length > 0 ? <PreviewImg files={info.userImg} /> : "暂无信息" },
|
||||
{ label: "姓名", children: info.name },
|
||||
{ label: "性别", children: getLabelName({ status: info.sex, list: SEX_ENUM }) },
|
||||
{ label: "出生年月", children: info.dateOfBirth },
|
||||
{ label: "年龄", children: info.age },
|
||||
{ label: "手机号", children: info.phone },
|
||||
{ label: "身份证", children: info.cardId },
|
||||
{ label: "民族", children: info.nationalityName || "暂无信息" },
|
||||
{ label: "婚姻状况", children: getLabelName({ status: info.maritalstatus, list: MARITAL_STATUS_ENUM }) },
|
||||
{ label: "政治面貌", children: info.politicalStatusName },
|
||||
...(info.politicalStatusName === "中共党员" ? [{ label: "入党时间", children: info.politicalTime }] : []),
|
||||
{ label: "户口所在地", children: info.hklocal || "暂无信息" },
|
||||
{ label: "现住址", children: info.address || "暂无信息" },
|
||||
{ label: "文化程度", children: info.degreeOfEducationName },
|
||||
{ label: "岗位名称(工种)", children: info.postId },
|
||||
{ label: "是否缴纳社保", children: getLabelName({ status: info.isSocial, list: WHETHER_ENUM }) },
|
||||
...(info.isSocial === "1"
|
||||
? [
|
||||
{ label: "社会保障号码", children: info.socialNumber },
|
||||
{ label: "社保卡照片", children: info.socSecurity?.length > 0 ? <PreviewImg files={info.socSecurity} /> : "暂无信息" },
|
||||
]
|
||||
: []),
|
||||
{ label: "是否按期缴纳工伤保险", children: getLabelName({ status: info.isInjuriesPay, list: WHETHER_ENUM }) },
|
||||
...(info.isInjuriesPay === "1"
|
||||
? [
|
||||
{ label: "工伤保险有效期", children: info.isInjuriesPayTime },
|
||||
{ label: "工伤保险凭证", children: info.empInsurance?.length > 0 ? <PreviewImg files={info.empInsurance} /> : "暂无信息" },
|
||||
]
|
||||
: []),
|
||||
{ label: "是否缴纳商业保险", children: getLabelName({ status: info.ispay, list: WHETHER_ENUM }) },
|
||||
...(info.ispay === "1"
|
||||
? [
|
||||
{ label: "商业保险单号", children: info.ispayNumber },
|
||||
{ label: "商业保险附件", children: info.insurance?.length > 0 ? <PreviewImg files={info.insurance} /> : "暂无信息" },
|
||||
]
|
||||
: []),
|
||||
{ label: "是否签订劳动合同", children: getLabelName({ status: info.isSignLabor, list: WHETHER_ENUM }) },
|
||||
...(info.isSignLabor === "1"
|
||||
? [
|
||||
{ label: "劳动合同附件", children: info.contract?.length > 0 ? <PreviewImg files={info.contract} /> : "暂无信息" },
|
||||
]
|
||||
: []),
|
||||
{ label: "是否参加三级安全培训", children: getLabelName({ status: info.isLevelThree, list: WHETHER_ENUM }) },
|
||||
...(info.isLevelThree === "1"
|
||||
? [
|
||||
{ label: "三级安全培训照片", children: info.threeLevel?.length > 0 ? <PreviewImg files={info.threeLevel} /> : "暂无信息" },
|
||||
]
|
||||
: []),
|
||||
{ label: "是否缴纳保险", children: getLabelName({ status: info.isBf, list: WHETHER_ENUM }) },
|
||||
{ label: "是否特殊工种", children: getLabelName({ status: info.isSpecialJob, list: WHETHER_ENUM }) },
|
||||
{ label: "是否流动人员", children: getLabelName({ status: info.isflow, list: WHETHER_ENUM }) },
|
||||
]}
|
||||
/>
|
||||
<Divider orientation="left">培训记录</Divider>
|
||||
<Table
|
||||
columns={[
|
||||
{ title: "班级名称", dataIndex: "className" },
|
||||
{ title: "培训状态", dataIndex: "status" },
|
||||
{ title: "开班时间", dataIndex: "openingTime" },
|
||||
{ title: "培训地点", dataIndex: "placeName" },
|
||||
{ title: "所在单位名称", dataIndex: "belongToCorpName" },
|
||||
{ title: "所在部门名称", dataIndex: "belongToCorpName" },
|
||||
{ title: "培训有效期", dataIndex: "validityPeriod" },
|
||||
]}
|
||||
pagination={false}
|
||||
dataSource={info.trainingRec}
|
||||
disabledResizer={true}
|
||||
/>
|
||||
<Divider orientation="left">特证信息</Divider>
|
||||
<Table
|
||||
columns={[
|
||||
{ title: "特证照片", dataIndex: "filepath", render: (_, record) => (<TooltipPreviewImg files={[]} />) },
|
||||
{ title: "作业类别", dataIndex: "specialTypeName" },
|
||||
{ title: "操作项目", dataIndex: "operationTypeName" },
|
||||
{ title: "证书名称", dataIndex: "certificate" },
|
||||
{ title: "发证机关", dataIndex: "issuingAuthority" },
|
||||
{ title: "证书类型", dataIndex: "cerTypeName" },
|
||||
{ title: "有效期", dataIndex: "time" },
|
||||
]}
|
||||
pagination={false}
|
||||
dataSource={info.special}
|
||||
disabledResizer={true}
|
||||
/>
|
||||
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default UserView;
|
||||
|
|
@ -528,7 +528,7 @@ function View(props) {
|
|||
labelStyle={{ width: 200 }}
|
||||
items={[
|
||||
// { label: "照片", children: info.userImg?.length > 0 ? <PreviewImg files={info.userImg} /> : "暂无信息"},
|
||||
{ label: "企业名称", children: info.corpName },
|
||||
{ label: "企业名称", children: info.corpName && info.corpName },
|
||||
{ label: "企业状态", children: info.xgfState, span: 5 },
|
||||
|
||||
{ label: "股份被监督部门", children: info.managerDepIds },
|
||||
|
|
|
|||
|
|
@ -1,25 +1,46 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import BackIcon from "zy-react-library/components/Icon/BackIcon";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_DEPARTMENT } from "~/enumerate/namespace";
|
||||
|
||||
function Department() {
|
||||
function Department(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState(null);
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {
|
||||
}, { form });
|
||||
const { tableProps, getData } = useTable(props["departmentList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqParentId: selectedNodeId,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["departmentRemove"]({ id });
|
||||
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
|
|
@ -28,22 +49,29 @@ function Department() {
|
|||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "部门名称" },
|
||||
{ name: "likeName", label: "部门名称" },
|
||||
{
|
||||
name: "name",
|
||||
name: "eqLevel",
|
||||
label: "部门级别",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
items: [{ name: "一级部门", bianma: "1" }],
|
||||
},
|
||||
{
|
||||
name: "eqDeptType",
|
||||
label: "单位类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", bianma: "1" }],
|
||||
},
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
|
|
@ -55,7 +83,7 @@ function Department() {
|
|||
>
|
||||
新增
|
||||
</Button>
|
||||
<Button icon={<BackIcon />}>返回</Button>
|
||||
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
|
|
@ -70,6 +98,8 @@ function Department() {
|
|||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
|
||||
setSelectedNodeId(record.parentId);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
|
|
@ -85,7 +115,12 @@ function Department() {
|
|||
</div>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
requestAdd={props["departmentAdd"]}
|
||||
requestEdit={props["departmentEdit"]}
|
||||
requestDetails={props["departmentDetails"]}
|
||||
loading={props.department.departmentLoading}
|
||||
open={addModalOpen}
|
||||
parentId={selectedNodeId}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -98,9 +133,13 @@ function Department() {
|
|||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [parentName, setParentName] = useState(null);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
console.log(props.currentId);
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
form.setFieldsValue(res.data);
|
||||
setParentName(res.data.parentName);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
|
|
@ -108,21 +147,34 @@ function AddModalComponent(props) {
|
|||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
console.log(values);
|
||||
onCancel();
|
||||
props.getData();
|
||||
values.levelName = getLabelName({ status: values.level, list: [{ bianma: "1", name: "一级部门" }] });
|
||||
values.parentId = props.parentId;
|
||||
if (props.currentId) {
|
||||
values.id = props.currentId;
|
||||
props.requestEdit(values).then(() => {
|
||||
onCancel();
|
||||
props.getData();
|
||||
});
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values).then(() => {
|
||||
onCancel();
|
||||
props.getData();
|
||||
});
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "修改" : "新增"}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
loading={props.loading}
|
||||
width={800}
|
||||
>
|
||||
<FormBuilder
|
||||
values={{
|
||||
regDepartment: "2",
|
||||
securityFlag: 0,
|
||||
}}
|
||||
form={form}
|
||||
span={24}
|
||||
|
|
@ -130,18 +182,18 @@ function AddModalComponent(props) {
|
|||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "parentName", label: "上级部门", render: () => (<Tag color="processing">111</Tag>) },
|
||||
{ name: "department", label: "部门名称" },
|
||||
{ name: "level", label: "部门级别", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ id: "1", name: "一级部门" }] },
|
||||
{ name: "sort", label: "部门排序", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ name: "parentName", required: false, label: "上级部门", render: <Tag color="processing">{parentName}</Tag> },
|
||||
{ name: "name", label: "部门名称" },
|
||||
{ name: "level", label: "部门级别", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ bianma: "1", name: "一级部门" }] },
|
||||
{ name: "depOrder", label: "部门排序", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{
|
||||
name: "regDepartment",
|
||||
name: "securityFlag",
|
||||
label: "是否安全管理部门",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [{ id: "1", name: "是" }, { id: "2", name: "否" }],
|
||||
items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }],
|
||||
},
|
||||
{ name: "bz", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "remarks", label: "备注", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
]}
|
||||
/>
|
||||
</Modal>
|
||||
|
|
@ -149,4 +201,4 @@ function AddModalComponent(props) {
|
|||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Department;
|
||||
export default Connect([NS_DEPARTMENT], true)(Department);
|
||||
|
|
|
|||
|
|
@ -1,42 +1,55 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import BackIcon from "zy-react-library/components/Icon/BackIcon";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import SelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_POST } from "~/enumerate/namespace";
|
||||
|
||||
function Post() {
|
||||
function Post(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState("0");
|
||||
const [selectedNodeName, setSelectedNodeName] = useState("");
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {
|
||||
}, { form });
|
||||
const { tableProps, getData } = useTable(props["postList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
departmentIdString: selectedNodeId,
|
||||
corpFlag: 1,
|
||||
};
|
||||
},
|
||||
});
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["postRemove"]({ id });
|
||||
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
const onTreeChange = (selectedKeys, event) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeName(event.node.name);
|
||||
console.log(selectedKeys);
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "岗位名称" },
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
|
|
@ -49,12 +62,11 @@ function Post() {
|
|||
>
|
||||
新增
|
||||
</Button>
|
||||
<Button icon={<BackIcon />}>返回</Button>
|
||||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "所属部门", dataIndex: "name" },
|
||||
{ title: "岗位名称", dataIndex: "name" },
|
||||
{ title: "所属部门", required: false, dataIndex: "departmentName" },
|
||||
{ title: "岗位名称", dataIndex: "postName" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
|
|
@ -81,6 +93,12 @@ function Post() {
|
|||
<AddModal
|
||||
currentId={currentId}
|
||||
open={addModalOpen}
|
||||
requestAdd={props["postAdd"]}
|
||||
requestEdit={props["postEdit"]}
|
||||
requestDetails={props["postDetails"]}
|
||||
selectedNodeName={selectedNodeName}
|
||||
loding={props.post.postLoading}
|
||||
parentId={selectedNodeId}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
|
|
@ -93,31 +111,58 @@ function Post() {
|
|||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [parentName, setParentName] = useState(null);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
console.log(props.currentId);
|
||||
props.requestDetails({ id: props.currentId }).then((res) => {
|
||||
const arr = [];
|
||||
res.data.departmentList && res.data.departmentList.forEach((item) => {
|
||||
arr.push(item.departmentId);
|
||||
});
|
||||
res.data.departmentIdsString = arr;
|
||||
form.setFieldsValue(res.data);
|
||||
console.log(res.data);
|
||||
setParentName(res.data.departmentName);
|
||||
});
|
||||
}
|
||||
}, [props.currentId]);
|
||||
else {
|
||||
setParentName(props.selectedNodeName);
|
||||
}
|
||||
}, [props.currentId, props.selectedNodeName]);
|
||||
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
console.log(values);
|
||||
onCancel();
|
||||
props.getData();
|
||||
values.departmentIdString = props.parentId;
|
||||
values.corpFlag = 1;
|
||||
if (props.currentId) {
|
||||
values.idString = props.currentId;
|
||||
props.requestEdit(values).then(() => {
|
||||
onCancel();
|
||||
props.getData();
|
||||
});
|
||||
}
|
||||
else {
|
||||
props.requestAdd(values).then(() => {
|
||||
onCancel();
|
||||
props.getData();
|
||||
});
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
title={props.currentId ? "修改" : "新增"}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
loading={props.loading}
|
||||
width={800}
|
||||
>
|
||||
<FormBuilder
|
||||
values={{
|
||||
regPost: "2",
|
||||
supervisionFlag: 0,
|
||||
}}
|
||||
form={form}
|
||||
span={24}
|
||||
|
|
@ -125,17 +170,17 @@ function AddModalComponent(props) {
|
|||
onFinish={onSubmit}
|
||||
showActionButtons={false}
|
||||
options={[
|
||||
{ name: "parentName", label: "所属部门", render: () => (<Tag color="processing">111</Tag>) },
|
||||
{ name: "department", label: "岗位名称" },
|
||||
{ name: "parentName", required: false, label: "所属部门", render: <Tag color="processing">{parentName }</Tag> },
|
||||
{ name: "postName", label: "岗位名称" },
|
||||
{
|
||||
name: "regPost",
|
||||
name: "supervisionFlag",
|
||||
label: "是否监管岗位",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: [{ id: "1", name: "是" }, { id: "2", name: "否" }],
|
||||
items: [{ bianma: 1, name: "是" }, { bianma: 0, name: "否" }],
|
||||
},
|
||||
{ name: "permission", label: "数据权限", required: false, dependencies: ["regPost"], hidden: formValues => !(formValues.regPost === "1") },
|
||||
{ name: "bz", label: "岗位职责", required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "departmentIdsString", label: "数据权限", required: false, render: <SelectTree multiple />, dependencies: ["supervisionFlag"], hidden: formValues => (formValues.supervisionFlag === 0) },
|
||||
{ name: "remarks", label: "岗位职责", render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
]}
|
||||
/>
|
||||
</Modal>
|
||||
|
|
@ -143,4 +188,5 @@ function AddModalComponent(props) {
|
|||
}
|
||||
|
||||
const AddModal = AddModalComponent;
|
||||
export default Post;
|
||||
|
||||
export default Connect([NS_POST], true)(Post);
|
||||
|
|
|
|||
|
|
@ -1,55 +1,139 @@
|
|||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Form, message } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import DepartmentSelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import nation from "zy-react-library/json/nation.json";
|
||||
import { ID_NUMBER, PHONE } from "zy-react-library/regular";
|
||||
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
const { query } = tools.router;
|
||||
const WHETHER_ENUM = [
|
||||
{ id: "1", name: "是" },
|
||||
{ id: "0", name: "否" },
|
||||
{ bianma: 1, name: "是" },
|
||||
{ bianma: 0, name: "否" },
|
||||
];
|
||||
const SEX = [
|
||||
{ bianma: 1, name: "男" },
|
||||
{ bianma: 2, name: "女" },
|
||||
];
|
||||
|
||||
function Add() {
|
||||
const onSubmit = (values) => {
|
||||
console.log(values);
|
||||
function Add(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [postData, setPostData] = useState([]);
|
||||
const [rolesData, setRolesData] = useState([]);
|
||||
const [rankData, getRankData] = useState([]);
|
||||
const [userTypeData, setUserTypeData] = useState([]);
|
||||
const [userID, setUserID] = useState(null);
|
||||
const queryParams = useGetUrlQuery();
|
||||
|
||||
useEffect(() => {
|
||||
if (queryParams["id"]) {
|
||||
const fetchData = async () => {
|
||||
const res = await props["userDetails"]({ id: queryParams["id"] });
|
||||
console.log(res.data);
|
||||
setUserID(res.data.userId);
|
||||
form.setFieldsValue(res.data);
|
||||
};
|
||||
fetchData();
|
||||
}
|
||||
props["rolesAll"]().then((res) => {
|
||||
setRolesData(res.data);
|
||||
});
|
||||
|
||||
// 部门级别
|
||||
props["dictData"]({ appKey: "0bb989ecada5470c87635018ece9f327", dictValue: "departmentLevel" }).then((res) => {
|
||||
console.log(res);
|
||||
getRankData(res.data);
|
||||
});
|
||||
// 人员类型
|
||||
props["dictData"]({ appKey: "0bb989ecada5470c87635018ece9f327", dictValue: "renyuanleixing" }).then((res) => {
|
||||
console.log(res);
|
||||
setUserTypeData(res.data);
|
||||
});
|
||||
}, []);
|
||||
|
||||
const onSubmit = async (values) => {
|
||||
values.nationName = getLabelName({ status: values.nation, list: nation });
|
||||
values.personnelTypeName = getLabelName({ status: values.personnelType, list: userTypeData, idKey: "dictValue", nameKey: "labelKey" });
|
||||
values.rank_level_name = getLabelName({ status: values.rank_level, list: rankData, idKey: "dictValue", nameKey: "labelKey" });
|
||||
idCardGetDateAndGender(values.userIdCard);
|
||||
|
||||
console.log(idCardGetDateAndGender(values.userIdCard));
|
||||
values.mainCorpFlag = 0;
|
||||
values.userType = 1;
|
||||
if (queryParams["id"]) {
|
||||
values.id = queryParams["id"];
|
||||
values.userId = userID;
|
||||
props["userEdit"](values).then((res) => {
|
||||
if (res.success) {
|
||||
window.history.back();
|
||||
message.success("编辑成功!");
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
props["userAdd"](values).then((res) => {
|
||||
if (res.success) {
|
||||
window.history.back();
|
||||
message.success("新增成功!");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const fnChoiceDepartment = async (event) => {
|
||||
console.log(event);
|
||||
form.setFieldsValue({ postId: undefined });
|
||||
// setDepartmentName(event[0].name)
|
||||
props["postAll"]({ corpFlag: 1, departmentIdString: event[0].id }).then((res) => {
|
||||
console.log(res);
|
||||
setPostData(res.data);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title={query.id ? "修改" : "新增"} />
|
||||
<HeaderBack title={queryParams["id"] ? "编辑" : "新增"} />
|
||||
<div style={{ paddingBottom: 10 }}>
|
||||
<FormBuilder
|
||||
loading={props.user.userLoading}
|
||||
values={{
|
||||
isHeadOfDepartment: "0",
|
||||
isDeputyInCharge: "0",
|
||||
departmentLeaderFlag: "0",
|
||||
|
||||
}}
|
||||
form={form}
|
||||
onFinish={onSubmit}
|
||||
labelCol={{ span: 6 }}
|
||||
options={[
|
||||
{ name: "roleId", label: "用户角色", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "一级部门", id: "1" }] },
|
||||
{ name: "departmentId", label: "所属部门", render: DepartmentSelectTree },
|
||||
{ name: "roleId", label: "用户角色", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: rolesData, itemsField: { labelKey: "roleName", valueKey: "id" } },
|
||||
{ name: "departmentId", label: "所属部门", render: <DepartmentSelectTree onGetNodePaths={fnChoiceDepartment} /> },
|
||||
{
|
||||
name: "postId",
|
||||
label: "所属岗位",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
items: postData,
|
||||
itemsField: { labelKey: "postName", valueKey: "id" },
|
||||
},
|
||||
{ name: "username", label: "用户名", tip: "* 如果修改手机号,登录密码则会变成初始密码“Aa@123456789”" },
|
||||
{ name: "username", label: "用户名" },
|
||||
{ name: "name", label: "姓名" },
|
||||
{ name: "phone", label: "手机号", rules: [{ pattern: PHONE, message: "请输入正确的手机号" }] },
|
||||
{
|
||||
name: "personType",
|
||||
name: "personnelType",
|
||||
label: "人员类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
items: userTypeData,
|
||||
itemsField: { labelKey: "dictLabel", valueKey: "dictValue" },
|
||||
},
|
||||
{
|
||||
name: "userIdCard",
|
||||
label: "身份证号",
|
||||
required: false,
|
||||
|
||||
rules: [{ pattern: ID_NUMBER, message: "请输入正确的身份证号" }],
|
||||
},
|
||||
{
|
||||
|
|
@ -57,25 +141,27 @@ function Add() {
|
|||
label: "民族",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
items: nation,
|
||||
},
|
||||
{
|
||||
name: "sex",
|
||||
label: "性别",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [{ name: "一级部门", id: "1" }],
|
||||
componentProps: { disabled: true },
|
||||
dependencies: ["userIdCard"],
|
||||
// shouldUpdate:{(prevValues, curValues)=>{}}
|
||||
items: SEX,
|
||||
},
|
||||
{
|
||||
name: "faceFile",
|
||||
label: "上传人脸照片",
|
||||
required: false,
|
||||
span: 24,
|
||||
render: ({ value, onChange }) => (
|
||||
render: (
|
||||
<Upload
|
||||
size={4}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
fileType="image"
|
||||
tipContent={(
|
||||
<div style={{ lineHeight: 1.6, color: "red", fontSize: 12 }}>
|
||||
<div>* 图像格式:JPG、JPEG、PNG</div>
|
||||
|
|
@ -89,16 +175,14 @@ function Add() {
|
|||
),
|
||||
},
|
||||
{ name: "sort", label: "部门排序", render: FORM_ITEM_RENDER_ENUM.NUMBER },
|
||||
{ name: "level", label: "部门级别", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: [{ name: "一级部门", id: "1" }] },
|
||||
{ name: "rank_level", label: "人员职级", required: false, render: FORM_ITEM_RENDER_ENUM.SELECT, items: rankData, itemsField: { labelKey: "dictLabel", valueKey: "dictValue" } },
|
||||
{ name: "email", label: "邮箱", required: false, rules: [{ type: "email", message: "请输入正确的邮箱" }] },
|
||||
{ name: "isHeadOfDepartment", label: "是否为部门负责人", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM },
|
||||
{ name: "isDeputyInCharge", label: "是否为分管领导", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM },
|
||||
{ name: "bz", label: "备注", span: 24, required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "remarks", label: "备注", span: 24, required: false, render: FORM_ITEM_RENDER_ENUM.TEXTAREA },
|
||||
{ name: "departmentLeaderFlag", label: "是否为部门负责人", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Add;
|
||||
export default Connect([NS_USER], true)(Add);
|
||||
|
|
|
|||
|
|
@ -1,23 +1,59 @@
|
|||
import { Button, Form, message, Modal, Space } from "antd";
|
||||
import { useState } from "react";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, message, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import DeleteIcon from "zy-react-library/components/Icon/DeleteIcon";
|
||||
import ExportIcon from "zy-react-library/components/Icon/ExportIcon";
|
||||
import ImportIcon from "zy-react-library/components/Icon/ImportIcon";
|
||||
import ImportFile from "zy-react-library/components/ImportFile";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
const [importOpen, setImportOpen] = useState(false);
|
||||
const [selectedNodeId, setSelectedNodeId] = useState();
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||
const [postData, setPostData] = useState([]);
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(() => {}, { form });
|
||||
const { tableProps, getData } = useTable(props["userList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
const fetchPostData = async () => {
|
||||
const deptId = selectedNodeId ?? "0";
|
||||
try {
|
||||
const res = await props["postAll"]({ corpFlag: 1, departmentIdString: deptId });
|
||||
setPostData(res?.data || []);
|
||||
}
|
||||
catch (err) {
|
||||
message.error("岗位数据加载失败");
|
||||
setPostData([]);
|
||||
}
|
||||
};
|
||||
|
||||
fetchPostData();
|
||||
}, [selectedNodeId]);
|
||||
|
||||
const onDelete = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定删除吗?",
|
||||
onOk: () => {
|
||||
props["userRemove"]({ id });
|
||||
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
|
|
@ -41,26 +77,42 @@ function List(props) {
|
|||
},
|
||||
});
|
||||
};
|
||||
const onUnlock = (id) => {
|
||||
message.success("解锁成功");
|
||||
};
|
||||
|
||||
const onImportFileConfirm = (values) => {
|
||||
console.log(values);
|
||||
message.success("导入成功");
|
||||
};
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
};
|
||||
return (
|
||||
<div style={{ padding: 20 }}>
|
||||
<div style={{ display: "flex", gap: 20 }}>
|
||||
<LeftTree />
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div style={{ flex: 1 }}>
|
||||
<Search
|
||||
options={[
|
||||
{ name: "name", label: "关键字", tip: "用户名/姓名" },
|
||||
{ name: "likeName", label: "姓名" },
|
||||
{
|
||||
name: "eqPostId",
|
||||
label: "所属岗位",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: postData,
|
||||
itemsField: { labelKey: "postName", valueKey: "id" },
|
||||
},
|
||||
|
||||
]}
|
||||
form={form}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
loading={props.user.userLoading}
|
||||
rowSelection={{
|
||||
selectedRowKeys,
|
||||
onChange: selectedRowKeys => setSelectedRowKeys(selectedRowKeys),
|
||||
}}
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
|
|
@ -72,6 +124,26 @@ function List(props) {
|
|||
>
|
||||
新增
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
danger
|
||||
onClick={() => {
|
||||
if (!selectedRowKeys.length)
|
||||
return message.warning("请选择要删除的行");
|
||||
Modal.confirm({
|
||||
title: "确定删除吗?",
|
||||
onOk: async () => {
|
||||
await props["userRemoveIds"]({ ids: selectedRowKeys.join(",") });
|
||||
message.success("删除成功");
|
||||
setSelectedRowKeys([]);
|
||||
getData();
|
||||
},
|
||||
});
|
||||
}}
|
||||
icon={<DeleteIcon />}
|
||||
>
|
||||
批量删除
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<ImportIcon />}
|
||||
|
|
@ -85,10 +157,11 @@ function List(props) {
|
|||
</>
|
||||
)}
|
||||
columns={[
|
||||
{ title: "用户名", dataIndex: "name" },
|
||||
{ title: "用户名", dataIndex: "username" },
|
||||
{ title: "姓名", dataIndex: "name" },
|
||||
{ title: "部门", dataIndex: "name" },
|
||||
{ title: "岗位", dataIndex: "name" },
|
||||
{ title: "手机号", dataIndex: "phone" },
|
||||
{ title: "所属部门", dataIndex: "departmentName" },
|
||||
{ title: "所属岗位", dataIndex: "postName" },
|
||||
{
|
||||
title: "操作",
|
||||
width: 300,
|
||||
|
|
@ -103,7 +176,15 @@ function List(props) {
|
|||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button type="link" onClick={() => onUnlock(record.id)}>解锁</Button>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
<Button type="link" danger onClick={() => onDelete(record.id)}>删除</Button>
|
||||
</Space>
|
||||
),
|
||||
|
|
@ -119,8 +200,78 @@ function List(props) {
|
|||
onConfirm={onImportFileConfirm}
|
||||
onCancel={() => { setImportOpen(false); }}
|
||||
/>
|
||||
<AddModal
|
||||
currentId={currentId}
|
||||
open={addModalOpen}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
getData={getData}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({ id: props.currentId });
|
||||
console.log(res.data);
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
console.log(info);
|
||||
}
|
||||
}, [props.currentId]);
|
||||
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
onCancel={onCancel}
|
||||
onOk={form.submit}
|
||||
okButtonProps={{ style: { display: "none" } }}
|
||||
title="查看"
|
||||
width={900}
|
||||
>
|
||||
|
||||
<div style={{ padding: 20 }}>
|
||||
<Descriptions
|
||||
labelStyle={{ width: 200 }}
|
||||
column={2}
|
||||
bordered
|
||||
items={[
|
||||
{ label: "用户角色", children: info.username },
|
||||
{ label: "所属部门", children: info.departmentName },
|
||||
{ label: "是否部门负责人", children: <span>{info.departmentLeaderFlag === 1 ? "是" : "否"}</span> },
|
||||
{ label: "所属岗位", children: info.postName },
|
||||
{ label: "用户名", children: info.username },
|
||||
{ label: "姓名", children: info.name },
|
||||
{ label: "手机号", children: info.phone },
|
||||
{ label: "人员类型", children: info.personnelTypeName },
|
||||
{ label: "身份证号", children: info.userIdCard },
|
||||
{ label: "民族", children: info.nationName },
|
||||
{ label: "性别", children: info.sex },
|
||||
|
||||
{ label: "人脸照片", children: info.nationName },
|
||||
{ label: "部门排序", children: info.sort },
|
||||
{ label: "邮箱", children: info.email },
|
||||
{ label: "备注", children: info.remarks },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
export default List;
|
||||
const AddModal = AddModalComponent;
|
||||
export default Connect([NS_USER], true)(List);
|
||||
|
|
|
|||
Loading…
Reference in New Issue