更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
+22
-51
@@ -2,58 +2,44 @@ package models
|
||||
|
||||
import "time"
|
||||
|
||||
// ERP 进销存交易层模型,对应 docs/sql/erp_inventory_schema.sql。
|
||||
//
|
||||
// 核心约定:
|
||||
// - 库存结存 yz_backend_erp_stock 只允许由库存流水(yz_backend_erp_stock_ledger)
|
||||
// 驱动变更,任何业务代码不得直接改 quantity/cost_price;
|
||||
// - 十类业务单据统一存 yz_backend_erp_document(+_item),用 doc_type 区分;
|
||||
// - tenant_id 为字符串(与 ERP/CRM 家族表一致),便于与客户/供应商表 JOIN。
|
||||
|
||||
// 单据类型
|
||||
const (
|
||||
ErpDocPurchaseOrder = "purchase_order" // 采购订单
|
||||
ErpDocPurchaseIn = "purchase_in" // 采购入库
|
||||
ErpDocPurchaseReturn = "purchase_return" // 采购退货
|
||||
ErpDocSalesOrder = "sales_order" // 销售订单
|
||||
ErpDocSalesOut = "sales_out" // 销售出库
|
||||
ErpDocSalesReturn = "sales_return" // 销售退货
|
||||
ErpDocOtherIn = "other_in" // 其他入库
|
||||
ErpDocOtherOut = "other_out" // 其他出库
|
||||
ErpDocTransfer = "transfer" // 库存调拨
|
||||
ErpDocStockTake = "stock_take" // 库存盘点
|
||||
ErpDocPurchaseOrder = "purchase_order"
|
||||
ErpDocPurchaseIn = "purchase_in"
|
||||
ErpDocPurchaseReturn = "purchase_return"
|
||||
ErpDocSalesOrder = "sales_order"
|
||||
ErpDocSalesOut = "sales_out"
|
||||
ErpDocSalesReturn = "sales_return"
|
||||
ErpDocOtherIn = "other_in"
|
||||
ErpDocOtherOut = "other_out"
|
||||
ErpDocTransfer = "transfer"
|
||||
ErpDocStockTake = "stock_take"
|
||||
)
|
||||
|
||||
// 单据状态
|
||||
const (
|
||||
ErpDocStatusDraft int8 = 0 // 草稿
|
||||
ErpDocStatusPending int8 = 1 // 审批中
|
||||
ErpDocStatusApproved int8 = 2 // 已生效
|
||||
ErpDocStatusRejected int8 = 3 // 已驳回
|
||||
ErpDocStatusCancelled int8 = 4 // 已作废
|
||||
ErpDocStatusDraft int8 = 0
|
||||
ErpDocStatusPending int8 = 1
|
||||
ErpDocStatusApproved int8 = 2
|
||||
ErpDocStatusRejected int8 = 3
|
||||
ErpDocStatusCancelled int8 = 4
|
||||
)
|
||||
|
||||
// 往来账类型
|
||||
const (
|
||||
ErpBillReceivable int8 = 1 // 应收
|
||||
ErpBillPayable int8 = 2 // 应付
|
||||
ErpBillReceivable int8 = 1
|
||||
ErpBillPayable int8 = 2
|
||||
)
|
||||
|
||||
// 收付款类型
|
||||
const (
|
||||
ErpFundReceive int8 = 1 // 收款
|
||||
ErpFundPay int8 = 2 // 付款
|
||||
ErpFundOtherIn int8 = 3 // 其他收入
|
||||
ErpFundExpense int8 = 4 // 费用支出
|
||||
ErpFundReceive int8 = 1
|
||||
ErpFundPay int8 = 2
|
||||
ErpFundOtherIn int8 = 3
|
||||
ErpFundExpense int8 = 4
|
||||
)
|
||||
|
||||
// 流水方向
|
||||
const (
|
||||
ErpStockIn int8 = 1
|
||||
ErpStockOut int8 = -1
|
||||
)
|
||||
|
||||
// ErpProductCategory 商品分类: yz_backend_erp_product_category
|
||||
type ErpProductCategory struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
@@ -69,7 +55,6 @@ type ErpProductCategory struct {
|
||||
|
||||
func (m *ErpProductCategory) TableName() string { return "yz_backend_erp_product_category" }
|
||||
|
||||
// ErpProduct 商品档案: yz_backend_erp_product
|
||||
type ErpProduct struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
@@ -103,7 +88,6 @@ type ErpProduct struct {
|
||||
UpdateTime time.Time `orm:"column(update_time);type(datetime);null;auto_now" json:"update_time"`
|
||||
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
||||
|
||||
// 联查展示字段(非表列)
|
||||
CategoryName string `orm:"-" json:"category_name"`
|
||||
TotalStock float64 `orm:"-" json:"total_stock"`
|
||||
SafetyState string `orm:"-" json:"safety_state"`
|
||||
@@ -112,7 +96,6 @@ type ErpProduct struct {
|
||||
|
||||
func (m *ErpProduct) TableName() string { return "yz_backend_erp_product" }
|
||||
|
||||
// ErpWarehouse 仓库: yz_backend_erp_warehouse
|
||||
type ErpWarehouse struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
@@ -131,7 +114,6 @@ type ErpWarehouse struct {
|
||||
|
||||
func (m *ErpWarehouse) TableName() string { return "yz_backend_erp_warehouse" }
|
||||
|
||||
// ErpStock 库存结存: yz_backend_erp_stock。唯一键 (tenant, product, warehouse, batch)。
|
||||
type ErpStock struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
@@ -142,7 +124,6 @@ type ErpStock struct {
|
||||
CostPrice float64 `orm:"column(cost_price);type(decimal);digits(18);decimals(6)" json:"cost_price"`
|
||||
UpdateTime time.Time `orm:"column(update_time);type(datetime);null;auto_now" json:"update_time"`
|
||||
|
||||
// 联查展示字段(非表列)
|
||||
ProductName string `orm:"-" json:"product_name"`
|
||||
ProductCode string `orm:"-" json:"product_code"`
|
||||
Spec string `orm:"-" json:"spec"`
|
||||
@@ -155,7 +136,6 @@ type ErpStock struct {
|
||||
|
||||
func (m *ErpStock) TableName() string { return "yz_backend_erp_stock" }
|
||||
|
||||
// ErpStockLedger 库存流水(只增不改不删): yz_backend_erp_stock_ledger
|
||||
type ErpStockLedger struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
@@ -188,7 +168,6 @@ type ErpStockLedger struct {
|
||||
|
||||
func (m *ErpStockLedger) TableName() string { return "yz_backend_erp_stock_ledger" }
|
||||
|
||||
// ErpDocument 业务单据主表: yz_backend_erp_document
|
||||
type ErpDocument struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
@@ -228,7 +207,6 @@ type ErpDocument struct {
|
||||
|
||||
func (m *ErpDocument) TableName() string { return "yz_backend_erp_document" }
|
||||
|
||||
// ErpDocumentItem 业务单据明细: yz_backend_erp_document_item
|
||||
type ErpDocumentItem struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
DocID uint64 `orm:"column(doc_id)" json:"doc_id"`
|
||||
@@ -252,12 +230,11 @@ type ErpDocumentItem struct {
|
||||
|
||||
ProductCode string `orm:"-" json:"product_code"`
|
||||
BaseUnit string `orm:"-" json:"base_unit"`
|
||||
StockQty float64 `orm:"-" json:"stock_qty"` // 当前可用库存(开单时展示)
|
||||
StockQty float64 `orm:"-" json:"stock_qty"`
|
||||
}
|
||||
|
||||
func (m *ErpDocumentItem) TableName() string { return "yz_backend_erp_document_item" }
|
||||
|
||||
// ErpPartnerBill 往来账(应收/应付): yz_backend_erp_partner_bill
|
||||
type ErpPartnerBill struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
@@ -279,7 +256,6 @@ type ErpPartnerBill struct {
|
||||
|
||||
func (m *ErpPartnerBill) TableName() string { return "yz_backend_erp_partner_bill" }
|
||||
|
||||
// ErpFundBill 收付款单: yz_backend_erp_fund_bill
|
||||
type ErpFundBill struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
@@ -306,7 +282,6 @@ type ErpFundBill struct {
|
||||
|
||||
func (m *ErpFundBill) TableName() string { return "yz_backend_erp_fund_bill" }
|
||||
|
||||
// ErpFundSettle 收付款核销明细: yz_backend_erp_fund_settle
|
||||
type ErpFundSettle struct {
|
||||
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
||||
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
||||
@@ -319,7 +294,6 @@ type ErpFundSettle struct {
|
||||
|
||||
func (m *ErpFundSettle) TableName() string { return "yz_backend_erp_fund_settle" }
|
||||
|
||||
// ErpDocTypeLabel 单据类型中文名(后端返回给两端的统一口径)
|
||||
var ErpDocTypeLabel = map[string]string{
|
||||
ErpDocPurchaseOrder: "采购订单",
|
||||
ErpDocPurchaseIn: "采购入库",
|
||||
@@ -333,7 +307,6 @@ var ErpDocTypeLabel = map[string]string{
|
||||
ErpDocStockTake: "库存盘点",
|
||||
}
|
||||
|
||||
// ErpDocAffectsStock 单据生效是否产生库存流水
|
||||
func ErpDocAffectsStock(docType string) bool {
|
||||
switch docType {
|
||||
case ErpDocPurchaseOrder, ErpDocSalesOrder:
|
||||
@@ -343,7 +316,6 @@ func ErpDocAffectsStock(docType string) bool {
|
||||
}
|
||||
}
|
||||
|
||||
// ErpDocStatusLabel 单据状态中文名
|
||||
func ErpDocStatusLabel(status int8) string {
|
||||
switch status {
|
||||
case ErpDocStatusPending:
|
||||
@@ -359,7 +331,6 @@ func ErpDocStatusLabel(status int8) string {
|
||||
}
|
||||
}
|
||||
|
||||
// ErpDocBizTypePrefix 单据类型对应审批流 biz_type(与 approval.go 常量一致)
|
||||
func ErpDocApprovalBizType(docType string) string {
|
||||
return "erp_" + docType
|
||||
}
|
||||
Reference in new issue
Block a user