From 81c6759dcee2dad7b63efdc87f660d4550d1572d Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期四, 30 十月 2025 09:49:58 +0800
Subject: [PATCH] excel导入送货物料信息

---
 WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_MaterialBarCodeBill.html |  200 ++++++++++++++++++++++++++-----------------------
 1 files changed, 107 insertions(+), 93 deletions(-)

diff --git a/WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_MaterialBarCodeBill.html b/WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_MaterialBarCodeBill.html
index a95613d..c2f00a5 100644
--- a/WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_MaterialBarCodeBill.html
+++ b/WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_MaterialBarCodeBill.html
@@ -40,9 +40,9 @@
                             <div class="layui-form-item">
                                 <div class="layui-row">
                                     <div class="layui-col-xs3">
-                                        <label class="layui-form-label"> 渚� 搴� 鍟嗭細</label>
+                                        <label class="layui-form-label"> 渚涘簲鍟嗕唬鐮侊細</label>
                                         <div class="layui-input-inline">
-                                            <input class="layui-input" name="HSupName" lay-verify="HSupName" id="HSupName" readonly="readonly" autocomplete="off">
+                                            <input class="layui-input" name="HSupNumber" lay-verify="HSupNumber" id="HSupNumber" readonly="readonly" autocomplete="off">
                                             <input id="HSupID" name="HSupID" type="hidden" />
                                         </div>
                                     </div>
@@ -50,9 +50,9 @@
                                         <label class="layui-form-label"> 渚� 搴� 鍟嗭細</label>
                                         <div class="layui-input-inline">
                                             <input class="layui-input" name="HSupName" lay-verify="HSupName" id="HSupName" readonly="readonly" autocomplete="off">
-                                            <input id="HSupName" name="HSupName" type="hidden" />
                                         </div>
                                     </div>
+                                </div>
                             </div>
 
                         </div>
@@ -64,11 +64,11 @@
                                 <div class="layui-tab-item layui-show">
                                     <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                                     <script type="text/html" id="toolbarDemo">
-                                        <div class="layui-btn-container">
+                                        <!--<div class="layui-btn-container">
                                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-add"><i class="layui-icon layui-icon-addition"></i>鎷嗗垎</button>
                                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_HideColumn"><i class="layui-icon layui-icon-addition"></i>鍒楄缃�</button>
                                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-del"><i class="layui-icon layui-icon-subtraction"></i>鍒犺</button>
-                                        </div>
+                                        </div>-->
                                     </script>
                                     <!-- 鏉$爜绫诲瀷涓嬫媺妗嗘ā鏉� -->
                                     <script type="text/html" id="barCodeTypeTpl">
@@ -166,6 +166,7 @@
                 , element = layui.element; //Tab鐨勫垏鎹㈠姛鑳斤紝鍒囨崲浜嬩欢鐩戝惉绛夛紝闇�瑕佷緷璧杄lement妯″潡
 
             var option;
+            //FetchSupInfo();
             option = {
                 elem: '#mainTable'
                 , toolbar: '#toolbarDemo'
@@ -176,24 +177,27 @@
                 , cols: [[
                     { type: 'checkbox', fixed: 'left' }
                     , { field: 'HMaterID', title: '鐗╂枡ID', width: 100, hide: true }
+                    , { field: 'HItemID', title: 'ID', width: 100, hide: true }
                     , { field: 'HMaterNumber', title: '鐗╂枡缂栫爜', width: 120 }
-/*                    , { field: 'HOldMaterNumber', title: '鏃х墿鏂欑紪鐮�', width: 120, hide: true }*/
+/*                   , { field: 'HOldMaterNumber', title: '鏃х墿鏂欑紪鐮�', width: 120, hide: true }*/
                     , { field: 'HMaterShortNumber', title: '鐗╂枡浠g爜', width: 120, hide: true }
-                   /* , { field: 'HSubjoin', title: '鐗╂枡浠g爜', width: 120, hide: true }*/
+                    , { field: 'HSubjoin', title: '鐗╂枡绠�绉�', width: 120, }
                     , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 120 }
                     , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 120 }
+                    , { field: 'HStatusMan', title: '宸ュ彿', width: 120, edit: 'text' }
                     , { field: 'HQty', title: '鏈鐢熸垚鏉$爜鏁伴噺', width: 135, edit: 'text', event: "inputHQty" }
-                    , { field: 'HMinQty', title: '鏍囧噯鍖呰鏁帮紙鍐呯瑁呯鏁帮級', width: 100, edit: 'text', event: "inputHMinQty" }
+                    , { field: 'HMinQty', title: '鏍囧噯鍖呰鏁帮紙鍐呯瑁呯鏁帮級', width: 100, event: "inputHMinQty" }
                     , { field: 'HBQty', title: '鏈�灏忓寘瑁呮暟锛堝唴绠辨暟锛�', width: 100 } 
                     , { field: 'biaoqianzhangshu', title: '鏍囩寮犳暟', width: 100 }
-                    , { field: 'HBatchNo', title: '鎵瑰彿', width: 100, edit: 'text' }
+                    , { field: 'HBatchNo', title: '鎵瑰彿', width: 100, edit: 'text', hide: true }
                     , { field: 'HBatchManager', title: '鍚敤鎵瑰彿', width: 100, hide: true }
                     , { field: 'HISKFPERIOD', title: '鏄惁鍚敤淇濊川鏈�', width: 100, edit: 'text', hide: true }
                     , { field: 'HEXPUNIT', title: '淇濊川鏈熷崟浣�', width: 100, edit: 'text', hide: true }
-                    , { field: 'HSourceBillType', title: '鏉$爜绫诲瀷', width: 100, templet: '#barCodeTypeTpl' }  
-                    , { field: 'HKFDate', title: '鐢熶骇鏃ユ湡', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }//, event: "chooseHKFDate"
-                    , { field: 'HKFPeriod', title: '淇濊川鏈�', width: 100,event:"inputHKFPeriod" }//
-                    , { field: 'HKFDQDate', title: '鍒版湡鏃ユ湡', align: 'center', width: 150, data_field: 'HKFDQDate' }//, event: "chooseHKFDQDate"
+                    , { field: 'HSourceBillType', title: '鏉$爜绫诲瀷', width: 100, templet: '#barCodeTypeTpl', hide: true }
+                    , { field: 'HKFDate', title: '鐢熶骇鏃ユ湡', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate", hide: true }//, event: "chooseHKFDate"
+                    , { field: 'HBarCodeDate', title: '鏉$爜鏃ユ湡', align: 'center', width: 150, data_field: 'HBarCodeDate', event: "chooseHBarCodeDate" }
+                    , { field: 'HKFPeriod', title: '淇濊川鏈�', width: 100, event: "inputHKFPeriod", hide: true }//
+                    , { field: 'HKFDQDate', title: '鍒版湡鏃ユ湡', align: 'center', width: 150, data_field: 'HKFDQDate', hide: true }//, event: "chooseHKFDQDate"
                     , { field: 'HSupID', title: '渚涘簲鍟咺D', width: 150, hide: true }
                     , { field: 'HSupName', title: '渚涘簲鍟嗗悕绉�', width: 150, hide: true }
                 ]]
@@ -233,18 +237,20 @@
                         , { field: 'HSubjoin', title: '鐗╂枡浠g爜', width: 120, hide: true }
                         , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 120 }
                         , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 120 }
+                        , { field: 'HStatusMan', title: '宸ュ彿', width: 120, edit: 'text'}
                         , { field: 'HQty', title: '鏈鐢熸垚鏉$爜鏁伴噺', width: 135, edit: 'text', event: "inputHQty" }
-                        , { field: 'HMinQty', title: '鏍囧噯鍖呰鏁帮紙鍐呯瑁呯鏁帮級', width: 100, edit: 'text', event: "inputHMinQty" }
+                        , { field: 'HMinQty', title: '鏍囧噯鍖呰鏁帮紙鍐呯瑁呯鏁帮級', width: 100, event: "inputHMinQty" }
                         , { field: 'HBQty', title: '鏈�灏忓寘瑁呮暟锛堝唴绠辨暟锛�', width: 100 }
                         , { field: 'biaoqianzhangshu', title: '鏍囩寮犳暟', width: 100 }
-                        , { field: 'HBatchNo', title: '鎵瑰彿', width: 100, edit: 'text' }
+                        , { field: 'HBatchNo', title: '鎵瑰彿', width: 100, edit: 'text', hide: true }
                         , { field: 'HBatchManager', title: '鍚敤鎵瑰彿', width: 100, hide: true }
                         , { field: 'HISKFPERIOD', title: '鏄惁鍚敤淇濊川鏈�', width: 100, edit: 'text', hide: true }
                         , { field: 'HEXPUNIT', title: '淇濊川鏈熷崟浣�', width: 100, edit: 'text', hide: true }
-                        , { field: 'HSourceBillType', title: '鏉$爜绫诲瀷', width: 100 }
-                        , { field: 'HKFDate', title: '鐢熶骇鏃ユ湡', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }//, event: "chooseHKFDate"
-                        , { field: 'HKFPeriod', title: '淇濊川鏈�', width: 100 }//
-                        , { field: 'HKFDQDate', title: '鍒版湡鏃ユ湡', align: 'center', width: 150, data_field: 'HKFDQDate' }//, event: "chooseHKFDQDate"
+                        , { field: 'HBarCodeDate', title: '鏉$爜鏃ユ湡', align: 'center', width: 150, data_field: 'HBarCodeDate', event: "chooseHBarCodeDate" }
+                        , { field: 'HSourceBillType', title: '鏉$爜绫诲瀷', width: 100, hide: true }
+                        , { field: 'HKFDate', title: '鐢熶骇鏃ユ湡', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate", hide: true }//, event: "chooseHKFDate"
+                        , { field: 'HKFPeriod', title: '淇濊川鏈�', width: 100, hide: true }//
+                        , { field: 'HKFDQDate', title: '鍒版湡鏃ユ湡', align: 'center', width: 150, data_field: 'HKFDQDate', hide: true}//, event: "chooseHKFDQDate"
                         , { field: 'HSupID', title: '渚涘簲鍟咺D', width: 150, hide: true }
                         , { field: 'HSupName', title: '渚涘簲鍟嗗悕绉�', width: 150, hide: true }
 
@@ -257,7 +263,6 @@
             else {
                 //鍚堝苟鏁伴噺鐢熸垚鏉$爜
                 layer.load(3);
-                FetchSupInfo();
                 $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                 $.ajax({
                     type: "GET",
@@ -270,13 +275,18 @@
                             var data = data.data;
                             var rowdata = [];
 
+                            $("#HSupID").val(data[0].HSupID);
+                            $("#HSupNumber").val(data[0].渚涘簲鍟嗕唬鐮�);
+                            $("#HSupName").val(data[0].渚涘簲鍟嗗悕绉�);
+
                             for (var i = 0; i < data.length; i++) {
                                 rowdata.push({
-                                    "HMaterID": data[i].HItemID,
+                                    "HMaterID": data[i].MaterID,
+                                    "HItemID": data[i].HItemID,
                                     "HMaterNumber": data[i].鐗╂枡浠g爜,
 /*                                    "HOldMaterNumber": "",*/
                                     "HMaterShortNumber": "",
-                                    /*"HSubjoin": "",*/
+                                    "HSubjoin": data[i].鐗╂枡绠�绉�,
                                     "HMaterName": data[i].鐗╂枡鍚嶇О,
                                     "HMaterModel": data[i].瑙勬牸鍨嬪彿,
                                     "HMinQty": data[i].鏍囧噯鍖呰鏁�,
@@ -288,10 +298,11 @@
                                     "HKFDQDate": data[i].鏈夋晥鏈�,
                                     "HKFDate": data[i].鐢熶骇鏃ユ湡,
                                     "HBatchManager": data[i].鏄惁鍚敤鎵瑰彿,
-                                    "HSupID": data[i].渚涘簲鍟嗕唬鐮�,
+                                    "HSupID": data[i].HSupID,
                                     "HSupName": data[i].渚涘簲鍟嗗悕绉�,
                                     "HEXPUNIT": data[i].淇濊川鏈熷崟浣�,
-                                    "HQty": 1, // 榛樿鐢熸垚鏉$爜鏁伴噺
+                                    "HQty": 0, // 榛樿鐢熸垚鏉$爜鏁伴噺
+                                    "HBarCodeDate": data[i].鏉$爜鏃ユ湡,
                                     "biaoqianzhangshu": 1 // 鏍囩寮犳暟
                                 });
                             }
@@ -393,6 +404,18 @@
                         }
                     });
                 }
+                else if (obj.event == 'chooseHBarCodeDate') {
+                    var field = $(this).data('field');
+                    laydate.render({
+                        elem: this.firstChild
+                        , show: true //鐩存帴鏄剧ず
+                        , closeStop: this
+                        , done: function (value, date) {
+                            data[field] = value;
+                            obj.update(data);
+                        }
+                    });
+                }
                 else if (obj.event == 'inputHKFPeriod') {
                     $(obj.tr).find(".layui-table-edit").keyup(function () {
                         var $input = $(this), val = $input.val();
@@ -411,7 +434,7 @@
                     
                 }
                 else if (obj.event == 'inputHMinQty') {
-                    var oldHMinQty = data.HMinQty;
+                    var $input = $(this), val = $input.val();
 
                     $(obj.tr).find(".layui-table-edit").keyup(function () {
                         var $input = $(this), val = $input.val();
@@ -487,10 +510,13 @@
                     }
                     if (HMinQty < HBQty) {
                         f_alert("鏍囧噯鍖呰鏁伴噺涓嶈兘灏忎簬鏈�灏忓寘瑁呮暟閲�!璇烽噸鏂拌緭鍏ワ紒")
-                        obj.update({
-                            HBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
-                        });
                         return;
+                    }
+                    else {
+                        obj.update({
+                            biaoqianzhangshu: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
+                        });
+
                     }
                     break;  
             }
@@ -517,7 +543,7 @@
 
                 var sMainStr = JSON.stringify(data.field);
                 var sSubStr = JSON.stringify(table.cache['mainTable']);
-                var sMainSub = sMainStr + ';' + sSubStr;
+                var sMainSub = sMainStr + ';' + sSubStr + ';' + sessionStorage["HUserName"] + ';' + sessionStorage["OrganizationID"];
                 var _sSubStr = JSON.parse(sSubStr);
                 for (var i = 0; i < _sSubStr.length; i++) {
                     if (_sSubStr[i].HQty > 0 && (_sSubStr[i].HMinQty == 0 || _sSubStr[i].HWXQty == 0)) {
@@ -530,6 +556,12 @@
                     //    layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,鏈鐢熸垚鏉$爜鏁伴噺涓嶈兘瓒呭嚭鏈敓鎴愭潯鐮佹暟閲�!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                     //    return Result = false;
                     //}
+
+                    if (_sSubStr[i].HQty == 0) {
+                        layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,鐢熸垚鏉$爜鏁伴噺涓嶈兘涓�0!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                        return Result = false;
+                    }
+
                     if (_sSubStr[i].HQty > 0 && _sSubStr[i].HISKFPERIOD == 1 && (/*_sSubStr[i].HBatchNo == "" ||*/ _sSubStr[i].HKFDate == "")) {
                         layer.msg("鏄庣粏璁板綍绗�" + (i + 1) + "琛�,鐢熶骇鏃ユ湡涓嶈兘涓虹┖!", { icon: 5, btn: ['纭'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                         return Result = false;
@@ -584,40 +616,50 @@
                                 var option_Success;
                                 option_Success = {
                                     elem: '#subTable'
-                                   // , url: GetWEBURL() + 'showHBarCodeBillDetail'  //h_v_Web_BarCodeBill_ForWeb1
+                                    // , url: GetWEBURL() + 'showHBarCodeBillDetail'  //h_v_Web_BarCodeBill_ForWeb1
                                     , toolbar: '#toolbarDemo1'
                                     , defaultToolbar: ['filter', 'exports']
+                                    , limit: 500
                                     , cols: [[
-                                        , { field: 'HBarCode', title: '鏉$爜', width: 100 }
+                                        { field: 'HLSH', title: '娴佹按鍙�', align: 'center', width: 150, data_field: 'HBarCodeDate' }
+                                        , { field: 'HBarCode', title: '鏉$爜', width: 230, ellipsis: true }
                                         , { field: 'HMaterID', title: '鐗╂枡ID', width: 100, hide: true }
+                                        , { field: 'HBarItemID', title: '鏉$爜ID', width: 100, hide: true }
                                         , { field: 'HMaterNumber', title: '鐗╂枡缂栫爜', width: 120 }
+                                        /*                                        , { field: 'LSH', title: '娴佹按鍙�', width: 120 }*/
                                         /*                    , { field: 'HOldMaterNumber', title: '鏃х墿鏂欑紪鐮�', width: 120, hide: true }*/
                                         , { field: 'HMaterShortNumber', title: '鐗╂枡浠g爜', width: 120, hide: true }
-                                        /* , { field: 'HSubjoin', title: '鐗╂枡浠g爜', width: 120, hide: true }*/
-                                        , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 120 }
+                                        , { field: 'HSubjoin', title: '鐗╂枡绠�绉�', width: 120 }
+                                        , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 120, hide: true }
                                         , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 120 }
+                                        , { field: 'HStatusMan', title: '宸ュ彿', width: 120 }
                                         , { field: 'HQty', title: '鏈鐢熸垚鏉$爜鏁伴噺', width: 135 }
                                         , { field: 'HMinQty', title: '鏍囧噯鍖呰鏁帮紙鍐呯瑁呯鏁帮級', width: 100 }
                                         , { field: 'HBQty', title: '鏈�灏忓寘瑁呮暟锛堝唴绠辨暟锛�', width: 100 }
                                         , { field: 'biaoqianzhangshu', title: '鏍囩寮犳暟', width: 100 }
-                                        , { field: 'HBatchNo', title: '鎵瑰彿', width: 100 }
+                                        , { field: 'HBarCodeDate', title: '鏉$爜鏃ユ湡', align: 'center', width: 150, data_field: 'HBarCodeDate' }
+                                        , { field: 'HBatchNo', title: '鎵瑰彿', width: 100, hide: true }
                                         , { field: 'HBatchManager', title: '鍚敤鎵瑰彿', width: 100, hide: true }
                                         , { field: 'HISKFPERIOD', title: '鏄惁鍚敤淇濊川鏈�', width: 100, hide: true }
                                         , { field: 'HEXPUNIT', title: '淇濊川鏈熷崟浣�', width: 100, hide: true }
-                                        , { field: 'HSourceBillType', title: '鏉$爜绫诲瀷', width: 100 }
-                                        , { field: 'HKFDate', title: '鐢熶骇鏃ユ湡', align: 'center', width: 150 }//, event: "chooseHKFDate"
-                                        , { field: 'HKFPeriod', title: '淇濊川鏈�', width: 100 }//
-                                        , { field: 'HKFDQDate', title: '鍒版湡鏃ユ湡', align: 'center', width: 150 }//, event: "chooseHKFDQDate"
+                                        , { field: 'HSourceBillType', title: '鏉$爜绫诲瀷', width: 100, hide: true }
+                                        , { field: 'HKFDate', title: '鐢熶骇鏃ユ湡', align: 'center', width: 150, hide: true }//, event: "chooseHKFDate"
+                                        , { field: 'HKFPeriod', title: '淇濊川鏈�', width: 100, hide: true }//
+                                        , { field: 'HKFDQDate', title: '鍒版湡鏃ユ湡', align: 'center', width: 150, hide: true }//, event: "chooseHKFDQDate"
                                         , { field: 'HSupID', title: '渚涘簲鍟咺D', width: 150, hide: true }
                                         , { field: 'HSupName', title: '渚涘簲鍟嗗悕绉�', width: 150, hide: true }
 
                                     ]]
                                 }
+                                //#region ADD
+                                var barcodes = data.data;
+
+                                // 灏嗘潯鐮佸垪琛ㄨ浆鎹负閫楀彿鍒嗛殧鐨勫瓧绗︿覆
+                                //var barcodeStr = barcodes.join('~');
                                 $.ajax({
                                     type: "GET",
-                                    url: GetWEBURL() + "/showHBarCodeBillDetail",
-                                    async: true,
-                                    data: { sMsg: lentryid },
+                                    url: GetWEBURL() + "/GetBarcodeDetails",
+                                    data: { barcodes: barcodes },
                                     dataType: "json",
                                     success: function (data_1) {
                                         if (data_1.count != 0) {
@@ -625,48 +667,18 @@
                                             var rowdata_1 = [];
 
                                             for (var i = 0; i < data.length; i++) {
-                                                var totalQty = data[i].鐢熸垚鏉$爜鏁伴噺; // 鎬绘潯鐮佹暟
-                                                var standardQty = data[i].鏍囧噯鍖呰鏁�; // 鏍囧噯鍖呰鏁�
-                                                var labelCount = Math.ceil(totalQty / standardQty); // 璁$畻鏍囩鏁�
-
-                                                // 鐢熸垚鍓峮-1涓爣鍑嗘爣绛�
-                                                for (var j = 0; j < labelCount - 1; j++) {
-                                                    rowdata_1.push({
-                                                        "HMaterID": data[i].HItemID,
-                                                        "HBarCode": data[i].HBarCode,
-                                                        "HMaterNumber": data[i].鐗╂枡浠g爜,
-                                                        "HMaterShortNumber": "",
-                                                        "HMaterName": data[i].鐗╂枡鍚嶇О,
-                                                        "HMaterModel": data[i].瑙勬牸鍨嬪彿,
-                                                        "HMinQty": standardQty,
-                                                        "HBQty": data[i].鏈�灏忓寘瑁呮暟,
-                                                        "HSourceBillType": data[i].鏉$爜绫诲瀷,
-                                                        "HBatchNo": data[i].鎵瑰彿,
-                                                        "HISKFPERIOD": data[i].鏄惁鍚敤淇濊川鏈� == null ? 0 : data[i].鏄惁鍚敤淇濊川鏈�,
-                                                        "HKFPeriod": data[i].淇濊川鏈� == null ? 0 : data[i].淇濊川鏈�,
-                                                        "HKFDQDate": data[i].鏈夋晥鏈�,
-                                                        "HKFDate": data[i].鐢熶骇鏃ユ湡,
-                                                        "HBatchManager": data[i].鏄惁鍚敤鎵瑰彿,
-                                                        "HSupID": data[i].渚涘簲鍟嗕唬鐮�,
-                                                        "HSupName": data[i].渚涘簲鍟嗗悕绉�,
-                                                        "HEXPUNIT": data[i].淇濊川鏈熷崟浣�,
-                                                        "HQty": standardQty, // 鏍囧噯鍖呰鏁�
-                                                        "biaoqianzhangshu": 1
-                                                    });
-                                                }
-
-                                                // 鐢熸垚鏈�鍚庝竴涓爣绛撅紙浣欐暟锛�
-                                                var lastQty = totalQty % standardQty;
-                                                if (lastQty === 0) lastQty = standardQty; // 濡傛灉鏁撮櫎锛屾渶鍚庝竴涓篃鏄爣鍑嗗寘瑁呮暟
 
                                                 rowdata_1.push({
-                                                    "HMaterID": data[i].HItemID,
+                                                    "HMaterID": data[i].HMaterID,
+                                                    "HBarItemID": data[i].HBarItemID,
+                                                    /*                                                        "LSH": data[i].HBarItemID,*/
                                                     "HBarCode": data[i].HBarCode,
                                                     "HMaterNumber": data[i].鐗╂枡浠g爜,
                                                     "HMaterShortNumber": "",
+                                                    "HSubjoin": data[i].鐗╂枡绠�绉�,
                                                     "HMaterName": data[i].鐗╂枡鍚嶇О,
                                                     "HMaterModel": data[i].瑙勬牸鍨嬪彿,
-                                                    "HMinQty": standardQty,
+                                                    "HMinQty": data[i].鏍囧噯鍖呰鏁�,
                                                     "HBQty": data[i].鏈�灏忓寘瑁呮暟,
                                                     "HSourceBillType": data[i].鏉$爜绫诲瀷,
                                                     "HBatchNo": data[i].鎵瑰彿,
@@ -675,32 +687,33 @@
                                                     "HKFDQDate": data[i].鏈夋晥鏈�,
                                                     "HKFDate": data[i].鐢熶骇鏃ユ湡,
                                                     "HBatchManager": data[i].鏄惁鍚敤鎵瑰彿,
-                                                    "HSupID": data[i].渚涘簲鍟嗕唬鐮�,
+                                                    "HSupID": data[i].HSupID,
                                                     "HSupName": data[i].渚涘簲鍟嗗悕绉�,
                                                     "HEXPUNIT": data[i].淇濊川鏈熷崟浣�,
-                                                    "HQty": lastQty, // 鏈�鍚庝竴涓爣绛剧殑鏁伴噺
-                                                    "biaoqianzhangshu": 1
+                                                    "HQty": data[i].鐢熸垚鏉$爜鏁伴噺, // 鏈鐢熸垚鏉$爜鏁伴噺
+                                                    "biaoqianzhangshu": 1,
+                                                    "HStatusMan": data[i].宸ュ彿,
+                                                    "HBarCodeDate": data[i].鏉$爜鏃ユ湡,
+                                                    "HLSH": data[i].娴佹按鍙�,
                                                 });
+
+
+
                                             }
 
+                                            // 鏇存柊琛ㄦ牸鏁版嵁
                                             option_Success.data = rowdata_1;
                                             table.render(option_Success);
-                                        
                                         }
-                                        else {
-                                            // $("#verifycode").click();
-                                            f_alert(data.Message);
-                                        }
-                                        layer.closeAll("loading");
-                                    },
-                                    error: function (err) {
-                                        f_alert("閿欒:" + err);
-                                        layer.closeAll("loading");
                                     }
                                 });
+                                //#endregion
 
+                              
+                            } else {
+                                layer.msg(data.Message);
                             }
-                           
+
                             layer.closeAll("loading");
                         },
                         error: function (err) {
@@ -723,7 +736,7 @@
                     return;
                 }
                 for (var j = 0; j < data2.length; j++) {
-                    rows += data2[j].HMaterID.toString() + ',';
+                    rows += data2[j].HBarItemID.toString() + ',';
                     rows2 += data2[j].HBarCode.toString() + ',';
                 }
                 rows = rows.substring(rows.length - 1, 0);
@@ -768,15 +781,16 @@
             //鑾峰彇渚涘簲鍟咺D
             function FetchSupInfo() {
                 var sWhere = "";
-                //var sWhere = " and 渚涘簲鍟嗗悕绉� ='" + sessionStorage["HUserName"] + "'";
+                var sWhere = " and 渚涘簲鍟嗗悕绉� ='" + sessionStorage["HUserName"] + "'";
                 $.ajax({
                     url: GetWEBURL() + "/Gy_Supplier/list",
                     type: "GET",
                     data: { "sWhere": sWhere, "user": '', "Organization": sessionStorage["Organization"] },
                     success: function (result) {
                         if (result.data.length > 0) {
+                            $("#HSupID").val(result.data[0].HItemID);
+                            $("#HSupNumber").val(result.data[0].渚涘簲鍟嗕唬鐮�);
                             $("#HSupName").val(result.data[0].渚涘簲鍟嗗悕绉�);
-                            $("#HSupID").val(result.data[0].渚涘簲鍟嗕唬鐮�);
                         } else {
                             layer.msg("渚涘簲鍟嗕俊鎭湭缁存姢", { time: 5000 });
                         }

--
Gitblit v1.9.1