Эх сурвалжийг харах

取消采集,上料打印,直通率报表优化

callm 4 жил өмнө
parent
commit
f7d34f2f41

+ 3 - 3
UAS_MES_ODLF/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -368,7 +368,7 @@ namespace UAS_MES_NEW.Make
                         OperateResult.AppendText(">>获取序列号" + code.Text + "成功\n", Color.Green);
                         if (PrintLabel.SelectedValue == null)
                         {
-                            OperateResult.AppendText(">>产品编号:" + ma_prodcode.Text + "未维护彩盒标签\n", Color.Red, code);
+                            OperateResult.AppendText(">>产品编号:" + ma_prodcode.Text + "未维护SN标签标签\n", Color.Red, code);
                             return;
                         }
                         GetItem();
@@ -507,7 +507,7 @@ namespace UAS_MES_NEW.Make
                     //刷新数据
                     EventArgs e = new EventArgs();
                     object sender = null;
-                    if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode, int.Parse(PrintNum.Text), ma_code, ma_prodcode.Text, "彩盒标", "0", out ErrorMessage))
+                    if (!Print.CodeSoft(Tag.ToString(), ref lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode, int.Parse(PrintNum.Text), ma_code, ma_prodcode.Text, "SN标签", "0", out ErrorMessage))
                     {
                         OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                     }
@@ -557,7 +557,7 @@ namespace UAS_MES_NEW.Make
 
         private void ma_prodcode_TextChanged(object sender, EventArgs e)
         {
-            DataTable _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault from label where la_prodcode='" + ma_prodcode.Text + "' and la_templatetype='彩盒标' and la_statuscode='AUDITED' order by la_isdefault", "select");
+            DataTable _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault from label where la_prodcode='" + ma_prodcode.Text + "' and la_templatetype='SN标签' and la_statuscode='AUDITED' order by la_isdefault", "select");
             PrintLabel.DataSource = _dt;
             PrintLabel.DisplayMember = "la_url";
             PrintLabel.ValueMember = "la_id";

+ 38 - 0
UAS_MES_ODLF/FunctionCode/Query/Query_DateRate.Designer.cs

@@ -34,6 +34,8 @@
             this.EndDate = new System.Windows.Forms.DateTimePicker();
             this.label3 = new System.Windows.Forms.Label();
             this.Export = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.pr_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.ms_makecode_label = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // BeginDate
@@ -81,11 +83,45 @@
             this.Export.UseVisualStyleBackColor = false;
             this.Export.Click += new System.EventHandler(this.Export_Click);
             // 
+            // pr_code
+            // 
+            this.pr_code.AllPower = "IFALL";
+            this.pr_code.Caller = null;
+            this.pr_code.Condition = null;
+            this.pr_code.DBTitle = "";
+            this.pr_code.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.pr_code.FormName = null;
+            this.pr_code.Location = new System.Drawing.Point(325, 91);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(6);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Power = "";
+            this.pr_code.ReturnData = null;
+            this.pr_code.SelectField = null;
+            this.pr_code.SetValueField = null;
+            this.pr_code.Size = new System.Drawing.Size(282, 46);
+            this.pr_code.TabIndex = 213;
+            this.pr_code.TableName = null;
+            this.pr_code.Tag = "makecode";
+            this.pr_code.TextBoxEnable = true;
+            // 
+            // ms_makecode_label
+            // 
+            this.ms_makecode_label.AutoSize = true;
+            this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode_label.Location = new System.Drawing.Point(140, 91);
+            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.ms_makecode_label.Name = "ms_makecode_label";
+            this.ms_makecode_label.Size = new System.Drawing.Size(146, 41);
+            this.ms_makecode_label.TabIndex = 212;
+            this.ms_makecode_label.Text = "产品编号";
+            // 
             // Query_DateRate
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1494, 1075);
+            this.Controls.Add(this.pr_code);
+            this.Controls.Add(this.ms_makecode_label);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.EndDate);
             this.Controls.Add(this.BeginDate);
@@ -108,5 +144,7 @@
         private System.Windows.Forms.DateTimePicker BeginDate;
         private System.Windows.Forms.DateTimePicker EndDate;
         private System.Windows.Forms.Label label3;
+        private CustomControl.TextBoxWithIcon.SearchTextBox pr_code;
+        private System.Windows.Forms.Label ms_makecode_label;
     }
 }

+ 19 - 1
UAS_MES_ODLF/FunctionCode/Query/Query_DateRate.cs

@@ -17,6 +17,7 @@ namespace UAS_MES_NEW.Query
 
         DataHelper dh = SystemInf.dh;
 
+        DataTable Dbfind;
 
         public Query_DateRate()
         {
@@ -25,6 +26,11 @@ namespace UAS_MES_NEW.Query
 
         private void Export_Click(object sender, EventArgs e)
         {
+            if (pr_code.Text == "")
+            {
+                MessageBox.Show("请输入产品代码");
+                return;
+            }
             if (EndDate.Value < BeginDate.Value)
             {
                 MessageBox.Show("结束日期不能小于起始日期");
@@ -42,7 +48,7 @@ namespace UAS_MES_NEW.Query
                 LogStringBuilder sql = new LogStringBuilder();
                 sql.Append("select * from MES_OKNG_DATE where sp_date between ");
                 sql.Append("to_date('" + BeginDate.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') and ");
-                sql.Append("to_date('" + EndDate.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') order by sp_date");
+                sql.Append("to_date('" + EndDate.Value.ToString("yyyy-MM-dd") + "','yyyy-mm-dd') and sp_prodcode='" + pr_code.Text + "' order by sp_date");
                 DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 string FolderPath = folderBrowserDialog1.SelectedPath;
                 ExcelHandler eh = new ExcelHandler();
@@ -57,7 +63,19 @@ namespace UAS_MES_NEW.Query
 
         private void Query_SpecialReport_Load(object sender, EventArgs e)
         {
+            //工单号放大镜配置
+            pr_code.TableName = " product ";
+            pr_code.SelectField = "pr_code # 产品编号,pr_detail # 产品名称,pr_spec # 型号";
+            pr_code.FormName = Name;
+            pr_code.SetValueField = new string[] { "pr_code" };
+            pr_code.Condition = "pr_statuscode='AUDITED'";
+            pr_code.DbChange += pr_code_DbChange;
+        }
 
+        private void pr_code_DbChange(object sender, EventArgs e)
+        {
+            Dbfind = pr_code.ReturnData;
+            BaseUtil.SetFormValue(this.Controls, Dbfind);
         }
     }
 }

+ 6 - 4
UAS_MES_ODLF/FunctionCode/Special/Special_CancelCollection.cs

@@ -40,8 +40,8 @@ namespace UAS_MES_NEW.Special
                 sql.Append("select cd_stepcode from craft left join craftdetail on cr_id=cd_crid where ");
                 sql.Append("cr_prodcode='" + pr_code + "' and cr_code='" + cr_code + "' order by cd_detno ");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                if (ms_stepcode == dt.Rows[0]["cd_stepcode"].ToString() || (ms_stepcode == "" && ms_nextstepcode == User.CurrentStepCode))
-                {
+                //if (ms_stepcode == dt.Rows[0]["cd_stepcode"].ToString() || (ms_stepcode == "" && ms_nextstepcode == User.CurrentStepCode))
+                //{
                     List<string> sqls = new List<string>();
                     //存在不良删除不良记录
                     if (ms_status == "3")
@@ -81,6 +81,8 @@ namespace UAS_MES_NEW.Special
                         dh.BatchInsert(sql.GetString(), new string[] { "barcode" }, barcode.ToArray());
                         sqls.Add("delete from craftmaterial where cm_sncode='" + sn_code.Text + "' and cm_makecode='" + ms_makecode + "'");
                     }
+                    sqls.Add("delete from sninfo where si_sn='"+sn_code.Text+"'");
+                    sqls.Add("update makeaddresslist set mal_sncode='',mal_status=0 where mal_sncode='"+sn_code.Text+"'");
                     //删除打印日志
                     sqls.Add("delete from labelprintlog where lpl_value='" + sn_code.Text + "' and lpl_makecode='" + ms_makecode + "'");
                     //删除老化记录
@@ -103,8 +105,8 @@ namespace UAS_MES_NEW.Special
                     dh.ExecuteSQLTran(sqls.ToArray());
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "取消采集", "取消采集成功", sn_code.Text, "");
                     OperateResult.AppendText(">>序列号" + sn_code.Text + "成功解除绑定\n", Color.Green, sn_code);
-                }
-                else OperateResult.AppendText(">>序列号" + sn_code.Text + "不处于第一道工序,不允许取消采集\n", Color.Red, sn_code);
+                //}
+                //else OperateResult.AppendText(">>序列号" + sn_code.Text + "不处于第一道工序,不允许取消采集\n", Color.Red, sn_code);
             }
             else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
         }