Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 years ago
parent
commit
0318675181

+ 28 - 8
UAS-MES/CustomControl/DataGrid_View/DataGridViewWithSerialNum.cs

@@ -13,6 +13,22 @@ namespace UAS_MES.CustomControl.DataGrid_View
     public partial class DataGridViewWithSerialNum : DataGridView
     {
         SolidBrush solidBrush;
+
+        bool EnableContentClick1 = true;
+
+        public bool EnableContentClick
+        {
+            get
+            {
+                return EnableContentClick1;
+            }
+
+            set
+            {
+                EnableContentClick1 = value;
+            }
+        }
+
         public DataGridViewWithSerialNum()
         {
             InitializeComponent();
@@ -27,24 +43,28 @@ namespace UAS_MES.CustomControl.DataGrid_View
 
         private void DataGridViewWithSerialNum_CellContentClick(object sender, DataGridViewCellEventArgs e)
         {
-            if (Columns[0] is DataGridViewCheckBoxColumn && e.ColumnIndex >= 0 && e.RowIndex >= 0)
+            if (EnableContentClick1)
             {
-                if (!(Columns[e.ColumnIndex] is DataGridViewCheckBoxColumn)&&!(Columns[e.ColumnIndex] is DataGridViewComboBoxColumn))
+                if (Columns[0] is DataGridViewCheckBoxColumn && e.ColumnIndex >= 0 && e.RowIndex >= 0)
                 {
-                    if (Rows[e.RowIndex].Cells[0].Value != null)
+                    if (!(Columns[e.ColumnIndex] is DataGridViewCheckBoxColumn) && !(Columns[e.ColumnIndex] is DataGridViewComboBoxColumn))
                     {
-                        if (Rows[e.RowIndex].Cells[0].Value.ToString() == "0")
+                        if (Rows[e.RowIndex].Cells[0].Value != null)
                         {
-                            Rows[e.RowIndex].Cells[0].Value = 1;
+                            if (Rows[e.RowIndex].Cells[0].Value.ToString() == "0")
+                            {
+                                Rows[e.RowIndex].Cells[0].Value = 1;
+                            }
+                            else
+                            {
+                                Rows[e.RowIndex].Cells[0].Value = 0;
+                            }
                         }
                         else
                         {
                             Rows[e.RowIndex].Cells[0].Value = 0;
                         }
                     }
-                    else {
-                        Rows[e.RowIndex].Cells[0].Value = 0;
-                    }
                 }
             }
         }

+ 0 - 16
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.Designer.cs

@@ -53,7 +53,6 @@
             this.PrinterList = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.StartWeight = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Confirm = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.pd_barcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.StopWeight = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.ma_code = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ma_qty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -373,19 +372,6 @@
             this.Confirm.UseVisualStyleBackColor = true;
             this.Confirm.Click += new System.EventHandler(this.Confirm_Click);
             // 
-            // pd_barcode
-            // 
-            this.pd_barcode.AutoSize = true;
-            this.pd_barcode.CutLength = null;
-            this.pd_barcode.Location = new System.Drawing.Point(1249, 26);
-            this.pd_barcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pd_barcode.MaximumSize = new System.Drawing.Size(200, 0);
-            this.pd_barcode.Name = "pd_barcode";
-            this.pd_barcode.Size = new System.Drawing.Size(87, 15);
-            this.pd_barcode.TabIndex = 107;
-            this.pd_barcode.Text = "pd_barcode";
-            this.pd_barcode.Visible = false;
-            // 
             // StopWeight
             // 
             this.StopWeight.AllPower = null;
@@ -579,7 +565,6 @@
             this.Controls.Add(this.PrintLabel);
             this.Controls.Add(this.StartWeight);
             this.Controls.Add(this.Confirm);
-            this.Controls.Add(this.pd_barcode);
             this.Controls.Add(this.StopWeight);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.ma_qty);
@@ -639,7 +624,6 @@
         private System.Windows.Forms.Label ma_qty_label;
         private System.Windows.Forms.Label ma_salecode_label;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
-        private CustomControl.ValueLabel.ValueLabel pd_barcode;
         private CustomControl.ButtonUtil.NormalButton Confirm;
         private CustomControl.ButtonUtil.NormalButton StartWeight;
         private System.Windows.Forms.ComboBox PrintLabel;

+ 24 - 10
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.cs

@@ -98,13 +98,18 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
+                //获取序列号的箱号
+                string ms_outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_sncode='" + outboxcode.Text + "' order by ms_id desc").ToString();
+                if (ms_outboxcode != "")
+                {
+                    outboxcode.Text = ms_outboxcode;
+                }
                 //根据箱号查询表单数据
-                pd_barcode.Text = dh.getFieldDataByCondition("makeserial left join package on ms_prodcode=pa_prodcode", "ms_sncode", "pa_outboxcode='" + outboxcode.Text + "'").ToString();
                 sql.Clear();
                 sql.Append("select pa_totalqty,ma_code,mcd_inqty,ma_qty,ma_qty-mcd_inqty as mcd_waitqty,ma_salecode,pr_detail,pr_cartonunit,pr_code,pr_cartongw,");
-                sql.Append("pr_cartonmaxw,pr_cartonminw from package left join product on pr_code=pa_prodcode left join make on ma_prodcode=pr_code and ma_code=pa_makecode  ");
+                sql.Append("pr_cartonmaxw,pr_cartonminw from package left join product on pr_code=pa_prodcode left join make on ma_prodcode=pr_code ");
                 sql.Append("left join makecraftdetail on mcd_macode=ma_code where pa_outboxcode='" + outboxcode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
-                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 //填充Form的值
                 BaseUtil.SetFormValue(this.Controls, dt);
                 //填充打印文件选项的DataGridView
@@ -124,14 +129,25 @@ namespace UAS_MES.Make
                         pr_cartongw.Text = Weight + "±" + (MaxWeight - Weight);
                     else
                         pr_cartongw.Text = MinWeight + "-" + MaxWeight;
+                    if (pr_cartonunit.Text == "kg")
+                    {
+                        weight.Text = (float.Parse(weight.Text) / 1000).ToString();
+                    }
                     double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text);
                     //称量合格或不合格都记录重量
                     if (ActualWeight >= MinWeight && ActualWeight <= MaxWeight)
                     {
                         if (AutoPrint.Checked)
                         {
-                            doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
-                            Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text));
+                            if (PrintLabel.Items.Count > 0)
+                            {
+                                doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
+                                Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text));
+                            }
+                            else
+                            {
+                                OperateResult.AppendText(">>产品" + pr_code.Text + "未维护卡通标签\n", Color.Green);
+                            }
                         }
                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "卡通箱称重", "称量合格", outboxcode.Text, "");
                         OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green);
@@ -143,7 +159,7 @@ namespace UAS_MES.Make
                     }
                     ListViewItem lsi = new ListViewItem();
                     lsi.SubItems.Add(outboxcode.Text);
-                    lsi.SubItems.Add(ActualWeight.ToString());
+                    lsi.SubItems.Add(ActualWeight.ToString() + pr_cartonunit.Text);
                     lsi.SubItems.Add(System.DateTime.Now.ToString());
                     WeighRecord.Items.Add(lsi);
                     dh.ExecuteSql("update package set pa_weight='" + weight.Text + "', pa_printcount= nvl(pa_printcount,0)+1 where pa_outboxcode='" + outboxcode.Text + "'", "update");
@@ -168,8 +184,6 @@ namespace UAS_MES.Make
                             try
                             {
                                 weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
-                                if (pr_cartonunit.Text == "kg")
-                                    weight.Text = (float.Parse(weight.Text) / 1000).ToString();
                             }
                             catch (Exception)
                             {
@@ -186,8 +200,8 @@ namespace UAS_MES.Make
         //确认打印
         private void Confirm_Click(object sender, EventArgs e)
         {
-            doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
-            Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text));
+            doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
+            Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text));
         }
 
         //停止进程,关闭串口

+ 5 - 4
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -183,7 +183,8 @@ namespace UAS_MES.Make
                                     weight.Text = (float.Parse(weight.Text) / 1000).ToString();
                                     WeightChange = true;
                                 }
-                                else {
+                                else
+                                {
                                     WeightChange = false;
                                 }
                             }
@@ -237,7 +238,7 @@ namespace UAS_MES.Make
         {
             if (PrintLabel.Items.Count != 0)
             {
-                doc = lbl.Documents.Open(ftpOperater.DownLoadTo+ PrintLabel.Text);
+                doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
                 Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text));
             }
             else
@@ -306,7 +307,7 @@ namespace UAS_MES.Make
             OperateResult.AppendText(">>批次" + ob_checkno.Text + "送检成功\n", Color.Green);
             LogicHandler.InsertMakeProcess(LastSncode, ms_makecode.Text, User.UserSourceCode, "手动送检", "手动送检成功", User.UserCode);
             //记录操作日志
-            LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "手动送检", "手动送检成功", "", ob_checkno.Text);
+            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "手动送检", "手动送检成功", "", ob_checkno.Text);
             ob_checkno.Text = "";
         }
 
@@ -341,7 +342,7 @@ namespace UAS_MES.Make
                     OperateResult.AppendText(">>当前采集数量已达到送检数量\n", Color.Red);
                     if (AutoCut)
                     {
-                        OperateResult.AppendText(">>批次"+ob_checkno.Text+"自动断批\n", Color.Green);
+                        OperateResult.AppendText(">>批次" + ob_checkno.Text + "自动断批\n", Color.Green);
                     }
                 }
             }

+ 1 - 0
UAS-MES/FunctionCode/OQC/OQC_CheckNoSplit.Designer.cs

@@ -220,6 +220,7 @@
             this.obd_makecode,
             this.obd_sncode,
             this.obd_builddate});
+            this.OutBoxDGV.EnableContentClick = false;
             this.OutBoxDGV.Location = new System.Drawing.Point(39, 281);
             this.OutBoxDGV.Name = "OutBoxDGV";
             this.OutBoxDGV.RowTemplate.Height = 27;

+ 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);
                 }