| | |
| | | var fileName string |
| | | f := excelize.NewFile() |
| | | |
| | | unitData, unitIndexMap := GetAllUnits() |
| | | |
| | | // 自定义表头 |
| | | headers := []interface{}{"日期", "单号", "产品", "产品编码", "业务类型", "从", "至", map[string][]string{"数量": {"件", "匹", "米", "重量"}}, "单位", "重量"} |
| | | headers := []interface{}{"日期", "单号", "产品", "产品编码", "业务类型", "从", "至", map[string][]string{"数量": unitData}, "单位", "重量"} |
| | | |
| | | // 设置表头 |
| | | if err := SetExcelHeader(headers, f); err != nil { |
| | |
| | | f.SetCellValue("Sheet1", "F"+column, v.FromLocation) |
| | | f.SetCellValue("Sheet1", "G"+column, v.ToLocation) |
| | | f.SetCellValue("Sheet1", "H"+column, v.Amount) |
| | | FillMoreUnitToExcel(v.Amount, v.AmountMoreUnits, 7, i+3, f) |
| | | FillMoreUnitToExcel(v.AmountMoreUnits, 7, i+3, unitIndexMap, f) |
| | | f.SetCellValue("Sheet1", "L"+column, v.Unit) |
| | | f.SetCellValue("Sheet1", "M"+column, v.Weight) |
| | | } |