Browse Source

中盒和外箱打印更改

章政 7 years ago
parent
commit
844f1a4daf

+ 396 - 396
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs

@@ -137,6 +137,37 @@
             this.BackCheck = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.MessageLog = new UAS_LabelMachine.CustomControl.RichText.RichTextAutoBottom();
             this.LabelInf = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
+            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.rownum = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_ifmodify = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifupload = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pr_vendprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_ifpick = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifrecheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_datecode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_custbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_custmidboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_custoutboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_custprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_custprodspec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pi_inoutno = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.SingleLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.SingleDocRefresh = new System.Windows.Forms.LinkLabel();
@@ -206,37 +237,6 @@
             this.BackendCheck = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
             this.FrontendCheck = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
             this.PLC1 = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
-            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.rownum = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_ifmodify = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifupload = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pr_vendprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_ifpick = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifrecheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_datecode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_custbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_custmidboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_custoutboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_custprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_custprodspec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.LogMenu.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PageSizeNum)).BeginInit();
             this.CollectionProcess.SuspendLayout();
@@ -820,7 +820,7 @@
             // UploadData
             // 
             this.UploadData.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.UploadData.Location = new System.Drawing.Point(234, 214);
+            this.UploadData.Location = new System.Drawing.Point(232, 214);
             this.UploadData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.UploadData.Name = "UploadData";
             this.UploadData.Size = new System.Drawing.Size(68, 26);
@@ -1410,148 +1410,394 @@
             this.LabelInf.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.LabelInf_CellPainting);
             this.LabelInf.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.LabelInf_DataError);
             // 
-            // pi_inoutno
+            // Choose
             // 
-            this.pi_inoutno.ID = null;
-            this.pi_inoutno.Location = new System.Drawing.Point(76, 10);
-            this.pi_inoutno.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.pi_inoutno.Name = "pi_inoutno";
-            this.pi_inoutno.Size = new System.Drawing.Size(150, 21);
-            this.pi_inoutno.Str = null;
-            this.pi_inoutno.Str1 = null;
-            this.pi_inoutno.Str2 = null;
-            this.pi_inoutno.TabIndex = 2;
-            this.pi_inoutno.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pi_inoutno_KeyDown);
+            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.Choose.HeaderText = "勾选";
+            this.Choose.Name = "Choose";
+            this.Choose.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.Choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.Choose.Visible = false;
+            this.Choose.Width = 55;
             // 
-            // SingleLabel
+            // pd_id
             // 
-            this.SingleLabel.Controls.Add(this.SingleDocRefresh);
-            this.SingleLabel.Controls.Add(this.label17);
-            this.SingleLabel.Controls.Add(this.groupBoxWithBorder4);
-            this.SingleLabel.Controls.Add(this.label7);
-            this.SingleLabel.Controls.Add(this.label16);
-            this.SingleLabel.Controls.Add(this.SingleLabelPrinter);
-            this.SingleLabel.Controls.Add(this.SingleBoxEnd);
-            this.SingleLabel.Controls.Add(this.SingleBoxBegin);
-            this.SingleLabel.Controls.Add(this.SingleLabelPrint);
-            this.SingleLabel.Controls.Add(this.SingleLabelAutoPrint);
-            this.SingleLabel.Controls.Add(this.SingleLabelCombox);
-            this.SingleLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabel.Location = new System.Drawing.Point(638, 6);
-            this.SingleLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.SingleLabel.Name = "SingleLabel";
-            this.SingleLabel.Padding = new System.Windows.Forms.Padding(2);
-            this.SingleLabel.Size = new System.Drawing.Size(180, 269);
-            this.SingleLabel.TabIndex = 77;
-            this.SingleLabel.TabStop = false;
-            this.SingleLabel.Text = "单盘标签";
+            this.pd_id.DataPropertyName = "pd_id";
+            this.pd_id.HeaderText = "pd_id";
+            this.pd_id.Name = "pd_id";
+            this.pd_id.Visible = false;
+            this.pd_id.Width = 60;
             // 
-            // SingleDocRefresh
+            // pib_id1
             // 
-            this.SingleDocRefresh.AutoSize = true;
-            this.SingleDocRefresh.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.SingleDocRefresh.Location = new System.Drawing.Point(67, 24);
-            this.SingleDocRefresh.Name = "SingleDocRefresh";
-            this.SingleDocRefresh.Size = new System.Drawing.Size(37, 20);
-            this.SingleDocRefresh.TabIndex = 118;
-            this.SingleDocRefresh.TabStop = true;
-            this.SingleDocRefresh.Text = "刷新";
-            this.SingleDocRefresh.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.DocRefresh_LinkClicked);
+            this.pib_id1.DataPropertyName = "pib_id";
+            this.pib_id1.HeaderText = "pib_id";
+            this.pib_id1.Name = "pib_id1";
+            this.pib_id1.Visible = false;
+            this.pib_id1.Width = 66;
             // 
-            // label17
+            // rownum
             // 
-            this.label17.AutoSize = true;
-            this.label17.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label17.Location = new System.Drawing.Point(9, 24);
-            this.label17.Name = "label17";
-            this.label17.Size = new System.Drawing.Size(55, 20);
-            this.label17.TabIndex = 115;
-            this.label17.Text = "格式(T)";
+            this.rownum.DataPropertyName = "rownum";
+            this.rownum.HeaderText = "行号";
+            this.rownum.Name = "rownum";
+            this.rownum.Width = 54;
             // 
-            // groupBoxWithBorder4
+            // pib_pdno
             // 
-            this.groupBoxWithBorder4.Controls.Add(this.label20);
-            this.groupBoxWithBorder4.Controls.Add(this.BackCombo);
-            this.groupBoxWithBorder4.Controls.Add(this.label19);
-            this.groupBoxWithBorder4.Controls.Add(this.FrontCombo);
-            this.groupBoxWithBorder4.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.groupBoxWithBorder4.Location = new System.Drawing.Point(7, 186);
-            this.groupBoxWithBorder4.Name = "groupBoxWithBorder4";
-            this.groupBoxWithBorder4.Size = new System.Drawing.Size(165, 78);
-            this.groupBoxWithBorder4.TabIndex = 41;
-            this.groupBoxWithBorder4.TabStop = false;
-            this.groupBoxWithBorder4.Text = "扫描区域";
+            this.pib_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
+            this.pib_pdno.DataPropertyName = "pib_pdno";
+            this.pib_pdno.HeaderText = "明细序号";
+            this.pib_pdno.Name = "pib_pdno";
+            this.pib_pdno.ReadOnly = true;
+            this.pib_pdno.Width = 78;
             // 
-            // label20
+            // pib_prodcode
             // 
-            this.label20.AutoSize = true;
-            this.label20.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label20.Location = new System.Drawing.Point(8, 49);
-            this.label20.Name = "label20";
-            this.label20.Size = new System.Drawing.Size(37, 20);
-            this.label20.TabIndex = 94;
-            this.label20.Text = "后端";
+            this.pib_prodcode.DataPropertyName = "pib_prodcode";
+            this.pib_prodcode.HeaderText = "物料编号";
+            this.pib_prodcode.Name = "pib_prodcode";
+            this.pib_prodcode.ReadOnly = true;
+            this.pib_prodcode.Width = 78;
             // 
-            // BackCombo
+            // pib_ifmodify
             // 
-            this.BackCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.BackCombo.Font = new System.Drawing.Font("微软雅黑", 8F);
-            this.BackCombo.FormattingEnabled = true;
-            this.BackCombo.Location = new System.Drawing.Point(52, 48);
-            this.BackCombo.Name = "BackCombo";
-            this.BackCombo.Size = new System.Drawing.Size(105, 24);
-            this.BackCombo.TabIndex = 93;
+            this.pib_ifmodify.DataPropertyName = "pib_ifmodify";
+            this.pib_ifmodify.HeaderText = "已修改";
+            this.pib_ifmodify.Name = "pib_ifmodify";
+            this.pib_ifmodify.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.pib_ifmodify.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.pib_ifmodify.Width = 66;
             // 
-            // label19
+            // pib_ifupload
             // 
-            this.label19.AutoSize = true;
-            this.label19.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.label19.Location = new System.Drawing.Point(8, 24);
-            this.label19.Name = "label19";
-            this.label19.Size = new System.Drawing.Size(37, 20);
-            this.label19.TabIndex = 92;
-            this.label19.Text = "前端";
+            this.pib_ifupload.DataPropertyName = "pib_ifupload";
+            this.pib_ifupload.HeaderText = "已上传";
+            this.pib_ifupload.Name = "pib_ifupload";
+            this.pib_ifupload.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.pib_ifupload.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.pib_ifupload.Width = 66;
             // 
-            // FrontCombo
+            // pr_vendprodcode
             // 
-            this.FrontCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.FrontCombo.Font = new System.Drawing.Font("微软雅黑", 8F);
-            this.FrontCombo.FormattingEnabled = true;
-            this.FrontCombo.Location = new System.Drawing.Point(52, 22);
-            this.FrontCombo.Name = "FrontCombo";
-            this.FrontCombo.Size = new System.Drawing.Size(105, 24);
-            this.FrontCombo.TabIndex = 0;
+            this.pr_vendprodcode.DataPropertyName = "pr_vendprodcode";
+            this.pr_vendprodcode.HeaderText = "MPN";
+            this.pr_vendprodcode.Name = "pr_vendprodcode";
+            this.pr_vendprodcode.ReadOnly = true;
+            this.pr_vendprodcode.Visible = false;
+            this.pr_vendprodcode.Width = 48;
             // 
-            // label7
+            // pib_brand
             // 
-            this.label7.AutoSize = true;
-            this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(8, 139);
-            this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(56, 17);
-            this.label7.TabIndex = 76;
-            this.label7.Text = "单盘范围";
+            this.pib_brand.DataPropertyName = "pib_brand";
+            this.pib_brand.HeaderText = "品牌";
+            this.pib_brand.Name = "pib_brand";
+            this.pib_brand.ReadOnly = true;
+            this.pib_brand.Width = 54;
             // 
-            // label16
+            // pib_madein
             // 
-            this.label16.AutoSize = true;
-            this.label16.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label16.Location = new System.Drawing.Point(68, 165);
-            this.label16.Name = "label16";
-            this.label16.Size = new System.Drawing.Size(13, 17);
-            this.label16.TabIndex = 87;
-            this.label16.Text = "-";
+            this.pib_madein.DataPropertyName = "pib_madein";
+            this.pib_madein.HeaderText = "产地";
+            this.pib_madein.Name = "pib_madein";
+            this.pib_madein.Visible = false;
+            this.pib_madein.Width = 54;
             // 
-            // SingleLabelPrinter
+            // pr_orispeccode
             // 
-            this.SingleLabelPrinter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrinter.Location = new System.Drawing.Point(6, 81);
-            this.SingleLabelPrinter.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
-            this.SingleLabelPrinter.Name = "SingleLabelPrinter";
-            this.SingleLabelPrinter.Size = new System.Drawing.Size(169, 25);
-            this.SingleLabelPrinter.TabIndex = 40;
+            this.pr_orispeccode.DataPropertyName = "pr_orispeccode";
+            this.pr_orispeccode.HeaderText = "原厂型号";
+            this.pr_orispeccode.Name = "pr_orispeccode";
+            this.pr_orispeccode.Width = 78;
             // 
-            // SingleBoxEnd
+            // pr_zxbzs
+            // 
+            this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
+            this.pr_zxbzs.HeaderText = "最小包装数";
+            this.pr_zxbzs.Name = "pr_zxbzs";
+            this.pr_zxbzs.Visible = false;
+            this.pr_zxbzs.Width = 90;
+            // 
+            // pr_unit
+            // 
+            this.pr_unit.DataPropertyName = "pr_unit";
+            this.pr_unit.HeaderText = "单位";
+            this.pr_unit.Name = "pr_unit";
+            this.pr_unit.Width = 54;
+            // 
+            // pib_lotno
+            // 
+            this.pib_lotno.DataPropertyName = "pib_lotno";
+            this.pib_lotno.HeaderText = "LotNo";
+            this.pib_lotno.Name = "pib_lotno";
+            this.pib_lotno.Width = 60;
+            // 
+            // pib_datecode
+            // 
+            this.pib_datecode.DataPropertyName = "pib_datecode";
+            this.pib_datecode.HeaderText = "DateCode";
+            this.pib_datecode.Name = "pib_datecode";
+            this.pib_datecode.Width = 78;
+            // 
+            // pib_ifpick
+            // 
+            this.pib_ifpick.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_ifpick.DataPropertyName = "pib_ifpick";
+            this.pib_ifpick.HeaderText = "已扫描";
+            this.pib_ifpick.Name = "pib_ifpick";
+            this.pib_ifpick.Width = 60;
+            // 
+            // pib_ifprint
+            // 
+            this.pib_ifprint.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_ifprint.DataPropertyName = "pib_ifprint";
+            this.pib_ifprint.HeaderText = "已打标";
+            this.pib_ifprint.Name = "pib_ifprint";
+            this.pib_ifprint.Width = 60;
+            // 
+            // pib_ifrecheck
+            // 
+            this.pib_ifrecheck.DataPropertyName = "pib_ifrecheck";
+            this.pib_ifrecheck.HeaderText = "已复核";
+            this.pib_ifrecheck.Name = "pib_ifrecheck";
+            this.pib_ifrecheck.Width = 47;
+            // 
+            // pib_datecode1
+            // 
+            this.pib_datecode1.DataPropertyName = "pib_datecode1";
+            this.pib_datecode1.HeaderText = "DateCode1";
+            this.pib_datecode1.Name = "pib_datecode1";
+            this.pib_datecode1.Visible = false;
+            this.pib_datecode1.Width = 84;
+            // 
+            // pib_qty
+            // 
+            this.pib_qty.DataPropertyName = "pib_qty";
+            this.pib_qty.HeaderText = "数量";
+            this.pib_qty.Name = "pib_qty";
+            this.pib_qty.ReadOnly = true;
+            this.pib_qty.Width = 54;
+            // 
+            // pib_barcode
+            // 
+            this.pib_barcode.DataPropertyName = "pib_barcode";
+            this.pib_barcode.HeaderText = "唯一条码";
+            this.pib_barcode.Name = "pib_barcode";
+            this.pib_barcode.ReadOnly = true;
+            this.pib_barcode.Visible = false;
+            this.pib_barcode.Width = 78;
+            // 
+            // pib_custbarcode
+            // 
+            this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
+            this.pib_custbarcode.HeaderText = "唯一条码";
+            this.pib_custbarcode.Name = "pib_custbarcode";
+            this.pib_custbarcode.ReadOnly = true;
+            this.pib_custbarcode.Width = 78;
+            // 
+            // pib_custmidboxcode
+            // 
+            this.pib_custmidboxcode.DataPropertyName = "pib_custmidboxcode";
+            this.pib_custmidboxcode.HeaderText = "中盒条码";
+            this.pib_custmidboxcode.Name = "pib_custmidboxcode";
+            this.pib_custmidboxcode.Width = 78;
+            // 
+            // pib_custoutboxcode
+            // 
+            this.pib_custoutboxcode.DataPropertyName = "pib_custoutboxcode";
+            this.pib_custoutboxcode.HeaderText = "外箱条码";
+            this.pib_custoutboxcode.Name = "pib_custoutboxcode";
+            this.pib_custoutboxcode.Width = 78;
+            // 
+            // pd_pocode
+            // 
+            this.pd_pocode.DataPropertyName = "pd_pocode";
+            this.pd_pocode.HeaderText = "客户PO";
+            this.pd_pocode.Name = "pd_pocode";
+            this.pd_pocode.ReadOnly = true;
+            this.pd_pocode.Width = 66;
+            // 
+            // pd_custprodcode
+            // 
+            this.pd_custprodcode.DataPropertyName = "pd_custprodcode";
+            this.pd_custprodcode.HeaderText = "客户料号";
+            this.pd_custprodcode.Name = "pd_custprodcode";
+            this.pd_custprodcode.ReadOnly = true;
+            this.pd_custprodcode.Width = 78;
+            // 
+            // pd_custprodspec
+            // 
+            this.pd_custprodspec.DataPropertyName = "pd_custprodspec";
+            this.pd_custprodspec.HeaderText = "客户型号";
+            this.pd_custprodspec.Name = "pd_custprodspec";
+            this.pd_custprodspec.ReadOnly = true;
+            this.pd_custprodspec.Width = 78;
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.DataPropertyName = "pr_spec";
+            this.pr_spec.HeaderText = "规格";
+            this.pr_spec.Name = "pr_spec";
+            this.pr_spec.Width = 54;
+            // 
+            // pib_outboxcode1
+            // 
+            this.pib_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
+            this.pib_outboxcode1.DataPropertyName = "pib_outboxcode1";
+            this.pib_outboxcode1.HeaderText = "中盒号";
+            this.pib_outboxcode1.Name = "pib_outboxcode1";
+            this.pib_outboxcode1.Width = 66;
+            // 
+            // pib_outboxcode2
+            // 
+            this.pib_outboxcode2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
+            this.pib_outboxcode2.DataPropertyName = "pib_outboxcode2";
+            this.pib_outboxcode2.HeaderText = "外箱号";
+            this.pib_outboxcode2.Name = "pib_outboxcode2";
+            this.pib_outboxcode2.Width = 66;
+            // 
+            // pi_inoutno
+            // 
+            this.pi_inoutno.ID = null;
+            this.pi_inoutno.Location = new System.Drawing.Point(76, 10);
+            this.pi_inoutno.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.pi_inoutno.Name = "pi_inoutno";
+            this.pi_inoutno.Size = new System.Drawing.Size(150, 21);
+            this.pi_inoutno.Str = null;
+            this.pi_inoutno.Str1 = null;
+            this.pi_inoutno.Str2 = null;
+            this.pi_inoutno.TabIndex = 2;
+            this.pi_inoutno.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pi_inoutno_KeyDown);
+            // 
+            // SingleLabel
+            // 
+            this.SingleLabel.Controls.Add(this.SingleDocRefresh);
+            this.SingleLabel.Controls.Add(this.label17);
+            this.SingleLabel.Controls.Add(this.groupBoxWithBorder4);
+            this.SingleLabel.Controls.Add(this.label7);
+            this.SingleLabel.Controls.Add(this.label16);
+            this.SingleLabel.Controls.Add(this.SingleLabelPrinter);
+            this.SingleLabel.Controls.Add(this.SingleBoxEnd);
+            this.SingleLabel.Controls.Add(this.SingleBoxBegin);
+            this.SingleLabel.Controls.Add(this.SingleLabelPrint);
+            this.SingleLabel.Controls.Add(this.SingleLabelAutoPrint);
+            this.SingleLabel.Controls.Add(this.SingleLabelCombox);
+            this.SingleLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.SingleLabel.Location = new System.Drawing.Point(638, 6);
+            this.SingleLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.SingleLabel.Name = "SingleLabel";
+            this.SingleLabel.Padding = new System.Windows.Forms.Padding(2);
+            this.SingleLabel.Size = new System.Drawing.Size(180, 269);
+            this.SingleLabel.TabIndex = 77;
+            this.SingleLabel.TabStop = false;
+            this.SingleLabel.Text = "单盘标签";
+            // 
+            // SingleDocRefresh
+            // 
+            this.SingleDocRefresh.AutoSize = true;
+            this.SingleDocRefresh.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.SingleDocRefresh.Location = new System.Drawing.Point(67, 24);
+            this.SingleDocRefresh.Name = "SingleDocRefresh";
+            this.SingleDocRefresh.Size = new System.Drawing.Size(37, 20);
+            this.SingleDocRefresh.TabIndex = 118;
+            this.SingleDocRefresh.TabStop = true;
+            this.SingleDocRefresh.Text = "刷新";
+            this.SingleDocRefresh.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.DocRefresh_LinkClicked);
+            // 
+            // label17
+            // 
+            this.label17.AutoSize = true;
+            this.label17.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.label17.Location = new System.Drawing.Point(9, 24);
+            this.label17.Name = "label17";
+            this.label17.Size = new System.Drawing.Size(55, 20);
+            this.label17.TabIndex = 115;
+            this.label17.Text = "格式(T)";
+            // 
+            // groupBoxWithBorder4
+            // 
+            this.groupBoxWithBorder4.Controls.Add(this.label20);
+            this.groupBoxWithBorder4.Controls.Add(this.BackCombo);
+            this.groupBoxWithBorder4.Controls.Add(this.label19);
+            this.groupBoxWithBorder4.Controls.Add(this.FrontCombo);
+            this.groupBoxWithBorder4.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.groupBoxWithBorder4.Location = new System.Drawing.Point(7, 186);
+            this.groupBoxWithBorder4.Name = "groupBoxWithBorder4";
+            this.groupBoxWithBorder4.Size = new System.Drawing.Size(165, 78);
+            this.groupBoxWithBorder4.TabIndex = 41;
+            this.groupBoxWithBorder4.TabStop = false;
+            this.groupBoxWithBorder4.Text = "扫描区域";
+            // 
+            // label20
+            // 
+            this.label20.AutoSize = true;
+            this.label20.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.label20.Location = new System.Drawing.Point(8, 49);
+            this.label20.Name = "label20";
+            this.label20.Size = new System.Drawing.Size(37, 20);
+            this.label20.TabIndex = 94;
+            this.label20.Text = "后端";
+            // 
+            // BackCombo
+            // 
+            this.BackCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.BackCombo.Font = new System.Drawing.Font("微软雅黑", 8F);
+            this.BackCombo.FormattingEnabled = true;
+            this.BackCombo.Location = new System.Drawing.Point(52, 48);
+            this.BackCombo.Name = "BackCombo";
+            this.BackCombo.Size = new System.Drawing.Size(105, 24);
+            this.BackCombo.TabIndex = 93;
+            // 
+            // label19
+            // 
+            this.label19.AutoSize = true;
+            this.label19.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.label19.Location = new System.Drawing.Point(8, 24);
+            this.label19.Name = "label19";
+            this.label19.Size = new System.Drawing.Size(37, 20);
+            this.label19.TabIndex = 92;
+            this.label19.Text = "前端";
+            // 
+            // FrontCombo
+            // 
+            this.FrontCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.FrontCombo.Font = new System.Drawing.Font("微软雅黑", 8F);
+            this.FrontCombo.FormattingEnabled = true;
+            this.FrontCombo.Location = new System.Drawing.Point(52, 22);
+            this.FrontCombo.Name = "FrontCombo";
+            this.FrontCombo.Size = new System.Drawing.Size(105, 24);
+            this.FrontCombo.TabIndex = 0;
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label7.Location = new System.Drawing.Point(8, 139);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(56, 17);
+            this.label7.TabIndex = 76;
+            this.label7.Text = "单盘范围";
+            // 
+            // label16
+            // 
+            this.label16.AutoSize = true;
+            this.label16.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label16.Location = new System.Drawing.Point(68, 165);
+            this.label16.Name = "label16";
+            this.label16.Size = new System.Drawing.Size(13, 17);
+            this.label16.TabIndex = 87;
+            this.label16.Text = "-";
+            // 
+            // SingleLabelPrinter
+            // 
+            this.SingleLabelPrinter.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.SingleLabelPrinter.Location = new System.Drawing.Point(6, 81);
+            this.SingleLabelPrinter.Margin = new System.Windows.Forms.Padding(5, 6, 5, 6);
+            this.SingleLabelPrinter.Name = "SingleLabelPrinter";
+            this.SingleLabelPrinter.Size = new System.Drawing.Size(169, 25);
+            this.SingleLabelPrinter.TabIndex = 40;
+            // 
+            // SingleBoxEnd
             // 
             this.SingleBoxEnd.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.SingleBoxEnd.ID = null;
@@ -2230,252 +2476,6 @@
             // 
             this.PLC1.Tag = "PLC1";
             // 
-            // Choose
-            // 
-            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.Choose.HeaderText = "勾选";
-            this.Choose.Name = "Choose";
-            this.Choose.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.Choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.Choose.Visible = false;
-            this.Choose.Width = 55;
-            // 
-            // pd_id
-            // 
-            this.pd_id.DataPropertyName = "pd_id";
-            this.pd_id.HeaderText = "pd_id";
-            this.pd_id.Name = "pd_id";
-            this.pd_id.Visible = false;
-            this.pd_id.Width = 60;
-            // 
-            // pib_id1
-            // 
-            this.pib_id1.DataPropertyName = "pib_id";
-            this.pib_id1.HeaderText = "pib_id";
-            this.pib_id1.Name = "pib_id1";
-            this.pib_id1.Visible = false;
-            this.pib_id1.Width = 66;
-            // 
-            // rownum
-            // 
-            this.rownum.DataPropertyName = "rownum";
-            this.rownum.HeaderText = "行号";
-            this.rownum.Name = "rownum";
-            this.rownum.Width = 54;
-            // 
-            // pib_pdno
-            // 
-            this.pib_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
-            this.pib_pdno.DataPropertyName = "pib_pdno";
-            this.pib_pdno.HeaderText = "明细序号";
-            this.pib_pdno.Name = "pib_pdno";
-            this.pib_pdno.ReadOnly = true;
-            this.pib_pdno.Width = 78;
-            // 
-            // pib_prodcode
-            // 
-            this.pib_prodcode.DataPropertyName = "pib_prodcode";
-            this.pib_prodcode.HeaderText = "物料编号";
-            this.pib_prodcode.Name = "pib_prodcode";
-            this.pib_prodcode.ReadOnly = true;
-            this.pib_prodcode.Width = 78;
-            // 
-            // pib_ifmodify
-            // 
-            this.pib_ifmodify.DataPropertyName = "pib_ifmodify";
-            this.pib_ifmodify.HeaderText = "已修改";
-            this.pib_ifmodify.Name = "pib_ifmodify";
-            this.pib_ifmodify.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.pib_ifmodify.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.pib_ifmodify.Width = 66;
-            // 
-            // pib_ifupload
-            // 
-            this.pib_ifupload.DataPropertyName = "pib_ifupload";
-            this.pib_ifupload.HeaderText = "已上传";
-            this.pib_ifupload.Name = "pib_ifupload";
-            this.pib_ifupload.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.pib_ifupload.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.pib_ifupload.Width = 66;
-            // 
-            // pr_vendprodcode
-            // 
-            this.pr_vendprodcode.DataPropertyName = "pr_vendprodcode";
-            this.pr_vendprodcode.HeaderText = "MPN";
-            this.pr_vendprodcode.Name = "pr_vendprodcode";
-            this.pr_vendprodcode.ReadOnly = true;
-            this.pr_vendprodcode.Visible = false;
-            this.pr_vendprodcode.Width = 48;
-            // 
-            // pib_brand
-            // 
-            this.pib_brand.DataPropertyName = "pib_brand";
-            this.pib_brand.HeaderText = "品牌";
-            this.pib_brand.Name = "pib_brand";
-            this.pib_brand.ReadOnly = true;
-            this.pib_brand.Width = 54;
-            // 
-            // pib_madein
-            // 
-            this.pib_madein.DataPropertyName = "pib_madein";
-            this.pib_madein.HeaderText = "产地";
-            this.pib_madein.Name = "pib_madein";
-            this.pib_madein.Visible = false;
-            this.pib_madein.Width = 54;
-            // 
-            // pr_orispeccode
-            // 
-            this.pr_orispeccode.DataPropertyName = "pr_orispeccode";
-            this.pr_orispeccode.HeaderText = "原厂型号";
-            this.pr_orispeccode.Name = "pr_orispeccode";
-            this.pr_orispeccode.Width = 78;
-            // 
-            // pr_zxbzs
-            // 
-            this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
-            this.pr_zxbzs.HeaderText = "最小包装数";
-            this.pr_zxbzs.Name = "pr_zxbzs";
-            this.pr_zxbzs.Visible = false;
-            this.pr_zxbzs.Width = 90;
-            // 
-            // pr_unit
-            // 
-            this.pr_unit.DataPropertyName = "pr_unit";
-            this.pr_unit.HeaderText = "单位";
-            this.pr_unit.Name = "pr_unit";
-            this.pr_unit.Width = 54;
-            // 
-            // pib_lotno
-            // 
-            this.pib_lotno.DataPropertyName = "pib_lotno";
-            this.pib_lotno.HeaderText = "LotNo";
-            this.pib_lotno.Name = "pib_lotno";
-            this.pib_lotno.Width = 60;
-            // 
-            // pib_datecode
-            // 
-            this.pib_datecode.DataPropertyName = "pib_datecode";
-            this.pib_datecode.HeaderText = "DateCode";
-            this.pib_datecode.Name = "pib_datecode";
-            this.pib_datecode.Width = 78;
-            // 
-            // pib_ifpick
-            // 
-            this.pib_ifpick.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_ifpick.DataPropertyName = "pib_ifpick";
-            this.pib_ifpick.HeaderText = "已扫描";
-            this.pib_ifpick.Name = "pib_ifpick";
-            this.pib_ifpick.Width = 60;
-            // 
-            // pib_ifprint
-            // 
-            this.pib_ifprint.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_ifprint.DataPropertyName = "pib_ifprint";
-            this.pib_ifprint.HeaderText = "已打标";
-            this.pib_ifprint.Name = "pib_ifprint";
-            this.pib_ifprint.Width = 60;
-            // 
-            // pib_ifrecheck
-            // 
-            this.pib_ifrecheck.DataPropertyName = "pib_ifrecheck";
-            this.pib_ifrecheck.HeaderText = "已复核";
-            this.pib_ifrecheck.Name = "pib_ifrecheck";
-            this.pib_ifrecheck.Width = 47;
-            // 
-            // pib_datecode1
-            // 
-            this.pib_datecode1.DataPropertyName = "pib_datecode1";
-            this.pib_datecode1.HeaderText = "DateCode1";
-            this.pib_datecode1.Name = "pib_datecode1";
-            this.pib_datecode1.Visible = false;
-            this.pib_datecode1.Width = 84;
-            // 
-            // pib_qty
-            // 
-            this.pib_qty.DataPropertyName = "pib_qty";
-            this.pib_qty.HeaderText = "数量";
-            this.pib_qty.Name = "pib_qty";
-            this.pib_qty.ReadOnly = true;
-            this.pib_qty.Width = 54;
-            // 
-            // pib_barcode
-            // 
-            this.pib_barcode.DataPropertyName = "pib_barcode";
-            this.pib_barcode.HeaderText = "唯一条码";
-            this.pib_barcode.Name = "pib_barcode";
-            this.pib_barcode.ReadOnly = true;
-            this.pib_barcode.Visible = false;
-            this.pib_barcode.Width = 78;
-            // 
-            // pib_custbarcode
-            // 
-            this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
-            this.pib_custbarcode.HeaderText = "唯一条码";
-            this.pib_custbarcode.Name = "pib_custbarcode";
-            this.pib_custbarcode.ReadOnly = true;
-            this.pib_custbarcode.Width = 78;
-            // 
-            // pib_custmidboxcode
-            // 
-            this.pib_custmidboxcode.DataPropertyName = "pib_custmidboxcode";
-            this.pib_custmidboxcode.HeaderText = "中盒条码";
-            this.pib_custmidboxcode.Name = "pib_custmidboxcode";
-            this.pib_custmidboxcode.Width = 78;
-            // 
-            // pib_custoutboxcode
-            // 
-            this.pib_custoutboxcode.DataPropertyName = "pib_custoutboxcode";
-            this.pib_custoutboxcode.HeaderText = "外箱条码";
-            this.pib_custoutboxcode.Name = "pib_custoutboxcode";
-            this.pib_custoutboxcode.Width = 78;
-            // 
-            // pd_pocode
-            // 
-            this.pd_pocode.DataPropertyName = "pd_pocode";
-            this.pd_pocode.HeaderText = "客户PO";
-            this.pd_pocode.Name = "pd_pocode";
-            this.pd_pocode.ReadOnly = true;
-            this.pd_pocode.Width = 66;
-            // 
-            // pd_custprodcode
-            // 
-            this.pd_custprodcode.DataPropertyName = "pd_custprodcode";
-            this.pd_custprodcode.HeaderText = "客户料号";
-            this.pd_custprodcode.Name = "pd_custprodcode";
-            this.pd_custprodcode.ReadOnly = true;
-            this.pd_custprodcode.Width = 78;
-            // 
-            // pd_custprodspec
-            // 
-            this.pd_custprodspec.DataPropertyName = "pd_custprodspec";
-            this.pd_custprodspec.HeaderText = "客户型号";
-            this.pd_custprodspec.Name = "pd_custprodspec";
-            this.pd_custprodspec.ReadOnly = true;
-            this.pd_custprodspec.Width = 78;
-            // 
-            // pr_spec
-            // 
-            this.pr_spec.DataPropertyName = "pr_spec";
-            this.pr_spec.HeaderText = "规格";
-            this.pr_spec.Name = "pr_spec";
-            this.pr_spec.Width = 54;
-            // 
-            // pib_outboxcode1
-            // 
-            this.pib_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
-            this.pib_outboxcode1.DataPropertyName = "pib_outboxcode1";
-            this.pib_outboxcode1.HeaderText = "中盒号";
-            this.pib_outboxcode1.Name = "pib_outboxcode1";
-            this.pib_outboxcode1.Width = 66;
-            // 
-            // pib_outboxcode2
-            // 
-            this.pib_outboxcode2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
-            this.pib_outboxcode2.DataPropertyName = "pib_outboxcode2";
-            this.pib_outboxcode2.HeaderText = "外箱号";
-            this.pib_outboxcode2.Name = "pib_outboxcode2";
-            this.pib_outboxcode2.Width = 66;
-            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

+ 68 - 23
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -400,10 +400,15 @@ namespace UAS_LabelMachine
                         ErrorMsg = "订单号不匹配";
                     }
                     //如果品牌不对应的话则不能使用本次的匹配规则
-                    if (LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"].Value.ToString() != sg_brand)
+                    if (LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"].Value.ToString() == sg_brand)
                     {
+                        ErrorMsg = "";
                         break;
                     }
+                    else
+                    {
+                        ErrorMsg = "未匹配到合适的采集策略";
+                    }
                 }
                 else
                 {
@@ -818,7 +823,7 @@ namespace UAS_LabelMachine
             if (SingleLabelCombox.Text != "")
             {
                 SingleDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + SingleLabelCombox.Text);
-                SingleLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + SingleLabelCombox.SelectedValue.ToString().Split('#')[0], "select");
+                SingleLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + SingleLabelCombox.SelectedValue.ToString().Split('#')[0], "select");
             }
             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 ");
@@ -843,7 +848,7 @@ namespace UAS_LabelMachine
             if (MidLabelCombox.Text != "")
             {
                 MidDoc = lbl.Documents.Open(ftpOperater.DownLoadTo + MidLabelCombox.Text);
-                MidLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + MidLabelCombox.SelectedValue.ToString().Split('#')[0], "select");
+                MidLabelParam = (DataTable)dh.ExecuteSql("select lp_name,lp_sql,lp_valuetype from label left join LABELPARAMETER on la_id= lp_laid where la_id=" + MidLabelCombox.SelectedValue.ToString().Split('#')[0], "select");
             }
             //缓存中盒参数
             sql.Clear();
@@ -1331,10 +1336,11 @@ namespace UAS_LabelMachine
                     return;
                 }
             }
+            //查询参数名称相同的获取到取值字段
             for (int j = 0; j < MidDoc.Variables.FormVariables.Count; j++)
             {
                 DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
-                if (dr1.Length > 0)
+                if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
                 {
                     sql.Append(dr1[0]["lp_sql"].ToString() + ",");
                 }
@@ -1345,10 +1351,30 @@ namespace UAS_LabelMachine
                 for (int j = 0; j < MidDoc.Variables.FormVariables.Count; j++)
                 {
                     DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
-                    if (dr1.Length > 0)
+                    if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
                     {
                         MidDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
                     }
+                    //SQL判断多个值的时候
+                    if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "SQL值")
+                    {
+                        DataTable dt1 = (DataTable)adh.ExecuteSql(dr1[0]["lp_sql"].ToString().Replace("{1}", "'" + pi_inoutno.Text + "'").Replace("{2}", pib_outboxcode1), "select");
+                        for (int i = 0; i < dt1.Rows.Count; i++)
+                        {
+                            for (int k = 0; k < MidDoc.Variables.FormVariables.Count; k++)
+                            {
+                                if (i == 0 & MidDoc.Variables.FormVariables.Item(k + 1).Name.ToUpper() == dr1[0]["lp_name"].ToString().ToUpper())
+                                {
+                                    MidDoc.Variables.FormVariables.Item(k + 1).Value = dt1.Rows[0][0].ToString();
+                                }
+                                //使用SN开头的参数赋值SN1,SN2,SN3等参数
+                                if (MidDoc.Variables.FormVariables.Item(k + 1).Name.ToUpper() == (dr1[0]["lp_name"].ToString() + (i + 1)).ToUpper())
+                                {
+                                    MidDoc.Variables.FormVariables.Item(k + 1).Value = dt1.Rows[i][0].ToString();
+                                }
+                            }
+                        }
+                    }
                     if (MidDoc.Variables.FormVariables.Item(j + 1).Value == "")
                     {
                         dr1 = Attach.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
@@ -1375,34 +1401,53 @@ namespace UAS_LabelMachine
             for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
             {
                 DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
-                if (dr1.Length > 0)
+                if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
                 {
                     sql.Append(dr1[0]["lp_sql"].ToString() + ",");
                 }
             }
             if (sql.Length != 0)
             {
-
-            }
-            DataTable dt = (DataTable)adh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + (pib_outboxcode2 == "" ? "0" : pib_outboxcode2), "select");
-            if (dt.Rows.Count > 0)
-            {
-                for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
+                DataTable dt = (DataTable)adh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2=" + (pib_outboxcode2 == "" ? "0" : pib_outboxcode2), "select");
+                if (dt.Rows.Count > 0)
                 {
-                    DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
-                    if (dr1.Length > 0)
+                    for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
                     {
-                        OutBoxDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
-                    }
-                    if (OutBoxDoc.Variables.FormVariables.Item(j + 1).Value == "")
-                    {
-                        dr1 = Attach.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
-                        if (dr1.Length > 0)
-                            OutBoxDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
+                        DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
+                        if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
+                        {
+                            OutBoxDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
+                        }
+                        //SQL判断多个值的时候
+                        if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "SQL值")
+                        {
+                            DataTable dt1 = (DataTable)adh.ExecuteSql(dr1[0]["lp_sql"].ToString().Replace("{1}", "'" + pi_inoutno.Text + "'").Replace("{2}", pib_outboxcode2), "select");
+                            for (int i = 0; i < dt1.Rows.Count; i++)
+                            {
+                                for (int k = 0; k < OutBoxDoc.Variables.FormVariables.Count; k++)
+                                {
+                                    if (i == 0 & OutBoxDoc.Variables.FormVariables.Item(k + 1).Name.ToUpper() == dr1[0]["lp_name"].ToString().ToUpper())
+                                    {
+                                        OutBoxDoc.Variables.FormVariables.Item(k + 1).Value = dt1.Rows[0][0].ToString();
+                                    }
+                                    //使用SN开头的参数赋值SN1,SN2,SN3等参数
+                                    if (OutBoxDoc.Variables.FormVariables.Item(k + 1).Name.ToUpper() == (dr1[0]["lp_name"].ToString() + (i + 1)).ToUpper())
+                                    {
+                                        OutBoxDoc.Variables.FormVariables.Item(k + 1).Value = dt1.Rows[i][0].ToString();
+                                    }
+                                }
+                            }
+                        }
+                        if (OutBoxDoc.Variables.FormVariables.Item(j + 1).Value == "")
+                        {
+                            dr1 = Attach.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
+                            if (dr1.Length > 0)
+                                OutBoxDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
+                        }
                     }
+                    OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
+                    OutBoxDoc.PrintDocument();
                 }
-                OutBoxDoc.Printer.SwitchTo(OutBoxPrinter.Text);
-                OutBoxDoc.PrintDocument();
             }
             else MessageLog.AppendText("未能匹配到外箱标签参数,请检查标签模板\n", Color.Red);
         }