From ae8228f21650a10a80a2311a31c389e918b5ec6e Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期五, 17 十二月 2021 14:49:07 +0800
Subject: [PATCH] 收料通知单 反审核 删除 同步删除金蝶收料单数据

---
 WebTM/views/采购管理/收料通知单/Add_Edit_Cg_POInStockBillList.html |   48 ++++++++++++++++++------
 WebTM/views/采购管理/收料通知单/Cg_POInStockBillList.html          |   54 +++++++++++++++++++++++---
 2 files changed, 83 insertions(+), 19 deletions(-)

diff --git "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\346\224\266\346\226\231\351\200\232\347\237\245\345\215\225/Add_Edit_Cg_POInStockBillList.html" "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\346\224\266\346\226\231\351\200\232\347\237\245\345\215\225/Add_Edit_Cg_POInStockBillList.html"
index 8c3f093..f7f4f8e 100644
--- "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\346\224\266\346\226\231\351\200\232\347\237\245\345\215\225/Add_Edit_Cg_POInStockBillList.html"
+++ "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\346\224\266\346\226\231\351\200\232\347\237\245\345\215\225/Add_Edit_Cg_POInStockBillList.html"
@@ -76,7 +76,7 @@
                                         <div class="layui-col-xs4 layui-inline">
                                             <label class="layui-form-label">涓氬姟鍛�</label>
                                             <div class="layui-input-inline">
-                                                <input type="text" name="HEmpName" id="HEmpName"" class="layui-input" value="" style="float:left;width:150px;">
+                                                <input type="text" name="HEmpName" id="HEmpName" " class="layui-input" value="" style="float:left;width:150px;">
                                                 <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="" style="float:left;width:150px;">
                                                 <button type="button" lay-submit="" class="layui-btn" lay-filter="HEmpList" style="width:40px;">
                                                     <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
@@ -106,7 +106,7 @@
                                                 </button>
                                             </div>
                                         </div>
-                                       
+
                                     </div>
                                     <div class="layui-row">
                                         <div class="layui-col-xs4 layui-inline">
@@ -160,7 +160,7 @@
                                                 <input class="layui-input" name="Box2" id="Box2" autocomplete="off">
                                             </div>
                                         </div>
-                                       
+
                                     </div>
                                     <div class="layui-row">
                                         <div class="layui-col-xs4 layui-inline">
@@ -377,7 +377,7 @@
                 get_checkManager();
             });
 
-          
+
             //淇濆瓨鎸夐挳
             form.on('submit(set_SaveBill)', function (data) {
                 set_SaveBill(data);
@@ -432,8 +432,8 @@
                                 , "HAddress": data.浜よ揣鍦扮偣
                                 , "HInnerBillNo": data.杈呭姪瀛楁
                                 , "HExRate": data.姹囩巼
-                                , "Box2": ""                     
-                                , "HRemark": data.琛ㄥご澶囨敞            
+                                , "Box2": ""
+                                , "HRemark": data.琛ㄥご澶囨敞
                                 , "HMaker": data.鍒跺崟浜�
                                 , "HChecker": data.瀹℃牳浜�
                                 , "HCloseMan": data.鍏抽棴浜�
@@ -474,19 +474,42 @@
                         //console.log(d.data);
                         $("#HBillNo").val(d.data[0].HBillNo);
                         $("#HDate").val(shijian);
-                        $("#HInterID").val(d.data[0].HInterID);
+                        $("#HInterID").val();
                     }
                 });
             }
             else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
-                RoadBillMain(hID);
-                /* RoadBillSub(linterid);*/
+                RoadBillMain(linterid);
+                 //RoadBillSub(linterid);
             }
+            //鏃ユ湡鏍煎紡鍖�
+            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('-');
+            }
+            //閫�鍑�
+            form.on('submit(Exit)', function (data) {
+                if (linterid == undefined) {
+                    //鍏抽棴椤电
+                    Pub_Close(2);
+                }
+                else {
+                    //鍏抽棴椤电
+                    Pub_Close(1);
+                }
+            });
             //#region 淇濆瓨鏂规硶
             function set_SaveBill(data) {
 
                 var sMainStr = JSON.stringify(data.field);
-             
+
                 $.ajax({
                     type: "POST",
                     url: GetWEBURL() + "Gy_Warehouse/ModifyByID", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
@@ -512,6 +535,7 @@
                 });
             }
             //#endregion
+
 
             function get_checkEmp() {
                 layer.open({
@@ -601,7 +625,7 @@
                     , btn2: function (index, layero) { }
                 })
             }
-         
+
             function get_checkDept() {
                 layer.open({
                     type: 2//寮圭獥绫诲瀷
@@ -624,7 +648,7 @@
                     , btn2: function (index, layero) { }
                 })
             }
-         
+
             function get_checkManager() {
                 layer.open({
                     type: 2//寮圭獥绫诲瀷
diff --git "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\346\224\266\346\226\231\351\200\232\347\237\245\345\215\225/Cg_POInStockBillList.html" "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\346\224\266\346\226\231\351\200\232\347\237\245\345\215\225/Cg_POInStockBillList.html"
index 651f1ef..b521cb4 100644
--- "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\346\224\266\346\226\231\351\200\232\347\237\245\345\215\225/Cg_POInStockBillList.html"
+++ "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\346\224\266\346\226\231\351\200\232\347\237\245\345\215\225/Cg_POInStockBillList.html"
@@ -75,7 +75,7 @@
                                         <div class="layui-input-block">
                                             <input type="text" class="layui-input" name="HDeptID" id="HDeptID" style="width:190px;">
                                         </div>
-                                    </div> 
+                                    </div>
                                     <div class="layui-inline">
                                         <label class="layui-form-label">涓荤</label>
                                         <div class="layui-input-block">
@@ -91,6 +91,8 @@
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
+                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit"><i class="layui-icon layui-icon-radio"></i>瀹℃牳</button>-->
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeAudit"><i class="layui-icon layui-icon-circle"></i>鍙嶅鏍�</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button>
                             </div>
@@ -162,12 +164,12 @@
                     , cols: [[
                         { type: 'checkbox', fixed: 'left' }
                        ,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true }
-                        , { field: '鏃ユ湡', title: '鏃ユ湡', width: 150 }
-                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�' }
+                        , { field: '鏃ユ湡', title: '鏃ユ湡', width: 100 }
+                        , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�' ,width: 120}
                         , { field: 'HBillType', title: 'HBillType', hide: true }
                         , { field: 'HSupID', title: 'HSupID', width: 120, hide: true }
-                        , { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�', width: 150 }
-                        , { field: '渚涘簲鍟�', title: '渚涘簲鍟�', width: 250 }
+                        , { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�', width: 120 }
+                        , { field: '渚涘簲鍟�', title: '渚涘簲鍟�', width: 150 }
                         , { field: '浜よ揣鍦扮偣', title: '浜よ揣鍦扮偣' }
                         , { field: 'HCurID', title: 'HCurID', width: 120, hide: true }
                         , { field: '甯佸埆浠g爜', title: '甯佸埆浠g爜' }
@@ -217,7 +219,7 @@
                         , { field: '鍏抽棴鏃ユ湡', title: '鍏抽棴鏃ユ湡', width: 200, templet: "<div>{{d.鍏抽棴鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍏抽棴鏃ユ湡, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                         , { field: '浣滃簾浜�', title: '浣滃簾浜�', width: 125 }
                         , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', width: 200, templet: "<div>{{d.浣滃簾鏃ユ湡 ==null ?'':layui.util.toDateString(d.浣滃簾鏃ユ湡, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
-                      
+
                     ]]
                 };
             }
@@ -338,10 +340,48 @@
                     //閫�鍑烘寜閽�
                     case 'get_Exit': Pub_Close(2);
                         break;
+                    case 'btn-DeAudit':
+                        DeAudit();
+                        break;
                 };
             });
 
-           
+            function DeAudit(){
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1)
+                {
+                    var InterID = data[0].hmainid.toString();
+                    //閫昏緫鍒犻櫎鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "Cg_POInStockBill/DeAuditPOInStockBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": InterID },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
+                                    // 寰楀埌frame绱㈠紩
+                                    var index = layer.getFrameIndex(window.name);
+                                    //鍏抽棴褰撳墠frame
+                                    layer.close(index);
+                                    //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                    window.location.reload();
+                                });
+
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        },
+                        error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                        }
+                    });
+                }
+                else
+                {
+                    layer.msg('璇烽�夋嫨涓�琛屾暟鎹垹闄わ紒');
+                }
+            }
             //#region 蹇�熻繃婊�
             function get_FastQuery(table, option) {
                 var HDate = $("#HBeginDate").val();//寮�濮嬫棩鏈�

--
Gitblit v1.9.1