Hcsy 8 år sedan
förälder
incheckning
f4f09e8c16

+ 37 - 0
UAS-MES/CustomControl/PowerControlForm/PowerControlForm.Designer.cs

@@ -0,0 +1,37 @@
+namespace UAS_MES.CustomControl.PowerControlForm
+{
+    partial class PowerControlForm
+    {
+        /// <summary> 
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region 组件设计器生成的代码
+
+        /// <summary> 
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            components = new System.ComponentModel.Container();
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+        }
+
+        #endregion
+    }
+}

+ 49 - 0
UAS-MES/CustomControl/PowerControlForm/PowerControlForm.cs

@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace UAS_MES.CustomControl.PowerControlForm
+{
+    public partial class PowerControlForm : Form
+    {
+        string PowerRead1;
+
+        public string PowerRead
+        {
+            get
+            {
+                return PowerRead1;
+            }
+
+            set
+            {
+                PowerRead1 = value;
+            }
+        }
+
+        string AllPower1;
+
+        public string AllPower
+        {
+            get
+            {
+                return AllPower1;
+            }
+
+            set
+            {
+                AllPower1 = value;
+            }
+        }
+
+        public PowerControlForm()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 4 - 1
UAS-MES/CustomControl/TextBoxWithIcon/MaCodeTextBox.cs

@@ -88,8 +88,11 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
                 if (Text != "")
                 {
                     string ErrorMessage = "";
-                    if (!LogicHandler.CheckMakeStatus(Text,out ErrorMessage))
+                    if (!LogicHandler.CheckMakeStatus(Text, out ErrorMessage))
+                    {
+                        Text = "";
                         BaseUtil.ShowError(ErrorMessage);
+                    }
                 }
                 else
                     BaseUtil.ShowError("工单号不能为空");

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_CheckNoRelpace.cs

@@ -61,7 +61,7 @@ namespace UAS_MES.Make
                     }
                     //记录MakeProcess和一般的操作日志
                     LogicHandler.InsertMessageLog(User.UserName, "变更序列号,备注:" + ReplaceReason.Text, "变更成功", "MakeSerial|ms_sncode=" + new_sncode.Text, "");
-                    LogicHandler.InsertMakeProcess(new_sncode.Text, dh.getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_sncode='" + new_sncode.Text + "'").ToString(),"序列号转换操作", "变更序列号成功,备注:" + ReplaceReason.Text, User.UserName);
+                    LogicHandler.InsertMakeProcess(new_sncode.Text, dh.getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_sncode='" + new_sncode.Text + "'").ToString(),User.UserSourceCode,"序列号转换操作", "变更序列号成功,备注:" + ReplaceReason.Text, User.UserName);
                     OperateResult.AppendText(">>序列号" + old_sncode.Text + "已成功替换为" + new_sncode.Text + "\n", Color.Green);
                 }
                 else

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -163,7 +163,7 @@ namespace UAS_MES.Make
                     else if (Step == "UnLoading")
                     {
                         string ErrorMessage1 = "";
-                        if (LogicHandler.SetMaterialDown(sn_code, sncode.Text, User.CurrentStepCode, User.UserName, out ErrorMessage1))
+                        if (LogicHandler.SetMaterialDown(sn_code, sncode.Text,User.UserSourceCode, User.CurrentStepCode, User.UserName, out ErrorMessage1))
                         {
                             OperateResult.AppendText(">>条码" + sncode.Text + "下料成功\n", Color.Green);
                         }

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -344,7 +344,7 @@ namespace UAS_MES.Make
                             string cm_stepcode = dt.Rows[0]["cm_stepcode"].ToString();
                             string cm_mccode = dt.Rows[0]["cm_mccode"].ToString();
                             dh.ExecuteSql("delete from Craftmaterial where cm_id=" + cm_id, "delete");
-                            LogicHandler.InsertMakeProcess(ms_macode, sn_code.Text, "上料采集操作", "下料成功", User.UserName);
+                            LogicHandler.InsertMakeProcess(ms_macode, sn_code.Text,User.UserSourceCode, "上料采集操作", "下料成功", User.UserName);
                             int count = dh.getRowCount("craftMaterial", "cm_mccode='" + cm_mccode + "' and cm_stepcode='" + cm_stepcode + "' and cm_sncode='" + sn_code.Text + "'");
                             if (count == 0)
                                 dh.UpdateByCondition("makecraftdetail ", "mcd_inqty=mcd_inqty-1,mcd_outqty=mcd_outqty-1,mcd_okqty = mcd_okqty - 1", "mcd_mccode='" + cm_mccode + "' and mcd_stepcode='" + cm_stepcode + "'");

+ 8 - 2
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -173,8 +173,10 @@ namespace UAS_MES.Make
                 mbr_dutycode.Text = BadInf_2[mbr_id]["mbr_dutycode"];
                 mbc_component.Text = dh.getFieldDataByCondition("makebadrscom", "mbc_component", "mbc_mbrid=" + mbr_id).ToString();
                 //加载两个Grid的数据源
-                mbp_partdgv.DataSource = (DataTable)dh.ExecuteSql("select mbp_id,mbp_part from makebadrspart where mbp_mbrid=" + mbr_id, "select");
-                mbl_locdgv.DataSource = (DataTable)dh.ExecuteSql("select mbl_id,mbl_loc from makebadrsloc where mbl_mbrid=" + mbr_id, "select");
+                DataTable dt = (DataTable)dh.ExecuteSql("select mbp_id,mbp_part from makebadrspart where mbp_mbrid=" + mbr_id, "select");
+                BaseUtil.FillDgvWithDataTable(mbp_partdgv,dt);
+                dt = (DataTable)dh.ExecuteSql("select mbl_id,mbl_loc from makebadrsloc where mbl_mbrid=" + mbr_id, "select");
+                BaseUtil.FillDgvWithDataTable(mbl_locdgv,dt);
             }
         }
 
@@ -418,6 +420,10 @@ namespace UAS_MES.Make
                     if (mbr_id != "")
                     {
                         dt = (DataTable)mbl_locdgv.DataSource;
+                        for (int i = 0; i < dt.Rows.Count; i++)
+                        {
+
+                        }
                         DataRow dr = dt.NewRow();
                         dr["mbl_loc"] = mbl_loc.Text;
                         dt.Rows.Add(dr);

+ 16 - 26
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -8,6 +8,7 @@ using UAS_MES.DataOperate;
 using UAS_MES.Entity;
 using UAS_MES.PublicMethod;
 using System.Collections.Generic;
+using UAS_MES.CustomControl.PowerControlForm;
 
 namespace UAS_MES.Make
 {
@@ -28,8 +29,6 @@ namespace UAS_MES.Make
         string ms_macode;
 
         string ErrorMessage = "";
-        //用于保存是否之前输入的ma_code
-
         //用于保存是否之前输入的ms_sncode
         string ms_sncode1;
 
@@ -164,7 +163,6 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                WaitRejectList.Items.Clear();
                 ChoosedRejectList.Items.Clear();
                 WaitList.Clear();
                 ChoosedList.Clear();
@@ -291,13 +289,16 @@ namespace UAS_MES.Make
             if (Reject.Checked)
             {
                 LoadBadCodeListView();
+                OperateResult.AppendText(">>请采集不良代码\n", Color.Green);
                 bc_code.Focus();
                 //勾选了自动产生代码
                 if (AutoBadCode.Checked)
                     Save_Click(new object(), new EventArgs());
             }
             else if (GoodProduct.Checked)
+            {
                 SetTestPass();
+            }
             //加载页面信息
             LoadCollectedNum();
         }
@@ -323,7 +324,7 @@ namespace UAS_MES.Make
                     ErrorMessage += "【" + dt.Rows[i]["bc_name"].ToString() + "】";
             }
             //存在不良记录
-            if (ErrorMessage!="")
+            if (ErrorMessage != "")
                 OperateResult.AppendText(">>序列号:" + ms_sncode.Text + " 已经判为不良品,不允许修改!\n", Color.Red);
             else
             {
@@ -370,9 +371,9 @@ namespace UAS_MES.Make
                 }
                 else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
                 int RejectCount = ChoosedRejectList.Items.Count;
-                string[] bccode = new string[bc_code.Text == "" ? RejectCount : RejectCount + 1];
-                string[] bcremark = new string[bc_code.Text == "" ? RejectCount : RejectCount + 1];
-                string[] bgcode = new string[bc_code.Text == "" ? RejectCount : RejectCount + 1];
+                string[] bccode = new string[RejectCount];
+                string[] bcremark = new string[RejectCount];
+                string[] bgcode = new string[RejectCount];
                 if (AutoBadCode.Checked)
                 {
                     string defaultvalue = Properties.Settings.Default.DefaultCollectionValue;
@@ -393,25 +394,15 @@ namespace UAS_MES.Make
                         //保存前台传送的不良信息保存至makebad 表。(判断不良原因是否重复)
                         //新建不良代码和备注的变量
                         //不良品的输入
-                        //如果长度不相等表示用户自行填写了
-                        if (bccode.Length != RejectCount)
-                        {
-                            bgcode[0] = bc_groupcode.SelectedValue.ToString();
-                            bccode[0] = bc_code.Text;
-                            bcremark[0] = bc_remark.Text;
-                        }
                         //用户未填写不良代码一切按照正常逻辑,填写了从index=1开始执行
-                        for (int i = (bc_code.Text == "" ? 0 : 1); i < (bc_code.Text == "" ? RejectCount : RejectCount + 1); i++)
+                        for (int i = 0; i < RejectCount; i++)
                         {
-                            if (!(bccode[0] == ChoosedRejectList.Items[bc_code.Text == "" ? i : i - 1].SubItems[1].Text))
-                            {
-                                //截取分号前面的内容
-                                bgcode[i] = ChoosedRejectList.Items[bc_code.Text == "" ? i : i - 1].SubItems[1].Text.Split(':')[0];
-                                //获取所有的不良代码
-                                bccode[i] = ChoosedRejectList.Items[bc_code.Text == "" ? i : i - 1].SubItems[2].Text;
-                                //获取所有的不良备注
-                                bcremark[i] = ChoosedRejectList.Items[bc_code.Text == "" ? i : i - 1].SubItems[3].Text;
-                            }
+                            //截取分号前面的内容
+                            bgcode[i] = ChoosedRejectList.Items[i].SubItems[1].Text.Split(':')[0];
+                            //获取所有的不良代码
+                            bccode[i] = ChoosedRejectList.Items[i].SubItems[2].Text;
+                            //获取所有的不良备注
+                            bcremark[i] = ChoosedRejectList.Items[i].SubItems[3].Text;
                         }
                     }
                 }
@@ -429,12 +420,11 @@ namespace UAS_MES.Make
                 }
                 //不良信息采集
                 dh.ExecuteSql("delete from makebad where mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ma_code.Text + "'", "delete");
-                if (LogicHandler.SetTestNGDetail(ms_sncode.Text, ma_code.Text, User.UserName, User.UserSourceCode, "检查未通过", bgcode, bccode, bcremark, out ErrorMessage))
+                if (LogicHandler.SetTestNGDetail(ms_sncode.Text, ma_code.Text, User.UserCode, User.UserSourceCode, "检查未通过", bgcode, bccode, bcremark, out ErrorMessage))
                 {
                     OperateResult.AppendText(">>" + ms_sncode.Text + "已采集为不良\n", Color.Green, ms_sncode);
                     //清除不良信息
                     bc_code.Text = "";
-                    WaitRejectList.Items.Clear();
                     ChoosedRejectList.Items.Clear();
                     LoadCollectedNum();
                     WaitList.Clear();

+ 1 - 1
UAS-MES/FunctionCode/OQC/OQC_BatchResultJudge.cs

@@ -286,7 +286,7 @@ namespace UAS_MES.OQC
                     string ErrorMessage = "";
                     LogicHandler.UpdateMakeMessage(ms_sncode.Text, ob_makecode.Text, "OQC批判过", User.UserSourceCode, User.UserName, "批次通过", out ErrorMessage);
                     //记录操作日志
-                    LogicHandler.InsertMakeProcess(ms_sncode.Text, ob_makecode.Text, "批结果判定", Operate, User.UserName);
+                    LogicHandler.InsertMakeProcess(ms_sncode.Text, ob_makecode.Text, User.UserSourceCode,"批结果判定", Operate, User.UserName);
                 }
             }
         }

+ 180 - 229
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.Designer.cs

@@ -46,6 +46,7 @@
             this.ob_status = new System.Windows.Forms.Label();
             this.ob_aqlcode_label = new System.Windows.Forms.Label();
             this.ob_maxngacceptqty_label = new System.Windows.Forms.Label();
+            this.ChooseAll = new System.Windows.Forms.CheckBox();
             this.ob_maxngacceptqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_aqlcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_projectcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -57,19 +58,9 @@
             this.bg_code1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.bg_name1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.WaitChooseDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewExpand();
-            this.Column3 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.bg_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.bg_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ob_remark = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.CheckTypeDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewExpand();
-            this.choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.oi_itemcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.oi_ng = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.oi_leveldefect = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ois_remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ois_status = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ois_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ChooseedReject = new UAS_MES.CustomControl.ButtonUtil.ArrowRightButton();
             this.WaitReject = new UAS_MES.CustomControl.ButtonUtil.ArrowLeftButton();
             this.oi_checkqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -90,7 +81,16 @@
             this.obd_outboxcode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ob_makecode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.obd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ChooseAll = new System.Windows.Forms.CheckBox();
+            this.choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.oi_itemcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.oi_ng = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.oi_leveldefect = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ois_remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ois_status = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ois_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Column3 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.bg_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bg_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.ChoosedDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.WaitChooseDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckTypeDGV)).BeginInit();
@@ -102,10 +102,9 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.ob_checkno_label.AutoSize = true;
             this.ob_checkno_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_checkno_label.Location = new System.Drawing.Point(17, 32);
-            this.ob_checkno_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_checkno_label.Location = new System.Drawing.Point(13, 26);
             this.ob_checkno_label.Name = "ob_checkno_label";
-            this.ob_checkno_label.Size = new System.Drawing.Size(72, 27);
+            this.ob_checkno_label.Size = new System.Drawing.Size(58, 21);
             this.ob_checkno_label.TabIndex = 156;
             this.ob_checkno_label.Text = "抽检批";
             // 
@@ -115,10 +114,9 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.obd_outboxcode_label.AutoSize = true;
             this.obd_outboxcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.obd_outboxcode_label.Location = new System.Drawing.Point(17, 72);
-            this.obd_outboxcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.obd_outboxcode_label.Location = new System.Drawing.Point(13, 58);
             this.obd_outboxcode_label.Name = "obd_outboxcode_label";
-            this.obd_outboxcode_label.Size = new System.Drawing.Size(52, 27);
+            this.obd_outboxcode_label.Size = new System.Drawing.Size(42, 21);
             this.obd_outboxcode_label.TabIndex = 154;
             this.obd_outboxcode_label.Text = "箱号";
             // 
@@ -128,10 +126,9 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.ms_sncode_label.AutoSize = true;
             this.ms_sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode_label.Location = new System.Drawing.Point(17, 115);
-            this.ms_sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_sncode_label.Location = new System.Drawing.Point(13, 92);
             this.ms_sncode_label.Name = "ms_sncode_label";
-            this.ms_sncode_label.Size = new System.Drawing.Size(72, 27);
+            this.ms_sncode_label.Size = new System.Drawing.Size(58, 21);
             this.ms_sncode_label.TabIndex = 152;
             this.ms_sncode_label.Text = "序列号";
             // 
@@ -141,10 +138,9 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.bc_code_label.AutoSize = true;
             this.bc_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bc_code_label.Location = new System.Drawing.Point(1076, 214);
-            this.bc_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.bc_code_label.Location = new System.Drawing.Point(807, 171);
             this.bc_code_label.Name = "bc_code_label";
-            this.bc_code_label.Size = new System.Drawing.Size(92, 27);
+            this.bc_code_label.Size = new System.Drawing.Size(74, 21);
             this.bc_code_label.TabIndex = 177;
             this.bc_code_label.Text = "不良代码";
             // 
@@ -154,10 +150,9 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(1076, 51);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(807, 41);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(72, 27);
+            this.label1.Size = new System.Drawing.Size(58, 21);
             this.label1.TabIndex = 179;
             this.label1.Text = "实批数";
             // 
@@ -167,10 +162,9 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(1076, 174);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Location = new System.Drawing.Point(807, 139);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(92, 27);
+            this.label4.Size = new System.Drawing.Size(74, 21);
             this.label4.TabIndex = 185;
             this.label4.Text = "不合格数";
             // 
@@ -180,10 +174,9 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(1076, 131);
-            this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label5.Location = new System.Drawing.Point(807, 105);
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(72, 27);
+            this.label5.Size = new System.Drawing.Size(58, 21);
             this.label5.TabIndex = 187;
             this.label5.Text = "合格数";
             // 
@@ -193,10 +186,9 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(1076, 89);
-            this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label6.Location = new System.Drawing.Point(807, 71);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(72, 27);
+            this.label6.Size = new System.Drawing.Size(58, 21);
             this.label6.TabIndex = 189;
             this.label6.Text = "抽检数";
             // 
@@ -204,10 +196,9 @@
             // 
             this.label9.AutoSize = true;
             this.label9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label9.Location = new System.Drawing.Point(621, 218);
-            this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label9.Location = new System.Drawing.Point(466, 174);
             this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(92, 27);
+            this.label9.Size = new System.Drawing.Size(74, 21);
             this.label9.TabIndex = 192;
             this.label9.Text = "待选不良";
             // 
@@ -217,10 +208,9 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(17, 664);
-            this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label10.Location = new System.Drawing.Point(13, 531);
             this.label10.Name = "label10";
-            this.label10.Size = new System.Drawing.Size(72, 27);
+            this.label10.Size = new System.Drawing.Size(58, 21);
             this.label10.TabIndex = 200;
             this.label10.Text = "录入框";
             // 
@@ -230,10 +220,9 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.ob_remark_label.AutoSize = true;
             this.ob_remark_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_remark_label.Location = new System.Drawing.Point(17, 706);
-            this.ob_remark_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_remark_label.Location = new System.Drawing.Point(13, 565);
             this.ob_remark_label.Name = "ob_remark_label";
-            this.ob_remark_label.Size = new System.Drawing.Size(52, 27);
+            this.ob_remark_label.Size = new System.Drawing.Size(42, 21);
             this.ob_remark_label.TabIndex = 202;
             this.ob_remark_label.Text = "备注";
             // 
@@ -243,10 +232,9 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.obd_makecode_label.AutoSize = true;
             this.obd_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.obd_makecode_label.Location = new System.Drawing.Point(17, 160);
-            this.obd_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.obd_makecode_label.Location = new System.Drawing.Point(13, 128);
             this.obd_makecode_label.Name = "obd_makecode_label";
-            this.obd_makecode_label.Size = new System.Drawing.Size(72, 27);
+            this.obd_makecode_label.Size = new System.Drawing.Size(58, 21);
             this.obd_makecode_label.TabIndex = 206;
             this.obd_makecode_label.Text = "工单号";
             // 
@@ -254,20 +242,18 @@
             // 
             this.ob_prodcode_label.AutoSize = true;
             this.ob_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_prodcode_label.Location = new System.Drawing.Point(320, 160);
-            this.ob_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_prodcode_label.Location = new System.Drawing.Point(240, 128);
             this.ob_prodcode_label.Name = "ob_prodcode_label";
-            this.ob_prodcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ob_prodcode_label.Size = new System.Drawing.Size(74, 21);
             this.ob_prodcode_label.TabIndex = 208;
             this.ob_prodcode_label.Text = "产品编号";
             // 
             // ob_status
             // 
             this.ob_status.AutoSize = true;
-            this.ob_status.Location = new System.Drawing.Point(20, 11);
-            this.ob_status.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_status.Location = new System.Drawing.Point(15, 9);
             this.ob_status.Name = "ob_status";
-            this.ob_status.Size = new System.Drawing.Size(0, 15);
+            this.ob_status.Size = new System.Drawing.Size(0, 12);
             this.ob_status.TabIndex = 212;
             this.ob_status.Visible = false;
             // 
@@ -277,10 +263,9 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.ob_aqlcode_label.AutoSize = true;
             this.ob_aqlcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_aqlcode_label.Location = new System.Drawing.Point(1076, 9);
-            this.ob_aqlcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_aqlcode_label.Location = new System.Drawing.Point(807, 7);
             this.ob_aqlcode_label.Name = "ob_aqlcode_label";
-            this.ob_aqlcode_label.Size = new System.Drawing.Size(52, 27);
+            this.ob_aqlcode_label.Size = new System.Drawing.Size(42, 21);
             this.ob_aqlcode_label.TabIndex = 214;
             this.ob_aqlcode_label.Text = "AQL";
             // 
@@ -290,24 +275,33 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.ob_maxngacceptqty_label.AutoSize = true;
             this.ob_maxngacceptqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_maxngacceptqty_label.Location = new System.Drawing.Point(855, 9);
-            this.ob_maxngacceptqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_maxngacceptqty_label.Location = new System.Drawing.Point(641, 7);
             this.ob_maxngacceptqty_label.Name = "ob_maxngacceptqty_label";
-            this.ob_maxngacceptqty_label.Size = new System.Drawing.Size(172, 27);
+            this.ob_maxngacceptqty_label.Size = new System.Drawing.Size(138, 21);
             this.ob_maxngacceptqty_label.TabIndex = 216;
             this.ob_maxngacceptqty_label.Text = "最大不合格通过数";
             // 
+            // ChooseAll
+            // 
+            this.ChooseAll.AutoSize = true;
+            this.ChooseAll.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ChooseAll.Location = new System.Drawing.Point(16, 502);
+            this.ChooseAll.Name = "ChooseAll";
+            this.ChooseAll.Size = new System.Drawing.Size(61, 25);
+            this.ChooseAll.TabIndex = 199;
+            this.ChooseAll.Text = "全选";
+            this.ChooseAll.UseVisualStyleBackColor = true;
+            // 
             // ob_maxngacceptqty
             // 
             this.ob_maxngacceptqty.AllPower = null;
             this.ob_maxngacceptqty.BackColor = System.Drawing.Color.White;
             this.ob_maxngacceptqty.Enabled = false;
             this.ob_maxngacceptqty.ID = null;
-            this.ob_maxngacceptqty.Location = new System.Drawing.Point(860, 51);
-            this.ob_maxngacceptqty.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_maxngacceptqty.Location = new System.Drawing.Point(645, 41);
             this.ob_maxngacceptqty.Name = "ob_maxngacceptqty";
             this.ob_maxngacceptqty.Power = null;
-            this.ob_maxngacceptqty.Size = new System.Drawing.Size(193, 25);
+            this.ob_maxngacceptqty.Size = new System.Drawing.Size(146, 21);
             this.ob_maxngacceptqty.Str = null;
             this.ob_maxngacceptqty.Str1 = null;
             this.ob_maxngacceptqty.Str2 = null;
@@ -320,11 +314,10 @@
             this.ob_aqlcode.BackColor = System.Drawing.Color.White;
             this.ob_aqlcode.Enabled = false;
             this.ob_aqlcode.ID = null;
-            this.ob_aqlcode.Location = new System.Drawing.Point(1211, 9);
-            this.ob_aqlcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_aqlcode.Location = new System.Drawing.Point(908, 7);
             this.ob_aqlcode.Name = "ob_aqlcode";
             this.ob_aqlcode.Power = null;
-            this.ob_aqlcode.Size = new System.Drawing.Size(193, 25);
+            this.ob_aqlcode.Size = new System.Drawing.Size(146, 21);
             this.ob_aqlcode.Str = null;
             this.ob_aqlcode.Str1 = null;
             this.ob_aqlcode.Str2 = null;
@@ -337,11 +330,10 @@
             this.ob_projectcode.BackColor = System.Drawing.Color.White;
             this.ob_projectcode.Enabled = false;
             this.ob_projectcode.ID = null;
-            this.ob_projectcode.Location = new System.Drawing.Point(127, 2);
-            this.ob_projectcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_projectcode.Location = new System.Drawing.Point(95, 2);
             this.ob_projectcode.Name = "ob_projectcode";
             this.ob_projectcode.Power = null;
-            this.ob_projectcode.Size = new System.Drawing.Size(153, 25);
+            this.ob_projectcode.Size = new System.Drawing.Size(116, 21);
             this.ob_projectcode.Str = null;
             this.ob_projectcode.Str1 = null;
             this.ob_projectcode.Str2 = null;
@@ -357,13 +349,12 @@
             this.Clean.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(1349, 711);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Clean.Location = new System.Drawing.Point(1012, 569);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
             this.Clean.Power = null;
-            this.Clean.Size = new System.Drawing.Size(64, 30);
+            this.Clean.Size = new System.Drawing.Size(48, 24);
             this.Clean.TabIndex = 211;
             this.Clean.Tag = "OQC!Inspection";
             this.Clean.Text = "清除";
@@ -373,10 +364,9 @@
             // OperateResult
             // 
             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(916, 588);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Location = new System.Drawing.Point(687, 470);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(425, 153);
+            this.OperateResult.Size = new System.Drawing.Size(320, 123);
             this.OperateResult.TabIndex = 210;
             this.OperateResult.Text = "";
             // 
@@ -386,11 +376,10 @@
             this.ob_prodcode.BackColor = System.Drawing.Color.White;
             this.ob_prodcode.Enabled = false;
             this.ob_prodcode.ID = null;
-            this.ob_prodcode.Location = new System.Drawing.Point(460, 164);
-            this.ob_prodcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_prodcode.Location = new System.Drawing.Point(345, 131);
             this.ob_prodcode.Name = "ob_prodcode";
             this.ob_prodcode.Power = null;
-            this.ob_prodcode.Size = new System.Drawing.Size(153, 25);
+            this.ob_prodcode.Size = new System.Drawing.Size(116, 21);
             this.ob_prodcode.Str = null;
             this.ob_prodcode.Str1 = null;
             this.ob_prodcode.Str2 = null;
@@ -403,11 +392,10 @@
             this.ob_makecode.BackColor = System.Drawing.Color.White;
             this.ob_makecode.Enabled = false;
             this.ob_makecode.ID = null;
-            this.ob_makecode.Location = new System.Drawing.Point(127, 164);
-            this.ob_makecode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_makecode.Location = new System.Drawing.Point(95, 131);
             this.ob_makecode.Name = "ob_makecode";
             this.ob_makecode.Power = null;
-            this.ob_makecode.Size = new System.Drawing.Size(153, 25);
+            this.ob_makecode.Size = new System.Drawing.Size(116, 21);
             this.ob_makecode.Str = null;
             this.ob_makecode.Str1 = null;
             this.ob_makecode.Str2 = null;
@@ -421,12 +409,11 @@
             this.ChoosedDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.bg_code1,
             this.bg_name1});
-            this.ChoosedDGV.Location = new System.Drawing.Point(1080, 255);
-            this.ChoosedDGV.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ChoosedDGV.Location = new System.Drawing.Point(810, 204);
             this.ChoosedDGV.Name = "ChoosedDGV";
             this.ChoosedDGV.RowHeadersWidth = 20;
             this.ChoosedDGV.RowTemplate.Height = 23;
-            this.ChoosedDGV.Size = new System.Drawing.Size(325, 321);
+            this.ChoosedDGV.Size = new System.Drawing.Size(244, 257);
             this.ChoosedDGV.TabIndex = 205;
             // 
             // bg_code1
@@ -451,49 +438,25 @@
             this.Column3,
             this.bg_code,
             this.bg_name});
-            this.WaitChooseDGV.Location = new System.Drawing.Point(629, 255);
-            this.WaitChooseDGV.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.WaitChooseDGV.Location = new System.Drawing.Point(472, 204);
             this.WaitChooseDGV.Name = "WaitChooseDGV";
             this.WaitChooseDGV.RowHeadersWidth = 20;
             this.WaitChooseDGV.RowTemplate.Height = 23;
-            this.WaitChooseDGV.Size = new System.Drawing.Size(357, 320);
+            this.WaitChooseDGV.Size = new System.Drawing.Size(268, 256);
             this.WaitChooseDGV.TabIndex = 204;
             this.WaitChooseDGV.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.WaitChooseDGV_CellContentClick);
             this.WaitChooseDGV.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.WaitChooseDGV_DataError);
             this.WaitChooseDGV.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.WaitChooseDGV_RowHeaderMouseClick);
             // 
-            // Column3
-            // 
-            this.Column3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.Column3.HeaderText = "勾选";
-            this.Column3.Name = "Column3";
-            this.Column3.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.Column3.Width = 60;
-            // 
-            // bg_code
-            // 
-            this.bg_code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.bg_code.DataPropertyName = "bg_code";
-            this.bg_code.HeaderText = "不良分组";
-            this.bg_code.Name = "bg_code";
-            // 
-            // bg_name
-            // 
-            this.bg_name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.bg_name.DataPropertyName = "bg_name";
-            this.bg_name.HeaderText = "分组名称";
-            this.bg_name.Name = "bg_name";
-            // 
             // ob_remark
             // 
             this.ob_remark.AllPower = null;
             this.ob_remark.BackColor = System.Drawing.Color.White;
             this.ob_remark.ID = null;
-            this.ob_remark.Location = new System.Drawing.Point(123, 709);
-            this.ob_remark.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_remark.Location = new System.Drawing.Point(92, 567);
             this.ob_remark.Name = "ob_remark";
             this.ob_remark.Power = null;
-            this.ob_remark.Size = new System.Drawing.Size(487, 25);
+            this.ob_remark.Size = new System.Drawing.Size(366, 21);
             this.ob_remark.Str = null;
             this.ob_remark.Str1 = null;
             this.ob_remark.Str2 = null;
@@ -505,11 +468,10 @@
             this.sncode.AllPower = null;
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(123, 668);
-            this.sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.sncode.Location = new System.Drawing.Point(92, 534);
             this.sncode.Name = "sncode";
             this.sncode.Power = null;
-            this.sncode.Size = new System.Drawing.Size(487, 25);
+            this.sncode.Size = new System.Drawing.Size(366, 21);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
@@ -529,77 +491,23 @@
             this.ois_remark,
             this.ois_status,
             this.ois_id});
-            this.CheckTypeDGV.Location = new System.Drawing.Point(21, 210);
-            this.CheckTypeDGV.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CheckTypeDGV.Location = new System.Drawing.Point(16, 168);
             this.CheckTypeDGV.Name = "CheckTypeDGV";
             this.CheckTypeDGV.RowHeadersWidth = 20;
             this.CheckTypeDGV.RowTemplate.Height = 23;
-            this.CheckTypeDGV.Size = new System.Drawing.Size(589, 406);
+            this.CheckTypeDGV.Size = new System.Drawing.Size(442, 325);
             this.CheckTypeDGV.TabIndex = 198;
             this.CheckTypeDGV.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.CheckTypeDGV_CellContentClick);
             this.CheckTypeDGV.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.CheckTypeDGV_CellValueChanged);
             this.CheckTypeDGV.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.CheckTypeDGV_DataError);
             this.CheckTypeDGV.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.CheckTypeDGV_RowHeaderMouseClick);
             // 
-            // choose
-            // 
-            this.choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.choose.DataPropertyName = "choose";
-            this.choose.HeaderText = "勾选";
-            this.choose.Name = "choose";
-            this.choose.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.choose.Width = 60;
-            // 
-            // oi_itemcode
-            // 
-            this.oi_itemcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
-            this.oi_itemcode.DataPropertyName = "oi_checkkind";
-            this.oi_itemcode.HeaderText = "检验类型";
-            this.oi_itemcode.Name = "oi_itemcode";
-            this.oi_itemcode.Width = 96;
-            // 
-            // oi_ng
-            // 
-            this.oi_ng.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
-            this.oi_ng.DataPropertyName = "oi_count";
-            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            this.oi_ng.DefaultCellStyle = dataGridViewCellStyle1;
-            this.oi_ng.HeaderText = "样本数量";
-            this.oi_ng.Name = "oi_ng";
-            this.oi_ng.Width = 96;
-            // 
-            // oi_leveldefect
-            // 
-            this.oi_leveldefect.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
-            this.oi_leveldefect.DataPropertyName = "oi_checkedcount";
-            this.oi_leveldefect.HeaderText = "已检数量";
-            this.oi_leveldefect.Name = "oi_leveldefect";
-            this.oi_leveldefect.Width = 96;
-            // 
-            // ois_remark
-            // 
-            this.ois_remark.HeaderText = "";
-            this.ois_remark.Name = "ois_remark";
-            // 
-            // ois_status
-            // 
-            this.ois_status.HeaderText = "";
-            this.ois_status.Name = "ois_status";
-            // 
-            // ois_id
-            // 
-            this.ois_id.DataPropertyName = "ois_id";
-            this.ois_id.HeaderText = "";
-            this.ois_id.Name = "ois_id";
-            this.ois_id.Visible = false;
-            // 
             // ChooseedReject
             // 
             this.ChooseedReject.Image = ((System.Drawing.Image)(resources.GetObject("ChooseedReject.Image")));
-            this.ChooseedReject.Location = new System.Drawing.Point(1000, 446);
-            this.ChooseedReject.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ChooseedReject.Location = new System.Drawing.Point(750, 357);
             this.ChooseedReject.Name = "ChooseedReject";
-            this.ChooseedReject.Size = new System.Drawing.Size(67, 29);
+            this.ChooseedReject.Size = new System.Drawing.Size(50, 23);
             this.ChooseedReject.TabIndex = 195;
             this.ChooseedReject.UseVisualStyleBackColor = true;
             this.ChooseedReject.Click += new System.EventHandler(this.ChooseedReject_Click);
@@ -607,10 +515,9 @@
             // WaitReject
             // 
             this.WaitReject.Image = ((System.Drawing.Image)(resources.GetObject("WaitReject.Image")));
-            this.WaitReject.Location = new System.Drawing.Point(1000, 366);
-            this.WaitReject.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.WaitReject.Location = new System.Drawing.Point(750, 293);
             this.WaitReject.Name = "WaitReject";
-            this.WaitReject.Size = new System.Drawing.Size(67, 29);
+            this.WaitReject.Size = new System.Drawing.Size(50, 23);
             this.WaitReject.TabIndex = 194;
             this.WaitReject.UseVisualStyleBackColor = true;
             this.WaitReject.Click += new System.EventHandler(this.WaitReject_Click);
@@ -621,11 +528,10 @@
             this.oi_checkqty.BackColor = System.Drawing.Color.White;
             this.oi_checkqty.Enabled = false;
             this.oi_checkqty.ID = null;
-            this.oi_checkqty.Location = new System.Drawing.Point(1211, 90);
-            this.oi_checkqty.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.oi_checkqty.Location = new System.Drawing.Point(908, 72);
             this.oi_checkqty.Name = "oi_checkqty";
             this.oi_checkqty.Power = null;
-            this.oi_checkqty.Size = new System.Drawing.Size(195, 25);
+            this.oi_checkqty.Size = new System.Drawing.Size(147, 21);
             this.oi_checkqty.Str = null;
             this.oi_checkqty.Str1 = null;
             this.oi_checkqty.Str2 = null;
@@ -638,11 +544,10 @@
             this.ob_okqty.BackColor = System.Drawing.Color.White;
             this.ob_okqty.Enabled = false;
             this.ob_okqty.ID = null;
-            this.ob_okqty.Location = new System.Drawing.Point(1211, 132);
-            this.ob_okqty.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_okqty.Location = new System.Drawing.Point(908, 106);
             this.ob_okqty.Name = "ob_okqty";
             this.ob_okqty.Power = null;
-            this.ob_okqty.Size = new System.Drawing.Size(195, 25);
+            this.ob_okqty.Size = new System.Drawing.Size(147, 21);
             this.ob_okqty.Str = null;
             this.ob_okqty.Str1 = null;
             this.ob_okqty.Str2 = null;
@@ -655,11 +560,10 @@
             this.ob_ngqty.BackColor = System.Drawing.Color.White;
             this.ob_ngqty.Enabled = false;
             this.ob_ngqty.ID = null;
-            this.ob_ngqty.Location = new System.Drawing.Point(1211, 175);
-            this.ob_ngqty.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_ngqty.Location = new System.Drawing.Point(908, 140);
             this.ob_ngqty.Name = "ob_ngqty";
             this.ob_ngqty.Power = null;
-            this.ob_ngqty.Size = new System.Drawing.Size(195, 25);
+            this.ob_ngqty.Size = new System.Drawing.Size(147, 21);
             this.ob_ngqty.Str = null;
             this.ob_ngqty.Str1 = null;
             this.ob_ngqty.Str2 = null;
@@ -672,11 +576,10 @@
             this.ob_batchqty.BackColor = System.Drawing.Color.White;
             this.ob_batchqty.Enabled = false;
             this.ob_batchqty.ID = null;
-            this.ob_batchqty.Location = new System.Drawing.Point(1211, 52);
-            this.ob_batchqty.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_batchqty.Location = new System.Drawing.Point(908, 42);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Power = null;
-            this.ob_batchqty.Size = new System.Drawing.Size(195, 25);
+            this.ob_batchqty.Size = new System.Drawing.Size(147, 21);
             this.ob_batchqty.Str = null;
             this.ob_batchqty.Str1 = null;
             this.ob_batchqty.Str2 = null;
@@ -688,11 +591,10 @@
             this.bccode.AllPower = null;
             this.bccode.BackColor = System.Drawing.Color.White;
             this.bccode.ID = null;
-            this.bccode.Location = new System.Drawing.Point(1211, 219);
-            this.bccode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.bccode.Location = new System.Drawing.Point(908, 175);
             this.bccode.Name = "bccode";
             this.bccode.Power = null;
-            this.bccode.Size = new System.Drawing.Size(195, 25);
+            this.bccode.Size = new System.Drawing.Size(147, 21);
             this.bccode.Str = null;
             this.bccode.Str1 = null;
             this.bccode.Str2 = null;
@@ -708,13 +610,12 @@
             this.Refresh.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Refresh.Image = ((System.Drawing.Image)(resources.GetObject("Refresh.Image")));
             this.Refresh.IsShowBorder = true;
-            this.Refresh.Location = new System.Drawing.Point(629, 36);
-            this.Refresh.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Refresh.Location = new System.Drawing.Point(472, 29);
             this.Refresh.MoveImage = ((System.Drawing.Image)(resources.GetObject("Refresh.MoveImage")));
             this.Refresh.Name = "Refresh";
             this.Refresh.NormalImage = ((System.Drawing.Image)(resources.GetObject("Refresh.NormalImage")));
             this.Refresh.Power = "ifRead";
-            this.Refresh.Size = new System.Drawing.Size(80, 30);
+            this.Refresh.Size = new System.Drawing.Size(60, 24);
             this.Refresh.TabIndex = 176;
             this.Refresh.Tag = "IFREAD";
             this.Refresh.Text = "刷新";
@@ -729,13 +630,12 @@
             this.GetBatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.GetBatch.Image = ((System.Drawing.Image)(resources.GetObject("GetBatch.Image")));
             this.GetBatch.IsShowBorder = true;
-            this.GetBatch.Location = new System.Drawing.Point(629, 118);
-            this.GetBatch.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.GetBatch.Location = new System.Drawing.Point(472, 94);
             this.GetBatch.MoveImage = ((System.Drawing.Image)(resources.GetObject("GetBatch.MoveImage")));
             this.GetBatch.Name = "GetBatch";
             this.GetBatch.NormalImage = ((System.Drawing.Image)(resources.GetObject("GetBatch.NormalImage")));
             this.GetBatch.Power = "ifRead";
-            this.GetBatch.Size = new System.Drawing.Size(80, 30);
+            this.GetBatch.Size = new System.Drawing.Size(60, 24);
             this.GetBatch.TabIndex = 175;
             this.GetBatch.Tag = "IFREAD";
             this.GetBatch.Text = "获取批";
@@ -750,13 +650,12 @@
             this.BatchPass.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.BatchPass.Image = ((System.Drawing.Image)(resources.GetObject("BatchPass.Image")));
             this.BatchPass.IsShowBorder = true;
-            this.BatchPass.Location = new System.Drawing.Point(743, 119);
-            this.BatchPass.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.BatchPass.Location = new System.Drawing.Point(557, 95);
             this.BatchPass.MoveImage = ((System.Drawing.Image)(resources.GetObject("BatchPass.MoveImage")));
             this.BatchPass.Name = "BatchPass";
             this.BatchPass.NormalImage = ((System.Drawing.Image)(resources.GetObject("BatchPass.NormalImage")));
             this.BatchPass.Power = "ifWrite";
-            this.BatchPass.Size = new System.Drawing.Size(80, 30);
+            this.BatchPass.Size = new System.Drawing.Size(60, 24);
             this.BatchPass.TabIndex = 174;
             this.BatchPass.Tag = "OQC!Inspection";
             this.BatchPass.Text = "批判过";
@@ -771,13 +670,12 @@
             this.Cancel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Cancel.Image = ((System.Drawing.Image)(resources.GetObject("Cancel.Image")));
             this.Cancel.IsShowBorder = true;
-            this.Cancel.Location = new System.Drawing.Point(743, 709);
-            this.Cancel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Cancel.Location = new System.Drawing.Point(557, 567);
             this.Cancel.MoveImage = ((System.Drawing.Image)(resources.GetObject("Cancel.MoveImage")));
             this.Cancel.Name = "Cancel";
             this.Cancel.NormalImage = ((System.Drawing.Image)(resources.GetObject("Cancel.NormalImage")));
             this.Cancel.Power = null;
-            this.Cancel.Size = new System.Drawing.Size(80, 30);
+            this.Cancel.Size = new System.Drawing.Size(60, 24);
             this.Cancel.TabIndex = 173;
             this.Cancel.Tag = "OQC!Inspection";
             this.Cancel.Text = "取消";
@@ -792,13 +690,12 @@
             this.Confirm.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Confirm.Image = ((System.Drawing.Image)(resources.GetObject("Confirm.Image")));
             this.Confirm.IsShowBorder = true;
-            this.Confirm.Location = new System.Drawing.Point(629, 709);
-            this.Confirm.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Confirm.Location = new System.Drawing.Point(472, 567);
             this.Confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("Confirm.MoveImage")));
             this.Confirm.Name = "Confirm";
             this.Confirm.NormalImage = ((System.Drawing.Image)(resources.GetObject("Confirm.NormalImage")));
             this.Confirm.Power = "ifWrite";
-            this.Confirm.Size = new System.Drawing.Size(80, 30);
+            this.Confirm.Size = new System.Drawing.Size(60, 24);
             this.Confirm.TabIndex = 172;
             this.Confirm.Tag = "ifWrite";
             this.Confirm.Text = "确认";
@@ -810,11 +707,10 @@
             this.ob_checkno.AllPower = "ifall";
             this.ob_checkno.BackColor = System.Drawing.Color.White;
             this.ob_checkno.ID = null;
-            this.ob_checkno.Location = new System.Drawing.Point(127, 36);
-            this.ob_checkno.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_checkno.Location = new System.Drawing.Point(95, 29);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Power = "ifread";
-            this.ob_checkno.Size = new System.Drawing.Size(487, 25);
+            this.ob_checkno.Size = new System.Drawing.Size(366, 21);
             this.ob_checkno.Str = null;
             this.ob_checkno.Str1 = null;
             this.ob_checkno.Str2 = null;
@@ -827,28 +723,25 @@
             this.obd_outboxcode.AllPower = null;
             this.obd_outboxcode.BackColor = System.Drawing.Color.White;
             this.obd_outboxcode.ID = null;
-            this.obd_outboxcode.Location = new System.Drawing.Point(127, 76);
-            this.obd_outboxcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.obd_outboxcode.Location = new System.Drawing.Point(95, 61);
             this.obd_outboxcode.Name = "obd_outboxcode";
             this.obd_outboxcode.Power = null;
-            this.obd_outboxcode.Size = new System.Drawing.Size(487, 25);
+            this.obd_outboxcode.Size = new System.Drawing.Size(366, 21);
             this.obd_outboxcode.Str = null;
             this.obd_outboxcode.Str1 = null;
             this.obd_outboxcode.Str2 = null;
             this.obd_outboxcode.TabIndex = 155;
             this.obd_outboxcode.Tag = "NoAuto";
-            this.obd_outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.obd_outboxcode_KeyDown);
             // 
             // ms_sncode
             // 
             this.ms_sncode.AllPower = "ifall";
             this.ms_sncode.BackColor = System.Drawing.Color.White;
             this.ms_sncode.ID = null;
-            this.ms_sncode.Location = new System.Drawing.Point(127, 119);
-            this.ms_sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ms_sncode.Location = new System.Drawing.Point(95, 95);
             this.ms_sncode.Name = "ms_sncode";
             this.ms_sncode.Power = "ifread";
-            this.ms_sncode.Size = new System.Drawing.Size(487, 25);
+            this.ms_sncode.Size = new System.Drawing.Size(366, 21);
             this.ms_sncode.Str = null;
             this.ms_sncode.Str1 = null;
             this.ms_sncode.Str2 = null;
@@ -891,23 +784,82 @@
             this.obd_id.Name = "obd_id";
             this.obd_id.Visible = false;
             // 
-            // ChooseAll
+            // choose
             // 
-            this.ChooseAll.AutoSize = true;
-            this.ChooseAll.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChooseAll.Location = new System.Drawing.Point(21, 628);
-            this.ChooseAll.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.ChooseAll.Name = "ChooseAll";
-            this.ChooseAll.Size = new System.Drawing.Size(74, 31);
-            this.ChooseAll.TabIndex = 199;
-            this.ChooseAll.Text = "全选";
-            this.ChooseAll.UseVisualStyleBackColor = true;
+            this.choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.choose.DataPropertyName = "choose";
+            this.choose.HeaderText = "勾选";
+            this.choose.Name = "choose";
+            this.choose.Resizable = System.Windows.Forms.DataGridViewTriState.False;
+            this.choose.Width = 60;
+            // 
+            // oi_itemcode
+            // 
+            this.oi_itemcode.DataPropertyName = "oi_checkkind";
+            this.oi_itemcode.HeaderText = "检验类型";
+            this.oi_itemcode.Name = "oi_itemcode";
+            this.oi_itemcode.Width = 78;
+            // 
+            // oi_ng
+            // 
+            this.oi_ng.DataPropertyName = "oi_count";
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            this.oi_ng.DefaultCellStyle = dataGridViewCellStyle1;
+            this.oi_ng.HeaderText = "样本数量";
+            this.oi_ng.Name = "oi_ng";
+            this.oi_ng.Width = 78;
+            // 
+            // oi_leveldefect
+            // 
+            this.oi_leveldefect.DataPropertyName = "oi_checkedcount";
+            this.oi_leveldefect.HeaderText = "已检数量";
+            this.oi_leveldefect.Name = "oi_leveldefect";
+            this.oi_leveldefect.Width = 78;
+            // 
+            // ois_remark
+            // 
+            this.ois_remark.HeaderText = "";
+            this.ois_remark.Name = "ois_remark";
+            // 
+            // ois_status
+            // 
+            this.ois_status.HeaderText = "";
+            this.ois_status.Name = "ois_status";
+            // 
+            // ois_id
+            // 
+            this.ois_id.DataPropertyName = "ois_id";
+            this.ois_id.HeaderText = "";
+            this.ois_id.Name = "ois_id";
+            this.ois_id.Visible = false;
+            // 
+            // Column3
+            // 
+            this.Column3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.Column3.HeaderText = "勾选";
+            this.Column3.Name = "Column3";
+            this.Column3.Resizable = System.Windows.Forms.DataGridViewTriState.False;
+            this.Column3.Width = 60;
+            // 
+            // bg_code
+            // 
+            this.bg_code.DataPropertyName = "bg_code";
+            this.bg_code.HeaderText = "不良分组";
+            this.bg_code.Name = "bg_code";
+            this.bg_code.Width = 93;
+            // 
+            // bg_name
+            // 
+            this.bg_name.DataPropertyName = "bg_name";
+            this.bg_name.HeaderText = "分组名称";
+            this.bg_name.Name = "bg_name";
+            this.bg_name.Width = 93;
             // 
             // OQC_SamplingDataCollection
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1420, 762);
+            this.ClientSize = new System.Drawing.Size(1065, 610);
             this.Controls.Add(this.ob_maxngacceptqty);
             this.Controls.Add(this.ob_maxngacceptqty_label);
             this.Controls.Add(this.ob_aqlcode);
@@ -953,7 +905,6 @@
             this.Controls.Add(this.ms_sncode);
             this.Controls.Add(this.ms_sncode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "OQC_SamplingDataCollection";
             this.Tag = "OQC!SamplingDataCollection";
             this.Text = "抽样数据采集";
@@ -1019,6 +970,7 @@
         private System.Windows.Forms.Label ob_maxngacceptqty_label;
         private System.Windows.Forms.DataGridViewTextBoxColumn bg_code1;
         private System.Windows.Forms.DataGridViewTextBoxColumn bg_name1;
+        private System.Windows.Forms.CheckBox ChooseAll;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Column3;
         private System.Windows.Forms.DataGridViewTextBoxColumn bg_code;
         private System.Windows.Forms.DataGridViewTextBoxColumn bg_name;
@@ -1029,6 +981,5 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn ois_remark;
         private System.Windows.Forms.DataGridViewTextBoxColumn ois_status;
         private System.Windows.Forms.DataGridViewTextBoxColumn ois_id;
-        private System.Windows.Forms.CheckBox ChooseAll;
     }
 }

+ 37 - 36
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -30,14 +30,8 @@ namespace UAS_MES.OQC
         private void 抽样数据采集_Load(object sender, EventArgs e)
         {
             asc.controllInitializeSize(this);
-            foreach (DataGridViewColumn item in CheckTypeDGV.Columns)
-            {
-                item.SortMode = DataGridViewColumnSortMode.NotSortable;
-            }
-            foreach (DataGridViewColumn item in WaitChooseDGV.Columns)
-            {
-                item.SortMode = DataGridViewColumnSortMode.NotSortable;
-            }
+            BaseUtil.DataGridViewNotSort(CheckTypeDGV);
+            BaseUtil.DataGridViewNotSort(WaitChooseDGV);
             dh = new DataHelper();
         }
 
@@ -132,36 +126,43 @@ namespace UAS_MES.OQC
                 DataTable UpdateData = BaseUtil.DGVIfChecked(CheckTypeDGV);
                 if (UpdateData != null)
                 {
-                    if (ChoosedDGV.RowCount > 0)
+                    //用于存放更新的数据
+                    List<string> ois_ifng_update = new List<string>();
+                    List<string> ois_defectlevel_update = new List<string>();
+                    List<string> ois_remark_update = new List<string>();
+                    List<string> ois_id_update = new List<string>();
+                    //用于存放插入的数据
+                    List<string> ois_ifng_insert = new List<string>();
+                    List<string> ois_defectlevel_insert = new List<string>();
+                    List<string> ois_remark_insert = new List<string>();
+                    List<string> oi_itemcode_insert = new List<string>();
+                    for (int i = 0; i < UpdateData.Rows.Count; i++)
                     {
-                        //用于存放更新的数据
-                        List<string> ois_ifng_update = new List<string>();
-                        List<string> ois_defectlevel_update = new List<string>();
-                        List<string> ois_remark_update = new List<string>();
-                        List<string> ois_id_update = new List<string>();
-                        //用于存放插入的数据
-                        List<string> ois_ifng_insert = new List<string>();
-                        List<string> ois_defectlevel_insert = new List<string>();
-                        List<string> ois_remark_insert = new List<string>();
-                        List<string> oi_itemcode_insert = new List<string>();
-                        for (int i = 0; i < UpdateData.Rows.Count; i++)
+                        //将布尔值转换为0,-1
+                        if (UpdateData.Rows[i]["ois_id"].ToString() != "" && UpdateData.Rows[i]["ois_id"].ToString() != "0")
                         {
-                            //将布尔值转换为0,-1
-                            if (UpdateData.Rows[i]["ois_id"].ToString() != "" && UpdateData.Rows[i]["ois_id"].ToString() != "0")
-                            {
-                                ois_ifng_update.Add(UpdateData.Rows[i]["oi_ng"].ToString() == "True" ? "-1" : "0");
-                                ois_defectlevel_update.Add(UpdateData.Rows[i]["oi_leveldefect"].ToString());
-                                ois_remark_update.Add(UpdateData.Rows[i]["ois_remark"].ToString());
-                                ois_id_update.Add(UpdateData.Rows[i]["ois_id"].ToString());
-                            }
-                            else
-                            {
-                                oi_itemcode_insert.Add(UpdateData.Rows[i]["oi_itemcode"].ToString());
-                                ois_ifng_insert.Add(UpdateData.Rows[i]["oi_ng"].ToString() == "True" ? "-1" : "0");
-                                ois_defectlevel_insert.Add(UpdateData.Rows[i]["oi_leveldefect"].ToString());
-                                ois_remark_insert.Add(UpdateData.Rows[i]["ois_remark"].ToString());
-                            }
+                            ois_ifng_update.Add(UpdateData.Rows[i]["oi_ng"].ToString() == "True" ? "-1" : "0");
+                            ois_defectlevel_update.Add(UpdateData.Rows[i]["oi_leveldefect"].ToString());
+                            ois_remark_update.Add(UpdateData.Rows[i]["ois_remark"].ToString());
+                            ois_id_update.Add(UpdateData.Rows[i]["ois_id"].ToString());
+                        }
+                        else
+                        {
+                            oi_itemcode_insert.Add(UpdateData.Rows[i]["oi_itemcode"].ToString());
+                            ois_ifng_insert.Add(UpdateData.Rows[i]["oi_ng"].ToString() == "True" ? "-1" : "0");
+                            ois_defectlevel_insert.Add(UpdateData.Rows[i]["oi_leveldefect"].ToString());
+                            ois_remark_insert.Add(UpdateData.Rows[i]["ois_remark"].ToString());
                         }
+                    }
+                    //判断是否含不通过的内容
+                    bool AllPass = true;
+                    for (int i = 0; i < ois_ifng_insert.Count; i++)
+                    {
+                        if (ois_ifng_insert[i] == "-1")
+                            AllPass = false;
+                    }
+                    if (ChoosedDGV.RowCount > 0 || AllPass)
+                    {
                         //执行批量更新的SQL
                         if (ois_id_update.Count > 0)
                         {
@@ -229,7 +230,7 @@ namespace UAS_MES.OQC
                     string ErrorMessage;
                     LogicHandler.UpdateMakeMessage(ms_sncode.Text, ob_makecode.Text, "OQC批判过", User.UserSourceCode, User.UserName, "批次通过", out ErrorMessage);
                     //记录操作日志
-                    LogicHandler.InsertMakeProcess(ms_sncode.Text, ob_makecode.Text, "批结果判定", "批次通过", User.UserName);
+                    LogicHandler.InsertMakeProcess(ms_sncode.Text, ob_makecode.Text,User.UserSourceCode, "批结果判定", "批次通过", User.UserName);
                     GetBatch.PerformClick();
                     OperateResult.AppendText(">>通过批成功\n", Color.Green);
                 }

+ 16 - 2
UAS-MES/PublicMethod/BaseUtil.cs

@@ -46,6 +46,16 @@ namespace UAS_MES.PublicMethod
             return selectConetnt.Remove(selectConetnt.Length - 1, 1).ToString();
         }
 
+        /// <summary>
+        /// 禁止DataGirdView排序
+        /// </summary>
+        /// <param name="Dgv"></param>
+        public static void DataGridViewNotSort(DataGridView Dgv)
+        {
+            foreach (DataGridViewColumn item in Dgv.Columns)
+                item.SortMode = DataGridViewColumnSortMode.NotSortable;
+        }
+
         /// <summary>
         /// 通过字段和其展示的中文值获取查询的内容
         /// </summary>
@@ -310,7 +320,11 @@ namespace UAS_MES.PublicMethod
                     {
                         for (int i = (e.RowIndex + 2); i < (e.RowIndex + 1 + CollapseRowCount); i++)
                         {
-                            dgv.Rows[i].Cells[0].Value = dgv.Rows[e.RowIndex].Cells[0].EditedFormattedValue;
+                            try
+                            {
+                                dgv.Rows[i].Cells[0].Value = dgv.Rows[e.RowIndex].Cells[0].EditedFormattedValue;
+                            }
+                            catch (Exception) { }
                         }
                     }
                 }
@@ -772,7 +786,7 @@ namespace UAS_MES.PublicMethod
                         if (dgv.Rows[i].Tag.ToString() == "SonRow")
                         {
                             DataRow dr = dt.NewRow();
-                        
+
                             for (int j = 1; j < dgv.ColumnCount; j++)
                             {
                                 Console.WriteLine(dgv.Rows[i].Cells[j].FormattedValue);

+ 41 - 153
UAS-MES/PublicMethod/LogicHandler.cs

@@ -195,15 +195,15 @@ namespace UAS_MES.PublicMethod
         /// </summary>
         /// <param name="iSnCode"></param>
         /// <param name="iMakeCode"></param>
-        /// <param name="iSource"></param>
+        /// <param name="iSourceCode"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
-        public static bool CheckCurrentStep(string iSnCode, string iMakeCode, string iSource, out string oErrMessage)
+        public static bool CheckCurrentStep(string iSnCode, string iMakeCode, string iSourceCode, out string oErrMessage)
         {
             if (GetMakeInfo(iSnCode, out iMakeCode, out oErrMessage))
             {
                 string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'").ToString();
-                string sourcestepcode = GetStepCodeBySource(iSource);
+                string sourcestepcode = GetStepCodeBySource(iSourceCode);
                 if (nextstepcode == "")
                 {
                     oErrMessage = "当前序列号已无可执行工序";
@@ -213,7 +213,7 @@ namespace UAS_MES.PublicMethod
                     return true;
                 else
                 {
-                    oErrMessage = "资源" + iSource + "对应的工序是" + sourcestepcode + ",序列号" + iSnCode + "当前工序是" + nextstepcode;
+                    oErrMessage = "资源" + iSourceCode + "对应的工序是" + sourcestepcode + ",序列号" + iSnCode + "当前工序是" + nextstepcode;
                     return false;
                 }
             }
@@ -407,10 +407,10 @@ namespace UAS_MES.PublicMethod
             return false;
         }
 
-        public static bool CheckStepAttribute(string iCaller, string iSource, out string oErrorMessage)
+        public static bool CheckStepAttribute(string iCaller, string iSourceCode, out string oErrorMessage)
         {
             oErrorMessage = "";
-            string[] param = new string[] { iCaller, iSource, oErrorMessage };
+            string[] param = new string[] { iCaller, iSourceCode, oErrorMessage };
             dh.CallProcedure("CS_CHECKSTEPATTRIBUTE", ref param);
             if (oErrorMessage == "" || oErrorMessage == null)
                 return true;
@@ -418,13 +418,13 @@ namespace UAS_MES.PublicMethod
                 return false;
         }
 
-        public static bool CheckStepSNAndMacode(string iMakeCode, string iSource, string iSN, string iUserCode, out string oMakeCode, out string oMsID, out string oErrorMessage)
+        public static bool CheckStepSNAndMacode(string iMakeCode, string iSourceCode, string iSN, string iUserCode, out string oMakeCode, out string oMsID, out string oErrorMessage)
         {
             Console.WriteLine("iMakeCode" + iMakeCode);
             oErrorMessage = "";
             oMakeCode = "";
             oMsID = "";
-            string[] param = new string[] { iMakeCode, iSource, iSN, iUserCode, oMakeCode, oMsID, oErrorMessage };
+            string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode, oMakeCode, oMsID, oErrorMessage };
             dh.CallProcedure("CS_CHECKSTEPSNANDMACODE", ref param);
             oMakeCode = param[4];
             oMsID = param[5];
@@ -916,18 +916,19 @@ namespace UAS_MES.PublicMethod
         /// </summary>
         /// <param name="iSnCode"></param>
         /// <param name="iMakeCode"></param>
-        /// <param name="iMaKind"></param>
+        /// <param name="iMPKind"></param>
         /// <param name="result"></param>
         /// <param name="iUserName"></param>
-        public static void InsertMakeProcess(string iSnCode, string iMakeCode, string iMaKind, string result, string iUserName)
+        public static void InsertMakeProcess(string iSnCode, string iMakeCode,string iSourceCode, string iMPKind, string result, string iUserName)
         {
+            string CurrentStep = GetStepCodeBySource(iSourceCode);
             sql.Clear();
             sql.Append("insert into MakeProcess(mp_id,mp_makecode,mp_maid, mp_mscode,mp_sncode,mp_stepcode,mp_stepname,");
             sql.Append("mp_craftcode,mp_craftname,mp_kind,mp_result,mp_indate,mp_inman,mp_wccode,mp_linecode,mp_sourcecode) ");
             sql.Append("select MakeProcess_seq.nextval, ma_code,ma_id,ms_code,ms_sncode,mcd_stepcode,mcd_stepname,");
-            sql.Append("ma_craftcode,ma_craftname,'" + iMaKind + "','" + result + "',sysdate,'" + iUserName + "',ma_wccode,ma_linecode,''");
+            sql.Append("ma_craftcode,ma_craftname,'" + iMPKind + "','" + result + "',sysdate,'" + iUserName + "',ma_wccode,ma_linecode,'"+ iSourceCode + "'");
             sql.Append("from make left join makecraftdetail on mcd_macode=ma_code left join makeserial on ms_makecode=ma_code ");
-            sql.Append("where ms_sncode='" + iSnCode + "' and ma_code='" + iMakeCode + "'");
+            sql.Append("where ms_sncode='" + iSnCode + "' and ma_code='" + iMakeCode + "' and mcd_stepcode='"+ CurrentStep + "'");
             //插入makeprocess 
             dh.ExecuteSql(sql.ToString(), "insert");
             sql.Clear();
@@ -984,10 +985,27 @@ namespace UAS_MES.PublicMethod
                 return false;
         }
 
-        public static bool SetStepFinish(string iMakeCode, string iSource, string iSN, string iUserCode, out string oErrorMessage)
+        public static bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
         {
             oErrorMessage = "";
-            string[] param = new string[] { iMakeCode, iSource, iSN, iUserCode, oErrorMessage };
+            string StepCode = dh.getFieldDataByCondition("Makeserial", "ms_stepcode", "ms_sncode='" + iSN + "'").ToString();
+            string CurrentStep = GetStepCodeBySource(iSourceCode);
+            Console.WriteLine("StepCode" + StepCode);
+            Console.WriteLine("CurrentStep" + CurrentStep);
+            if (StepCode == CurrentStep)
+            {
+                InsertMakeProcess(iSN, iMakeCode, iSourceCode, iMPKind, iResult, iUserCode);
+                return true;
+            }
+            else {
+                return CS_SetFinish(iMakeCode, iSourceCode, iSN, iUserCode, out oErrorMessage);
+            }
+        }
+
+        public static bool CS_SetFinish(string iMakeCode, string iSourceCode, string iSN, string iUserCode, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode, oErrorMessage };
             dh.CallProcedure("CS_SETSTEPFINISH", ref param);
             if (oErrorMessage == "" || oErrorMessage == null)
                 return true;
@@ -1056,13 +1074,13 @@ namespace UAS_MES.PublicMethod
         /// </summary>
         /// <param name="iSnCode"></param>
         /// <param name="iMakeCode"></param>
-        /// <param name="iUserName"></param>
+        /// <param name="iUserCode"></param>
         /// <param name="iSourceCode"></param>
         /// <param name="iBadCode"></param>
         /// <param name="iBadRemark"></param>
         /// <param name="oErrorMessage"></param>
         /// <returns></returns>
-        public static bool SetTestNGDetail(string iSnCode, string iMakeCode, string iUserName, string iSourceCode, string iResult, string[] iBadGroupCode, string[] iBadCode, string[] iBadRemark, out string oErrorMessage)
+        public static bool SetTestNGDetail(string iSnCode, string iMakeCode, string iUserCode, string iSourceCode, string iResult, string[] iBadGroupCode, string[] iBadCode, string[] iBadRemark, out string oErrorMessage)
         {
             oErrorMessage = "";
             string StepCode = "";
@@ -1074,7 +1092,7 @@ namespace UAS_MES.PublicMethod
             sql.Clear();
             sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,");
             sql.Append("mb_indate,mb_stepcode,mb_sourcecode,mb_badcode,mb_bgcode,mb_badtable,mb_soncode,mb_status,mb_badremark)");
-            sql.Append("select makebad_seq.nextval,ma_code,ms_code,ms_sncode,'" + iUserName + "',sysdate,'" + StepCode + "',ms_sourcecode,:bc_code,:bg_code,'',");
+            sql.Append("select makebad_seq.nextval,ma_code,ms_code,ms_sncode,'" + iUserCode + "',sysdate,'" + StepCode + "',ms_sourcecode,:bc_code,:bg_code,'',");
             sql.Append("sp_soncode,'0',:bc_remark from make left join makeSerial on ms_makecode=ma_code left join stepProduct on ");
             sql.Append("sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + iSnCode + "'");
             dh.BatchInsert(sql.ToString(), new string[] { "bc_code", "bg_code", "bc_remark" }, iBadCode, iBadGroupCode, iBadRemark);
@@ -1088,12 +1106,11 @@ namespace UAS_MES.PublicMethod
             //dh.UpdateByCondition("makecraftdetail", "mcd_inqty=mcd_inqty+1,mcd_outqty = mcd_outqty + 1", "mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "'");
             //更新序列号已经采集的工序 ms_paststep 已采集数据,更新下一工序
             dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + StepCode + "'", "ms_sncode='" + iSnCode + "'");
-            //记录操作日志
-            InsertMakeProcess(iSnCode, iMakeCode, "不良采集", iResult, iUserName);
             //判断当前采集点是否为扣料工序cd_ifreduce =-1 则为扣料工序
             //之前保存的不良就不再调用
+            Console.WriteLine("ms_status"+ ms_status);
             if (ms_status != "3")
-                SetStepFinish(iMakeCode, iSourceCode, iSnCode, iUserName, out oErrorMessage);
+                SetStepFinish(iMakeCode, iSourceCode, iSnCode, "不良采集", iResult, iUserCode, out oErrorMessage);
             return true;
         }
 
@@ -1231,7 +1248,7 @@ namespace UAS_MES.PublicMethod
         /// <param name="iUserName"></param>
         /// <param name="oErrorMessage"></param>
         /// <returns></returns>
-        public static bool SetMaterialDown(string iSnCode, string iBarCode, string iCurrentStep, string iUserName, out string oErrorMessage)
+        public static bool SetMaterialDown(string iSnCode, string iBarCode,string iSourceCode, string iCurrentStep, string iUserName, out string oErrorMessage)
         {
             //序列号不为空的时候
             oErrorMessage = "";
@@ -1269,7 +1286,7 @@ namespace UAS_MES.PublicMethod
                     string cm_stepcode = dt.Rows[0]["cm_stepcode"].ToString();
                     string cm_mccode = dt.Rows[0]["cm_mccode"].ToString();
                     dh.ExecuteSql("delete from Craftmaterial where cm_id=" + cm_id, "delete");
-                    InsertMakeProcess(ms_macode, iSnCode, "下料操作", "下料成功", iUserName);
+                    InsertMakeProcess(ms_macode, iSnCode, iSourceCode,"下料操作", "下料成功", iUserName);
                     int count = dh.getRowCount("craftMaterial", "cm_mccode='" + cm_mccode + "' and cm_stepcode='" + cm_stepcode + "' and cm_sncode='" + iSnCode + "'");
                     if (count == 0)
                         dh.UpdateByCondition("makecraftdetail ", "mcd_inqty=mcd_inqty-1,mcd_outqty=mcd_outqty-1,mcd_okqty = mcd_okqty - 1", "mcd_mccode='" + cm_mccode + "' and mcd_stepcode='" + cm_stepcode + "'");
@@ -1290,138 +1307,9 @@ namespace UAS_MES.PublicMethod
         /// <param name="iResult"></param>
         /// <param name="oErrorMessage"></param>
         /// <returns></returns>
-        public static bool UpdateMakeMessage(string iSnCode, string iMakeCode, string iMaKind, string iSourceCode, string iUserName, string iResult, out string oErrorMessage)
+        public static bool UpdateMakeMessage(string iSnCode, string iMakeCode, string iMPKind, string iSourceCode, string iUserName, string iResult, out string oErrorMessage)
         {
-            InsertMakeProcess(iSnCode, iMakeCode, iMaKind, iResult, iUserName);
-            return SetStepFinish(iMakeCode, iSourceCode, iSnCode, iUserName, out oErrorMessage);
-            //oErrorMessage = "";
-            //string StepCode = "";
-            //string StepName = "";
-            //string LineCode = "";
-            //if (iResult == "" || iResult == null)
-            //{
-            //    iResult = "测试合格";
-            //}
-            //GetStepCodeAndNameAndLineBySource(iSourceCode, ref StepCode, ref StepName, ref LineCode);
-            ////判断是否上料工序,如果是的话执行该步骤
-            //DataTable dt = dh.getFieldsDataByCondition("make left join craft on cr_code=ma_craftcode left join craftdetail on cd_crid=cr_id", new string[] { "cd_ifinput", "cr_code" }, "ma_code='" + iMakeCode + "' and cd_stepcode='" + StepCode + "'");
-            //string Yes_No = dh.GetConfig("BatchNumber", "MESSetting").ToString();
-            //string cr_code = "";
-            //if (dt.Rows.Count > 0)
-            //{
-            //    cr_code = dt.Rows[0]["cr_code"].ToString();
-            //    if (dt.Rows[0]["cd_ifinput"].ToString() != "0")
-            //    {
-            //        sql.Clear();
-            //        sql.Append("select wm_concat(mss_prodcode) code,count(1) cn from (select sum(nvl(mss_remain,0))remain,mss_prodcode,max(mss_baseqty) mss_baseqty ");
-            //        sql.Append("from makesourcestock where mss_makecode='" + iMakeCode + "' and mss_stepcode='" + StepCode + "' ");
-            //        sql.Append("and mss_linecode='" + LineCode + "' group by mss_prodcode)T where T.remain<mss_baseqty and rownum<20");
-            //        dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            //        //如果配置的是Yes
-            //        if (Yes_No != "0")
-            //        {
-            //            //如果批次料不足
-            //            if (dt.Rows.Count > 0 && int.Parse(dt.Rows[0]["cn"].ToString()) > 0)
-            //            {
-            //                oErrorMessage += "批次物料:" + iSnCode + "," + dt.Rows[0]["code"] + "岗位备料不足";
-            //                return false;
-            //            }
-            //        }
-            //        //如果配置的是No 或者批次料足够
-            //        else if (Yes_No == "0" || dt.Rows.Count == 0)
-            //        {
-            //            //扣减批次数量,插入数据至用料表
-            //            sql.Clear();
-            //            sql.Append("select mss_prodcode , max(mss_baseqty) baseqty from makesourcestock ");
-            //            sql.Append("mss_makecode='" + iMakeCode + "' and mss_stepcode='" + StepCode + "'  and mss_linecode='" + LineCode + "' group by mss_prodcode");
-            //            DataTable dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            //            for (int i = 0; i < dt1.Rows.Count; i++)
-            //            {
-            //                string prodcode = dt1.Rows[i]["mss_prodcode"].ToString();
-            //                //本次上料需要扣除的数量
-            //                int baseqty = int.Parse(dt1.Rows[i]["baseqty"].ToString());
-            //                sql.Clear();
-            //                sql.Append("select mss_remain,mss_useqty,mss_id ,mss_barcode from makesourcestock where mss_makecode='" + iMakeCode + "' and ");
-            //                sql.Append("mss_stepcode='" + StepCode + "' and mss_prodcode='" + prodcode + "'  and mss_linecode='" + LineCode + "'  and mss_remain >0 order by mss_id  asc");
-            //                DataTable dt2 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            //                for (int j = 0; i < dt2.Rows.Count; j++)
-            //                {
-            //                    int remain = int.Parse(dt2.Rows[j]["mss_remain"].ToString());
-            //                    int useqty = int.Parse(dt2.Rows[j]["mss_useqty"].ToString());
-            //                    string mss_id = dt2.Rows[j]["mss_id"].ToString();
-            //                    string barcode = dt2.Rows[j]["mss_barcode"].ToString();
-            //                    //如果可扣数量大于0
-            //                    if (baseqty > 0)
-            //                    {
-            //                        //并且可扣数量大于剩余数量
-            //                        if (baseqty > remain)
-            //                        {
-            //                            sql.Clear();
-            //                            sql.Append("update makesourcestock set mss_useqty=nvl(mss_useqty,0)+mss_remain,mss_remain = 0 where mss_id='" + mss_id + "' ");
-            //                            dh.ExecuteSql(sql.ToString(), "update");
-            //                            //扣减剩余数量
-            //                            baseqty -= remain;
-            //                        }
-            //                        else if (remain >= baseqty)
-            //                        {
-            //                            dh.ExecuteSql("update makesourcestock set mss_remain = mss_remain-mss_baseqty where mss_id =" + mss_id, "select");
-            //                            baseqty = 0;
-            //                        }
-            //                    }
-            //                }
-            //            }
-            //        }
-            //    }
-            //}
-            ////查询批次和批数量
-            //int batchqty = 0;
-            //string checkno = "";
-            //dt = (DataTable)dh.ExecuteSql("select count(ms_checkno) count,ms_checkno from makeserial where ms_checkno=(select ms_checkno from makeserial where ms_sncode='" + iSnCode + "') group by ms_checkno", "select");
-            //if (dt.Rows.Count > 0)
-            //{
-            //    batchqty = int.Parse(dt.Rows[0]["count"].ToString());
-            //    checkno = dt.Rows[0]["ms_checkno"].ToString();
-            //}
-            //object nextstepcode = dh.getFieldDataByCondition("makecraftdetail", "mcd_nextstepcode", "mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "'");
-            //if (iResult.Contains("批次通过") && dt.Rows.Count > 0)
-            //{
-            //    //更新执行的数量
-            //    sqls.Add("update makecraftdetail set mcd_inqty=mcd_inqty+" + batchqty + ",mcd_outqty = mcd_outqty + " + batchqty + ",mcd_okqty = mcd_okqty + " + batchqty + " where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "' ");
-            //    //更新makeSerial 的下一工序
-            //    sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_nextstepcode='" + nextstepcode.ToString() + "' where ms_checkno='" + checkno + "'");
-            //}
-            //else
-            //{
-            //    //更新执行的数量
-            //    sqls.Add("update makecraftdetail set mcd_inqty=mcd_inqty+1,mcd_outqty = mcd_outqty + 1,mcd_okqty = mcd_okqty + 1 where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "' ");
-            //    //更新makeSerial 的下一工序
-            //    sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_stepcode='" + StepCode + "',ms_nextstepcode='" + nextstepcode.ToString() + "' where ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'");
-            //}
-            ////更新序列号已经采集的工序 ms_paststep 已采集数据,更新下一工序
-            //dh.ExecuteSQLTran(sqls.ToArray());
-            //sqls.Clear();
-            ////记录操作日志
-            //InsertMakeProcess(iSnCode, iMakeCode, iResult, iUserName);
-            ////检测下道工序是否存在,不存在 更新状态为已完成
-            //if (nextstepcode == null || nextstepcode.ToString() == "")
-            //{
-            //    if (iResult.Contains("批次通过"))
-            //    {
-            //        sqls.Add("update make set ma_madeqty=ma_madeqty+" + batchqty + " where ma_code='" + iMakeCode + "'");
-            //        sqls.Add("update makeserial set ms_status=2 where ms_checkno='" + checkno + "'");
-            //    }
-            //    else
-            //    {
-            //        sqls.Add("update make set ma_madeqty=ma_madeqty+1  where ma_code='" + iMakeCode + "'");
-            //        sqls.Add("update makeserial set ms_status=2 where ms_sncode='" + iSnCode + "'");
-            //    }
-            //    dh.ExecuteSQLTran(sqls.ToArray());
-            //    sqls.Clear();
-            //}
-            //else
-            //    CheckNextStepIfQC(iSnCode, iMakeCode, nextstepcode.ToString(), cr_code, iUserName, out oErrorMessage);
-            //// 将数据插入craftmaterial表
-            //SetCollectionFinish(iSnCode, iMakeCode, iUserName, iSourceCode, out oErrorMessage);
+            return SetStepFinish(iMakeCode, iSourceCode, iSnCode, iMPKind, iResult, iUserName, out oErrorMessage);
         }
 
         /// <summary>

+ 7 - 1
UAS-MES/UAS-MES.csproj

@@ -41,7 +41,7 @@
     <MinimumRequiredVersion>1.0.0.201</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
-    <ApplicationRevision>227</ApplicationRevision>
+    <ApplicationRevision>230</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>true</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>
@@ -281,6 +281,12 @@
     <Compile Include="CustomControl\Pagination\PaginationDbFind.Designer.cs">
       <DependentUpon>PaginationDbFind.cs</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\PowerControlForm\PowerControlForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="CustomControl\PowerControlForm\PowerControlForm.Designer.cs">
+      <DependentUpon>PowerControlForm.cs</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\ProcessBar\ProcessBar.cs">
       <SubType>UserControl</SubType>
     </Compile>