chenhaozhe
2025-06-18 dfa5d56846d55f7012035901ae89bb81d3c72c65
WebTM/views/Éú²ú¹ÜÀí/ÌáÁϼƻ®/JIT_LiftMaterPlanBillEdit.html
@@ -14,6 +14,7 @@
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/SetColumn.js"></script>
    <style>
        .main-btn { /*头部主按钮*/
            padding: 0 2px; /*调整按钮左右空隙大小*/
@@ -146,6 +147,7 @@
                        <div class="layui-btn-container">
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                        </div>
                    </script>
                </form>
@@ -265,13 +267,73 @@
                , "HCloseStatus": false, "HRemoveQty": "", "HSeOrderBillNo": "", "HUnReciveQty": "", "HPOOrderBillDate": "", "HPOOrderBillDeliveryDate": ""
                , "HPOOrderBillRemark": "", "HPOOrderBillNote": ""
            }];
            //不可编辑列
            var cancelEditStyleList = new RegExp(/HMaterName/i)
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            //加载组织
            get_Organ();
            //加载表格
            var option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , limit: 500 //每页默认显示的数量
                , cellMinWidth: 120
                , height: 'full-270'
                , totalRow: true
                , cols: [[ //表头
                    { type: 'checkbox', totalRowText: '合计行' }
                    , { type: 'numbers', field: '序号', title: '序号', totalRow: true }
                    , { field: 'HLaterReason', title: '延迟原因', templet: '#HLaterReason', width: 200 }//list
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: 'HMaterNumber', title: '物料编码', edit: 'text', event: "HMaterID" }
                    , { field: 'HMaterName', title: '物料名称' }
                    , { field: 'HMaterModel', title: '规格型号' }
                    , { field: 'HUnitID', title: 'HUnitID', hide: true }
                    , { field: 'HUnitIDName', title: '计量单位', edit: 'text', event: "HUnitID" }
                    , { field: 'HErpClsID', title: '物料属性', templet: '#HErpClsID' }//list
                    , { 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', totalRow: true }
                    , { field: 'HDayPlanBillNo', title: '日计划工单编号', edit: 'text' }
                    , { field: 'HSourceInterID', title: '日计划工单FID', edit: 'text' }
                    , { field: 'HSourceEntryID', title: '日计划工单FENTRYID', width: 200, edit: 'text' }
                    , { field: 'HSourceBillNo', title: '生产订单号', edit: 'text' }
                    , { field: 'HSourceBillType', title: '源单类型', edit: 'text' }
                    , { 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', totalRow: true }
                    , { field: 'HPOOrderInterID', title: '采购订单内码', edit: 'text' }
                    , { field: 'HPOOrderEntryID', title: '采购订单子内码', edit: 'text' }
                    , { field: 'HPOOrderBillNo', title: '采购订单号', edit: 'text' }
                    , { field: 'HPOOrderBillSEQ', title: '采购订单行号', edit: 'text' }
                    , { field: 'HWWOrderInterID', title: '委外订单内码', edit: 'text' }
                    , { field: 'HWWOrderEntryID', title: '委外订单子内码', edit: 'text' }
                    , { field: 'HWWOrderBillNo', title: '委外订单', edit: 'text' }
                    , { field: 'HPurchaseDeptID', title: 'HPurchaseDeptID', hide: true }
                    , { field: 'HPurchaseDeptIDName', title: '采购部门', edit: 'text', event: "HPurchaseDeptID" }
                    , { 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', totalRow: true }
                    , { field: 'HReciveQty', title: '收料数量', edit: 'text', totalRow: true }
                    , { field: 'HCloseStatus', title: '关闭状态', templet: "#HCloseStatus" }//ck
                    , { field: 'HRemoveQty', title: '转移数量', edit: 'text', totalRow: true }
                    , { field: 'HSeOrderBillNo', 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' }
                    , { field: 'HPOOrderBillNote', title: '采购订单表体备注', edit: 'text', width: 200 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ]]
            }
            option.data = rowdata;
            //制单人
            $("#HMaker").val(sessionStorage["HUserName"]);
@@ -305,67 +367,8 @@
                RoadBillMain(linterid);
            }
            var option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , limit: 500 //每页默认显示的数量
                , cellMinWidth: 120
                , height: 'full-270'
                , totalRow: true
                , cols: [[ //表头
                    { type: 'checkbox', totalRowText: '合计行' }
                    , { type: 'numbers', title: '序号', totalRow: true }
                    , { field: 'HLaterReason', title: '延迟原因', templet: '#HLaterReason', width: 200 }//list
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: 'HMaterNumber', title: '物料编码', edit: 'text', event: "HMaterID" }
                    , { field: 'HMaterName', title: '物料名称' }
                    , { field: 'HMaterModel', title: '规格型号' }
                    , { field: 'HUnitID', title: 'HUnitID', hide: true }
                    , { field: 'HUnitIDName', title: '计量单位', edit: 'text', event: "HUnitID" }
                    , { field: 'HErpClsID', title: '物料属性', templet: '#HErpClsID' }//list
                    , { 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', totalRow: true}
                    , { field: 'HDayPlanBillNo', title: '日计划工单编号', edit: 'text' }
                    , { field: 'HSourceInterID', title: '日计划工单FID', edit: 'text' }
                    , { field: 'HSourceEntryID', title: '日计划工单FENTRYID', width: 200, edit: 'text' }
                    , { field: 'HSourceBillNo', title: '生产订单号', edit: 'text' }
                    , { field: 'HSourceBillType', title: '源单类型', edit: 'text' }
                    , { 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', totalRow: true }
                    , { field: 'HPOOrderInterID', title: '采购订单内码', edit: 'text' }
                    , { field: 'HPOOrderEntryID', title: '采购订单子内码', edit: 'text' }
                    , { field: 'HPOOrderBillNo', title: '采购订单号', edit: 'text' }
                    , { field: 'HPOOrderBillSEQ', title: '采购订单行号', edit: 'text' }
                    , { field: 'HWWOrderInterID', title: '委外订单内码', edit: 'text' }
                    , { field: 'HWWOrderEntryID', title: '委外订单子内码', edit: 'text' }
                    , { field: 'HWWOrderBillNo', title: '委外订单', edit: 'text' }
                    , { field: 'HPurchaseDeptID', title: 'HPurchaseDeptID', hide: true }
                    , { field: 'HPurchaseDeptIDName', title: '采购部门', edit: 'text', event: "HPurchaseDeptID" }
                    , { 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', totalRow: true }
                    , { field: 'HReciveQty', title: '收料数量', edit: 'text', totalRow: true }
                    , { field: 'HCloseStatus', title: '关闭状态', templet: "#HCloseStatus" }//ck
                    , { field: 'HRemoveQty', title: '转移数量', edit: 'text', totalRow: true}
                    , { field: 'HSeOrderBillNo', 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' }
                    , { field: 'HPOOrderBillNote', title: '采购订单表体备注', edit: 'text', width: 200 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ]]
            }
            //初始加载表格
            option.data = rowdata;
            DisPlay_HideColumn();
            DisPlay_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table, cancelEditStyleList)
         
            //#endregion
@@ -425,6 +428,10 @@
                            //行数据 ä¸‹æ‹‰æ¡† å¤é€‰æ¡† æ˜¾ç¤º
                            checkRefresh();
                        }
                        break;
                    //列设置
                    case 'set_HideColumn':
                        get_HideColumnEdit(HModName, sessionStorage["HUserName"], option, table)
                        break;
                }
            });
@@ -751,109 +758,6 @@
                        $("#HSettleCurrId").val(checkStatus.data[0].HItemID);
                        $("#HSettleCurrIdName").val(checkStatus.data[0].货币名称);
                        layer.close(index);//关闭弹窗
                    }
                })
            }
            //隐藏列设置
            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 });
                    }
                })
            }