chenhaozhe
2025-05-09 815f1726bd4f12face7ddbd2668c1efe089bdbb9
隐藏 选择列 修正表格乱序
1个文件已修改
47 ■■■■ 已修改文件
WebTM/views/基础资料/销售基础资料/Gy_Customer.html 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/»ù´¡×ÊÁÏ/ÏúÊÛ»ù´¡×ÊÁÏ/Gy_Customer.html
@@ -375,18 +375,17 @@
            //#region ç»„织名称超链接
            table.on('tool(mainTable)', function (obj) {
                var data = obj.data;
                debugger;
                if (obj.event === '客户代码') {
                    layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '客户基础资料'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: false //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['Gy_Customer_Edit.html?OperationType=3&linterid=' + data.HItemID + '&HSouceBillType=']
                    , resize: false
                })
                        type: 2
                        , area: ['100%', '100%']
                        , title: '客户基础资料'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['Gy_Customer_Edit.html?OperationType=3&linterid=' + data.HItemID + '&HSouceBillType=']
                        , resize: false
                    })
                }
            })
            //endregion
@@ -590,7 +589,6 @@
                        option.limit = size;//改变表格页大小
                        if (data1.code == 1) {
                            optionPage.count = data1.count;//改变列表数据总数
                            debugger;
                            var data = [];
                            var col = [];
                            //给空的数组赋值
@@ -610,7 +608,7 @@
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                                } else if (data[i].name === '客户代码') {
                                    col.push({
                                        field: data[i].id, title: data[i].name, event: '客户代码',width: 120, align: 'center', sort: false, templet: function (d) {
                                        field: data[i].id, title: data[i].name, event: '客户代码', width: 120, align: 'center', sort: false, templet: function (d) {
                                            return '<span style="color: blue;">' + d.客户代码 + '</span>'
                                        }, style: 'cursor: pointer;'
                                    });
@@ -637,9 +635,10 @@
                            option.cols = [col];
                            option.data = data1.data;
                            option.totalRow = true;
                            console.log(option)
                            ins = table.render(option);
                            laypage.render(optionPage);
                            //刷新表格数据
                            //刷新表格数据 åœ¨éœ€è¦åˆ—设置的场合,优先在此处修改
                            DisPlay_HideColumn();
                            layer.close(ajaxLoad);
@@ -1154,12 +1153,32 @@
                                }
                                if (dataCols[4] != null && dataCols[4] != "") {
                                    option.cols[0][i + 1]["title"] = dataCols[4];
                                    option.cols[0][i + 1]["field"] = dataCols[5];
                                }
                                // éšè—æŒ‡å®šåç§°çš„列
                                if ((dataCols[4] + dataCols[5]).search('选择') !== -1) {
                                    option.cols[0][i + 1]["hide"] = true;
                                }
                                option.cols[0][i + 1]["templet"] = ''
                                // æ ¼å¼åŒ–名字中含有某些词汇的列
                                if ((dataCols[4] + dataCols[5]).search('时间') !== -1) {
                                    option.cols[0][i + 1]["templet"] =
                                        option.cols[0][i + 1]["templet"] = "<div>{{d." + option.cols[0][i + 1]["field"] + " ==null ?'':layui.util.toDateString(d." + option.cols[0][i + 1]["field"] + ", 'yyyy-MM-dd HH:mm-ss')}}</div>"
                                } else if ((dataCols[4] + dataCols[5]).search('客户代码') !== -1) {
                                    option.cols[0][i + 1]["templet"] = function (d) {
                                        return '<span style="color: blue; cursor: pointer;">' + d.客户代码 + '</span>'
                                    }
                                    option.cols[0][i + 1]["event"] = '客户代码'
                                }
                                //统计列
                                if (dataCols[6] == 1) {
                                    option.cols[0][i + 1]["totalRow"] = true;
                                }
                            }
@@ -1181,6 +1200,8 @@
                                    option.cols[0][i + 1]["fixed"] = "left";
                                }
                            }
                            console.log(option);
                            table.render(option);
                            ins = table.render(option);
                            //获取本页所有按钮对象