From d537315971435c647693fedf847ab22b30263a5b Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Thu, 7 Mar 2019 14:54:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A7=B0=E9=87=8D=E8=AE=A1?= =?UTF-8?q?=E6=95=B0=E5=AE=A2=E6=88=B7=E7=AB=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ButcherFactory.BO/Bill/WeightCountEntity.cs | 34 + ButcherFactory.BO/ButcherFactory.BO.csproj | 214 ++++--- ButcherFactory.BO/Enums/ApplyClient.cs | 3 +- ButcherFactory.BO/Enums/DriveType.cs | 5 +- ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs | 1 - .../LocalBL/WeightCountEntityBL.cs | 159 +++++ .../ButcherFactory.Form.csproj | 10 + .../SegmentPickUpForm.Designer.cs | 96 +-- .../SegmentPickUp_/SegmentPickUpForm.cs | 1 - .../WeightCount_/WeightCountConfig.cs | 18 + .../WeightCount_/WeightCountForm.Designer.cs | 601 ++++++++++++++++++ .../WeightCount_/WeightCountForm.cs | 283 +++++++++ .../WeightCount_/WeightCountForm.resx | 168 +++++ 13 files changed, 1434 insertions(+), 159 deletions(-) create mode 100644 ButcherFactory.BO/Bill/WeightCountEntity.cs create mode 100644 ButcherFactory.BO/LocalBL/WeightCountEntityBL.cs create mode 100644 ButcherFactory.Form/WeightCount_/WeightCountConfig.cs create mode 100644 ButcherFactory.Form/WeightCount_/WeightCountForm.Designer.cs create mode 100644 ButcherFactory.Form/WeightCount_/WeightCountForm.cs create mode 100644 ButcherFactory.Form/WeightCount_/WeightCountForm.resx diff --git a/ButcherFactory.BO/Bill/WeightCountEntity.cs b/ButcherFactory.BO/Bill/WeightCountEntity.cs new file mode 100644 index 0000000..adcf854 --- /dev/null +++ b/ButcherFactory.BO/Bill/WeightCountEntity.cs @@ -0,0 +1,34 @@ +using Forks.EnterpriseServices.DomainObjects2; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ButcherFactory.BO.Bill +{ + [MapToTable("Butcher_WeightCountEntity")] + public class WeightCountEntity : SyncBill + { + public long? WorkUnit_ID { get; set; } + + public long? Store_ID { get; set; } + + public long? Goods_ID { get; set; } + + public long? ProductBatch_ID { get; set; } + + public decimal? Weight { get; set; } + + [DbColumn(DefaultValue = 1)] + public int Number { get; set; } + + [ReferenceTo(typeof(Goods), "Name")] + [Join("Goods_ID", "ID")] + public string Goods_Name { get; set; } + + public bool Submited { get; set; } + + public bool ProduceOut { get; set; } + } +} diff --git a/ButcherFactory.BO/ButcherFactory.BO.csproj b/ButcherFactory.BO/ButcherFactory.BO.csproj index b6e00d1..918a670 100644 --- a/ButcherFactory.BO/ButcherFactory.BO.csproj +++ b/ButcherFactory.BO/ButcherFactory.BO.csproj @@ -1,113 +1,115 @@ - - - - - Debug - AnyCPU - {B258C523-269C-4ED7-AB71-7196D5D2EF65} - Library - Properties - ButcherFactory.BO - ButcherFactory.BO - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\tsref\Debug\Forks.EnterpriseServices.dll - - - False - ..\..\..\tsref\Debug\Forks.JsonRpc.Client.dll - - - False - ..\..\..\tsref\release\Forks.Utils.dll - - - False - ..\..\..\tsref\Debug\Newtonsoft.Json.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + AnyCPU + {B258C523-269C-4ED7-AB71-7196D5D2EF65} + Library + Properties + ButcherFactory.BO + ButcherFactory.BO + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\tsref\Debug\Forks.EnterpriseServices.dll + + + False + ..\..\..\tsref\Debug\Forks.JsonRpc.Client.dll + + + False + ..\..\..\tsref\release\Forks.Utils.dll + + + False + ..\..\..\tsref\Debug\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --> \ No newline at end of file diff --git a/ButcherFactory.BO/Enums/ApplyClient.cs b/ButcherFactory.BO/Enums/ApplyClient.cs index 5ee4723..298bef0 100644 --- a/ButcherFactory.BO/Enums/ApplyClient.cs +++ b/ButcherFactory.BO/Enums/ApplyClient.cs @@ -11,6 +11,7 @@ namespace ButcherFactory.BO 白条出入库 = 0, 分割品 = 1, 副产品 = 2, - 分割领用 = 3 + 分割领用 = 3, + 称重计数 = 4 } } diff --git a/ButcherFactory.BO/Enums/DriveType.cs b/ButcherFactory.BO/Enums/DriveType.cs index e1ded43..f257c88 100644 --- a/ButcherFactory.BO/Enums/DriveType.cs +++ b/ButcherFactory.BO/Enums/DriveType.cs @@ -11,8 +11,9 @@ namespace ButcherFactory.BO 白条入库 = 0, 白条领用 = 1, 分割生产 = 2, - 扫码入库 = 3, - 分割领用 = 4, + 扫码入库 = 3, + 分割领用 = 4, + 称重计数 = 6, //B3从51开始 白条发货 = 51, diff --git a/ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs b/ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs index cd23664..0d8e64d 100644 --- a/ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs +++ b/ButcherFactory.BO/LocalBL/CarcassInStoreBL.cs @@ -243,7 +243,6 @@ namespace ButcherFactory.BO.LocalBL class CarcassInStoreObj { - [JsonIgnore] public long ID { get; set; } [JsonIgnore] public long RowVersion { get; set; } diff --git a/ButcherFactory.BO/LocalBL/WeightCountEntityBL.cs b/ButcherFactory.BO/LocalBL/WeightCountEntityBL.cs new file mode 100644 index 0000000..5c74e1f --- /dev/null +++ b/ButcherFactory.BO/LocalBL/WeightCountEntityBL.cs @@ -0,0 +1,159 @@ +using ButcherFactory.BO.Bill; +using ButcherFactory.BO.Utils; +using Forks.EnterpriseServices.DomainObjects2; +using Forks.EnterpriseServices.DomainObjects2.DQuery; +using Forks.EnterpriseServices.SqlDoms; +using Forks.JsonRpc.Client; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ButcherFactory.BO.LocalBL +{ + public static class WeightCountEntityBL + { + const string RpcPath = @"/MainSystem/B3ClientService/Rpcs/WeightCountEntityRpc/"; + + public static BindingList GetWeightCountEntity(bool produce, bool submited) + { + var query = new DQueryDom(new JoinAlias(typeof(WeightCountEntity))); + query.Columns.Add(DQSelectColumn.Field("ID")); + query.Columns.Add(DQSelectColumn.Field("RowIndex")); + query.Columns.Add(DQSelectColumn.Field("Goods_Name")); + query.Columns.Add(DQSelectColumn.Field("Number")); + query.Columns.Add(DQSelectColumn.Field("Weight")); + //query.Columns.Add(DQSelectColumn.Field("CreateTime")); + query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID", true)); + query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("ProduceOut", produce), DQCondition.EQ("Submited", submited))); + if (submited) + { + query.Where.Conditions.Add(DQCondition.And(DQCondition.Between("CreateTime", DateTime.Today, DateTime.Today + new TimeSpan(23, 59, 59)))); + query.Range = SelectRange.Top(20); + } + var list = new BindingList(); + using (var session = DmoSession.New()) + { + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + var entity = new WeightCountEntity(); + entity.ID = (long)reader[0]; + entity.RowIndex = (int)reader[1]; + entity.Goods_Name = (string)reader[2]; + entity.Number = (int)reader[3]; + entity.Weight = (decimal?)reader[4]; + //entity.CreateTime = (DateTime)reader[5]; + list.Add(entity); + } + } + } + return list; + } + + public static void InsertEntityByWeight(WeightCountEntity entity) + { + using (var session = DmoSession.New()) + { + entity.Number = 1; + entity.UserID = AppContext.Worker.ID; + session.Insert(entity); + session.Commit(); + } + } + + public static void UpdateNumber(long id, int number) + { + var update = new DQUpdateDom(typeof(WeightCountEntity)); + update.Where.Conditions.Add(DQCondition.EQ("ID", id)); + update.Columns.Add(new DQUpdateColumn("Number", number)); + update.EExecute(); + } + + public static void UpdateSubmit(IEnumerable ids) + { + var update = new DQUpdateDom(typeof(WeightCountEntity)); + update.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ID"), ids.Select(x => DQExpression.Value(x)).ToArray())); + update.Columns.Add(new DQUpdateColumn("Submited", true)); + update.EExecute(); + } + + public static void Upload() + { + try + { + using (var session = DmoSession.New()) + { + var needUpload = GetUnSyncData(session); + if (needUpload.Count == 0) + return; + var method = RpcPath + "Upload"; + var json = JsonConvert.SerializeObject(needUpload); + RpcFacade.Call(method, json); + foreach (var item in needUpload) + SetLocalAsSyncd(item, session); + session.Commit(); + } + } + catch + { +#if DEBUG + throw; +#endif + } + } + + static List GetUnSyncData(IDmoSession session) + { + var query = new DQueryDom(new JoinAlias(typeof(WeightCountEntity))); + query.Columns.Add(DQSelectColumn.Field("ID")); + query.Columns.Add(DQSelectColumn.Field("RowVersion")); + query.Columns.Add(DQSelectColumn.Field("UserID")); + query.Columns.Add(DQSelectColumn.Field("WorkUnit_ID")); + query.Columns.Add(DQSelectColumn.Field("ProductBatch_ID")); + query.Columns.Add(DQSelectColumn.Field("Goods_ID")); + query.Columns.Add(DQSelectColumn.Field("Weight")); + query.Columns.Add(DQSelectColumn.Field("CreateTime")); + query.Columns.Add(DQSelectColumn.Field("Number")); + query.Columns.Add(DQSelectColumn.Field("Store_ID")); + query.Columns.Add(DQSelectColumn.Field("ProduceOut")); + query.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Submited", true), DQCondition.EQ("Sync", false))); + query.Range = SelectRange.Top(10); + query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); + + var upload = new List(); + using (var reader = session.ExecuteReader(query)) + { + while (reader.Read()) + { + var obj = new WeightCountEntity(); + obj.ID = (long)reader[0]; + obj.RowVersion = (int)reader[1]; + obj.UserID = (long)reader[2]; + obj.WorkUnit_ID = (long?)reader[4]; + obj.ProductBatch_ID = (long?)reader[4]; + obj.Goods_ID = (long?)reader[5]; + obj.Weight = (decimal?)reader[6]; + obj.CreateTime = (DateTime)reader[7]; + obj.Number = (int)reader[8]; + obj.Store_ID = (long?)reader[9]; + obj.ProduceOut = (bool)reader[10]; + upload.Add(obj); + } + } + return upload; + } + + static void SetLocalAsSyncd(WeightCountEntity obj, IDmoSession session) + { + var update = new DQUpdateDom(typeof(WeightCountEntity)); + update.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("ID", obj.ID), DQCondition.EQ("RowVersion", obj.RowVersion))); + update.Columns.Add(new DQUpdateColumn("Sync", true)); + session.ExecuteNonQuery(update); + } + } +} diff --git a/ButcherFactory.Form/ButcherFactory.Form.csproj b/ButcherFactory.Form/ButcherFactory.Form.csproj index 4fe389b..fd4c3fc 100644 --- a/ButcherFactory.Form/ButcherFactory.Form.csproj +++ b/ButcherFactory.Form/ButcherFactory.Form.csproj @@ -272,6 +272,13 @@ + + + Form + + + WeightCountForm.cs + @@ -374,6 +381,9 @@ SegmentStockUpForm.cs + + WeightCountForm.cs + diff --git a/ButcherFactory.Form/SegmentPickUp_/SegmentPickUpForm.Designer.cs b/ButcherFactory.Form/SegmentPickUp_/SegmentPickUpForm.Designer.cs index 22bde12..c5a98bf 100644 --- a/ButcherFactory.Form/SegmentPickUp_/SegmentPickUpForm.Designer.cs +++ b/ButcherFactory.Form/SegmentPickUp_/SegmentPickUpForm.Designer.cs @@ -32,15 +32,20 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = 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 dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); this.submitBtn = new WinFormControl.UButton(); this.uLabel4 = new WinFormControl.ULabel(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.needSubmitGrid = new WinFormControl.UDataGridView(); + this.U_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.U_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.U_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.U_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.U_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.numFlowPanel = new System.Windows.Forms.FlowLayoutPanel(); this.uLabel3 = new WinFormControl.ULabel(); this.workUnitSelect = new System.Windows.Forms.ComboBox(); @@ -63,11 +68,6 @@ this.H_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.U_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.U_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.U_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.U_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.U_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.needSubmitGrid)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); @@ -122,7 +122,7 @@ this.groupBox1.Location = new System.Drawing.Point(11, 13); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(5); - this.groupBox1.Size = new System.Drawing.Size(600, 265); + this.groupBox1.Size = new System.Drawing.Size(600, 305); this.groupBox1.TabIndex = 2; this.groupBox1.TabStop = false; // @@ -160,14 +160,53 @@ this.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle4; this.needSubmitGrid.RowTemplate.Height = 30; this.needSubmitGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.needSubmitGrid.Size = new System.Drawing.Size(590, 248); + this.needSubmitGrid.Size = new System.Drawing.Size(590, 240); this.needSubmitGrid.TabIndex = 16; // + // U_ID + // + this.U_ID.DataPropertyName = "ID"; + this.U_ID.HeaderText = "ID"; + this.U_ID.Name = "U_ID"; + this.U_ID.ReadOnly = true; + this.U_ID.Visible = false; + // + // U_RowIndex + // + this.U_RowIndex.DataPropertyName = "RowIndex"; + this.U_RowIndex.HeaderText = "序号"; + this.U_RowIndex.Name = "U_RowIndex"; + this.U_RowIndex.ReadOnly = true; + // + // U_Goods_Name + // + this.U_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.U_Goods_Name.DataPropertyName = "Goods_Name"; + this.U_Goods_Name.HeaderText = "产品名称"; + this.U_Goods_Name.Name = "U_Goods_Name"; + this.U_Goods_Name.ReadOnly = true; + // + // U_Number + // + this.U_Number.DataPropertyName = "Number"; + this.U_Number.HeaderText = "数量"; + this.U_Number.Name = "U_Number"; + this.U_Number.ReadOnly = true; + // + // U_Weight + // + this.U_Weight.DataPropertyName = "Weight"; + dataGridViewCellStyle3.Format = "#0.######"; + this.U_Weight.DefaultCellStyle = dataGridViewCellStyle3; + this.U_Weight.HeaderText = "重量"; + this.U_Weight.Name = "U_Weight"; + this.U_Weight.ReadOnly = true; + // // numFlowPanel // this.numFlowPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.numFlowPanel.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.numFlowPanel.Location = new System.Drawing.Point(143, 14); + this.numFlowPanel.Location = new System.Drawing.Point(143, 12); this.numFlowPanel.Name = "numFlowPanel"; this.numFlowPanel.Size = new System.Drawing.Size(452, 41); this.numFlowPanel.TabIndex = 15; @@ -459,45 +498,6 @@ this.H_Weight.Name = "H_Weight"; this.H_Weight.ReadOnly = true; // - // U_ID - // - this.U_ID.DataPropertyName = "ID"; - this.U_ID.HeaderText = "ID"; - this.U_ID.Name = "U_ID"; - this.U_ID.ReadOnly = true; - this.U_ID.Visible = false; - // - // U_RowIndex - // - this.U_RowIndex.DataPropertyName = "RowIndex"; - this.U_RowIndex.HeaderText = "序号"; - this.U_RowIndex.Name = "U_RowIndex"; - this.U_RowIndex.ReadOnly = true; - // - // U_Goods_Name - // - this.U_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.U_Goods_Name.DataPropertyName = "Goods_Name"; - this.U_Goods_Name.HeaderText = "产品名称"; - this.U_Goods_Name.Name = "U_Goods_Name"; - this.U_Goods_Name.ReadOnly = true; - // - // U_Number - // - this.U_Number.DataPropertyName = "Number"; - this.U_Number.HeaderText = "数量"; - this.U_Number.Name = "U_Number"; - this.U_Number.ReadOnly = true; - // - // U_Weight - // - this.U_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle3.Format = "#0.######"; - this.U_Weight.DefaultCellStyle = dataGridViewCellStyle3; - this.U_Weight.HeaderText = "重量"; - this.U_Weight.Name = "U_Weight"; - this.U_Weight.ReadOnly = true; - // // SegmentPickUpForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); diff --git a/ButcherFactory.Form/SegmentPickUp_/SegmentPickUpForm.cs b/ButcherFactory.Form/SegmentPickUp_/SegmentPickUpForm.cs index 8ddb877..5c8c266 100644 --- a/ButcherFactory.Form/SegmentPickUp_/SegmentPickUpForm.cs +++ b/ButcherFactory.Form/SegmentPickUp_/SegmentPickUpForm.cs @@ -34,7 +34,6 @@ namespace ButcherFactory.SegmentPickUp_ #endregion const string FilePatch = @"Config\NumberSetDialog.cfg"; - Thread syncBeforeInfo; Thread uploadData; BindingList needSubmitedList; BindingList historyList; diff --git a/ButcherFactory.Form/WeightCount_/WeightCountConfig.cs b/ButcherFactory.Form/WeightCount_/WeightCountConfig.cs new file mode 100644 index 0000000..b21ed82 --- /dev/null +++ b/ButcherFactory.Form/WeightCount_/WeightCountConfig.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ButcherFactory.WeightCount_ +{ + public class WeightCountConfig + { + public long? WorkUnitID { get; set; } + + public long? Store_ID { get; set; } + + private bool mProduceOut = true; + public bool ProduceOut { get { return mProduceOut; } set { mProduceOut = value; } } + } +} diff --git a/ButcherFactory.Form/WeightCount_/WeightCountForm.Designer.cs b/ButcherFactory.Form/WeightCount_/WeightCountForm.Designer.cs new file mode 100644 index 0000000..6139ccc --- /dev/null +++ b/ButcherFactory.Form/WeightCount_/WeightCountForm.Designer.cs @@ -0,0 +1,601 @@ +namespace ButcherFactory.WeightCount_ +{ + partial class WeightCountForm + { + /// + /// 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() + { + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WeightCountForm)); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle(); + this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.H_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.H_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.H_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.historyDataGrid = new WinFormControl.UDataGridView(); + this.H_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.uLabel4 = new WinFormControl.ULabel(); + this.storeSelect = new System.Windows.Forms.ComboBox(); + this.uLabel5 = new WinFormControl.ULabel(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.typeBtn = new WinFormControl.UButton(); + this.uLabel6 = new WinFormControl.ULabel(); + this.numSetBtn = new WinFormControl.UButton(); + this.productBatchSelect = new System.Windows.Forms.ComboBox(); + this.uLabel2 = new WinFormControl.ULabel(); + this.closeBtn = new WinFormControl.UButton(); + this.uTimerLabel1 = new WinFormControl.UTimerLabel(); + this.workUnitSelect = new System.Windows.Forms.ComboBox(); + this.netStateWatch1 = new WinFormControl.NetStateWatch(); + this.uWeightControl1 = new WinFormControl.UWeightControl(); + this.uLabel1 = new WinFormControl.ULabel(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.needSubmitGrid = new WinFormControl.UDataGridView(); + this.U_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.U_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.U_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.U_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.U_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.numFlowPanel = new System.Windows.Forms.FlowLayoutPanel(); + this.submitBtn = new WinFormControl.UButton(); + this.uLabel3 = new WinFormControl.ULabel(); + ((System.ComponentModel.ISupportInitialize)(this.historyDataGrid)).BeginInit(); + this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.needSubmitGrid)).BeginInit(); + this.SuspendLayout(); + // + // H_Weight + // + this.H_Weight.DataPropertyName = "Weight"; + dataGridViewCellStyle17.Format = "#0.######"; + this.H_Weight.DefaultCellStyle = dataGridViewCellStyle17; + this.H_Weight.HeaderText = "重量"; + this.H_Weight.Name = "H_Weight"; + this.H_Weight.ReadOnly = true; + // + // H_Goods_Name + // + this.H_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.H_Goods_Name.DataPropertyName = "Goods_Name"; + this.H_Goods_Name.HeaderText = "产品名称"; + this.H_Goods_Name.Name = "H_Goods_Name"; + this.H_Goods_Name.ReadOnly = true; + // + // H_RowIndex + // + this.H_RowIndex.DataPropertyName = "RowIndex"; + this.H_RowIndex.HeaderText = "序号"; + this.H_RowIndex.Name = "H_RowIndex"; + this.H_RowIndex.ReadOnly = true; + // + // H_ID + // + this.H_ID.DataPropertyName = "ID"; + this.H_ID.HeaderText = "ID"; + this.H_ID.Name = "H_ID"; + this.H_ID.ReadOnly = true; + this.H_ID.Visible = false; + // + // historyDataGrid + // + this.historyDataGrid.AllowUserToAddRows = false; + this.historyDataGrid.AllowUserToDeleteRows = false; + this.historyDataGrid.AllowUserToResizeColumns = false; + this.historyDataGrid.AllowUserToResizeRows = false; + dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle18; + this.historyDataGrid.BackgroundColor = System.Drawing.Color.White; + this.historyDataGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; + dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle19.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle19.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle19; + this.historyDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.historyDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.H_ID, + this.H_RowIndex, + this.H_Goods_Name, + this.H_Number, + this.H_Weight}); + this.historyDataGrid.Dock = System.Windows.Forms.DockStyle.Fill; + this.historyDataGrid.Location = new System.Drawing.Point(5, 19); + this.historyDataGrid.MultiSelect = false; + this.historyDataGrid.Name = "historyDataGrid"; + this.historyDataGrid.ReadOnly = true; + this.historyDataGrid.RowHeadersVisible = false; + dataGridViewCellStyle20.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle20; + this.historyDataGrid.RowTemplate.Height = 23; + this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.historyDataGrid.Size = new System.Drawing.Size(590, 158); + this.historyDataGrid.TabIndex = 2; + // + // H_Number + // + this.H_Number.DataPropertyName = "Number"; + this.H_Number.HeaderText = "数量"; + this.H_Number.Name = "H_Number"; + this.H_Number.ReadOnly = true; + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Right))); + this.flowLayoutPanel1.AutoScroll = true; + this.flowLayoutPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.flowLayoutPanel1.Location = new System.Drawing.Point(627, -1); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(680, 521); + this.flowLayoutPanel1.TabIndex = 4; + // + // groupBox2 + // + this.groupBox2.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.groupBox2.Controls.Add(this.historyDataGrid); + this.groupBox2.Controls.Add(this.uLabel4); + this.groupBox2.Location = new System.Drawing.Point(11, 324); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Padding = new System.Windows.Forms.Padding(5); + this.groupBox2.Size = new System.Drawing.Size(600, 182); + this.groupBox2.TabIndex = 3; + this.groupBox2.TabStop = false; + // + // uLabel4 + // + this.uLabel4.AutoSize = true; + this.uLabel4.BackColor = System.Drawing.Color.White; + this.uLabel4.Font = new System.Drawing.Font("宋体", 13F); + this.uLabel4.Location = new System.Drawing.Point(8, -1); + this.uLabel4.Name = "uLabel4"; + this.uLabel4.Size = new System.Drawing.Size(80, 18); + this.uLabel4.TabIndex = 1; + this.uLabel4.Text = "历史领料"; + // + // storeSelect + // + this.storeSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.storeSelect.Font = new System.Drawing.Font("宋体", 15F); + this.storeSelect.FormattingEnabled = true; + this.storeSelect.Location = new System.Drawing.Point(696, 11); + this.storeSelect.Name = "storeSelect"; + this.storeSelect.Size = new System.Drawing.Size(170, 28); + this.storeSelect.TabIndex = 23; + // + // uLabel5 + // + this.uLabel5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.uLabel5.AutoSize = true; + this.uLabel5.BackColor = System.Drawing.Color.Transparent; + this.uLabel5.Font = new System.Drawing.Font("宋体", 15F); + this.uLabel5.Location = new System.Drawing.Point(595, 14); + this.uLabel5.Name = "uLabel5"; + this.uLabel5.Size = new System.Drawing.Size(109, 20); + this.uLabel5.TabIndex = 22; + this.uLabel5.Text = "入库仓库:"; + // + // splitContainer1 + // + this.splitContainer1.BackColor = System.Drawing.Color.Transparent; + this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer1.IsSplitterFixed = true; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.BackColor = System.Drawing.Color.Transparent; + this.splitContainer1.Panel1.Controls.Add(this.typeBtn); + this.splitContainer1.Panel1.Controls.Add(this.uLabel6); + this.splitContainer1.Panel1.Controls.Add(this.storeSelect); + this.splitContainer1.Panel1.Controls.Add(this.uLabel5); + this.splitContainer1.Panel1.Controls.Add(this.numSetBtn); + this.splitContainer1.Panel1.Controls.Add(this.productBatchSelect); + this.splitContainer1.Panel1.Controls.Add(this.uLabel2); + this.splitContainer1.Panel1.Controls.Add(this.closeBtn); + this.splitContainer1.Panel1.Controls.Add(this.uTimerLabel1); + this.splitContainer1.Panel1.Controls.Add(this.workUnitSelect); + this.splitContainer1.Panel1.Controls.Add(this.netStateWatch1); + this.splitContainer1.Panel1.Controls.Add(this.uWeightControl1); + this.splitContainer1.Panel1.Controls.Add(this.uLabel1); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.flowLayoutPanel1); + this.splitContainer1.Panel2.Controls.Add(this.groupBox2); + this.splitContainer1.Panel2.Controls.Add(this.groupBox1); + this.splitContainer1.Size = new System.Drawing.Size(1305, 611); + this.splitContainer1.SplitterDistance = 86; + this.splitContainer1.TabIndex = 3; + // + // typeBtn + // + this.typeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.typeBtn.AsClicked = false; + this.typeBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("typeBtn.BackgroundImage"))); + this.typeBtn.EnableGroup = false; + this.typeBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.typeBtn.FlatAppearance.BorderSize = 0; + this.typeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.typeBtn.Font = new System.Drawing.Font("宋体", 15F); + this.typeBtn.ForeColor = System.Drawing.Color.Black; + this.typeBtn.Location = new System.Drawing.Point(696, 46); + this.typeBtn.Name = "typeBtn"; + this.typeBtn.PlaySound = false; + this.typeBtn.SelfControlEnable = false; + this.typeBtn.Size = new System.Drawing.Size(111, 34); + this.typeBtn.SoundType = WinFormControl.SoundType.Click; + this.typeBtn.TabIndex = 25; + this.typeBtn.UseVisualStyleBackColor = true; + this.typeBtn.WithStataHode = false; + this.typeBtn.Click += new System.EventHandler(this.typeBtn_Click); + // + // uLabel6 + // + this.uLabel6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.uLabel6.AutoSize = true; + this.uLabel6.BackColor = System.Drawing.Color.Transparent; + this.uLabel6.Font = new System.Drawing.Font("宋体", 15F); + this.uLabel6.Location = new System.Drawing.Point(595, 53); + this.uLabel6.Name = "uLabel6"; + this.uLabel6.Size = new System.Drawing.Size(109, 20); + this.uLabel6.TabIndex = 24; + this.uLabel6.Text = "当前操作:"; + // + // numSetBtn + // + this.numSetBtn.AsClicked = false; + this.numSetBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("numSetBtn.BackgroundImage"))); + this.numSetBtn.EnableGroup = false; + this.numSetBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.numSetBtn.FlatAppearance.BorderSize = 0; + this.numSetBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.numSetBtn.Font = new System.Drawing.Font("宋体", 15F); + this.numSetBtn.ForeColor = System.Drawing.Color.Black; + this.numSetBtn.Location = new System.Drawing.Point(358, 46); + this.numSetBtn.Name = "numSetBtn"; + this.numSetBtn.PlaySound = false; + this.numSetBtn.SelfControlEnable = false; + this.numSetBtn.Size = new System.Drawing.Size(111, 34); + this.numSetBtn.SoundType = WinFormControl.SoundType.Click; + this.numSetBtn.TabIndex = 21; + this.numSetBtn.Text = "数量设置"; + this.numSetBtn.UseVisualStyleBackColor = true; + this.numSetBtn.WithStataHode = false; + this.numSetBtn.Click += new System.EventHandler(this.numSetBtn_Click); + // + // productBatchSelect + // + this.productBatchSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.productBatchSelect.Font = new System.Drawing.Font("宋体", 15F); + this.productBatchSelect.FormattingEnabled = true; + this.productBatchSelect.Location = new System.Drawing.Point(984, 50); + this.productBatchSelect.Name = "productBatchSelect"; + this.productBatchSelect.Size = new System.Drawing.Size(170, 28); + this.productBatchSelect.TabIndex = 18; + // + // uLabel2 + // + this.uLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.uLabel2.AutoSize = true; + this.uLabel2.BackColor = System.Drawing.Color.Transparent; + this.uLabel2.Font = new System.Drawing.Font("宋体", 15F); + this.uLabel2.Location = new System.Drawing.Point(883, 53); + this.uLabel2.Name = "uLabel2"; + this.uLabel2.Size = new System.Drawing.Size(109, 20); + this.uLabel2.TabIndex = 16; + this.uLabel2.Text = "生产批次:"; + // + // closeBtn + // + this.closeBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.closeBtn.AsClicked = false; + this.closeBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("closeBtn.BackgroundImage"))); + this.closeBtn.EnableGroup = false; + this.closeBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.closeBtn.FlatAppearance.BorderSize = 0; + this.closeBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.closeBtn.Font = new System.Drawing.Font("宋体", 15F); + this.closeBtn.ForeColor = System.Drawing.Color.Black; + this.closeBtn.Location = new System.Drawing.Point(1187, 7); + this.closeBtn.Name = "closeBtn"; + this.closeBtn.PlaySound = false; + this.closeBtn.SelfControlEnable = false; + this.closeBtn.Size = new System.Drawing.Size(111, 34); + this.closeBtn.SoundType = WinFormControl.SoundType.Click; + this.closeBtn.TabIndex = 10; + this.closeBtn.Text = "关 闭"; + this.closeBtn.UseVisualStyleBackColor = true; + this.closeBtn.WithStataHode = false; + this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click); + // + // uTimerLabel1 + // + this.uTimerLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.uTimerLabel1.AutoSize = true; + this.uTimerLabel1.BackColor = System.Drawing.Color.Transparent; + this.uTimerLabel1.Font = new System.Drawing.Font("黑体", 12F); + this.uTimerLabel1.Format = "M月d日 H:mm:ss"; + this.uTimerLabel1.Location = new System.Drawing.Point(1165, 53); + this.uTimerLabel1.Name = "uTimerLabel1"; + this.uTimerLabel1.Size = new System.Drawing.Size(128, 16); + this.uTimerLabel1.TabIndex = 8; + this.uTimerLabel1.Text = "3月30日 8:54:07"; + // + // workUnitSelect + // + this.workUnitSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.workUnitSelect.Font = new System.Drawing.Font("宋体", 15F); + this.workUnitSelect.FormattingEnabled = true; + this.workUnitSelect.Location = new System.Drawing.Point(984, 11); + this.workUnitSelect.Name = "workUnitSelect"; + this.workUnitSelect.Size = new System.Drawing.Size(170, 28); + this.workUnitSelect.TabIndex = 7; + // + // netStateWatch1 + // + this.netStateWatch1.BackColor = System.Drawing.Color.Transparent; + this.netStateWatch1.Location = new System.Drawing.Point(354, 4); + this.netStateWatch1.Name = "netStateWatch1"; + this.netStateWatch1.Size = new System.Drawing.Size(90, 39); + this.netStateWatch1.TabIndex = 1; + // + // uWeightControl1 + // + this.uWeightControl1.BackColor = System.Drawing.Color.Transparent; + this.uWeightControl1.Location = new System.Drawing.Point(3, 3); + this.uWeightControl1.Name = "uWeightControl1"; + this.uWeightControl1.Size = new System.Drawing.Size(349, 78); + this.uWeightControl1.TabIndex = 0; + this.uWeightControl1.WeightFalg = null; + // + // uLabel1 + // + this.uLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.uLabel1.AutoSize = true; + this.uLabel1.BackColor = System.Drawing.Color.Transparent; + this.uLabel1.Font = new System.Drawing.Font("宋体", 15F); + this.uLabel1.Location = new System.Drawing.Point(883, 14); + this.uLabel1.Name = "uLabel1"; + this.uLabel1.Size = new System.Drawing.Size(109, 20); + this.uLabel1.TabIndex = 5; + this.uLabel1.Text = "工作单元:"; + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.needSubmitGrid); + this.groupBox1.Controls.Add(this.numFlowPanel); + this.groupBox1.Controls.Add(this.submitBtn); + this.groupBox1.Controls.Add(this.uLabel3); + this.groupBox1.Location = new System.Drawing.Point(11, 13); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Padding = new System.Windows.Forms.Padding(5); + this.groupBox1.Size = new System.Drawing.Size(600, 305); + this.groupBox1.TabIndex = 2; + this.groupBox1.TabStop = false; + // + // needSubmitGrid + // + this.needSubmitGrid.AllowUserToAddRows = false; + this.needSubmitGrid.AllowUserToDeleteRows = false; + this.needSubmitGrid.AllowUserToResizeColumns = false; + this.needSubmitGrid.AllowUserToResizeRows = false; + dataGridViewCellStyle21.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle21; + this.needSubmitGrid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.needSubmitGrid.BackgroundColor = System.Drawing.Color.White; + this.needSubmitGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; + dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle22.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle22.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle22.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle22; + this.needSubmitGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.needSubmitGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.U_ID, + this.U_RowIndex, + this.U_Goods_Name, + this.U_Number, + this.U_Weight}); + this.needSubmitGrid.Location = new System.Drawing.Point(5, 57); + this.needSubmitGrid.MultiSelect = false; + this.needSubmitGrid.Name = "needSubmitGrid"; + this.needSubmitGrid.ReadOnly = true; + this.needSubmitGrid.RowHeadersVisible = false; + dataGridViewCellStyle24.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle24.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle24; + this.needSubmitGrid.RowTemplate.Height = 30; + this.needSubmitGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.needSubmitGrid.Size = new System.Drawing.Size(590, 240); + this.needSubmitGrid.TabIndex = 16; + // + // U_ID + // + this.U_ID.DataPropertyName = "ID"; + this.U_ID.HeaderText = "ID"; + this.U_ID.Name = "U_ID"; + this.U_ID.ReadOnly = true; + this.U_ID.Visible = false; + // + // U_RowIndex + // + this.U_RowIndex.DataPropertyName = "RowIndex"; + this.U_RowIndex.HeaderText = "序号"; + this.U_RowIndex.Name = "U_RowIndex"; + this.U_RowIndex.ReadOnly = true; + // + // U_Goods_Name + // + this.U_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.U_Goods_Name.DataPropertyName = "Goods_Name"; + this.U_Goods_Name.HeaderText = "产品名称"; + this.U_Goods_Name.Name = "U_Goods_Name"; + this.U_Goods_Name.ReadOnly = true; + // + // U_Number + // + this.U_Number.DataPropertyName = "Number"; + this.U_Number.HeaderText = "数量"; + this.U_Number.Name = "U_Number"; + this.U_Number.ReadOnly = true; + // + // U_Weight + // + this.U_Weight.DataPropertyName = "Weight"; + dataGridViewCellStyle23.Format = "#0.######"; + this.U_Weight.DefaultCellStyle = dataGridViewCellStyle23; + this.U_Weight.HeaderText = "重量"; + this.U_Weight.Name = "U_Weight"; + this.U_Weight.ReadOnly = true; + // + // numFlowPanel + // + this.numFlowPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.numFlowPanel.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; + this.numFlowPanel.Location = new System.Drawing.Point(143, 13); + this.numFlowPanel.Name = "numFlowPanel"; + this.numFlowPanel.Size = new System.Drawing.Size(452, 41); + this.numFlowPanel.TabIndex = 15; + // + // submitBtn + // + this.submitBtn.AsClicked = false; + this.submitBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("submitBtn.BackgroundImage"))); + this.submitBtn.EnableGroup = false; + this.submitBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.submitBtn.FlatAppearance.BorderSize = 0; + this.submitBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.submitBtn.Font = new System.Drawing.Font("宋体", 15F); + this.submitBtn.ForeColor = System.Drawing.Color.Black; + this.submitBtn.Location = new System.Drawing.Point(11, 20); + this.submitBtn.Name = "submitBtn"; + this.submitBtn.PlaySound = false; + this.submitBtn.SelfControlEnable = false; + this.submitBtn.Size = new System.Drawing.Size(111, 34); + this.submitBtn.SoundType = WinFormControl.SoundType.Click; + this.submitBtn.TabIndex = 11; + this.submitBtn.Text = "提 交"; + this.submitBtn.UseVisualStyleBackColor = true; + this.submitBtn.WithStataHode = false; + this.submitBtn.Click += new System.EventHandler(this.submitBtn_Click); + // + // uLabel3 + // + this.uLabel3.AutoSize = true; + this.uLabel3.BackColor = System.Drawing.Color.White; + this.uLabel3.Font = new System.Drawing.Font("宋体", 13F); + this.uLabel3.Location = new System.Drawing.Point(8, 0); + this.uLabel3.Name = "uLabel3"; + this.uLabel3.Size = new System.Drawing.Size(80, 18); + this.uLabel3.TabIndex = 0; + this.uLabel3.Text = "领料明细"; + // + // WeightCountForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(1305, 611); + this.Controls.Add(this.splitContainer1); + this.MinimumSize = new System.Drawing.Size(1321, 650); + this.Name = "WeightCountForm"; + this.Text = "称重计数"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + ((System.ComponentModel.ISupportInitialize)(this.historyDataGrid)).EndInit(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel1.PerformLayout(); + this.splitContainer1.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.needSubmitGrid)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight; + private System.Windows.Forms.DataGridViewTextBoxColumn H_Goods_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn H_RowIndex; + private System.Windows.Forms.DataGridViewTextBoxColumn H_ID; + private WinFormControl.UDataGridView historyDataGrid; + private System.Windows.Forms.DataGridViewTextBoxColumn H_Number; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.GroupBox groupBox2; + private WinFormControl.ULabel uLabel4; + private System.Windows.Forms.ComboBox storeSelect; + private WinFormControl.ULabel uLabel5; + private System.Windows.Forms.SplitContainer splitContainer1; + private WinFormControl.UButton numSetBtn; + private System.Windows.Forms.ComboBox productBatchSelect; + private WinFormControl.ULabel uLabel2; + private WinFormControl.UButton closeBtn; + private WinFormControl.UTimerLabel uTimerLabel1; + private System.Windows.Forms.ComboBox workUnitSelect; + private WinFormControl.NetStateWatch netStateWatch1; + private WinFormControl.UWeightControl uWeightControl1; + private WinFormControl.ULabel uLabel1; + private System.Windows.Forms.GroupBox groupBox1; + private WinFormControl.UDataGridView needSubmitGrid; + private System.Windows.Forms.DataGridViewTextBoxColumn U_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn U_RowIndex; + private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn U_Number; + private System.Windows.Forms.DataGridViewTextBoxColumn U_Weight; + private System.Windows.Forms.FlowLayoutPanel numFlowPanel; + private WinFormControl.UButton submitBtn; + private WinFormControl.ULabel uLabel3; + private WinFormControl.ULabel uLabel6; + private WinFormControl.UButton typeBtn; + } +} \ No newline at end of file diff --git a/ButcherFactory.Form/WeightCount_/WeightCountForm.cs b/ButcherFactory.Form/WeightCount_/WeightCountForm.cs new file mode 100644 index 0000000..d2fcc56 --- /dev/null +++ b/ButcherFactory.Form/WeightCount_/WeightCountForm.cs @@ -0,0 +1,283 @@ +using ButcherFactory.BO; +using ButcherFactory.BO.LocalBL; +using ButcherFactory.BO.Rpcs; +using ButcherFactory.BO.Utils; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Windows.Forms; +using WinFormControl; +using ButcherFactory.Utils; +using ButcherFactory.Dialogs; +using ButcherFactory.BO.Bill; + +namespace ButcherFactory.WeightCount_ +{ + public partial class WeightCountForm : Form, IWithRoleForm + { + #region IWithRoleForm + public List RoleName + { + get { return new List { (short)设备类别.称重计数 }; } + } + + public Form Generate() + { + return this; + } + #endregion + + const string FilePatch = @"Config\NumberSetDialog.cfg"; + Thread uploadData; + BindingList needSubmitedList; + BindingList historyList; + WeightCountConfig config; + + long? batchID; + + public WeightCountForm() + { + InitializeComponent(); + BuildNumberPanel(); + workUnitSelect.SelectedIndexChanged += delegate + { + if (workUnitSelect.SelectedValue == null) + config.WorkUnitID = null; + else + config.WorkUnitID = (long)workUnitSelect.SelectedValue; + XmlUtil.SerializerObjToFile(config); + }; + storeSelect.SelectedIndexChanged += delegate + { + if (storeSelect.SelectedValue == null) + config.Store_ID = null; + else + config.Store_ID = (long)storeSelect.SelectedValue; + XmlUtil.SerializerObjToFile(config); + }; + productBatchSelect.SelectedIndexChanged += delegate + { + if (productBatchSelect.SelectedValue == null) + batchID = null; + else + batchID = (long)productBatchSelect.SelectedValue; + }; + this.FormClosing += delegate + { + if (uploadData != null && uploadData.IsAlive) + uploadData.Abort(); + }; + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + var initTask = new Thread(LoadBind); + initTask.Start(); + + uploadData = new Thread(UpLoadLocalData); + uploadData.Start(); + } + + private void LoadBind() + { + this.Invoke(new Action(() => + { + BLUtil.DeleteLocalDb(); + BaseInfoSyncRpc.SyncGoodsByTag(ApplyClient.称重计数); + BaseInfoSyncRpc.SyncBaseInfo(); + BaseInfoSyncRpc.SyncProductBatch(1); + BaseInfoSyncRpc.SyncBaseInfo(); + + productBatchSelect.EBindComboBox(x => x.Date == DateTime.Today, 6, "Date"); + config = XmlUtil.DeserializeFromFile(); + workUnitSelect.EBindComboBox(x => x.ID == config.WorkUnitID, top: 100); + storeSelect.EBindComboBox(x => x.ID == config.Store_ID, top: 100); + BindGoods(); + AfterChangeType(); + })); + } + + List goodsBtns = new List(); + void BindGoods() + { + var goods = FormClientGoodsSetBL.GetGoodsList(); + foreach (var item in goods) + { + var btn = new UButton() { Width = 120, Height = 75, Text = item.Goods_Name, Tag = item.Goods_ID, Font = new Font("宋体", 15), Margin = new Padding(22, 10, 22, 30), PlaySound = true }; + btn.Click += GoodsBtnClick; + goodsBtns.Add(btn); + flowLayoutPanel1.Controls.Add(btn); + } + } + + void GoodsBtnClick(object sender, EventArgs e) + { + if (batchID == null) + throw new Exception("请先选择批次"); + if (!config.ProduceOut && config.Store_ID == null) + throw new Exception("请先选择仓库"); + if (uWeightControl1.Weight == 0) + throw new Exception("重量不能为0!"); + var c = sender as UButton; + var entity = new WeightCountEntity(); + entity.RowIndex = GetRowIndex(); + entity.Weight = uWeightControl1.Weight; + entity.Goods_ID = (long)c.Tag; + entity.Goods_Name = c.Text; + entity.ProductBatch_ID = batchID; + entity.WorkUnit_ID = config.WorkUnitID; + if (!config.ProduceOut) + entity.Store_ID = config.Store_ID; + entity.ProduceOut = config.ProduceOut; + WeightCountEntityBL.InsertEntityByWeight(entity); + needSubmitedList.Insert(0, entity); + AfterInsert(); + } + + void BindGrid() + { + needSubmitedList = WeightCountEntityBL.GetWeightCountEntity(config.ProduceOut, false); + needSubmitGrid.DataSource = needSubmitedList; + needSubmitGrid.Refresh(); + + historyList = WeightCountEntityBL.GetWeightCountEntity(config.ProduceOut, true); + historyDataGrid.DataSource = historyList; + historyDataGrid.Refresh(); + } + + private void UpLoadLocalData() + { + while (true) + { + if (this.IsHandleCreated) + { + this.Invoke(new Action(() => + { + WeightCountEntityBL.Upload(); + })); + } + Thread.Sleep(2000); + } + } + + void AfterInsert() + { + needSubmitGrid.FirstDisplayedScrollingRowIndex = 0; + needSubmitGrid.Rows[0].Selected = true; + needSubmitGrid.CurrentCell = needSubmitGrid.Rows[0].Cells[2]; + needSubmitGrid.Refresh(); + } + + int GetRowIndex() + { + var f = needSubmitedList.FirstOrDefault(x => x.CreateTime.Date == DateTime.Today); + if (f != null) + return f.RowIndex.Value + 1; + else if (historyList.Any()) + return historyList.First().RowIndex.Value + 1; + else + return 1; + } + + private void closeBtn_Click(object sender, EventArgs e) + { + Close(); + } + + private void submitBtn_Click(object sender, EventArgs e) + { + if (needSubmitedList.Count == 0) + throw new Exception("没有待提交记录"); + var arr = needSubmitedList.ToList(); + arr.Reverse(); + WeightCountEntityBL.UpdateSubmit(needSubmitedList.Select(x => x.ID)); + foreach (var item in arr) + { + historyList.Insert(0, item); + if (historyList.Count > 50) + historyList.RemoveAt(50); + needSubmitedList.Remove(item); + } + historyDataGrid.FirstDisplayedScrollingRowIndex = 0; + historyDataGrid.Refresh(); + needSubmitGrid.Refresh(); + } + + private void numSetBtn_Click(object sender, EventArgs e) + { + new NumberSetDialog().ShowDialog(); + BuildNumberPanel(); + } + + void BuildNumberPanel() + { + numFlowPanel.Controls.Clear(); + if (!System.IO.File.Exists(FilePatch)) + return; + var simpBtn = new UButton() { Width = 100, Height = 34, Text = "自定义", Font = new Font("宋体", 15), Margin = new Padding(6, 2, 6, 0), WithStataHode = true, EnableGroup = true }; + simpBtn.Click += delegate + { + var cr = GetCurrentRowEntity(); + if (cr == null) + return; + var keyBoard = new NumberPad(); + if (keyBoard.ShowDialog() == true) + { + var v = 0; + if (int.TryParse(keyBoard.Result, out v) && v > 0) + { + cr.Number = v; + WeightCountEntityBL.UpdateNumber(cr.ID, cr.Number); + needSubmitGrid.Refresh(); + } + else + throw new Exception("输入数量有误!"); + } + }; + numFlowPanel.Controls.Add(simpBtn); + var arr = System.IO.File.ReadAllText(FilePatch).Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Reverse(); + foreach (var item in arr) + { + var btn = new UButton() { Width = 100, Height = 34, Text = item, Font = new Font("宋体", 15), Margin = new Padding(6, 2, 6, 0), WithStataHode = true, EnableGroup = true }; + btn.Click += (sender, e) => + { + var row = GetCurrentRowEntity(); + if (row == null) + return; + var b = sender as UButton; + row.Number = int.Parse(b.Text); + WeightCountEntityBL.UpdateNumber(row.ID, row.Number); + needSubmitGrid.Refresh(); + }; + numFlowPanel.Controls.Add(btn); + } + } + + WeightCountEntity GetCurrentRowEntity() + { + if (needSubmitGrid.CurrentRow == null) + return null; + return needSubmitGrid.CurrentRow.DataBoundItem as WeightCountEntity; + } + + private void typeBtn_Click(object sender, EventArgs e) + { + config.ProduceOut = !config.ProduceOut; + XmlUtil.SerializerObjToFile(config); + AfterChangeType(); + } + + void AfterChangeType() + { + typeBtn.Text = config.ProduceOut ? "产出" : "入库"; + BindGrid(); + } + } +} diff --git a/ButcherFactory.Form/WeightCount_/WeightCountForm.resx b/ButcherFactory.Form/WeightCount_/WeightCountForm.resx new file mode 100644 index 0000000..f49205f --- /dev/null +++ b/ButcherFactory.Form/WeightCount_/WeightCountForm.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + + True + + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + + True + + + True + + + True + + + + iVBORw0KGgoAAAANSUhEUgAAAGAAAAAwCAIAAABhdOiYAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAAHNJREFUaEPt0AENACAMwDAkowVB14aDz0CTKui5b1gICoKCoCAoCAqCgqAgKAgK + goKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAgKAgKgoKgICgICoKCoCAoCAqCgqAg + KAgKgoKg1ZsPvpCB0hBohjQAAAAASUVORK5CYII= + + + \ No newline at end of file