Browse Source

查询界面修改

callm 4 months ago
parent
commit
769765ff61

+ 3 - 3
UAS_MES_ZDXW/FunctionCode/Query/Query_MakeInfo.cs

@@ -35,10 +35,10 @@ namespace UAS_MES_NEW.Query
 
             //工单号放大镜配置
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
-            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,pr_detail # 产品名称,ma_softversion # 软件版本";
+            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,pr_detail # 产品名称,ma_status # 工单状态";
             ma_code.FormName = Name;
             ma_code.SetValueField = new string[] { "ma_code" };
-            ma_code.Condition = "ma_statuscode='STARTED'";
+            ma_code.Condition = "ma_statuscode is not null";
             ma_code.DbChange += Ma_code_DbChange;
         }
         private void Ma_code_DbChange(object sender, EventArgs e)
@@ -64,7 +64,7 @@ namespace UAS_MES_NEW.Query
             else
             {
                 MessageBox.Show("工单号" + ma_code.Text + "不存在");
-                BaseUtil.CleanDataGridView(SnInf);
+                //BaseUtil.CleanDataGridView(SnInf);
                 ma_code.Text = "";
             }
         }

+ 11 - 109
UAS_MES_ZDXW/FunctionCode/Query/Query_SN.Designer.cs

@@ -30,11 +30,8 @@
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Query_SN));
             this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
-            this.label1 = new System.Windows.Forms.Label();
-            this.label2 = new System.Windows.Forms.Label();
             this.label5 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
-            this.label4 = new System.Windows.Forms.Label();
             this.date = new System.Windows.Forms.DateTimePicker();
             this.label6 = new System.Windows.Forms.Label();
             this.label7 = new System.Windows.Forms.Label();
@@ -46,37 +43,12 @@
             this.Print = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.num = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.status = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.seriallength = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.pr_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.color = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.factory = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Export = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             ((System.ComponentModel.ISupportInitialize)(this.currentSerial)).BeginInit();
             this.SuspendLayout();
             // 
-            // label1
-            // 
-            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(106, 313);
-            this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(146, 41);
-            this.label1.TabIndex = 1;
-            this.label1.Text = "工厂代码";
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(106, 181);
-            this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(146, 41);
-            this.label2.TabIndex = 2;
-            this.label2.Text = "颜色代码";
-            // 
             // label5
             // 
             this.label5.AutoSize = true;
@@ -92,27 +64,16 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(106, 456);
+            this.label3.Location = new System.Drawing.Point(106, 274);
             this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(146, 41);
             this.label3.TabIndex = 13;
             this.label3.Text = "流水长度";
             // 
-            // label4
-            // 
-            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(106, 383);
-            this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(146, 41);
-            this.label4.TabIndex = 15;
-            this.label4.Text = "组装状态";
-            // 
             // date
             // 
-            this.date.Location = new System.Drawing.Point(305, 249);
+            this.date.Location = new System.Drawing.Point(305, 197);
             this.date.Name = "date";
             this.date.Size = new System.Drawing.Size(388, 35);
             this.date.TabIndex = 17;
@@ -122,7 +83,7 @@
             // 
             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(106, 247);
+            this.label6.Location = new System.Drawing.Point(106, 195);
             this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(82, 41);
@@ -133,7 +94,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(106, 526);
+            this.label7.Location = new System.Drawing.Point(106, 344);
             this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(126, 41);
@@ -155,7 +116,7 @@
             // 
             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(106, 597);
+            this.label10.Location = new System.Drawing.Point(106, 415);
             this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(146, 41);
@@ -175,7 +136,7 @@
             // 
             // currentSerial
             // 
-            this.currentSerial.Location = new System.Drawing.Point(305, 603);
+            this.currentSerial.Location = new System.Drawing.Point(305, 421);
             this.currentSerial.Name = "currentSerial";
             this.currentSerial.Size = new System.Drawing.Size(388, 35);
             this.currentSerial.TabIndex = 30;
@@ -195,7 +156,7 @@
             this.Print.DownImage = ((System.Drawing.Image)(resources.GetObject("Print.DownImage")));
             this.Print.Image = null;
             this.Print.IsShowBorder = true;
-            this.Print.Location = new System.Drawing.Point(519, 670);
+            this.Print.Location = new System.Drawing.Point(519, 488);
             this.Print.Margin = new System.Windows.Forms.Padding(6);
             this.Print.MoveImage = ((System.Drawing.Image)(resources.GetObject("Print.MoveImage")));
             this.Print.Name = "Print";
@@ -228,7 +189,7 @@
             this.num.AllPower = null;
             this.num.BackColor = System.Drawing.Color.White;
             this.num.ID = null;
-            this.num.Location = new System.Drawing.Point(305, 527);
+            this.num.Location = new System.Drawing.Point(305, 345);
             this.num.Margin = new System.Windows.Forms.Padding(6);
             this.num.Name = "num";
             this.num.Power = null;
@@ -238,27 +199,12 @@
             this.num.Str2 = null;
             this.num.TabIndex = 20;
             // 
-            // status
-            // 
-            this.status.AllPower = null;
-            this.status.BackColor = System.Drawing.Color.White;
-            this.status.ID = null;
-            this.status.Location = new System.Drawing.Point(305, 386);
-            this.status.Margin = new System.Windows.Forms.Padding(6);
-            this.status.Name = "status";
-            this.status.Power = null;
-            this.status.Size = new System.Drawing.Size(388, 35);
-            this.status.Str = null;
-            this.status.Str1 = null;
-            this.status.Str2 = null;
-            this.status.TabIndex = 16;
-            // 
             // seriallength
             // 
             this.seriallength.AllPower = null;
             this.seriallength.BackColor = System.Drawing.Color.White;
             this.seriallength.ID = null;
-            this.seriallength.Location = new System.Drawing.Point(305, 457);
+            this.seriallength.Location = new System.Drawing.Point(305, 275);
             this.seriallength.Margin = new System.Windows.Forms.Padding(6);
             this.seriallength.Name = "seriallength";
             this.seriallength.Power = null;
@@ -267,7 +213,7 @@
             this.seriallength.Str1 = null;
             this.seriallength.Str2 = null;
             this.seriallength.TabIndex = 14;
-            this.seriallength.Text = "4";
+            this.seriallength.Text = "6";
             // 
             // pr_code
             // 
@@ -284,38 +230,6 @@
             this.pr_code.Str2 = null;
             this.pr_code.TabIndex = 12;
             // 
-            // color
-            // 
-            this.color.AllPower = null;
-            this.color.BackColor = System.Drawing.Color.White;
-            this.color.ID = null;
-            this.color.Location = new System.Drawing.Point(305, 186);
-            this.color.Margin = new System.Windows.Forms.Padding(6);
-            this.color.Name = "color";
-            this.color.Power = null;
-            this.color.Size = new System.Drawing.Size(388, 35);
-            this.color.Str = null;
-            this.color.Str1 = null;
-            this.color.Str2 = null;
-            this.color.TabIndex = 6;
-            this.color.Text = "5";
-            // 
-            // factory
-            // 
-            this.factory.AllPower = null;
-            this.factory.BackColor = System.Drawing.Color.White;
-            this.factory.ID = null;
-            this.factory.Location = new System.Drawing.Point(305, 315);
-            this.factory.Margin = new System.Windows.Forms.Padding(6);
-            this.factory.Name = "factory";
-            this.factory.Power = null;
-            this.factory.Size = new System.Drawing.Size(388, 35);
-            this.factory.Str = null;
-            this.factory.Str1 = null;
-            this.factory.Str2 = null;
-            this.factory.TabIndex = 5;
-            this.factory.Text = "D";
-            // 
             // Export
             // 
             this.Export.AllPower = null;
@@ -323,7 +237,7 @@
             this.Export.DownImage = ((System.Drawing.Image)(resources.GetObject("Export.DownImage")));
             this.Export.Image = null;
             this.Export.IsShowBorder = true;
-            this.Export.Location = new System.Drawing.Point(305, 670);
+            this.Export.Location = new System.Drawing.Point(305, 488);
             this.Export.Margin = new System.Windows.Forms.Padding(6);
             this.Export.MoveImage = ((System.Drawing.Image)(resources.GetObject("Export.MoveImage")));
             this.Export.Name = "Export";
@@ -351,16 +265,10 @@
             this.Controls.Add(this.label7);
             this.Controls.Add(this.label6);
             this.Controls.Add(this.date);
-            this.Controls.Add(this.status);
-            this.Controls.Add(this.label4);
             this.Controls.Add(this.seriallength);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.pr_code);
             this.Controls.Add(this.label5);
-            this.Controls.Add(this.color);
-            this.Controls.Add(this.factory);
-            this.Controls.Add(this.label2);
-            this.Controls.Add(this.label1);
             this.Controls.Add(this.Export);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(6);
@@ -378,16 +286,10 @@
 
         private CustomControl.ButtonUtil.NormalButton Export;
         private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1;
-        private System.Windows.Forms.Label label1;
-        private System.Windows.Forms.Label label2;
-        private CustomControl.TextBoxWithIcon.EnterTextBox factory;
-        private CustomControl.TextBoxWithIcon.EnterTextBox color;
         private CustomControl.TextBoxWithIcon.EnterTextBox pr_code;
         private System.Windows.Forms.Label label5;
         private CustomControl.TextBoxWithIcon.EnterTextBox seriallength;
         private System.Windows.Forms.Label label3;
-        private CustomControl.TextBoxWithIcon.EnterTextBox status;
-        private System.Windows.Forms.Label label4;
         private System.Windows.Forms.DateTimePicker date;
         private System.Windows.Forms.Label label6;
         private CustomControl.TextBoxWithIcon.EnterTextBox num;

+ 2 - 233
UAS_MES_ZDXW/FunctionCode/Query/Query_SN.cs

@@ -48,18 +48,13 @@ namespace UAS_MES_NEW.Query
                 DataTable dt = new DataTable();
                 dt.Columns.Add("工单号");
                 dt.Columns.Add("序列号");
-                dt.Columns.Add("拓展栏位1");
-                dt.Columns.Add("拓展栏位2");
-                dt.Columns.Add("拓展栏位3");
-                dt.Columns.Add("备注");
                 for (decimal i = currentSerial.Value; i < currentSerial.Value + int.Parse(num.Text); i++)
                 {
                     DataRow dr = dt.NewRow();
                     dr["工单号"] = ma_code.Text;
-                    string serial = ma_code.Text+ pr_code.Text
+                    string serial = ma_code.Text
                         + lpad(int.Parse(seriallength.Text), (i + 1).ToString());
-                    string encode = MD5Encoding(serial + ")G$d");
-                    dr["序列号"] = serial + encode.Substring(encode.Length - 2);
+                    dr["序列号"] = serial;
                     dt.Rows.Add(dr);
                 }
                 eh.ExportExcel(dt, FolderPath);
@@ -113,235 +108,9 @@ namespace UAS_MES_NEW.Query
             return number;
         }
 
-        private string GetDate(string year, string month, string day)
-        {
-            string returndate = "";
-            switch (year)
-            {
-                case "2020":
-                    returndate = "C";
-                    break;
-                case "2021":
-                    returndate = "D";
-                    break;
-                case "2022":
-                    returndate = "E";
-                    break;
-                case "2023":
-                    returndate = "F";
-                    break;
-                case "2024":
-                    returndate = "G";
-                    break;
-                case "2025":
-                    returndate = "H";
-                    break;
-                case "2026":
-                    returndate = "I";
-                    break;
-                case "2027":
-                    returndate = "J";
-                    break;
-                case "2028":
-                    returndate = "K";
-                    break;
-                case "2029":
-                    returndate = "L";
-                    break;
-                case "2030":
-                    returndate = "M";
-                    break;
-                case "2031":
-                    returndate = "N";
-                    break;
-                case "2032":
-                    returndate = "O";
-                    break;
-                case "2033":
-                    returndate = "P";
-                    break;
-                case "2034":
-                    returndate = "Q";
-                    break;
-                default:
-                    break;
-            }
-            switch (month)
-            {
-                case "01":
-                    returndate += "1";
-                    break;
-                case "02":
-                    returndate += "2";
-                    break;
-                case "03":
-                    returndate += "3";
-                    break;
-                case "04":
-                    returndate += "4";
-                    break;
-                case "05":
-                    returndate += "5";
-                    break;
-                case "06":
-                    returndate += "6";
-                    break;
-                case "07":
-                    returndate += "7";
-                    break;
-                case "08":
-                    returndate += "8";
-                    break;
-                case "09":
-                    returndate += "9";
-                    break;
-                case "10":
-                    returndate += "A";
-                    break;
-                case "11":
-                    returndate += "B";
-                    break;
-                case "12":
-                    returndate += "C";
-                    break;
-                default:
-                    break;
-            }
-            switch (day)
-            {
-                case "01":
-                    returndate += "1";
-                    break;
-                case "02":
-                    returndate += "2";
-                    break;
-                case "03":
-                    returndate += "3";
-                    break;
-                case "04":
-                    returndate += "4";
-                    break;
-                case "05":
-                    returndate += "5";
-                    break;
-                case "06":
-                    returndate += "6";
-                    break;
-                case "07":
-                    returndate += "7";
-                    break;
-                case "08":
-                    returndate += "8";
-                    break;
-                case "09":
-                    returndate += "9";
-                    break;
-                case "10":
-                    returndate += "A";
-                    break;
-                case "11":
-                    returndate += "B";
-                    break;
-                case "12":
-                    returndate += "C";
-                    break;
-                case "13":
-                    returndate += "D";
-                    break;
-                case "14":
-                    returndate += "E";
-                    break;
-                case "15":
-                    returndate += "F";
-                    break;
-                case "16":
-                    returndate += "G";
-                    break;
-                case "17":
-                    returndate += "H";
-                    break;
-                case "18":
-                    returndate += "I";
-                    break;
-                case "19":
-                    returndate += "J";
-                    break;
-                case "20":
-                    returndate += "K";
-                    break;
-                case "21":
-                    returndate += "L";
-                    break;
-                case "22":
-                    returndate += "M";
-                    break;
-                case "23":
-                    returndate += "N";
-                    break;
-                case "24":
-                    returndate += "O";
-                    break;
-                case "25":
-                    returndate += "P";
-                    break;
-                case "26":
-                    returndate += "Q";
-                    break;
-                case "27":
-                    returndate += "R";
-                    break;
-                case "28":
-                    returndate += "S";
-                    break;
-                case "29":
-                    returndate += "T";
-                    break;
-                case "30":
-                    returndate += "U";
-                    break;
-                case "31":
-                    returndate += "V";
-                    break;
-                default:
-                    break;
-            }
-            return returndate;
-        }
-
         private void Print_Click(object sender, EventArgs e)
         {
 
-            DataTable dt = new DataTable();
-            dt.Columns.Add("工单号");
-            dt.Columns.Add("序列号");
-            dt.Columns.Add("拓展栏位1");
-            dt.Columns.Add("拓展栏位2");
-            dt.Columns.Add("拓展栏位3");
-            dt.Columns.Add("备注");
-            for (decimal i = currentSerial.Value; i < currentSerial.Value + int.Parse(num.Text); i++)
-            {
-                DataRow dr = dt.NewRow();
-             
-
-                string serial = pr_code.Text
-                    + color.Text
-                    + GetDate(date.Value.ToString("yyyy"), date.Value.ToString("MM"), date.Value.ToString("dd"))
-                    + factory.Text
-                    + status.Text
-                    + lpad(int.Parse(seriallength.Text), (i + 1).ToString());
-                string encode = MD5Encoding(serial + ")G$d");
-                dr["序列号"] = serial + encode.Substring(encode.Length - 2);
-                dt.Rows.Add(dr);
-                for (int j = 0; j < doc.Variables.FormVariables.Count; j++)
-                {
-                    if (doc.Variables.FormVariables.Item(j + 1).Name.ToUpper() == "SN")
-                    {
-                        doc.Variables.FormVariables.Item(j + 1).Value = (serial + encode.Substring(encode.Length - 2));
-                    }
-                }
-                doc.Printer.SwitchTo(Printer.Text);
-                doc.PrintDocument(1);
-            }
         }
     }
 }