zrg
2024-10-15 78de27057cad6ce159d4ba14050cb56510694ccf
WebTM/views/É豸¹ÜÀí/É豸±¨±í/Sb_EquipResumeCheckQuery.html
@@ -10,6 +10,7 @@
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/layui/layui1.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
@@ -19,6 +20,7 @@
        .layui-tree-set-active > .layui-tree-entry .layui-tree-main {
            background: #aef0f7;
        }
        .my-btn-container {
            min-width: 380px; /* è®¾ç½®æœ€å°å®½åº¦ */
            /* å…¶ä»–需要的样式 */
@@ -95,10 +97,20 @@
                , soulTable = layui.soulTable
                , tree = layui.tree
            var sWhere = "";
            var HNumber = "";
            var HName = "";
            var option = [];
            var optionResume = [];
            var titleData = ["HInterID", "HBillType"];
            var treeId;
            //获取参数
            var params = getUrlVars();
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  1添加 ä¿å­˜  2复制  3 ç¼–辑
            var linterid = params[params[1]]; //从参数中获取 å•据内码
                HNumber = params[params[2]]; //从参数中获取
                HName = params[params[3]]; //从参数中获取
                HNumber = decodeURI(HNumber);
                HName = decodeURI(HName);
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -113,7 +125,7 @@
                    case 'get_Refresh': get_Refresh();
                        break;
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                    case 'get_Exit': get_Exit();
                        break;
                    //退出按钮
                    case 'get_Search': get_DisplayResume();
@@ -161,9 +173,15 @@
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
                //查询
                get_Display(sWhere);
                if (OperationType == 3) {
                    $("#HNumber").val(HNumber);
                    $("#HName").val(HName);
                    get_FastQuery();
                    get_DisplayResume(linterid)
                } else {
                    //查询
                    get_Display(sWhere);
                }
                //查询设备分类
                get_Display_Tree();
            }
@@ -298,60 +316,63 @@
            function get_DisplayResume(HInterID) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var HInterID = data[0].hmainid.toString();
                    var ajaxLoad = layer.load();
                    $.ajax({
                        url: GetWEBURL() + '/Gy_EquipFileMain/GetResumeList',
                        type: "GET",
                        data: { "HInterID": HInterID, "user": sessionStorage["HUserName"] },
                        success: function (data1) {
                            if (data1.count == 1) {
                                var data = [];
                                var col = [];
                                var totalArray = ["数量", "关联数量", "未关联数量", "打印条码数量", "未打印条码数量", "实收数量", "金额", "计划金额"];
                                //给空的数组赋值
                                for (var key in data1.list) {
                                    data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                                }
                                //在列表左边添加勾选框
                                col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计' });
                                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 if ($.inArray(data[i].name, totalArray) > -1) {  //添加计算列
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
                                    } 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 HH:mm:ss')}}</div>", width: 200 });
                                                break;
                                            default:
                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                        }
                                    }
                                }
                                optionResume.cols = [col];
                                optionResume.data = data1.data;
                                table.render(optionResume);
                                layer.close(ajaxLoad);
                                //layer.alert("查询成功", { icon: 1 });
                            } else {
                                layer.close(ajaxLoad);
                                layer.alert(data1.code + data1.Message, { icon: 5 });
                if (OperationType!=3) {
                    if (checkStatus.data.length === 1) {
                        var HInterID = data[0].hmainid.toString();
                    } else {
                        layer.msg('请选择一行数据查询!');
                        return;
                    }
                }
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Gy_EquipFileMain/GetResumeList',
                    type: "GET",
                    data: { "HInterID": HInterID, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            var data = [];
                            var col = [];
                            var totalArray = ["数量", "关联数量", "未关联数量", "打印条码数量", "未打印条码数量", "实收数量", "金额", "计划金额"];
                            //给空的数组赋值
                            for (var key in data1.list) {
                                data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                            }
                        }, error: function () {
                            //在列表左边添加勾选框
                            col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计' });
                            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 if ($.inArray(data[i].name, totalArray) > -1) {  //添加计算列
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
                                } 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 HH:mm:ss')}}</div>", width: 200 });
                                            break;
                                        default:
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                    }
                                }
                            }
                            optionResume.cols = [col];
                            optionResume.data = data1.data;
                            table.render(optionResume);
                            layer.close(ajaxLoad);
                            layer.alert("接口请求失败!", { icon: 5 });
                            //layer.alert("查询成功", { icon: 1 });
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    });
                } else {
                    layer.msg('请选择一行数据查询!');
                }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                
            }
@@ -470,6 +491,27 @@
                $("#btnSearch").click();
            }
            //退出
            function get_Exit() {
                if (OperationType != 3) {
                    Pub_Close(2);
                } else {
                    Pub_Close(1);
                }
            }
            //#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
            //以上是layui模块
        });