From 7ae052d141e69fe9e19392172fc2960134a03232 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 01 十二月 2025 15:54:52 +0800
Subject: [PATCH] 1.采购入库单列表、直接调拨单列表、其他出库单列表、生产入库列表、销售出库单列表:layui中开发 查看包装明细

---
 WebTM/views/领料发货/其他出库/Kf_OtherOutBill_Fast.html | 2219 +++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 1,456 insertions(+), 763 deletions(-)

diff --git "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\345\205\266\344\273\226\345\207\272\345\272\223/Kf_OtherOutBill_Fast.html" "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\345\205\266\344\273\226\345\207\272\345\272\223/Kf_OtherOutBill_Fast.html"
index 58f2203..eed6bba 100644
--- "a/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\345\205\266\344\273\226\345\207\272\345\272\223/Kf_OtherOutBill_Fast.html"
+++ "b/WebTM/views/\351\242\206\346\226\231\345\217\221\350\264\247/\345\205\266\344\273\226\345\207\272\345\272\223/Kf_OtherOutBill_Fast.html"
@@ -1,51 +1,65 @@
 锘�<!DOCTYPE html>
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <title>鍏朵粬鍑哄簱</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
     <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
     <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
+    <style>
+       
+        .layui-col-xs8 {
+            width: 55.666667%;
+        }
+        .layui-col-xs4 {
+            width: 20.333333%;
+        }
+    </style>
 </head>
-<!--<style>
-    @media screen and (max-width: 450px) {
-        .layui-form-item .mobile {
-            display: inline-block;
-            float: none;
-            left: -3px;
-            width: 55%;
-            margin: 0 0 10px 10px;
-        }
 
-        .layui-form-item .layui-btn {
-            position: relative;
-            top: -6px;
-        }
-       .layui-form-item .layui-input.mobile {
-            display: inline;
-            float: none;
-            left: -3px;
-            width: 55%;
-            margin: 0 0 10px 10px;
-        }
-    }
-</style>-->
 <body>
-    <div class="layui-fluid">
-        <div class="layui-card" style="padding: 1px">
-            <div class="layui-card-body" style="padding: 1px;">
+    <div class="layui-fluid" style="padding: 0px">
+        <div class="layui-card">
+            <div class="layui-card-body" style="padding: 0px; height:800px;">
                 <form class="layui-form" action="" lay-filter="component-form-group">
+                    <div style="background-color:#0085E8;">
+                        <span style="color: white;"><i class="layui-icon layui-icon-form"></i>鍏朵粬鍑哄簱鍗�</span>
+                    </div>
+                    <div class="layui-form-item" style="padding:15px;margin:0px">
+                        <div class="layui-row">
+                            <div class="layui-col-xs3">
+                                <label class="layui-form-label" style="width:40px;padding-left:0px;">鏉$爜</label>
+                            </div>
+                            <div class="layui-col-xs8">
+                                <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
+                            </div>
+                            <div class="layui-col-xs2">
+                                <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin">纭畾</button>
+                            </div>
+                        </div>
+                        <div class="layui-form-item" style="padding:0px;margin:0px">
+                            <div class="layui-row">
+                                <div class="layui-col-xs3">
+                                    <label class="layui-form-label" style="width:40px;padding-left:0px;">鏁伴噺</label>
+                                </div>
+                                <div class="layui-col-xs8">
+                                    <input type="text" name="HQty" id="HQty" lay-verify="HQty" onkeyup="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/)){if(!this.t_value>0){this.value=''}else{this.value=this.t_value;}}else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" autocomplete="off" class="layui-input" onfocus="this.select();">
+                                </div>
+                            </div>
+                        </div>
+                    </div>
                     <div class="layui-tab" lay-filter="tab-Kf_OtherOutBill">
                         <ul class="layui-tab-title" lay-filter="tab-all">
-                            <!-- <li lay-id="1">婧愬崟淇℃伅</li>-->
-                            <li lay-id="1">婧愬崟淇℃伅</li>
-                            <li lay-id="2">鍗曟嵁淇℃伅</li>
-                            <li lay-id="3">鐗╂枡娓呭崟</li>
-                            <li lay-id="4">鏃ュ織</li>
+                            <li lay-id="1" style="padding:1px;">閫夋嫨婧愬崟</li>
+                            <li lay-id="2" style="padding:1px;">琛ㄥご淇℃伅</li>
+                            <li lay-id="3" style="padding:1px;">鏄庣粏淇℃伅</li>
+                            <li lay-id="4" style="padding:1px;">涓嬫灦淇℃伅</li>
+                            <li lay-id="5" style="padding:1px;">鍚堣淇℃伅</li>
                         </ul>
                         <div class="layui-tab-content">
+                            <!--閫夋嫨婧愬崟-->
                             <div class="layui-tab-item layui-show">
                                 <div class="layui-form-item">
                                     <div class="layui-row">
@@ -55,21 +69,80 @@
                                         <div class="layui-col-xs8">
                                             <select name=" HBillType" id="HBillType">
                                                 <option value="-1">鎵嬪伐褰曞叆</option>
+                                                <option value="1242">鍑哄簱鐢宠鍗�</option>
                                             </select>
                                         </div>
+                                    </div>
+                                </div>
+                                <div class="layui-form-item">
+                                    <div class="layui-row">
+                                        <div class="layui-col-xs4">
+                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">鎵弿绫诲瀷</label>
                                         </div>
+                                        <div class="layui-col-xs8">
+                                            <select name=" HScanStyle" id="HScanStyle" disabled:"disabled">
+                                                <option value="鏁存墭鎵爜">鏁存墭鎵爜</option>
+                                                <option value="鍗曚釜鎷嗙爜">鍗曚釜鎷嗙爜</option>
+                                                <option value="鍙嶅悜鎷嗙爜">鍙嶅悜鎷嗙爜</option>
+                                                <option value="鏁存墭鍒犻櫎">鏁存墭鍒犻櫎</option>
+                                            </select>
+                                        </div>
+                                    </div>
                                 </div>
                                 <div class="layui-form-item">
                                     <div class="layui-row">
                                         <div class="layui-col-xs4">
                                             <label class="layui-form-label" style="width:60px;padding-left:0px;">婧愬崟鍙�</label>
                                         </div>
-                                            <div class="layui-col-xs8">
-                                                <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" autocomplete="off" class="layui-input">
-                                            </div>
+                                        <div class="layui-col-xs8">
+                                            <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" autocomplete="off" class="layui-input" onfocus="this.select();">
                                         </div>
+                                        <div class="layui-col-xs2">
+                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin2">纭畾</button>
+                                        </div>
+                                        <div class="layui-col-xs2">
+                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin3">閫夋嫨</button>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="layui-form-item">
+                                    <div class="layui-row">
+                                        <div class="layui-col-xs4">
+                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">FIFOWH</label><!--鍏堣繘鍏堝嚭浠撳簱-->
+                                        </div>
+                                        <div class="layui-col-xs8">
+                                            <input type="text" name="HFIFOWHNAME" id="HFIFOWHNAME" lay-verify="HFIFOWHNAME" autocomplete="off" class="layui-input">
+                                            <input type="hidden" name="HFIFOWHID" id="HFIFOWHID" lay-verify="HFIFOWHID" value="0" autocomplete="off" class="layui-input">
+                                        </div>
+                                        <div class="layui-col-xs4">
+                                            <button type="button" id="HFIFOWHID-BT" lay-submit="" class="layui-btn" lay-filter="HFIFOWHID-BT">...</button>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="layui-form-item">
+                                    <div class="layui-row">
+                                        <div class="layui-col-xs4">
+                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">鍗曟嵁绫诲瀷</label>
+                                        </div>
+                                        <div class="layui-col-xs8">
+                                            <select name=" HBillSubType" id="HBillSubType">
+                                                <!--鍔ㄦ�佹覆鏌撶粍缁�-->
+                                            </select>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="layui-form-item">
+                                    <div class="layui-row">
+                                        <div class="layui-col-xs4">
+                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">鏃ユ湡</label>
+                                        </div>
+                                        <div class="layui-col-xs8">
+                                            <input name="HDate" id="HDate" autocomplete="off" class="layui-input">
+                                        </div>
+                                    </div>
                                 </div>
                             </div>
+                            <!--琛ㄥご淇℃伅-->
                             <div class="layui-tab-item">
                                 <div class="layui-form-item" style="padding:0px;margin:0px">
                                     <div class="layui-row">
@@ -77,7 +150,7 @@
                                             <label class="layui-form-label" style="width:30px;padding-left:0px;">浠撳簱</label>
                                         </div>
                                         <div class="layui-col-xs6">
-                                            <input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" autocomplete="off" class="layui-input">
+                                            <input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" autocomplete="off" class="layui-input" onfocus="this.select();">
                                             <input type="hidden" name="HWHID" id="HWHID" lay-verify="HWHID" value="0" autocomplete="off" class="layui-input">
                                         </div>
                                         <div class="layui-col-xs3">
@@ -91,7 +164,7 @@
                                             <label class="layui-form-label" style="width:30px;padding-left:0px;">浠撲綅</label>
                                         </div>
                                         <div class="layui-col-xs6">
-                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" lay-verify="HStockPlaceName" autocomplete="off" class="layui-input">
+                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" lay-verify="HStockPlaceName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                             <input type="hidden" name="HStockPlaceID" id="HStockPlaceID" lay-verify="HStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                         </div>
                                         <div class="layui-col-xs3">
@@ -102,10 +175,24 @@
                                 <div class="layui-form-item" style="padding:0px;margin:0px">
                                     <div class="layui-row">
                                         <div class="layui-col-xs3">
+                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">瀹㈡埛</label>
+                                        </div>
+                                        <div class="layui-col-xs6">
+                                            <input type="text" name="HSupName" id="HSupName" lay-verify="HSupName" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
+                                            <input type="hidden" name="HSupID" id="HSupID" lay-verify="HSupID" value="0" autocomplete="off" class="layui-input">
+                                        </div>
+                                        <div class="layui-col-xs3">
+                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSupID-BT">...</button>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="layui-form-item" style="padding:0px;margin:0px">
+                                    <div class="layui-row">
+                                        <div class="layui-col-xs3">
                                             <label class="layui-form-label" style="width:30px;padding-left:0px;">淇濈</label>
                                         </div>
                                         <div class="layui-col-xs6">
-                                            <input type="text" name="HKeeper" id="HKeeper" lay-verify="HKeeper" autocomplete="off" class="layui-input">
+                                            <input type="text" name="HKeeper" id="HKeeper" lay-verify="HKeeper" autocomplete="off" class="layui-input" onfocus="this.select();">
                                             <input type="hidden" name="HKeeperID" id="HKeeperID" lay-verify="HKeeperID" value="0" autocomplete="off" class="layui-input">
                                         </div>
                                         <div class="layui-col-xs3">
@@ -119,7 +206,7 @@
                                             <label class="layui-form-label" style="width:30px;padding-left:0px;">棰嗘枡</label>
                                         </div>
                                         <div class="layui-col-xs6">
-                                            <input type="text" name="HSecManager" id="HSecManager" lay-verify="HSecManager" autocomplete="off" class="layui-input">
+                                            <input type="text" name="HSecManager" id="HSecManager" lay-verify="HSecManager" autocomplete="off" class="layui-input" onfocus="this.select();">
                                             <input type="hidden" name="HSecManagerID" id="HSecManagerID" lay-verify="HSecManagerID" value="0" autocomplete="off" class="layui-input">
                                         </div>
                                         <div class="layui-col-xs3">
@@ -145,7 +232,7 @@
                                             <label class="layui-form-label" style="width:30px;padding-left:0px;">閮ㄩ棬</label>
                                         </div>
                                         <div class="layui-col-xs6">
-                                            <input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" autocomplete="off" class="layui-input">
+                                            <input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                             <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0" autocomplete="off" class="layui-input">
                                         </div>
                                         <div class="layui-col-xs3">
@@ -167,51 +254,57 @@
                                     </div>
                                 </div>
                             </div>
+                            <!--鏄庣粏淇℃伅-->
                             <div class="layui-tab-item">
-                                <div class="layui-form-item" style="padding:0px;margin:0px">
-                                    <div class="layui-row">
-                                        <div class="layui-col-xs4">
-                                            <label class="layui-form-label" style="width:40px;padding-left:0px;">鏉$爜</label>
-                                        </div>
-                                        <div class="layui-col-xs8">
-                                            <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
-                                        </div>
-                                    </div>
-                                </div>
-                                <div class="layui-form-item" style="padding:0px;margin:0px">
-                                    <div class="layui-row">
-                                        <div class="layui-col-xs4">
-                                            <label class="layui-form-label" style="width:40px;padding-left:0px;">鏁伴噺</label>
-                                        </div>
-                                        <div class="layui-col-xs8">
-                                            <input type="text" name="HQty" id="HQty" lay-verify="HQty" autocomplete="off" class="layui-input">
-                                        </div>
-                                    </div>
-                                </div>
                                 <table class="layui-hide" id="wl-table" lay-filter="wl-table"></table>
                             </div>
+                            <!--涓嬫灦淇℃伅-->
                             <div class="layui-tab-item">
-                                <table class="layui-hide" id="mx-table" lay-filter="mx-table"></table>
+                                <table class="layui-hide" id="FIFOlist-table" lay-filter="FIFOlist-table"></table>
                             </div>
+                            <!--鍚堣淇℃伅-->
                             <div class="layui-tab-item">
-                                <table class="layui-hide" id="fj-table-qd" lay-filter="fj-table-qd"></table>
+                                <div class="layui-row">
+                                    <div class="layui-col-xs3">
+                                        <label class="layui-form-label" style="width:60px;padding-left:0px;">鏉$爜鏁伴噺</label>
+                                    </div>
+                                    <div class="layui-col-xs8 layui-input-inline mobile">
+                                        <input type="text" name="HBarcodeQtys" id="HBarcodeQtys" lay-verify="HBarcodeQtys" autocomplete="off" class="layui-input">
+                                    </div>
+                                </div>
+                                <div class="layui-row">
+                                    <div class="layui-col-xs3">
+                                        <label class="layui-form-label" style="width:60px;padding-left:0px;">鎬绘暟閲�</label>
+                                    </div>
+                                    <div class="layui-col-xs8 layui-input-inline mobile">
+                                        <input type="text" name="HSumQtys" id="HSumQtys" lay-verify="HSumQtys" value="0" autocomplete="off" class="layui-input">
+                                    </div>
+                                </div>
+                                <div class="layui-row">
+                                    <div class="layui-col-xs3">
+                                        <label class="layui-form-label" style="width:60px;padding-left:0px;">鏃ュ織</label>
+                                    </div>
+                                    <div class="layui-col-xs8 layui-input-inline mobile">
+                                        <input type="text" name="HNote" id="HNote" lay-verify="HNote" autocomplete="off" class="layui-input">
+                                    </div>
+                                </div>
                             </div>
                         </div>
-                        <div class="layui-form-item" style="margin-bottom: 20px;">
-                            <div class="layui-row">
-                                <div class="layui-col-xs3">
-                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="Saver">鎻愪氦</button>
-                                </div>
-                                <div class="layui-col-xs3">
-                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdModify">缂栬緫</button>
-                                </div>
-                                <div class="layui-col-xs3">
-                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdDelete">鍒犻櫎</button>
-                                </div>
-                                <div class="layui-col-xs3">
-                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="Cancel">閫�鍑�</button>
-                                </div>
-                            </div>
+                        <div class="layer-footer" style="z-index: 10; position: fixed; text-align: center; bottom: 0; width:100%; height:50px">
+                            <button type="button" lay-submit="" class="layui-btn" lay-filter="Saver">鎻愪氦</button>
+                            <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdModify">缂栬緫</button>
+                            <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdDelete">鍒犻櫎</button>
+                            <button type="button" lay-submit="" class="layui-btn" lay-filter="Cancel">閫�鍑�</button>
+                        </div>
+                        <div id="" style="display:none;">
+                            <audio id="cs" hidden controls>
+                                <source src="../../video/jingbao.wav" type="audio/ogg">
+                            </audio>
+                        </div>
+                        <div id="" style="display:none;">
+                            <audio id="cs2" hidden controls>
+                                <source src="../../video/success.wav" type="audio/ogg">
+                            </audio>
                         </div>
                     </div>
                 </form>
@@ -223,288 +316,593 @@
     <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
     <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
     <script>
-    layui.config({
-        base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
-    }).extend({
-        index: 'lib/index' //涓诲叆鍙fā鍧�
-    }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
-        var $ = layui.$
-        , admin = layui.admin
-        , layer = layui.layer
-        , table = layui.table
-        , form = layui.form
-        , element = layui.element;
+        layui.config({
+            base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
+        }).extend({
+            index: 'lib/index' //涓诲叆鍙fā鍧�
+        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
+            var $ = layui.$
+                , admin = layui.admin
+                , layer = layui.layer
+                , table = layui.table
+                , form = layui.form
+                , laydate = layui.laydate
+                , element = layui.element;
+            var HInterID = $('#HInterID').val()
+            var HBillNo = $('#HBillNo').val()
+            var HBillType = '1206'
+            var HMaker = sessionStorage["HUserName"]
+            var HStockOrgID = sessionStorage["OrganizationID"]
+            var HSourceFlag = sessionStorage["SourceFlag"];
+            var OperationType = 0;//鎿嶄綔绫诲瀷
+            var option = [];
 
 
-        //琛ㄥご鍒濆鍖栬祴鍊硷紙鏍规嵁鐧诲綍鐢ㄦ埛鑾峰彇 榛樿浠撳簱銆侀儴闂ㄣ�侀獙鏀躲�佷繚绠°�侀噾铦剁敤鎴凤級 new
-        $("#HWHID").val(sessionStorage["HWHID"]);
-        $("#HWHNAME").val(sessionStorage["HWHName"]);
-        $("#HStockPlaceID").val(sessionStorage["HSPID"]);
-        $("#HStockPlaceName").val(sessionStorage["HSPName"]);
-        //$("#HSupID").val(sessionStorage["HSupID"]);
-        //$("#HSupName").val(sessionStorage["HSupName"]);
-        $("#HDeptID").val(sessionStorage["HDeptID"]);
-        $("#HDeptName").val(sessionStorage["HDept"]);
-        $("#HSecManagerID").val(sessionStorage["HSecManagerID"]);
-        $("#HSecManager").val(sessionStorage["HSecManager"]);
-        $("#HKeeperID").val(sessionStorage["HKeeperID"]);
-        $("#HKeeper").val(sessionStorage["HKeeper"]);
-        $("#HMaker").val(sessionStorage["HUserName"]);
-        $("#HMaker").hide();
-        $("#HMakerID").hide();
-        $("#HBillerID").val(sessionStorage["HBillerID"]);
-        $("#HBillerID").hide();
+            //琛ㄥご鍒濆鍖栬祴鍊硷紙鏍规嵁鐧诲綍鐢ㄦ埛鑾峰彇 榛樿浠撳簱銆侀儴闂ㄣ�侀獙鏀躲�佷繚绠°�侀噾铦剁敤鎴凤級 new
+            $("#HWHID").val(sessionStorage["HWHID"]);
+            $("#HWHNAME").val(sessionStorage["HWHName"]);
+            //$("#HStockPlaceID").val(sessionStorage["HSPID"]);
+            //$("#HStockPlaceName").val(sessionStorage["HSPName"]);
+            //$("#HSupID").val(sessionStorage["HSupID"]);
+            //$("#HSupName").val(sessionStorage["HSupName"]);
+            $("#HDeptID").val(sessionStorage["HDeptID"]);
+            $("#HDeptName").val(sessionStorage["HDept"]);
+            $("#HSecManagerID").val(sessionStorage["HSecManagerID"]);
+            $("#HSecManager").val(sessionStorage["HSecManager"]);
+            $("#HKeeperID").val(sessionStorage["HKeeperID"]);
+            $("#HKeeper").val(sessionStorage["HKeeper"]);
+            $("#HMaker").val(sessionStorage["HUserName"]);
+            $("#HMaker").hide();
+            $("#HMakerID").hide();
+            $("#HBillerID").val(sessionStorage["HBillerID"]);
+            $("#HBillerID").hide();
+            $("#HBillSubType").val(sessionStorage["HBillSubType"]);
+            $("#HDate").val(formatDate(sessionStorage["HDate"]));
+
+            //榛樿甯﹀叆鐨勪粨搴擄紝濡傛灉鍚敤浠撲綅鍒欎粨浣嶆湁鏁堬紝濡傛灉娌℃湁鍚敤鍒欎粨浣嶇伆搴� new
 
 
+            // 缂栬緫鑾峰彇琛ㄥご鏃舵椂闂存牸寮忕煫姝f柟寮�
+            function formatDate(date) {
+                var d = new Date(date),
+                    month = '' + (d.getMonth() + 1),
+                    day = '' + d.getDate(),
+                    year = d.getFullYear();
 
+                if (month.length < 2) month = '0' + month;
+                if (day.length < 2) day = '0' + day;
 
-        //榛樿甯﹀叆鐨勪粨搴擄紝濡傛灉鍚敤浠撲綅鍒欎粨浣嶆湁鏁堬紝濡傛灉娌℃湁鍚敤鍒欎粨浣嶇伆搴� new
-
-
-        //鑾峰彇鍙傛暟
-        function getUrlVars() {
-            var vars = [], hash;
-            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
-            for (var i = 0; i < hashes.length; i++) {
-                hash = hashes[i].split('=');
-                vars.push(hash[0]);
-                vars[hash[0]] = hash[1];
+                return [year, month, day].join('-');
             }
-            return vars;
-        }
-        var params = getUrlVars();
-        var linterid = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
-        var lSourceBillType = params[params[2]];  //浠庡崟鎹幏鍙� 婧愬崟绫诲瀷
-        
-        function  RoadBillMain(linterid)//鍔犺浇琛ㄥご
-        {
-            $.ajax({
-                url: GetWEBURL() + "/Web/GetPonderationBill",
-                type: "GET",
-                data: { "HInterID": linterid },
-                success: function (d) {
-                    // console.log(d.data);
-                    $("#HInterID").val(d.data[0].HInterID);
-                    $("#HBillNo").val(d.data[0].HBillNo);
-                    $("#HBillType").val(d.data[0].HSourceBillType);
-                    $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
-                    //$("#HWHID").val(d.data[0].HWhID);
-                    //$("#HKeeperID").val(d.data[0].HKeeperID);
-                    //$("#HSecManagerID").val(d.data[0].HSecManagerID);
-                    //$("#HDeptID").val(d.data[0].HDeptID);
-                    //$("#HBarCode").val(d.data[0].HBarCode);
-                    //$("#HQty").val(d.data[0].HQty);
-                }
-            })
-        }
 
+            //鍒濆鍖栬〃鍗曟彃浠�
+            set_InitFrom();
 
-        function RoadBillSub(linterid)//鍔犺浇琛ㄤ綋
-        {
-            table.render({
-                    elem: '#wl-table'
-                    , url: GetWEBURL() + '/OtherOutBill/DisBillEntryList_Webs_Json'
-                    , toolbar: '#toolbarDemo'
-                    , where: { HBillID: linterid, HBillType: '1206', sWhere: '' }
-                    , cols: [[
-                        { type: 'radio' }
-                    , { field: 'HQty', title: '鏁伴噺', width: 150 }
-                    , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 150 }
+            //鍒濆鍖栬〃鍗曟彃浠�
+            function set_InitFrom() {
+                //甯歌鐢ㄦ硶
+                laydate.render({
+                    elem: '#HDate'
+                });
+            }
+
+            var listOption = {
+                elem: '#wl-table'
+                , toolbar: '#toolbarDemo'
+                , cellMinWidth: 90
+                , limit: 3000
+                , totalRow: true
+                , cols: [[
+                    { type: 'radio' }
+                    , { field: 'HQty', title: '鏁伴噺', width: 150, totalRow: true }
+                    , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 150, totalRow: true }
                     , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
                     , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
                     , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
-                    , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
-                    , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
+                    , { field: 'HAuxPropName', title: '杈呭姪灞炴��', width: 150 }
                     , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
-                    , { field: 'HBatchNo', title: '鎵规', width: 150 }
-                    ]] 
-                    , height: 500
-                    , done: function () {
+                    //, { field: 'HBatchNo', title: '鎵规', width: 150, hide: true }
+                    , { field: 'HPieceQty', title: '鏉$爜鏁伴噺', width: 150, totalRow: true }
+                    , { field: 'HMaterID', title: 'HMaterID', width: 150, hide: true }
+                    , { field: 'HAuxPropID', title: 'HAuxPropID', width: 150, hide: true }
+                    , { field: 'HSourceInterID', title: 'HSourceInterID', width: 150, hide: true }
+                    , { field: 'HSourceEntryID', title: 'HSourceEntryID', width: 150, hide: true }
+                    , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 70 }
+                ]]
+                , height: 500
+                , done: function () {
+                    layer.closeAll("loading");
+                }
+            }
+            var FIFOlistOption = {
+                elem: '#FIFOlist-table'
+                , toolbar: '#toolbarDemo'
+                , cellMinWidth: 90
+                , limit: 3000
+                , totalRow: true
+                , cols: [[
+                    { field: 'HQty', title: '鏁伴噺', width: 150, totalRow: true }
+                    , { field: 'HQtyMust', title: '涓嬫灦鏁伴噺', width: 150, totalRow: true }
+                    , { field: 'HWhName', title: '浠撳簱', width: 150 }
+                    , { field: 'HSPName', title: '浠撲綅', width: 150 }
+                    , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
+                    , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
+                    //, { field: 'HBatchNo', title: '鎵规', width: 150 }
+                    , { field: 'HAuxPropName', title: '杈呭姪灞炴��', width: 150 }
+                ]]
+                , height: 500
+                , done: function () {
+                    layer.closeAll("loading");
+                }
+            }
+            //妫シ鍒楄〃鏄剧ず
+            //var listOption = {
+            //    elem: '#wl-table'
+            //    , toolbar: '#toolbarDemo'
+            //    , cellMinWidth: 90
+            //    , totalRow: true
+            //    , cols: [[
+            //        { type: 'radio' }
+            //        , { field: 'HQty', title: '閲嶉噺', width: 150, totalRow: true }
+            //        , { field: 'HAuxQty', title: '绠辨暟', width: 150, totalRow: true }
+            //        , { field: 'HQtyMust', title: '搴斿彂鏁伴噺', width: 150 }
+            //        , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
+            //        , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
+            //        , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
+            //        , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
+            //        , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
+            //        , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
+            //        , { field: 'HBatchNo', title: '鎵规', width: 150 }
+            //        , { field: 'HPieceQty', title: '鏉$爜鏁伴噺', width: 150 }
+            //    ]]
+            //    , height: 500
+            //    , done: function () {
+            //        layer.closeAll("loading");
+            //    }
+            //}
+
+
+            //鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
+            if (sessionStorage.login != "login") {
+                layer.confirm("鐧诲綍澶辨晥锛岃閲嶆柊鐧诲綍锛�", {
+                    icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍']
+                }, function () { window.location.href = "../../user/login.html"; });
+            }
+
+            function playSound() {
+                console.log("playSound");
+                var audio = document.getElementById("cs");
+                audio.play();
+            }
+            function playSound1() {
+                console.log("playSound1");
+                var audio = document.getElementById("cs2");
+                audio.play();
+            }
+
+            //鑾峰彇鍙傛暟
+            function getUrlVars() {
+                var vars = [], hash;
+                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
+                for (var i = 0; i < hashes.length; i++) {
+                    hash = hashes[i].split('=');
+                    vars.push(hash[0]);
+                    vars[hash[0]] = hash[1];
+                }
+                return vars;
+            }
+            //var params = getUrlVars();
+            //var linterid = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
+            //var lSourceBillType = params[params[2]];  //浠庡崟鎹幏鍙� 婧愬崟绫诲瀷
+            var params = getUrlVars();
+            var OperationType = params[params[0]];  //浠庣紦瀛樺垪琛ㄤ腑杩斿洖鏁版嵁绫诲瀷  1鏂板  2浠庣紦瀛樺垪琛ㄤ腑杩斿洖
+            var HInterID_Temp = params[params[1]];  //浠庣紦瀛樺垪琛ㄤ腑杩斿洖鍗曟嵁ID
+
+
+
+            //鍒ゆ柇鏄惁鏂板
+            if (HInterID != 0) {
+                HSourceFlag = true;
+            }
+            //浠庣紦瀛樺垪琛ㄧ紪杈戝姛鑳借烦杞嚦鍗曟嵁妯″潡
+            else if (OperationType == 2) {
+                RoadBillMain(HInterID_Temp);
+                $("#HBarCode").select();
+                $("#HBarCode").focus();     //鑾峰彇鍏夋爣
+                //$('#QueDin2').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
+                //document.getElementById("QueDin2").disabled = true;   //鎸夐挳鍙樹负涓嶅彲缂栬緫鐘舵��
+                //鏄剧ず琛ㄤ綋鏄庣粏
+                DisBillEntryList();
+                HSourceFlag = true;
+            }
+            else {
+                OperationType = 1;
+                //鑾峰彇鏈�澶у崟鎹甀D銆佸崟鎹彿
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + "/WEBSController/GetMaxBillNoAndID_Json",
+                    async: false,    //async鐢ㄤ簬鎺у埗锛坒alse锛夊悓姝ュ拰锛坱rue锛夊紓姝ワ紝榛樿鐨勬槸true锛屽嵆璇锋眰榛樿鐨勬槸寮傛璇锋眰
+                    data: { "HBillType": HBillType },
+                    success: function (d) {
+                        if (d.count == 1) {
+                            $("#HInterID").val(d.data[0].HInterID);
+                            $("#HBillNo").val(d.data[0].HBillNo);
+                            $("#HDate").val(formatDate(new Date(), "yyyy-MM-dd"));
+                            HInterID = $('#HInterID').val()
+                            HBillNo = $('#HBillNo').val()
+                        }
+                        else {
+                            layer.msg(d.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                        }
+                    }
+                });
+                HSourceFlag = false;
+            }
+
+            function RoadBillMain(linterid)//鍔犺浇琛ㄥご
+            {
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + '/WEBSController/GetSourceBill_Temp_Json',
+                    async: false,    //async鐢ㄤ簬鎺у埗锛坒alse锛夊悓姝ュ拰锛坱rue锛夊紓姝ワ紝榛樿鐨勬槸true锛屽嵆璇锋眰榛樿鐨勬槸寮傛璇锋眰
+                    data: { "HInterID": HInterID_Temp, "HBillType": HBillType },
+                    success: function (d) {
+                        // console.log(d.data);
+                        $("#HInterID").val(d.data[0].HInterID);
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                        $("#HBillType").val(d.data[0].HSourceBillType == null ? "1242" : d.data[0].HSourceBillType);
+                        //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+                        if (d.data[0].HSourceBillType == "1242") {
+                            $("#HBillType").empty();
+                            $("#HBillType").val("1242");
+                            var optionHtml = '';
+                            optionHtml += "<option value = '" + d.data[0].HSourceBillType + "' >" + '鍑哄簱鐢宠鍗�' + "</option>";
+                            $("#HBillType").append(optionHtml);
+                            layui.form.render('select');
+                            $("#HBillType").attr("readonly", "readonly");
+                        }
+                        else {
+                            $("#HBillType").empty();
+                            $("#HBillType").val("-1");
+                            var optionHtml = '';
+                            optionHtml += "<option value = '" + d.data[0].HSourceBillType + "' >" + '鎵嬪伐褰曞叆' + "</option>";
+                            $("#HBillType").append(optionHtml);
+                            layui.form.render('select');
+                            $("#HBillType").attr("readonly", "readonly");
+                        }
+                        $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
+                        $("#HSourceBillNo").attr("disabled", "true");
+                        $("#HDate").val(formatDate(new Date(), "yyyy-MM-dd"));
+                        HSourceFlag = true;
+                        //$("#HWHID").val(d.data[0].HWhID);
+                        //$("#HKeeperID").val(d.data[0].HKeeperID);
+                        //$("#HSecManagerID").val(d.data[0].HSecManagerID);
+                        //$("#HDeptID").val(d.data[0].HDeptID);
+                        //$("#HBarCode").val(d.data[0].HBarCode);
+                        //$("#HQty").val(d.data[0].HQty);
+                    }
+                })
+                //鑾峰彇鍗曟嵁瀛愮被鍨�
+                var HBillSubType = '';
+                $.ajax({
+                    url: GetWEBURL() + "/WEBSController/GetBillSubType_Json",
+                    type: "GET",
+                    data: { "HBillType": '1206', "HStockOrgID": HStockOrgID },
+                    success: function (result) {
+                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            var data = result.data;
+                            for (var i = 0; i < data.length; i++) {
+                                HBillSubType += '<option value="' + data[i].HNumber + '">' + data[i].HName + '</option>';
+                            }
+                            $("#HBillSubType").append(HBillSubType);
+                            form.render('select');
+                        }
                         layer.closeAll("loading");
                     }
-            });
-        }
-             
-        //鍔ㄦ�佸姞杞芥簮鍗曠被鍨嬪垪琛� new
+                })
+            }
 
-            
 
-            
+            //function RoadBillSub(linterid)//鍔犺浇琛ㄤ綋
+            //{
+            //    table.render({
+            //        elem: '#wl-table'
+            //        , url: GetWEBURL() + '/OtherOutBill/DisBillEntryList_Webs_Json'
+            //        //, toolbar: '#toolbarDemo'
+            //        , page: true
+            //        , limit: 100
+            //        , where: { HBillID: linterid, HBillType: '1206', sWhere: '' }
+            //        , cols: [[
+            //            { type: 'radio' }
+            //            , { field: 'HQty', title: '閲嶉噺', width: 150 }
+            //            , { field: 'HAuxQty', title: '绠辨暟', width: 150, totalRow: true }
+            //            , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
+            //            , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
+            //            , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
+            //            , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
+            //            , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
+            //            , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
+            //            //, { field: 'HBatchNo', title: '鎵规', width: 150 }
+            //        ]]
+            //        , height: 500
+            //        , done: function () {
+            //            layer.closeAll("loading");
+            //        }
+            //    });
+            //}
 
-            
+            //鍔ㄦ�佸姞杞芥簮鍗曠被鍨嬪垪琛� new
 
-        //鍒ゆ柇鏄惁鏂板
-        if (linterid == null || linterid == 0) {
-            //鑾峰彇鏈�澶у崟鎹彿 new
-            $("#HInterID").val("");
-            $("#HBillNo").val(""); 
-            $.ajax({ 
-                url: GetWEBURL() + "/Web/GetMAXNum",
-                type: "GET",
-                data: { "HBillType": '1206' },
-                success: function (d) {
-                    //console.log(d.data);
-                    $("#HInterID").val(d.data[0].HInterID);
-                    $("#HBillNo").val(d.data[0].HBillNo);
+
+
+
+
+
+
+            ////鍒ゆ柇鏄惁鏂板
+            //if (linterid == null || linterid == 0) {
+            //    //鑾峰彇鏈�澶у崟鎹彿 new
+            //    $("#HInterID").val("");
+            //    $("#HBillNo").val("");
+            //    $.ajax({
+            //        url: GetWEBURL() + "/Web/GetMAXNumPDA",
+            //        type: "GET",
+            //        data: { "HBillType": '1206' },
+            //        success: function (d) {
+            //            //console.log(d.data);
+            //            $("#HInterID").val(d.data[0].HInterID);
+            //            $("#HBillNo").val(d.data[0].HBillNo);
+            //            $("#HDate").val(formatDate(new Date(), "yyyy-MM-dd"));
+            //        }
+            //    });
+            //    //鑾峰彇鍗曟嵁瀛愮被鍨�
+            //    var HBillSubType = '';
+            //    $.ajax({
+            //        url: GetWEBURL() + "/WEBSController/GetBillSubType_Json",
+            //        type: "GET",
+            //        data: { "HBillType": '1206', "HStockOrgID": HStockOrgID },
+            //        success: function (result) {
+            //            if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+            //                var data = result.data;
+            //                for (var i = 0; i < data.length; i++) {
+            //                    HBillSubType += '<option value="' + data[i].HNumber + '">' + data[i].HName + '</option>';
+            //                }
+            //                $("#HBillSubType").append(HBillSubType);
+            //                form.render('select');
+            //            }
+            //            layer.closeAll("loading");
+            //        }
+            //    })
+            //}
+            //else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
+            //    RoadBillMain(linterid);
+            //    //RoadBillSub(linterid);
+
+            //    //鏄剧ず琛ㄤ綋鏄庣粏
+            //    DisBillEntryList();
+            //}
+
+            $('#HStockPlaceName').on('keydown', function (event) {      //鎵粨浣�
+                var HBarCode = $('#HStockPlaceName').val()
+                if (event.keyCode == 13) {
+                    //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
+                    $.ajax({
+                        url: GetWEBURL() + "/Web/GetSpName_Json",
+                        type: "GET",
+                        data: { "HBarCode": HBarCode },
+                        success: function (result) {
+                            if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                $("#HStockPlaceName").val(result.data[0].HName);
+                                $("#HWHID").val(result.data[0].HWHID);
+                                $("#HWHNAME").val(result.data[0].HWhName);
+                                $("#HStockPlaceID").val(result.data[0].HItemID);
+                                element.tabChange('tab-POStockInBill', '2');
+                            }
+                            else {
+                                // $("#verifycode").click();
+                                //layer.msg(result.Message, { icon: 5 });
+                                layer.msg(result.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                            }
+                            layer.closeAll("loading");
+                        }
+                    });
+                    // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
                 }
             });
-        }
-        else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
-            RoadBillMain(linterid);
-            RoadBillSub(linterid);
-        }
-
-
-        form.on('submit(HWHID-BT)', function () {//閫夋嫨浠撳簱
-            layer.open({
-                type: 2
-                , area: ['100%', '100%']
-                , title: '浠撳簱鍒楄〃'
-                , shade: 0.6 //閬僵閫忔槑搴�
-                , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
-                , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_WarehouseList.html?Type=HWHID', 'yes']
-                , resize: false
-                , cancel: function () {
-                    //$(".layui-btn").removeClass("layui-btn-disabled");
-                }
-            })
-        });
-        form.on('submit(HSpID-BT)', function () {//閫夋嫨浠撲綅
-            layer.open({
-                type: 2
-                , area: ['100%', '100%']
-                , title: '浠撲綅鍒楄〃'
-                , shade: 0.6 //閬僵閫忔槑搴�
-                , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
-                , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_StockPlaceList.html?HWhID=' + sessionStorage["HWHID"] + '&Type=HSpID', 'yes']
-                , resize: false
-                , cancel: function () {
-                    //$(".layui-btn").removeClass("layui-btn-disabled");
-                }
-            })
-        });
-        form.on('submit(HSupID-BT)', function () {//閫夋嫨渚涘簲鍟�
-            layer.open({
-                type: 2
-                , area: ['100%', '100%']
-                , title: '渚涘簲鍟嗗垪琛�'
-                , shade: 0.6 //閬僵閫忔槑搴�
-                , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
-                , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_SupplierList.html', 'yes']
-                , resize: false
-                , cancel: function () {
-                    //$(".layui-btn").removeClass("layui-btn-disabled");
-                }
-            })
-        });
-
-
-        //form.on('submit(HKeeperID-BT)', function () {//閫夋嫨淇濈
-        //    layer.open({
-        //        type: 2
-        //        , area: ['100%', '100%']
-        //        , title: '淇濈鍒楄〃'
-        //        , shade: 0.6 //閬僵閫忔槑搴�
-        //        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
-        //        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-        //        , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_EmployeeList.html?Type=HKeeper', 'yes']
-        //        , resize: false
-        //        , cancel: function () {
-        //            //$(".layui-btn").removeClass("layui-btn-disabled");
-        //        }
-        //    })
-        //});
-        //form.on('submit(HSecManagerID-BT)', function (data) {//閫夋嫨楠屾敹
-        //    var sMainStr = JSON.stringify(data.field);
-        //    layer.open({
-        //        type: 2
-        //        , area: ['100%', '100%']
-        //        , title: '楠屾敹鍒楄〃'
-        //        , shade: 0.6 //閬僵閫忔槑搴�
-        //        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
-        //        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-        //        , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_EmployeeList.html?Type=HSecManager', 'yes']
-        //        , resize: false
-        //        , cancel: function () {
-        //            //$(".layui-btn").removeClass("layui-btn-disabled");
-        //        }
-        //    })
-        //});
-        form.on('submit(HKeeperID-BT)', function () {//閫夋嫨淇濈
-            layer.open({
-                type: 2//寮圭獥绫诲瀷
-                , skin: 'layui-layer-rim' //鍔犱笂杈规
-                , area: ['90%', '90%']//澶у皬
-                , title: '鑱屽憳鍒楄〃'//鏍囬
-                , shift: 2//寮瑰嚭鍔ㄧ敾
-                , content: ['../../PublicPage/UserInformation.html', 'yes']
-                , btn: ['纭畾', '鍙栨秷']
-                , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
-                    var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
-                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
-                    if (checkStatus.data.length === 0) {
-                        return layer.msg('璇烽�夋嫨鏁版嵁');
+            //閫夋嫨鍏堣繘鍏堝嚭浠撳簱
+            form.on('submit(HFIFOWHID-BT)', function () {//閫夋嫨璋冨嚭浠撳簱
+                layer.open({
+                    type: 2
+                    , area: ['100%', '100%']
+                    , title: '浠撳簱鍒楄〃'
+                    , shade: 0.6 //閬僵閫忔槑搴�
+                    , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                    , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                    , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_WarehouseListNew.html?Type=HFIFOWHID&HOrgID=' + HStockOrgID + '', 'yes']
+                    , resize: false
+                    , cancel: function () {
+                        //$(".layui-btn").removeClass("layui-btn-disabled");
                     }
-                    $("#HKeeper").val(checkStatus.data[0].HName);
-                    $("#HKeeperID").val(checkStatus.data[0].HItemID);
-                    layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
-                }
-                , btn2: function (index, layero) { }
-            })
-        });
-        form.on('submit(HSecManagerID-BT)', function (data) {//閫夋嫨鍙戣揣
-            layer.open({
-                type: 2//寮圭獥绫诲瀷
-                , skin: 'layui-layer-rim' //鍔犱笂杈规
-                , area: ['90%', '90%']//澶у皬
-                , title: '鑱屽憳鍒楄〃'//鏍囬
-                , shift: 2//寮瑰嚭鍔ㄧ敾
-                , content: ['../../PublicPage/UserInformation.html', 'yes']
-                , btn: ['纭畾', '鍙栨秷']
-                , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
-                    var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
-                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
-                    if (checkStatus.data.length === 0) {
-                        return layer.msg('璇烽�夋嫨鏁版嵁');
+                })
+            });
+            form.on('submit(HWHID-BT)', function () {//閫夋嫨浠撳簱
+                layer.open({
+                    type: 2
+                    , area: ['100%', '100%']
+                    , title: '浠撳簱鍒楄〃'
+                    , shade: 0.6 //閬僵閫忔槑搴�
+                    , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                    , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                    , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_WarehouseListNew.html?Type=HWHID&HOrgID=' + HStockOrgID + '', 'yes']
+                    , resize: false
+                    , cancel: function () {
                     }
-                    $("#HSecManager").val(checkStatus.data[0].HName);
-                    $("#HSecManagerID").val(checkStatus.data[0].HItemID);
-                    layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
-                }
-                , btn2: function (index, layero) { }
+                })
+            });
+            form.on('submit(HSpID-BT)', function () {//閫夋嫨浠撲綅
+                layer.open({
+                    type: 2
+                    , area: ['100%', '100%']
+                    , title: '浠撲綅鍒楄〃'
+                    , shade: 0.6 //閬僵閫忔槑搴�
+                    , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                    , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                    , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_StockPlaceList.html?HWhID=' + sessionStorage["HWHID"] + '&Type=HSpID', 'yes']
+                    , resize: false
+                    , cancel: function () {
+                        //$(".layui-btn").removeClass("layui-btn-disabled");
+                    }
+                })
+            });
+
+            //#region 瀹㈡埛
+            form.on('submit(HSupID-BT)', function () {//閫夋嫨瀹㈡埛
+                layer.open({
+                    type: 2
+                    , area: ['100%', '100%']
+                    , title: '瀹㈡埛鍒楄〃'
+                    , shade: 0.6 //閬僵閫忔槑搴�
+                    , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                    , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                    , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_CustomerListNew.html?HOrgID=' + HStockOrgID + '', 'yes']
+                    , resize: false
+                    , cancel: function () {
+                        //$(".layui-btn").removeClass("layui-btn-disabled");
+                    }
+                })
+            });
+
+            //#endregion
+
+
+            //form.on('submit(HKeeperID-BT)', function () {//閫夋嫨淇濈
+            //    layer.open({
+            //        type: 2
+            //        , area: ['100%', '100%']
+            //        , title: '淇濈鍒楄〃'
+            //        , shade: 0.6 //閬僵閫忔槑搴�
+            //        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+            //        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+            //        , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_EmployeeList.html?Type=HKeeper', 'yes']
+            //        , resize: false
+            //        , cancel: function () {
+            //            //$(".layui-btn").removeClass("layui-btn-disabled");
+            //        }
+            //    })
+            //});
+            //form.on('submit(HSecManagerID-BT)', function (data) {//閫夋嫨楠屾敹
+            //    var sMainStr = JSON.stringify(data.field);
+            //    layer.open({
+            //        type: 2
+            //        , area: ['100%', '100%']
+            //        , title: '楠屾敹鍒楄〃'
+            //        , shade: 0.6 //閬僵閫忔槑搴�
+            //        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+            //        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+            //        , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_EmployeeList.html?Type=HSecManager', 'yes']
+            //        , resize: false
+            //        , cancel: function () {
+            //            //$(".layui-btn").removeClass("layui-btn-disabled");
+            //        }
+            //    })
+            //});
+            form.on('submit(HKeeperID-BT)', function () {//閫夋嫨淇濈
+                layer.open({
+                    type: 2//寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['90%', '90%']//澶у皬
+                    , title: '鑱屽憳鍒楄〃'//鏍囬
+                    , shift: 2//寮瑰嚭鍔ㄧ敾
+                    , content: ['../../PublicPage/UserInformation.html', 'yes']
+                    , btn: ['纭畾', '鍙栨秷']
+                    , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                        var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                        if (checkStatus.data.length === 0) {
+                            return layer.msg('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HKeeper").val(checkStatus.data[0].HName);
+                        $("#HKeeperID").val(checkStatus.data[0].HItemID);
+                        layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) { }
+                })
+            });
+            form.on('submit(HSecManagerID-BT)', function (data) {//閫夋嫨鍙戣揣
+                layer.open({
+                    type: 2//寮圭獥绫诲瀷
+                    , skin: 'layui-layer-rim' //鍔犱笂杈规
+                    , area: ['90%', '90%']//澶у皬
+                    , title: '鑱屽憳鍒楄〃'//鏍囬
+                    , shift: 2//寮瑰嚭鍔ㄧ敾
+                    , content: ['../../PublicPage/UserInformation.html', 'yes']
+                    , btn: ['纭畾', '鍙栨秷']
+                    , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                        var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                        if (checkStatus.data.length === 0) {
+                            return layer.msg('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HSecManager").val(checkStatus.data[0].HName);
+                        $("#HSecManagerID").val(checkStatus.data[0].HItemID);
+                        layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) { }
+                })
+            });
+
+
+
+            form.on('submit(HDeptID-BT)', function () {//閫夋嫨閮ㄩ棬
+                layer.open({
+                    type: 2
+                    , area: ['100%', '100%']
+                    , title: '閮ㄩ棬鍒楄〃'
+                    , shade: 0.6 //閬僵閫忔槑搴�
+                    , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                    , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                    , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_DepartmentList.html', 'yes']
+                    , resize: false
+                    , cancel: function () {
+                        //$(".layui-btn").removeClass("layui-btn-disabled");
+                    }
+                })
+            });
+
+            //閫�鍑烘寜閽�
+            form.on('submit(Cancel)', function () {
+                var sInterID = $("#HInterID").val()
+                var HBillType = '1206'
+                $.ajax(
+                    {
+                        type: "Get",
+                        url: GetWEBURL() + "/WEBSController/set_DelPonderationBillMain_Temp_FIFO_New_Json",
+                        async: false,    //async鐢ㄤ簬鎺у埗锛坒alse锛夊悓姝ュ拰锛坱rue锛夊紓姝ワ紝榛樿鐨勬槸true锛屽嵆璇锋眰榛樿鐨勬槸寮傛璇锋眰
+                        data: { "HInterID": HInterID, "HBillType": HBillType, "HStockOrgID": HStockOrgID },
+                        dataType: "json",
+                        success: function (data) {
+                            if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜�
+                            }
+                            else {
+                                layer.msg(data.Message, { icon: 2 });
+                            }
+                        },
+                        error: function (err) {
+                            layer.msg('閿欒' + err, {
+                                icon: 5,
+                                time: 20000
+                            }, function () {
+                            });
+                        }
+                    });
+                layer.confirm('鎮ㄧ‘瀹氳閫�鍑哄悧锛�', { icon: 3, title: '鎻愮ず' }, function (index) {
+                    parent.location.href = "../../../views/index_Mobile.html";
+                });
             })
-        });
 
-
-
-        form.on('submit(HDeptID-BT)', function () {//閫夋嫨閮ㄩ棬
-            layer.open({
-                type: 2
-                , area: ['100%', '100%']
-                , title: '閮ㄩ棬鍒楄〃'
-                , shade: 0.6 //閬僵閫忔槑搴�
-                , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
-                , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_DepartmentList.html', 'yes']
-                , resize: false
-                , cancel: function () {
-                    //$(".layui-btn").removeClass("layui-btn-disabled");
-                }
-            })
-        });
-
-        form.on('submit(Cancel)', function () {
-            sessionStorage["SourceFlag"] = false;
-            parent.location.href = "../../../views/index.html"
-            //window.close();//鍏抽棴褰撳墠椤�
-        })
-
-        form.on('submit(cmdModify)', function () {//缂栬緫
-            var sSubStr = table.cache['wl-table'];
-            //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉
+            form.on('submit(cmdModify)', function () {//缂栬緫
+                var sSubStr = table.cache['wl-table'];
+                //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉
                 layer.open({
                     type: 2
                     , area: ['100%', '100%']
@@ -518,140 +916,723 @@
                         //$(".layui-btn").removeClass("layui-btn-disabled");
                     }
                 })
-           // }
-        });
+                // }
+            });
 
-        form.on('submit(cmdDelete)', function () {//鍒犻櫎
-            var checkStatus = table.checkStatus('wl-table')
-            , data = checkStatus.data;
-            // console.log(data);
-            var sInterID = $('#HInterID').val()
-            var sMaterID = data[0].HMaterID
-            var sBillType = '1206'
-            var sAuxPropID = data[0].HAuxPropID
-            //var sMTONo = data[0].HMTONo
-            var sMTONo = ''
-            var sSourceInterID = data[0].HSourceInterID
-            var sSourceEntryID = data[0].HSourceEntryID
-            $.ajax(
-               {
-                   type: "Get",
-                   //url: "http://61.130.49.162:9090/WMSAPI///POStockInBill/Delete_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                   url: GetWEBURL() + "/OtherOutBill/Delete_Json",
-                   async: true,
-                   data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": sBillType, },
-                   dataType: "json",
-                   success: function (data) {
-                       if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                           //layer.msg(data.Message, { icon: 1 });
-                           table.render({
-                               elem: '#wl-table' 
-                               , url: GetWEBURL() + '/OtherOutBill/DisBillEntryList_Webs_Json'
-                               , cellMinWidth: 80
-                               , toolbar: '#toolbarDemo'
-                               , where: { HBillID: sInterID, HBillType: '1206', sWhere: '' }
-                               , cols: [[
-                                  { type: 'radio' }
-                                , { field: 'HQty', title: '鏁伴噺', width: 80 }
-                                , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 80 }
-                                , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 100 }
-                                , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
-                                , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 100 }
-                                , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 100 }
-                                , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 100 }
-                                , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 100 }
-                                , { field: 'HBatchNo', title: '鎵规', width: 100 }
-                                , { field: 'HAuxPropID', title: '杈呭姪灞炴��', width: 100 }
-                                , { field: 'HMTONo', title: '璁″垝璺熻釜鍙�', width: 100 }
-                               ]]
-                         , height: 500
-                           })
-                       }
-                       else {
-                           layer.msg(data.Message, { icon: 2 });
-                       }
-                   },
-                   error: function (err) {
-                       layer.msg('閿欒' + err, {
-                           icon: 5,
-                           time: 20000
-                       }, function () {
-                           //do something
-                       });
-                   }
-               });
-        });
+            form.on('submit(cmdDelete)', function () {//鍒犻櫎
+                var checkStatus = table.checkStatus('wl-table')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1) {
+                    layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗灏嗕笉鍙仮澶嶏紒", { title: "鍒犻櫎纭" }, function (index) {
+                        var sInterID = $("#HInterID").val()
+                        var sBillNo = $("#HBillNo").val()
+                        var sMaterID = data[0].HMaterID
+                        var sAuxPropID = data[0].HAuxPropID
+                        var sMTONo = ''
+                        var sSourceInterID = data[0].HSourceInterID
+                        var sSourceEntryID = data[0].HSourceEntryID
+                        var HBillType = '1206';
+                        $.ajax(
+                            {
+                                type: "Get",
+                                url: GetWEBURL() + "/WEBSController/set_DelPonderationBillMain_Temp_InterIDAndSource_Json",
+                                async: true,
+                                data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "HBillType": HBillType },
+                                dataType: "json",
+                                success: function (data) {
+                                    if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                        //鏄剧ず琛ㄤ綋鏄庣粏
+                                        DisBillEntryList();
+
+                                        ////鏄剧ず琛ㄤ綋鏄庣粏
+                                        //$.ajax({
+                                        //    url: GetWEBURL() + '/WEBSController/GetBillEntryTmpList_Json',
+                                        //    type: "GET",
+                                        //    data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": HBillType, "HStockOrgID": HStockOrgID },
+                                        //    success: function (result) {
+                                        //        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                        //            listOption.data = result.data.Materlist;
+                                        //            table.render(listOption);
+                                        //            FIFOlistOption.data = result.data.FIFOlist;
+                                        //            table.render(FIFOlistOption);
+
+                                        //            //console.log(result.data.list2);
+                                        //            var count = 0;
+                                        //            var count1 = 0;
+                                        //            for (var i = 0; i < result.data.Materlist.length; i++) {
+                                        //                count += result.data.Materlist[i].HQty;
+                                        //                count1 += result.data.Materlist[i].HPieceQty;
+                                        //            }
+                                        //            $("#HSumQtys").val(count);
+                                        //            $("#HBarcodeQtys").val(count1);
+                                        //            //return;
+                                        //        }
+                                        //        else {
+                                        //            layer.msg(result.Message);
+                                        //        }
+                                        //        layer.closeAll("loading");
+                                        //    }
+                                        //});
+                                    }
+                                    else {
+                                        layer.msg(data.Message, { icon: 2 });
+                                    }
+                                },
+                                error: function (err) {
+                                    layer.msg('閿欒' + err, {
+                                        icon: 5,
+                                        time: 20000
+                                    }, function () {
+                                    });
+                                }
+                            });
+                        layer.close(index)
+                    })
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛岃褰曪紝杩涜鍒犻櫎锛�');
+                }
+            });
 
 
-        form.on('submit(Saver)', function (data) {//鎻愪氦
-            //debugger;
-            var sMainStr = JSON.stringify(data.field);
-            var sSubStr = table.cache['wl-table'];
-            var sSourceType = $("#HBillType").val();
-            if (AllowLoadData(sSubStr) != false)//闈炵┖楠岃瘉
-            {
-                layer.load(3);
-                $.ajax(
+            form.on('submit(Saver)', function (data) {//鎻愪氦
+                //debugger;
+                var sMainStr = JSON.stringify(data.field);
+                var sSubStr = table.cache['wl-table'];
+                var sSourceType = $("#HBillType").val();
+                if (AllowLoadData(sSubStr) != false)//闈炵┖楠岃瘉
                 {
-                    type: "POST",                    
-                    url: GetWEBURL() + "/OtherOutBill/set_set_SaveOtherOutBill_Json",
-                    async: true,
-                    data: { "oMain": sMainStr  },
-                    dataType: "json",
-                    success: function (data) {
-                        if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                            layer.msg(data.Message + $("#HBillNo").val(), { icon: 1 });
+                    layer.load(3);
+                    $.ajax(
+                        {
+                            type: "POST",
+                            url: GetWEBURL() + "/OtherOutBill/set_set_SaveOtherOutBill_Json",
+                            async: true,
+                            data: { "oMain": sMainStr },
+                            dataType: "json",
+                            success: function (data) {
+                                if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                    layer.confirm(data.Message, {
+                                        icon: 1, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['鏂板'],
+                                        btn2: function () {
+                                            parent.location.href = "../../../views/index.html"
+                                        }//鍏抽棴
+                                    }, function () {
+                                        location.replace('Kf_OtherOutBill_Fast.html?OperationType=1&HInterID=0');
+                                    });//鏂板
+                                }
+                                else {
+                                    layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                                }
+                                layer.closeAll("loading");
+                            },
+                            error: function (err) {
+                                layer.msg("閿欒:" + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            }
+                        });
+                    return false;
+                }
+            });
+            //鐩戝惉鎻愪氦
+            form.verify({
+                numberOrEmpty: function (value, item) {
+                    // if (value != '') {
+                    if (!/^\d+$/.test(value)) {
+                        return '涓嶈兘涓虹┖鎴栨暟瀛楁垨鑰�0';
+                    }
+                    //}
+                }
+            });
+
+            //#region 鎵弿婧愬崟鏉$爜
+
+            //鎵簮鍗�
+            $('#HSourceBillNo').on('keydown', function (event) {
+                if (event.keyCode == 13) {
+                    GetMeesageBySourceBillNo();
+                }
+            });
+
+            //纭畾
+            form.on('submit(QueDin2)', function (data) {
+                GetMeesageBySourceBillNo();
+            });
+
+
+
+            form.on('submit(QueDin3)', function () {//
+                layer.open({
+                    type: 2
+                    , area: ['100%', '100%']
+                    , title: '鍑哄簱鐢宠鍗曞垪琛�'
+                    , shade: 0.6 //閬僵閫忔槑搴�
+                    //, maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                    , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                    , content: ['../../Baseset/鍩虹璧勬枡/OtherOutRequestBillList.html', 'yes']
+                    , btn: ['纭畾', '鍙栨秷']
+                    , btn1: function (index, layero) {
+
+                        //鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                        var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別lem:"#test"
+                        if (checkStatus.data.length === 0) {
+                            return layer.msg('璇烽�夋嫨鏁版嵁');
+                        }
+                        $("#HSourceBillNo").val(checkStatus.data[0].FBILLNO);
+                        layer.close(layer.index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                    }
+                    , btn2: function (index, layero) {
+                        //鎸夐挳銆愭寜閽簩銆戠殑鍥炶皟
+                        //return false 寮�鍚浠g爜鍙姝㈢偣鍑昏鎸夐挳鍏抽棴
+                    },
+                    end: function () {
+
+                    },
+                    success: function (layero, index) {
+
+                    }
+                })
+            });
+
+            //鎵弿婧愬崟鏉$爜
+            function GetMeesageBySourceBillNo(obj) {
+                var sInterID = $("#HInterID").val()
+                var sBillNo = $("#HBillNo").val()
+                var HBillType = '1206'
+                var HSourceBillNo = $('#HSourceBillNo').val()
+                var HSourceBillType = $("#HBillType").val()
+                var HMaker = sessionStorage["HUserName"]
+                var HFIFOWhID = $("#HFIFOWHID").val()
+                $.ajax({
+                    url: GetWEBURL() + "/WEBSController/get_SourceBarCode_OtherOut_Json",
+                    type: "GET",
+                    data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": HBillType, "HSourceBillNo": HSourceBillNo, "HSourceBillType": HSourceBillType, "HMaker": HMaker, "HFIFOWhID": HFIFOWhID, "HOWNERID": HStockOrgID },
+                    success: function (result) {
+                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            playSound1();
+                            HSourceFlag = true;
+                            if (result.data.hDeptIDField != 0) {
+                                $("#HDeptID").val(result.data.hDeptIDField);
+                                $("#HDeptName").val(result.data.hDeptNameField);
+                            }
+                            $("#HSourceBillNo").val(result.data.hSourceBillNoField);
+
+                            $("#HBillType").attr("disabled", "disabled");
+                            form.render('select');
+                            if (result.data.hMulSourceFlagField == 0) {
+                                $("#HSourceBillNo").attr("readonly", "readonly");
+                            }
+                            layer.load(3);
+                            element.tabChange('tab-Kf_OtherOutBill', '2');
+
+                            //鏄剧ず琛ㄤ綋鏄庣粏
+                            DisBillEntryList();
+
+                            //$.ajax({
+                            //    url: GetWEBURL() + '/WEBSController/GetBillEntryTmpList_Json',
+                            //    type: "GET",
+                            //    data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": HBillType, "HStockOrgID": HStockOrgID },
+                            //    success: function (result) {
+                            //        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            //            listOption.data = result.data.Materlist;
+                            //            table.render(listOption);
+                            //            FIFOlistOption.data = result.data.FIFOlist;
+                            //            table.render(FIFOlistOption);
+
+                            //            //console.log(result.data.list2);
+                            //            var count = 0;
+                            //            var count1 = 0;
+                            //            for (var i = 0; i < result.data.Materlist.length; i++) {
+                            //                count += result.data.Materlist[i].HQty;
+                            //                count1 += result.data.Materlist[i].HPieceQty;
+                            //            }
+                            //            $("#HSumQtys").val(count);
+                            //            $("#HBarcodeQtys").val(count1);
+                            //            //return;
+                            //        }
+                            //        else {
+                            //            layer.msg(result.Message);
+                            //        }
+                            //        layer.closeAll("loading");
+                            //    }
+                            //});
                         }
                         else {
-                            layer.msg(data.Message, { icon: 5 });
+                            playSound();
+                            layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                         }
                         layer.closeAll("loading");
-                    },
-                    error: function (err) {
-                        layer.msg("閿欒:" + err, { icon: 5 });
                     }
                 });
-                return false;
-            } 
-        });
-        //鐩戝惉鎻愪氦
-        form.verify({
-            numberOrEmpty: function (value, item) {
-                // if (value != '') {
-                if (!/^\d+$/.test(value)) {
-                    return '涓嶈兘涓虹┖鎴栨暟瀛楁垨鑰�0';
+            }
+
+            //#endregion
+
+
+            //#region 鎵弿鐗╂枡鏉$爜
+
+            //鏉″舰鐮佸洖杞︽柟娉�
+            $('#HBarCode').on('keydown', function (event) {
+                if (event.keyCode == 13) {
+                    GetMeesageByBarCode();
                 }
-                //}
+            });
+
+            //纭畾
+            form.on('submit(QueDin)', function (data) {
+                GetMeesageByBarCode();
+            });
+
+            //鎵潯鐮�
+            function GetMeesageByBarCode(obj) {
+                //浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
+                if ($("#HWHNAME").val() == '') {
+                    $("#HWHID").val("0");
+                }
+                if ($("#HStockPlaceName").val() == '') {
+                    $("#HStockPlaceID").val("0");
+                }
+                var sOldBarCode = $('#HBarCode').val()
+                var HDeleteFlag = sOldBarCode.substring(0, 1);
+                var sBarCode = sOldBarCode.slice(1);
+                if (sBarCode == null) {
+                    sBarCode = "";
+                }
+
+                var sInterID = $("#HInterID").val()
+                var sBillType = '1206'
+                var sBillNo = $("#HBillNo").val()
+                var sMaker = sessionStorage["HUserName"];
+                var sHWHID = $("#HWHID").val();//浠撳簱ID
+                var sHSPID = $("#HStockPlaceID").val();//浠撲綅ID
+                var sQty = $("#HQty").val()
+                if (sQty == "") {
+                    sQty = 0;
+                }
+                var sSourceBillNo = $("#HSourceBillNo").val()
+                if (sSourceBillNo == null) {
+                    sSourceBillNo = "";
+                }
+                var sHBillType = $("#HBillType").val()
+                var HScanStyle = $("#HScanStyle").val();
+
+                //鍒ゆ柇鏉$爜鏄惁涓虹┖  new
+                if (sBarCode == '') {
+                    playSound();
+                    layer.msg("鏉$爜涓虹┖锛屼笉鑳芥壂鎻忥紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                    return false;
+                }
+                if (HDeleteFlag == "*") {
+                    if (sBarCode != "") {
+                        $('#HBarCode').val("");
+                    }
+                    $.ajax(
+                        {
+                            type: "Get",
+                            url: GetWEBURL() + "/ProductIn/Delete_Json",
+                            async: true,
+                            data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": sBillType, "HBarCode": sBarCode },
+                            dataType: "json",
+                            success: function (data) {
+                                if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜�
+                                    playSound1();
+                                    //娓呯┖鏁伴噺
+                                    $("#HQty").val("");
+
+                                    //鏄剧ず琛ㄤ綋鏄庣粏
+                                    DisBillEntryList();
+
+                                    //table.reload('wl-table', {
+                                    //    where: { HBillID: sInterID, HBillType: '1206', sWhere: '' }
+                                    //});
+                                }
+                                else {
+                                    playSound();
+                                    layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+
+                                }
+                            },
+                            error: function (err) {
+                                playSound();
+                                layer.msg('閿欒' + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+
+                            }
+                        });
+                }
+                else if (HScanStyle == "鏁存墭鍒犻櫎") {
+                    var HBarCode = $('#HBarCode').val();
+                    var HInterID = $('#HInterID').val();
+                    if (HBarCode == "") {
+                        layer.msg("鏁存墭鍒犻櫎鏉$爜涓嶈兘涓虹┖", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                        return;
+                    }
+                    $.ajax(
+                        {
+                            type: "Get",
+                            url: GetWEBURL() + "/OtherOutBillList/OtherOutBillSDeleCode",
+                            async: true,
+                            data: { "HBarCode": HBarCode, "HInterID": HInterID },
+                            dataType: "json",
+                            success: function (data) {
+                                if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜�
+                                    layer.msg(data.Message, { icon: 1, btn: ['纭'], time: 100000, title: "娓╅Θ鎻愮ず" });
+                                    //娓呯┖鏁伴噺
+                                    $("#HQty").val("");
+
+                                    //鏄剧ず琛ㄤ綋鏄庣粏
+                                    DisBillEntryList();
+
+                                    //table.render({
+                                    //    elem: '#wl-table'
+                                    //    , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
+                                    //    , cellMinWidth: 80
+                                    //    //, toolbar: '#toolbarDemo'
+                                    //    , page: true
+                                    //    , limit: 100
+                                    //    , defaultToolbar: []
+                                    //    , where: { HBillID: sInterID, HBillType: '1206', sWhere: '' }
+                                    //    , cols: [[
+                                    //        { type: 'radio' }
+                                    //        , { field: 'HQty', title: '鏁伴噺', width: 80 }
+                                    //        , { field: 'HAuxQty', title: '杈呭姪鏁伴噺', width: 80 }
+                                    //        , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 80 }
+                                    //        , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 100 }
+                                    //        , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
+                                    //        , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 100 }
+                                    //        , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 100 }
+                                    //        , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 100 }
+                                    //        , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 100 }
+                                    //        //, { field: 'HBatchNo', title: '鎵规', width: 100 }
+                                    //        , { field: 'HAuxPropID', title: '杈呭姪灞炴��', width: 100 }
+                                    //        , { field: 'HMTONo', title: '璁″垝璺熻釜鍙�', width: 100 }
+                                    //        , { field: 'HWHID', title: 'ck', width: 100 }
+                                    //    ]]
+                                    //    //, height: 500
+                                    //})
+                                }
+                                else {
+                                    layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                                }
+                            },
+                            error: function (err) {
+                                layer.msg("閿欒" + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            }
+                        });
+                }
+                else {
+                    var sBarCode = $('#HBarCode').val()
+                    if (sBarCode != "") {
+                        $('#HBarCode').val("");
+                    }
+                    if (sQty != "") {
+                        $('#HQty').val("");
+                    }
+                    $.ajax({
+                        url: GetWEBURL() + "/WEBSController/Get_BarCode_Json",
+                        type: "GET",
+                        data: { "sBarCode": sBarCode, "HInterID": sInterID, "HBillType": sBillType, "HBillNo": sBillNo, "HMaker": sMaker, "HWhID": sHWHID, "HSPID": sHSPID, "HQty": sQty, "HRedBlueFlag": false, "SourceFlag": HSourceFlag, "HSourceBillNo": sSourceBillNo, "HSourceBillType": sHBillType, "HStockOrgID": HStockOrgID, "HScanStyle": HScanStyle, "HCustom1": "", "HCustom2": "" },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                if (result.data.hBarTypeField == '浠撳簱鏉$爜') {
+                                    $("#HWHNAME").val(result.data.hWhNameField);
+                                    $("#HWHID").val(result.data.hWhIDField);
+                                    $("#HStockPlaceName").val("");
+                                    $("#HNote").val(";涓�閿壂鐮佷粨搴撴潯鐮�");
+                                    element.tabChange('tab-Kf_OtherOutBill', '2');  //璺宠浆椤电
+                                    return;
+                                }
+                                else if (result.data.hBarTypeField == '浠撲綅鏉$爜') {
+                                    $("#HStockPlaceName").val(result.data.hSPNameField);
+                                    $("#HStockPlaceID").val(result.data.hSPIDField);
+                                    $("#HWHNAME").val(result.data.hWhNameField);
+                                    $("#HWHID").val(result.data.hWhIDField);
+                                    $("#HNote").val(";涓�閿壂鐮佷粨浣嶆潯鐮�");
+                                    element.tabChange('tab-Kf_OtherOutBill', '2');//璺宠浆椤电
+                                    return;
+                                }
+                                else if (result.data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+                                    $("#HDeptName").val(result.data.hDeptNameField);
+                                    $("#HDeptID").val(result.data.hDeptIDField);
+                                    $("#HNote").val(";涓�閿壂鐮侀儴闂ㄦ潯鐮�");
+                                    element.tabChange('tab-Kf_OtherOutBill', '2');//璺宠浆椤电
+                                    return;
+                                }
+                                else if (result.data.hBarTypeField == '婧愬崟鏉$爜') {
+                                    $("#HSupName").val(result.data.hSupNameField);
+                                    $("#HSupID").val(result.data.hSupIDField);
+                                    $("#HDeptName").val(result.data.hDeptNameField);
+                                    $("#HDeptID").val(result.data.hDeptIDField);
+                                    $("#HSourceBillNo").val(result.data.hSourceBillNoField);
+                                    sessionStorage["SourceFlag"] = true;
+                                    //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+                                    if (result.data.hSourceBillTypeField == "1206") {
+                                        $("#HBillType").val("1206");
+
+                                    }
+                                    else {
+                                        $("#HBillType").val("鎵嬪伐褰曞叆");
+                                    }
+                                    $("#HNote").val(";涓�閿壂鐮佹簮鍗曟潯鐮�");
+                                    element.tabChange('tab-Kf_OtherOutBill', '3');
+                                }
+                                else {
+                                    //if (HSourceFlag == "false") {
+                                    //    $("#HBillType").find("option:contains('鎵嬪伐褰曞叆')").attr("selected", true);
+                                    //    $("#HSourceBillNo").val("");
+
+                                    //    $("#HSourceBillNo").attr("readonly", "readonly");
+                                    //    $("#HBillType").attr("disabled", "disabled");
+                                    //    form.render('select');
+                                    //}
+                                    //HSourceFlag = true;
+                                    //element.tabChange('tab-Kf_OtherOutBill', '3');
+
+                                    if (HSourceFlag == true) {
+                                        element.tabChange('tab-Kf_OtherOutBill', '3');
+                                    }
+                                    else {
+                                        HSourceFlag = true;
+                                        $("#HSourceBillNo").val(result.data.hSourceBillNoField);
+                                        $("#HBillType").val(result.data.hSourceBillTypeField == null ? "1242" : result.data.hSourceBillTypeField);
+                                        //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+                                        if (result.data.hSourceBillTypeField == "1242") {
+                                            $("#HBillType").empty();
+                                            $("#HBillType").val("1242");
+                                            var optionHtml = '';
+                                            optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鍑哄簱鐢宠鍗�' + "</option>";
+                                            $("#HBillType").append(optionHtml);
+                                            layui.form.render('select');
+                                            $("#HBillType").attr("readonly", "readonly");
+                                        }
+                                        else {
+                                            //$("#HBillType").empty();
+                                            $("#HBillType").val("-1");
+                                            var optionHtml = '';
+                                            optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鎵嬪伐褰曞叆' + "</option>";
+                                            $("#HBillType").append(optionHtml);
+                                            layui.form.render('select');
+                                            $("#HBillType").attr("readonly", "readonly");
+                                        }
+                                        $("#HSourceBillNo").attr("readonly", "readonly");
+                                        element.tabChange('tab-Kf_OtherOutBill', '3');
+                                    }
+                                }
+                                layer.load(3)
+
+                                //鏄剧ず琛ㄤ綋鏄庣粏
+                                DisBillEntryList();
+
+                                //$.ajax({
+                                //    url: GetWEBURL() + '/WEBSController/GetBillEntryTmpList_Json',
+                                //    type: "GET",
+                                //    data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": sBillType, "HStockOrgID": HStockOrgID },
+                                //    success: function (result) {
+                                //        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                //            listOption.data = result.data.Materlist;
+                                //            table.render(listOption);
+                                //            FIFOlistOption.data = result.data.FIFOlist;
+                                //            table.render(FIFOlistOption);
+
+                                //            //console.log(result.data.list2);
+                                //            var count = 0;
+                                //            var count1 = 0;
+                                //            for (var i = 0; i < result.data.Materlist.length; i++) {
+                                //                count += result.data.Materlist[i].HQty;
+                                //                count1 += result.data.Materlist[i].HPieceQty;
+                                //            }
+                                //            $("#HSumQtys").val(count);
+                                //            $("#HBarcodeQtys").val(count1);
+                                //            //return;
+                                //        }
+                                //        else {
+                                //            layer.msg(result.Message);
+                                //        }
+                                //        layer.closeAll("loading");
+                                //    }
+                                //});
+                                playSound1();
+                                //娓呯┖鏁伴噺
+                                $("#HQty").val("");
+                            }
+                            else {
+                                playSound();
+                                layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            }
+                            layer.closeAll("loading");
+                        }
+                    });
+                }
             }
+
+            //#endregion
+
+
+            //#region 鏄剧ず鐗╂枡鍒楄〃淇℃伅
+
+            function DisBillEntryList() {
+                var sInterID = $("#HInterID").val()
+                var sBillNo = $("#HBillNo").val()
+                var HBillType = '1206'
+                var sHStockOrgID = sessionStorage["OrganizationID"];
+
+                //鍒锋柊鍒楄〃淇℃伅
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + '/WEBSController/GetBillEntryTmpList_Json',
+                    async: false,    //async鐢ㄤ簬鎺у埗锛坒alse锛夊悓姝ュ拰锛坱rue锛夊紓姝ワ紝榛樿鐨勬槸true锛屽嵆璇锋眰榛樿鐨勬槸寮傛璇锋眰
+                    data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": HBillType, "HStockOrgID": sHStockOrgID },
+                    success: function (result) {
+                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            listOption.data = result.data.Materlist;
+                            table.render(listOption);
+                            FIFOlistOption.data = result.data.FIFOlist;
+                            table.render(FIFOlistOption);
+
+                            //console.log(result.data.list2);
+                            var count = 0;
+                            var count1 = 0;
+                            for (var i = 0; i < result.data.Materlist.length; i++) {
+                                count += result.data.Materlist[i].HQty;
+                                count1 += result.data.Materlist[i].HPieceQty;
+                            }
+                            $("#HSumQtys").val(count);
+                            $("#HBarcodeQtys").val(count1);
+                            //return;
+                        }
+                        else {
+                            layer.msg(result.Message);
+                        }
+                    }
+                });
+            }
+
+            //#endregion
+
+
+            //function playSound() {
+            //    var audio = document.getElementById("cs");
+            //    if (audio == null)
+            //        $("body").append('<audio id="cs" hidden controls> <source src = "../../video/jingbao.wav" type = "audio/ogg"> </audio >');
+            //    var audio = document.getElementById("cs");
+            //    audio.play();
+            //}
+            ////鎵簮鍗�     鍘熻皟鐢ㄦ柟娉�
+            //function GetMeesageBySourceBillNo(obj) {
+            //    var HSourceBillNo = $('#HSourceBillNo').val()
+            //    var sInterID = $("#HInterID").val()
+            //    var sBillNo = $("#HBillNo").val()
+            //    var sMouldManagerCtl = "N";  //鏄惁鍚敤鍣ㄥ叿绠$悊
+            //    var sFIFOCtl = "N";          //鏄惁鍚敤鍏堣繘鍏堝嚭绠$悊
+            //    if (HSourceBillNo == "" || sInterID <= 0) {
+            //        layer.msg("婧愬崟鍙蜂负绌猴紝鎴栬�呭唴鐮佷笉瀛樺湪锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+            //        return;
+            //    }
+            //    //
+            //    $.ajax({
+            //        //url: "http://61.130.49.162:9090/WMSAPI///OtherOutBill/set_SavePonderationBillMain_Temp_Source_Fast_Json",
+            //        url: GetWEBURL() + "/OtherOutBill/set_SavePonderationBillMain_Temp_Source_Fast_Json",
+            //        type: "GET",
+            //        data: { "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },
+            //        success: function (result) {
+            //            if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+            //                layer.load(3)
+            //                table.render({
+            //                    elem: '#wl-table'
+            //                    // , url: 'http://61.130.49.162:9090/WMSAPI///OtherOutBill/DisBillEntryList_Webs_Json'
+            //                    , url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json1'
+            //                    , toolbar: '#toolbarDemo'
+            //                    , totalRow: true
+            //                    , where: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1206', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl }
+            //                    , cols: [[
+            //                        { type: 'radio' }
+            //                        , { field: 'HQty', title: '閲嶉噺', width: 150, totalRow: true}
+            //                        , { field: 'HAuxQty', title: '绠辨暟', width: 150, totalRow: true }
+            //                        , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 150 }
+            //                        , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
+            //                        , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
+            //                        , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
+            //                        , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
+            //                        , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
+            //                        , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
+            //                        , { field: 'HBatchNo', title: '鎵规', width: 150 }
+            //                        , { field: 'HPieceQty', title: '鏉$爜鏁伴噺', width: 150 }
+            //                    ]]
+            //                    // , data: [linterid]
+            //                    // , page: true
+            //                    , height: 500
+            //                    , done: function () {
+            //                        layer.closeAll("loading");
+            //                    }
+            //                });
+            //            }
+            //            else {
+            //                // $("#verifycode").click();
+            //                //layer.msg(result.Message, { icon: 5 });
+            //                layer.msg(result.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+            //            }
+            //            layer.closeAll("loading");
+            //        }
+            //    });
+            //}
+
         });
-        $('#HBarCode').on('keydown', function (event) {  //鎵潯鐮�
-            var sSubStr = table.cache['wl-table'];
-            var sBarCode = $('#HBarCode').val()
-            var sInterID = $("#HInterID").val()
-            var sBillNo = $("#HBillNo").val()
-            var sQty = $("#HQty").val()
-            var sHBillType = $("#HBillType").val()
-            var sHWHID = $("#HWHID").val()
-            var sHSPID = $("#HStockPlaceID").val()
-            var sSourceBillNo = $("#HSourceBillNo").val()
-            //var Flag = sessionStorage["SourceFlag"];
-            if (sQty == "") {
-                sQty = 0;
-            }
+
+        //浠ヤ笂涓篖ayUi妯″潡
+        function GetHFIFOWHNAMEValue(obj)  //杩斿洖鍏堣繘鍏堝嚭浠撳簱
+        {
+            $("#HFIFOWHNAME").val(obj[0].HName);
+            $("#HFIFOWHID").val(obj[0].HItemID);
+        }
+        function GetHWHValue(obj)  //杩斿洖浠撳簱
+        {
+            $("#HWHNAME").val(obj[0].HName);
+            //sessionStorage["HWHID"] = obj[0].HItemID;
+            $("#HWHID").val(obj[0].HItemID);
+        }
+        function GetHSpValue(obj) {  //杩斿洖璋冨叆浠撲綅
+            $("#HStockPlaceName").val(obj[0].HName);
+            $("#HStockPlaceID").val(obj[0].HItemID);
+            $("#HWHNAME").val(obj[0].HWhName);
+            $("#HWHID").val(obj[0].HWHID);
+        }
+        function GetHSupValue(obj) {  //杩斿洖瀹㈡埛
+            $("#HSupName").val(obj[0].HName);
+            $("#HSupID").val(obj[0].HItemID);
+        }
+        function GetHKeeperValue(obj) {  //杩斿洖淇濈
+            $("#HKeeper").val(obj[0].HName);
+            $("#HKeeperID").val(obj[0].HItemID);
+        }
+        function GetHSecManagerValue(obj) {  //杩斿洖楠屾敹
+            $("#HSecManager").val(obj[0].HName);
+            $("#HSecManagerID").val(obj[0].HItemID);
+        }
+        function GetHDeptNameValue(obj) {   //杩斿洖閮ㄩ棬
+            $("#HDeptName").val(obj[0].HName);
+            $("#HDeptID").val(obj[0].HItemID);
+        }
+        function AllowLoadData(sSubStr) {  //闈炵┖楠岃瘉
+            //鏁板瓧姝e垯(鍖呭惈灏忔暟)
+            var reg = /^\d+(\.\d+)?$/;
+            //if (reg.test($("#HQty").val()) == false || $("#HQty").val() == '') {
+            //    layer.msg("鏁伴噺蹇呴』涓烘暟閲忔垨灏忔暟", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+            //    return false;
+            //}
             //if ($("#HSourceBillNo").val() == '') {
             //    layer.msg("璇峰厛鎵簮鍗�!", { icon: 5 });
             //    return false;
             //}
-            //if ($("#HDeptName").val() == '') {
+            //if($("#HDeptName").val()=='')
+            //{
             //    layer.msg("閮ㄩ棬娌℃湁閫夋嫨!", { icon: 5 });
             //    return false;
             //}
             //if ($("#HSecManager").val() == '') {
-            //    layer.msg("鍙戞枡浜烘病鏈夐�夋嫨!", { icon: 5 });
+            //    layer.msg("楠屾敹浜烘病鏈夐�夋嫨!", { icon: 5 });
             //    return false;
             //}
             //if ($("#HKeeper").val() == '') {
-            //    layer.msg("棰嗘枡浜烘病鏈夐�夋嫨!", { icon: 5 });
+            //    layer.msg("淇濈浜烘病鏈夐�夋嫨!", { icon: 5 });
             //    return false;
             //}
             //if ($("#HSupName").val() == '') {
@@ -662,329 +1643,41 @@
             //    layer.msg("浠撳簱娌℃湁閫夋嫨!", { icon: 5 });
             //    return false;
             //}
-            if (event.keyCode == 13) {
-                if (sBarCode == '') {
-                    playSound();
-                    layer.msg("鏉$爜涓虹┖锛屼笉鑳芥壂鎻忥紒", { icon: 5, btn: ['纭畾'], time: 100000, offset: 't' });
-                    return false;
-                }
-                if (sBarCode != "") {
-                    $('#HBarCode').val("");
-                }
-                if (sQty != "") {
-                    $('#HQty').val("");
-                }
-                sessionStorage["SourceFlag"] = false;
-                //if (AllowLoadData(sSubStr, 'HBarCode') != false) {//闈炵┖楠岃瘉
-                $.ajax({
-                    url: GetWEBURL() + "/OtherOutBill/get_CheckTypeByBarCode_Out_Json",
-                    type: "GET",
-                    data: { "sCode": sBarCode, "sInterID": sInterID, "sBillNo": sBillNo, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": sessionStorage["SourceFlag"], "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"] },
-                    success: function (result) {
-                        if (result.count == 1) {
-                            if (result.data.HBarType == '浠撳簱鏉$爜') {
-                                $("#HWHNAME").val(result.data.HWhName);
-                                $("#HWHID").val(result.data.HWhID);
-                                $("#HStockPlaceName").val("");
-                                $("#HNote").val(";涓�閿壂鐮佷粨搴撴潯鐮�");
-                                element.tabChange('tab-Kf_OtherOutBill', '2');  //璺宠浆椤电
-                            }
-                            else if (result.data.HBarType == '浠撲綅鏉$爜') {
-                                $("#HStockPlaceName").val(result.data.HSPName);
-                                $("#HStockPlaceID").val(result.data.HSPID);
-                                $("#HWHNAME").val(result.data.HWhName);
-                                $("#HWHID").val(result.data.HWhID);
-                                $("#HNote").val(";涓�閿壂鐮佷粨浣嶆潯鐮�");
-                                element.tabChange('tab-Kf_OtherOutBill', '2');//璺宠浆椤电
-                            }
-                            else if (result.data.HBarType == '閮ㄩ棬鏉$爜') {
-                                $("#HDeptName").val(result.data.HDeptName);
-                                $("#HDeptID").val(result.data.HDeptID);
-                                $("#HNote").val(";涓�閿壂鐮侀儴闂ㄦ潯鐮�");
-                                element.tabChange('tab-Kf_OtherOutBill', '2');//璺宠浆椤电
-                            }
-                            else if (result.data.HBarType == '婧愬崟鏉$爜') {
-                                $("#HSupName").val(result.data.HSupName);
-                                $("#HSupID").val(result.data.HSupID);
-                                $("#HDeptName").val(result.data.HDeptName);
-                                $("#HDeptID").val(result.data.HDeptID);
-                                $("#HSourceBillNo").val(result.data.HSourceBillNo);
-                                sessionStorage["SourceFlag"] = true;
-                                //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
-                                if (result.data.HSourceBillType == "1206") {
-                                    $("#HBillType").val("1206");
-
-                                }
-                                else {
-                                    $("#HBillType").val("鎵嬪伐褰曞叆");
-                                }
-                                $("#HNote").val(";涓�閿壂鐮佹簮鍗曟潯鐮�");
-                                element.tabChange('tab-Kf_OtherOutBill', '3');
-                            }
-                            else {
-                                if (sessionStorage["SourceFlag"] == "true") {
-                                    element.tabChange('tab-Kf_OtherOutBill', '3');
-                                }
-                                else {
-                                    //$("#HSupName").val(result.data.HSupName);
-                                    //$("#HSupID").val(result.data.HSupID);
-                                    //$("#HDeptName").val(result.data.HDeptName);
-                                    //$("#HDeptID").val(result.data.HDeptID);
-                                    //$("#HSourceBillNo").val(result.data.HSourceBillNo);
-                                    sessionStorage["SourceFlag"] = true;
-                                    //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
-                                    if (result.data.HSourceBillType == "1206") {
-                                        $("#HBillType").val("1206");
-
-                                    }
-                                    else if (result.data.HSourceBillType == "1601") {
-                                        $("#HBillType").val("1601");
-                                    }
-                                    $("#HNote").val(";鐗╂枡鏉$爜");
-                                    element.tabChange('tab-Kf_OtherOutBill', '3');
-                                }
-                            }
-                            //$("#HSupID").val(result.data.HSupID);
-                            //$("#HSupName").val(result.data.HSupName);
-                            //$("#HDeptID").val(result.data.HDeptID);
-                            //$("#HDeptName").val(result.data.HDeptName);
-                            layer.load(3)
-                            table.render({
-                                elem: '#wl-table' 
-                                , url: GetWEBURL() + '/OtherOutBill/DisBillEntryList_Webs_Json'
-                          , toolbar: '#toolbarDemo'
-                          , where: { HBillID: sInterID, HBillType: '1206', sWhere: '' }
-                          , cellMinWidth: 90
-                          , cols: [[
-                              { type: 'radio' }
-                            , { field: 'HQty', title: '鏁伴噺', width: 150 }
-                            , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 150 }
-                            , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
-                            , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
-                            , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
-                            , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
-                            , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
-                            , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
-                            , { field: 'HBatchNo', title: '鎵规', width: 150 }
-                          ]]
-                                // , data: [linterid]
-                                // , page: true
-                          , height: 500
-                          , done: function () {
-                              layer.closeAll("loading");
-                          }
-                            });
-                        }
-                        else {
-                            // $("#verifycode").click();
-                            //layer.msg(result.Message, { icon: 5 });
-                            playSound();
-                            layer.msg(result.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
-                        }
-                        layer.closeAll("loading");
-                    }
-                });
-            }
-            //else
-            //{
-            //    layer.msg(result.Message, { icon: 5 });
-            //}
-            //layer.closeAll("loading");
-            //}
-        });
-
-        function playSound() {
-            var audio = document.getElementById("cs");
-            if (audio == null)
-                $("body").append('<audio id="cs" hidden controls> <source src = "../../video/jingbao.wav" type = "audio/ogg"> </audio >');
-            var audio = document.getElementById("cs");
-            audio.play();
-        }
-
-
-        $('#HSourceBillNo').on('keydown', function (event) {
-            var HSourceBillNo = $('#HSourceBillNo').val()
-            var sInterID = $("#HInterID").val()
-            var sBillNo = $("#HBillNo").val()
-            if (event.keyCode == 13) {
-                $.ajax({
-                    //url: "http://61.130.49.162:9090/WMSAPI///OtherOutBill/set_SavePonderationBillMain_Temp_Source_Fast_Json",
-                    url: GetWEBURL() + "/OtherOutBill/set_SavePonderationBillMain_Temp_Source_Fast_Json",
-                    type: "GET",
-                    data: { "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },
-                    success: function (result) {
-                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                            layer.load(3)
-                            table.render({
-                                elem: '#wl-table'
-                                // , url: 'http://61.130.49.162:9090/WMSAPI///OtherOutBill/DisBillEntryList_Webs_Json'
-                                 , url: GetWEBURL() + '/OtherOutBill/DisBillEntryList_Webs_Json'
-                              , toolbar: '#toolbarDemo'
-                              , where: { HBillID: sInterID, HBillType: '1206', sWhere: '' }
-                              , cols: [[
-                                  { type: 'radio' }
-                                , { field: 'HQty', title: '鏁伴噺', width: 150 }
-                                , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 150 }
-                                , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
-                                , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
-                                , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
-                                , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
-                                , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
-                                , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
-                                , { field: 'HBatchNo', title: '鎵规', width: 150 }
-                              ]]
-                                // , data: [linterid]
-                                // , page: true
-                              , height: 500
-                              , done: function () {
-                                  layer.closeAll("loading");
-                              }
-                            });
-                        }
-                        else {
-                            // $("#verifycode").click();
-                            //layer.msg(result.Message, { icon: 5 });
-                            layer.msg(result.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
-                        }
-                        layer.closeAll("loading");
-                    }
-                });
-               // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
-            }
-        });
-
-
-        $('#HStockPlaceName').on('keydown', function (event) {      //鎵粨浣�
-            var HBarCode = $('#HStockPlaceName').val()
-            if (event.keyCode == 13) {
-                //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
-                $.ajax({
-                    url: GetWEBURL() + "/Web/GetSpName_Json",
-                    type: "GET",
-                    data: { "HBarCode": HBarCode },
-                    success: function (result) {
-                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                            $("#HStockPlaceName").val(result.data[0].HName);
-                            $("#HWHID").val(result.data[0].HWHID);
-                            $("#HWHNAME").val(result.data[0].HWhName);
-                            element.tabChange('tab-POStockInBill', '2');
-                        }
-                        else {
-                            // $("#verifycode").click();
-                            //layer.msg(result.Message, { icon: 5 });
-                            layer.msg(result.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
-                        }
-                        layer.closeAll("loading");
-                    }
-                });
-                // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
-            }
-        });
-
-        table.render({
-            elem: '#mx-table'
-            // , url: 'http://localhost:8083/OtherOutBill/GetHBarCodeShowBillSub'
-            //, toolbar: '#toolbarDemo'
-            // , where: { sMsg: linterid, sMsg2: lentryid }
-         , cols: [[
-           , { field: 'HMaterID', title: '鐗╂枡ID', width: 100, hide: true }
-         ]]
-         , page: true
-         , height: 500
-         , done: function () {
-         }
-        });
-    });
-    function GetHWHValue(obj)  //杩斿洖浠撳簱
-    {
-        $("#HWHNAME").val(obj[0].HName);
-        //sessionStorage["HWHID"] = obj[0].HItemID;
-        $("#HWHID").val(obj[0].HItemID);
-    }
-    function GetHSpValue(obj) {  //杩斿洖璋冨叆浠撲綅
-        $("#HStockPlaceName").val(obj[0].HName);
-        $("#HStockPlaceID").val(obj[0].HItemID);
-    }
-    function GetHSupValue(obj) {  //杩斿洖渚涘簲鍟�
-        $("#HSupName").val(obj[0].HName);
-        $("#HSupID").val(obj[0].HItemID);
-    }
-    function GetHKeeperValue(obj) {  //杩斿洖淇濈
-        $("#HKeeper").val(obj[0].HName);
-        $("#HKeeperID").val(obj[0].HItemID);
-    }
-    function GetHSecManagerValue(obj) {  //杩斿洖楠屾敹
-        $("#HSecManager").val(obj[0].HName);
-        $("#HSecManagerID").val(obj[0].HItemID);
-    }
-    function GetHDeptNameValue(obj) {   //杩斿洖閮ㄩ棬
-        $("#HDeptName").val(obj[0].HName);
-        $("#HDeptID").val(obj[0].HItemID);
-    }
-    function AllowLoadData(sSubStr) {  //闈炵┖楠岃瘉
-        //if ($("#HSourceBillNo").val() == '') {
-        //    layer.msg("璇峰厛鎵簮鍗�!", { icon: 5 });
-        //    return false;
-        //}
-        //if($("#HDeptName").val()=='')
-        //{
-        //    layer.msg("閮ㄩ棬娌℃湁閫夋嫨!", { icon: 5 });
-        //    return false;
-        //}
-        //if ($("#HSecManager").val() == '') {
-        //    layer.msg("楠屾敹浜烘病鏈夐�夋嫨!", { icon: 5 });
-        //    return false;
-        //}
-        //if ($("#HKeeper").val() == '') {
-        //    layer.msg("淇濈浜烘病鏈夐�夋嫨!", { icon: 5 });
-        //    return false;
-        //}
-        //if ($("#HSupName").val() == '') {
-        //    layer.msg("渚涘簲鍟嗘病鏈夐�夋嫨!", { icon: 5 });
-        //    return false;
-        //}
-        //if ($("#HWHNAME").val() == '') {
-        //    layer.msg("浠撳簱娌℃湁閫夋嫨!", { icon: 5 });
-        //    return false;
-        //}
-        if ($("#HBillNo").val() == '') {
-            layer.msg("閿欒鐨勫崟鎹彿!", { icon: 5 });
-            return false;
-        }
-        if ($("#HInterID").val() == '') {
-            layer.msg("閿欒鐨勫唴鐮�!", { icon: 5 });
-            return false;
-        }
-        if(sSubStr=='')
-        {
-            layer.msg("娌℃湁鐗╂枡鏄庣粏璁板綍!", { icon: 5 });
-            return false;
-        }
-        if (sSubStr != '') {
-            for (var i = 0; i <= sSubStr.length - 1; i++) {  //鍒ゆ柇鎵爜鏁伴噺涓嶈兘澶т簬搴旀敹鏁伴噺
-                if (parseFloat(sSubStr[i].HQtyMust) > 0) {
-                    if (parseFloat(sSubStr[i].HQty) > parseFloat(sSubStr[i].HQtyMust))
-                    {
-                        layer.msg("鏁伴噺涓嶈兘澶т簬搴旀敹鏁伴噺锛�", { icon: 5 });
-                        return false;
-                    }
-                }
-            }
-            for (var i = 0; i <= sSubStr.length - 1; i++) {   //鍒ゆ柇鎵爜鏁伴噺涓嶈兘涓�0
-                if (parseFloat(sSubStr[i].HQty) > 0) {
-                    s = 1;
-                }
-            }
-            if (s == 0) {
-                layer.msg("鍏朵粬鍑哄簱璁板綍鏈壂鐮侊紒", { icon: 5 });
+            if ($("#HBillNo").val() == '') {
+                layer.msg("閿欒鐨勫崟鎹彿!", { icon: 5 });
                 return false;
             }
+            if ($("#HInterID").val() == '') {
+                layer.msg("閿欒鐨勫唴鐮�!", { icon: 5 });
+                return false;
+            }
+            if (sSubStr == '') {
+                layer.msg("娌℃湁鐗╂枡鏄庣粏璁板綍!", { icon: 5 });
+                return false;
+            }
+            if (sSubStr != '') {
+                for (var i = 0; i <= sSubStr.length - 1; i++) {  //鍒ゆ柇鎵爜鏁伴噺涓嶈兘澶т簬搴旀敹鏁伴噺
+                    if (parseFloat(sSubStr[i].HQtyMust) > 0) {
+                        if (parseFloat(sSubStr[i].HQty) > parseFloat(sSubStr[i].HQtyMust)) {
+                            layer.msg("鏁伴噺涓嶈兘澶т簬搴旀敹鏁伴噺锛�", { icon: 5 });
+                            return false;
+                        }
+                    }
+                }
+                for (var i = 0; i <= sSubStr.length - 1; i++) {   //鍒ゆ柇鎵爜鏁伴噺涓嶈兘涓�0
+                    if (parseFloat(sSubStr[i].HQty) > 0) {
+                        s = 1;
+                    }
+                }
+                if (s == 0) {
+                    layer.msg("鍏朵粬鍑哄簱璁板綍鏈壂鐮侊紒", { icon: 5 });
+                    return false;
+                }
+            }
+            else {
+                return true;
+            }
         }
-        else
-        {
-            return true;
-        }
-    }
     </script>
 
 </body>

--
Gitblit v1.9.1