diff --git a/erp/purchase.go b/erp/purchase.go index b59bd07..38cba78 100644 --- a/erp/purchase.go +++ b/erp/purchase.go @@ -80,7 +80,7 @@ type PurchaseProduct struct { CurrencySymbol string // 币种符号 CurrencyRate decimal.Decimal // 币种汇率 MeasureUnit string // 数量单位 - Batch []PurchaseProductBatch // 产品批次 + Batches []PurchaseProductBatch // 产品批次 } type PurchaseProductBatch struct { BatchNo int64 `binding:"required" label:"批次号"` @@ -146,6 +146,7 @@ func (p *purchase) Info(ctx context.Context, purchaseId int64) (reply ReplyPurch type ArgsPurchaseEdit struct { PurchaseId int64 // 采购合同id PoSerial string // PoSerial + BatchNo int64 // 批次号 Remark string // 备注 OrderDate *time.Time // 下单日期 FactoryAddress string // 工厂地址 @@ -235,3 +236,23 @@ func (p *purchase) CancelAudit(ctx context.Context, purchaseId int64) (err error err = xClient.Call(ctx, "CancelAudit", purchaseId, &reply) return } + +type ArgsPurchaseBatch struct { + PurchaseId int64 // 采购合同id + FactoryId int64 // 采购工厂id +} +type PurchaseBatchItem struct { + PurchaseId int64 `json:"purchaseId"` + BatchNo int64 `json:"batchNo"` + HasEdit bool `json:"hasEdit"` +} + +// Batch @TITLE 批次数据 +func (p *purchase) Batch(ctx context.Context, args ArgsPurchaseBatch) (reply []PurchaseBatchItem, err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + err = xClient.Call(ctx, "Batch", args, &reply) + return +} diff --git a/erp/purchase/product.go b/erp/purchase/product.go index 2087d0d..ad216fb 100644 --- a/erp/purchase/product.go +++ b/erp/purchase/product.go @@ -142,3 +142,23 @@ func (p *product) ListAccounting(ctx context.Context, args ArgsListAccounting) ( err = xClient.Call(ctx, "ListAccounting", args, &reply) return } + +type ProductBatchCountItem struct { + PurchaseProductId int64 `json:"purchaseProductId"` + SaleCount int64 `json:"saleCount"` + Batches []ProductBatchItem `json:"batch"` +} +type ProductBatchItem struct { + BatchNo int64 `json:"batchNo"` + PurchaseCount int64 `json:"purchaseCount"` +} + +// BatchCount @TITLE 批次数量 +func (p *product) BatchCount(ctx context.Context, purchaseProductIds []int64) (reply []ProductBatchCountItem, err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + err = xClient.Call(ctx, "BatchCount", purchaseProductIds, &reply) + return +}