| | |
| | | StoredProduct // 可储存的产品 |
| | | ) |
| | | |
| | | // MaterialMode 物料类型(字符串) |
| | | type MaterialMode string |
| | | |
| | | const ( |
| | | MaterialModeRaw MaterialMode = "原材料" |
| | | MaterialModeSemi MaterialMode = "半成品" |
| | | MaterialModeFinished MaterialMode = "成品" |
| | | MaterialModeRaw MaterialMode = "原材料" |
| | | MaterialModeSemi MaterialMode = "半成品" |
| | | MaterialModeFinished MaterialMode = "成品" |
| | | MaterialModeAuxiliary MaterialMode = "辅料" //辅料 |
| | | MaterialModeConsumables MaterialMode = "耗材" //耗材 |
| | | MaterialModeOther MaterialMode = "其他" //其他 |
| | | MaterialModeVirtual MaterialMode = "虚拟件" //虚拟件, 不能销售,不能出入库,不能采购 |
| | | ) |
| | | |
| | | func (t MaterialMode) Valid() bool { |
| | | if t != MaterialModeRaw && |
| | | t != MaterialModeSemi && |
| | | t != MaterialModeAuxiliary && |
| | | t != MaterialModeConsumables && |
| | | t != MaterialModeOther && |
| | | t != MaterialModeFinished && |
| | | t != MaterialModeVirtual { |
| | | return false |
| | | } |
| | | return true |
| | | } |
| | | |
| | | func (t MaterialMode) Type() MaterialType { |
| | | switch t { |
| | | case MaterialModeRaw: |
| | | return MaterialTypeRaw |
| | | case MaterialModeSemi: |
| | | 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) |
| | | } |
| | | |
| | | // MaterialType 物料类型(数字) |
| | | type MaterialType int |
| | | |
| | | const ( |
| | | MaterialTypeRaw = iota + 1 // 原材料 |
| | | MaterialTypeSemi // 半成品 |
| | | MaterialTypeFinished // 成品 |
| | | MaterialTypeAuxiliary //辅料 |
| | | MaterialTypeConsumables //耗材 |
| | | MaterialTypeOther //其他 |
| | | MaterialTypeVirtual //虚拟件 |
| | | ) |
| | | |
| | | func (t MaterialType) Valid() bool { |
| | | if t < MaterialTypeRaw || |
| | | t > MaterialTypeVirtual { |
| | | return false |
| | | } |
| | | return true |
| | | } |
| | | |
| | | type MaterialStatus int |
| | | |
| | |
| | | OperationStatus_Waiting //正在等待 |
| | | OperationStatus_Ready //就绪 |
| | | OperationStatus_Finish //完成 |
| | | OperationStatus_Cancel //取消 |
| | | ) |
| | | |
| | | type PostType int |
| | |
| | | "png": FileType_Picture, |
| | | "svg": FileType_Picture, |
| | | } |
| | | |
| | | type FileTemplateCategory int |
| | | |
| | | const ( |
| | | FileTemplateCategory_Selfmade FileTemplateCategory = iota + 1 //入库-自制 |
| | | FileTemplateCategory_Output //出库 |
| | | FileTemplateCategory_JialianInput1 = 14 //嘉联入库模板1 |
| | | FileTemplateCategory_JialianOutput1 = 15 //嘉联出库模块1 |
| | | FileWarehouseCategory_JialianInput2 = 16 //嘉联入库模板2 |
| | | FileWarehouseCategory_JialianOutput2 = 17 //嘉联出库模块2 |
| | | ) |
| | | |
| | | type CodeStandardType string |
| | | |
| | | const ( |
| | | CodeStandardType_Material CodeStandardType = "物料编码" |
| | | CodeStandardType_Incoming CodeStandardType = "入库编码" |
| | | CodeStandardType_Outgoing CodeStandardType = "出库编码" |
| | | CodeStandardType_Internal CodeStandardType = "调拨编码" |
| | | CodeStandardType_Disuse CodeStandardType = "仓库报废编码" |
| | | CodeStandardType_TakeStock CodeStandardType = "盘点编码" |
| | | ) |
| | | |
| | | type OperationSource int |
| | | |
| | | const ( |
| | | OperationSourcePurchase OperationSource = 1 //采购入库 |
| | | OperationSourceProduction OperationSource = 2 //生产入库 |
| | | OperationSourceOutsourcing OperationSource = 3 //委外入库 |
| | | OperationSourceProductionApply OperationSource = 4 //生产领料 |
| | | OperationSourceOutsourcingApply OperationSource = 5 //委外领料 |
| | | OperationSourceSaleDelivery OperationSource = 6 //销售发货 |
| | | ) |
| | | |
| | | const DoMonthStatsToken = "Eoh2ZAUJjtbmu0TBkc3dq7MPCpL4riw5NVxOfgXYlKvHF6sR" |
| | | |
| | | type SystemConfigType int |
| | | |
| | | const ( |
| | | SystemConfigTypeInventoryCutOffPoint SystemConfigType = 1 //库存结算时间点 |
| | | ) |
| | | |
| | | type MiniDictType int |
| | | |
| | | const ( |
| | | StorageType MiniDictType = iota + 1 // 入库类型 |
| | | StockoutType // 出库类型 |
| | | TransferType // 调拨类型 |
| | | TakeStock // 盘点类型 |
| | | ) |
| | | |
| | | func (t MiniDictType) Valid() bool { |
| | | if t <= 0 { |
| | | return false |
| | | } |
| | | return true |
| | | } |
| | | |
| | | // BoolType 布尔类型 |
| | | type BoolType int |
| | | |
| | | const ( |
| | | BoolTypeTrue BoolType = 1 // true |
| | | BoolTypeFalse BoolType = 2 // false |
| | | ) |
| | | |
| | | func (slf BoolType) IsValid() bool { |
| | | return slf == BoolTypeTrue || slf == BoolTypeFalse |
| | | } |
| | | |
| | | func (slf BoolType) Bool() bool { |
| | | return slf == BoolTypeTrue |
| | | } |