Browse Source

修改BUG代码

章政 8 years ago
parent
commit
0475ed21c3

+ 24 - 22
UAS-MES/FunctionCode/OQC/OQC_Inspection.Designer.cs

@@ -72,7 +72,7 @@
             this.panel2.Controls.Add(this.label1);
             this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
             this.panel2.Location = new System.Drawing.Point(0, 0);
-            this.panel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.panel2.Margin = new System.Windows.Forms.Padding(4);
             this.panel2.Name = "panel2";
             this.panel2.Size = new System.Drawing.Size(1220, 35);
             this.panel2.TabIndex = 89;
@@ -183,7 +183,7 @@
             this.WithDraw.AutoSize = true;
             this.WithDraw.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.WithDraw.Location = new System.Drawing.Point(556, 676);
-            this.WithDraw.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.WithDraw.Margin = new System.Windows.Forms.Padding(4);
             this.WithDraw.Name = "WithDraw";
             this.WithDraw.Size = new System.Drawing.Size(74, 31);
             this.WithDraw.TabIndex = 169;
@@ -198,7 +198,7 @@
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
             this.ma_code.Location = new System.Drawing.Point(136, 175);
-            this.ma_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(4);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.ReturnData = null;
@@ -218,7 +218,7 @@
             this.ChooseAll.Image = ((System.Drawing.Image)(resources.GetObject("ChooseAll.Image")));
             this.ChooseAll.IsShowBorder = true;
             this.ChooseAll.Location = new System.Drawing.Point(739, 634);
-            this.ChooseAll.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ChooseAll.Margin = new System.Windows.Forms.Padding(4);
             this.ChooseAll.MoveImage = ((System.Drawing.Image)(resources.GetObject("ChooseAll.MoveImage")));
             this.ChooseAll.Name = "ChooseAll";
             this.ChooseAll.NormalImage = ((System.Drawing.Image)(resources.GetObject("ChooseAll.NormalImage")));
@@ -233,7 +233,7 @@
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OperateResult.Location = new System.Drawing.Point(931, 219);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(280, 398);
             this.OperateResult.TabIndex = 174;
@@ -248,7 +248,7 @@
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
             this.Clean.Location = new System.Drawing.Point(1029, 632);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Clean.Margin = new System.Windows.Forms.Padding(4);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
@@ -268,7 +268,7 @@
             this.Delete.Image = ((System.Drawing.Image)(resources.GetObject("Delete.Image")));
             this.Delete.IsShowBorder = true;
             this.Delete.Location = new System.Drawing.Point(213, 712);
-            this.Delete.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Delete.Margin = new System.Windows.Forms.Padding(4);
             this.Delete.MoveImage = ((System.Drawing.Image)(resources.GetObject("Delete.MoveImage")));
             this.Delete.Name = "Delete";
             this.Delete.NormalImage = ((System.Drawing.Image)(resources.GetObject("Delete.NormalImage")));
@@ -289,7 +289,7 @@
             this.SendOQC.Image = ((System.Drawing.Image)(resources.GetObject("SendOQC.Image")));
             this.SendOQC.IsShowBorder = true;
             this.SendOQC.Location = new System.Drawing.Point(361, 712);
-            this.SendOQC.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.SendOQC.Margin = new System.Windows.Forms.Padding(4);
             this.SendOQC.MoveImage = ((System.Drawing.Image)(resources.GetObject("SendOQC.MoveImage")));
             this.SendOQC.Name = "SendOQC";
             this.SendOQC.NormalImage = ((System.Drawing.Image)(resources.GetObject("SendOQC.NormalImage")));
@@ -309,7 +309,7 @@
             this.GetBatch.Image = ((System.Drawing.Image)(resources.GetObject("GetBatch.Image")));
             this.GetBatch.IsShowBorder = true;
             this.GetBatch.Location = new System.Drawing.Point(931, 175);
-            this.GetBatch.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.GetBatch.Margin = new System.Windows.Forms.Padding(4);
             this.GetBatch.MoveImage = ((System.Drawing.Image)(resources.GetObject("GetBatch.MoveImage")));
             this.GetBatch.Name = "GetBatch";
             this.GetBatch.NormalImage = ((System.Drawing.Image)(resources.GetObject("GetBatch.NormalImage")));
@@ -326,7 +326,7 @@
             this.pa_outboxcode.BackColor = System.Drawing.Color.White;
             this.pa_outboxcode.ID = null;
             this.pa_outboxcode.Location = new System.Drawing.Point(156, 678);
-            this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(4);
             this.pa_outboxcode.Name = "pa_outboxcode";
             this.pa_outboxcode.Power = null;
             this.pa_outboxcode.Size = new System.Drawing.Size(388, 25);
@@ -343,7 +343,7 @@
             this.ob_batchqty.BackColor = System.Drawing.Color.White;
             this.ob_batchqty.ID = null;
             this.ob_batchqty.Location = new System.Drawing.Point(156, 634);
-            this.ob_batchqty.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_batchqty.Margin = new System.Windows.Forms.Padding(4);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Power = null;
             this.ob_batchqty.Size = new System.Drawing.Size(388, 25);
@@ -362,7 +362,7 @@
             this.RemoveAll.Image = ((System.Drawing.Image)(resources.GetObject("RemoveAll.Image")));
             this.RemoveAll.IsShowBorder = true;
             this.RemoveAll.Location = new System.Drawing.Point(843, 634);
-            this.RemoveAll.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.RemoveAll.Margin = new System.Windows.Forms.Padding(4);
             this.RemoveAll.MoveImage = ((System.Drawing.Image)(resources.GetObject("RemoveAll.MoveImage")));
             this.RemoveAll.Name = "RemoveAll";
             this.RemoveAll.NormalImage = ((System.Drawing.Image)(resources.GetObject("RemoveAll.NormalImage")));
@@ -382,7 +382,7 @@
             this.NewBatch.Image = ((System.Drawing.Image)(resources.GetObject("NewBatch.Image")));
             this.NewBatch.IsShowBorder = true;
             this.NewBatch.Location = new System.Drawing.Point(931, 128);
-            this.NewBatch.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.NewBatch.Margin = new System.Windows.Forms.Padding(4);
             this.NewBatch.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewBatch.MoveImage")));
             this.NewBatch.Name = "NewBatch";
             this.NewBatch.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewBatch.NormalImage")));
@@ -401,7 +401,7 @@
             this.ob_status.Enabled = false;
             this.ob_status.ID = null;
             this.ob_status.Location = new System.Drawing.Point(817, 175);
-            this.ob_status.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_status.Margin = new System.Windows.Forms.Padding(4);
             this.ob_status.Name = "ob_status";
             this.ob_status.Power = null;
             this.ob_status.Size = new System.Drawing.Size(103, 25);
@@ -418,7 +418,7 @@
             this.ma_prodcode.Enabled = false;
             this.ma_prodcode.ID = null;
             this.ma_prodcode.Location = new System.Drawing.Point(479, 175);
-            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4);
             this.ma_prodcode.Name = "ma_prodcode";
             this.ma_prodcode.Power = null;
             this.ma_prodcode.Size = new System.Drawing.Size(187, 25);
@@ -434,7 +434,7 @@
             this.ob_checkno.BackColor = System.Drawing.Color.White;
             this.ob_checkno.ID = null;
             this.ob_checkno.Location = new System.Drawing.Point(137, 52);
-            this.ob_checkno.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_checkno.Margin = new System.Windows.Forms.Padding(4);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Power = null;
             this.ob_checkno.Size = new System.Drawing.Size(424, 25);
@@ -452,7 +452,7 @@
             this.obd_outboxcode.BackColor = System.Drawing.Color.White;
             this.obd_outboxcode.ID = null;
             this.obd_outboxcode.Location = new System.Drawing.Point(137, 91);
-            this.obd_outboxcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.obd_outboxcode.Margin = new System.Windows.Forms.Padding(4);
             this.obd_outboxcode.Name = "obd_outboxcode";
             this.obd_outboxcode.Power = null;
             this.obd_outboxcode.Size = new System.Drawing.Size(424, 25);
@@ -469,7 +469,7 @@
             this.ms_sncode.BackColor = System.Drawing.Color.White;
             this.ms_sncode.ID = null;
             this.ms_sncode.Location = new System.Drawing.Point(137, 132);
-            this.ms_sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ms_sncode.Margin = new System.Windows.Forms.Padding(4);
             this.ms_sncode.Name = "ms_sncode";
             this.ms_sncode.Power = null;
             this.ms_sncode.Size = new System.Drawing.Size(424, 25);
@@ -491,7 +491,7 @@
             this.obd_id,
             this.obd_makecode});
             this.CheckBatchDGV.Location = new System.Drawing.Point(36, 218);
-            this.CheckBatchDGV.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CheckBatchDGV.Margin = new System.Windows.Forms.Padding(4);
             this.CheckBatchDGV.Name = "CheckBatchDGV";
             this.CheckBatchDGV.RowHeadersWidth = 20;
             this.CheckBatchDGV.RowTemplate.Height = 23;
@@ -505,16 +505,17 @@
             // 
             this.勾选.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
             this.勾选.HeaderText = "勾选";
+            this.勾选.MinimumWidth = 60;
             this.勾选.Name = "勾选";
             this.勾选.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.勾选.Width = 42;
+            this.勾选.Width = 60;
             // 
             // ob_batchqty_dgv
             // 
             this.ob_batchqty_dgv.DataPropertyName = "ob_batchqty";
             this.ob_batchqty_dgv.HeaderText = "数量";
             this.ob_batchqty_dgv.Name = "ob_batchqty_dgv";
-            this.ob_batchqty_dgv.Width = 210;
+            this.ob_batchqty_dgv.Width = 80;
             // 
             // obd_outboxcode_dgv
             // 
@@ -534,6 +535,7 @@
             // 
             this.obd_makecode.DataPropertyName = "obd_makecode";
             this.obd_makecode.HeaderText = "工单号";
+            this.obd_makecode.MinimumWidth = 120;
             this.obd_makecode.Name = "obd_makecode";
             this.obd_makecode.Width = 215;
             // 
@@ -570,7 +572,7 @@
             this.Controls.Add(this.CheckBatchDGV);
             this.Controls.Add(this.panel2);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "OQC_Inspection";
             this.Tag = "OQC!Inspection";
             this.Text = "生成送检批";

+ 7 - 21
UAS-MES/FunctionCode/OQC/OQC_Inspection.cs

@@ -50,10 +50,10 @@ namespace UAS_MES.OQC
                 string ob_id = dh.GetSEQ("OQCBatch_SEQ");
                 string checkno = "";
                 LogicHandler.GetSerialNumByCaller("Make!CheckQC",out checkno);
+                sql.Clear();
                 sql.Append("insert into OQCBatch (ob_id, ob_checkno ,ob_status, ob_source,ob_indate,ob_checkman) ");
                 sql.Append("values( '" + ob_id + "','" + checkno + "', 'ENTERING', '新增', sysdate, '" + User.UserName + "')");
                 dh.ExecuteSql(sql.GetString(), "insert");
-                sql.Clear();
                 //记录操作日志
                 LogicHandler.InsertMessageLog(User.UserName, "生成新批", "成功", "", "");
                 //生成成功,将批次号,以及批次状态写入页面
@@ -85,8 +85,7 @@ namespace UAS_MES.OQC
                             GetBatch.PerformClick();
                             OperateResult.AppendText(">>箱号已从送检批中移除\n", Color.Green);
                         }
-                        else
-                            OperateResult.AppendText(">>箱号不在抽检明细中\n", Color.Red);
+                        else OperateResult.AppendText(">>箱号不在抽检明细中\n", Color.Red);
                     }
                     //未勾选撤销
                     else
@@ -114,33 +113,20 @@ namespace UAS_MES.OQC
                                     dh.UpdateByCondition("OQCBatch", "ob_batchqty =(select count(1) from OQCBatchDetail where obd_obid=" + obd_id + ")", "ob_id=" + obd_id);
                                     dh.UpdateByCondition("makeserial", "ms_checkno='" + ob_checkno.Text + "'", "exists (select 1 from OQCBatchDetail where obd_obid ='" + obd_id + "' and obd_makecode = ms_makecode and  ms_sncode = obd_sncode)");
                                     GetBatch.PerformClick();
-                                    OperateResult.AppendText(">>箱号成功维护到送检批\n", Color.Green);
+                                    OperateResult.AppendText(">>箱号成功维护到送检批\n", Color.Green, pa_outboxcode);
                                 }
                                 //存在则进行提示
-                                else
-                                    OperateResult.AppendText(">>箱号已存在送检批" + dt.Rows[0]["obd_checkno"] + "中\n", Color.Red);
+                                else OperateResult.AppendText(">>箱号已存在送检批" + dt.Rows[0]["obd_checkno"] + "中\n", Color.Red, pa_outboxcode);
                             }
                             else if (ma_prodcode.Text == "")
                             {
                             }
-                            else
-                            {
-                                BaseUtil.CleanForm(this);
-                                OperateResult.AppendText(">>箱内产品与抽检批次产品不一致\n", Color.Red);
-                            }
-                        }
-                        else
-                        {
-                            BaseUtil.CleanForm(this);
-                            OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "不存在\n", Color.Red);
+                            else OperateResult.AppendText(">>箱内产品与抽检批次产品不一致\n", Color.Red, pa_outboxcode);
                         }
+                        else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "不存在\n", Color.Red, pa_outboxcode);
                     }
                 }
-                else
-                {
-                    BaseUtil.CleanForm(this);
-                    OperateResult.AppendText(">>只允许在录入状态的抽检批才允许操作\n", Color.Red);
-                }
+                else OperateResult.AppendText(">>只允许在录入状态的抽检批才允许操作\n", Color.Red, pa_outboxcode);
             }
         }
 

+ 10 - 1
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -114,6 +114,15 @@ namespace UAS_MES.OQC
                 //判断当前的检验状态
                 if (ob_status.Text == "待检验" || ob_status.Text == "检验中")
                 {
+                    DataTable temp = dh.getFieldsDatasByCondition("makeserial", new string[] { "nvl(ms_ifrework,0)ms_ifrework", "ms_reworkcheckno", "ms_reworkstatus" }, "upper(ms_sncode)='" + sncode.Text.ToUpper() + "' order by ms_id desc");
+                    if (temp.Rows.Count > 0)
+                    {
+                        if (temp.Rows[0]["ms_reworkstatus"].ToString() == "3")
+                        {
+                            OperateResult.AppendText(">>返修的不良序列号必须先进行维修\n", Color.Red);
+                            return false;
+                        }
+                    }
                     dt = (DataTable)dh.ExecuteSql("select obd_sncode,ob_source,obd_makecode from OQCBatchDetail left join OQCBatch  on ob_id=obd_obid where obd_sncode='" + sncode.Text + "' and ob_checkno='" + ob_checkno.Text + "'", "select");
                     if (dt.Rows.Count > 0)
                     {
@@ -326,12 +335,12 @@ namespace UAS_MES.OQC
                         dh.ExecuteSql("update OQCBATCH set ob_ngqty='" + ngqty + "',ob_actsampleqty='" + checkqty + "',ob_okqty=('" + checkqty + "'-'" + ngqty + "') where ob_checkno ='" + ob_checkno.Text + "'", "update");
                         OperateResult.AppendText(">>序列号 " + sncode.Text + "操作成功\n", Color.Green);
                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "抽样数据采集", "检验项目采集成功", sncode.Text, ob_checkno.Text);
-                        GetBatch.PerformClick();
                         ChoosedDGV.DataSource = null;
                         BaseUtil.CleanDGVData(CheckTypeDGV);
                         BaseUtil.CleanDGVData(WaitChooseDGV);
                         sncode.Text = "";
                         sncode.Focus();
+                        GetBatch.PerformClick();
                     }
                     else OperateResult.AppendText(">>含有未通过项请勾选不良明细\n", Color.Red);
                 }