From e968a2a53d207286e5ac0e1feddf4f2fdc72c8ed Mon Sep 17 00:00:00 2001
From: zgq <519541279@qq.com>
Date: 星期三, 24 三月 2021 10:03:18 +0800
Subject: [PATCH] 新增供应商设置

---
 WebTM/views/仓存管理/仓库调拨/Cc_LookingForBill.html |  138 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 103 insertions(+), 35 deletions(-)

diff --git "a/WebTM/views/\344\273\223\345\255\230\347\256\241\347\220\206/\344\273\223\345\272\223\350\260\203\346\213\250/Cc_LookingForBill.html" "b/WebTM/views/\344\273\223\345\255\230\347\256\241\347\220\206/\344\273\223\345\272\223\350\260\203\346\213\250/Cc_LookingForBill.html"
index aa02308..089ec8f 100644
--- "a/WebTM/views/\344\273\223\345\255\230\347\256\241\347\220\206/\344\273\223\345\272\223\350\260\203\346\213\250/Cc_LookingForBill.html"
+++ "b/WebTM/views/\344\273\223\345\255\230\347\256\241\347\220\206/\344\273\223\345\272\223\350\260\203\346\213\250/Cc_LookingForBill.html"
@@ -2,7 +2,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-    <title>鎵捐揣鍗�</title>
+<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">
@@ -45,6 +45,7 @@
                         <ul class="layui-tab-title" lay-filter="tab-all">
                             <li lay-id="1" style="padding:1px;display:none">琛ㄥご淇℃伅</li>
                             <li lay-id="2" style="padding:1px;" class="layui-this">鏄庣粏淇℃伅</li>
+                            <li lay-id="3" style="padding:1px;">宸叉壂淇℃伅</li>
                         </ul>
                         <div class="layui-tab-content">
                             <!--琛ㄥご淇℃伅-->
@@ -121,6 +122,10 @@
                             <div class="layui-tab-item layui-show">
                                 <table class="layui-hide" id="bzd-table" lay-filter="bzd-table"></table>
                             </div>
+                            <!--宸叉壂淇℃伅-->
+                            <div class="layui-tab-item">
+                                <table class="layui-hide" id="bzd-table2" lay-filter="bzd-table2"></table>
+                            </div>
                         </div>
                     </div>
                     <div class="layer-footer" style="z-index: 10; position: fixed; text-align: center; bottom: 0; width:100%; height:50px">
@@ -174,6 +179,14 @@
             $("#HMakerID").val(sessionStorage["Czybm"]);
             $("#HMaker").val(sessionStorage["HUserName"]);
 
+
+            //鍒ゆ柇鐢ㄦ埛鏄惁缁戝畾鐝粍鍜岀敓浜ц祫婧�
+            if ($("#HGroupID").val() == 0 || $("#HSourceID").val() == 0) {
+                layer.confirm("璇ョ敤鎴锋湭缁戝畾鐝粍鎴栫敓浜ц祫婧愶紒涓嶅厑璁告壘璐э紒", {
+                    icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['纭閫�鍑�']
+                }, function () { window.location.href = "../../index.html"; });
+            }
+
             //鑾峰彇鏈�澶у崟鎹彿 new
             $("#HInterID").val("");
             $("#HBillNo").val("");
@@ -195,15 +208,16 @@
                 , page: true
                 //, height: 256
                 , cellMinWidth: 90
+                , limit: 500
                 , cols: [[
                     { type: 'numbers', title: '搴忓彿' }
                     , { field: 'HIsStatus', title: '鏄惁鎵爜' }
                     , { field: 'HMTONo', title: '鎵瑰彿', width: 180 }
                     , { field: 'HSPID', title: '浠撲綅ID', hide: true }
-                    , { field: 'HSPName', title: '浠撲綅' }
+                    , { field: 'HSPName', title: '浠撲綅', hide: true }
                     , { field: 'HStatus', title: '鍦ㄥ簱鐘舵��', width: 165 }
                     , { field: 'HWhID', title: '浠撳簱ID', hide: true }
-                    , { field: 'HWhName', title: '浠撳簱' }
+                    , { field: 'HWhName', title: '浠撳簱', width: 130, hide: true }
                     , { field: 'HSourceInterID', title: '婧愬崟ID', hide: true }
                     , { field: 'HSourceBillNo', title: '婧愬崟鍙�', width: 110 }
                     , { field: 'HGroupID', title: '鐝粍ID', hide: true }
@@ -217,20 +231,64 @@
                     , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿' }
                     , { field: '鍗虫椂搴撳瓨', title: '鍗虫椂搴撳瓨' }
                     , { field: 'HBarCode', title: '鏉$爜缂栧彿', hide: true }
-                    , { field: 'HInterID', title: '鍗曟嵁ID' }
+                    , { field: 'HInterID', title: '鍗曟嵁ID', hide: true }
                     , { field: 'HBillNo', title: '鍗曟嵁鍙�' }
-                    , { field: 'HMakerID', title: '鍒跺崟浜篒D' }
+                    , { field: 'HMakerID', title: '鍒跺崟浜篒D', hide: true }
                     , { field: 'HMaker', title: '鍒跺崟浜�' }
-                    , { field: 'HBillType', title: 'HBillType' }
+                    , { field: 'HBillType', title: 'HBillType', hide: true }
                 ]]
                 , text: {
                     none: '鏆傛棤鐩稿叧鏁版嵁锛岃鍏堟壂鎻忔簮鍗曞彿锛�' //榛樿锛氭棤鏁版嵁銆傛敞锛氳灞炴�т负 layui 2.2.5 寮�濮嬫柊澧�
                 }
             };
 
+            //涓昏〃鍒楄〃-宸叉壂淇℃伅
+            var option2 = {
+                elem: '#bzd-table2'
+                //, toolbar: '#toolbarDemo'
+                , page: true
+                //, height: 256
+                , cellMinWidth: 90
+                , limit: 500
+                , cols: [[
+                    { type: 'numbers', title: '搴忓彿' }
+                    , { field: 'HIsStatus', title: '鏄惁鎵爜' }
+                    , { field: 'HMTONo', title: '鎵瑰彿', width: 180 }
+                    , { field: 'HSPID', title: '浠撲綅ID', hide: true }
+                    , { field: 'HSPName', title: '浠撲綅', hide: true }
+                    , { field: 'HStatus', title: '鍦ㄥ簱鐘舵��', width: 165 }
+                    , { field: 'HWhID', title: '浠撳簱ID', hide: true }
+                    , { field: 'HWhName', title: '浠撳簱', width: 130, hide: true }
+                    , { field: 'HSourceInterID', title: '婧愬崟ID', hide: true }
+                    , { field: 'HSourceBillNo', title: '婧愬崟鍙�', width: 110 }
+                    , { field: 'HGroupID', title: '鐝粍ID', hide: true }
+                    , { field: 'HGroup', title: '鐝粍' }
+                    , { field: 'HSourceID', title: '鐢熶骇璧勬簮ID', hide: true }
+                    , { field: 'HSource', title: '鐢熶骇璧勬簮', width: 115, templet: '#sexTpl' }
+                    , { field: 'HQty', title: '鏁伴噺' }
+                    , { field: 'HMaterID', title: '鐗╂枡ID', hide: true }
+                    , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 120 }
+                    , { field: 'HMaterNumber', title: '鐗╂枡缂栫爜' }
+                    , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿' }
+                    , { field: '鍗虫椂搴撳瓨', title: '鍗虫椂搴撳瓨' }
+                    , { field: 'HBarCode', title: '鏉$爜缂栧彿', hide: true }
+                    , { field: 'HInterID', title: '鍗曟嵁ID', hide: true }
+                    , { field: 'HBillNo', title: '鍗曟嵁鍙�' }
+                    , { field: 'HMakerID', title: '鍒跺崟浜篒D', hide: true }
+                    , { field: 'HMaker', title: '鍒跺崟浜�' }
+                    , { field: 'HBillType', title: 'HBillType', hide: true }
+                ]]
+                , text: {
+                    none: '鏆傛棤鐩稿叧鏁版嵁锛岃鍏堟壂鎻忓疄鐗╂潯鐮侊紒' //榛樿锛氭棤鏁版嵁銆傛敞锛氳灞炴�т负 layui 2.2.5 寮�濮嬫柊澧�
+                }
+            };
+
             //鍒濆鍔犺浇琛ㄦ牸
             option.data = [];
             table.render(option);
+
+            option2.data = [];
+            table.render(option2);
 
             //杩涘叆椤甸潰榛樿鍏夋爣鍦ㄦ簮鍗曞彿涓�
             $("#HSourceBillNo").focus();
@@ -285,9 +343,9 @@
                                         rowFlage += i + 1 + ",";
                                     }
                                 }
-                                if (rowFlage) {
-                                    layer.msg("绗�" + rowFlage + "琛屾暟鎹棤鏉$爜锛岃鍏堢敓鎴愭潯鐮侊紒", { icon: 5, btn: ['鎴戝凡鐭ユ檽'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                                }
+                                //if (rowFlage) {
+                                //    layer.msg("绗�" + rowFlage + "琛屾暟鎹棤鏉$爜锛岃鍏堢敓鎴愭潯鐮侊紒", { icon: 5, btn: ['鎴戝凡鐭ユ檽'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                                //}
                                 $("#HSourceBillNo").attr("readonly", "readonly");//婧愬崟鍙峰彧璇�
                                 $("#HSourceBillNo").css("background-color", "#efefef4d");
                                 element.tabChange('tab-LookingForBill', '2');  //璺宠浆椤电
@@ -305,6 +363,7 @@
                 }
             });
 
+            var data = new Object();
             //鎵疄鐗╂潯鐮�
             $('#HBarCode').on('keydown', function (event) {
                 var HBarCode = $('#HBarCode').val()
@@ -319,10 +378,14 @@
                                 layer.close(index);
                                 $('#HBarCode').val("");
                                 layer.msg("璇ュ疄鐗╁凡鎵爜锛岃鍕块噸澶嶆壂鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                            } else if (sSubStr[i].HStatus != null && sSubStr[i].HStatus != "" && sSubStr[i].HStatus != "鍦ㄥ簱") {
-                                layer.close(index);
-                                layer.msg("璇ュ疄鐗╁湪瑁佸垏涓紝涓嶅厑璁告壂鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                            } else {
+                            }
+                            //else if (sSubStr[i].HStatus != null && sSubStr[i].HStatus != "" && sSubStr[i].HStatus != "鍦ㄥ簱")
+                            //{
+                            //    layer.close(index);
+                            //    layer.msg("璇ュ疄鐗╁湪" + sSubStr[i].HSource+"瑁佸垏涓紝涓嶅厑璁告壂鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            //}
+                            else
+                            {
                                 sSubStr[i].HIsStatus = "鏄�";
                                 sSubStr[i].HSourceID = $("#HSourceID").val();
                                 sSubStr[i].HSource = $("#HSource").val();
@@ -334,15 +397,20 @@
                                 sSubStr[i].HMaker = $("#HMaker").val();
                                 option.data = table.cache["bzd-table"];
                                 table.render(option);
-                                layer.close(index);
                                 $('#HBarCode').val("");
+                                //鍔ㄦ�佽幏鍙栧凡鎵爜璁板綍骞舵坊鍔犲埌宸叉壂淇℃伅涓�
+                                table.cache["bzd-table2"].push(sSubStr[i]);
+                                option2.data = table.cache["bzd-table2"];
+                                table.render(option2);
+                                element.tabChange('tab-LookingForBill', '3');//璺宠浆椤电
+                                layer.close(index);
                                 layer.msg("鎵爜鎴愬姛锛�", { icon: 1, time: 1000 });
                             }
                         }
                     }
                     if (rowCount == 0) {
                         layer.close(index);
-                        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: "娓╅Θ鎻愮ず" });
                     }
 
 
@@ -425,18 +493,18 @@
             form.on('submit(Saver)', function (data) {//鎻愪氦
                 //debugger;
                 //var sMainStr = JSON.stringify(data.field);
-                var tableData = table.cache['bzd-table'];
-                for (var i = 0; i < tableData.length; i++) {
-                    if (tableData[i].HIsStatus == "鏄�" ) {
+                var tableData = table.cache['bzd-table2'];
+                //for (var i = 0; i < tableData.length; i++) {
+                //    if (tableData[i].HIsStatus == "鏄�" ) {
 
-                    } else {
-                        //绉婚櫎褰撳墠琛�
-                        tableData.splice(i, 1);
-                        i--;
-                        option.data = tableData;
-                        table.render(option);
-                    }
-                }
+                //    } else {
+                //        //绉婚櫎褰撳墠琛�
+                //        tableData.splice(i, 1);
+                //        i--;
+                //        option.data = tableData;
+                //        table.render(option);
+                //    }
+                //}
                 var sSubStr = JSON.stringify(tableData);
                 sSubStr = "{\"oSub\": " + sSubStr + "}";
                 //sSubStr = JSON.stringify(sSubStr);
@@ -452,15 +520,15 @@
                         async: true,
                         data: { "oMain": sSubStr },
                         dataType: "json",
-                        success: function (data) {
-                            if (data.count == 1) {
-                                layer.confirm(data.Message, {
-                                    icon: 1, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['鏂板'],
-                                    btn2: function () {
-                                        //parent.layui.admin.events.closeThisTabs();鍏抽棴椤电
-                                        //window.close();//鍏抽棴椤甸潰锛屾祻瑙堝櫒鏈夋晥锛孭DA鏃犳晥
-                                        parent.location.href = "../../../views/index.html"
-                                    }//鍏抽棴
+                        success: function (result) {
+                            if (result.count == 1) {
+                                layer.confirm(result.Message, {
+                                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 {

--
Gitblit v1.9.1