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 |  392 +++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 287 insertions(+), 105 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 ad6f223..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"
@@ -9,7 +9,7 @@
     <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%;
         }
@@ -19,7 +19,7 @@
 <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>
@@ -40,21 +40,21 @@
                                     <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" autocomplete="off" class="layui-input">
+                                    <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" 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">
@@ -79,8 +79,9 @@
                                         </div>
                                         <div class="layui-col-xs8">
                                             <select name="HBillType" id="HBillType">
+                                                <option value="3714">宸ュ簭姹囨姤鍗�</option>
                                                 <option value="3711">鐢熶骇姹囨姤鍗�</option>
-                                                <option value="3710">鐢熶骇璁㈠崟</option>
+                                                <option value="3710" selected>鐢熶骇璁㈠崟</option>
                                             </select>
                                         </div>
                                     </div>
@@ -94,22 +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">
@@ -123,7 +134,7 @@
                                             <label class="layui-form-label" style="width:30px;padding-left:0px;">浠撲綅</label>
                                         </div>
                                         <div class="layui-col-xs6">
-                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" 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">
@@ -137,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">
@@ -151,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">
@@ -177,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">
@@ -199,13 +210,6 @@
                                     </div>
                                 </div>
                             </div>
-
-
-
-
-
-
-
                             <div class="layui-tab-item">
                                 <!--<div class="layui-form-item" style="padding:0px;margin:0px">
             <div class="layui-row">
@@ -239,7 +243,7 @@
                                 <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>
+                                            <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">
@@ -249,7 +253,7 @@
                                 <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>
+                                            <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">
@@ -316,9 +320,9 @@
                 , layer = layui.layer
                 , table = layui.table
                 , form = layui.form
+                , laydate = layui.laydate
                 , element = layui.element;
-
-
+            var HStockOrgID = sessionStorage["OrganizationID"]
             var option = [];
 
 
@@ -342,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() {
@@ -362,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 }
@@ -375,8 +391,8 @@
                 option = {
                     id: 'wl-table'
                     , elem: '#wl-table'
-                    , toolbar: '#toolbarDemo'
-                    , page: false
+                    //, toolbar: '#toolbarDemo'
+                    , page: true
                     , cellMinWidth: 120
                     , height: 500
                     , cols: [columns]
@@ -398,7 +414,7 @@
                 return vars;
             }
 
-            ////鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
+            //鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
             //if (sessionStorage.login != "login") {
             //    layer.confirm("鐧诲綍澶辨晥锛岃閲嶆柊鐧诲綍锛�", {
             //        icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍']
@@ -408,6 +424,17 @@
             var params = getUrlVars();
             var linterid = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
             var lSourceBillType = params[params[2]];  //浠庡崟鎹幏鍙� 婧愬崟绫诲瀷
+
+            //鍒濆鍖栬〃鍗曟彃浠�
+            set_InitFrom();
+
+            //鍒濆鍖栬〃鍗曟彃浠�
+            function set_InitFrom() {
+                //甯歌鐢ㄦ硶
+                laydate.render({
+                    elem: '#HDate'
+                });
+            }
 
             function RoadBillMain(linterid)//鍔犺浇琛ㄥご
             {
@@ -419,9 +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);
@@ -433,22 +492,15 @@
 
 
             function RoadBillSub(linterid)//鍔犺浇琛ㄤ綋
-            {
-                //var checkStatus = table.checkStatus('wl-table')
-                //    , data = checkStatus.data;
-                //var sInterID = $('#HInterID').val()
-                //var sBillNo = $("#HBillNo").val()
-                //var sMouldManagerCtl = 'N'
-                //var sFIFOCtl = 'N'
+            { 
 
                 $("#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: [[
@@ -461,10 +513,11 @@
                         , { 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");
@@ -517,6 +570,8 @@
                 //鑾峰彇鏈�澶у崟鎹彿 new
                 $("#HInterID").val("");
                 $("#HBillNo").val("");
+                $("#HBillType").val("3710");
+                form.render('select');
                 $.ajax({
                     url: GetWEBURL() + "/Web/GetMAXNumPDA",
                     type: "GET",
@@ -525,6 +580,7 @@
                         //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();
                     }
                 });
@@ -553,7 +609,6 @@
             //
             //
 
-            //閫夋嫨浠撳簱
             form.on('submit(HWHID-BT)', function () {//閫夋嫨浠撳簱
                 layer.open({
                     type: 2
@@ -562,13 +617,28 @@
                     , shade: 0.6 //閬僵閫忔槑搴�
                     , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
                     , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                    , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_WarehouseList.html?Type=HWHID', 'yes']
+                    , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_WarehouseListNew.html?Type=HWHID&HOrgID=' + HStockOrgID + '', '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_WarehouseList.html?Type=HWHID', 'yes']
+            //        , resize: false
+            //        , cancel: function () {
+            //            //$(".layui-btn").removeClass("layui-btn-disabled");
+            //        }
+            //    })
+            //});
 
             //閫夋嫨浠撲綅
             form.on('submit(HSpID-BT)', function () {//閫夋嫨浠撲綅
@@ -731,9 +801,11 @@
                             elem: '#wl-table'
                             //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
                             , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
-                            , toolbar: '#toolbarDemo'
+                            //, toolbar: '#toolbarDemo'
                             , defaultToolbar: []
                             , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
+                            , page: true
+                            , limit: 100
                             , cols: [[
                                 { type: 'radio' }
                                 , { field: 'HQty', title: '鏁伴噺', width: 150 }
@@ -744,7 +816,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: 'HBarcodeQtys', title: '鏉$爜鏁伴噺', width: 150 }
                             ]]
                             // , data: [linterid]
@@ -760,10 +832,12 @@
             });
 
             form.on('submit(Cancel)', function () {
-                parent.location.href = "../../../views/index.html"
+                layer.confirm('鎮ㄧ‘瀹氳閫�鍑哄悧锛�', { icon: 3, title: '鎻愮ず' }, function (index) {
+                    parent.location.href = "../../../views/index_Mobile.html";
+                });
             })
 
-            ////鍒犻櫎
+            //鍒犻櫎
             //form.on('submit(cmdDelete)', function () {//鍒犻櫎
             //    var checkStatus = table.checkStatus('wl-table')
             //        , data = checkStatus.data;
@@ -816,7 +890,7 @@
             //                        elem: '#wl-table'
             //                        //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
             //                        , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
-            //                        , toolbar: '#toolbarDemo'
+            //                        //, toolbar: '#toolbarDemo'
             //                        , defaultToolbar: []
             //                        , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
             //                        , cols: [[
@@ -929,7 +1003,7 @@
                 var sMainStr = JSON.stringify(data.field);
                 var sSubStr = table.cache['wl-table'];
                 //var sSourceType = $("#HBillType").val();
-                var sSourceType = "3711";
+                var sSourceType = "3714";
                 if (AllowLoadData(sSubStr) != false)//闈炵┖楠岃瘉
                 {
                     layer.load(3);
@@ -943,7 +1017,8 @@
                             dataType: "json",
                             success: function (data) {
                                 if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜�
-                                    layer.confirm("鐢熸垚浜у搧鍏ュ簱鍗�" + data.Message + $("#HBillNo").val(), {
+                                    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();鍏抽棴椤电
@@ -1072,6 +1147,40 @@
                 }
             });
 
+            //鎵粨搴�
+            $('#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'
@@ -1082,6 +1191,7 @@
                     , { field: 'HMaterID', title: '鐗╂枡ID', width: 100, hide: true }
                 ]]
                 , page: true
+                , limit: 100
                 , height: 500
                 , done: function () {
                 }
@@ -1105,10 +1215,13 @@
                 var sMouldManagerCtl = "N";  //鏄惁鍚敤鍣ㄥ叿绠$悊
                 var sFIFOCtl = "N";          //鏄惁鍚敤鍏堣繘鍏堝嚭绠$悊
                 if (HDeleteFlag == "*") {
-                    if (sBarCode != "") {
+                    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",
@@ -1120,11 +1233,12 @@
                                 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' }
@@ -1136,7 +1250,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: 'HBarcodeQtys', title: '鏉$爜鏁伴噺', width: 150 }
                                         ]]
                                         // , data: [linterid]
@@ -1146,6 +1260,8 @@
                                             layer.closeAll("loading");
                                         }
                                     })
+                                    //娓呯┖鏁伴噺
+                                    $("#HQty").val("");
                                 }
                                 else {
                                     playSound();
@@ -1186,48 +1302,85 @@
                     //if (AllowLoadData(sSubStr, 'HBarCode') != false) {//闈炵┖楠岃瘉
                     $.ajax({
                         //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/get_CheckTypeByBarCode_Json",
-                        url: GetWEBURL() + "/ProductIn/get_CheckTypeByBarCode_Json",
+                        url: GetWEBURL() + "/WEBSController/Get_BarCode_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"] },
+                        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;
-                            playSound1();
                             if (result.count == 1) {
-                                if (result.data.HBarType == '浠撳簱鏉$爜') {
-                                    $("#HWHNAME").val(result.data.HWhName);
-                                    $("#HWHID").val(result.data.HWhID);
+                                playSound1();
+                                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.HBarType == '浠撲綅鏉$爜') {
-                                    $("#HStockPlaceName").val(result.data.HSPName);
-                                    $("#HStockPlaceID").val(result.data.HSPID);
-                                    $("#HWHNAME").val(result.data.HWhName);
-                                    $("#HWHID").val(result.data.HWhID);
+                                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.HBarType == '閮ㄩ棬鏉$爜') {
-                                    $("#HDeptName").val(result.data.HDeptName);
-                                    $("#HDeptID").val(result.data.HDeptID);
+                                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.HBarType == '婧愬崟鏉$爜') {
-                                    $("#HSupName").val(result.data.HSupName);
-                                    $("#HSupID").val(result.data.HSupID);
-                                    $("#HDeptName").val(result.data.HDeptName);
-                                    $("#HDeptID").val(result.data.HDeptID);
+                                else if (result.data.hBarTypeField == '婧愬崟鏉$爜') {
+                                    if (result.data.hDeptIDField != 0) {
+                                        $("#HDeptID").val(result.data.hDeptIDField);
+                                        $("#HDeptName").val(result.data.hDeptNameField);
+                                    }
                                     $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                     HSourceFlag = true;
+                                    $("#HBillType").val(result.data.hSourceBillTypeField == null ? "3714" : result.data.hSourceBillTypeField);
                                     //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
-                                    //if (result.data.HSourceBillType == "3711") {
-                                    //    $("#HBillType").val("3711");
-                                    //}
-                                    //else {
-                                    //    $("#HBillType").val("-1");
-                                    //}
+                                    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');
                                 }
@@ -1237,12 +1390,16 @@
                                         $("#HSourceBillNo").attr("readonly", "readonly");
                                     }
                                     else {
-                                        $("#HSupName").val(result.data.HSupName);
-                                        $("#HSupID").val(result.data.HSupID);
+                                        //$("#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)
+                                        $("#HBillType").val(result.data.hSourceBillTypeField == null ? "3714" : result.data.hSourceBillTypeField);
                                         HSourceFlag = true;
                                         //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
                                         if (result.data.hSourceBillTypeField == "3711") {
@@ -1254,7 +1411,7 @@
                                             layui.form.render('select');
                                             $("#HBillType").attr("readonly", "readonly");
                                         }
-                                        if (result.data.hSourceBillTypeField == "3710") {
+                                        else if (result.data.hSourceBillTypeField == "3710") {
                                             $("#HBillType").empty();
                                             $("#HBillType").val("3710");
                                             var optionHtml = '';
@@ -1263,8 +1420,23 @@
                                             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").val("-1");
+                                            //$("#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(";鐗╂枡鏉$爜");
@@ -1280,7 +1452,7 @@
                                 //    elem: '#wl-table'
                                 //    //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
                                 //    , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
-                                //    , toolbar: '#toolbarDemo'
+                                //    //, toolbar: '#toolbarDemo'
                                 //    , defaultToolbar: []
                                 //    , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
                                 //    , cols: [[
@@ -1335,6 +1507,8 @@
                                         layer.closeAll("loading");
                                     }
                                 });
+                                //娓呯┖鏁伴噺
+                                $("#HQty").val("");
                             }
                             else {
                                 playSound();
@@ -1353,9 +1527,11 @@
 
             var listOption = {
                 elem: '#wl-table'
-                , toolbar: '#toolbarDemo'
+                //, toolbar: '#toolbarDemo'
                 , totalRow: true
                 , cellMinWidth: 90
+                , page: true
+                ,limit: 100
                 , cols: [[
                     { type: 'radio' }
                     , { field: 'HQty', title: '鏁伴噺', width: 150, totalRow: true}
@@ -1366,7 +1542,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: 'HPieceQty', title: '鏉$爜鏁伴噺', width: 150 }
                 ]]
                 , height: 500
@@ -1376,7 +1552,7 @@
             }
             var listOption1 = {
                 elem: '#mx-table'
-                , toolbar: '#toolbarDemo'
+                //, toolbar: '#toolbarDemo'
                 , cellMinWidth: 90
                 , cols: [[
                     { type: 'radio' }
@@ -1386,7 +1562,7 @@
                     , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
                     , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
                     , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
-                    , { field: 'HBatchNo', title: '鎵瑰彿', width: 150 }
+                    //, { field: 'HBatchNo', title: '鎵瑰彿', width: 150 }
                     //, { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
                     //, { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
                     , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
@@ -1412,34 +1588,41 @@
                 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[0].HDeptID != 0) {
-                                $("#HDeptID").val(result.data[0].HDeptID);
-                                $("#HDeptName").val(result.data[0].HDeptName);
+                            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'
+                                elem: '#wl-table' 
                                 , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
-                                , toolbar: '#toolbarDemo'
+                                //, toolbar: '#toolbarDemo'
                                 , totalRow: true
                                 , defaultToolbar: []
+                                , page: true
+                                , limit: 100
                                 , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
                                 , cols: [[
                                     { type: 'radio' }
@@ -1455,7 +1638,6 @@
                                     , { field: 'HPieceQty', title: '鏉$爜鏁伴噺', width: 150 }
                                 ]]
                                 // , data: [linterid]
-                                // , page: true
                                 , height: 500
                                 , done: function () {
                                     layer.closeAll("loading");

--
Gitblit v1.9.1