From a7e05ebe00fdcb649c012e5afc4a42a8d631e824 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期三, 02 四月 2025 08:38:24 +0800 Subject: [PATCH] 删除客户管理查询条件中的“客户编号” 完成 新增订单---黑白印件 的后道工序最右边增加一个“口 竖式”,同前面套号、压痕一样,默认不勾选,是竖式的业务经理自己下单时勾选 完成提交外协付款申请时,增加上传审批证明的上传图片功能,可以添加多张图片;查询列表中增加“付款状态:全部、已付款、未付款”查询条件,默认全部;“完工状态”改为默认未完工 完成请示批复----付款申请 中也要向上面的需求一样,增加上传审批证明的上传图片功能,可以添加多张图片 完成在“请示批复”中进行“批复”操作的时候要能查看上传的审批图片 完成包装要求”要显示在打印的订单中 完成包装要求”要显示在打印的订单中 完成收据联单的新增订单中,纸张选无碳纸时,不显示“品牌”、“克重”,在联数的后面增加颜色选择:“颜色:上白下红”(匹配联数)订单管理中的“订单状态”删除,删除后新增两个状态:“完工状态:全部、未完工、已完工”和“送货状态:全部、已送货、未送货” 完成请示批复中默认“未批复” 完成请示批复中默认“未批复” 完成 --- CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanDakaList.aspx.cs | 101 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 99 insertions(+), 2 deletions(-) diff --git a/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanDakaList.aspx.cs b/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanDakaList.aspx.cs index 2789512..b9c634d 100644 --- a/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanDakaList.aspx.cs +++ b/CY_ECommercePlatform/CY.WebForm/Pages/business/DeliverPlanDakaList.aspx.cs @@ -18,6 +18,9 @@ using CY.SQLDAL; using System.Data.SqlClient; using CY.Infrastructure.Logging; +using NPOI.SS.UserModel; +using NPOI.XSSF.UserModel; +using System.IO; namespace CY.WebForm.Pages.business { @@ -228,9 +231,103 @@ UCPager1.AspNetPager.RecordCount = pa.RecordCount; } - - + + //鏌ヨ浜嬩欢 + protected void btn_Daochu_Click(object src, EventArgs e) + { + + byte[] fileBytes = ExportToExcel(); + if (fileBytes != null) + { + Response.Clear(); + Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; + Response.AppendHeader("Content-Disposition", "attachment; filename=鎵撳崱瀵煎嚭.xlsx"); + Response.BinaryWrite(fileBytes); + Response.End(); + } + else + { + // 澶勭悊瀵煎嚭澶辫触鐨勬儏鍐� + Response.Write("瀵煎嚭澶辫触锛岃绋嶅悗閲嶈瘯锛�"); + } + + } + + + public byte[] ExportToExcel() + { + byte[] bt = null; + try + { + Pagination pa = new Pagination(); + pa.PageSize = 1000; + pa.PageIndex = 1; + + + + IEnumerable<OA_DriverRecord> results = _oA_DriverRecordBLL.SelectModelPage(pa, + this.txtCreatTimestart.Value, + this.txtCreatTimeend.Value, + this.selCarId.Value, + this.txtCreater.Value, + this.selClockType.Value + ); + + // 鍒涘缓宸ヤ綔绨� + IWorkbook workbook = new XSSFWorkbook(); + ISheet sheet = workbook.CreateSheet("瀵煎嚭鏁版嵁"); + + // 鍒涘缓琛ㄥご + IRow headerRow = sheet.CreateRow(0); + headerRow.CreateCell(0).SetCellValue("缂栧彿"); + headerRow.CreateCell(1).SetCellValue("杞﹁締"); + headerRow.CreateCell(2).SetCellValue("椹鹃┒鍛�"); + headerRow.CreateCell(3).SetCellValue("鎵撳崱鏃堕棿"); + headerRow.CreateCell(4).SetCellValue("鎵撳崱绫诲瀷"); + headerRow.CreateCell(5).SetCellValue("鏈璐ф儏鍐�"); + headerRow.CreateCell(6).SetCellValue("杞﹀喌"); + headerRow.CreateCell(7).SetCellValue("澶囨敞"); + headerRow.CreateCell(8).SetCellValue("閲岀▼(鍏噷)"); + + + + // 娣诲姞鏁版嵁 + int rowIndex = 1; + foreach (var oA_DriverRecord in results) + { + IRow row = sheet.CreateRow(rowIndex++); + row.CreateCell(0).SetCellValue((rowIndex - 1).ToString()); + row.CreateCell(1).SetCellValue(oA_DriverRecord.CarName); + row.CreateCell(2).SetCellValue(oA_DriverRecord.Creater); + row.CreateCell(3).SetCellValue(oA_DriverRecord.CreatTime.ToString("yyyy-MM-dd")); + row.CreateCell(4).SetCellValue(oA_DriverRecord.ClockTypeName); + row.CreateCell(5).SetCellValue(oA_DriverRecord.EmptyCause); + row.CreateCell(6).SetCellValue(oA_DriverRecord.CarCondition); + row.CreateCell(7).SetCellValue(oA_DriverRecord.Remark); + row.CreateCell(8).SetCellValue(oA_DriverRecord.Mileage.ToString()); + + + + } + + // 灏嗗伐浣滅翱鍐欏叆鍐呭瓨娴� + using (var ms = new MemoryStream()) + { + workbook.Write(ms); + bt = ms.ToArray(); + } + } + catch (Exception e) + { + bt = null; + // 璁板綍鏃ュ織 + + } + return bt; + } + + } } \ No newline at end of file -- Gitblit v1.9.1