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 |  264 +++++++++++++++++++++++++++++++---------------------
 1 files changed, 158 insertions(+), 106 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 41174f0..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,66 +57,68 @@
                                 <tr>
                                     <th>鏉″舰鐮�</th>
                                     <td class="t1_input">
-                                        <input type="text" name="sBillBarCode" class="layui-input" id="sBillBarCode" placeholder="璇疯緭鍏ユ潯褰㈢爜" style="border-radius: 50px;">
+                                        <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="娴佽浆鍗″彿" class="layui-input" id="娴佽浆鍗″彿" 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="sProcNo" class="layui-input" id="sProcNo" 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>
@@ -130,43 +132,46 @@
                                 <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>
@@ -209,15 +214,28 @@
                 , form = layui.form;
 
             //鑾峰彇褰撳墠鏃堕棿澶勭悊
-            $("#HDateNow").val(Format(new Date(), "yyyy-MM-dd"));
-            $("#鍒涘缓浜�").val(sessionStorage["HUserName"]);
+            $("#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"]);//娴佹按鍙�
+            
+            
 
             //椤甸潰鍒濆鍖栬祴鍊�
             //鑾峰彇鍗曟嵁鍙�
             $.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
@@ -226,51 +244,49 @@
                 }
             });
 
-            $("#sBillBarCode").focus();
-            $("#sBillBarCode").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");
 
 
             //鎵潯褰㈢爜鏂规硶
-            $('#sBillBarCode').on('keydown', function (event) {   //鎵潯褰㈢爜
-                var sBillBarCode = $('#sBillBarCode').val();//鏉″舰鐮侊紙娴佽浆鍗″彿锛夛紙鏁版嵁搴撲腑涓哄崟鎹彿锛�
+            $('#HBarCode').on('keydown', function (event) {   //鎵潯褰㈢爜
+                var HBarCode = $('#HBarCode').val();//鏉″舰鐮侊紙娴佽浆鍗″彿锛夛紙鏁版嵁搴撲腑涓哄崟鎹彿锛�
                 if (event.keyCode == 13) {
                     //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
-                    if (sBillBarCode == "") {
+                    if (HBarCode == "") {
                         layer.alert("鏉″舰鐮佷负绌猴紒", { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
                         return;
                     }
-                    //
                     $.ajax({
                         url: GetWEBURL() + "api/newBill/getHbarCodeDetail",
                         type: "GET",
                         data: {
-                            "sBillBarCode": sBillBarCode
+                            "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="" 瀵瑰簲鐨勫��
-                                    "娴佽浆鍗″彿": $("#sBillBarCode").val()
-                                    , "宸ュ簭浠g爜": data.宸ュ簭浠g爜
-                                    , "宸ュ簭鍚嶇О": data.宸ュ簭
-                                    , "浜у搧浠g爜": data.浜у搧浠g爜
-                                    , "浜у搧鍚嶇О": data.浜у搧
-                                    , "瑙勬牸鍨嬪彿": data.瑙勬牸鍨嬪彿
-                                    , "鐢熶骇璁㈠崟鏁伴噺": data.鐢熶骇鏁伴噺
+                                    "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.璁㈠崟璺熻釜鍙�
                                 });
-                                //$("#sBillBarCode").attr("readonly", "readonly");//鏉″舰鐮佸彧璇�
-                                //$("#sBillBarCode").css("background-color", "#efefef4d");
-                                $("#sBillBarCode").css("box-shadow", "none");
-                                $("#sProcNo").removeAttr("readonly");//绉婚櫎娴佹按鍙峰彧璇�
-                                $("#sProcNo").css("background-color", "white");
-                                $("#sProcNo").focus();
-                                $("#sProcNo").css("box-shadow", "0 0 0 1px #00ff00");
+                                //$("#HBarCode").attr("readonly", "readonly");//鏉″舰鐮佸彧璇�
+                                //$("#HBarCode").css("background-color", "#efefef4d");
+                                $("#HBarCode").css("box-shadow", "none");
                             } 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 });
@@ -280,11 +296,11 @@
             });
 
             //娴佹按鍙峰洖杞︽柟娉�
-            $('#sProcNo').on('keydown', function (event) {   //鎵潯褰㈢爜
-                var sProcNo = $('#sProcNo').val();
-                var sBillNo = $('#sBillBarCode').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;
                     }
@@ -292,24 +308,30 @@
                         url: GetWEBURL() + "/api/newBill/getProcDetail",
                         type: "GET",
                         data: {
-                            "sBillNo": sBillNo
-                            , "sProcNo": sProcNo
+                            "sBillNo": HBarCode
+                            , "sProcNo": HProcNo
                         },
                         success: function (result) {
                             var data = result.data.h_v_Sc_ProcessExchangeBillList[0];
                             if (result.code == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
                                 form.val("component-form-group", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
-                                    "宸ュ簭浠g爜": data.宸ュ簭浠g爜
-                                    , "宸ュ簭鍚嶇О": data.宸ュ簭
-                                    , "浜у搧浠g爜": data.浜у搧浠g爜
-                                    , "浜у搧鍚嶇О": data.浜у搧
-                                    , "瑙勬牸鍨嬪彿": data.瑙勬牸鍨嬪彿
-                                    , "鐢熶骇璁㈠崟鏁伴噺": data.鐢熶骇鏁伴噺
+                                     //"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.鐢熶骇鏁伴噺
                                 });
-                                $("#sProcNo").css("box-shadow", "none");
-                                $("#ProductionResources").css("box-shadow", "0 0 1px 2px #00ff00");
+                                $("#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 });
@@ -331,7 +353,7 @@
                     }
                 }
             });
-
+            
             //閫夋嫨鐢熶骇鐝粍寮圭獥
             form.on('submit(ProductionTeam-BT)', function () {//閫夋嫨鐢熶骇鐝粍
                 layer.open({
@@ -364,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 });
                         }
                     });
             });
@@ -398,16 +436,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();
+                });
+            });
 
 
 
@@ -422,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