WebTM/views/Éú²ú¹ÜÀí/Òì³£·´À¡µ¥/OA_ErrMsgBackSignBill_BrushCard.html
@@ -21,7 +21,11 @@
            height: 30px;
            line-height: 30px;
        }
        .layui-table th, .layui-table td {
            white-space: nowrap; /* ä¸æ¢è¡Œ */
            overflow: hidden; /* è¶…出内容隐藏 */
            text-overflow: ellipsis; /* æ˜¾ç¤ºçœç•¥å· */
        }
        .btn-title {
            font-size: 16px;
        }
@@ -45,6 +49,12 @@
        .layui-form-label {
            width: 25%;
        }
        #mainTable tr {
            height: 100px; /* ä½ æƒ³è¦çš„行高 */
        }
        #btnSignIn,#btnErrMSg,#btnQuery,#btnEdit {
            font-size: 36px; /* è®¾ç½®å­—体大小 */
        }
    </style>
</head>
@@ -54,9 +64,10 @@
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
                    <div style="padding: 2px; ">
                        <button class="layui-btn layui-btn-normal" style="margin-left: 5px" type="button" lay-submit="" lay-filter="btnSignIn" id="btnSignIn">签到</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 10px" type="button" lay-submit="" lay-filter="btnQuery" id="btnQuery">查询</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 10px" type="button" lay-submit="" lay-filter="btnEdit" id="btnEdit">退出</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 150px;height:120px;width:120px;" type="button" lay-submit="" lay-filter="btnSignIn" id="btnSignIn">签到</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 70px; height: 120px; width: 120px;" type="button" lay-submit="" lay-filter="btnErrMSg" id="btnErrMSg">处理</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 70px; height: 120px; width: 120px;" type="button" lay-submit="" lay-filter="btnQuery" id="btnQuery">查询</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 70px; height: 120px; width: 120px;" type="button" lay-submit="" lay-filter="btnEdit" id="btnEdit">退出</button>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <h1 style="text-align: center; padding: 10px 0;"><b>异常反馈刷卡签到</b></h1>
@@ -92,7 +103,7 @@
                            </div>
                        </div>
                    </div>
                    <table class="" id="mainTable" lay-filter="mainTable" style="margin-top:10px;"></table>
                    <table class="" id="mainTable" lay-filter="mainTable" style="margin-top:10px;" lay-size="lg"></table>
                </form>
            </div>
        </div>
@@ -121,6 +132,10 @@
            //不需要显示的字段 å¯æ‰©å±•
            var titleData = [];
            //#endregion
            //获取参数
            var params = getUrlVars();
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  1添加 ä¿å­˜  2复制  3 ç¼–辑
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -188,23 +203,64 @@
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var linterid = data[0].hmainid.toString();
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '异常反馈接收单签到'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../../生产管理/异常反馈单/OA_ErrMsgBackSignBillMain.html?OperationType=2&linterid=' + linterid + '&HEntryID=' + 0 + '&HSouceBillType=' + 4529 + ''
                        , resize: false,
                        end: function () {
                            //刷新页面,
                            get_FastQuery();//查询
                        }
                        , cancel: function () {
                        }
                    })
                    var HEntryID = data[0].HEntryID.toString();
                    if (data[0].单据状态 != "已反馈") {
                        layer.msg('该单子已签到或已处理,不能再次签到!');
                    } else {
                        layer.open({
                            type: 2
                            , area: ['100%', '100%']
                            , title: '异常反馈接收单签到'
                            , shade: 0.6 //遮罩透明度
                            , maxmin: true //允许全屏最小化
                            , anim: 0 //0-6的动画形式,-1不开启
                            , content: '../../生产管理/异常反馈单/OA_ErrMsgBackSignBillMain.html?OperationType=2&linterid=' + linterid + '&HEntryID=' + HEntryID + '&HSouceBillType=' + 4502 + ''
                            , resize: false,
                            end: function () {
                                //刷新页面,
                                get_FastQuery();//查询
                            }
                            , cancel: function () {
                            }
                        })
                    }
                } else {
                    layer.msg('请选择一个异常反馈接收单进行签到!');
                }
            });
            //处理
            form.on('submit(btnErrMSg)', function () {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var linterid = data[0].hmainid.toString();
                    var HEntryID = data[0].HEntryID.toString();
                    if (data[0].单据状态 != "已签到") {
                        layer.msg('该单子未签到,不能处理!');
                    } else {
                        layer.open({
                            type: 2
                            , area: ['100%', '100%']
                            , title: '异常反馈接收单签到'
                            , shade: 0.6 //遮罩透明度
                            , maxmin: true //允许全屏最小化
                            , anim: 0 //0-6的动画形式,-1不开启
                            , content: '../../生产管理/异常反馈单/OA_ErrMsgBackHandleBillMain.html?OperationType=2&linterid=' + linterid + '&HEntryID=' + HEntryID + '&HSouceBillType=' + 4502 + ''
                            , resize: false,
                            end: function () {
                                //刷新页面,
                                get_FastQuery();//查询
                            }
                            , cancel: function () {
                            }
                        })
                    }
                } else {
                    layer.msg('请选择一个异常反馈接收单进行签到!');
@@ -213,8 +269,14 @@
            //退出
            form.on('submit(btnEdit)', function () {
                //关闭页签
                Pub_Close(2);
                if (OperationType == "2") {
                    //关闭页签
                    Pub_Close(1);
                } else {
                    //关闭页签
                    Pub_Close(2);
                }
            });
            //IC卡回车方法
@@ -264,7 +326,7 @@
                    , limit: 50 //每页默认显示的数量
                    , cellMinWidth: 200
                    , done: function (res, curr, count) {
                        //soulTable.render(this);
                    }
                };
                option.data = [];
@@ -292,87 +354,183 @@
            //#region æŸ¥è¯¢
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                //进入页面显示的缓存列表
                $.ajax({
                    url: GetWEBURL() + '/OA_ErrMsgBackSignBill_BrushCard/ErrMsgBackReceive',
                    type: "GET",
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"]},
                    success: function (data1) {
                        if (data1.count == 1) {
                if (OperationType == 2) {       //保留原有的刷卡签到,新增一个报工台刷卡签到(获取数据方式不一样)
                    //进入页面显示的缓存列表
                    $.ajax({
                        url: GetWEBURL() + '/OA_ErrMsgBackSignBill_BrushCard/ErrMsgBackReceive',
                        type: "GET",
                        data: { "sWhere": sWhere, "num":"2","user": sessionStorage["HUserName"] },
                        success: function (data1) {
                            if (data1.count == 1) {
                            if (data1.data.length > 0) {
                                $("#HSignInEmp").val(data1.data[0].指派处理人);
                            } else {
                                $("#HSignInEmp").val("");
                                layer.msg('没有被指派异常反馈单', { time: 2 * 1000});
                            }
                            var data = [];
                            var col = [];
                            //给空的数组赋值
                            for (var key in data1.list) {
                                data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                                //获取不需要显示的列(H开头的列不显示)
                                var patrn = new RegExp(/^h/i);
                                if (patrn.test(data1.list[key].ColmCols)) {
                                    titleData[key] = data1.list[key].ColmCols;
                                if (data1.data.length > 0) {
                                    $("#HSignInEmp").val(data1.data[0].指派处理人);
                                } else {
                                    $("#HSignInEmp").val("");
                                    layer.msg('没有被指派异常反馈单', { time: 2 * 1000 });
                                }
                            }
                            //在列表左边添加勾选框
                            col.push({ type: 'checkbox', fixed: 'left' });
                            for (var i = 0; i < data.length; i++) {
                                // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                                if ($.inArray(data[i].name, titleData) > -1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                }
                                else {
                                    switch (data[i].Type) {
                                        //int
                                        case 'DateTime':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
                                            break;
                                        case 'long':
                                        case 'Int32':
                                        case 'Int64':
                                        case 'double':
                                        case 'Decimal':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
                                            break;
                                        default:
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                var data = [];
                                var col = [];
                                //给空的数组赋值
                                for (var key in data1.list) {
                                    data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                                    //获取不需要显示的列(H开头的列不显示)
                                    var patrn = new RegExp(/^h/i);
                                    if (patrn.test(data1.list[key].ColmCols)) {
                                        titleData[key] = data1.list[key].ColmCols;
                                    }
                                }
                            }
                            //动态显示列名
                            option = {
                                elem: '#mainTable'
                                , cols: [col]
                                , data: data1.data
                                , height: 'full-80'
                                , page: true
                                , limits: [50, 500, 5000, 50000]
                                , limit: 50
                                , cellMinWidth: 90
                                , totalRow: true
                                , done: function (res, curr, count) {
                                    //soulTable.render(this);
                                //在列表左边添加勾选框
                                col.push({ type: 'checkbox', fixed: 'left' });
                                for (var i = 0; i < data.length; i++) {
                                    // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                                    if ($.inArray(data[i].name, titleData) > -1) {
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                    }
                                    else {
                                        switch (data[i].Type) {
                                            //int
                                            case 'DateTime':
                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
                                                break;
                                            case 'long':
                                            case 'Int32':
                                            case 'Int64':
                                            case 'double':
                                            case 'Decimal':
                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
                                                break;
                                            default:
                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                        }
                                    }
                                }
                                //动态显示列名
                                option = {
                                    elem: '#mainTable'
                                    , cols: [col]
                                    , data: data1.data
                                    , height: 'full-80'
                                    , page: true
                                    , limits: [50, 500, 5000, 50000]
                                    , limit: 50
                                    , cellMinWidth: 90
                                    , totalRow: true
                                    , done: function (res, curr, count) {
                                    }
                                }
                                ins = table.render(option);
                                layer.close(ajaxLoad);
                            } else {
                                option.data = data1.data
                                ins = table.render(option);
                                layer.close(ajaxLoad);
                            }
                            ins = table.render(option);
                            layer.close(ajaxLoad);
                        } else {
                            option.data = data1.data
                            ins = table.render(option);
                        }, error: function () {
                            layer.close(ajaxLoad);
                            //layer.alert(data1.code + data1.Message, { icon: 5 });
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                    });
                } else {
                    //进入页面显示的缓存列表
                    $.ajax({
                        url: GetWEBURL() + '/OA_ErrMsgBackSignBill_BrushCard/ErrMsgBackReceive',
                        type: "GET",
                        data: { "sWhere": sWhere, "num": "1","user": sessionStorage["HUserName"] },
                        success: function (data1) {
                            if (data1.count == 1) {
                                if (data1.data.length > 0) {
                                    $("#HSignInEmp").val(data1.data[0].指派处理人);
                                } else {
                                    $("#HSignInEmp").val("");
                                    layer.msg('没有被指派异常反馈单', { time: 2 * 1000 });
                                }
                                var data = [];
                                var col = [];
                                //给空的数组赋值
                                for (var key in data1.list) {
                                    data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                                    //获取不需要显示的列(H开头的列不显示)
                                    var patrn = new RegExp(/^h/i);
                                    if (patrn.test(data1.list[key].ColmCols)) {
                                        titleData[key] = data1.list[key].ColmCols;
                                    }
                                }
                                //在列表左边添加勾选框
                                col.push({ type: 'checkbox', fixed: 'left' });
                                for (var i = 0; i < data.length; i++) {
                                    // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                                    if ($.inArray(data[i].name, titleData) > -1) {
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                    }
                                    else {
                                        switch (data[i].Type) {
                                            //int
                                            case 'DateTime':
                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
                                                break;
                                            case 'long':
                                            case 'Int32':
                                            case 'Int64':
                                            case 'double':
                                            case 'Decimal':
                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
                                                break;
                                            default:
                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                        }
                                    }
                                }
                                //动态显示列名
                                option = {
                                    elem: '#mainTable'
                                    , cols: [col]
                                    , data: data1.data
                                    , height: 'full-80'
                                    , page: true
                                    , limits: [50, 500, 5000, 50000]
                                    , limit: 50
                                    , cellMinWidth: 90
                                    , totalRow: true
                                    , done: function (res, curr, count) {
                                        //soulTable.render(this);
                                    }
                                }
                                ins = table.render(option);
                                layer.close(ajaxLoad);
                            } else {
                                option.data = data1.data
                                ins = table.render(option);
                                layer.close(ajaxLoad);
                                //layer.alert(data1.code + data1.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.close(ajaxLoad);
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
            }
            //#endregion
            //#region èŽ·å–å‚æ•°
            function getUrlVars() {
                var vars = [], hash;
                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
                for (var i = 0; i < hashes.length; i++) {
                    hash = hashes[i].split('=');
                    vars.push(hash[0]);
                    vars[hash[0]] = hash[1];
                }
                return vars;
            }
            //#endregion