diff --git a/B3ClientService.Web/Pages/B3ClientService/Reports/CarcassLossAnalyse_/CarcassLossAnalyse.cs b/B3ClientService.Web/Pages/B3ClientService/Reports/CarcassLossAnalyse_/CarcassLossAnalyse.cs index 10dcf17..290e1f6 100644 --- a/B3ClientService.Web/Pages/B3ClientService/Reports/CarcassLossAnalyse_/CarcassLossAnalyse.cs +++ b/B3ClientService.Web/Pages/B3ClientService/Reports/CarcassLossAnalyse_/CarcassLossAnalyse.cs @@ -64,22 +64,23 @@ namespace BWP.Web.Pages.B3ClientService.Reports.CarcassLossAnalyse_ hp.EAdd(new SimpleLabel("生产批次")); batchSelect = hp.EAdd(new ChoiceBox(B3ClientServiceConsts.DataSources.生产批次) { EnableInputArgument = true, EnableTopItem = true, AutoPostBack = true, Width = Unit.Pixel(180) }); var batch = GetYesterdayBatch(); - if (!string.IsNullOrEmpty(batch)) - batchSelect.Fill(batch, batch); + if (batch != null) + batchSelect.Fill(batch.Item1.ToString(), batch.Item2); batchSelect.SelectedValueChanged += delegate { StartQuery(); }; } - string GetYesterdayBatch() + Tuple GetYesterdayBatch() { var dom = new DQueryDom(new JoinAlias(typeof(ProductBatch))); + dom.Columns.Add(DQSelectColumn.Field("ID")); dom.Columns.Add(DQSelectColumn.Field("Name")); dom.OrderBy.Expressions.Add(DQOrderByExpression.Create("Date", true)); dom.Where.Conditions.Add(DQCondition.LessThan("Date", DateTime.Today)); dom.Range = SelectRange.Top(1); - return dom.EExecuteScalar(); + return dom.EExecuteScalar(); } private TitlePanel CreateResultTab() diff --git a/B3ClientService.Web/Pages/B3ClientService/Reports/CarcassStateAnalyse_/CarcassStateAnalyse.cs b/B3ClientService.Web/Pages/B3ClientService/Reports/CarcassStateAnalyse_/CarcassStateAnalyse.cs index c6e3922..d15f369 100644 --- a/B3ClientService.Web/Pages/B3ClientService/Reports/CarcassStateAnalyse_/CarcassStateAnalyse.cs +++ b/B3ClientService.Web/Pages/B3ClientService/Reports/CarcassStateAnalyse_/CarcassStateAnalyse.cs @@ -52,27 +52,25 @@ namespace BWP.Web.Pages.B3ClientService.Reports.CarcassStateAnalyse_ ChoiceBox batchSelect; DFCheckBox noCodeBox; DateInput butcherDate; + DFTextBox minInput, maxInput; private void AddQueryControl(Panel queryPanel) { var hp = queryPanel.EAdd(new Panel()); hp.Style.Add("float", "right"); hp.EAdd(new SimpleLabel("屠宰日期")); butcherDate = hp.EAdd(new DateInput()); - noCodeBox = hp.EAdd(new DFCheckBox() { Text = "查看无码", AutoPostBack = true }); - noCodeBox.InputAttributes.Add("style", "width:15px;height:15px;"); hp.EAdd(new SimpleLabel("生产批次")); - batchSelect = hp.EAdd(new ChoiceBox(B3ClientServiceConsts.DataSources.生产批次) { EnableInputArgument = true, EnableTopItem = true, AutoPostBack = true, Width = Unit.Pixel(160) }); + batchSelect = hp.EAdd(new ChoiceBox(B3ClientServiceConsts.DataSources.生产批次) { EnableInputArgument = true, EnableTopItem = true, Width = Unit.Pixel(160) }); var batch = GetYesterdayBatch(); if (batch != null) batchSelect.Fill(batch.Item1.ToString(), batch.Item2); - noCodeBox.CheckedChanged += delegate - { - StartQuery(); - }; - batchSelect.SelectedValueChanged += delegate - { - StartQuery(); - }; + hp.EAdd(new SimpleLabel("入库重量")); + minInput = hp.EAdd(new DFTextBox() { Width = Unit.Pixel(50) }); + hp.EAdd(new LiteralControl("-")); + maxInput = hp.EAdd(new DFTextBox() { Width = Unit.Pixel(50) }); + noCodeBox = hp.EAdd(new DFCheckBox() { Text = "查看无码" }); + noCodeBox.InputAttributes.Add("style", "width:15px;height:15px;"); + hp.EAdd(new TSButton("开始查询", delegate { StartQuery(); })); } Tuple GetYesterdayBatch() @@ -148,6 +146,10 @@ namespace BWP.Web.Pages.B3ClientService.Reports.CarcassStateAnalyse_ } if (noCodeBox.Checked) query.Where.Conditions.Add(DQCondition.Or(DQCondition.IsNull(DQExpression.Field("BarCode")), DQCondition.EQ("BarCode", ""))); + if (!minInput.IsEmpty) + query.Where.Conditions.Add(DQCondition.GreaterThanOrEqual("InStoreWeight", decimal.Parse(minInput.Text))); + if (!maxInput.IsEmpty) + query.Where.Conditions.Add(DQCondition.LessThanOrEqual("InStoreWeight", decimal.Parse(maxInput.Text))); var args = new LoadArguments(query); foreach (var idx in sumColumns) args.SumColumns.Add(idx);