yangle
2022-09-21 9e789f4bf8ee5998c9ae23ca7541f7aa6077664c
WebTM/views/É豸¹ÜÀí/Sb_EqpConkBookBillList.html
@@ -183,7 +183,8 @@
                ]]
            };
            var HModName = "Sb_EqpConkBookBillList";
            var col = [];
            var titleData = ["hmainid", "单据类型", "HEquipID", "HConkTypeID", "HEmpID", "HDeptID", "HManagerID", "hsubid", "HConkReasonID", "HManagerID1", "源单主内码", "源单子内码", "HBillType"];//不需要显示的字段 å¯æ‰©å±•
            var index = layer.load(0);
            //初始化表格
@@ -290,6 +291,7 @@
            });
            //进入页面显示的缓存列表
            var ajaxLoad = layer.load();
            $.ajax({
                //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                url: GetWEBURL() + '/Sb_EqpRepairWorkBill/GetEqpConkBookBillList',
@@ -297,15 +299,54 @@
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"]},
                success: function (data1) {
                    if (data1.count == 1) {
                        option.data = data1.data;
                        var data = [];
                        //给空的数组赋值
                        for (var key in data1.list) {
                            data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                        }
                        for (var i = 0; i < data.length; i++) {
                            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;
                                    default:
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                }
                            }
                        }
                        //在列表左边添加勾选框
                        col.unshift({ type: 'checkbox', fixed: 'left' })
                        //动态显示列名
                        option = {
                            elem: '#mainTable'
                            , toolbar: '#toolbarDemo'
                            , cols: [col]
                            , data: data1.data
                            , height: 550
                            , page: true
                            , cellMinWidth: 90
                            , limit: 50
                            , limits: [50, 500, 5000, 20000]
                        }
                        table.render(option);
                        layer.close(index);
                        //刷新表格数据
                        DisPlay_HideColumn();
                        layer.close(ajaxLoad);
                        //layer.alert("查询成功", { icon: 1 });
                    } else {
                        layer.close(index);
                        layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(index);
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
@@ -406,12 +447,15 @@
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = ["hmainid", "单据类型", "HEquipID", "HConkTypeID", "HEmpID", "HDeptID", "HManagerID", "hsubid", "HConkReasonID", "HManagerID1", "源单主内码", "源单子内码","HBillType"];//不需要显示的字段 å¯æ‰©å±•
                            /*var titleData = ["hmainid", "单据类型", "HEquipID", "HConkTypeID", "HEmpID", "HDeptID", "HManagerID", "hsubid", "HConkReasonID", "HManagerID1", "源单主内码", "源单子内码","HBillType"];//不需要显示的字段 å¯æ‰©å±•*/
                            dataCol = data1.data[0].HGridString.split(',');
                            for (var i = 0; i < option.cols[0].length - 2; i++) {
                                var dataCols = dataCol[i].split('|');
                                //在不为空的情况下进行分割
                                if (dataCol[i]) {
                                    var dataCols = dataCol[i].split('|');
                                }
                                //隐藏列
                                if (dataCols[1] == 1) {
                                    option.cols[0][i + 1]["hide"] = true;