yangle
2022-09-07 d9ccb1dfdb438225014b0b95d642a4e2a0c3736b
WebTM/views/Éú²ú¹ÜÀí/Éú²ú½ÐÁÏÆ½Ì¨/JIT_ComplementGoodBillMain.html
@@ -38,6 +38,7 @@
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="Yltl" id="Yltl">余量退料申请单</button>
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="Bftl" id="Bftl">报废退料申请单</button>
                        <button class="layui-btn layui-btn-normal" type="button" lay-submit="" lay-filter="Sctld" id="Sctld">生成退料单</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px;margin-top:5px;" type="button" lay-submit="" lay-filter="HideColumn" id="HideColumn">隐藏列设置</button>
                    </div>
                    <div class="layui-collapse">
                        <div class="layui-colla-item">
@@ -129,17 +130,15 @@
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">开始日期</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="date" class="layui-input" lay-verify="HBeginDate" name="HBeginDate" id="HBeginDate" style="padding-left: 48px;">
                                            <input type="date" class="layui-input" lay-verify="HBeginDate" name="HBeginDate" id="HBeginDate" style="padding-left: 80px;">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;text-align:center;">—</label>
                                        <div class="layui-input-block" style="margin-left: 118px;">
                                            <input type="date" class="layui-input" lay-verify="HEndDate" name="HEndDate" id="HEndDate" style="padding-left: 48px;">
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="date" class="layui-input" lay-verify="HEndDate" name="HEndDate" id="HEndDate" style="padding-left: 80px;">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-row" style="margin-top:10px;">
                                    <div class="layui-inline">
                                        <div class="layui-input-block" style="margin-left: 90px;">
                                            <input type="checkbox" name="ps" id="ps" lay-skin="primary" lay-filter="ps" title="仅显示未完全配送">
@@ -179,6 +178,7 @@
        //查询条件
        var sWhere = "";
        var option = [];
        var HModName = "JIT_ComplementGoodBill";
        //#endregion
        //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -250,6 +250,11 @@
            getXc();
        })
        //隐藏列设置
        form.on('submit(HideColumn)', function () {
            get_HideColumn();
        })
        //#endregion
        //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
@@ -263,6 +268,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();
        }
        //获取组织
        function Organ() {
@@ -313,13 +319,15 @@
                    , { field: '退料原因', title: '退料原因', width: 160, edit: 'text'}
                    , { field: '已叫料数量', title: '已叫料数量', width: 160}
                    , { field: '已配送数量', title: '已配送数量', width: 160 }
                    , { field: '调出仓库', title: '调出仓库', width: 160, edit: 'text', event: 'Warehouse' }
                    , { field: '调出仓库', title: '调出仓库', width: 160, edit: 'text', event: 'OutWarehouse' }
                    , { field: '调出仓库id', title: '调出仓库id', width: 160, hide: true }
                    , { field: '调入仓库', title: '调入仓库', width: 160, edit: 'text', event: 'InWarehouse' }
                    , { field: '调入仓库id', title: '调入仓库id', width: 160, hide: true }
                    , { 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: 'HICMOBillNo', title: 'HICMOBillNo', width: 160 }
                    , { field: '源单主内码', title: '源单主内码', width: 160 }
                    , { field: '源单子内码', title: '源单子内码', width: 160 }
@@ -487,7 +495,7 @@
        function set_GridCellCheck(obj) {
            $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                if (event.key == "F7") {
                    if (obj.event == "Warehouse") {
                    if (obj.event == "OutWarehouse") {
                        //打开维修项目小窗体
                        layer.open({
                            type: 2
@@ -512,7 +520,36 @@
                                    "调出仓库": checkStatus.data[0].HName
                                    , "调出仓库id": checkStatus.data[0].HItemID
                                })
                                console.log(checkStatus.data[0].HItemID)
                                layer.close(index);//关闭弹窗
                            }
                        })
                    }
                    if (obj.event == "InWarehouse") {
                        //打开维修项目小窗体
                        layer.open({
                            type: 2
                            , skin: "layui-layer-rim" //加上边框
                            , title: "仓库列表"  //标题
                            , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                            , shift: 2 //弹出动画
                            , area: ["90%", "90%"] //窗体大小
                            , maxmin: true //设置最大最小按钮是否显示
                            , content: ["../../Baseset/基础资料/Gy_WarehouseList.html", "yes"]
                            , btn: ["确定", "取消"]
                            , btn1: function (index, laero) {
                                //按钮一  çš„回调
                                var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                if (checkStatus.data.length != 1) {
                                    return layer.msg("请选择一条数据");
                                }
                                //更新表格缓存的数据
                                obj.update({
                                    "调入仓库": checkStatus.data[0].HName
                                    , "调入仓库id": checkStatus.data[0].HItemID
                                })
                                layer.close(index);//关闭弹窗
                            }
                        })
@@ -523,17 +560,18 @@
        //新增叫料单
        function set_AddNew_Jl() {
            if (table.cache['mainTable'].length == 0) {
            var data = table.cache['mainTable'];
            if (data.length == 0) {
                return layer.msg("无数据,无法叫料!");
            }
            else {
                var sMainStr = JSON.stringify(table.cache['mainTable']) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"];//sessionStorage["HUserName"]
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "Sc_ComplementGoodBill/InsertCallGoodsBill", //方法所在页面和方法名
                        url: GetWEBURL() + "/Sc_ComplementGoodBill/InsertCallGoodsBill", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainStr },
                        dataType: "json",
@@ -678,7 +716,7 @@
                        $.ajax(
                            {
                                type: "POST",
                                url: GetWEBURL() + "Sc_ComplementGoodBill/Insert_JL_ICStockTuiBill", //方法所在页面和方法名
                                url: GetWEBURL() + "/Sc_ComplementGoodBill/Insert_JL_ICStockTuiBill", //方法所在页面和方法名
                                async: true,
                                data: { "msg": sMainStr },
                                dataType: "json",
@@ -764,6 +802,110 @@
                })
            }
        }
        //隐藏列设置
        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 = ["调出仓库id", "调入仓库id", "HDeptID", "HDeptNumber", "HMaterialID", "HWHID", "HOutOrgID", "HSouceInterID", "HSourceEntryID", "HSourceBillNo", "HICMOInterID", "HICMOEntryID","HSTOCKID"];//不需要显示的字段 å¯æ‰©å±•
                        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
    });