第一轮改Bug
parent
6e3a2f45d0
commit
a3d0418dd1
Binary file not shown.
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
module.exports={compact:!1,plugins:[["@babel/plugin-proposal-decorators",{legacy:!0}]],presets:[["@babel/preset-env",{targets:{browsers:["ie >= 10"]}}],["@babel/preset-react",{runtime:"automatic"}]]};
|
||||
|
|
@ -0,0 +1 @@
|
|||
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
|
|
@ -0,0 +1,125 @@
|
|||
/*!
|
||||
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
|
|
@ -0,0 +1,79 @@
|
|||
/*! 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
|
|
@ -0,0 +1 @@
|
|||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
<!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>
|
||||
|
|
@ -25,7 +25,8 @@ module.exports = {
|
|||
contextInject: {
|
||||
// 应用Key
|
||||
appKey: "",
|
||||
fileUrl: "http://192.168.20.240:9787/mnt",
|
||||
fileUrl: "http://192.168.20.240:9787/mnt/",
|
||||
// fileUrl: "https://jpfz.qhdsafety.com/gbsFileTest/",
|
||||
},
|
||||
// public/index.html注入全局变量
|
||||
windowInject: {
|
||||
|
|
|
|||
|
|
@ -28,9 +28,10 @@
|
|||
"antd": "latest",
|
||||
"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.108"
|
||||
"zy-react-library": "^1.0.121"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@antfu/eslint-config": "^5.4.1",
|
||||
|
|
|
|||
|
|
@ -49,6 +49,6 @@
|
|||
<noscript>此网页需要开启JavaScript功能。</noscript>
|
||||
<!-- MAIN -->
|
||||
<% const { root } = $element; %>
|
||||
<div id="<%= root.id %>" style="width: 100%; height: 100%; position: relative"></div>
|
||||
<div id="<%= root.id %>" style="width: 100%; height: 100%; position: relative;overflow-y: auto"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -20,3 +20,8 @@ export const departmentRemove = declareRequest(
|
|||
"departmentLoading",
|
||||
"Post > @/basic-info/department/remove/{id}",
|
||||
);
|
||||
// 获取当前登录人信息
|
||||
export const userGetInfo = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Get > /basic-info/user/getInfo",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export const corpInfoList = declareRequest(
|
|||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/list",
|
||||
);
|
||||
export const corpInfoRemoveDetails = declareRequest(
|
||||
export const corpInfoDetails = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/info/{id}",
|
||||
);
|
||||
|
|
@ -40,3 +40,17 @@ export const corpUserMiddlePage = declareRequest(
|
|||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/corpUserMiddlePage",
|
||||
);
|
||||
|
||||
// 获取当前登录人信息
|
||||
export const userGetInfo = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Get > /basic-info/user/getInfo",
|
||||
);
|
||||
export const corplnfoCheckCorpcode = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/checkCorpCode",
|
||||
);
|
||||
export const corplnfoCheckCorpName = declareRequest(
|
||||
"enterpriseLoading",
|
||||
"Post > @/basic-info/corpInfo/checkCorpName",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -45,3 +45,14 @@ export const userEmploymentLogAll = declareRequest(
|
|||
"userLoading",
|
||||
"Get > /basic-info/userEmploymentLog/listAll",
|
||||
);
|
||||
|
||||
export const userChangePassword = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/user/changePassword/{id}",
|
||||
);
|
||||
|
||||
// 校验用户名 手机号 身份证号是否重复
|
||||
export const verifyUser = declareRequest(
|
||||
"userLoading",
|
||||
"Post > @/basic-info/user/verifyUser",
|
||||
);
|
||||
|
|
|
|||
|
|
@ -30,9 +30,12 @@ function Department(props) {
|
|||
onOk: () => {
|
||||
props["corpQualificationInfoRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -106,7 +109,7 @@ function Department(props) {
|
|||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
|
|
@ -123,19 +126,22 @@ function Department(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,18 +22,18 @@ function Info(props) {
|
|||
};
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props.corpInfoRemoveDetails({
|
||||
id: "1985906265017954306",
|
||||
const { data } = await props["userGetInfo"]();
|
||||
console.log(data);
|
||||
|
||||
const res = await props.corpInfoDetails({
|
||||
id: data.corpinfoId,
|
||||
});
|
||||
const licenseFile = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: res.data.corpinfoId,
|
||||
});
|
||||
const imgArr = [];
|
||||
licenseFile.forEach((item) => {
|
||||
imgArr.push(item.url);
|
||||
});
|
||||
res.data.licenseFile = imgArr;
|
||||
res.data.licenseFile = licenseFile;
|
||||
console.log(res.data.licenseFile);
|
||||
setInfo(res.data);
|
||||
console.log(res.data);
|
||||
// 不要在这里 log info,它还是旧的
|
||||
|
|
@ -58,6 +58,11 @@ function Info(props) {
|
|||
label: "统一社会信用代码",
|
||||
children: info.code,
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
children: info.corpStateName,
|
||||
},
|
||||
|
||||
{
|
||||
label: "所属区域",
|
||||
children: info.cityName,
|
||||
|
|
@ -146,10 +151,7 @@ function Info(props) {
|
|||
label: "企事业单位经营地址",
|
||||
children: info.addressBusiness,
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
children: info.corpStateName,
|
||||
},
|
||||
|
||||
{
|
||||
label: "营业执照",
|
||||
children: <TooltipPreviewImg files={info.licenseFile} />,
|
||||
|
|
@ -199,7 +201,7 @@ function Info(props) {
|
|||
props.history.push(`./update?id=${info.id}`);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
编辑
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,9 +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,6 +23,8 @@ import { getLabelName } from "zy-react-library/utils";
|
|||
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
|
||||
import { useDebounce } from "~/utils"; // 确保路径正确
|
||||
|
||||
const ENTERPRISE_STATUS = [
|
||||
{
|
||||
bianma: "filialstate01",
|
||||
|
|
@ -71,6 +74,85 @@ 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);
|
||||
const debouncedCorpName = useDebounce(corpNameValue, 600);
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const { data } = await props["corpInfoDetails"]({
|
||||
id: queryParams["id"],
|
||||
});
|
||||
setKeyId(data.corpinfoId);
|
||||
const licenseFile = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: data.corpinfoId,
|
||||
});
|
||||
data.INDUSTRYALL = getLastValidCorpTypeName(data);
|
||||
|
||||
data.license = [data.licenseStart, data.licenseEnd];
|
||||
data.scaleType = data.scaleType ?? 0;
|
||||
|
||||
const values = {
|
||||
licenseFile,
|
||||
...data,
|
||||
};
|
||||
form.setFieldsValue({
|
||||
...values,
|
||||
});
|
||||
// res.data.whetherHygieneFlag = res.data.whetherHygieneFlag ?? 0;
|
||||
// res.data.whetherHazardsFlag = res.data.whetherHazardsFlag ?? 0;
|
||||
// res.data.whetherScarceFlag = res.data.whetherScarceFlag ?? 0;
|
||||
// res.data.whetherChemicalsFlag = res.data.whetherChemicalsFlag ?? 0;
|
||||
// res.data.whetherSpecialequipmentFlag = res.data.whetherSpecialequipmentFlag ?? 0;
|
||||
// res.data.whetherSpecialpeopleFlag = res.data.whetherSpecialpeopleFlag ?? 0;
|
||||
// res.data.whetherCoalgasFlag = res.data.whetherCoalgasFlag ?? 0;
|
||||
// res.data.whetherFireFlag = res.data.whetherFireFlag ?? 0;
|
||||
// res.data.whetherConfinedFlag = res.data.whetherConfinedFlag ?? 0;
|
||||
// res.data.whetherPowderFlag = res.data.whetherPowderFlag ?? 0;
|
||||
// res.data.whetherLightningFlag = res.data.whetherLightningFlag ?? 0;
|
||||
// res.data.whetherActinogenFlag = res.data.whetherActinogenFlag ?? 0;
|
||||
// res.data.whetherLiquidammoniaFlag = res.data.whetherLiquidammoniaFlag ?? 0;
|
||||
// res.data.whetherPipeline = res.data.whetherPipeline ?? 0;
|
||||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
// 校验社会统一信用代码重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCode) {
|
||||
form.setFields([{ name: "code", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["corplnfoCheckCorpcode"]({ code: debouncedCode, id: queryParams["id"] }).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "code", errors: ["该社会统一信用代码已被其他企业使用"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCode]);
|
||||
|
||||
// 校验企业名称重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCorpName) {
|
||||
form.setFields([{ name: "corpName", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["corplnfoCheckCorpName"]({ corpName: debouncedCorpName, id: queryParams["id"] }).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "corpName", errors: ["企业名称重复"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCorpName]);
|
||||
|
||||
const onValuesChange = (changed) => {
|
||||
if ("code" in changed)
|
||||
setCodeValue(changed.code ?? "");
|
||||
|
||||
if ("corpName" in changed)
|
||||
setCorpNameValue(changed.corpName ?? "");
|
||||
};
|
||||
|
||||
const onSubmit = async (values) => {
|
||||
await deleteFile({
|
||||
single: false,
|
||||
|
|
@ -102,14 +184,14 @@ function Update(props) {
|
|||
nameKey: "dictLabel",
|
||||
});
|
||||
if (industryData.length > 0) {
|
||||
values.corpType = industryData[0].dictValue;
|
||||
values.corpTypeName = industryData[0].dictLabel;
|
||||
values.corpType2 = industryData[1] && industryData[1].dictValue;
|
||||
values.corpType2Name = industryData[1] && industryData[1].dictLabel;
|
||||
values.corpType3 = industryData[2] && industryData[2].dictValue;
|
||||
values.corpType3Name = industryData[2] && industryData[2].dictLabel;
|
||||
values.corpType4 = industryData[3] && industryData[3].dictValue;
|
||||
values.corpType4Name = industryData[3] && industryData[3].dictLabel;
|
||||
values.corpType = industryData[0].dict_value;
|
||||
values.corpTypeName = industryData[0].dict_label;
|
||||
values.corpType2 = industryData[1] && industryData[1].dict_value;
|
||||
values.corpType2Name = industryData[1] && industryData[1].dict_label;
|
||||
values.corpType3 = industryData[2] && industryData[2].dict_value;
|
||||
values.corpType3Name = industryData[2] && industryData[2].dict_label;
|
||||
values.corpType4 = industryData[3] && industryData[3].dict_value;
|
||||
values.corpType4Name = industryData[3] && industryData[3].dict_label;
|
||||
}
|
||||
await uploadFile({
|
||||
single: false,
|
||||
|
|
@ -122,9 +204,11 @@ function Update(props) {
|
|||
values.licenseStart = values.license[0];
|
||||
values.licenseEnd = values.license[1];
|
||||
delete values.license;
|
||||
props["corpInfoEdit"](values).then(() => {
|
||||
message.success("操作成功!");
|
||||
window.history.back();
|
||||
props["corpInfoEdit"](values).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("操作成功!");
|
||||
window.history.back();
|
||||
}
|
||||
});
|
||||
};
|
||||
function getLastValidCorpTypeName(item) {
|
||||
|
|
@ -146,55 +230,18 @@ function Update(props) {
|
|||
// 全为空则返回空字符串或默认值
|
||||
return "";
|
||||
}
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const { data } = await props["corpInfoRemoveDetails"]({
|
||||
id: queryParams["id"],
|
||||
});
|
||||
setKeyId(data.corpinfoId);
|
||||
const licenseFile = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: keyId,
|
||||
});
|
||||
data.INDUSTRYALL = getLastValidCorpTypeName(data);
|
||||
data.license = [data.licenseStart, data.licenseEnd];
|
||||
data.scaleType = data.scaleType ?? 0;
|
||||
const values = {
|
||||
licenseFile,
|
||||
...data,
|
||||
};
|
||||
form.setFieldsValue({
|
||||
...values,
|
||||
});
|
||||
// res.data.whetherHygieneFlag = res.data.whetherHygieneFlag ?? 0;
|
||||
// res.data.whetherHazardsFlag = res.data.whetherHazardsFlag ?? 0;
|
||||
// res.data.whetherScarceFlag = res.data.whetherScarceFlag ?? 0;
|
||||
// res.data.whetherChemicalsFlag = res.data.whetherChemicalsFlag ?? 0;
|
||||
// res.data.whetherSpecialequipmentFlag = res.data.whetherSpecialequipmentFlag ?? 0;
|
||||
// res.data.whetherSpecialpeopleFlag = res.data.whetherSpecialpeopleFlag ?? 0;
|
||||
// res.data.whetherCoalgasFlag = res.data.whetherCoalgasFlag ?? 0;
|
||||
// res.data.whetherFireFlag = res.data.whetherFireFlag ?? 0;
|
||||
// res.data.whetherConfinedFlag = res.data.whetherConfinedFlag ?? 0;
|
||||
// res.data.whetherPowderFlag = res.data.whetherPowderFlag ?? 0;
|
||||
// res.data.whetherLightningFlag = res.data.whetherLightningFlag ?? 0;
|
||||
// res.data.whetherActinogenFlag = res.data.whetherActinogenFlag ?? 0;
|
||||
// res.data.whetherLiquidammoniaFlag = res.data.whetherLiquidammoniaFlag ?? 0;
|
||||
// res.data.whetherPipeline = res.data.whetherPipeline ?? 0;
|
||||
|
||||
// 不要在这里 log info,它还是旧的
|
||||
};
|
||||
fetchData();
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title="编辑" />
|
||||
<div
|
||||
style={{
|
||||
paddingBottom: 10,
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
onValuesChange={onValuesChange}
|
||||
values={{
|
||||
scaleType: 0,
|
||||
whetherHygieneFlag: 0,
|
||||
|
|
@ -231,6 +278,24 @@ function Update(props) {
|
|||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
name: "corpState",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "开户人",
|
||||
name: "createName",
|
||||
required: false,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "社会统一信用代码",
|
||||
name: "code",
|
||||
|
|
@ -239,6 +304,7 @@ function Update(props) {
|
|||
pattern: UNIFIED_SOCIAL_CREDIT_CODE,
|
||||
message: "请输入正确的社会统一信用代码",
|
||||
},
|
||||
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -284,16 +350,16 @@ function Update(props) {
|
|||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
name: "corpState",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
},
|
||||
|
||||
{
|
||||
name: "map",
|
||||
customizeRender: true,
|
||||
render: <Map required={false} />,
|
||||
render: (
|
||||
<Map
|
||||
required={false}
|
||||
|
||||
/>
|
||||
),
|
||||
span: 24,
|
||||
},
|
||||
{
|
||||
|
|
@ -333,12 +399,22 @@ function Update(props) {
|
|||
label: "所属行业",
|
||||
name: "INDUSTRYALL",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="config_industry_enum"
|
||||
onGetNodePaths={(node) => {
|
||||
setIndustryData(node);
|
||||
// <DictionarySelect
|
||||
// dictValue="config_industry_enum"
|
||||
// onGetNodePaths={(node) => {
|
||||
// setIndustryData(node);
|
||||
// console.log(node);
|
||||
// }}
|
||||
// />
|
||||
|
||||
<IndustrySelect
|
||||
onGetNodePaths={(data) => {
|
||||
|
||||
console.log(data);
|
||||
setIndustryData(data);
|
||||
}}
|
||||
/>
|
||||
|
||||
),
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ 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";
|
||||
|
||||
|
|
@ -20,16 +21,30 @@ function OrganizationStructure(props) {
|
|||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState(null);
|
||||
const [selectedNodeName, setSelectedNodeName] = useState("");
|
||||
const { getUserInfo } = useGetUserInfo();
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const { tableProps, getData } = useTable(props["departmentList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqParentId: selectedNodeId,
|
||||
eqCorpinfoId: selectedNodeId,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
getUserInfo().then((res) => {
|
||||
setSelectedNodeName(res.departmentName);
|
||||
});
|
||||
};
|
||||
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
const onTreeChange = (selectedKeys, event) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeName(event.node.name);
|
||||
|
|
@ -43,9 +58,12 @@ function OrganizationStructure(props) {
|
|||
onOk: () => {
|
||||
props["departmentRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -61,7 +79,10 @@ function OrganizationStructure(props) {
|
|||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<LeftTree
|
||||
onSelect={onTreeChange}
|
||||
|
||||
/>
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
|
|
@ -75,7 +96,7 @@ function OrganizationStructure(props) {
|
|||
label: "部门名称",
|
||||
},
|
||||
{
|
||||
name: "level",
|
||||
name: "eqLevel",
|
||||
label: "部门级别",
|
||||
render: (
|
||||
<DictionarySelect dictValue="companyDepartmentLevel0000" />
|
||||
|
|
@ -119,6 +140,14 @@ function OrganizationStructure(props) {
|
|||
title: "部门级别",
|
||||
dataIndex: "levelName",
|
||||
},
|
||||
{
|
||||
title: "部门分责人",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
},
|
||||
{
|
||||
title: "部门排序",
|
||||
dataIndex: "depOrder",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
|
|
@ -132,7 +161,7 @@ function OrganizationStructure(props) {
|
|||
setSelectedNodeId(record.parentId);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
|
|
@ -153,7 +182,7 @@ function OrganizationStructure(props) {
|
|||
<AddModal
|
||||
open={addModalOpen}
|
||||
loading={props.department.departmentLoading}
|
||||
getData={getData}
|
||||
|
||||
parentId={selectedNodeId}
|
||||
currentId={currentId}
|
||||
requestAdd={props["departmentAdd"]}
|
||||
|
|
@ -163,6 +192,8 @@ function OrganizationStructure(props) {
|
|||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
setSelectedNodeId("");
|
||||
getData();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
|
@ -185,10 +216,9 @@ function AddModalComponent(props) {
|
|||
});
|
||||
}
|
||||
else {
|
||||
console.log(props.selectedNodeName);
|
||||
setParentName(props.selectedNodeName);
|
||||
}
|
||||
}, [props.currentId, props.selectedNodeName]);
|
||||
}, []);
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
|
|
@ -201,16 +231,28 @@ function AddModalComponent(props) {
|
|||
nameKey: "dictLabel",
|
||||
});
|
||||
values.parentId = props.parentId;
|
||||
if (Number.isInteger(values.depOrder) && values.depOrder < 0) {
|
||||
message.error("部门排序请输入正整数!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (props.currentId) {
|
||||
values.parentId = props.parentId;
|
||||
values.id = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
await props.requestEdit(values).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("编辑成功");
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values);
|
||||
await props.requestAdd(values).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("新增成功");
|
||||
}
|
||||
});
|
||||
}
|
||||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@ 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";
|
||||
|
|
@ -36,8 +37,12 @@ function Post(props) {
|
|||
onOk: () => {
|
||||
props["postRemove"]({
|
||||
id,
|
||||
}).then((result) => {
|
||||
if (result.success) {
|
||||
message.success("删除成功");
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
|
||||
getData();
|
||||
},
|
||||
});
|
||||
|
|
@ -67,6 +72,17 @@ function Post(props) {
|
|||
flex: 1,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "likePostName",
|
||||
label: "岗位名称",
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
|
|
@ -103,7 +119,7 @@ function Post(props) {
|
|||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
|
|
@ -143,6 +159,9 @@ function Post(props) {
|
|||
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
|
||||
|
|
@ -151,20 +170,31 @@ function AddModalComponent(props) {
|
|||
})
|
||||
.then((res) => {
|
||||
form.setFieldsValue(res.data);
|
||||
console.log(res.data);
|
||||
|
||||
setParentName(res.data.departmentName);
|
||||
setParentId(res.data.departmentId);
|
||||
});
|
||||
}
|
||||
else {
|
||||
setParentName(props.selectedNodeName);
|
||||
if (!props.selectedNodeName) {
|
||||
getUserInfo().then((res) => {
|
||||
setParentName(res.departmentName);
|
||||
setParentId(res.departmentId);
|
||||
});
|
||||
}
|
||||
else {
|
||||
setParentName(props.selectedNodeName);
|
||||
setParentId(props.parentId);
|
||||
}
|
||||
}
|
||||
}, [props.currentId, props.selectedNodeName]);
|
||||
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
values.departmentId = props.parentId;
|
||||
values.departmentId = parentId;
|
||||
values.corpFlag = 2;
|
||||
if (props.currentId) {
|
||||
values.id = props.currentId;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import { ID_NUMBER, PHONE } from "zy-react-library/regular";
|
|||
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
import { useDebounce } from "~/utils";
|
||||
|
||||
const WHETHER_ENUM = [
|
||||
{
|
||||
|
|
@ -28,11 +29,11 @@ const WHETHER_ENUM = [
|
|||
];
|
||||
const SEX = [
|
||||
{
|
||||
bianma: 1,
|
||||
bianma: "1",
|
||||
name: "男",
|
||||
},
|
||||
{
|
||||
bianma: 2,
|
||||
bianma: "0",
|
||||
name: "女",
|
||||
},
|
||||
];
|
||||
|
|
@ -44,6 +45,13 @@ function Add(props) {
|
|||
const [userTypeData, setUserTypeData] = useState([]);
|
||||
const [userID, setUserID] = useState(null);
|
||||
const queryParams = useGetUrlQuery();
|
||||
const [userIdCardValue, setUserIdCardValue] = useState(null);
|
||||
const [usernameValue, setUsernameValue] = useState(null);
|
||||
const [phoneValue, setPhoneValue] = useState(null);
|
||||
const debouncedUserIdCard = useDebounce(userIdCardValue, 600);
|
||||
const debouncedUsernameValue = useDebounce(usernameValue, 600);
|
||||
const debouncedPhoneValueValue = useDebounce(phoneValue, 600);
|
||||
|
||||
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||
useEffect(() => {
|
||||
if (queryParams["id"]) {
|
||||
|
|
@ -51,26 +59,24 @@ function Add(props) {
|
|||
const { data } = await props["userDetails"]({
|
||||
id: queryParams["id"],
|
||||
});
|
||||
form.setFieldValue("sex", idCardGetDateAndGender(data.userIdCard).sex);
|
||||
|
||||
// const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["13"], eqForeignKey: queryParams["id"] });
|
||||
const filepath
|
||||
= data.filepath
|
||||
= data.userAvatarUrl
|
||||
? [
|
||||
{
|
||||
name: data.name,
|
||||
url: data.filepath,
|
||||
url: process.env.app["fileUrl"] + data.userAvatarUrl,
|
||||
},
|
||||
]
|
||||
: [];
|
||||
console.log(filepath);
|
||||
const values = {
|
||||
filepath,
|
||||
...data,
|
||||
};
|
||||
values.faceFile = [
|
||||
{
|
||||
name: data.name,
|
||||
url: data.filepath,
|
||||
},
|
||||
];
|
||||
values.faceFile = filepath;
|
||||
setUserID(data.userId);
|
||||
form.setFieldsValue({
|
||||
...values,
|
||||
|
|
@ -108,7 +114,6 @@ function Add(props) {
|
|||
nameKey: "dictLabel",
|
||||
});
|
||||
// values.rank_level_name = getLabelName({ status: values.rank_level, list: rankData, idKey: "dictValue", nameKey: "labelKey" });
|
||||
idCardGetDateAndGender(values.userIdCard);
|
||||
const { filePath } = await uploadFile({
|
||||
single: true,
|
||||
files: values.faceFile,
|
||||
|
|
@ -151,6 +156,61 @@ function Add(props) {
|
|||
setPostData(res.data);
|
||||
});
|
||||
};
|
||||
// 校验身份证重复
|
||||
useEffect(() => {
|
||||
if (!debouncedUserIdCard) {
|
||||
form.setFields([{ name: "userIdCard", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ userIdCard: debouncedUserIdCard, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "userIdCard", errors: ["身份证号重复"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedUserIdCard]);
|
||||
|
||||
// 校验用户名重复
|
||||
useEffect(() => {
|
||||
if (!debouncedUsernameValue) {
|
||||
form.setFields([{ name: "username", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ username: debouncedUsernameValue, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "username", errors: ["用户名重复"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedUsernameValue]);
|
||||
|
||||
// 校验用户名重复
|
||||
useEffect(() => {
|
||||
if (!debouncedPhoneValueValue) {
|
||||
form.setFields([{ name: "phone", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ phone: debouncedPhoneValueValue, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
if (!res.success) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
if ("username" in changedValues) {
|
||||
setUsernameValue(changedValues.username ?? "");
|
||||
}
|
||||
if ("phone" in changedValues) {
|
||||
setPhoneValue(changedValues.phone ?? "");
|
||||
}
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title={queryParams["id"] ? "编辑" : "新增"} />
|
||||
|
|
@ -161,6 +221,7 @@ function Add(props) {
|
|||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
onValuesChange={onValuesChange}
|
||||
values={{
|
||||
departmentLeaderFlag: "0",
|
||||
}}
|
||||
|
|
@ -198,7 +259,7 @@ function Add(props) {
|
|||
{
|
||||
name: "username",
|
||||
label: "用户名",
|
||||
tip: "* 如果修改手机号,登录密码则会变成初始密码“Aa@123456789”",
|
||||
tip: "* 如果修改手机号,登录密码则会变成初始密码“Aa12345678”",
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
|
|
|
|||
|
|
@ -9,10 +9,12 @@ 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 useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
|
|
@ -31,6 +33,7 @@ function List(props) {
|
|||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
userType: 2,
|
||||
allFlag: 1,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -41,9 +44,12 @@ function List(props) {
|
|||
onOk: () => {
|
||||
props["userRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -65,8 +71,12 @@ function List(props) {
|
|||
console.log(values);
|
||||
importFile("/basic-info/user/importUserTable", {
|
||||
files: values.file,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("导入成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("导入成功");
|
||||
};
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
|
|
@ -96,7 +106,7 @@ function List(props) {
|
|||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "username",
|
||||
name: "likeUsername",
|
||||
label: "用户名",
|
||||
},
|
||||
]}
|
||||
|
|
@ -190,24 +200,32 @@ function List(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<ImportFile
|
||||
visible={importOpen}
|
||||
templateUrl=""
|
||||
onCancel={() => {
|
||||
setImportOpen(false);
|
||||
}}
|
||||
onConfirm={onImportFileConfirm}
|
||||
/>
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
{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("");
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -220,6 +238,7 @@ function AddModalComponent(props) {
|
|||
const res = await props.requestDetails({
|
||||
id: props.currentId,
|
||||
});
|
||||
res.data.userAvatarUrl = [{ filePath: res.data.userAvatarUrl }];
|
||||
console.log(res.data);
|
||||
setInfo(res.data);
|
||||
};
|
||||
|
|
@ -296,11 +315,11 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: info.sex,
|
||||
children: idCardGetDateAndGender(info.userIdCard).sex === "1" ? "男" : idCardGetDateAndGender(info.userIdCard).sex === "0" ? "女" : "",
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: info.nationName,
|
||||
children: <TooltipPreviewImg files={info.userAvatarUrl} />,
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
|
|
|
|||
|
|
@ -30,9 +30,12 @@ function Department(props) {
|
|||
onOk: () => {
|
||||
props["userQualificationInfoRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -105,7 +108,7 @@ function Department(props) {
|
|||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
|
|
@ -122,19 +125,22 @@ function Department(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ function Qualification() {
|
|||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
|
|
@ -90,23 +90,31 @@ function Qualification() {
|
|||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,21 +4,24 @@ 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 Upload from "zy-react-library/components/Upload";
|
||||
|
||||
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 {
|
||||
PHONE,
|
||||
POSTAL_CODE,
|
||||
UNIFIED_SOCIAL_CREDIT_CODE,
|
||||
} from "zy-react-library/regular";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
import { useDebounce } from "~/utils";
|
||||
|
||||
const ENTERPRISE_STATUS = [
|
||||
{
|
||||
|
|
@ -66,11 +69,18 @@ function CorpInfo(props) {
|
|||
const { loading: deleteFileLoading, deleteFile } = useDeleteFile();
|
||||
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
const [keyId, setKeyId] = useState("");
|
||||
const [keyId, setKeyId] = useState({});
|
||||
const [scaleData, setScaleData] = useState([]);
|
||||
const [ecoTypeData, setEcoTypeData] = useState([]);
|
||||
const [industryData, setIndustryData] = useState([]);
|
||||
const [cityData, setCityData] = useState([]);
|
||||
const [info, setInfoData] = useState([]);
|
||||
|
||||
const [codeValue, setCodeValue] = useState("");
|
||||
const [corpNameValue, setCorpNameValue] = useState("");
|
||||
const debouncedCode = useDebounce(codeValue, 600);
|
||||
const debouncedCorpName = useDebounce(corpNameValue, 600);
|
||||
|
||||
function getLastValidCorpTypeName(item) {
|
||||
// 按层级顺序排列
|
||||
const names = [
|
||||
|
|
@ -92,11 +102,14 @@ function CorpInfo(props) {
|
|||
}
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const { data } = await props["corpInfoRemoveDetails"]({});
|
||||
setKeyId(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 });
|
||||
const licenseFile = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: keyId,
|
||||
eqForeignKey: res.data.userId ? res.data.userId : "",
|
||||
});
|
||||
data.INDUSTRYALL = getLastValidCorpTypeName(data);
|
||||
data.license = [data.licenseStart, data.licenseEnd];
|
||||
|
|
@ -141,31 +154,69 @@ function CorpInfo(props) {
|
|||
nameKey: "dictLabel",
|
||||
});
|
||||
if (industryData.length > 0) {
|
||||
values.corpType = industryData[0].dictValue;
|
||||
values.corpTypeName = industryData[0].dictLabel;
|
||||
values.corpType2 = industryData[1] && industryData[1].dictValue;
|
||||
values.corpType2Name = industryData[1] && industryData[1].dictLabel;
|
||||
values.corpType3 = industryData[2] && industryData[2].dictValue;
|
||||
values.corpType3Name = industryData[2] && industryData[2].dictLabel;
|
||||
values.corpType4 = industryData[3] && industryData[3].dictValue;
|
||||
values.corpType4Name = industryData[3] && industryData[3].dictLabel;
|
||||
values.corpType = industryData[0].dict_value;
|
||||
values.corpTypeName = industryData[0].dict_label;
|
||||
values.corpType2 = industryData[1] && industryData[1].dict_value;
|
||||
values.corpType2Name = industryData[1] && industryData[1].dict_label;
|
||||
values.corpType3 = industryData[2] && industryData[2].dict_value;
|
||||
values.corpType3Name = industryData[2] && industryData[2].dict_label;
|
||||
values.corpType4 = industryData[3] && industryData[3].dict_value;
|
||||
values.corpType4Name = industryData[3] && industryData[3].dict_label;
|
||||
}
|
||||
await uploadFile({
|
||||
single: false,
|
||||
files: values.licenseFile,
|
||||
params: {
|
||||
type: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
foreignKey: keyId,
|
||||
foreignKey: keyId.corpinfoId,
|
||||
},
|
||||
});
|
||||
values.corpinfoId = keyId;
|
||||
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(() => {
|
||||
message.success("操作成功!");
|
||||
props["corpInfoEdit"](values).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("操作成功!");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 校验社会统一信用代码重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCode) {
|
||||
form.setFields([{ name: "code", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["corplnfoCheckCorpcode"]({ code: debouncedCode, id: keyId.id }).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "code", errors: ["该社会统一信用代码已被其他企业使用"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCode]);
|
||||
|
||||
// 校验企业名称重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCorpName) {
|
||||
form.setFields([{ name: "corpName", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["corplnfoCheckCorpName"]({ corpName: debouncedCorpName, id: keyId.id }).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "corpName", errors: ["企业名称重复"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCorpName]);
|
||||
|
||||
const onValuesChange = (changed) => {
|
||||
if ("code" in changed)
|
||||
setCodeValue(changed.code ?? "");
|
||||
|
||||
if ("corpName" in changed)
|
||||
setCorpNameValue(changed.corpName ?? "");
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
|
|
@ -175,6 +226,7 @@ function CorpInfo(props) {
|
|||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
onValuesChange={onValuesChange}
|
||||
loading={
|
||||
deleteFileLoading
|
||||
|| uploadFileLoading
|
||||
|
|
@ -194,6 +246,16 @@ function CorpInfo(props) {
|
|||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
name: "corpState",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "社会统一信用代码",
|
||||
name: "code",
|
||||
|
|
@ -247,15 +309,6 @@ function CorpInfo(props) {
|
|||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
name: "corpState",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "map",
|
||||
customizeRender: true,
|
||||
|
|
@ -299,11 +352,10 @@ function CorpInfo(props) {
|
|||
label: "所属行业",
|
||||
name: "INDUSTRYALL",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="config_industry_enum"
|
||||
onGetNodePaths={(node) => {
|
||||
setIndustryData(node);
|
||||
console.log(node);
|
||||
<IndustrySelect
|
||||
onGetNodePaths={(data) => {
|
||||
console.log(data);
|
||||
setIndustryData(data);
|
||||
}}
|
||||
/>
|
||||
),
|
||||
|
|
@ -388,8 +440,7 @@ function CorpInfo(props) {
|
|||
name: "qrCode",
|
||||
label: "企业二维码",
|
||||
required: false,
|
||||
hidden: formValues => !(formValues.xgfState !== 2),
|
||||
render: () => (
|
||||
render: (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
|
|
@ -406,10 +457,14 @@ function CorpInfo(props) {
|
|||
onFinish={onSubmit}
|
||||
/>
|
||||
</div>
|
||||
<CorpInfoQrCode
|
||||
open={corpInfoQrCodeOpen}
|
||||
onCancel={() => setCorpInfoQrCodeOpen(false)}
|
||||
/>
|
||||
{ corpInfoQrCodeOpen
|
||||
&& (
|
||||
<CorpInfoQrCode
|
||||
open={corpInfoQrCodeOpen}
|
||||
row={info}
|
||||
onCancel={() => setCorpInfoQrCodeOpen(false)}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
@ -429,7 +484,7 @@ const CorpInfoQrCode = (props) => {
|
|||
onCancel={props.onCancel}
|
||||
>
|
||||
<QRCode
|
||||
value="-"
|
||||
value={JSON.stringify({ corpName: props.row.corpName, corpinfoId: props.row.corpinfoId })}
|
||||
style={{
|
||||
margin: "0 auto",
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -10,15 +10,19 @@ 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 { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_DEPARTMENT } from "~/enumerate/namespace";
|
||||
|
||||
function Department(props) {
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [selectedNodeId, setSelectedNodeId] = useState(null);
|
||||
const [selectedNodeName, setSelectedNodeName] = useState("");
|
||||
const { getUserInfo } = useGetUserInfo();
|
||||
|
||||
const [form] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(props["departmentList"], {
|
||||
form,
|
||||
|
|
@ -29,6 +33,15 @@ function Department(props) {
|
|||
};
|
||||
},
|
||||
});
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
getUserInfo().then((res) => {
|
||||
setSelectedNodeName(res.departmentName);
|
||||
});
|
||||
};
|
||||
|
||||
fetchData();
|
||||
}, []);
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeId(key);
|
||||
|
|
@ -41,9 +54,12 @@ function Department(props) {
|
|||
onOk: () => {
|
||||
props["departmentRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -75,13 +91,9 @@ function Department(props) {
|
|||
{
|
||||
name: "eqLevel",
|
||||
label: "部门级别",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [
|
||||
{
|
||||
name: "一级部门",
|
||||
bianma: "1",
|
||||
},
|
||||
],
|
||||
render: (
|
||||
<DictionarySelect dictValue="companyDepartmentLevel0000" />
|
||||
),
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
|
|
@ -104,6 +116,26 @@ function Department(props) {
|
|||
{
|
||||
title: "部门名称",
|
||||
dataIndex: "name",
|
||||
render: (_, record) => (
|
||||
<Button
|
||||
block
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setSelectedNodeId(record.id);
|
||||
getData();
|
||||
}}
|
||||
>
|
||||
{`${record.name}>`}
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "部门分责人",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
},
|
||||
{
|
||||
title: "部门排序",
|
||||
dataIndex: "depOrder",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
|
@ -118,7 +150,7 @@ function Department(props) {
|
|||
setSelectedNodeId(record.parentId);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
|
|
@ -135,20 +167,25 @@ function Department(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<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"]}
|
||||
selectedNodeName={selectedNodeName}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
setSelectedNodeId("");
|
||||
getData();
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -167,6 +204,9 @@ function AddModalComponent(props) {
|
|||
setParentName(res.data.parentName);
|
||||
});
|
||||
}
|
||||
else {
|
||||
setParentName(props.selectedNodeName);
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
form.resetFields();
|
||||
|
|
@ -180,13 +220,25 @@ function AddModalComponent(props) {
|
|||
nameKey: "dictLabel",
|
||||
});
|
||||
values.parentId = props.parentId;
|
||||
if (Number.isInteger(values.depOrder) && values.depOrder < 0) {
|
||||
message.error("部门排序请输入正整数!");
|
||||
return;
|
||||
}
|
||||
if (props.currentId) {
|
||||
values.parentId = props.parentId;
|
||||
values.id = props.currentId;
|
||||
await props.requestEdit(values);
|
||||
await props.requestEdit(values).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("编辑成功");
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
await props.requestAdd(values);
|
||||
await props.requestAdd(values).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("新增成功");
|
||||
}
|
||||
});
|
||||
}
|
||||
onCancel();
|
||||
props.getData();
|
||||
|
|
@ -205,6 +257,7 @@ function AddModalComponent(props) {
|
|||
span={24}
|
||||
values={{
|
||||
securityFlag: 0,
|
||||
superviseFlag: 0,
|
||||
}}
|
||||
options={[
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Form } 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";
|
||||
|
|
@ -18,7 +18,7 @@ function Department(props) {
|
|||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqQualificationinfoType: 1,
|
||||
eqQualificationinfoType: 2,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -87,6 +87,10 @@ function Department(props) {
|
|||
columns={[
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "userName",
|
||||
},
|
||||
{
|
||||
title: "证书名称",
|
||||
dataIndex: "qualificationName",
|
||||
},
|
||||
{
|
||||
|
|
@ -99,16 +103,16 @@ function Department(props) {
|
|||
},
|
||||
{
|
||||
title: "就职状态",
|
||||
dataIndex: "certificateNo",
|
||||
render: (_, record) => (
|
||||
<sapn>
|
||||
{record.employmentFlag === 1
|
||||
? "就职"
|
||||
: record.employmentFlag === 0
|
||||
? "离职"
|
||||
: ""}
|
||||
</sapn>
|
||||
),
|
||||
dataIndex: "employmentFlagName",
|
||||
render: (value) => {
|
||||
if (value === "在职") {
|
||||
return <Tag color="success">在职</Tag>;
|
||||
}
|
||||
if (value === "离职") {
|
||||
return <Tag color="error">离职</Tag>;
|
||||
}
|
||||
return <Tag color="default">未知</Tag>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Form } 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";
|
||||
|
|
@ -87,6 +87,10 @@ function Department(props) {
|
|||
columns={[
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "userName",
|
||||
},
|
||||
{
|
||||
title: "证书名称",
|
||||
dataIndex: "qualificationName",
|
||||
},
|
||||
{
|
||||
|
|
@ -103,16 +107,16 @@ function Department(props) {
|
|||
},
|
||||
{
|
||||
title: "就职状态",
|
||||
dataIndex: "certificateNo",
|
||||
render: (_, record) => (
|
||||
<sapn>
|
||||
{record.employmentFlag === 1
|
||||
? "就职"
|
||||
: record.employmentFlag === 0
|
||||
? "离职"
|
||||
: ""}
|
||||
</sapn>
|
||||
),
|
||||
dataIndex: "employmentFlagName",
|
||||
render: (value) => {
|
||||
if (value === "在职") {
|
||||
return <Tag color="success">在职</Tag>;
|
||||
}
|
||||
if (value === "离职") {
|
||||
return <Tag color="error">离职</Tag>;
|
||||
}
|
||||
return <Tag color="default">未知</Tag>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
|||
import useUploadFile from "zy-react-library/hooks/useUploadFile";
|
||||
import nation from "zy-react-library/json/nation.json";
|
||||
import { ID_NUMBER } from "zy-react-library/regular";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
|
||||
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
import { getAgeByIdCard, getBirthDateFromIdCard, useDebounce } from "~/utils";
|
||||
|
||||
export const WHETHER_ENUM = [
|
||||
{
|
||||
|
|
@ -32,11 +32,11 @@ export const WHETHER_ENUM = [
|
|||
export const SEX_ENUM = [
|
||||
{
|
||||
name: "男",
|
||||
bianma: "0",
|
||||
bianma: "1",
|
||||
},
|
||||
{
|
||||
name: "女",
|
||||
bianma: "1",
|
||||
bianma: "0",
|
||||
},
|
||||
];
|
||||
export const MARITAL_STATUS_ENUM = [
|
||||
|
|
@ -60,6 +60,12 @@ function Add(props) {
|
|||
const { loading: deleteFileLoading, deleteFile } = useDeleteFile();
|
||||
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
const [userIdCardValue, setUserIdCardValue] = useState(null);
|
||||
const [usernameValue, setUsernameValue] = useState(null);
|
||||
const [phoneValue, setPhoneValue] = useState(null);
|
||||
const debouncedUserIdCard = useDebounce(userIdCardValue, 600);
|
||||
const debouncedUsernameValue = useDebounce(usernameValue, 600);
|
||||
const debouncedPhoneValueValue = useDebounce(phoneValue, 600);
|
||||
useEffect(() => {
|
||||
console.log(queryParams["id"]);
|
||||
if (queryParams["id"]) {
|
||||
|
|
@ -67,6 +73,9 @@ function Add(props) {
|
|||
const { data } = await props["userDetails"]({
|
||||
id: queryParams["id"],
|
||||
});
|
||||
form.setFieldValue("sex", idCardGetDateAndGender(data.userIdCard).sex);
|
||||
form.setFieldValue("age", getAgeByIdCard(data.userIdCard));
|
||||
form.setFieldValue("birthday", getBirthDateFromIdCard(data.userIdCard));
|
||||
setUserID(data.userId);
|
||||
const userImg = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["13"],
|
||||
|
|
@ -135,6 +144,10 @@ function Add(props) {
|
|||
foreignKey: userID,
|
||||
},
|
||||
});
|
||||
if (Number.isInteger(values.age) && values.age < 0) {
|
||||
message.error("年龄请输入正整数!");
|
||||
return;
|
||||
}
|
||||
if (queryParams["id"]) {
|
||||
values.id = queryParams["id"];
|
||||
values.userId = userID;
|
||||
|
|
@ -154,6 +167,62 @@ function Add(props) {
|
|||
});
|
||||
}
|
||||
};
|
||||
// 校验身份证重复
|
||||
useEffect(() => {
|
||||
if (!debouncedUserIdCard) {
|
||||
form.setFields([{ name: "userIdCard", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ userIdCard: debouncedUserIdCard, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "userIdCard", errors: ["身份证号重复"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedUserIdCard]);
|
||||
|
||||
// 校验用户名重复
|
||||
useEffect(() => {
|
||||
if (!debouncedUsernameValue) {
|
||||
form.setFields([{ name: "username", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ username: debouncedUsernameValue, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "username", errors: ["用户名重复"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedUsernameValue]);
|
||||
|
||||
// 校验用户名重复
|
||||
useEffect(() => {
|
||||
if (!debouncedPhoneValueValue) {
|
||||
form.setFields([{ name: "phone", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ phone: debouncedPhoneValueValue, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
if (!res.success) {
|
||||
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);
|
||||
form.setFieldValue("age", getAgeByIdCard(newIdCard));
|
||||
form.setFieldValue("birthday", getBirthDateFromIdCard(newIdCard));
|
||||
}
|
||||
}
|
||||
if ("username" in changedValues) {
|
||||
setUsernameValue(changedValues.username ?? "");
|
||||
}
|
||||
if ("phone" in changedValues) {
|
||||
setPhoneValue(changedValues.phone ?? "");
|
||||
}
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title={queryParams["id"] ? "编辑" : "新增"} />
|
||||
|
|
@ -164,9 +233,8 @@ function Add(props) {
|
|||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
values={{
|
||||
sex: "0",
|
||||
}}
|
||||
|
||||
onValuesChange={onValuesChange}
|
||||
loading={
|
||||
deleteFileLoading
|
||||
|| uploadFileLoading
|
||||
|
|
@ -177,7 +245,7 @@ function Add(props) {
|
|||
{
|
||||
label: "用户照片",
|
||||
name: "userImg",
|
||||
span: 24,
|
||||
span: 12,
|
||||
render: (
|
||||
<Upload
|
||||
size={4}
|
||||
|
|
@ -203,30 +271,6 @@ function Add(props) {
|
|||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
name: "username",
|
||||
label: "用户名",
|
||||
tip: "* 如果修改手机号,登录密码则会变成初始密码“Aa@123456789”",
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "departmentId",
|
||||
label: "所属部门",
|
||||
render: <DepartmentSelectTree />,
|
||||
},
|
||||
{
|
||||
name: "userIdCard",
|
||||
label: "身份证号",
|
||||
rules: [
|
||||
{
|
||||
pattern: ID_NUMBER,
|
||||
message: "请输入正确的身份证号",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "cardImg",
|
||||
label: "身份证照片",
|
||||
|
|
@ -254,6 +298,31 @@ function Add(props) {
|
|||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
name: "username",
|
||||
label: "用户名",
|
||||
tip: "* 如果修改手机号,登录密码则会变成初始密码“Aa12345678”",
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "departmentId",
|
||||
label: "所属部门",
|
||||
render: <DepartmentSelectTree />,
|
||||
},
|
||||
{
|
||||
name: "userIdCard",
|
||||
label: "身份证号",
|
||||
rules: [
|
||||
{
|
||||
pattern: ID_NUMBER,
|
||||
message: "请输入正确的身份证号",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
name: "email",
|
||||
label: "电子邮箱",
|
||||
|
|
@ -282,14 +351,20 @@ function Add(props) {
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "dateOfBirth",
|
||||
name: "birthday",
|
||||
label: "出生年月",
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "age",
|
||||
label: "年龄",
|
||||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
componentProps: {
|
||||
disabled: true,
|
||||
},
|
||||
|
||||
},
|
||||
{
|
||||
name: "locationAddress",
|
||||
|
|
@ -329,7 +404,8 @@ function Add(props) {
|
|||
/>
|
||||
),
|
||||
},
|
||||
// { name: "deputyLeaderFlag", label: "是否为分管领导", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM },
|
||||
// { name: "deputyLeaderFlag", label: "是否为
|
||||
// 分管领导", required: false, render: FORM_ITEM_RENDER_ENUM.RADIO, items: WHETHER_ENUM },
|
||||
// {
|
||||
// name: "politicalTime",
|
||||
// label: "入党时间",
|
||||
|
|
|
|||
|
|
@ -4,13 +4,15 @@ import { useEffect, useState } from "react";
|
|||
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 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 useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
function List(props) {
|
||||
|
|
@ -25,15 +27,23 @@ function List(props) {
|
|||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
userType: 3,
|
||||
allFlag: 1,
|
||||
};
|
||||
},
|
||||
});
|
||||
const onResetPassword = () => {
|
||||
const onResetPassword = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定要重置密码为Aa@123456789吗?",
|
||||
content: "确定要重置密码为Aa12345678吗?",
|
||||
onOk: () => {
|
||||
message.success("重置密码成功");
|
||||
props["userChangePassword"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("重置密码成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -44,9 +54,12 @@ function List(props) {
|
|||
onOk: () => {
|
||||
props["userRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -77,13 +90,23 @@ function List(props) {
|
|||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "name",
|
||||
name: "likeName",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
name: "userIdCard",
|
||||
name: "likeUserIdCard",
|
||||
label: "身份证号",
|
||||
},
|
||||
{
|
||||
name: "eqPersonnelType",
|
||||
label: "人员类型",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="renyuanleixing"
|
||||
|
||||
/>
|
||||
),
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -118,6 +141,10 @@ function List(props) {
|
|||
title: "岗位",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "人员类型",
|
||||
dataIndex: "personnelTypeName",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 600,
|
||||
|
|
@ -181,17 +208,21 @@ function List(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
|
@ -230,7 +261,7 @@ function AddModalComponent(props) {
|
|||
<Modal
|
||||
open={props.open}
|
||||
title="查看"
|
||||
width={900}
|
||||
width={1200}
|
||||
okButtonProps={{
|
||||
style: {
|
||||
display: "none",
|
||||
|
|
@ -261,14 +292,14 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: info.sex,
|
||||
children: idCardGetDateAndGender(info.userIdCard).sex === "1" ? "男" : idCardGetDateAndGender(info.userIdCard).sex === "0" ? "女" : "",
|
||||
},
|
||||
{
|
||||
label: "出生年月",
|
||||
children: info.dateOfBirth,
|
||||
children: info.birthday,
|
||||
},
|
||||
{
|
||||
label: "出生年月",
|
||||
label: "年龄",
|
||||
children: info.age,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Modal, Space } from "antd";
|
||||
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";
|
||||
|
|
@ -8,7 +8,6 @@ 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 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";
|
||||
|
|
@ -44,6 +43,11 @@ function Department(props) {
|
|||
onOk: () => {
|
||||
props["userQualificationInfoRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
getData();
|
||||
},
|
||||
|
|
@ -129,7 +133,7 @@ function Department(props) {
|
|||
columns={[
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "qualificationName",
|
||||
dataIndex: "userName",
|
||||
},
|
||||
{
|
||||
title: "证书名称",
|
||||
|
|
@ -142,15 +146,15 @@ function Department(props) {
|
|||
{
|
||||
title: "就职状态",
|
||||
dataIndex: "certificateNo",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{record.employmentFlag === 1
|
||||
? "就职"
|
||||
: record.employmentFlag === 0
|
||||
? "离职"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
render: (value) => {
|
||||
if (value === "在职") {
|
||||
return <Tag color="success">在职</Tag>;
|
||||
}
|
||||
if (value === "离职") {
|
||||
return <Tag color="error">离职</Tag>;
|
||||
}
|
||||
return <Tag color="default">未知</Tag>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
|
|
@ -183,7 +187,7 @@ function Department(props) {
|
|||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
|
|
@ -200,19 +204,22 @@ function Department(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
);
|
||||
|
|
@ -319,12 +326,12 @@ function AddModalComponent(props) {
|
|||
name: "certificateNo",
|
||||
label: "证书编号",
|
||||
},
|
||||
{
|
||||
name: "remarks",
|
||||
label: "备注",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||
},
|
||||
// {
|
||||
// name: "remarks",
|
||||
// label: "备注",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||
// },
|
||||
{
|
||||
name: "cardImg",
|
||||
required: false,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Modal, Space } from "antd";
|
||||
import { Button, Form, message, Modal, Space, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
|
|
@ -9,7 +9,6 @@ import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
|||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import Upload from "zy-react-library/components/Upload";
|
||||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import { UPLOAD_FILE_TYPE_ENUM } from "zy-react-library/enum/uploadFile/gwj";
|
||||
|
||||
import useDeleteFile from "zy-react-library/hooks/useDeleteFile";
|
||||
|
|
@ -47,6 +46,11 @@ function Department(props) {
|
|||
onOk: () => {
|
||||
props["userQualificationInfoRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
getData();
|
||||
},
|
||||
|
|
@ -131,7 +135,7 @@ function Department(props) {
|
|||
columns={[
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "qualificationName",
|
||||
dataIndex: "userName",
|
||||
},
|
||||
{
|
||||
title: "证书名称",
|
||||
|
|
@ -152,15 +156,15 @@ function Department(props) {
|
|||
{
|
||||
title: "就职状态",
|
||||
dataIndex: "certificateNo",
|
||||
render: (_, record) => (
|
||||
<sapn>
|
||||
{record.employmentFlag === 1
|
||||
? "就职"
|
||||
: record.employmentFlag === 0
|
||||
? "离职"
|
||||
: ""}
|
||||
</sapn>
|
||||
),
|
||||
render: (value) => {
|
||||
if (value === "在职") {
|
||||
return <Tag color="success">在职</Tag>;
|
||||
}
|
||||
if (value === "离职") {
|
||||
return <Tag color="error">离职</Tag>;
|
||||
}
|
||||
return <Tag color="default">未知</Tag>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
|
|
@ -193,7 +197,7 @@ function Department(props) {
|
|||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
|
|
@ -210,20 +214,26 @@ function Department(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
);
|
||||
|
|
@ -238,6 +248,7 @@ function AddModalComponent(props) {
|
|||
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
const [deleteCardImageFiles, setDeleteCardImageFiles] = useState([]);
|
||||
const [operatingProjectType, setOperatingProjectType] = useState("");
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
|
|
@ -248,6 +259,7 @@ function AddModalComponent(props) {
|
|||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: data.userQualificationinfoId,
|
||||
});
|
||||
setOperatingProjectType(data.qualificationinfoCategory);
|
||||
data.cardImg = cardImg;
|
||||
form.setFieldsValue(data);
|
||||
setUserQualificationinfoId(data.userQualificationinfoId);
|
||||
|
|
@ -264,7 +276,6 @@ function AddModalComponent(props) {
|
|||
single: false,
|
||||
files: deleteCardImageFiles,
|
||||
});
|
||||
values.corpinfoId = queryParams["corpinfoId"];
|
||||
values.userId = queryParams["id"];
|
||||
values.qualificationinfoType = 1;
|
||||
values.userQualificationinfoId = userQualificationinfoId;
|
||||
|
|
@ -300,6 +311,16 @@ function AddModalComponent(props) {
|
|||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
const onValuesChange = (changedValues) => {
|
||||
if ("qualificationinfoCategory" in changedValues) {
|
||||
const newIdCard = changedValues.qualificationinfoCategory;
|
||||
if (newIdCard) {
|
||||
setOperatingProjectType(newIdCard);
|
||||
form.setFieldsValue({ operatingProject: undefined });
|
||||
console.log(newIdCard);
|
||||
}
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
|
|
@ -312,12 +333,12 @@ function AddModalComponent(props) {
|
|||
onCancel={onCancel}
|
||||
>
|
||||
<FormBuilder
|
||||
s
|
||||
form={form}
|
||||
span={24}
|
||||
values={{
|
||||
securityFlag: 0,
|
||||
}}
|
||||
onValuesChange={onValuesChange}
|
||||
options={[
|
||||
{
|
||||
name: "qualificationName",
|
||||
|
|
@ -325,7 +346,6 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
name: "qualificationinfoCategory",
|
||||
required: false,
|
||||
label: "证书作业类别",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
|
|
@ -338,11 +358,10 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
name: "operatingProject",
|
||||
required: false,
|
||||
label: "操作项目",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="DGZY_dgzy"
|
||||
dictValue={operatingProjectType}
|
||||
onGetData={(data) => {
|
||||
setOperatingPrData(data);
|
||||
}}
|
||||
|
|
@ -353,12 +372,12 @@ function AddModalComponent(props) {
|
|||
name: "certificateNo",
|
||||
label: "证书编号",
|
||||
},
|
||||
{
|
||||
name: "remarks",
|
||||
label: "备注",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||
},
|
||||
// {
|
||||
// name: "remarks",
|
||||
// label: "备注",
|
||||
// required: false,
|
||||
// render: FORM_ITEM_RENDER_ENUM.TEXTAREA,
|
||||
// },
|
||||
{
|
||||
name: "cardImg",
|
||||
required: false,
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ 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";
|
||||
|
||||
const ENTERPRISE_TYPE = [
|
||||
{
|
||||
|
|
@ -77,13 +77,16 @@ function List(props) {
|
|||
const onResetPassword = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "是否重置密码为Bb@123456789?",
|
||||
content: "是否重置密码为Aa12345678?",
|
||||
onOk: () => {
|
||||
props["corpInfoChangePassword"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("重置密码成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("重置密码成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -94,9 +97,12 @@ function List(props) {
|
|||
onOk: () => {
|
||||
props["corpInfoRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -288,27 +294,37 @@ function List(props) {
|
|||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
loading={props.enterprise.enterpriseLoading}
|
||||
getData={getData}
|
||||
openType={openType}
|
||||
currentId={currentId}
|
||||
requestAdd={props["corpInfoAdd"]}
|
||||
requestEdit={props["corpInfoEdit"]}
|
||||
requestDetails={props["corpInfoRemoveDetails"]}
|
||||
requestChangeCompanyName={props["corpInfoChangeCompanyName"]}
|
||||
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>
|
||||
);
|
||||
}
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
console.log(props.loading);
|
||||
const [codeValue, setCodeValue] = useState("");
|
||||
const [corpNameValue, setCorpNameValue] = useState("");
|
||||
const debouncedCode = useDebounce(codeValue, 600);
|
||||
const debouncedCorpName = useDebounce(corpNameValue, 600);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
props
|
||||
|
|
@ -343,18 +359,55 @@ function AddModalComponent(props) {
|
|||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
// 校验社会统一信用代码重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCode) {
|
||||
form.setFields([{ name: "code", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props.requestCorplnfoCheckCorpcode({ code: debouncedCode, id: props.currentId }).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "code", errors: ["该社会统一信用代码已被其他企业使用"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCode]);
|
||||
|
||||
// 校验企业名称重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCorpName) {
|
||||
form.setFields([{ name: "corpName", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props.requestCorplnfoCheckCorpName({ corpName: debouncedCorpName, id: props.currentId }).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "corpName", errors: ["企业名称重复"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCorpName]);
|
||||
|
||||
const onValuesChange = (changed) => {
|
||||
console.log(changed);
|
||||
if ("code" in changed)
|
||||
setCodeValue(changed.code ?? "");
|
||||
|
||||
if ("corpName" in changed)
|
||||
setCorpNameValue(changed.corpName ?? "");
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
title={props.currentId ? "编辑" : "新增"}
|
||||
width={800}
|
||||
loading={props.loading}
|
||||
|
||||
onOk={form.submit}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
span={24}
|
||||
|
||||
onValuesChange={onValuesChange}
|
||||
loading={props.loading}
|
||||
options={[
|
||||
{
|
||||
name: "corpName",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ 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,
|
||||
|
|
@ -39,7 +38,7 @@ function View(props) {
|
|||
const [info, setInfo] = useState({});
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props.corpInfoRemoveDetails({
|
||||
const res = await props.corpInfoDetails({
|
||||
id: queryParams["id"],
|
||||
});
|
||||
setInfo(res.data);
|
||||
|
|
|
|||
|
|
@ -21,14 +21,27 @@ const ENTERPRISE_TYPE = [
|
|||
];
|
||||
const BRANCH_CONPANY_STATUS = [
|
||||
{
|
||||
bianma: 1,
|
||||
bianma: "filialstate01",
|
||||
name: "在产",
|
||||
},
|
||||
{
|
||||
bianma: 0,
|
||||
bianma: "filialstate02",
|
||||
name: "在建",
|
||||
},
|
||||
{
|
||||
bianma: "filialstate03",
|
||||
name: "代建",
|
||||
},
|
||||
{
|
||||
bianma: "filialstate04",
|
||||
name: "停产",
|
||||
},
|
||||
{
|
||||
bianma: "filialstate05",
|
||||
name: "破产",
|
||||
},
|
||||
];
|
||||
|
||||
const STATUS = [
|
||||
{
|
||||
bianma: 1,
|
||||
|
|
@ -75,13 +88,13 @@ function List(props) {
|
|||
label: "分公司名称",
|
||||
},
|
||||
{
|
||||
name: "corpState",
|
||||
name: "eqCorpState",
|
||||
label: "分公司状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: BRANCH_CONPANY_STATUS,
|
||||
},
|
||||
{
|
||||
name: "useFlag",
|
||||
name: "eqUseFlag",
|
||||
label: "启用状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: STATUS,
|
||||
|
|
@ -123,13 +136,19 @@ function List(props) {
|
|||
title: "列表排序",
|
||||
dataIndex: "corpOrder",
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
dataIndex: "corpOrder",
|
||||
render: (_, record) => (
|
||||
<div>{record.useFlag === 0 ? "停用" : record.useFlag === 1 ? "启用" : ""}</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() =>
|
||||
props.history.push(`./View?id=${record.id}`)}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Descriptions, Form, Modal, Space } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
|
@ -20,8 +20,7 @@ function View(props) {
|
|||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqParentId: selectedNodeId,
|
||||
eqCorpInfoId: queryParams["id"],
|
||||
eqCorpinfoId: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -31,69 +30,77 @@ function View(props) {
|
|||
getData();
|
||||
};
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
|
||||
<HeaderBack title="查看" />
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
gap: 20,
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<LeftTree onSelect={onTreeChange} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
display: "flex",
|
||||
gap: 20,
|
||||
}}
|
||||
>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "部门名称",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "负责人",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "部门级别",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
<LeftTree onSelect={onTreeChange} params={{ eqCorpinfoId: queryParams["id"] }} />
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
}}
|
||||
>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "部门名称",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "部门级别",
|
||||
dataIndex: "name",
|
||||
},
|
||||
{
|
||||
title: "部门分责人",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
},
|
||||
{
|
||||
title: "部门排序",
|
||||
dataIndex: "depOrder",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["departmentDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["departmentDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,9 +65,12 @@ function List(props) {
|
|||
return {
|
||||
...formData,
|
||||
enterpriseType: 2,
|
||||
geCreateDate: formData.eqCreateDate?.[0],
|
||||
leCreateDate: formData.eqCreateDate?.[1],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [selectedLng, setSelectedLng] = useState("");
|
||||
const [selectedLat, setSelectedLat] = useState("");
|
||||
|
|
@ -78,13 +81,18 @@ function List(props) {
|
|||
setRowData(row);
|
||||
setVisible(true);
|
||||
};
|
||||
const handleConfirm = (lng, lat) => {
|
||||
const handleConfirm = (lng, lat, extra) => {
|
||||
console.log("选中的坐标:", lng, lat);
|
||||
console.log(extra);
|
||||
console.log(rowData);
|
||||
rowData.latitude = lng;
|
||||
rowData.longitude = lat;
|
||||
props["corpInfoEdit"](rowData).then(() => {
|
||||
message.success("定位成功!");
|
||||
rowData.latitude = lat;
|
||||
rowData.longitude = lng;
|
||||
rowData.areaCode = extra.area;
|
||||
rowData.areaName = extra.area === "1" ? "东港区" : extra.area === "2" ? "西港区" : "";
|
||||
props["corpInfoEdit"](rowData).then((res) => {
|
||||
if (res.errMessage) {
|
||||
message.success("定位成功!");
|
||||
}
|
||||
});
|
||||
// props.
|
||||
};
|
||||
|
|
@ -101,10 +109,6 @@ function List(props) {
|
|||
name: "likecorpName",
|
||||
label: "分公司名称",
|
||||
},
|
||||
{
|
||||
name: "likeCorpAccount",
|
||||
label: "登录账号",
|
||||
},
|
||||
{
|
||||
label: "所属区域",
|
||||
required: false,
|
||||
|
|
@ -144,7 +148,7 @@ function List(props) {
|
|||
{
|
||||
name: "eqCreateDate",
|
||||
label: "成立时间",
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE,
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
|
||||
},
|
||||
{
|
||||
name: "eqRegcapital",
|
||||
|
|
@ -155,7 +159,7 @@ function List(props) {
|
|||
label: "固定资产",
|
||||
},
|
||||
{
|
||||
name: "enterpriseType",
|
||||
name: "eqType",
|
||||
label: "企业类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_TYPE,
|
||||
|
|
@ -271,8 +275,11 @@ function List(props) {
|
|||
visible={visible}
|
||||
latitude={selectedLat}
|
||||
longitude={selectedLng}
|
||||
showArea
|
||||
area={rowData.areaCode}
|
||||
onClose={() => setVisible(false)}
|
||||
onConfirm={handleConfirm}
|
||||
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -5,13 +5,16 @@ import HeaderBack from "zy-react-library/components/HeaderBack";
|
|||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import { 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) {
|
||||
const [info, setInfo] = useState({});
|
||||
const queryParams = useGetUrlQuery();
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
const getCorpTypeNamePath = (item) => {
|
||||
const names = [
|
||||
item.corpTypeName,
|
||||
|
|
@ -23,9 +26,15 @@ function View(props) {
|
|||
};
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props.corpInfoRemoveDetails({
|
||||
const res = await props.corpInfoDetails({
|
||||
id: queryParams["id"],
|
||||
});
|
||||
const licenseFile = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["6"],
|
||||
eqForeignKey: res.data.corpinfoId,
|
||||
});
|
||||
|
||||
res.data.licenseFile = licenseFile;
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
|
|
@ -39,11 +48,17 @@ function View(props) {
|
|||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
|
||||
items={[
|
||||
{
|
||||
label: "企业名称",
|
||||
children: info.corpName && info.corpName,
|
||||
},
|
||||
{
|
||||
label: "企业名称",
|
||||
children: info.corpName && info.corpName,
|
||||
},
|
||||
|
||||
{
|
||||
label: "统一社会信用代码",
|
||||
children: info.code,
|
||||
|
|
@ -64,6 +79,19 @@ function View(props) {
|
|||
label: "规模",
|
||||
children: info.scaleName,
|
||||
},
|
||||
{
|
||||
label: "是否规模以上",
|
||||
children: (
|
||||
<div>
|
||||
{info.scaleType === 1
|
||||
? "是"
|
||||
: info.scaleType === 0
|
||||
? "否"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
label: "经度",
|
||||
children: info.longitude,
|
||||
|
|
@ -120,18 +148,7 @@ function View(props) {
|
|||
label: "安全负责人手机号",
|
||||
children: info.safetyPhone,
|
||||
},
|
||||
{
|
||||
label: "是否规模以上",
|
||||
children: (
|
||||
<div>
|
||||
{info.scaleType === 1
|
||||
? "是"
|
||||
: info.scaleType === 0
|
||||
? "否"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
label: "企事业单位经营地址",
|
||||
children: info.addressBusiness,
|
||||
|
|
@ -142,7 +159,7 @@ function View(props) {
|
|||
},
|
||||
{
|
||||
label: "营业执照",
|
||||
children: "Zhou",
|
||||
children: <TooltipPreviewImg files={info.licenseFile} />,
|
||||
},
|
||||
{
|
||||
label: "营业执照有效期",
|
||||
|
|
|
|||
|
|
@ -61,18 +61,18 @@ function List(props) {
|
|||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "name",
|
||||
name: "likeCorpName",
|
||||
label: "分公司名称",
|
||||
placeholder: "请输入分公司名称,支持模糊搜索",
|
||||
placeholder: "请输入分公司名称",
|
||||
},
|
||||
{
|
||||
name: "corpState",
|
||||
name: "eqCorpState",
|
||||
label: "公司状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_STATUS,
|
||||
},
|
||||
{
|
||||
name: "useFlag",
|
||||
name: "eqUseFlag",
|
||||
label: "启用状态",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: USER_FLAG,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ import Table from "zy-react-library/components/Table";
|
|||
import useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
|
||||
import { 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();
|
||||
|
|
@ -21,7 +23,7 @@ function List(props) {
|
|||
return {
|
||||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
corpinfoId: queryParams["id"],
|
||||
eqCorpinfoId: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -108,7 +110,7 @@ function AddModalComponent(props) {
|
|||
const res = await props.requestDetails({
|
||||
id: props.currentId,
|
||||
});
|
||||
console.log(res.data);
|
||||
res.data.userAvatarUrl = [{ filePath: res.data.userAvatarUrl }];
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
|
|
@ -183,11 +185,11 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: info.sex,
|
||||
children: idCardGetDateAndGender(info.userIdCard).sex === "1" ? "男" : idCardGetDateAndGender(info.userIdCard).sex === "0" ? "女" : "",
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: info.nationName,
|
||||
children: <TooltipPreviewImg files={info.userAvatarUrl} />,
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
|
|
|
|||
|
|
@ -5,10 +5,12 @@ 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 useTable from "zy-react-library/hooks/useTable";
|
||||
import { idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
|
||||
const USER_TYPE = [
|
||||
|
|
@ -168,11 +170,11 @@ function AddModalComponent(props) {
|
|||
const res = await props.requestDetails({
|
||||
id: props.currentId,
|
||||
});
|
||||
console.log(res.data);
|
||||
res.data.userAvatarUrl = [{ filePath: res.data.userAvatarUrl }];
|
||||
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
console.log(info);
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
|
|
@ -244,11 +246,11 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: info.sex,
|
||||
children: idCardGetDateAndGender(info.userIdCard).sex === "1" ? "男" : idCardGetDateAndGender(info.userIdCard).sex === "0" ? "女" : "",
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: info.nationName,
|
||||
children: <TooltipPreviewImg files={info.userAvatarUrl} />,
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import useTable from "zy-react-library/hooks/useTable";
|
|||
import { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
import { useDebounce } from "~/utils";
|
||||
|
||||
const ENTERPRISE_TYPE = [
|
||||
{
|
||||
|
|
@ -35,6 +36,10 @@ function List(props) {
|
|||
return {
|
||||
...formData,
|
||||
enterpriseType: 3,
|
||||
|
||||
geCreateTime: formData.CreateTime?.[0],
|
||||
leCreateTime: formData.CreateTime?.[1],
|
||||
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -43,13 +48,16 @@ function List(props) {
|
|||
const onResetPassword = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "是否重置密码为Bb@123456789?",
|
||||
content: "是否重置密码为Aa12345678?",
|
||||
onOk: () => {
|
||||
props["corpInfoChangePassword"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("重置密码成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("重置密码成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -60,9 +68,12 @@ function List(props) {
|
|||
onOk: () => {
|
||||
props["corpInfoRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -76,19 +87,30 @@ function List(props) {
|
|||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "corpName",
|
||||
name: "likecorpName",
|
||||
label: "分公司名称",
|
||||
},
|
||||
{
|
||||
name: "cityName",
|
||||
name: "eqCity",
|
||||
label: "属地",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="res_region_enum"
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
name: "eqtype",
|
||||
name: "CreateTime",
|
||||
label: "开户时间",
|
||||
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
|
||||
},
|
||||
{
|
||||
name: "eqType",
|
||||
label: "相关方企业类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: ENTERPRISE_TYPE,
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -106,12 +128,12 @@ function List(props) {
|
|||
)}
|
||||
columns={[
|
||||
{
|
||||
title: "单位名称",
|
||||
title: "分公司名称",
|
||||
dataIndex: "corpName",
|
||||
},
|
||||
{
|
||||
title: "属地",
|
||||
dataIndex: "corpName",
|
||||
dataIndex: "cityName",
|
||||
},
|
||||
{
|
||||
title: "开户人",
|
||||
|
|
@ -123,7 +145,7 @@ function List(props) {
|
|||
},
|
||||
{
|
||||
title: "开户时间",
|
||||
dataIndex: "createDate",
|
||||
dataIndex: "createTime",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
|
@ -164,24 +186,34 @@ function List(props) {
|
|||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestAdd={props["corpInfoAdd"]}
|
||||
requestEdit={props["corpInfoEdit"]}
|
||||
requestDetails={props["corpInfoRemoveDetails"]}
|
||||
requestChangeCompanyName={props["corpInfoChangeCompanyName"]}
|
||||
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>
|
||||
);
|
||||
}
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [codeValue, setCodeValue] = useState("");
|
||||
const [corpNameValue, setCorpNameValue] = useState("");
|
||||
const debouncedCode = useDebounce(codeValue, 600);
|
||||
const debouncedCorpName = useDebounce(corpNameValue, 600);
|
||||
console.log(props);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
|
|
@ -209,6 +241,40 @@ function AddModalComponent(props) {
|
|||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
|
||||
// 校验社会统一信用代码重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCode) {
|
||||
form.setFields([{ name: "code", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props.requestCorplnfoCheckCorpcode({ code: debouncedCode, id: props.currentId }).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "code", errors: ["该社会统一信用代码已被其他企业使用"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCode]);
|
||||
|
||||
// 校验企业名称重复
|
||||
useEffect(() => {
|
||||
if (!debouncedCorpName) {
|
||||
form.setFields([{ name: "corpName", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props.requestCorplnfoCheckCorpName({ corpName: debouncedCorpName, id: props.currentId }).then((res) => {
|
||||
if (!res.data) {
|
||||
form.setFields([{ name: "corpName", errors: ["企业名称重复"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedCorpName]);
|
||||
|
||||
const onValuesChange = (changed) => {
|
||||
if ("code" in changed)
|
||||
setCodeValue(changed.code ?? "");
|
||||
|
||||
if ("corpName" in changed)
|
||||
setCorpNameValue(changed.corpName ?? "");
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
|
|
@ -219,6 +285,7 @@ function AddModalComponent(props) {
|
|||
>
|
||||
<FormBuilder
|
||||
form={form}
|
||||
onValuesChange={onValuesChange}
|
||||
span={24}
|
||||
options={[
|
||||
{
|
||||
|
|
@ -236,7 +303,7 @@ function AddModalComponent(props) {
|
|||
],
|
||||
},
|
||||
{
|
||||
name: "eqEcoType",
|
||||
name: "ecoType",
|
||||
label: "经济类型",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
|
|
|
|||
|
|
@ -1,22 +1,33 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Descriptions, Divider } from "antd";
|
||||
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 useGetUrlQuery from "zy-react-library/hooks/useGetUrlQuery";
|
||||
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) {
|
||||
const [info, setInfo] = useState({});
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
const [corpInfoQrCodeOpen, setCorpInfoQrCodeOpen] = useState(false);
|
||||
const queryParams = useGetUrlQuery();
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
const res = await props.corpInfoRemoveDetails({
|
||||
const res = await props.corpInfoDetails({
|
||||
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,它还是旧的
|
||||
};
|
||||
fetchData();
|
||||
|
|
@ -32,9 +43,10 @@ function View(props) {
|
|||
<Divider orientation="left">基本信息</Divider>
|
||||
<Descriptions
|
||||
bordered
|
||||
loading={getFileLoading}
|
||||
items={[
|
||||
{
|
||||
label: "单位名称",
|
||||
label: "企业名称",
|
||||
children: info.corpName && info.corpName,
|
||||
},
|
||||
{
|
||||
|
|
@ -49,6 +61,10 @@ function View(props) {
|
|||
label: "统一社会信用代码",
|
||||
children: info.code,
|
||||
},
|
||||
{
|
||||
label: "成立日期",
|
||||
children: info.createDate,
|
||||
},
|
||||
{
|
||||
label: "属地",
|
||||
children: info.cityName,
|
||||
|
|
@ -109,6 +125,22 @@ function View(props) {
|
|||
label: "经济类型",
|
||||
children: info.ecoTypeName,
|
||||
},
|
||||
{
|
||||
label: "企业二维码",
|
||||
|
||||
children: (
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setCorpInfoQrCodeOpen(true);
|
||||
}}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
),
|
||||
|
||||
},
|
||||
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
|
|
@ -117,18 +149,12 @@ function View(props) {
|
|||
/>
|
||||
<Divider orientation="left">营业执照</Divider>
|
||||
<Descriptions
|
||||
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "营业执照",
|
||||
children: "Zhou",
|
||||
render: (
|
||||
<TooltipPreviewImg
|
||||
files={{
|
||||
file: "",
|
||||
}}
|
||||
/>
|
||||
),
|
||||
children: <TooltipPreviewImg files={info.licenseFile} />,
|
||||
},
|
||||
{
|
||||
label: "营业执照有效期",
|
||||
|
|
@ -141,7 +167,39 @@ function View(props) {
|
|||
}}
|
||||
/>
|
||||
</div>
|
||||
{ corpInfoQrCodeOpen
|
||||
&& (
|
||||
<CorpInfoQrCode
|
||||
open={corpInfoQrCodeOpen}
|
||||
row={info}
|
||||
onCancel={() => setCorpInfoQrCodeOpen(false)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const CorpInfoQrCode = (props) => {
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
title="企业二维码"
|
||||
footer={[
|
||||
<Button
|
||||
key="cancel"
|
||||
onClick={props.onCancel}
|
||||
>
|
||||
关闭
|
||||
</Button>,
|
||||
]}
|
||||
onCancel={props.onCancel}
|
||||
>
|
||||
<QRCode
|
||||
value={JSON.stringify({ corpName: props.row.corpName, corpinfoId: props.row.corpinfoId })}
|
||||
style={{
|
||||
margin: "0 auto",
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
export default Connect([NS_ENTERPRISE], true)(View);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Modal, Space } from "antd";
|
||||
import { Form, Modal, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DictionarySelect from "zy-react-library/components/SelectTree/Dictionary";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
|
|
@ -17,6 +16,7 @@ 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";
|
||||
|
|
@ -32,7 +32,7 @@ function Department(props) {
|
|||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
eqQualificationinfoType: 1,
|
||||
eqQualificationinfoType: 2,
|
||||
eqUserId: queryParams["id"],
|
||||
};
|
||||
},
|
||||
|
|
@ -114,23 +114,23 @@ function Department(props) {
|
|||
/>
|
||||
<Table
|
||||
loading={getFileLoading}
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
// toolBarRender={() => (
|
||||
// <>
|
||||
// <Button
|
||||
// type="primary"
|
||||
// icon={<AddIcon />}
|
||||
// onClick={() => {
|
||||
// setAddModalOpen(true);
|
||||
// }}
|
||||
// >
|
||||
// 新增
|
||||
// </Button>
|
||||
// </>
|
||||
// )}
|
||||
columns={[
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "qualificationName",
|
||||
dataIndex: "userName",
|
||||
},
|
||||
{
|
||||
title: "证书名称",
|
||||
|
|
@ -142,16 +142,16 @@ function Department(props) {
|
|||
},
|
||||
{
|
||||
title: "就职状态",
|
||||
dataIndex: "certificateNo",
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
{record.employmentFlag === 1
|
||||
? "就职"
|
||||
: record.employmentFlag === 0
|
||||
? "离职"
|
||||
: ""}
|
||||
</div>
|
||||
),
|
||||
dataIndex: "employmentFlagName",
|
||||
render: (value) => {
|
||||
if (value === "在职") {
|
||||
return <Tag color="success">在职</Tag>;
|
||||
}
|
||||
if (value === "离职") {
|
||||
return <Tag color="error">离职</Tag>;
|
||||
}
|
||||
return <Tag color="default">未知</Tag>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
|
|
@ -172,48 +172,52 @@ function Department(props) {
|
|||
return <TooltipPreviewImg files={files} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
// {
|
||||
// title: "操作",
|
||||
// width: 200,
|
||||
// render: (_, record) => (
|
||||
// <Space>
|
||||
// <Button
|
||||
// type="link"
|
||||
// onClick={() => {
|
||||
// setAddModalOpen(true);
|
||||
// setCurrentId(record.id);
|
||||
// }}
|
||||
// >
|
||||
// 编辑
|
||||
// </Button>
|
||||
// <Button
|
||||
// danger
|
||||
// type="link"
|
||||
// onClick={() => onDelete(record.id)}
|
||||
// >
|
||||
// 删除
|
||||
// </Button>
|
||||
// </Space>
|
||||
// ),
|
||||
// },
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ function List(props) {
|
|||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "name",
|
||||
name: "likeCorpName",
|
||||
label: "相关方单位名称",
|
||||
},
|
||||
// { name: "corpState", label: "公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_STATUS },
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Modal, Space } from "antd";
|
||||
import { Form, Modal, Tag } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import FormBuilder from "zy-react-library/components/FormBuilder";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import AddIcon from "zy-react-library/components/Icon/AddIcon";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import DictionarySelect from "zy-react-library/components/Select/Dictionary";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
|
|
@ -28,6 +27,7 @@ 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,
|
||||
|
|
@ -114,23 +114,23 @@ function Department(props) {
|
|||
/>
|
||||
<Table
|
||||
loading={getFileLoading}
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
<Button
|
||||
type="primary"
|
||||
icon={<AddIcon />}
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
}}
|
||||
>
|
||||
新增
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
// toolBarRender={() => (
|
||||
// <>
|
||||
// <Button
|
||||
// type="primary"
|
||||
// icon={<AddIcon />}
|
||||
// onClick={() => {
|
||||
// setAddModalOpen(true);
|
||||
// }}
|
||||
// >
|
||||
// 新增
|
||||
// </Button>
|
||||
// </>
|
||||
// )}
|
||||
columns={[
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "qualificationName",
|
||||
dataIndex: "userName",
|
||||
},
|
||||
{
|
||||
title: "证书名称",
|
||||
|
|
@ -150,16 +150,16 @@ function Department(props) {
|
|||
},
|
||||
{
|
||||
title: "就职状态",
|
||||
dataIndex: "certificateNo",
|
||||
render: (_, record) => (
|
||||
<sapn>
|
||||
{record.employmentFlag === 1
|
||||
? "就职"
|
||||
: record.employmentFlag === 0
|
||||
? "离职"
|
||||
: ""}
|
||||
</sapn>
|
||||
),
|
||||
dataIndex: "employmentFlagName",
|
||||
render: (value) => {
|
||||
if (value === "在职") {
|
||||
return <Tag color="success">在职</Tag>;
|
||||
}
|
||||
if (value === "离职") {
|
||||
return <Tag color="error">离职</Tag>;
|
||||
}
|
||||
return <Tag color="default">未知</Tag>;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "图片",
|
||||
|
|
@ -180,49 +180,54 @@ function Department(props) {
|
|||
return <TooltipPreviewImg files={files} />;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 200,
|
||||
render: (_, record) => (
|
||||
<Space>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setAddModalOpen(true);
|
||||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
type="link"
|
||||
onClick={() => onDelete(record.id)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
// {
|
||||
// title: "操作",
|
||||
// width: 200,
|
||||
// render: (_, record) => (
|
||||
// <Space>
|
||||
// <Button
|
||||
// type="link"
|
||||
// onClick={() => {
|
||||
// setAddModalOpen(true);
|
||||
// setCurrentId(record.id);
|
||||
// }}
|
||||
// >
|
||||
// 编辑
|
||||
// </Button>
|
||||
// <Button
|
||||
// danger
|
||||
// type="link"
|
||||
// onClick={() => onDelete(record.id)}
|
||||
// >
|
||||
// 删除
|
||||
// </Button>
|
||||
// </Space>
|
||||
// ),
|
||||
// },
|
||||
]}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
);
|
||||
|
|
@ -236,6 +241,7 @@ function AddModalComponent(props) {
|
|||
const { loading: deleteFileLoading, deleteFile } = useDeleteFile();
|
||||
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
const [operatingProjectType, setOperatingProjectType] = useState("");
|
||||
const [deleteCardImageFiles, setDeleteCardImageFiles] = useState([]);
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
|
|
@ -299,6 +305,16 @@ function AddModalComponent(props) {
|
|||
onCancel();
|
||||
props.getData();
|
||||
};
|
||||
const onValuesChange = (changedValues) => {
|
||||
if ("qualificationinfoCategory" in changedValues) {
|
||||
const newIdCard = changedValues.qualificationinfoCategory;
|
||||
if (newIdCard) {
|
||||
setOperatingProjectType(newIdCard);
|
||||
form.setFieldsValue({ operatingProject: undefined });
|
||||
console.log(newIdCard);
|
||||
}
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Modal
|
||||
open={props.open}
|
||||
|
|
@ -311,7 +327,7 @@ function AddModalComponent(props) {
|
|||
onCancel={onCancel}
|
||||
>
|
||||
<FormBuilder
|
||||
s
|
||||
onValuesChange={onValuesChange}
|
||||
form={form}
|
||||
span={24}
|
||||
values={{
|
||||
|
|
@ -324,7 +340,6 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
name: "qualificationinfoCategory",
|
||||
required: false,
|
||||
label: "证书作业类别",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
|
|
@ -337,11 +352,10 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
name: "operatingProject",
|
||||
required: false,
|
||||
label: "操作项目",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="DGZY_dgzy"
|
||||
dictValue={operatingProjectType}
|
||||
onGetData={(data) => {
|
||||
setOperatingPrData(data);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ function List(props) {
|
|||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "name",
|
||||
name: "likeCorpName",
|
||||
label: "相关方单位名称",
|
||||
},
|
||||
// { name: "corpState", label: "公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_STATUS },
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ function List(props) {
|
|||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "name",
|
||||
name: "likeCorpName",
|
||||
label: "相关方单位名称",
|
||||
},
|
||||
// { name: "corpState", label: "公司状态", render: FORM_ITEM_RENDER_ENUM.SELECT, items: ENTERPRISE_STATUS },
|
||||
|
|
|
|||
|
|
@ -5,9 +5,13 @@ 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 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) {
|
||||
|
|
@ -22,16 +26,23 @@ function List(props) {
|
|||
return {
|
||||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
corpinfoId: queryParams["id"],
|
||||
eqCorpinfoId: queryParams["id"],
|
||||
};
|
||||
},
|
||||
});
|
||||
const onResetPassword = () => {
|
||||
const onResetPassword = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定要重置密码为Aa@123456789吗?",
|
||||
content: "确定要重置密码为Aa12345678吗?",
|
||||
onOk: () => {
|
||||
message.success("重置密码成功");
|
||||
props["userChangePassword"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("重置密码成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -63,7 +74,7 @@ function List(props) {
|
|||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "username",
|
||||
name: "likeUsername",
|
||||
label: "用户名",
|
||||
},
|
||||
]}
|
||||
|
|
@ -115,29 +126,42 @@ function List(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
);
|
||||
}
|
||||
function AddModalComponent(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [info, setInfo] = useState({});
|
||||
const { loading: getFileLoading, getFile } = useGetFile();
|
||||
useEffect(() => {
|
||||
if (props.currentId) {
|
||||
const fetchData = async () => {
|
||||
const res = await props.requestDetails({
|
||||
id: props.currentId,
|
||||
});
|
||||
const userImg = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["13"],
|
||||
eqForeignKey: res.data.userId,
|
||||
});
|
||||
const cardImg = await getFile({
|
||||
eqType: UPLOAD_FILE_TYPE_ENUM["14"],
|
||||
eqForeignKey: res.data.userId,
|
||||
});
|
||||
res.data.userImg = userImg;
|
||||
res.data.cardImg = cardImg;
|
||||
console.log(res.data);
|
||||
setInfo(res.data);
|
||||
};
|
||||
|
|
@ -170,6 +194,14 @@ function AddModalComponent(props) {
|
|||
<Descriptions
|
||||
bordered
|
||||
items={[
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: <TooltipPreviewImg files={info.userImg} />,
|
||||
},
|
||||
{
|
||||
label: "身份证照片",
|
||||
children: <TooltipPreviewImg files={info.cardImg} />,
|
||||
},
|
||||
{
|
||||
label: "用户角色",
|
||||
children: info.username,
|
||||
|
|
@ -214,12 +246,9 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: info.sex,
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: info.nationName,
|
||||
children: idCardGetDateAndGender(info.userIdCard).sex === "1" ? "男" : idCardGetDateAndGender(info.userIdCard).sex === "0" ? "女" : "",
|
||||
},
|
||||
|
||||
{
|
||||
label: "部门排序",
|
||||
children: info.sort,
|
||||
|
|
|
|||
|
|
@ -1,760 +0,0 @@
|
|||
import { Button, Descriptions, Divider, Form } from "antd";
|
||||
import { useState } from "react";
|
||||
import HeaderBack from "zy-react-library/components/HeaderBack";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import TooltipPreviewImg from "zy-react-library/components/TooltipPreviewImg";
|
||||
|
||||
function View(props) {
|
||||
const [form] = Form.useForm();
|
||||
const fnSearch = (values) => {
|
||||
console.log(values);
|
||||
};
|
||||
const [info] = useState({
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
selectUserId: null,
|
||||
username: "13058604112",
|
||||
password: "16758a08251b174145edfb6188bcb5dd51a827f1",
|
||||
name: "0513-1",
|
||||
roleId: "fhadminzhuche",
|
||||
rolesName: null,
|
||||
lastLogin: null,
|
||||
ip: null,
|
||||
status: 0,
|
||||
bz: "注册用户",
|
||||
sex: null,
|
||||
skin: "pcoded-navbar navbar-image-3,navbar pcoded-header navbar-expand-lg navbar-light header-dark,",
|
||||
email: null,
|
||||
number: null,
|
||||
phone: "13058604112",
|
||||
roleIds: null,
|
||||
departmentId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
departmentName: null,
|
||||
departmentNameAll: null,
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
funIds: null,
|
||||
appid: null,
|
||||
postId: "jhsdGsdghbs",
|
||||
postName: "jhsdGsdghbs",
|
||||
ismain: "0",
|
||||
errorCount: 0,
|
||||
sort: null,
|
||||
learnercategory: null,
|
||||
useravatarprefix: null,
|
||||
useravatarurl: null,
|
||||
shiftdutyone: null,
|
||||
shiftdutytwo: null,
|
||||
duration: null,
|
||||
workstatus: null,
|
||||
workperiod: null,
|
||||
isRecorder: null,
|
||||
personnelType: null,
|
||||
personnelTypeName: null,
|
||||
isHazardconfirmer: null,
|
||||
isAccessauditor: null,
|
||||
isOnlinelearning: null,
|
||||
personType: null,
|
||||
jcr: null,
|
||||
pushCid: null,
|
||||
empno: null,
|
||||
cfdStatus: null,
|
||||
cardno: null,
|
||||
userIdCard: null,
|
||||
isPolice: null,
|
||||
userIdentity: null,
|
||||
baseimgpath: null,
|
||||
backendaddr: null,
|
||||
mkmjcard: null,
|
||||
ispush: "1",
|
||||
userType: "3",
|
||||
inHrUser: "0",
|
||||
isDelete: 0,
|
||||
creator: null,
|
||||
createTime: "2025-04-20 14:41:54",
|
||||
operat: "87ef258559e6430aa837e0f38062e250",
|
||||
operatTime: "2025-08-29 11:05:09",
|
||||
mkmjVehicleReviewer: null,
|
||||
userIds: null,
|
||||
departSort: null,
|
||||
corpinfoName: null,
|
||||
classCount: null,
|
||||
completeCount: null,
|
||||
studystate: null,
|
||||
corpInfoStatus: null,
|
||||
busImgList: null,
|
||||
faceFile: null,
|
||||
facePermissions: null,
|
||||
job: null,
|
||||
jobLevel: null,
|
||||
jobLevelName: null,
|
||||
nation: null,
|
||||
nationName: null,
|
||||
basicinfoId: null,
|
||||
precinctId: null,
|
||||
roleName: null,
|
||||
isassess: null,
|
||||
mkmjPermissions: "1",
|
||||
inMkmjBlacklist: null,
|
||||
disableMkmj: null,
|
||||
employCorpName: null,
|
||||
validityPeriodStart: null,
|
||||
validityPeriodEnd: null,
|
||||
classNo: null,
|
||||
employCorpId: null,
|
||||
xgfUserId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
loginUser: null,
|
||||
isFlow: "0",
|
||||
isFlowName: null,
|
||||
trainStatus: null,
|
||||
trainStatusName: null,
|
||||
basicState: null,
|
||||
basicStateName: null,
|
||||
userPhoto: null,
|
||||
userPhotoInfo: [
|
||||
{
|
||||
imgfilesId: "4a7197ac1f844466a592f5ac54bb7071",
|
||||
filepath: "/uploadFiles/file/xgf/920fa607d47c431b9142912801d10047.jpg",
|
||||
},
|
||||
],
|
||||
userCard: null,
|
||||
userCardInfo: [
|
||||
{
|
||||
imgfilesId: "4a3a9d1cca0b463290afbe2da7f86fcd",
|
||||
filepath: "/uploadFiles/file/xgf/887b696c5593413f9c108111ef111c1f.jpg",
|
||||
},
|
||||
{
|
||||
imgfilesId: "70972a9e21e3448d9dbfffae02f442ba",
|
||||
filepath: "/uploadFiles/file/xgf/51588b4531a449b58ace522928c75166.png",
|
||||
},
|
||||
],
|
||||
socSecurity: null,
|
||||
socSecurityInfo: [
|
||||
{
|
||||
imgfilesId: "c733ce9c56e746c99814503dbd09992e",
|
||||
filepath: "/uploadFiles/file/xgf/082c6408413648879f53bd02f5c6059b.png",
|
||||
},
|
||||
{
|
||||
imgfilesId: "efaa255ef2e64da7920e2b4415a0e250",
|
||||
filepath: "/uploadFiles/file/xgf/dde0abbe4c494111bc1e7533bda76178.png",
|
||||
},
|
||||
],
|
||||
contract: null,
|
||||
contractInfo: [],
|
||||
insurance: null,
|
||||
insuranceInfo: [],
|
||||
empInsurance: null,
|
||||
empInsuranceInfo: [],
|
||||
threeLevel: null,
|
||||
threeLevelInfo: [],
|
||||
deleteFileIds: null,
|
||||
emp: {
|
||||
employmentApplyManagementId: "50b9c363d6584072a7a14b1ef6fc3468",
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
relevantUnitName: "测试相关方",
|
||||
startDate: "2025-04-20 14:43:50",
|
||||
endDate: null,
|
||||
leaveReason: null,
|
||||
applyTime: null,
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
creator: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
createtime: "2025-04-20 14:43:51",
|
||||
operator: "87ef258559e6430aa837e0f38062e250",
|
||||
operatetime: "2025-08-11 18:20:32",
|
||||
isdelete: "0",
|
||||
auditState: "2",
|
||||
departState: "0",
|
||||
reviewState: "",
|
||||
departmentId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
remarks: null,
|
||||
auditRemarks: null,
|
||||
auditTime: null,
|
||||
auditPerson: null,
|
||||
corpStartDate: "2025-04-20",
|
||||
postId: "jhsdGsdghbs",
|
||||
entryDate: null,
|
||||
isSignLabor: "0",
|
||||
isInjuriesPay: "0",
|
||||
socialNumber: "462218514G0CB1PQ55",
|
||||
ispay: "0",
|
||||
isLevelThree: "0",
|
||||
isSafetyTell: "0",
|
||||
isBodyAdapt: "0",
|
||||
isSpecialJob: "0",
|
||||
isflow: "0",
|
||||
isSocial: "1",
|
||||
socialType: null,
|
||||
isBf: "0",
|
||||
},
|
||||
userDetails: {
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
name: "0513-1",
|
||||
phone: "13058604112",
|
||||
creattime: "2025-08-11 18:20:31",
|
||||
departState: "0",
|
||||
isdelete: "0",
|
||||
personWorkType: null,
|
||||
personWorkTypeName: null,
|
||||
age: "21",
|
||||
hklocal: "11112",
|
||||
address: "1111",
|
||||
degreeOfEducation: "dxbk",
|
||||
degreeOfEducationName: "大学本科",
|
||||
corpStartDate: null,
|
||||
postId: "jhsdGsdghbs",
|
||||
postName: "jhsdGsdghbs",
|
||||
workSign: null,
|
||||
joinedDate: null,
|
||||
workDate: null,
|
||||
photo: "/uploadFiles/file/xgf/920fa607d47c431b9142912801d10047.jpg",
|
||||
dateOfBirth: "2004-06-07",
|
||||
ispay: "0",
|
||||
ispayNumber: "",
|
||||
isSafetyTell: "0",
|
||||
isSafetyTime: null,
|
||||
isInjuriesPay: "0",
|
||||
isSignLabor: "0",
|
||||
sex: "0",
|
||||
entryDate: null,
|
||||
nationality: "mz",
|
||||
nationalityName: "满族",
|
||||
maritalstatus: "0",
|
||||
politicalTime: null,
|
||||
politicalStatus: "zgybdy01",
|
||||
politicalStatusName: "中共预备党员",
|
||||
isInjuriesPayTime: "",
|
||||
isLevelThree: "0",
|
||||
isBodyAdapt: "0",
|
||||
isSpecialJob: null,
|
||||
belongToCorp: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
belongToCorpName: "测试相关方",
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
managerDepartmentId: null,
|
||||
managerDepartmentName: null,
|
||||
competentDepartmentId: null,
|
||||
competentDepartmentName: null,
|
||||
mainDepartmentId: null,
|
||||
mainDepartmentName: null,
|
||||
cardId: "130726200406079838",
|
||||
departmentId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
departmentName: "测试相关方",
|
||||
isSocial: "1",
|
||||
isBf: "0",
|
||||
socialNumber: "462218514G0CB1PQ55",
|
||||
zzname: null,
|
||||
annex: "/uploadFiles/file/xgf/94212aec9b66433ca3b665a68251d8b5.zip",
|
||||
attorney: null,
|
||||
commitmentLetter: null,
|
||||
},
|
||||
trainingRec: [
|
||||
{
|
||||
classInfoId: "7a3ab8fabd8a4b51a8e2ed1d081b19b3",
|
||||
createTime: "2025-05-19 00:00:00",
|
||||
creator: "1",
|
||||
operateTime: "2025-05-19 00:00:00",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "65a5b863a20a4f85b43dc63dc0bd9308",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo:
|
||||
"/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-15 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "0515-1222",
|
||||
openingTime: "2025-05-15 00:00:00",
|
||||
place: "3725a5aa60da407e87b7931e311da192",
|
||||
placeName: "教育培训中心(东山校区)阶梯教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
{
|
||||
classInfoId: "a14252d3baed49f3b694d51f8a01a543",
|
||||
createTime: "2025-06-01 00:00:00",
|
||||
creator: "1",
|
||||
operateTime: "2025-06-01 00:00:00",
|
||||
operator: "1",
|
||||
isdelete: "0",
|
||||
corpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
userId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
status: "0",
|
||||
classMessageId: "3bbc4df4bcef4de698fea4c6fdc963ea",
|
||||
username: "13058604112",
|
||||
name: "0513-1",
|
||||
sex: "0",
|
||||
cardId: "130726200406079838",
|
||||
belongToCorpName: "测试相关方",
|
||||
departmentName: "测试相关方",
|
||||
photo:
|
||||
"/uploadFiles/file/education/face/20250515/a394731af5cf4fab8183fa7663a1e491.jpeg",
|
||||
phone: "13058604112",
|
||||
personWorkType: null,
|
||||
certificate: null,
|
||||
classNo: null,
|
||||
trainUsersId: null,
|
||||
validityPeriodStart: "2025-05-15 00:00:00",
|
||||
validityPeriodEnd: "2025-05-14",
|
||||
className: "666666",
|
||||
openingTime: "2025-05-15 00:00:00",
|
||||
place: "3725a5aa60da407e87b7931e311da192",
|
||||
placeName: "教育培训中心(东山校区)阶梯教室",
|
||||
postName: null,
|
||||
deptName: "测试相关方",
|
||||
},
|
||||
],
|
||||
special: [],
|
||||
flows: [
|
||||
{
|
||||
flowId: "fd58bf5ad97847419f8de769639947f5",
|
||||
type: "1",
|
||||
creator: null,
|
||||
creatorName: null,
|
||||
creatorTime: "2025-05-13 14:30:18",
|
||||
validFlag: "1",
|
||||
foreignKey: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
isdelete: "0",
|
||||
endFlag: "1",
|
||||
details: [
|
||||
{
|
||||
flowDetailId: "33ec9909844b482fbcdb8c6cc1e8a9db",
|
||||
flowId: "fd58bf5ad97847419f8de769639947f5",
|
||||
stepFlag: "0",
|
||||
stepName: "相关方提交人员信息到发包单位",
|
||||
sort: 0,
|
||||
parentId: "0",
|
||||
approverId: "87ef258559e6430aa837e0f38062e250",
|
||||
approverName: "测试相关方",
|
||||
approverOpinion: null,
|
||||
approverCorpinfoId: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
approverCorpinfoName: "测试相关方",
|
||||
approverTime: "2025-05-13 14:30:18",
|
||||
passFlag: "1",
|
||||
endFlag: "0",
|
||||
isdelete: "0",
|
||||
foreignKey: null,
|
||||
appointAnnex:
|
||||
"/uploadFiles/file/xgf/94212aec9b66433ca3b665a68251d8b5.zip",
|
||||
appointAnnexName: null,
|
||||
},
|
||||
{
|
||||
flowDetailId: "b6e4612892b14a73b8aa4324c69c85d3",
|
||||
flowId: "fd58bf5ad97847419f8de769639947f5",
|
||||
stepFlag: "0",
|
||||
stepName: null,
|
||||
sort: 1,
|
||||
parentId: "33ec9909844b482fbcdb8c6cc1e8a9db",
|
||||
approverId: "94407a4e15ec46b5974b128e124fa661",
|
||||
approverName: "齐津铖",
|
||||
approverOpinion: "",
|
||||
approverCorpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
approverCorpinfoName: "卓云企业",
|
||||
approverTime: "2025-05-13 14:38:39",
|
||||
passFlag: "1",
|
||||
endFlag: "0",
|
||||
isdelete: "0",
|
||||
foreignKey: null,
|
||||
appointAnnex: null,
|
||||
appointAnnexName: null,
|
||||
},
|
||||
{
|
||||
flowDetailId: "1ef915958e5e4eba872c55588524b168",
|
||||
flowId: "fd58bf5ad97847419f8de769639947f5",
|
||||
stepFlag: "1",
|
||||
stepName: null,
|
||||
sort: 2,
|
||||
parentId: "b6e4612892b14a73b8aa4324c69c85d3",
|
||||
approverId: "94407a4e15ec46b5974b128e124fa661",
|
||||
approverName: "齐津铖",
|
||||
approverOpinion: "",
|
||||
approverCorpinfoId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
approverCorpinfoName: "卓云企业",
|
||||
approverTime: "2025-05-13 14:39:43",
|
||||
passFlag: "1",
|
||||
endFlag: "1",
|
||||
isdelete: "0",
|
||||
foreignKey: null,
|
||||
appointAnnex: null,
|
||||
appointAnnexName: null,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
lastFlow: {
|
||||
flowsId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
foreignKeyId: "5d8dcfbcd27741c79efaa6ca31941b9e",
|
||||
foreignKeyName: "sys_user=>user_id",
|
||||
flowsStep: 1,
|
||||
flowsType: "0",
|
||||
isDelete: "0",
|
||||
appointZeroCorpId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
appointZeroCorpType: null,
|
||||
appointZeroCorpName: "卓云企业",
|
||||
appointZeroDepartmentId: "16579f1de79743198884a56350c113cc",
|
||||
appointZeroDepartmentName: "分公司级测试部门",
|
||||
appointZeroUserId: "94407a4e15ec46b5974b128e124fa661",
|
||||
appointZeroUserName: "齐津铖",
|
||||
appointZeroStatus: "1",
|
||||
appointZeroOpinion: "",
|
||||
appointZeroTime: "2025-05-13 14:38:39",
|
||||
appointOneCorpId: "13cf0f4ec77e4d98ae8cdd9c3386ae0c",
|
||||
appointOneCorpName: "卓云企业",
|
||||
appointOneCorpType: "0",
|
||||
appointOneDepartmentId: "16579f1de79743198884a56350c113cc",
|
||||
appointOneDepartmentName: "",
|
||||
appointOneUserId: "94407a4e15ec46b5974b128e124fa661",
|
||||
appointOneUserName: "齐津铖",
|
||||
appointOneStatus: "1",
|
||||
appointOneOpinion: "",
|
||||
appointOneTime: "2025-05-13 14:39:42",
|
||||
appointTwoCorpId: null,
|
||||
appointTwoCorpName: null,
|
||||
appointTwoCorpType: null,
|
||||
appointTwoDepartmentId: null,
|
||||
appointTwoDepartmentName: null,
|
||||
appointTwoUserId: null,
|
||||
appointTwoUserName: null,
|
||||
appointTwoStatus: null,
|
||||
appointTwoOpinion: null,
|
||||
appointTwoTime: null,
|
||||
appointThreeCorpId: null,
|
||||
appointThreeCorpName: null,
|
||||
appointThreeCorpType: null,
|
||||
appointThreeDepartmentId: null,
|
||||
appointThreeDepartmentName: null,
|
||||
appointThreeUserId: null,
|
||||
appointThreeUserName: null,
|
||||
appointThreeStatus: null,
|
||||
appointThreeOpinion: null,
|
||||
appointThreeTime: null,
|
||||
appointFourCorpId: null,
|
||||
appointFourCorpName: null,
|
||||
appointFourCorpType: null,
|
||||
appointFourDepartmentId: null,
|
||||
appointFourDepartmentName: null,
|
||||
appointFourUserId: null,
|
||||
appointFourUserName: null,
|
||||
appointFourStatus: null,
|
||||
appointFourOpinion: null,
|
||||
appointFiveCorpId: null,
|
||||
appointFiveCorpName: null,
|
||||
appointFiveCorpType: null,
|
||||
appointFiveDepartmentId: null,
|
||||
appointFiveDepartmentName: null,
|
||||
appointFiveUserId: null,
|
||||
appointFiveUserName: null,
|
||||
appointFiveStatus: null,
|
||||
appointFiveOpinion: null,
|
||||
appointSixCorpId: null,
|
||||
appointSixCorpName: null,
|
||||
appointSixCorpType: null,
|
||||
appointSixDepartmentId: null,
|
||||
appointSixDepartmentName: null,
|
||||
appointSixUserId: null,
|
||||
appointSixUserName: null,
|
||||
appointSixStatus: null,
|
||||
appointSixOpinion: null,
|
||||
appointSevenCorpId: null,
|
||||
appointSevenCorpName: null,
|
||||
appointSevenCorpType: null,
|
||||
appointSevenDepartmentId: null,
|
||||
appointSevenDepartmentName: null,
|
||||
appointSevenUserId: null,
|
||||
appointSevenUserName: null,
|
||||
appointSevenStatus: null,
|
||||
appointSevenOpinion: null,
|
||||
sendType: "1",
|
||||
checkStatus: "2",
|
||||
checkStatusName: "审核结束",
|
||||
},
|
||||
powerFlag: null,
|
||||
entrustFlag: null,
|
||||
lastStepFlag: null,
|
||||
checkStep: null,
|
||||
flowsStep: null,
|
||||
flowsType: null,
|
||||
attorney: null,
|
||||
appointZeroUserId: null,
|
||||
appointZeroCorpName: "卓云企业",
|
||||
appointZeroTime: null,
|
||||
appointOneUserId: null,
|
||||
appointOneCorpName: "卓云企业",
|
||||
appointOneTime: null,
|
||||
appointTwoUserId: null,
|
||||
appointTwoCorpName: null,
|
||||
appointTwoTime: null,
|
||||
appointThreeUserId: null,
|
||||
appointThreeCorpName: null,
|
||||
appointThreeTime: null,
|
||||
appointFourUserId: null,
|
||||
appointFourCorpName: null,
|
||||
appointFiveUserId: null,
|
||||
appointFiveCorpName: null,
|
||||
appointSixUserId: null,
|
||||
appointSixCorpName: null,
|
||||
appointSevenUserId: null,
|
||||
appointSevenCorpName: null,
|
||||
appointTime: "2025-05-13 14:39:42",
|
||||
cardId: null,
|
||||
belongToCorp: "dd5ab430a9f442a0be64c61a9645b904",
|
||||
belongToCorpName: "测试相关方",
|
||||
degreeOfEducation: null,
|
||||
isSocial: null,
|
||||
isInjuriesPay: null,
|
||||
ispay: null,
|
||||
isBf: null,
|
||||
age: null,
|
||||
unValidFlag: "1",
|
||||
unValidInfo: "合格证有效期",
|
||||
checkStatus: null,
|
||||
classStatus: null,
|
||||
});
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title="查看" />
|
||||
<div
|
||||
style={{
|
||||
padding: 20,
|
||||
}}
|
||||
>
|
||||
<Divider orientation="left">企业基础信息</Divider>
|
||||
<Descriptions
|
||||
items={[
|
||||
// { label: "照片", children: info.userImg?.length > 0 ? <PreviewImg files={info.userImg} /> : "暂无信息"},
|
||||
{
|
||||
label: "企业名称",
|
||||
children: info.corpName && info.corpName,
|
||||
},
|
||||
{
|
||||
label: "企业状态",
|
||||
children: info.xgfState,
|
||||
span: 5,
|
||||
},
|
||||
{
|
||||
label: "股份被监督部门",
|
||||
children: info.managerDepIds,
|
||||
},
|
||||
{
|
||||
label: "股份主管部门",
|
||||
children: info.dateOfBirthmainDepIds,
|
||||
},
|
||||
{
|
||||
label: "基层单位监管部门",
|
||||
children: info.agecompetentDepIds,
|
||||
},
|
||||
{
|
||||
label: "基层单位主管部门",
|
||||
children: info.superviseDepIds,
|
||||
},
|
||||
{
|
||||
label: "集团单位",
|
||||
children: info.phonecorpTypIds,
|
||||
},
|
||||
{
|
||||
label: "开户人",
|
||||
children: info.cardIdholderName,
|
||||
},
|
||||
{
|
||||
label: "统一社会信用代码",
|
||||
children: info.code,
|
||||
span: 3,
|
||||
},
|
||||
{
|
||||
label: "属地",
|
||||
children: info.cityName,
|
||||
},
|
||||
{
|
||||
label: "所属行业",
|
||||
children: info.industryNames,
|
||||
},
|
||||
{
|
||||
label: "经济类型",
|
||||
children: info.ecoType,
|
||||
},
|
||||
{
|
||||
label: "经度",
|
||||
children: info.longitude,
|
||||
},
|
||||
{
|
||||
label: "维度",
|
||||
children: info.latitude,
|
||||
},
|
||||
{
|
||||
label: "单位经营地址",
|
||||
children: info.address,
|
||||
},
|
||||
{
|
||||
label: "企业规模",
|
||||
children: info.scale,
|
||||
},
|
||||
{
|
||||
label: "法人姓名",
|
||||
children: info.lrName,
|
||||
},
|
||||
{
|
||||
label: "联系电话",
|
||||
children: info.lrPhone,
|
||||
},
|
||||
{
|
||||
label: "主要负责人",
|
||||
children: info.contacts,
|
||||
},
|
||||
{
|
||||
label: "主要负责人联系电话",
|
||||
children: info.contactsPhone,
|
||||
},
|
||||
{
|
||||
label: "成立日期",
|
||||
children: info.createDate,
|
||||
},
|
||||
{
|
||||
label: "职工人数(人)",
|
||||
children: info.employees,
|
||||
},
|
||||
{
|
||||
label: "资产总额(万元)",
|
||||
children: info.totalassets,
|
||||
},
|
||||
{
|
||||
label: "注册资金(万元)",
|
||||
children: info.regcapital,
|
||||
},
|
||||
{
|
||||
label: "用工形式",
|
||||
children: info.employmentForm,
|
||||
},
|
||||
{
|
||||
label: "选取形式",
|
||||
children: info.selectForms,
|
||||
},
|
||||
]}
|
||||
column={6}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
<Divider orientation="left">营业执照</Divider>
|
||||
|
||||
<Descriptions
|
||||
items={[
|
||||
{
|
||||
label: "营业执照有效期",
|
||||
children: info.managerDepIds,
|
||||
},
|
||||
{
|
||||
label: "营业执照",
|
||||
children: <TooltipPreviewImg files={[]} />,
|
||||
},
|
||||
]}
|
||||
column={2}
|
||||
labelStyle={{
|
||||
width: 200,
|
||||
}}
|
||||
/>
|
||||
|
||||
<Divider orientation="left">单位资质信息</Divider>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "资质正式名称",
|
||||
dataIndex: "className",
|
||||
},
|
||||
{
|
||||
title: "证书有效期",
|
||||
dataIndex: "status",
|
||||
},
|
||||
{
|
||||
title: "证件编号",
|
||||
dataIndex: "openingTime",
|
||||
},
|
||||
{
|
||||
title: "培训地点",
|
||||
dataIndex: "placeName",
|
||||
},
|
||||
{
|
||||
title: "有效期",
|
||||
dataIndex: "time",
|
||||
render: (_, record) => <TooltipPreviewImg files={[record.url]} />,
|
||||
},
|
||||
]}
|
||||
pagination={false}
|
||||
dataSource={info.trainingRec}
|
||||
disabledResizer={true}
|
||||
/>
|
||||
<Divider orientation="left">相关方人员信息</Divider>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
// { name: "name", label: "关键字", tip: "证书名称/证书编号" },
|
||||
{
|
||||
name: "name",
|
||||
label: "姓名",
|
||||
placeholder: "请输入姓名,支持模糊搜索",
|
||||
},
|
||||
]}
|
||||
labelCol={{
|
||||
span: 2,
|
||||
}}
|
||||
onFinish={fnSearch}
|
||||
/>
|
||||
<Table
|
||||
columns={[
|
||||
{
|
||||
title: "特证照片",
|
||||
dataIndex: "filepath",
|
||||
render: (_, record) => <TooltipPreviewImg files={[record.url]} />,
|
||||
},
|
||||
{
|
||||
title: "作业类别",
|
||||
dataIndex: "specialTypeName",
|
||||
},
|
||||
{
|
||||
title: "操作项目",
|
||||
dataIndex: "operationTypeName",
|
||||
},
|
||||
{
|
||||
title: "证书名称",
|
||||
dataIndex: "certificate",
|
||||
},
|
||||
{
|
||||
title: "发证机关",
|
||||
dataIndex: "issuingAuthority",
|
||||
},
|
||||
{
|
||||
title: "证书类型",
|
||||
dataIndex: "cerTypeName",
|
||||
},
|
||||
{
|
||||
title: "有效期",
|
||||
dataIndex: "time",
|
||||
render: (_, record) => (
|
||||
<>
|
||||
<Button
|
||||
type="link"
|
||||
onClick={() =>
|
||||
props.history.push(`./UserView?id=${record.id}`)}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
</>
|
||||
),
|
||||
},
|
||||
]}
|
||||
dataSource={info.special}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
export default View;
|
||||
|
|
@ -41,9 +41,12 @@ function Department(props) {
|
|||
onOk: () => {
|
||||
props["departmentRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -75,25 +78,14 @@ function Department(props) {
|
|||
{
|
||||
name: "eqLevel",
|
||||
label: "部门级别",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [
|
||||
{
|
||||
name: "一级部门",
|
||||
bianma: "1",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "eqDeptType",
|
||||
label: "单位类型",
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: [
|
||||
{
|
||||
name: "一级部门",
|
||||
bianma: "1",
|
||||
},
|
||||
],
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="companyDepartmentLevel0000"
|
||||
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -115,6 +107,27 @@ function Department(props) {
|
|||
{
|
||||
title: "部门名称",
|
||||
dataIndex: "name",
|
||||
render: (_, record) => (
|
||||
<Button
|
||||
block
|
||||
type="link"
|
||||
onClick={() => {
|
||||
setSelectedNodeId(record.id);
|
||||
getData();
|
||||
}}
|
||||
>
|
||||
{`${record.name}>`}
|
||||
</Button>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: "部门分责人",
|
||||
dataIndex: "departmentUserLeaderList",
|
||||
},
|
||||
{
|
||||
title: "部门排序",
|
||||
dataIndex: "depOrder",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
|
@ -129,7 +142,7 @@ function Department(props) {
|
|||
setSelectedNodeId(record.parentId);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
|
|
@ -146,20 +159,23 @@ function Department(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
|
@ -190,6 +206,10 @@ function AddModalComponent(props) {
|
|||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
});
|
||||
if (Number.isInteger(values.depOrder) && values.depOrder < 0) {
|
||||
message.error("部门排序请输入正整数!");
|
||||
return;
|
||||
}
|
||||
values.parentId = props.parentId;
|
||||
if (props.currentId) {
|
||||
values.id = props.currentId;
|
||||
|
|
|
|||
|
|
@ -5,8 +5,11 @@ 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";
|
||||
|
|
@ -34,9 +37,12 @@ function Post(props) {
|
|||
onOk: () => {
|
||||
props["postRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -65,6 +71,17 @@ function Post(props) {
|
|||
flex: 1,
|
||||
}}
|
||||
>
|
||||
<Search
|
||||
form={form}
|
||||
options={[
|
||||
{
|
||||
name: "likePostName",
|
||||
label: "岗位名称",
|
||||
},
|
||||
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Table
|
||||
toolBarRender={() => (
|
||||
<>
|
||||
|
|
@ -101,7 +118,7 @@ function Post(props) {
|
|||
setCurrentId(record.id);
|
||||
}}
|
||||
>
|
||||
修改
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
danger
|
||||
|
|
@ -118,27 +135,36 @@ function Post(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
);
|
||||
}
|
||||
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
|
||||
|
|
@ -146,18 +172,23 @@ function AddModalComponent(props) {
|
|||
id: props.currentId,
|
||||
})
|
||||
.then((res) => {
|
||||
// const arr = [];
|
||||
// res.data.departmentList && res.data.departmentList.forEach((item) => {
|
||||
// arr.push(item.departmentId);
|
||||
// });
|
||||
// res.data.departmentIdsString = arr;
|
||||
form.setFieldsValue(res.data);
|
||||
console.log(res.data);
|
||||
|
||||
setParentName(res.data.departmentName);
|
||||
setParentId(res.data.departmentId);
|
||||
});
|
||||
}
|
||||
else {
|
||||
setParentName(props.selectedNodeName);
|
||||
if (!props.selectedNodeName) {
|
||||
getUserInfo().then((res) => {
|
||||
setParentName(res.departmentName);
|
||||
setParentId(res.departmentId);
|
||||
});
|
||||
}
|
||||
else {
|
||||
setParentName(props.selectedNodeName);
|
||||
setParentId(props.parentId);
|
||||
}
|
||||
}
|
||||
}, [props.currentId, props.selectedNodeName]);
|
||||
const onCancel = () => {
|
||||
|
|
@ -165,7 +196,7 @@ function AddModalComponent(props) {
|
|||
props.onCancel();
|
||||
};
|
||||
const onSubmit = async (values) => {
|
||||
values.departmentId = props.parentId;
|
||||
values.departmentId = parentId;
|
||||
values.corpFlag = 1;
|
||||
if (props.currentId) {
|
||||
values.id = props.currentId;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import { ID_NUMBER, PHONE } from "zy-react-library/regular";
|
|||
import { getLabelName, idCardGetDateAndGender } from "zy-react-library/utils";
|
||||
|
||||
import { NS_USER } from "~/enumerate/namespace";
|
||||
import { useDebounce } from "~/utils";
|
||||
|
||||
// import useGetFile from "zy-react-library/hooks/useGetFile";
|
||||
|
||||
|
|
@ -31,11 +32,11 @@ const WHETHER_ENUM = [
|
|||
];
|
||||
const SEX = [
|
||||
{
|
||||
bianma: 1,
|
||||
bianma: "1",
|
||||
name: "男",
|
||||
},
|
||||
{
|
||||
bianma: 2,
|
||||
bianma: "0",
|
||||
name: "女",
|
||||
},
|
||||
];
|
||||
|
|
@ -47,6 +48,12 @@ function Add(props) {
|
|||
const [userTypeData, setUserTypeData] = useState([]);
|
||||
const [userID, setUserID] = useState(null);
|
||||
const queryParams = useGetUrlQuery();
|
||||
const [userIdCardValue, setUserIdCardValue] = useState(null);
|
||||
const [usernameValue, setUsernameValue] = useState(null);
|
||||
const [phoneValue, setPhoneValue] = useState(null);
|
||||
const debouncedUserIdCard = useDebounce(userIdCardValue, 600);
|
||||
const debouncedUsernameValue = useDebounce(usernameValue, 600);
|
||||
const debouncedPhoneValueValue = useDebounce(phoneValue, 600);
|
||||
|
||||
// const { loading: getFileLoading, getFile } = useGetFile();
|
||||
const { loading: uploadFileLoading, uploadFile } = useUploadFile();
|
||||
|
|
@ -56,26 +63,25 @@ function Add(props) {
|
|||
const { data } = await props["userDetails"]({
|
||||
id: queryParams["id"],
|
||||
});
|
||||
form.setFieldValue("sex", idCardGetDateAndGender(data.userIdCard).sex);
|
||||
fnChoiceDepartment([{ id: data.departmentId }], 1);
|
||||
|
||||
// const hiddenImageFiles = await getFile({ eqType: UPLOAD_FILE_TYPE_ENUM["13"], eqForeignKey: queryParams["id"] });
|
||||
const filepath
|
||||
= data.filepath
|
||||
= data.userAvatarUrl
|
||||
? [
|
||||
{
|
||||
name: data.name,
|
||||
url: data.filepath,
|
||||
url: process.env.app["fileUrl"] + data.userAvatarUrl,
|
||||
},
|
||||
]
|
||||
: [];
|
||||
console.log(filepath);
|
||||
const values = {
|
||||
filepath,
|
||||
...data,
|
||||
};
|
||||
values.faceFile = [
|
||||
{
|
||||
name: data.name,
|
||||
url: data.filepath,
|
||||
},
|
||||
];
|
||||
values.faceFile = filepath;
|
||||
setUserID(data.userId);
|
||||
form.setFieldsValue({
|
||||
...values,
|
||||
|
|
@ -98,13 +104,12 @@ function Add(props) {
|
|||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
});
|
||||
values.rank_level_name = getLabelName({
|
||||
status: values.rank_level,
|
||||
values.rankLevel_name = getLabelName({
|
||||
status: values.rankLevel,
|
||||
list: rankData,
|
||||
idKey: "dictValue",
|
||||
nameKey: "dictLabel",
|
||||
});
|
||||
idCardGetDateAndGender(values.userIdCard);
|
||||
const { filePath } = await uploadFile({
|
||||
single: true,
|
||||
files: values.faceFile,
|
||||
|
|
@ -149,6 +154,59 @@ function Add(props) {
|
|||
setPostData(res.data);
|
||||
});
|
||||
};
|
||||
// 校验身份证重复
|
||||
useEffect(() => {
|
||||
if (!debouncedUserIdCard) {
|
||||
form.setFields([{ name: "userIdCard", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ userIdCard: debouncedUserIdCard, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "userIdCard", errors: ["身份证号重复"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedUserIdCard]);
|
||||
|
||||
// 校验用户名重复
|
||||
useEffect(() => {
|
||||
if (!debouncedUsernameValue) {
|
||||
form.setFields([{ name: "username", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ username: debouncedUsernameValue, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
if (!res.success) {
|
||||
form.setFields([{ name: "username", errors: ["用户名重复"] }]);
|
||||
}
|
||||
});
|
||||
}, [debouncedUsernameValue]);
|
||||
|
||||
// 校验用户名重复
|
||||
useEffect(() => {
|
||||
if (!debouncedPhoneValueValue) {
|
||||
form.setFields([{ name: "phone", errors: [] }]);
|
||||
return;
|
||||
}
|
||||
props["verifyUser"]({ phone: debouncedPhoneValueValue, id: queryParams["id"] ?? "" }).then((res) => {
|
||||
if (!res.success) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
if ("username" in changedValues) {
|
||||
setUsernameValue(changedValues.username ?? "");
|
||||
}
|
||||
if ("phone" in changedValues) {
|
||||
setPhoneValue(changedValues.phone ?? "");
|
||||
}
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<HeaderBack title={queryParams["id"] ? "编辑" : "新增"} />
|
||||
|
|
@ -161,7 +219,9 @@ function Add(props) {
|
|||
form={form}
|
||||
values={{
|
||||
departmentLeaderFlag: "0",
|
||||
deputyLeaderFlag: "0",
|
||||
}}
|
||||
onValuesChange={onValuesChange}
|
||||
loading={uploadFileLoading || props.user.userLoading}
|
||||
options={[
|
||||
{
|
||||
|
|
@ -175,23 +235,13 @@ function Add(props) {
|
|||
valueKey: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "departmentId",
|
||||
label: "所属部门",
|
||||
render: (
|
||||
<DepartmentSelectTree onGetNodePaths={fnChoiceDepartment} />
|
||||
),
|
||||
},
|
||||
{ name: "departmentId", label: "所属部门", render: <DepartmentSelectTree onGetNodePaths={fnChoiceDepartment} /> },
|
||||
{
|
||||
name: "postId",
|
||||
label: "所属岗位",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.SELECT,
|
||||
items: postData,
|
||||
itemsField: {
|
||||
labelKey: "postName",
|
||||
valueKey: "id",
|
||||
},
|
||||
itemsField: { labelKey: "postName", valueKey: "id" },
|
||||
},
|
||||
{
|
||||
name: "username",
|
||||
|
|
@ -291,7 +341,7 @@ function Add(props) {
|
|||
render: FORM_ITEM_RENDER_ENUM.NUMBER,
|
||||
},
|
||||
{
|
||||
name: "rank_level",
|
||||
name: "rankLevel",
|
||||
label: "职级",
|
||||
required: false,
|
||||
render: (
|
||||
|
|
@ -328,6 +378,13 @@ function Add(props) {
|
|||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
{
|
||||
name: "deputyLeaderFlag",
|
||||
label: "是否为分管领导",
|
||||
required: false,
|
||||
render: FORM_ITEM_RENDER_ENUM.RADIO,
|
||||
items: WHETHER_ENUM,
|
||||
},
|
||||
]}
|
||||
labelCol={{
|
||||
span: 6,
|
||||
|
|
|
|||
|
|
@ -8,13 +8,16 @@ import ImportIcon from "zy-react-library/components/Icon/ImportIcon";
|
|||
import ImportFile from "zy-react-library/components/ImportFile";
|
||||
import LeftTree from "zy-react-library/components/LeftTree/Department/Gwj/index";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import 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) {
|
||||
|
|
@ -33,6 +36,8 @@ function List(props) {
|
|||
return {
|
||||
...formData,
|
||||
eqDepartmentId: selectedNodeId,
|
||||
allFlag: 1,
|
||||
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
@ -46,7 +51,7 @@ function List(props) {
|
|||
});
|
||||
setPostData(res?.data || []);
|
||||
}
|
||||
catch (err) {
|
||||
catch {
|
||||
message.error("岗位数据加载失败");
|
||||
setPostData([]);
|
||||
}
|
||||
|
|
@ -60,9 +65,12 @@ function List(props) {
|
|||
onOk: () => {
|
||||
props["userRemove"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -80,12 +88,19 @@ function List(props) {
|
|||
},
|
||||
});
|
||||
};
|
||||
const onResetPassword = () => {
|
||||
const onResetPassword = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
content: "确定要重置密码为Aa@123456789吗?",
|
||||
content: "确定要重置密码为Aa12345678吗?",
|
||||
onOk: () => {
|
||||
message.success("重置密码成功");
|
||||
props["userChangePassword"]({
|
||||
id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("重置密码成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
|
@ -96,6 +111,7 @@ function List(props) {
|
|||
// message.success("导入成功");
|
||||
};
|
||||
const onTreeChange = (selectedKeys) => {
|
||||
console.log(selectedKeys);
|
||||
const key = selectedKeys[0] || null;
|
||||
setSelectedNodeId(key);
|
||||
getData();
|
||||
|
|
@ -135,6 +151,16 @@ function List(props) {
|
|||
valueKey: "id",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "personnelType",
|
||||
label: "人员类型",
|
||||
render: (
|
||||
<DictionarySelect
|
||||
dictValue="renyuanleixing"
|
||||
|
||||
/>
|
||||
),
|
||||
},
|
||||
]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
|
|
@ -167,10 +193,12 @@ function List(props) {
|
|||
onOk: async () => {
|
||||
await props["userRemoveIds"]({
|
||||
ids: selectedRowKeys.join(","),
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
message.success("删除成功");
|
||||
getData();
|
||||
}
|
||||
});
|
||||
message.success("删除成功");
|
||||
setSelectedRowKeys([]);
|
||||
getData();
|
||||
},
|
||||
});
|
||||
}}
|
||||
|
|
@ -216,6 +244,10 @@ function List(props) {
|
|||
title: "所属岗位",
|
||||
dataIndex: "postName",
|
||||
},
|
||||
{
|
||||
title: "人员类型",
|
||||
dataIndex: "personnelTypeName",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
width: 300,
|
||||
|
|
@ -259,24 +291,30 @@ function List(props) {
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<ImportFile
|
||||
visible={importOpen}
|
||||
templateUrl=""
|
||||
onCancel={() => {
|
||||
setImportOpen(false);
|
||||
}}
|
||||
onConfirm={onImportFileConfirm}
|
||||
/>
|
||||
<AddModal
|
||||
open={addModalOpen}
|
||||
getData={getData}
|
||||
currentId={currentId}
|
||||
requestDetails={props["userDetails"]}
|
||||
onCancel={() => {
|
||||
setAddModalOpen(false);
|
||||
setCurrentId("");
|
||||
}}
|
||||
/>
|
||||
{ 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("");
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -289,11 +327,12 @@ function AddModalComponent(props) {
|
|||
const res = await props.requestDetails({
|
||||
id: props.currentId,
|
||||
});
|
||||
console.log(res.data);
|
||||
|
||||
res.data.userAvatarUrl = [{ filePath: res.data.userAvatarUrl }];
|
||||
|
||||
setInfo(res.data);
|
||||
};
|
||||
fetchData();
|
||||
console.log(info);
|
||||
}
|
||||
}, [props.currentId]);
|
||||
const onCancel = () => {
|
||||
|
|
@ -365,11 +404,11 @@ function AddModalComponent(props) {
|
|||
},
|
||||
{
|
||||
label: "性别",
|
||||
children: info.sex,
|
||||
children: idCardGetDateAndGender(info.userIdCard).sex === "1" ? "男" : idCardGetDateAndGender(info.userIdCard).sex === "0" ? "女" : "",
|
||||
},
|
||||
{
|
||||
label: "人脸照片",
|
||||
children: info.nationName,
|
||||
children: <TooltipPreviewImg files={info.userAvatarUrl} />,
|
||||
},
|
||||
{
|
||||
label: "部门排序",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,106 @@
|
|||
import { useEffect, useRef, useState } from "react";
|
||||
/**
|
||||
* 根据身份证号计算年龄
|
||||
* @param {string} idCard - 18位身份证号码
|
||||
* @returns {number | null} 年龄(整数),无效身份证返回 null
|
||||
*/
|
||||
export function getAgeByIdCard(idCard) {
|
||||
// 非空 & 类型校验
|
||||
if (!idCard || typeof idCard !== "string") {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 只处理18位身份证
|
||||
const id = idCard.trim();
|
||||
if (id.length !== 18) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 提取出生年月日:第7~14位(索引6~13)
|
||||
const birthStr = id.substring(6, 14); // 如 "19900101"
|
||||
const year = Number.parseInt(birthStr.substring(0, 4), 10);
|
||||
const month = Number.parseInt(birthStr.substring(4, 6), 10);
|
||||
const day = Number.parseInt(birthStr.substring(6, 8), 10);
|
||||
|
||||
// 简单校验日期合法性(可选增强)
|
||||
if (year < 1900 || year > new Date().getFullYear() || month < 1 || month > 12 || day < 1 || day > 31) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 构造出生日期
|
||||
const birthDate = new Date(year, month - 1, day); // 月份从0开始
|
||||
const today = new Date();
|
||||
|
||||
// 计算年龄
|
||||
let age = today.getFullYear() - birthDate.getFullYear();
|
||||
const monthDiff = today.getMonth() - birthDate.getMonth();
|
||||
const dayDiff = today.getDate() - birthDate.getDate();
|
||||
|
||||
// 如果还没过生日,减1岁
|
||||
if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
|
||||
age -= 1;
|
||||
}
|
||||
|
||||
return age >= 0 ? age : null; // 年龄不能为负
|
||||
}
|
||||
/**
|
||||
* 从18位身份证号中提取出生年月日
|
||||
* @param {string} idCard - 身份证号码
|
||||
* @returns {{ year: number; month: number; day: number } | null} 出生年月日对象,无效则返回 null
|
||||
*/
|
||||
export function getBirthDateFromIdCard(idCard) {
|
||||
if (!idCard || typeof idCard !== "string") {
|
||||
return null;
|
||||
}
|
||||
|
||||
const id = idCard.trim();
|
||||
if (id.length !== 18) {
|
||||
return null; // 仅支持18位身份证
|
||||
}
|
||||
|
||||
// 提取第7~14位:YYYYMMDD
|
||||
const birthStr = id.substring(6, 14); // 如 "19900307"
|
||||
|
||||
const year = Number.parseInt(birthStr.substring(0, 4), 10);
|
||||
const month = Number.parseInt(birthStr.substring(4, 6), 10);
|
||||
const day = Number.parseInt(birthStr.substring(6, 8), 10);
|
||||
|
||||
// 简单合法性校验
|
||||
const currentYear = new Date().getFullYear();
|
||||
if (
|
||||
year < 1900
|
||||
|| year > currentYear + 1 // 允许未来1年(录入误差)
|
||||
|| 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) {
|
||||
clearTimeout(timerRef.current);
|
||||
}
|
||||
|
||||
// 设置新的定时器
|
||||
timerRef.current = setTimeout(() => {
|
||||
setDebouncedValue(value);
|
||||
}, delay);
|
||||
|
||||
// 组件卸载或 delay/value 变化时清理
|
||||
return () => {
|
||||
if (timerRef.current) {
|
||||
clearTimeout(timerRef.current);
|
||||
}
|
||||
};
|
||||
}, [value, delay]);
|
||||
|
||||
return debouncedValue;
|
||||
}
|
||||
Loading…
Reference in New Issue