ソースを参照

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

Hcsy 7 年 前
コミット
2b857a8d84

+ 16 - 0
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs

@@ -84,6 +84,7 @@
             this.bi_inman = new System.Windows.Forms.Label();
             this.pib_inman = new System.Windows.Forms.Label();
             this.PackMidBox = new System.Windows.Forms.Button();
+            this.CustomerLabel = new System.Windows.Forms.Button();
             this.DCCheck = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.GridPrcode = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
             this.pd_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -641,6 +642,19 @@
             this.PackMidBox.Visible = false;
             this.PackMidBox.Click += new System.EventHandler(this.PackMidBox_Click);
             // 
+            // CustomerLabel
+            // 
+            this.CustomerLabel.Enabled = false;
+            this.CustomerLabel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.CustomerLabel.Location = new System.Drawing.Point(485, 80);
+            this.CustomerLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.CustomerLabel.Name = "CustomerLabel";
+            this.CustomerLabel.Size = new System.Drawing.Size(84, 26);
+            this.CustomerLabel.TabIndex = 103;
+            this.CustomerLabel.Text = "标签自定义";
+            this.CustomerLabel.UseVisualStyleBackColor = true;
+            this.CustomerLabel.Click += new System.EventHandler(this.CustomerLabel_Click);
+            // 
             // DCCheck
             // 
             this.DCCheck.ID = null;
@@ -1365,6 +1379,7 @@
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(233)))), ((int)(((byte)(206)))));
             this.ClientSize = new System.Drawing.Size(1257, 729);
+            this.Controls.Add(this.CustomerLabel);
             this.Controls.Add(this.PackMidBox);
             this.Controls.Add(this.pib_inman);
             this.Controls.Add(this.bi_inman);
@@ -1547,5 +1562,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
         private System.Windows.Forms.Button PackMidBox;
+        private System.Windows.Forms.Button CustomerLabel;
     }
 }

+ 22 - 3
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -464,7 +464,7 @@ namespace UAS_LabelMachine
             sql.Clear();
             sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'||to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS')  la_id,cl_custcode from customerlabel left join prodinout on pi_cardcode=cl_custcode ");
             sql.Append("left join customer on cu_code=cl_custcode left join label on la_code=CL_LABELCODE where ((pi_cardcode='" + pi_cardcode.Text + "' ");
-            sql.Append("and  pi_inoutno='" + pi_inoutno.Text + "') or( cl_custcode is null)) and cl_labeltype='单盘' order by cl_date desc");
+            sql.Append("and  pi_inoutno='" + pi_inoutno.Text + "') or( cl_custcode is null)) and cl_labeltype='单盘' order by cl_custcode,cl_date desc");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             SingleLabelCombox.DisplayMember = "cl_labelname";
             SingleLabelCombox.ValueMember = "la_id";
@@ -486,7 +486,7 @@ namespace UAS_LabelMachine
             sql.Clear();
             sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'||to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS')  la_id,cl_custcode from customerlabel left join prodinout on pi_cardcode=cl_custcode ");
             sql.Append("left join customer on cu_code=cl_custcode left join label on la_code=CL_LABELCODE where ((pi_cardcode='" + pi_cardcode.Text + "' ");
-            sql.Append("and  pi_inoutno='" + pi_inoutno.Text + "') or( cl_custcode is null)) and cl_labeltype='中盒' order by cl_date desc");
+            sql.Append("and  pi_inoutno='" + pi_inoutno.Text + "') or( cl_custcode is null)) and cl_labeltype='中盒' order by cl_custcode,cl_date desc");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             MidLabelCombox.DisplayMember = "cl_labelname";
             MidLabelCombox.ValueMember = "la_id";
@@ -509,7 +509,7 @@ namespace UAS_LabelMachine
             sql.Clear();
             sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'||to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS')  la_id,cl_custcode from customerlabel left join prodinout on pi_cardcode=cl_custcode ");
             sql.Append("left join customer on cu_code=cl_custcode left join label on la_code=CL_LABELCODE where ((pi_cardcode='" + pi_cardcode.Text + "' ");
-            sql.Append("and  pi_inoutno='" + pi_inoutno.Text + "') or( cl_custcode is null)) and cl_labeltype='外箱' order by cl_date desc");
+            sql.Append("and  pi_inoutno='" + pi_inoutno.Text + "') or( cl_custcode is null)) and cl_labeltype='外箱' order by cl_custcode,cl_date desc");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             OutBoxCombox.DisplayMember = "cl_labelname";
             OutBoxCombox.ValueMember = "la_id";
@@ -550,6 +550,14 @@ namespace UAS_LabelMachine
                 if (dt.Rows.Count > 0)
                 {
                     pi_cardcode.Text = dt.Rows[0]["pi_cardcode"].ToString();
+                    if (pi_cardcode.Text != "ZGCC")
+                    {
+                        CustomerLabel.Enabled = false;
+                    }
+                    else
+                    {
+                        CustomerLabel.Enabled = true;
+                    }
                     pi_date.Text = dt.Rows[0]["pi_date"].ToString();
                     PI_ID = dt.Rows[0]["pi_id"].ToString();
                     OutBoxNum_Click(new object(), new EventArgs());
@@ -1620,5 +1628,16 @@ namespace UAS_LabelMachine
             }
             Input.Focus();
         }
+
+        private void CustomerLabel_Click(object sender, EventArgs e)
+        {
+            sql.Clear();
+            sql.Append("update prodiobarcode set pib_custbarcode=case when instr(pib_custbarcode,'SL')=0 ");
+            sql.Append("then ('SL'||pib_custbarcode)else pib_custbarcode end, pib_custoutboxcode=case when instr");
+            sql.Append("(pib_custoutboxcode,'SC')=0 then ('SC'||pib_custoutboxcode)else pib_custoutboxcode end where pib_inoutno='" + pi_inoutno.Text + "'");
+            dh.ExecuteSql(sql.ToString(), "select");
+            LoadGridData(sender, e);
+            CustomerLabel.Enabled = false;
+        }
     }
 }