no message
parent
a3d0418dd1
commit
9ac6566331
BIN
basic-info.zip
BIN
basic-info.zip
Binary file not shown.
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
module.exports={compact:!1,plugins:[["@babel/plugin-proposal-decorators",{legacy:!0}]],presets:[["@babel/preset-env",{targets:{browsers:["ie >= 10"]}}],["@babel/preset-react",{runtime:"automatic"}]]};
|
||||
|
|
@ -1 +0,0 @@
|
|||
module.exports={javaGit:"<git-url>",javaGitName:"<git-name>",environment:{development:{javaGitBranch:"<branch-name>",API_HOST:"http://192.168.10.56:80"},production:{javaGitBranch:"<branch-name>",API_HOST:"http://192.168.20.100:30140"}},appIdentifier:"basic-info",contextInject:{appKey:"",fileUrl:"https://jpfz.qhdsafety.com/gbsFileTest"},windowInject:{title:"微应用模板",links:[],element:{root:{id:"root"}},scripts:["https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr"]},server:{port:"8080",host:"127.0.0.1",open:!0},framework:{antd:{"ant-prefix":"micro-temp",fontFamily:"PingFangSC-Regular",colorPrimary:"#1677ff",borderRadius:2}},webpackConfig:{htmlWebpackPluginOption:{inject:!0}}};
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,125 +0,0 @@
|
|||
/*!
|
||||
Copyright (c) 2018 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*/
|
||||
|
||||
/*!
|
||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*!
|
||||
* isobject <https://github.com/jonschlinkert/isobject>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
||||
/** @preserve
|
||||
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
||||
* derived from CryptoJS.mode.CTR
|
||||
* Jan Hruby jhruby.web@gmail.com
|
||||
*/
|
||||
|
||||
/** @preserve
|
||||
(c) 2012 by Cédric Mesnil. All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
|
||||
/** */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,79 +0,0 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license React
|
||||
* use-sync-external-store-shim.production.js
|
||||
*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v16.13.1
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
/** @license React v17.0.2
|
||||
* react-is.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
{
|
||||
"name": "micro-app",
|
||||
"version": "2.0.0",
|
||||
"description": "建教帮微应用模板",
|
||||
"author": "JJB",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"serve": "node node_modules/@cqsjjb/scripts/webpack.dev.server.js",
|
||||
"build": "node node_modules/@cqsjjb/scripts/webpack.build.js",
|
||||
"push": "jjb-cmd push java production",
|
||||
"clean-cache": "rimraf node_modules/.cache/webpack",
|
||||
"serve:development": "cross-env NODE_ENV=development npm run serve",
|
||||
"serve:production": "cross-env NODE_ENV=production npm run serve",
|
||||
"build:development": "cross-env NODE_ENV=development npm run build",
|
||||
"build:production": "cross-env NODE_ENV=production npm run build",
|
||||
"code-optimization": "node node_modules/@cqsjjb/scripts/code-optimization.js",
|
||||
"lint": "eslint --ext .js,.jsx,.tsx --fix src"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "latest",
|
||||
"@ant-design/pro-components": "^2.8.10",
|
||||
"@cqsjjb/jjb-common-decorator": "latest",
|
||||
"@cqsjjb/jjb-common-lib": "latest",
|
||||
"@cqsjjb/jjb-dva-runtime": "latest",
|
||||
"@cqsjjb/jjb-react-admin-component": "latest",
|
||||
"ahooks": "^3.9.5",
|
||||
"antd": "latest",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"zy-react-library": "^1.0.118"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^5.4.1",
|
||||
"@babel/plugin-proposal-decorators": "^7.19.3",
|
||||
"@cqsjjb/scripts": "latest",
|
||||
"@eslint-react/eslint-plugin": "^2.2.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^9.37.0",
|
||||
"eslint-plugin-format": "^1.0.2",
|
||||
"eslint-plugin-react-hooks": "^7.0.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.23",
|
||||
"typescript": "^5.9.3"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<!doctype html><html lang="zh"><head data-built-info="@cqsjjb/scripts@2.0.0-alpha-1 Env/production (2025/11/21 10:27:43) App/basic-info"><meta charset="UTF-8"/><meta name="renderer" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/><meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover"><title>--</title><script>(function () {
|
||||
const APP_ENV = {
|
||||
antd: {
|
||||
'ant-prefix': 'micro-temp',
|
||||
fontFamily: 'PingFangSC-Regular',
|
||||
colorPrimary: '#1677ff',
|
||||
borderRadius: parseInt('2')
|
||||
},
|
||||
appKey: '',
|
||||
basename: 'basic-info',
|
||||
API_HOST: 'http://192.168.20.100:30140'
|
||||
};
|
||||
APP_ENV.API_HOST = sessionStorage.API_HOST || APP_ENV.API_HOST || window.location.origin;
|
||||
window.process = {
|
||||
env: { app: APP_ENV },
|
||||
NODE_ENV: 'production'
|
||||
};
|
||||
window.__JJB_ENVIRONMENT__ = {
|
||||
API_HOST: APP_ENV.API_HOST,
|
||||
redirect: '',
|
||||
FRAMEWORK: APP_ENV.antd
|
||||
};
|
||||
})();</script><script src="https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr"></script><script defer="defer" src="/basic-info/static/js/418.e3b78452bf77bb630f75.js"></script><script defer="defer" src="/basic-info/static/js/52.750bdeed068a68dc1077.js"></script><script defer="defer" src="/basic-info/static/js/main.fe2e6eb14455acaa8a20.js"></script><link href="/basic-info/static/css/main.640d8c3fc4701f655c3c.css" rel="stylesheet"></head><body><noscript>此网页需要开启JavaScript功能。</noscript><div id="root" style="width: 100%; height: 100%; position: relative;overflow-y: auto"></div><script type="text/javascript">/* @cqsjjb/script 输出当前应用基本信息、构建时间 */console.log("%c@cqsjjb/scripts@2.0.0-alpha-1 Env/production (2025/11/21 10:27:43) App/basic-info Version/master Java/<branch-name>", "color: #1890ff; border-radius: 2px; padding: 0 4px; border: 1px solid #1890ff; background: #f9fcff")</script></body></html>
|
||||
|
|
@ -16,7 +16,7 @@ module.exports = {
|
|||
// 应用后端分支名称,部署上线需要
|
||||
javaGitBranch: "<branch-name>",
|
||||
// 接口服务地址
|
||||
API_HOST: "http://192.168.20.100:30140",
|
||||
API_HOST: "https://gbs-gateway.qhdsafety.com",
|
||||
},
|
||||
},
|
||||
// 应用唯一标识符
|
||||
|
|
@ -25,8 +25,8 @@ module.exports = {
|
|||
contextInject: {
|
||||
// 应用Key
|
||||
appKey: "",
|
||||
fileUrl: "http://192.168.20.240:9787/mnt/",
|
||||
// fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
|
||||
// fileUrl: "http://192.168.20.240:9787/mnt/",
|
||||
fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
|
||||
},
|
||||
// public/index.html注入全局变量
|
||||
windowInject: {
|
||||
|
|
|
|||
|
|
@ -25,13 +25,13 @@
|
|||
"@cqsjjb/jjb-dva-runtime": "latest",
|
||||
"@cqsjjb/jjb-react-admin-component": "latest",
|
||||
"ahooks": "^3.9.5",
|
||||
"antd": "latest",
|
||||
"antd": "5.27.6",
|
||||
"dayjs": "^1.11.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"qrcode.react": "^4.2.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"zy-react-library": "^1.0.121"
|
||||
"zy-react-library": "^1.0.122"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^5.4.1",
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ export const userEmploymentLogAll = declareRequest(
|
|||
"userLoading",
|
||||
"Get > /basic-info/userEmploymentLog/listAll",
|
||||
);
|
||||
|
||||
export const userChangePassword = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/user/changePassword/{id}",
|
||||
|
|
|
|||
|
|
@ -126,22 +126,21 @@ function Department(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
{addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.businessLicense.corpQualificationLoading}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestAdd={props["corpQualificationInfoAdd"]}
|
||||
requestEdit={props["corpQualificationInfoEdit"]}
|
||||
requestDetails={props["corpQualificationInfoDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.businessLicense.corpQualificationLoading}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestAdd={props["corpQualificationInfoAdd"]}
|
||||
requestEdit={props["corpQualificationInfoEdit"]}
|
||||
requestDetails={props["corpQualificationInfoDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ function Info(props) {
|
|||
const fetchData = async () => {
|
||||
const { data } = await props["userGetInfo"]();
|
||||
console.log(data);
|
||||
|
||||
const res = await props.corpInfoDetails({
|
||||
id: data.corpinfoId,
|
||||
});
|
||||
|
|
@ -62,7 +61,6 @@ function Info(props) {
|
|||
label: "企业状态",
|
||||
children: info.corpStateName,
|
||||
},
|
||||
|
||||
{
|
||||
label: "所属区域",
|
||||
children: info.cityName,
|
||||
|
|
@ -151,7 +149,6 @@ function Info(props) {
|
|||
label: "企事业单位经营地址",
|
||||
children: info.addressBusiness,
|
||||
},
|
||||
|
||||
{
|
||||
label: "营业执照",
|
||||
children: <TooltipPreviewImg files={info.licenseFile} />,
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ 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 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";
|
||||
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
|
|
@ -22,8 +22,7 @@ import {
|
|||
import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
import { useDebounce } from "~/utils"; // 确保路径正确
|
||||
import { useDebounce } from "~/utils";
|
||||
|
||||
const ENTERPRISE_STATUS = [
|
||||
{
|
||||
|
|
@ -74,7 +73,6 @@ function Update(props) {
|
|||
const { loading: deleteFileLoading, deleteFile } = useDeleteFile();
|
||||
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
|
||||
const [codeValue, setCodeValue] = useState("");
|
||||
const [corpNameValue, setCorpNameValue] = useState("");
|
||||
const debouncedCode = useDebounce(codeValue, 600);
|
||||
|
|
@ -90,10 +88,8 @@ function Update(props) {
|
|||
eqForeignKey: data.corpinfoId,
|
||||
});
|
||||
data.INDUSTRYALL = getLastValidCorpTypeName(data);
|
||||
|
||||
data.license = [data.licenseStart, data.licenseEnd];
|
||||
data.scaleType = data.scaleType ?? 0;
|
||||
|
||||
const values = {
|
||||
licenseFile,
|
||||
...data,
|
||||
|
|
@ -122,12 +118,25 @@ function Update(props) {
|
|||
// 校验社会统一信用代码重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCode) {
|
||||
form.setFields([{ name: "code", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "code",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["corplnfoCheckCorpcode"]({ code: debouncedCode, id: queryParams["id"] }).then((res) => {
|
||||
props["corplnfoCheckCorpcode"]({
|
||||
code: debouncedCode,
|
||||
id: queryParams["id"],
|
||||
}).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "code", errors: ["该社会统一信用代码已被其他企业使用"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "code",
|
||||
errors: ["该社会统一信用代码已被其他企业使用"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCode]);
|
||||
|
|
@ -135,24 +144,34 @@ function Update(props) {
|
|||
// 校验企业名称重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCorpName) {
|
||||
form.setFields([{ name: "corpName", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "corpName",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["corplnfoCheckCorpName"]({ corpName: debouncedCorpName, id: queryParams["id"] }).then((res) => {
|
||||
props["corplnfoCheckCorpName"]({
|
||||
corpName: debouncedCorpName,
|
||||
id: queryParams["id"],
|
||||
}).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "corpName", errors: ["企业名称重复"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "corpName",
|
||||
errors: ["企业名称重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCorpName]);
|
||||
|
||||
const onValuesChange = (changed) => {
|
||||
if ("code" in changed)
|
||||
setCodeValue(changed.code ?? "");
|
||||
|
||||
if ("corpName" in changed)
|
||||
setCorpNameValue(changed.corpName ?? "");
|
||||
};
|
||||
|
||||
const onSubmit = async (values) => {
|
||||
await deleteFile({
|
||||
single: false,
|
||||
|
|
@ -230,7 +249,6 @@ function Update(props) {
|
|||
// 全为空则返回空字符串或默认值
|
||||
return "";
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title="编辑" />
|
||||
|
|
@ -241,7 +259,6 @@ function Update(props) {
|
|||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
onValuesChange={onValuesChange}
|
||||
values={{
|
||||
scaleType: 0,
|
||||
whetherHygieneFlag: 0,
|
||||
|
|
@ -304,7 +321,6 @@ function Update(props) {
|
|||
pattern: UNIFIED_SOCIAL_CREDIT_CODE,
|
||||
message: "请输入正确的社会统一信用代码",
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -350,16 +366,10 @@ function Update(props) {
|
|||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
},
|
||||
|
||||
{
|
||||
name: "map",
|
||||
customizeRender: true,
|
||||
render: (
|
||||
<Map
|
||||
required={false}
|
||||
|
||||
/>
|
||||
),
|
||||
render: <Map required={false} />,
|
||||
span: 24,
|
||||
},
|
||||
{
|
||||
|
|
@ -409,12 +419,10 @@ function Update(props) {
|
|||
|
||||
<IndustrySelect
|
||||
onGetNodePaths={(data) => {
|
||||
|
||||
console.log(data);
|
||||
setIndustryData(data);
|
||||
}}
|
||||
/>
|
||||
|
||||
),
|
||||
},
|
||||
{
|
||||
|
|
@ -598,6 +606,7 @@ function Update(props) {
|
|||
span: 6,
|
||||
}}
|
||||
onFinish={onSubmit}
|
||||
onValuesChange={onValuesChange}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
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 useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
|
||||
function Add() {
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ 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 SelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||
|
|
@ -23,7 +23,6 @@ function OrganizationStructure(props) {
|
|||
const [selectedNodeName, setSelectedNodeName] = useState("");
|
||||
const { getUserInfo } = useGetUserInfo();
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const { tableProps, getData } = useTable(props["departmentList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
|
|
@ -34,17 +33,14 @@ function OrganizationStructure(props) {
|
|||
};
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
getUserInfo().then((res) => {
|
||||
setSelectedNodeName(res.departmentName);
|
||||
});
|
||||
};
|
||||
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
const onTreeChange = (selectedKeys, event) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeName(event.node.name);
|
||||
|
|
@ -79,10 +75,7 @@ function OrganizationStructure(props) {
|
|||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree
|
||||
onSelect={onTreeChange}
|
||||
|
||||
/>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
|
|
@ -141,7 +134,7 @@ function OrganizationStructure(props) {
|
|||
dataIndex: "levelName",
|
||||
},
|
||||
{
|
||||
title: "部门分责人",
|
||||
title: "部门负责人",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
},
|
||||
{
|
||||
|
|
@ -182,7 +175,6 @@ function OrganizationStructure(props) {
|
|||
<AddModal
|
||||
open={addModalOpen}
|
||||
loading={props.department.departmentLoading}
|
||||
|
||||
parentId={selectedNodeId}
|
||||
currentId={currentId}
|
||||
requestAdd={props["departmentAdd"]}
|
||||
|
|
@ -235,7 +227,6 @@ function AddModalComponent(props) {
|
|||
message.error("部门排序请输入正整数!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (props.currentId) {
|
||||
values.parentId = props.parentId;
|
||||
values.id = props.currentId;
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@ 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 useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import { NS_POST } from "~/enumerate/namespace";
|
||||
|
||||
// import SelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
|
|
@ -42,7 +43,6 @@ function Post(props) {
|
|||
message.success("删除成功");
|
||||
}
|
||||
});
|
||||
|
||||
getData();
|
||||
},
|
||||
});
|
||||
|
|
@ -79,7 +79,6 @@ function Post(props) {
|
|||
name: "likePostName",
|
||||
label: "岗位名称",
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -161,7 +160,6 @@ function AddModalComponent(props) {
|
|||
const [parentName, setParentName] = useState(null);
|
||||
const [parentId, setParentId] = useState(null);
|
||||
const { getUserInfo } = useGetUserInfo();
|
||||
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props
|
||||
|
|
@ -170,7 +168,6 @@ function AddModalComponent(props) {
|
|||
})
|
||||
.then((res) => {
|
||||
form.setFieldsValue(res.data);
|
||||
|
||||
setParentName(res.data.departmentName);
|
||||
setParentId(res.data.departmentId);
|
||||
});
|
||||
|
|
@ -188,7 +185,6 @@ function AddModalComponent(props) {
|
|||
}
|
||||
}
|
||||
}, [props.currentId, props.selectedNodeName]);
|
||||
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ function Add(props) {
|
|||
const debouncedUserIdCard = useDebounce(userIdCardValue, 600);
|
||||
const debouncedUsernameValue = useDebounce(usernameValue, 600);
|
||||
const debouncedPhoneValueValue = useDebounce(phoneValue, 600);
|
||||
|
||||
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||
useEffect(() => {
|
||||
if (queryParams["id"]) {
|
||||
|
|
@ -151,7 +150,7 @@ function Add(props) {
|
|||
});
|
||||
props["postAll"]({
|
||||
corpFlag: 1,
|
||||
departmentId: event[0].id,
|
||||
departmentId: event[event.length - 1].id,
|
||||
}).then((res) => {
|
||||
setPostData(res.data);
|
||||
});
|
||||
|
|
@ -159,12 +158,25 @@ function Add(props) {
|
|||
// 校验身份证重复
|
||||
useEffect(() => {
|
||||
if (!debouncedUserIdCard) {
|
||||
form.setFields([{ name: "userIdCard", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "userIdCard",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ userIdCard: debouncedUserIdCard, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
props["verifyUser"]({
|
||||
userIdCard: debouncedUserIdCard,
|
||||
id: queryParams["id"] ?? "",
|
||||
}).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "userIdCard", errors: ["身份证号重复"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "userIdCard",
|
||||
errors: ["身份证号重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedUserIdCard]);
|
||||
|
|
@ -172,12 +184,25 @@ function Add(props) {
|
|||
// 校验用户名重复
|
||||
useEffect(() => {
|
||||
if (!debouncedUsernameValue) {
|
||||
form.setFields([{ name: "username", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "username",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ username: debouncedUsernameValue, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
props["verifyUser"]({
|
||||
username: debouncedUsernameValue,
|
||||
id: queryParams["id"] ?? "",
|
||||
}).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "username", errors: ["用户名重复"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "username",
|
||||
errors: ["用户名重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedUsernameValue]);
|
||||
|
|
@ -185,20 +210,31 @@ function Add(props) {
|
|||
// 校验用户名重复
|
||||
useEffect(() => {
|
||||
if (!debouncedPhoneValueValue) {
|
||||
form.setFields([{ name: "phone", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "phone",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ phone: debouncedPhoneValueValue, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
props["verifyUser"]({
|
||||
phone: debouncedPhoneValueValue,
|
||||
id: queryParams["id"] ?? "",
|
||||
}).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "phone", errors: ["手机号重复"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "phone",
|
||||
errors: ["手机号重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedPhoneValueValue]);
|
||||
|
||||
const onValuesChange = (changedValues) => {
|
||||
if ("userIdCard" in changedValues) {
|
||||
const newIdCard = changedValues.userIdCard;
|
||||
|
||||
setUserIdCardValue(newIdCard ?? "");
|
||||
if (newIdCard) {
|
||||
form.setFieldValue("sex", idCardGetDateAndGender(newIdCard).sex);
|
||||
|
|
@ -221,7 +257,6 @@ function Add(props) {
|
|||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
onValuesChange={onValuesChange}
|
||||
values={{
|
||||
departmentLeaderFlag: "0",
|
||||
}}
|
||||
|
|
@ -381,6 +416,7 @@ function Add(props) {
|
|||
span: 6,
|
||||
}}
|
||||
onFinish={onSubmit}
|
||||
onValuesChange={onValuesChange}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ 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 TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
|
||||
import useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
|
||||
import useImportFile from "zy-react-library/hooks/useImportFile";
|
||||
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
|
|
@ -33,7 +33,6 @@ function List(props) {
|
|||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
userType: 2,
|
||||
allFlag: 1,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -200,32 +199,28 @@ function List(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
{importOpen
|
||||
&& (
|
||||
<ImportFile
|
||||
visible={importOpen}
|
||||
templateUrl=""
|
||||
onCancel={() => {
|
||||
setImportOpen(false);
|
||||
}}
|
||||
onConfirm={onImportFileConfirm}
|
||||
/>
|
||||
)}
|
||||
{
|
||||
addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
{importOpen && (
|
||||
<ImportFile
|
||||
visible={importOpen}
|
||||
templateUrl={`${process.env.app["fileUrl"]}template/user_template.xlsx`}
|
||||
onCancel={() => {
|
||||
setImportOpen(false);
|
||||
}}
|
||||
onConfirm={onImportFileConfirm}
|
||||
/>
|
||||
)}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -238,7 +233,11 @@ function AddModalComponent(props) {
|
|||
const res = await props.requestDetails({
|
||||
id: props.currentId,
|
||||
});
|
||||
res.data.userAvatarUrl = [{ filePath: res.data.userAvatarUrl }];
|
||||
res.data.userAvatarUrl = [
|
||||
{
|
||||
filePath: res.data.userAvatarUrl,
|
||||
},
|
||||
];
|
||||
console.log(res.data);
|
||||
setInfo(res.data);
|
||||
};
|
||||
|
|
@ -315,7 +314,12 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: idCardGetDateAndGender(info.userIdCard).sex === "1" ? "男" : idCardGetDateAndGender(info.userIdCard).sex === "0" ? "女" : "",
|
||||
children:
|
||||
idCardGetDateAndGender(info.userIdCard).sex === "1"
|
||||
? "男"
|
||||
: idCardGetDateAndGender(info.userIdCard).sex === "0"
|
||||
? "女"
|
||||
: "",
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
|
|
|
|||
|
|
@ -1,33 +1,35 @@
|
|||
import React from 'react';
|
||||
import { ImportCore } from "@cqsjjb/jjb-common-decorator/module";
|
||||
|
||||
import { ImportCore } from '@cqsjjb/jjb-common-decorator/module';
|
||||
import React from "react";
|
||||
|
||||
export default class Entry extends React.Component {
|
||||
state = {
|
||||
Component: undefined
|
||||
Component: undefined,
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
if (process.env.app.appKey) {
|
||||
ImportCore({
|
||||
name: '$',
|
||||
from: 'https://cdn.cqjjb.cn/jcloud/use/plugin/b31c9840a57f11ef91cf7f3cabbb7484/latest'
|
||||
}).then(res => {
|
||||
name: "$",
|
||||
from: "https://cdn.cqjjb.cn/jcloud/use/plugin/b31c9840a57f11ef91cf7f3cabbb7484/latest",
|
||||
}).then((res) => {
|
||||
if (res.status) {
|
||||
this.setState({
|
||||
Component: res.module?.default
|
||||
Component: res.module?.default,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { Component } = this.state;
|
||||
return (
|
||||
Component &&
|
||||
process.env.app.appKey && (
|
||||
Component
|
||||
&& process.env.app.appKey && (
|
||||
<Component
|
||||
detail={{
|
||||
componentKey: process.env.app.appKey
|
||||
componentKey: process.env.app.appKey,
|
||||
}}
|
||||
appKey={process.env.app.appKey}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -125,22 +125,21 @@ function Department(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
{ addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,31 +90,27 @@ function Qualification() {
|
|||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
{addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{
|
||||
previewOpen
|
||||
&& (
|
||||
<PreviewModal
|
||||
src={previewSrc}
|
||||
open={previewOpen}
|
||||
onCancel={() => {
|
||||
setPreviewOpen(false);
|
||||
setPreviewSrc("");
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{previewOpen && (
|
||||
<PreviewModal
|
||||
src={previewSrc}
|
||||
open={previewOpen}
|
||||
onCancel={() => {
|
||||
setPreviewOpen(false);
|
||||
setPreviewSrc("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,59 +1,58 @@
|
|||
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 DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
import Map from 'zy-react-library/components/Map';
|
||||
import Upload from 'zy-react-library/components/Upload';
|
||||
import useGetFile from 'zy-react-library/hooks/useGetFile';
|
||||
import FormBuilder from 'zy-react-library/components/FormBuilder';
|
||||
import useDeleteFile from 'zy-react-library/hooks/useDeleteFile';
|
||||
import useUploadFile from 'zy-react-library/hooks/useUploadFile';
|
||||
import IndustrySelect from 'zy-react-library/components/SelectTree/Industry';
|
||||
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";
|
||||
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
|
||||
import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
||||
import { Connect } from '@cqsjjb/jjb-dva-runtime';
|
||||
import { getLabelName } from 'zy-react-library/utils';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { FORM_ITEM_RENDER_ENUM } from 'zy-react-library/enum/formItemRender';
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from 'zy-react-library/enum/uploadFile/gwj';
|
||||
import { Button, Form, message, Modal, QRCode } from 'antd';
|
||||
import {
|
||||
PHONE,
|
||||
POSTAL_CODE,
|
||||
UNIFIED_SOCIAL_CREDIT_CODE,
|
||||
} from "zy-react-library/regular";
|
||||
UNIFIED_SOCIAL_CREDIT_CODE
|
||||
} from 'zy-react-library/regular';
|
||||
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
import { useDebounce } from "~/utils";
|
||||
import { useDebounce } from '~/utils';
|
||||
import { NS_ENTERPRISE } from '~/enumerate/namespace';
|
||||
|
||||
const ENTERPRISE_STATUS = [
|
||||
{
|
||||
bianma: "filialstate01",
|
||||
name: "在产",
|
||||
bianma: 'filialstate01',
|
||||
name: '在产'
|
||||
},
|
||||
{
|
||||
bianma: "filialstate02",
|
||||
name: "在建",
|
||||
bianma: 'filialstate02',
|
||||
name: '在建'
|
||||
},
|
||||
{
|
||||
bianma: "filialstate03",
|
||||
name: "代建",
|
||||
bianma: 'filialstate03',
|
||||
name: '代建'
|
||||
},
|
||||
{
|
||||
bianma: "filialstate04",
|
||||
name: "停产",
|
||||
bianma: 'filialstate04',
|
||||
name: '停产'
|
||||
},
|
||||
{
|
||||
bianma: "filialstate05",
|
||||
name: "破产",
|
||||
},
|
||||
bianma: 'filialstate05',
|
||||
name: '破产'
|
||||
}
|
||||
];
|
||||
const WHETHER_ENUM = [
|
||||
{
|
||||
bianma: 1,
|
||||
name: "是",
|
||||
name: '是'
|
||||
},
|
||||
{
|
||||
bianma: 0,
|
||||
name: "否",
|
||||
},
|
||||
name: '否'
|
||||
}
|
||||
];
|
||||
// const xgfStateMap = {
|
||||
// 0: "未填报",
|
||||
|
|
@ -75,83 +74,85 @@ function CorpInfo(props) {
|
|||
const [industryData, setIndustryData] = useState([]);
|
||||
const [cityData, setCityData] = useState([]);
|
||||
const [info, setInfoData] = useState([]);
|
||||
|
||||
const [codeValue, setCodeValue] = useState("");
|
||||
const [corpNameValue, setCorpNameValue] = useState("");
|
||||
const [codeValue, setCodeValue] = useState('');
|
||||
const [corpNameValue, setCorpNameValue] = useState('');
|
||||
const debouncedCode = useDebounce(codeValue, 600);
|
||||
const debouncedCorpName = useDebounce(corpNameValue, 600);
|
||||
|
||||
function getLastValidCorpTypeName(item) {
|
||||
// 按层级顺序排列
|
||||
const names = [
|
||||
item.corpType,
|
||||
item.corpType2,
|
||||
item.corpType3,
|
||||
item.corpType4,
|
||||
item.corpType4
|
||||
];
|
||||
|
||||
// 从后往前找第一个非空值
|
||||
for (let i = names.length - 1; i >= 0; i--) {
|
||||
if (names[i] != null && names[i] !== "") {
|
||||
if (names[i] != null && names[i] !== '') {
|
||||
return names[i];
|
||||
}
|
||||
}
|
||||
|
||||
// 全为空则返回空字符串或默认值
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props["userGetInfo"]();
|
||||
|
||||
const { data } = await props["corpInfoDetails"]({ id: res.data.corpinfoId });
|
||||
const res = await props['userGetInfo']();
|
||||
const { data } = await props['corpInfoDetails']({
|
||||
id: res.data.corpinfoId
|
||||
});
|
||||
setInfoData(data);
|
||||
setKeyId({ id: res.data.corpinfoId, corpinfoId: res.data.userId });
|
||||
setKeyId({
|
||||
id: res.data.corpinfoId,
|
||||
corpinfoId: res.data.userId
|
||||
});
|
||||
const licenseFile = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: res.data.userId ? res.data.userId : "",
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM['6'],
|
||||
eqForeignKey: res.data.userId ? res.data.userId : ''
|
||||
});
|
||||
data.INDUSTRYALL = getLastValidCorpTypeName(data);
|
||||
data.license = [data.licenseStart, data.licenseEnd];
|
||||
data.scaleType = data.scaleType ?? 0;
|
||||
const values = {
|
||||
licenseFile,
|
||||
...data,
|
||||
...data
|
||||
};
|
||||
form.setFieldsValue({
|
||||
...values,
|
||||
...values
|
||||
});
|
||||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
const onSubmit = async (values) => {
|
||||
const onSubmit = async values => {
|
||||
await deleteFile({
|
||||
single: false,
|
||||
files: deleteHiddenImageFiles,
|
||||
files: deleteHiddenImageFiles
|
||||
});
|
||||
values.ecoTypeName = getLabelName({
|
||||
status: values.ecoType,
|
||||
list: ecoTypeData,
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
idKey: 'dictValue',
|
||||
nameKey: 'dictLabel'
|
||||
});
|
||||
values.scaleName = getLabelName({
|
||||
status: values.scale,
|
||||
list: scaleData,
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
idKey: 'dictValue',
|
||||
nameKey: 'dictLabel'
|
||||
});
|
||||
values.corpStateName = getLabelName({
|
||||
status: values.corpState,
|
||||
list: ENTERPRISE_STATUS,
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
idKey: 'dictValue',
|
||||
nameKey: 'dictLabel'
|
||||
});
|
||||
values.cityName = getLabelName({
|
||||
status: values.city,
|
||||
list: cityData,
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
idKey: 'dictValue',
|
||||
nameKey: 'dictLabel'
|
||||
});
|
||||
if (industryData.length > 0) {
|
||||
values.corpType = industryData[0].dict_value;
|
||||
|
|
@ -167,18 +168,18 @@ function CorpInfo(props) {
|
|||
single: false,
|
||||
files: values.licenseFile,
|
||||
params: {
|
||||
type: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
foreignKey: keyId.corpinfoId,
|
||||
},
|
||||
type: UPLOAD_FILE_TYPE_ENUM['6'],
|
||||
foreignKey: keyId.corpinfoId
|
||||
}
|
||||
});
|
||||
values.corpinfoId = keyId.corpinfoId;
|
||||
values.id = keyId.id;
|
||||
values.licenseStart = values.license[0];
|
||||
values.licenseEnd = values.license[1];
|
||||
delete values.license;
|
||||
props["corpInfoEdit"](values).then((res) => {
|
||||
props['corpInfoEdit'](values).then(res => {
|
||||
if (res.success) {
|
||||
message.success("操作成功!");
|
||||
message.success('操作成功!');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -186,12 +187,25 @@ function CorpInfo(props) {
|
|||
// 校验社会统一信用代码重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCode) {
|
||||
form.setFields([{ name: "code", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: 'code',
|
||||
errors: []
|
||||
}
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["corplnfoCheckCorpcode"]({ code: debouncedCode, id: keyId.id }).then((res) => {
|
||||
props['corplnfoCheckCorpcode']({
|
||||
code: debouncedCode,
|
||||
id: keyId.id
|
||||
}).then(res => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "code", errors: ["该社会统一信用代码已被其他企业使用"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: 'code',
|
||||
errors: ['该社会统一信用代码已被其他企业使用']
|
||||
}
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCode]);
|
||||
|
|
@ -199,246 +213,253 @@ function CorpInfo(props) {
|
|||
// 校验企业名称重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCorpName) {
|
||||
form.setFields([{ name: "corpName", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: 'corpName',
|
||||
errors: []
|
||||
}
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["corplnfoCheckCorpName"]({ corpName: debouncedCorpName, id: keyId.id }).then((res) => {
|
||||
props['corplnfoCheckCorpName']({
|
||||
corpName: debouncedCorpName,
|
||||
id: keyId.id
|
||||
}).then(res => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "corpName", errors: ["企业名称重复"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: 'corpName',
|
||||
errors: ['企业名称重复']
|
||||
}
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCorpName]);
|
||||
|
||||
const onValuesChange = (changed) => {
|
||||
if ("code" in changed)
|
||||
setCodeValue(changed.code ?? "");
|
||||
|
||||
if ("corpName" in changed)
|
||||
setCorpNameValue(changed.corpName ?? "");
|
||||
const onValuesChange = changed => {
|
||||
if ('code' in changed) setCodeValue(changed.code ?? '');
|
||||
if ('corpName' in changed) setCorpNameValue(changed.corpName ?? '');
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
style={{
|
||||
paddingBottom: 10,
|
||||
paddingBottom: 10
|
||||
}}
|
||||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
onValuesChange={onValuesChange}
|
||||
loading={
|
||||
deleteFileLoading
|
||||
|| uploadFileLoading
|
||||
|| getFileLoading
|
||||
|| props.enterprise.enterpriseLoading
|
||||
deleteFileLoading ||
|
||||
uploadFileLoading ||
|
||||
getFileLoading ||
|
||||
props.enterprise.enterpriseLoading
|
||||
}
|
||||
options={[
|
||||
{
|
||||
label: "基本信息",
|
||||
render: FORM_ITEM_RENDER_ENUM.DIVIDER,
|
||||
label: '基本信息',
|
||||
render: FORM_ITEM_RENDER_ENUM.DIVIDER
|
||||
},
|
||||
{
|
||||
label: "企业名称",
|
||||
name: "corpName",
|
||||
label: '企业名称',
|
||||
name: 'corpName',
|
||||
span: 24,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
name: "corpState",
|
||||
label: '企业状态',
|
||||
name: 'corpState',
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "社会统一信用代码",
|
||||
name: "code",
|
||||
label: '社会统一信用代码',
|
||||
name: 'code',
|
||||
rules: [
|
||||
{
|
||||
pattern: UNIFIED_SOCIAL_CREDIT_CODE,
|
||||
message: "请输入正确的社会统一信用代码",
|
||||
},
|
||||
],
|
||||
message: '请输入正确的社会统一信用代码'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "所属区域",
|
||||
label: '所属区域',
|
||||
required: false,
|
||||
name: "city",
|
||||
name: 'city',
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="res_region_enum"
|
||||
onGetData={(data) => {
|
||||
onGetData={data => {
|
||||
setCityData(data);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "邮政编码",
|
||||
name: "postalCode",
|
||||
label: '邮政编码',
|
||||
name: 'postalCode',
|
||||
required: false,
|
||||
rules: [
|
||||
{
|
||||
pattern: POSTAL_CODE,
|
||||
message: "请输入正确的邮政编码",
|
||||
},
|
||||
],
|
||||
message: '请输入正确的邮政编码'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "规模",
|
||||
name: "scale",
|
||||
label: '规模',
|
||||
name: 'scale',
|
||||
required: false,
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="scale"
|
||||
onGetData={(data) => {
|
||||
onGetData={data => {
|
||||
setScaleData(data);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "成立时间",
|
||||
name: "createDate",
|
||||
label: '成立时间',
|
||||
name: 'createDate',
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE
|
||||
},
|
||||
{
|
||||
name: "map",
|
||||
name: 'map',
|
||||
customizeRender: true,
|
||||
render: <Map required={false} />,
|
||||
span: 24,
|
||||
span: 24
|
||||
},
|
||||
{
|
||||
label: "职工人数",
|
||||
name: "employees",
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
label: '职工人数',
|
||||
name: 'employees',
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER
|
||||
},
|
||||
{
|
||||
label: "占地面积(㎡)",
|
||||
name: "areaCovered",
|
||||
label: '占地面积(㎡)',
|
||||
name: 'areaCovered',
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER
|
||||
},
|
||||
{
|
||||
label: "注册资金(万元)",
|
||||
name: "regcapital",
|
||||
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: 'totalAssets',
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER
|
||||
},
|
||||
{
|
||||
label: "经济类型",
|
||||
name: "ecoType",
|
||||
label: '经济类型',
|
||||
name: 'ecoType',
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="ECO_TYPE"
|
||||
onGetData={(data) => {
|
||||
onGetData={data => {
|
||||
setEcoTypeData(data);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "所属行业",
|
||||
name: "INDUSTRYALL",
|
||||
label: '所属行业',
|
||||
name: 'INDUSTRYALL',
|
||||
render: (
|
||||
<IndustrySelect
|
||||
onGetNodePaths={(data) => {
|
||||
onGetNodePaths={data => {
|
||||
console.log(data);
|
||||
setIndustryData(data);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "法定代表人",
|
||||
name: "lrName",
|
||||
required: false,
|
||||
label: '法定代表人',
|
||||
name: 'lrName',
|
||||
required: false
|
||||
},
|
||||
{
|
||||
label: "法人手机号",
|
||||
name: "lrMobile",
|
||||
label: '法人手机号',
|
||||
name: 'lrMobile',
|
||||
required: false,
|
||||
rules: [
|
||||
{
|
||||
pattern: PHONE,
|
||||
message: "请输入正确的手机号",
|
||||
},
|
||||
],
|
||||
message: '请输入正确的手机号'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "主要负责人",
|
||||
name: "contacts",
|
||||
label: '主要负责人',
|
||||
name: 'contacts'
|
||||
},
|
||||
{
|
||||
label: "主要负责人手机号",
|
||||
name: "contactsPhone",
|
||||
label: '主要负责人手机号',
|
||||
name: 'contactsPhone',
|
||||
rules: [
|
||||
{
|
||||
pattern: PHONE,
|
||||
message: "请输入正确的手机号",
|
||||
},
|
||||
],
|
||||
message: '请输入正确的手机号'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "安全负责人",
|
||||
name: "safetyName",
|
||||
required: false,
|
||||
label: '安全负责人',
|
||||
name: 'safetyName',
|
||||
required: false
|
||||
},
|
||||
{
|
||||
label: "安全负责人电话手机号",
|
||||
name: "safetyPhone",
|
||||
label: '安全负责人电话手机号',
|
||||
name: 'safetyPhone',
|
||||
required: false,
|
||||
rules: [
|
||||
{
|
||||
pattern: PHONE,
|
||||
message: "请输入正确的手机号",
|
||||
},
|
||||
],
|
||||
message: '请输入正确的手机号'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "是否规模以上",
|
||||
name: "scaleType",
|
||||
label: '是否规模以上',
|
||||
name: 'scaleType',
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
items: WHETHER_ENUM
|
||||
},
|
||||
{
|
||||
label: "企事业单位经营地址",
|
||||
name: "addressBusiness",
|
||||
label: '企事业单位经营地址',
|
||||
name: 'addressBusiness'
|
||||
},
|
||||
{
|
||||
label: "营业执照",
|
||||
name: "licenseFile",
|
||||
label: '营业执照',
|
||||
name: 'licenseFile',
|
||||
render: (
|
||||
<Upload
|
||||
onGetRemoveFile={(file) => {
|
||||
onGetRemoveFile={file => {
|
||||
setDeleteHiddenImageFiles([
|
||||
...deleteHiddenImageFiles,
|
||||
file,
|
||||
file
|
||||
]);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "营业执照有效期",
|
||||
name: "license",
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
|
||||
label: '营业执照有效期',
|
||||
name: 'license',
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE
|
||||
},
|
||||
{
|
||||
name: "qrCode",
|
||||
label: "企业二维码",
|
||||
name: 'qrCode',
|
||||
label: '企业二维码',
|
||||
required: false,
|
||||
render: (
|
||||
<Button
|
||||
|
|
@ -449,26 +470,26 @@ function CorpInfo(props) {
|
|||
>
|
||||
查看
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
)
|
||||
}
|
||||
// { label: "单位资质信息", render: FORM_ITEM_RENDER_ENUM.DIVIDER },
|
||||
// { name: "qualification", customizeRender: true, span: 24, render: <Qualification /> },
|
||||
]}
|
||||
onFinish={onSubmit}
|
||||
onValuesChange={onValuesChange}
|
||||
/>
|
||||
</div>
|
||||
{ corpInfoQrCodeOpen
|
||||
&& (
|
||||
<CorpInfoQrCode
|
||||
open={corpInfoQrCodeOpen}
|
||||
row={info}
|
||||
onCancel={() => setCorpInfoQrCodeOpen(false)}
|
||||
/>
|
||||
)}
|
||||
{corpInfoQrCodeOpen && (
|
||||
<CorpInfoQrCode
|
||||
row={info}
|
||||
open={corpInfoQrCodeOpen}
|
||||
onCancel={() => setCorpInfoQrCodeOpen(false)}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
const CorpInfoQrCode = (props) => {
|
||||
const CorpInfoQrCode = props => {
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
|
|
@ -479,14 +500,17 @@ const CorpInfoQrCode = (props) => {
|
|||
onClick={props.onCancel}
|
||||
>
|
||||
关闭
|
||||
</Button>,
|
||||
</Button>
|
||||
]}
|
||||
onCancel={props.onCancel}
|
||||
>
|
||||
<QRCode
|
||||
value={JSON.stringify({ corpName: props.row.corpName, corpinfoId: props.row.corpinfoId })}
|
||||
value={JSON.stringify({
|
||||
corpName: props.row.corpName,
|
||||
corpinfoId: props.row.corpinfoId
|
||||
})}
|
||||
style={{
|
||||
margin: "0 auto",
|
||||
margin: '0 auto'
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ 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 SelectTree from "zy-react-library/components/SelectTree/Department/Gwj";
|
||||
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { NS_DEPARTMENT } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
|
|
@ -22,7 +22,6 @@ function Department(props) {
|
|||
const [selectedNodeId, setSelectedNodeId] = useState(null);
|
||||
const [selectedNodeName, setSelectedNodeName] = useState("");
|
||||
const { getUserInfo } = useGetUserInfo();
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["departmentList"], {
|
||||
form,
|
||||
|
|
@ -39,7 +38,6 @@ function Department(props) {
|
|||
setSelectedNodeName(res.departmentName);
|
||||
});
|
||||
};
|
||||
|
||||
fetchData();
|
||||
}, []);
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
|
|
@ -130,7 +128,7 @@ function Department(props) {
|
|||
),
|
||||
},
|
||||
{
|
||||
title: "部门分责人",
|
||||
title: "部门负责人",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import {Form, Tag} from "antd";
|
||||
import { Form, Tag } from "antd";
|
||||
import { useState } from "react";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import {Form, Tag} from "antd";
|
||||
import { Form, Tag } from "antd";
|
||||
import { useState } from "react";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
|||
import nation from "zy-react-library/json/nation.json";
|
||||
import { ID_NUMBER } from "zy-react-library/regular";
|
||||
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
import { getAgeByIdCard, getBirthDateFromIdCard, useDebounce } from "~/utils";
|
||||
|
||||
|
|
@ -170,12 +171,25 @@ function Add(props) {
|
|||
// 校验身份证重复
|
||||
useEffect(() => {
|
||||
if (!debouncedUserIdCard) {
|
||||
form.setFields([{ name: "userIdCard", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "userIdCard",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ userIdCard: debouncedUserIdCard, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
props["verifyUser"]({
|
||||
userIdCard: debouncedUserIdCard,
|
||||
id: queryParams["id"] ?? "",
|
||||
}).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "userIdCard", errors: ["身份证号重复"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "userIdCard",
|
||||
errors: ["身份证号重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedUserIdCard]);
|
||||
|
|
@ -183,12 +197,25 @@ function Add(props) {
|
|||
// 校验用户名重复
|
||||
useEffect(() => {
|
||||
if (!debouncedUsernameValue) {
|
||||
form.setFields([{ name: "username", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "username",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ username: debouncedUsernameValue, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
props["verifyUser"]({
|
||||
username: debouncedUsernameValue,
|
||||
id: queryParams["id"] ?? "",
|
||||
}).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "username", errors: ["用户名重复"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "username",
|
||||
errors: ["用户名重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedUsernameValue]);
|
||||
|
|
@ -196,16 +223,28 @@ function Add(props) {
|
|||
// 校验用户名重复
|
||||
useEffect(() => {
|
||||
if (!debouncedPhoneValueValue) {
|
||||
form.setFields([{ name: "phone", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "phone",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ phone: debouncedPhoneValueValue, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
props["verifyUser"]({
|
||||
phone: debouncedPhoneValueValue,
|
||||
id: queryParams["id"] ?? "",
|
||||
}).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "phone", errors: ["手机号重复"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "phone",
|
||||
errors: ["手机号重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedPhoneValueValue]);
|
||||
|
||||
const onValuesChange = (changedValues) => {
|
||||
if ("userIdCard" in changedValues) {
|
||||
const newIdCard = changedValues.userIdCard;
|
||||
|
|
@ -233,8 +272,6 @@ function Add(props) {
|
|||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
|
||||
onValuesChange={onValuesChange}
|
||||
loading={
|
||||
deleteFileLoading
|
||||
|| uploadFileLoading
|
||||
|
|
@ -322,7 +359,6 @@ function Add(props) {
|
|||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
name: "email",
|
||||
label: "电子邮箱",
|
||||
|
|
@ -364,7 +400,6 @@ function Add(props) {
|
|||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
name: "locationAddress",
|
||||
|
|
@ -562,6 +597,7 @@ function Add(props) {
|
|||
// },
|
||||
]}
|
||||
onFinish={onSubmit}
|
||||
onValuesChange={onValuesChange}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ 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 DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
|
|
@ -27,7 +27,6 @@ function List(props) {
|
|||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
userType: 3,
|
||||
allFlag: 1,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -100,12 +99,7 @@ function List(props) {
|
|||
{
|
||||
name: "eqPersonnelType",
|
||||
label: "人员类型",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="renyuanleixing"
|
||||
|
||||
/>
|
||||
),
|
||||
render: <DictionarySelect dictValue="renyuanleixing" />,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
|
|
@ -208,21 +202,18 @@ function List(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
{
|
||||
addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -292,7 +283,12 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: idCardGetDateAndGender(info.userIdCard).sex === "1" ? "男" : idCardGetDateAndGender(info.userIdCard).sex === "0" ? "女" : "",
|
||||
children:
|
||||
idCardGetDateAndGender(info.userIdCard).sex === "1"
|
||||
? "男"
|
||||
: idCardGetDateAndGender(info.userIdCard).sex === "0"
|
||||
? "女"
|
||||
: "",
|
||||
},
|
||||
{
|
||||
label: "出生年月",
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ 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 { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
|
||||
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
|
@ -204,22 +204,21 @@ function Department(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
{addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ 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 { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
|
||||
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
|
@ -215,25 +215,22 @@ function Department(props) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{
|
||||
addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
getData={getData}
|
||||
dictData={props["dictData"]}
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
getData={getData}
|
||||
dictData={props["dictData"]}
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
@ -316,7 +313,9 @@ function AddModalComponent(props) {
|
|||
const newIdCard = changedValues.qualificationinfoCategory;
|
||||
if (newIdCard) {
|
||||
setOperatingProjectType(newIdCard);
|
||||
form.setFieldsValue({ operatingProject: undefined });
|
||||
form.setFieldsValue({
|
||||
operatingProject: undefined,
|
||||
});
|
||||
console.log(newIdCard);
|
||||
}
|
||||
}
|
||||
|
|
@ -338,7 +337,6 @@ function AddModalComponent(props) {
|
|||
values={{
|
||||
securityFlag: 0,
|
||||
}}
|
||||
onValuesChange={onValuesChange}
|
||||
options={[
|
||||
{
|
||||
name: "qualificationName",
|
||||
|
|
@ -398,6 +396,7 @@ function AddModalComponent(props) {
|
|||
}}
|
||||
showActionButtons={false}
|
||||
onFinish={onSubmit}
|
||||
onValuesChange={onValuesChange}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ 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 { useDebounce } from "~/utils";
|
||||
|
||||
|
|
@ -295,27 +296,25 @@ function List(props) {
|
|||
{...tableProps}
|
||||
/>
|
||||
|
||||
{addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loading={props.enterprise.enterpriseLoading}
|
||||
getData={getData}
|
||||
openType={openType}
|
||||
currentId={currentId}
|
||||
requestAdd={props["corpInfoAdd"]}
|
||||
requestEdit={props["corpInfoEdit"]}
|
||||
requestDetails={props["corpInfoDetails"]}
|
||||
requestChangeCompanyName={props["corpInfoChangeCompanyName"]}
|
||||
requestCorplnfoCheckCorpcode={props["corplnfoCheckCorpcode"]}
|
||||
requestCorplnfoCheckCorpName={props["corplnfoCheckCorpName"]}
|
||||
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loading={props.enterprise.enterpriseLoading}
|
||||
getData={getData}
|
||||
openType={openType}
|
||||
currentId={currentId}
|
||||
requestAdd={props["corpInfoAdd"]}
|
||||
requestEdit={props["corpInfoEdit"]}
|
||||
requestDetails={props["corpInfoDetails"]}
|
||||
requestChangeCompanyName={props["corpInfoChangeCompanyName"]}
|
||||
requestCorplnfoCheckCorpcode={props["corplnfoCheckCorpcode"]}
|
||||
requestCorplnfoCheckCorpName={props["corplnfoCheckCorpName"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -362,34 +361,62 @@ function AddModalComponent(props) {
|
|||
// 校验社会统一信用代码重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCode) {
|
||||
form.setFields([{ name: "code", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "code",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props.requestCorplnfoCheckCorpcode({ code: debouncedCode, id: props.currentId }).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "code", errors: ["该社会统一信用代码已被其他企业使用"] }]);
|
||||
}
|
||||
});
|
||||
props
|
||||
.requestCorplnfoCheckCorpcode({
|
||||
code: debouncedCode,
|
||||
id: props.currentId,
|
||||
})
|
||||
.then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([
|
||||
{
|
||||
name: "code",
|
||||
errors: ["该社会统一信用代码已被其他企业使用"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCode]);
|
||||
|
||||
// 校验企业名称重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCorpName) {
|
||||
form.setFields([{ name: "corpName", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "corpName",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props.requestCorplnfoCheckCorpName({ corpName: debouncedCorpName, id: props.currentId }).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "corpName", errors: ["企业名称重复"] }]);
|
||||
}
|
||||
});
|
||||
props
|
||||
.requestCorplnfoCheckCorpName({
|
||||
corpName: debouncedCorpName,
|
||||
id: props.currentId,
|
||||
})
|
||||
.then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([
|
||||
{
|
||||
name: "corpName",
|
||||
errors: ["企业名称重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCorpName]);
|
||||
|
||||
const onValuesChange = (changed) => {
|
||||
console.log(changed);
|
||||
if ("code" in changed)
|
||||
setCodeValue(changed.code ?? "");
|
||||
|
||||
if ("corpName" in changed)
|
||||
setCorpNameValue(changed.corpName ?? "");
|
||||
};
|
||||
|
|
@ -398,15 +425,12 @@ function AddModalComponent(props) {
|
|||
open={props.open}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
span={24}
|
||||
|
||||
onValuesChange={onValuesChange}
|
||||
loading={props.loading}
|
||||
options={[
|
||||
{
|
||||
|
|
@ -468,6 +492,7 @@ function AddModalComponent(props) {
|
|||
}}
|
||||
showActionButtons={false}
|
||||
onFinish={onSubmit}
|
||||
onValuesChange={onValuesChange}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ 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,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ const BRANCH_CONPANY_STATUS = [
|
|||
name: "破产",
|
||||
},
|
||||
];
|
||||
|
||||
const STATUS = [
|
||||
{
|
||||
bianma: 1,
|
||||
|
|
@ -140,7 +139,13 @@ function List(props) {
|
|||
title: "状态",
|
||||
dataIndex: "corpOrder",
|
||||
render: (_, record) => (
|
||||
<div>{record.useFlag === 0 ? "停用" : record.useFlag === 1 ? "启用" : ""}</div>
|
||||
<div>
|
||||
{record.useFlag === 0
|
||||
? "停用"
|
||||
: record.useFlag === 1
|
||||
? "启用"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { Button, Descriptions, Form, Modal, Space } from "antd";
|
|||
import { useEffect, useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
|
@ -31,7 +32,6 @@ function View(props) {
|
|||
};
|
||||
return (
|
||||
<div>
|
||||
|
||||
<HeaderBack title="查看" />
|
||||
<div
|
||||
style={{
|
||||
|
|
@ -44,7 +44,12 @@ function View(props) {
|
|||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} params={{ eqCorpinfoId: queryParams["id"] }} />
|
||||
<LeftTree
|
||||
params={{
|
||||
eqCorpinfoId: queryParams["id"],
|
||||
}}
|
||||
onSelect={onTreeChange}
|
||||
/>
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
|
|
@ -61,7 +66,7 @@ function View(props) {
|
|||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "部门分责人",
|
||||
title: "部门负责人",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ function List(props) {
|
|||
};
|
||||
},
|
||||
});
|
||||
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [selectedLng, setSelectedLng] = useState("");
|
||||
const [selectedLat, setSelectedLat] = useState("");
|
||||
|
|
@ -88,7 +87,12 @@ function List(props) {
|
|||
rowData.latitude = lat;
|
||||
rowData.longitude = lng;
|
||||
rowData.areaCode = extra.area;
|
||||
rowData.areaName = extra.area === "1" ? "东港区" : extra.area === "2" ? "西港区" : "";
|
||||
rowData.areaName
|
||||
= extra.area === "1"
|
||||
? "东港区"
|
||||
: extra.area === "2"
|
||||
? "西港区"
|
||||
: "";
|
||||
props["corpInfoEdit"](rowData).then((res) => {
|
||||
if (res.errMessage) {
|
||||
message.success("定位成功!");
|
||||
|
|
@ -272,14 +276,13 @@ function List(props) {
|
|||
{...tableProps}
|
||||
/>
|
||||
<MapSelector
|
||||
showArea
|
||||
area={rowData.areaCode}
|
||||
visible={visible}
|
||||
latitude={selectedLat}
|
||||
longitude={selectedLng}
|
||||
showArea
|
||||
area={rowData.areaCode}
|
||||
onClose={() => setVisible(false)}
|
||||
onConfirm={handleConfirm}
|
||||
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ 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 { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
function View(props) {
|
||||
|
|
@ -33,7 +33,6 @@ function View(props) {
|
|||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: res.data.corpinfoId,
|
||||
});
|
||||
|
||||
res.data.licenseFile = licenseFile;
|
||||
setInfo(res.data);
|
||||
};
|
||||
|
|
@ -48,7 +47,6 @@ function View(props) {
|
|||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
|
||||
items={[
|
||||
{
|
||||
label: "企业名称",
|
||||
|
|
@ -58,7 +56,6 @@ function View(props) {
|
|||
label: "企业名称",
|
||||
children: info.corpName && info.corpName,
|
||||
},
|
||||
|
||||
{
|
||||
label: "统一社会信用代码",
|
||||
children: info.code,
|
||||
|
|
@ -91,7 +88,6 @@ function View(props) {
|
|||
</div>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
label: "经度",
|
||||
children: info.longitude,
|
||||
|
|
@ -148,7 +144,6 @@ function View(props) {
|
|||
label: "安全负责人手机号",
|
||||
children: info.safetyPhone,
|
||||
},
|
||||
|
||||
{
|
||||
label: "企事业单位经营地址",
|
||||
children: info.addressBusiness,
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@ 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 TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
|
||||
function List(props) {
|
||||
const queryParams = useGetUrlQuery();
|
||||
|
|
@ -110,7 +110,11 @@ function AddModalComponent(props) {
|
|||
const res = await props.requestDetails({
|
||||
id: props.currentId,
|
||||
});
|
||||
res.data.userAvatarUrl = [{ filePath: res.data.userAvatarUrl }];
|
||||
res.data.userAvatarUrl = [
|
||||
{
|
||||
filePath: res.data.userAvatarUrl,
|
||||
},
|
||||
];
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
|
|
@ -185,7 +189,12 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: idCardGetDateAndGender(info.userIdCard).sex === "1" ? "男" : idCardGetDateAndGender(info.userIdCard).sex === "0" ? "女" : "",
|
||||
children:
|
||||
idCardGetDateAndGender(info.userIdCard).sex === "1"
|
||||
? "男"
|
||||
: idCardGetDateAndGender(info.userIdCard).sex === "0"
|
||||
? "女"
|
||||
: "",
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
|
|
|
|||
|
|
@ -3,14 +3,14 @@ import { Button, Descriptions, Form, Modal, Space } from "antd";
|
|||
import { useEffect, useState } from "react";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
const USER_TYPE = [
|
||||
|
|
@ -170,8 +170,11 @@ function AddModalComponent(props) {
|
|||
const res = await props.requestDetails({
|
||||
id: props.currentId,
|
||||
});
|
||||
res.data.userAvatarUrl = [{ filePath: res.data.userAvatarUrl }];
|
||||
|
||||
res.data.userAvatarUrl = [
|
||||
{
|
||||
filePath: res.data.userAvatarUrl,
|
||||
},
|
||||
];
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
|
|
@ -246,7 +249,12 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: idCardGetDateAndGender(info.userIdCard).sex === "1" ? "男" : idCardGetDateAndGender(info.userIdCard).sex === "0" ? "女" : "",
|
||||
children:
|
||||
idCardGetDateAndGender(info.userIdCard).sex === "1"
|
||||
? "男"
|
||||
: idCardGetDateAndGender(info.userIdCard).sex === "0"
|
||||
? "女"
|
||||
: "",
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
|
|
|
|||
|
|
@ -36,10 +36,8 @@ function List(props) {
|
|||
return {
|
||||
...formData,
|
||||
enterpriseType: 3,
|
||||
|
||||
geCreateTime: formData.CreateTime?.[0],
|
||||
leCreateTime: formData.CreateTime?.[1],
|
||||
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -93,11 +91,7 @@ function List(props) {
|
|||
{
|
||||
name: "eqCity",
|
||||
label: "属地",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="res_region_enum"
|
||||
/>
|
||||
),
|
||||
render: <DictionarySelect dictValue="res_region_enum" />,
|
||||
},
|
||||
{
|
||||
name: "CreateTime",
|
||||
|
|
@ -110,7 +104,6 @@ function List(props) {
|
|||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_TYPE,
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -186,25 +179,23 @@ function List(props) {
|
|||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
{addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestAdd={props["corpInfoAdd"]}
|
||||
requestEdit={props["corpInfoEdit"]}
|
||||
requestDetails={props["corpInfoDetails"]}
|
||||
requestChangeCompanyName={props["corpInfoChangeCompanyName"]}
|
||||
requestCorplnfoCheckCorpcode={props["corplnfoCheckCorpcode"]}
|
||||
requestCorplnfoCheckCorpName={props["corplnfoCheckCorpName"]}
|
||||
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestAdd={props["corpInfoAdd"]}
|
||||
requestEdit={props["corpInfoEdit"]}
|
||||
requestDetails={props["corpInfoDetails"]}
|
||||
requestChangeCompanyName={props["corpInfoChangeCompanyName"]}
|
||||
requestCorplnfoCheckCorpcode={props["corplnfoCheckCorpcode"]}
|
||||
requestCorplnfoCheckCorpName={props["corplnfoCheckCorpName"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -245,33 +236,61 @@ function AddModalComponent(props) {
|
|||
// 校验社会统一信用代码重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCode) {
|
||||
form.setFields([{ name: "code", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "code",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props.requestCorplnfoCheckCorpcode({ code: debouncedCode, id: props.currentId }).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "code", errors: ["该社会统一信用代码已被其他企业使用"] }]);
|
||||
}
|
||||
});
|
||||
props
|
||||
.requestCorplnfoCheckCorpcode({
|
||||
code: debouncedCode,
|
||||
id: props.currentId,
|
||||
})
|
||||
.then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([
|
||||
{
|
||||
name: "code",
|
||||
errors: ["该社会统一信用代码已被其他企业使用"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCode]);
|
||||
|
||||
// 校验企业名称重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCorpName) {
|
||||
form.setFields([{ name: "corpName", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "corpName",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props.requestCorplnfoCheckCorpName({ corpName: debouncedCorpName, id: props.currentId }).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "corpName", errors: ["企业名称重复"] }]);
|
||||
}
|
||||
});
|
||||
props
|
||||
.requestCorplnfoCheckCorpName({
|
||||
corpName: debouncedCorpName,
|
||||
id: props.currentId,
|
||||
})
|
||||
.then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([
|
||||
{
|
||||
name: "corpName",
|
||||
errors: ["企业名称重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCorpName]);
|
||||
|
||||
const onValuesChange = (changed) => {
|
||||
if ("code" in changed)
|
||||
setCodeValue(changed.code ?? "");
|
||||
|
||||
if ("corpName" in changed)
|
||||
setCorpNameValue(changed.corpName ?? "");
|
||||
};
|
||||
|
|
@ -285,7 +304,6 @@ function AddModalComponent(props) {
|
|||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
onValuesChange={onValuesChange}
|
||||
span={24}
|
||||
options={[
|
||||
{
|
||||
|
|
@ -331,6 +349,7 @@ function AddModalComponent(props) {
|
|||
}}
|
||||
showActionButtons={false}
|
||||
onFinish={onSubmit}
|
||||
onValuesChange={onValuesChange}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Divider, Modal, QRCode } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
function View(props) {
|
||||
|
|
@ -21,12 +21,10 @@ function View(props) {
|
|||
id: queryParams["id"],
|
||||
});
|
||||
setInfo(res.data);
|
||||
|
||||
const licenseFile = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: res.data.corpinfoId,
|
||||
});
|
||||
|
||||
res.data.licenseFile = licenseFile;
|
||||
// 不要在这里 log info,它还是旧的
|
||||
};
|
||||
|
|
@ -43,7 +41,6 @@ function View(props) {
|
|||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
loading={getFileLoading}
|
||||
items={[
|
||||
{
|
||||
label: "企业名称",
|
||||
|
|
@ -127,7 +124,6 @@ function View(props) {
|
|||
},
|
||||
{
|
||||
label: "企业二维码",
|
||||
|
||||
children: (
|
||||
<Button
|
||||
type="link"
|
||||
|
|
@ -138,18 +134,16 @@ function View(props) {
|
|||
查看
|
||||
</Button>
|
||||
),
|
||||
|
||||
},
|
||||
|
||||
]}
|
||||
column={2}
|
||||
loading={getFileLoading}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
<Divider orientation="left">营业执照</Divider>
|
||||
<Descriptions
|
||||
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
|
|
@ -167,14 +161,13 @@ function View(props) {
|
|||
}}
|
||||
/>
|
||||
</div>
|
||||
{ corpInfoQrCodeOpen
|
||||
&& (
|
||||
<CorpInfoQrCode
|
||||
open={corpInfoQrCodeOpen}
|
||||
row={info}
|
||||
onCancel={() => setCorpInfoQrCodeOpen(false)}
|
||||
/>
|
||||
)}
|
||||
{corpInfoQrCodeOpen && (
|
||||
<CorpInfoQrCode
|
||||
row={info}
|
||||
open={corpInfoQrCodeOpen}
|
||||
onCancel={() => setCorpInfoQrCodeOpen(false)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -194,7 +187,10 @@ const CorpInfoQrCode = (props) => {
|
|||
onCancel={props.onCancel}
|
||||
>
|
||||
<QRCode
|
||||
value={JSON.stringify({ corpName: props.row.corpName, corpinfoId: props.row.corpinfoId })}
|
||||
value={JSON.stringify({
|
||||
corpName: props.row.corpName,
|
||||
corpinfoId: props.row.corpinfoId,
|
||||
})}
|
||||
style={{
|
||||
margin: "0 auto",
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import useGetFile from "zy-react-library/hooks/useGetFile";
|
|||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
||||
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { NS_PERSNONEL_CERTFICATE } from "~/enumerate/namespace";
|
||||
|
|
@ -49,7 +48,7 @@ function Department(props) {
|
|||
},
|
||||
});
|
||||
};
|
||||
const [fileCache, setFileCache] = useState({}); // key: userQualificationinfoId, value: files array
|
||||
const [fileCache, setFileCache] = useState({});
|
||||
const [loadingKeys, setLoadingKeys] = useState(new Set()); // 正在加载的 ID 集合
|
||||
|
||||
const loadFileForRecord = async (userQualificationinfoId) => {
|
||||
|
|
@ -202,22 +201,21 @@ function Department(props) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ function Department(props) {
|
|||
const [fileCache, setFileCache] = useState({}); // key: userQualificationinfoId, value: files array
|
||||
const [loadingKeys, setLoadingKeys] = useState(new Set()); // 正在加载的 ID 集合
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["userQualificationInfoList"], {
|
||||
form,
|
||||
|
|
@ -209,25 +208,22 @@ function Department(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
{
|
||||
addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
getData={getData}
|
||||
dictData={props["dictData"]}
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.personnelCertificate.userQualificationLoading}
|
||||
getData={getData}
|
||||
dictData={props["dictData"]}
|
||||
currentId={currentId}
|
||||
requestAdd={props["userQualificationInfoAdd"]}
|
||||
requestEdit={props["userQualificationInfoEdit"]}
|
||||
requestDetails={props["userQualificationInfoDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
@ -310,7 +306,9 @@ function AddModalComponent(props) {
|
|||
const newIdCard = changedValues.qualificationinfoCategory;
|
||||
if (newIdCard) {
|
||||
setOperatingProjectType(newIdCard);
|
||||
form.setFieldsValue({ operatingProject: undefined });
|
||||
form.setFieldsValue({
|
||||
operatingProject: undefined,
|
||||
});
|
||||
console.log(newIdCard);
|
||||
}
|
||||
}
|
||||
|
|
@ -327,7 +325,6 @@ function AddModalComponent(props) {
|
|||
onCancel={onCancel}
|
||||
>
|
||||
<FormBuilder
|
||||
onValuesChange={onValuesChange}
|
||||
form={form}
|
||||
span={24}
|
||||
values={{
|
||||
|
|
@ -392,6 +389,7 @@ function AddModalComponent(props) {
|
|||
}}
|
||||
showActionButtons={false}
|
||||
onFinish={onSubmit}
|
||||
onValuesChange={onValuesChange}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@ 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 TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
|
|
@ -126,19 +126,18 @@ function List(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
{addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -246,9 +245,13 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: idCardGetDateAndGender(info.userIdCard).sex === "1" ? "男" : idCardGetDateAndGender(info.userIdCard).sex === "0" ? "女" : "",
|
||||
children:
|
||||
idCardGetDateAndGender(info.userIdCard).sex === "1"
|
||||
? "男"
|
||||
: idCardGetDateAndGender(info.userIdCard).sex === "0"
|
||||
? "女"
|
||||
: "",
|
||||
},
|
||||
|
||||
{
|
||||
label: "部门排序",
|
||||
children: info.sort,
|
||||
|
|
|
|||
|
|
@ -79,13 +79,9 @@ function Department(props) {
|
|||
name: "eqLevel",
|
||||
label: "部门级别",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="companyDepartmentLevel0000"
|
||||
|
||||
/>
|
||||
<DictionarySelect dictValue="companyDepartmentLevel0000" />
|
||||
),
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -120,9 +116,8 @@ function Department(props) {
|
|||
</Button>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: "部门分责人",
|
||||
title: "部门负责人",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
},
|
||||
{
|
||||
|
|
@ -159,23 +154,22 @@ function Department(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
{addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loading={props.department.departmentLoading}
|
||||
getData={getData}
|
||||
parentId={selectedNodeId}
|
||||
currentId={currentId}
|
||||
requestAdd={props["departmentAdd"]}
|
||||
requestEdit={props["departmentEdit"]}
|
||||
requestDetails={props["departmentDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loading={props.department.departmentLoading}
|
||||
getData={getData}
|
||||
parentId={selectedNodeId}
|
||||
currentId={currentId}
|
||||
requestAdd={props["departmentAdd"]}
|
||||
requestEdit={props["departmentEdit"]}
|
||||
requestDetails={props["departmentDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@ 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 useGetUserInfo from "zy-react-library/hooks/useGetUserInfo";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
|
|
@ -78,7 +77,6 @@ function Post(props) {
|
|||
name: "likePostName",
|
||||
label: "岗位名称",
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -135,26 +133,23 @@ function Post(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
{
|
||||
addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.post.postLoading}
|
||||
getData={getData}
|
||||
parentId={selectedNodeId}
|
||||
currentId={currentId}
|
||||
requestAdd={props["postAdd"]}
|
||||
requestEdit={props["postEdit"]}
|
||||
requestDetails={props["postDetails"]}
|
||||
selectedNodeName={selectedNodeName}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loding={props.post.postLoading}
|
||||
getData={getData}
|
||||
parentId={selectedNodeId}
|
||||
currentId={currentId}
|
||||
requestAdd={props["postAdd"]}
|
||||
requestEdit={props["postEdit"]}
|
||||
requestDetails={props["postDetails"]}
|
||||
selectedNodeName={selectedNodeName}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -162,9 +157,7 @@ function AddModalComponent(props) {
|
|||
const [form] = Form.useForm();
|
||||
const [parentName, setParentName] = useState(null);
|
||||
const [parentId, setParentId] = useState(null);
|
||||
|
||||
const { getUserInfo } = useGetUserInfo();
|
||||
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props
|
||||
|
|
@ -173,7 +166,6 @@ function AddModalComponent(props) {
|
|||
})
|
||||
.then((res) => {
|
||||
form.setFieldsValue(res.data);
|
||||
|
||||
setParentName(res.data.departmentName);
|
||||
setParentId(res.data.departmentId);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -64,7 +64,14 @@ function Add(props) {
|
|||
id: queryParams["id"],
|
||||
});
|
||||
form.setFieldValue("sex", idCardGetDateAndGender(data.userIdCard).sex);
|
||||
fnChoiceDepartment([{ id: data.departmentId }], 1);
|
||||
fnChoiceDepartment(
|
||||
[
|
||||
{
|
||||
id: data.departmentId,
|
||||
},
|
||||
],
|
||||
1,
|
||||
);
|
||||
|
||||
// const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["13"], eqForeignKey: queryParams["id"] });
|
||||
const filepath
|
||||
|
|
@ -148,7 +155,7 @@ function Add(props) {
|
|||
// setDepartmentName(event[0].name)
|
||||
props["postAll"]({
|
||||
corpFlag: 1,
|
||||
departmentId: event[0].id,
|
||||
departmentId: event[event.length - 1].id,
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
setPostData(res.data);
|
||||
|
|
@ -157,12 +164,25 @@ function Add(props) {
|
|||
// 校验身份证重复
|
||||
useEffect(() => {
|
||||
if (!debouncedUserIdCard) {
|
||||
form.setFields([{ name: "userIdCard", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "userIdCard",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ userIdCard: debouncedUserIdCard, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
props["verifyUser"]({
|
||||
userIdCard: debouncedUserIdCard,
|
||||
id: queryParams["id"] ?? "",
|
||||
}).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "userIdCard", errors: ["身份证号重复"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "userIdCard",
|
||||
errors: ["身份证号重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedUserIdCard]);
|
||||
|
|
@ -170,12 +190,25 @@ function Add(props) {
|
|||
// 校验用户名重复
|
||||
useEffect(() => {
|
||||
if (!debouncedUsernameValue) {
|
||||
form.setFields([{ name: "username", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "username",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ username: debouncedUsernameValue, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
props["verifyUser"]({
|
||||
username: debouncedUsernameValue,
|
||||
id: queryParams["id"] ?? "",
|
||||
}).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "username", errors: ["用户名重复"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "username",
|
||||
errors: ["用户名重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedUsernameValue]);
|
||||
|
|
@ -183,12 +216,25 @@ function Add(props) {
|
|||
// 校验用户名重复
|
||||
useEffect(() => {
|
||||
if (!debouncedPhoneValueValue) {
|
||||
form.setFields([{ name: "phone", errors: [] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "phone",
|
||||
errors: [],
|
||||
},
|
||||
]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ phone: debouncedPhoneValueValue, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
props["verifyUser"]({
|
||||
phone: debouncedPhoneValueValue,
|
||||
id: queryParams["id"] ?? "",
|
||||
}).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "phone", errors: ["手机号重复"] }]);
|
||||
form.setFields([
|
||||
{
|
||||
name: "phone",
|
||||
errors: ["手机号重复"],
|
||||
},
|
||||
]);
|
||||
}
|
||||
});
|
||||
}, [debouncedPhoneValueValue]);
|
||||
|
|
@ -221,7 +267,6 @@ function Add(props) {
|
|||
departmentLeaderFlag: "0",
|
||||
deputyLeaderFlag: "0",
|
||||
}}
|
||||
onValuesChange={onValuesChange}
|
||||
loading={uploadFileLoading || props.user.userLoading}
|
||||
options={[
|
||||
{
|
||||
|
|
@ -235,13 +280,22 @@ function Add(props) {
|
|||
valueKey: "id",
|
||||
},
|
||||
},
|
||||
{ name: "departmentId", label: "所属部门", render: <DepartmentSelectTree onGetNodePaths={fnChoiceDepartment} /> },
|
||||
{
|
||||
name: "departmentId",
|
||||
label: "所属部门",
|
||||
render: (
|
||||
<DepartmentSelectTree onGetNodePaths={fnChoiceDepartment} />
|
||||
),
|
||||
},
|
||||
{
|
||||
name: "postId",
|
||||
label: "所属岗位",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: postData,
|
||||
itemsField: { labelKey: "postName", valueKey: "id" },
|
||||
itemsField: {
|
||||
labelKey: "postName",
|
||||
valueKey: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "username",
|
||||
|
|
@ -390,6 +444,7 @@ function Add(props) {
|
|||
span: 6,
|
||||
}}
|
||||
onFinish={onSubmit}
|
||||
onValuesChange={onValuesChange}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -9,15 +9,15 @@ 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 DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
|
||||
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 useDownloadBlob from "zy-react-library/hooks/useDownloadBlob";
|
||||
|
||||
import useImportFile from "zy-react-library/hooks/useImportFile";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
|
|
@ -36,8 +36,6 @@ function List(props) {
|
|||
return {
|
||||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
allFlag: 1,
|
||||
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -154,12 +152,7 @@ function List(props) {
|
|||
{
|
||||
name: "personnelType",
|
||||
label: "人员类型",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="renyuanleixing"
|
||||
|
||||
/>
|
||||
),
|
||||
render: <DictionarySelect dictValue="renyuanleixing" />,
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
|
|
@ -291,30 +284,28 @@ function List(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
{ importOpen
|
||||
&& (
|
||||
<ImportFile
|
||||
visible={importOpen}
|
||||
templateUrl=""
|
||||
onCancel={() => {
|
||||
setImportOpen(false);
|
||||
}}
|
||||
onConfirm={onImportFileConfirm}
|
||||
/>
|
||||
)}
|
||||
{ addModalOpen
|
||||
&& (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{importOpen && (
|
||||
<ImportFile
|
||||
visible={importOpen}
|
||||
templateUrl={`${process.env.app["fileUrl"]}template/user_template.xlsx`}
|
||||
onCancel={() => {
|
||||
setImportOpen(false);
|
||||
}}
|
||||
onConfirm={onImportFileConfirm}
|
||||
/>
|
||||
)}
|
||||
{addModalOpen && (
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -327,9 +318,11 @@ function AddModalComponent(props) {
|
|||
const res = await props.requestDetails({
|
||||
id: props.currentId,
|
||||
});
|
||||
|
||||
res.data.userAvatarUrl = [{ filePath: res.data.userAvatarUrl }];
|
||||
|
||||
res.data.userAvatarUrl = [
|
||||
{
|
||||
filePath: res.data.userAvatarUrl,
|
||||
},
|
||||
];
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
|
|
@ -404,7 +397,12 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: idCardGetDateAndGender(info.userIdCard).sex === "1" ? "男" : idCardGetDateAndGender(info.userIdCard).sex === "0" ? "女" : "",
|
||||
children:
|
||||
idCardGetDateAndGender(info.userIdCard).sex === "1"
|
||||
? "男"
|
||||
: idCardGetDateAndGender(info.userIdCard).sex === "0"
|
||||
? "女"
|
||||
: "",
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { useEffect, useRef, useState } from "react";
|
||||
|
||||
/**
|
||||
* 根据身份证号计算年龄
|
||||
* @param {string} idCard - 18位身份证号码
|
||||
|
|
@ -23,7 +24,14 @@ export function getAgeByIdCard(idCard) {
|
|||
const day = Number.parseInt(birthStr.substring(6, 8), 10);
|
||||
|
||||
// 简单校验日期合法性(可选增强)
|
||||
if (year < 1900 || year > new Date().getFullYear() || month < 1 || month > 12 || day < 1 || day > 31) {
|
||||
if (
|
||||
year < 1900
|
||||
|| year > new Date().getFullYear()
|
||||
|| month < 1
|
||||
|| month > 12
|
||||
|| day < 1
|
||||
|| day > 31
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -40,7 +48,6 @@ export function getAgeByIdCard(idCard) {
|
|||
if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
|
||||
age -= 1;
|
||||
}
|
||||
|
||||
return age >= 0 ? age : null; // 年龄不能为负
|
||||
}
|
||||
/**
|
||||
|
|
@ -52,7 +59,6 @@ export function getBirthDateFromIdCard(idCard) {
|
|||
if (!idCard || typeof idCard !== "string") {
|
||||
return null;
|
||||
}
|
||||
|
||||
const id = idCard.trim();
|
||||
if (id.length !== 18) {
|
||||
return null; // 仅支持18位身份证
|
||||
|
|
@ -70,19 +76,18 @@ export function getBirthDateFromIdCard(idCard) {
|
|||
if (
|
||||
year < 1900
|
||||
|| year > currentYear + 1 // 允许未来1年(录入误差)
|
||||
|| month < 1 || month > 12
|
||||
|| day < 1 || day > 31
|
||||
|| month < 1
|
||||
|| month > 12
|
||||
|| day < 1
|
||||
|| day > 31
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return `${year}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
|
||||
}
|
||||
|
||||
export function useDebounce(value, delay = 500) {
|
||||
const [debouncedValue, setDebouncedValue] = useState(value);
|
||||
const timerRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
// 清除上一次的定时器
|
||||
if (timerRef.current) {
|
||||
|
|
@ -101,6 +106,5 @@ export function useDebounce(value, delay = 500) {
|
|||
}
|
||||
};
|
||||
}, [value, delay]);
|
||||
|
||||
return debouncedValue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue