diff --git a/BO/BO/Bill/WeightBill/WeightBill.cs b/BO/BO/Bill/WeightBill/WeightBill.cs index 5b15ed4..9ee9dae 100644 --- a/BO/BO/Bill/WeightBill/WeightBill.cs +++ b/BO/BO/Bill/WeightBill/WeightBill.cs @@ -49,7 +49,6 @@ namespace BO.BO public decimal? ShackPrice { get; set; } - [NonDmoProperty] public decimal? ShackMoney { get @@ -105,6 +104,8 @@ namespace BO.BO } } + public int? HouseNumber { get { if (_houseDetails.Any()) return _details.Sum(x => (x.Number ?? 0)); return null; } } + private List _sanctionDetails = new List(); public List SanctionDetails { get { return _sanctionDetails; } } diff --git a/BO/Utils/BillRpc/WeightBillRpc.cs b/BO/Utils/BillRpc/WeightBillRpc.cs index 24dec2e..d855abe 100644 --- a/BO/Utils/BillRpc/WeightBillRpc.cs +++ b/BO/Utils/BillRpc/WeightBillRpc.cs @@ -202,5 +202,21 @@ namespace BO.Utils.BillRpc } return result; } + + public static List GetUnHousedBill(DateTime date) + { + const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/WeightBillRpc/GetNoHouseInfoWeightBills"; + var list = RpcFacade.Call>(method, date); + var result = new List(); + foreach (var obj in list) + { + var entity = new WeightBill(); + result.Add(entity); + entity.ID = obj.Get("ID"); + entity.B3ID = obj.Get("B3ID"); + entity.Supplier_Name = obj.Get("Supplier_Name"); + } + return result; + } } } diff --git a/QualityAndOrder/QualityOrderForm.Designer.cs b/QualityAndOrder/QualityOrderForm.Designer.cs index e060c5e..8bb9bd8 100644 --- a/QualityAndOrder/QualityOrderForm.Designer.cs +++ b/QualityAndOrder/QualityOrderForm.Designer.cs @@ -46,18 +46,6 @@ this.uTabControl2 = new BWP.WinFormControl.UTabControl(); this.tabPage3 = new System.Windows.Forms.TabPage(); this.sanctionGrid = new BWP.WinFormControl.UDataGridView(); - this.S_Sanction_ID1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_AbnormalItem_ID1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_AbnormalItem_Name1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_Number1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_Sanction_ID2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_AbnormalItem_ID2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_AbnormalItem_Name2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_Number2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_Sanction_ID3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_AbnormalItem_ID3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_AbnormalItem_Name3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.S_Number3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.tabPage4 = new System.Windows.Forms.TabPage(); this.housePanel = new System.Windows.Forms.TabControl(); this.label3 = new System.Windows.Forms.Label(); @@ -68,11 +56,11 @@ this.numberBox = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.keyBoardPanel = new System.Windows.Forms.FlowLayoutPanel(); - this.uDataGridView1 = new BWP.WinFormControl.UDataGridView(); + this.weightBillGrid = new BWP.WinFormControl.UDataGridView(); this.W_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.W_B3ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.W_Supplier_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.W_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.W_HouseNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.W_HouseNames = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.syncBtn = new System.Windows.Forms.Button(); this.testTimeInput = new BWP.WinFormControl.UDatePicker(); @@ -101,6 +89,18 @@ this.tab2SyncBtn = new System.Windows.Forms.Button(); this.tab2DateSelect = new BWP.WinFormControl.UDatePicker(); this.label4 = new System.Windows.Forms.Label(); + this.S_AbnormalItem_Name1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_Number1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_AbnormalItem_Name2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_Number2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_AbnormalItem_Name3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_Number3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_Sanction_ID1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_AbnormalItem_ID1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_Sanction_ID2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_AbnormalItem_ID2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_Sanction_ID3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.S_AbnormalItem_ID3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.uTabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.panel1.SuspendLayout(); @@ -108,7 +108,7 @@ this.tabPage3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.sanctionGrid)).BeginInit(); this.tabPage4.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.weightBillGrid)).BeginInit(); this.tabPage2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.preOrderGrid)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.orderGrid)).BeginInit(); @@ -139,7 +139,7 @@ this.tabPage1.Controls.Add(this.numberBox); this.tabPage1.Controls.Add(this.label1); this.tabPage1.Controls.Add(this.keyBoardPanel); - this.tabPage1.Controls.Add(this.uDataGridView1); + this.tabPage1.Controls.Add(this.weightBillGrid); this.tabPage1.Controls.Add(this.syncBtn); this.tabPage1.Controls.Add(this.testTimeInput); this.tabPage1.Controls.Add(this.label20); @@ -204,22 +204,23 @@ this.sanctionGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.sanctionGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.sanctionGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.S_Sanction_ID1, - this.S_AbnormalItem_ID1, this.S_AbnormalItem_Name1, this.S_Number1, - this.S_Sanction_ID2, - this.S_AbnormalItem_ID2, this.S_AbnormalItem_Name2, this.S_Number2, - this.S_Sanction_ID3, - this.S_AbnormalItem_ID3, this.S_AbnormalItem_Name3, - this.S_Number3}); + this.S_Number3, + this.S_Sanction_ID1, + this.S_AbnormalItem_ID1, + this.S_Sanction_ID2, + this.S_AbnormalItem_ID2, + this.S_Sanction_ID3, + this.S_AbnormalItem_ID3}); this.sanctionGrid.Dock = System.Windows.Forms.DockStyle.Fill; this.sanctionGrid.Location = new System.Drawing.Point(3, 3); this.sanctionGrid.MultiSelect = false; this.sanctionGrid.Name = "sanctionGrid"; + this.sanctionGrid.ReadOnly = true; this.sanctionGrid.RowHeadersVisible = false; dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); this.sanctionGrid.RowsDefaultCellStyle = dataGridViewCellStyle3; @@ -229,90 +230,6 @@ this.sanctionGrid.Size = new System.Drawing.Size(717, 540); this.sanctionGrid.TabIndex = 43; // - // S_Sanction_ID1 - // - this.S_Sanction_ID1.DataPropertyName = "Sanction_ID1"; - this.S_Sanction_ID1.HeaderText = "Sanction_ID1"; - this.S_Sanction_ID1.Name = "S_Sanction_ID1"; - this.S_Sanction_ID1.Visible = false; - // - // S_AbnormalItem_ID1 - // - this.S_AbnormalItem_ID1.DataPropertyName = "AbnormalItem_ID1"; - this.S_AbnormalItem_ID1.HeaderText = "AbnormalItem_ID1"; - this.S_AbnormalItem_ID1.Name = "S_AbnormalItem_ID1"; - this.S_AbnormalItem_ID1.Visible = false; - // - // S_AbnormalItem_Name1 - // - this.S_AbnormalItem_Name1.DataPropertyName = "AbnormalItem_Name1"; - this.S_AbnormalItem_Name1.HeaderText = "异常项"; - this.S_AbnormalItem_Name1.Name = "S_AbnormalItem_Name1"; - this.S_AbnormalItem_Name1.ReadOnly = true; - // - // S_Number1 - // - this.S_Number1.DataPropertyName = "Number1"; - this.S_Number1.HeaderText = "头数"; - this.S_Number1.Name = "S_Number1"; - this.S_Number1.Width = 135; - // - // S_Sanction_ID2 - // - this.S_Sanction_ID2.DataPropertyName = "Sanction_ID2"; - this.S_Sanction_ID2.HeaderText = "Sanction_ID2"; - this.S_Sanction_ID2.Name = "S_Sanction_ID2"; - this.S_Sanction_ID2.Visible = false; - // - // S_AbnormalItem_ID2 - // - this.S_AbnormalItem_ID2.DataPropertyName = "AbnormalItem_ID2"; - this.S_AbnormalItem_ID2.HeaderText = "AbnormalItem_ID2"; - this.S_AbnormalItem_ID2.Name = "S_AbnormalItem_ID2"; - this.S_AbnormalItem_ID2.Visible = false; - // - // S_AbnormalItem_Name2 - // - this.S_AbnormalItem_Name2.DataPropertyName = "AbnormalItem_Name2"; - this.S_AbnormalItem_Name2.HeaderText = "异常项"; - this.S_AbnormalItem_Name2.Name = "S_AbnormalItem_Name2"; - this.S_AbnormalItem_Name2.ReadOnly = true; - // - // S_Number2 - // - this.S_Number2.DataPropertyName = "Number2"; - this.S_Number2.HeaderText = "头数"; - this.S_Number2.Name = "S_Number2"; - this.S_Number2.Width = 135; - // - // S_Sanction_ID3 - // - this.S_Sanction_ID3.DataPropertyName = "Sanction_ID3"; - this.S_Sanction_ID3.HeaderText = "Sanction_ID3"; - this.S_Sanction_ID3.Name = "S_Sanction_ID3"; - this.S_Sanction_ID3.Visible = false; - // - // S_AbnormalItem_ID3 - // - this.S_AbnormalItem_ID3.DataPropertyName = "AbnormalItem_ID3"; - this.S_AbnormalItem_ID3.HeaderText = "AbnormalItem_ID3"; - this.S_AbnormalItem_ID3.Name = "S_AbnormalItem_ID3"; - this.S_AbnormalItem_ID3.Visible = false; - // - // S_AbnormalItem_Name3 - // - this.S_AbnormalItem_Name3.DataPropertyName = "AbnormalItem_Name3"; - this.S_AbnormalItem_Name3.HeaderText = "异常项"; - this.S_AbnormalItem_Name3.Name = "S_AbnormalItem_Name3"; - this.S_AbnormalItem_Name3.ReadOnly = true; - // - // S_Number3 - // - this.S_Number3.DataPropertyName = "Number3"; - this.S_Number3.HeaderText = "头数"; - this.S_Number3.Name = "S_Number3"; - this.S_Number3.Width = 135; - // // tabPage4 // this.tabPage4.Controls.Add(this.housePanel); @@ -387,6 +304,7 @@ this.commitBtn.TabIndex = 40; this.commitBtn.Text = "提交"; this.commitBtn.UseVisualStyleBackColor = true; + this.commitBtn.Click += new System.EventHandler(this.commitBtn_Click); // // numberBox // @@ -415,15 +333,15 @@ this.keyBoardPanel.Size = new System.Drawing.Size(452, 241); this.keyBoardPanel.TabIndex = 37; // - // uDataGridView1 + // weightBillGrid // - this.uDataGridView1.AllowUserToAddRows = false; - this.uDataGridView1.AllowUserToDeleteRows = false; - this.uDataGridView1.AllowUserToResizeColumns = false; - this.uDataGridView1.AllowUserToResizeRows = false; + this.weightBillGrid.AllowUserToAddRows = false; + this.weightBillGrid.AllowUserToDeleteRows = false; + this.weightBillGrid.AllowUserToResizeColumns = false; + this.weightBillGrid.AllowUserToResizeRows = false; dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; - this.uDataGridView1.BackgroundColor = System.Drawing.Color.White; + this.weightBillGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; + this.weightBillGrid.BackgroundColor = System.Drawing.Color.White; dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F); @@ -431,30 +349,32 @@ dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; - this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.weightBillGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; + this.weightBillGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.weightBillGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.W_ID, this.W_B3ID, this.W_Supplier_Name, - this.W_Number, + this.W_HouseNumber, this.W_HouseNames}); - this.uDataGridView1.Location = new System.Drawing.Point(25, 77); - this.uDataGridView1.MultiSelect = false; - this.uDataGridView1.Name = "uDataGridView1"; - this.uDataGridView1.RowHeadersVisible = false; + this.weightBillGrid.Location = new System.Drawing.Point(25, 77); + this.weightBillGrid.MultiSelect = false; + this.weightBillGrid.Name = "weightBillGrid"; + this.weightBillGrid.ReadOnly = true; + this.weightBillGrid.RowHeadersVisible = false; dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle6; - this.uDataGridView1.RowTemplate.Height = 23; - this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.uDataGridView1.Size = new System.Drawing.Size(452, 401); - this.uDataGridView1.TabIndex = 34; + this.weightBillGrid.RowsDefaultCellStyle = dataGridViewCellStyle6; + this.weightBillGrid.RowTemplate.Height = 50; + this.weightBillGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.weightBillGrid.Size = new System.Drawing.Size(452, 401); + this.weightBillGrid.TabIndex = 34; // // W_ID // this.W_ID.DataPropertyName = "ID"; this.W_ID.HeaderText = "ID"; this.W_ID.Name = "W_ID"; + this.W_ID.ReadOnly = true; this.W_ID.Visible = false; // // W_B3ID @@ -462,25 +382,29 @@ this.W_B3ID.DataPropertyName = "B3ID"; this.W_B3ID.HeaderText = "过磅单号"; this.W_B3ID.Name = "W_B3ID"; + this.W_B3ID.ReadOnly = true; // // W_Supplier_Name // this.W_Supplier_Name.DataPropertyName = "Supplier_Name"; this.W_Supplier_Name.HeaderText = "供应商"; this.W_Supplier_Name.Name = "W_Supplier_Name"; + this.W_Supplier_Name.ReadOnly = true; this.W_Supplier_Name.Width = 120; // - // W_Number + // W_HouseNumber // - this.W_Number.DataPropertyName = "Number"; - this.W_Number.HeaderText = "头数"; - this.W_Number.Name = "W_Number"; + this.W_HouseNumber.DataPropertyName = "HouseNumber"; + this.W_HouseNumber.HeaderText = "头数"; + this.W_HouseNumber.Name = "W_HouseNumber"; + this.W_HouseNumber.ReadOnly = true; // // W_HouseNames // this.W_HouseNames.DataPropertyName = "HouseNames"; this.W_HouseNames.HeaderText = "圈舍"; this.W_HouseNames.Name = "W_HouseNames"; + this.W_HouseNames.ReadOnly = true; this.W_HouseNames.Width = 120; // // syncBtn @@ -492,6 +416,7 @@ this.syncBtn.TabIndex = 33; this.syncBtn.Text = "同步"; this.syncBtn.UseVisualStyleBackColor = true; + this.syncBtn.Click += new System.EventHandler(this.syncBtn_Click); // // testTimeInput // @@ -786,6 +711,99 @@ this.label4.TabIndex = 35; this.label4.Text = "日期:"; // + // S_AbnormalItem_Name1 + // + this.S_AbnormalItem_Name1.DataPropertyName = "AbnormalItem_Name1"; + this.S_AbnormalItem_Name1.HeaderText = "异常项"; + this.S_AbnormalItem_Name1.Name = "S_AbnormalItem_Name1"; + this.S_AbnormalItem_Name1.ReadOnly = true; + // + // S_Number1 + // + this.S_Number1.DataPropertyName = "Number1"; + this.S_Number1.HeaderText = "头数"; + this.S_Number1.Name = "S_Number1"; + this.S_Number1.ReadOnly = true; + this.S_Number1.Width = 135; + // + // S_AbnormalItem_Name2 + // + this.S_AbnormalItem_Name2.DataPropertyName = "AbnormalItem_Name2"; + this.S_AbnormalItem_Name2.HeaderText = "异常项"; + this.S_AbnormalItem_Name2.Name = "S_AbnormalItem_Name2"; + this.S_AbnormalItem_Name2.ReadOnly = true; + // + // S_Number2 + // + this.S_Number2.DataPropertyName = "Number2"; + this.S_Number2.HeaderText = "头数"; + this.S_Number2.Name = "S_Number2"; + this.S_Number2.ReadOnly = true; + this.S_Number2.Width = 135; + // + // S_AbnormalItem_Name3 + // + this.S_AbnormalItem_Name3.DataPropertyName = "AbnormalItem_Name3"; + this.S_AbnormalItem_Name3.HeaderText = "异常项"; + this.S_AbnormalItem_Name3.Name = "S_AbnormalItem_Name3"; + this.S_AbnormalItem_Name3.ReadOnly = true; + // + // S_Number3 + // + this.S_Number3.DataPropertyName = "Number3"; + this.S_Number3.HeaderText = "头数"; + this.S_Number3.Name = "S_Number3"; + this.S_Number3.ReadOnly = true; + this.S_Number3.Width = 135; + // + // S_Sanction_ID1 + // + this.S_Sanction_ID1.DataPropertyName = "Sanction_ID1"; + this.S_Sanction_ID1.HeaderText = "Sanction_ID1"; + this.S_Sanction_ID1.Name = "S_Sanction_ID1"; + this.S_Sanction_ID1.ReadOnly = true; + this.S_Sanction_ID1.Visible = false; + // + // S_AbnormalItem_ID1 + // + this.S_AbnormalItem_ID1.DataPropertyName = "AbnormalItem_ID1"; + this.S_AbnormalItem_ID1.HeaderText = "AbnormalItem_ID1"; + this.S_AbnormalItem_ID1.Name = "S_AbnormalItem_ID1"; + this.S_AbnormalItem_ID1.ReadOnly = true; + this.S_AbnormalItem_ID1.Visible = false; + // + // S_Sanction_ID2 + // + this.S_Sanction_ID2.DataPropertyName = "Sanction_ID2"; + this.S_Sanction_ID2.HeaderText = "Sanction_ID2"; + this.S_Sanction_ID2.Name = "S_Sanction_ID2"; + this.S_Sanction_ID2.ReadOnly = true; + this.S_Sanction_ID2.Visible = false; + // + // S_AbnormalItem_ID2 + // + this.S_AbnormalItem_ID2.DataPropertyName = "AbnormalItem_ID2"; + this.S_AbnormalItem_ID2.HeaderText = "AbnormalItem_ID2"; + this.S_AbnormalItem_ID2.Name = "S_AbnormalItem_ID2"; + this.S_AbnormalItem_ID2.ReadOnly = true; + this.S_AbnormalItem_ID2.Visible = false; + // + // S_Sanction_ID3 + // + this.S_Sanction_ID3.DataPropertyName = "Sanction_ID3"; + this.S_Sanction_ID3.HeaderText = "Sanction_ID3"; + this.S_Sanction_ID3.Name = "S_Sanction_ID3"; + this.S_Sanction_ID3.ReadOnly = true; + this.S_Sanction_ID3.Visible = false; + // + // S_AbnormalItem_ID3 + // + this.S_AbnormalItem_ID3.DataPropertyName = "AbnormalItem_ID3"; + this.S_AbnormalItem_ID3.HeaderText = "AbnormalItem_ID3"; + this.S_AbnormalItem_ID3.Name = "S_AbnormalItem_ID3"; + this.S_AbnormalItem_ID3.ReadOnly = true; + this.S_AbnormalItem_ID3.Visible = false; + // // QualityOrderForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -797,6 +815,7 @@ this.Name = "QualityOrderForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "验质分圈"; + this.Click += new System.EventHandler(this.QualityOrderForm_Click); this.uTabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.tabPage1.PerformLayout(); @@ -805,7 +824,7 @@ this.tabPage3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.sanctionGrid)).EndInit(); this.tabPage4.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.weightBillGrid)).EndInit(); this.tabPage2.ResumeLayout(false); this.tabPage2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.preOrderGrid)).EndInit(); @@ -819,12 +838,7 @@ private BWP.WinFormControl.UTabControl uTabControl1; private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabPage tabPage2; - private BWP.WinFormControl.UDataGridView uDataGridView1; - private System.Windows.Forms.DataGridViewTextBoxColumn W_ID; - private System.Windows.Forms.DataGridViewTextBoxColumn W_B3ID; - private System.Windows.Forms.DataGridViewTextBoxColumn W_Supplier_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn W_Number; - private System.Windows.Forms.DataGridViewTextBoxColumn W_HouseNames; + private BWP.WinFormControl.UDataGridView weightBillGrid; private System.Windows.Forms.Button syncBtn; private BWP.WinFormControl.UDatePicker testTimeInput; private System.Windows.Forms.Label label20; @@ -864,19 +878,24 @@ private BWP.WinFormControl.UTabControl uTabControl2; private System.Windows.Forms.TabPage tabPage3; private System.Windows.Forms.TabPage tabPage4; - private System.Windows.Forms.DataGridViewTextBoxColumn S_Sanction_ID1; - private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_ID1; + private System.Windows.Forms.TabControl housePanel; + private System.Windows.Forms.DataGridViewTextBoxColumn W_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn W_B3ID; + private System.Windows.Forms.DataGridViewTextBoxColumn W_Supplier_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn W_HouseNumber; + private System.Windows.Forms.DataGridViewTextBoxColumn W_HouseNames; private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_Name1; private System.Windows.Forms.DataGridViewTextBoxColumn S_Number1; - private System.Windows.Forms.DataGridViewTextBoxColumn S_Sanction_ID2; - private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_ID2; private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_Name2; private System.Windows.Forms.DataGridViewTextBoxColumn S_Number2; - private System.Windows.Forms.DataGridViewTextBoxColumn S_Sanction_ID3; - private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_ID3; private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_Name3; private System.Windows.Forms.DataGridViewTextBoxColumn S_Number3; - private System.Windows.Forms.TabControl housePanel; + private System.Windows.Forms.DataGridViewTextBoxColumn S_Sanction_ID1; + private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_ID1; + private System.Windows.Forms.DataGridViewTextBoxColumn S_Sanction_ID2; + private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_ID2; + private System.Windows.Forms.DataGridViewTextBoxColumn S_Sanction_ID3; + private System.Windows.Forms.DataGridViewTextBoxColumn S_AbnormalItem_ID3; diff --git a/QualityAndOrder/QualityOrderForm.cs b/QualityAndOrder/QualityOrderForm.cs index 25c45fe..5452ebe 100644 --- a/QualityAndOrder/QualityOrderForm.cs +++ b/QualityAndOrder/QualityOrderForm.cs @@ -1,4 +1,6 @@ -using BO.Utils; +using BO.BO; +using BO.Utils; +using BO.Utils.BillRpc; using ButcherManageClient; using System; using System.Collections.Generic; @@ -30,14 +32,22 @@ namespace QualityAndOrder List> hogGradeList; List houseList; List sanctionList; + List weightBills; + + readonly Color btnSelectForeColor = Color.FromArgb(255, 255, 255); + readonly Color btnSelectBackColor = Color.FromArgb(66, 163, 218); + Color btnUnSelectForeColor = SystemColors.ControlText; + Color btnUnSelectBackColor = Color.FromArgb(225, 225, 225); public QualityOrderForm() { InitializeComponent(); + syncBtn.Focus(); this.uTabControl1.Selected += (sender, e) => { this.Text = e.TabPage.Text; }; sanctionGrid.AutoGenerateColumns = false; + weightBillGrid.AutoGenerateColumns = false; hogGradeList = BaseInfoRpcUtil.GetBaseInfoEntity("GetHogGradeList"); houseList = HouseSplitEntity.Init(BaseInfoRpcUtil.GetBaseInfoEntity("GetLiveColonyHouseList")); sanctionList = SanctionSplit3Part.Init(BaseInfoRpcUtil.GetSanctionList()); @@ -48,6 +58,17 @@ namespace QualityAndOrder AddHouseBtn(); AddKeyPadForTab2(); + + numberBox.LostFocus += (sender, e) => { flag = 1; }; + sanctionGrid.GotFocus += (sender, e) => { flag = 2; }; + } + + int flag = 0; + + private void BindWeightBillGrid() + { + weightBillGrid.DataSource = weightBills.OrderBy(x => x.Remark).OrderBy(x => x.ID).ToList(); + weightBillGrid.Refresh(); } private void AddKeyPadForTab1() @@ -57,42 +78,132 @@ namespace QualityAndOrder var btn = new Button() { Name = "_" + i, Text = i.ToString(), Size = new Size(80, 60), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { All = 10 }, Font = new Font("宋体", 15) }; btn.Click += (sender, e) => { - numberBox.Text += btn.Text; + if (flag == 1) + { + numberBox.Text += btn.Text; + } + else if (flag == 2) + InputSanctionNumber(btn.Text); }; keyBoardPanel.Controls.Add(btn); } var zero = new Button() { Name = "_0", Text = "0", Size = new Size(80, 60), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { All = 10 }, Font = new Font("宋体", 15) }; zero.Click += (sender, e) => { - if (!string.IsNullOrEmpty(numberBox.Text)) - numberBox.Text += "0"; + if (flag == 1) + { + if (!string.IsNullOrEmpty(numberBox.Text)) + numberBox.Text += "0"; + } + else if (flag == 2) + InputSanctionNumber("0"); }; keyBoardPanel.Controls.Add(zero); var back = new Button() { Name = "_back", Text = "←", Size = new Size(80, 60), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { All = 10 }, Font = new Font("宋体", 15) }; back.Click += (sender, e) => { - if (!string.IsNullOrEmpty(numberBox.Text)) - numberBox.Text = numberBox.Text.Substring(0, numberBox.Text.Length - 1); + if (flag == 1) + { + if (!string.IsNullOrEmpty(numberBox.Text)) + numberBox.Text = numberBox.Text.Substring(0, numberBox.Text.Length - 1); + } + else if (flag == 2) + InputSanctionNumber("←"); }; keyBoardPanel.Controls.Add(back); var clear = new Button() { Name = "_clear", Text = "清空", Size = new Size(80, 60), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { All = 10 }, Font = new Font("宋体", 15) }; clear.Click += (sender, e) => { - numberBox.Text = null; + if (flag == 1) + { + numberBox.Text = string.Empty; + } + else if (flag == 2) + InputSanctionNumber("清空"); }; keyBoardPanel.Controls.Add(clear); + } + + void InputSanctionNumber(string input) + { + if (sanctionGrid.CurrentCell == null) + throw new Exception("请选择一项异常"); + var tag = sanctionGrid.CurrentRow.DataBoundItem as SanctionSplit3Part; + var idx = sanctionGrid.SelectedCells[0].ColumnIndex; + if (idx > 3) + { + if (tag.Sanction_ID3 == 0) + return; + tag.Number3 = GetAfterNumber(tag.Number3, input); + } + else if (idx > 1) + { + if (tag.Sanction_ID2 == 0) + return; + tag.Number2 = GetAfterNumber(tag.Number2, input); + } + else + { + if (tag.Sanction_ID1 == 0) + return; + tag.Number1 = GetAfterNumber(tag.Number1, input); + } + sanctionGrid.Refresh(); } + int? GetAfterNumber(int? oldValue, string input) + { + switch (input) + { + case "0": + if (oldValue.HasValue) + return int.Parse(oldValue + "0"); + return null; + case "←": + if (oldValue.HasValue) + { + var s = oldValue.ToString(); + s = s.Substring(0, s.Length - 1); + if (string.IsNullOrEmpty(s)) + return null; + return int.Parse(s); + } + return null; + case "清空": + return null; + default: + var sn = ""; + if (oldValue.HasValue) + sn = oldValue.ToString(); + sn += input; + return int.Parse(sn); + } + } + + + Button currentBtn; private void AddHogGradeBtn() { foreach (var item in hogGradeList) { - var btn = new Button() { Name = "_" + item.Item1, Tag = item.Item1, Text = item.Item2, Size = new Size(80, 60), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { Left = 20, Top = 5 }, Font = new Font("宋体", 15) }; + var btn = new Button() { Name = "_" + item.Item1, Tag = item, Text = item.Item2, Size = new Size(80, 60), TextAlign = ContentAlignment.MiddleCenter, Margin = new Padding { Left = 20, Top = 5 }, Font = new Font("宋体", 15), BackColor = btnUnSelectBackColor }; btn.Click += (sender, e) => { - numberBox.Text = btn.Tag.ToString(); + if (currentBtn != null) + { + currentBtn.BackColor = btnUnSelectBackColor; + currentBtn.ForeColor = btnUnSelectForeColor; + } + if (currentBtn != btn) + { + btn.BackColor = btnSelectBackColor; + btn.ForeColor = btnSelectForeColor; + currentBtn = btn; + } + else + currentBtn = null; }; hogGradePanel.Controls.Add(btn); } @@ -104,7 +215,8 @@ namespace QualityAndOrder sanctionGrid.Refresh(); } - List