callm 1 жил өмнө
parent
commit
007c2fd891

+ 14 - 0
UAS_MES_LGDZ/FunctionCode/Query/BarCodePrint.Designer.cs

@@ -32,6 +32,7 @@
             this.label1_lll_ = new System.Windows.Forms.Label();
             this.PrintBarCode = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.bar_remain = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
+            this.newbarcode = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // label1_lll_
@@ -79,11 +80,23 @@
             this.bar_remain.Str2 = null;
             this.bar_remain.TabIndex = 222;
             // 
+            // newbarcode
+            // 
+            this.newbarcode.AutoSize = true;
+            this.newbarcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.newbarcode.Location = new System.Drawing.Point(254, 9);
+            this.newbarcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.newbarcode.Name = "newbarcode";
+            this.newbarcode.Size = new System.Drawing.Size(0, 41);
+            this.newbarcode.TabIndex = 228;
+            this.newbarcode.Visible = false;
+            // 
             // BarCodePrint
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(731, 249);
+            this.Controls.Add(this.newbarcode);
             this.Controls.Add(this.PrintBarCode);
             this.Controls.Add(this.bar_remain);
             this.Controls.Add(this.label1_lll_);
@@ -103,5 +116,6 @@
         private CustomControl.TextBoxWithIcon.SnCollectionBox bar_remain;
         private System.Windows.Forms.Label label1_lll_;
         private CustomControl.ButtonUtil.NormalButton PrintBarCode;
+        private System.Windows.Forms.Label newbarcode;
     }
 }

+ 15 - 1
UAS_MES_LGDZ/FunctionCode/Query/BarCodePrint.cs

@@ -8,6 +8,7 @@ using System.Text;
 using System.Windows.Forms;
 using UAS_MES_NEW.DataOperate;
 using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicMethod;
 
 namespace UAS_MES_NEW.Query
 {
@@ -25,11 +26,24 @@ namespace UAS_MES_NEW.Query
         private void BarCodePrint_Load(object sender, EventArgs e)
         {
             bar_remain.Text = dh.getFieldDataByCondition("barcode", "bar_remain", "bar_code='" + bar + "'").ToString();
+
         }
 
         private void PrintBarCode_Click(object sender, EventArgs e)
         {
-
+            DataTable dt = (DataTable)dh.ExecuteSql("select bar_remain,bar_prodcode,to_char(bar_madedate,'yyyymmdd')bar_madedate" +
+             ",bar_vendbarcode from barcode where bar_code='" + bar + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                string remain = dt.Rows[0]["bar_remain"].ToString();
+                string bar_prodcode = dt.Rows[0]["bar_prodcode"].ToString();
+                string bar_madedate = dt.Rows[0]["bar_madedate"].ToString();
+                string bar_vendbarcode = dt.Rows[0]["bar_vendbarcode"].ToString();
+                string barcode = "";
+                LogicHandler.SP_GETBARCODE(bar_prodcode, "", out barcode);
+                newbarcode.Text = barcode.Replace("BARCODE:","") + "#" + bar_prodcode + "," + bar_prodcode + "," + bar_remain.Text + "," + bar_vendbarcode + "," + bar_madedate + ",";
+            }
+            Close();
         }
     }
 }

+ 18 - 6
UAS_MES_LGDZ/FunctionCode/Query/Query_BarcodeIn.cs

@@ -110,6 +110,8 @@ namespace UAS_MES_NEW.Query
             MessageBox.Show("生成明细成功");
         }
 
+        string new_barcode = "";
+
         private void pi_inoutno_UserControlTextChanged(object sender, EventArgs e)
         {
             LoadGridData();
@@ -138,24 +140,34 @@ namespace UAS_MES_NEW.Query
                     MessageBox.Show("条码" + barcode.Text + "不存在");
                     return;
                 }
-
-                BarCodePrint bar=new BarCodePrint(barcode.Text);
-                bar.StartPosition= FormStartPosition.CenterScreen;
-                bar.Controls["PrintBarCode"].Click += Print_Click_1;
+                BarCodePrint bar = new BarCodePrint(barcode.Text);
+                bar.StartPosition = FormStartPosition.CenterScreen;
                 bar.ShowDialog();
+                string newbarcode = bar.Controls["newbarcode"].Text;
+                string bar_remain = bar.Controls["bar_remain"].Text;
+                bar.Controls["PrintBarCode"].Click += Query_BarcodeIn_Click;
 
                 string pi_id = dh.getFieldDataByCondition("prodinout", "pi_id", "pi_inoutno='" + pi_inoutno.Text + "'").ToString();
-                string bar_remain = dt.Rows[0]["bar_remain"].ToString();
                 string bar_code = dt.Rows[0]["bar_code"].ToString();
                 string bar_prodcode = dt.Rows[0]["bar_prodcode"].ToString();
                 string bar_madedate = dt.Rows[0]["bar_madedate"].ToString();
                 string bar_vendbarcode = dt.Rows[0]["bar_vendbarcode"].ToString();
                 dh.ExecuteSql("insert into barcodeio(bi_id,bi_piid,bi_barcode,bi_inoutno,bi_prodcode,bi_indate,bi_inqty,bi_vendbarcode,bi_madedate,bi_sourcecode)" +
-                    "values(barcodeio_seq.nextval,'" + pi_id + "','" + bar_code + "','" + pi_inoutno.Text + "','" + bar_prodcode + "',sysdate,'" + bar_remain + "','" + bar_vendbarcode + "',to_date('" + bar_madedate + "','yyyy-mm-dd'),'"+ bar_code + "')", "insert");
+                    "values(barcodeio_seq.nextval,'" + pi_id + "','" + newbarcode + "','" + pi_inoutno.Text + "','" + bar_prodcode + "',sysdate,'" + bar_remain + "','" + bar_vendbarcode + "',to_date('" + bar_madedate + "','yyyy-mm-dd'),'" + bar_code + "')", "insert");
                 LoadGridData();
+                string ErrorMessage = "";
+                if (Print.BarTender(Tag.ToString(), ref engine, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, new_barcode, int.Parse("1"), pi_inoutno.Text, bar_prodcode, "自定义", "0", out ErrorMessage))
+                {
+
+                }
             }
         }
 
+        private void Query_BarcodeIn_Click(object sender, EventArgs e)
+        {
+
+        }
+
         private void DeleteBarcode_Click(object sender, EventArgs e)
         {
             if (!ifcheckrow())

+ 1 - 1
UAS_MES_LGDZ/FunctionCode/Query/Query_SpecialReport.cs

@@ -207,7 +207,7 @@ namespace UAS_MES_NEW.Query
                 DialogResult result1 = ExportFileDialog.ShowDialog();
                 if (result1 == DialogResult.OK)
                 {
-                    excel.ExportExcel_LIANGAN(dt1, ExportFileDialog.SelectedPath + System.DateTime.Now.ToString("yyyyMMddhhmmss") + ".xls");
+                    excel.ExportExcel_LIANGAN(dt1, ExportFileDialog.SelectedPath +"\\"+ System.DateTime.Now.ToString("yyyyMMddhhmmss") + ".xls");
                 }
             }
         }