Bläddra i källkod

修改维修保存按钮在良品时不可见

章政 8 år sedan
förälder
incheckning
4cb7d2a551

+ 2 - 0
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -479,12 +479,14 @@ namespace UAS_MES.Make
                 bc_code.Enabled = false;
                 WaitReject.Enabled = false;
                 ChooseedReject.Enabled = false;
+                Save.Visible = false;
             }
             else
             {
                 bc_code.Enabled = true;
                 WaitReject.Enabled = true;
                 ChooseedReject.Enabled = true;
+                Save.Visible = true;
             }
         }
     }

+ 30 - 14
UAS-MES/FunctionCode/OQC/OQC_BatchResultJudge.cs

@@ -229,29 +229,45 @@ namespace UAS_MES.OQC
         /// <returns></returns>
         private bool CheckBefore()
         {
-            //如果AQL标准为空
-            if (ob_aqlcode.Text == "")
+            if (ob_maxngacceptqty.Text == "" || ob_maxngacceptqty.Text=="0")
             {
-                if (ob_maxngacceptqty.Text == "")
-                    OperateResult.AppendText(">>AQL标准为空的时候必须填写最大不合格允许通过数\n", Color.Red);
+                if (ob_aqlcode.Text == "")
+                    OperateResult.AppendText(">>最大不合格允许通过数为空的时候必须填写维护AQL标准\n", Color.Red);
                 else
                 {
-                    sql.Clear();
-                    sql.Append("select wm_concat(oi_itemcode) codes from OQCitems where ");
-                    sql.Append("nvl(oi_checkqty,0)<oi_sampleqty  and oi_sampleqty>0 and rownum<30 and oi_checkno='" + ob_checkno.Text + "'");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    dt = (DataTable)dh.ExecuteSql("select nvl(ad_minqty,0)ad_minqty,nvl(ad_maxqty,0)ad_maxqty,nvl(ad_maxngacceptqty,0)ad_maxngacceptqty from QUA_Aql left join qua_aqldetail on ad_alid=al_id where al_code='" + ob_aqlcode.Text + "'", "select");
                     if (dt.Rows.Count > 0)
                     {
-                        if (dt.Rows[0]["codes"].ToString() != "")
+                        for (int i = 0; i < dt.Rows.Count; i++)
                         {
-                            OperateResult.AppendText(">>项目编号抽检数未达到样本数,项目编号['" + ob_makecode.Text + "']\n", Color.Red);
-                            return false;
+                            int batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
+                            int minqty = int.Parse(dt.Rows[i]["ad_minqty"].ToString());
+                            int maxqty = int.Parse(dt.Rows[i]["ad_maxqty"].ToString());
+                            if (batchqty > minqty && batchqty <= maxqty)
+                            {
+                                ob_maxngacceptqty.Text = dt.Rows[i]["ad_maxngacceptqty"].ToString();
+                                return true;
+                            }
                         }
-                        else
-                            return true;
                     }
                 }
             }
+            else {
+                sql.Clear();
+                sql.Append("select wm_concat(oi_itemcode) codes from OQCitems where ");
+                sql.Append("nvl(oi_checkqty,0)<oi_sampleqty  and oi_sampleqty>0 and rownum<30 and oi_checkno='" + ob_checkno.Text + "'");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                if (dt.Rows.Count > 0)
+                {
+                    if (dt.Rows[0]["codes"].ToString() != "")
+                    {
+                        OperateResult.AppendText(">>项目编号抽检数未达到样本数,项目编号[" + dt.Rows[0]["codes"].ToString() + "]\n", Color.Red);
+                        return false;
+                    }
+                    else
+                        return true;
+                }
+            }
             return false;
         }
 
@@ -285,7 +301,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.UserSourceCode,"批结果判定", Operate, User.UserName);
+                    LogicHandler.InsertMakeProcess(ms_sncode.Text, ob_makecode.Text, User.UserSourceCode, "批结果判定", Operate, User.UserName);
                 }
             }
         }

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

@@ -186,7 +186,7 @@
             | 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(807, 71);
+            this.label6.Location = new System.Drawing.Point(807, 72);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(58, 21);
             this.label6.TabIndex = 189;
@@ -599,7 +599,7 @@
             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(908, 72);
+            this.oi_checkqty.Location = new System.Drawing.Point(908, 73);
             this.oi_checkqty.Name = "oi_checkqty";
             this.oi_checkqty.Power = null;
             this.oi_checkqty.Size = new System.Drawing.Size(147, 21);

+ 29 - 13
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -274,29 +274,45 @@ namespace UAS_MES.OQC
 
         private bool CheckBefore()
         {
-            //如果AQL标准为空
-            if (ob_aqlcode.Text == "")
+            if (ob_maxngacceptqty.Text == "" || ob_maxngacceptqty.Text == "0")
             {
-                if (ob_maxngacceptqty.Text == "")
-                    OperateResult.AppendText(">>AQL标准为空的时候必须填写最大不合格允许通过数\n", Color.Red);
+                if (ob_aqlcode.Text == "")
+                    OperateResult.AppendText(">>最大不合格允许通过数为空的时候必须填写维护AQL标准\n", Color.Red);
                 else
                 {
-                    sql.Clear();
-                    sql.Append("select wm_concat(oi_itemcode) codes from OQCitems where ");
-                    sql.Append("nvl(oi_checkqty,0)<oi_sampleqty  and oi_sampleqty>0 and rownum<30 and oi_checkno='" + ob_checkno.Text + "'");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    dt = (DataTable)dh.ExecuteSql("select nvl(ad_minqty,0)ad_minqty,nvl(ad_maxqty,0)ad_maxqty,nvl(ad_maxngacceptqty,0)ad_maxngacceptqty from QUA_Aql left join qua_aqldetail on ad_alid=al_id where al_code='" + ob_aqlcode.Text + "'", "select");
                     if (dt.Rows.Count > 0)
                     {
-                        if (dt.Rows[0]["codes"].ToString() != "")
+                        for (int i = 0; i < dt.Rows.Count; i++)
                         {
-                            OperateResult.AppendText(">>项目编号抽检数未达到样本数,项目编号['" + ob_makecode.Text + "']\n", Color.Red);
-                            return false;
+                            int batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
+                            int minqty = int.Parse(dt.Rows[i]["ad_minqty"].ToString());
+                            int maxqty = int.Parse(dt.Rows[i]["ad_maxqty"].ToString());
+                            if (batchqty > minqty && batchqty <= maxqty)
+                            {
+                                ob_maxngacceptqty.Text = dt.Rows[i]["ad_maxngacceptqty"].ToString();
+                                return true;
+                            }
                         }
-                        else
-                            return true;
                     }
                 }
             }
+            else {
+                sql.Clear();
+                sql.Append("select wm_concat(oi_itemcode) codes from OQCitems where ");
+                sql.Append("nvl(oi_checkqty,0)<oi_sampleqty  and oi_sampleqty>0 and rownum<30 and oi_checkno='" + ob_checkno.Text + "'");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                if (dt.Rows.Count > 0)
+                {
+                    if (dt.Rows[0]["codes"].ToString() != "")
+                    {
+                        OperateResult.AppendText(">>项目编号抽检数未达到样本数,项目编号[" + dt.Rows[0]["codes"].ToString() + "]\n", Color.Red);
+                        return false;
+                    }
+                    else
+                        return true;
+                }
+            }
             return false;
         }
 

+ 1 - 0
UAS-MES/Program.cs

@@ -41,6 +41,7 @@ namespace UAS_MES
                     Directory.CreateDirectory(sysdisc + @":\Log");
                 FileStream fs = new FileStream(sysdisc + @":\Log\" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
                 fs.Close();
+                LogManager.DoLog(Application.StartupPath);
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
                     Application.Run(new Login());
                 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>248</ApplicationRevision>
+    <ApplicationRevision>249</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>true</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>