zrg
2024-12-30 97fd11f21a7dcf2f6de866986bc9e6ee9da6a132
WebTM/views/user/login.html
@@ -1,46 +1,224 @@

<!--
    Last modified: 2022-06-25 18:40:11
    Url: https://www.axui.cn
-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>登入</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link href="../../layuiadmin/ax/ax-response.css" rel="stylesheet" />
    <link href="../../layuiadmin/ax/ax.css" rel="stylesheet" />
    <link href="../../layuiadmin/ax/main.css" rel="stylesheet" />
    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="../../layuiadmin/style/login.css" media="all">
</head>
<body>
    <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">
        <div class="layadmin-user-login-main">
            <div class="layadmin-user-login-box layadmin-user-login-header">
                <h2>L-MES</h2>
                <p>WMS条码系统</p>
            </div>
            <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                    <input type="text" name="username" id="LAY-user-login-username" lay-verify="required" placeholder="用户名" class="layui-input">
                </div>
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                    <input type="password" name="password" id="LAY-user-login-password" lay-verify="required" placeholder="密码" class="layui-input">
                </div>
                <!--<div class="layui-form-item" style="margin-bottom: 20px;">
                    <input type="checkbox" name="remember" lay-skin="primary" title="记住密码">
                    <a href="forget.html" class="layadmin-user-jump-change layadmin-link" style="margin-top: 7px;">忘记密码?</a>
                </div>-->
                <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>
<body class="ax-align-origin">
    <div class="login ax-shadow-cloud ax-radius-md">
        <div class="ax-row ax-radius-md ax-split">
            <div class="ax-col ax-col-14 ax-radius-left ax-radius-md cover"></div>
            <div class="ax-col ax-col-10">
                <div class="core">
                    <div class="ax-break"></div>
                    <div class="ax-tab" axTab>
                        <ul class="ax-row ax-tab-nav ax-menu-tab">
                            <a href="###" class="ax-item ax-col" style="font-size: 20px;" id="HLogoLabel">智云迈思L-MES</a>
                            <!--<a href="###" class="ax-item">注册新用户</a>-->
                            <!--<li class="ax-col"></li>-->
                        </ul>
                        <ul class="ax-tab-content">
                            <li>
                                <form>
                                    <div class="ax-break"></div>
                                    <div class="ax-break ax-hide-tel"></div>
                                    <div class="ax-form-group">
                                        <div class="ax-flex-row">
                                            <div class="ax-form-con">
                                                <div class="ax-form-input">
                                                    <select name="Organization" id="Organization" lay-verify="required" lay-search class="layui-input">
                                                        <!--动态渲染组织-->
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ax-break-md"></div>
                                    <div class="ax-form-group">
                                        <div class="ax-flex-row">
                                            <div class="ax-form-con">
                                                <div class="ax-form-input">
                                                    <span class="ax-pos-left" style="width: 2.4rem;"><i class="ax-iconfont ax-icon-me-f"></i></span>
                                                    <input name="LAY-user-login-username" value="" placeholder="输入登录名称" type="text" id="LAY-user-login-username">
                                                    <span class="ax-pos-right" ><a href="###" class="ax-iconfont ax-icon-close ax-val-none"></a></span>
                                                </div>
                                                <button type="button" lay-submit="" class="layui-btn layui-btn-sm" id="LAY-user-loginICCard-submit" name="LAY-user-loginICCard-submit" lay-filter="LAY-user-loginICCard-submit" style="position: absolute;margin-top:-3.5rem;margin-left:36rem"><i class="layui-icon layui-icon-layer"></i>刷卡</button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ax-break-md"></div>
                                    <div class="ax-form-group">
                                        <div class="ax-flex-row">
                                            <div class="ax-form-con">
                                                <div class="ax-form-input">
                                                    <span class="ax-pos-left" style="width:2.4rem;"><i class="ax-iconfont ax-icon-lock-f"></i></span>
                                                    <input name="LAY-user-login-password" placeholder="输入密码" type="password" id="LAY-user-login-password">
                                                    <span class="ax-pos-right"><a href="###" class="ax-iconfont ax-icon-close ax-val-none"></a></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ax-break-md"></div>
                                    <!--<div class="ax-form-group">
                                        <div class="ax-flex-row">
                                            <div class="ax-form-con">
                                                <div class="ax-form-input">
                                                    <div class="ax-row">
                                                        <div class="ax-flex-block">
                                                            <span class="ax-pos-left" style="width:2.4rem;"><i class="ax-iconfont ax-icon-shield-f"></i></span>
                                                            <input name="username" placeholder="输入验证码..." value="" type="text"><span class="ax-pos-right"><a href="###" class="ax-iconfont ax-icon-close ax-val-none"></a></span>
                                                        </div>
                                                        <a href="###" class="ax-form-img"><img src="../../layuiadmin/ax/images/yanzhengma.jpg"></a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>-->
                                    <div class="ax-break-md"></div>
                                    <!--<div class="ax-form-group">
                                        <div class="ax-flex-row">
                                            <div class="ax-form-con">
                                                <div class="ax-form-input">
                                                    <div class="ax-row">
                                                        <div class="ax-flex-block">
                                                            <label class="ax-checkbox"><input name="free-agree" value="0" checked="" type="checkbox"><span>记住密码</span></label>
                                                        </div>
                                                        <a href="###" class="ax-form-txt ax-color-ignore">忘记了密码?</a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>-->
                                    <div class="ax-break-md"></div>
                                    <div class="ax-form-group">
                                        <div class="ax-flex-row">
                                            <div class="ax-flex-block">
                                                <div class="ax-form-input"><button type="button" lay-submit="" class="ax-btn ax-primary ax-full" id="LAY-user-login-submit" name="LAY-user-login-submit" lay-filter="LAY-user-login-submit">登录</button></div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ax-break"></div>
                                    <div class="ax-break ax-hide-tel"></div>
                                    <div class="ax-break ax-hide-tel"></div>
                                </form>
                            </li>
                            <li>
                                <form>
                                    <div class="ax-break"></div>
                                    <div class="ax-break ax-hide-tel"></div>
                                    <div class="ax-form-group">
                                        <div class="ax-flex-row">
                                            <div class="ax-form-con">
                                                <div class="ax-form-input"><span class="ax-pos-left" style="width: 2.4rem;"><i class="ax-iconfont ax-icon-me-f"></i></span><input name="username" placeholder="输入名称" type="text"><span class="ax-pos-right"><a href="###" class="ax-iconfont ax-icon-close ax-val-none"></a></span></div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ax-break-md"></div>
                                    <div class="ax-form-group">
                                        <div class="ax-flex-row">
                                            <div class="ax-form-con">
                                                <div class="ax-form-input">
                                                    <span class="ax-pos-left" style="width:2.4rem;"><i class="ax-iconfont ax-icon-lock-f"></i></span>
                                                    <input name="password" placeholder="输入密码" type="password"><span class="ax-pos-right"><a href="###" class="ax-iconfont ax-icon-close ax-val-none"></a></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ax-break-md"></div>
                                    <div class="ax-form-group">
                                        <div class="ax-flex-row">
                                            <div class="ax-form-con">
                                                <div class="ax-form-input">
                                                    <span class="ax-pos-left" style="width:2.4rem;"><i class="ax-iconfont ax-icon-lock-f"></i></span>
                                                    <input name="password" placeholder="再次输入密码" type="password"><span class="ax-pos-right"><a href="###" class="ax-iconfont ax-icon-close ax-val-none"></a></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ax-break-md"></div>
                                    <div class="ax-form-group">
                                        <div class="ax-flex-row">
                                            <div class="ax-form-con">
                                                <div class="ax-form-input">
                                                    <div class="ax-row">
                                                        <div class="ax-flex-block">
                                                            <label class="ax-checkbox"><input name="free-agree" value="0" checked="" type="checkbox"><span>注册成功后立即登录</span></label>
                                                        </div>
                                                        <a href="###" class="ax-form-txt ax-color-primary">有账号?立即登录</a>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ax-break-md"></div>
                                    <div class="ax-form-group">
                                        <div class="ax-flex-row">
                                            <div class="ax-flex-block">
                                                <div class="ax-form-input"><button type="button" class="ax-btn ax-primary ax-full">注册</button></div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ax-break"></div>
                                    <div class="ax-break ax-hide-tel"></div>
                                    <div class="ax-break ax-hide-tel"></div>
                                </form>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="../../layuiadmin/ax/ax.min.js"></script>
    <script src="../../layuiadmin/layui/layui.js"></script>
    <script src="../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../layuiadmin/zgqCustom/zgqCustom.js" type="text/javascript"></script>
    <script>
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
@@ -55,149 +233,304 @@
            //, search = router.search;
            var $ = layui.$
            , admin = layui.admin
            , layer = layui.layer
            , table = layui.table
            , form = layui.form
            , element = layui.element
            , laypage = layui.laypage
            , laydate = layui.laydate
            , util = layui.util;
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , element = layui.element
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util;
            //获取数据库名
            $.ajax({
                type: "get",
                url: GetWEBURL() + "/Web/GetDataBases",
                success: function (result) {
                    if (result.count == 1) { // 说明验证成功了,
                        sessionStorage["数据库"] = result.data[0].Name;
                    }
                    layer.closeAll("loading");
                }
            })
            var load = layer.load(1, {
                content: '组织加载中。。。',
                shade: [0.4, '#393D49'],
                // time: 10 * 1000,
                success: function (layero) {
                    layero.css('padding-left', '30px');
                    layero.find('.layui-layer-content').css({
                        'padding-top': '40px',
                        'width': '70px',
                        'color': 'white',
                        'background-position-x': '16px'
                    });
                }
            })
            //获取基础信息
            getBaseInfo();
            //获取登录页组织列
            var Organization = '';
            $.ajax({
                type: "get",
                url: GetWEBURL() + "/Web/GetOrganizations",
                success: function (result) {
                    if (result.count == 1) { // 说明验证成功了,
                        var data = result.data;
                        for (var i = 0; i < data.length; i++) {
                            if (i == 0)
                                Organization += '<option  "  value="' + data[i].ID + '" selected>' + data[i].Name + '</option>';
                            else
                                Organization += '<option  " value="' + data[i].ID + '">' + data[i].Name + '</option>';
                        }
                        $("#Organization").append(Organization);
                        form.render('select');
                        //读取配置文件
                        get_ReadConfigFile();
                    }
                    layer.closeAll("loading");
                }
            })
            //form.render();
            //判断用户是移动端还是PC端
            var judgeMorPCflag = judgeMorPC();
            //提交
            form.on("submit(LAY-user-login-submit)", function (obj) {
                var user = obj.field;
                layer.load(3)
                //if (event.keyCode == 13) {
                    $.ajax({
                        type: "get",
                        //url: "http://61.130.49.162:9090/WMSAPI///Web/GetUser",
                        url: GetWEBURL() + "/Web/GetUser",
                        data: { "UserName": user.username, "PassWord": user.password },
                        success: function (result) {
                            if (result.count == 1) { // 说明验证成功了,
                                layer.msg(result.Message, { icon: 1 });
                                //sessionStorage["HUserName"] = user.username;
                                sessionStorage["HUserName"] = result.data[0].Czymc;
                                sessionStorage["HBillerID"] = result.data[0].HK3UserID;
                                sessionStorage["SourceFlag"] = false;
                                sessionStorage["HKeeperID"] = result.data[0].HKeeperID;
                                sessionStorage["HKeeper"] = result.data[0].HKeeper;
                                sessionStorage["HSecManagerID"] = result.data[0].HSecManagerID;
                                sessionStorage["HSecManager"] = result.data[0].HSecManager;
                                sessionStorage["HSellManID"] = result.data[0].HSellManID;
                                sessionStorage["HSellMan"] = result.data[0].HSellMan;
                                sessionStorage["HDeptID"] = result.data[0].HDeptID;
                                sessionStorage["HDept"] = result.data[0].HDept;
                                sessionStorage["HWHID"] = result.data[0].HWhID;
                                sessionStorage["HWHName"] = result.data[0].HWHName;
                                sessionStorage["HSPID"] = result.data[0].HSPID;
                                sessionStorage["HSPName"] = result.data[0].HSPName;
                                sessionStorage["HSupID"] = result.data[0].HSupID;
                                sessionStorage["HSupName"] = result.data[0].HSupName;
                                sessionStorage["Czmm"] = result.data[0].Czmm;
                                sessionStorage["Czybm"] = result.data[0].Czybm;
                                sessionStorage["HEmpID"] = result.data[0].HEmpID;
                                sessionStorage["HGroup"] = result.data[0].HGroup;
                                sessionStorage["HGroupID"] = result.data[0].HGroupID;
                                sessionStorage["HProc"] = result.data[0].HProc;
                                sessionStorage["HProcNo"] = result.data[0].HProcNo;
                                sessionStorage["HSource"] = result.data[0].HSource;
                                sessionStorage["HSourceID"] = result.data[0].HSourceID;
                                sessionStorage["HWorkCenter"] = result.data[0].HWorkCenter;
                                sessionStorage["HWorkCenterID"] = result.data[0].HWorkCenterID;
                                sessionStorage["HProcName"] = result.data[0].HProcName;
                                sessionStorage["HProcID"] = result.data[0].HProcID;
                                //sessionStorage["IP"] = System.Configuration.ConfigurationSettings.AppSettings("name");
                                window.location.href = '../../views/index.html'
                            }
                            else {
                                // $("#verifycode").click();
                                layer.msg(result.Message, { icon: 5 });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (result) {
                            layer.closeAll("loading");
                            layer.msg("接口请求失败!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            //layer.msg('获取采购订单出现异常', { icon: 2, time: 2000 });
                        }
                    })
                //}
                loging();
            })
            form.on("submit(LAY-user-loginICCard-submit)", function (obj) {
                loginICCard();
            })
            //音频
            form.on("submit(LAY-user-login-yp)", function (obj) {
                playSound();
            })
            //密码框回车执行登录
            $('#LAY-user-login-password').on('keydown', function (e) {
                if (e.keyCode == 13) {
                    var UserName = $("#LAY-user-login-username").val();
                    var PassWord = $("#LAY-user-login-password").val();
                    layer.load(3);
                    $.ajax({
                        type: "get",
                        //url: "http://61.130.49.162:9090/WMSAPI///Web/GetUser",
                        url: GetWEBURL() + "/Web/GetUser",
                        data: { "UserName": UserName, "PassWord": PassWord },
                        success: function (result) {
                            if (result.count == 1) { // 说明验证成功了,
                                layer.msg(result.Message, { icon: 1 });
                                sessionStorage["HUserName"] = result.data[0].Czymc;;
                                sessionStorage["HBillerID"] = result.data[0].HK3UserID;
                                sessionStorage["SourceFlag"] = false;
                                sessionStorage["HKeeperID"] = result.data[0].HKeeperID;
                                sessionStorage["HKeeper"] = result.data[0].HKeeper;
                                sessionStorage["HSecManagerID"] = result.data[0].HSecManagerID;
                                sessionStorage["HSecManager"] = result.data[0].HSecManager;
                                sessionStorage["HSellManID"] = result.data[0].HSellManID;
                                sessionStorage["HSellMan"] = result.data[0].HSellMan;
                                sessionStorage["HDeptID"] = result.data[0].HDeptID;
                                sessionStorage["HDept"] = result.data[0].HDept;
                                sessionStorage["HWHID"] = result.data[0].HWhID;
                                sessionStorage["HWHName"] = result.data[0].HWHName;
                                sessionStorage["HSPID"] = result.data[0].HSPID;
                                sessionStorage["HSPName"] = result.data[0].HSPName;
                                sessionStorage["HSupID"] = result.data[0].HSupID;
                                sessionStorage["HSupName"] = result.data[0].HSupName;
                                sessionStorage["Czmm"] = result.data[0].Czmm;
                                sessionStorage["Czybm"] = result.data[0].Czybm;
                                sessionStorage["HEmpID"] = result.data[0].HEmpID;
                                sessionStorage["HGroup"] = result.data[0].HGroup;
                                sessionStorage["HGroupID"] = result.data[0].HGroupID;
                                sessionStorage["HProc"] = result.data[0].HProc;
                                sessionStorage["HProcNo"] = result.data[0].HProcNo;
                                sessionStorage["HSource"] = result.data[0].HSource;
                                sessionStorage["HSourceID"] = result.data[0].HSourceID;
                                sessionStorage["HWorkCenter"] = result.data[0].HWorkCenter;
                                sessionStorage["HWorkCenterID"] = result.data[0].HWorkCenterID;
                                sessionStorage["HProcName"] = result.data[0].HProcName;
                                sessionStorage["HProcID"] = result.data[0].HProcID;
                                //sessionStorage["IP"] = System.Configuration.ConfigurationSettings.AppSettings("name");
                                window.location.href = '../../views/index.html'
                            }
                            else {
                                // $("#verifycode").click();
                                layer.msg(result.Message, { icon: 5 });
                            }
                            layer.closeAll("loading");
                        }
                    })
                    loging();
                    //playSound();
                }
            });
            //用户名框回车光标移到密码框
            $('#LAY-user-login-username').on('keydown', function (e) {
                if (e.keyCode == 13)
                {
                if (e.keyCode == 13) {
                    $("#LAY-user-login-password").focus();
                }
            })
            //读取配置文件
            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"]);
                    form.render('select');
                }
            }
            //存储配置文件
            function get_WriteConfigFile() {
                //清空本地存储的数据
                localStorage.removeItem("data");
                var data = {
                    UserID: sessionStorage["Czybm"]
                    , OrgID: sessionStorage["OrganizationID"]
                }
                //本地存储
                localStorage.setItem("data", JSON.stringify(data));
            }
            //登录
            function loging() {
                if ($("#Organization").val() == 0) {
                    //playSound();
                    layer.msg("请选择组织!");
                    return;
                }
                var UserName = $("#LAY-user-login-username").val();
                var PassWord = $("#LAY-user-login-password").val();
                layer.load(3);
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "/Web/GetUser",
                    data: { "UserName": UserName, "PassWord": PassWord, "HOrgName": $("#Organization").val() },
                    success: function (result) {
                        if (result.count == 1) { // 说明验证成功了,
                            layer.msg(result.Message, { icon: 1 });
                            //sessionStorage["HUserName"] = user.username;
                            sessionStorage["HCloudUserName"] = result.data[0].HCloudUserName;//金蝶云账号
                            sessionStorage["HCloudUserPsd"] = result.data[0].HCloudUserPsd;
                            sessionStorage["HMaker"] = result.data[0].Czymc;
                            sessionStorage["HUserName"] = result.data[0].Czymc;
                            sessionStorage["HBillerID"] = result.data[0].HK3UserID;
                            sessionStorage["SourceFlag"] = false;
                            sessionStorage["HKeeperID"] = result.data[0].HKeeperID;
                            sessionStorage["HKeeper"] = result.data[0].HKeeper;
                            sessionStorage["HSecManagerID"] = result.data[0].HSecManagerID;
                            sessionStorage["HSecManager"] = result.data[0].HSecManager;
                            sessionStorage["HSellManID"] = result.data[0].HSellManID;
                            sessionStorage["HSellMan"] = result.data[0].HSellMan;
                            sessionStorage["HDeptID"] = result.data[0].HDeptID;
                            sessionStorage["HDept"] = result.data[0].HDept;
                            sessionStorage["HWHID"] = result.data[0].HWhID;
                            sessionStorage["HWHName"] = result.data[0].HWHName;
                            sessionStorage["HSPID"] = result.data[0].HSPID;
                            sessionStorage["HSPName"] = result.data[0].HSPName;
                            sessionStorage["HSupID"] = result.data[0].HSupID;
                            sessionStorage["HSupName"] = result.data[0].HSupName;
                            sessionStorage["Czmm"] = result.data[0].Czmm;
                            sessionStorage["Czybm"] = result.data[0].Czybm;
                            sessionStorage["HEmpID"] = result.data[0].HEmpID;
                            sessionStorage["HEmpNumber"] = result.data[0].HEmpNumber;
                            sessionStorage["HEmpName"] = result.data[0].HEmpName;
                            sessionStorage["HGroup"] = result.data[0].HGroup;
                            sessionStorage["HGroupID"] = result.data[0].HGroupID;
                            sessionStorage["HProc"] = result.data[0].HProc;
                            sessionStorage["HProcNo"] = result.data[0].HProcNo;
                            sessionStorage["HSource"] = result.data[0].HSource;
                            sessionStorage["HSourceID"] = result.data[0].HSourceID;
                            sessionStorage["HWorkCenter"] = result.data[0].HWorkCenter;
                            sessionStorage["HWorkCenterID"] = result.data[0].HWorkCenterID;
                            sessionStorage["HProcName"] = result.data[0].HProcName;
                            sessionStorage["HProcID"] = result.data[0].HProcID;
                            sessionStorage["HCheckEmpID"] = result.data[0].HCheckEmpID;
                            sessionStorage["HCheckEmpName"] = result.data[0].HCheckEmpName;
                            sessionStorage["login"] = "login";
                            sessionStorage["OrganizationID"] = $("#Organization").val();
                            sessionStorage["Organization"] = $("#Organization option:selected").text();
                            //sessionStorage["IP"] = System.Configuration.ConfigurationSettings.AppSettings("name");
                            if (!judgeMorPCflag) {//移动端
                                window.location.href = '../../views/index_Mobile.html'
                            } else {//PC端
                                window.location.href = '../../views/indexMenu.html'
                            }
                            get_WriteConfigFile();
                        }
                        else {
                            // $("#verifycode").click();
                            layer.msg(result.Message, { icon: 5 });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (result) {
                        layer.closeAll("loading");
                        layer.msg("接口请求失败!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        //layer.msg('获取采购订单出现异常', { icon: 2, time: 2000 });
                    }
                })
            }
            //刷卡登录
            function loginICCard() {
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: 'IC刷卡',
                    closeBtn: 1,
                    shift: 2,
                    area: ['30%', '30%'],
                    maxmin: true,
                    content: '../user/login_ICCard.html',
                    end: function () {
                        if (LoginData.data[0].Czybm != undefined && LoginData.data[0].Czybm != "") {
                            result = LoginData;
                            sessionStorage["HCloudUserName"] = result.data[0].HCloudUserName;//金蝶云账号
                            sessionStorage["HCloudUserPsd"] = result.data[0].HCloudUserPsd;
                            sessionStorage["HMaker"] = result.data[0].Czymc;
                            sessionStorage["HUserName"] = result.data[0].Czymc;
                            sessionStorage["HBillerID"] = result.data[0].HK3UserID;
                            sessionStorage["SourceFlag"] = false;
                            sessionStorage["HKeeperID"] = result.data[0].HKeeperID;
                            sessionStorage["HKeeper"] = result.data[0].HKeeper;
                            sessionStorage["HSecManagerID"] = result.data[0].HSecManagerID;
                            sessionStorage["HSecManager"] = result.data[0].HSecManager;
                            sessionStorage["HSellManID"] = result.data[0].HSellManID;
                            sessionStorage["HSellMan"] = result.data[0].HSellMan;
                            sessionStorage["HDeptID"] = result.data[0].HDeptID;
                            sessionStorage["HDept"] = result.data[0].HDept;
                            sessionStorage["HWHID"] = result.data[0].HWhID;
                            sessionStorage["HWHName"] = result.data[0].HWHName;
                            sessionStorage["HSPID"] = result.data[0].HSPID;
                            sessionStorage["HSPName"] = result.data[0].HSPName;
                            sessionStorage["HSupID"] = result.data[0].HSupID;
                            sessionStorage["HSupName"] = result.data[0].HSupName;
                            sessionStorage["Czmm"] = result.data[0].Czmm;
                            sessionStorage["Czybm"] = result.data[0].Czybm;
                            sessionStorage["HEmpID"] = result.data[0].HEmpID;
                            sessionStorage["HEmpNumber"] = result.data[0].HEmpNumber;
                            sessionStorage["HEmpName"] = result.data[0].HEmpName;
                            sessionStorage["HGroup"] = result.data[0].HGroup;
                            sessionStorage["HGroupID"] = result.data[0].HGroupID;
                            sessionStorage["HProc"] = result.data[0].HProc;
                            sessionStorage["HProcNo"] = result.data[0].HProcNo;
                            sessionStorage["HSource"] = result.data[0].HSource;
                            sessionStorage["HSourceID"] = result.data[0].HSourceID;
                            sessionStorage["HWorkCenter"] = result.data[0].HWorkCenter;
                            sessionStorage["HWorkCenterID"] = result.data[0].HWorkCenterID;
                            sessionStorage["HProcName"] = result.data[0].HProcName;
                            sessionStorage["HProcID"] = result.data[0].HProcID;
                            sessionStorage["HCheckEmpID"] = result.data[0].HCheckEmpID;
                            sessionStorage["HCheckEmpName"] = result.data[0].HCheckEmpName;
                            sessionStorage["login"] = "login";
                            sessionStorage["OrganizationID"] = $("#Organization").val();
                            sessionStorage["Organization"] = $("#Organization option:selected").text();
                            //sessionStorage["IP"] = System.Configuration.ConfigurationSettings.AppSettings("name");
                            if (!judgeMorPCflag) {//移动端
                                window.location.href = '../../views/index_Mobile.html'
                            } else {//PC端
                                window.location.href = '../../views/indexMenu.html'
                            }
                            get_WriteConfigFile();
                        }
                    }
                });
            }
            function playSound() {
                var audio = document.getElementById("cs");
                if (audio == null)
                    $("body").append('<audio id="cs" hidden controls> <source src = "../video/jingbao.wav" type = "audio/ogg"> </audio >');
                var audio = document.getElementById("cs");
                audio.play();
            }
            //获取基础信息
            function getBaseInfo() {
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "/Web/BaseInfo",
                    data: {},
                    success: function (res) {
                        //查询成功
                        if (res.count == 1) {
                            var data = res.data[0];
                            console.log(data);
                            sessionStorage["HCusName"] = data.HCusName;
                            sessionStorage["HLogoLabel"] = data.HLogoLabel;
                            sessionStorage["HMenuLabel"] = data.HMenuLabel;
                            $("#HLogoLabel").text(data.HLogoLabel);
                        }
                    }
                })
            }
        });
        function getDataByICCard(obj) {
            LoginData = obj;
        }
    </script>
</body>
</html>