zgq
2021-01-21 46b10d520f13e5aa34cc0b02bae3aff58166981a
WebTM/views/¹¤Ðò»ã±¨/MES_StationInBill_PDA.html
@@ -97,7 +97,7 @@
                                        <input type="text" name="HQty" class="layui-input" id="HQty" placeholder="请输入进站数量">
                                    </td>
                                </tr>
                                <tr>
                                <tr style="display:none;">
                                    <th>生产资源</th>
                                    <td class="bz_td">
                                        <input type="text" name="HSource" class="layui-input" id="HSource" placeholder="选择生产资源" style="background-color:#efefef4d;" readonly>
@@ -214,15 +214,26 @@
            //获取当前时间处理
            $("#HStationInTime").val(Format(new Date(), "yyyy-MM-dd"));
            $("#HEmp").val(sessionStorage["HUserName"]);
            $("#HEmpID").val(sessionStorage["Czybm"]);
            $("#HEmp").val(sessionStorage["HUserName"]);//创建人
            $("#HEmpID").val(sessionStorage["HEmpID"]);
            $("#HProc").val(sessionStorage["HProc"]);//工序
            $("#HProcID").val(sessionStorage["HProcName"]);
            $("#HSource").val(sessionStorage["HSource"]);//生产资源
            $("#HSourceID").val(sessionStorage["HSourceID"]);
            $("#HGroup").val(sessionStorage["HGroup"]);//生产班组
            $("#HGroupID").val(sessionStorage["HGroupID"]);
            $("#HCenter").val(sessionStorage["HWorkCenter"]);//工作中心
            $("#HCenterID").val(sessionStorage["HWorkCenterID"]);
            $("#HProcNo").val(sessionStorage["HProcNo"]);//流水号
            //页面初始化赋值
            //获取单据号
            $.ajax({
                url: GetWEBURL() + "/api/newBill/getNewInterBillNo",
                type: "GET",
                //data: { "HBillType": '3790' },
                data: { "billType": '3790' },
                success: function (d) {
                    $("#HBillNo").val(d.data.HBillNo);//进站单号
                    $("#HInterID").val(d.data.HInterID);//进站单号ID
@@ -233,10 +244,6 @@
            $("#HBarCode").focus();
            $("#HBarCode").css("box-shadow", "0 0 0 1px #00ff00");
            $("#Serial_number").attr("readonly", "readonly");//流水号只读
            $("#Serial_number").css("background-color", "#efefef4d");
            $("#Entrants_number").attr("readonly", "readonly");//进站数量只读
            $("#Entrants_number").css("background-color", "#efefef4d");
            //扫条形码方法
@@ -248,7 +255,6 @@
                        layer.alert("条形码为空!", { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        return;
                    }
                    //
                    $.ajax({
                        url: GetWEBURL() + "api/newBill/getHbarCodeDetail",
                        type: "GET",
@@ -256,19 +262,19 @@
                            "sBillBarCode": HBarCode
                        },
                        success: function (result) {
                            var data = result.data.h_v_Sc_ProcessExchangeBillList[0];
                            if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                var data = result.data.h_v_Sc_ProcessExchangeBillList[0];
                                form.val("component-form-group", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                    "HProcExchBillNo": $("#HBarCode").val()
                                    , "HProcID": data.HProcID
                                    , "HProc": data.工序
                                    , "HCenter": data.工作中心
                                    , "HCenterID": data.工作中心代码
                                    //, "HProcID": data.HProcID
                                    //, "HProc": data.工序
                                    //, "HCenter": data.工作中心
                                    //, "HCenterID": data.工作中心代码
                                    , "HICMOInterID": data.hicmointerid
                                    , "HICMOBillNo": data.任务单号
                                    , "HDeptID": data.HDeptID
                                    , "HQty": data.计划数量
                                    , "HMaterID": data.产品代码
                                    , "HMaterID": data.HMaterID
                                    , "HMaterName": data.产品
                                    , "HMaterModel": data.规格型号
                                    , "HICMOQty": data.生产数量
@@ -277,12 +283,8 @@
                                //$("#HBarCode").attr("readonly", "readonly");//条形码只读
                                //$("#HBarCode").css("background-color", "#efefef4d");
                                $("#HBarCode").css("box-shadow", "none");
                                $("#HProcNo").removeAttr("readonly");//移除流水号只读
                                $("#HProcNo").css("background-color", "white");
                                $("#HProcNo").focus();
                                $("#HProcNo").css("box-shadow", "0 0 0 1px #00ff00");
                            } else {
                                layer.alert(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                                layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                            }
                        }, error: function () {
                            layer.alert("扫条形码方法发生错误!", { icon: 5 });
@@ -311,15 +313,15 @@
                            var data = result.data.h_v_Sc_ProcessExchangeBillList[0];
                            if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                form.val("component-form-group", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                     "HProcID": data.HProcID
                                    , "HProc": data.工序
                                    , "HCenter": data.工作中心
                                    , "HCenterID": data.工作中心代码
                                    , "HICMOInterID": data.hicmointerid
                                     //"HProcID": data.HProcID
                                    //, "HProc": data.工序
                                    //, "HCenter": data.工作中心
                                    //, "HCenterID": data.工作中心代码
                                     "HICMOInterID": data.hicmointerid
                                    , "HICMOBillNo": data.任务单号
                                    , "HDeptID": data.HDeptID
                                    , "HQty": data.计划数量
                                    , "HMaterID": data.产品代码
                                    , "HMaterID": data.HMaterID
                                    , "HMaterName": data.产品
                                    , "HMaterModel": data.规格型号
                                    , "HICMOQty": data.生产数量
@@ -327,7 +329,7 @@
                                $("#HProcNo").css("box-shadow", "none");
                                checkPopup();
                            } else {
                                layer.alert(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                                layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                            }
                        }, error: function () {
                            layer.alert("流水号方法发生错误!", { icon: 5 });
@@ -402,12 +404,10 @@
            form.on('submit(Saver)', function (data) {//提交
                //debugger;
                var sMainStr =data.field;
                console.log(sMainStr);
                $.ajax(
                    {
                        type: "POST",
                        //url: GetWEBURL() + "/api/newBill/setStationInBill", //方法所在页面和方法名
                        url: "http://localhost:12761/api/newBill/setStationInBill",
                        url: GetWEBURL() + "/api/newBill/setStationInBill", //方法所在页面和方法名
                        async: true,
                        data: sMainStr,
                        dataType: "json",
@@ -434,16 +434,16 @@
            //退出按钮
            form.on('submit(Close)', function (data) {//退出
                layer.confirm('您确定要关闭本页吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.layui.admin.events.closeThisTabs();
                    parent.location.href = "../../views/index.html";
                });
            });
            //新增按钮
            //form.on('submit(HAddBT)', function (data) {//退出
            //    layer.confirm('您确定要新增吗?', { icon: 3, title: '提示' }, function (index) {
            //        window.location.reload();
            //    });
            //});
            form.on('submit(HAddBT)', function (data) {//退出
                layer.confirm('您确定要新增吗?', { icon: 3, title: '提示' }, function (index) {
                    window.location.reload();
                });
            });
@@ -460,10 +460,11 @@
        //校验是否选择弹窗事件
        function checkPopup() {
            if (!$("#HSource").val()) {
                $("#HSource").css("box-shadow", "0 0 1px 2px #00ff00");
            }
            else if (!$("#HGroup").val()) {
            //if (!$("#HSource").val()) {//生产资源
            //    $("#HSource").css("box-shadow", "0 0 1px 2px #00ff00");
            //}
            //else
            if (!$("#HGroup").val()) {
                $("#HGroup").css("box-shadow", "0 0 1px 2px #00ff00");
            }
            else if (!$("#HCenter").val()) {
@@ -484,6 +485,7 @@
            }
        }
        //返回生产资源
        function GetProductionResourcesValue(obj) {  //返回生产资源
            if ($("#HSource").val()) {
                $("#HSource").css("box-shadow", "none");
@@ -497,9 +499,9 @@
        //返回工作中心
        function GetWorkCenterValue(obj) {  //返回工作中心
            if (obj.length == 0) {
                layer.msg("请先选择班组", { index: 0 });
                layer.msg("请先选择工作中心", { index: 0 });
            } else {
                $("#HCenter").val(obj[0].生产班组);
                $("#HCenter").val(obj[0].工作中心);
                $("#HCenterID").val(obj[0].HItemID);
                $("#HCenter").css("box-shadow", "none");
                checkPopup();