yusijie
2024-04-02 092846e8284f7f1ac065a411dc5240138c19ce37
生产订单列表动态列
1个文件已修改
67 ■■■■■ 已修改文件
WebTM/views/生产管理/生产任务单/Sc_ICMOBillList.html 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillList.html
@@ -266,6 +266,7 @@
            var HDeptID = params[params[0]];
            var option = [];
            var ins;                        //用于导出excel
            var titleData = ["销售订单日期", "订单跟踪号", "业务员代码", "业务员",  "客户代码", "客户",  "hbomid", "BOM单编码", "HRoutingInterID", "工艺路线代码", "工艺路线", "订单包装备注", "hsubid", "源单单号", "源单主内码", "源单子内码", "关闭类型", "单据类型", "计划跟踪号"];//不需要显示的字段 å¯æ‰©å±•
           
            //判断是否有参数传递
@@ -722,9 +723,64 @@
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            ins = table.render(option);
                            layer.close(ajaxLoad);
                            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', 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 {
                                    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'
                                , toolbar: '#toolbarDemo'
                                , totalRow: true
                                , cols: [col]
                                , data: data1.data
                                , height: 'full-120'
                                , page: true
                                , limits: [50, 500, 5000, 50000]
                                , limit: 50
                                , cellMinWidth: 90
                                , done: function (res, curr, count) {
                                    soulTable.render(this);
                                }
                            }
                            table.render(option);
                            //刷新表格数据
                            DisPlay_HideColumn();
                            //刷新按钮显示
                            var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
@@ -735,10 +791,11 @@
                                ColFilter();
                            }
                            layer.close(ajaxLoad);
                            //layer.alert("查询成功", { icon: 1 });
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
@@ -1577,7 +1634,7 @@
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = ["hmainid", "HEntryID", "作废人", "作废日期", "销售订单日期", "订单跟踪号", "HDeptID", "HMaterID", "hunitid", "hempid", "业务员代码", "业务员", "hcusid", "客户代码", "客户", "HCenterID", "工作中心代码", "工作中心", "hbomid", "BOM单编码", "HRoutingInterID", "工艺路线代码", "工艺路线", "订单包装备注", "hsubid", "源单单号", "源单主内码", "源单子内码", "行关闭人", "关闭类型", "单据类型", "计划跟踪号"];//不需要显示的字段 å¯æ‰©å±•
                           /* var titleData = ["hmainid", "HEntryID", "作废人", "作废日期", "销售订单日期", "订单跟踪号", "HDeptID", "HMaterID", "hunitid", "hempid", "业务员代码", "业务员", "hcusid", "客户代码", "客户", "HCenterID", "工作中心代码", "工作中心", "hbomid", "BOM单编码", "HRoutingInterID", "工艺路线代码", "工艺路线", "订单包装备注", "hsubid", "源单单号", "源单主内码", "源单子内码", "行关闭人", "关闭类型", "单据类型", "计划跟踪号"];//不需要显示的字段 å¯æ‰©å±•*/
                            dataCol = data1.data[0].HGridString.split(',');