fix(backend): 修复日期字段解析失败导致创建单据报错

新增 model.Date 类型,支持前端传入的纯日期格式 YYYY-MM-DD:
- UnmarshalJSON 优先解析 YYYY-MM-DD,回退支持 RFC3339
- MarshalJSON 输出 YYYY-MM-DD
- Value/Scan 实现 GORM MySQL DATE 列读写
- StockInOrder/StockOutOrder/InventoryCheck 的 OrderDate/CheckDate 改用 Date 类型

feat(client): SelectionArea 全局开启文字可选中复制

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-04-07 22:29:15 +08:00
parent d717fb3735
commit 754275cbd6
4 changed files with 78 additions and 7 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ type StockInOrder struct {
OperatorID uint64 `gorm:"not null" json:"operator_id"`
ReviewerID *uint64 `json:"reviewer_id"`
Status string `gorm:"type:enum('draft','pending','approved','rejected');default:'draft'" json:"status"`
OrderDate time.Time `gorm:"type:date" json:"order_date"`
OrderDate Date `gorm:"type:date" json:"order_date"`
TotalAmount float64 `gorm:"type:decimal(16,2);default:0" json:"total_amount"`
ReviewedAt *time.Time `json:"reviewed_at"`
CustomFields JSON `gorm:"type:json" json:"custom_fields,omitempty"`
@@ -51,7 +51,7 @@ type StockOutOrder struct {
OperatorID uint64 `gorm:"not null" json:"operator_id"`
ReviewerID *uint64 `json:"reviewer_id"`
Status string `gorm:"type:enum('draft','pending','approved','rejected');default:'draft'" json:"status"`
OrderDate time.Time `gorm:"type:date" json:"order_date"`
OrderDate Date `gorm:"type:date" json:"order_date"`
TotalAmount float64 `gorm:"type:decimal(16,2);default:0" json:"total_amount"`
ReviewedAt *time.Time `json:"reviewed_at"`
CustomFields JSON `gorm:"type:json" json:"custom_fields,omitempty"`
@@ -116,7 +116,7 @@ type InventoryCheck struct {
WarehouseID uint64 `gorm:"not null" json:"warehouse_id"`
OperatorID uint64 `gorm:"not null" json:"operator_id"`
Status string `gorm:"type:enum('draft','completed');default:'draft'" json:"status"`
CheckDate time.Time `gorm:"type:date" json:"check_date"`
CheckDate Date `gorm:"type:date" json:"check_date"`
Remark string `gorm:"size:500" json:"remark"`
Items []InventoryCheckItem `gorm:"foreignKey:CheckID" json:"items,omitempty"`