wtt
2024-10-28 07cf94734c36d4eae6ddbc4dd338bf5af81a2193
WebTM/views/Éú²ú¹ÜÀí/ÌáÁϼƻ®/JIT_LiftMaterPlanBillEdit.html
@@ -55,6 +55,7 @@
                    <div style="padding: 10px; ">
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="Cancel" id="Cancel">退出</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">保存</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="HideColumn" id="HideColumn">隐藏列设置</button>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <div class="layui-tab-content">
@@ -207,9 +208,9 @@
            <option value="1">蓝海实业集团</option>
            <option value="100035">蓝海通讯公司</option>
            <option value="100037">通讯公司本部</option>
            <option value="100038">手机事业部</option>
            <option value="100038">杭州工厂</option>
            <option value="100039">平板事业部</option>
            <option value="100040">蓝海电子公司</option>
            <option value="100040">江山工厂</option>
            <option value="100041">蓝海销售公司</option>
            <option value="100042">香港销售公司</option>
            <option value="100043">蓝海电子商务有限公司</option>
@@ -253,6 +254,7 @@
                , element = layui.element;
            //初始表格数据
            var HModName = "JIT_Cg_PODemandPlanBill";
            var rowdata = [{
                "HLaterReason": "", "HMaterID": "", "HMaterNumber": "", "HMaterName": "", "HMaterModel": "", "HUnitID": "", "HUnitIDName": ""
                , "HErpClsID": "", "HQty": "", "HRemark": "", "HPURCHASEORGID": "", "HStatus": "", "HFixleadTime": ""
@@ -293,7 +295,6 @@
                    type: "GET",
                    data: { "HBillType": '4608' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
@@ -302,7 +303,6 @@
            }
            else {//如果修改则走下面 new
                RoadBillMain(linterid);
                //RoadBillSub(linterid);
            }
            var option = {
@@ -311,6 +311,7 @@
                , limit: 500 //每页默认显示的数量
                , cellMinWidth: 120
                , height: 'full-270'
                , totalRow: true
                , cols: [[ //表头
                    { type: 'checkbox', totalRowText: '合计行' }
                    , { type: 'numbers', title: '序号', totalRow: true }
@@ -322,11 +323,11 @@
                    , { field: 'HUnitID', title: 'HUnitID', hide: true }
                    , { field: 'HUnitIDName', title: '计量单位', edit: 'text', event: "HUnitID" }
                    , { field: 'HErpClsID', title: '物料属性', templet: '#HErpClsID' }//list
                    , { field: 'HQty', title: '数量', edit: 'text' }
                    , { field: 'HQty', title: '数量', edit: 'text', totalRow: true }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                    , { field: 'HPURCHASEORGID', title: '采购组织', templet: "#HPURCHASEORGIDSub" }
                    , { field: 'HStatus', title: '状态', templet: '#HStatus' }//list
                    , { field: 'HFixleadTime', title: '提前期', edit: 'text' }
                    , { field: 'HFixleadTime', title: '提前期', edit: 'text', totalRow: true}
                    , { field: 'HDayPlanBillNo', title: '日计划工单编号', edit: 'text' }
                    , { field: 'HSourceInterID', title: '日计划工单FID', edit: 'text' }
                    , { field: 'HSourceEntryID', title: '日计划工单FENTRYID', width: 200, edit: 'text' }
@@ -335,7 +336,7 @@
                    , { field: 'HWorkShopID', title: 'HWorkShopID', hide: true }
                    , { field: 'HWorkShopIDName', title: '生产车间', edit: 'text', event: "HWorkShopID" }
                    , { field: 'HDayPlanDate', title: '工单生产日期', width: 200, event: 'HDayPlanDate' }//date
                    , { field: 'HRelationQty1', title: '可用采购数量', edit: 'text' }
                    , { field: 'HRelationQty1', title: '可用采购数量', edit: 'text', totalRow: true }
                    , { field: 'HPOOrderInterID', title: '采购订单内码', edit: 'text' }
                    , { field: 'HPOOrderEntryID', title: '采购订单子内码', edit: 'text' }
                    , { field: 'HPOOrderBillNo', title: '采购订单号', edit: 'text' }
@@ -348,12 +349,12 @@
                    , { field: 'HCloseTypeSub', title: '是否手工关闭', templet: "#HCloseTypeSub" }//ck
                    , { field: 'HCloseMan', title: '行关闭', width: 200, edit: 'text' }
                    , { field: 'HEntryCloseDate', title: '行关闭日期', width: 200, event: 'HEntryCloseDate' }//date
                    , { field: 'HSendQty', title: '送货单数量', edit: 'text' }
                    , { field: 'HReciveQty', title: '收料数量', edit: 'text' }
                    , { field: 'HSendQty', title: '送货单数量', edit: 'text', totalRow: true }
                    , { field: 'HReciveQty', title: '收料数量', edit: 'text', totalRow: true }
                    , { field: 'HCloseStatus', title: '关闭状态', templet: "#HCloseStatus" }//ck
                    , { field: 'HRemoveQty', title: '转移数量', edit: 'text' }
                    , { field: 'HRemoveQty', title: '转移数量', edit: 'text', totalRow: true}
                    , { field: 'HSeOrderBillNo', title: '销售订单号', edit: 'text' }
                    , { field: 'HUnReciveQty', title: '未收料数量', edit: 'text' }
                    , { field: 'HUnReciveQty', title: '未收料数量', edit: 'text', totalRow: true}
                    , { field: 'HPOOrderBillDate', title: '采购订单单据日期', event: "HPOOrderBillDate", width: 200 }//date
                    , { field: 'HPOOrderBillDeliveryDate', title: '采购订单交货日期', event: "HPOOrderBillDeliveryDate", width: 200 } // date
                    , { field: 'HPOOrderBillRemark', title: '采购订单摘要', edit: 'text' }
@@ -364,7 +365,8 @@
            //初始加载表格
            option.data = rowdata;
            table.render(option);
            DisPlay_HideColumn();
            //#endregion
@@ -606,6 +608,11 @@
                });
            });
            //隐藏列设置
            form.on('submit(HideColumn)', function (data) {
                get_HideColumn();
            });
            //#endregion
            //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
@@ -624,7 +631,9 @@
                                Organization += '<option  style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
                            }
                            $("#HPURCHASEORGID").append(Organization);
                            $("#HPURCHASEORGID").val(sessionStorage["OrganizationID"]);
                            $("#HSubORGID").append(Organization);
                            $("#HSubORGID").val(sessionStorage["OrganizationID"]);
                            form.render('select');
                        }
                        layer.closeAll("loading");
@@ -647,7 +656,6 @@
            //多选  åˆ·æ–°è¡¨æ ¼
            function checkRefresh() {
                for (var i = 1; i <= option.data.length; i++) {
                    console.log(JSON.stringify(option.data[i - 1]))
                    //延迟原因
                    $('#HLaterReason' + i + '').find("option[value='" + option.data[i - 1].HLaterReason + "']").attr("selected", true);
                    //物料属性
@@ -701,7 +709,7 @@
                    , shift: 2 //弹出动画
                    , area: ["90%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: ["../../Baseset/基础资料/Gy_SupplierList.html", "yes"]
                    , content: ["../../基础资料/采购基础资料/Gy_Supplier.html", "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //按钮一  çš„回调
@@ -713,7 +721,7 @@
                        }
                        //更新表格缓存的数据
                        $("#HSupplierID").val(checkStatus.data[0].HItemID);
                        $("#HSupplierIDName").val(checkStatus.data[0].HName);
                        $("#HSupplierIDName").val(checkStatus.data[0].供应商名称);
                        layer.close(index);//关闭弹窗
                    }
                })
@@ -747,6 +755,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 = ["HMaterID", "HUnitID", "HWorkShopID", "HPurchaseDeptID"];//不需要显示的字段 å¯æ‰©å±•
                            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]["title"], 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 });
                    }
                })
            }
            //行快捷键
            function set_GridCellCheck(obj) {
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
@@ -763,7 +874,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_MaterialList.html", "yes"]
                                , content: ['../../基础资料/公用基础资料/Gy_Material.html', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -777,9 +888,9 @@
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HMaterID": checkStatus.data[0].HItemID
                                        , "HMaterNumber": checkStatus.data[0].HNumber
                                        , "HMaterName": checkStatus.data[0].HName
                                        , "HMaterModel": checkStatus.data[0].HModel
                                        , "HMaterNumber": checkStatus.data[0].物料代码
                                        , "HMaterName": checkStatus.data[0].物料名称
                                        , "HMaterModel": checkStatus.data[0].规格型号
                                    })
                                    layer.close(index);//关闭弹窗
                                }
@@ -797,7 +908,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_UnitList.html", "yes"]
                                , content: ['../../基础资料/公用基础资料/Gy_Unit.html', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -810,7 +921,7 @@
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HUnitID": checkStatus.data[0].HItemID
                                        , "HUnitIDName": checkStatus.data[0].HName
                                        , "HUnitIDName": checkStatus.data[0].计量单位名称
                                    })
                                    layer.close(index);//关闭弹窗
                                }
@@ -828,7 +939,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_DepartmentList.html", "yes"]
                                , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -841,7 +952,7 @@
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HWorkShopID": checkStatus.data[0].HItemID
                                        , "HWorkShopIDName": checkStatus.data[0].HName
                                        , "HWorkShopIDName": checkStatus.data[0].部门名称
                                    })
                                    layer.close(index);//关闭弹窗
                                }
@@ -859,7 +970,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_DepartmentList.html", "yes"]
                                , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -872,15 +983,16 @@
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HPurchaseDeptID": checkStatus.data[0].HItemID
                                        , "HPurchaseDeptIDName": checkStatus.data[0].HName
                                        , "HPurchaseDeptIDName": checkStatus.data[0].部门名称
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                            })
                        }
                        obj.event = "";
                        return false;
                    }
                })
            }
@@ -900,7 +1012,7 @@
                            , "HInterID": d.data[0].hmainid
                            , "HSubORGID": d.data[0].委外组织
                            , "HAddress": d.data[0].交货地点
                            , "HPURCHASEORGID": d.data[0].主表采购组织
                            , "HPURCHASEORGID": d.data[0].HPURCHASEORGID
                            , "HSupplierID": d.data[0].HSupplierID
                            , "HSupplierIDName": d.data[0].供应商名称
                            , "HSettleCurrId": d.data[0].HSettleCurrId