1
yusijie
2025-09-13 8c839f638e97f2e8487c64bfe92cc31e0a8979cb
WebTM/views/³µ¼ä¹ÜÀí/²úÏß/MES_ProductionLinePackaging.html
@@ -25,16 +25,13 @@
                <form class="layui-form" action="" lay-filter="component-form-group">
                    <div class="layui-form-item" style="margin-bottom: 20px;">
                        <button type="button" lay-submit="" lay-filter="HAddBT" class="layui-btn layui-btn-radius">新增</button>
                        <!--<button type="button" lay-submit="" lay-filter="" class="layui-btn layui-btn-radius">清空</button>-->
                        <button type="button" lay-submit="" lay-filter="Saver" class="layui-btn layui-btn-radius">保存</button>
                        <button type="button" lay-submit="" lay-filter="Close" class="layui-btn layui-btn-radius layui-btn-danger">退出</button>
                        <button type="button" lay-submit="" lay-filter="HAddPrint" class="layui-btn layui-btn-radius">新增打印模板</button>
                        <div class="layui-inline">
                            <div class="layui-input-block">
                                <select name="city" lay-verify="required" id="dymb">
                                    <!--<option value="未选择">请选择打印模板</option>-->
                                    <option value="HBarCodePrint">物料条码模板</option>
                                    <!--<option value="HPOInStockBill">送货单</option>-->
                                    <!--<option value="HPOInStockBill">送货单(标签纸)</option>-->
                            <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                <select name="dymb" id="dymb" lay-verify="dymb" class="ForFilteringSchemes">
                                    <!--动态渲染模板-->
                                </select>
                            </div>
                        </div>
@@ -441,6 +438,7 @@
            }
            var option = [];
            set_InitGrid();
            //初始化明细表格
            function set_InitGrid() {
                columns = [
@@ -476,6 +474,7 @@
                    }
                };
            }
            //全局变量
            var ZJTMFlag = false;//子件条码输入标记
            //获取当前时间处理
@@ -512,6 +511,10 @@
            var HModName = "MES_ProductionLinePackaging";
            initFunction(1, HModName, sessionStorage["HTranSlate"]);
            form.render('select');
            //获取打印模板
            GetHBarCodePrint();
            //扫条形码方法
            $('#HFbarcode').on('keydown', function (event) {   //扫条形码
@@ -888,6 +891,7 @@
                    });
                }
            });
            //保存按钮
            form.on('submit(Saver)', function (data) {//提交
                //debugger;
@@ -1117,15 +1121,24 @@
                });
            });
            //新增打印模板按钮
            form.on('submit(HAddPrint)', function (data) {//退出
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '打印模版选择'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: false //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=&MyMsg=&Type=' + HModName, 'yes']
                    , resize: false
                })
            });
            //打印按钮
            form.on('submit(Print2)', function (data) {//退出
                //打开打印模板
                var linterid = $("#HInterID").val();
                //var linterid = "28973";
                //var Type = "HBarCodePrint";
                //var OpenTmp = "包装单物料标识卡(网页版)";
                //var ReportViewer = document.getElementById("ReportViewer");
                //window.open("../../views/BaseSet/HBarPlanPrint.html?linterid=" + linterid.toString() + "&Type=" + Type.toString() + "&OpenTmp=" + OpenTmp.toString());
                var sWhere = "select * from h_v_SRM_BarCodeBillList where HItemID in(" + linterid + ") order by ç‰©æ–™ä»£ç ";
                $.ajax({
@@ -1146,7 +1159,7 @@
                                }
                                var report1 = "";
                                var parintName = $("#PrintName").val();
                                var parintName = $("#PrintName").val();
                                if (parintName == "斯莫尔" && LDM != "AAA") {
                                    report1 = urlAddRandomNo("../../grf/包装单物料标识卡(网页版).grf");
                                } else if (LDM == "AAA") {
@@ -1188,9 +1201,8 @@
                var linterid = $("#HInterID").val();
                var HOrgID = $("#HOrgID").val();
                var Type = "HBarCodePrint";
                var OpenTmp = "白标打印15";
                //var ReportViewer = document.getElementById("ReportViewer");
                window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + linterid.toString() + "|" + HOrgID +  "&Type=" + Type.toString() + "&OpenTmp=" + OpenTmp.toString());
                var OpenTmp = $("#dymb").val();
                window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + linterid.toString() + "|" + HOrgID + "&Type=" + Type.toString() + "&OpenTmp=" + OpenTmp.toString());
                $("#Print2").click();
            });
@@ -1313,6 +1325,11 @@
                                , "流转卡ID": data[0].hmainid
                            });
                            icmoQty = data[0].流转卡数量;
                            if (data[0].默认打印模版 !="") {
                                $("#dymb").val(data[0].默认打印模版);
                                form.render('select');
                            }
                            //
                            $.ajax({//生成唯一码
                                url: GetWEBURL() + "/LEMS/SaveBarCode_json",
@@ -1349,8 +1366,7 @@
                                        });
                                    } else {
                                        playSound();
                                        // $("#verifycode").click();
                                        //layer.msg(result.Message, { icon: 5 });
                                        layer.alert(get_MessageError("[0000-2-063]插入主表失败", sessionStorage["HTranSlate"]), { icon: 5, btn: [get_MessageError('[0000-2-035]退出', sessionStorage["HTranSlate"])], time: 100000, offset: 't' });
                                    }
                                }, error: function () {
@@ -1446,19 +1462,32 @@
                    }
                });
            }
            //获取打印模板
            function GetHBarCodePrint() {
                //获取登录页组织列
                $.ajax({
                    type: "get",
                    async: false,
                    url: GetWEBURL() + "/Open_PrintTem/GetOpenTmpList_Json",
                    data: { "HNumber": HModName },
                    success: function (result) {
                        var HBarCodePrint = "";
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data;
                            for (var i = 0; i < data.length; i++) {
                                HBarCodePrint += '<option  style="color:blue;" value="' + data[i].HName + '">' + data[i].HName + '</option>';
                            }
                            $("#dymb").append(HBarCodePrint);
                            form.render('select');
                        }
                        layer.closeAll("loading");
                    }
                })
            }
            //以上为layui模块
        });
        //function window_onload() {
        //    Report.LoadFromURL("../grf/包装单物料标识卡(网页版).grf");
        //}
        //function btnPrint_onclick() {
        //    var linterid = "28973";
        //    //Report.LoadDataFromURL("../../views/Baseset/xmlSRM_Web_BarCodeBillList.aspx?linterid=" + linterid, true, "");
        //    Report.Print(true);
        //}
        function GetHWorkerValue(obj) {  //返回接收人
            $("#Operator").val(obj[0].HName);
@@ -1498,16 +1527,16 @@
            $("#HOrganizationID").val(obj[0].HNumber);
        }
                                                    //function GetHEmpValue(obj)  //返回职员
                                                    //{
                                                    //    $("#HEmpName").val(obj[0].HName);
                                                    //    $("#HEmpID").val(obj[0].HItemID);
                                                    //}
                                                    //function GetHDeptNameValue(obj)  //返回部门
                                                    //{
                                                    //    $("#HDeptName").val(obj[0].HName);
                                                    //    $("#HDeptID").val(obj[0].HItemID);
                                                    //}
        //function GetHEmpValue(obj)  //返回职员
        //{
        //    $("#HEmpName").val(obj[0].HName);
        //    $("#HEmpID").val(obj[0].HItemID);
        //}
        //function GetHDeptNameValue(obj)  //返回部门
        //{
        //    $("#HDeptName").val(obj[0].HName);
        //    $("#HDeptID").val(obj[0].HItemID);
        //}
    </script>