Browse Source

生成条码最小包调整

章政 6 years ago
parent
commit
9fb1381127

+ 23 - 15
UAS-出货标签管理(吉利通)/DateCodeSetAndPrint.Designer.cs

@@ -39,9 +39,10 @@
             // 
             // SetValueAndPrint
             // 
-            this.SetValueAndPrint.Location = new System.Drawing.Point(382, 335);
+            this.SetValueAndPrint.Location = new System.Drawing.Point(191, 168);
+            this.SetValueAndPrint.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.SetValueAndPrint.Name = "SetValueAndPrint";
-            this.SetValueAndPrint.Size = new System.Drawing.Size(142, 41);
+            this.SetValueAndPrint.Size = new System.Drawing.Size(77, 20);
             this.SetValueAndPrint.TabIndex = 0;
             this.SetValueAndPrint.Text = "设置并打印";
             this.SetValueAndPrint.UseVisualStyleBackColor = true;
@@ -51,7 +52,8 @@
             this.loadingCircle1.Active = false;
             this.loadingCircle1.Color = System.Drawing.Color.DarkGray;
             this.loadingCircle1.InnerCircleRadius = 5;
-            this.loadingCircle1.Location = new System.Drawing.Point(410, 212);
+            this.loadingCircle1.Location = new System.Drawing.Point(205, 106);
+            this.loadingCircle1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.loadingCircle1.Name = "loadingCircle1";
             this.loadingCircle1.NumberSpoke = 12;
             this.loadingCircle1.OuterCircleRadius = 11;
@@ -64,9 +66,10 @@
             // 
             // SetValue
             // 
-            this.SetValue.Location = new System.Drawing.Point(213, 335);
+            this.SetValue.Location = new System.Drawing.Point(106, 168);
+            this.SetValue.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.SetValue.Name = "SetValue";
-            this.SetValue.Size = new System.Drawing.Size(142, 41);
+            this.SetValue.Size = new System.Drawing.Size(71, 20);
             this.SetValue.TabIndex = 3;
             this.SetValue.Text = "设置值";
             this.SetValue.UseVisualStyleBackColor = true;
@@ -74,27 +77,30 @@
             // lotno_label
             // 
             this.lotno_label.AutoSize = true;
-            this.lotno_label.Location = new System.Drawing.Point(135, 131);
+            this.lotno_label.Location = new System.Drawing.Point(68, 66);
+            this.lotno_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.lotno_label.Name = "lotno_label";
-            this.lotno_label.Size = new System.Drawing.Size(70, 24);
+            this.lotno_label.Size = new System.Drawing.Size(35, 12);
             this.lotno_label.TabIndex = 4;
             this.lotno_label.Text = "LotNo";
             // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(135, 221);
+            this.label2.Location = new System.Drawing.Point(68, 110);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(106, 24);
+            this.label2.Size = new System.Drawing.Size(53, 12);
             this.label2.TabIndex = 5;
             this.label2.Text = "DateCode";
             // 
             // lotno
             // 
             this.lotno.ID = null;
-            this.lotno.Location = new System.Drawing.Point(268, 128);
+            this.lotno.Location = new System.Drawing.Point(134, 64);
+            this.lotno.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.lotno.Name = "lotno";
-            this.lotno.Size = new System.Drawing.Size(301, 35);
+            this.lotno.Size = new System.Drawing.Size(152, 21);
             this.lotno.Str = null;
             this.lotno.Str1 = null;
             this.lotno.Str2 = null;
@@ -103,9 +109,10 @@
             // datecode
             // 
             this.datecode.ID = null;
-            this.datecode.Location = new System.Drawing.Point(268, 218);
+            this.datecode.Location = new System.Drawing.Point(134, 109);
+            this.datecode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.datecode.Name = "datecode";
-            this.datecode.Size = new System.Drawing.Size(301, 35);
+            this.datecode.Size = new System.Drawing.Size(152, 21);
             this.datecode.Str = null;
             this.datecode.Str1 = null;
             this.datecode.Str2 = null;
@@ -113,9 +120,9 @@
             // 
             // DateCodeSetAndPrint
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(730, 425);
+            this.ClientSize = new System.Drawing.Size(365, 212);
             this.Controls.Add(this.datecode);
             this.Controls.Add(this.lotno);
             this.Controls.Add(this.label2);
@@ -123,6 +130,7 @@
             this.Controls.Add(this.SetValue);
             this.Controls.Add(this.loadingCircle1);
             this.Controls.Add(this.SetValueAndPrint);
+            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.Name = "DateCodeSetAndPrint";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "DateCodeSetAndPrint";

File diff suppressed because it is too large
+ 180 - 225
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs


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

@@ -2418,7 +2418,11 @@ namespace UAS_LabelMachine
             string pdno = LabelInf.Rows[rowindex].Cells["pib_pdno"].Value.ToString();
             string datecode = setvalue.FindForm().Controls["datecode"].Text;
             string lotno = setvalue.FindForm().Controls["lotno"].Text;
-            adh.ExecuteSql("update prodiobarcode set pib_lotno='" + lotno + "',pib_datecode='" + datecode + "' where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "update");
+            string year = "0";
+            string month = "0";
+            string day = "0";
+            LogicHandler.GetTimeFromDatecode(datecode, "", out year, out month, out day);
+            adh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_ifmodify=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year=" + year + ",pib_month=" + month + ",pib_day=" + day + " where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "update");
             LoadGridData();
             setvalue.FindForm().Close();
         }
@@ -2427,6 +2431,14 @@ namespace UAS_LabelMachine
         {
             Button setvalueandprint = sender as Button;
             string pdno = LabelInf.Rows[rowindex].Cells["pib_pdno"].Value.ToString();
+            string datecode = setvalueandprint.FindForm().Controls["datecode"].Text;
+            string lotno = setvalueandprint.FindForm().Controls["lotno"].Text;
+            string year = "0";
+            string month = "0";
+            string day = "0";
+            LogicHandler.GetTimeFromDatecode(datecode, "", out year, out month, out day);
+            adh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_ifmodify=-1,pib_ifprint=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year=" + year + ",pib_month=" + month + ",pib_day=" + day + " where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "update");
+            LoadGridData();
             DataTable pibid_dt = (DataTable)adh.ExecuteSql("select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "select");
             for (int i = 0; i < pibid_dt.Rows.Count; i++)
             {

+ 78 - 61
UAS-出货标签管理(吉利通)/生成条码.Designer.cs

@@ -56,10 +56,10 @@
             this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_totalqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_restqty1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_restqty2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_restqty3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mid_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mid_num = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mid_remain = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -70,10 +70,9 @@
             // 
             this.pi_inoutno_label.AutoSize = true;
             this.pi_inoutno_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_inoutno_label.Location = new System.Drawing.Point(50, 58);
-            this.pi_inoutno_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pi_inoutno_label.Location = new System.Drawing.Point(25, 29);
             this.pi_inoutno_label.Name = "pi_inoutno_label";
-            this.pi_inoutno_label.Size = new System.Drawing.Size(178, 41);
+            this.pi_inoutno_label.Size = new System.Drawing.Size(90, 21);
             this.pi_inoutno_label.TabIndex = 148;
             this.pi_inoutno_label.Text = "出入库单号";
             // 
@@ -81,10 +80,9 @@
             // 
             this.pi_class_label.AutoSize = true;
             this.pi_class_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_class_label.Location = new System.Drawing.Point(532, 58);
-            this.pi_class_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pi_class_label.Location = new System.Drawing.Point(286, 29);
             this.pi_class_label.Name = "pi_class_label";
-            this.pi_class_label.Size = new System.Drawing.Size(146, 41);
+            this.pi_class_label.Size = new System.Drawing.Size(74, 21);
             this.pi_class_label.TabIndex = 150;
             this.pi_class_label.Text = "单据类型";
             // 
@@ -92,20 +90,18 @@
             // 
             this.pi_class.AutoSize = true;
             this.pi_class.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pi_class.Location = new System.Drawing.Point(710, 58);
-            this.pi_class.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pi_class.Location = new System.Drawing.Point(375, 29);
             this.pi_class.Name = "pi_class";
-            this.pi_class.Size = new System.Drawing.Size(0, 41);
+            this.pi_class.Size = new System.Drawing.Size(0, 21);
             this.pi_class.TabIndex = 152;
             // 
             // pr_kind_label
             // 
             this.pr_kind_label.AutoSize = true;
             this.pr_kind_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_kind_label.Location = new System.Drawing.Point(952, 58);
-            this.pr_kind_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.pr_kind_label.Location = new System.Drawing.Point(501, 29);
             this.pr_kind_label.Name = "pr_kind_label";
-            this.pr_kind_label.Size = new System.Drawing.Size(146, 41);
+            this.pr_kind_label.Size = new System.Drawing.Size(74, 21);
             this.pr_kind_label.TabIndex = 156;
             this.pr_kind_label.Text = "物料类型";
             // 
@@ -117,30 +113,27 @@
             "单件管控",
             "批管控",
             "全部"});
-            this.pr_kind.Location = new System.Drawing.Point(1126, 60);
-            this.pr_kind.Margin = new System.Windows.Forms.Padding(6);
+            this.pr_kind.Location = new System.Drawing.Point(588, 30);
             this.pr_kind.Name = "pr_kind";
-            this.pr_kind.Size = new System.Drawing.Size(238, 32);
+            this.pr_kind.Size = new System.Drawing.Size(121, 20);
             this.pr_kind.TabIndex = 157;
             // 
             // MidCapacity_label
             // 
             this.MidCapacity_label.AutoSize = true;
             this.MidCapacity_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidCapacity_label.Location = new System.Drawing.Point(1406, 58);
-            this.MidCapacity_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
+            this.MidCapacity_label.Location = new System.Drawing.Point(754, 29);
             this.MidCapacity_label.Name = "MidCapacity_label";
-            this.MidCapacity_label.Size = new System.Drawing.Size(146, 41);
+            this.MidCapacity_label.Size = new System.Drawing.Size(74, 21);
             this.MidCapacity_label.TabIndex = 158;
             this.MidCapacity_label.Text = "中盘容量";
             // 
             // SetMidCapacity
             // 
             this.SetMidCapacity.Image = ((System.Drawing.Image)(resources.GetObject("SetMidCapacity.Image")));
-            this.SetMidCapacity.Location = new System.Drawing.Point(1822, 56);
-            this.SetMidCapacity.Margin = new System.Windows.Forms.Padding(6);
+            this.SetMidCapacity.Location = new System.Drawing.Point(962, 28);
             this.SetMidCapacity.Name = "SetMidCapacity";
-            this.SetMidCapacity.Size = new System.Drawing.Size(100, 46);
+            this.SetMidCapacity.Size = new System.Drawing.Size(50, 23);
             this.SetMidCapacity.TabIndex = 160;
             this.SetMidCapacity.Text = "刷新";
             this.SetMidCapacity.UseVisualStyleBackColor = true;
@@ -148,19 +141,17 @@
             // 
             // MidCapacity
             // 
-            this.MidCapacity.Location = new System.Drawing.Point(1574, 58);
-            this.MidCapacity.Margin = new System.Windows.Forms.Padding(6);
+            this.MidCapacity.Location = new System.Drawing.Point(838, 29);
             this.MidCapacity.Name = "MidCapacity";
             this.MidCapacity.Negative = false;
-            this.MidCapacity.Size = new System.Drawing.Size(238, 35);
+            this.MidCapacity.Size = new System.Drawing.Size(121, 21);
             this.MidCapacity.TabIndex = 159;
             // 
             // ChooseAll
             // 
-            this.ChooseAll.Location = new System.Drawing.Point(2, 204);
-            this.ChooseAll.Margin = new System.Windows.Forms.Padding(6);
+            this.ChooseAll.Location = new System.Drawing.Point(1, 102);
             this.ChooseAll.Name = "ChooseAll";
-            this.ChooseAll.Size = new System.Drawing.Size(92, 46);
+            this.ChooseAll.Size = new System.Drawing.Size(46, 23);
             this.ChooseAll.TabIndex = 155;
             this.ChooseAll.Text = "全选";
             this.ChooseAll.UseVisualStyleBackColor = true;
@@ -168,10 +159,9 @@
             // GenerateBarCode
             // 
             this.GenerateBarCode.Image = ((System.Drawing.Image)(resources.GetObject("GenerateBarCode.Image")));
-            this.GenerateBarCode.Location = new System.Drawing.Point(884, 156);
-            this.GenerateBarCode.Margin = new System.Windows.Forms.Padding(6);
+            this.GenerateBarCode.Location = new System.Drawing.Point(517, 78);
             this.GenerateBarCode.Name = "GenerateBarCode";
-            this.GenerateBarCode.Size = new System.Drawing.Size(128, 48);
+            this.GenerateBarCode.Size = new System.Drawing.Size(64, 24);
             this.GenerateBarCode.TabIndex = 154;
             this.GenerateBarCode.Text = "生成条码";
             this.GenerateBarCode.UseVisualStyleBackColor = true;
@@ -180,10 +170,9 @@
             // Screen
             // 
             this.Screen.Image = ((System.Drawing.Image)(resources.GetObject("Screen.Image")));
-            this.Screen.Location = new System.Drawing.Point(708, 156);
-            this.Screen.Margin = new System.Windows.Forms.Padding(6);
+            this.Screen.Location = new System.Drawing.Point(429, 78);
             this.Screen.Name = "Screen";
-            this.Screen.Size = new System.Drawing.Size(128, 48);
+            this.Screen.Size = new System.Drawing.Size(64, 24);
             this.Screen.TabIndex = 153;
             this.Screen.Text = "筛选";
             this.Screen.UseVisualStyleBackColor = true;
@@ -211,19 +200,18 @@
             this.pr_unit,
             this.pd_totalqty,
             this.pd_qty,
-            this.pr_zxbzs,
             this.pib_restqty1,
             this.pib_restqty2,
             this.pib_restqty3,
+            this.pr_zxbzs,
             this.mid_qty,
             this.mid_num,
             this.mid_remain});
             this.ProdIoInfDGV.GridColor = System.Drawing.SystemColors.ButtonFace;
-            this.ProdIoInfDGV.Location = new System.Drawing.Point(0, 250);
-            this.ProdIoInfDGV.Margin = new System.Windows.Forms.Padding(6);
+            this.ProdIoInfDGV.Location = new System.Drawing.Point(0, 125);
             this.ProdIoInfDGV.Name = "ProdIoInfDGV";
             this.ProdIoInfDGV.RowTemplate.Height = 23;
-            this.ProdIoInfDGV.Size = new System.Drawing.Size(2400, 854);
+            this.ProdIoInfDGV.Size = new System.Drawing.Size(1163, 407);
             this.ProdIoInfDGV.TabIndex = 151;
             this.ProdIoInfDGV.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.ProdIoInfDGV_CellEndEdit);
             this.ProdIoInfDGV.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.ProdIoInfDGV_CellPainting);
@@ -231,10 +219,9 @@
             // pi_inoutno
             // 
             this.pi_inoutno.ID = null;
-            this.pi_inoutno.Location = new System.Drawing.Point(256, 58);
-            this.pi_inoutno.Margin = new System.Windows.Forms.Padding(6);
+            this.pi_inoutno.Location = new System.Drawing.Point(128, 29);
             this.pi_inoutno.Name = "pi_inoutno";
-            this.pi_inoutno.Size = new System.Drawing.Size(238, 35);
+            this.pi_inoutno.Size = new System.Drawing.Size(121, 21);
             this.pi_inoutno.Str = null;
             this.pi_inoutno.Str1 = null;
             this.pi_inoutno.Str2 = null;
@@ -245,10 +232,9 @@
             // ResetSerialNum
             // 
             this.ResetSerialNum.Image = ((System.Drawing.Image)(resources.GetObject("ResetSerialNum.Image")));
-            this.ResetSerialNum.Location = new System.Drawing.Point(1058, 156);
-            this.ResetSerialNum.Margin = new System.Windows.Forms.Padding(6);
+            this.ResetSerialNum.Location = new System.Drawing.Point(604, 78);
             this.ResetSerialNum.Name = "ResetSerialNum";
-            this.ResetSerialNum.Size = new System.Drawing.Size(128, 48);
+            this.ResetSerialNum.Size = new System.Drawing.Size(64, 24);
             this.ResetSerialNum.TabIndex = 161;
             this.ResetSerialNum.Text = "流水重置";
             this.ResetSerialNum.UseVisualStyleBackColor = true;
@@ -256,23 +242,27 @@
             // 
             // Choose
             // 
-            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.Choose.HeaderText = "勾选";
             this.Choose.Name = "Choose";
-            this.Choose.Width = 60;
+            this.Choose.Width = 35;
             // 
             // pd_orderdetno
             // 
+            this.pd_orderdetno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pd_orderdetno.DataPropertyName = "pd_orderdetno";
             this.pd_orderdetno.HeaderText = "pd_orderdetno";
             this.pd_orderdetno.Name = "pd_orderdetno";
             this.pd_orderdetno.Visible = false;
+            this.pd_orderdetno.Width = 108;
             // 
             // pd_pdno
             // 
+            this.pd_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pd_pdno.DataPropertyName = "pd_pdno";
             this.pd_pdno.HeaderText = "订单序号";
             this.pd_pdno.Name = "pd_pdno";
+            this.pd_pdno.Width = 78;
             // 
             // pr_id
             // 
@@ -290,106 +280,134 @@
             // 
             // pd_prodcode
             // 
+            this.pd_prodcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pd_prodcode.DataPropertyName = "pd_prodcode";
             this.pd_prodcode.HeaderText = "物料编号";
             this.pd_prodcode.Name = "pd_prodcode";
             this.pd_prodcode.ReadOnly = true;
+            this.pd_prodcode.Width = 78;
             // 
             // pr_detail
             // 
+            this.pr_detail.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pr_detail.DataPropertyName = "pr_detail";
             this.pr_detail.HeaderText = "物料名称";
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.ReadOnly = true;
+            this.pr_detail.Width = 78;
             // 
             // pd_ordercode
             // 
+            this.pd_ordercode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pd_ordercode.DataPropertyName = "pd_ordercode";
             this.pd_ordercode.HeaderText = "订单编号";
             this.pd_ordercode.Name = "pd_ordercode";
+            this.pd_ordercode.Width = 78;
             // 
             // pr_spec
             // 
+            this.pr_spec.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pr_spec.DataPropertyName = "pr_spec";
             this.pr_spec.HeaderText = "规格描述";
             this.pr_spec.Name = "pr_spec";
             this.pr_spec.ReadOnly = true;
+            this.pr_spec.Width = 78;
             // 
             // pr_brand
             // 
+            this.pr_brand.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pr_brand.DataPropertyName = "pr_brand";
             this.pr_brand.HeaderText = "品牌";
             this.pr_brand.Name = "pr_brand";
             this.pr_brand.ReadOnly = true;
-            this.pr_brand.Width = 80;
+            this.pr_brand.Width = 54;
             // 
             // pr_unit
             // 
+            this.pr_unit.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pr_unit.DataPropertyName = "pr_unit";
             this.pr_unit.HeaderText = "单位";
             this.pr_unit.Name = "pr_unit";
             this.pr_unit.ReadOnly = true;
-            this.pr_unit.Width = 80;
+            this.pr_unit.Width = 54;
             // 
             // pd_totalqty
             // 
+            this.pd_totalqty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pd_totalqty.DataPropertyName = "pd_totalqty";
             this.pd_totalqty.HeaderText = "总数";
             this.pd_totalqty.Name = "pd_totalqty";
             this.pd_totalqty.ReadOnly = true;
-            this.pd_totalqty.Width = 80;
+            this.pd_totalqty.Width = 54;
             // 
             // pd_qty
             // 
+            this.pd_qty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.pd_qty.DataPropertyName = "pd_qty";
             this.pd_qty.HeaderText = "本次数量";
             this.pd_qty.Name = "pd_qty";
-            // 
-            // pr_zxbzs
-            // 
-            this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
-            this.pr_zxbzs.HeaderText = "单盘数量";
-            this.pr_zxbzs.Name = "pr_zxbzs";
+            this.pd_qty.Width = 78;
             // 
             // pib_restqty1
             // 
+            this.pib_restqty1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pib_restqty1.DataPropertyName = "pib_restqty1";
             this.pib_restqty1.HeaderText = "尾数1";
             this.pib_restqty1.Name = "pib_restqty1";
+            this.pib_restqty1.Width = 60;
             // 
             // pib_restqty2
             // 
+            this.pib_restqty2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pib_restqty2.DataPropertyName = "pib_restqty2";
             this.pib_restqty2.HeaderText = "尾数2";
             this.pib_restqty2.Name = "pib_restqty2";
+            this.pib_restqty2.Width = 60;
             // 
             // pib_restqty3
             // 
+            this.pib_restqty3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pib_restqty3.DataPropertyName = "pib_restqty3";
             this.pib_restqty3.HeaderText = "尾数3";
             this.pib_restqty3.Name = "pib_restqty3";
+            this.pib_restqty3.Width = 60;
+            // 
+            // pr_zxbzs
+            // 
+            this.pr_zxbzs.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
+            this.pr_zxbzs.HeaderText = "单盘数量";
+            this.pr_zxbzs.Name = "pr_zxbzs";
+            this.pr_zxbzs.Width = 78;
             // 
             // mid_qty
             // 
-            this.mid_qty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.mid_qty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.mid_qty.HeaderText = "中盒容量(盘)";
             this.mid_qty.Name = "mid_qty";
-            this.mid_qty.Width = 140;
+            this.mid_qty.Width = 72;
             // 
             // mid_num
             // 
+            this.mid_num.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.mid_num.HeaderText = "中盒盘数";
             this.mid_num.Name = "mid_num";
             this.mid_num.ReadOnly = true;
+            this.mid_num.Width = 61;
             // 
             // mid_remain
             // 
+            this.mid_remain.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
             this.mid_remain.HeaderText = "中盒尾数";
             this.mid_remain.Name = "mid_remain";
             this.mid_remain.ReadOnly = true;
+            this.mid_remain.Width = 61;
             // 
             // 生成条码
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(2402, 1108);
+            this.ClientSize = new System.Drawing.Size(1164, 530);
             this.Controls.Add(this.ResetSerialNum);
             this.Controls.Add(this.SetMidCapacity);
             this.Controls.Add(this.MidCapacity);
@@ -404,7 +422,6 @@
             this.Controls.Add(this.pi_class_label);
             this.Controls.Add(this.pi_inoutno);
             this.Controls.Add(this.pi_inoutno_label);
-            this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "生成条码";
             this.Text = "生成条码";
             this.Load += new System.EventHandler(this.生成条码_Load);
@@ -444,10 +461,10 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_totalqty;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_qty;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_zxbzs;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_restqty1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_restqty2;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_restqty3;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_zxbzs;
         private System.Windows.Forms.DataGridViewTextBoxColumn mid_qty;
         private System.Windows.Forms.DataGridViewTextBoxColumn mid_num;
         private System.Windows.Forms.DataGridViewTextBoxColumn mid_remain;

+ 73 - 15
UAS-出货标签管理(吉利通)/生成条码.cs

@@ -220,6 +220,36 @@ namespace UAS_LabelMachine
                     ArrayList<string> midcode = new ArrayList<string>();
                     ArrayList<string> barcode = new ArrayList<string>();
                     ArrayList<string> custbarcode = new ArrayList<string>();
+                    int restqty1 = 0;
+                    int restqty2 = 0;
+                    int restqty3 = 0;
+                    if (ProdIoInfDGV.Rows[i].Cells["pib_restqty1"].Value.ToString() != "0")
+                    {
+                        string mid_code = dh.getFieldDataByCondition("PRODIOBARCODE", "nvl(max(to_number(PIB_OUTBOXCODE1)),0)+1", "PIB_INOUTNO='" + pi_inoutno.Text + "'").ToString();
+                        int.TryParse(ProdIoInfDGV.Rows[i].Cells["pib_restqty1"].Value.ToString(), out restqty1);
+                        barcode.Add(BarcodeMethod1(pd_id, pr_id, pib_barcode));
+                        custbarcode.Add(BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix));
+                        midcode.Add(mid_code);
+                        pib_inqty.Add(restqty1.ToString());
+                    }
+                    if (ProdIoInfDGV.Rows[i].Cells["pib_restqty2"].Value.ToString() != "0")
+                    {
+                        string mid_code = dh.getFieldDataByCondition("PRODIOBARCODE", "nvl(max(to_number(PIB_OUTBOXCODE1)),0)+1", "PIB_INOUTNO='" + pi_inoutno.Text + "'").ToString();
+                        int.TryParse(ProdIoInfDGV.Rows[i].Cells["pib_restqty2"].Value.ToString(), out restqty2);
+                        barcode.Add(BarcodeMethod1(pd_id, pr_id, pib_barcode));
+                        custbarcode.Add(BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix));
+                        midcode.Add(mid_code);
+                        pib_inqty.Add(restqty2.ToString());
+                    }
+                    if (ProdIoInfDGV.Rows[i].Cells["pib_restqty3"].Value.ToString() != "0")
+                    {
+                        string mid_code = dh.getFieldDataByCondition("PRODIOBARCODE", "nvl(max(to_number(PIB_OUTBOXCODE1)),0)+1", "PIB_INOUTNO='" + pi_inoutno.Text + "'").ToString();
+                        int.TryParse(ProdIoInfDGV.Rows[i].Cells["pib_restqty3"].Value.ToString(), out restqty3);
+                        barcode.Add(BarcodeMethod1(pd_id, pr_id, pib_barcode));
+                        custbarcode.Add(BarcodeMethod1(PrefixFixed, Suffix, SerialNumIndex, SerialNumLength, Radix));
+                        midcode.Add(mid_code);
+                        pib_inqty.Add(restqty3.ToString());
+                    }
                     //循环中盒号的个数,取当前出入库单最大 的中盒号+1
                     for (int j = 0; j < mid_num; j++)
                     {
@@ -354,7 +384,7 @@ namespace UAS_LabelMachine
         {
             bool mouseOver = e.CellBounds.Contains(this.PointToClient(Cursor.Position));
             if (e.ColumnIndex > 0)
-                if (ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pr_zxbzs" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pd_qty" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "mid_qty")
+                if (ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pr_zxbzs" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pd_qty" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "mid_qty" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pib_restqty1" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pib_restqty2" || ProdIoInfDGV.Columns[e.ColumnIndex].Name == "pib_restqty3")
                 {
                     SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
                     e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.LightSeaGreen, e.CellBounds);
@@ -377,6 +407,21 @@ namespace UAS_LabelMachine
             object pd_qty = ProdIoInfDGV.Rows[e.RowIndex].Cells["pd_qty"].Value;
             object mid_qty = ProdIoInfDGV.Rows[e.RowIndex].Cells["mid_qty"].Value;
             object pd_totalqty = ProdIoInfDGV.Rows[e.RowIndex].Cells["pd_totalqty"].Value;
+            int restqty1 = 0;
+            int restqty2 = 0;
+            int restqty3 = 0;
+            if (ProdIoInfDGV.Rows[e.RowIndex].Cells["pib_restqty1"].Value.ToString() != "0")
+            {
+                int.TryParse(ProdIoInfDGV.Rows[e.RowIndex].Cells["pib_restqty1"].Value.ToString(), out restqty1);
+            }
+            if (ProdIoInfDGV.Rows[e.RowIndex].Cells["pib_restqty2"].Value.ToString() != "0")
+            {
+                int.TryParse(ProdIoInfDGV.Rows[e.RowIndex].Cells["pib_restqty2"].Value.ToString(), out restqty2);
+            }
+            if (ProdIoInfDGV.Rows[e.RowIndex].Cells["pib_restqty3"].Value.ToString() != "0")
+            {
+                int.TryParse(ProdIoInfDGV.Rows[e.RowIndex].Cells["pib_restqty3"].Value.ToString(), out restqty3);
+            }
             if (pr_zxbzs != null && pd_qty != null && mid_qty != null)
             {
                 int 最小包装量 = int.Parse(pr_zxbzs.ToString());
@@ -396,22 +441,37 @@ namespace UAS_LabelMachine
                         return;
                     }
                     //计算中盘数量
-                    int mid_num = 本次数量 / (最小包装量 * 中盘容量);
+                    int mid_num = (本次数量 - restqty1 - restqty2 - restqty3) / (最小包装量 * 中盘容量);
                     //计算中盘尾数
-                    if (本次数量 % (最小包装量 * 中盘容量) == 0)
+                    if (((本次数量 - restqty1 - restqty2 - restqty3)) % (最小包装量 * 中盘容量) == 0)
                         ProdIoInfDGV.Rows[e.RowIndex].Cells["mid_num"].Value = mid_num;
                     else
                         ProdIoInfDGV.Rows[e.RowIndex].Cells["mid_num"].Value = mid_num + 1;
-                    ProdIoInfDGV.Rows[e.RowIndex].Cells["mid_remain"].Value = 本次数量 - mid_num * 最小包装量 * 中盘容量;
+                    ProdIoInfDGV.Rows[e.RowIndex].Cells["mid_remain"].Value = 本次数量 - restqty1 - restqty2 - restqty3 - mid_num * 最小包装量 * 中盘容量;
                 }
             }
         }
-
+   
         //设置全部中盒容量
         private void SetMidCapacity_Click(object sender, EventArgs e)
         {
             for (int i = 0; i < ProdIoInfDGV.Rows.Count; i++)
             {
+                int restqty1 = 0;
+                int restqty2 = 0;
+                int restqty3 = 0;
+                if (ProdIoInfDGV.Rows[i].Cells["pib_restqty1"].Value.ToString() != "0")
+                {
+                    int.TryParse(ProdIoInfDGV.Rows[i].Cells["pib_restqty1"].Value.ToString(), out restqty1);
+                }
+                if (ProdIoInfDGV.Rows[i].Cells["pib_restqty2"].Value.ToString() != "0")
+                {
+                    int.TryParse(ProdIoInfDGV.Rows[i].Cells["pib_restqty2"].Value.ToString(), out restqty2);
+                }
+                if (ProdIoInfDGV.Rows[i].Cells["pib_restqty3"].Value.ToString() != "0")
+                {
+                    int.TryParse(ProdIoInfDGV.Rows[i].Cells["pib_restqty3"].Value.ToString(), out restqty3);
+                }
                 ProdIoInfDGV.Rows[i].Cells["mid_qty"].Value = MidCapacity.Text;
                 if (ProdIoInfDGV.Rows[i].Cells["pr_zxbzs"].Value.ToString() != "" && ProdIoInfDGV.Rows[i].Cells["pd_qty"].Value.ToString() != "" && ProdIoInfDGV.Rows[i].Cells["mid_qty"].Value.ToString() != "" && ProdIoInfDGV.Rows[i].Cells["pr_zxbzs"].Value.ToString() != "0")
                 {
@@ -426,13 +486,13 @@ namespace UAS_LabelMachine
                         int 本次数量 = int.Parse(pd_qty.ToString());
                         int 总数 = int.Parse(pd_totalqty.ToString());
                         //计算中盘数量
-                        int mid_num = 本次数量 / (最小包装量 * 中盘容量);
+                        int mid_num = (本次数量 - restqty1 - restqty2 - restqty3) / (最小包装量 * 中盘容量);
                         //计算中盘尾数
-                        if (本次数量 % (最小包装量 * 中盘容量) == 0)
+                        if (((本次数量 - restqty1 - restqty2 - restqty3)) % (最小包装量 * 中盘容量) == 0)
                             ProdIoInfDGV.Rows[i].Cells["mid_num"].Value = mid_num;
                         else
                             ProdIoInfDGV.Rows[i].Cells["mid_num"].Value = mid_num + 1;
-                        ProdIoInfDGV.Rows[i].Cells["mid_remain"].Value = 本次数量 - mid_num * 最小包装量 * 中盘容量;
+                        ProdIoInfDGV.Rows[i].Cells["mid_remain"].Value = (本次数量 - restqty1 - restqty2 - restqty3) - mid_num * 最小包装量 * 中盘容量;
                     }
                 }
             }
@@ -451,13 +511,11 @@ namespace UAS_LabelMachine
                 //查询出入库的类型
                 dt = (DataTable)dh.ExecuteSql("select ds_inorout from documentsetup where ds_name='" + pi_class.Text + "'", "select");
                 sql.Clear();
-                sql.Append("select pd_piid,pd_id,pr_id,pr_brand,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty pd_totalqty,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,pd_piclass,pd_qty from (select ");
-                sql.Append("pd_piid,pd_id,pr_id,pr_brand,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,pd_piclass,");
-                sql.Append("outqty-nvl((select sum(nvl(pib_qty,0)) from PRODIOBARCODE where PIB_PIID=pd_piid and pib_ordercode=pd_ordercode ");
-                sql.Append("and pib_orderdetno=pd_orderdetno),0)pd_qty from (select pd_piid,min(pd_id) pd_id,sum(pd_outqty)outqty,");
-                sql.Append("pd_ordercode,pd_orderdetno,pd_pdno,max(pd_prodcode)pd_prodcode,max(pd_piclass)pd_piclass ");
-                sql.Append("from prodiodetail where pd_piclass='出货单' group by pd_piid,pd_ordercode,pd_orderdetno,pd_pdno)T left join product on pr_code=pd_prodcode ");
-                sql.Append("where nvl(pr_zxbzs,0)>0)  where  pd_piid='" + pi_id + "'");
+                sql.Append("select 0 pib_restqty1,0 pib_restqty2,0 pib_restqty3,pd_piid,pd_id,pr_id,pr_brand,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty pd_totalqty,pd_ordercode,pd_orderdetno,pd_pdno, ");
+                sql.Append("pd_prodcode,pd_piclass,pd_qty from (select pd_piid,pd_id,pr_id,pr_brand,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,pd_piclass,");
+                sql.Append("outqty-nvl((select sum(nvl(pib_qty,0)) from PRODIOBARCODE where PIB_PIID=pd_piid and pib_pdno=pd_pdno),0)pd_qty from (select pd_piid,min(pd_id) pd_id,sum(pd_outqty)outqty, ");
+                sql.Append("pd_ordercode,pd_orderdetno,pd_pdno,max(pd_prodcode)pd_prodcode,max(pd_piclass)pd_piclass from prodiodetail where pd_piclass='出货单' group by pd_piid,pd_ordercode,pd_orderdetno,pd_pdno)T ");
+                sql.Append("left join product on pr_code=pd_prodcode where nvl(pr_zxbzs,0)>0)  where  pd_piid='" + pi_id + "'");
                 dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
                 BaseUtil.FillDgvWithDataTable(ProdIoInfDGV, dt);
             }

+ 3 - 3
UAS-出货标签管理(吉利通)/生成条码.resx

@@ -193,9 +193,6 @@
   <metadata name="pd_qty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pr_zxbzs.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="pib_restqty1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -205,6 +202,9 @@
   <metadata name="pib_restqty3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pr_zxbzs.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="mid_qty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>

Some files were not shown because too many files changed in this diff