From 9fc747c8fe1b492e0e82da57a60f4ac17ef196d8 Mon Sep 17 00:00:00 2001
From: zgq <519541279@qq.com>
Date: 星期一, 22 二月 2021 22:28:09 +0800
Subject: [PATCH] 1、上架归还单:先扫条码再扫货架,如果不匹配不允许提交。2、下架找货单:已下架的条码允许再次下架。

---
 WebTM/views/工序汇报/MES_StationInBill_PDA.html |  322 +++++++++++++++++++++++++++-------------------------
 1 files changed, 167 insertions(+), 155 deletions(-)

diff --git "a/WebTM/views/\345\267\245\345\272\217\346\261\207\346\212\245/MES_StationInBill_PDA.html" "b/WebTM/views/\345\267\245\345\272\217\346\261\207\346\212\245/MES_StationInBill_PDA.html"
index 95dda20..a7d711e 100644
--- "a/WebTM/views/\345\267\245\345\272\217\346\261\207\346\212\245/MES_StationInBill_PDA.html"
+++ "b/WebTM/views/\345\267\245\345\272\217\346\261\207\346\212\245/MES_StationInBill_PDA.html"
@@ -57,115 +57,121 @@
                                 <tr>
                                     <th>鏉″舰鐮�</th>
                                     <td class="t1_input">
-                                        <input type="text" name="鏉″舰鐮�" class="layui-input" id="HFbarcode" placeholder="璇疯緭鍏ユ潯褰㈢爜" style="background-color:#efefef4d;border-radius: 50px;" readonly>
+                                        <input type="text" name="HBarCode" class="layui-input" id="HBarCode" placeholder="璇疯緭鍏ユ潯褰㈢爜" style="border-radius: 50px;">
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>娴佽浆鍗″彿</th>
                                     <td class="t1_input">
-                                        <input type="text" name="HBillNo" class="layui-input" id="HBillNo" placeholder="娴佽浆鍗″彿" style="background-color:#efefef4d;" readonly>
+                                        <input type="text" name="HProcExchBillNo" class="layui-input" id="HProcExchBillNo" placeholder="娴佽浆鍗″彿" style="background-color:#efefef4d;" readonly>
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>娴佹按鍙�</th>
                                     <td class="t1_input">
-                                        <input type="text" name="娴佹按鍙�" class="layui-input" id="Serial_number" placeholder="璇疯緭鍏ユ祦姘村彿" style="background-color:#efefef4d;" readonly>
+                                        <input type="text" name="HProcNo" class="layui-input" id="HProcNo" placeholder="璇疯緭鍏ユ祦姘村彿" style="background-color:#efefef4d;" readonly>
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>宸ュ簭浠g爜</th>
                                     <td class="t1_input">
-                                        <input type="text" name="宸ュ簭浠g爜" class="layui-input" id="宸ュ簭浠g爜" placeholder="璇疯緭鍏ュ伐搴忎唬鐮�" style="background-color:#efefef4d;" readonly>
+                                        <input type="text" name="HProcName" class="layui-input" id="HProcName" placeholder="璇疯緭鍏ュ伐搴忎唬鐮�" style="background-color:#efefef4d;" readonly>
+                                        <input type="hidden" name="HProcID" id="HProcID" value="0" autocomplete="off" class="layui-input">
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>宸ュ簭鍚嶇О</th>
                                     <td class="t1_input">
-                                        <input type="text" name="宸ュ簭鍚嶇О" class="layui-input" id="宸ュ簭鍚嶇О" placeholder="璇疯緭鍏ュ伐搴忓悕绉�" style="background-color:#efefef4d;" readonly>
+                                        <input type="text" name="HProc" class="layui-input" id="HProc" placeholder="璇疯緭鍏ュ伐搴忓悕绉�" style="background-color:#efefef4d;" readonly>
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>鍒涘缓浜�</th>
                                     <td class="t1_input">
-                                        <input type="text" name="鍒涘缓浜�" class="layui-input" id="鍒涘缓浜�" placeholder="璇疯緭鍏ュ垱寤轰汉" style="background-color:#efefef4d;" readonly>
+                                        <input type="text" class="layui-input" id="HEmp" placeholder="璇疯緭鍏ュ垱寤轰汉" style="background-color:#efefef4d;" readonly>
+                                        <input type="hidden" name="HEmpID" id="HEmpID" value="0" autocomplete="off" class="layui-input">
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>杩涚珯鏁伴噺</th>
                                     <td class="t1_input">
-                                        <input type="text" name="杩涚珯鏁伴噺" class="layui-input" id="杩涚珯鏁伴噺" placeholder="璇疯緭鍏ヨ繘绔欐暟閲�" style="background-color:#efefef4d;" readonly>
+                                        <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="鐢熶骇鐝粍" class="layui-input" id="ProductionResources" placeholder="閫夋嫨鐢熶骇璧勬簮" style="background-color:#efefef4d;" readonly>
-                                        <input type="hidden" name="鐢熶骇璧勬簮浠g爜" id="ProductionResourcesID" value="0" autocomplete="off" class="layui-input">
+                                        <input type="text" name="HSource" class="layui-input" id="HSource" placeholder="閫夋嫨鐢熶骇璧勬簮" style="background-color:#efefef4d;" readonly>
+                                        <input type="hidden" name="HSourceID" id="HSourceID" value="0" autocomplete="off" class="layui-input">
                                         <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionResources-BT">...</button>
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>鐢熶骇鐝粍</th>
                                     <td class="bz_td">
-                                        <input type="text" name="鐢熶骇鐝粍" class="layui-input" id="ProductionTeam" placeholder="閫夋嫨鐢熶骇鐝粍" style="background-color:#efefef4d;" readonly>
-                                        <input type="hidden" name="鐢熶骇鐝粍浠g爜" id="ProductionTeamID" value="0" autocomplete="off" class="layui-input">
+                                        <input type="text" name="HGroup" class="layui-input" id="HGroup" placeholder="閫夋嫨鐢熶骇鐝粍" style="background-color:#efefef4d;" readonly>
+                                        <input type="hidden" name="HGroupID" id="HGroupID" value="0" autocomplete="off" class="layui-input">
                                         <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionTeam-BT">...</button>
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>宸ヤ綔涓績</th>
                                     <td class="bz_td">
-                                        <input type="text" name="宸ヤ綔涓績" class="layui-input" id="HProcName" placeholder="閫夋嫨宸ヤ綔涓績" style="background-color:#efefef4d;" readonly>
-                                        <input type="hidden" name="宸ヤ綔涓績浠g爜" id="HProcID" value="0" autocomplete="off" class="layui-input">
+                                        <input type="text" name="HCenter" class="layui-input" id="HCenter" placeholder="閫夋嫨宸ヤ綔涓績" style="background-color:#efefef4d;" readonly>
+                                        <input type="hidden" name="HCenterID" id="HCenterID" value="0" autocomplete="off" class="layui-input">
                                         <button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="HWorkingProcedure-BT">...</button>
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>杩涚珯鍗曞彿</th>
                                     <td class="t1_input">
-                                        <input type="text" name="杩涚珯鍗曞彿" class="layui-input" id="杩涚珯鍗曞彿" placeholder="璇疯緭鍏ヨ繘绔欏崟鍙�" style="background-color:#efefef4d;" readonly>
+                                        <input type="text" name="HBillNo" class="layui-input" id="HBillNo" placeholder="璇疯緭鍏ヨ繘绔欏崟鍙�" style="background-color:#efefef4d;" readonly>
+                                        <input type="hidden" name="HInterID" class="layui-input" id="HInterID">
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>鏃ユ湡</th>
                                     <td class="t1_input">
-                                        <input type="date" name="鏃ユ湡" class="layui-input HDateNow" id="HDateNow" placeholder="璇烽�夋嫨鏃ユ湡">
+                                        <input type="date" name="HStationInTime" class="layui-input" id="HStationInTime" placeholder="璇烽�夋嫨鏃ユ湡">
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>鐢熶骇璁㈠崟</th>
                                     <td class="t1_input">
-                                        <input type="text" name="鐢熶骇璁㈠崟" class="layui-input" id="鐢熶骇璁㈠崟" placeholder="璇疯緭鍏ョ敓浜ц鍗�" style="background-color:#efefef4d;" readonly>
+                                        <input type="text" name="HICMOBillNo" class="layui-input" id="HICMOBillNo" placeholder="璇疯緭鍏ョ敓浜ц鍗�" style="background-color:#efefef4d;" readonly>
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>浜у搧浠g爜</th>
                                     <td class="t1_input">
-                                        <input type="text" name="浜у搧浠g爜" class="layui-input" id="浜у搧浠g爜" placeholder="璇疯緭鍏ヤ骇鍝佷唬鐮�" style="background-color:#efefef4d;" readonly>
+                                        <input type="text" name="HMaterID" class="layui-input" id="HMaterID" placeholder="璇疯緭鍏ヤ骇鍝佷唬鐮�" style="background-color:#efefef4d;" readonly>
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>浜у搧鍚嶇О</th>
                                     <td class="t1_input">
-                                        <input type="text" name="浜у搧鍚嶇О" class="layui-input" id="浜у搧鍚嶇О" placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" style="background-color:#efefef4d;" readonly>
+                                        <input type="text" name="HMaterName" class="layui-input" id="HMaterName" placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" style="background-color:#efefef4d;" readonly>
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>瑙勬牸鍨嬪彿</th>
                                     <td class="t1_input">
-                                        <input type="text" name="瑙勬牸鍨嬪彿" class="layui-input" id="瑙勬牸鍨嬪彿" placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�" style="background-color:#efefef4d;" readonly>
+                                        <input type="text" name="HMaterModel" class="layui-input" id="HMaterModel" placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�" style="background-color:#efefef4d;" readonly>
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>璁㈠崟璺熻釜鍙�</th>
                                     <td class="t1_input">
-                                        <input type="text" name="璁㈠崟璺熻釜鍙�" class="layui-input" id="璁㈠崟璺熻釜鍙�" placeholder="璇疯緭鍏ヨ鍗曡窡韪彿" style="background-color:#efefef4d;" readonly>
+                                        <input type="text" name="HOrderProcNO" class="layui-input" id="HOrderProcNO" placeholder="璇疯緭鍏ヨ鍗曡窡韪彿" style="background-color:#efefef4d;" readonly>
                                     </td>
                                 </tr>
                                 <tr>
                                     <th>鐢熶骇璁㈠崟鏁伴噺</th>
                                     <td class="t1_input">
-                                        <input type="text" name="鐢熶骇璁㈠崟鏁伴噺" class="layui-input" id="鐢熶骇璁㈠崟鏁伴噺" placeholder="璇疯緭鍏ョ敓浜ц鍗曟暟閲�" style="background-color:#efefef4d;" readonly>
+                                        <input type="text" name="HICMOQty" class="layui-input" id="HICMOQty" placeholder="璇疯緭鍏ョ敓浜ц鍗曟暟閲�" style="background-color:#efefef4d;" readonly>
+                                        <!--闅愯棌瀛楁-->
+                                        <input type="hidden" name="HICMOInterID" class="layui-input" id="HICMOInterID"><!--浠诲姟鍗曞彿ID鍙杊icmointerid-->
+                                        <input type="hidden" name="HDeptID" class="layui-input" id="HDeptID"><!--鐢熶骇杞﹂棿id-->
                                     </td>
                                 </tr>
                             </tbody>
@@ -208,148 +214,124 @@
                 , form = layui.form;
 
             //鑾峰彇褰撳墠鏃堕棿澶勭悊
-            var data = new Date();
-            var year = data.getFullYear();  //鑾峰彇骞�
-            var month = data.getMonth() + 1;    //鑾峰彇鏈�
-            var day = data.getDate(); //鑾峰彇鏃�
-            var time = year + "/" + month + "/" + day;
-            var date = new Date();
-            //$("#HDateNow").val(time);//鍔犺浇褰撳墠鏃堕棿
-            //alert($("#HDateNow").val());
-            $("#HDateNow").val(Format(new Date(), "yyyy-MM-dd"));
+            $("#HStationInTime").val(Format(new Date(), "yyyy-MM-dd"));
+            $("#HEmp").val(sessionStorage["HUserName"]);//鍒涘缓浜�
+            $("#HEmpID").val(sessionStorage["HEmpID"]);
+            $("#HProc").val(sessionStorage["HProc"]);//宸ュ簭
+            $("#HProcName").val(sessionStorage["HProcName"]);//宸ュ簭浠g爜
+            $("#HProcID").val(sessionStorage["HProcID"]);//宸ュ簭ID
+            $("#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"]);//娴佹按鍙�
+            
+            
 
-            //laydate.render({
-            //    elem: '#HDateNow' //鎸囧畾鍏冪礌
-            //    , value: new Date()
-            //    ,trigger: 'click',
-            //});
             //椤甸潰鍒濆鍖栬祴鍊�
             //鑾峰彇鍗曟嵁鍙�
             $.ajax({
-                url: GetWEBURL() + "/Web/GetMAXNum",
+                url: GetWEBURL() + "/api/newBill/getNewInterBillNo",
                 type: "GET",
-                data: { "HBillType": '3790' },
+                data: { "billType": '3790' },
                 success: function (d) {
-                    $("#HInterID").val(d.data[0].HInterID);
-                    $("#HBillNo2").val(d.data[0].HBillNo);
+                    $("#HBillNo").val(d.data.HBillNo);//杩涚珯鍗曞彿
+                    $("#HInterID").val(d.data.HInterID);//杩涚珯鍗曞彿ID
                 }, error: function () {
                     layer.alert("鑾峰彇鍗曟嵁鍙峰け璐�!", { icon: 5 });
                 }
             });
 
-            $("#HFbarcode").focus();
-            $("#HFbarcode").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");
+            $("#HBarCode").focus();
+            $("#HBarCode").css("box-shadow", "0 0 0 1px #00ff00");
 
 
             //鎵潯褰㈢爜鏂规硶
-            $('#HFbarcode').on('keydown', function (event) {   //鎵潯褰㈢爜
-                var HFbarcode = $('#HFbarcode').val();
+            $('#HBarCode').on('keydown', function (event) {   //鎵潯褰㈢爜
+                var HBarCode = $('#HBarCode').val();//鏉″舰鐮侊紙娴佽浆鍗″彿锛夛紙鏁版嵁搴撲腑涓哄崟鎹彿锛�
                 if (event.keyCode == 13) {
                     //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
-                    if (HFbarcode == "") {
+                    if (HBarCode == "") {
                         layer.alert("鏉″舰鐮佷负绌猴紒", { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
                         return;
                     }
-                    //
                     $.ajax({
-                        url: GetWEBURL() + "TEST",
+                        url: GetWEBURL() + "api/newBill/getHbarCodeDetail",
                         type: "GET",
                         data: {
-                            "sBillBarCode": HFbarcode
+                            "sBillBarCode": HBarCode
                         },
                         success: function (result) {
-                            //var data = result.data;
-                            //if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                            //    form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
-                            //        "璁㈠崟璺熻釜鍙�": data[0].璁㈠崟璺熻釜鍙�
-                            //        , "浜у搧浠g爜": data[0].浜у搧浠g爜
-                            //        , "浜у搧鍚嶇О": data[0].浜у搧
-                            //        , "瑙勬牸鍨嬪彿": data[0].瑙勬牸鍨嬪彿
-                            //        , "娴佽浆鍗℃暟閲�": data[0].娴佽浆鍗℃暟閲�
-                            //        , "鍒跺崟浜�": data[0].鍒跺崟浜�
-                            //        , "鍒跺崟鏃ユ湡": data[0].鍒跺崟鏃ユ湡
-                            //        , "淇敼浜�": data[0].淇敼浜�
-                            //        , "淇敼鏃ユ湡": data[0].淇敼鏃ユ湡
-                            //        , "瀹℃牳浜�": data[0].瀹℃牳浜�
-                            //        , "瀹℃牳鏃ユ湡": data[0].瀹℃牳鏃ユ湡
-                            //        , "鐢熶骇璁㈠崟鍙�": data[0].婧愬崟鍗曞彿
-                            //        , "鐢熶骇璁㈠崟鏁伴噺": data[0].鐢熶骇鏁伴噺
-                            //        , "HBillNo": $("#HFbarcode").val()
-                            //    });
-                            //    $("#HFbarcode").attr("readonly", "readonly");//鏉″舰鐮佸彧璇�
-                            //    $("#HFbarcode").css("background-color", "#efefef4d");
-                            //    $("#HFbarcode").css("box-shadow", "none");
-                            //    $("#Serial_number").removeAttr("readonly");//绉婚櫎娴佹按鍙峰彧璇�
-                            //    $("#Serial_number").css("background-color", "white");
-                            //    $("#Serial_number").focus();
-                            //    $("#Serial_number").css("box-shadow", "0 0 0 1px #00ff00");
-                            //} else {
-                            //    layer.alert(result.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
-                            //}
+                            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.宸ヤ綔涓績浠g爜
+                                    , "HICMOInterID": data.hicmointerid
+                                    , "HICMOBillNo": data.浠诲姟鍗曞彿
+                                    , "HDeptID": data.HDeptID
+                                    , "HQty": data.璁″垝鏁伴噺
+                                    , "HMaterID": data.HMaterID
+                                    , "HMaterName": data.浜у搧
+                                    , "HMaterModel": data.瑙勬牸鍨嬪彿
+                                    , "HICMOQty": data.鐢熶骇鏁伴噺
+                                    , "HOrderProcNO":data.璁㈠崟璺熻釜鍙�
+                                });
+                                //$("#HBarCode").attr("readonly", "readonly");//鏉″舰鐮佸彧璇�
+                                //$("#HBarCode").css("background-color", "#efefef4d");
+                                $("#HBarCode").css("box-shadow", "none");
+                            } else {
+                                layer.alert(result.msg, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                            }
                         }, error: function () {
                             layer.alert("鎵潯褰㈢爜鏂规硶鍙戠敓閿欒!", { icon: 5 });
                         }
                     });
-                    // layer.msg($('#HFbarcode').val(), { icon: 1 });
                 }
             });
 
             //娴佹按鍙峰洖杞︽柟娉�
-            $('#Serial_number').on('keydown', function (event) {   //鎵潯褰㈢爜
-                var sProcNo = $('#Serial_number').val();
-                var sBillNo = $('#HBillNo').val();
+            $('#HProcNo').on('keydown', function (event) {   //鎵潯褰㈢爜
+                var HProcNo = $('#HProcNo').val();
+                var HBarCode = $('#HBarCode').val();
                 if (event.keyCode == 13) {
-                    if (sProcNo == "" || sBillNo == "") {
+                    if (HProcNo == "" || HBarCode == "") {
                         layer.alert("娴佹按鍙锋垨娴佽浆鍗″彿涓虹┖锛�", { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
                         return;
                     }
                     $.ajax({
-                        url: GetWEBURL() + "/LEMS/TxtHProcNo_KeyDown",
+                        url: GetWEBURL() + "/api/newBill/getProcDetail",
                         type: "GET",
                         data: {
-                            "sProcNo": sProcNo
-                            , "sBillNo": sBillNo
+                            "sBillNo": HBarCode
+                            , "sProcNo": HProcNo
                         },
                         success: function (result) {
-                            var data = result.data;
-                            if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data.h_v_Sc_ProcessExchangeBillList[0];
+                            if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
                                 form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
-                                    "璁㈠崟璺熻釜鍙�": data[0].璁㈠崟璺熻釜鍙�
-                                    , "浜у搧浠g爜": data[0].浜у搧浠g爜
-                                    , "浜у搧鍚嶇О": data[0].浜у搧
-                                    , "瑙勬牸鍨嬪彿": data[0].瑙勬牸鍨嬪彿
-                                    , "娴佽浆鍗℃暟閲�": data[0].娴佽浆鍗℃暟閲�
-                                    , "宸ヤ綔涓績": data[0].宸ヤ綔涓績
-                                    , "宸ヤ綔涓績浠g爜": data[0].宸ヤ綔涓績浠g爜
-                                    , "鐢熶骇鐝粍": data[0].鐝粍
-                                    , "鐢熶骇鐝粍浠g爜": data[0].鐝粍浠g爜
-                                    , "鐢熶骇璧勬簮": data[0].鐢熶骇璧勬簮
-                                    , "鐢熶骇璧勬簮浠g爜": data[0].鐢熶骇璧勬簮浠g爜
-                                    , "鍒跺崟浜�": data[0].鍒跺崟浜�
-                                    , "鍒跺崟鏃ユ湡": data[0].鍒跺崟鏃ユ湡
-                                    , "淇敼浜�": data[0].淇敼浜�
-                                    , "淇敼鏃ユ湡": data[0].淇敼鏃ユ湡
-                                    , "瀹℃牳浜�": data[0].瀹℃牳浜�
-                                    , "瀹℃牳鏃ユ湡": data[0].瀹℃牳鏃ユ湡
-                                    , "鐢熶骇璁㈠崟鍙�": data[0].婧愬崟鍗曞彿
-                                    , "鐢熶骇璁㈠崟鏁伴噺": data[0].鐢熶骇鏁伴噺
-                                    , "HBillNo": $("#HFbarcode").val()
+                                     //"HProcID": data.HProcID
+                                    //, "HProc": data.宸ュ簭
+                                    //, "HCenter": data.宸ヤ綔涓績
+                                    //, "HCenterID": data.宸ヤ綔涓績浠g爜
+                                     "HICMOInterID": data.hicmointerid
+                                    , "HICMOBillNo": data.浠诲姟鍗曞彿
+                                    , "HDeptID": data.HDeptID
+                                    , "HQty": data.璁″垝鏁伴噺
+                                    , "HMaterID": data.HMaterID
+                                    , "HMaterName": data.浜у搧
+                                    , "HMaterModel": data.瑙勬牸鍨嬪彿
+                                    , "HICMOQty": data.鐢熶骇鏁伴噺
                                 });
-                                $("#Serial_number").attr("readonly", "readonly");//鏉″舰鐮佸彧璇�
-                                $("#Serial_number").css("background-color", "#efefef4d");
-                                $("#Serial_number").css("box-shadow", "none");
-                                $("#Entrants_number").removeAttr("readonly");//绉婚櫎杩涚珯鏁伴噺鍙
-                                $("#Entrants_number").css("background-color", "white");
-                                $("#Entrants_number").focus();
-                                $("#Entrants_number").css("box-shadow", "0 0 0 1px #00ff00");
+                                $("#HProcNo").css("box-shadow", "none");
+                                checkPopup();
                             } else {
-                                // $("#verifycode").click();
-                                //layer.msg(result.Message, { icon: 5 });
-                                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 });
@@ -371,7 +353,7 @@
                     }
                 }
             });
-
+            
             //閫夋嫨鐢熶骇鐝粍寮圭獥
             form.on('submit(ProductionTeam-BT)', function () {//閫夋嫨鐢熶骇鐝粍
                 layer.open({
@@ -404,33 +386,49 @@
                 })
             });
 
+            //閫夋嫨宸ヤ綔涓績寮圭獥
+            form.on('submit(HWorkingProcedure-BT)', function () {//閫夋嫨宸ヤ綔涓績
+                layer.open({
+                    type: 2
+                    , area: ['80%', '80%']
+                    , title: '宸ヤ綔涓績'
+                    , shade: 0.6 //閬僵閫忔槑搴�
+                    //, maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                    , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                    , content: ['../Baseset/鍩虹璧勬枡/Gy_WorkCenterList.html', 'yes']
+                    , resize: false
+                    , cancel: function (index, layero) {
+                    }
+                })
+            });
+
             //淇濆瓨鎸夐挳
             form.on('submit(Saver)', function (data) {//鎻愪氦
                 //debugger;
-                var sMainStr = JSON.stringify(data.field);
-                console.log(sMainStr);
+                var sMainStr =data.field;
                 $.ajax(
                     {
                         type: "POST",
-                        url: GetWEBURL() + "/LEMS/Sub_SaveBill_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        url: GetWEBURL() + "/api/newBill/setStationInBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
                         async: true,
-                        data: { "oMain": sMainStr },
+                        data: sMainStr,
                         dataType: "json",
-                        success: function (data) {
-                            if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                        success: function (result) {
+                            console.log(result);
+                            if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
                                 $("#sHWHID").val("");
-                                layer.alert(data.Message + $("#HBillNo").val(), { icon: 1 }, function () {
+                                layer.alert(result.msg + "鍗曞彿涓猴細" + $("#HBillNo").val(), { icon: 1 }, function () {
                                     window.location.reload();//鍒锋柊椤甸潰
                                 });
                             }
                             else {
-                                layer.alert(data.Message, { icon: 5 });
+                                layer.alert(result.msg, { icon: 5 });
                             }
                             layer.closeAll("loading");
                             layui.form.render();
                         },
                         error: function (err) {
-                            layer.alert("閿欒:" + err, { icon: 5 });
+                            layer.alert("鎺ュ彛璇锋眰澶辫触:" + err, { icon: 5 });
                         }
                     });
             });
@@ -438,7 +436,7 @@
             //閫�鍑烘寜閽�
             form.on('submit(Close)', function (data) {//閫�鍑�
                 layer.confirm('鎮ㄧ‘瀹氳鍏抽棴鏈〉鍚楋紵', { icon: 3, title: '鎻愮ず' }, function (index) {
-                    parent.layui.admin.events.closeThisTabs();
+                    parent.location.href = "../../views/index.html";
                 });
             });
 
@@ -462,42 +460,56 @@
 
         });
 
+        //鏍¢獙鏄惁閫夋嫨寮圭獥浜嬩欢
+        function checkPopup() {
+            //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()) {
+                $("#HCenter").css("box-shadow", "0 0 1px 2px #00ff00");
+            } 
+        }
+
+        //杩斿洖鐢熶骇鐝粍
         function GetProductionTeamValue(obj) {  //杩斿洖鐢熶骇鐝粍
             if (obj.length == 0) {
                 layer.msg("璇峰厛閫夋嫨鐝粍", { index: 0 });
             } else {
-                $("#ProductionTeam").val(obj[0].鐝粍);
-                $("#ProductionTeamID").val(obj[0].HItemID);
-                $("#ProductionTeam").css("box-shadow", "none");
-                if ($("#ProductionResources").val()) {
-                    $("#ProductionResources").css("box-shadow", "none");
-                } else {
-                    $("#ProductionResources").css("box-shadow", "0 0 1px 2px #00ff00");
-                }
+                $("#HGroup").val(obj[0].鐝粍);
+                $("#HGroupID").val(obj[0].HItemID);
+                $("#HGroup").css("box-shadow", "none");
+                checkPopup();
                 layer.closeAll();
             }
         }
 
+        //杩斿洖鐢熶骇璧勬簮
         function GetProductionResourcesValue(obj) {  //杩斿洖鐢熶骇璧勬簮
-            if ($("#ProductionResources").val()) {
-                $("#ProductionResources").css("box-shadow", "none");
+            if ($("#HSource").val()) {
+                $("#HSource").css("box-shadow", "none");
             }
-            $("#ProductionResources").val(obj[0].鐢熶骇璧勬簮);
-            $("#ProductionResourcesID").val(obj[0].鐢熶骇璧勬簮浠g爜);
-            $("#ProductionResources").css("box-shadow", "none");
+            $("#HSource").val(obj[0].鐢熶骇璧勬簮);
+            $("#HSourceID").val(obj[0].HItemID);
+            $("#HSource").css("box-shadow", "none");
+            checkPopup();
         }
 
-
-                            //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 GetWorkCenterValue(obj) {  //杩斿洖宸ヤ綔涓績
+            if (obj.length == 0) {
+                layer.msg("璇峰厛閫夋嫨宸ヤ綔涓績", { index: 0 });
+            } else {
+                $("#HCenter").val(obj[0].宸ヤ綔涓績);
+                $("#HCenterID").val(obj[0].HItemID);
+                $("#HCenter").css("box-shadow", "none");
+                checkPopup();
+                layer.closeAll();
+            }
+        }
 
 
     </script>

--
Gitblit v1.9.1