焊接修改
This commit is contained in:
@@ -10,6 +10,8 @@ using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using MiniExcelLibs;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
|
||||
namespace FineUIPro.Web.CLGL
|
||||
{
|
||||
@@ -47,6 +49,11 @@ namespace FineUIPro.Web.CLGL
|
||||
drpStates.DataSource = BLL.TwConst.StateMap;
|
||||
drpStates.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpStates);
|
||||
drpCategory.DataTextField = "Key";
|
||||
drpCategory.DataValueField = "Value";
|
||||
drpCategory.DataSource = BLL.TwConst.CategoryMap;
|
||||
drpCategory.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpCategory);
|
||||
|
||||
}
|
||||
#region 数据绑定
|
||||
@@ -66,6 +73,10 @@ namespace FineUIPro.Web.CLGL
|
||||
{
|
||||
table.State = Convert.ToInt32(drpStates.SelectedValue);
|
||||
}
|
||||
if (drpCategory.SelectedValue != Const._Null)
|
||||
{
|
||||
table.Category = Convert.ToInt32(drpCategory.SelectedValue);
|
||||
}
|
||||
if (drpWarehouse.SelectedValue != Const._Null)
|
||||
{
|
||||
table.WarehouseCode = drpWarehouse.SelectedValue;
|
||||
@@ -558,10 +569,11 @@ namespace FineUIPro.Web.CLGL
|
||||
List<Model.Tw_PrintDetail> tw_PrintDetails = new List<Model.Tw_PrintDetail>();
|
||||
Model.Tw_PrintMaster printMaster = new Model.Tw_PrintMaster
|
||||
{
|
||||
|
||||
|
||||
ReqUnitName = result.ReqUnitName,
|
||||
CusBillCode = result.CusBillCode,
|
||||
CreateDate = result.CreateDate.Value.ToString("yyyy-MM-dd"),
|
||||
CreateManName = !string.IsNullOrEmpty(result.CreateMan) ? BLL.Person_PersonsService.getSignatureUrl(result.CreateMan) : "",
|
||||
ProjectName = ProjectService.GetProjectNameByProjectId(result.ProjectId),
|
||||
CategoryString = result.CategoryString,
|
||||
BillName = TwConst.PrintMap.Where(x => x.Value == result.TypeInt).Select(x => x.Key).FirstOrDefault(),
|
||||
@@ -650,5 +662,32 @@ namespace FineUIPro.Web.CLGL
|
||||
#endregion
|
||||
|
||||
|
||||
protected void btnOut_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIDArray.Length > 0)
|
||||
{
|
||||
var sheets = new Dictionary<string, object>
|
||||
{
|
||||
["出库明细"] = TwOutputdetailService.GetPrintListByOutputMasterIds(Grid1.SelectedRowIDArray.ToList()),
|
||||
["管线材料明细"] = TwInoutplandetailRelationService.GetPrintListByOutputMasterIds(Grid1.SelectedRowIDArray.ToList())
|
||||
};
|
||||
string path = Funs.RootPath + @"File\Excel\Temp\OutputDetail.xlsx";
|
||||
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
|
||||
|
||||
MiniExcel.SaveAs(path, sheets);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user