From 3f5aa5f14c56e55a05902c7e3b9b112eb23ee80d Mon Sep 17 00:00:00 2001 From: liujiandao <274878379@qq.com> Date: 星期三, 03 一月 2024 17:27:04 +0800 Subject: [PATCH] 采购类型修改 --- model/test/material.go | 29 +++++++++++++++++------------ 1 files changed, 17 insertions(+), 12 deletions(-) diff --git a/model/test/material.go b/model/test/material.go index 31d322d..58f6412 100644 --- a/model/test/material.go +++ b/model/test/material.go @@ -10,8 +10,6 @@ Name string `gorm:"type:varchar(191);not null;comment:鐗╂枡鍚嶇О" json:"name"` MaterialType MaterialType `gorm:"index;type:int(11);comment:鐗╂枡绫诲瀷(鏁板瓧)" json:"materialType"` Model MaterialMode `gorm:"type:varchar(191);not null;comment:鐗╂枡绫诲瀷(瀛楃涓�)" json:"model"` - Explain string `gorm:"type:varchar(512);comment:缂栧彿璇存槑" json:"explain"` - CodeStandardID string `gorm:"type:varchar(191);comment:缂栫爜瑙勮寖ID" json:"codeStandardID"` Specs string `gorm:"type:varchar(191);comment:鐗╂枡瑙勬牸" json:"specs"` Type string `gorm:"type:varchar(191);comment:鐗╂枡鍨嬪彿" json:"type"` MinInventory decimal.Decimal `gorm:"type:decimal(35,18);comment:鏈�灏忓簱瀛�" json:"minInventory"` @@ -19,9 +17,7 @@ Amount decimal.Decimal `gorm:"type:decimal(35,18);comment:鏁伴噺" json:"amount"` LockAmount decimal.Decimal `gorm:"type:decimal(35,18);default:0;comment:閿佸畾鏁伴噺" json:"lockAmount"` Unit string `gorm:"type:varchar(100);comment:鍗曚綅" json:"unit"` - Note string `gorm:"type:varchar(1024);comment:澶囨敞" json:"note"` TemplateID string `gorm:"type:varchar(191);comment:妯℃澘ID" json:"-"` - FSource string `gorm:"type:varchar(191);comment:鐢熶骇杞﹂棿" json:"-"` Status MaterialStatus `gorm:"type:int(11);comment:鐘舵��" json:"status"` Supplier string `gorm:"type:varchar(191);comment:渚涘簲鍟�" json:"supplier"` PurchasePrice decimal.Decimal `gorm:"type:decimal(35,18);comment:閲囪喘浠锋牸" json:"purchasePrice"` @@ -29,10 +25,8 @@ ProduceAheadDay int `gorm:"type:int(11);comment:鍒堕�犳彁鍓嶆湡(澶�)" json:"produceAheadDay"` MinPurchaseAmount decimal.Decimal `gorm:"type:decimal(35,18);comment:鏈�灏忛噰璐噺" json:"minPurchaseAmount"` PurchaseType PurchaseType `gorm:"type:int(11);comment:閲囪喘绫诲瀷" json:"purchaseType"` - IsSale *bool `gorm:"type:tinyint(1);comment:鏄惁閿�鍞�" json:"isSale"` SalePrice decimal.Decimal `gorm:"type:decimal(35,18);comment:閿�鍞崟浠�" json:"salePrice"` - AutoIncr uint `gorm:"type:int(11);comment:鑷ID;default:0;" json:"autoIncr"` - AttachmentList []*Attachment `json:"attachmentList" gorm:"many2many:material_attachment"` + CategoryName string `gorm:"type:varchar(255);comment:浜у搧绫诲埆鍚嶇О" json:"categoryName"` //浜у搧绫诲埆鍚嶇О } // PurchaseType 閲囪喘绫诲瀷 @@ -59,9 +53,10 @@ MaterialModeRaw MaterialMode = "鍘熸潗鏂�" MaterialModeSemi MaterialMode = "鍗婃垚鍝�" MaterialModeFinished MaterialMode = "鎴愬搧" - MaterialModeAuxiliary MaterialMode = "杈呮枡" //杈呮枡 - MaterialModeConsumables MaterialMode = "鑰楁潗" //鑰楁潗 - MaterialModeOther MaterialMode = "鍏朵粬" //鍏朵粬 + MaterialModeAuxiliary MaterialMode = "杈呮枡" //杈呮枡 + MaterialModeConsumables MaterialMode = "鑰楁潗" //鑰楁潗 + MaterialModeOther MaterialMode = "鍏朵粬" //鍏朵粬 + MaterialModeVirtual MaterialMode = "铏氭嫙浠�" //铏氭嫙浠�, 涓嶈兘閿�鍞紝涓嶈兘鍑哄叆搴擄紝涓嶈兘閲囪喘 ) func (t MaterialMode) Valid() bool { @@ -70,7 +65,8 @@ t != MaterialModeAuxiliary && t != MaterialModeConsumables && t != MaterialModeOther && - t != MaterialModeFinished { + t != MaterialModeFinished && + t != MaterialModeVirtual { return false } return true @@ -84,6 +80,14 @@ return MaterialTypeSemi case MaterialModeFinished: return MaterialTypeFinished + case MaterialModeAuxiliary: + return MaterialTypeAuxiliary + case MaterialModeConsumables: + return MaterialTypeConsumables + case MaterialModeOther: + return MaterialTypeOther + case MaterialModeVirtual: + return MaterialTypeVirtual } return MaterialType(0) } @@ -98,11 +102,12 @@ MaterialTypeAuxiliary //杈呮枡 MaterialTypeConsumables //鑰楁潗 MaterialTypeOther //鍏朵粬 + MaterialTypeVirtual //铏氭嫙浠� ) func (t MaterialType) Valid() bool { if t < MaterialTypeRaw || - t > MaterialTypeFinished { + t > MaterialTypeVirtual { return false } return true -- Gitblit v1.8.0