From d5911ff0c0a17aa8ccd97c050be06fa1a2b812e6 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期五, 29 三月 2024 10:04:39 +0800
Subject: [PATCH] 网页版: 增加 异常反馈验收单 单据编辑以及单据列表 模块; 网页版: 增加 异常反馈验收单 单据编辑以及单据列表 模块;

---
 WarM/条码打印/Kf_WeighToBarCode_StationOutBill.cs |  241 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 232 insertions(+), 9 deletions(-)

diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode_StationOutBill.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode_StationOutBill.cs"
index 144f2f9..463f03c 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode_StationOutBill.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode_StationOutBill.cs"
@@ -35,6 +35,7 @@
         public Int64 HProcessExchangeEntryID = 0;
         public Int64 HSupID = 0;
         public double HSourceQty = 0;
+        public double HMaterWeight = 0;         //鐗╂枡鍏嬮噸
         public string HCusMaterName = "";       //瀹㈡埛鐗╂枡鍚嶇О
         public string HCusModel = "";           //瀹㈡埛瑙勬牸鍨嬪彿
         public string HMaker = DBUtility.ClsPub.CurUserName;
@@ -345,8 +346,8 @@
                         Int64 sInterID = 0;
                         string sBillNo = "";
                         string sBillType = "3791";
-                        sInterID = DBUtility.ClsPub.CreateBillID_Prod(sBillType, ref DBUtility.ClsPub.sExeReturnInfo);           //寰楀埌鏂板崟鎹甀D
-                        sBillNo = DBUtility.ClsPub.CreateBillCode_Prod(sBillType, ref DBUtility.ClsPub.sExeReturnInfo, true);    //寰楀埌鏂板崟鎹彿
+                        sInterID = DBUtility.ClsPub.CreateBillID(sBillType, ref DBUtility.ClsPub.sExeReturnInfo);           //寰楀埌鏂板崟鎹甀D
+                        sBillNo = DBUtility.ClsPub.CreateBillCode(sBillType, ref DBUtility.ClsPub.sExeReturnInfo, true);    //寰楀埌鏂板崟鎹彿
 
                         Int64 sHBarCodeInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[y]["HInterID"]);
                         Int64 sHMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[y]["HMaterID"]);
@@ -390,8 +391,10 @@
                         ",0,0,0,0,0,0,0,0,0" +
                         ",0,0,''," + sHBarCodeInterID.ToString() + "," + HStockOrgID.ToString() +
                         ") ");
-                    }
 
+                        ////鍥炲~娴佽浆鍗″叧鑱旀暟閲�
+                        //oCn.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Out " + sInterID + ",1");
+                    }
                     //鍥炲~宸茬敓鍗曠姸鎬�
                     oCn.RunProc("Update KF_BCPWeighSource_Temp set HRelationInterID=1 where HInterID= " + HInterID.ToString());
                     MessageBox.Show("鐢熸垚宸ュ簭鍑虹珯姹囨姤鍗曟垚鍔燂紒", "鎻愮ず");
@@ -522,7 +525,7 @@
             if (chkHDYFlag.Checked == true)
             {
                 //鎵撳嵃鏉$爜
-                Sub_SetReport("鐗╂枡鏉$爜");
+                Sub_SetReport("鍗婃垚鍝佹潯鐮�");
                 Report.Print(false);
                 Thread.Sleep(1000);
             }
@@ -542,6 +545,8 @@
             }
 
             txtHQty.Text = "";
+            txtHWeightQyt.Text = "";
+            txtHBarcodeNo.Text = "";
             txtHQty.Focus();
         }
 
@@ -574,13 +579,81 @@
                 MessageBox.Show("璇疯緭鍏ユ纭背鏁帮紒", "鎻愮ず");
                 return false;
             }
-            else if (DBUtility.ClsPub.isDoule(txtHProcID.Tag) == 0)
+            else if (DBUtility.ClsPub.isDoule(txtHWeightQyt.Text) == 0)
             {
-                MessageBox.Show("璇峰厛閫夋嫨宸ュ簭锛�", "鎻愮ず");
+                MessageBox.Show("璇疯緭鍏ユ纭噸閲忥紒", "鎻愮ず");
+                return false;
+            }
+            else if (DBUtility.ClsPub.isInt(txtHBarcodeNo.Text) == 0)
+            {
+                MessageBox.Show("璇疯緭鍏ュ寘鍙凤紒", "鎻愮ず");
+                return false;
+            }
+            else if (DBUtility.ClsPub.isLong(txtHProcID.Tag) == 0)
+            {
+                MessageBox.Show("宸ュ簭涓嶅厑璁镐负绌猴紝璇峰厛杈撳叆娴佹按鍙峰悗鍥炶溅纭锛�", "鎻愮ず");
+                return false;
+            }
+            else if (DBUtility.ClsPub.isInt(txtHProcNo.Text) == 0)
+            {
+                MessageBox.Show("璇疯緭鍏ユ纭祦姘村彿锛�", "鎻愮ず");
+                return false;
+            }
+            else if (DBUtility.ClsPub.isLong(txtHSourceID.Tag) == 0)
+            {
+                MessageBox.Show("鐢熶骇璧勬簮涓嶅厑璁镐负绌猴紝璇峰厛閫夋嫨鐢熶骇璧勬簮锛�", "鎻愮ず");
                 return false;
             }
 
-            return true;
+            //瀹為檯鍏嬮噸=閲嶉噺/绫虫暟*1000锛屽疄闄呭厠閲嶈秴鍑虹墿鏂欑淮鎶ゅ厠閲嶇殑鐧惧垎涔嬩簩鍗佹垨涓嶈冻鐗╂枡缁存姢鍏嬮噸鐨勭櫨鍒嗕箣鍏崄锛岄璀︽彁绀�
+            double sQty = 0;    //瀹為檯鍏嬮噸
+            sQty = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text) / DBUtility.ClsPub.isDoule(txtHQty.Text) * 1000;
+
+            if (sQty > HMaterWeight * 1.2 || sQty < HMaterWeight * 0.8)
+            {
+                if (MessageBox.Show("鐗╂枡缁存姢鍏嬮噸涓猴細" + HMaterWeight.ToString() + "锛屽疄闄呭厠閲嶄负锛�" + sQty.ToString() + "锛屾墍杈撳叆瀹為檯鍏嬮噸瓒呭嚭鐗╂枡缁存姢鍏嬮噸鐨勭櫨鍒嗕箣浜屽崄鎴栦笉瓒崇墿鏂欑淮鎶ゅ厠閲嶇殑鐧惧垎涔嬪叓鍗侊紝璇锋鏌ヨ緭鍏ョ殑鏁版嵁鏄惁姝g‘锛�", "鎻愮ず", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
+                {
+                    //return true;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+
+            //鏉$爜鐢熸垚鍓嶆帶鍒跺垽鏂�
+            double HNowQty = 0;     //绫虫暟
+            double HWeightQyt = 0;  //閲嶉噺
+            HNowQty = DBUtility.ClsPub.isDoule(txtHQty.Text);
+            HWeightQyt = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text);
+
+            DataSet oDsCheck = oCn.RunProcReturn("exec h_p_Kf_WeighToBarCode_StationOutBill_AddBarCodeCheck " + HInterID.ToString() + "," + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + "," + HProcessExchangeInterID.ToString() + "," + HProcessExchangeEntryID.ToString() + "," + HSourceQty.ToString() + "," + HNowQty.ToString() + "," + HWeightQyt.ToString(), "h_p_Kf_WeighToBarCode_StationOutBill_AddBarCodeCheck");
+            //
+            if (oDsCheck == null && oDsCheck.Tables[0].Rows.Count == 0)
+            {
+                MessageBox.Show("鏉$爜鐢熸垚鍓嶅垽鏂敊璇紒");
+                return false;
+            }
+            else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "1")
+            {
+                MessageBox.Show(DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]), "鎻愮ず");
+                return false;
+            }
+            else if (DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0][0]) == "2")
+            {
+                if (MessageBox.Show(DBUtility.ClsPub.isStrNull(oDsCheck.Tables[0].Rows[0]["HRemark"]), "鎻愮ず", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
+                {
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+            else
+            {
+                return true;
+            }
         }
 
         //鐢熸垚鏉$爜
@@ -641,9 +714,11 @@
             string HBarCodeType = "";
             Int64 HMaterID2 = 0;
             double HQty = 0;            //绫虫暟
+            double HMaterialJQty = 0;   //閲嶉噺
             Int64 HGroupID = 0;
             Int64 HDeptID = 0;
             string HProcessExchangeBillNo = "";
+            Int64 HBarcodeNo = 0;       //鍖呮暟
             string HMaterName = "";
             string HMaterModel = "";
             Int64 HProcID = 0;
@@ -655,9 +730,11 @@
             HBarCodeType = DBUtility.ClsPub.isStrNull(cmbHBarCodeType.Text);
             HMaterID2 = DBUtility.ClsPub.isLong(txtHMaterNumber.Tag);
             HQty = DBUtility.ClsPub.isDoule(txtHQty.Text);
+            HMaterialJQty = DBUtility.ClsPub.isDoule(txtHWeightQyt.Text);
             HGroupID = DBUtility.ClsPub.isLong(txtHGroupID.Tag);
             HDeptID = DBUtility.ClsPub.isLong(txtHDeptName.Tag);
             HProcessExchangeBillNo = DBUtility.ClsPub.isStrNull(txtHBillNo.Text);
+            HBarcodeNo = DBUtility.ClsPub.isLong(txtHBarcodeNo.Text);
             HMaterName = DBUtility.ClsPub.isStrNull(txtHMaterName.Text);
             HMaterModel = DBUtility.ClsPub.isStrNull(txtHMaterModel.Text);
             HProcID = DBUtility.ClsPub.isLong(txtHProcID.Tag);
@@ -683,8 +760,8 @@
                 + " '" + HBarCode + "','" + HBarCodeType + "'," + HMaterID2.ToString() + "," + HUnitID.ToString() + "," + HQty.ToString()
                 + ",'" + HBatchNo + "'," + HSupID.ToString() + "," + HGroupID.ToString() + ",'" + HMaker + "',getdate(),0," + HQty.ToString()
                 + ", " + HSourceInterID.ToString() + "," + HSourceEntryID.ToString() + ",'" + HSourceBillNo + "','" + HSourceBillType + "',''"
-                + ", 1,1," + HDeptID.ToString() + ",0,0,''"
-                + ", 0,'',getdate(),'','" + sDate + "',0,0"
+                + ", 1," + HBarcodeNo.ToString() + "," + HDeptID.ToString() + ",0,0,''"
+                + ", 0,'',getdate(),'','" + sDate + "'," + HMaterialJQty.ToString() + ",0"
                 + ", " + HStockOrgID.ToString() + "," + HStockOrgID.ToString() + ",''," + HInterID.ToString() + ",0"
                 + ", " + HProcessExchangeInterID.ToString() + "," + HProcessExchangeEntryID.ToString() + ",'" + HProcessExchangeBillNo + "',0,'" + HCusMaterName + "','" + HCusModel + "'"
                 + ", " + HProcID.ToString() + "," + HCenterID.ToString() + "," + HSourceID.ToString() + "," + HProcNo.ToString() + "," + HSourceQty.ToString()
@@ -727,6 +804,7 @@
             HSourceQty = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("鏁伴噺")].Value);
             HProcessExchangeInterID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HProcessExchangeInterID")].Value);
             HSupID = DBUtility.ClsPub.isLong(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HSupID")].Value);
+            HMaterWeight = DBUtility.ClsPub.isDoule(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HMaterWeight")].Value);
             HCusMaterName = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HCusMaterName")].Value);
             HCusModel = DBUtility.ClsPub.isStrNull(grdSub.SelectedRows[0].Cells[Fun_GetSubCol("HCusModel")].Value);
         }
@@ -928,6 +1006,50 @@
 
         #endregion
 
+        #region  //娴佹按鍙锋壂鎻�
+        private void txtHProcNo_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Return)
+            {
+                if (DBUtility.ClsPub.isLong(txtHProcNo.Text) == 0)
+                {
+                    MessageBox.Show("娴佹按鍙蜂负绌烘垨鎵�杈撳叆娴佹按鍙蜂笉姝g‘锛岃閲嶆柊杈撳叆娴佹按鍙凤紒");
+                    return;
+                }
+                //鏍规嵁杞崱涓籌D銆佹祦姘村彿甯﹀嚭娴佽浆鍗′笂鐩稿簲宸ュ簭銆佺彮缁勩�佸伐浣滀腑蹇冦�佺敓浜ц祫婧�
+                DataSet Ds = oCn.RunProcReturn("exec h_p_KF_GetBCPWeighSource_HProcNo2 " + HProcessExchangeInterID.ToString() + "," + DBUtility.ClsPub.isLong(txtHProcNo.Text) + ",'" + DBUtility.ClsPub.CurUserID + "'", "h_p_KF_GetBCPWeighSource_HProcNo2");
+                if (Ds == null || Ds.Tables[0].Rows.Count == 0)
+                {
+                    txtHProcNo.Text = "";
+                    txtHProcID.Tag = 0;
+                    txtHProcID.Text = "";
+                    txtHCenterID.Tag = 0;
+                    txtHCenterID.Text = "";
+                    txtHGroupID.Tag = 0;
+                    txtHGroupID.Text = "";
+                    txtHSourceID.Tag = 0;
+                    txtHSourceID.Text = "";
+                    MessageBox.Show("鎵�杈撳叆娴佹按鍙蜂笉鍦ㄥ綋鍓嶅伐搴忔祦杞崱涓嬫垨鐢ㄦ埛鏈叧鑱旇娴佹按鍙锋墍瀵瑰簲鐩稿叧宸ュ簭锛岃閲嶆柊杈撳叆娴佹按鍙凤紒");
+                    return;
+                }
+                else
+                {
+                    HProcessExchangeEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceEntryID"]);
+                    txtHProcNo.Text = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HProcNo"]);
+                    txtHProcID.Tag = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcID"]);
+                    txtHProcID.Text = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HProcName"]);
+                    txtHCenterID.Tag = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCenterID"]);
+                    txtHCenterID.Text = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HCenterName"]);
+                    txtHGroupID.Tag = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HGroupID"]);
+                    txtHGroupID.Text = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HGroupName"]);
+                    txtHSourceID.Tag = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceID"]);
+                    txtHSourceID.Text = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HSourceName"]);
+                }
+            }
+        }
+
+        #endregion
+
         #region  //宸ュ簭閫夋嫨
 
         private void cmdHProcID_Click(object sender, EventArgs e)
@@ -970,5 +1092,106 @@
         }
 
         #endregion
+
+        #region  //鐢熶骇璧勬簮閫夋嫨
+
+        private void txtHSourceID_KeyPress(object sender, KeyPressEventArgs e)
+        {
+            if (e.KeyChar == (char)Keys.Return)
+            {
+                if (DBUtility.ClsPub.isStrNull(txtHSourceID.Text) != "")
+                {
+                    DAL.ClsGy_Source_View oSource = new DAL.ClsGy_Source_View();
+                    if (oSource.GetInfoByID(DBUtility.ClsPub.isLong(txtHSourceID.Text.Replace("HCX", ""))))
+                    {
+                        txtHSourceID.Text = oSource.omodel.HName;
+                        txtHSourceID.Tag = oSource.omodel.HItemID;
+                    }
+                    else
+                    {
+                        txtHSourceID.Text = "";
+                        txtHSourceID.Tag = 0;
+                    }
+                }
+                else
+                {
+                    txtHSourceID.Text = "";
+                    txtHSourceID.Tag = 0;
+                }
+            }
+        }
+
+        private void txtHSourceID_Click(object sender, EventArgs e)
+        {
+            txtHSourceID.SelectAll();
+        }
+
+        private void txtHSourceID_TextChanged(object sender, EventArgs e)
+        {
+            BLL.ClsPub_BLL.Sub_ClearText(txtHSourceID);
+        }
+
+        private void cmdHSourceID_Click(object sender, EventArgs e)
+        {
+            DAL.ClsGy_Source_View oSource = new DAL.ClsGy_Source_View();
+            if (oSource.RefreshView())
+            {
+                txtHSourceID.Text = oSource.oModel.HName;
+                txtHSourceID.Tag = oSource.oModel.HItemID.ToString();
+            }
+            else
+            {
+                txtHSourceID.Text = "";
+            }
+        }
+
+        #endregion
+
+        #region  //鐢熶骇鐝粍閫夋嫨
+
+        private void cmdHGroupID_Click(object sender, EventArgs e)
+        {
+            DAL.ClsGy_Group_View oGroup = new DAL.ClsGy_Group_View();
+            if (oGroup.RefreshView())
+            {
+                txtHGroupID.Text = oGroup.oModel.HName;
+                txtHGroupID.Tag = oGroup.oModel.HItemID.ToString();
+            }
+            else
+            {
+                txtHGroupID.Text = "";
+            }
+        }
+
+        private void txtHGroupID_TextChanged(object sender, EventArgs e)
+        {
+            BLL.ClsPub_BLL.Sub_ClearText(txtHGroupID);
+        }
+
+        #endregion
+
+        #region  //宸ヤ綔涓績閫夋嫨
+
+        private void cmdHCenterID_Click(object sender, EventArgs e)
+        {
+            DAL.ClsGy_WorkCenter_View oWorkCenter = new DAL.ClsGy_WorkCenter_View();
+            if (oWorkCenter.RefreshView())
+            {
+                txtHCenterID.Text = oWorkCenter.oModel.HName;
+                txtHCenterID.Tag = oWorkCenter.oModel.HItemID.ToString();
+            }
+            else
+            {
+                txtHCenterID.Text = "";
+            }
+        }
+
+        private void txtHCenterID_TextChanged(object sender, EventArgs e)
+        {
+            BLL.ClsPub_BLL.Sub_ClearText(txtHCenterID);
+        }
+
+
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1