diff --git a/.vs/SGGL_SeDin_New/v17/.wsuo b/.vs/SGGL_SeDin_New/v17/.wsuo index a6886c55..ab83a5a7 100644 Binary files a/.vs/SGGL_SeDin_New/v17/.wsuo and b/.vs/SGGL_SeDin_New/v17/.wsuo differ diff --git a/DataBase/版本日志/SGGLDB_V2024-11-12.sql b/DataBase/版本日志/SGGLDB_V2024-11-12.sql new file mode 100644 index 00000000..6e22e7d1 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2024-11-12.sql @@ -0,0 +1,3 @@ +alter table dbo.Tw_InOutPlanDetail + add SortIndex int +go \ No newline at end of file diff --git a/SGGL/BLL/CLGL/TwConst.cs b/SGGL/BLL/CLGL/TwConst.cs index 11f0e9a2..f597baa5 100644 --- a/SGGL/BLL/CLGL/TwConst.cs +++ b/SGGL/BLL/CLGL/TwConst.cs @@ -45,8 +45,8 @@ namespace BLL }; public static Dictionary PlanPrintMap = new Dictionary { - { "采购通知单" ,(int)TypeInt.采购入库}, - { "退料通知单" ,(int)TypeInt.退料入库}, + { "采购入库申请单" ,(int)TypeInt.采购入库}, + { "退料入库申请单" ,(int)TypeInt.退料入库}, { "其他入库通知单" ,(int)TypeInt.其他入库}, { "材料领用申请单" ,(int)TypeInt.领料出库}, { "补料申请单" ,(int)TypeInt.补料出库}, diff --git a/SGGL/BLL/CLGL/TwInOutplandetailService.cs b/SGGL/BLL/CLGL/TwInOutplandetailService.cs index 45998070..209b4374 100644 --- a/SGGL/BLL/CLGL/TwInOutplandetailService.cs +++ b/SGGL/BLL/CLGL/TwInOutplandetailService.cs @@ -37,6 +37,7 @@ namespace BLL (string.IsNullOrEmpty(table.InOutPlanMasterId) || x.InOutPlanMasterId.Contains(table.InOutPlanMasterId)) && (string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) && (string.IsNullOrEmpty(table.MaterialCode) || x.MaterialCode.Contains(table.MaterialCode)) + orderby x.SortIndex select new Model.Tw_InOutDetailOutput { Id = x.Id, @@ -49,7 +50,7 @@ namespace BLL MaterialName = mat.MaterialName, MaterialDef= mat.MaterialDef, StockNum = stock.StockNum ?? 0, - } + } ; return q; @@ -94,6 +95,7 @@ namespace BLL MaterialCode = newtable.MaterialCode, PlanNum = newtable.PlanNum, ActNum = newtable.ActNum, + SortIndex = newtable.SortIndex }; Funs.DB.Tw_InOutPlanDetail.InsertOnSubmit(table); Funs.DB.SubmitChanges(); @@ -106,11 +108,14 @@ namespace BLL /// public static void AddList(IEnumerable list, string inoutPlanMasterId) { + int sortIndex = 1; foreach (var item in list) { item.Id= SQLHelper.GetNewID(); + item.SortIndex= sortIndex; item.InOutPlanMasterId = inoutPlanMasterId; Add(item); + sortIndex++; } } public static void Update(Model.Tw_InOutPlanDetail newtable) @@ -125,6 +130,7 @@ namespace BLL table.MaterialCode = newtable.MaterialCode; table.PlanNum = newtable.PlanNum; table.ActNum = newtable.ActNum; + table.SortIndex= newtable.SortIndex; Funs.DB.SubmitChanges(); } diff --git a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs index c0dff8e3..6a19976b 100644 --- a/SGGL/BLL/CLGL/TwInOutplanmasterService.cs +++ b/SGGL/BLL/CLGL/TwInOutplanmasterService.cs @@ -43,6 +43,7 @@ namespace BLL from warehouseperson in warehousepersons.DefaultIfEmpty() join unit in Funs.DB.Base_Unit on x.ReqUnitId equals unit.UnitId into units from unit in units.DefaultIfEmpty() + orderby x.CreateDate descending where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) && @@ -157,6 +158,7 @@ namespace BLL var result = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList(); // q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); return from x in result + select new Model.Tw_InOutMasterOutput { Id = x.Id, diff --git a/SGGL/BLL/CLGL/TwInputdetailService.cs b/SGGL/BLL/CLGL/TwInputdetailService.cs index 2b8ec442..eef2c6e9 100644 --- a/SGGL/BLL/CLGL/TwInputdetailService.cs +++ b/SGGL/BLL/CLGL/TwInputdetailService.cs @@ -121,5 +121,24 @@ namespace BLL } + public static IEnumerable GePrintListByInputMasterIds(List inputMasterIds) + { + var q = from x in Funs.DB.Tw_InputDetail + join mat in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals mat.MaterialCode into mm + from mat in mm.DefaultIfEmpty() + join y in Funs.DB.Tw_InputMaster on x.InputMasterId equals y.Id + where inputMasterIds.Contains(x.InputMasterId) + orderby y.CusBillCode , x.MaterialCode + select new + { + 入库单编号 = y.CusBillCode, + 材料编码 = x.MaterialCode, + 材料名称 = mat.MaterialName, + 材料描述 = mat.MaterialDef, + 计划数量 = x.PlanNum, + 实际数量 = x.ActNum, + }; + return q; + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx index 40b7dcee..aaa8e40c 100644 --- a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx @@ -143,7 +143,14 @@ runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="MaterialCode" SortDirection="DESC" EnableColumnLines="true" - AllowPaging="true" IsDatabasePaging="true" PageSize="10000" > + AllowPaging="true" IsDatabasePaging="true" PageSize="10000" EnableTextSelection="True" > + + + + + + + @@ -151,8 +158,8 @@ - + diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs index 92ea05c1..74e95519 100644 --- a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.cs @@ -80,6 +80,7 @@ namespace FineUIPro.Web.CLGL { Model.Tw_InOutDetailOutput table = new Model.Tw_InOutDetailOutput(); table.InOutPlanMasterId = inOutPlanMasterId; + table.MaterialCode = txtMaterialCode.Text; var tb = BLL.TwInOutplandetailService.GetListData(table, Grid2); Grid2.DataSource = tb; Grid2.DataBind(); @@ -329,7 +330,6 @@ namespace FineUIPro.Web.CLGL this.btnMenuEdit.Hidden = false; this.btnGenInMaster.Hidden = false; this.btnRevokeGenInMaster.Hidden = false; - this.btnPassMaster.Hidden = false; } if (buttonList.Contains(BLL.Const.BtnDelete)) { @@ -438,8 +438,8 @@ namespace FineUIPro.Web.CLGL AuditDate = string.Format("{0:yyyy-MM-dd}", result.AuditDate), AuditManName2 = !string.IsNullOrEmpty(result.AuditMan2) ? BLL.Person_PersonsService.getSignatureUrl(result.AuditMan2) : "", AuditDate2 = string.Format("{0:yyyy-MM-dd}", result.AuditDate2), - WarehouseManName = !string.IsNullOrEmpty(result.WarehouseMan) ? BLL.Person_PersonsService.getSignatureUrl(result.WarehouseMan) : "", - WarehouseManAuditDate = string.Format("{0:yyyy-MM-dd}", result.WarehouseDate), + WarehouseManName = !string.IsNullOrEmpty(result.CreateManName) ? BLL.Person_PersonsService.getSignatureUrl(result.CreateManName) : "", + WarehouseManAuditDate = string.Format("{0:yyyy-MM-dd}", result.CreateDate), }; tw_PrintMasters.Add(printMaster); // orderApproveIn.ProjectManager = !string.IsNullOrEmpty(approveManModels.InputApproveMan.ProjectManager) ? BLL.Person_PersonsService.getSignatureUrl(approveManModels.InputApproveMan.ProjectManager) : ""; @@ -479,6 +479,7 @@ namespace FineUIPro.Web.CLGL var tw_PrintDetail = ( from x in Funs.DB.Tw_InOutPlanDetail join y in Funs.DB.HJGL_MaterialCodeLib on x.MaterialCode equals y.MaterialCode where x.InOutPlanMasterId==Id + orderby x.SortIndex select new Model.Tw_PrintDetail { SortIndex =0, @@ -518,5 +519,9 @@ namespace FineUIPro.Web.CLGL } } + protected void txtMaterialCode_OnTextChanged(object sender, EventArgs e) + { + BindDetailGrid(Grid1.SelectedRowID); + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs index 0148b89c..401d9af5 100644 --- a/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMaster.aspx.designer.cs @@ -221,6 +221,15 @@ namespace FineUIPro.Web.CLGL /// protected global::FineUIPro.Grid Grid2; + /// + /// txtMaterialCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMaterialCode; + /// /// Label1 控件。 /// diff --git a/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx index 9e9723ed..aa49ef31 100644 --- a/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx +++ b/SGGL/FineUIPro.Web/CLGL/InPlanMasterEdit.aspx @@ -17,7 +17,7 @@
- @@ -54,7 +54,7 @@ - diff --git a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx index d4383db6..f6ec52fc 100644 --- a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx +++ b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx @@ -38,7 +38,7 @@ diff --git a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs index ae32704b..9902df49 100644 --- a/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs +++ b/SGGL/FineUIPro.Web/CLGL/InputMaster.aspx.cs @@ -1,4 +1,5 @@ using BLL; +using MiniExcelLibs; using Model; using System; using System.Collections.Generic; @@ -243,15 +244,26 @@ namespace FineUIPro.Web.CLGL /// protected void btnOut_Click(object sender, EventArgs e) { - Response.ClearContent(); - string filename = Funs.GetNewFileName(); - Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("出入库计划主表" + filename, System.Text.Encoding.UTF8) + ".xls"); - Response.ContentType = "application/excel"; - Response.ContentEncoding = System.Text.Encoding.UTF8; - this.Grid1.PageSize = 500; - this.BindGrid(); - Response.Write(GetGridTableHtml(Grid1)); - Response.End(); + if (Grid1.SelectedRowIDArray.Length>0) + { + var printModel= TwInputdetailService.GePrintListByInputMasterIds(Grid1.SelectedRowIDArray.ToList()); + string path = Funs.RootPath + @"File\Excel\Temp\InputDetail.xlsx"; + path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx"); + + MiniExcel.SaveAs(path, printModel); + + string fileName = "入库明细表.xlsx"; + FileInfo info = new FileInfo(path); + long fileSize = info.Length; + System.Web.HttpContext.Current.Response.Clear(); + System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize); + System.Web.HttpContext.Current.Response.Flush(); + System.Web.HttpContext.Current.Response.Close(); + File.Delete(path); + } } /// diff --git a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx index 32fb161f..1369d55e 100644 --- a/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx +++ b/SGGL/FineUIPro.Web/CLGL/MaterialStock.aspx @@ -35,7 +35,7 @@ runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="Id" SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true" EnableTextSelection="True" - AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" > + AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True"> diff --git a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx index e655fdb0..a308f150 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx +++ b/SGGL/FineUIPro.Web/CLGL/OutPlanMaster.aspx @@ -165,7 +165,7 @@ diff --git a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx index c2fdb37c..c3d6af57 100644 --- a/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx +++ b/SGGL/FineUIPro.Web/CLGL/OutputMaster.aspx @@ -158,7 +158,7 @@ <%-- - + using System; using System.Collections; using System.Collections.Generic; @@ -84,7 +84,7 @@ namespace FastReport } - + @@ -149,12 +149,12 @@ namespace FastReport - + - + diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 563f6c49..041b19b4 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -259100,6 +259100,8 @@ namespace Model private System.Nullable _ActNum; + private System.Nullable _SortIndex; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -259116,6 +259118,8 @@ namespace Model partial void OnPlanNumChanged(); partial void OnActNumChanging(System.Nullable value); partial void OnActNumChanged(); + partial void OnSortIndexChanging(System.Nullable value); + partial void OnSortIndexChanged(); #endregion public Tw_InOutPlanDetail() @@ -259243,6 +259247,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortIndex", DbType="Int")] + public System.Nullable SortIndex + { + get + { + return this._SortIndex; + } + set + { + if ((this._SortIndex != value)) + { + this.OnSortIndexChanging(value); + this.SendPropertyChanging(); + this._SortIndex = value; + this.SendPropertyChanged("SortIndex"); + this.OnSortIndexChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged;