|
@@ -217,24 +217,25 @@ func (c *StockController) Stock_Detail_Excel() {
|
|
|
})
|
|
|
|
|
|
StockMonthDao := Stock.NewStockMonth(orm.NewOrm())
|
|
|
- for i, r := range class_List {
|
|
|
-
|
|
|
+ var j = 0
|
|
|
+ for _, r := range class_List {
|
|
|
StockList := StockMonthDao.Read_StockMonth_List(T_depot_id, T_product_id, r.Id, T_start_date, T_end_date)
|
|
|
if len(StockList) == 0 {
|
|
|
continue
|
|
|
}
|
|
|
|
|
|
- if i == 0 {
|
|
|
+ if j == 0 {
|
|
|
f.SetSheetName("Sheet1", r.T_name)
|
|
|
} else {
|
|
|
f.NewSheet(r.T_name)
|
|
|
}
|
|
|
- f.MergeCell(r.T_name, "A1", "K1")
|
|
|
+ j += 1
|
|
|
+ f.MergeCell(r.T_name, "A1", "J1")
|
|
|
f.SetRowStyle(r.T_name, 1, 1, Style1)
|
|
|
f.SetCellValue(r.T_name, "A1", fmt.Sprintf("宝智达科技产品进销存统计表"))
|
|
|
f.SetRowHeight(r.T_name, 1, 30)
|
|
|
// 这里设置表头
|
|
|
- f.SetCellStyle(r.T_name, "A2", "K2", Style2)
|
|
|
+ f.SetCellStyle(r.T_name, "A2", "J2", Style2)
|
|
|
f.SetRowHeight(r.T_name, 2, 20)
|
|
|
|
|
|
f.SetCellValue(r.T_name, "A2", "序号")
|
|
@@ -247,7 +248,7 @@ func (c *StockController) Stock_Detail_Excel() {
|
|
|
f.SetCellValue(r.T_name, "H2", "当月出库")
|
|
|
f.SetCellValue(r.T_name, "I2", "期末库存")
|
|
|
f.SetCellValue(r.T_name, "J2", "出库项目")
|
|
|
- f.SetCellValue(r.T_name, "K2", "备注")
|
|
|
+ //f.SetCellValue(r.T_name, "K2", "备注")
|
|
|
// 设置列宽
|
|
|
f.SetColWidth(r.T_name, "A", "A", 10)
|
|
|
f.SetColWidth(r.T_name, "B", "B", 10)
|
|
@@ -259,7 +260,7 @@ func (c *StockController) Stock_Detail_Excel() {
|
|
|
f.SetColWidth(r.T_name, "H", "H", 10)
|
|
|
f.SetColWidth(r.T_name, "I", "I", 10)
|
|
|
f.SetColWidth(r.T_name, "J", "J", 10)
|
|
|
- f.SetColWidth(r.T_name, "K", "K", 10)
|
|
|
+ //f.SetColWidth(r.T_name, "K", "K", 10)
|
|
|
line := 2
|
|
|
|
|
|
// 循环写入数据
|
|
@@ -269,7 +270,7 @@ func (c *StockController) Stock_Detail_Excel() {
|
|
|
|
|
|
f.SetCellValue(r.T_name, fmt.Sprintf("A%d", line), line-2)
|
|
|
f.SetCellValue(r.T_name, fmt.Sprintf("B%d", line), product.T_name)
|
|
|
- f.SetCellValue(r.T_name, fmt.Sprintf("C%d", line), r.T_name)
|
|
|
+ f.SetCellValue(r.T_name, fmt.Sprintf("C%d", line), product.T_model)
|
|
|
f.SetCellValue(r.T_name, fmt.Sprintf("D%d", line), product.T_spec)
|
|
|
f.SetCellValue(r.T_name, fmt.Sprintf("E%d", line), v.T_month)
|
|
|
f.SetCellValue(r.T_name, fmt.Sprintf("F%d", line), v.T_beginning)
|
|
@@ -291,7 +292,7 @@ func (c *StockController) Stock_Detail_Excel() {
|
|
|
},
|
|
|
})
|
|
|
|
|
|
- f.SetCellStyle(r.T_name, "A2", fmt.Sprintf("K%d", line), Style4)
|
|
|
+ f.SetCellStyle(r.T_name, "A2", fmt.Sprintf("J%d", line), Style4)
|
|
|
|
|
|
}
|
|
|
|