|
@@ -138,15 +138,17 @@ func (b *ProcessBillExcel) drawTableTitle() error {
|
|
|
|
|
|
return b.Excel.SetCellValue(b.SheetName, left1Cell, value)
|
|
|
}
|
|
|
+ // a采购项目 b规格 c下单数量 d单位 e完成数量 f单价 g预算金额 h实际金额 i交货时间 j备注
|
|
|
drawCol("A", "采购项目")
|
|
|
drawCol("B", "规格")
|
|
|
- drawCol("C", "数量")
|
|
|
+ drawCol("C", "下单数量")
|
|
|
drawCol("D", "单位")
|
|
|
- drawCol("E", "单价")
|
|
|
- drawCol("F", "预算金额")
|
|
|
- drawCol("G", "实际金额")
|
|
|
- drawCol("H", "交货时间")
|
|
|
- drawCol("I", "备注")
|
|
|
+ drawCol("E", "完成数量")
|
|
|
+ drawCol("F", "单价")
|
|
|
+ drawCol("G", "预算金额")
|
|
|
+ drawCol("H", "实际金额")
|
|
|
+ drawCol("I", "交货时间")
|
|
|
+ drawCol("J", "备注")
|
|
|
|
|
|
return nil
|
|
|
}
|
|
@@ -156,7 +158,7 @@ func (b *ProcessBillExcel) drawTableContent() error {
|
|
|
b.Row = row
|
|
|
|
|
|
var DrawRow = func(rowIndex int, values ...string) {
|
|
|
- charas := []string{"A", "B", "C", "D", "E", "F", "G", "H", "I"}
|
|
|
+ charas := []string{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J"}
|
|
|
for i, c := range charas {
|
|
|
v := ""
|
|
|
if i < len(values) {
|
|
@@ -175,24 +177,22 @@ func (b *ProcessBillExcel) drawTableContent() error {
|
|
|
confirmCount := "-"
|
|
|
realAmount := "-"
|
|
|
// 预算金额
|
|
|
- budgetAmount := fmt.Sprintf("%.2f", float64(ps.Count)*ps.Price)
|
|
|
+ budgetAmount := fmt.Sprintf("%.2f", b.Content.BudgetAmount)
|
|
|
b.FormatToEmpty(&budgetAmount)
|
|
|
|
|
|
- if b.Content.Status == "complete" {
|
|
|
- // 实际完成数
|
|
|
- confirmCount = fmt.Sprintf("%d", b.Content.ConfirmCount)
|
|
|
- b.FormatToEmpty(&confirmCount)
|
|
|
+ // 实际完成数
|
|
|
+ confirmCount = fmt.Sprintf("%d", ps.ConfirmCount)
|
|
|
+ b.FormatToEmpty(&confirmCount)
|
|
|
|
|
|
- // 实际金额
|
|
|
- realAmount = fmt.Sprintf("%.2f", float64(b.Content.ConfirmCount)*ps.Price)
|
|
|
- b.FormatToEmpty(&realAmount)
|
|
|
- }
|
|
|
+ // 实际金额
|
|
|
+ realAmount = fmt.Sprintf("%.2f", b.Content.RealAmount)
|
|
|
+ b.FormatToEmpty(&realAmount)
|
|
|
|
|
|
- // 采购项目 规格 数量 单位 单价 预算金额 实际金额 交货时间 备注
|
|
|
- count := fmt.Sprintf("%d", ps.Count)
|
|
|
+ // a采购项目 b规格 c下单数量 d单位 e完成数量 f单价 g预算金额 h实际金额 i交货时间 j备注
|
|
|
+ orderCount := fmt.Sprintf("%d", ps.OrderCount)
|
|
|
price := fmt.Sprintf("%.2f", ps.Price)
|
|
|
b.FormatToEmpty(&price)
|
|
|
- DrawRow(row, ps.Name, ps.Norm, count, ps.Unit, price, budgetAmount, realAmount, deliveryTime, ps.Remark)
|
|
|
+ DrawRow(row, ps.Name, ps.Norm, orderCount, ps.Unit, confirmCount, price, budgetAmount, realAmount, deliveryTime, ps.Remark)
|
|
|
row++
|
|
|
b.Row++
|
|
|
}
|