From 820074f0ce1c04edfb4a9fb4ed5b3fa784e6e8d0 Mon Sep 17 00:00:00 2001
From: zzr99 <1940172413@qq.com>
Date: 星期一, 16 五月 2022 14:22:39 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WorkM/流转卡管理/MES_StationOutBill.cs |  112 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 107 insertions(+), 5 deletions(-)

diff --git "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationOutBill.cs" "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationOutBill.cs"
index 6098e2f..84bf6e6 100644
--- "a/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationOutBill.cs"
+++ "b/WorkM/\346\265\201\350\275\254\345\215\241\347\256\241\347\220\206/MES_StationOutBill.cs"
@@ -60,9 +60,16 @@
         public void Sub_ClearBill()
         {
             DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp);
-            txtHSourceName.Focus();
+            DBUtility.Xt_BaseBillFun.Sub_ClearBill1(tabPage2);
+            DBUtility.Xt_BaseBillFun.Sub_ClearBill1(tabPage3);
             initGrid();
             initGrid_Sub();
+            txtHBarCode.Text = "";
+            txtHProcExchBillNo.Enabled = true;
+            txtHProcNo.Enabled = true;
+            txtHBarCode.Enabled = true;
+            tabControl2.SelectedIndex = 0;
+            txtHSourceName.Focus();
             //寰楀埌鎿嶄綔鍛樹俊鎭紙鍑虹珯鎿嶄綔鍛橀粯璁や负鐧诲綍浜猴紝鏍规嵁鐧诲綍浜虹敤鎴峰悕锛屾壘鍒拌亴鍛樺悓鍚嶇殑璁板綍锛岄粯璁ゅ啓鍏� 鎿嶄綔鍛� 鏂囨湰妗嗭紱濡傛灉娌℃壘鍒板垯涓虹┖锛涳級
             DataSet Ds;
             SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
@@ -184,6 +191,8 @@
                     cmdXG.Enabled = true;
                     cmdCancel.Enabled = true;
                     cmdChecker.Enabled = true;
+                    cmdBFChecker.Enabled = true;
+                    txtHBarCode.Enabled = false;
                     Sub_LrtextStatus(false);
                     break;
                 case DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew:
@@ -194,6 +203,7 @@
                     cmdXG.Enabled = false;
                     cmdCancel.Enabled = true;
                     cmdChecker.Enabled = false;
+                    cmdBFChecker.Enabled = false;
                     Sub_LrtextStatus(true);
                     break;
                 case DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify:
@@ -204,6 +214,7 @@
                     cmdXG.Enabled = false;
                     cmdCancel.Enabled = true;
                     cmdChecker.Enabled = false;
+                    cmdBFChecker.Enabled = false;
                     Sub_LrtextStatus(true);
                     break;
             }
@@ -580,9 +591,26 @@
                 MessageBox.Show("宸ヤ綔涓績娌℃湁閫夋嫨锛�", "鎻愮ず");
                 return false;
             }
-            if (DBUtility.ClsPub.isDoule(txtHQty.Text) + DBUtility.ClsPub.isDoule(txtHWasterQty.Text) <= 0)
+            if (DBUtility.ClsPub.isDoule(txtHQty.Text) 
+                + DBUtility.ClsPub.isDoule(txtHWasterQty.Text) 
+                + DBUtility.ClsPub.isDoule(txtHBadCount.Text)  <= 0)
             {
                 MessageBox.Show("鏁伴噺涓嶈兘涓�0锛�", "鎻愮ず");
+                return false;
+            }
+            if (DBUtility.ClsPub.isDoule(txtHQty.Text.Trim()) < 0)
+            {
+                MessageBox.Show("鍚堟牸涓暟涓嶈兘灏忎簬0锛�", "鎻愮ず");
+                return false;
+            }
+            if (DBUtility.ClsPub.isDoule(txtHWasterQty.Text.Trim()) < 0)
+            {
+                MessageBox.Show("涓嶅悎鏍兼暟涓嶈兘灏忎簬0锛�", "鎻愮ず");
+                return false;
+            }
+            if (DBUtility.ClsPub.isDoule(txtHBadCount.Text.Trim()) < 0)
+            {
+                MessageBox.Show("涓嶈壇鍝佹暟涓嶈兘灏忎簬0锛�", "鎻愮ず");
                 return false;
             }
             if (DBUtility.ClsPub.isDoule(txtHWorkTimes.Text)   <= 0)
@@ -641,6 +669,35 @@
                 MessageBox.Show("鍗曟嵁鍙烽噸澶嶏紒", "鎻愮ず");
                 return false;
             }
+
+            //鏍规嵁涓嶅悓瀹㈡埛锛屽褰曞叆鎬诲伐鏃朵笌鏍囧噯鎬诲伐鏃惰繘琛屽姣斿垽鏂�
+            SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+            long sMaterID = DBUtility.ClsPub.isLong(this.txtHMaterID.Tag);
+            long sProcID = DBUtility.ClsPub.isLong(this.txtHProcID.Tag);
+            double sQty = DBUtility.ClsPub.isDoule(this.txtHQty.Text);
+            double sBadCount = DBUtility.ClsPub.isDoule(this.txtHBadCount.Text);
+            double sWasterQty = DBUtility.ClsPub.isDoule(this.txtHWasterQty.Text);
+            double sWorkTimes = DBUtility.ClsPub.isSingle(this.txtHWorkTimes.Text);
+            DataSet Ds;
+            Ds = oCn.RunProcReturn("exec h_p_MES_StationOutBill_WorkTimesCtrl  " + sMaterID.ToString() + "," + sProcID.ToString() + "," + sQty.ToString() + "," + sBadCount.ToString() + "," + sWasterQty.ToString() + "," + sWorkTimes.ToString(), "h_p_MES_StationOutBill_WorkTimesCtrl");
+            if (Ds == null || Ds.Tables[0].Rows.Count == 0)
+            {
+                MessageBox.Show("褰曞叆鎬诲伐鏃朵笌鏍囧噯鎬诲伐鏃跺姣斿垽鏂け璐ワ紒", "鎻愮ず");
+                return false;
+            }
+            else
+            {
+                if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 1)
+                {
+                    MessageBox.Show(DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]));
+                    return false;
+                }
+                else if (DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0][0]) == 2)
+                {
+                    MessageBox.Show(DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HRemark"]));
+                }
+            }
+
             return true;
         }
         //淇濆瓨鍗曟嵁
@@ -663,8 +720,18 @@
             if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify)
                 BillNew.omodel.HInterID = BillOld.omodel.HInterID;
             //涓荤被璧嬪��
-            BillNew.omodel.HYear = 2011;
-            BillNew.omodel.HPeriod = 1;
+            //鍒ゆ柇浼氳鏈熸槸鍚﹀悎鐞�
+            string s = "";
+            int sYear = 0;
+            int sPeriod = 0;
+            if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(DBUtility.ClsPub.isDate(this.txtHStationOutTime.Text), ref sYear, ref sPeriod, ref s) == false)
+            {
+                MessageBox.Show(s, "鎻愮ず");
+                return false;
+            } 
+            //
+            BillNew.omodel.HYear = sYear;
+            BillNew.omodel.HPeriod = sPeriod;
             BillNew.omodel.HBillNo = this.txtHBillNo.Text.Trim();
             BillNew.omodel.HICMOBillNo = this.txtHICMOBillNo.Text.Trim();
             BillNew.omodel.HICMOInterID = DBUtility.ClsPub.isLong(this.txtHICMOBillNo.Tag);
@@ -791,6 +858,7 @@
         private void initGrid()
         {
             DBUtility.Xt_BaseBillFun.initGridMESList(grdCardList, this.Name + "grdCardList");
+            grdCardList.DataSource = null;
 
         }
 
@@ -1554,6 +1622,40 @@
             oBF.HMainSourceInterID = BillOld.omodel.HInterID;
             oBF.HProcExchInterID = lngBillKey;
             oBF.HProcExchEntryID = lngBillSubKey;
+            oBF.HBillSubType = "涓嶈壇璇勫";
+            oBF.txtHLotNo.Text = txtHProcExchBillNo.Text;
+            oBF.txtHOrderProcNo.Text = txtHOrderProcNO.Text;
+            oBF.txtHMaterID.Text = txtHMaterName.Text;
+            oBF.txtHMaterNumber.Text = txtHMaterID.Text;
+            oBF.txtHModel.Text = txtHMaterModel.Text;
+            oBF.txtHMaterID.Tag = txtHMaterID.Tag;
+            oBF.txtHProcID.Tag = txtHProcID.Tag;
+            oBF.txtHProcID.Text = txtHProcID.Text;
+            oBF.txtHWorkCenterID.Text = txtHCenterID.Text;
+            oBF.txtHWorkCenterID.Tag = txtHCenterID.Tag;
+            oBF.txtHICMOInterID.Text = Pub_Class.ClsPub.isStrNull(txtHICMOBillNo.Tag);
+            oBF.txtHICMOBillNo.Text = txtHICMOBillNo.Text;
+            oBF.txtHProcExchQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHPlanQty.Text));
+            oBF.txtHPlanQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHBadCount.Text));
+            oBF.txtHPlanPNL.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHBadPNL.Text));
+            oBF.txtHBadPNL.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHBadPNL.Text));
+            oBF.txtHBadQty.Text = ClsPub.isStrNull(ClsPub.isDoule(txtHBadCount.Text));
+            oBF.ShowDialog();
+            if (oBF.BillChange)
+            {
+                this.Sub_ShowBill();
+            }
+        }
+
+        //鎶ュ簾鍝佽川纭鎸夐挳
+        private void cmdBFChecker_Click(object sender, EventArgs e)
+        {
+            QC_NoPassProdCheckBill oBF = new QC_NoPassProdCheckBill();
+            oBF.BillStatus = DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew;
+            oBF.HMainSourceInterID = BillOld.omodel.HInterID;
+            oBF.HProcExchInterID = lngBillKey;
+            oBF.HProcExchEntryID = lngBillSubKey;
+            oBF.HBillSubType = "鎶ュ簾璇勫";
             oBF.txtHLotNo.Text = txtHProcExchBillNo.Text;
             oBF.txtHOrderProcNo.Text = txtHOrderProcNO.Text;
             oBF.txtHMaterID.Text = txtHMaterName.Text;
@@ -1575,7 +1677,7 @@
             if (oBF.BillChange)
             {
                 this.Sub_ShowBill();
-            } 
+            }
         }
 
         private void label20_Click(object sender, EventArgs e)

--
Gitblit v1.9.1