From e9b223bdb11c0278b31120932e457dbab2a3cadd Mon Sep 17 00:00:00 2001 From: yibo <361071264@qq.com> Date: Thu, 26 Apr 2018 10:44:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ButcherFactory.BO/Bill/CarcassTakeOut.cs | 2 + ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs | 55 +-- .../CarcassInStoreForm.Designer.cs | 90 ++--- .../CarcassTakeOutForm.Designer.cs | 378 ++++++++++-------- .../CarcassTakeOut_/CarcassTakeOutForm.cs | 58 ++- 5 files changed, 335 insertions(+), 248 deletions(-) diff --git a/ButcherFactory.BO/Bill/CarcassTakeOut.cs b/ButcherFactory.BO/Bill/CarcassTakeOut.cs index 60ca667..0797647 100644 --- a/ButcherFactory.BO/Bill/CarcassTakeOut.cs +++ b/ButcherFactory.BO/Bill/CarcassTakeOut.cs @@ -19,6 +19,8 @@ namespace ButcherFactory.BO public long? Goods_ID { get; set; } + public long? ProductBatch_ID { get; set; } + public decimal? Weight { get; set; } public decimal? BeforeWeight { get; set; } diff --git a/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs b/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs index bd30c86..0cea67a 100644 --- a/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs +++ b/ButcherFactory.BO/LocalBL/CarcassTakeOutBL.cs @@ -15,30 +15,26 @@ namespace ButcherFactory.BO.LocalBL { public static class CarcassTakeOutBL { - const string RpcPath = @"/MainSystem/B3ClientService/Rpcs/CarcassTakeOutRpc/"; - public static CarcassTakeOut InsertOrUpdate(long? workUnitID, string barCode, out bool isNew) + public static CarcassTakeOut Insert(long? workUnitID, long? batchID, long? goodsID, string barCode) { using (var session = DmoSession.New()) { - var entity = GetEntityByBarCode(barCode, session); - if (entity == null) - { - entity = new CarcassTakeOut(); - entity.WorkUnit_ID = workUnitID; - entity.BarCode = barCode; - entity.UserID = AppContext.Worker.ID; - entity.RowIndex = GenerateRowIndex(session); - session.Insert(entity); - isNew = true; - } - else + var exist = CheckExist(barCode, session); + if (exist) + return null; + var entity = new CarcassTakeOut(); + entity.WorkUnit_ID = workUnitID; + if (string.IsNullOrEmpty(barCode)) { - if (entity.WorkUnit_ID != workUnitID) - Update(entity.ID, session, new Tuple("WorkUnit_ID", workUnitID)); - isNew = false; + entity.ProductBatch_ID = batchID; + entity.Goods_ID = goodsID; } + entity.UserID = AppContext.Worker.ID; + entity.BarCode = barCode; + entity.RowIndex = GenerateRowIndex(session); + session.Insert(entity); session.Commit(); return entity; } @@ -52,18 +48,14 @@ namespace ButcherFactory.BO.LocalBL return (query.EExecuteScalar(session) ?? 0) + 1; } - private static CarcassTakeOut GetEntityByBarCode(string barCode, IDmoSession session) + static bool CheckExist(string barCode, IDmoSession session) { if (string.IsNullOrEmpty(barCode)) - return null; + return false; var query = new DQueryDom(new JoinAlias(typeof(CarcassTakeOut))); - query.Columns.Add(DQSelectColumn.Field("ID")); - query.Columns.Add(DQSelectColumn.Field("WorkUnit_ID")); + query.Columns.Add(DQSelectColumn.Create(DQExpression.Value(1), "c")); query.Where.Conditions.Add(DQCondition.EQ("BarCode", barCode)); - var item = query.EExecuteScalar(); - if (item == null) - return null; - return new CarcassTakeOut() { ID = item.Item1, WorkUnit_ID = item.Item2 }; + return query.EExecuteScalar(session) != null; } static void Update(long id, IDmoSession session, params Tuple[] updates) @@ -239,6 +231,8 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("BarCode")); 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.Where.Conditions.Add(DQCondition.And(DQCondition.EQ("Submited", true), DQCondition.EQ("Sync", false))); @@ -256,8 +250,13 @@ namespace ButcherFactory.BO.LocalBL obj.BarCode = (string)reader[2]; obj.TakeOutWorker_ID = (long)reader[3]; obj.WorkUnit_ID = (long?)reader[4]; - obj.Weight = (decimal)reader[5]; - obj.Time = (DateTime)reader[6]; + if (string.IsNullOrEmpty(obj.BarCode)) + { + obj.ProductBatch_ID = (long?)reader[5]; + obj.Goods_ID = (long?)reader[6]; + } + obj.Weight = (decimal)reader[7]; + obj.Time = (DateTime)reader[8]; upload.Add(obj); } } @@ -280,6 +279,8 @@ namespace ButcherFactory.BO.LocalBL public string BarCode { get; set; } public long? TakeOutWorker_ID { get; set; } public long? WorkUnit_ID { get; set; } + public long? ProductBatch_ID { get; set; } + public long? Goods_ID { get; set; } public decimal? Weight { get; set; } public DateTime? Time { get; set; } } diff --git a/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.Designer.cs b/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.Designer.cs index e9313dc..aca3789 100644 --- a/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.Designer.cs +++ b/ButcherFactory.Form/CarcassInStore_/CarcassInStoreForm.Designer.cs @@ -29,16 +29,16 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CarcassInStoreForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = 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 dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = 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 dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.noCodeBtn = new WinFormControl.UButton(); this.noWeightBtn = new WinFormControl.UButton(); @@ -273,7 +273,6 @@ this.splitContainer2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; - this.splitContainer2.IsSplitterFixed = true; this.splitContainer2.Location = new System.Drawing.Point(0, 0); this.splitContainer2.Name = "splitContainer2"; // @@ -288,7 +287,7 @@ this.splitContainer2.Panel2.BackColor = System.Drawing.Color.Transparent; this.splitContainer2.Panel2.Controls.Add(this.flowLayoutPanel1); this.splitContainer2.Size = new System.Drawing.Size(1305, 521); - this.splitContainer2.SplitterDistance = 639; + this.splitContainer2.SplitterDistance = 637; this.splitContainer2.TabIndex = 0; // // groupBox2 @@ -301,7 +300,7 @@ this.groupBox2.Location = new System.Drawing.Point(11, 254); this.groupBox2.Name = "groupBox2"; this.groupBox2.Padding = new System.Windows.Forms.Padding(5); - this.groupBox2.Size = new System.Drawing.Size(614, 254); + this.groupBox2.Size = new System.Drawing.Size(612, 254); this.groupBox2.TabIndex = 1; this.groupBox2.TabStop = false; // @@ -311,15 +310,15 @@ this.historyDataGrid.AllowUserToDeleteRows = false; this.historyDataGrid.AllowUserToResizeColumns = false; this.historyDataGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle21.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle21; + dataGridViewCellStyle11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.historyDataGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11; this.historyDataGrid.BackgroundColor = System.Drawing.Color.White; this.historyDataGrid.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.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle22; + dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle12.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.historyDataGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12; this.historyDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.historyDataGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.H_ID, @@ -335,12 +334,12 @@ this.historyDataGrid.Name = "historyDataGrid"; this.historyDataGrid.ReadOnly = true; this.historyDataGrid.RowHeadersVisible = false; - dataGridViewCellStyle26.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle26.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle26; + dataGridViewCellStyle16.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle16; this.historyDataGrid.RowTemplate.Height = 23; this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.historyDataGrid.Size = new System.Drawing.Size(604, 230); + this.historyDataGrid.Size = new System.Drawing.Size(602, 230); this.historyDataGrid.TabIndex = 2; // // H_ID @@ -378,8 +377,8 @@ // H_Weight // this.H_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle23.Format = "#0.######"; - this.H_Weight.DefaultCellStyle = dataGridViewCellStyle23; + dataGridViewCellStyle13.Format = "#0.######"; + this.H_Weight.DefaultCellStyle = dataGridViewCellStyle13; this.H_Weight.HeaderText = "入库重量"; this.H_Weight.Name = "H_Weight"; this.H_Weight.ReadOnly = true; @@ -387,8 +386,8 @@ // H_BeforeWeight // this.H_BeforeWeight.DataPropertyName = "BeforeWeight"; - dataGridViewCellStyle24.Format = "#0.######"; - this.H_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle24; + dataGridViewCellStyle14.Format = "#0.######"; + this.H_BeforeWeight.DefaultCellStyle = dataGridViewCellStyle14; this.H_BeforeWeight.HeaderText = "胴体重量"; this.H_BeforeWeight.Name = "H_BeforeWeight"; this.H_BeforeWeight.ReadOnly = true; @@ -396,8 +395,8 @@ // H_Discont // this.H_Discont.DataPropertyName = "Discont"; - dataGridViewCellStyle25.Format = "#0.######"; - this.H_Discont.DefaultCellStyle = dataGridViewCellStyle25; + dataGridViewCellStyle15.Format = "#0.######"; + this.H_Discont.DefaultCellStyle = dataGridViewCellStyle15; this.H_Discont.HeaderText = "损耗"; this.H_Discont.Name = "H_Discont"; this.H_Discont.ReadOnly = true; @@ -422,7 +421,7 @@ this.groupBox1.Location = new System.Drawing.Point(11, 15); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(5); - this.groupBox1.Size = new System.Drawing.Size(614, 226); + this.groupBox1.Size = new System.Drawing.Size(612, 226); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; // @@ -432,15 +431,15 @@ this.needSubmitGrid.AllowUserToDeleteRows = false; this.needSubmitGrid.AllowUserToResizeColumns = false; this.needSubmitGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle27.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle27; + dataGridViewCellStyle17.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle17; this.needSubmitGrid.BackgroundColor = System.Drawing.Color.White; this.needSubmitGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle28.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle28.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle28.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle28.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle28; + dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle18.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle18.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle18; this.needSubmitGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.needSubmitGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.U_ID, @@ -453,12 +452,12 @@ this.needSubmitGrid.Name = "needSubmitGrid"; this.needSubmitGrid.ReadOnly = true; this.needSubmitGrid.RowHeadersVisible = false; - dataGridViewCellStyle30.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle30.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle30; + 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.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle20; this.needSubmitGrid.RowTemplate.Height = 23; this.needSubmitGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.needSubmitGrid.Size = new System.Drawing.Size(604, 202); + this.needSubmitGrid.Size = new System.Drawing.Size(602, 202); this.needSubmitGrid.TabIndex = 1; // // U_ID @@ -488,8 +487,8 @@ // U_Weight // this.U_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle29.Format = "#0.######"; - this.U_Weight.DefaultCellStyle = dataGridViewCellStyle29; + dataGridViewCellStyle19.Format = "#0.######"; + this.U_Weight.DefaultCellStyle = dataGridViewCellStyle19; this.U_Weight.HeaderText = "重量"; this.U_Weight.Name = "U_Weight"; this.U_Weight.ReadOnly = true; @@ -508,10 +507,11 @@ // // flowLayoutPanel1 // + this.flowLayoutPanel1.AutoScroll = true; this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(660, 519); + this.flowLayoutPanel1.Size = new System.Drawing.Size(662, 519); this.flowLayoutPanel1.TabIndex = 0; // // CarcassInStoreForm diff --git a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs index 6b0db20..a8467a1 100644 --- a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs +++ b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.Designer.cs @@ -28,21 +28,22 @@ /// private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CarcassTakeOutForm)); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = 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 dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = 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 dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CarcassTakeOutForm)); this.workUnitSelect = new System.Windows.Forms.ComboBox(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.noBarCode = new WinFormControl.UButton(); this.closeBtn = new WinFormControl.UButton(); this.uTimerLabel1 = new WinFormControl.UTimerLabel(); this.uScanPanel1 = new WinFormControl.UScanPanel(); @@ -59,21 +60,23 @@ this.H_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.uLabel4 = new WinFormControl.ULabel(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.weightGrid = new WinFormControl.UDataGridView(); + this.W_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.W_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.needSubmitGrid = new WinFormControl.UDataGridView(); this.readBtn = new WinFormControl.UButton(); this.submitBtn = new WinFormControl.UButton(); - this.needSubmitGrid = new WinFormControl.UDataGridView(); + this.uLabel3 = new WinFormControl.ULabel(); + this.productBatchSelect = new System.Windows.Forms.ComboBox(); + this.uLabel2 = new WinFormControl.ULabel(); this.U_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_RowIndex = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_BeforeWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.U_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.uLabel3 = new WinFormControl.ULabel(); - this.weightGrid = new WinFormControl.UDataGridView(); - this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.W_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.W_Weight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.noBarCode = new WinFormControl.UButton(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -81,12 +84,12 @@ this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.historyDataGrid)).BeginInit(); this.groupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.needSubmitGrid)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.weightGrid)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); this.splitContainer2.Panel1.SuspendLayout(); this.splitContainer2.Panel2.SuspendLayout(); this.splitContainer2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.weightGrid)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.needSubmitGrid)).BeginInit(); this.SuspendLayout(); // // workUnitSelect @@ -94,7 +97,7 @@ 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(843, 11); + 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 = 3; @@ -113,6 +116,8 @@ // splitContainer1.Panel1 // this.splitContainer1.Panel1.BackColor = System.Drawing.Color.Transparent; + this.splitContainer1.Panel1.Controls.Add(this.productBatchSelect); + this.splitContainer1.Panel1.Controls.Add(this.uLabel2); this.splitContainer1.Panel1.Controls.Add(this.noBarCode); this.splitContainer1.Panel1.Controls.Add(this.closeBtn); this.splitContainer1.Panel1.Controls.Add(this.uTimerLabel1); @@ -124,25 +129,51 @@ // // 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(1164, 611); + this.splitContainer1.Size = new System.Drawing.Size(1305, 611); this.splitContainer1.SplitterDistance = 86; this.splitContainer1.TabIndex = 1; // + // noBarCode + // + this.noBarCode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.noBarCode.AsClicked = false; + this.noBarCode.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("noBarCode.BackgroundImage"))); + this.noBarCode.EnableGroup = false; + this.noBarCode.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); + this.noBarCode.FlatAppearance.BorderSize = 0; + this.noBarCode.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.noBarCode.Font = new System.Drawing.Font("宋体", 15F); + this.noBarCode.ForeColor = System.Drawing.Color.Black; + this.noBarCode.Location = new System.Drawing.Point(591, 45); + this.noBarCode.Name = "noBarCode"; + this.noBarCode.PlaySound = false; + this.noBarCode.SelfControlEnable = false; + this.noBarCode.Size = new System.Drawing.Size(114, 34); + this.noBarCode.SoundType = WinFormControl.SoundType.Click; + this.noBarCode.TabIndex = 14; + this.noBarCode.Text = "无 码"; + this.noBarCode.UseVisualStyleBackColor = true; + this.noBarCode.WithStataHode = false; + this.noBarCode.Click += new System.EventHandler(this.noBarCode_Click); + // // 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(1046, 7); + 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; @@ -158,7 +189,7 @@ 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(1024, 53); + 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; @@ -168,7 +199,7 @@ // this.uScanPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.uScanPanel1.BackColor = System.Drawing.Color.Transparent; - this.uScanPanel1.Location = new System.Drawing.Point(439, 9); + this.uScanPanel1.Location = new System.Drawing.Point(580, 9); this.uScanPanel1.Name = "uScanPanel1"; this.uScanPanel1.Size = new System.Drawing.Size(303, 32); this.uScanPanel1.TabIndex = 2; @@ -196,7 +227,7 @@ 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(742, 14); + 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; @@ -212,7 +243,7 @@ this.groupBox2.Location = new System.Drawing.Point(11, 284); this.groupBox2.Name = "groupBox2"; this.groupBox2.Padding = new System.Windows.Forms.Padding(5); - this.groupBox2.Size = new System.Drawing.Size(1140, 222); + this.groupBox2.Size = new System.Drawing.Size(776, 222); this.groupBox2.TabIndex = 3; this.groupBox2.TabStop = false; // @@ -250,7 +281,7 @@ this.historyDataGrid.RowsDefaultCellStyle = dataGridViewCellStyle5; this.historyDataGrid.RowTemplate.Height = 23; this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.historyDataGrid.Size = new System.Drawing.Size(1130, 198); + this.historyDataGrid.Size = new System.Drawing.Size(766, 198); this.historyDataGrid.TabIndex = 2; // // H_ID @@ -326,14 +357,119 @@ 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(1140, 265); + this.groupBox1.Size = new System.Drawing.Size(776, 265); this.groupBox1.TabIndex = 2; this.groupBox1.TabStop = false; // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Bottom; + this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; + this.splitContainer2.IsSplitterFixed = true; + this.splitContainer2.Location = new System.Drawing.Point(5, 60); + this.splitContainer2.Name = "splitContainer2"; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.weightGrid); + // + // splitContainer2.Panel2 + // + this.splitContainer2.Panel2.Controls.Add(this.needSubmitGrid); + this.splitContainer2.Size = new System.Drawing.Size(766, 200); + this.splitContainer2.SplitterDistance = 254; + this.splitContainer2.TabIndex = 14; + // + // weightGrid + // + this.weightGrid.AllowUserToAddRows = false; + this.weightGrid.AllowUserToDeleteRows = false; + this.weightGrid.AllowUserToResizeColumns = false; + this.weightGrid.AllowUserToResizeRows = false; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.weightGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; + this.weightGrid.BackgroundColor = System.Drawing.Color.White; + this.weightGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle7.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.weightGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7; + this.weightGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.weightGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.W_ID, + this.W_Weight}); + this.weightGrid.Dock = System.Windows.Forms.DockStyle.Fill; + this.weightGrid.Location = new System.Drawing.Point(0, 0); + this.weightGrid.MultiSelect = false; + this.weightGrid.Name = "weightGrid"; + this.weightGrid.ReadOnly = true; + this.weightGrid.RowHeadersVisible = false; + dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.weightGrid.RowsDefaultCellStyle = dataGridViewCellStyle8; + this.weightGrid.RowTemplate.Height = 23; + this.weightGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.weightGrid.Size = new System.Drawing.Size(254, 200); + this.weightGrid.TabIndex = 14; + // + // W_ID + // + this.W_ID.DataPropertyName = "ID"; + this.W_ID.HeaderText = "序号"; + this.W_ID.Name = "W_ID"; + this.W_ID.ReadOnly = true; + // + // W_Weight + // + this.W_Weight.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.W_Weight.DataPropertyName = "Weight"; + this.W_Weight.HeaderText = "重量"; + this.W_Weight.Name = "W_Weight"; + this.W_Weight.ReadOnly = true; + // + // needSubmitGrid + // + this.needSubmitGrid.AllowUserToAddRows = false; + this.needSubmitGrid.AllowUserToDeleteRows = false; + this.needSubmitGrid.AllowUserToResizeColumns = false; + this.needSubmitGrid.AllowUserToResizeRows = false; + dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9; + this.needSubmitGrid.BackgroundColor = System.Drawing.Color.White; + this.needSubmitGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; + dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle10.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10; + 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_BarCode, + this.U_Goods_Name, + this.U_BeforeWeight, + this.U_Weight}); + this.needSubmitGrid.Dock = System.Windows.Forms.DockStyle.Fill; + this.needSubmitGrid.Location = new System.Drawing.Point(0, 0); + this.needSubmitGrid.MultiSelect = false; + this.needSubmitGrid.Name = "needSubmitGrid"; + this.needSubmitGrid.ReadOnly = true; + this.needSubmitGrid.RowHeadersVisible = false; + dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle12; + this.needSubmitGrid.RowTemplate.Height = 23; + this.needSubmitGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.needSubmitGrid.Size = new System.Drawing.Size(508, 200); + this.needSubmitGrid.TabIndex = 1; + // // readBtn // this.readBtn.AsClicked = false; this.readBtn.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("readBtn.BackgroundImage"))); + this.readBtn.EnableGroup = false; this.readBtn.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); this.readBtn.FlatAppearance.BorderSize = 0; this.readBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; @@ -342,6 +478,7 @@ this.readBtn.Location = new System.Drawing.Point(145, 20); this.readBtn.Name = "readBtn"; this.readBtn.PlaySound = false; + this.readBtn.SelfControlEnable = false; this.readBtn.Size = new System.Drawing.Size(114, 34); this.readBtn.SoundType = WinFormControl.SoundType.Click; this.readBtn.TabIndex = 13; @@ -354,6 +491,7 @@ // 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; @@ -362,6 +500,7 @@ 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; @@ -370,42 +509,38 @@ this.submitBtn.WithStataHode = false; this.submitBtn.Click += new System.EventHandler(this.submitBtn_Click); // - // needSubmitGrid + // uLabel3 // - this.needSubmitGrid.AllowUserToAddRows = false; - this.needSubmitGrid.AllowUserToDeleteRows = false; - this.needSubmitGrid.AllowUserToResizeColumns = false; - this.needSubmitGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle9.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.needSubmitGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9; - this.needSubmitGrid.BackgroundColor = System.Drawing.Color.White; - this.needSubmitGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle10.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.needSubmitGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10; - 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_BarCode, - this.U_Goods_Name, - this.U_BeforeWeight, - this.U_Weight}); - this.needSubmitGrid.Dock = System.Windows.Forms.DockStyle.Fill; - this.needSubmitGrid.Location = new System.Drawing.Point(0, 0); - this.needSubmitGrid.MultiSelect = false; - this.needSubmitGrid.Name = "needSubmitGrid"; - this.needSubmitGrid.ReadOnly = true; - this.needSubmitGrid.RowHeadersVisible = false; - dataGridViewCellStyle12.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.needSubmitGrid.RowsDefaultCellStyle = dataGridViewCellStyle12; - this.needSubmitGrid.RowTemplate.Height = 23; - this.needSubmitGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.needSubmitGrid.Size = new System.Drawing.Size(872, 200); - this.needSubmitGrid.TabIndex = 1; + 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 = "领料明细"; + // + // 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 = 15; + // + // 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 = "生产批次:"; // // U_ID // @@ -446,7 +581,6 @@ this.U_BeforeWeight.HeaderText = "入库重量"; this.U_BeforeWeight.Name = "U_BeforeWeight"; this.U_BeforeWeight.ReadOnly = true; - this.U_BeforeWeight.Width = 150; // // U_Weight // @@ -454,115 +588,26 @@ this.U_Weight.HeaderText = "重量"; this.U_Weight.Name = "U_Weight"; this.U_Weight.ReadOnly = true; - this.U_Weight.Width = 150; - // - // 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 = "领料明细"; - // - // weightGrid - // - this.weightGrid.AllowUserToAddRows = false; - this.weightGrid.AllowUserToDeleteRows = false; - this.weightGrid.AllowUserToResizeColumns = false; - this.weightGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.weightGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; - this.weightGrid.BackgroundColor = System.Drawing.Color.White; - this.weightGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle7.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.weightGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7; - this.weightGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.weightGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.W_ID, - this.W_Weight}); - this.weightGrid.Dock = System.Windows.Forms.DockStyle.Fill; - this.weightGrid.Location = new System.Drawing.Point(0, 0); - this.weightGrid.MultiSelect = false; - this.weightGrid.Name = "weightGrid"; - this.weightGrid.ReadOnly = true; - this.weightGrid.RowHeadersVisible = false; - dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle8.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.weightGrid.RowsDefaultCellStyle = dataGridViewCellStyle8; - this.weightGrid.RowTemplate.Height = 23; - this.weightGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.weightGrid.Size = new System.Drawing.Size(254, 200); - this.weightGrid.TabIndex = 14; - // - // splitContainer2 - // - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Bottom; - this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; - this.splitContainer2.IsSplitterFixed = true; - this.splitContainer2.Location = new System.Drawing.Point(5, 60); - this.splitContainer2.Name = "splitContainer2"; - // - // splitContainer2.Panel1 - // - this.splitContainer2.Panel1.Controls.Add(this.weightGrid); - // - // splitContainer2.Panel2 - // - this.splitContainer2.Panel2.Controls.Add(this.needSubmitGrid); - this.splitContainer2.Size = new System.Drawing.Size(1130, 200); - this.splitContainer2.SplitterDistance = 254; - this.splitContainer2.TabIndex = 14; - // - // W_ID - // - this.W_ID.DataPropertyName = "ID"; - this.W_ID.HeaderText = "序号"; - this.W_ID.Name = "W_ID"; - this.W_ID.ReadOnly = true; - // - // W_Weight - // - this.W_Weight.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.W_Weight.DataPropertyName = "Weight"; - this.W_Weight.HeaderText = "重量"; - this.W_Weight.Name = "W_Weight"; - this.W_Weight.ReadOnly = true; // - // noBarCode + // flowLayoutPanel1 // - this.noBarCode.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.noBarCode.AsClicked = false; - this.noBarCode.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("noBarCode.BackgroundImage"))); - this.noBarCode.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(155)))), ((int)(((byte)(214))))); - this.noBarCode.FlatAppearance.BorderSize = 0; - this.noBarCode.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.noBarCode.Font = new System.Drawing.Font("宋体", 15F); - this.noBarCode.ForeColor = System.Drawing.Color.Black; - this.noBarCode.Location = new System.Drawing.Point(450, 45); - this.noBarCode.Name = "noBarCode"; - this.noBarCode.PlaySound = false; - this.noBarCode.Size = new System.Drawing.Size(114, 34); - this.noBarCode.SoundType = WinFormControl.SoundType.Click; - this.noBarCode.TabIndex = 14; - this.noBarCode.Text = "无 码"; - this.noBarCode.UseVisualStyleBackColor = true; - this.noBarCode.WithStataHode = false; - this.noBarCode.Click += new System.EventHandler(this.noBarCode_Click); + 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(793, -1); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(514, 521); + this.flowLayoutPanel1.TabIndex = 4; // // CarcassTakeOutForm // 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(1164, 611); + this.ClientSize = new System.Drawing.Size(1305, 611); this.Controls.Add(this.splitContainer1); - this.MinimumSize = new System.Drawing.Size(1180, 650); + this.MinimumSize = new System.Drawing.Size(1321, 650); this.Name = "CarcassTakeOutForm"; this.Text = "白条领用"; this.splitContainer1.Panel1.ResumeLayout(false); @@ -575,12 +620,12 @@ ((System.ComponentModel.ISupportInitialize)(this.historyDataGrid)).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.needSubmitGrid)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.weightGrid)).EndInit(); this.splitContainer2.Panel1.ResumeLayout(false); this.splitContainer2.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); this.splitContainer2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.weightGrid)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.needSubmitGrid)).EndInit(); this.ResumeLayout(false); } @@ -609,17 +654,20 @@ private System.Windows.Forms.DataGridViewTextBoxColumn H_Goods_Name; private System.Windows.Forms.DataGridViewTextBoxColumn H_BeforeWeight; private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight; + private WinFormControl.UDataGridView weightGrid; + private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.DataGridViewTextBoxColumn W_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn W_Weight; + private WinFormControl.UButton noBarCode; + private System.Windows.Forms.ComboBox productBatchSelect; + private WinFormControl.ULabel uLabel2; private System.Windows.Forms.DataGridViewTextBoxColumn U_ID; private System.Windows.Forms.DataGridViewTextBoxColumn U_RowIndex; private System.Windows.Forms.DataGridViewTextBoxColumn U_BarCode; private System.Windows.Forms.DataGridViewTextBoxColumn U_Goods_Name; private System.Windows.Forms.DataGridViewTextBoxColumn U_BeforeWeight; private System.Windows.Forms.DataGridViewTextBoxColumn U_Weight; - private WinFormControl.UDataGridView weightGrid; - private System.Windows.Forms.SplitContainer splitContainer2; - private System.Windows.Forms.DataGridViewTextBoxColumn W_ID; - private System.Windows.Forms.DataGridViewTextBoxColumn W_Weight; - private WinFormControl.UButton noBarCode; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; } } \ No newline at end of file diff --git a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs index 8edb82a..eba0b40 100644 --- a/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs +++ b/ButcherFactory.Form/CarcassTakeOut_/CarcassTakeOutForm.cs @@ -13,6 +13,7 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using ButcherFactory.Utils; +using WinFormControl; namespace ButcherFactory.CarcassTakeOut_ { @@ -36,6 +37,7 @@ namespace ButcherFactory.CarcassTakeOut_ BindingList historyList; BindingList weightList; long? workUnitID; + long? batchID; public CarcassTakeOutForm() { InitializeComponent(); @@ -49,6 +51,13 @@ namespace ButcherFactory.CarcassTakeOut_ workUnitID = (long)workUnitSelect.SelectedValue; XmlUtil.SerializerObjToFile(new CarcassTakeOutFormConfig { WorkUnitID = workUnitID }); }; + productBatchSelect.SelectedIndexChanged += delegate + { + if (productBatchSelect.SelectedValue == null) + batchID = null; + else + batchID = (long)productBatchSelect.SelectedValue; + }; this.FormClosing += delegate { if (syncBeforeInfo != null && syncBeforeInfo.IsAlive) @@ -81,13 +90,37 @@ namespace ButcherFactory.CarcassTakeOut_ BaseInfoSyncRpc.SyncBaseInfo(); } + productBatchSelect.EBindComboBox(x => x.Date == DateTime.Today, "Date"); var config = XmlUtil.DeserializeFromFile(); workUnitSelect.EBindComboBox(x => x.ID == config.WorkUnitID); + BindGoods(); BindGrid(); })); } + bool noCode = false; + 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 += (sender, e) => + { + if (batchID == null) + throw new Exception("请先选择批次"); + if (!noCode) + throw new Exception("如果无码请先点击无码按钮"); + var c = sender as UButton; + Insert(null, (long)c.Tag, c.Text); + noBarCode_Click(sender, EventArgs.Empty); + noBarCode.AsClicked = false; + }; + flowLayoutPanel1.Controls.Add(btn); + } + } + void BindGrid() { weightList = CarcassTakeOutBL.GetWeightList(); @@ -114,7 +147,7 @@ namespace ButcherFactory.CarcassTakeOut_ if (netStateWatch1.NetState) { bool ff = true; - var list = needSubmitedList.Where(x => x.BeforeWeight == null&&!string.IsNullOrEmpty(x.BarCode)).Take(5); + var list = needSubmitedList.Where(x => x.BeforeWeight == null && !string.IsNullOrEmpty(x.BarCode)).Take(5); if (!list.Any()) { list = historyList.Where(x => x.BeforeWeight == null && !string.IsNullOrEmpty(x.BarCode)).Take(5); @@ -167,18 +200,18 @@ namespace ButcherFactory.CarcassTakeOut_ throw new Exception("请先扫码"); if (barCode.Length != 23) throw new Exception("条码格式不正确"); - FillCode(barCode); + Insert(barCode, null, null); } - void FillCode(string barCode) + void Insert(string barCode, long? goodsID, string goodsName) { - bool isNew; - var entity = CarcassTakeOutBL.InsertOrUpdate(workUnitID, barCode, out isNew); - if (isNew) - { - needSubmitedList.Insert(0, entity); - needSubmitGrid.Refresh(); - } + var entity = CarcassTakeOutBL.Insert(workUnitID, batchID, goodsID, barCode); + if (entity == null) + return; + if (string.IsNullOrEmpty(barCode)) + entity.Goods_Name = goodsName; + needSubmitedList.Insert(0, entity); + needSubmitGrid.Refresh(); } private void closeBtn_Click(object sender, EventArgs e) @@ -199,6 +232,8 @@ namespace ButcherFactory.CarcassTakeOut_ foreach (var item in arr) { historyList.Insert(0, item); + if (historyList.Count > 100) + historyList.RemoveAt(100); needSubmitedList.Remove(item); } weightList.Clear(); @@ -220,7 +255,8 @@ namespace ButcherFactory.CarcassTakeOut_ private void noBarCode_Click(object sender, EventArgs e) { - FillCode(string.Empty); + noCode = !noCode; + noBarCode.Text = noCode ? "等待插入" : "无 码"; } } }