|
@@ -26,17 +26,20 @@ type ProduceBillExcel struct {
|
|
func (b *ProduceBillExcel) drawTitle() error {
|
|
func (b *ProduceBillExcel) drawTitle() error {
|
|
b.Row++
|
|
b.Row++
|
|
marginLeft := excelize.PageMarginLeft(0.15)
|
|
marginLeft := excelize.PageMarginLeft(0.15)
|
|
|
|
+ startCell := fmt.Sprintf("A%d", b.Row)
|
|
|
|
+ endCell := fmt.Sprintf("L%d", b.Row)
|
|
|
|
|
|
// !isPrint
|
|
// !isPrint
|
|
if !b.Content.IsPrint {
|
|
if !b.Content.IsPrint {
|
|
- marginLeft = excelize.PageMarginLeft(0.3)
|
|
|
|
|
|
+ endCell = fmt.Sprintf("I%d", b.Row)
|
|
|
|
+ marginLeft = excelize.PageMarginLeft(0.4)
|
|
b.Excel.SetColWidth(b.SheetName, "A", "B", 16)
|
|
b.Excel.SetColWidth(b.SheetName, "A", "B", 16)
|
|
- b.Excel.SetColWidth(b.SheetName, "C", "H", 12)
|
|
|
|
|
|
+ b.Excel.SetColWidth(b.SheetName, "C", "H", 10.5)
|
|
b.Excel.SetColWidth(b.SheetName, "I", "I", 16)
|
|
b.Excel.SetColWidth(b.SheetName, "I", "I", 16)
|
|
}
|
|
}
|
|
b.Excel.SetPageMargins(b.SheetName, marginLeft)
|
|
b.Excel.SetPageMargins(b.SheetName, marginLeft)
|
|
- startCell := fmt.Sprintf("A%d", b.Row)
|
|
|
|
- err := b.Excel.MergeCell(b.SheetName, startCell, fmt.Sprintf("L%d", b.Row))
|
|
|
|
|
|
+
|
|
|
|
+ err := b.Excel.MergeCell(b.SheetName, startCell, endCell)
|
|
if err != nil {
|
|
if err != nil {
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
@@ -332,29 +335,42 @@ func (b *ProduceBillExcel) drawTableSignature() error {
|
|
b.Excel.SetCellStyle(b.SheetName, billUserCell, billUservCell, style2)
|
|
b.Excel.SetCellStyle(b.SheetName, billUserCell, billUservCell, style2)
|
|
b.Excel.SetCellValue(b.SheetName, billUserCell, "制单人:"+b.Content.UserName)
|
|
b.Excel.SetCellValue(b.SheetName, billUserCell, "制单人:"+b.Content.UserName)
|
|
|
|
|
|
- fontCell := fmt.Sprintf("H%d", b.Row)
|
|
|
|
- imageCell1 := fmt.Sprintf("I%d", b.Row)
|
|
|
|
- imageCell2 := fmt.Sprintf("K%d", b.Row)
|
|
|
|
|
|
+ fontNum := "H"
|
|
|
|
+ image1s := "I"
|
|
|
|
+ image2s := "K"
|
|
|
|
+ image1e := "J"
|
|
|
|
+ image2e := "L"
|
|
|
|
|
|
// !isPrint
|
|
// !isPrint
|
|
if !b.Content.IsPrint {
|
|
if !b.Content.IsPrint {
|
|
- fontCell = fmt.Sprintf("E%d", b.Row)
|
|
|
|
- imageCell1 = fmt.Sprintf("F%d", b.Row)
|
|
|
|
- imageCell2 = fmt.Sprintf("H%d", b.Row)
|
|
|
|
|
|
+ fontNum = "E"
|
|
|
|
+ image1s = "F"
|
|
|
|
+ image2s = "H"
|
|
|
|
+ image1e = "G"
|
|
|
|
+ image2e = "I"
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- b.Excel.MergeCell(b.SheetName, fontCell, fmt.Sprintf("H%d", b.Row+2))
|
|
|
|
|
|
+ fontCell := fmt.Sprintf("%s%d", fontNum, b.Row)
|
|
|
|
+ fontEndCell := fmt.Sprintf("%s%d", fontNum, b.Row+2)
|
|
|
|
+
|
|
|
|
+ imageCell1 := fmt.Sprintf("%s%d", image1s, b.Row)
|
|
|
|
+ imageEndCell1 := fmt.Sprintf("%s%d", image1e, b.Row+2)
|
|
|
|
+
|
|
|
|
+ imageCell2 := fmt.Sprintf("%s%d", image2s, b.Row)
|
|
|
|
+ imageEndCell2 := fmt.Sprintf("%s%d", image2e, b.Row+2)
|
|
|
|
+
|
|
|
|
+ b.Excel.MergeCell(b.SheetName, fontCell, fontEndCell)
|
|
b.Excel.SetCellStyle(b.SheetName, fontCell, fontCell, style1)
|
|
b.Excel.SetCellStyle(b.SheetName, fontCell, fontCell, style1)
|
|
b.Excel.SetCellValue(b.SheetName, fontCell, "审核签字:")
|
|
b.Excel.SetCellValue(b.SheetName, fontCell, "审核签字:")
|
|
|
|
|
|
// 签字图片1 I10-J12
|
|
// 签字图片1 I10-J12
|
|
- b.Excel.MergeCell(b.SheetName, imageCell1, fmt.Sprintf("J%d", b.Row+2))
|
|
|
|
|
|
+ b.Excel.MergeCell(b.SheetName, imageCell1, imageEndCell1)
|
|
b.Excel.SetCellStyle(b.SheetName, imageCell1, imageCell1, style1)
|
|
b.Excel.SetCellStyle(b.SheetName, imageCell1, imageCell1, style1)
|
|
b.Excel.SetCellValue(b.SheetName, imageCell1, "")
|
|
b.Excel.SetCellValue(b.SheetName, imageCell1, "")
|
|
|
|
|
|
// 签字图片2 K10-L12
|
|
// 签字图片2 K10-L12
|
|
- b.Excel.MergeCell(b.SheetName, imageCell2, fmt.Sprintf("L%d", b.Row+2))
|
|
|
|
|
|
+ b.Excel.MergeCell(b.SheetName, imageCell2, imageEndCell2)
|
|
b.Excel.SetCellStyle(b.SheetName, imageCell2, imageCell1, style1)
|
|
b.Excel.SetCellStyle(b.SheetName, imageCell2, imageCell1, style1)
|
|
b.Excel.SetCellValue(b.SheetName, imageCell2, "")
|
|
b.Excel.SetCellValue(b.SheetName, imageCell2, "")
|
|
|
|
|