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>
@@ -68,6 +65,7 @@
                                    <option value="1941600-00-B">1941600-00-B</option>
                                    <option value="1941600-00-C">1941600-00-C</option>
                                    <option value="1943600-00-C">1943600-00-C</option>
                                    <option value="1998800-00-C">1998800-00-C</option>
                                    <option value="其他" selected>其他</option>
                                </select>
                            </div>
@@ -178,6 +176,7 @@
                                                    <td>
                                                        <input type="text" name="流转卡号" id="HProcExchBillNo" lay-verify="" autocomplete="off" placeholder="流转卡号" class="layui-input" style="background-color:#efefef4d" readonly>
                                                        <input type="hidden" name="流转卡ID" id="HFbarcodeID">
                                                        <input type="hidden" name="HOrgID" id="HOrgID">
                                                    </td>
                                                    <th style="width:80px;padding:10px" id="BT_HDateNow">组装时间</th>
                                                    <td>
@@ -397,7 +396,7 @@
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js" type="text/javascript"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../../layuiadmin/Scripts/webConfig2.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../CreateControl.js"></script>
    <script src="../../../layuiadmin/MESLanguage.js"></script>
    <script>
@@ -439,6 +438,7 @@
            }
            var option = [];
            set_InitGrid();
            //初始化明细表格
            function set_InitGrid() {
                columns = [
@@ -474,6 +474,7 @@
                    }
                };
            }
            //全局变量
            var ZJTMFlag = false;//子件条码输入标记
            //获取当前时间处理
@@ -498,6 +499,7 @@
            getBillno();
            $("#HDateNow").val(time);//加载当前时间
            $("#HFbarcode").focus();
            $("#HOrgID").val(sessionStorage["OrganizationID"]);
            $("#HFbarcode").css("box-shadow", "0 0 0 1px #00ff00");
            $("#SubBarcode").attr("readonly", "readonly");//子件条码只读
            $("#SubBarcode").css("background-color", "#efefef4d");
@@ -509,6 +511,10 @@
            var HModName = "MES_ProductionLinePackaging";
            initFunction(1, HModName, sessionStorage["HTranSlate"]);
            form.render('select');
            //获取打印模板
            GetHBarCodePrint();
            //扫条形码方法
            $('#HFbarcode').on('keydown', function (event) {   //扫条形码
@@ -804,6 +810,7 @@
                                                        , "HNumber": $("#HNumber").val()
                                                        , "HName": $("#HMaterName").val()
                                                        , "HModel": $("#HModel").val()
                                                        , "HOrgID": $("#HOrgID").val()
                                                    },
                                                    success: function (result) {
                                                        var data = result.data;
@@ -815,7 +822,7 @@
                                                                $('#SubBarcode').val("");
                                                                $("#SubBarcode").focus();
                                                                table.reload('smjl-table', {
                                                                    url: GetWEBURL1() + '/LEMS/Update_HBillNo_SubBarcodeList_Json'
                                                                    url: GetWEBURL() + '/LEMS/Update_HBillNo_SubBarcodeList_Json'
                                                                    , where: {
                                                                        HBillNo: HBillNo2
                                                                        , HBarCode: HBillNo
@@ -884,6 +891,7 @@
                    });
                }
            });
            //保存按钮
            form.on('submit(Saver)', function (data) {//提交
                //debugger;
@@ -950,6 +958,7 @@
                        , "BBM": BBM
                        , "LDM": LDM
                        , "HMaterNumber": $("#HNumber").val()
                        , "HOrgID": $("#HOrgID").val()
                    },
                    success: function (result) {
                        var data = result.data;
@@ -1112,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({
@@ -1142,12 +1160,13 @@
                                var report1 = "";
                                var parintName = $("#PrintName").val();
                                if (parintName == "斯莫尔") {
                                if (parintName == "斯莫尔" && LDM != "AAA") {
                                    report1 = urlAddRandomNo("../../grf/包装单物料标识卡(网页版).grf");
                                } else if (LDM == "AAA") {
                                    report1 = urlAddRandomNo("../../grf/包装单物料标识卡(网页版)_MXG.grf");
                                } else {
                                    report1 = urlAddRandomNo("../../grf/包装单物料标识卡(网页版)2.grf");
                                }
                                var args = {
                                    type: "print",
                                    showOptionDlg: false, //如果不显示打印对话框而直接打印,将此行注释去掉即可
@@ -1180,10 +1199,10 @@
                var BBM = $("#BBM").val();
                var LDM = $("#LDM").val();
                var linterid = $("#HInterID").val();
                var HOrgID = $("#HOrgID").val();
                var Type = "HBarCodePrint";
                var OpenTmp = "白标打印1";
                //var ReportViewer = document.getElementById("ReportViewer");
                window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + linterid.toString() + "&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();
            });
@@ -1306,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",
@@ -1315,7 +1339,8 @@
                                    "sHBarcodeNo": $("#HSourceBillNo").val(),
                                    "sHMaterID": $("#HMaterID").val(),
                                    "sHUnitID": $("#HUnitID").val(),
                                    "sHMaterName": $("#HMaterName").val()
                                    "sHMaterName": $("#HMaterName").val(),
                                    "HOrgID": $("#HOrgID").val()
                                },
                                success: function (result) {
                                    var data = result.data;
@@ -1341,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 () {
@@ -1438,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);
@@ -1490,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>