Browse Source

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

Hcsy 7 years ago
parent
commit
a5e8a40c6c

+ 13 - 0
UAS-出货标签管理(泽天)/CustomControl/EnterTextBox.cs

@@ -64,6 +64,19 @@ namespace UAS_LabelMachine.CustomControl
             }
         }
 
+        public override string Text
+        {
+            get
+            {
+                return base.Text.ToUpper();
+            }
+
+            set
+            {
+                base.Text = value;
+            }
+        }
+
         public EnterTextBox()
         {
             InitializeComponent();

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

@@ -36,7 +36,6 @@
             this.CleanDetail = new System.Windows.Forms.Button();
             this.pib_id = new System.Windows.Forms.Label();
             this.pi_cardcode = new System.Windows.Forms.Label();
-            this.pi_cardcode_label = new System.Windows.Forms.Label();
             this.Fresh = new System.Windows.Forms.LinkLabel();
             this.RefreshDBConnect = new System.Windows.Forms.Timer(this.components);
             this.GetGridOnly = new System.Windows.Forms.CheckBox();
@@ -87,15 +86,6 @@
             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();
-            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();
@@ -150,6 +140,21 @@
             this.OutboxCapacity = new System.Windows.Forms.NumericUpDown();
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
+            this.Combindetail = new System.Windows.Forms.CheckBox();
+            this.label8 = new System.Windows.Forms.Label();
+            this.pi_title = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.ProcessCount = new System.Windows.Forms.Label();
+            this.pd_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pjd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Column1 = 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();
@@ -166,7 +171,7 @@
             // 
             this.pi_inoutno_label.AutoSize = true;
             this.pi_inoutno_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_inoutno_label.Location = new System.Drawing.Point(3, 10);
+            this.pi_inoutno_label.Location = new System.Drawing.Point(9, 10);
             this.pi_inoutno_label.Name = "pi_inoutno_label";
             this.pi_inoutno_label.Size = new System.Drawing.Size(65, 20);
             this.pi_inoutno_label.TabIndex = 3;
@@ -220,20 +225,11 @@
             // 
             this.pi_cardcode.AutoSize = true;
             this.pi_cardcode.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_cardcode.Location = new System.Drawing.Point(77, 38);
+            this.pi_cardcode.Location = new System.Drawing.Point(254, 110);
             this.pi_cardcode.Name = "pi_cardcode";
             this.pi_cardcode.Size = new System.Drawing.Size(0, 20);
             this.pi_cardcode.TabIndex = 71;
-            // 
-            // pi_cardcode_label
-            // 
-            this.pi_cardcode_label.AutoSize = true;
-            this.pi_cardcode_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_cardcode_label.Location = new System.Drawing.Point(3, 38);
-            this.pi_cardcode_label.Name = "pi_cardcode_label";
-            this.pi_cardcode_label.Size = new System.Drawing.Size(65, 20);
-            this.pi_cardcode_label.TabIndex = 72;
-            this.pi_cardcode_label.Text = "客户编号";
+            this.pi_cardcode.Visible = false;
             // 
             // Fresh
             // 
@@ -254,7 +250,7 @@
             // 
             this.GetGridOnly.AutoSize = true;
             this.GetGridOnly.Font = new System.Drawing.Font("微软雅黑", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GetGridOnly.Location = new System.Drawing.Point(149, 38);
+            this.GetGridOnly.Location = new System.Drawing.Point(100, 177);
             this.GetGridOnly.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.GetGridOnly.Name = "GetGridOnly";
             this.GetGridOnly.Size = new System.Drawing.Size(77, 20);
@@ -472,7 +468,7 @@
             // ChooseAll
             // 
             this.ChooseAll.Location = new System.Drawing.Point(0, 379);
-            this.ChooseAll.Margin = new System.Windows.Forms.Padding(2);
+            this.ChooseAll.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.ChooseAll.Name = "ChooseAll";
             this.ChooseAll.Size = new System.Drawing.Size(38, 22);
             this.ChooseAll.TabIndex = 84;
@@ -595,7 +591,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(232, 155);
+            this.label3.Location = new System.Drawing.Point(232, 148);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(51, 20);
             this.label3.TabIndex = 98;
@@ -605,7 +601,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(232, 185);
+            this.label4.Location = new System.Drawing.Point(232, 178);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(51, 20);
             this.label4.TabIndex = 99;
@@ -615,7 +611,7 @@
             // 
             this.bi_inman.AutoSize = true;
             this.bi_inman.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bi_inman.Location = new System.Drawing.Point(297, 155);
+            this.bi_inman.Location = new System.Drawing.Point(297, 148);
             this.bi_inman.Name = "bi_inman";
             this.bi_inman.Size = new System.Drawing.Size(0, 20);
             this.bi_inman.TabIndex = 100;
@@ -624,7 +620,7 @@
             // 
             this.pib_inman.AutoSize = true;
             this.pib_inman.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pib_inman.Location = new System.Drawing.Point(297, 185);
+            this.pib_inman.Location = new System.Drawing.Point(297, 178);
             this.pib_inman.Name = "pib_inman";
             this.pib_inman.Size = new System.Drawing.Size(0, 20);
             this.pib_inman.TabIndex = 101;
@@ -676,6 +672,7 @@
             this.GridPrcode.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.pd_pdno,
             this.pjd_id,
+            this.Column1,
             this.pd_prodcode,
             this.CollectedNum,
             this.UnCollectedNum,
@@ -696,75 +693,6 @@
             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);
@@ -776,9 +704,9 @@
             this.groupBoxWithBorder1.Controls.Add(this.label12);
             this.groupBoxWithBorder1.Controls.Add(this.label7);
             this.groupBoxWithBorder1.Location = new System.Drawing.Point(583, 6);
-            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.groupBoxWithBorder1.Size = new System.Drawing.Size(140, 211);
             this.groupBoxWithBorder1.TabIndex = 81;
             this.groupBoxWithBorder1.TabStop = false;
@@ -788,7 +716,7 @@
             // 
             this.label18.AutoSize = true;
             this.label18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label18.Location = new System.Drawing.Point(64, 110);
+            this.label18.Location = new System.Drawing.Point(64, 139);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(13, 17);
             this.label18.TabIndex = 90;
@@ -797,7 +725,7 @@
             // MidBoxEnd
             // 
             this.MidBoxEnd.ID = null;
-            this.MidBoxEnd.Location = new System.Drawing.Point(83, 108);
+            this.MidBoxEnd.Location = new System.Drawing.Point(83, 137);
             this.MidBoxEnd.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidBoxEnd.Name = "MidBoxEnd";
             this.MidBoxEnd.Size = new System.Drawing.Size(50, 21);
@@ -809,7 +737,7 @@
             // MidBoxBegin
             // 
             this.MidBoxBegin.ID = null;
-            this.MidBoxBegin.Location = new System.Drawing.Point(8, 108);
+            this.MidBoxBegin.Location = new System.Drawing.Point(8, 137);
             this.MidBoxBegin.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidBoxBegin.Name = "MidBoxBegin";
             this.MidBoxBegin.Size = new System.Drawing.Size(50, 21);
@@ -822,7 +750,7 @@
             // 
             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(63, 47);
+            this.label16.Location = new System.Drawing.Point(63, 76);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(13, 17);
             this.label16.TabIndex = 87;
@@ -831,7 +759,7 @@
             // SingleBoxEnd
             // 
             this.SingleBoxEnd.ID = null;
-            this.SingleBoxEnd.Location = new System.Drawing.Point(82, 46);
+            this.SingleBoxEnd.Location = new System.Drawing.Point(82, 75);
             this.SingleBoxEnd.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleBoxEnd.Name = "SingleBoxEnd";
             this.SingleBoxEnd.Size = new System.Drawing.Size(50, 21);
@@ -843,7 +771,7 @@
             // SingleBoxBegin
             // 
             this.SingleBoxBegin.ID = null;
-            this.SingleBoxBegin.Location = new System.Drawing.Point(7, 45);
+            this.SingleBoxBegin.Location = new System.Drawing.Point(7, 74);
             this.SingleBoxBegin.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleBoxBegin.Name = "SingleBoxBegin";
             this.SingleBoxBegin.Size = new System.Drawing.Size(50, 21);
@@ -856,7 +784,7 @@
             // 
             this.label12.AutoSize = true;
             this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label12.Location = new System.Drawing.Point(7, 73);
+            this.label12.Location = new System.Drawing.Point(7, 111);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(56, 17);
             this.label12.TabIndex = 77;
@@ -866,7 +794,7 @@
             // 
             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(7, 16);
+            this.label7.Location = new System.Drawing.Point(7, 33);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(56, 17);
             this.label7.TabIndex = 76;
@@ -919,6 +847,7 @@
             this.LabelInf.RowTemplate.Height = 23;
             this.LabelInf.Size = new System.Drawing.Size(1257, 346);
             this.LabelInf.TabIndex = 27;
+            this.LabelInf.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelInf_CellClick);
             this.LabelInf.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelInf_CellValueChanged);
             this.LabelInf.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.LabelInf_DataError);
             // 
@@ -1102,7 +1031,7 @@
             this.SingleLabel.Location = new System.Drawing.Point(726, 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.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.SingleLabel.Size = new System.Drawing.Size(170, 211);
             this.SingleLabel.TabIndex = 77;
             this.SingleLabel.TabStop = false;
@@ -1121,7 +1050,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(50, 177);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(70, 177);
             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);
@@ -1136,7 +1065,7 @@
             this.SingleLabelAutoPrint.Checked = true;
             this.SingleLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.SingleLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(6, 93);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(6, 91);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabelAutoPrint.Name = "SingleLabelAutoPrint";
             this.SingleLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
@@ -1170,7 +1099,7 @@
             this.MidLabel.Location = new System.Drawing.Point(898, 6);
             this.MidLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabel.Name = "MidLabel";
-            this.MidLabel.Padding = new System.Windows.Forms.Padding(2);
+            this.MidLabel.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.MidLabel.Size = new System.Drawing.Size(172, 211);
             this.MidLabel.TabIndex = 78;
             this.MidLabel.TabStop = false;
@@ -1189,7 +1118,7 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(4, 120);
+            this.label2.Location = new System.Drawing.Point(6, 120);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(32, 17);
             this.label2.TabIndex = 92;
@@ -1212,7 +1141,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(5, 152);
+            this.label5.Location = new System.Drawing.Point(8, 152);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(32, 17);
             this.label5.TabIndex = 50;
@@ -1245,7 +1174,7 @@
             this.MidLabelAutoPrint.Checked = true;
             this.MidLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.MidLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelAutoPrint.Location = new System.Drawing.Point(9, 93);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(9, 92);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabelAutoPrint.Name = "MidLabelAutoPrint";
             this.MidLabelAutoPrint.Size = new System.Drawing.Size(75, 21);
@@ -1277,9 +1206,9 @@
             this.OutBoxLabel.Controls.Add(this.OutBoxCombox);
             this.OutBoxLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OutBoxLabel.Location = new System.Drawing.Point(1075, 6);
-            this.OutBoxLabel.Margin = new System.Windows.Forms.Padding(2);
+            this.OutBoxLabel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.OutBoxLabel.Name = "OutBoxLabel";
-            this.OutBoxLabel.Padding = new System.Windows.Forms.Padding(2);
+            this.OutBoxLabel.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.OutBoxLabel.Size = new System.Drawing.Size(175, 211);
             this.OutBoxLabel.TabIndex = 79;
             this.OutBoxLabel.TabStop = false;
@@ -1288,7 +1217,7 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(109, 6);
+            this.LogingOut.Location = new System.Drawing.Point(109, -6);
             this.LogingOut.Name = "LogingOut";
             this.LogingOut.Size = new System.Drawing.Size(42, 21);
             this.LogingOut.TabIndex = 77;
@@ -1314,7 +1243,7 @@
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(7, 148);
+            this.label10.Location = new System.Drawing.Point(7, 145);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(32, 17);
             this.label10.TabIndex = 90;
@@ -1324,7 +1253,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(7, 110);
+            this.label6.Location = new System.Drawing.Point(7, 107);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(32, 17);
             this.label6.TabIndex = 87;
@@ -1373,12 +1302,143 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
+            // Combindetail
+            // 
+            this.Combindetail.AutoSize = true;
+            this.Combindetail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Combindetail.Location = new System.Drawing.Point(296, 114);
+            this.Combindetail.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Combindetail.Name = "Combindetail";
+            this.Combindetail.Size = new System.Drawing.Size(93, 25);
+            this.Combindetail.TabIndex = 104;
+            this.Combindetail.Text = "合并明细";
+            this.Combindetail.UseVisualStyleBackColor = true;
+            this.Combindetail.CheckedChanged += new System.EventHandler(this.Combindetail_CheckedChanged);
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label8.Location = new System.Drawing.Point(9, 41);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(65, 20);
+            this.label8.TabIndex = 106;
+            this.label8.Text = "客户名称";
+            // 
+            // pi_title
+            // 
+            this.pi_title.AutoSize = true;
+            this.pi_title.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pi_title.Location = new System.Drawing.Point(83, 41);
+            this.pi_title.Name = "pi_title";
+            this.pi_title.Size = new System.Drawing.Size(0, 20);
+            this.pi_title.TabIndex = 105;
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label9.Location = new System.Drawing.Point(232, 200);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(85, 20);
+            this.label9.TabIndex = 107;
+            this.label9.Text = "已装箱/总数";
+            // 
+            // ProcessCount
+            // 
+            this.ProcessCount.AutoSize = true;
+            this.ProcessCount.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ProcessCount.Location = new System.Drawing.Point(327, 200);
+            this.ProcessCount.Name = "ProcessCount";
+            this.ProcessCount.Size = new System.Drawing.Size(0, 20);
+            this.ProcessCount.TabIndex = 108;
+            // 
+            // 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;
+            // 
+            // Column1
+            // 
+            this.Column1.DataPropertyName = "pd_custprodcode";
+            this.Column1.HeaderText = "客户料号";
+            this.Column1.Name = "Column1";
+            // 
+            // 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);
             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.ProcessCount);
+            this.Controls.Add(this.label9);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.pi_title);
+            this.Controls.Add(this.Combindetail);
             this.Controls.Add(this.CustomerLabel);
             this.Controls.Add(this.PackMidBox);
             this.Controls.Add(this.pib_inman);
@@ -1401,7 +1461,6 @@
             this.Controls.Add(this.ChooseAll);
             this.Controls.Add(this.GetGridOnly);
             this.Controls.Add(this.Fresh);
-            this.Controls.Add(this.pi_cardcode_label);
             this.Controls.Add(this.pi_cardcode);
             this.Controls.Add(this.pib_id);
             this.Controls.Add(this.CleanDetail);
@@ -1426,18 +1485,18 @@
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.GridPrcode)).EndInit();
-            this.groupBoxWithBorder1.ResumeLayout(false);
+            this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LabelInf)).EndInit();
-            this.SingleLabel.ResumeLayout(false);
+            this.SingleLabel.ResumeLayout(true);
             this.SingleLabel.PerformLayout();
-            this.MidLabel.ResumeLayout(false);
+            this.MidLabel.ResumeLayout(true);
             this.MidLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.MidboxCapacity)).EndInit();
-            this.OutBoxLabel.ResumeLayout(false);
+            this.OutBoxLabel.ResumeLayout(true);
             this.OutBoxLabel.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.OutboxCapacity)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }
@@ -1490,7 +1549,6 @@
         private System.Windows.Forms.Button CleanDetail;
         private System.Windows.Forms.Label pib_id;
         private System.Windows.Forms.Label pi_cardcode;
-        private System.Windows.Forms.Label pi_cardcode_label;
         private System.Windows.Forms.LinkLabel Fresh;
         private System.Windows.Forms.LinkLabel LogingOut;
         private System.Windows.Forms.Timer RefreshDBConnect;
@@ -1529,15 +1587,6 @@
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Button PackOutBox;
         private System.Windows.Forms.Button PrintStatus;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_pdno;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pjd_id;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_prodcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn CollectedNum;
-        private System.Windows.Forms.DataGridViewTextBoxColumn UnCollectedNum;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_outqty;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_brand;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pjd_zxbzs_user;
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.Label label4;
         private System.Windows.Forms.Label bi_inman;
@@ -1563,5 +1612,20 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
         private System.Windows.Forms.Button PackMidBox;
         private System.Windows.Forms.Button CustomerLabel;
+        private System.Windows.Forms.CheckBox Combindetail;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label pi_title;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.Label ProcessCount;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_pdno;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pjd_id;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_prodcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn CollectedNum;
+        private System.Windows.Forms.DataGridViewTextBoxColumn UnCollectedNum;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_outqty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_brand;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pjd_zxbzs_user;
     }
 }

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

@@ -6,14 +6,13 @@ using System.Text.RegularExpressions;
 using System.Text;
 using System.Collections.Generic;
 using System.Diagnostics;
-using LabelManager2;
 using UAS_LabelMachine.PublicMethod;
 using UAS_LabelMachine.Entity;
 using UAS_LabelMachine.PublicForm;
 using System.Threading;
-using System.IO;
 using System.Globalization;
 using FastReport;
+using System.Linq;
 
 namespace UAS_LabelMachine
 {
@@ -201,9 +200,10 @@ namespace UAS_LabelMachine
                 Input.Text = "";
                 return;
             }
+            Input.Text = Input.Text.Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", "");
             Dictionary<string, string> Data = new Dictionary<string, string>();
             string[] SplitData = Input.Text.Split('*');
-            if (SplitData.Length < 6)
+            if (SplitData.Length < 5)
             {
                 MessageBox.Show("数据格式错误,无法解析", "提示");
                 Input.SelectAll();
@@ -253,35 +253,38 @@ namespace UAS_LabelMachine
             }
             if (Data["BRAND"] != CurrentBrand)
             {
-                MessageBox.Show("当前采集【品牌】不对应,请重新采集", "提示");
-                Input.SelectAll();
-                return;
+                string close = MessageBox.Show(this.ParentForm, "当前采集【品牌】不对应,是否继续采集", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                if (close != "Yes")
+                {
+                    Input.SelectAll();
+                    return;
+                }
             }
             int CodeCount = 0;
             //如果单位是KPCS则需要除1000
-            int CollectNum = 0;
+            double CollectNum = 0;
             if (CurrentUnit == "KPCS")
             {
                 //如果单位是KPCS则必须是1000的整数倍
-                if (int.Parse(Data["QTY"]) % 1000 != 0 || int.Parse(Data["QTY"]) / 1000 % int.Parse(CurrentZXBZ) != 0)
+                if ((int.Parse(Data["QTY"]) > 1000 && int.Parse(Data["QTY"]) % 1000 != 0) || int.Parse(Data["QTY"]) / 1000 % double.Parse(CurrentZXBZ) != 0)
                 {
                     MessageBox.Show("物料" + Data["PRCODE"] + "采集数量无法按照最小包装数拆分", "提示");
                     Input.SelectAll();
                     return;
                 }
-                CodeCount = int.Parse(Data["QTY"]) / 1000 / int.Parse(CurrentZXBZ);
-                CollectNum = int.Parse(Data["QTY"]) / 1000;
+                CodeCount = int.Parse((double.Parse(Data["QTY"]) / 1000 / double.Parse(CurrentZXBZ)).ToString());
+                CollectNum = double.Parse(Data["QTY"]) / 1000;
             }
             else
             {
-                if (int.Parse(Data["QTY"]) % int.Parse(CurrentZXBZ) != 0)
+                if (double.Parse(Data["QTY"]) % double.Parse(CurrentZXBZ) != 0)
                 {
                     MessageBox.Show("采集【数量】无法按照最小包装数拆分", "提示");
                     Input.SelectAll();
                     return;
                 }
-                CodeCount = int.Parse(Data["QTY"]) / int.Parse(CurrentZXBZ);
-                CollectNum = int.Parse(Data["QTY"]);
+                CodeCount = int.Parse((double.Parse(Data["QTY"]) / double.Parse(CurrentZXBZ)).ToString());
+                CollectNum = double.Parse(Data["QTY"]);
             }
             string pib_barcode = Data.ContainsKey("SERIAL") ? Data["SERIAL"] : "";
             //获取ID
@@ -289,7 +292,7 @@ namespace UAS_LabelMachine
             string pib_outboxcode2 = "";
             if (OutBoxNum.Text == "新增")
             {
-                string maxoutbox = dh.getFieldDataByCondition("prodiobarcode", "max(pib_outboxcode2)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
+                string maxoutbox = dh.getFieldDataByCondition("prodiobarcode", "max(to_number(pib_outboxcode2))", "pib_inoutno='" + pi_inoutno.Text + "'").ToString();
                 //如果没有则从开始插入
                 if (maxoutbox == "")
                 {
@@ -306,8 +309,8 @@ namespace UAS_LabelMachine
             }
             //计算当前采集数量
             string collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
-            int CollectQty = (collectqty == "" ? 0 : int.Parse(collectqty));
-            if (CollectQty + CollectNum > int.Parse(CurrentPrCount))
+            double CollectQty = (collectqty == "" ? 0 : double.Parse(collectqty));
+            if (Convert.ToDouble((CollectQty + CollectNum).ToString("0.000")) > double.Parse(CurrentPrCount))
             {
                 MessageBox.Show("物料" + Data["PRCODE"] + "采集后数量为" + (CollectQty + CollectNum) + ",【超出】本行出货数量" + CurrentPrCount, "提示");
                 Input.SelectAll();
@@ -341,7 +344,7 @@ namespace UAS_LabelMachine
             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,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,pd_remark ");
+            sql.Append("'" + pib_barcode + "',:PIB_CUSTBARCODE,'" + CurrentZXBZ + "','" + Data["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());
             //更新流水号
@@ -362,33 +365,41 @@ namespace UAS_LabelMachine
             }
             //采集后重新计数,自动跳到下一行
             collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
-            CollectQty = (collectqty == "" ? 0 : int.Parse(collectqty));
+            CollectQty = (collectqty == "" ? 0 : double.Parse(collectqty));
             //采集达到了数量进行换行
-            if (CollectQty == int.Parse(CurrentPrCount))
+            if (CollectQty == double.Parse(CurrentPrCount))
             {
                 for (int i = 0; i < GridPrcode.Rows.Count; i++)
                 {
                     string outqty = GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString();
                     string collectnum = GridPrcode.Rows[i].Cells["CollectedNum"].Value.ToString();
                     //采集之前的行,如后续行有物料编号相同的并且编号较大的跳到这样
-                    if (GridPrcode.Rows[i].Cells["pd_prodcode"].Value.ToString() == CurrentPrCode && int.Parse(outqty) > int.Parse(collectnum == "" ? "0" : collectnum))
+                    if (GridPrcode.Rows[i].Cells["pd_prodcode"].Value.ToString() == CurrentPrCode && double.Parse(outqty) > double.Parse(collectnum == "" ? "0" : collectnum))
                     {
                         if (int.Parse(GridPrcode.Rows[i].Cells["pd_pdno"].Value.ToString()) > int.Parse(CurrentPDNO))
                         {
                             GridPrcode.Rows[i].Selected = true;
-                            GridPrcode.FirstDisplayedScrollingRowIndex = i;
+                            if (i - 1 > 0)
+                                GridPrcode.FirstDisplayedScrollingRowIndex = i - 1;
+                            else
+                                GridPrcode.FirstDisplayedScrollingRowIndex = i;
+                            Input.Clear();
+                            OutBoxNum_Click(new object(), new EventArgs());
                             return;
                         }
                     }
                 }
-                for (int i = GridPrcode.Rows.Count - 1; i >= 0; i--)
+                DataGridViewSelectedRowCollection selectrow = GridPrcode.SelectedRows;
+                if (selectrow.Count > 0)
                 {
-                    string outqty = GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString();
-                    string collectnum = GridPrcode.Rows[i].Cells["CollectedNum"].Value.ToString();
-                    if (int.Parse(outqty) > int.Parse(collectnum == "" ? "0" : collectnum))
-                    {
-                        GridPrcode.Rows[i].Selected = true;
-                        GridPrcode.FirstDisplayedScrollingRowIndex = i;
+                    if (selectrow[0].Index + 1 < GridPrcode.Rows.Count) {
+                        string outqty = GridPrcode.Rows[selectrow[0].Index + 1].Cells["pd_outqty"].Value.ToString();
+                        string collectnum = GridPrcode.Rows[selectrow[0].Index + 1].Cells["CollectedNum"].Value.ToString();
+                        if (double.Parse(outqty) > double.Parse(collectnum == "" ? "0" : collectnum))
+                        {
+                            GridPrcode.Rows[selectrow[0].Index + 1].Selected = true;
+                            GridPrcode.FirstDisplayedScrollingRowIndex = selectrow[0].Index + 1;
+                        }
                     }
                 }
             }
@@ -410,6 +421,8 @@ namespace UAS_LabelMachine
                     else
                         pibid += PIBID[i];
                 }
+                if (!SingleLabelCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
+                    SingleReport.Load(SingleLabelCombox.SelectedValue.ToString());
                 for (int j = 0; j < SingleReport.Parameters.Count; j++)
                 {
                     SingleReport.SetParameterValue(SingleReport.Parameters[j].Name, "");
@@ -464,74 +477,77 @@ namespace UAS_LabelMachine
         {
             ComBoxClickChangeLabelDoc = false;
             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("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelurl,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_custcode,cl_date desc");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             SingleLabelCombox.DisplayMember = "cl_labelname";
-            SingleLabelCombox.ValueMember = "la_id";
+            SingleLabelCombox.ValueMember = "cl_labelurl";
             SingleLabelCombox.DataSource = dt;
-            if (!GetGridOnly.Checked)
-                for (int i = 0; i < dt.Rows.Count; i++)
-                {
-                    string LabelUrl = dt.Rows[i]["la_id"].ToString().Split('#')[1];
-                    string LabelName = dt.Rows[i]["cl_labelname"].ToString();
-                    System.DateTime time = Convert.ToDateTime(dt.Rows[i]["cl_date"].ToString());
-                    FileInfo file = new FileInfo(ftpOperater.DownLoadTo + LabelName);
-                    if (time.ToString() != file.LastWriteTime.ToString())
-                        BaseUtil.GetLabelUrl(LabelUrl, LabelName, time);
-                }
+            //if (!GetGridOnly.Checked)
+            //    for (int i = 0; i < dt.Rows.Count; i++)
+            //    {
+            //        string LabelUrl = dt.Rows[i]["la_id"].ToString().Split('#')[1];
+            //        string LabelName = dt.Rows[i]["cl_labelname"].ToString();
+            //        System.DateTime time = Convert.ToDateTime(dt.Rows[i]["cl_date"].ToString());
+            //        FileInfo file = new FileInfo(ftpOperater.DownLoadTo + LabelName);
+            //        if (time.ToString() != file.LastWriteTime.ToString())
+            //            BaseUtil.GetLabelUrl(LabelUrl, LabelName, time);
+            //    }
             if (SingleLabelCombox.Text != "")
             {
-                SingleReport.Load(ftpOperater.DownLoadTo + SingleLabelCombox.Text);
+                if (!SingleLabelCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
+                    SingleReport.Load(SingleLabelCombox.SelectedValue.ToString());
             }
             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("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelurl,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_custcode,cl_date desc");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             MidLabelCombox.DisplayMember = "cl_labelname";
-            MidLabelCombox.ValueMember = "la_id";
+            MidLabelCombox.ValueMember = "cl_labelurl";
             MidLabelCombox.DataSource = dt;
-            if (!GetGridOnly.Checked)
-                for (int i = 0; i < dt.Rows.Count; i++)
-                {
-                    string LabelUrl = dt.Rows[i]["la_id"].ToString().Split('#')[1];
-                    string LabelName = dt.Rows[i]["cl_labelname"].ToString();
-                    System.DateTime time = Convert.ToDateTime(dt.Rows[i]["cl_date"].ToString());
-                    FileInfo file = new FileInfo(ftpOperater.DownLoadTo + LabelName);
-                    if (time.ToString() != file.LastWriteTime.ToString())
-                        BaseUtil.GetLabelUrl(LabelUrl, LabelName, time);
-                }
+            //if (!GetGridOnly.Checked)
+            //    for (int i = 0; i < dt.Rows.Count; i++)
+            //    {
+            //        string LabelUrl = dt.Rows[i]["la_id"].ToString().Split('#')[1];
+            //        string LabelName = dt.Rows[i]["cl_labelname"].ToString();
+            //        System.DateTime time = Convert.ToDateTime(dt.Rows[i]["cl_date"].ToString());
+            //        FileInfo file = new FileInfo(ftpOperater.DownLoadTo + LabelName);
+            //        if (time.ToString() != file.LastWriteTime.ToString())
+            //            BaseUtil.GetLabelUrl(LabelUrl, LabelName, time);
+            //    }
             if (MidLabelCombox.Text != "")
             {
-                MidReport.Load(ftpOperater.DownLoadTo + MidLabelCombox.Text);
+                if (!MidLabelCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
+                    MidReport.Load(MidLabelCombox.SelectedValue.ToString());
             }
             //缓存中盒参数
             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("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelurl,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_custcode,cl_date desc");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             OutBoxCombox.DisplayMember = "cl_labelname";
-            OutBoxCombox.ValueMember = "la_id";
+            OutBoxCombox.ValueMember = "cl_labelurl";
             OutBoxCombox.DataSource = dt;
-            if (!GetGridOnly.Checked)
-                for (int i = 0; i < dt.Rows.Count; i++)
-                {
-                    string LabelUrl = dt.Rows[i]["la_id"].ToString().Split('#')[1];
-                    string LabelName = dt.Rows[i]["cl_labelname"].ToString();
-                    System.DateTime time = Convert.ToDateTime(dt.Rows[i]["cl_date"].ToString());
-                    FileInfo file = new FileInfo(ftpOperater.DownLoadTo + LabelName);
-                    if (time.ToString() != file.LastWriteTime.ToString())
-                        BaseUtil.GetLabelUrl(LabelUrl, LabelName, time);
-                }
+            //if (!GetGridOnly.Checked)
+            //    for (int i = 0; i < dt.Rows.Count; i++)
+            //    {
+            //        string LabelUrl = dt.Rows[i]["la_id"].ToString().Split('#')[1];
+            //        string LabelName = dt.Rows[i]["cl_labelname"].ToString();
+            //        System.DateTime time = Convert.ToDateTime(dt.Rows[i]["cl_date"].ToString());
+            //        FileInfo file = new FileInfo(ftpOperater.DownLoadTo + LabelName);
+            //        if (time.ToString() != file.LastWriteTime.ToString())
+            //            BaseUtil.GetLabelUrl(LabelUrl, LabelName, time);
+            //    }
             if (OutBoxCombox.Text != "")
             {
-                OutReport.Load(ftpOperater.DownLoadTo + OutBoxCombox.Text);
+                if (!OutBoxCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
+                    OutReport.Load(OutBoxCombox.SelectedValue.ToString());
             }
-            BaseUtil.GetLabelUrl(DataHelper.FTPAdress, "唛头.frx", System.DateTime.Now);
-            FootReport.Load(ftpOperater.DownLoadTo + "唛头.frx");
+            //BaseUtil.GetLabelUrl(DataHelper.FTPAdress, "唛头.frx", System.DateTime.Now);
+            FootReport.Load(@"\\10.2.10.211\文件服务 (f)\FastReport\唛头.frx");
             //缓存外箱参数
             ComBoxClickChangeLabelDoc = true;
         }
@@ -547,11 +563,12 @@ namespace UAS_LabelMachine
             {
                 Input.Clear();
                 sql.Clear();
-                sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date from prodinout where pi_inoutno='" + pi_inoutno.Text + "' and pi_invostatuscode='AUDITED'");
+                sql.Append("select pi_id,pi_cardcode,pi_title,to_char(pi_date,'yyyymmdd')pi_date from prodinout where pi_inoutno='" + pi_inoutno.Text + "' and pi_invostatuscode='AUDITED'");
                 dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 if (dt.Rows.Count > 0)
                 {
                     pi_cardcode.Text = dt.Rows[0]["pi_cardcode"].ToString();
+                    pi_title.Text = dt.Rows[0]["pi_title"].ToString();
                     if (pi_cardcode.Text != "ZGCC")
                     {
                         CustomerLabel.Enabled = false;
@@ -569,15 +586,18 @@ namespace UAS_LabelMachine
                     GetBarCodeRule(out Prefix, out Suffix, out MaxNum, out NumLength, out Radix);
                     SingleID.Clear();
                     Input.Focus();
-                    //从后往前找未采集的行
+                    ////从后往前找未采集的行
                     for (int i = GridPrcode.Rows.Count - 1; i >= 0; i--)
                     {
                         string outqty = GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString();
                         string collectnum = GridPrcode.Rows[i].Cells["CollectedNum"].Value.ToString();
-                        if (int.Parse(outqty) > int.Parse(collectnum == "" ? "0" : collectnum))
+                        if (double.Parse(outqty) > double.Parse(collectnum == "" ? "0" : collectnum))
                         {
                             GridPrcode.Rows[i].Selected = true;
-                            GridPrcode.FirstDisplayedScrollingRowIndex = i;
+                            if (i - 1 > 0)
+                                GridPrcode.FirstDisplayedScrollingRowIndex = i - 1;
+                            else
+                                GridPrcode.FirstDisplayedScrollingRowIndex = i;
                         }
                     }
                     bi_inman.Text = dh.getFieldDataByCondition("barcodeio left join employee on bi_inman=em_code", "wm_concat(distinct em_name)", "bi_piid=" + PI_ID).ToString();
@@ -631,25 +651,27 @@ namespace UAS_LabelMachine
                     for (int i = 0; i < LabelInf.RowCount; i++)
                     {
                         //勾选了并且未打印
-                        if (LabelInf.Rows[i].Cells["Choose"].FormattedValue != null && LabelInf.Rows[i].Cells["Choose"].FormattedValue.ToString().ToLower() == "true" && LabelInf.Rows[i].Cells["pib_ifprint"].FormattedValue.ToString().ToLower() != "true")
+                        if (LabelInf.Rows[i].Cells["Choose"].FormattedValue != null && LabelInf.Rows[i].Cells["Choose"].FormattedValue.ToString().ToLower() == "true")
                         {
                             pibid += LabelInf.Rows[i].Cells["pib_id1"].Value.ToString() + ",";
                             LabelInf.Rows[i].Cells["pib_ifprint"].Value = true;
                         }
                     }
-                    for (int j = 0; j < SingleReport.Parameters.Count; j++)
+                    if (pibid != "")
                     {
-                        SingleReport.SetParameterValue(SingleReport.Parameters[j].Name, "");
-                        for (int k = 0; k < Attach.Rows.Count; k++)
+                        if (!SingleLabelCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
+                            SingleReport.Load(SingleLabelCombox.SelectedValue.ToString());
+                        for (int j = 0; j < SingleReport.Parameters.Count; j++)
                         {
-                            if (Attach.Rows[k][0].ToString() == SingleReport.Parameters[j].Name)
+                            SingleReport.SetParameterValue(SingleReport.Parameters[j].Name, "");
+                            for (int k = 0; k < Attach.Rows.Count; k++)
                             {
-                                SingleReport.SetParameterValue(SingleReport.Parameters[j].Name, Attach.Rows[k][1].ToString());
+                                if (Attach.Rows[k][0].ToString() == SingleReport.Parameters[j].Name)
+                                {
+                                    SingleReport.SetParameterValue(SingleReport.Parameters[j].Name, Attach.Rows[k][1].ToString());
+                                }
                             }
                         }
-                    }
-                    if (pibid != "")
-                    {
                         DataTable dt = (DataTable)dh.ExecuteSql("select * from prodiosingleinfo_view where 主键ID in (" + pibid.Substring(0, pibid.Length - 1) + ")", "select");
                         SingleReport.RegisterData(dt, "prodiosingleinfo_view");
                         SingleReport.GetDataSource("prodiosingleinfo_view").Enabled = true;
@@ -771,7 +793,6 @@ namespace UAS_LabelMachine
                 }
                 List<int> MidOutBoxCode = new List<int>();
                 List<int> MidOutBoxCodeIndex = new List<int>();
-                string la_id = MidLabelCombox.SelectedValue.ToString().Split('#')[0];
                 for (int i = (begin == 0 ? 0 : begin); i <= (end == 0 ? LabelInf.Rows.Count - 1 : end); i++)
                 {
                     try
@@ -788,11 +809,28 @@ namespace UAS_LabelMachine
                         return;
                     }
                 }
+                //如果有选中行
+                if (SelectProdcode != "")
+                {
+                    MidOutBoxCode.Clear();
+                    MidOutBoxCodeIndex.Clear();
+                }
+                for (int i = 0; i < LabelInf.Rows.Count; i++)
+                {
+                    if (LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() == SelectProdcode)
+                    {
+                        if (!MidOutBoxCode.Contains(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString())))
+                        {
+                            MidOutBoxCode.Add(int.Parse(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()));
+                            MidOutBoxCodeIndex.Add(i);
+                        }
+                    }
+                }
                 for (int i = 0; i < MidOutBoxCodeIndex.Count; i++)
                 {
                     try
                     {
-                        MidBoxCodePrint(la_id, MidOutBoxCodeIndex[i]);
+                        MidBoxCodePrint(MidOutBoxCodeIndex[i]);
                     }
                     catch (Exception e)
                     {
@@ -805,9 +843,6 @@ namespace UAS_LabelMachine
             bool FindMidLabel = false;
             if (MidLabelCombox.SelectedValue != null)
             {
-                string la_id = MidLabelCombox.SelectedValue.ToString().Split('#')[0];
-                string cl_labelname = MidLabelCombox.Text;
-                string LabelUrl = dh.getFieldDataByCondition("label left join customerlabel on la_code=cl_labelcode", "cl_labelurl", "la_id='" + la_id + "' and cl_labelname='" + cl_labelname + "'").ToString();
                 //中盒号所在的行
                 int MidLabelRowIndex = 0;
                 //缓存中盒数据
@@ -822,7 +857,7 @@ namespace UAS_LabelMachine
                 }
                 //找到了指定的盒号
                 if (FindMidLabel)
-                    MidBoxCodePrint(la_id, MidLabelRowIndex);
+                    MidBoxCodePrint(MidLabelRowIndex);
                 else
                     MessageBox.Show("该出入库单未找到该中盒号!", "提示");
             }
@@ -848,9 +883,6 @@ namespace UAS_LabelMachine
         {
             List<string> Outboxcode = new List<string>();
             //如果未勾选箱号则对勾选的数据的箱号进行整合
-            string la_id = OutBoxCombox.SelectedValue.ToString().Split('#')[0];
-            string cl_labelname = OutBoxCombox.Text;
-            string LabelUrl = dh.getFieldDataByCondition("label left join customerlabel on la_code=cl_labelcode", "cl_labelurl", "la_id='" + la_id + "' and cl_labelname='" + cl_labelname + "'").ToString();
             if (OutBoxNum.Text == "" || OutBoxNum.Text == "新增")
             {
                 for (int i = 0; i < LabelInf.RowCount; i++)
@@ -870,7 +902,7 @@ namespace UAS_LabelMachine
                         {
                             if (LabelInf.Rows[h].Cells["pib_outboxcode2"].Value.ToString() == Outboxcode.ToArray()[i])
                             {
-                                OutBoxCodePrint(la_id, h);
+                                OutBoxCodePrint(h);
                                 break;
                             }
                         }
@@ -900,7 +932,7 @@ namespace UAS_LabelMachine
                     }
                     //找到了指定的盒号
                     if (FindMidLabel)
-                        OutBoxCodePrint(la_id, OutBoxLabelRowIndex);
+                        OutBoxCodePrint(OutBoxLabelRowIndex);
                     else
                         MessageBox.Show("该出入库单未找到该外箱号!", "提示");
                 }
@@ -909,21 +941,11 @@ namespace UAS_LabelMachine
             Outboxcode.Clear();
         }
 
-        private void MidBoxCodePrint(string la_id, int rowindex)
+        private void MidBoxCodePrint(int rowindex)
         {
             if (EnablePrint)
             {
-                for (int j = 0; j < MidReport.Parameters.Count; j++)
-                {
-                    MidReport.SetParameterValue(MidReport.Parameters[j].Name, "");
-                    for (int i = 0; i < Attach.Rows.Count; i++)
-                    {
-                        if (Attach.Rows[i][0].ToString() == MidReport.Parameters[j].Name)
-                        {
-                            MidReport.SetParameterValue(MidReport.Parameters[j].Name, Attach.Rows[i][1].ToString());
-                        }
-                    }
-                }
+
                 //名称相等的时候,取SQL进行值的查询
                 string pib_id = LabelInf.Rows[rowindex].Cells["pib_id1"].Value.ToString();
                 string pib_outboxcode1 = LabelInf.Rows[rowindex].Cells["pib_outboxcode1"].Value.ToString();
@@ -938,6 +960,19 @@ namespace UAS_LabelMachine
                 }
                 if (dt.Rows.Count > 0)
                 {
+                    if (!MidLabelCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
+                        MidReport.Load(MidLabelCombox.SelectedValue.ToString());
+                    for (int j = 0; j < MidReport.Parameters.Count; j++)
+                    {
+                        MidReport.SetParameterValue(MidReport.Parameters[j].Name, "");
+                        for (int i = 0; i < Attach.Rows.Count; i++)
+                        {
+                            if (Attach.Rows[i][0].ToString() == MidReport.Parameters[j].Name)
+                            {
+                                MidReport.SetParameterValue(MidReport.Parameters[j].Name, Attach.Rows[i][1].ToString());
+                            }
+                        }
+                    }
                     MidReport.RegisterData(dt, "prodiomidinfo_view");
                     MidReport.GetDataSource("prodiomidinfo_view").Enabled = true;
                     MidReport.PrintSettings.ShowDialog = false;
@@ -952,10 +987,12 @@ namespace UAS_LabelMachine
         /// <summary>
         /// 执行打印外箱号
         /// </summary>
-        private void OutBoxCodePrint(string la_id, int rowindex)
+        private void OutBoxCodePrint(int rowindex)
         {
             if (EnablePrint)
             {
+                if (!OutBoxCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
+                    OutReport.Load(OutBoxCombox.SelectedValue.ToString());
                 for (int j = 0; j < OutReport.Parameters.Count; j++)
                 {
                     OutReport.SetParameterValue(OutReport.Parameters[j].Name, "");
@@ -969,34 +1006,11 @@ 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++)
-                {
-                    DataRow dr = dt1.NewRow();
-                    for (int j = 0; j < dt.Columns.Count; j++)
-                    {
-                        dr[j] = dt.Rows[i][j].ToString();
-                    }
-                    dt1.Rows.Add(dr);
-                    if ((i + 1) % 5 == 0 || (i + 1) == dt.Rows.Count)
-                    {
-                        OutReport.RegisterData(dt1, "prodiooutinfo_view");
-                        OutReport.GetDataSource("prodiooutinfo_view").Enabled = true;
-                        OutReport.PrintSettings.ShowDialog = false;
-                        OutReport.PrintSettings.Printer = OutBoxPrinter.Text;
-                     
-                        try
-                        {
-                            OutReport.Print();
-                        }
-                        catch (Exception e)
-                        {
-                            MessageBox.Show(e.Message);
-                            return;
-                        }
-                        BaseUtil.CleanDataTableData(dt1);
-                    }
-                }
+                OutReport.RegisterData(dt, "prodiooutinfo_view");
+                OutReport.GetDataSource("prodiooutinfo_view").Enabled = true;
+                OutReport.PrintSettings.ShowDialog = false;
+                OutReport.PrintSettings.Printer = OutBoxPrinter.Text;
+                OutReport.Print();
                 Properties.Settings.Default.OPrinter = OutBoxPrinter.Text;
                 Properties.Settings.Default.Save();
             }
@@ -1057,7 +1071,7 @@ namespace UAS_LabelMachine
             AllChecked = false;
             sql.Clear();
             sql.Append("select pd_custprodcode,pd_custprodspec,pib_custmidboxcode,pd_pocode,pjd_orispeccode,pib_madein,pib_custbarcode,pib_custoutboxcode,pib_id,pib_datecode1,pib_pdid,pib_piid,");
-            sql.Append("pib_pdno,pib_prodcode,nvl(nvl(pd_brand,pib_brand),pr_brand)pib_brand,pr_vendprodcode,pib_lotno,pib_datecode,pib_qty,pr_spec,");
+            sql.Append("pib_pdno,pib_prodcode,pib_brand,pr_vendprodcode,pib_lotno,pib_datecode,pib_qty,pr_spec,");
             sql.Append("pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,pib_outboxcode2,nvl(pib_ifprint,0)pib_ifprint from prodiobarcode left join ");
             sql.Append("prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno and pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode  ");
             sql.Append("left join sale on sa_code=pib_ordercode left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pib_piid='" + PI_ID + "' ");
@@ -1075,14 +1089,20 @@ namespace UAS_LabelMachine
             if (LabelInf.Rows.Count > 0)
                 LabelInf.FirstDisplayedScrollingRowIndex = LabelInf.Rows.Count - 1;
             //计算所有的采集数量
+            double CollectNum = 0;
+            double OutNum = 0;
             for (int i = 0; i < GridPrcode.Rows.Count; i++)
             {
                 string CurrentPrCode = GridPrcode.Rows[i].Cells["pd_prodcode"].Value.ToString();
                 string CurrentPDNO = GridPrcode.Rows[i].Cells["pd_pdno"].Value.ToString();
+                string CurrentOutQTY = GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString();
                 string collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
+                CollectNum += double.Parse(collectqty == "" ? "0" : collectqty);
+                OutNum += double.Parse(CurrentOutQTY);
                 GridPrcode.Rows[i].Cells["CollectedNum"].Value = collectqty;
-                GridPrcode.Rows[i].Cells["UnCollectedNum"].Value = int.Parse(GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString()) - int.Parse(collectqty == "" ? "0" : collectqty);
+                GridPrcode.Rows[i].Cells["UnCollectedNum"].Value = Convert.ToDouble(double.Parse(GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString()) - double.Parse(collectqty == "" ? "0" : collectqty)).ToString("0.000");
             }
+            ProcessCount.Text = CollectNum + "/" + OutNum;
         }
 
         private void Refresh_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
@@ -1143,7 +1163,8 @@ namespace UAS_LabelMachine
             {
                 if (ComBoxClickChangeLabelDoc)
                 {
-                    SingleReport.Load(ftpOperater.DownLoadTo + SingleLabelCombox.Text);
+                    if (!SingleLabelCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
+                        SingleReport.Load(SingleLabelCombox.SelectedValue.ToString());
                 }
             }
             catch (Exception) { }
@@ -1160,7 +1181,8 @@ namespace UAS_LabelMachine
             {
                 if (ComBoxClickChangeLabelDoc)
                 {
-                    MidReport.Load(ftpOperater.DownLoadTo + MidLabelCombox.Text);
+                    if (!MidLabelCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
+                        MidReport.Load(MidLabelCombox.SelectedValue.ToString());
                 }
             }
             catch (Exception) { }
@@ -1177,7 +1199,8 @@ namespace UAS_LabelMachine
             {
                 if (ComBoxClickChangeLabelDoc)
                 {
-                    OutReport.Load(ftpOperater.DownLoadTo + OutBoxCombox.Text);
+                    if (!OutBoxCombox.SelectedValue.ToString().Contains("System.Data.DataRowView"))
+                        OutReport.Load(OutBoxCombox.SelectedValue.ToString());
                 }
             }
             catch (Exception) { }
@@ -1280,7 +1303,51 @@ namespace UAS_LabelMachine
 
         private void LoadPrcodeData()
         {
-            GridPrcode.DataSource = (DataTable)dh.ExecuteSql("select pd_pdno,pd_prodcode,'0' CollectedNum,'0' UnCollectedNum,pd_outqty,pr_unit,pd_brand,pjd_zxbzs_user,pjd_id from prodiodetail left join prodinout on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode left join product on pd_prodcode=pr_code where pi_id='" + PI_ID + "' order by pd_pdno", "select");
+            GridPrcode.DataSource = (DataTable)dh.ExecuteSql("select pd_pdno,pd_custprodcode,pd_prodcode,'0' CollectedNum,'0' UnCollectedNum,pd_outqty,pr_unit,pd_brand,pjd_zxbzs_user,pjd_id from prodiodetail left join prodinout on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode left join product on pd_prodcode=pr_code where pi_id='" + PI_ID + "' order by pd_pdno", "select");
+            List<int> RemoveIndex = new List<int>();
+            if (Combindetail.Checked)
+            {
+                int CurrentIndex = 0;
+                for (int i = 0; i < GridPrcode.Rows.Count; i++)
+                {
+                    if (i + 1 < GridPrcode.Rows.Count)
+                    {
+                        string BProdCode = GridPrcode.Rows[i].Cells["pd_prodcode"].Value.ToString();
+                        string BPrUnit = GridPrcode.Rows[i].Cells["pr_unit"].Value.ToString();
+                        string BPrBrand = GridPrcode.Rows[i].Cells["pd_brand"].Value.ToString();
+                        string FProdCode = GridPrcode.Rows[i + 1].Cells["pd_prodcode"].Value.ToString();
+                        string FPrUnit = GridPrcode.Rows[i + 1].Cells["pr_unit"].Value.ToString();
+                        string FrBrand = GridPrcode.Rows[i + 1].Cells["pd_brand"].Value.ToString();
+                        if (BProdCode == FProdCode && BPrUnit == FPrUnit && BPrBrand == FrBrand)
+                        {
+                            GridPrcode.Rows[CurrentIndex].Cells["pd_outqty"].Value = double.Parse(GridPrcode.Rows[CurrentIndex].Cells["pd_outqty"].Value.ToString()) + double.Parse(GridPrcode.Rows[i + 1].Cells["pd_outqty"].Value.ToString());
+                            RemoveIndex.Add(i + 1);
+                        }
+                        else
+                        {
+                            CurrentIndex = i + 1;
+                        }
+                    }
+                }
+                foreach (int item in RemoveIndex.OrderByDescending(x => x))
+                {
+                    GridPrcode.Rows.RemoveAt(item);
+                }
+            }
+            double CollectNum = 0;
+            double OutNum = 0;
+            for (int i = 0; i < GridPrcode.Rows.Count; i++)
+            {
+                string CurrentPrCode = GridPrcode.Rows[i].Cells["pd_prodcode"].Value.ToString();
+                string CurrentPDNO = GridPrcode.Rows[i].Cells["pd_pdno"].Value.ToString();
+                string CurrentOutQTY = GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString();
+                string collectqty = (LabelInfDataTable.Compute("sum(pib_qty)", "pib_prodcode='" + CurrentPrCode + "' and pib_pdno='" + CurrentPDNO + "'").ToString());
+                CollectNum += double.Parse(collectqty == "" ? "0" : collectqty);
+                OutNum += double.Parse(CurrentOutQTY);
+                GridPrcode.Rows[i].Cells["CollectedNum"].Value = collectqty;
+                GridPrcode.Rows[i].Cells["UnCollectedNum"].Value = Convert.ToDouble(double.Parse(GridPrcode.Rows[i].Cells["pd_outqty"].Value.ToString()) - double.Parse(collectqty == "" ? "0" : collectqty)).ToString("0.000");
+            }
+            ProcessCount.Text = CollectNum + "/" + OutNum;
             if (GridPrcode.Rows.Count > 0)
             {
                 CurrentPrCode = GridPrcode.Rows[0].Cells["pd_prodcode"].Value.ToString();
@@ -1296,8 +1363,9 @@ namespace UAS_LabelMachine
 
         private void OutBoxNum_Click(object sender, EventArgs e)
         {
+            string OutBox = OutBoxNum.Text;
             OutBoxNum.Items.Clear();
-            DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by pib_outboxcode2", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2)", "select");
             ItemObject io = new ItemObject("新增", "新增");
             OutBoxNum.Items.Add(io);
             for (int i = 0; i < dt.Rows.Count; i++)
@@ -1308,6 +1376,8 @@ namespace UAS_LabelMachine
             }
             if (OutBoxNum.Text == "新增" || OutBoxNum.Text == "")
                 OutBoxNum.SelectedIndex = OutBoxNum.Items.Count - 1;
+            if (OutBox != "新增" && OutBox != "")
+                OutBoxNum.Text = OutBox;
         }
 
         /// <summary>
@@ -1407,7 +1477,7 @@ namespace UAS_LabelMachine
             CurrentBrand = GridPrcode.Rows[e.RowIndex].Cells["pd_brand"].Value.ToString();
             GridPrcode.Rows[e.RowIndex].Selected = true;
             GridPrcode.FirstDisplayedScrollingRowIndex = e.RowIndex;
-            dh.ExecuteSql("delete from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno='" + CurrentPDNO + "' and pib_prodcode='" + CurrentPrCode + "'", "delete");
+            //dh.ExecuteSql("delete from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno='" + CurrentPDNO + "' and pib_prodcode='" + CurrentPrCode + "'", "delete");
             LoadGridData(sender, new EventArgs());
         }
 
@@ -1423,7 +1493,10 @@ namespace UAS_LabelMachine
                 CurrentPrCount = GridPrcode.Rows[dsc[0].Index].Cells["pd_outqty"].Value.ToString();
                 CurrentBrand = GridPrcode.Rows[dsc[0].Index].Cells["pd_brand"].Value.ToString();
                 GridPrcode.Rows[dsc[0].Index].Selected = true;
-                GridPrcode.FirstDisplayedScrollingRowIndex = dsc[0].Index;
+                if (dsc[0].Index - 1 > 0)
+                    GridPrcode.FirstDisplayedScrollingRowIndex = dsc[0].Index - 1;
+                else
+                    GridPrcode.FirstDisplayedScrollingRowIndex = dsc[0].Index;
             }
         }
 
@@ -1434,7 +1507,10 @@ namespace UAS_LabelMachine
             if (e.RowIndex >= 0)
             {
                 GridPrcode.Rows[e.RowIndex].Selected = true;
-                GridPrcode.FirstDisplayedScrollingRowIndex = e.RowIndex;
+                if (e.RowIndex - 1 > 0)
+                    GridPrcode.FirstDisplayedScrollingRowIndex = e.RowIndex - 1;
+                else
+                    GridPrcode.FirstDisplayedScrollingRowIndex = e.RowIndex;
             }
         }
 
@@ -1476,8 +1552,8 @@ 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='" + pi_inoutno.Text + "') from prodiobarcode  where pib_id=";
+            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 to_number(pib_outboxcode2)", "select");
+            string SQL = "select pib_outboxcode2||'/'||(select max(to_number(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 + dt.Rows[i]["pib_id"].ToString(), "select");
@@ -1512,13 +1588,13 @@ namespace UAS_LabelMachine
                     e.PaintContent(e.CellBounds);
                     e.Handled = true;
                 }
-                if (GridPrcode.Columns[e.ColumnIndex].Name == "UnCollectedNum" || GridPrcode.Columns[e.ColumnIndex].Name == "CollectedNum")
+                if (GridPrcode.Columns[e.ColumnIndex].Name == "UnCollectedNum")
                 {
                     SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
-                    if (GridPrcode.Rows[e.RowIndex].Cells["UnCollectedNum"].Value.ToString() == "0")
+                    if (GridPrcode.Rows[e.RowIndex].Cells["UnCollectedNum"].Value.ToString() == "0.000")
                         e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.LightSeaGreen, e.CellBounds);
                     else
-                        e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.Gray, e.CellBounds);
+                        e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.Red, e.CellBounds);
                     Rectangle border = e.CellBounds;
                     border.Width -= 1;
                     e.Graphics.DrawRectangle(Pens.White, border);
@@ -1550,7 +1626,7 @@ namespace UAS_LabelMachine
         {
             if (LabelInf.Rows.Count > 0)
             {
-                DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by pib_outboxcode2", "select");
+                DataTable dt = (DataTable)dh.ExecuteSql("select distinct pib_outboxcode2 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' order by to_number(pib_outboxcode2)", "select");
                 string pibcustoutboxcode = dh.getFieldDataByCondition("prodiobarcode", "pib_custoutboxcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + LabelInf.Rows[LabelInf.Rows.Count - 1].Cells["pib_outboxcode2"].Value.ToString() + "' and pib_custoutboxcode is not null").ToString();
                 GetBarCodeRule(out Prefix, out Suffix, out MaxNum, out NumLength, out Radix);
                 if (Radix > 0)
@@ -1590,22 +1666,25 @@ namespace UAS_LabelMachine
             if (Radix > 0)
             {
                 //生成中盒条码
-                int pib_outboxcode1 = int.Parse(dh.getFieldDataByCondition("prodiobarcode", "nvl(max(pib_outboxcode1),0)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString());
+                int pib_outboxcode1 = int.Parse(dh.getFieldDataByCondition("prodiobarcode", "max(to_number(nvl(pib_outboxcode1,0)))", "pib_inoutno='" + pi_inoutno.Text + "'").ToString());
                 MaxNum = MaxNum - 1;
                 for (int i = 0; i < dt.Rows.Count; i++)
                 {
                     List<string> MidBoxCode = new List<string>();
                     List<string> PIBID = new List<string>();
                     List<string> PIBOUTBOXCODE1 = new List<string>();
-                    DataTable dt1 = (DataTable)dh.ExecuteSql("select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + dt.Rows[i]["pib_outboxcode2"].ToString() + "' and pib_outboxcode1 is null order by  to_number(pib_id)", "select");
+                    DataTable dt1 = (DataTable)dh.ExecuteSql("select pib_id,pib_prodcode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode2='" + dt.Rows[i]["pib_outboxcode2"].ToString() + "' and pib_outboxcode1 is null order by  to_number(pib_id)", "select");
                     //如果不是10的整数倍则为尾盒
+                    int tencount = 0;
                     for (int j = 0; j < dt1.Rows.Count; j++)
                     {
-                        if (j % 10 == 0)
+                        if (tencount % 10 == 0 || (dt1.Rows[j]["pib_prodcode"].ToString() != dt1.Rows[j - 1]["pib_prodcode"].ToString()))
                         {
                             pib_outboxcode1 = pib_outboxcode1 + 1;
                             MaxNum = MaxNum + 1;
+                            tencount = 0;
                         }
+                        tencount = tencount + 1;
                         string serialcode = BaseUtil.DToAny(MaxNum, Radix);
                         for (int k = serialcode.ToString().Length; k < NumLength; k++)
                         {
@@ -1649,5 +1728,16 @@ namespace UAS_LabelMachine
             LoadGridData(sender, e);
             CustomerLabel.Enabled = false;
         }
+
+        private void Combindetail_CheckedChanged(object sender, EventArgs e)
+        {
+            LoadPrcodeData();
+        }
+        string SelectProdcode = "";
+        private void LabelInf_CellClick(object sender, DataGridViewCellEventArgs e)
+        {
+            LabelInf.Rows[e.RowIndex].Selected = true;
+            SelectProdcode = LabelInf.Rows[e.RowIndex].Cells["pib_prodcode"].Value.ToString();
+        }
     }
 }

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

@@ -132,6 +132,9 @@
   <metadata name="pjd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="pd_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

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

@@ -93,9 +93,10 @@ namespace UAS_LabelMachine
             // 
             this.cl_code_label.AutoSize = true;
             this.cl_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cl_code_label.Location = new System.Drawing.Point(31, 15);
+            this.cl_code_label.Location = new System.Drawing.Point(41, 19);
+            this.cl_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.cl_code_label.Name = "cl_code_label";
-            this.cl_code_label.Size = new System.Drawing.Size(74, 21);
+            this.cl_code_label.Size = new System.Drawing.Size(92, 27);
             this.cl_code_label.TabIndex = 145;
             this.cl_code_label.Text = "客户编号";
             // 
@@ -103,9 +104,10 @@ namespace UAS_LabelMachine
             // 
             this.cu_name_label.AutoSize = true;
             this.cu_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cu_name_label.Location = new System.Drawing.Point(325, 16);
+            this.cu_name_label.Location = new System.Drawing.Point(433, 20);
+            this.cu_name_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.cu_name_label.Name = "cu_name_label";
-            this.cu_name_label.Size = new System.Drawing.Size(74, 21);
+            this.cu_name_label.Size = new System.Drawing.Size(92, 27);
             this.cu_name_label.TabIndex = 144;
             this.cu_name_label.Text = "客户名称";
             // 
@@ -117,9 +119,10 @@ namespace UAS_LabelMachine
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(919, 89);
+            this.label1.Location = new System.Drawing.Point(1225, 111);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(106, 21);
+            this.label1.Size = new System.Drawing.Size(132, 27);
             this.label1.TabIndex = 164;
             this.label1.Text = "模板参数预览";
             // 
@@ -127,17 +130,19 @@ namespace UAS_LabelMachine
             // 
             this.PrinterList_lable.AutoSize = true;
             this.PrinterList_lable.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrinterList_lable.Location = new System.Drawing.Point(920, 21);
+            this.PrinterList_lable.Location = new System.Drawing.Point(1227, 26);
+            this.PrinterList_lable.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.PrinterList_lable.Name = "PrinterList_lable";
-            this.PrinterList_lable.Size = new System.Drawing.Size(90, 21);
+            this.PrinterList_lable.Size = new System.Drawing.Size(112, 27);
             this.PrinterList_lable.TabIndex = 175;
             this.PrinterList_lable.Text = "打印机列表";
             // 
             // OpenFolder
             // 
-            this.OpenFolder.Location = new System.Drawing.Point(562, 490);
+            this.OpenFolder.Location = new System.Drawing.Point(749, 612);
+            this.OpenFolder.Margin = new System.Windows.Forms.Padding(4);
             this.OpenFolder.Name = "OpenFolder";
-            this.OpenFolder.Size = new System.Drawing.Size(75, 27);
+            this.OpenFolder.Size = new System.Drawing.Size(100, 34);
             this.OpenFolder.TabIndex = 156;
             this.OpenFolder.Text = "打开";
             this.OpenFolder.UseVisualStyleBackColor = true;
@@ -147,27 +152,30 @@ namespace UAS_LabelMachine
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(283, 453);
+            this.label3.Location = new System.Drawing.Point(377, 566);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(74, 21);
+            this.label3.Size = new System.Drawing.Size(92, 27);
             this.label3.TabIndex = 171;
             this.label3.Text = "盘标类型";
             // 
             // FolderPath
             // 
             this.FolderPath.Enabled = false;
-            this.FolderPath.Location = new System.Drawing.Point(379, 493);
+            this.FolderPath.Location = new System.Drawing.Point(505, 616);
+            this.FolderPath.Margin = new System.Windows.Forms.Padding(4);
             this.FolderPath.Name = "FolderPath";
-            this.FolderPath.Size = new System.Drawing.Size(161, 21);
+            this.FolderPath.Size = new System.Drawing.Size(213, 25);
             this.FolderPath.TabIndex = 157;
             // 
             // FolderPath_Label
             // 
             this.FolderPath_Label.AutoSize = true;
             this.FolderPath_Label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.FolderPath_Label.Location = new System.Drawing.Point(283, 493);
+            this.FolderPath_Label.Location = new System.Drawing.Point(377, 616);
+            this.FolderPath_Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.FolderPath_Label.Name = "FolderPath_Label";
-            this.FolderPath_Label.Size = new System.Drawing.Size(74, 21);
+            this.FolderPath_Label.Size = new System.Drawing.Size(92, 27);
             this.FolderPath_Label.TabIndex = 158;
             this.FolderPath_Label.Text = "模板路径";
             // 
@@ -180,18 +188,20 @@ namespace UAS_LabelMachine
             "单盘",
             "中盒",
             "外箱"});
-            this.la_type1.Location = new System.Drawing.Point(379, 454);
+            this.la_type1.Location = new System.Drawing.Point(505, 568);
+            this.la_type1.Margin = new System.Windows.Forms.Padding(4);
             this.la_type1.Name = "la_type1";
-            this.la_type1.Size = new System.Drawing.Size(161, 20);
+            this.la_type1.Size = new System.Drawing.Size(213, 23);
             this.la_type1.TabIndex = 169;
             // 
             // cl_custcode_label
             // 
             this.cl_custcode_label.AutoSize = true;
             this.cl_custcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cl_custcode_label.Location = new System.Drawing.Point(20, 450);
+            this.cl_custcode_label.Location = new System.Drawing.Point(27, 562);
+            this.cl_custcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.cl_custcode_label.Name = "cl_custcode_label";
-            this.cl_custcode_label.Size = new System.Drawing.Size(74, 21);
+            this.cl_custcode_label.Size = new System.Drawing.Size(92, 27);
             this.cl_custcode_label.TabIndex = 167;
             this.cl_custcode_label.Text = "客户编号";
             // 
@@ -205,9 +215,10 @@ namespace UAS_LabelMachine
             // 
             this.la_code_label.AutoSize = true;
             this.la_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.la_code_label.Location = new System.Drawing.Point(563, 453);
+            this.la_code_label.Location = new System.Drawing.Point(751, 566);
+            this.la_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.la_code_label.Name = "la_code_label";
-            this.la_code_label.Size = new System.Drawing.Size(74, 21);
+            this.la_code_label.Size = new System.Drawing.Size(92, 27);
             this.la_code_label.TabIndex = 178;
             this.la_code_label.Text = "模板编号";
             // 
@@ -215,9 +226,10 @@ namespace UAS_LabelMachine
             // 
             this.NetURL_label.AutoSize = true;
             this.NetURL_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.NetURL_label.Location = new System.Drawing.Point(936, 49);
+            this.NetURL_label.Location = new System.Drawing.Point(1248, 61);
+            this.NetURL_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.NetURL_label.Name = "NetURL_label";
-            this.NetURL_label.Size = new System.Drawing.Size(74, 21);
+            this.NetURL_label.Size = new System.Drawing.Size(92, 27);
             this.NetURL_label.TabIndex = 181;
             this.NetURL_label.Text = "网络路径";
             // 
@@ -225,9 +237,10 @@ namespace UAS_LabelMachine
             // 
             this.cl_labeltype_label.AutoSize = true;
             this.cl_labeltype_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.cl_labeltype_label.Location = new System.Drawing.Point(609, 15);
+            this.cl_labeltype_label.Location = new System.Drawing.Point(812, 19);
+            this.cl_labeltype_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.cl_labeltype_label.Name = "cl_labeltype_label";
-            this.cl_labeltype_label.Size = new System.Drawing.Size(74, 21);
+            this.cl_labeltype_label.Size = new System.Drawing.Size(92, 27);
             this.cl_labeltype_label.TabIndex = 185;
             this.cl_labeltype_label.Text = "盘标类型";
             // 
@@ -236,9 +249,10 @@ namespace UAS_LabelMachine
             this.la_type.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.la_type.DropDownWidth = 161;
             this.la_type.FormattingEnabled = true;
-            this.la_type.Location = new System.Drawing.Point(705, 16);
+            this.la_type.Location = new System.Drawing.Point(940, 20);
+            this.la_type.Margin = new System.Windows.Forms.Padding(4);
             this.la_type.Name = "la_type";
-            this.la_type.Size = new System.Drawing.Size(161, 20);
+            this.la_type.Size = new System.Drawing.Size(213, 23);
             this.la_type.TabIndex = 184;
             this.la_type.Tag = "cl_labeltype";
             // 
@@ -246,41 +260,44 @@ namespace UAS_LabelMachine
             // 
             this.la_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
-            this.la_name.Location = new System.Drawing.Point(116, 493);
+            this.la_name.Location = new System.Drawing.Point(155, 616);
+            this.la_name.Margin = new System.Windows.Forms.Padding(4);
             this.la_name.Name = "la_name";
-            this.la_name.Size = new System.Drawing.Size(1, 21);
+            this.la_name.Size = new System.Drawing.Size(0, 25);
             this.la_name.TabIndex = 186;
             // 
             // la_name_label
             // 
             this.la_name_label.AutoSize = true;
             this.la_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.la_name_label.Location = new System.Drawing.Point(20, 493);
+            this.la_name_label.Location = new System.Drawing.Point(27, 616);
+            this.la_name_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.la_name_label.Name = "la_name_label";
-            this.la_name_label.Size = new System.Drawing.Size(74, 21);
+            this.la_name_label.Size = new System.Drawing.Size(92, 27);
             this.la_name_label.TabIndex = 187;
             this.la_name_label.Text = "模板名称";
             // 
             // FTPShare
             // 
             this.FTPShare.AutoSize = true;
-            this.FTPShare.Checked = true;
-            this.FTPShare.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.FTPShare.Location = new System.Drawing.Point(659, 497);
+            this.FTPShare.Location = new System.Drawing.Point(879, 621);
+            this.FTPShare.Margin = new System.Windows.Forms.Padding(4);
             this.FTPShare.Name = "FTPShare";
-            this.FTPShare.Size = new System.Drawing.Size(66, 16);
+            this.FTPShare.Size = new System.Drawing.Size(83, 19);
             this.FTPShare.TabIndex = 188;
             this.FTPShare.Text = "FTP共享";
             this.FTPShare.UseVisualStyleBackColor = true;
+            this.FTPShare.Visible = false;
             // 
             // FastReport
             // 
             this.FastReport.AutoSize = true;
             this.FastReport.Checked = true;
             this.FastReport.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.FastReport.Location = new System.Drawing.Point(1058, 86);
+            this.FastReport.Location = new System.Drawing.Point(1411, 108);
+            this.FastReport.Margin = new System.Windows.Forms.Padding(4);
             this.FastReport.Name = "FastReport";
-            this.FastReport.Size = new System.Drawing.Size(110, 25);
+            this.FastReport.Size = new System.Drawing.Size(136, 31);
             this.FastReport.TabIndex = 161;
             this.FastReport.TabStop = true;
             this.FastReport.Text = "FastReport";
@@ -289,9 +306,10 @@ namespace UAS_LabelMachine
             // 
             // pictureBox1
             // 
-            this.pictureBox1.Location = new System.Drawing.Point(918, 138);
+            this.pictureBox1.Location = new System.Drawing.Point(1224, 172);
+            this.pictureBox1.Margin = new System.Windows.Forms.Padding(4);
             this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(254, 300);
+            this.pictureBox1.Size = new System.Drawing.Size(339, 375);
             this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
             this.pictureBox1.TabIndex = 191;
             this.pictureBox1.TabStop = false;
@@ -299,18 +317,19 @@ namespace UAS_LabelMachine
             // pagination1
             // 
             this.pagination1.Cursor = System.Windows.Forms.Cursors.Hand;
-            this.pagination1.Location = new System.Drawing.Point(0, 550);
-            this.pagination1.Margin = new System.Windows.Forms.Padding(4);
+            this.pagination1.Location = new System.Drawing.Point(0, 688);
+            this.pagination1.Margin = new System.Windows.Forms.Padding(5);
             this.pagination1.Name = "pagination1";
-            this.pagination1.Size = new System.Drawing.Size(1179, 31);
+            this.pagination1.Size = new System.Drawing.Size(1572, 39);
             this.pagination1.TabIndex = 190;
             // 
             // NewLabel
             // 
             this.NewLabel.Image = ((System.Drawing.Image)(resources.GetObject("NewLabel.Image")));
-            this.NewLabel.Location = new System.Drawing.Point(846, 490);
+            this.NewLabel.Location = new System.Drawing.Point(1128, 612);
+            this.NewLabel.Margin = new System.Windows.Forms.Padding(4);
             this.NewLabel.Name = "NewLabel";
-            this.NewLabel.Size = new System.Drawing.Size(61, 24);
+            this.NewLabel.Size = new System.Drawing.Size(81, 30);
             this.NewLabel.TabIndex = 189;
             this.NewLabel.Tag = "IfWrite";
             this.NewLabel.Text = "新增标签";
@@ -320,14 +339,16 @@ namespace UAS_LabelMachine
             // NetURL
             // 
             this.NetURL.ID = null;
-            this.NetURL.Location = new System.Drawing.Point(1026, 49);
+            this.NetURL.Location = new System.Drawing.Point(1368, 61);
+            this.NetURL.Margin = new System.Windows.Forms.Padding(4);
             this.NetURL.Name = "NetURL";
-            this.NetURL.Size = new System.Drawing.Size(122, 21);
+            this.NetURL.Size = new System.Drawing.Size(161, 25);
             this.NetURL.Str = null;
             this.NetURL.Str1 = null;
             this.NetURL.Str2 = null;
             this.NetURL.TabIndex = 182;
             this.NetURL.Tag = "cu_name";
+            this.NetURL.Text = "\\\\10.2.10.211\\文件服务 (f)\\FastReport\\";
             this.NetURL.TextChanged += new System.EventHandler(this.NetURL_TextChanged);
             // 
             // la_code
@@ -337,13 +358,14 @@ namespace UAS_LabelMachine
             this.la_code.Condition = null;
             this.la_code.DBTitle = null;
             this.la_code.FormName = null;
-            this.la_code.Location = new System.Drawing.Point(659, 455);
+            this.la_code.Location = new System.Drawing.Point(879, 569);
+            this.la_code.Margin = new System.Windows.Forms.Padding(4);
             this.la_code.Name = "la_code";
             this.la_code.Power = null;
             this.la_code.ReturnData = null;
             this.la_code.SelectField = null;
             this.la_code.SetValueField = null;
-            this.la_code.Size = new System.Drawing.Size(161, 21);
+            this.la_code.Size = new System.Drawing.Size(215, 26);
             this.la_code.TabIndex = 179;
             this.la_code.TableName = null;
             this.la_code.Tag = "la_code";
@@ -352,9 +374,10 @@ namespace UAS_LabelMachine
             // Save
             // 
             this.Save.Image = ((System.Drawing.Image)(resources.GetObject("Save.Image")));
-            this.Save.Location = new System.Drawing.Point(759, 491);
+            this.Save.Location = new System.Drawing.Point(1012, 614);
+            this.Save.Margin = new System.Windows.Forms.Padding(4);
             this.Save.Name = "Save";
-            this.Save.Size = new System.Drawing.Size(61, 24);
+            this.Save.Size = new System.Drawing.Size(81, 30);
             this.Save.TabIndex = 170;
             this.Save.Tag = "IfWrite";
             this.Save.Text = "保存";
@@ -363,19 +386,20 @@ namespace UAS_LabelMachine
             // 
             // ChooseAll
             // 
-            this.ChooseAll.Location = new System.Drawing.Point(19, 92);
+            this.ChooseAll.Location = new System.Drawing.Point(25, 115);
+            this.ChooseAll.Margin = new System.Windows.Forms.Padding(4);
             this.ChooseAll.Name = "ChooseAll";
-            this.ChooseAll.Size = new System.Drawing.Size(40, 21);
+            this.ChooseAll.Size = new System.Drawing.Size(53, 26);
             this.ChooseAll.TabIndex = 177;
             this.ChooseAll.Text = "全选";
             this.ChooseAll.UseVisualStyleBackColor = true;
             // 
             // PrinterList
             // 
-            this.PrinterList.Location = new System.Drawing.Point(1026, 22);
-            this.PrinterList.Margin = new System.Windows.Forms.Padding(4);
+            this.PrinterList.Location = new System.Drawing.Point(1368, 28);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(5);
             this.PrinterList.Name = "PrinterList";
-            this.PrinterList.Size = new System.Drawing.Size(121, 20);
+            this.PrinterList.Size = new System.Drawing.Size(161, 25);
             this.PrinterList.TabIndex = 174;
             // 
             // LabelDataGridView
@@ -398,7 +422,8 @@ namespace UAS_LabelMachine
             this.cl_detno,
             this.cl_labelsoft,
             this.cl_status});
-            this.LabelDataGridView.Location = new System.Drawing.Point(17, 90);
+            this.LabelDataGridView.Location = new System.Drawing.Point(23, 112);
+            this.LabelDataGridView.Margin = new System.Windows.Forms.Padding(4);
             this.LabelDataGridView.Name = "LabelDataGridView";
             dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
             dataGridViewCellStyle1.BackColor = System.Drawing.Color.Blue;
@@ -412,9 +437,10 @@ namespace UAS_LabelMachine
             this.LabelDataGridView.RowsDefaultCellStyle = dataGridViewCellStyle2;
             this.LabelDataGridView.RowTemplate.Height = 23;
             this.LabelDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
-            this.LabelDataGridView.Size = new System.Drawing.Size(890, 348);
+            this.LabelDataGridView.Size = new System.Drawing.Size(1187, 435);
             this.LabelDataGridView.TabIndex = 172;
             this.LabelDataGridView.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelDataGridView_CellContentClick);
+            this.LabelDataGridView.CellContentDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelDataGridView_CellContentDoubleClick);
             this.LabelDataGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.LabelDataGridView_CellFormatting);
             this.LabelDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.LabelDataGridView_DataError);
             // 
@@ -460,48 +486,56 @@ namespace UAS_LabelMachine
             this.cl_labeltype.DataPropertyName = "cl_labeltype";
             this.cl_labeltype.HeaderText = "标签类型";
             this.cl_labeltype.Name = "cl_labeltype";
+            this.cl_labeltype.ReadOnly = true;
             // 
             // cl_labelcode
             // 
             this.cl_labelcode.DataPropertyName = "cl_labelcode";
             this.cl_labelcode.HeaderText = "模板编号";
             this.cl_labelcode.Name = "cl_labelcode";
+            this.cl_labelcode.ReadOnly = true;
             // 
             // cl_labelurl
             // 
             this.cl_labelurl.DataPropertyName = "cl_labelurl";
             this.cl_labelurl.HeaderText = "模板路径";
             this.cl_labelurl.Name = "cl_labelurl";
+            this.cl_labelurl.ReadOnly = true;
             // 
             // cl_labelname
             // 
             this.cl_labelname.DataPropertyName = "cl_labelname";
             this.cl_labelname.HeaderText = "模板名称";
             this.cl_labelname.Name = "cl_labelname";
+            this.cl_labelname.ReadOnly = true;
             // 
             // cl_date
             // 
             this.cl_date.DataPropertyName = "cl_date";
             this.cl_date.HeaderText = "最后修改时间";
             this.cl_date.Name = "cl_date";
+            this.cl_date.ReadOnly = true;
             // 
             // cl_isdefault
             // 
             this.cl_isdefault.DataPropertyName = "cl_isdefault";
             this.cl_isdefault.HeaderText = "是否默认";
             this.cl_isdefault.Name = "cl_isdefault";
+            this.cl_isdefault.ReadOnly = true;
             // 
             // cl_detno
             // 
             this.cl_detno.DataPropertyName = "cl_detno";
             this.cl_detno.HeaderText = "序号";
             this.cl_detno.Name = "cl_detno";
+            this.cl_detno.ReadOnly = true;
             // 
             // cl_labelsoft
             // 
             this.cl_labelsoft.DataPropertyName = "cl_labelsoft";
             this.cl_labelsoft.HeaderText = "标签软件";
             this.cl_labelsoft.Name = "cl_labelsoft";
+            this.cl_labelsoft.ReadOnly = true;
             // 
             // cl_status
             // 
@@ -513,9 +547,10 @@ namespace UAS_LabelMachine
             // PrintTest
             // 
             this.PrintTest.Image = ((System.Drawing.Image)(resources.GetObject("PrintTest.Image")));
-            this.PrintTest.Location = new System.Drawing.Point(1016, 455);
+            this.PrintTest.Location = new System.Drawing.Point(1355, 569);
+            this.PrintTest.Margin = new System.Windows.Forms.Padding(4);
             this.PrintTest.Name = "PrintTest";
-            this.PrintTest.Size = new System.Drawing.Size(61, 24);
+            this.PrintTest.Size = new System.Drawing.Size(81, 30);
             this.PrintTest.TabIndex = 166;
             this.PrintTest.Tag = "Print";
             this.PrintTest.Text = "打印测试";
@@ -529,13 +564,14 @@ namespace UAS_LabelMachine
             this.客户编号.Condition = null;
             this.客户编号.DBTitle = null;
             this.客户编号.FormName = null;
-            this.客户编号.Location = new System.Drawing.Point(116, 453);
+            this.客户编号.Location = new System.Drawing.Point(155, 566);
+            this.客户编号.Margin = new System.Windows.Forms.Padding(4);
             this.客户编号.Name = "客户编号";
             this.客户编号.Power = null;
             this.客户编号.ReturnData = null;
             this.客户编号.SelectField = null;
             this.客户编号.SetValueField = null;
-            this.客户编号.Size = new System.Drawing.Size(136, 21);
+            this.客户编号.Size = new System.Drawing.Size(181, 26);
             this.客户编号.TabIndex = 168;
             this.客户编号.TableName = null;
             this.客户编号.Tag = "cu_code";
@@ -548,13 +584,14 @@ namespace UAS_LabelMachine
             this.cu_code.Condition = null;
             this.cu_code.DBTitle = null;
             this.cu_code.FormName = null;
-            this.cu_code.Location = new System.Drawing.Point(127, 16);
+            this.cu_code.Location = new System.Drawing.Point(169, 20);
+            this.cu_code.Margin = new System.Windows.Forms.Padding(4);
             this.cu_code.Name = "cu_code";
             this.cu_code.Power = null;
             this.cu_code.ReturnData = null;
             this.cu_code.SelectField = null;
             this.cu_code.SetValueField = null;
-            this.cu_code.Size = new System.Drawing.Size(150, 21);
+            this.cu_code.Size = new System.Drawing.Size(200, 26);
             this.cu_code.TabIndex = 159;
             this.cu_code.TableName = null;
             this.cu_code.Tag = "cl_custcode";
@@ -563,9 +600,10 @@ namespace UAS_LabelMachine
             // UpdateGrid
             // 
             this.UpdateGrid.Image = ((System.Drawing.Image)(resources.GetObject("UpdateGrid.Image")));
-            this.UpdateGrid.Location = new System.Drawing.Point(695, 49);
+            this.UpdateGrid.Location = new System.Drawing.Point(927, 61);
+            this.UpdateGrid.Margin = new System.Windows.Forms.Padding(4);
             this.UpdateGrid.Name = "UpdateGrid";
-            this.UpdateGrid.Size = new System.Drawing.Size(61, 24);
+            this.UpdateGrid.Size = new System.Drawing.Size(81, 30);
             this.UpdateGrid.TabIndex = 154;
             this.UpdateGrid.Tag = "IfWrite";
             this.UpdateGrid.Text = "更新";
@@ -575,9 +613,10 @@ namespace UAS_LabelMachine
             // Screen
             // 
             this.Screen.Image = ((System.Drawing.Image)(resources.GetObject("Screen.Image")));
-            this.Screen.Location = new System.Drawing.Point(582, 49);
+            this.Screen.Location = new System.Drawing.Point(776, 61);
+            this.Screen.Margin = new System.Windows.Forms.Padding(4);
             this.Screen.Name = "Screen";
-            this.Screen.Size = new System.Drawing.Size(61, 24);
+            this.Screen.Size = new System.Drawing.Size(81, 30);
             this.Screen.TabIndex = 153;
             this.Screen.Tag = "IfRead";
             this.Screen.Text = "筛选";
@@ -587,9 +626,10 @@ namespace UAS_LabelMachine
             // cu_name
             // 
             this.cu_name.ID = null;
-            this.cu_name.Location = new System.Drawing.Point(419, 16);
+            this.cu_name.Location = new System.Drawing.Point(559, 20);
+            this.cu_name.Margin = new System.Windows.Forms.Padding(4);
             this.cu_name.Name = "cu_name";
-            this.cu_name.Size = new System.Drawing.Size(150, 21);
+            this.cu_name.Size = new System.Drawing.Size(199, 25);
             this.cu_name.Str = null;
             this.cu_name.Str1 = null;
             this.cu_name.Str2 = null;
@@ -598,9 +638,9 @@ namespace UAS_LabelMachine
             // 
             // 客户标签维护
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1179, 581);
+            this.ClientSize = new System.Drawing.Size(1572, 726);
             this.Controls.Add(this.pictureBox1);
             this.Controls.Add(this.pagination1);
             this.Controls.Add(this.NewLabel);
@@ -634,6 +674,7 @@ namespace UAS_LabelMachine
             this.Controls.Add(this.cu_name);
             this.Controls.Add(this.cl_code_label);
             this.Controls.Add(this.cu_name_label);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "客户标签维护";
             this.Tag = "Make!CustLabel";
             this.Text = "客户标签维护";
@@ -687,6 +728,7 @@ namespace UAS_LabelMachine
         private NormalButton NewLabel;
         private Pagination pagination1;
         private RadioButton FastReport;
+        private PictureBox pictureBox1;
         private DataGridViewCheckBoxColumn Choose;
         private DataGridViewTextBoxColumn la_id;
         private DataGridViewTextBoxColumn cu_name1;
@@ -701,6 +743,5 @@ namespace UAS_LabelMachine
         private DataGridViewTextBoxColumn cl_detno;
         private DataGridViewTextBoxColumn cl_labelsoft;
         private DataGridViewTextBoxColumn cl_status;
-        private PictureBox pictureBox1;
     }
 }

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

@@ -77,9 +77,9 @@ namespace UAS_LabelMachine
             la_code.SetValueField = new string[] { "la_code" };
             la_code.TableName = "(select * from label order by la_id)";
             la_code.SelectField = "la_code # 模板编号,la_name # 模板名称";
-            NetURL.Text = Settings.Default.ShareUrl;
+            //NetURL.Text = Settings.Default.ShareUrl;
         }
-        
+
         private void 条码维护_Load(object sender, EventArgs e)
         {
             if (Settings.Default.FTPAddress == "")
@@ -116,31 +116,6 @@ namespace UAS_LabelMachine
                     time = System.DateTime.Now;
                 }
             }
-            if (LabelDataGridView.Columns[e.ColumnIndex].HeaderText == "编辑")
-            {
-                if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
-                {
-                    CL_ID2 = LabelDataGridView.Rows[e.RowIndex].Cells["cl_id"].Value.ToString();
-                    LabelPath = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelurl"].Value.ToString();
-                    string LabelName = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelname"].Value.ToString();
-                    System.DateTime time;
-                    try
-                    {
-                       time = Convert.ToDateTime(LabelDataGridView.Rows[e.RowIndex].Cells["cl_date"].Value.ToString());
-                    }
-                    catch (Exception)
-                    {
-                        time = System.DateTime.Now;
-                    }
-                    BaseUtil.GetLabelUrl(LabelPath, LabelName, time);
-                    System.Diagnostics.Process.Start(ftpOperater.DownLoadTo + LabelName);
-                    客户编号.Text = LabelDataGridView.Rows[e.RowIndex].Cells["CL_CUSTCODE2"].Value.ToString();
-                    la_type1.Text = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labeltype"].Value.ToString();
-                    la_code.Text = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelcode"].Value.ToString();
-                    la_name.Text = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelname"].Value.ToString();
-                    FolderPath.Text = ftpOperater.DownLoadTo;
-                }
-            }
             //asc.controllInitializeSize(this);
         }
 
@@ -276,7 +251,7 @@ namespace UAS_LabelMachine
         {
             if (LabelCode != "")
             {
-       
+
             }
         }
 
@@ -284,7 +259,7 @@ namespace UAS_LabelMachine
         {
             try
             {
-           
+
             }
             catch (Exception)
             {
@@ -357,9 +332,18 @@ namespace UAS_LabelMachine
                         //将文件复制到指定位置
                         File.Copy(sourceFile, destFile, true);
                         string SoftWare = "FastReport";
-                        sql.Clear();
-                        sql.Append("insert into customerlabel (cl_id,cl_labelcode,cl_custcode,cl_labeltype,cl_labelurl,cl_labelname,cl_labelsoft,cl_date) values( customerlabel_seq.nextval, ");
-                        sql.Append("'" + la_code.Text + "','" + (客户编号.Text == "" ? "共用" : 客户编号.Text) + "','" + la_type1.Text + "','" + destFile + "','" + la_name.Text + "','" + SoftWare + "',sysdate)");
+                        if (CL_ID2 != null)
+                        {
+                            sql.Clear();
+                            sql.Append("update customerlabel set cl_labelcode='" + la_code.Text + "',cl_custcode='" + 客户编号.Text + "',");
+                            sql.Append("cl_labeltype='" + la_type1.Text + "',cl_labelname='" + la_name.Text + "',cl_date=sysdate where cl_id=" + CL_ID2);
+                        }
+                        else
+                        {
+                            sql.Clear();
+                            sql.Append("insert into customerlabel (cl_id,cl_labelcode,cl_custcode,cl_labeltype,cl_labelurl,cl_labelname,cl_labelsoft,cl_date) values( customerlabel_seq.nextval, ");
+                            sql.Append("'" + la_code.Text + "','" + (客户编号.Text == "" ? "" : 客户编号.Text) + "','" + la_type1.Text + "','" + (NetURL.Text + la_name.Text) + "','" + la_name.Text + "','" + SoftWare + "',sysdate)");
+                        }
                         dh.ExecuteSql(sql.ToString(), "insert");
                         sql.Clear();
                     }
@@ -393,5 +377,31 @@ namespace UAS_LabelMachine
             FolderPath.Text = "";
             CL_ID2 = null;
         }
+
+        private void LabelDataGridView_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
+        {
+            if (e.RowIndex >= 0 && e.ColumnIndex >= 0)
+            {
+                CL_ID2 = LabelDataGridView.Rows[e.RowIndex].Cells["cl_id"].Value.ToString();
+                LabelPath = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelurl"].Value.ToString();
+                string LabelName = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelname"].Value.ToString();
+                System.DateTime time;
+                try
+                {
+                    time = Convert.ToDateTime(LabelDataGridView.Rows[e.RowIndex].Cells["cl_date"].Value.ToString());
+                }
+                catch (Exception)
+                {
+                    time = System.DateTime.Now;
+                }
+                File.Copy(LabelPath, ftpOperater.DownLoadTo + LabelName, true);
+                System.Diagnostics.Process.Start(ftpOperater.DownLoadTo + LabelName);
+                客户编号.Text = LabelDataGridView.Rows[e.RowIndex].Cells["CL_CUSTCODE2"].Value.ToString();
+                la_type1.Text = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labeltype"].Value.ToString();
+                la_code.Text = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelcode"].Value.ToString();
+                la_name.Text = LabelDataGridView.Rows[e.RowIndex].Cells["cl_labelname"].Value.ToString();
+                FolderPath.Text = ftpOperater.DownLoadTo;
+            }
+        }
     }
 }