相关方需求修改

master
853931625@qq.com 2026-04-13 09:28:27 +08:00
parent 583e255167
commit 8844bb25ee
15 changed files with 583 additions and 466 deletions

View File

@ -28,8 +28,8 @@ module.exports = {
// 应用Key
appKey: "",
// fileUrl: "http://192.168.20.240:9787/mnt/",
fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
// fileUrl: "https://skqhdg.porthebei.com:9004/file/uploadFiles2/",
// fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
fileUrl: "https://skqhdg.porthebei.com:9004/file/uploadFiles2/",
},
// public/index.html注入全局变量
windowInject: {

View File

@ -8,14 +8,14 @@ import AddIcon from "zy-react-library/components/Icon/AddIcon";
import Page from "zy-react-library/components/Page";
import Search from "zy-react-library/components/Search";
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
import AreaSelect from "zy-react-library/components/SelectTree/Area";
// import AreaSelect from "zy-react-library/components/SelectTree/Area";
import Table from "zy-react-library/components/Table";
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import useTable from "zy-react-library/hooks/useTable";
import { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
import { getLabelName } from "zy-react-library/utils";
import { NS_ENTERPRISE } from "~/enumerate/namespace";
import { getAreaNamePath, useDebounce } from "~/utils";
import { useDebounce } from "~/utils";
const ENTERPRISE_TYPE = [
{
@ -43,11 +43,11 @@ function List(props) {
enterpriseType: 3,
geCreateTime: formData.CreateTime?.[0],
leCreateTime: formData.CreateTime?.[1],
eqProvince: formData.cityRecord?.[0],
eqCity: formData.cityRecord?.[1],
eqCountry: formData.cityRecord?.[2],
eqStreet: formData.cityRecord?.[3],
eqVillage: formData.cityRecord?.[4],
// eqProvince: formData.cityRecord?.[0],
// eqCity: formData.cityRecord?.[1],
// eqCountry: formData.cityRecord?.[2],
// eqStreet: formData.cityRecord?.[3],
// eqVillage: formData.cityRecord?.[4],
};
},
@ -57,7 +57,7 @@ function List(props) {
const onResetPassword = (id) => {
Modal.confirm({
title: "提示",
content: "是否重置密码为Aa@12345678",
content: "是否重置密码为Cc@12345678",
onOk: () => {
props["corpInfoChangePassword"]({
id,
@ -87,44 +87,44 @@ function List(props) {
},
});
};
const onFinish = async () => {
// 处理属地查询
const arr = [];
cityData.forEach((item) => {
arr.push(item.value);
});
form.setFieldValue("cityRecord", arr);
getData();
};
// const onFinish = async () => {
// // 处理属地查询
// const arr = [];
// cityData.forEach((item) => {
// arr.push(item.value);
// });
// form.setFieldValue("cityRecord", arr);
// getData();
// };
const onReset = () => {
setCityData([]);
form.setFieldValue("cityRecord", []);
};
// const onReset = () => {
// setCityData([]);
//
// form.setFieldValue("cityRecord", []);
// };
return (
<div>
<Page isShowAllAction={false}>
<Search
form={form}
onFinish={() => onFinish()}
onReset={onReset}
onFinish={getData}
// onReset={onReset}
options={[
{
name: "likecorpName",
label: "企业名称",
},
{
name: "cityData",
label: "属地",
render: (
<AreaSelect
onGetNodePaths={nodes =>
setCityData(nodes)}
/>
),
},
// {
// name: "cityData",
// label: "属地",
// render: (
// <AreaSelect
// onGetNodePaths={nodes =>
// setCityData(nodes)}
// />
// ),
// },
{
name: "CreateTime",
label: "开户时间",
@ -136,12 +136,12 @@ function List(props) {
render: FORM_ITEM_RENDER_ENUM.SELECT,
items: ENTERPRISE_TYPE,
},
{
name: "cityRecord",
label: "属地",
render: FORM_ITEM_RENDER_ENUM.SELECT,
onlyForLabel: true,
},
// {
// name: "cityRecord",
// label: "属地",
// render: FORM_ITEM_RENDER_ENUM.SELECT,
// onlyForLabel: true,
// },
]}
@ -171,14 +171,14 @@ function List(props) {
title: "企业名称",
dataIndex: "corpName",
},
{
title: "属地",
dataIndex: "cityName",
width: 300,
render: (_, record) => (
<div>{getAreaNamePath(record)}</div>
),
},
// {
// title: "属地",
// dataIndex: "cityName",
// width: 300,
// render: (_, record) => (
// <div>{getAreaNamePath(record)}</div>
// ),
// },
{
title: "创建单位",
dataIndex: "tenantName",
@ -447,6 +447,7 @@ function AddModalComponent(props) {
{
name: "code",
label: "统一社会信用代码",
required: false,
rules: [
{
pattern: UNIFIED_SOCIAL_CREDIT_CODE,
@ -454,23 +455,23 @@ function AddModalComponent(props) {
},
],
},
{
name: "ecoType",
label: "经济类型",
render: (
<DictionarySelect
dictValue="ECO_TYPE"
onGetLabel={(label) => {
form.setFieldValue("ecoTypeName", label);
}}
/>
),
},
{
name: "ecoTypeName",
label: "经济类型名称",
onlyForLabel: true,
},
// {
// name: "ecoType",
// label: "经济类型",
// render: (
// <DictionarySelect
// dictValue="ECO_TYPE"
// onGetLabel={(label) => {
// form.setFieldValue("ecoTypeName", label);
// }}
// />
// ),
// },
// {
// name: "ecoTypeName",
// label: "经济类型名称",
// onlyForLabel: true,
// },
{
name: "type",
label: "相关方类型",

View File

@ -10,7 +10,7 @@ import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import { getLabelName } from "zy-react-library/utils";
import { NS_ENTERPRISE } from "~/enumerate/namespace";
import { getAreaNamePath, getCorpTypeNamePath } from "~/utils";
import { getCorpTypeNamePath } from "~/utils";
const ENTERPRISE_TYPE = [
{
@ -103,33 +103,33 @@ function View(props) {
children: info.code,
},
{
label: "属地",
children: <div>{getAreaNamePath(info)}</div>,
},
// {
// label: "属地",
// children: <div>{getAreaNamePath(info)}</div>,
// },
{
label: "所属行业",
children: <div>{getCorpTypeNamePath(info)}</div>,
},
// {
// label: "所属行业",
// children: <div>{getCorpTypeNamePath(info)}</div>,
// },
{
label: "经济类型",
children: info.ecoTypeName,
},
{
label: "经度/纬度",
children: info.longitude && `${info.longitude}/${info.latitude}`,
},
// {
// label: "经济类型",
// children: info.ecoTypeName,
// },
// {
// label: "经度/纬度",
// children: info.longitude && `${info.longitude}/${info.latitude}`,
// },
{
label: "单位经营地址",
children: info.addressBusiness,
},
{
label: "企业规模",
children: info.scaleName,
},
// {
// label: "企业规模",
// children: info.scaleName,
// },
{
label: "法定代表人",
@ -189,10 +189,10 @@ function View(props) {
</div>
),
},
{
label: "成立日期",
children: info.createDate,
},
// {
// label: "成立日期",
// children: info.createDate,
// },
{
label: "职工人数(人)",
children: info.employees,
@ -202,14 +202,14 @@ function View(props) {
// children: info.areaCovered,
// },
{
label: "注册资金(万元)",
children: info.regcapital,
},
{
label: "资产总额(万元)",
children: info.totalAssets,
},
// {
// label: "注册资金(万元)",
// children: info.regcapital,
// },
// {
// label: "资产总额(万元)",
// children: info.totalAssets,
// },
{
label: "企业二维码",

View File

@ -37,58 +37,58 @@ function List(props) {
return {
...formData,
enterpriseType: 3,
eqProvince: formData.cityRecord?.[0],
eqCity: formData.cityRecord?.[1],
eqCountry: formData.cityRecord?.[2],
eqStreet: formData.cityRecord?.[3],
eqVillage: formData.cityRecord?.[4],
// eqProvince: formData.cityRecord?.[0],
// eqCity: formData.cityRecord?.[1],
// eqCountry: formData.cityRecord?.[2],
// eqStreet: formData.cityRecord?.[3],
// eqVillage: formData.cityRecord?.[4],
};
},
});
const onFinish = async () => {
// 处理属地查询
const arr = [];
cityData.forEach((item) => {
arr.push(item.value);
});
form.setFieldValue("cityRecord", arr);
getData();
};
// const onFinish = async () => {
// // 处理属地查询
// const arr = [];
// cityData.forEach((item) => {
// arr.push(item.value);
// });
// form.setFieldValue("cityRecord", arr);
// getData();
// };
const onReset = () => {
setCityData([]);
form.setFieldValue("cityRecord", []);
};
// const onReset = () => {
// setCityData([]);
//
// form.setFieldValue("cityRecord", []);
// };
return (
<div>
<Page isShowAllAction={false}>
<Search
form={form}
onFinish={() => onFinish()}
onReset={onReset}
onFinish={getData}
// onReset={onReset}
options={[
{
name: "likeCorpName",
label: "企业名称",
},
{
name: "cityData",
label: "属地",
render: (
<AreaSelect
onGetNodePaths={nodes =>
setCityData(nodes)}
/>
),
},
// {
// name: "cityData",
// label: "属地",
// render: (
// <AreaSelect
// onGetNodePaths={nodes =>
// setCityData(nodes)}
// />
// ),
// },
{ name: "eqType", label: "相关方类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
{
name: "cityRecord",
label: "属地",
render: FORM_ITEM_RENDER_ENUM.SELECT,
onlyForLabel: true,
},
// {
// name: "cityRecord",
// label: "属地",
// render: FORM_ITEM_RENDER_ENUM.SELECT,
// onlyForLabel: true,
// },
]}
/>
<Table
@ -109,13 +109,13 @@ function List(props) {
),
width: 120,
},
{
title: "属地",
dataIndex: "cityName",
render: (_, record) => (
<div>{getAreaNamePath(record)}</div>
),
},
// {
// title: "属地",
// dataIndex: "cityName",
// render: (_, record) => (
// <div>{getAreaNamePath(record)}</div>
// ),
// },
{
title: "创建单位",
dataIndex: "tenantName",

View File

@ -47,7 +47,7 @@ function List(props) {
const onResetPassword = (id) => {
Modal.confirm({
title: "提示",
content: "确定要重置密码为Aa@12345678吗",
content: "确定要重置密码为Cc@12345678吗",
onOk: () => {
props["userChangePassword"]({
id,
@ -357,22 +357,22 @@ function AddModalComponent(props) {
label: "民族",
children: info.nationName,
},
{
label: "婚姻状况",
children: info.maritalStatusName,
},
// {
// label: "婚姻状况",
// children: info.maritalStatusName,
// },
{
label: "政治面貌",
children: info.politicalAffiliationName,
},
{
label: "户口所在地",
children: info.locationAddress,
},
{
label: "现住址",
children: info.currentAddress,
},
// {
// label: "户口所在地",
// children: info.locationAddress,
// },
// {
// label: "现住址",
// children: info.currentAddress,
// },
{
label: "文化程度",
children: info.culturalLevelName,

View File

@ -85,7 +85,7 @@ function List(props) {
const onResetPassword = (id) => {
Modal.confirm({
title: "提示",
content: "确定要重置密码为Aa@12345678吗",
content: "确定要重置密码为Bb@12345678吗",
onOk: () => {
props["userChangePassword"]({
id,

View File

@ -3,12 +3,8 @@ 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 Page from "zy-react-library/components/Page";
import AreaSelect from "zy-react-library/components/SelectTree/Area";
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
import IndustrySelect from "zy-react-library/components/SelectTree/Industry";
import Upload from "zy-react-library/components/Upload";
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
@ -27,20 +23,20 @@ import { useDebounce } from "~/utils";
const REQUIRED_FIELDS = [
"corpName",
"code",
"province",
"ecoType",
// "province",
// "ecoType",
"addressBusiness",
"scale",
// "scale",
"lrName",
"lrMobile",
"contacts",
"contactsPhone",
"createDate",
// "createDate",
"employees",
"regcapital",
"totalAssets",
"licenseStart",
"licenseEnd",
// "regcapital",
// "totalAssets",
// "licenseStart",
// "licenseEnd",
];
const ENTERPRISE_STATUS = [
{
@ -128,9 +124,9 @@ function CorpInfo(props) {
// data.lrMobile = data.lrMobile && data.lrMobile.label;
// data.contactsPhone = data.contactsPhone && data.contactsPhone.label;
data.region = data.village || data.street || data.country || data.city || data.province;
// data.region = data.village || data.street || data.country || data.city || data.province;
setInfoData(data);
setCorpInfoId(res.data.corpinfoId)
setCorpInfoId(res.data.corpinfoId);
setKeyId({
id: res.data.corpinfoId,
corpinfoId: res.data.userId,
@ -140,7 +136,7 @@ function CorpInfo(props) {
eqForeignKey: res.data.userId ? res.data.userId : "",
});
data.INDUSTRYALL = getLastValidCorpTypeName(data);
data.license = [data.licenseStart, data.licenseEnd];
// data.license = [data.licenseStart, data.licenseEnd];
data.scaleType = data.scaleType ?? 0;
const hasLicenseFile = Array.isArray(licenseFile) && licenseFile.length > 0;
@ -162,7 +158,6 @@ function CorpInfo(props) {
});
};
useEffect(() => {
fetchData();
}, []);
const onSubmit = async (values) => {
@ -220,22 +215,20 @@ function CorpInfo(props) {
});
values.corpinfoId = keyId.corpinfoId;
values.id = keyId.id;
values.licenseStart = values.license[0];
values.licenseEnd = values.license[1];
// values.licenseStart = values.license[0];
// values.licenseEnd = values.license[1];
delete values.license;
props["corpInfoEdit"](values).then((res) => {
if (res.success) {
message.success("操作成功!");
props["corpInfoDetails"]({
id: corpinfoId,
}).then(res =>{
res.data.region = res.data.village || res.data.street || res.data.country || res.data.city || res.data.province;
}).then((res) => {
// res.data.region = res.data.village || res.data.street || res.data.country || res.data.city || res.data.province;
setInfoData(res.data);
});
// data.lrMobile = data.lrMobile && data.lrMobile.label;
// data.contactsPhone = data.contactsPhone && data.contactsPhone.label;
}
});
};
@ -340,32 +333,30 @@ function CorpInfo(props) {
message: "请输入正确的统一社会信用代码",
},
],
componentProps: {
disabled: true,
},
},
{
label: "属地",
name: "region",
render: (
<AreaSelect
onGetNodePaths={nodes =>
setCityData(nodes)}
/>
),
},
{
label: "所属行业",
name: "INDUSTRYALL",
required: false,
render: (
<IndustrySelect
onGetNodePaths={(data) => {
setIndustryData(data);
}}
/>
),
},
// {
// label: "属地",
// name: "region",
// render: (
// <AreaSelect
// onGetNodePaths={nodes =>
// setCityData(nodes)}
// />
// ),
// },
// {
// label: "所属行业",
// name: "INDUSTRYALL",
// required: false,
// render: (
// <IndustrySelect
// onGetNodePaths={(data) => {
// setIndustryData(data);
// }}
// />
// ),
// },
// {
// label: "企业状态",
@ -377,42 +368,42 @@ function CorpInfo(props) {
// disabled: true,
// },
// },
{
label: "经济类型",
name: "ecoType",
required: false,
render: (
<DictionarySelect
dictValue="ECO_TYPE"
onGetData={(data) => {
setEcoTypeData(data);
}}
/>
),
},
{
name: "map",
customizeRender: true,
render: <Map required={false} />,
span: 24,
},
// {
// label: "经济类型",
// name: "ecoType",
// required: false,
// render: (
// <DictionarySelect
// dictValue="ECO_TYPE"
// onGetData={(data) => {
// setEcoTypeData(data);
// }}
// />
// ),
// },
// {
// name: "map",
// customizeRender: true,
// render: <Map required={false} />,
// span: 24,
// },
{
label: "企事业单位经营地址",
name: "addressBusiness",
},
{
label: "企业规模",
name: "scale",
render: (
<DictionarySelect
dictValue="scale"
onGetData={(data) => {
setScaleData(data);
}}
/>
),
},
// {
// label: "企业规模",
// name: "scale",
//
// render: (
// <DictionarySelect
// dictValue="scale"
// onGetData={(data) => {
// setScaleData(data);
// }}
// />
// ),
// },
{
label: "法定代表人",
name: "lrName",
@ -443,12 +434,12 @@ function CorpInfo(props) {
},
],
},
{
label: "成立日期",
name: "createDate",
render: FORM_ITEM_RENDER_ENUM.DATE,
},
// {
// label: "成立日期",
// name: "createDate",
//
// render: FORM_ITEM_RENDER_ENUM.DATE,
// },
{
label: "职工人数(人)",
@ -456,16 +447,16 @@ function CorpInfo(props) {
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: "regcapital",
// render: FORM_ITEM_RENDER_ENUM.NUMBER,
// },
// {
// label: "资产总额(万元)",
// name: "totalAssets",
// render: FORM_ITEM_RENDER_ENUM.NUMBER,
// },
{
label: "营业执照",
@ -481,11 +472,11 @@ function CorpInfo(props) {
/>
),
},
{
label: "营业执照有效期",
name: "license",
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
},
// {
// label: "营业执照有效期",
// name: "license",
// render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
// },
{
name: "qrCode",
label: "企业二维码",

View File

@ -14,11 +14,18 @@ import useGetFile from "zy-react-library/hooks/useGetFile";
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import useUploadFile from "zy-react-library/hooks/useUploadFile";
import nation from "zy-react-library/json/nation.json";
import { ID_NUMBER, PHONE } from "zy-react-library/regular";
import { PHONE } from "zy-react-library/regular";
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
import { NS_USER } from "~/enumerate/namespace";
import { getAgeByIdCard, getBirthDateFromIdCard, useDebounce, UseDecodeIdCard } from "~/utils";
import {
getAgeByIdCard,
getBirthDateFromIdCard,
getChineseIdCardFullErrorMessage,
isValidChineseIdCard,
useDebounce,
UseDecodeIdCard,
} from "~/utils";
export const WHETHER_ENUM = [
{
@ -189,6 +196,9 @@ function Add(props) {
]);
return;
}
if (!isValidChineseIdCard(debouncedUserIdCard)) {
return;
}
props["verifyUser"]({
userIdCard: btoa(debouncedUserIdCard),
id: queryParams["id"] ?? "",
@ -259,11 +269,22 @@ function Add(props) {
if ("userIdCard" in changedValues) {
const newIdCard = changedValues.userIdCard;
setUserIdCardValue(newIdCard ?? "");
if (newIdCard) {
form.setFields([
{
name: "userIdCard",
errors: [],
},
]);
if (newIdCard && isValidChineseIdCard(newIdCard)) {
form.setFieldValue("sex", idCardGetDateAndGender(newIdCard).sex);
form.setFieldValue("age", getAgeByIdCard(newIdCard));
form.setFieldValue("birthday", getBirthDateFromIdCard(newIdCard));
}
else {
form.setFieldValue("sex", undefined);
form.setFieldValue("age", undefined);
form.setFieldValue("birthday", undefined);
}
}
if ("username" in changedValues) {
setUsernameValue(changedValues.username ?? "");
@ -369,10 +390,17 @@ function Add(props) {
{
name: "userIdCard",
label: "身份证号",
validateTrigger: "onChange",
rules: [
{
pattern: ID_NUMBER,
message: "请输入正确的身份证号",
validateTrigger: "onChange",
validator: (_, value) => {
const errorMessage = getChineseIdCardFullErrorMessage(value);
if (!errorMessage) {
return Promise.resolve();
}
return Promise.reject(new Error(errorMessage));
},
},
],
},
@ -417,14 +445,14 @@ function Add(props) {
disabled: true,
},
},
{
name: "locationAddress",
label: "户口所在地",
},
{
name: "currentAddress",
label: "现住址",
},
// {
// name: "locationAddress",
// label: "户口所在地",
// },
// {
// name: "currentAddress",
// label: "现住址",
// },
{
name: "culturalLevel",
label: "文化程度",
@ -437,12 +465,12 @@ function Add(props) {
/>
),
},
{
name: "maritalStatus",
label: "婚姻状况",
render: FORM_ITEM_RENDER_ENUM.RADIO,
items: MARITAL_STATUS_ENUM,
},
// {
// name: "maritalStatus",
// label: "婚姻状况",
// render: FORM_ITEM_RENDER_ENUM.RADIO,
// items: MARITAL_STATUS_ENUM,
// },
{
name: "politicalAffiliation",
label: "政治面貌",
@ -458,7 +486,6 @@ function Add(props) {
{
name: "postName",
label: "岗位(工种)",
required: false,
},
{
name: "flowFlag",

View File

@ -50,7 +50,7 @@ function List(props) {
const onResetPassword = (id) => {
Modal.confirm({
title: "提示",
content: "确定要重置密码为Aa@12345678吗",
content: "确定要重置密码为Cc@12345678吗",
onOk: () => {
props["userChangePassword"]({
id,
@ -516,22 +516,22 @@ function AddModalComponent(props) {
label: "民族",
children: info.nationName,
},
{
label: "婚姻状况",
children: info.maritalStatusName,
},
// {
// label: "婚姻状况",
// children: info.maritalStatusName,
// },
{
label: "政治面貌",
children: info.politicalAffiliationName,
},
{
label: "户口所在地",
children: info.locationAddress,
},
{
label: "现住址",
children: info.currentAddress,
},
// {
// label: "户口所在地",
// children: info.locationAddress,
// },
// {
// label: "现住址",
// children: info.currentAddress,
// },
{
label: "文化程度",
children: info.culturalLevelName,

View File

@ -80,7 +80,7 @@ function List(props) {
const onResetPassword = (id) => {
Modal.confirm({
title: "提示",
content: "是否重置密码为Aa@12345678",
content: "是否重置密码为Bb@12345678",
onOk: () => {
props["corpInfoChangePassword"]({
id,

View File

@ -6,8 +6,6 @@ import FormBuilder from "zy-react-library/components/FormBuilder";
import AddIcon from "zy-react-library/components/Icon/AddIcon";
import Search from "zy-react-library/components/Search";
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
import AreaSelect from "zy-react-library/components/SelectTree/Area";
import Table from "zy-react-library/components/Table";
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import useTable from "zy-react-library/hooks/useTable";
@ -33,7 +31,7 @@ const ENTERPRISE_TYPE = [
];
function List(props) {
const [form] = Form.useForm();
const [cityData, setCityData] = useState([]);
// const [cityData, setCityData] = useState([]);
const { tableProps, getData } = useTable(props["corpInfoList"], {
form,
transform: (formData) => {
@ -42,11 +40,11 @@ function List(props) {
enterpriseType: 3,
geCreateTime: formData.CreateTime?.[0],
leCreateTime: formData.CreateTime?.[1],
eqProvince: formData.cityRecord?.[0],
eqCity: formData.cityRecord?.[1],
eqCountry: formData.cityRecord?.[2],
eqStreet: formData.cityRecord?.[3],
eqVillage: formData.cityRecord?.[4],
// eqProvince: formData.cityRecord?.[0],
// eqCity: formData.cityRecord?.[1],
// eqCountry: formData.cityRecord?.[2],
// eqStreet: formData.cityRecord?.[3],
// eqVillage: formData.cityRecord?.[4],
};
},
@ -56,7 +54,7 @@ function List(props) {
const onResetPassword = (id) => {
Modal.confirm({
title: "提示",
content: "是否重置密码为Aa@12345678",
content: "是否重置密码为Cc@12345678",
onOk: () => {
props["corpInfoChangePassword"]({
id,
@ -93,21 +91,21 @@ function List(props) {
},
});
};
const onFinish = async () => {
// 处理属地查询
const arr = [];
cityData.forEach((item) => {
arr.push(item.value);
});
form.setFieldValue("cityRecord", arr);
getData();
};
// const onFinish = async () => {
// // 处理属地查询
// const arr = [];
// cityData.forEach((item) => {
// arr.push(item.value);
// });
// form.setFieldValue("cityRecord", arr);
// getData();
// };
const onReset = () => {
setCityData([]);
form.setFieldValue("cityRecord", []);
};
// const onReset = () => {
// setCityData([]);
//
// form.setFieldValue("cityRecord", []);
// };
return (
<div
style={{
@ -117,23 +115,23 @@ function List(props) {
<Search
form={form}
onFinish={() => onFinish()}
onReset={onReset}
onFinish={getData}
// onReset={onReset}
options={[
{
name: "likecorpName",
label: "企业名称",
},
{
name: "cityData",
label: "属地",
render: (
<AreaSelect
onGetNodePaths={nodes =>
setCityData(nodes)}
/>
),
},
// {
// name: "cityData",
// label: "属地",
// render: (
// <AreaSelect
// onGetNodePaths={nodes =>
// setCityData(nodes)}
// />
// ),
// },
{
name: "CreateTime",
label: "开户时间",
@ -145,12 +143,12 @@ function List(props) {
render: FORM_ITEM_RENDER_ENUM.SELECT,
items: ENTERPRISE_TYPE,
},
{
name: "cityRecord",
label: "属地",
render: FORM_ITEM_RENDER_ENUM.SELECT,
onlyForLabel: true,
},
// {
// name: "cityRecord",
// label: "属地",
// render: FORM_ITEM_RENDER_ENUM.SELECT,
// onlyForLabel: true,
// },
]}
@ -180,14 +178,14 @@ function List(props) {
title: "企业名称",
dataIndex: "corpName",
},
{
title: "属地",
dataIndex: "cityName",
width: 300,
render: (_, record) => (
<div>{getAreaNamePath(record)}</div>
),
},
// {
// title: "属地",
// dataIndex: "cityName",
// width: 300,
// render: (_, record) => (
// <div>{getAreaNamePath(record)}</div>
// ),
// },
{
title: "创建单位",
dataIndex: "tenantName",
@ -453,6 +451,7 @@ function AddModalComponent(props) {
{
name: "code",
label: "统一社会信用代码",
required: false,
rules: [
{
pattern: UNIFIED_SOCIAL_CREDIT_CODE,
@ -460,23 +459,24 @@ function AddModalComponent(props) {
},
],
},
{
name: "ecoType",
label: "经济类型",
render: (
<DictionarySelect
dictValue="ECO_TYPE"
onGetLabel={(label) => {
form.setFieldValue("ecoTypeName", label);
}}
/>
),
},
{
name: "ecoTypeName",
label: "经济类型名称",
onlyForLabel: true,
},
// {
// name: "ecoType",
// label: "经济类型",
// required: false,
// render: (
// <DictionarySelect
// dictValue="ECO_TYPE"
// onGetLabel={(label) => {
// form.setFieldValue("ecoTypeName", label);
// }}
// />
// ),
// },
// {
// name: "ecoTypeName",
// label: "经济类型名称",
// onlyForLabel: true,
// },
{
name: "type",
label: "相关方类型",

View File

@ -10,7 +10,7 @@ import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
import { getLabelName } from "zy-react-library/utils";
import { NS_ENTERPRISE } from "~/enumerate/namespace";
import { getAreaNamePath, getCorpTypeNamePath } from "~/utils";
// import { getAreaNamePath, getCorpTypeNamePath } from "~/utils";
const ENTERPRISE_TYPE = [
{
@ -103,33 +103,33 @@ function View(props) {
children: info.code,
},
{
label: "属地",
children: <div>{getAreaNamePath(info)}</div>,
},
{
label: "所属行业",
children: <div>{getCorpTypeNamePath(info)}</div>,
},
{
label: "经济类型",
children: info.ecoTypeName,
},
{
label: "经度/纬度",
children: info.longitude && `${info.longitude}/${info.latitude}`,
},
// {
// label: "属地",
// children: <div>{getAreaNamePath(info)}</div>,
// },
//
// {
// label: "所属行业",
// children: <div>{getCorpTypeNamePath(info)}</div>,
// },
//
// {
// label: "经济类型",
// children: info.ecoTypeName,
// },
// {
// label: "经度/纬度",
// children: info.longitude && `${info.longitude}/${info.latitude}`,
// },
{
label: "单位经营地址",
children: info.addressBusiness,
},
{
label: "企业规模",
children: info.scaleName,
},
// {
// label: "企业规模",
// children: info.scaleName,
// },
{
label: "法定代表人",
@ -189,10 +189,10 @@ function View(props) {
</div>
),
},
{
label: "成立日期",
children: info.createDate,
},
// {
// label: "成立日期",
// children: info.createDate,
// },
{
label: "职工人数(人)",
children: info.employees,
@ -202,14 +202,14 @@ function View(props) {
// children: info.areaCovered,
// },
{
label: "注册资金(万元)",
children: info.regcapital,
},
{
label: "资产总额(万元)",
children: info.totalAssets,
},
// {
// label: "注册资金(万元)",
// children: info.regcapital,
// },
// {
// label: "资产总额(万元)",
// children: info.totalAssets,
// },
{
label: "企业二维码",

View File

@ -30,36 +30,36 @@ const ENTERPRISE_TYPE = [
function List(props) {
const [form] = Form.useForm();
const [cityData, setCityData] = useState([]);
// const [cityData, setCityData] = useState([]);
const { tableProps, getData } = useTable(props["corpUserMiddlePage"], {
form,
transform: (formData) => {
return {
...formData,
enterpriseType: 3,
eqProvince: formData.cityRecord?.[0],
eqCity: formData.cityRecord?.[1],
eqCountry: formData.cityRecord?.[2],
eqStreet: formData.cityRecord?.[3],
eqVillage: formData.cityRecord?.[4],
// eqProvince: formData.cityRecord?.[0],
// eqCity: formData.cityRecord?.[1],
// eqCountry: formData.cityRecord?.[2],
// eqStreet: formData.cityRecord?.[3],
// eqVillage: formData.cityRecord?.[4],
};
},
});
const onFinish = async () => {
// 处理属地查询
const arr = [];
cityData.forEach((item) => {
arr.push(item.value);
});
form.setFieldValue("cityRecord", arr);
getData();
};
// const onFinish = async () => {
// // 处理属地查询
// const arr = [];
// cityData.forEach((item) => {
// arr.push(item.value);
// });
// form.setFieldValue("cityRecord", arr);
// getData();
// };
const onReset = () => {
setCityData([]);
form.setFieldValue("cityRecord", []);
};
// const onReset = () => {
// setCityData([]);
//
// form.setFieldValue("cityRecord", []);
// };
return (
<div
style={{
@ -68,30 +68,30 @@ function List(props) {
>
<Search
form={form}
onFinish={() => onFinish()}
onReset={onReset}
onFinish={getData}
// onReset={onReset}
options={[
{
name: "likeCorpName",
label: "企业名称",
},
{
name: "cityData",
label: "属地",
render: (
<AreaSelect
onGetNodePaths={nodes =>
setCityData(nodes)}
/>
),
},
// {
// name: "cityData",
// label: "属地",
// render: (
// <AreaSelect
// onGetNodePaths={nodes =>
// setCityData(nodes)}
// />
// ),
// },
{ name: "eqType", label: "相关方类型", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_TYPE },
{
name: "cityRecord",
label: "属地",
render: FORM_ITEM_RENDER_ENUM.SELECT,
onlyForLabel: true,
},
// {
// name: "cityRecord",
// label: "属地",
// render: FORM_ITEM_RENDER_ENUM.SELECT,
// onlyForLabel: true,
// },
]}
/>
<Table
@ -112,13 +112,13 @@ function List(props) {
),
width: 120,
},
{
title: "属地",
dataIndex: "cityName",
render: (_, record) => (
<div>{getAreaNamePath(record)}</div>
),
},
// {
// title: "属地",
// dataIndex: "cityName",
// render: (_, record) => (
// <div>{getAreaNamePath(record)}</div>
// ),
// },
{
title: "创建单位",
dataIndex: "tenantName",

View File

@ -49,7 +49,7 @@ function List(props) {
const onResetPassword = (id) => {
Modal.confirm({
title: "提示",
content: "确定要重置密码为Aa@12345678吗",
content: "确定要重置密码为Cc@12345678吗",
onOk: () => {
props["userChangePassword"]({
id,
@ -362,22 +362,22 @@ function AddModalComponent(props) {
label: "民族",
children: info.nationName,
},
{
label: "婚姻状况",
children: info.maritalStatusName,
},
// {
// label: "婚姻状况",
// children: info.maritalStatusName,
// },
{
label: "政治面貌",
children: info.politicalAffiliationName,
},
{
label: "户口所在地",
children: info.locationAddress,
},
{
label: "现住址",
children: info.currentAddress,
},
// {
// label: "户口所在地",
// children: info.locationAddress,
// },
// {
// label: "现住址",
// children: info.currentAddress,
// },
{
label: "文化程度",
children: info.culturalLevelName,

View File

@ -1,5 +1,103 @@
import { useEffect, useRef, useState } from "react";
/**
* 校验中国大陆18位身份证号
* 包含地址码年份(18/19/20开头)月份日期顺序码和校验位
* @param {string} idCard
* @returns {boolean}
*/
export function isValidChineseIdCard(idCard) {
if (!idCard || typeof idCard !== "string") {
return false;
}
const value = idCard.trim();
if (!isValidChineseIdCardFormat(value)) {
return false;
}
const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
const checkCodeMap = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"];
const sum = value
.substring(0, 17)
.split("")
.reduce((total, num, index) => total + Number(num) * weights[index], 0);
return checkCodeMap[sum % 11] === value[17].toUpperCase();
}
export function isValidChineseIdCardFormat(idCard) {
if (!idCard || typeof idCard !== "string") {
return false;
}
const value = idCard.trim();
const pattern = /^[1-9][0-9]{5}(18|19|20)[0-9]{2}(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01])[0-9]{3}[0-9Xx]$/;
if (!pattern.test(value)) {
return false;
}
const year = Number.parseInt(value.substring(6, 10), 10);
const month = Number.parseInt(value.substring(10, 12), 10);
const day = Number.parseInt(value.substring(12, 14), 10);
const date = new Date(year, month - 1, day);
return (
date.getFullYear() === year
&& date.getMonth() === month - 1
&& date.getDate() === day
);
}
export function getChineseIdCardInputErrorMessage(idCard) {
if (!idCard || typeof idCard !== "string") {
return "";
}
const value = idCard.trim();
if (!/^[0-9Xx]*$/.test(value)) {
return "身份证号只能输入数字或X";
}
if (value.length > 18) {
return "身份证号长度不能超过18位";
}
if (value.length < 18) {
return "";
}
if (!isValidChineseIdCardFormat(value)) {
return "请输入正确的18位身份证号";
}
return "";
}
export function getChineseIdCardFullErrorMessage(idCard) {
const inputErrorMessage = getChineseIdCardInputErrorMessage(idCard);
if (inputErrorMessage) {
return inputErrorMessage;
}
if (!idCard || typeof idCard !== "string") {
return "";
}
const value = idCard.trim();
if (value.length < 18) {
return "";
}
if (!isValidChineseIdCard(value)) {
return "身份证校验位不正确";
}
return "";
}
/**
* 根据身份证号计算年龄
* @param {string} idCard - 18位身份证号码