WebTM/views/Éú²ú¹ÜÀí/ÍËÁÏÉêÇëµ¥/JIT_CallGoodsBackRequestBillList.html
@@ -92,6 +92,8 @@
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-top:10px;">
                                    </div>
                                </div>
                            </div>
                        </div>
@@ -99,6 +101,7 @@
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="HideColumn"><i class="layui-icon layui-icon-form"></i>隐藏列设置</button>
                            </div>
                        </script>
                    </form>
@@ -125,6 +128,7 @@
            var sWhere = "";
            var option = [];
            var HModName = "JIT_CallGoodsBackRequestBill";
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -141,6 +145,10 @@
                switch (obj.event) {
                    //删除
                    case 'set_DeleteBill': set_DeleteBill();
                        break;
                    //隐藏列设置
                    case 'HideColumn':
                        get_HideColumn();
                        break;
                };
            });
@@ -185,6 +193,7 @@
                //日期初始化
                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                DisPlay_HideColumn();
            }
            //#endregion
@@ -192,7 +201,7 @@
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 570
                    , height: 'full-90'
                    , page: true
                    , cellMinWidth: 90
                    , limit: 50
@@ -203,7 +212,21 @@
                        , { field: '单据号', title: '单据号', sort: true, width: 165 }
                        , { field: '日期', title: '日期', width: 200, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据类型', title: '单据类型' }
                        , { field: '调出组织', title: '调出组织', width: 160 }
                        , { field: '调入组织', title: '调入组织', width: 160 }
                        , { field: '退料模式', title: '退料模式', width: 160 }
                        , { field: '源单单号', title: '源单单号', width: 160 }
                        , { field: '物料代码', title: '物料代码', width: 160 }
                        , { field: '物料名称', title: '物料名称', width: 160 }
                        , { field: '规格型号', title: '规格型号', width: 160 }
                        , { field: '退回数量', title: '退回数量', width: 160 }
                        , { field: '退料原因', title: '退料原因', width: 160 }
                        , { field: '仓库代码', title: '仓库代码', width: 160 }
                        , { field: '调入仓库', title: '调入仓库', width: 160 }
                        , { field: '调入仓位', title: '调入仓位', width: 160 }
                        , { field: '表头备注', title: '表头备注', width: 170 }
                        , { field: '责任部门代码', title: '责任部门代码', width: 160 }
                        , { field: '责任部门名称', title: '责任部门名称', width: 160 }
                        , { field: '退回人', title: '退回人', width: 170 }
                        , { field: '退回日期', title: '退回日期', width: 200, templet: "<div>{{d.退回日期 ==null ?'':layui.util.toDateString(d.退回日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '退回原因', title: '退回原因', width: 170 }
@@ -218,34 +241,11 @@
                        , { field: '关闭类型', title: '关闭类型', width: 170 }
                        , { field: '作废人', title: '作废人' }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '源单类型', title: '源单类型', width: 170 }
                        , { field: '源单子内码', title: '源单子内码', width: 170 }
                        , { field: '源单号', title: '源单号', width: 170 }
                        , { field: '打印次数', title: '打印次数', width: 170 }
                        , { field: '退料人代码', title: '退料人代码', width: 170 }
                        , { field: '退料人', title: '退料人', width: 170 }
                        , { field: '搬运人代码', title: '搬运人代码', width: 170 }
                        , { field: '搬运人', title: '搬运人', width: 170 }
                        , { field: '验收人代码', title: '验收人代码', width: 170 }
                        , { field: '验收人', title: '验收人', width: 170 }
                        , { field: '退料模式', title: '叫料模式', width: 170 }
                        , { field: '表体备注', title: '表体备注', width: 170 }
                        , { field: '源单单号', title: '源单单号', width: 170 }
                        , { field: '物料代码', title: '物料代码', width: 170 }
                        , { field: '物料名称', title: '物料名称', width: 170 }
                        , { field: '规格型号', title: '规格型号', width: 170 }
                        , { field: '责任部门代码', title: '责任部门代码', width: 170 }
                        , { field: '责任部门名称', title: '责任部门名称', width: 170 }
                        , { field: '调入仓库', title: '调入仓库', width: 170 }
                        , { field: '调入仓位', title: '调入仓位', width: 215 }
                        , { field: '调出仓库', title: '调出仓库', width: 215 }
                        , { field: '调出仓位', title: '调出仓位', width: 215 }
                        , { field: '退回数量', title: '退回数量', width: 170 }
                        , { field: '工序代码', title: '工序代码', width: 170 }
                        , { field: '工序名称', title: '工序名称', width: 170 }
                        , { field: '退料原因', title: '退料原因', width: 170 }
                        , { field: '供应商代码', title: '供应商代码', width: 170 }
                        , { field: '供应商名称', title: '供应商名称', width: 170 }
                        , { field: '退料人', title: '退料人', width: 160 }
                        , { field: '搬运人', title: '搬运人', width: 160 }
                        , { field: '验收人', title: '验收人', width: 160 }
                        , { field: '调出仓库', title: '调出仓库', width: 160 }
                        , { field: '调出仓位', title: '调出仓位', width: 160 }
                    ]]
                };
            }
@@ -334,7 +334,7 @@
                $("#MaterialModel").val("");//规格型号
                $("#HDeptName").val("");//生产车间
                $("#ProcMul").val("");//工段
                form.render('select');
                $("#btnSearch").click();//刷新
                sWhere = "";
            }
@@ -352,7 +352,7 @@
                            option.data = data1.data;
                            table.render(option);
                            layer.close(ajaxLoad);
                            //layer.alert("查询成功", { icon: 1 });
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
@@ -388,7 +388,7 @@
                    HDeptName: HDeptName,
                    ProcMul: ProcMul,
                    Hmaker: Hmaker,
                    HOrgID: HOrgID
                    HOrgID: HOrgID,
                }
                get_Display(JSON.stringify(sWhere));
@@ -435,6 +435,109 @@
                }
            }
            //隐藏列设置
            function get_HideColumn() {
                var colName = "";
                for (var i = 1; i < option.cols[0].length - 1; i++) {
                    colName += option.cols[0][i]["title"] + ",";
                }
                colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿›è¡Œç¼–码
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim" //加上边框
                    , title: "隐藏列设置"  //标题
                    , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                    , shift: 2 //弹出动画
                    , area: ["50%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: ['../../基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //刷新表格数据
                        DisPlay_HideColumn();
                        //更新表格缓存的数据
                        layer.close(index);//关闭弹窗
                    }
                })
            }
            //显示列数据
            function DisPlay_HideColumn() {
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    type: "GET",
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.data.length != 0) {
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = ["hmainid", "HBillStatus"];//不需要显示的字段 å¯æ‰©å±•
                            dataCol = data1.data[0].HGridString.split(',');
                            for (var i = 0; i < option.cols[0].length - 2; i++) {
                                var dataCols = dataCol[i].split('|');
                                //隐藏列
                                if (dataCols[1] == 1) {
                                    option.cols[0][i + 1]["hide"] = true;
                                }
                                //设置内容字体大小
                                if (data1.data[0].HFontSize != 0) {
                                    option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
                                } else {
                                    option.cols[0][i + 1]["style"] = "font-size:100%";
                                }
                                //设置列宽
                                if (dataCols[3] > 0) {
                                    option.cols[0][i + 1]["width"] = dataCols[3];
                                }
                                //显示列
                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["field"], titleData) == -1) {
                                    option.cols[0][i + 1]["hide"] = false;
                                }
                                //字体所在位置(å·¦ å±…中 å³)
                                switch (dataCols[2]) {
                                    case "L":
                                        option.cols[0][i + 1]["align"] = "left";
                                        break;
                                    case "M":
                                        option.cols[0][i + 1]["align"] = "center";
                                        break;
                                    case "R":
                                        option.cols[0][i + 1]["align"] = "right";
                                        break;
                                }
                            }
                            //取消冻结列
                            for (var i = 1; i < option.cols[0].length - 1; i++) {
                                if (option.cols[0][i]["fixed"] != null) {
                                    option.cols[0][i]["fixed"] = null;
                                }
                                else {
                                    break;
                                }
                            }
                            //冻结列
                            if (data1.data[0].HFixCols != 0) {
                                for (var i = 0; i < data1.data[0].HFixCols; i++) {
                                    if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
                                        data1.data[0].HFixCols += 1;
                                    }
                                    option.cols[0][i + 1]["fixed"] = "left";
                                }
                            }
                            table.render(option);
                        } else {
                            table.render(option);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                })
            }
            //#endregion
            //以上是layui模块