Browse Source

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

Hcsy 7 years ago
parent
commit
ab42fd8943

+ 1 - 1
UAS-出货标签管理(泽天)/PublicMethod/DataHelper.cs

@@ -53,7 +53,7 @@ namespace UAS_LabelMachine
         //Oracle端口
         public static readonly string OraclePort = "1521";
         //需要显示的账套
-        public static readonly string Masters = "ZT_TEST";
+        public static readonly string Masters = "ZT_TEST,ZT";
         //用户选择的数据库的连接字符串
         public static string DBConnectionString;
         static OracleConnection connection = null;

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

@@ -81,6 +81,15 @@
             this.PrintStatus = 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();
+            this.pjd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.CollectedNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.UnCollectedNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_outqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pjd_zxbzs_user = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.groupBoxWithBorder1 = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.label18 = new System.Windows.Forms.Label();
             this.MidBoxEnd = new UAS_LabelMachine.CustomControl.EnterTextBox();
@@ -134,15 +143,6 @@
             this.OutboxCapacity = new System.Windows.Forms.NumericUpDown();
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
-            this.pd_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pjd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.CollectedNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.UnCollectedNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_outqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pjd_zxbzs_user = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridPrcode)).BeginInit();
@@ -178,7 +178,7 @@
             // LabelMainTain
             // 
             this.LabelMainTain.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.LabelMainTain.Location = new System.Drawing.Point(381, 15);
+            this.LabelMainTain.Location = new System.Drawing.Point(406, 15);
             this.LabelMainTain.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.LabelMainTain.Name = "LabelMainTain";
             this.LabelMainTain.Size = new System.Drawing.Size(68, 26);
@@ -475,7 +475,7 @@
             // AttachInfo
             // 
             this.AttachInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AttachInfo.Location = new System.Drawing.Point(381, 48);
+            this.AttachInfo.Location = new System.Drawing.Point(406, 48);
             this.AttachInfo.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.AttachInfo.Name = "AttachInfo";
             this.AttachInfo.Size = new System.Drawing.Size(68, 26);
@@ -519,7 +519,7 @@
             // PrintFooter
             // 
             this.PrintFooter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintFooter.Location = new System.Drawing.Point(454, 15);
+            this.PrintFooter.Location = new System.Drawing.Point(503, 15);
             this.PrintFooter.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintFooter.Name = "PrintFooter";
             this.PrintFooter.Size = new System.Drawing.Size(68, 26);
@@ -561,7 +561,7 @@
             // Pack
             // 
             this.Pack.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Pack.Location = new System.Drawing.Point(454, 48);
+            this.Pack.Location = new System.Drawing.Point(503, 48);
             this.Pack.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Pack.Name = "Pack";
             this.Pack.Size = new System.Drawing.Size(68, 26);
@@ -573,7 +573,7 @@
             // PrintStatus
             // 
             this.PrintStatus.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintStatus.Location = new System.Drawing.Point(525, 15);
+            this.PrintStatus.Location = new System.Drawing.Point(309, 80);
             this.PrintStatus.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintStatus.Name = "PrintStatus";
             this.PrintStatus.Size = new System.Drawing.Size(68, 26);
@@ -623,6 +623,75 @@
             this.GridPrcode.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.GridPrcode_CellPainting);
             this.GridPrcode.SelectionChanged += new System.EventHandler(this.GridPrcode_SelectionChanged);
             // 
+            // pd_pdno
+            // 
+            this.pd_pdno.DataPropertyName = "pd_pdno";
+            this.pd_pdno.HeaderText = "明细序号";
+            this.pd_pdno.Name = "pd_pdno";
+            this.pd_pdno.ReadOnly = true;
+            this.pd_pdno.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            // 
+            // pjd_id
+            // 
+            this.pjd_id.DataPropertyName = "pjd_id";
+            this.pjd_id.HeaderText = "pjd_id";
+            this.pjd_id.Name = "pjd_id";
+            this.pjd_id.Visible = false;
+            // 
+            // pd_prodcode
+            // 
+            this.pd_prodcode.DataPropertyName = "pd_prodcode";
+            this.pd_prodcode.HeaderText = "物料编号";
+            this.pd_prodcode.Name = "pd_prodcode";
+            this.pd_prodcode.ReadOnly = true;
+            this.pd_prodcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            // 
+            // CollectedNum
+            // 
+            this.CollectedNum.DataPropertyName = "CollectedNum";
+            this.CollectedNum.HeaderText = "已采数";
+            this.CollectedNum.Name = "CollectedNum";
+            this.CollectedNum.ReadOnly = true;
+            // 
+            // UnCollectedNum
+            // 
+            this.UnCollectedNum.DataPropertyName = "UnCollectedNum";
+            this.UnCollectedNum.HeaderText = "未采集";
+            this.UnCollectedNum.Name = "UnCollectedNum";
+            this.UnCollectedNum.ReadOnly = true;
+            // 
+            // pd_outqty
+            // 
+            this.pd_outqty.DataPropertyName = "pd_outqty";
+            this.pd_outqty.HeaderText = "出库数量";
+            this.pd_outqty.Name = "pd_outqty";
+            this.pd_outqty.ReadOnly = true;
+            this.pd_outqty.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            // 
+            // pr_unit
+            // 
+            this.pr_unit.DataPropertyName = "pr_unit";
+            this.pr_unit.HeaderText = "单位";
+            this.pr_unit.Name = "pr_unit";
+            this.pr_unit.ReadOnly = true;
+            this.pr_unit.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            // 
+            // pd_brand
+            // 
+            this.pd_brand.DataPropertyName = "pd_brand";
+            this.pd_brand.HeaderText = "品牌";
+            this.pd_brand.Name = "pd_brand";
+            this.pd_brand.ReadOnly = true;
+            this.pd_brand.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            // 
+            // pjd_zxbzs_user
+            // 
+            this.pjd_zxbzs_user.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pjd_zxbzs_user.DataPropertyName = "pjd_zxbzs_user";
+            this.pjd_zxbzs_user.HeaderText = "最小包装";
+            this.pjd_zxbzs_user.Name = "pjd_zxbzs_user";
+            this.pjd_zxbzs_user.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            // 
             // groupBoxWithBorder1
             // 
             this.groupBoxWithBorder1.Controls.Add(this.label18);
@@ -967,7 +1036,7 @@
             // 
             this.SingleLabelPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.SingleLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrint.Location = new System.Drawing.Point(80, 158);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(65, 158);
             this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabelPrint.Name = "SingleLabelPrint";
             this.SingleLabelPrint.Size = new System.Drawing.Size(68, 26);
@@ -1076,7 +1145,7 @@
             // MidLabelPrint
             // 
             this.MidLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelPrint.Location = new System.Drawing.Point(82, 156);
+            this.MidLabelPrint.Location = new System.Drawing.Point(67, 156);
             this.MidLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabelPrint.Name = "MidLabelPrint";
             this.MidLabelPrint.Size = new System.Drawing.Size(68, 26);
@@ -1198,7 +1267,7 @@
             // OutBoxLabelPrint
             // 
             this.OutBoxLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLabelPrint.Location = new System.Drawing.Point(91, 158);
+            this.OutBoxLabelPrint.Location = new System.Drawing.Point(73, 158);
             this.OutBoxLabelPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OutBoxLabelPrint.Name = "OutBoxLabelPrint";
             this.OutBoxLabelPrint.Size = new System.Drawing.Size(76, 26);
@@ -1219,75 +1288,6 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
-            // pd_pdno
-            // 
-            this.pd_pdno.DataPropertyName = "pd_pdno";
-            this.pd_pdno.HeaderText = "明细序号";
-            this.pd_pdno.Name = "pd_pdno";
-            this.pd_pdno.ReadOnly = true;
-            this.pd_pdno.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            // 
-            // pjd_id
-            // 
-            this.pjd_id.DataPropertyName = "pjd_id";
-            this.pjd_id.HeaderText = "pjd_id";
-            this.pjd_id.Name = "pjd_id";
-            this.pjd_id.Visible = false;
-            // 
-            // pd_prodcode
-            // 
-            this.pd_prodcode.DataPropertyName = "pd_prodcode";
-            this.pd_prodcode.HeaderText = "物料编号";
-            this.pd_prodcode.Name = "pd_prodcode";
-            this.pd_prodcode.ReadOnly = true;
-            this.pd_prodcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            // 
-            // CollectedNum
-            // 
-            this.CollectedNum.DataPropertyName = "CollectedNum";
-            this.CollectedNum.HeaderText = "已采数";
-            this.CollectedNum.Name = "CollectedNum";
-            this.CollectedNum.ReadOnly = true;
-            // 
-            // UnCollectedNum
-            // 
-            this.UnCollectedNum.DataPropertyName = "UnCollectedNum";
-            this.UnCollectedNum.HeaderText = "未采集";
-            this.UnCollectedNum.Name = "UnCollectedNum";
-            this.UnCollectedNum.ReadOnly = true;
-            // 
-            // pd_outqty
-            // 
-            this.pd_outqty.DataPropertyName = "pd_outqty";
-            this.pd_outqty.HeaderText = "出库数量";
-            this.pd_outqty.Name = "pd_outqty";
-            this.pd_outqty.ReadOnly = true;
-            this.pd_outqty.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            // 
-            // pr_unit
-            // 
-            this.pr_unit.DataPropertyName = "pr_unit";
-            this.pr_unit.HeaderText = "单位";
-            this.pr_unit.Name = "pr_unit";
-            this.pr_unit.ReadOnly = true;
-            this.pr_unit.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            // 
-            // pd_brand
-            // 
-            this.pd_brand.DataPropertyName = "pd_brand";
-            this.pd_brand.HeaderText = "品牌";
-            this.pd_brand.Name = "pd_brand";
-            this.pd_brand.ReadOnly = true;
-            this.pd_brand.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            // 
-            // pjd_zxbzs_user
-            // 
-            this.pjd_zxbzs_user.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pjd_zxbzs_user.DataPropertyName = "pjd_zxbzs_user";
-            this.pjd_zxbzs_user.HeaderText = "最小包装";
-            this.pjd_zxbzs_user.Name = "pjd_zxbzs_user";
-            this.pjd_zxbzs_user.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

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

@@ -28,10 +28,6 @@ namespace UAS_LabelMachine
 
         StringBuilder sql = new StringBuilder();
         /// <summary>
-        /// CodeSoft新建打印机引擎
-        /// </summary>
-        ApplicationClass lbl;
-        /// <summary>
         /// 单盘打印文件
         /// </summary>
         Report SingleReport = new Report();
@@ -44,9 +40,9 @@ namespace UAS_LabelMachine
         /// </summary>
         Report OutReport = new Report();
         /// <summary>
-        /// 唛头文件
+        /// 唛头文件打印
         /// </summary>
-        Document FootDoc;
+        Report FootReport = new Report();
         /// <summary>
         /// Loading窗口
         /// </summary>
@@ -151,15 +147,6 @@ namespace UAS_LabelMachine
             SingleLabelPrinter.Text = Properties.Settings.Default.SPrinter;
             asc.controllInitializeSize(this);
             asc.controlAutoSize(this);
-            //实例化打印进程
-            try
-            {
-                lbl = new ApplicationClass();
-            }
-            catch (Exception)
-            {
-                MessageBox.Show("未安装CodeSoft软件或者版本不正确", "提示");
-            }
             RefreshDBConnect.Interval = 60000;
             RefreshDBConnect.Start();
         }
@@ -179,8 +166,6 @@ namespace UAS_LabelMachine
         {
             客户标签维护 form = new 客户标签维护();
             BaseUtil.SetFormCenter(form);
-            if (FootDoc != null)
-                FootDoc.Close();
             form.FormClosed += LabelFormClose;
             form.ShowDialog();
         }
@@ -348,9 +333,9 @@ namespace UAS_LabelMachine
             }
             sql.Clear();
             sql.Append("insert into prodiobarcode(PIB_ID,PIB_PRODCODE,PIB_INDATE,PIB_INOUTNO,PIB_PIID,PIB_PDNO, PIB_PDID,PIB_PICLASS,");
-            sql.Append("PIB_BARCODE,PIB_CUSTBARCODE,PIB_QTY,pib_brand,pib_datecode,pib_lotno,PIB_OUTBOXCODE2,pib_inman,PIB_IFPRINT,PIB_ORDERCODE,PIB_CUSTPO) ");
+            sql.Append("PIB_BARCODE,PIB_CUSTBARCODE,PIB_QTY,pib_brand,pib_datecode,pib_lotno,PIB_OUTBOXCODE2,pib_inman,PIB_IFPRINT,PIB_ORDERCODE,PIB_CUSTPO,pib_remark) ");
             sql.Append("select :PIB_ID,pd_prodcode,sysdate,pi_inoutno,pi_id,pd_pdno,pd_id,pi_class,");
-            sql.Append("'" + pib_barcode + "',:PIB_CUSTBARCODE,'" + CurrentZXBZ + "',pjd_brand,'" + Data["DATECODE"] + "','" + Data["LOTNO"] + "','" + pib_outboxcode2 + "','" + User.UserCode + "','" + (EnablePrint && SingleLabelAutoPrint.Checked ? 1 : 0).ToString() + "',pd_ordercode,pd_pocode ");
+            sql.Append("'" + pib_barcode + "',:PIB_CUSTBARCODE,'" + CurrentZXBZ + "',pjd_brand,'" + Data["DATECODE"] + "','" + Data["LOTNO"] + "','" + pib_outboxcode2 + "','" + User.UserCode + "','" + (EnablePrint && SingleLabelAutoPrint.Checked ? 1 : 0).ToString() + "',pd_ordercode,pd_pocode,pd_remark ");
             sql.Append("from prodinout left join prodiodetail on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pi_id='" + PI_ID + "' and pd_prodcode='" + CurrentPrCode + "' and pd_pdno='" + CurrentPDNO + "'");
             dh.BatchInsert(sql.ToString(), new string[] { "PIB_ID", "PIB_CUSTBARCODE" }, PIBID, CustBarCode.ToArray());
             //更新流水号
@@ -444,7 +429,6 @@ namespace UAS_LabelMachine
                     e.Cancel = true;
                 else
                 {
-                    lbl.Quit();
                     LogManager.DoLog("关闭程序");
                 }
             }
@@ -476,7 +460,7 @@ namespace UAS_LabelMachine
                 }
             if (SingleLabelCombox.Text != "")
             {
-                SingleReport.Load(@"F:/Simple List.frx");
+                SingleReport.Load(ftpOperater.DownLoadTo + SingleLabelCombox.Text);
             }
             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 ");
@@ -498,7 +482,7 @@ namespace UAS_LabelMachine
                 }
             if (MidLabelCombox.Text != "")
             {
-                MidReport.Load(@"F:/Simple List.frx");
+                MidReport.Load(ftpOperater.DownLoadTo+ MidLabelCombox.Text);
             }
             //缓存中盒参数
             sql.Clear();
@@ -521,21 +505,10 @@ namespace UAS_LabelMachine
                 }
             if (OutBoxCombox.Text != "")
             {
-                OutReport.Load(@"F:/Simple List.frx");
-            }
-            if (!File.Exists(ftpOperater.DownLoadTo + "唛头.lab"))
-            {
-                BaseUtil.GetLabelUrl(DataHelper.FTPAdress, "唛头.lab", System.DateTime.Now);
-                if (FootDoc != null)
-                    FootDoc.Close();
-                FootDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + "唛头.lab");
-            }
-            else
-            {
-                if (FootDoc != null)
-                    FootDoc.Close();
-                FootDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + "唛头.lab");
+                OutReport.Load(ftpOperater.DownLoadTo + OutBoxCombox.Text);
             }
+            BaseUtil.GetLabelUrl(DataHelper.FTPAdress, "唛头.frx", System.DateTime.Now);
+            FootReport.Load(ftpOperater.DownLoadTo + "唛头.frx");
             //缓存外箱参数
             ComBoxClickChangeLabelDoc = true;
         }
@@ -644,7 +617,7 @@ namespace UAS_LabelMachine
                             //保存参数打印
                             SingleReport.PrintSettings.ShowDialog = false;
                             SingleReport.PrintSettings.Printer = SingleLabelPrinter.Text;
-                            SingleReport.Print();
+                            SingleReport.Show();
                             Properties.Settings.Default.SPrinter = SingleLabelPrinter.Text;
                             Properties.Settings.Default.Save();
                             LabelInf.Rows[i].Cells["pib_ifprint"].Value = true;
@@ -838,8 +811,8 @@ namespace UAS_LabelMachine
                 //按获取到的箱号列表进行打印
                 if (Outboxcode.ToArray().Length > 0)
                 {
-                    try
-                    {
+                    //try
+                    //{
                         // 循环打印外箱号
                         for (int i = 0; i < Outboxcode.ToArray().Length; i++)
                         {
@@ -852,8 +825,8 @@ namespace UAS_LabelMachine
                                 }
                             }
                         }
-                    }
-                    catch { }
+                    //}
+                    //catch { }
                 }
                 else
                 {
@@ -905,7 +878,7 @@ namespace UAS_LabelMachine
                 //名称相等的时候,取SQL进行值的查询
                 string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
                 string pib_outboxcode1 = LabelInf.Rows[rowindex].Cells["pib_outboxcode1"].Value.ToString();
-                DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where 主键ID=" + pib_id + "' and 中盒号='" + pib_outboxcode1 + "'", "select");
+                DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiomidinfo_view where =" + pib_id + "' and 中盒号='" + pib_outboxcode1 + "'", "select");
                 MidReport.RegisterData(dt, "prodiomidinfo_view");
                 MidReport.GetDataSource("prodiomidinfo_view").Enabled = true;
                 MidReport.PrintSettings.Printer = MidLabelPrinter.Text;
@@ -932,6 +905,7 @@ namespace UAS_LabelMachine
                         }
                     }
                 }
+                string pib_outboxcode2 = LabelInf.Rows[rowindex].Cells["pib_outboxcode2"].Value.ToString();
                 DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiooutinfo_view where 出货单号='" + pi_inoutno.Text + "' and 外箱号='" + pib_outboxcode2 + "'", "select");
                 DataTable dt1 = dt.Clone();
                 for (int i = 0; i < dt.Rows.Count; i++)
@@ -1075,7 +1049,6 @@ namespace UAS_LabelMachine
                 //注销的时候需要将拼接的连接字符串置空
                 DataHelper.DBConnectionString = null;
                 logout = true;
-                lbl.Quit();
                 this.Hide();
                 login.ShowDialog();
                 this.Close();
@@ -1095,7 +1068,7 @@ namespace UAS_LabelMachine
             {
                 if (ComBoxClickChangeLabelDoc)
                 {
-
+                    SingleReport.Load(SingleLabelCombox.Text);
                 }
             }
             catch (Exception) { }
@@ -1112,7 +1085,7 @@ namespace UAS_LabelMachine
             {
                 if (ComBoxClickChangeLabelDoc)
                 {
-
+                    MidReport.Load(MidLabelCombox.Text);
                 }
             }
             catch (Exception) { }
@@ -1129,7 +1102,7 @@ namespace UAS_LabelMachine
             {
                 if (ComBoxClickChangeLabelDoc)
                 {
-
+                    OutReport.Load(OutBoxCombox.Text);
                 }
             }
             catch (Exception) { }
@@ -1425,13 +1398,14 @@ namespace UAS_LabelMachine
         private void PrintFooter_Click(object sender, EventArgs e)
         {
             DataTable dt = (DataTable)dh.ExecuteSql("select pib_outboxcode2,max(pib_id) pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' group by pib_outboxcode2 order by pib_outboxcode2", "select");
-            string SQL = "select pib_outboxcode2||'/'||(select max(pib_outboxcode2) from prodiobarcode where pib_inoutno={pib_inoutno}) from prodiobarcode  where pib_id={pib_id}";
+            string SQL = "select pib_outboxcode2||'/'||(select max(pib_outboxcode2) from prodiobarcode where pib_inoutno='"+pi_inoutno.Text+"') from prodiobarcode  where pib_id=";
             for (int i = 0; i < dt.Rows.Count; i++)
             {
-                DataTable dt1 = (DataTable)dh.ExecuteSql(SQL.Replace("{pib_inoutno}", "'" + pi_inoutno.Text + "'").Replace("{pib_id}", dt.Rows[i]["pib_id"].ToString()), "select");
-                FootDoc.Variables.FreeVariables.Item("唛头").Value = dt1.Rows[0][0].ToString();
-                FootDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
-                FootDoc.PrintDocument();
+                DataTable dt1 = (DataTable)dh.ExecuteSql(SQL+dt.Rows[i]["pib_id"].ToString(), "select");
+                FootReport.SetParameterValue("唛头", dt1.Rows[0][0].ToString());
+                FootReport.PrintSettings.ShowDialog = false;
+                FootReport.PrintSettings.Printer= SingleLabelPrinter.Text;
+                FootReport.Show();
             }
             LogManager.DoCommandLog(pi_inoutno.Text, User.UserCode, "打印唛头", "成功");
         }
@@ -1566,6 +1540,7 @@ namespace UAS_LabelMachine
                 SetPrintStatus_label.ForeColor = Color.Red;
                 SetPrintStatus_label.Text = "暂停打印";
             }
+            Input.Focus();
         }
     }
 }

+ 4 - 26
UAS-出货标签管理(泽天)/客户标签维护.cs

@@ -24,9 +24,6 @@ namespace UAS_LabelMachine
         //用于拼接条件查询
         StringBuilder condition = new StringBuilder();
         StringBuilder sql = new StringBuilder();
-        /*CodeSoft新建打印机引擎*/
-        ApplicationClass lbl;
-        Document doc;
         /*BarTender新建打印机引擎*/
         //private Engine engine = null;
         //private LabelFormatDocument format ;
@@ -78,7 +75,7 @@ namespace UAS_LabelMachine
 
             la_code.FormName = Name;
             la_code.SetValueField = new string[] { "la_code" };
-            la_code.TableName = "label";
+            la_code.TableName = "(select * from label order by la_id)";
             la_code.SelectField = "la_code # 模板编号,la_name # 模板名称";
             NetURL.Text = Settings.Default.ShareUrl;
         }
@@ -97,7 +94,6 @@ namespace UAS_LabelMachine
             LoadData();
             Width = Width + 1;
             asc.controllInitializeSize(this);
-            lbl = new ApplicationClass();
             Width = Width + 1;
         }
 
@@ -105,10 +101,6 @@ namespace UAS_LabelMachine
         {
             if (LabelDataGridView.Columns[e.ColumnIndex].HeaderText == "预览")
             {
-                if (lbl.Documents.Count > 0)
-                {
-                    lbl.ActiveDocument.Close();
-                }
                 //获取路径和标签名称
                 LabelPath = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelurl"].Value.ToString();
                 LabelCode = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelcode"].Value.ToString();
@@ -123,18 +115,6 @@ namespace UAS_LabelMachine
                 {
                     time = System.DateTime.Now;
                 }
-                if (CodeSoft.Checked)
-                {
-                    string LabelName = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelname"].Value.ToString();
-                    doc = lbl.Documents.Open(BaseUtil.GetLabelUrl(LabelPath, LabelName,time));
-                    Bitmap bit = new Bitmap(doc.CopyImageToFile());
-                    pictureBox1.Image = bit;
-                    //如果文件已不存在则进行提示
-                    if (doc == null)
-                    {
-                        return;
-                    }
-                }
             }
             if (LabelDataGridView.Columns[e.ColumnIndex].HeaderText == "编辑")
             {
@@ -225,7 +205,7 @@ namespace UAS_LabelMachine
             //根据勾选的不同设置不同的文件后缀过滤
             if (CodeSoft.Checked)
             {
-                openFileDialog1.Filter = "(*.lab)|*.lab|(*.frx)|*.frx";
+                openFileDialog1.Filter = "(*.frx)|*.frx";
             }
             DialogResult result = openFileDialog1.ShowDialog();
             if (result == DialogResult.OK)
@@ -296,8 +276,7 @@ namespace UAS_LabelMachine
         {
             if (LabelCode != "")
             {
-                doc.Printer.SwitchTo(PrinterList.Text);
-                doc.PrintDocument();
+       
             }
         }
 
@@ -305,8 +284,7 @@ namespace UAS_LabelMachine
         {
             try
             {
-                lbl.Documents.CloseAll();
-                lbl.Application.Quit();
+           
             }
             catch (Exception)
             {