| | |
| | | <div class="layadmin-user-login-main"> |
| | | <div class="layadmin-user-login-box layadmin-user-login-header"> |
| | | <!--<img src="layuiAdmin.std-v1.2.1/src/img/Logo.png" alt="供应商协同平台" align="middle" />--> |
| | | <h2 style="color:white;">供应商协同平台</h2> |
| | | <p style="color: white;">智云LMES管理系统</p> |
| | | <h2 style="color:white;" id="title1">供应商协同平台</h2> |
| | | <p style="color: white;margin-bottom:10px;" id="title2">智云LMES管理系统</p> |
| | | <a class="ax-item FY_BT" id="Hlanguage" style="color: white;">语言</a> |
| | | <select id="HTranSlate" style="width: 25%; margin-right: 1%; padding-left: 1px; font-size: 13px;"> |
| | | <option value="1" selected>中文</option> |
| | | <option value="2">Eeglish</option> |
| | | <option value="3">Spanish</option> |
| | | </select> |
| | | </div> |
| | | <div class="layadmin-user-login-box layadmin-user-login-body layui-form"> |
| | | <div class="layui-form-item"> |
| | |
| | | <div class="layui-form-item"> |
| | | <button type="button" lay-submit="" class="layui-btn layui-btn-fluid" id="LAY-user-login-submit" name="LAY-user-login-submit" lay-filter="LAY-user-login-submit">登 入</button> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <!--<div class="layui-form-item"> |
| | | <a href="./layuiAdmin.std-v1.2.1/src/Download/组装车间未排产代码.xlsx" download="组装车间未排产代码.xlsx" style="color:red;font-size:20px;">点击下载操作手册</a> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <a href="./layuiAdmin.std-v1.2.1/src/Download/gridreport6.8.zip" download="插件压缩包.zip" style="color:red;font-size:20px;">点击下载压缩包</a> |
| | | </div> |
| | | </div>--> |
| | | </div> |
| | | </div> |
| | | <!--顺序不能改变--> |
| | |
| | | <script src="layuiAdmin.std-v1.2.1/src/js/jquery-1.9.1.min.js"></script> |
| | | <script src="layuiAdmin.std-v1.2.1/src/js/jquery.selectlist.js"></script> |
| | | <script src="layuiAdmin.std-v1.2.1/src/layuiadmin/layui/layui.js"></script> |
| | | <script src="layuiAdmin.std-v1.2.1/src/layuiadmin/MESLanguage.js"></script> |
| | | <script src="Scripts/webConfig.js"></script> |
| | | <script type="text/javascript"> |
| | | layui.config({ |
| | |
| | | , form = layui.form |
| | | , router = layui.router() |
| | | , search = router.search; |
| | | |
| | | //#region 多语言 |
| | | var HModName = "SRM_login"; |
| | | var login_data = localStorage.getItem("data"); |
| | | var login_data2 = []; |
| | | if (login_data != null) { |
| | | login_data2 = JSON.parse(login_data); |
| | | } |
| | | //获取基础信息 |
| | | getBaseInfo(login_data2.HTranSlate); |
| | | |
| | | if (login_data == null || login_data2.HTranSlate == undefined) { |
| | | initFunction(1, "SRM_login", 1); |
| | | } else { |
| | | initFunction(1, "SRM_login", login_data2.HTranSlate); |
| | | } |
| | | //#endregion |
| | | |
| | | //获取登录页组织列 |
| | | var Organization = '<option value="0" style="color:red;">组织</option>'; |
| | | $.ajax({ |
| | |
| | | } |
| | | $("#edu").append(Organization); |
| | | form.render('select'); |
| | | |
| | | //读取配置文件 |
| | | get_ReadConfigFile(); |
| | | } |
| | | layer.closeAll("loading"); |
| | | } |
| | | }) |
| | | form.on('submit(LAY-user-login-submit)', function (obj) {//登录 |
| | | loging(obj); |
| | | if ($("#HTranSlate").val() == null) { |
| | | layer.msg("请选择语言!"); |
| | | return false; |
| | | } |
| | | loging(obj); |
| | | }) |
| | | |
| | | function loging(obj) { |
| | |
| | | sessionStorage["OrganizationID"] = $("#edu").val(); |
| | | sessionStorage["Organization"] = $("#edu option:selected").text(); |
| | | sessionStorage["login"] = "login"; |
| | | sessionStorage["HTranSlate"] = $("#HTranSlate option:selected").val(); |
| | | get_WriteConfigFile(); |
| | | window.location.href = "layuiAdmin.std-v1.2.1/src/views/index.html" |
| | | } |
| | | else { |
| | |
| | | } |
| | | layer.closeAll("loading"); |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | //密码框回车执行登录 |
| | | $('#LAY-user-login-password').on('keydown', function (e) { |
| | | if (e.keyCode == 13) { |
| | | if ($("#HTranSlate").val() == null) { |
| | | layer.msg("请选择语言!"); |
| | | return false; |
| | | } |
| | | loging(); |
| | | } |
| | | }); |
| | |
| | | $("#LAY-user-login-password").focus(); |
| | | } |
| | | }) |
| | | |
| | | //#region 多语言翻译 |
| | | |
| | | $("#HTranSlate").change(function () { |
| | | var select = $("#HTranSlate").val(); |
| | | getBaseInfo(select); |
| | | initFunction(1, HModName, select); |
| | | //sessionStorage["HTranSlate"] = select; |
| | | }) |
| | | |
| | | //读取配置文件 |
| | | function get_ReadConfigFile() { |
| | | //获取本地存储的数据 |
| | | var data = localStorage.getItem("data"); |
| | | if (data != null) { |
| | | var data2 = JSON.parse(data); |
| | | $("#LAY-user-login-username").val(data2["UserID"]); |
| | | $("#Organization").val(data2["OrgID"]); |
| | | $("#HTranSlate").val(data2["HTranSlate"] == undefined ? 1 : data2["HTranSlate"]); |
| | | form.render('select'); |
| | | } |
| | | } |
| | | |
| | | //存储配置文件 |
| | | function get_WriteConfigFile() { |
| | | //清空本地存储的数据 |
| | | localStorage.removeItem("data"); |
| | | var data = { |
| | | UserID: sessionStorage["Czybm"] |
| | | , OrgID: sessionStorage["OrganizationID"] |
| | | , HTranSlate: sessionStorage["HTranSlate"] |
| | | } |
| | | //本地存储 |
| | | localStorage.setItem("data", JSON.stringify(data)); |
| | | } |
| | | |
| | | //获取基础信息 |
| | | function getBaseInfo(HTranSlate) { |
| | | if (HTranSlate == undefined) { |
| | | HTranSlate = "1"; |
| | | } |
| | | |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL() + "Web/BaseInfo", |
| | | async: false, |
| | | data: {}, |
| | | success: function (res) { |
| | | //查询成功 |
| | | if (res.count == 1) { |
| | | var data = res.data[0]; |
| | | console.log(data); |
| | | |
| | | //判断当前登录的语言类型 |
| | | var HLogoLabel = ""; |
| | | var HMenuLabel = ""; |
| | | if (HTranSlate == "1" || (login_data2.length == 0 && HTranSlate == undefined)) { |
| | | HLogoLabel = data.HLogoLabel; |
| | | HMenuLabel = data.HMenuLabel; |
| | | } else if (HTranSlate == "2") { |
| | | HLogoLabel = data.HLogoTranslationText_English; |
| | | HMenuLabel = data.HMenuTranslationText_English; |
| | | } else if (HTranSlate == "3") { |
| | | HLogoLabel = data.HLogoTranslationText_Spain; |
| | | HMenuLabel = data.HMenuTranslationText_Spain; |
| | | } |
| | | |
| | | sessionStorage["HCusName"] = data.HCusName; |
| | | sessionStorage["HLogoLabel"] = HLogoLabel; |
| | | sessionStorage["HMenuLabel"] = HMenuLabel; |
| | | $("#HLogoLabel").text(HLogoLabel); |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | //#endregion |
| | | |
| | | }); |
| | | </script> |
| | | </body> |