diff --git a/ButcherFactory.BO/Bill/SegmentProduction.cs b/ButcherFactory.BO/Bill/SegmentProduction.cs index d78e65d..f36aa90 100644 --- a/ButcherFactory.BO/Bill/SegmentProduction.cs +++ b/ButcherFactory.BO/Bill/SegmentProduction.cs @@ -22,8 +22,9 @@ namespace ButcherFactory.BO { if (string.IsNullOrEmpty(BarCode)) return null; - if (BarCode.Contains("260912011")) - return BarCode.Replace("260912011", ""); + var tag = "260912011" + DateTime.Today.Year; + if (BarCode.Contains(tag)) + return BarCode.Replace(tag, ""); return BarCode; } } diff --git a/ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs b/ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs index d74032a..2cf346f 100644 --- a/ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs +++ b/ButcherFactory.BO/LocalBL/SegmentSaleOutBL.cs @@ -75,6 +75,8 @@ namespace ButcherFactory.BO.LocalBL new Tuple("WeightRecord_ID", first.LongExt2), new Tuple("ScanRecord_ID", first.LongExt3) ); + item.WeightRecord_ID = first.LongExt2; + item.ScanRecord_ID = first.LongExt3; } } @@ -179,5 +181,55 @@ namespace ButcherFactory.BO.LocalBL query.Columns.Add(DQSelectColumn.Create(DQExpression.Value(1), "c")); return query.EExecuteScalar() != null; } + + public static List InsertByStockUp(string barCode, IEnumerable orderDetails) + { + var id = orderDetails.First().SaleOutStore_ID; + var json = RpcFacade.Call(RpcPath + "SaleOutStoreRpc/GetCustomerStockUp", barCode, id); + if (string.IsNullOrEmpty(json)) + throw new Exception("无备货信息或条码跟客户不匹配"); + var list = JsonConvert.DeserializeObject>(json); + //detail.BillID = orderDetail.SaleOutStore_ID; + //detail.DetailID = orderDetail.ID; + //detail.Goods_ID = orderDetail.Goods_ID; + //detail.Goods_Code = orderDetail.Goods_Code; + //detail.Goods_Name = orderDetail.Goods_Name; + //detail.Number = scanInfo.DecimalExt1.Value; + //if (orderDetail.Number.HasValue && orderDetail.SecondNumber.HasValue && orderDetail.Number != 0) + // detail.SecondNumber = decimal.Round(orderDetail.SecondNumber.Value * detail.Number / orderDetail.Number.Value, 2); + //detail.Operator = "扫码发货"; + using (var session = DmoSession.New()) + { + if (list.Any()) + { + var existCodes = GetExistCodes(session, list.Select(x => x.BarCode)); + foreach (var item in existCodes) + list.Remove(list.First(x => x.BarCode == item)); + } + foreach (var item in list) + { + item.BillID = id; + item.Operator = "按备货发货"; + session.Insert(item); + } + foreach (var g in list.GroupBy(x => x.DetailID)) + { + var first = orderDetails.FirstOrDefault(x => x.ID == g.Key); + if (first == null) + throw new Exception(string.Format("备货与出库单不符,出库单缺少存货{0}", g.First().Goods_Name)); + SubmitDetails(session, g, first, 1); + } + session.Commit(); + } + return list; + } + + private static List GetExistCodes(IDmoSession session, IEnumerable codes) + { + var query = new DQueryDom(new JoinAlias(typeof(SegmentSaleOut_Detail))); + query.Columns.Add(DQSelectColumn.Field("BarCode")); + query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("BarCode"), codes.Select(x => DQExpression.Value(x)).ToArray())); + return query.EExecuteList(session); + } } } diff --git a/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.Designer.cs b/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.Designer.cs index bfe2b7e..e280f14 100644 --- a/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.Designer.cs +++ b/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.Designer.cs @@ -28,24 +28,24 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle 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 dataGridViewCellStyle10 = 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 dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = 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 dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); this.barCodeBox = new System.Windows.Forms.TextBox(); this.uLabel1 = new WinFormControl.ULabel(); @@ -202,18 +202,18 @@ this.inStoreGrid.AllowUserToDeleteRows = false; this.inStoreGrid.AllowUserToResizeColumns = false; this.inStoreGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.inStoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.inStoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; this.inStoreGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.inStoreGrid.BackgroundColor = System.Drawing.Color.White; this.inStoreGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle20.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle20.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.inStoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.inStoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.inStoreGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.inStoreGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.I_ID, @@ -228,9 +228,9 @@ this.inStoreGrid.Name = "inStoreGrid"; this.inStoreGrid.ReadOnly = true; this.inStoreGrid.RowHeadersVisible = false; - dataGridViewCellStyle23.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle23.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.inStoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle23; + dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.inStoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle5; this.inStoreGrid.RowTemplate.Height = 23; this.inStoreGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.inStoreGrid.Size = new System.Drawing.Size(618, 398); @@ -282,8 +282,8 @@ // I_Weight // this.I_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle21.Format = "#0.######"; - this.I_Weight.DefaultCellStyle = dataGridViewCellStyle21; + dataGridViewCellStyle3.Format = "#0.######"; + this.I_Weight.DefaultCellStyle = dataGridViewCellStyle3; this.I_Weight.HeaderText = "重量"; this.I_Weight.Name = "I_Weight"; this.I_Weight.ReadOnly = true; @@ -292,9 +292,9 @@ // I_InStoreTime // this.I_InStoreTime.DataPropertyName = "InStoreTime"; - dataGridViewCellStyle22.Format = "T"; - dataGridViewCellStyle22.NullValue = null; - this.I_InStoreTime.DefaultCellStyle = dataGridViewCellStyle22; + dataGridViewCellStyle4.Format = "T"; + dataGridViewCellStyle4.NullValue = null; + this.I_InStoreTime.DefaultCellStyle = dataGridViewCellStyle4; this.I_InStoreTime.HeaderText = "入库时间"; this.I_InStoreTime.Name = "I_InStoreTime"; this.I_InStoreTime.ReadOnly = true; @@ -366,15 +366,15 @@ this.backStoreGrid.AllowUserToDeleteRows = false; this.backStoreGrid.AllowUserToResizeColumns = false; this.backStoreGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle24.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.backStoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle24; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.backStoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6; this.backStoreGrid.BackgroundColor = System.Drawing.Color.White; this.backStoreGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle25.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle25.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle25.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle25.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.backStoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle25; + 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.backStoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7; this.backStoreGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.backStoreGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.B_ID, @@ -390,9 +390,9 @@ this.backStoreGrid.Name = "backStoreGrid"; this.backStoreGrid.ReadOnly = true; this.backStoreGrid.RowHeadersVisible = false; - dataGridViewCellStyle28.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle28.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.backStoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle28; + dataGridViewCellStyle10.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.backStoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle10; this.backStoreGrid.RowTemplate.Height = 23; this.backStoreGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.backStoreGrid.Size = new System.Drawing.Size(624, 178); @@ -445,8 +445,8 @@ // B_Weight // this.B_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle26.Format = "#0.######"; - this.B_Weight.DefaultCellStyle = dataGridViewCellStyle26; + dataGridViewCellStyle8.Format = "#0.######"; + this.B_Weight.DefaultCellStyle = dataGridViewCellStyle8; this.B_Weight.HeaderText = "重量"; this.B_Weight.Name = "B_Weight"; this.B_Weight.ReadOnly = true; @@ -455,9 +455,9 @@ // B_ProductTime // this.B_ProductTime.DataPropertyName = "ProductTime"; - dataGridViewCellStyle27.Format = "T"; - dataGridViewCellStyle27.NullValue = null; - this.B_ProductTime.DefaultCellStyle = dataGridViewCellStyle27; + dataGridViewCellStyle9.Format = "T"; + dataGridViewCellStyle9.NullValue = null; + this.B_ProductTime.DefaultCellStyle = dataGridViewCellStyle9; this.B_ProductTime.HeaderText = "生产时间"; this.B_ProductTime.Name = "B_ProductTime"; this.B_ProductTime.ReadOnly = true; @@ -512,15 +512,15 @@ this.unInstoreGrid.AllowUserToDeleteRows = false; this.unInstoreGrid.AllowUserToResizeColumns = false; this.unInstoreGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle29.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.unInstoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle29; + dataGridViewCellStyle11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.unInstoreGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11; this.unInstoreGrid.BackgroundColor = System.Drawing.Color.White; this.unInstoreGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle30.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle30.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle30.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.unInstoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle30; + 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.unInstoreGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12; this.unInstoreGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.unInstoreGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn8, @@ -536,9 +536,9 @@ this.unInstoreGrid.Name = "unInstoreGrid"; this.unInstoreGrid.ReadOnly = true; this.unInstoreGrid.RowHeadersVisible = false; - dataGridViewCellStyle33.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle33.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.unInstoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle33; + dataGridViewCellStyle15.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle15.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.unInstoreGrid.RowsDefaultCellStyle = dataGridViewCellStyle15; this.unInstoreGrid.RowTemplate.Height = 23; this.unInstoreGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.unInstoreGrid.Size = new System.Drawing.Size(624, 145); @@ -591,8 +591,8 @@ // U_Weight // this.U_Weight.DataPropertyName = "Weight"; - dataGridViewCellStyle31.Format = "#0.######"; - this.U_Weight.DefaultCellStyle = dataGridViewCellStyle31; + dataGridViewCellStyle13.Format = "#0.######"; + this.U_Weight.DefaultCellStyle = dataGridViewCellStyle13; this.U_Weight.HeaderText = "重量"; this.U_Weight.Name = "U_Weight"; this.U_Weight.ReadOnly = true; @@ -601,9 +601,9 @@ // U_ProductTime // this.U_ProductTime.DataPropertyName = "ProductTime"; - dataGridViewCellStyle32.Format = "T"; - dataGridViewCellStyle32.NullValue = null; - this.U_ProductTime.DefaultCellStyle = dataGridViewCellStyle32; + dataGridViewCellStyle14.Format = "T"; + dataGridViewCellStyle14.NullValue = null; + this.U_ProductTime.DefaultCellStyle = dataGridViewCellStyle14; this.U_ProductTime.HeaderText = "生产时间"; this.U_ProductTime.MinimumWidth = 2; this.U_ProductTime.Name = "U_ProductTime"; @@ -640,15 +640,15 @@ this.exceptionGrid.AllowUserToDeleteRows = false; this.exceptionGrid.AllowUserToResizeColumns = false; this.exceptionGrid.AllowUserToResizeRows = false; - dataGridViewCellStyle34.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); - this.exceptionGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle34; + dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); + this.exceptionGrid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16; this.exceptionGrid.BackgroundColor = System.Drawing.Color.White; this.exceptionGrid.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle35.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle35.Font = new System.Drawing.Font("宋体", 12F); - dataGridViewCellStyle35.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle35.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.exceptionGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle35; + dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle17.Font = new System.Drawing.Font("宋体", 12F); + dataGridViewCellStyle17.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.exceptionGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle17; this.exceptionGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.exceptionGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.E_ID, @@ -661,9 +661,9 @@ this.exceptionGrid.Name = "exceptionGrid"; this.exceptionGrid.ReadOnly = true; this.exceptionGrid.RowHeadersVisible = false; - dataGridViewCellStyle36.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle36.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); - this.exceptionGrid.RowsDefaultCellStyle = dataGridViewCellStyle36; + dataGridViewCellStyle18.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); + this.exceptionGrid.RowsDefaultCellStyle = dataGridViewCellStyle18; this.exceptionGrid.RowTemplate.Height = 23; this.exceptionGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.exceptionGrid.Size = new System.Drawing.Size(624, 104); diff --git a/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.cs b/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.cs index b0909d6..03628dd 100644 --- a/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.cs +++ b/ButcherFactory.Form/SegmentInStore_/SegmentInStoreForm.cs @@ -180,7 +180,7 @@ namespace ButcherFactory.SegmentInStore_ { InsertExceptionInfo(code, msg); ControlsUtil.PlanVoice(msg); - InfoBox.Show("错误", msg, Color.Red, 1, this); + //InfoBox.Show("错误", msg, Color.Red, 1, this); return; } BindBackGrid(); @@ -200,7 +200,7 @@ namespace ButcherFactory.SegmentInStore_ { InsertExceptionInfo(code, msg); ControlsUtil.PlanVoice(msg); - InfoBox.Show("错误", msg, Color.Red, 1, this); + //InfoBox.Show("错误", msg, Color.Red, 1, this); return; } inStoreList.Insert(0, first); @@ -229,7 +229,7 @@ namespace ButcherFactory.SegmentInStore_ SegmentInStoreBL.Delete(entity.ID); inStoreList.Remove(entity); ControlsUtil.PlanVoice(msg); - InfoBox.Show("错误", msg, Color.Red, 1, this); + //InfoBox.Show("错误", msg, Color.Red, 1, this); })); } this.Invoke(new Action(() => diff --git a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs index 730316c..426c58c 100644 --- a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs +++ b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.Designer.cs @@ -468,7 +468,6 @@ this.historyDataGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.historyDataGrid.Size = new System.Drawing.Size(437, 308); this.historyDataGrid.TabIndex = 2; - this.historyDataGrid.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.historyDataGrid_CellClick); // // H_ID // @@ -484,7 +483,7 @@ this.H_RowIndex.HeaderText = "序号"; this.H_RowIndex.Name = "H_RowIndex"; this.H_RowIndex.ReadOnly = true; - this.H_RowIndex.Width = 80; + this.H_RowIndex.Width = 70; // // H_BarCode // @@ -562,11 +561,6 @@ private WinFormControl.UDataGridView historyDataGrid; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; - private System.Windows.Forms.DataGridViewTextBoxColumn H_ID; - private System.Windows.Forms.DataGridViewTextBoxColumn H_RowIndex; - private System.Windows.Forms.DataGridViewTextBoxColumn H_BarCode; - private System.Windows.Forms.DataGridViewTextBoxColumn H_Goods_Name; - private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight; private Controls.WeightControl uWeightControl1; private Controls.ColorButton rePrintBtn; private Controls.ColorButton closeBtn; @@ -574,5 +568,10 @@ private Controls.ColorButton deleteBtn; private System.Windows.Forms.Label msglbl; private System.Windows.Forms.CheckBox barPrintCheck; + private System.Windows.Forms.DataGridViewTextBoxColumn H_ID; + private System.Windows.Forms.DataGridViewTextBoxColumn H_RowIndex; + private System.Windows.Forms.DataGridViewTextBoxColumn H_BarCode; + private System.Windows.Forms.DataGridViewTextBoxColumn H_Goods_Name; + private System.Windows.Forms.DataGridViewTextBoxColumn H_Weight; } } \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs index 4409660..a801ecc 100644 --- a/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs +++ b/ButcherFactory.Form/SegmentProductionAuto_/SegmentProductionAutoForm.cs @@ -202,7 +202,7 @@ namespace ButcherFactory.SegmentProductionAuto_ if (historyList.Count > 30) historyList.RemoveAt(30); historyDataGrid.FirstDisplayedScrollingRowIndex = 0; - historyDataGrid.Rows[0].Selected = true; + historyDataGrid.ClearSelection(); historyDataGrid.Refresh(); if (barPrintCheck.Checked) { @@ -274,6 +274,7 @@ namespace ButcherFactory.SegmentProductionAuto_ { foreach (var item in tag) historyList.Remove(item); + historyDataGrid.ClearSelection(); historyDataGrid.Refresh(); })); } @@ -300,9 +301,14 @@ namespace ButcherFactory.SegmentProductionAuto_ { if (barPrintCheck.Checked) { - if (historyDataGrid.CurrentRow == null) + if (historyList.Count == 0) throw new Exception("请先选择要补打的记录"); - var item = historyDataGrid.CurrentRow.DataBoundItem as SegmentProduction; + SegmentProduction item; + var row = historyDataGrid.SelectedRows; + if (row.Count > 0) + item = row[0].DataBoundItem as SegmentProduction; + else + item = historyList.First(); NotAuto.SegmentProductionPrint.Print(item, batchDate, config.Template); } } @@ -312,32 +318,22 @@ namespace ButcherFactory.SegmentProductionAuto_ new TemplateSelector(config).ShowDialog(); } - long id = 0; private void deleteBtn_Click(object sender, EventArgs e) { - if (id == 0) - return; - var first = historyList.FirstOrDefault(x => x.ID == id); - if (first == null) + var row = historyDataGrid.SelectedRows; + if (row.Count == 0) return; if (MessageBox.Show("确定删除选中记录?", "删除确认", MessageBoxButtons.OKCancel) != DialogResult.OK) return; - SegmentProductionBL.SetAsDelete(first.ID, first.BarCode); - historyList.Remove(first); + var tag = historyDataGrid.SelectedRows[0].DataBoundItem as SegmentProduction; + SegmentProductionBL.SetAsDelete(tag.ID, tag.BarCode); + historyList.Remove(tag); historyDataGrid.DataSource = historyList; - if (historyList.Any()) - historyDataGrid.Rows[0].Selected = true; + historyDataGrid.ClearSelection(); historyDataGrid.Refresh(); var thd = new Thread(new ParameterizedThreadStart(RefreshTask)); - thd.Start(first); - } - - private void historyDataGrid_CellClick(object sender, DataGridViewCellEventArgs e) - { - if (historyDataGrid.CurrentRow == null) - return; - id = (long)historyDataGrid.CurrentRow.Cells["H_ID"].Value; + thd.Start(tag); } } } diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html index 4a69a54..5a9bee0 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint.html @@ -15,7 +15,7 @@ -
品名:$Goods_Name
+
品名:$Goods_Name
$Info  生产日期:$Date
diff --git a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint1.html b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint1.html index e0d5076..0d7c962 100644 --- a/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint1.html +++ b/ButcherFactory.Form/SegmentProduction_/SegmentProductionPrint1.html @@ -15,7 +15,7 @@ -
品名:$Goods_Name
+
品名:$Goods_Name
$Info  生产日期:$Date
执行标准:GB/T9959.2-2008
diff --git a/ButcherFactory.Form/SegmentSaleOut_/SegmentSaleOutForm.Designer.cs b/ButcherFactory.Form/SegmentSaleOut_/SegmentSaleOutForm.Designer.cs index 8e60673..70bfb5e 100644 --- a/ButcherFactory.Form/SegmentSaleOut_/SegmentSaleOutForm.Designer.cs +++ b/ButcherFactory.Form/SegmentSaleOut_/SegmentSaleOutForm.Designer.cs @@ -32,6 +32,10 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); @@ -45,10 +49,6 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel12 = new System.Windows.Forms.Panel(); this.discontSetBtn = new ButcherFactory.Controls.ColorButton(); this.disContLbl = new WinFormControl.ULabel(); @@ -56,6 +56,15 @@ this.readBtn = new ButcherFactory.Controls.ColorButton(); this.deleteBtn = new ButcherFactory.Controls.ColorButton(); this.weightRecordGridView = new WinFormControl.UDataGridView(); + this.F_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_Idx = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_GoodsCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_SecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_DiscontWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.F_Time = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.label2 = new System.Windows.Forms.Label(); this.detailGridView = new WinFormControl.UDataGridView(); this.D_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -111,15 +120,7 @@ this.uScanPanel1 = new WinFormControl.UScanPanel(); this.weightControl1 = new ButcherFactory.Controls.WeightControl(); this.object_d7bff25f_9863_49d3_8b36_d485c11bb256 = new ButcherFactory.Controls.RoundPanel(this.components); - this.F_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.F_Idx = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.F_BarCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.F_GoodsCode = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.F_Goods_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.F_SecondNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.F_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.F_DiscontWeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.F_Time = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.stockUpSendCheck = new System.Windows.Forms.CheckBox(); this.roundPanel1.SuspendLayout(); this.panel12.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.weightRecordGridView)).BeginInit(); @@ -153,11 +154,12 @@ this.panel12.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.panel12.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(247)))), ((int)(((byte)(247)))), ((int)(((byte)(247))))); + this.panel12.Controls.Add(this.deleteBtn); + this.panel12.Controls.Add(this.stockUpSendCheck); this.panel12.Controls.Add(this.discontSetBtn); this.panel12.Controls.Add(this.disContLbl); this.panel12.Controls.Add(this.flowLayoutPanel1); this.panel12.Controls.Add(this.readBtn); - this.panel12.Controls.Add(this.deleteBtn); this.panel12.Location = new System.Drawing.Point(505, 529); this.panel12.Name = "panel12"; this.panel12.Size = new System.Drawing.Size(673, 50); @@ -169,7 +171,7 @@ this.discontSetBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(144)))), ((int)(((byte)(98)))), ((int)(((byte)(222))))); this.discontSetBtn.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.discontSetBtn.ForeColor = System.Drawing.Color.White; - this.discontSetBtn.Location = new System.Drawing.Point(372, 8); + this.discontSetBtn.Location = new System.Drawing.Point(394, 8); this.discontSetBtn.Name = "discontSetBtn"; this.discontSetBtn.Radius = 10; this.discontSetBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); @@ -186,7 +188,7 @@ this.disContLbl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.disContLbl.Font = new System.Drawing.Font("黑体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.disContLbl.ForeColor = System.Drawing.Color.Red; - this.disContLbl.Location = new System.Drawing.Point(475, 8); + this.disContLbl.Location = new System.Drawing.Point(486, 8); this.disContLbl.Name = "disContLbl"; this.disContLbl.Size = new System.Drawing.Size(77, 35); this.disContLbl.TabIndex = 38; @@ -197,9 +199,9 @@ // this.flowLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel1.Location = new System.Drawing.Point(96, 2); + this.flowLayoutPanel1.Location = new System.Drawing.Point(200, 2); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(270, 47); + this.flowLayoutPanel1.Size = new System.Drawing.Size(188, 47); this.flowLayoutPanel1.TabIndex = 36; // // readBtn @@ -223,7 +225,7 @@ 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(6, 8); + this.deleteBtn.Location = new System.Drawing.Point(107, 8); this.deleteBtn.Name = "deleteBtn"; this.deleteBtn.Radius = 10; this.deleteBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106))))); @@ -281,6 +283,89 @@ this.weightRecordGridView.Size = new System.Drawing.Size(673, 128); this.weightRecordGridView.TabIndex = 12; // + // F_ID + // + this.F_ID.DataPropertyName = "ID"; + this.F_ID.HeaderText = "ID"; + this.F_ID.Name = "F_ID"; + this.F_ID.ReadOnly = true; + this.F_ID.Visible = false; + // + // F_Idx + // + this.F_Idx.DataPropertyName = "Idx"; + this.F_Idx.HeaderText = "序号"; + this.F_Idx.Name = "F_Idx"; + this.F_Idx.ReadOnly = true; + this.F_Idx.Width = 60; + // + // F_BarCode + // + this.F_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.F_BarCode.DataPropertyName = "ShortCode"; + this.F_BarCode.HeaderText = "存货条码"; + this.F_BarCode.MinimumWidth = 100; + this.F_BarCode.Name = "F_BarCode"; + this.F_BarCode.ReadOnly = true; + // + // F_GoodsCode + // + this.F_GoodsCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.F_GoodsCode.DataPropertyName = "Goods_Code"; + this.F_GoodsCode.HeaderText = "产品编码"; + this.F_GoodsCode.MinimumWidth = 100; + this.F_GoodsCode.Name = "F_GoodsCode"; + this.F_GoodsCode.ReadOnly = true; + // + // F_Goods_Name + // + this.F_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.F_Goods_Name.DataPropertyName = "Goods_Name"; + this.F_Goods_Name.HeaderText = "产品名称"; + this.F_Goods_Name.MinimumWidth = 100; + this.F_Goods_Name.Name = "F_Goods_Name"; + this.F_Goods_Name.ReadOnly = true; + // + // F_SecondNumber + // + this.F_SecondNumber.DataPropertyName = "SecondNumber"; + dataGridViewCellStyle3.Format = "#0.######"; + this.F_SecondNumber.DefaultCellStyle = dataGridViewCellStyle3; + this.F_SecondNumber.HeaderText = "辅数量"; + this.F_SecondNumber.Name = "F_SecondNumber"; + this.F_SecondNumber.ReadOnly = true; + this.F_SecondNumber.Width = 60; + // + // F_Number + // + this.F_Number.DataPropertyName = "Number"; + dataGridViewCellStyle4.Format = "#0.######"; + this.F_Number.DefaultCellStyle = dataGridViewCellStyle4; + this.F_Number.HeaderText = "报价数量"; + this.F_Number.Name = "F_Number"; + this.F_Number.ReadOnly = true; + this.F_Number.Width = 80; + // + // F_DiscontWeight + // + this.F_DiscontWeight.DataPropertyName = "DiscontWeight"; + dataGridViewCellStyle5.Format = "#0.######"; + this.F_DiscontWeight.DefaultCellStyle = dataGridViewCellStyle5; + this.F_DiscontWeight.HeaderText = "扣重"; + this.F_DiscontWeight.Name = "F_DiscontWeight"; + this.F_DiscontWeight.ReadOnly = true; + this.F_DiscontWeight.Width = 60; + // + // F_Time + // + this.F_Time.DataPropertyName = "Time"; + dataGridViewCellStyle6.Format = "MM.dd HH:mm:ss"; + this.F_Time.DefaultCellStyle = dataGridViewCellStyle6; + this.F_Time.HeaderText = "时间"; + this.F_Time.Name = "F_Time"; + this.F_Time.ReadOnly = true; + this.F_Time.Width = 120; + // // label2 // this.label2.AutoSize = true; @@ -965,88 +1050,17 @@ this.object_d7bff25f_9863_49d3_8b36_d485c11bb256.Size = new System.Drawing.Size(262, 74); this.object_d7bff25f_9863_49d3_8b36_d485c11bb256.TabIndex = 0; // - // F_ID - // - this.F_ID.DataPropertyName = "ID"; - this.F_ID.HeaderText = "ID"; - this.F_ID.Name = "F_ID"; - this.F_ID.ReadOnly = true; - this.F_ID.Visible = false; - // - // F_Idx - // - this.F_Idx.DataPropertyName = "Idx"; - this.F_Idx.HeaderText = "序号"; - this.F_Idx.Name = "F_Idx"; - this.F_Idx.ReadOnly = true; - this.F_Idx.Width = 60; - // - // F_BarCode - // - this.F_BarCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.F_BarCode.DataPropertyName = "ShortCode"; - this.F_BarCode.HeaderText = "存货条码"; - this.F_BarCode.MinimumWidth = 100; - this.F_BarCode.Name = "F_BarCode"; - this.F_BarCode.ReadOnly = true; - // - // F_GoodsCode - // - this.F_GoodsCode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.F_GoodsCode.DataPropertyName = "Goods_Code"; - this.F_GoodsCode.HeaderText = "产品编码"; - this.F_GoodsCode.MinimumWidth = 100; - this.F_GoodsCode.Name = "F_GoodsCode"; - this.F_GoodsCode.ReadOnly = true; - // - // F_Goods_Name - // - this.F_Goods_Name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.F_Goods_Name.DataPropertyName = "Goods_Name"; - this.F_Goods_Name.HeaderText = "产品名称"; - this.F_Goods_Name.MinimumWidth = 100; - this.F_Goods_Name.Name = "F_Goods_Name"; - this.F_Goods_Name.ReadOnly = true; - // - // F_SecondNumber - // - this.F_SecondNumber.DataPropertyName = "SecondNumber"; - dataGridViewCellStyle3.Format = "#0.######"; - this.F_SecondNumber.DefaultCellStyle = dataGridViewCellStyle3; - this.F_SecondNumber.HeaderText = "辅数量"; - this.F_SecondNumber.Name = "F_SecondNumber"; - this.F_SecondNumber.ReadOnly = true; - this.F_SecondNumber.Width = 60; - // - // F_Number - // - this.F_Number.DataPropertyName = "Number"; - dataGridViewCellStyle4.Format = "#0.######"; - this.F_Number.DefaultCellStyle = dataGridViewCellStyle4; - this.F_Number.HeaderText = "报价数量"; - this.F_Number.Name = "F_Number"; - this.F_Number.ReadOnly = true; - this.F_Number.Width = 80; - // - // F_DiscontWeight - // - this.F_DiscontWeight.DataPropertyName = "DiscontWeight"; - dataGridViewCellStyle5.Format = "#0.######"; - this.F_DiscontWeight.DefaultCellStyle = dataGridViewCellStyle5; - this.F_DiscontWeight.HeaderText = "扣重"; - this.F_DiscontWeight.Name = "F_DiscontWeight"; - this.F_DiscontWeight.ReadOnly = true; - this.F_DiscontWeight.Width = 60; - // - // F_Time + // stockUpSendCheck // - this.F_Time.DataPropertyName = "Time"; - dataGridViewCellStyle6.Format = "MM.dd HH:mm:ss"; - this.F_Time.DefaultCellStyle = dataGridViewCellStyle6; - this.F_Time.HeaderText = "时间"; - this.F_Time.Name = "F_Time"; - this.F_Time.ReadOnly = true; - this.F_Time.Width = 120; + this.stockUpSendCheck.AutoSize = true; + this.stockUpSendCheck.Font = new System.Drawing.Font("宋体", 12F); + this.stockUpSendCheck.ForeColor = System.Drawing.Color.Red; + this.stockUpSendCheck.Location = new System.Drawing.Point(0, 16); + this.stockUpSendCheck.Name = "stockUpSendCheck"; + this.stockUpSendCheck.Size = new System.Drawing.Size(107, 20); + this.stockUpSendCheck.TabIndex = 14; + this.stockUpSendCheck.Text = "按备货发货"; + this.stockUpSendCheck.UseVisualStyleBackColor = true; // // SegmentSaleOutForm // @@ -1060,6 +1074,7 @@ this.roundPanel1.ResumeLayout(false); this.roundPanel1.PerformLayout(); this.panel12.ResumeLayout(false); + this.panel12.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.weightRecordGridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.detailGridView)).EndInit(); this.panel7.ResumeLayout(false); @@ -1150,6 +1165,7 @@ private System.Windows.Forms.DataGridViewTextBoxColumn F_Number; private System.Windows.Forms.DataGridViewTextBoxColumn F_DiscontWeight; private System.Windows.Forms.DataGridViewTextBoxColumn F_Time; + private System.Windows.Forms.CheckBox stockUpSendCheck; } } \ No newline at end of file diff --git a/ButcherFactory.Form/SegmentSaleOut_/SegmentSaleOutForm.cs b/ButcherFactory.Form/SegmentSaleOut_/SegmentSaleOutForm.cs index 0b59aab..f4fc6b2 100644 --- a/ButcherFactory.Form/SegmentSaleOut_/SegmentSaleOutForm.cs +++ b/ButcherFactory.Form/SegmentSaleOut_/SegmentSaleOutForm.cs @@ -102,8 +102,10 @@ namespace ButcherFactory.SegmentSaleOut_ throw new Exception("扫码重复"); if (SegmentSaleOutBL.BarCodeUsed(barCode)) throw new Exception("扫码重复"); - - InsertDetailByScan(barCode); + if (stockUpSendCheck.Checked) + BatchInsertByScan(barCode); + else + InsertDetailByScan(barCode); WinFormControl.SoundPalyUtil.PlaySound(WinFormControl.SoundType.Click); } @@ -126,6 +128,32 @@ namespace ButcherFactory.SegmentSaleOut_ BindDetailByLocal(orderDetail.ID); } + void BatchInsertByScan(string barCode) + { + var results = SegmentSaleOutBL.InsertByStockUp(barCode, details); + var orderDetail = detailGridView.CurrentRow.DataBoundItem as SaleOutStore_Detail; + var idx = weightRecord.Any() ? weightRecord.Max(x => x.Idx) + 1 : 1; + foreach (var item in results.Where(x=>x.DetailID==orderDetail.ID)) + { + item.Idx = idx; + weightRecord.Insert(0, item); + idx++; + } + weightRecordGridView.FirstDisplayedScrollingRowIndex = 0; + weightRecordGridView.Refresh(); + + foreach (var item in details) + { + item.SNumber = (item.SNumber ?? 0) + results.Where(x => x.DetailID == item.ID).Sum(x => x.Number); + if (item.SNumber == 0) + item.SNumber = null; + item.SSecondNumber = (item.SSecondNumber ?? 0) + results.Where(x => x.DetailID == item.ID).Sum(x => x.SecondNumber); + if (item.SSecondNumber == 0) + item.SSecondNumber = null; + } + detailGridView.Refresh(); + } + private void queryControl_MouseDown(object sender, MouseEventArgs e) { var simpleLbl = sender as Label; @@ -284,6 +312,8 @@ namespace ButcherFactory.SegmentSaleOut_ { if (weightRecordGridView.CurrentRow == null) return; + if (MessageBox.Show("确定删除选中明细?", "删除确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) + return; var id = (long)weightRecordGridView.CurrentRow.Cells[0].Value; var tag = weightRecord.First(x => x.ID == id); SegmentSaleOutBL.DeleteAndUpdate(tag);
执行标准:GB/T9959.2-2008