Commit 6974ed40 authored by wuhao's avatar wuhao 🎯

asdr

parent 212345b2
...@@ -138,6 +138,7 @@ pre { ...@@ -138,6 +138,7 @@ pre {
justify-content: center; justify-content: center;
} }
.spread { .spread {
width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
...@@ -235,6 +236,12 @@ pre { ...@@ -235,6 +236,12 @@ pre {
} }
.logincontent { .logincontent {
.ant-tabs-nav-wrap{
display: inline-block !important;
}
.ant-tabs-tab-active {
font-size: 16px !important;
}
.ant-layout-footer { .ant-layout-footer {
background-color: #23394a !important; background-color: #23394a !important;
.ant-pro-global-footer { .ant-pro-global-footer {
...@@ -281,6 +288,16 @@ pre { ...@@ -281,6 +288,16 @@ pre {
.ant-select-clear { .ant-select-clear {
background-color: transparent !important; background-color: transparent !important;
} }
.ant-select-selection-item-content,.ant-select-selection-item-remove{
color: #000 !important;
.anticon {
color: #000 !important;
}
}
.ant-select-selection-overflow{
display: flex !important;
flex-wrap: nowrap !important;
}
} }
.reg { .reg {
...@@ -296,3 +313,6 @@ pre { ...@@ -296,3 +313,6 @@ pre {
.ant-pro-global-header { .ant-pro-global-header {
padding-left: 6px !important; padding-left: 6px !important;
} }
table{
min-width: calc(100% - 6px) !important;
}
import { import {
AlipayCircleOutlined,
LockOutlined, LockOutlined,
MobileOutlined,
TaobaoCircleOutlined,
UserOutlined, UserOutlined,
WeiboCircleOutlined, LoginOutlined,
ArrowRightOutlined,
CloseOutlined
} from "@ant-design/icons"; } from "@ant-design/icons";
import { Alert, message, Tabs, Row, Col } from "antd"; import { Alert, message, Tabs, Row, Col, Button, Input } from "antd";
import React, { useState } from "react"; import React, { useState, useRef } from "react";
import { import {
ProFormCaptcha, ProFormCaptcha,
ProFormCheckbox, ProFormCheckbox,
...@@ -19,7 +18,7 @@ import { ...@@ -19,7 +18,7 @@ import {
ProFormTextArea ProFormTextArea
} from "@ant-design/pro-form"; } from "@ant-design/pro-form";
import { Link, history, FormattedMessage, useModel } from "umi"; import { Link, history, FormattedMessage, useModel } from "umi";
import { fakeAccountLogin } from "@/services/login"; import { fakeAccountLogin, saveForRegister } from "@/services/login";
import styles from "./index.less"; import styles from "./index.less";
import AES from "crypto-js/aes"; import AES from "crypto-js/aes";
import ECB from "crypto-js/mode-ecb"; import ECB from "crypto-js/mode-ecb";
...@@ -29,26 +28,18 @@ import moment from "moment"; ...@@ -29,26 +28,18 @@ import moment from "moment";
import Footer from "@/components/Footer"; import Footer from "@/components/Footer";
import { import {
factorySelectRegister, factorySelectRegister,
shopSelectByFactory, storeselectionBoxAll,
productionLineSelectByShops, productionLineSelectByShops,
sectionSelectByShops, sectionSelectByShops,
allUserSelect, allUserSelect,
departmentTree, departmentTree,
roleSelectRegister, roleSelectRegister,
} from "@/services/system"; } from "@/services/system";
import { doFetch } from "@/utils/doFetch";
import { ProDescriptions } from '@ant-design/pro-components';
const { Search } = Input;
const LoginMessage = ({ content }) => (
<Alert
style={{
marginBottom: 24,
}}
message={content}
type="error"
showIcon
/>
);
const { TabPane } = Tabs; const { TabPane } = Tabs;
...@@ -56,8 +47,11 @@ let col = { xs: 0, sm: 0, md: 7, lg: 6, xl: 6, xxl: 6 }, ...@@ -56,8 +47,11 @@ let col = { xs: 0, sm: 0, md: 7, lg: 6, xl: 6, xxl: 6 },
cols = { xs: 24, sm: 24, md: 17, lg: 18, xl: 18, xxl: 18 }; cols = { xs: 24, sm: 24, md: 17, lg: 18, xl: 18, xxl: 18 };
const Login = () => { const Login = () => {
const formRef = useRef();
const { initialState, setInitialState } = useModel("@@initialState"); const { initialState, setInitialState } = useModel("@@initialState");
const [tabkey, settabkey] = useState("1"); const [tabkey, settabkey] = useState("1");
const [visible, setvisible] = useState(true);
const [data, setdata] = useState();
const fetchUserInfo = async () => { const fetchUserInfo = async () => {
const userInfo = await initialState?.fetchUserInfo(), const userInfo = await initialState?.fetchUserInfo(),
menuData = await initialState?.getmenuData(); menuData = await initialState?.getmenuData();
...@@ -105,14 +99,24 @@ const Login = () => { ...@@ -105,14 +99,24 @@ const Login = () => {
} }
}; };
const handleReg = async (values) => {
console.log(values);
debugger
// 登录
const res = await saveForRegister({ ...values });
if (res.code === "0000") {
message.success("注册成功,根据用户名可查询注册进度");
formRef.current.resetFields();
return;
}
};
const handleSubmit = async (values) => { const handleSubmit = async (values) => {
if (tabkey == "1") { if (tabkey == "1") {
await handleLogin(values) await handleLogin(values)
} else { } else {
await handleReg(values)
} }
} }
...@@ -131,12 +135,154 @@ const Login = () => { ...@@ -131,12 +135,154 @@ const Login = () => {
<div className="cover"> <div className="cover">
<img alt="logo" src={require("@/assets/logo_white.png")} /> <img alt="logo" src={require("@/assets/logo_white.png")} />
</div> </div>
{
visible && <div className={styles.search}>
<h2 style={{ fontSize: 16, borderBottom: "6px solid #eee", marginBottom: 12, paddingBottom: 12 }} className="spread">
<a>
查询注册进度
</a>
<CloseOutlined style={{ color: "red" }} onClick={() => {
setvisible(false)
}}>
</CloseOutlined>
</h2>
<Search
placeholder="请输入手机号"
allowClear
onSearch={(value) => {
if (value) {
doFetch({
url: "/ngic-auth/sysAccountApply/queryByPhone",
params: { accountName: value.replace(/^\s+|\s+$/g, "") },
}).then((res) => {
if (res.code == "0000") {
let data = res?.data?.data;
setdata(data);
}
});
}
}}
style={{ width: "100%", marginBottom: 15 }}
/>
<ProDescriptions
columns={[
{
"title": "用户名",
"dataIndex": "accountName",
"key": "accountName"
},
{
"title": "姓名",
"dataIndex": "userName",
"key": "userName"
},
{
"title": "联系电话",
"dataIndex": "telephone",
"key": "telephone"
},
{
"title": "工厂",
"dataIndex": "factoryName",
"key": "factoryName"
},
{
"title": "组织",
"dataIndex": "departmentName",
"key": "departmentName"
},
{
"title": "负责仓库",
"dataIndex": "chargeStoreName",
"key": "chargeStoreName"
},
{
"title": "角色",
"dataIndex": "roleName",
"key": "roleName"
},
{
"title": "直属领导",
"dataIndex": "parentName",
"key": "parentName"
},
{
"title": "邮箱",
"dataIndex": "mailNo",
"key": "mailNo"
},
{
"title": "审批结果",
"dataIndex": "auditResultName",
"key": "auditResultName"
},
{
"title": "这是审批意见",
"dataIndex": "auditOpinion",
"key": "auditOpinion"
},
{
"title": "审批状态",
"dataIndex": "statusName",
"key": "statusName"
},
{
"title": "备注",
"dataIndex": "remark",
"key": "remark"
},
{
"title": "申请时间",
"dataIndex": "applyTime",
"key": "applyTime"
},
{
"title": "审批时间",
"dataIndex": "auditTime",
"key": "auditTime"
},
{
"title": "审批人",
"dataIndex": "auditUserName",
"key": "auditUserName"
}
]}
column={1}
dataSource={data}
></ProDescriptions>
</div>
}
</div> </div>
</Col> </Col>
<Col {...cols}> <Col {...cols}>
<div className="logincontent" style={{ width: "100%", height: "100%", display: "flex", flexDirection: "column" }}> <div className="logincontent" style={{ width: "100%", height: "100%", display: "flex", flexDirection: "column" }}>
<div className={styles.content}> <div className={styles.content}>
<LoginForm <LoginForm
submitter={{
render: (props) => {
return <Button
{...props}
style={{ width: "100%" }}
type="primary"
size="large"
icon={tabkey === "1" ? <LoginOutlined /> : <ArrowRightOutlined />}
onClick={async () => {
let values = await formRef.current.validateFields()
await handleSubmit(values);
}}
>
{tabkey === "1" ? "登录" : "注册"}
</Button>
}
}}
title={<span style={{ color: "#fff" }}>WMS</span>} title={<span style={{ color: "#fff" }}>WMS</span>}
subTitle={ subTitle={
<span style={{ color: "rgba(255,255,255,0.6)" }}> <span style={{ color: "rgba(255,255,255,0.6)" }}>
...@@ -150,11 +296,14 @@ const Login = () => { ...@@ -150,11 +296,14 @@ const Login = () => {
await handleSubmit(values); await handleSubmit(values);
}} }}
style={{ width: tabkey == "2" ? 560 : 328, marginLeft: tabkey == "2" ? -116 : 0 }}//样式适配 style={{ width: tabkey == "2" ? 560 : 328, marginLeft: tabkey == "2" ? -116 : 0 }}//样式适配
formRef={formRef}
> >
<Tabs <Tabs
style={{ justifyContent: "flex-start" }}
activeKey={tabkey} activeKey={tabkey}
onChange={settabkey} onChange={settabkey}
tabBarStyle={{ color: "#fff" }} tabBarStyle={{ color: "#fff" }}
tabBarExtraContent={<a style={{ color: "rgba(255,255,255,0.6)" }}>查询注册进度</a>}
> >
<TabPane tab="登录" key="1"> <TabPane tab="登录" key="1">
{tabkey == "1" && ( {tabkey == "1" && (
...@@ -195,6 +344,11 @@ const Login = () => { ...@@ -195,6 +344,11 @@ const Login = () => {
<Row className="reg" gutter={12}> <Row className="reg" gutter={12}>
<Col span={8}> <Col span={8}>
<ProFormText <ProFormText
fieldProps={{
style: {
height: 32
}
}}
name="accountName" name="accountName"
label={<b>用户名</b>} label={<b>用户名</b>}
placeholder="请输入用户名" placeholder="请输入用户名"
...@@ -209,6 +363,11 @@ const Login = () => { ...@@ -209,6 +363,11 @@ const Login = () => {
<Col span={8}> <Col span={8}>
<ProFormText <ProFormText
fieldProps={{
style: {
height: 32
}
}}
name="userName" name="userName"
label={<b>姓名</b>} label={<b>姓名</b>}
placeholder="请输入姓名" placeholder="请输入姓名"
...@@ -223,6 +382,11 @@ const Login = () => { ...@@ -223,6 +382,11 @@ const Login = () => {
<Col span={8}> <Col span={8}>
<ProFormText <ProFormText
fieldProps={{
style: {
height: 32
}
}}
name="telephone" name="telephone"
label={<b>联系电话</b>} label={<b>联系电话</b>}
placeholder="请输入联系电话" placeholder="请输入联系电话"
...@@ -242,8 +406,8 @@ const Login = () => { ...@@ -242,8 +406,8 @@ const Login = () => {
<Col span={8}> <Col span={8}>
<ProFormTreeSelect <ProFormTreeSelect
name="departmentId" name="departmentId"
label={<b>组织</b>} label={<b>部门</b>}
placeholder="请选择组织" placeholder="请选择部门"
fieldProps={{ fieldProps={{
fieldNames: { fieldNames: {
label: "title", label: "title",
...@@ -258,7 +422,7 @@ const Login = () => { ...@@ -258,7 +422,7 @@ const Login = () => {
rules={[ rules={[
{ {
required: true, required: true,
message: "请选择组织!", message: "请选择部门!",
} }
]} ]}
/> />
...@@ -266,7 +430,11 @@ const Login = () => { ...@@ -266,7 +430,11 @@ const Login = () => {
<Col span={8}> <Col span={8}>
<ProFormSelect <ProFormSelect
name="factoryId" fieldProps={{
mode: "multiple",
maxTagCount: 1
}}
name="factoryIdList"
label={<b>工厂</b>} label={<b>工厂</b>}
placeholder="请选择工厂" placeholder="请选择工厂"
request={async () => { request={async () => {
...@@ -283,17 +451,36 @@ const Login = () => { ...@@ -283,17 +451,36 @@ const Login = () => {
</Col> </Col>
<Col span={8}> <Col span={8}>
<ProFormDependency name={["factoryId"]}> <ProFormSelect
fieldProps={{
mode: "multiple",
maxTagCount: 1
}}
name="storeIdList"
label={<b>负责仓库</b>}
placeholder={"请选择负责仓库"}
request={async () => {
let res = await storeselectionBoxAll({});
return res?.data?.dataList ?? []
}}
rules={[
{
required: false,
message: "请选择负责仓库!",
}
]}
/>
{/* <ProFormDependency name={["factoryId"]}>
{ {
({ factoryId }) => { ({ factoryId }) => {
return <ProFormSelect return <ProFormSelect
name="shopIdList" name="storeIdList"
label={<b>负责仓库</b>} label={<b>负责仓库</b>}
placeholder={"请选择负责仓库"} placeholder={"请选择负责仓库"}
params={{ factoryId }} params={{ factoryId }}
request={async (params) => { request={async (params) => {
let res = await shopSelectByFactory({ factoryId: params.factoryId }); let res = await storeselectionBoxAll({});
return res?.data?.dataList ?? [] return res?.data?.dataList ?? []
}} }}
rules={[ rules={[
...@@ -307,12 +494,16 @@ const Login = () => { ...@@ -307,12 +494,16 @@ const Login = () => {
} }
</ProFormDependency> </ProFormDependency> */}
</Col> </Col>
<Col span={8}> <Col span={8}>
<ProFormSelect <ProFormSelect
fieldProps={{
mode: "multiple",
maxTagCount: 1
}}
name="roleIdList" name="roleIdList"
label={<b>角色配置</b>} label={<b>角色配置</b>}
placeholder="请选择角色配置" placeholder="请选择角色配置"
...@@ -348,13 +539,14 @@ const Login = () => { ...@@ -348,13 +539,14 @@ const Login = () => {
</Col> </Col>
<Col span={8}> <Col span={8}>
<ProFormText <ProFormText
fieldProps={{
style: {
height: 32
}
}}
name="mailNo" name="mailNo"
label={<b>邮箱</b>} label={<b>邮箱</b>}
placeholder="请输入邮箱" placeholder="请输入邮箱"
request={async () => {
let res = await allUserSelect({});
return res?.data?.dataList ?? []
}}
rules={[ rules={[
{ {
required: false, required: false,
......
...@@ -52,3 +52,14 @@ ...@@ -52,3 +52,14 @@
color: @primary-color; color: @primary-color;
} }
} }
.search{
position: absolute;
left: 0;
top: 0;
z-index: 999;
background-color: #ffffff;
width: 100%;
height: 100%;
padding: 12px;
}
\ No newline at end of file
...@@ -49,6 +49,9 @@ const Logon = (props) => { ...@@ -49,6 +49,9 @@ const Logon = (props) => {
<div className={styles.main}> <div className={styles.main}>
<div> <div>
<img src="./logo.svg" alt="" style={{ width: 44, marginBottom: 30 }} /> <img src="./logo.svg" alt="" style={{ width: 44, marginBottom: 30 }} />
</div> </div>
<div className={`${styles.body} logon`}> <div className={`${styles.body} logon`}>
<Tabs <Tabs
......
...@@ -16,6 +16,15 @@ export async function fakeAccountLoginOut(params) { ...@@ -16,6 +16,15 @@ export async function fakeAccountLoginOut(params) {
}); });
} }
//登录
export async function saveForRegister(params) {
return request("/wms/ngic-auth/sysAccountApply/saveForRegister", {
method: "POST",
data: params,
});
}
//个人信息 //个人信息
export async function queryCurrentUser(params) { export async function queryCurrentUser(params) {
return request("/wms/ngic-auth/sysUser/query", { return request("/wms/ngic-auth/sysUser/query", {
......
...@@ -29,7 +29,13 @@ export async function shopSelect(params) { ...@@ -29,7 +29,13 @@ export async function shopSelect(params) {
data: params, data: params,
}); });
} }
//仓库下拉
export async function storeselectionBoxAll(params) {
return request(`/wms/ngic-auth/sysStore/selectionBoxAll`, {
method: "POST",
data: params,
});
}
//根据工厂id查询车间下拉 //根据工厂id查询车间下拉
export async function shopSelectByFactory(params) { export async function shopSelectByFactory(params) {
return request(`/wms/ngic-auth/sysShop/query/selectbox/factory`, { return request(`/wms/ngic-auth/sysShop/query/selectbox/factory`, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment