소스 검색

修改OQC公用方法

章政 8 년 전
부모
커밋
0df6ad7da7

+ 10 - 0
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -99,17 +99,23 @@ namespace UAS_MES.Make
                 if (GetSNCode.Text == "")
                 {
                     OperatResult.AppendText(">>序列号不允许为空\n", Color.Red);
+                    BaseUtil.CleanForm(this);
+                    BadCodeTree.Nodes.Clear();
                     return;
                 }
                 string ms_status = dh.getFieldDataByCondition("Makeserial", "ms_status", "ms_sncode='" + GetSNCode.Text + "'").ToString();
                 if (ms_status == "4")
                 {
                     OperatResult.AppendText(">>序列号:" + GetSNCode.Text + "已处于报废状态\n", Color.Red);
+                    BaseUtil.CleanForm(this);
+                    BadCodeTree.Nodes.Clear();
                     return;
                 }
                 if (ms_status != "3")
                 {
                     OperatResult.AppendText(">>序列号:" + GetSNCode.Text + "不处于维修状态\n", Color.Red);
+                    BaseUtil.CleanForm(this);
+                    BadCodeTree.Nodes.Clear();
                     return;
                 }
                 string ErrorMessage = "";
@@ -281,6 +287,8 @@ namespace UAS_MES.Make
                     dh.UpdateByCondition("makeserial", "ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_sncode='" + ms_sncode.Text + "'");
                     dh.ExecuteSql(insert_makeprocess.Replace("#", "完成维修"), "insert", ms_sncode.Text, User.CurrentStepCode);
                     OperatResult.AppendText(">>" + ms_sncode.Text + " 序列号回流成功\n", Color.Green);
+                    BaseUtil.CleanForm(this);
+                    BadCodeTree.Nodes.Clear();
                     GetSNCode.Clear();
                 }
             }
@@ -350,6 +358,7 @@ namespace UAS_MES.Make
                 }
                 OperatResult.AppendText(">>不良零件保存成功\n", Color.Green);
             }
+            else OperatResult.AppendText(">>不良零件未维护数据\n", Color.Red);
             //保存不良位置
             dt = (DataTable)mbl_locdgv.DataSource;
             if (dt != null && dt.Rows.Count > 0)
@@ -371,6 +380,7 @@ namespace UAS_MES.Make
                 }
                 OperatResult.AppendText(">>不良位置保存成功\n", Color.Green);
             }
+            else OperatResult.AppendText(">>不良位置未维护数据\n", Color.Red);
         }
 
         private void DeleteRepairInf_Click(object sender, EventArgs e)

+ 7 - 14
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.cs

@@ -65,9 +65,7 @@ namespace UAS_MES.OQC
                     ErrorMessage = "";
                 }
             }
-            else {
-                OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-            }
+            else  OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
         }
 
         private void SaveConfiguration_Click(object sender, EventArgs e)
@@ -135,10 +133,11 @@ namespace UAS_MES.OQC
         private void RefreshConfiguration_Click(object sender, EventArgs e)
         {
             sql.Clear();
-            sql.Append("select  nvl(max(oi_id),0)oi_id,max(ci_kind) ci_kind,max(oi_sampleqty) oi_sampleqty from ");
-            sql.Append("QUA_PROJECT left join QUA_ProjectDetail on pd_prid=pr_id  left join QUA_CheckItem on ");
-            sql.Append("pd_ciid=ci_id  left join OQCITEMS on oi_projectcode=pr_code and oi_checkkind=ci_kind ");
-            sql.Append("where oi_checkno='" + ob_checkno.Text + "' and oi_projectcode='" + ob_projectcode.Text + "'  group by ci_kind ");
+            sql.Append("select nvl(max(oi_id),0)oi_id,ci_kind,nvl(max(oi_sampleqty),0) oi_sampleqty from ");
+            sql.Append("QUA_PROJECT left join QUA_ProjectDetail on pd_prid=pr_id left join QUA_CheckItem ");
+            sql.Append("on pd_ciid=ci_id left join OQCITEMS on oi_checkno='" + ob_checkno.Text + "' and ");
+            sql.Append("oi_projectcode='" + ob_projectcode.Text + "'and oi_projectcode = pr_code and oi_checkkind = ci_kind ");
+            sql.Append("where pr_code='" + ob_projectcode.Text + "' group by ci_kind");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             BaseUtil.FillDgvWithDataTable(CheckTypeDGV, dt);
         }
@@ -147,10 +146,9 @@ namespace UAS_MES.OQC
         {
             if (ob_aqlcode.Text != "" || ob_maxngacceptqty.Text != "")
             {
-                GetBatch.PerformClick();
                 SaveConfiguration.PerformClick();
                 Checkob_maxngacceptqty();
-               
+                GetBatch.PerformClick();
             }
             else
                 OperateResult.AppendText(">>AQL和最大不合格允许通过数至少填写一个\n", Color.Red);
@@ -182,11 +180,6 @@ namespace UAS_MES.OQC
             OperateResult.Clear();
         }
 
-        private void CheckTypeDGV_CellContentClick(object sender, DataGridViewCellEventArgs e)
-        {
-
-        }
-
         private void ob_checkno_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Enter)

+ 82 - 114
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.designer.cs

@@ -44,6 +44,7 @@
             this.ob_aqlcode_label = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
+            this.ob_maxngacceptqty = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxNumOnly();
             this.ob_aqlcode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.pr_detail = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_projectcode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
@@ -68,7 +69,6 @@
             this.obd_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_checkno = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ms_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ob_maxngacceptqty = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxNumOnly();
             this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.CheckTypeDGV)).BeginInit();
             this.SuspendLayout();
@@ -77,10 +77,9 @@
             // 
             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(701, 61);
-            this.ms_sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_sncode_label.Location = new System.Drawing.Point(526, 49);
             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 = "序列号";
             // 
@@ -88,10 +87,9 @@
             // 
             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(28, 56);
-            this.ob_checkno_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_checkno_label.Location = new System.Drawing.Point(21, 45);
             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 = 154;
             this.ob_checkno_label.Text = "批次号";
             // 
@@ -102,9 +100,8 @@
             this.panel2.Controls.Add(this.label2);
             this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
             this.panel2.Location = new System.Drawing.Point(0, 0);
-            this.panel2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(1363, 41);
+            this.panel2.Size = new System.Drawing.Size(1022, 33);
             this.panel2.TabIndex = 156;
             this.panel2.Tag = "NoAuto";
             // 
@@ -113,10 +110,9 @@
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
-            this.label2.Location = new System.Drawing.Point(16, 5);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(12, 4);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(177, 27);
+            this.label2.Size = new System.Drawing.Size(143, 21);
             this.label2.TabIndex = 0;
             this.label2.Text = "OQC采样计划维护";
             // 
@@ -124,10 +120,9 @@
             // 
             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(357, 59);
-            this.obd_outboxcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.obd_outboxcode_label.Location = new System.Drawing.Point(268, 47);
             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 = 157;
             this.obd_outboxcode_label.Text = "箱号";
             // 
@@ -135,10 +130,9 @@
             // 
             this.ob_batchqty_label.AutoSize = true;
             this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty_label.Location = new System.Drawing.Point(28, 119);
-            this.ob_batchqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_batchqty_label.Location = new System.Drawing.Point(21, 88);
             this.ob_batchqty_label.Name = "ob_batchqty_label";
-            this.ob_batchqty_label.Size = new System.Drawing.Size(72, 27);
+            this.ob_batchqty_label.Size = new System.Drawing.Size(58, 21);
             this.ob_batchqty_label.TabIndex = 159;
             this.ob_batchqty_label.Text = "批数量";
             // 
@@ -146,10 +140,9 @@
             // 
             this.ob_source_label.AutoSize = true;
             this.ob_source_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_source_label.Location = new System.Drawing.Point(357, 121);
-            this.ob_source_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_source_label.Location = new System.Drawing.Point(268, 90);
             this.ob_source_label.Name = "ob_source_label";
-            this.ob_source_label.Size = new System.Drawing.Size(72, 27);
+            this.ob_source_label.Size = new System.Drawing.Size(58, 21);
             this.ob_source_label.TabIndex = 161;
             this.ob_source_label.Text = "批类型";
             // 
@@ -157,10 +150,9 @@
             // 
             this.pr_kind_label.AutoSize = true;
             this.pr_kind_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_kind_label.Location = new System.Drawing.Point(701, 122);
-            this.pr_kind_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_kind_label.Location = new System.Drawing.Point(526, 91);
             this.pr_kind_label.Name = "pr_kind_label";
-            this.pr_kind_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_kind_label.Size = new System.Drawing.Size(74, 21);
             this.pr_kind_label.TabIndex = 165;
             this.pr_kind_label.Text = "产品类型";
             // 
@@ -168,10 +160,9 @@
             // 
             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(1052, 65);
-            this.ob_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_prodcode_label.Location = new System.Drawing.Point(789, 52);
             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 = 163;
             this.ob_prodcode_label.Text = "产品编号";
             // 
@@ -179,10 +170,9 @@
             // 
             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(52, 680);
-            this.ob_remark_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_remark_label.Location = new System.Drawing.Point(39, 550);
             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 = 172;
             this.ob_remark_label.Text = "备注";
             // 
@@ -190,10 +180,9 @@
             // 
             this.ob_status_label.AutoSize = true;
             this.ob_status_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_status_label.Location = new System.Drawing.Point(1052, 122);
-            this.ob_status_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_status_label.Location = new System.Drawing.Point(789, 91);
             this.ob_status_label.Name = "ob_status_label";
-            this.ob_status_label.Size = new System.Drawing.Size(52, 27);
+            this.ob_status_label.Size = new System.Drawing.Size(42, 21);
             this.ob_status_label.TabIndex = 178;
             this.ob_status_label.Text = "状态";
             // 
@@ -201,10 +190,9 @@
             // 
             this.ob_maxacceptqty_label.AutoSize = true;
             this.ob_maxacceptqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_maxacceptqty_label.Location = new System.Drawing.Point(52, 730);
-            this.ob_maxacceptqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_maxacceptqty_label.Location = new System.Drawing.Point(39, 584);
             this.ob_maxacceptqty_label.Name = "ob_maxacceptqty_label";
-            this.ob_maxacceptqty_label.Size = new System.Drawing.Size(212, 27);
+            this.ob_maxacceptqty_label.Size = new System.Drawing.Size(170, 21);
             this.ob_maxacceptqty_label.TabIndex = 182;
             this.ob_maxacceptqty_label.Text = "最大不合格允许通过数";
             // 
@@ -212,10 +200,9 @@
             // 
             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(547, 680);
-            this.ob_aqlcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_aqlcode_label.Location = new System.Drawing.Point(410, 550);
             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 = 184;
             this.ob_aqlcode_label.Text = "AQL";
             // 
@@ -223,10 +210,9 @@
             // 
             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(1052, 174);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(268, 129);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(92, 27);
+            this.label1.Size = new System.Drawing.Size(74, 21);
             this.label1.TabIndex = 186;
             this.label1.Text = "检验方案";
             // 
@@ -234,12 +220,21 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(28, 170);
+            this.pr_detail_label.Location = new System.Drawing.Point(21, 129);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 188;
             this.pr_detail_label.Text = "产品名称";
             // 
+            // ob_maxngacceptqty
+            // 
+            this.ob_maxngacceptqty.Location = new System.Drawing.Point(215, 584);
+            this.ob_maxngacceptqty.Name = "ob_maxngacceptqty";
+            this.ob_maxngacceptqty.Size = new System.Drawing.Size(169, 21);
+            this.ob_maxngacceptqty.TabIndex = 192;
+            this.ob_maxngacceptqty.Text = "0";
+            // 
             // ob_aqlcode
             // 
             this.ob_aqlcode.AllPower = null;
@@ -247,13 +242,13 @@
             this.ob_aqlcode.Condition = null;
             this.ob_aqlcode.DBTitle = null;
             this.ob_aqlcode.FormName = null;
-            this.ob_aqlcode.Location = new System.Drawing.Point(613, 678);
-            this.ob_aqlcode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ob_aqlcode.Location = new System.Drawing.Point(460, 552);
+            this.ob_aqlcode.Margin = new System.Windows.Forms.Padding(2);
             this.ob_aqlcode.Name = "ob_aqlcode";
             this.ob_aqlcode.Power = null;
             this.ob_aqlcode.SelectField = null;
             this.ob_aqlcode.SetValueField = null;
-            this.ob_aqlcode.Size = new System.Drawing.Size(257, 26);
+            this.ob_aqlcode.Size = new System.Drawing.Size(196, 21);
             this.ob_aqlcode.TabIndex = 191;
             this.ob_aqlcode.TableName = null;
             this.ob_aqlcode.Tag = "AL_CODE";
@@ -265,12 +260,12 @@
             this.pr_detail.BackColor = System.Drawing.Color.White;
             this.pr_detail.Enabled = false;
             this.pr_detail.ID = null;
-            this.pr_detail.Location = new System.Drawing.Point(135, 176);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.pr_detail.Location = new System.Drawing.Point(101, 129);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(2);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Power = null;
             this.pr_detail.ReadOnly = true;
-            this.pr_detail.Size = new System.Drawing.Size(180, 25);
+            this.pr_detail.Size = new System.Drawing.Size(136, 21);
             this.pr_detail.Str = null;
             this.pr_detail.Str1 = null;
             this.pr_detail.Str2 = null;
@@ -284,13 +279,13 @@
             this.ob_projectcode.Condition = null;
             this.ob_projectcode.DBTitle = null;
             this.ob_projectcode.FormName = null;
-            this.ob_projectcode.Location = new System.Drawing.Point(1163, 176);
-            this.ob_projectcode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ob_projectcode.Location = new System.Drawing.Point(347, 129);
+            this.ob_projectcode.Margin = new System.Windows.Forms.Padding(2);
             this.ob_projectcode.Name = "ob_projectcode";
             this.ob_projectcode.Power = null;
             this.ob_projectcode.SelectField = null;
             this.ob_projectcode.SetValueField = null;
-            this.ob_projectcode.Size = new System.Drawing.Size(181, 26);
+            this.ob_projectcode.Size = new System.Drawing.Size(159, 21);
             this.ob_projectcode.TabIndex = 187;
             this.ob_projectcode.TableName = null;
             this.ob_projectcode.Tag = "pr_code";
@@ -302,11 +297,10 @@
             this.ob_status.BackColor = System.Drawing.Color.White;
             this.ob_status.Enabled = false;
             this.ob_status.ID = null;
-            this.ob_status.Location = new System.Drawing.Point(1163, 122);
-            this.ob_status.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_status.Location = new System.Drawing.Point(872, 91);
             this.ob_status.Name = "ob_status";
             this.ob_status.Power = null;
-            this.ob_status.Size = new System.Drawing.Size(180, 25);
+            this.ob_status.Size = new System.Drawing.Size(136, 21);
             this.ob_status.Str = null;
             this.ob_status.Str1 = null;
             this.ob_status.Str2 = null;
@@ -316,10 +310,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(1073, 216);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Location = new System.Drawing.Point(807, 194);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(269, 396);
+            this.OperateResult.Size = new System.Drawing.Size(203, 318);
             this.OperateResult.TabIndex = 177;
             this.OperateResult.Text = "";
             // 
@@ -331,13 +324,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(1165, 622);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Clean.Location = new System.Drawing.Point(872, 518);
             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(91, 30);
+            this.Clean.Size = new System.Drawing.Size(68, 24);
             this.Clean.TabIndex = 176;
             this.Clean.Tag = "";
             this.Clean.Text = "清除";
@@ -349,11 +341,10 @@
             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(136, 682);
-            this.ob_remark.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_remark.Location = new System.Drawing.Point(102, 552);
             this.ob_remark.Name = "ob_remark";
             this.ob_remark.Power = null;
-            this.ob_remark.Size = new System.Drawing.Size(375, 25);
+            this.ob_remark.Size = new System.Drawing.Size(282, 21);
             this.ob_remark.Str = null;
             this.ob_remark.Str1 = null;
             this.ob_remark.Str2 = null;
@@ -368,13 +359,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(676, 170);
-            this.GetBatch.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.GetBatch.Location = new System.Drawing.Point(460, 164);
             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(91, 30);
+            this.GetBatch.Size = new System.Drawing.Size(68, 24);
             this.GetBatch.TabIndex = 171;
             this.GetBatch.Tag = "OQC!Inspection";
             this.GetBatch.Text = "获取批";
@@ -389,13 +379,12 @@
             this.SaveConfiguration.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.SaveConfiguration.Image = ((System.Drawing.Image)(resources.GetObject("SaveConfiguration.Image")));
             this.SaveConfiguration.IsShowBorder = true;
-            this.SaveConfiguration.Location = new System.Drawing.Point(399, 634);
-            this.SaveConfiguration.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.SaveConfiguration.Location = new System.Drawing.Point(299, 518);
             this.SaveConfiguration.MoveImage = ((System.Drawing.Image)(resources.GetObject("SaveConfiguration.MoveImage")));
             this.SaveConfiguration.Name = "SaveConfiguration";
             this.SaveConfiguration.NormalImage = ((System.Drawing.Image)(resources.GetObject("SaveConfiguration.NormalImage")));
             this.SaveConfiguration.Power = "ifWrite";
-            this.SaveConfiguration.Size = new System.Drawing.Size(91, 30);
+            this.SaveConfiguration.Size = new System.Drawing.Size(68, 24);
             this.SaveConfiguration.TabIndex = 170;
             this.SaveConfiguration.Tag = "OQC!Inspection";
             this.SaveConfiguration.Text = "保存配置";
@@ -410,13 +399,12 @@
             this.RefreshConfiguration.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.RefreshConfiguration.Image = ((System.Drawing.Image)(resources.GetObject("RefreshConfiguration.Image")));
             this.RefreshConfiguration.IsShowBorder = true;
-            this.RefreshConfiguration.Location = new System.Drawing.Point(613, 634);
-            this.RefreshConfiguration.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.RefreshConfiguration.Location = new System.Drawing.Point(460, 518);
             this.RefreshConfiguration.MoveImage = ((System.Drawing.Image)(resources.GetObject("RefreshConfiguration.MoveImage")));
             this.RefreshConfiguration.Name = "RefreshConfiguration";
             this.RefreshConfiguration.NormalImage = ((System.Drawing.Image)(resources.GetObject("RefreshConfiguration.NormalImage")));
             this.RefreshConfiguration.Power = "ifRead";
-            this.RefreshConfiguration.Size = new System.Drawing.Size(91, 30);
+            this.RefreshConfiguration.Size = new System.Drawing.Size(68, 24);
             this.RefreshConfiguration.TabIndex = 169;
             this.RefreshConfiguration.Tag = "OQC!Inspection";
             this.RefreshConfiguration.Text = "刷新配置";
@@ -431,13 +419,12 @@
             this.Save.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Save.Image = ((System.Drawing.Image)(resources.GetObject("Save.Image")));
             this.Save.IsShowBorder = true;
-            this.Save.Location = new System.Drawing.Point(551, 729);
-            this.Save.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Save.Location = new System.Drawing.Point(413, 583);
             this.Save.MoveImage = ((System.Drawing.Image)(resources.GetObject("Save.MoveImage")));
             this.Save.Name = "Save";
             this.Save.NormalImage = ((System.Drawing.Image)(resources.GetObject("Save.NormalImage")));
             this.Save.Power = "ifWrite";
-            this.Save.Size = new System.Drawing.Size(93, 30);
+            this.Save.Size = new System.Drawing.Size(70, 24);
             this.Save.TabIndex = 168;
             this.Save.Tag = "OQC!Inspection";
             this.Save.Text = "保存";
@@ -454,13 +441,11 @@
             this.ci_id,
             this.ci_kind,
             this.oi_sampleqty});
-            this.CheckTypeDGV.Location = new System.Drawing.Point(57, 216);
-            this.CheckTypeDGV.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.CheckTypeDGV.Location = new System.Drawing.Point(43, 194);
             this.CheckTypeDGV.Name = "CheckTypeDGV";
             this.CheckTypeDGV.RowTemplate.Height = 23;
-            this.CheckTypeDGV.Size = new System.Drawing.Size(993, 398);
+            this.CheckTypeDGV.Size = new System.Drawing.Size(745, 318);
             this.CheckTypeDGV.TabIndex = 167;
-            this.CheckTypeDGV.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.CheckTypeDGV_CellContentClick);
             // 
             // Choose
             // 
@@ -511,12 +496,11 @@
             this.pr_kind.BackColor = System.Drawing.Color.White;
             this.pr_kind.Enabled = false;
             this.pr_kind.ID = null;
-            this.pr_kind.Location = new System.Drawing.Point(811, 122);
-            this.pr_kind.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pr_kind.Location = new System.Drawing.Point(608, 91);
             this.pr_kind.Name = "pr_kind";
             this.pr_kind.Power = null;
             this.pr_kind.ReadOnly = true;
-            this.pr_kind.Size = new System.Drawing.Size(180, 25);
+            this.pr_kind.Size = new System.Drawing.Size(136, 21);
             this.pr_kind.Str = null;
             this.pr_kind.Str1 = null;
             this.pr_kind.Str2 = null;
@@ -529,11 +513,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(1163, 68);
-            this.ob_prodcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_prodcode.Location = new System.Drawing.Point(872, 54);
             this.ob_prodcode.Name = "ob_prodcode";
             this.ob_prodcode.Power = null;
-            this.ob_prodcode.Size = new System.Drawing.Size(180, 25);
+            this.ob_prodcode.Size = new System.Drawing.Size(136, 21);
             this.ob_prodcode.Str = null;
             this.ob_prodcode.Str1 = null;
             this.ob_prodcode.Str2 = null;
@@ -546,11 +529,10 @@
             this.ob_source.BackColor = System.Drawing.Color.White;
             this.ob_source.Enabled = false;
             this.ob_source.ID = null;
-            this.ob_source.Location = new System.Drawing.Point(463, 121);
-            this.ob_source.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_source.Location = new System.Drawing.Point(347, 90);
             this.ob_source.Name = "ob_source";
             this.ob_source.Power = null;
-            this.ob_source.Size = new System.Drawing.Size(180, 25);
+            this.ob_source.Size = new System.Drawing.Size(136, 21);
             this.ob_source.Str = null;
             this.ob_source.Str1 = null;
             this.ob_source.Str2 = null;
@@ -563,12 +545,11 @@
             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(135, 121);
-            this.ob_batchqty.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_batchqty.Location = new System.Drawing.Point(101, 90);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Power = null;
             this.ob_batchqty.ReadOnly = true;
-            this.ob_batchqty.Size = new System.Drawing.Size(180, 25);
+            this.ob_batchqty.Size = new System.Drawing.Size(136, 21);
             this.ob_batchqty.Str = null;
             this.ob_batchqty.Str1 = null;
             this.ob_batchqty.Str2 = null;
@@ -580,11 +561,10 @@
             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(463, 61);
-            this.obd_outboxcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.obd_outboxcode.Location = new System.Drawing.Point(347, 49);
             this.obd_outboxcode.Name = "obd_outboxcode";
             this.obd_outboxcode.Power = null;
-            this.obd_outboxcode.Size = new System.Drawing.Size(180, 25);
+            this.obd_outboxcode.Size = new System.Drawing.Size(136, 21);
             this.obd_outboxcode.Str = null;
             this.obd_outboxcode.Str1 = null;
             this.obd_outboxcode.Str2 = null;
@@ -597,11 +577,10 @@
             this.ob_checkno.AllPower = null;
             this.ob_checkno.BackColor = System.Drawing.Color.White;
             this.ob_checkno.ID = null;
-            this.ob_checkno.Location = new System.Drawing.Point(135, 59);
-            this.ob_checkno.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ob_checkno.Location = new System.Drawing.Point(101, 47);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Power = null;
-            this.ob_checkno.Size = new System.Drawing.Size(180, 25);
+            this.ob_checkno.Size = new System.Drawing.Size(136, 21);
             this.ob_checkno.Str = null;
             this.ob_checkno.Str1 = null;
             this.ob_checkno.Str2 = null;
@@ -614,11 +593,10 @@
             this.ms_sncode.AllPower = null;
             this.ms_sncode.BackColor = System.Drawing.Color.White;
             this.ms_sncode.ID = null;
-            this.ms_sncode.Location = new System.Drawing.Point(811, 64);
-            this.ms_sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ms_sncode.Location = new System.Drawing.Point(608, 51);
             this.ms_sncode.Name = "ms_sncode";
             this.ms_sncode.Power = null;
-            this.ms_sncode.Size = new System.Drawing.Size(180, 25);
+            this.ms_sncode.Size = new System.Drawing.Size(136, 21);
             this.ms_sncode.Str = null;
             this.ms_sncode.Str1 = null;
             this.ms_sncode.Str2 = null;
@@ -626,20 +604,11 @@
             this.ms_sncode.Tag = "NoAuto";
             this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_sncode_KeyDown);
             // 
-            // ob_maxngacceptqty
-            // 
-            this.ob_maxngacceptqty.Location = new System.Drawing.Point(287, 730);
-            this.ob_maxngacceptqty.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.ob_maxngacceptqty.Name = "ob_maxngacceptqty";
-            this.ob_maxngacceptqty.Size = new System.Drawing.Size(224, 25);
-            this.ob_maxngacceptqty.TabIndex = 192;
-            this.ob_maxngacceptqty.Text = "0";
-            // 
             // OQC_PlanMaintain
             // 
-            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(1363, 770);
+            this.ClientSize = new System.Drawing.Size(1022, 616);
             this.Controls.Add(this.ob_maxngacceptqty);
             this.Controls.Add(this.ob_aqlcode);
             this.Controls.Add(this.pr_detail);
@@ -675,7 +644,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_PlanMaintain";
             this.Tag = "OQC!PlanMaintain";
             this.Text = "抽样计划维护";

+ 15 - 0
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.resx

@@ -788,4 +788,19 @@
   <metadata name="oi_sampleqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="Choose.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="oi_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ci_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ci_kind.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="oi_sampleqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>

+ 5 - 5
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.Designer.cs

@@ -29,7 +29,7 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OQC_SamplingDataCollection));
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
             this.ob_checkno_label = new System.Windows.Forms.Label();
             this.obd_outboxcode_label = new System.Windows.Forms.Label();
             this.ms_sncode_label = new System.Windows.Forms.Label();
@@ -527,8 +527,8 @@
             // 
             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;
+            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            this.oi_ng.DefaultCellStyle = dataGridViewCellStyle2;
             this.oi_ng.HeaderText = "样本数量";
             this.oi_ng.Name = "oi_ng";
             this.oi_ng.Width = 78;
@@ -819,7 +819,7 @@
             this.ob_aqlcode.Str1 = null;
             this.ob_aqlcode.Str2 = null;
             this.ob_aqlcode.TabIndex = 215;
-            this.ob_aqlcode.Tag = "NoAuto";
+            this.ob_aqlcode.Tag = "ob_aqlcode";
             // 
             // ob_aqlcode_label
             // 
@@ -847,7 +847,7 @@
             this.ob_maxngacceptqty.Str1 = null;
             this.ob_maxngacceptqty.Str2 = null;
             this.ob_maxngacceptqty.TabIndex = 217;
-            this.ob_maxngacceptqty.Tag = "NoAuto";
+            this.ob_maxngacceptqty.Tag = "ob_maxngacceptqty";
             // 
             // ob_maxngacceptqty_label
             // 

+ 5 - 3
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -73,8 +73,10 @@ namespace UAS_MES.OQC
                             else
                             {
                                 string ErrorMessage = "";
+                                string oMakeCode = "";
+                                string oMsID = "";
                                 bool ifFirst;
-                                if (LogicHandler.CheckCurrentStepAndIfFirst(sncode.Text, dt.Rows[0]["ob_makecode"].ToString(), User.UserSourceCode, "OQC!SamplingDataCollection", out ifFirst, out ErrorMessage))
+                                if (LogicHandler.CheckStepSNAndMacode(dt.Rows[0]["ob_makecode"].ToString(),User.UserSourceCode,sncode.Text, User.UserCode,out oMakeCode,out oMsID, out ErrorMessage))
                                     GetBatchTypeGridData();
                                 else
                                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
@@ -93,8 +95,8 @@ namespace UAS_MES.OQC
             dt = (DataTable)dh.ExecuteSql("select 0,oi_checkkind,max(oi_sampleqty) oi_count,max(oi_checkqty) oi_checkedcount from OQCBatch  left join OQCItems on ob_checkno=oi_checkno  where oi_checkno='" + ob_checkno.Text + "' group by oi_checkkind ", "select");
             BaseUtil.FillExpandDgvWithDataTable(CheckTypeDGV, dt, true);
             sql.Clear();
-            sql.Append("select pb_badgroup, bg_name,bg_code from product left join productkind ");
-            sql.Append("on pr_kind=pk_name left join PRODUCTBADGROUP on pk_code= pb_kindcode ");
+            sql.Append("select pb_badgroup,bg_name,bg_code from product left join productkind ");
+            sql.Append("on pr_kind=pk_code left join PRODUCTBADGROUP on pk_code= pb_kindcode ");
             sql.Append("left join badgroup on  bg_code=pb_badgroup where pr_code='" + ob_prodcode.Text + "'");
             BadCode = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             BaseUtil.FillExpandDgvWithDataTable(WaitChooseDGV, BadCode, true);

+ 36 - 0
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.resx

@@ -270,6 +270,21 @@
   <metadata name="bc_name1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="bc_code1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bc_name1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bc_code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="bc_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -300,6 +315,27 @@
   <metadata name="ois_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="dataGridViewCheckBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="oi_itemcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="oi_ng.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="oi_leveldefect.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ois_remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ois_status.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ois_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <data name="ChooseedReject.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAACUAAAAXCAYAAACMLIalAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6

+ 1 - 1
UAS-MES/Program.cs

@@ -42,7 +42,7 @@ namespace UAS_MES
                 FileStream fs = new FileStream(sysdisc + @":\Log\" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
                 fs.Close();
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
-                    Application.Run(new Form1());
+                    Application.Run(new Login());
                 else
                 {
                     //创建启动对象

+ 1 - 1
UAS-MES/PublicMethod/BaseUtil.cs

@@ -555,7 +555,7 @@ namespace UAS_MES.PublicMethod
                     DataGridViewCheckBoxCell checkcell = new DataGridViewCheckBoxCell();
                     collapseRow.Cells.Add(checkcell);
                     //因为DGV中可能有空置的列多出,所以需要用DataTable的列进行循环
-                    for (int j = 1; j <= dt.Columns.Count; j++)
+                    for (int j = 1; j < dt.Columns.Count; j++)
                     {
                         DataGridViewTextBoxCell textcell = new DataGridViewTextBoxCell();
                         textcell.Value = dt.Rows[i][j - 1].ToString();

+ 26 - 38
UAS-MES/PublicMethod/LogicHandler.cs

@@ -817,11 +817,9 @@ namespace UAS_MES.PublicMethod
                             sql.Append("on obd_obid = ob_id  where ob_checkno ='" + iCheckNo + "' group by ob_id,ob_status,ob_prodcode,ob_batchqty,ob_source,ob_checkno,obd_outboxcode,obd_makecode,obd_id");
                             Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                         }
-                        else
-                            oErrorMessage = "自动生成的抽检批次号不允许在该页面操作,或者该抽检批次号不是在录入状态";
+                        else oErrorMessage = "自动生成的抽检批次号不允许在该页面操作,或者该抽检批次号不是在录入状态";
                     }
-                    else
-                        oErrorMessage = "该送检批次不存在";
+                    else oErrorMessage = "该送检批次不存在";
                     break;
                 case "OQCPLANMAINTAIN":
                     sql.Clear();
@@ -837,45 +835,35 @@ namespace UAS_MES.PublicMethod
                         if (Form.Rows[0]["ob_status"].ToString() == "UNCHECK")
                         {
                             //判断送检方案是否为空
-                            if (Form.Rows[0]["ob_projectcode"].ToString() == "")
+                            string qualmethod = "";
+                            //第一原则送检方案为空
+                            if (Form.Rows[0]["pr_qualmethod"].ToString() == "")
                             {
-                                //第一原则送检方案为空
-                                string qualmethod = "";
-                                if (Form.Rows[0]["pr_qualmethod"].ToString() == "")
-                                {
-                                    //判读第二原则送检方案为空
-                                    string pr_qualmethod = dh.getFieldDataByCondition("product left join productkind on pr_kind=pk_name", "pk_qualmethod", "pr_code='" + Form.Rows[0]["ob_prodcode"] + "'").ToString();
-                                    if (pr_qualmethod == "" || pr_qualmethod == null)
-                                        oErrorMessage = "该物料或者物料种类未维护检验方案,物料号:" + Form.Rows[0]["ob_prodcode"] + ",请先维护检验方案";
-                                    //判读第二原则送检方案为空
-                                    else
-                                        qualmethod = pr_qualmethod;
-                                }
-                                //第一原则送检方案不为空
+                                //判读第二原则送检方案为空
+                                string pr_qualmethod = dh.getFieldDataByCondition("product left join productkind on pr_kind=pk_name", "pk_qualmethod", "pr_code='" + Form.Rows[0]["ob_prodcode"] + "'").ToString();
+                                if (pr_qualmethod == "" || pr_qualmethod == null)
+                                    oErrorMessage = "该物料或者物料种类未维护检验方案,物料号:" + Form.Rows[0]["ob_prodcode"] + ",请先维护检验方案";
+                                //判读第二原则送检方案为空
                                 else
-                                {
-                                    qualmethod = Form.Rows[0]["pr_qualmethod"].ToString();
-                                }
-                                Form.Rows[0]["ob_projectcode"] = qualmethod;
-                                pr_id = dh.getFieldDataByCondition("QUA_Project", "pr_id", "pr_code = '" + qualmethod + "'").ToString();
-                                sql.Clear();
-                                sql.Append("select 1 choose,nvl(max(oi_id),0) oi_id,max(ci_kind) ci_kind,max(oi_sampleqty) oi_sampleqty from ");
-                                sql.Append("QUA_PROJECT left join QUA_ProjectDetail on pd_prid=pr_id  left join QUA_CheckItem on ");
-                                sql.Append("pd_ciid=ci_id  left join OQCITEMS on oi_projectcode=pr_code and oi_checkkind=ci_kind ");
-                                sql.Append("where oi_checkno='" + iCheckNo + "' and oi_projectcode='" + qualmethod + "' group by ci_kind ");
-                                Grid = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                                if (Grid.Rows.Count == 0)
-                                {
-                                    sql.Clear();
-                                    Grid = (DataTable)dh.ExecuteSql("select distinct 0 choose,ci_kind,0 oi_id,0 oi_sampleqty   from QUA_ProjectDetail left join QUA_CheckItem on pd_ciid=ci_id where pd_prid='" + pr_id + "'", "select");
-                                    if (Grid.Rows.Count == 0)
-                                        oErrorMessage = "检验方案:" + qualmethod + "无检验项目";
-                                }
+                                    qualmethod = pr_qualmethod;
                             }
+                            //第一原则送检方案不为空
                             else
                             {
-                                pr_id = dh.getFieldDataByCondition("QUA_Project", "pr_id", "pr_code = '" + Form.Rows[0]["pr_qualmethod"] + "'").ToString();
-                                Grid = (DataTable)dh.ExecuteSql("select distinct ci_kind ,0 oi_id , 0 oi_sampleqty   from QUA_ProjectDetail left join QUA_CheckItem on pd_ciid=ci_id where pd_prid='" + pr_id + "'", "select");
+                                qualmethod = Form.Rows[0]["pr_qualmethod"].ToString();
+                            }
+                            Form.Rows[0]["ob_projectcode"] = qualmethod;
+                            pr_id = dh.getFieldDataByCondition("QUA_Project", "pr_id", "pr_code = '" + qualmethod + "'").ToString();
+                            sql.Clear();
+                            sql.Append("select nvl(max(oi_id),0)oi_id,ci_kind,nvl(max(oi_sampleqty),0) oi_sampleqty from ");
+                            sql.Append("QUA_PROJECT left join QUA_ProjectDetail on pd_prid=pr_id left join QUA_CheckItem ");
+                            sql.Append("on pd_ciid=ci_id left join OQCITEMS on oi_checkno='" + iCheckNo + "' and ");
+                            sql.Append("oi_projectcode='" + qualmethod + "'and oi_projectcode = pr_code and oi_checkkind = ci_kind ");
+                            sql.Append("where pr_code='" + qualmethod + "' group by ci_kind ");
+                            Grid = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                            if (Grid.Rows.Count == 0)
+                            {
+                                oErrorMessage = "检验方案:" + qualmethod + "无检验项目";
                             }
                         }
                         else

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

@@ -41,7 +41,7 @@
     <MinimumRequiredVersion>1.0.0.201</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
-    <ApplicationRevision>217</ApplicationRevision>
+    <ApplicationRevision>222</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>true</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>