|
@@ -225,8 +225,10 @@ func (b *ProductBillExcel) drawTableTitle() error {
|
|
|
func (b *ProductBillExcel) drawTableContent() error {
|
|
|
b.Row += 2
|
|
|
|
|
|
- var DrawRow = func(rowIndex int, values ...string) {
|
|
|
+ var DrawRow = func(rowIndex int, values ...string) float64 {
|
|
|
charas := []string{"A", "B", "C", "D", "E", "F", "G", "H", "I"}
|
|
|
+ // 获取改行最大行高
|
|
|
+ max := getRowHeight(values[0], b.getRangeWidth(charas[0]))
|
|
|
for i, c := range charas {
|
|
|
v := ""
|
|
|
if i < len(values) {
|
|
@@ -248,8 +250,12 @@ func (b *ProductBillExcel) drawTableContent() error {
|
|
|
// }
|
|
|
// }
|
|
|
// b.Excel.SetRowHeight(b.SheetName, rowIndex, 21*magN)
|
|
|
+ if getRowHeight(v, b.getRangeWidth(c)) > max {
|
|
|
+ max = getRowHeight(v, b.getRangeWidth(c))
|
|
|
+ }
|
|
|
b.Excel.SetRowHeight(b.SheetName, rowIndex, 50)
|
|
|
}
|
|
|
+ return max
|
|
|
}
|
|
|
products := b.Content.Products
|
|
|
if len(products) > 0 {
|
|
@@ -275,6 +281,9 @@ func (b *ProductBillExcel) drawTableContent() error {
|
|
|
b.FormatToEmpty(&price)
|
|
|
|
|
|
DrawRow(b.Row, product.Name, product.Norm, product.Size, orderCount, product.Unit, price, budgetAmount, deliveryTime, product.Remark)
|
|
|
+ // rowMaxHeight := DrawRow(b.Row, product.Name, product.Norm, product.Size, orderCount, product.Unit, price, budgetAmount, deliveryTime, product.Remark)
|
|
|
+ // 设置行高
|
|
|
+ // b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: rowMaxHeight})
|
|
|
|
|
|
b.Row++
|
|
|
}
|
|
@@ -305,6 +314,8 @@ func (b *ProductBillExcel) drawTableFooter() error {
|
|
|
b.Excel.SetCellStyle(b.SheetName, sendToStartCell, sendToEndCell, styleLeft)
|
|
|
b.Excel.SetCellValue(b.SheetName, sendToStartCell, "送货地址:"+b.Content.SendTo)
|
|
|
b.Excel.MergeCell(b.SheetName, supplierStartCell, supplierEndCell)
|
|
|
+ // 设置行高
|
|
|
+ // b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("送货地址:"+b.Content.SendTo, b.getRangeWidth("A:F"))})
|
|
|
b.Excel.SetCellStyle(b.SheetName, supplierStartCell, supplierEndCell, styleLeft)
|
|
|
b.Excel.SetCellValue(b.SheetName, supplierStartCell, " 供应商签字:")
|
|
|
b.Excel.SetRowHeight(b.SheetName, b.Row, 32)
|