From 7df042662e1929abdd667cfd7b037f4e10e8c2ad Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期四, 14 三月 2024 11:27:56 +0800
Subject: [PATCH] 其他应付单 增加子表保存,目录放到采购管理,其他入库单编辑模块 并完善 其他出库单 列表功能;( 常规 功能, 新增,修改,删除,审核,作废,关闭,自定义过滤,源单类型列表(源单 手工录入), 合计行,保存控制,审核控制,删除控制,关联数回填 等等 ) (注: 基础资料选择, 均用 基础资料列表 的方式)

---
 WebTM/views/验收入库/产品入库/Kf_ProductInBill_Fast.html | 1896 +++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 1,211 insertions(+), 685 deletions(-)

diff --git "a/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\344\272\247\345\223\201\345\205\245\345\272\223/Kf_ProductInBill_Fast.html" "b/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\344\272\247\345\223\201\345\205\245\345\272\223/Kf_ProductInBill_Fast.html"
index c7a365b..a2bde86 100644
--- "a/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\344\272\247\345\223\201\345\205\245\345\272\223/Kf_ProductInBill_Fast.html"
+++ "b/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\344\272\247\345\223\201\345\205\245\345\272\223/Kf_ProductInBill_Fast.html"
@@ -1,19 +1,25 @@
 锘�<!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%;
+        }
+    </style>
 </head>
 
 <body>
     <div class="layui-fluid" style="padding:0">
         <div class="layui-card">
-            <div class="layui-card-body" style="padding: 5px; height:800px;">
+            <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>
@@ -26,34 +32,62 @@
                             <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 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">
+                                    <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 layui-col-xs12" lay-filter="tab-ProductlnBill">
                         <ul class="layui-tab-title" lay-filter="tab-all">
-                            <li lay-id="1" style="padding:1px;" class="layui-this">婧愬崟淇℃伅</li>
-                            <li lay-id="2" style="padding:1px;">鍗曟嵁淇℃伅</li>
+                            <li lay-id="1" style="padding:1px;">婧愬崟淇℃伅</li>
+                            <li lay-id="2" style="padding:1px;" class="layui-this">鍗曟嵁淇℃伅</li>
                             <li lay-id="3" style="padding:1px;">鐗╂枡娓呭崟</li>
                             <li lay-id="4" style="padding:1px;">鏄庣粏娓呭崟</li>
-                            <!--<li lay-id="5">鏃ュ織</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-tab-item ">
                                 <div class="layui-form-item">
+                                    <!--<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">
+                <input type="text" value="鐢熶骇璁㈠崟" name="HBillTypeCHN" id="HBillTypeCHN" lay-verify="HBillTypeCHN" autocomplete="off" class="layui-input" readonly>
+                <input type="hidden" value="3710" name="HBillType" id="HBillType" lay-verify="HBillType" autocomplete="off" class="layui-input">-->
+                                    <!--<input type="text" value="鐢熶骇姹囨姤鍗�" name="HBillTypeCHN" id="HBillTypeCHN" lay-verify="HBillTypeCHN" autocomplete="off" class="layui-input" readonly>
+            <input type=-->
+                                    <!--"hidden" value="3711" name="HBillType" id="HBillType" lay-verify="HBillType" autocomplete="off" class="layui-input">-->
+                                    <!--<select name="HBillType" id="HBillType">
+                <option value="3711">鐢熶骇姹囨姤鍗�</option>
+            </select>-->
+                                    <!--</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">
-                                            <input type="text" value="鐢熶骇璁㈠崟" name="HBillTypeCHN" id="HBillTypeCHN" lay-verify="HBillTypeCHN" autocomplete="off" class="layui-input" readonly>
-                                            <input type="hidden" value="3710" name="HBillType" id="HBillType" lay-verify="HBillType" autocomplete="off" class="layui-input">
-                                            <!--<input type="text" value="鐢熶骇姹囨姤鍗�" name="HBillTypeCHN" id="HBillTypeCHN" lay-verify="HBillTypeCHN" autocomplete="off" class="layui-input" readonly>
-                            <input type=-->
-                                            <!--"hidden" value="3711" name="HBillType" id="HBillType" lay-verify="HBillType" autocomplete="off" class="layui-input">-->
-                                            <!--<select name="HBillType" id="HBillType">
-                                <option value="3711">鐢熶骇姹囨姤鍗�</option>
-                            </select>-->
+                                            <select name="HBillType" id="HBillType">
+                                                <option value="3714">宸ュ簭姹囨姤鍗�</option>
+                                                <option value="3711">鐢熶骇姹囨姤鍗�</option>
+                                                <option value="3710" selected>鐢熶骇璁㈠崟</option>
+                                            </select>
                                         </div>
                                     </div>
+
+
+
                                 </div>
                                 <div class="layui-form-item">
                                     <div class="layui-row">
@@ -61,19 +95,32 @@
                                             <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">
+                                            <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>
+                                </div>
+                                <div class="layui-form-item">
+                                    <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">
+                                            <input name="HDate" id="HDate" autocomplete="off" class="layui-input">
                                         </div>
                                     </div>
                                 </div>
                             </div>
-                            <div class="layui-tab-item">
+                            <div class="layui-tab-item layui-show" >
                                 <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="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" autocomplete="off" class="layui-input" readonly>
+                                            <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">
@@ -87,11 +134,11 @@
                                             <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" autocomplete="off" class="layui-input">
+                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                             <input type="hidden" name="HStockPlaceID" id="HStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                         </div>
                                         <div class="layui-col-xs3">
-                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSpID-BT" style="display:none">...</button>
+                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSpID-BT" >...</button>
                                         </div>
                                     </div>
                                 </div>
@@ -101,7 +148,7 @@
                                             <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">
@@ -115,7 +162,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">
@@ -141,7 +188,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">
@@ -165,55 +212,83 @@
                             </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-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-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" 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:40px;padding-left:0px;">鏁伴噺</label>
+                </div>
+                <div class="layui-col-xs8">
+                    <input type="text" name="HQty" id="HQty" lay-verify="HQty" value="0" 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>
                             </div>
+
+                            <!--鏄庣粏娓呭崟-->
+                            <div class="layui-tab-item">
+                                <!-- <table class="layui-hide" id="mx-table" lay-filter="mx-table"></table>-->
+                                <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:50px;padding-left:0px;">鏉$爜鏁�</label>
+                                        </div>
+                                        <div class="layui-col-xs8">
+                                            <input type="text" name="HBarCodeQtys" id="HBarCodeQtys" lay-verify="HBarCodeQtys" 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-xs3">
+                                            <label class="layui-form-label" style="width:50px;padding-left:0px;">鎬绘暟閲�</label>
+                                        </div>
+                                        <div class="layui-col-xs8">
+                                            <input type="text" name="HSumQtys" id="HSumQtys" lay-verify="HSumQtys" autocomplete="off" class="layui-input">
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+
+
+
                             <div class="layui-tab-item">
                                 <table class="layui-hide" id="fj-table-qd" lay-filter="fj-table-qd"></table>
                             </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>-->
+                            <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>-->
                     </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="cmdDelete">鍒犻櫎</button>
                         <button type="button" lay-submit="" class="layui-btn" lay-filter="Cancel">閫�鍑�</button>
                     </div>
                     <div id="" style="display:none;">
@@ -241,13 +316,13 @@
             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;
-
-
+                , admin = layui.admin
+                , layer = layui.layer
+                , table = layui.table
+                , form = layui.form
+                , laydate = layui.laydate
+                , element = layui.element;
+            var HStockOrgID = sessionStorage["OrganizationID"]
             var option = [];
 
 
@@ -271,12 +346,24 @@
             $("#HMakerID").hide();
             $("#HBillerID").val(sessionStorage["HBillerID"]);
             $("#HBillerID").hide();
+            $("#HDate").val(formatDate(sessionStorage["HDate"]));
             var HSourceFlag = sessionStorage["SourceFlag"];
             //榛樿甯﹀叆鐨勪粨搴擄紝濡傛灉鍚敤浠撲綅鍒欎粨浣嶆湁鏁堬紝濡傛灉娌℃湁鍚敤鍒欎粨浣嶇伆搴� new
 
-            $("#HBarCode").focus();
+            $("#HWHNAME").focus();                 
 
+            // 缂栬緫鑾峰彇琛ㄥご鏃舵椂闂存牸寮忕煫姝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;
+
+                return [year, month, day].join('-');
+            }
 
             //鍒濆鍖栨槑缁嗚〃鏍�
             function set_InitGrid() {
@@ -291,7 +378,7 @@
                     , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
                     , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
                     , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
-                    , { field: 'HBatchNo', title: '鎵规', width: 150 }
+                    //, { field: 'HBatchNo', title: '鎵规', width: 150 }
                     , { field: 'HInterID', title: '鍗曟嵁ID', width: 150, hide: true }
                     , { field: 'HBilltype', title: '鍗曟嵁绫诲瀷', width: 150, hide: true }
                     , { field: 'Hbarcode', title: '鏉$爜缂栧彿', width: 150, hide: true }
@@ -304,8 +391,8 @@
                 option = {
                     id: 'wl-table'
                     , elem: '#wl-table'
-                    , toolbar: '#toolbarDemo'
-                    , page: false
+                    //, toolbar: '#toolbarDemo'
+                    , page: true
                     , cellMinWidth: 120
                     , height: 500
                     , cols: [columns]
@@ -328,17 +415,28 @@
             }
 
             //鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
-            if (sessionStorage.login != "login") {
-                layer.confirm("鐧诲綍澶辨晥锛岃閲嶆柊鐧诲綍锛�", {
-                    icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍']
-                }, function () { window.location.href = "../../user/login.html"; });
-            }
+            //if (sessionStorage.login != "login") {
+            //    layer.confirm("鐧诲綍澶辨晥锛岃閲嶆柊鐧诲綍锛�", {
+            //        icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍']
+            //    }, function () { window.location.href = "../../user/login.html"; });
+            //}
 
             var params = getUrlVars();
             var linterid = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
             var lSourceBillType = params[params[2]];  //浠庡崟鎹幏鍙� 婧愬崟绫诲瀷
-        
-            function  RoadBillMain(linterid)//鍔犺浇琛ㄥご
+
+            //鍒濆鍖栬〃鍗曟彃浠�
+            set_InitFrom();
+
+            //鍒濆鍖栬〃鍗曟彃浠�
+            function set_InitFrom() {
+                //甯歌鐢ㄦ硶
+                laydate.render({
+                    elem: '#HDate'
+                });
+            }
+
+            function RoadBillMain(linterid)//鍔犺浇琛ㄥご
             {
                 $.ajax({
                     url: GetWEBURL() + "/Web/GetPonderationBill",
@@ -348,8 +446,41 @@
                         // console.log(d.data);
                         $("#HInterID").val(d.data[0].HInterID);
                         $("#HBillNo").val(d.data[0].HBillNo);
-                        $("#HBillType").val(d.data[0].HSourceBillType);
+                        $("#HBillType").val(d.data[0].HSourceBillType == null ? "3714" : d.data[0].HSourceBillType);
+                        //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+                        if (d.data[0].HSourceBillType == "3711") {
+                            $("#HBillType").empty();
+                            $("#HBillType").val("3711");
+                            var optionHtml = '';
+                            optionHtml += "<option value = '" + d.data[0].HSourceBillType + "' >" + '鐢熶骇姹囨姤鍗�' + "</option>";
+                            $("#HBillType").append(optionHtml);
+                            layui.form.render('select');
+                            $("#HBillType").attr("readonly", "readonly");
+                        }
+                        else if (d.data[0].HSourceBillType == "3710") {
+                            $("#HBillType").empty();
+                            $("#HBillType").val("3710");
+                            var optionHtml = '';
+                            optionHtml += "<option value = '" + d.data[0].HSourceBillType + "' >" + '鐢熶骇璁㈠崟' + "</option>";
+                            $("#HBillType").append(optionHtml);
+                            layui.form.render('select');
+                            $("#HBillType").attr("readonly", "readonly");
+                        }
+                        else if (d.data[0].HSourceBillType == "3714") {
+                            $("#HBillType").empty();
+                            $("#HBillType").val("3714");
+                            var optionHtml = '';
+                            optionHtml += "<option value = '" + d.data[0].HSourceBillType + "' >" + '宸ュ簭姹囨姤鍗�' + "</option>";
+                            $("#HBillType").append(optionHtml);
+                            layui.form.render('select');
+                            $("#HBillType").attr("readonly", "readonly");
+                        }
+                        else {
+                            //$("#HBillType").val("-1");
+                        }
                         $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
+                        $("#HSourceBillNo").attr("disabled", "true");
+                        $("#HDate").val(formatDate(new Date(), "yyyy-MM-dd"));
                         //$("#HWHID").val(d.data[0].HWhID);
                         //$("#HStockPlaceID").val(d.data[0].HSPID);
                         //$("#HKeeperID").val(d.data[0].HKeeperID);
@@ -361,19 +492,19 @@
 
 
             function RoadBillSub(linterid)//鍔犺浇琛ㄤ綋
-            {
+            { 
+
                 $("#HInterID").val(linterid);//淇敼鏃朵富琛↖D
                 //缂栬緫鍔犺浇鏁版嵁
                 var sInterID = $("#HInterID").val();
                 table.render({
-                    elem: '#wl-table'
-                    //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
+                    elem: '#wl-table' 
                     , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
-                    , toolbar: '#toolbarDemo'
+                    //, toolbar: '#toolbarDemo'
                     , defaultToolbar: []
                     , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
                     , cols: [[
-                          { type: 'radio' }
+                        { type: 'radio' }
                         , { field: 'HQty', title: '鏁伴噺', width: 150 }
                         , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 150 }
                         , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
@@ -382,117 +513,168 @@
                         , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
                         , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
                         , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
-                        , { field: 'HBatchNo', title: '鎵规', width: 150 }
+                        //, { field: 'HBatchNo', title: '鎵规', width: 150 }
                     ]]
                     // , data: [linterid]
-                    // , page: true
+                    , page: true
+                    , limie: 100
                     , height: 500
                     , done: function () {
                         layer.closeAll("loading");
                     }
                 });
+
+
+
+
+                //$.ajax({
+                //    url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json',
+                //    type: "GET",
+                //    data: { HBillID: sInterID, HBillType: '1202', sWhere: '' },
+                //    success: function (result) {
+                //        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                //            listOption.data = result.data.list;
+                //            table.render(listOption);
+
+                //            //console.log(result.data.list2);
+                //            var count = 0;
+                //            var count1 = 0;
+                //            for (var i = 0; i < result.data.list.length; i++) {
+                //                count += result.data.list[i].HQty;
+                //                count1 += result.data.list[i].HPieceQty;
+                //            }
+                //            $("#HSumQtys").val(count);
+                //            $("#HBarCodeQtys").val(count1);
+                //            //return;
+                //        }
+                //        else {
+                //            layer.msg(result.Message);
+                //        }
+                //        layer.closeAll("loading");
+                //    }
+                //});
+
+
             }
-             
+
             //鍔ㄦ�佸姞杞芥簮鍗曠被鍨嬪垪琛� new
 
-            
 
-            
 
-            
+
+
+
 
             //鍒ゆ柇鏄惁鏂板
             if (linterid == null || linterid == 0) {
                 //鑾峰彇鏈�澶у崟鎹彿 new
                 $("#HInterID").val("");
-                $("#HBillNo").val(""); 
+                $("#HBillNo").val("");
+                $("#HBillType").val("3710");
+                form.render('select');
                 $.ajax({
-                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    url: GetWEBURL() + "/Web/GetMAXNumPDA",
                     type: "GET",
                     data: { "HBillType": '1202' },
                     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"));
                         set_InitGrid();
                     }
                 });
-            } 
+            }
             else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
                 RoadBillMain(linterid);
                 RoadBillSub(linterid);
             }
 
 
-        //杩涘叆鐗╂枡鏄庣粏椤电銆佹潯鐮佹 鍏夋爣鐒︾偣   new
-        //if (1 == 2)
-        //{
-        //    element.tabChange('tab-ProductlnBill', '3');
-        //    var pFocus = $("#HBarCode");
-        //    pFocus.focus();
-        //    pFocus.select();
-        //}
-        //else
-        //{
-        //    element.tabChange('tab-ProductlnBill', '1');
-        //    var pFocus = $("#HSourceBillNo");
-        //    pFocus.focus();
-        //    pFocus.select();
-        //}
-        //
-        //
+            //杩涘叆鐗╂枡鏄庣粏椤电銆佹潯鐮佹 鍏夋爣鐒︾偣   new
+            //if (1 == 2)
+            //{
+            //    element.tabChange('tab-ProductlnBill', '3');
+            //    var pFocus = $("#HBarCode");
+            //    pFocus.focus();
+            //    pFocus.select();
+            //}
+            //else
+            //{
+            //    element.tabChange('tab-ProductlnBill', '1');
+            //    var pFocus = $("#HSourceBillNo");
+            //    pFocus.focus();
+            //    pFocus.select();
+            //}
+            //
+            //
 
-        //閫夋嫨浠撳簱
-        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(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 () {
+                    }
+                })
+            });
+            //閫夋嫨浠撳簱
+            //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(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(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(HKeeperID-BT)', function () {//閫夋嫨淇濈
+            //閫夋嫨淇濈
+            //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(HKeeperID-BT)', function () {
                 layer.open({
                     type: 2//寮圭獥绫诲瀷
                     , skin: 'layui-layer-rim' //鍔犱笂杈规
@@ -516,25 +698,25 @@
             });
 
 
-        //閫夋嫨楠屾敹
-        //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(HSecManagerID-BT)', function (data) {//閫夋嫨楠屾敹
+            //閫夋嫨楠屾敹
+            //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(HSecManagerID-BT)', function (data) {
                 layer.open({
                     type: 2//寮圭獥绫诲瀷
                     , skin: 'layui-layer-rim' //鍔犱笂杈规
@@ -557,27 +739,48 @@
                 })
             });
 
-        //閫夋嫨閮ㄩ棬
-        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(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(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%']
+            //        , title: '鏄庣粏鍒楄〃'
+            //        , shade: 0.6 //閬僵閫忔槑搴�
+            //        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+            //        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+            //        , content: ['../../../views/鍏叡椤甸潰/Kf_BarCodeEditDlg.html?table=' + JSON.stringify(sSubStr), 'yes']
+            //        , resize: false
+            //        , cancel: function () {
+            //            //$(".layui-btn").removeClass("layui-btn-disabled");
+            //        }
+            //    })
+            //    // }
+            //});
+
+            form.on('submit(cmdModify)', function () {//缂栬緫
+                //var sSubStr = table.cache['wl-table'];
+                var checkStatus = table.checkStatus('wl-table')
+                    , data = checkStatus.data;
+                //if (AllowLoadData(sSubStr) != false) {//闈炵┖楠岃瘉
                 layer.open({
                     type: 2
                     , area: ['100%', '100%']
@@ -585,174 +788,418 @@
                     , shade: 0.6 //閬僵閫忔槑搴�
                     , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
                     , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                    , content: ['../../../views/鍏叡椤甸潰/Kf_BarCodeEditDlg.html?table=' + JSON.stringify(sSubStr), 'yes']
+                    , content: ['../../../views/鍏叡椤甸潰/Kf_BarCodeEditDlg.html?HInterID=' + data[0].HInterID + '&HMaterID =' + data[0].HMaterID + '&HBillType =' + data[0].HBillType, '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(cmdDelete)', function () {//鍒犻櫎
-            var checkStatus = table.checkStatus('wl-table')
-            , data = checkStatus.data;
-            var sInterID = $('#HInterID').val()
-            var sMaterID = data[0].HMaterID
-            var sBillType = '1202'
-            var sAuxPropID = data[0].HAuxPropID
-            //var sMTONo = data[0].HMTONo
-            var sMTONo = ''
-            var sSourceInterID = data[0].HSourceInterID
-            var sSourceEntryID = data[0].HSourceEntryID
-            var HBillNo = $("#HBillNo").val()
-            var sMouldManagerCtl = 'N'
-            var sFIFOCtl = 'N'
-            $.ajax(
-               {
-                   type: "Get",
-                   //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/Delete_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                    url: GetWEBURL() + "/ProductIn/Delete_Json_AN",
-                   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) { // 璇存槑楠岃瘉鎴愬姛浜�
-                         //  table.render({
-                         //      elem: '#wl-table'
-                         //      //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Mate_Webs_Json'
-                         //      , url: GetWEBURL() + '/ProductIn/DisPlayBarCodeList_Json'
-                         //, cellMinWidth: 80
-                         //, toolbar: '#toolbarDemo'
-                         //      , where: { HBillID: sInterID, HBillNo: HBillNo, HBillType: '1202', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl}
-                         //, 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 }
-                         //       , { field: 'HMaterID', title: '鐗╂枡ID', width: 100 }
-                         //]]
-                         //, height: 500
-                         //  })
-                           table.render({
-                               elem: '#wl-table'
-                               //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
-                               , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
-                               , toolbar: '#toolbarDemo'
-                               , defaultToolbar: []
-                               , where: { HBillID: sInterID, HBillType: '1202', 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 {
-                           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: "娓╅Θ鎻愮ず" });
-                   }
-               });
-        });
-
-        //鎻愪氦
-        form.on('submit(Saver)', function (data) {//鎻愪氦
-            //debugger;
-            if ($("#HExplanation").val() == "") {
-                if ($("#HWHNAME").val() == "瀹藉箙鎴愬搧浠揘EW" || $("#HWHNAME").val() == "鏍锋湰浠揘EW") {
-                    $("#HWHNAME").val("");
-                    $("#HWHID").val("");
-                    layer.msg("璇锋壂MES搴撲綅鐮侊紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                    return;
-                }
-                else
-                {
-                    $("#HExplanation").val($("#HWHNAME").val());
-                }
-            }
-            var sMainStr = JSON.stringify(data.field);
-            var sSubStr = table.cache['wl-table'];
-            //var sSourceType = $("#HBillType").val();
-            var sSourceType = "3711";
-            if (AllowLoadData(sSubStr) != false)//闈炵┖楠岃瘉
-            {
-                layer.load(3);
-                $.ajax(
-                {
-                    type: "POST",
-                    //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/set_SaveProductInBill_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                    url: GetWEBURL() + "/ProductIn/set_SaveProductInBill_Json",
-                    async: true,
-                    data: { "oMain": sMainStr  },
-                    dataType: "json",
-                    success: function (data) {
-                        if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜�
-                            layer.confirm("鐢熸垚浜у搧鍏ュ簱鍗�" + data.Message + $("#HBillNo").val(), {
-                                icon: 1, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['鏂板'],
-                                btn2: function () {
-                                    //parent.layui.admin.events.closeThisTabs();鍏抽棴椤电
-                                    //window.close();//鍏抽棴椤甸潰锛屾祻瑙堝櫒鏈夋晥锛孭DA鏃犳晥
-                                    parent.location.href = "../../../views/index.html"
-                                }//鍏抽棴
-                            }, function () { window.location.reload(); });//鏂板
-                        }
-                        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: "娓╅Θ鎻愮ず" });
+                    , end: function () {
+                        //鍒锋柊椤甸潰,
+                        //location.reload();
+                        var sInterID = $("#HInterID").val()
+                        table.render({
+                            elem: '#wl-table'
+                            //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
+                            , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
+                            //, toolbar: '#toolbarDemo'
+                            , defaultToolbar: []
+                            , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
+                            , page: true
+                            , limit: 100
+                            , 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 }
+                                , { field: 'HBarcodeQtys', title: '鏉$爜鏁伴噺', width: 150 }
+                            ]]
+                            // , data: [linterid]
+                            // , page: true
+                            , height: 500
+                            , done: function () {
+                                layer.closeAll("loading");
+                            }
+                        })
                     }
+                })
+                // }
+            });
+
+            form.on('submit(Cancel)', function () {
+                layer.confirm('鎮ㄧ‘瀹氳閫�鍑哄悧锛�', { icon: 3, title: '鎻愮ず' }, function (index) {
+                    parent.location.href = "../../../views/index_Mobile.html";
                 });
-                return false;
-            } 
-        });
+            })
 
-        //鐩戝惉鎻愪氦
-        form.verify({
-            numberOrEmpty: function (value, item) {
-                // if (value != '') {
-                if (!/^\d+$/.test(value)) {
-                    return '涓嶈兘涓虹┖鎴栨暟瀛楁垨鑰�0';
+            //鍒犻櫎
+            //form.on('submit(cmdDelete)', function () {//鍒犻櫎
+            //    var checkStatus = table.checkStatus('wl-table')
+            //        , data = checkStatus.data;
+            //    var sInterID = $('#HInterID').val()
+            //    var sMaterID = data[0].HMaterID
+            //    var sBillType = '1202'
+            //    var sAuxPropID = data[0].HAuxPropID
+            //    //var sMTONo = data[0].HMTONo
+            //    var sMTONo = ''
+            //    var sSourceInterID = data[0].HSourceInterID
+            //    var sSourceEntryID = data[0].HSourceEntryID
+            //    var HBillNo = $("#HBillNo").val()
+            //    var sMouldManagerCtl = 'N'
+            //    var sFIFOCtl = 'N'
+            //    $.ajax(
+            //        {
+            //            type: "Get",
+            //            //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/Delete_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+            //            url: GetWEBURL() + "/ProductIn/Delete_Json_AN",
+            //            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) { // 璇存槑楠岃瘉鎴愬姛浜�
+            //                    //  table.render({
+            //                    //      elem: '#wl-table'
+            //                    //      //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Mate_Webs_Json'
+            //                    //      , url: GetWEBURL() + '/ProductIn/DisPlayBarCodeList_Json'
+            //                    //, cellMinWidth: 80
+            //                    //, toolbar: '#toolbarDemo'
+            //                    //      , where: { HBillID: sInterID, HBillNo: HBillNo, HBillType: '1202', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl}
+            //                    //, 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 }
+            //                    //       , { field: 'HMaterID', title: '鐗╂枡ID', width: 100 }
+            //                    //]]
+            //                    //, height: 500
+            //                    //  })
+            //                    table.render({
+            //                        elem: '#wl-table'
+            //                        //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
+            //                        , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
+            //                        //, toolbar: '#toolbarDemo'
+            //                        , defaultToolbar: []
+            //                        , where: { HBillID: sInterID, HBillType: '1202', 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 {
+            //                    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: "娓╅Θ鎻愮ず" });
+            //            }
+            //        });
+            //});
+
+
+            //鍒犻櫎
+            form.on('submit(cmdDelete)', function () {//鍒犻櫎
+                var checkStatus = table.checkStatus('wl-table')
+                    , data = checkStatus.data;
+                var sInterID = $('#HInterID').val()
+                var sMaterID = data[0].HMaterID
+                var sBillType = '1202'
+                var sAuxPropID = data[0].HAuxPropID
+                //var sMTONo = data[0].HMTONo
+                var sMTONo = ''
+                var sSourceInterID = data[0].HSourceInterID
+                var sSourceEntryID = data[0].HSourceEntryID
+                var sBillNo = $("#HBillNo").val()
+                var sMouldManagerCtl = 'N'
+                var sFIFOCtl = 'N'
+                $.ajax(
+                    {
+                        type: "Get",
+                        //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/Delete_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        url: GetWEBURL() + "/ProductIn/Delete_Json_AN",
+                        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) { 
+                                $.ajax({
+                                    url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_New_Json1',
+                                    type: "GET",
+                                    data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1202', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
+                                    success: function (result) {
+                                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                            listOption.data = result.data.list;
+                                            table.render(listOption);
+
+                                            //console.log(result.data.list2);
+                                            var count = 0;
+                                            var count1 = 0;
+                                            for (var i = 0; i < result.data.list.length; i++) {
+                                                count += result.data.list[i].HQty;
+                                                count1 += result.data.list[i].HPieceQty;
+                                            }
+                                            $("#HSumQtys").val(count);
+                                            $("#HBarCodeQtys").val(count1);
+                                            //return;
+                                        }
+                                        else {
+                                            layer.msg(result.Message);
+                                        }
+                                        layer.closeAll("loading");
+                                    }
+                                });
+                            }
+                            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: "娓╅Θ鎻愮ず" });
+                        }
+                    });
+            });
+
+            //鎻愪氦
+            form.on('submit(Saver)', function (data) {//鎻愪氦
+                //debugger;
+                if ($("#HExplanation").val() == "") {
+                    if ($("#HWHNAME").val() == "瀹藉箙鎴愬搧浠揘EW" || $("#HWHNAME").val() == "鏍锋湰浠揘EW") {
+                        $("#HWHNAME").val("");
+                        $("#HWHID").val("");
+                        layer.msg("璇锋壂MES搴撲綅鐮侊紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                        return;
+                    }
+                    else {
+                        $("#HExplanation").val($("#HWHNAME").val());
+                    }
                 }
-                //}
-            }
-        });
+                var sMainStr = JSON.stringify(data.field);
+                var sSubStr = table.cache['wl-table'];
+                //var sSourceType = $("#HBillType").val();
+                var sSourceType = "3714";
+                if (AllowLoadData(sSubStr) != false)//闈炵┖楠岃瘉
+                {
+                    layer.load(3);
+                    $.ajax(
+                        {
+                            type: "POST",
+                            //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/set_SaveProductInBill_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                            url: GetWEBURL() + "/ProductIn/set_SaveProductInBill_Json",
+                            async: true,
+                            data: { "oMain": sMainStr },
+                            dataType: "json",
+                            success: function (data) {
+                                if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜�
+                                    layer.confirm(data.Message, {
+                                    //layer.confirm("鐢熸垚浜у搧鍏ュ簱鍗�" + data.Message + $("#HBillNo").val(), {
+                                        icon: 1, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['鏂板'],
+                                        btn2: function () {
+                                            //parent.layui.admin.events.closeThisTabs();鍏抽棴椤电
+                                            //window.close();//鍏抽棴椤甸潰锛屾祻瑙堝櫒鏈夋晥锛孭DA鏃犳晥
+                                            parent.location.href = "../../../views/index.html"
+                                        }//鍏抽棴
+                                    }, function () { window.location.reload(); });//鏂板
+                                }
+                                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;
+                }
+            });
 
-        //鎵潯鐮�
-            $('#HBarCode').on('keydown', function (event) {  //鎵潯鐮�
+            //鐩戝惉鎻愪氦
+            form.verify({
+                numberOrEmpty: function (value, item) {
+                    // if (value != '') {
+                    if (!/^\d+$/.test(value)) {
+                        return '涓嶈兘涓虹┖鎴栨暟瀛楁垨鑰�0';
+                    }
+                    //}
+                }
+            });
+
+            //鏉″舰鐮佸洖杞︽柟娉�
+            $('#HBarCode').on('keydown', function (event) {
+                var sQty = $("#HQty").val();
+                if (sQty == "") {
+                    sQty = 0;
+                }
+                if (event.keyCode == 13) {
+                    GetMeesageByBarCode();
+                }
+            });
+            //纭畾
+            form.on('submit(QueDin)', function (data) {
+                GetMeesageByBarCode();
+            });
+
+
+            //鎵簮鍗�
+            $('#HSourceBillNo').on('keydown', function (event) {
+                if (event.keyCode == 13) {
+                    GetMeesageBySourceBillNo();
+                }
+            });
+            //纭畾
+            form.on('submit(QueDin2)', function (data) {
+                GetMeesageBySourceBillNo();
+            });
+
+            //鎵粨浣�
+            $('#HStockPlaceName').on('keydown', function (event) {      //鎵粨浣�
+                var HBarCode = $('#HStockPlaceName').val()
+                if (event.keyCode == 13) {
+                    //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
+                    $.ajax({
+                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
+                        type: "GET",
+                        data: { "HBarCode": HBarCode },
+                        success: function (result) {
+                            if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                $("#HStockPlaceName").val(result.data[0].HName);
+                                $("#HStockPlaceID").val(result.data[0].HItemID);
+                                $("#HWHID").val(result.data[0].HWHID);
+                                $("#HWHNAME").val(result.data[0].HWhName);
+                                element.tabChange('tab-ProductlnBill', '2');
+                            }
+                            else {
+                                // $("#verifycode").click();
+                                //layer.msg(result.Message, { icon: 5 });
+                                layer.msg(result.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
+                            }
+                            layer.closeAll("loading");
+                        }
+                    });
+                }
+            });
+
+            //鎵玀ES浠撲綅
+            $('#HMESSPName').on('keydown', function (event) {      //鎵粨浣�
+                var HBarCode = $('#HMESSPName').val();
+                if (event.keyCode == 13) {
+                    //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
+                    $.ajax({
+                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
+                        type: "GET",
+                        data: { "HBarCode": HBarCode },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                $("#HMESSPID").val(result.data[0].HWHID);
+                                $("#HMESSPName").val(result.data[0].HWhName + "-" + result.data[0].HName);
+                                $("#HExplanation").val(result.data[0].HName + "-" + result.data[0].HWhName);
+                                $.ajax({
+                                    url: GetWEBURL() + "/LookingFor/GetSpNameMES_Json",
+                                    type: "GET",
+                                    data: { "HERPWHID": result.data[0].HWHID },
+                                    success: function (result) {
+                                        if (result.count == 1) {
+                                            $("#HWHID").val(result.data[0].HMESWHID);
+                                            $("#HWHNAME").val(result.data[0].HMESWHNAME);
+                                            $("#HMESSPName").attr("readonly", "readonly");//MES浠撲綅鍙HExplanation
+                                            $("#HMESSPName").css("background-color", "#efefef4d");
+                                        }
+                                        else {
+                                            layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                                        }
+                                        layer.closeAll("loading");
+                                    }
+                                });
+                            }
+                            else {
+                                layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            }
+                            layer.closeAll("loading");
+                        }
+                    });
+                }
+            });
+
+            //鎵粨搴�
+            $('#HWHNAME').on('keydown', function (event) {
+                var HBarCode = $('#HWHNAME').val()
+                if (event.keyCode == 13) {
+                    if (!HBarCode) {
+                        layer.msg('鏃犱粨搴撴潯鐮佷俊鎭紒');
+                        return;
+                    }
+                    //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
+                    $.ajax({
+                        url: GetWEBURL() + "/LookingFor/getWHName_Json",
+                        type: "GET",
+                        data: { "HBarCode": HBarCode },
+                        success: function (result) {
+                            if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                //$("#HStockPlaceName").val(result.data[0].HName);
+                                //$("#HStockPlaceID").val(result.data[0].HItemID);
+                                $("#HBarCode").focus();      
+                                $("#HWHID").val(result.data[0].HItemID);
+                                $("#HWHNAME").val(result.data[0].HName);
+                                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', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            }
+                            layer.closeAll("loading");
+                        }
+                    });
+                    // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
+                }
+            });
+
+            //鍒锋柊鏄庣粏椤电
+            table.render({
+                elem: '#mx-table'
+                // , url: 'http://61.130.49.162:9090/WMSAPI///Web/GetHBarCodeShowBillSub'
+                //, toolbar: '#toolbarDemo'
+                // , where: { sMsg: linterid, sMsg2: lentryid }
+                , cols: [[
+                    , { field: 'HMaterID', title: '鐗╂枡ID', width: 100, hide: true }
+                ]]
+                , page: true
+                , limit: 100
+                , height: 500
+                , done: function () {
+                }
+            });
+
+
+            //鎵潯鐮�
+            function GetMeesageByBarCode(obj) {  //杩斿洖宸ヤ綔涓績
                 var sOldBarCode = $('#HBarCode').val()
                 var HDeleteFlag = sOldBarCode.substring(0, 1);
                 var sBarCode = sOldBarCode.slice(1);
@@ -765,28 +1212,33 @@
                 var sHWHID = $("#HWHID").val()
                 var sHSPID = $("#HStockPlaceID").val()
                 var sSourceBillNo = $("#HSourceBillNo").val()
-                if (event.keyCode == 13) {
-                if (HDeleteFlag == "*")
-                {
-                    if (sBarCode != "") {
+                var sMouldManagerCtl = "N";  //鏄惁鍚敤鍣ㄥ叿绠$悊
+                var sFIFOCtl = "N";          //鏄惁鍚敤鍏堣繘鍏堝嚭绠$悊
+                if (HDeleteFlag == "*") {
+                    if (sBarCode == "") {
+                        layer.msg("璇锋壂鎻忚鍒犻櫎鐨勬潯鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                        return;
+                    }
+                    else {
                         $('#HBarCode').val("");
                     }
-                    var sBarCode = sOldBarCode.slice(1);
                     $.ajax(
                         {
                             type: "Get",
                             url: GetWEBURL() + "/ProductIn/Delete_Json",
                             async: true,
-                            data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": sBillType, "HBarCode": sBarCode},
+                            data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": sBillType, "HBarCode": sBarCode },
                             dataType: "json",
                             success: function (data) {
                                 if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜�
+                                    playSound1();
                                     table.render({
-                                        elem: '#wl-table'
-                                        //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
+                                        elem: '#wl-table' 
                                         , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
-                                        , toolbar: '#toolbarDemo'
+                                        //, toolbar: '#toolbarDemo'
                                         , defaultToolbar: []
+                                        , page: true
+                                        , limit: 100
                                         , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
                                         , cols: [[
                                             { type: 'radio' }
@@ -798,7 +1250,8 @@
                                             , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
                                             , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
                                             , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
-                                            , { field: 'HBatchNo', title: '鎵规', width: 150 }
+                                            //, { field: 'HBatchNo', title: '鎵规', width: 150 }
+                                            , { field: 'HBarcodeQtys', title: '鏉$爜鏁伴噺', width: 150 }
                                         ]]
                                         // , data: [linterid]
                                         // , page: true
@@ -807,12 +1260,16 @@
                                             layer.closeAll("loading");
                                         }
                                     })
+                                    //娓呯┖鏁伴噺
+                                    $("#HQty").val("");
                                 }
                                 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: "娓╅Θ鎻愮ず" });
                             }
                         });
@@ -825,285 +1282,370 @@
                     }
                     //鍒ゆ柇鏉$爜鏄惁涓虹┖  new
                     if (sBarCode == '') {
+                        playSound();
+                        layer.msg("鏉$爜涓虹┖锛屼笉鑳芥壂鎻忥紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                        return false;
+                    }
+                    if (sBarCode != "") {
+                        $('#HBarCode').val("");
+                    }
+                    if (sQty != "") {
+                        $('#HQty').val("");
+                    }
+                    if (sHWHID == "184154") {
+                        if (sHSPID == "0") {
                             playSound();
-                            layer.msg("鏉$爜涓虹┖锛屼笉鑳芥壂鎻忥紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            layer.msg("浠撲綅涓虹┖锛岃閫夋嫨浠撲綅锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                             return false;
                         }
-                        if (sBarCode != "") {
-                            $('#HBarCode').val("");
-                        }
-                        if (sQty != "") {
-                            $('#HQty').val("");
-                        }
-                        if (sHWHID == "184154") {
-                            if (sHSPID == "0") {
-                                layer.msg("浠撲綅涓虹┖锛岃閫夋嫨浠撲綅锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                                return false;
-                            }
-                        }
-                        //if (AllowLoadData(sSubStr, 'HBarCode') != false) {//闈炵┖楠岃瘉
-                        $.ajax({
-                            //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/get_CheckTypeByBarCode_Json",
-                            url: GetWEBURL() + "/ProductIn/get_CheckTypeByBarCode_Json",
-                            type: "GET",
-                            data: { "sCode": sBarCode, "sInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": HSourceFlag, "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"] },
-                            success: function (result) {
-                                //debugger;
+                    }
+                    //if (AllowLoadData(sSubStr, 'HBarCode') != false) {//闈炵┖楠岃瘉
+                    $.ajax({
+                        //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/get_CheckTypeByBarCode_Json",
+                        url: GetWEBURL() + "/WEBSController/Get_BarCode_Json",
+                        //url: GetWEBURL() + "/ProductIn/get_CheckTypeByBarCode_Json",  //鏃�
+                        type: "GET",
+                        data: { "sBarCode": sBarCode, "HInterID": sInterID, "HBillType": sBillType, "HBillNo": sBillNo, "HMaker": sessionStorage["HUserName"], "HWhID": sHWHID, "HSPID": sHSPID, "HQty": sQty, "HRedBlueFlag": false, "SourceFlag": HSourceFlag, "HSourceBillNo": sSourceBillNo, "HSourceBillType": sHBillType, "HStockOrgID": sessionStorage["OrganizationID"], "HScanStyle": '', "HCustom1": '', "HCustom2": '' },
+                        //data: { "sCode": sBarCode, "sInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": HSourceFlag, "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"] },  //鏃�
+                        success: function (result) {
+                            //debugger;
+                            if (result.count == 1) {
                                 playSound1();
-                                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-ProductlnBill', '2');  //璺宠浆椤电
+                                if (result.data.hBarTypeField == '浠撳簱鏉$爜') {
+                                    $("#HWHNAME").val(result.data.hWhNameField);
+                                    $("#HWHID").val(result.data.hWhIDField);
+                                    $("#HStockPlaceName").val("");
+                                    $("#HNote").val(";涓�閿壂鐮佷粨搴撴潯鐮�");
+                                    element.tabChange('tab-ProductlnBill', '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-ProductlnBill', '2');//璺宠浆椤电
+                                    return;
+                                }
+                                else if (result.data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+                                    $("#HDeptName").val(result.data.hDeptNameField);
+                                    $("#HDeptID").val(result.data.hDeptIDField);
+                                    $("#HNote").val(";涓�閿壂鐮侀儴闂ㄦ潯鐮�");
+                                    element.tabChange('tab-ProductlnBill', '2');//璺宠浆椤电
+                                    return;
+                                }
+                                else if (result.data.hBarTypeField == '婧愬崟鏉$爜') {
+                                    if (result.data.hDeptIDField != 0) {
+                                        $("#HDeptID").val(result.data.hDeptIDField);
+                                        $("#HDeptName").val(result.data.hDeptNameField);
                                     }
-                                    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-ProductlnBill', '2');//璺宠浆椤电
+                                    $("#HSourceBillNo").val(result.data.hSourceBillNoField);
+                                    HSourceFlag = true;
+                                    $("#HBillType").val(result.data.hSourceBillTypeField == null ? "3714" : result.data.hSourceBillTypeField);
+                                    //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+                                    if (result.data.hSourceBillTypeField == "3711") {
+                                        $("#HBillType").empty();
+                                        $("#HBillType").val("3711");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鐢熶骇姹囨姤鍗�' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
                                     }
-                                    else if (result.data.HBarType == '閮ㄩ棬鏉$爜') {
-                                        $("#HDeptName").val(result.data.HDeptName);
-                                        $("#HDeptID").val(result.data.HDeptID);
-                                        $("#HNote").val(";涓�閿壂鐮侀儴闂ㄦ潯鐮�");
-                                        element.tabChange('tab-ProductlnBill', '2');//璺宠浆椤电
+                                    else if (result.data.hSourceBillTypeField == "3710") {
+                                        $("#HBillType").empty();
+                                        $("#HBillType").val("3710");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鐢熶骇璁㈠崟' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
                                     }
-                                    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);
-                                        HSourceFlag = true;
-                                        //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
-                                        //if (result.data.HSourceBillType == "3711") {
-                                        //    $("#HBillType").val("3711");
-                                        //}
-                                        //else {
-                                        //    $("#HBillType").val("-1");
-                                        //}
-                                        $("#HNote").val(";涓�閿壂鐮佹簮鍗曟潯鐮�");
-                                        element.tabChange('tab-ProductlnBill', '3');
+                                    else if (result.data.hSourceBillTypeField == "3714") {
+                                        $("#HBillType").empty();
+                                        $("#HBillType").val("3714");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '宸ュ簭姹囨姤鍗�' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
                                     }
                                     else {
-                                        if (HSourceFlag == "true") {
-                                            element.tabChange('tab-ProductlnBill', '3');
-                                        }
-                                        else {
-                                            $("#HSupName").val(result.data.HSupName);
-                                            $("#HSupID").val(result.data.HSupID);
-                                            //$("#HDeptName").val(result.data.HDept);
-                                            //$("#HDeptID").val(result.data.HDeptID);
-                                            $("#HSourceBillNo").val(result.data.HSourceBillNo);
-                                            HSourceFlag = true;
-                                            //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
-                                            //if (result.data.HSourceBillType == "3711") {
-                                            //    $("#HBillType").val("3711");
-
-                                            //}
-
-                                            //else {
-                                            //    $("#HBillType").val("-1");
-                                            //}
-                                            $("#HNote").val(";鐗╂枡鏉$爜");
-                                            element.tabChange('tab-ProductlnBill', '3');
-                                        }
+                                        //$("#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");
                                     }
-                                    //$("#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: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
-                                        , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
-                                        , toolbar: '#toolbarDemo'
-                                        , defaultToolbar: []
-                                        , where: { HBillID: sInterID, HBillType: '1202', 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");
-                                        }
-                                    });
+                                    $("#HSourceBillNo").attr("readonly", "readonly");
+                                    $("#HNote").val(";涓�閿壂鐮佹簮鍗曟潯鐮�");
+                                    element.tabChange('tab-ProductlnBill', '3');
                                 }
                                 else {
-                                    playSound();
-                                    layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                                    if (HSourceFlag == true) {
+                                        element.tabChange('tab-ProductlnBill', '3');
+                                        $("#HSourceBillNo").attr("readonly", "readonly");
+                                    }
+                                    else {
+                                        //$("#HSupName").val(result.data.HSupName);
+                                        //$("#HSupID").val(result.data.HSupID);
+                                        //$("#HDeptName").val(result.data.HDept);
+                                        //$("#HDeptID").val(result.data.HDeptID);
+                                        if (result.data.hDeptIDField != 0) {
+                                            $("#HDeptID").val(result.data.hDeptIDField);
+                                            $("#HDeptName").val(result.data.hDeptNameField);
+                                        }
+                                        $("#HSourceBillNo").val(result.data.hSourceBillNoField);
+                                        $("#HBillType").val(result.data.hSourceBillTypeField == null ? "3714" : result.data.hSourceBillTypeField);
+                                        HSourceFlag = true;
+                                        //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+                                        if (result.data.hSourceBillTypeField == "3711") {
+                                            $("#HBillType").empty();
+                                            $("#HBillType").val("3711");
+                                            var optionHtml = '';
+                                            optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鐢熶骇姹囨姤鍗�' + "</option>";
+                                            $("#HBillType").append(optionHtml);
+                                            layui.form.render('select');
+                                            $("#HBillType").attr("readonly", "readonly");
+                                        }
+                                        else if (result.data.hSourceBillTypeField == "3710") {
+                                            $("#HBillType").empty();
+                                            $("#HBillType").val("3710");
+                                            var optionHtml = '';
+                                            optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鐢熶骇璁㈠崟' + "</option>";
+                                            $("#HBillType").append(optionHtml);
+                                            layui.form.render('select');
+                                            $("#HBillType").attr("readonly", "readonly");
+                                        }
+                                        else if (result.data.hSourceBillTypeField == "3714") {
+                                            $("#HBillType").empty();
+                                            $("#HBillType").val("3714");
+                                            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");
+                                        $("#HNote").val(";鐗╂枡鏉$爜");
+                                        element.tabChange('tab-ProductlnBill', '3');
+                                    }
                                 }
-                                layer.closeAll("loading");
-                            },
-                            error: function (err) {
-                                playSound();
-                                layer.msg("鎺ュ彛璇锋眰寮傚父:" + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                                console.log(err);
-                            }
-                        });
-                    }
-                }
-            });
+                                //$("#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: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
+                                //    , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
+                                //    //, toolbar: '#toolbarDemo'
+                                //    , defaultToolbar: []
+                                //    , where: { HBillID: sInterID, HBillType: '1202', 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");
+                                //    }
+                                //});
 
+                                $.ajax({
+                                    //url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json',
+                                    //type: "GET",
+                                    //data: { HBillID: sInterID, HBillType: '1202', sWhere: '' },
+
+                                    url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_New_Json1',
+                                    type: "GET",
+                                    data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1202', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
+                                    success: function (result) {
+                                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                            listOption.data = result.data.list;
+                                            table.render(listOption);
+                                            listOption1.data = result.data.list2;
+                                            table.render(listOption1);
+                                           
+                                            //console.log(result.data.list2);
+                                            var count = 0;
+                                            var count1 = 0;
+                                            for (var i = 0; i < result.data.list.length; i++) {
+                                                count += result.data.list[i].HQty;
+                                                count1 += result.data.list[i].HPieceQty;
+                                            }
+                                            $("#HSumQtys").val(count);
+                                            $("#HBarCodeQtys").val(count1);
+                                            //return;
+                                        }
+                                        else {
+                                            layer.msg(result.Message);
+                                        }
+                                        layer.closeAll("loading");
+                                    }
+                                });
+                                //娓呯┖鏁伴噺
+                                $("#HQty").val("");
+                            }
+                            else {
+                                playSound();
+                                layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            }
+                            layer.closeAll("loading");
+                        },
+                        error: function (err) {
+                            playSound();
+                            layer.msg("鎺ュ彛璇锋眰寮傚父:" + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            console.log(err);
+                        }
+                    });
+                }
+            }
+
+            var listOption = {
+                elem: '#wl-table'
+                //, toolbar: '#toolbarDemo'
+                , totalRow: true
+                , cellMinWidth: 90
+                , page: true
+                ,limit: 100
+                , 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: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
+                    //, { field: 'HBatchNo', title: '鎵规', width: 150 }
+                    , { field: 'HPieceQty', title: '鏉$爜鏁伴噺', width: 150 }
+                ]]
+                , height: 500
+                , done: function () {
+                    layer.closeAll("loading");
+                }
+            }
+            var listOption1 = {
+                elem: '#mx-table'
+                //, toolbar: '#toolbarDemo'
+                , cellMinWidth: 90
+                , cols: [[
+                    { type: 'radio' }
+                    , { field: 'HQty', title: '鏁伴噺', width: 150 }
+                    , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 150 }
+                    , { field: 'HBarCode', title: '鏉$爜缂栧彿', width: 150 }
+                    , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
+                    , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
+                    , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
+                    //, { field: 'HBatchNo', title: '鎵瑰彿', width: 150 }
+                    //, { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
+                    //, { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
+                    , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
+                ]]
+                , height: 500
+                , done: function () {
+                    layer.closeAll("loading");
+                }
+            }
 
             function playSound() {
                 console.log("playSound");
-                //var audio = document.getElementById("cs");
-                //$("appendAut").html("");
-                //if (audio == null)
-                //$("appendAut").append('<audio id="cs" hidden controls> <source src = "../../video/jingbao.wav" type = "audio/ogg"> </audio >');
-                //$("appendAut").attr("src","../../video/jingbao.wav")
                 var audio = document.getElementById("cs");
                 audio.play();
             }
-
             function playSound1() {
                 console.log("playSound1");
-                //var audio = document.getElementById("cs");
-                //$("appendAut").html("");
-                //if (audio == null)
-                //$("appendAut").append('<audio id="cs" hidden controls> <source src = "../../video/success.wav" type = "audio/ogg"> </audio >');
-                //$("appendAut").attr("src", "../../video/success.wav")
                 var audio = document.getElementById("cs2");
                 audio.play();
             }
-
-        //鎵簮鍗�
-        $('#HSourceBillNo').on('keydown', function (event) {   //鎵簮鍗�
-            var HSourceBillNo = $('#HSourceBillNo').val()
-            var sInterID = $("#HInterID").val()
-            var sBillNo = $("#HBillNo").val()
-            var HSourceBillType = $("#HBillType").val()
-            if (event.keyCode == 13) {
-                //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
+            //鎵簮鍗�
+            function GetMeesageBySourceBillNo(obj) {
+                var HSourceBillNo = $('#HSourceBillNo').val()
+                var sInterID = $("#HInterID").val()
+                var sBillNo = $("#HBillNo").val()
+                var sBillType = '1202'
+                var HSourceBillType = $("#HBillType").val()
                 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///ProductIn/set_SavePonderationBillMain_Temp_Source_Fast_Json",
-                    url: GetWEBURL() + "/ProductIn/set_SavePonderationBillMain_Temp_Source_Fast_Json",
+                $.ajax({ 
+                    url: GetWEBURL() + "/WEBSController/Get_SourceBarCode_ProductIn_Json",
+                    //url: GetWEBURL() + "/ProductIn/set_SavePonderationBillMain_Temp_Source_Fast_Json",    //鏃�
                     type: "GET",
-                    data: { "HSourceBillType": HSourceBillType, "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },
+                    data: { "HInterID": sInterID, "HBillNo": sBillNo, "HBillType": sBillType, "HSourceBillNo": HSourceBillNo, "HSourceBillType": HSourceBillType, "HMaker": sessionStorage["HUserName"], "HStockOrgID": sessionStorage["OrganizationID"] },
+                    //data: { "HSourceBillType": HSourceBillType, "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },    //鏃�
                     success: function (result) {
                         if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            if (result.data.hDeptIDField != 0) {
+                                $("#HDeptID").val(result.data.hDeptIDField);
+                                $("#HDeptName").val(result.data.hDeptNameField);
+                            }
+                            //if (result.data[0].HDeptID != 0) {
+                            //    $("#HDeptID").val(result.data[0].HDeptID);
+                            //    $("#HDeptName").val(result.data[0].HDeptName);
+                            //}
+                            playSound1();
                             HSourceFlag = true;
                             layer.load(3)
                             element.tabChange('tab-ProductlnBill', '2');
                             table.render({
-                                elem: '#wl-table'
-                                //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
-                              , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
-                                , toolbar: '#toolbarDemo'
+                                elem: '#wl-table' 
+                                , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
+                                //, toolbar: '#toolbarDemo'
+                                , totalRow: true
                                 , defaultToolbar: []
-                              , where: { HBillID: sInterID, HBillType: '1202', 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 }
-                              ]]
+                                , page: true
+                                , limit: 100
+                                , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
+                                , 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: '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 {
-                            layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                        }
-                        layer.closeAll("loading");
-                    }
-                });
-            }
-        });
-
-        //鎵粨浣�
-        $('#HStockPlaceName').on('keydown', function (event) {      //鎵粨浣�
-            var HBarCode = $('#HStockPlaceName').val()
-            if (event.keyCode == 13) {
-                //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
-                $.ajax({
-                    url: GetWEBURL() + "/LookingFor/getSpName_Json",
-                    type: "GET",
-                    data: { "HBarCode": HBarCode },
-                    success: function (result) {
-                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                            $("#HStockPlaceName").val(result.data[0].HName);
-                            $("#HStockPlaceID").val(result.data[0].HItemID);
-                            $("#HWHID").val(result.data[0].HWHID);
-                            $("#HWHNAME").val(result.data[0].HWhName);
-                            element.tabChange('tab-ProductlnBill', '2');
-                        }
-                        else {
-                            // $("#verifycode").click();
-                            //layer.msg(result.Message, { icon: 5 });
-                            layer.msg(result.Message, { icon: 5, btn: ['閫�鍑�'], time: 100000, offset: 't' });
-                        }
-                        layer.closeAll("loading");
-                    }
-                });
-            }
-        });
-
-        //鎵玀ES浠撲綅
-        $('#HMESSPName').on('keydown', function (event) {      //鎵粨浣�
-            var HBarCode = $('#HMESSPName').val();
-            if (event.keyCode == 13) {
-                //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
-                $.ajax({
-                    url: GetWEBURL() + "/LookingFor/getSpName_Json",
-                    type: "GET",
-                    data: { "HBarCode": HBarCode },
-                    success: function (result) {
-                        if (result.count == 1) {
-                            $("#HMESSPID").val(result.data[0].HWHID);
-                            $("#HMESSPName").val(result.data[0].HWhName + "-" + result.data[0].HName);
-                            $("#HExplanation").val(result.data[0].HName + "-" + result.data[0].HWhName);
-                            $.ajax({
-                                url: GetWEBURL() + "/LookingFor/GetSpNameMES_Json",
-                                type: "GET",
-                                data: { "HERPWHID": result.data[0].HWHID },
-                                success: function (result) {
-                                    if (result.count == 1) {
-                                        $("#HWHID").val(result.data[0].HMESWHID);
-                                        $("#HWHNAME").val(result.data[0].HMESWHNAME);
-                                        $("#HMESSPName").attr("readonly", "readonly");//MES浠撲綅鍙HExplanation
-                                        $("#HMESSPName").css("background-color", "#efefef4d");
-                                    }
-                                    else {
-                                        layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                                    }
+                                , height: 500
+                                , done: function () {
                                     layer.closeAll("loading");
                                 }
                             });
                         }
                         else {
+                            playSound();
                             layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                         }
                         layer.closeAll("loading");
@@ -1111,104 +1653,88 @@
                 });
             }
         });
-
-        //鍒锋柊鏄庣粏椤电
-        table.render({
-            elem: '#mx-table'
-            // , url: 'http://61.130.49.162:9090/WMSAPI///Web/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 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()=='')
+        //浠ヤ笂涓篖ayui妯″潡
+        function GetHWHValue(obj)  //杩斿洖璋冨叆浠撳簱
         {
-            layer.msg("閮ㄩ棬娌℃湁閫夋嫨", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-            return false;
+            $("#HWHNAME").val(obj[0].HName);
+            //sessionStorage["HWHID"] = obj[0].HItemID;
+            $("#HWHID").val(obj[0].HItemID);
         }
-        if ($("#HSecManager").val() == '') {
-            layer.msg("楠屾敹浜烘病鏈夐�夋嫨", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-            return false;
+        function GetHSpValue(obj) {  //杩斿洖璋冨叆浠撲綅
+            $("#HStockPlaceName").val(obj[0].HName);
+            $("#HStockPlaceID").val(obj[0].HItemID);
+            $("#HWHNAME").val(obj[0].HWhName);
+            $("#HWHID").val(obj[0].HWHID);
         }
-        if ($("#HKeeper").val() == '') {
-            layer.msg("淇濈浜烘病鏈夐�夋嫨", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-            return false;
+        function GetHKeeperValue(obj) {  //杩斿洖淇濈
+            $("#HKeeper").val(obj[0].HName);
+            $("#HKeeperID").val(obj[0].HItemID);
         }
-        //if ($("#HWHNAME").val() == '') {
-        //    layer.msg("浠撳簱娌℃湁閫夋嫨!", { icon: 5 });
-        //    return false;
-        //}
-        if ($("#HBillNo").val() == '') {
-            layer.msg("閿欒鐨勫崟鎹彿", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-            return false;
+        function GetHSecManagerValue(obj) {  //杩斿洖楠屾敹
+            $("#HSecManager").val(obj[0].HName);
+            $("#HSecManagerID").val(obj[0].HItemID);
         }
-        if ($("#HInterID").val() == '') {
-            layer.msg("閿欒鐨勫唴鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-            return false;
+        function GetHDeptNameValue(obj) {   //杩斿洖閮ㄩ棬
+            $("#HDeptName").val(obj[0].HName);
+            $("#HDeptID").val(obj[0].HItemID);
         }
-        if (typeof (sSubStr) == "undefined")
-        {
-            layer.msg("娌℃湁鐗╂枡鏄庣粏璁板綍", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-            return false;
-        }
-        if (!typeof (sSubStr) == "undefined") {
-            //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, btn: ['纭畾'], time: 100000, offset: 't' }); 
-            //            return false;
-            //        }
-            //    }
+        function AllowLoadData(sSubStr) {  //闈炵┖楠岃瘉
+            //if ($("#HSourceBillNo").val() == '') {
+            //    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, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+            if ($("#HDeptName").val() == '') {
+                layer.msg("閮ㄩ棬娌℃湁閫夋嫨", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                 return false;
             }
+            if ($("#HSecManager").val() == '') {
+                layer.msg("楠屾敹浜烘病鏈夐�夋嫨", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                return false;
+            }
+            if ($("#HKeeper").val() == '') {
+                layer.msg("淇濈浜烘病鏈夐�夋嫨", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                return false;
+            }
+            //if ($("#HWHNAME").val() == '') {
+            //    layer.msg("浠撳簱娌℃湁閫夋嫨!", { icon: 5 });
+            //    return false;
+            //}
+            if ($("#HBillNo").val() == '') {
+                layer.msg("閿欒鐨勫崟鎹彿", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                return false;
+            }
+            if ($("#HInterID").val() == '') {
+                layer.msg("閿欒鐨勫唴鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                return false;
+            }
+            if (typeof (sSubStr) == "undefined") {
+                layer.msg("娌℃湁鐗╂枡鏄庣粏璁板綍", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                return false;
+            }
+            if (!typeof (sSubStr) == "undefined") {
+                //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, btn: ['纭畾'], time: 100000, offset: 't' });
+                //            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, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                    return false;
+                }
+            }
+            else {
+                return true;
+            }
         }
-        else
-        {
-            return true;
-        }
-    }
     </script>
 
 </body>

--
Gitblit v1.9.1