diff --git a/ButcherFactory.BO/Bill/SegmentInStore.cs b/ButcherFactory.BO/Bill/SegmentInStore.cs index ffe091e..4a07262 100644 --- a/ButcherFactory.BO/Bill/SegmentInStore.cs +++ b/ButcherFactory.BO/Bill/SegmentInStore.cs @@ -45,6 +45,8 @@ namespace ButcherFactory.BO public DateTime? InStoreTime { get; set; } + public DateTime? BackStoreTime { get; set; } + //0 已入库 //1 正在退库 //2 已退库 diff --git a/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs b/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs index e413525..9863b4a 100644 --- a/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs +++ b/ButcherFactory.BO/LocalBL/CarcassSaleOutBL.cs @@ -100,7 +100,7 @@ namespace ButcherFactory.BO.LocalBL var mesInfo = JsonConvert.DeserializeObject(json); if (!string.IsNullOrEmpty(mesInfo.Goods_Code)) { - if (mesInfo.Goods_Code == "X002") + if (mesInfo.Goods_Code == "X002")//特殊处理,有个存货编码不存在。 mesInfo.Goods_Code = "0001"; var gInfo = GetGoodsInfo(mesInfo.Goods_Code); first.Goods_Code = mesInfo.Goods_Code; @@ -253,6 +253,11 @@ namespace ButcherFactory.BO.LocalBL update.Columns.Add(new DQUpdateColumn("ScanRecord_ID", DQExpression.NULL)); update.EExecute(); } + + public static bool HasNoAssignDetail(long billid) + { + return RpcFacade.Call(RpcPath + "SaleOutStoreRpc/HasNoAssignDetail", billid); + } } class SaleOutCarcassObj diff --git a/ButcherFactory.BO/LocalBL/SegmentInStoreBL.cs b/ButcherFactory.BO/LocalBL/SegmentInStoreBL.cs index ba806ed..45f1438 100644 --- a/ButcherFactory.BO/LocalBL/SegmentInStoreBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentInStoreBL.cs @@ -265,6 +265,7 @@ namespace ButcherFactory.BO.LocalBL { var update = new DQUpdateDom(typeof(SegmentInStore)); update.Columns.Add(new DQUpdateColumn("State", 2)); + update.Columns.Add(new DQUpdateColumn("BackStoreTime", DateTime.Now)); update.Columns.Add(new DQUpdateColumn("Sync", false)); update.Columns.Add(new DQUpdateColumn("RowVersion", DQExpression.Add(DQExpression.Field("RowVersion"), DQExpression.Value(1)))); update.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ID"), ids.Select(x => DQExpression.Value(x)).ToArray())); @@ -358,6 +359,7 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Field("Store_ID")); query.Columns.Add(DQSelectColumn.Field("State")); query.Columns.Add(DQSelectColumn.Field("Delete")); + query.Columns.Add(DQSelectColumn.Field("BackStoreTime")); query.Where.Conditions.Add(DQCondition.And(DQCondition.InEQ("State", 1), DQCondition.EQ("Sync", false))); query.Range = SelectRange.Top(10); query.OrderBy.Expressions.Add(DQOrderByExpression.Create("ID")); @@ -375,6 +377,7 @@ namespace ButcherFactory.BO.LocalBL obj.Store_ID = (long?)reader[4]; obj.State = (int)reader[5]; obj.Delete = (bool)reader[6]; + obj.BackStoreTime = (DateTime?)reader[7]; upload.Add(obj); } } @@ -407,6 +410,8 @@ namespace ButcherFactory.BO.LocalBL public int State { get; set; } public bool Delete { get; set; } + + public DateTime? BackStoreTime { get; set; } } class SegmentProductObj diff --git a/ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs b/ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs index d71a04c..00533f3 100644 --- a/ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs @@ -26,6 +26,11 @@ namespace ButcherFactory.BO.LocalBL return CarcassSaleOutBL.GetSaleOutStoreDetailList(id); } + public static bool HasNoAssignDetail(long billID) + { + return CarcassSaleOutBL.HasNoAssignDetail(billID); + } + public static BindingList GetWeightRecord(long detailID) { var query = new DmoQuery(typeof(SegmentSaleOut_Detail)); diff --git a/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutForm.Designer.cs b/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutForm.Designer.cs index b74fcbc..46abd4c 100644 --- a/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutForm.Designer.cs +++ b/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutForm.Designer.cs @@ -328,7 +328,7 @@ this.panel7.Controls.Add(this.panel8); this.panel7.Location = new System.Drawing.Point(6, 100); this.panel7.Name = "panel7"; - this.panel7.Size = new System.Drawing.Size(485, 475); + this.panel7.Size = new System.Drawing.Size(505, 475); this.panel7.TabIndex = 1; // // panel11 @@ -340,7 +340,7 @@ this.panel11.Controls.Add(this.alreadyViewBtn); this.panel11.Location = new System.Drawing.Point(1, 397); this.panel11.Name = "panel11"; - this.panel11.Size = new System.Drawing.Size(484, 78); + this.panel11.Size = new System.Drawing.Size(501, 78); this.panel11.TabIndex = 8; // // goodsFinishBtn @@ -348,7 +348,7 @@ this.goodsFinishBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(120)))), ((int)(((byte)(24))))); this.goodsFinishBtn.Font = new System.Drawing.Font("黑体", 15F); this.goodsFinishBtn.ForeColor = System.Drawing.Color.White; - this.goodsFinishBtn.Location = new System.Drawing.Point(331, 3); + this.goodsFinishBtn.Location = new System.Drawing.Point(349, 3); this.goodsFinishBtn.Name = "goodsFinishBtn"; this.goodsFinishBtn.Radius = 10; this.goodsFinishBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); @@ -363,7 +363,7 @@ this.weightRecordBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); this.weightRecordBtn.Font = new System.Drawing.Font("黑体", 15F); this.weightRecordBtn.ForeColor = System.Drawing.Color.White; - this.weightRecordBtn.Location = new System.Drawing.Point(143, 3); + this.weightRecordBtn.Location = new System.Drawing.Point(152, 3); this.weightRecordBtn.Name = "weightRecordBtn"; this.weightRecordBtn.Radius = 10; this.weightRecordBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); @@ -454,12 +454,12 @@ this.mainGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle20; this.mainGridView.RowHeadersVisible = false; dataGridViewCellStyle21.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(242)))), ((int)(((byte)(251))))); - dataGridViewCellStyle21.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle21.Font = new System.Drawing.Font("宋体", 12F); dataGridViewCellStyle21.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(98)))), ((int)(((byte)(222))))); this.mainGridView.RowsDefaultCellStyle = dataGridViewCellStyle21; - this.mainGridView.RowTemplate.Height = 40; + this.mainGridView.RowTemplate.Height = 50; this.mainGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.mainGridView.Size = new System.Drawing.Size(476, 242); + this.mainGridView.Size = new System.Drawing.Size(499, 242); this.mainGridView.TabIndex = 6; this.mainGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mainGridView_CellClick); // @@ -503,7 +503,7 @@ this.panel9.Dock = System.Windows.Forms.DockStyle.Top; this.panel9.Location = new System.Drawing.Point(0, 133); this.panel9.Name = "panel9"; - this.panel9.Size = new System.Drawing.Size(485, 1); + this.panel9.Size = new System.Drawing.Size(505, 1); this.panel9.TabIndex = 1; // // panel8 @@ -523,14 +523,14 @@ this.panel8.Dock = System.Windows.Forms.DockStyle.Top; this.panel8.Location = new System.Drawing.Point(0, 0); this.panel8.Name = "panel8"; - this.panel8.Size = new System.Drawing.Size(485, 133); + this.panel8.Size = new System.Drawing.Size(505, 133); this.panel8.TabIndex = 0; // // billStateBox // this.billStateBox.BackColor = System.Drawing.Color.Transparent; this.billStateBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.billStateBox.Location = new System.Drawing.Point(321, 47); + this.billStateBox.Location = new System.Drawing.Point(340, 47); this.billStateBox.Name = "billStateBox"; this.billStateBox.Size = new System.Drawing.Size(148, 26); this.billStateBox.TabIndex = 38; @@ -541,7 +541,7 @@ // this.deliverGoodsLineBox.BackColor = System.Drawing.Color.Transparent; this.deliverGoodsLineBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.deliverGoodsLineBox.Location = new System.Drawing.Point(321, 7); + this.deliverGoodsLineBox.Location = new System.Drawing.Point(340, 7); this.deliverGoodsLineBox.Name = "deliverGoodsLineBox"; this.deliverGoodsLineBox.Size = new System.Drawing.Size(148, 26); this.deliverGoodsLineBox.TabIndex = 37; @@ -586,7 +586,7 @@ this.clearBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25))))); this.clearBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.clearBtn.ForeColor = System.Drawing.Color.White; - this.clearBtn.Location = new System.Drawing.Point(380, 86); + this.clearBtn.Location = new System.Drawing.Point(399, 86); this.clearBtn.Name = "clearBtn"; this.clearBtn.Radius = 10; this.clearBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); @@ -601,7 +601,7 @@ this.refreshBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(198)))), ((int)(((byte)(58))))); this.refreshBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.refreshBtn.ForeColor = System.Drawing.Color.White; - this.refreshBtn.Location = new System.Drawing.Point(264, 86); + this.refreshBtn.Location = new System.Drawing.Point(283, 86); this.refreshBtn.Name = "refreshBtn"; this.refreshBtn.Radius = 10; this.refreshBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); @@ -615,7 +615,7 @@ // this.uLabel5.AutoSize = true; this.uLabel5.BackColor = System.Drawing.Color.Transparent; - this.uLabel5.Location = new System.Drawing.Point(262, 54); + this.uLabel5.Location = new System.Drawing.Point(281, 54); this.uLabel5.Name = "uLabel5"; this.uLabel5.Size = new System.Drawing.Size(53, 12); this.uLabel5.TabIndex = 20; @@ -625,7 +625,7 @@ // this.uLabel6.AutoSize = true; this.uLabel6.BackColor = System.Drawing.Color.Transparent; - this.uLabel6.Location = new System.Drawing.Point(262, 14); + this.uLabel6.Location = new System.Drawing.Point(281, 14); this.uLabel6.Name = "uLabel6"; this.uLabel6.Size = new System.Drawing.Size(53, 12); this.uLabel6.TabIndex = 19; @@ -666,7 +666,7 @@ this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("黑体", 12F); this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(124)))), ((int)(((byte)(222))))); - this.label1.Location = new System.Drawing.Point(506, 100); + this.label1.Location = new System.Drawing.Point(522, 100); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(72, 16); this.label1.TabIndex = 2; @@ -706,18 +706,18 @@ this.D_SNumber, this.D_DiffNumber}); this.orderGridView.EnableHeadersVisualStyles = false; - this.orderGridView.Location = new System.Drawing.Point(503, 123); + this.orderGridView.Location = new System.Drawing.Point(517, 123); this.orderGridView.MultiSelect = false; this.orderGridView.Name = "orderGridView"; this.orderGridView.ReadOnly = true; this.orderGridView.RowHeadersVisible = false; dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(243)))), ((int)(((byte)(250))))); - dataGridViewCellStyle16.Font = new System.Drawing.Font("宋体", 9F); + dataGridViewCellStyle16.Font = new System.Drawing.Font("宋体", 10F); dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); this.orderGridView.RowsDefaultCellStyle = dataGridViewCellStyle16; this.orderGridView.RowTemplate.Height = 40; this.orderGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.orderGridView.Size = new System.Drawing.Size(673, 230); + this.orderGridView.Size = new System.Drawing.Size(659, 230); this.orderGridView.TabIndex = 3; this.orderGridView.RowPrePaint += new System.Windows.Forms.DataGridViewRowPrePaintEventHandler(this.orderGridView_RowPrePaint); // @@ -814,7 +814,7 @@ this.label2.AutoSize = true; this.label2.Font = new System.Drawing.Font("黑体", 12F); this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(135)))), ((int)(((byte)(69))))); - this.label2.Location = new System.Drawing.Point(506, 362); + this.label2.Location = new System.Drawing.Point(522, 366); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(72, 16); this.label2.TabIndex = 4; @@ -841,7 +841,7 @@ dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.sendGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; - this.sendGridView.ColumnHeadersHeight = 25; + this.sendGridView.ColumnHeadersHeight = 30; this.sendGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.sendGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.F_ID, @@ -857,7 +857,7 @@ this.F_DiffWeight, this.F_Time}); this.sendGridView.EnableHeadersVisualStyles = false; - this.sendGridView.Location = new System.Drawing.Point(503, 387); + this.sendGridView.Location = new System.Drawing.Point(517, 387); this.sendGridView.MultiSelect = false; this.sendGridView.Name = "sendGridView"; this.sendGridView.ReadOnly = true; @@ -868,7 +868,7 @@ this.sendGridView.RowsDefaultCellStyle = dataGridViewCellStyle8; this.sendGridView.RowTemplate.Height = 40; this.sendGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.sendGridView.Size = new System.Drawing.Size(673, 128); + this.sendGridView.Size = new System.Drawing.Size(659, 128); this.sendGridView.TabIndex = 5; this.sendGridView.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.sendGridView_CellClick); // @@ -991,9 +991,9 @@ this.panel12.Controls.Add(this.fullBtn); this.panel12.Controls.Add(this.halfBtn); this.panel12.Controls.Add(this.scanCodeBtn); - this.panel12.Location = new System.Drawing.Point(503, 525); + this.panel12.Location = new System.Drawing.Point(517, 525); this.panel12.Name = "panel12"; - this.panel12.Size = new System.Drawing.Size(673, 50); + this.panel12.Size = new System.Drawing.Size(659, 50); this.panel12.TabIndex = 6; // // commitBtn @@ -1002,11 +1002,11 @@ this.commitBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(198)))), ((int)(((byte)(58))))); this.commitBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.commitBtn.ForeColor = System.Drawing.Color.White; - this.commitBtn.Location = new System.Drawing.Point(572, 8); + this.commitBtn.Location = new System.Drawing.Point(546, 0); this.commitBtn.Name = "commitBtn"; this.commitBtn.Radius = 10; this.commitBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); - this.commitBtn.Size = new System.Drawing.Size(84, 35); + this.commitBtn.Size = new System.Drawing.Size(102, 50); this.commitBtn.TabIndex = 34; this.commitBtn.Text = "提交"; this.commitBtn.UseVisualStyleBackColor = false; diff --git a/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutForm.cs b/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutForm.cs index 2de6da3..c8fc80f 100644 --- a/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutForm.cs +++ b/ButcherFactory.Form/CarcassSaleOut2_/CarcassSaleOutForm.cs @@ -131,7 +131,7 @@ namespace ButcherFactory.CarcassSaleOut2_ { var detail = CarcassSaleOutBL.Insert(weight); if (weightRecord.Any()) - detail.Idx = weightRecord.Max(x => x.Idx) + 1; + detail.Idx = weightRecord.First().Idx + 1; else detail.Idx = 1; weightRecord.Insert(0, detail); @@ -139,7 +139,7 @@ namespace ButcherFactory.CarcassSaleOut2_ if (!scanCode) AfterScan("G8536"); else - sendGridView.Refresh(); + sendGridView.Refresh(); checkWeight = new Thread(new ParameterizedThreadStart(CheckWeight)); checkWeight.Start(weight); })); @@ -157,7 +157,7 @@ namespace ButcherFactory.CarcassSaleOut2_ void uScanPanel1_AfterScan() { var barCode = uScanPanel1.TextBox.Text.Trim(); - if (!barCode.StartsWith("G") && weightRecord.Any(x => x.BarCode == barCode)) + if (!barCode.StartsWith("G") && weightRecord.Any(x => x.BarCode == barCode))//正常重复码 return; AfterScan(barCode); } @@ -200,8 +200,8 @@ namespace ButcherFactory.CarcassSaleOut2_ throw new Exception("请选择要配货完成的发货单"); var id = (long)mainGridView.CurrentRow.Cells[0].Value; - var ds = CarcassSaleOutBL.GetSaleOutStoreDetailList(id); - if (ds.Any(x => x.SNumber == null || x.SNumber == 0)) + var hasNoAssignDetail = CarcassSaleOutBL.HasNoAssignDetail(id); + if (hasNoAssignDetail) { if (MessageBox.Show("有未配货的明细,确认配货完成?", "配货完成确认", MessageBoxButtons.OKCancel) != DialogResult.OK) return; @@ -415,6 +415,13 @@ namespace ButcherFactory.CarcassSaleOut2_ private void sendGridView_CellClick(object sender, DataGridViewCellEventArgs e) { + if (e.RowIndex == -1 && e.ColumnIndex == 2) + { + foreach (var item in weightRecord) + item.Selected = !item.Selected; + sendGridView.Refresh(); + return; + } if (e.RowIndex < 0) return; var id = (long)sendGridView.CurrentRow.Cells[0].Value; diff --git a/ButcherFactory.Form/Dialogs/SelectDeliverGoodsLineDialog.cs b/ButcherFactory.Form/Dialogs/SelectDeliverGoodsLineDialog.cs index 8dab6f4..bc6b437 100644 --- a/ButcherFactory.Form/Dialogs/SelectDeliverGoodsLineDialog.cs +++ b/ButcherFactory.Form/Dialogs/SelectDeliverGoodsLineDialog.cs @@ -40,6 +40,8 @@ namespace ButcherFactory.Dialogs Color color = Color.FromArgb(250, 120, 24); private void AddButtons(TabPage tabPage) { + if (tabPage.Controls.Count != 0) + return; tabPage.BackColor = Color.White; var flw = new FlowLayoutPanel() { Dock = DockStyle.Fill, AutoScroll = true }; var arr = list.Where(x => x.StringExt2 == tabPage.Text); diff --git a/ButcherFactory.Form/Dialogs/WeightRecordDialog.Designer.cs b/ButcherFactory.Form/Dialogs/WeightRecordDialog.Designer.cs index 1c6ca64..6837438 100644 --- a/ButcherFactory.Form/Dialogs/WeightRecordDialog.Designer.cs +++ b/ButcherFactory.Form/Dialogs/WeightRecordDialog.Designer.cs @@ -36,6 +36,11 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.uDataGridView1 = new WinFormControl.UDataGridView(); + this.panel1 = new System.Windows.Forms.Panel(); + this.closeBtn = new ButcherFactory.Controls.ColorButton(); + this.rollBackBtn = new ButcherFactory.Controls.ColorButton(); + this.deleteBtn = new ButcherFactory.Controls.ColorButton(); + this.addBtn = new ButcherFactory.Controls.ColorButton(); this.R_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.R_Selected = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.R_Image = new System.Windows.Forms.DataGridViewImageColumn(); @@ -49,11 +54,6 @@ this.R_DiffWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.R_Operator = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.R_Time = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.panel1 = new System.Windows.Forms.Panel(); - this.addBtn = new ButcherFactory.Controls.ColorButton(); - this.deleteBtn = new ButcherFactory.Controls.ColorButton(); - this.rollBackBtn = new ButcherFactory.Controls.ColorButton(); - this.closeBtn = new ButcherFactory.Controls.ColorButton(); ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).BeginInit(); this.panel1.SuspendLayout(); this.SuspendLayout(); @@ -76,7 +76,8 @@ dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; - this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.uDataGridView1.ColumnHeadersHeight = 40; + this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.R_ID, this.R_Selected, @@ -106,6 +107,75 @@ this.uDataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.uDataGridView1_CellClick); this.uDataGridView1.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.uDataGridView1_CellFormatting); // + // panel1 + // + this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel1.Controls.Add(this.closeBtn); + this.panel1.Controls.Add(this.rollBackBtn); + this.panel1.Controls.Add(this.deleteBtn); + this.panel1.Controls.Add(this.addBtn); + this.panel1.Location = new System.Drawing.Point(185, 468); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(744, 52); + this.panel1.TabIndex = 2; + // + // closeBtn + // + this.closeBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); + this.closeBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.closeBtn.ForeColor = System.Drawing.Color.White; + this.closeBtn.Location = new System.Drawing.Point(624, 5); + this.closeBtn.Name = "closeBtn"; + this.closeBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); + this.closeBtn.Size = new System.Drawing.Size(117, 43); + this.closeBtn.TabIndex = 3; + this.closeBtn.Text = "关闭"; + this.closeBtn.UseVisualStyleBackColor = false; + this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click); + // + // rollBackBtn + // + this.rollBackBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(75)))), ((int)(((byte)(71))))); + this.rollBackBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.rollBackBtn.ForeColor = System.Drawing.Color.White; + this.rollBackBtn.Location = new System.Drawing.Point(428, 5); + this.rollBackBtn.Name = "rollBackBtn"; + this.rollBackBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); + this.rollBackBtn.Size = new System.Drawing.Size(117, 43); + this.rollBackBtn.TabIndex = 6; + this.rollBackBtn.Text = "退回"; + this.rollBackBtn.UseVisualStyleBackColor = false; + this.rollBackBtn.Click += new System.EventHandler(this.rollBackBtn_Click); + // + // deleteBtn + // + this.deleteBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25))))); + this.deleteBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.deleteBtn.ForeColor = System.Drawing.Color.White; + this.deleteBtn.Location = new System.Drawing.Point(207, 5); + this.deleteBtn.Name = "deleteBtn"; + this.deleteBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); + this.deleteBtn.Size = new System.Drawing.Size(117, 43); + this.deleteBtn.TabIndex = 5; + this.deleteBtn.Text = "删除且更新"; + this.deleteBtn.UseVisualStyleBackColor = false; + this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click); + // + // addBtn + // + this.addBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(198)))), ((int)(((byte)(58))))); + this.addBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.addBtn.ForeColor = System.Drawing.Color.White; + this.addBtn.Location = new System.Drawing.Point(3, 5); + this.addBtn.Name = "addBtn"; + this.addBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); + this.addBtn.Size = new System.Drawing.Size(117, 43); + this.addBtn.TabIndex = 3; + this.addBtn.Text = "新增"; + this.addBtn.UseVisualStyleBackColor = false; + this.addBtn.Click += new System.EventHandler(this.addBtn_Click); + // // R_ID // this.R_ID.DataPropertyName = "ID"; @@ -139,7 +209,7 @@ // // R_BarCode // - this.R_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.R_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.R_BarCode.DataPropertyName = "ShortCode"; this.R_BarCode.HeaderText = "存货条码"; this.R_BarCode.MinimumWidth = 100; @@ -148,6 +218,7 @@ // // R_Goods_Code // + this.R_Goods_Code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.R_Goods_Code.DataPropertyName = "Goods_Code"; this.R_Goods_Code.HeaderText = "产品编码"; this.R_Goods_Code.Name = "R_Goods_Code"; @@ -155,7 +226,7 @@ // // R_Goods_Name // - this.R_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.R_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.R_Goods_Name.DataPropertyName = "Goods_Name"; this.R_Goods_Name.HeaderText = "产品名称"; this.R_Goods_Name.MinimumWidth = 100; @@ -170,7 +241,6 @@ this.R_Number.HeaderText = "数量"; this.R_Number.Name = "R_Number"; this.R_Number.ReadOnly = true; - this.R_Number.Width = 70; // // R_InStoreWeight // @@ -198,7 +268,6 @@ this.R_DiffWeight.HeaderText = "差异"; this.R_DiffWeight.Name = "R_DiffWeight"; this.R_DiffWeight.ReadOnly = true; - this.R_DiffWeight.Width = 70; // // R_Operator // @@ -209,82 +278,12 @@ // // R_Time // - this.R_Time.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.R_Time.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.R_Time.DataPropertyName = "Time"; this.R_Time.HeaderText = "时间"; this.R_Time.MinimumWidth = 120; this.R_Time.Name = "R_Time"; this.R_Time.ReadOnly = true; - this.R_Time.Width = 120; - // - // panel1 - // - this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.panel1.Controls.Add(this.closeBtn); - this.panel1.Controls.Add(this.rollBackBtn); - this.panel1.Controls.Add(this.deleteBtn); - this.panel1.Controls.Add(this.addBtn); - this.panel1.Location = new System.Drawing.Point(185, 468); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(744, 52); - this.panel1.TabIndex = 2; - // - // addBtn - // - this.addBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(198)))), ((int)(((byte)(58))))); - this.addBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.addBtn.ForeColor = System.Drawing.Color.White; - this.addBtn.Location = new System.Drawing.Point(3, 5); - this.addBtn.Name = "addBtn"; - this.addBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); - this.addBtn.Size = new System.Drawing.Size(117, 43); - this.addBtn.TabIndex = 3; - this.addBtn.Text = "新增"; - this.addBtn.UseVisualStyleBackColor = false; - this.addBtn.Click += new System.EventHandler(this.addBtn_Click); - // - // deleteBtn - // - this.deleteBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(25))))); - this.deleteBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.deleteBtn.ForeColor = System.Drawing.Color.White; - this.deleteBtn.Location = new System.Drawing.Point(207, 5); - this.deleteBtn.Name = "deleteBtn"; - this.deleteBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); - this.deleteBtn.Size = new System.Drawing.Size(117, 43); - this.deleteBtn.TabIndex = 5; - this.deleteBtn.Text = "删除且更新"; - this.deleteBtn.UseVisualStyleBackColor = false; - this.deleteBtn.Click += new System.EventHandler(this.deleteBtn_Click); - // - // rollBackBtn - // - this.rollBackBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(75)))), ((int)(((byte)(71))))); - this.rollBackBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.rollBackBtn.ForeColor = System.Drawing.Color.White; - this.rollBackBtn.Location = new System.Drawing.Point(428, 5); - this.rollBackBtn.Name = "rollBackBtn"; - this.rollBackBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); - this.rollBackBtn.Size = new System.Drawing.Size(117, 43); - this.rollBackBtn.TabIndex = 6; - this.rollBackBtn.Text = "退回"; - this.rollBackBtn.UseVisualStyleBackColor = false; - this.rollBackBtn.Click += new System.EventHandler(this.rollBackBtn_Click); - // - // closeBtn - // - this.closeBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(135)))), ((int)(((byte)(245))))); - this.closeBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.closeBtn.ForeColor = System.Drawing.Color.White; - this.closeBtn.Location = new System.Drawing.Point(624, 5); - this.closeBtn.Name = "closeBtn"; - this.closeBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(15)))), ((int)(((byte)(215)))), ((int)(((byte)(107))))); - this.closeBtn.Size = new System.Drawing.Size(117, 43); - this.closeBtn.TabIndex = 3; - this.closeBtn.Text = "关闭"; - this.closeBtn.UseVisualStyleBackColor = false; - this.closeBtn.Click += new System.EventHandler(this.closeBtn_Click); // // WeightRecordDialog // @@ -299,6 +298,7 @@ this.Name = "WeightRecordDialog"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "称重记录"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).EndInit(); this.panel1.ResumeLayout(false); this.ResumeLayout(false); @@ -309,6 +309,10 @@ private WinFormControl.UDataGridView uDataGridView1; private System.Windows.Forms.Panel panel1; + private Controls.ColorButton addBtn; + private Controls.ColorButton deleteBtn; + private Controls.ColorButton rollBackBtn; + private Controls.ColorButton closeBtn; private System.Windows.Forms.DataGridViewTextBoxColumn R_ID; private System.Windows.Forms.DataGridViewTextBoxColumn R_Selected; private System.Windows.Forms.DataGridViewImageColumn R_Image; @@ -322,9 +326,5 @@ private System.Windows.Forms.DataGridViewTextBoxColumn R_DiffWeight; private System.Windows.Forms.DataGridViewTextBoxColumn R_Operator; private System.Windows.Forms.DataGridViewTextBoxColumn R_Time; - private Controls.ColorButton addBtn; - private Controls.ColorButton deleteBtn; - private Controls.ColorButton rollBackBtn; - private Controls.ColorButton closeBtn; } } \ No newline at end of file diff --git a/ButcherFactory.Form/Dialogs/WeightRecordDialog.cs b/ButcherFactory.Form/Dialogs/WeightRecordDialog.cs index a980975..8413acd 100644 --- a/ButcherFactory.Form/Dialogs/WeightRecordDialog.cs +++ b/ButcherFactory.Form/Dialogs/WeightRecordDialog.cs @@ -49,7 +49,19 @@ namespace ButcherFactory.Dialogs e.PaintBackground(e.ClipBounds, false); e.Handled = true; } + else if (e.ColumnIndex == uDataGridView1.Columns.Count - 3) + { + using (Brush foreColor = new SolidBrush(e.CellStyle.ForeColor)) + { + e.PaintBackground(e.ClipBounds, false); + StringFormat drawFormat = new StringFormat(); + drawFormat.LineAlignment = StringAlignment.Center; + drawFormat.Alignment = System.Drawing.StringAlignment.Near; + e.Graphics.DrawString(diff.ToString("#0.##"), e.CellStyle.Font, foreColor, e.CellBounds, drawFormat); + e.Handled = true; + } + } else if (e.ColumnIndex == 3) { using (Brush foreColor = new SolidBrush(e.CellStyle.ForeColor)) @@ -77,6 +89,7 @@ namespace ButcherFactory.Dialogs } } + decimal diff = 0; void BindGrid() { list = CarcassSaleOutBL.GetWeightRecord(mDetail.ID); @@ -84,7 +97,7 @@ namespace ButcherFactory.Dialogs total.Number = list.Sum(x => x.Number); total.Weight = list.Sum(x => x.Weight); total.InStoreWeight = list.Sum(x => x.InStoreWeight ?? 0); - var diff = list.Sum(x => x.DiffWeight ?? 0); + diff = list.Sum(x => x.DiffWeight ?? 0); list.Add(total); uDataGridView1.DataSource = list; ReBuildTotalRow(diff); @@ -94,7 +107,6 @@ namespace ButcherFactory.Dialogs private void ReBuildTotalRow(decimal diff) { var row = uDataGridView1.Rows[list.Count - 1]; - row.Cells["R_DiffWeight"].Value = diff; row.Cells["R_Time"].Value = null; } @@ -135,6 +147,13 @@ namespace ButcherFactory.Dialogs private void uDataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { + if (e.RowIndex == -1 && e.ColumnIndex == 2) + { + foreach (var item in list) + item.Selected = !item.Selected; + uDataGridView1.Refresh(); + return; + } if (e.RowIndex < 0 || e.RowIndex == list.Count - 1) return; var id = (long)uDataGridView1.CurrentRow.Cells[0].Value; diff --git a/ButcherFactory.Form/SegmentSaleOut_/SegmentSaleOutForm.cs b/ButcherFactory.Form/SegmentSaleOut_/SegmentSaleOutForm.cs index 5b9c531..75800d2 100644 --- a/ButcherFactory.Form/SegmentSaleOut_/SegmentSaleOutForm.cs +++ b/ButcherFactory.Form/SegmentSaleOut_/SegmentSaleOutForm.cs @@ -240,8 +240,8 @@ namespace ButcherFactory.SegmentSaleOut_ throw new Exception("请选择要配货完成的发货单"); var id = (long)orderGridView.CurrentRow.Cells[0].Value; - var ds = SegmentSaleOutBL.GetSaleOutStoreDetailList(id); - if (ds.Any(x => x.SNumber == null || x.SNumber == 0)) + var hasNoAssignDetail = SegmentSaleOutBL.HasNoAssignDetail(id); + if (hasNoAssignDetail) { if (MessageBox.Show("有未配货的明细,确认配货完成?", "配货完成确认", MessageBoxButtons.OKCancel) != DialogResult.OK) return;