From 221108b0e0416968ca8417513ebf65c8b5109662 Mon Sep 17 00:00:00 2001
From: lishihai <dslsh@dscom>
Date: 星期三, 26 六月 2024 11:40:47 +0800
Subject: [PATCH] 库存盘点应用按钮记录创建人,创建时间,应用时间、应用人员等信息;根据条形码查询产品详情;新增编辑产品增加条形码字段->添加条形码被使用验证
---
models/move_history.go | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/models/move_history.go b/models/move_history.go
index a83a53a..4d7b10d 100644
--- a/models/move_history.go
+++ b/models/move_history.go
@@ -19,6 +19,7 @@
OperationTypeName string `json:"operationTypeName" gorm:"type:varchar(127);not null;comment:浣滀笟绫诲瀷鍚嶇О"` //浣滀笟绫诲瀷鍚嶇О
OperationId int `json:"operationId" gorm:"type:int;not null;comment:鎿嶄綔id"` //鎿嶄綔id
ProductId string `json:"productId" gorm:"type:varchar(255);not null;comment:浜у搧id"` //浜у搧id
+ Product Material `json:"-" gorm:"foreignKey:ProductId"` //浜у搧
ProductName string `json:"productName" gorm:"type:varchar(255);not null;comment:浜у搧鍚嶇О"` //浜у搧鍚嶇О
Amount decimal.Decimal `json:"amount" gorm:"type:decimal(20,2);not null;comment:鏁伴噺"` //鏁伴噺
Unit string `json:"unit" gorm:"type:char(10);not null;comment:鍗曚綅"` //鍗曚綅
@@ -94,6 +95,10 @@
db = db.Where("product_name like ?", fmt.Sprintf("%%%v%%", slf.Keyword))
}
+ if slf.Preload {
+ db = db.Model(&MoveHistory{}).Preload("Product")
+ }
+
return db
}
--
Gitblit v1.8.0