From 438e9cf23ce53d875ba180f16ca3f5513a769910 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期六, 11 五月 2024 15:39:41 +0800
Subject: [PATCH] 销售出库单:下查功能

---
 WarM/仓库管理/Kf_SellOutBill_BarCodeNote.cs |   92 ++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 85 insertions(+), 7 deletions(-)

diff --git "a/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Kf_SellOutBill_BarCodeNote.cs" "b/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Kf_SellOutBill_BarCodeNote.cs"
index fad273f..e775084 100644
--- "a/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Kf_SellOutBill_BarCodeNote.cs"
+++ "b/WarM/\344\273\223\345\272\223\347\256\241\347\220\206/Kf_SellOutBill_BarCodeNote.cs"
@@ -29,6 +29,7 @@
         public Int64 HStockOrgID = DBUtility.ClsPub.HOrgID;
         public DateTime HDate = DateTime.Today;
         public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+        public DAL.ClsKf_SellOutBill BillOld = new DAL.ClsKf_SellOutBill();   //瀵瑰簲鍗曟嵁绫�
         SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
 
         #region  //鍥哄畾浠g爜
@@ -53,6 +54,7 @@
             grdMain.DataSource = null;
             grdSub.DataSource = null;
             grdBarCode.DataSource = null;
+            grdTM.DataSource = null;
         }
 
         //绐椾綋鍔犺浇
@@ -87,6 +89,7 @@
             DBUtility.Xt_BaseBillFun.initGridList(grdMain, this.Name);
             DBUtility.Xt_BaseBillFun.initGridList(grdSub, this.Name + "grdSub");
             DBUtility.Xt_BaseBillFun.initGridList(grdBarCode, this.Name + "grdBarCode");
+            DBUtility.Xt_BaseBillFun.initGridList(grdTM, this.Name + "grdTM");
         }
 
 
@@ -126,6 +129,15 @@
             DBUtility.Xt_BaseBillFun.GraphicsGrid(grdBarCode);
         }
 
+        private void grdTM_Paint(object sender, PaintEventArgs e)
+        {
+            GraphicsGridTM();
+        }
+        private void GraphicsGridTM()
+        {
+            DBUtility.Xt_BaseBillFun.GraphicsGrid(grdTM);
+        }
+
         private Int32 Fun_GetCol(string sCol)
         {
             return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdMain);
@@ -139,6 +151,11 @@
         private Int32 Fun_GetBarCodeCol(string sCol)
         {
             return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdBarCode);
+        }
+
+        private Int32 Fun_GetTMCol(string sCol)
+        {
+            return DBUtility.Xt_BaseBillFun.Fun_GetCol(sCol, grdTM);
         }
 
         //鐢荤嚎
@@ -161,6 +178,12 @@
             string s3 = frmCondition.cmbHComplete.Text;
             long n3 = 0;
             DBUtility.Xt_BaseBillFun.GraphLine(grdBarCode, MainIDCol3, SubIDCol3, s3, ref n3);
+
+            int MainIDCol4 = Fun_GetTMCol("hmainid");
+            int SubIDCol4 = Fun_GetTMCol("hsubid");
+            string s4 = frmCondition.cmbHComplete.Text;
+            long n4 = 0;
+            DBUtility.Xt_BaseBillFun.GraphLine(grdTM, MainIDCol4, SubIDCol4, s4, ref n4);
         }
 
         //淇濆瓨鍒楀
@@ -169,6 +192,7 @@
             DBUtility.Xt_BaseBillFun.SaveGrid(grdMain, this.Name);
             DBUtility.Xt_BaseBillFun.SaveGrid(grdSub, this.Name + "grdSub");
             DBUtility.Xt_BaseBillFun.SaveGrid(grdBarCode, this.Name + "grdBarCode");
+            DBUtility.Xt_BaseBillFun.SaveGrid(grdTM, this.Name + "grdTM");
         }
 
         //榛樿鍒楀
@@ -177,6 +201,7 @@
             DBUtility.Xt_BaseBillFun.DefaultGridView(grdMain, this.Name);
             DBUtility.Xt_BaseBillFun.DefaultGridView(grdSub, this.Name + "grdSub");
             DBUtility.Xt_BaseBillFun.DefaultGridView(grdBarCode, this.Name + "grdBarCode");
+            DBUtility.Xt_BaseBillFun.DefaultGridView(grdTM, this.Name + "grdTM");
         }
 
         #endregion
@@ -298,42 +323,49 @@
                 cmbHStockOrgID.Text = DSet.Tables[0].Rows[0]["閿�鍞粍缁�"].ToString();
                 cmbHBillStatus.Text = DSet.Tables[0].Rows[0]["鍗曟嵁鐘舵��"].ToString();
                 txtHMoney.Text = DSet.Tables[0].Rows[0]["鏈崟閲戦"].ToString();
-                txtHCreditDifference.Text = DSet.Tables[0].Rows[0]["淇℃伅宸"].ToString();
+                txtHCreditDifference.Text = DSet.Tables[0].Rows[0]["淇$敤宸"].ToString();
                 HInterID = DBUtility.ClsPub.isLong(DSet.Tables[0].Rows[0]["HInterID"]);
+                txtHMaker.Text = DSet.Tables[0].Rows[0]["鍒跺崟浜�"].ToString();
+                txtHChecker.Text = DSet.Tables[0].Rows[0]["瀹℃牳浜�"].ToString();
 
                 //杩斿洖鍩烘湰淇℃伅銆佺爜鍗曚俊鎭�
                 grdMain.DataSource = DSet.Tables[1].DefaultView;
                 grdBarCode.DataSource = DSet.Tables[2].DefaultView;
+                grdTM.DataSource = DSet.Tables[3].DefaultView;
                 //鍐荤粨
                 int FrCol = DBUtility.ClsPub.isInt(frmCondition.txtFrozenCol.Text);
                 string s = frmCondition.cmbHComplete.Text;
                 DBUtility.Xt_BaseBillFun.DisplayGrid(grdMain, this.Name, s, FrCol);
                 DBUtility.Xt_BaseBillFun.DisplayGrid(grdBarCode, this.Name + "grdBarCode", s, FrCol);
+                DBUtility.Xt_BaseBillFun.DisplayGrid(grdTM, this.Name + "grdTM", s, FrCol);
                 //鐢荤嚎
                 GraphLine();
 
-                //鏈鏍�
                 if (cmbHBillStatus.Text == "宸插鏍�")
                 {
                     sh.Enabled = false;
+                    fsh.Enabled = true;
                     pic1.Visible = true;
                     pic1.Image = System.Drawing.Image.FromFile(DBUtility.ClsPub.AppPath + @"/Pic/Checked.jpg");
                 }
                 else if (cmbHBillStatus.Text == "宸插叧闂�")
                 {
                     sh.Enabled = false;
+                    fsh.Enabled = false;
                     pic1.Visible = true;
                     pic1.Image = System.Drawing.Image.FromFile(DBUtility.ClsPub.AppPath + @"/Pic/Closed.jpg");
                 }
                 else if (cmbHBillStatus.Text == "宸蹭綔搴�")
                 {
                     sh.Enabled = false;
+                    fsh.Enabled = false;
                     pic1.Visible = true;
                     pic1.Image = System.Drawing.Image.FromFile(DBUtility.ClsPub.AppPath + @"/Pic/Deleted.jpg");
                 }
                 else
                 {
                     sh.Enabled = true;
+                    fsh.Enabled = false;
                     pic1.Visible = false;
                     pic1.Image = null;
                 }
@@ -346,6 +378,17 @@
 
         private void sh_Click(object sender, EventArgs e)
         {
+            DataSet ds2 = oCn.RunProcReturn("exec h_p_Kf_CheckSellOutBill_CrediControl " + HInterID.ToString(), "h_p_Kf_CheckSellOutBill_CrediControl");
+            if (ds2 == null || ds2.Tables[0].Rows.Count == 0)
+            {
+                MessageBox.Show("瀹℃牳閿�鍞嚭搴撳崟锛屼俊鐢ㄦ帶鍒跺垽鏂敊璇紒", "鎻愮ず");
+                return;
+            }
+            else if (DBUtility.ClsPub.isLong(ds2.Tables[0].Rows[0][0]) == 1)
+            {
+                MessageBox.Show(DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HRemark"]), "鎻愮ず");
+                return;
+            }
             DataSet ds = oCn.RunProcReturn("exec h_p_Kf_SellOutBill_Check " + HInterID.ToString() + ",'" + HBillType + "','" + HMaker + "'", "h_p_Kf_SellOutBill_Check");
             if (ds == null || ds.Tables[0].Rows.Count == 0)
             {
@@ -360,10 +403,40 @@
             else
             {
                 cmbHBillStatus.Text="宸插鏍�";
+                txtHChecker.Text = HMaker.ToString();
                 sh.Enabled = false;
+                fsh.Enabled = true;
                 pic1.Visible = true;
                 pic1.Image = System.Drawing.Image.FromFile(DBUtility.ClsPub.AppPath + @"/Pic/Checked.jpg");
                 MessageBox.Show("瀹℃牳鎴愬姛锛�", "鎻愮ず");
+                return;
+            }
+        }
+
+        #endregion
+
+        #region  //鍙嶅鏍搁攢鍞嚭搴撳崟
+        private void fsh_Click(object sender, EventArgs e)
+        {
+            if(HInterID==0)
+            {
+                MessageBox.Show("璇峰厛閫夋嫨瀵瑰簲閿�鍞嚭搴撳崟锛�", "鎻愮ず");
+                return;
+            }
+            if (BillOld.AbandonCheck(HInterID, ref DBUtility.ClsPub.sExeReturnInfo) == true)
+            {
+                cmbHBillStatus.Text = "鍒涘缓";
+                txtHChecker.Text = "";
+                sh.Enabled = true;
+                fsh.Enabled = false;
+                pic1.Visible = false;
+                pic1.Image = null;
+                MessageBox.Show("鍙嶅鏍告垚鍔燂紒", "鎻愮ず");
+                return;
+            }
+            else
+            {
+                MessageBox.Show("鍙嶅鏍稿け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo, "鎻愮ず");
                 return;
             }
         }
@@ -441,6 +514,8 @@
                 Report.FieldByName("鍗曟嵁鐘舵��").AsString = cmbHBillStatus.Text;
                 Report.FieldByName("鏈崟閲戦").AsString = txtHMoney.Text;
                 Report.FieldByName("淇$敤宸").AsString = txtHCreditDifference.Text;
+                Report.FieldByName("鍒跺崟浜�").AsString = txtHMaker.Text;
+                Report.FieldByName("瀹℃牳浜�").AsString = txtHChecker.Text;
             }
             catch (Exception e)
             {
@@ -468,11 +543,11 @@
 
         private void BarCodedy_Click(object sender, EventArgs e)
         {
-            if (cmbHBillStatus.Text != "宸插鏍�")
-            {
-                MessageBox.Show("鎵�閫夊崟鎹搴斿崟鎹姸鎬佷笉涓衡�樺凡瀹℃牳鈥欑姸鎬侊紝涓嶅厑璁告墦鍗帮紒", "鎻愮ず");
-                return;
-            }
+            //if (cmbHBillStatus.Text != "宸插鏍�")
+            //{
+            //    MessageBox.Show("鎵�閫夊崟鎹搴斿崟鎹姸鎬佷笉涓衡�樺凡瀹℃牳鈥欑姸鎬侊紝涓嶅厑璁告墦鍗帮紒", "鎻愮ず");
+            //    return;
+            //}
             //閫夋嫨鎵撳嵃妯℃澘
             BLL.Gy_OpenTmp oFrm = new BLL.Gy_OpenTmp();
             oFrm.sBillName = ModName;
@@ -522,6 +597,8 @@
                 Report.FieldByName("鍗曟嵁鐘舵��").AsString = cmbHBillStatus.Text;
                 Report.FieldByName("鏈崟閲戦").AsString = txtHMoney.Text;
                 Report.FieldByName("淇$敤宸").AsString = txtHCreditDifference.Text;
+                Report.FieldByName("鍒跺崟浜�").AsString = txtHMaker.Text;
+                Report.FieldByName("瀹℃牳浜�").AsString = txtHChecker.Text;
             }
             catch (Exception e)
             {
@@ -555,5 +632,6 @@
         }
 
         #endregion
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1