From a4bdaf32034a6d831cde152eee53923b3e25021f Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Wed, 29 May 2019 18:42:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E5=94=AE=E5=A4=87=E8=B4=A7=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=8C=89=E5=AE=A2=E6=88=B7=E5=A4=87=E8=B4=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ButcherFactory.BO/Bill/StockUpEntity.cs | 20 +- ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs | 2 +- .../ButcherFactory.Form.csproj | 10 + .../SegmentStockUp_/SegmentStockUpConfig.cs | 13 + .../SegmentStockUpForm.Designer.cs | 321 +++++++++++------- .../SegmentStockUp_/SegmentStockUpForm.cs | 105 ++++-- .../SegmentStockUp_/SegmentStockUpForm.resx | 40 +-- .../SelectCustomerDialog.Designer.cs | 122 +++++++ .../SegmentStockUp_/SelectCustomerDialog.cs | 68 ++++ .../SegmentStockUp_/SelectCustomerDialog.resx | 120 +++++++ 10 files changed, 633 insertions(+), 188 deletions(-) create mode 100644 ButcherFactory.Form/SegmentStockUp_/SegmentStockUpConfig.cs create mode 100644 ButcherFactory.Form/SegmentStockUp_/SelectCustomerDialog.Designer.cs create mode 100644 ButcherFactory.Form/SegmentStockUp_/SelectCustomerDialog.cs create mode 100644 ButcherFactory.Form/SegmentStockUp_/SelectCustomerDialog.resx diff --git a/ButcherFactory.BO/Bill/StockUpEntity.cs b/ButcherFactory.BO/Bill/StockUpEntity.cs index a935512..c7c1262 100644 --- a/ButcherFactory.BO/Bill/StockUpEntity.cs +++ b/ButcherFactory.BO/Bill/StockUpEntity.cs @@ -25,15 +25,17 @@ namespace ButcherFactory.BO [DbColumn(DefaultValue = 0)] public bool StandardPic { get; set; } public bool Finishd - { - get + { + get { - if (StandardPic) - return (UnitNum ?? 0) <= (SUnitNum ?? 0); - return (SecondNumber ?? 0) <= (SSecondNumber ?? 0); + //if (StandardPic) + return (UnitNum ?? 0) <= (SUnitNum ?? 0) + (DownFloat ?? 0); + //return (SecondNumber ?? 0) <= (SSecondNumber ?? 0); } } - public long? SendQueue { get; set; } + public long? SendQueue { get; set; } + + public decimal? DownFloat { get; set; } } [KeyField("ID", KeyGenType.identity)] @@ -72,7 +74,9 @@ namespace ButcherFactory.BO public string Goods_Name { get; set; } - public string DeliverGoodsLine_Name { get; set; } + public string DeliverGoodsLine_Name { get; set; } + + public string Customer_Name { get; set; } [NonDmoProperty] public long BillID { get; set; } @@ -83,7 +87,7 @@ namespace ButcherFactory.BO public int State { get; set; } public long DetailID { get; set; } public long MaxID { get; set; } - public bool StandardPic { get; set; } + //public bool StandardPic { get; set; } public decimal? UnitNum { get; set; } public decimal? SecondNumber { get; set; } } diff --git a/ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs b/ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs index 25c03d1..02432cd 100644 --- a/ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentStockUpBL.cs @@ -70,7 +70,7 @@ namespace ButcherFactory.BO.LocalBL { try { - var json = JsonConvert.SerializeObject(new { DetailID = detail.DetailID, StandardPic = detail.StandardPic, BarCode = detail.BarCode, SecondNumber = detail.SecondNumber, UnitNumber = detail.UnitNumber }); + var json = JsonConvert.SerializeObject(new { DetailID = detail.DetailID, StandardPic = detail.StandardPic, BarCode = detail.BarCode, SecondNumber = detail.SecondNumber, UnitNumber = detail.UnitNumber }); var r = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/InsertStockUpDetail", json, JsonConvert.SerializeObject(already), totalNumber); var outSide = JsonConvert.DeserializeObject(r); if (outSide.State == 1) diff --git a/ButcherFactory.Form/ButcherFactory.Form.csproj b/ButcherFactory.Form/ButcherFactory.Form.csproj index 77741a9..e3269e5 100644 --- a/ButcherFactory.Form/ButcherFactory.Form.csproj +++ b/ButcherFactory.Form/ButcherFactory.Form.csproj @@ -270,6 +270,7 @@ WeightRecordDialog.cs + Form @@ -277,6 +278,12 @@ SegmentStockUpForm.cs + + Form + + + SelectCustomerDialog.cs + @@ -398,6 +405,9 @@ SegmentStockUpForm.cs + + SelectCustomerDialog.cs + DiscontWeightSetDialog.cs diff --git a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpConfig.cs b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpConfig.cs new file mode 100644 index 0000000..5bae73c --- /dev/null +++ b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpConfig.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ButcherFactory.SegmentStockUp_ +{ + public class SegmentStockUpConfig + { + public decimal? AllowDownWeight { get; set; } + } +} diff --git a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs index d468581..b5aa837 100644 --- a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs +++ b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.Designer.cs @@ -28,25 +28,25 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle(); this.uScanPanel1 = new WinFormControl.UScanPanel(); this.panel4 = new System.Windows.Forms.Panel(); this.goodsLbl = new System.Windows.Forms.Label(); @@ -56,7 +56,7 @@ this.panel5 = new System.Windows.Forms.Panel(); this.mainGridView = new WinFormControl.UDataGridView(); this.D_Finishd = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.D_DeliverGoodsLine_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.D_Customer_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.D_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.D_Goods_Spec = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.D_SecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -74,7 +74,7 @@ this.F_SSecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.label13 = new System.Windows.Forms.Label(); this.detailGridView = new WinFormControl.UDataGridView(); - this.B_DeliverGoodsLine_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.B_Customer_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.B_ShortCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.B_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.B_SaleOutStoreID = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -87,9 +87,13 @@ this.bhNumberLbl = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.panel7 = new System.Windows.Forms.Panel(); + this.colorButton1 = new ButcherFactory.Controls.ColorButton(); this.printCk = new System.Windows.Forms.CheckBox(); this.refresh = new ButcherFactory.Controls.ColorButton(); - this.colorButton1 = new ButcherFactory.Controls.ColorButton(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.downWeightBox = new System.Windows.Forms.Label(); this.roundPanel1.SuspendLayout(); this.panel5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.mainGridView)).BeginInit(); @@ -101,6 +105,10 @@ // // roundPanel1 // + this.roundPanel1.Controls.Add(this.downWeightBox); + this.roundPanel1.Controls.Add(this.label5); + this.roundPanel1.Controls.Add(this.label2); + this.roundPanel1.Controls.Add(this.label1); this.roundPanel1.Controls.Add(this.panel7); this.roundPanel1.Controls.Add(this.bhUnitNumLbl); this.roundPanel1.Controls.Add(this.label9); @@ -197,8 +205,8 @@ this.mainGridView.AllowUserToDeleteRows = false; this.mainGridView.AllowUserToResizeColumns = false; this.mainGridView.AllowUserToResizeRows = false; - dataGridViewCellStyle13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(217)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); - this.mainGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle13; + dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(217)))), ((int)(((byte)(238)))), ((int)(((byte)(255))))); + this.mainGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle20; this.mainGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); @@ -206,17 +214,17 @@ this.mainGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; this.mainGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.mainGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); - dataGridViewCellStyle14.Font = new System.Drawing.Font("宋体", 10F); - dataGridViewCellStyle14.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.mainGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle14; + dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle21.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + dataGridViewCellStyle21.Font = new System.Drawing.Font("宋体", 10F); + dataGridViewCellStyle21.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.mainGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle21; this.mainGridView.ColumnHeadersHeight = 30; this.mainGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.mainGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.D_Finishd, - this.D_DeliverGoodsLine_Name, + this.D_Customer_Name, this.D_Goods_Name, this.D_Goods_Spec, this.D_SecondNumber, @@ -229,10 +237,10 @@ this.mainGridView.Name = "mainGridView"; this.mainGridView.ReadOnly = true; this.mainGridView.RowHeadersVisible = false; - dataGridViewCellStyle19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(243)))), ((int)(((byte)(250))))); - dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 9F); - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); - this.mainGridView.RowsDefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle26.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(243)))), ((int)(((byte)(250))))); + dataGridViewCellStyle26.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle26.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.mainGridView.RowsDefaultCellStyle = dataGridViewCellStyle26; this.mainGridView.RowTemplate.Height = 40; this.mainGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.mainGridView.Size = new System.Drawing.Size(545, 320); @@ -248,14 +256,14 @@ this.D_Finishd.ReadOnly = true; this.D_Finishd.Visible = false; // - // D_DeliverGoodsLine_Name + // D_Customer_Name // - this.D_DeliverGoodsLine_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.D_DeliverGoodsLine_Name.DataPropertyName = "DeliverGoodsLine_Name"; - this.D_DeliverGoodsLine_Name.HeaderText = "线路名称"; - this.D_DeliverGoodsLine_Name.MinimumWidth = 100; - this.D_DeliverGoodsLine_Name.Name = "D_DeliverGoodsLine_Name"; - this.D_DeliverGoodsLine_Name.ReadOnly = true; + this.D_Customer_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.D_Customer_Name.DataPropertyName = "Customer_Name"; + this.D_Customer_Name.HeaderText = "客户"; + this.D_Customer_Name.MinimumWidth = 100; + this.D_Customer_Name.Name = "D_Customer_Name"; + this.D_Customer_Name.ReadOnly = true; // // D_Goods_Name // @@ -278,8 +286,8 @@ // D_SecondNumber // this.D_SecondNumber.DataPropertyName = "SecondNumber"; - dataGridViewCellStyle15.Format = "#0.######"; - this.D_SecondNumber.DefaultCellStyle = dataGridViewCellStyle15; + dataGridViewCellStyle22.Format = "#0.######"; + this.D_SecondNumber.DefaultCellStyle = dataGridViewCellStyle22; this.D_SecondNumber.HeaderText = "订货数量"; this.D_SecondNumber.Name = "D_SecondNumber"; this.D_SecondNumber.ReadOnly = true; @@ -288,8 +296,8 @@ // D_UnitNum // this.D_UnitNum.DataPropertyName = "UnitNum"; - dataGridViewCellStyle16.Format = "#0.######"; - this.D_UnitNum.DefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle23.Format = "#0.######"; + this.D_UnitNum.DefaultCellStyle = dataGridViewCellStyle23; this.D_UnitNum.HeaderText = "订货重量"; this.D_UnitNum.Name = "D_UnitNum"; this.D_UnitNum.ReadOnly = true; @@ -298,8 +306,8 @@ // D_SSecondNumber // this.D_SSecondNumber.DataPropertyName = "SSecondNumber"; - dataGridViewCellStyle17.Format = "#0.######"; - this.D_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle24.Format = "#0.######"; + this.D_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle24; this.D_SSecondNumber.HeaderText = "备货数量"; this.D_SSecondNumber.Name = "D_SSecondNumber"; this.D_SSecondNumber.ReadOnly = true; @@ -308,8 +316,8 @@ // D_SUnitNum // this.D_SUnitNum.DataPropertyName = "SUnitNum"; - dataGridViewCellStyle18.Format = "#0.######"; - this.D_SUnitNum.DefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle25.Format = "#0.######"; + this.D_SUnitNum.DefaultCellStyle = dataGridViewCellStyle25; this.D_SUnitNum.HeaderText = "备货重量"; this.D_SUnitNum.Name = "D_SUnitNum"; this.D_SUnitNum.ReadOnly = true; @@ -345,8 +353,8 @@ this.finishGrid.AllowUserToDeleteRows = false; this.finishGrid.AllowUserToResizeColumns = false; this.finishGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(228)))), ((int)(((byte)(203))))); - this.finishGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle27.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(228)))), ((int)(((byte)(203))))); + this.finishGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle27; this.finishGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); @@ -354,12 +362,12 @@ this.finishGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; this.finishGrid.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.finishGrid.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(129)))), ((int)(((byte)(213)))), ((int)(((byte)(68))))); - dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 10F); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.finishGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle28.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle28.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(129)))), ((int)(((byte)(213)))), ((int)(((byte)(68))))); + dataGridViewCellStyle28.Font = new System.Drawing.Font("宋体", 10F); + dataGridViewCellStyle28.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle28.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.finishGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle28; this.finishGrid.ColumnHeadersHeight = 30; this.finishGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.finishGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { @@ -375,10 +383,10 @@ this.finishGrid.Name = "finishGrid"; this.finishGrid.ReadOnly = true; this.finishGrid.RowHeadersVisible = false; - dataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(247)))), ((int)(((byte)(240))))); - dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 10F); - dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(129)))), ((int)(((byte)(213)))), ((int)(((byte)(68))))); - this.finishGrid.RowsDefaultCellStyle = dataGridViewCellStyle7; + dataGridViewCellStyle33.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(247)))), ((int)(((byte)(240))))); + dataGridViewCellStyle33.Font = new System.Drawing.Font("宋体", 10F); + dataGridViewCellStyle33.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(129)))), ((int)(((byte)(213)))), ((int)(((byte)(68))))); + this.finishGrid.RowsDefaultCellStyle = dataGridViewCellStyle33; this.finishGrid.RowTemplate.Height = 40; this.finishGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.finishGrid.Size = new System.Drawing.Size(580, 37); @@ -396,7 +404,7 @@ // this.F_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.F_Name.DataPropertyName = "Name"; - this.F_Name.HeaderText = "线路名称"; + this.F_Name.HeaderText = "客户"; this.F_Name.MinimumWidth = 100; this.F_Name.Name = "F_Name"; this.F_Name.ReadOnly = true; @@ -404,8 +412,8 @@ // F_UnitNum // this.F_UnitNum.DataPropertyName = "UnitNum"; - dataGridViewCellStyle3.Format = "#0.######"; - this.F_UnitNum.DefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle29.Format = "#0.######"; + this.F_UnitNum.DefaultCellStyle = dataGridViewCellStyle29; this.F_UnitNum.HeaderText = "订货重量"; this.F_UnitNum.Name = "F_UnitNum"; this.F_UnitNum.ReadOnly = true; @@ -413,8 +421,8 @@ // F_SecondNumber // this.F_SecondNumber.DataPropertyName = "SecondNumber"; - dataGridViewCellStyle4.Format = "#0.######"; - this.F_SecondNumber.DefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle30.Format = "#0.######"; + this.F_SecondNumber.DefaultCellStyle = dataGridViewCellStyle30; this.F_SecondNumber.HeaderText = "订货数量"; this.F_SecondNumber.Name = "F_SecondNumber"; this.F_SecondNumber.ReadOnly = true; @@ -422,8 +430,8 @@ // F_SUnitNum // this.F_SUnitNum.DataPropertyName = "SUnitNum"; - dataGridViewCellStyle5.Format = "#0.######"; - this.F_SUnitNum.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle31.Format = "#0.######"; + this.F_SUnitNum.DefaultCellStyle = dataGridViewCellStyle31; this.F_SUnitNum.HeaderText = "备货重量"; this.F_SUnitNum.Name = "F_SUnitNum"; this.F_SUnitNum.ReadOnly = true; @@ -431,8 +439,8 @@ // F_SSecondNumber // this.F_SSecondNumber.DataPropertyName = "SSecondNumber"; - dataGridViewCellStyle6.Format = "#0.######"; - this.F_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle32.Format = "#0.######"; + this.F_SSecondNumber.DefaultCellStyle = dataGridViewCellStyle32; this.F_SSecondNumber.HeaderText = "备货数量"; this.F_SSecondNumber.Name = "F_SSecondNumber"; this.F_SSecondNumber.ReadOnly = true; @@ -454,24 +462,24 @@ this.detailGridView.AllowUserToDeleteRows = false; this.detailGridView.AllowUserToResizeColumns = false; this.detailGridView.AllowUserToResizeRows = false; - dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(228)))), ((int)(((byte)(203))))); - this.detailGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle34.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(228)))), ((int)(((byte)(203))))); + this.detailGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle34; this.detailGridView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.detailGridView.BackgroundColor = System.Drawing.Color.White; this.detailGridView.BorderStyle = System.Windows.Forms.BorderStyle.None; this.detailGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.detailGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; - dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(148)))), ((int)(((byte)(74))))); - dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 10F); - dataGridViewCellStyle9.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.detailGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle9; + dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle35.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(148)))), ((int)(((byte)(74))))); + dataGridViewCellStyle35.Font = new System.Drawing.Font("宋体", 10F); + dataGridViewCellStyle35.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle35.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.detailGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle35; this.detailGridView.ColumnHeadersHeight = 30; this.detailGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.detailGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.B_DeliverGoodsLine_Name, + this.B_Customer_Name, this.B_ShortCode, this.B_Goods_Name, this.B_SaleOutStoreID, @@ -483,23 +491,23 @@ this.detailGridView.Name = "detailGridView"; this.detailGridView.ReadOnly = true; this.detailGridView.RowHeadersVisible = false; - dataGridViewCellStyle12.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(247)))), ((int)(((byte)(240))))); - dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 10F); - dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(148)))), ((int)(((byte)(74))))); - this.detailGridView.RowsDefaultCellStyle = dataGridViewCellStyle12; + dataGridViewCellStyle38.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(247)))), ((int)(((byte)(240))))); + dataGridViewCellStyle38.Font = new System.Drawing.Font("宋体", 10F); + dataGridViewCellStyle38.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(148)))), ((int)(((byte)(74))))); + this.detailGridView.RowsDefaultCellStyle = dataGridViewCellStyle38; this.detailGridView.RowTemplate.Height = 40; this.detailGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.detailGridView.Size = new System.Drawing.Size(580, 268); this.detailGridView.TabIndex = 6; // - // B_DeliverGoodsLine_Name + // B_Customer_Name // - this.B_DeliverGoodsLine_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.B_DeliverGoodsLine_Name.DataPropertyName = "DeliverGoodsLine_Name"; - this.B_DeliverGoodsLine_Name.HeaderText = "线路名称"; - this.B_DeliverGoodsLine_Name.MinimumWidth = 100; - this.B_DeliverGoodsLine_Name.Name = "B_DeliverGoodsLine_Name"; - this.B_DeliverGoodsLine_Name.ReadOnly = true; + this.B_Customer_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.B_Customer_Name.DataPropertyName = "Customer_Name"; + this.B_Customer_Name.HeaderText = "客户"; + this.B_Customer_Name.MinimumWidth = 100; + this.B_Customer_Name.Name = "B_Customer_Name"; + this.B_Customer_Name.ReadOnly = true; // // B_ShortCode // @@ -530,8 +538,8 @@ // B_SecondNumber // this.B_SecondNumber.DataPropertyName = "SecondNumber"; - dataGridViewCellStyle10.Format = "#0.######"; - this.B_SecondNumber.DefaultCellStyle = dataGridViewCellStyle10; + dataGridViewCellStyle36.Format = "#0.######"; + this.B_SecondNumber.DefaultCellStyle = dataGridViewCellStyle36; this.B_SecondNumber.HeaderText = "数量"; this.B_SecondNumber.Name = "B_SecondNumber"; this.B_SecondNumber.ReadOnly = true; @@ -540,8 +548,8 @@ // B_UnitNumber // this.B_UnitNumber.DataPropertyName = "UnitNumber"; - dataGridViewCellStyle11.Format = "#0.######"; - this.B_UnitNumber.DefaultCellStyle = dataGridViewCellStyle11; + dataGridViewCellStyle37.Format = "#0.######"; + this.B_UnitNumber.DefaultCellStyle = dataGridViewCellStyle37; this.B_UnitNumber.HeaderText = "重量"; this.B_UnitNumber.Name = "B_UnitNumber"; this.B_UnitNumber.ReadOnly = true; @@ -621,6 +629,19 @@ this.panel7.Size = new System.Drawing.Size(346, 44); this.panel7.TabIndex = 20; // + // colorButton1 + // + this.colorButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.colorButton1.ForeColor = System.Drawing.Color.White; + this.colorButton1.Location = new System.Drawing.Point(136, 5); + this.colorButton1.Name = "colorButton1"; + this.colorButton1.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); + this.colorButton1.Size = new System.Drawing.Size(75, 35); + this.colorButton1.TabIndex = 2; + this.colorButton1.Text = "打印测试"; + this.colorButton1.UseVisualStyleBackColor = false; + this.colorButton1.Click += new System.EventHandler(this.colorButton1_Click); + // // printCk // this.printCk.AutoSize = true; @@ -645,18 +666,54 @@ this.refresh.UseVisualStyleBackColor = false; this.refresh.Click += new System.EventHandler(this.refresh_Click); // - // colorButton1 - // - this.colorButton1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); - this.colorButton1.ForeColor = System.Drawing.Color.White; - this.colorButton1.Location = new System.Drawing.Point(136, 5); - this.colorButton1.Name = "colorButton1"; - this.colorButton1.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); - this.colorButton1.Size = new System.Drawing.Size(75, 35); - this.colorButton1.TabIndex = 2; - this.colorButton1.Text = "打印测试"; - this.colorButton1.UseVisualStyleBackColor = false; - this.colorButton1.Click += new System.EventHandler(this.colorButton1_Click); + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("宋体", 14F); + this.label1.Location = new System.Drawing.Point(378, 18); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(104, 19); + this.label1.TabIndex = 21; + this.label1.Text = "选择客户:"; + // + // label2 + // + this.label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.label2.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.label2.Font = new System.Drawing.Font("宋体", 14F); + this.label2.ForeColor = System.Drawing.Color.Red; + this.label2.Location = new System.Drawing.Point(475, 11); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(332, 32); + this.label2.TabIndex = 22; + this.label2.Text = "请选择"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label2.Click += new System.EventHandler(this.label2_Click); + // + // label5 + // + this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("宋体", 14F); + this.label5.ForeColor = System.Drawing.Color.Blue; + this.label5.Location = new System.Drawing.Point(978, 100); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(104, 19); + this.label5.TabIndex = 23; + this.label5.Text = "下浮重量:"; + // + // downWeightBox + // + this.downWeightBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.downWeightBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.downWeightBox.Font = new System.Drawing.Font("宋体", 14F); + this.downWeightBox.ForeColor = System.Drawing.Color.Red; + this.downWeightBox.Location = new System.Drawing.Point(1075, 94); + this.downWeightBox.Name = "downWeightBox"; + this.downWeightBox.Size = new System.Drawing.Size(102, 30); + this.downWeightBox.TabIndex = 24; + this.downWeightBox.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.downWeightBox.Click += new System.EventHandler(this.downWeightBox_Click); // // SegmentStockUpForm // @@ -704,29 +761,33 @@ private System.Windows.Forms.Label dhUnitNumLbl; private System.Windows.Forms.Label label7; private System.Windows.Forms.Panel panel7; - private Controls.ColorButton refresh; - private System.Windows.Forms.CheckBox printCk; - private System.Windows.Forms.DataGridViewTextBoxColumn D_Finishd; - private System.Windows.Forms.DataGridViewTextBoxColumn D_DeliverGoodsLine_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn D_Goods_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn D_Goods_Spec; - private System.Windows.Forms.DataGridViewTextBoxColumn D_SecondNumber; - private System.Windows.Forms.DataGridViewTextBoxColumn D_UnitNum; - private System.Windows.Forms.DataGridViewTextBoxColumn D_SSecondNumber; - private System.Windows.Forms.DataGridViewTextBoxColumn D_SUnitNum; - private WinFormControl.UDataGridView finishGrid; - private System.Windows.Forms.DataGridViewTextBoxColumn F_RowIndex; - private System.Windows.Forms.DataGridViewTextBoxColumn F_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn F_UnitNum; - private System.Windows.Forms.DataGridViewTextBoxColumn F_SecondNumber; - private System.Windows.Forms.DataGridViewTextBoxColumn F_SUnitNum; - private System.Windows.Forms.DataGridViewTextBoxColumn F_SSecondNumber; - private System.Windows.Forms.DataGridViewTextBoxColumn B_DeliverGoodsLine_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn B_ShortCode; - private System.Windows.Forms.DataGridViewTextBoxColumn B_Goods_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn B_SaleOutStoreID; - private System.Windows.Forms.DataGridViewTextBoxColumn B_SecondNumber; + private Controls.ColorButton refresh; + private System.Windows.Forms.CheckBox printCk; + private WinFormControl.UDataGridView finishGrid; + private Controls.ColorButton colorButton1; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Finishd; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Customer_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Goods_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn D_Goods_Spec; + private System.Windows.Forms.DataGridViewTextBoxColumn D_SecondNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn D_UnitNum; + private System.Windows.Forms.DataGridViewTextBoxColumn D_SSecondNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn D_SUnitNum; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.DataGridViewTextBoxColumn B_Customer_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn B_ShortCode; + private System.Windows.Forms.DataGridViewTextBoxColumn B_Goods_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn B_SaleOutStoreID; + private System.Windows.Forms.DataGridViewTextBoxColumn B_SecondNumber; private System.Windows.Forms.DataGridViewTextBoxColumn B_UnitNumber; - private Controls.ColorButton colorButton1; + private System.Windows.Forms.DataGridViewTextBoxColumn F_RowIndex; + private System.Windows.Forms.DataGridViewTextBoxColumn F_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn F_UnitNum; + private System.Windows.Forms.DataGridViewTextBoxColumn F_SecondNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn F_SUnitNum; + private System.Windows.Forms.DataGridViewTextBoxColumn F_SSecondNumber; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label downWeightBox; } } \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs index cb2d2a6..febd77b 100644 --- a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs +++ b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.cs @@ -12,7 +12,8 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; -using System.Windows.Forms; +using System.Windows.Forms; +using WinFormControl; namespace ButcherFactory.SegmentStockUp_ { @@ -28,9 +29,12 @@ namespace ButcherFactory.SegmentStockUp_ { return this; } - #endregion + #endregion + + Tuple selectedCustomer; - DateTime sendTime = DateTime.Today; + DateTime sendTime = DateTime.Today; + SegmentStockUpConfig config; BindingList mainList; BindingList detailList; @@ -45,7 +49,8 @@ namespace ButcherFactory.SegmentStockUp_ Thread loadBindTask;//onetime public SegmentStockUpForm() - { + { + config = XmlUtil.DeserializeFromFile(); InitializeComponent(); finishList = new BindingList(); allMain = new List(); @@ -70,7 +75,8 @@ namespace ButcherFactory.SegmentStockUp_ } protected override void OnLoad(EventArgs e) - { + { + downWeightBox.Text = string.Format("{0:#0.######}", config.AllowDownWeight); StartTask(); base.OnLoad(e); } @@ -145,10 +151,11 @@ namespace ButcherFactory.SegmentStockUp_ { var mainFirst = allMain.FirstOrDefault(x => x.DetailID == item.DetailID); if (mainFirst != null) - { - mainFirst.StandardPic = item.StandardPic; + { + mainFirst.StandardPic = false;// item.StandardPic; mainFirst.SUnitNum = item.UnitNum; - mainFirst.SSecondNumber = item.SecondNumber; + mainFirst.SSecondNumber = item.SecondNumber; + mainFirst.DownFloat = config.AllowDownWeight; } } @@ -159,7 +166,7 @@ namespace ButcherFactory.SegmentStockUp_ var append = new List(); finishList = new BindingList(); var idx = 0; - foreach (var item in allMain.GroupBy(x => x.DeliverGoodsLine_Name).Where(x => x.All(y => y.Finishd))) + foreach (var item in allMain.GroupBy(x => x.Customer_Name).Where(x => x.All(y => y.Finishd))) { var detail = new DeliverGoodsLineTemp(); detail.RowIndex = ++idx; @@ -256,8 +263,12 @@ namespace ButcherFactory.SegmentStockUp_ } void InsertDetail(Tuple scan) - { - var saleOutStore = allMain.FirstOrDefault(x => !x.Finishd && x.Goods_Code == scan.Item1); + { + SaleOutStoreInfo saleOutStore; + if (selectedCustomer != null) + saleOutStore = allMain.FirstOrDefault(x => x.Customer_Name == selectedCustomer.Item1 && !x.Finishd && x.Goods_Code == scan.Item1); + else + saleOutStore = allMain.FirstOrDefault(x => !x.Finishd && x.Goods_Code == scan.Item1); if (saleOutStore == null) { InfoBox.Show("提示", "没有订单", Color.Red, 1, this); @@ -269,20 +280,21 @@ namespace ButcherFactory.SegmentStockUp_ detail.DetailID = saleOutStore.DetailID; detail.DeliverGoodsLine_Name = saleOutStore.DeliverGoodsLine_Name; detail.Goods_Name = saleOutStore.Goods_Name; - //detail.BillID = saleOutStore.BillID; + //detail.BillID = saleOutStore.BillID; + detail.Customer_Name = saleOutStore.Customer_Name; detail.UnitNumber = scan.Item2; detail.StandardPic = scan.Item3; if (detail.UnitNumber.HasValue && saleOutStore.Rate.HasValue) detail.SecondNumber = detail.UnitNumber * saleOutStore.Rate; else - detail.SecondNumber = 1; - var number =saleOutStore.UnitNum ; - if (!detail.StandardPic) - number = saleOutStore.SecondNumber; + detail.SecondNumber = 1; + var number = saleOutStore.UnitNum - (config.AllowDownWeight ?? 0); + //if (!detail.StandardPic) + // number = saleOutStore.SecondNumber; var already = alreadyList.FirstOrDefault(x => x.DetailID == detail.DetailID); if (already == null) - already = new AlreadyStockUp() { DetailID = detail.DetailID };//StandardPic = detail.StandardPic + already = new AlreadyStockUp() { DetailID = detail.DetailID };//StandardPic = detail.StandardPic var back = SegmentStockUpBL.Insert(detail, already, number.Value); if (back == null) { @@ -294,7 +306,7 @@ namespace ButcherFactory.SegmentStockUp_ InfoBox.Show("提示", "条码已使用过", Color.Green, 1, this); return; } - back.StandardPic = detail.StandardPic; + //back.StandardPic = detail.StandardPic; back.DetailID = detail.DetailID; if (back.State == 0) { @@ -311,11 +323,12 @@ namespace ButcherFactory.SegmentStockUp_ allDetail.Add(detail); if (printCk.Checked) - { - var last = allMain.Where(x => x.Goods_Name == saleOutStore.Goods_Name && x.DeliverGoodsLine_Name == saleOutStore.DeliverGoodsLine_Name) - .Sum(x => ((x.UnitNum ?? 0) - (x.SUnitNum ?? 0)) < 0 ? 0 : ((x.UnitNum ?? 0) - (x.SUnitNum ?? 0))); - if (last < 0) - last = 0; + { + var last = 0m; + // allMain.Where(x => x.Goods_Name == saleOutStore.Goods_Name && x.DeliverGoodsLine_Name == saleOutStore.DeliverGoodsLine_Name) + // .Sum(x => ((x.UnitNum ?? 0) - (x.SUnitNum ?? 0)) < 0 ? 0 : ((x.UnitNum ?? 0) - (x.SUnitNum ?? 0))); + //if (last < 0) + // last = 0; SegmentStockUpPrint.Print(detail, last, saleOutStore); } var hasUnFinish = allMain.Where(x => x.Customer_Name == saleOutStore.Customer_Name).Any(x => !x.Finishd); @@ -327,24 +340,25 @@ namespace ButcherFactory.SegmentStockUp_ void BindMainGrid(SaleOutStoreInfo saleOutStore) { var main = new List(); - foreach (var g in allMain.Where(x => x.Goods_Name == saleOutStore.Goods_Name).GroupBy(x => x.DeliverGoodsLine_Name)) + foreach (var g in allMain.Where(x => x.Goods_Name == saleOutStore.Goods_Name).GroupBy(x => x.Customer_Name)) { var item = new SaleOutStoreInfo(); var f = g.First(); main.Add(item); - item.DeliverGoodsLine_Name = g.Key; + item.Customer_Name = g.Key; item.Goods_Name = f.Goods_Name; item.Goods_Spec = f.Goods_Spec; item.SecondNumber = g.Sum(x => x.SecondNumber ?? 0); item.UnitNum = g.Sum(x => x.UnitNum ?? 0); item.SSecondNumber = g.Sum(x => x.SSecondNumber ?? 0); - item.SUnitNum = g.Sum(x => x.SUnitNum ?? 0); + item.SUnitNum = g.Sum(x => x.SUnitNum ?? 0); + item.DownFloat = config.AllowDownWeight; } mainList = new BindingList(main.OrderBy(x => x.Finishd).ToList()); mainGridView.DataSource = mainList; mainGridView.Refresh(); - BindDetail(main.Where(x => x.DeliverGoodsLine_Name == saleOutStore.DeliverGoodsLine_Name).First()); + BindDetail(main.Where(x => x.Customer_Name == saleOutStore.Customer_Name).First()); } void BindDetail(SaleOutStoreInfo first) @@ -357,8 +371,8 @@ namespace ButcherFactory.SegmentStockUp_ dhNumberLbl.Text = string.Format("{0:#0.##}", first.SecondNumber); dhUnitNumLbl.Text = string.Format("{0:#0.##}", first.UnitNum); bhNumberLbl.Text = string.Format("{0:#0.##}", first.SSecondNumber); - bhUnitNumLbl.Text = string.Format("{0:#0.##}", first.SUnitNum); - var detail = allDetail.Where(x => x.DeliverGoodsLine_Name == first.DeliverGoodsLine_Name && x.Goods_Name == first.Goods_Name).OrderByDescending(x => x.ID); + bhUnitNumLbl.Text = string.Format("{0:#0.##}", first.SUnitNum); + var detail = allDetail.Where(x => x.Customer_Name == first.Customer_Name && x.Goods_Name == first.Goods_Name).OrderByDescending(x => x.ID); detailList = new BindingList(detail.ToList()); //} //else @@ -417,6 +431,39 @@ namespace ButcherFactory.SegmentStockUp_ var last = 5.234m; var saleOutStore = new SaleOutStoreInfo() { Customer_Name = "青岛市大客户", SendQueue = 51 }; SegmentStockUpPrint.Print(detail, last, saleOutStore); + } + + private void label2_Click(object sender, EventArgs e) + { + var dialog = new SelectCustomerDialog(); + if (dialog.ShowDialog() == DialogResult.OK) + { + selectedCustomer = dialog.Result; + if (selectedCustomer == null) + label2.Text = "请选择"; + else + label2.Text = selectedCustomer.Item1; + } + } + + private void downWeightBox_Click(object sender, EventArgs e) + { + var pad = new NumberPad(); + if (pad.ShowDialog() == true) + { + decimal? weight=null; + if (!string.IsNullOrEmpty(pad.Result)) + { + decimal v; + if (decimal.TryParse(pad.Result, out v)) + weight = v; + else + throw new Exception("输入错误"); + } + downWeightBox.Text = string.Format("{0:#0.######}", weight); + config.AllowDownWeight = weight; + XmlUtil.SerializerObjToFile(config); + } } } diff --git a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.resx b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.resx index 58680c6..4399334 100644 --- a/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.resx +++ b/ButcherFactory.Form/SegmentStockUp_/SegmentStockUpForm.resx @@ -117,64 +117,64 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True - + True \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentStockUp_/SelectCustomerDialog.Designer.cs b/ButcherFactory.Form/SegmentStockUp_/SelectCustomerDialog.Designer.cs new file mode 100644 index 0000000..f6744bd --- /dev/null +++ b/ButcherFactory.Form/SegmentStockUp_/SelectCustomerDialog.Designer.cs @@ -0,0 +1,122 @@ +namespace ButcherFactory.SegmentStockUp_ +{ + partial class SelectCustomerDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.searchBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.clearBtn = new ButcherFactory.Controls.ColorButton(); + this.closeBtn = new ButcherFactory.Controls.ColorButton(); + this.SuspendLayout(); + // + // searchBox + // + this.searchBox.Font = new System.Drawing.Font("宋体", 15F); + this.searchBox.Location = new System.Drawing.Point(93, 10); + this.searchBox.Name = "searchBox"; + this.searchBox.Size = new System.Drawing.Size(158, 30); + this.searchBox.TabIndex = 0; + this.searchBox.Click += new System.EventHandler(this.searchBox_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("宋体", 15F); + this.label1.Location = new System.Drawing.Point(18, 15); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(69, 20); + this.label1.TabIndex = 1; + this.label1.Text = "搜索:"; + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.flowLayoutPanel1.Location = new System.Drawing.Point(19, 77); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(789, 452); + this.flowLayoutPanel1.TabIndex = 2; + // + // clearBtn + // + this.clearBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.clearBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.clearBtn.Font = new System.Drawing.Font("宋体", 12F); + this.clearBtn.ForeColor = System.Drawing.Color.White; + this.clearBtn.Location = new System.Drawing.Point(601, 17); + this.clearBtn.Name = "clearBtn"; + this.clearBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); + this.clearBtn.Size = new System.Drawing.Size(88, 39); + this.clearBtn.TabIndex = 3; + this.clearBtn.Text = "清空"; + this.clearBtn.UseVisualStyleBackColor = false; + this.clearBtn.Click += new System.EventHandler(this.clearBtn_Click); + // + // closeBtn + // + this.closeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.closeBtn.BackColor = System.Drawing.Color.Red; + this.closeBtn.Font = new System.Drawing.Font("宋体", 12F); + this.closeBtn.ForeColor = System.Drawing.Color.White; + this.closeBtn.Location = new System.Drawing.Point(717, 17); + this.closeBtn.Name = "closeBtn"; + this.closeBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); + this.closeBtn.Size = new System.Drawing.Size(88, 39); + this.closeBtn.TabIndex = 4; + this.closeBtn.Text = "关闭"; + this.closeBtn.UseVisualStyleBackColor = false; + this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click); + // + // SelectCustomerDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(824, 560); + this.Controls.Add(this.closeBtn); + this.Controls.Add(this.clearBtn); + this.Controls.Add(this.flowLayoutPanel1); + this.Controls.Add(this.label1); + this.Controls.Add(this.searchBox); + this.Name = "SelectCustomerDialog"; + this.Text = "选择客户"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox searchBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private Controls.ColorButton clearBtn; + private Controls.ColorButton closeBtn; + } +} \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentStockUp_/SelectCustomerDialog.cs b/ButcherFactory.Form/SegmentStockUp_/SelectCustomerDialog.cs new file mode 100644 index 0000000..d9d61a3 --- /dev/null +++ b/ButcherFactory.Form/SegmentStockUp_/SelectCustomerDialog.cs @@ -0,0 +1,68 @@ +using ButcherFactory.BO.LocalBL; +using ButcherFactory.Controls; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using WinFormControl; + +namespace ButcherFactory.SegmentStockUp_ +{ + public partial class SelectCustomerDialog : Form + { + public Tuple Result; + public SelectCustomerDialog() + { + InitializeComponent(); + } + + Color customerColor = Color.FromArgb(144, 98, 222); + private void searchBox_Click(object sender, EventArgs e) + { + var keyBoard = new VirtualKeyPad(); + if (keyBoard.ShowDialog() == true) + { + searchBox.Text = keyBoard.Result.Trim(); + flowLayoutPanel1.Controls.Clear(); + if (string.IsNullOrEmpty(searchBox.Text)) + return; + var customers = DialogBL.GetCustomerList(searchBox.Text); + foreach (var item in customers) + { + var btn = new ColorButton() { Width = 100, Height = 60, Text = item.StringExt1.ToString(), Tag = item.LongExt1, BackColor = customerColor, Font = new Font("宋体", 10), Margin = new Padding(12) }; + btn.Click += CustomerClick; + flowLayoutPanel1.Controls.Add(btn); + } + } + } + + private void CustomerClick(object sender, EventArgs e) + { + var btn = sender as ColorButton; + Result = new Tuple(btn.Text, Convert.ToInt64(btn.Tag)); + AfterChange(); + } + + private void clearBtn_Click(object sender, EventArgs e) + { + Result = null; + AfterChange(); + } + + void AfterChange() + { + DialogResult = DialogResult.OK; + this.Close(); + } + + private void closeBtn_Click(object sender, EventArgs e) + { + this.Close(); + } + } +} diff --git a/ButcherFactory.Form/SegmentStockUp_/SelectCustomerDialog.resx b/ButcherFactory.Form/SegmentStockUp_/SelectCustomerDialog.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/ButcherFactory.Form/SegmentStockUp_/SelectCustomerDialog.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file