diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.cs b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.cs index 7f306f6..fc18175 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.cs +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.cs @@ -97,6 +97,8 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ base.InitForm(form); } + private ChoiceBox _goodsPropertyCatalog; + protected override void AddQueryControls(VLayoutPanel vPanel) { var layout = new LayoutManager("Main", _mainInfo); @@ -112,6 +114,14 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ layout.Add("BillState", state); layout.Add("OrderDate", QueryCreator.TimeRange(_mainInfo.Fields["OrderDate"], mQueryContainer, "MinOrderDate", "MaxOrderDate")); + _goodsPropertyCatalog = QueryCreator.DFChoiceBoxEnableMultiSelection(_detailInfo.Fields["GoodsPropertyCatalog_ID"], B3UnitedInfosConsts.DataSources.存货属性分类); + layout.Add("GoodsPropertyCatalog_ID", new SimpleLabel("属性分类"), mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(_goodsPropertyCatalog, s => long.Parse(s)), "GoodsPropertyCatalog_ID")); + layout["GoodsPropertyCatalog_ID"].NotAutoAddToContainer = true; + layout.Add("Customer_ID", mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(QueryCreator.DFChoiceBoxEnableMultiSelection(_mainInfo.Fields["Customer_ID"], B3SaleDataSources.用户配置客户全部), s => long.Parse(s)), "Customer_ID")); + layout.Add("TakeGoods_Type", mQueryContainer.AddLink(new ChoiceBoxMultiSelectLink(QueryCreator.DFNameValueInputEnableMultiSelection<配送方式>(_mainInfo.Fields["TakeGoods_Type"]), s => long.Parse(s)), "TakeGoods_Type")); + layout["GoodsPropertyCatalog_ID"].NotAutoAddToContainer = true; + + var config = layout.CreateDefaultConfig(4); config.Expand = false; var section = mPageLayoutManager.AddSection("查询条件", "查询条件"); @@ -166,8 +176,29 @@ namespace BWP.Web.Pages.B3QingDaoWanFu.SaleOutStore_ var dom = base.GetQueryDom(); var root = dom.From.RootSource.Alias; var detail = JoinAlias.Create("detail"); + var goods = new JoinAlias(typeof(SaleGoods)); + var goodsProperty = new JoinAlias(typeof(GoodsProperty)); + var goodsPropertyCatalog = new JoinAlias(typeof(GoodsPropertyCatalog)); + dom.From.AddJoin(JoinType.Left, new DQDmoSource(goods), DQCondition.EQ(detail, "SaleGoods_ID", goods, "ID")); + dom.From.AddJoin(JoinType.Left, new DQDmoSource(goodsProperty), DQCondition.EQ(goodsProperty, "ID", goods, "GoodsProperty_ID")); + dom.From.AddJoin(JoinType.Left, new DQDmoSource(goodsPropertyCatalog), DQCondition.EQ(goodsProperty, "GoodsPropertyCatalog_ID", goodsPropertyCatalog, "ID")); + + dom.Where.Conditions.Add(DQCondition.EQ(root, "Domain_ID", DomainContext.Current.ID)); OrganizationUtil.AddOrganizationLimit(dom, typeof(SaleOutStore)); + if (!_goodsPropertyCatalog.IsEmpty) + { + + var strs = B3SaleWebUtil.GetDeepByTreeName(_goodsPropertyCatalog.DisplayValue); + var conditions = new List(); + var values = _goodsPropertyCatalog.GetValues(); + for (int index = 0; index < values.Length; index++) + { + var value = values[index]; + conditions.Add(DQCondition.EQ(goodsPropertyCatalog, "TreeDeep" + strs[index] + "ID", value)); + } + dom.Where.Conditions.Add(DQCondition.Or(conditions)); + } foreach (var item in fieldInfo) diff --git a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.xml b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.xml index 6001b4e..741123b 100644 --- a/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.xml +++ b/B3QingDaoWanFu.Web/Pages/B3QingDaoWanFu/SaleOutStore_/SaleOutStoreSimpleAnayse.xml @@ -41,8 +41,14 @@ - - + + + + + + + + \ No newline at end of file