导入资产
使用 CSV 文件一次性导入多个资产。导入功能会自动创建不存在的组、单位和位置。
1. 访问导入
导航: 从侧边栏进入 Assets → Import。
2. 导入步骤
步骤 1:下载模板
- 点击 Download Template
- 在 Excel 或文本编辑器中打开 CSV
- 模板包含列标题和示例行
步骤 2:填写数据
每行一个资产。使用下面描述的列。
步骤 3:上传
- 点击 Select CSV File
- 选择完成的 CSV 文件
- 点击 Import 或 Upload
- 查看导入摘要(导入数量、失败数量、错误)
3. 预期列
| Column | Description | Required |
|---|---|---|
asset_code or code | Unique code. Auto-generated if empty | No |
asset_name or name | Asset name | Yes |
quantity or amount | Quantity. Default: 1 | No |
unit | Unit name (e.g., Pieces). Created if not exists | No |
group or category | Asset group. Created if not exists | No |
location | Location. Created if not exists | No |
purchase_date or date_buy | YYYY-MM-DD format | No |
warranty_months or warranty_period | Warranty in months | No |
price or unit_price | Unit price | No |
depreciation_months or depreciation | Depreciation period in months | No |
supplier or supplier_name | Supplier name | No |
description | Asset description | No |
manufacturer | Manufacturer | No |
model or model_number | Model number | No |
serial or series | Serial number | No |
4. CSV 格式提示
- 编码: UTF-8(带 BOM 以兼容 Excel)
- 分隔符: 逗号(
,) - 标题: 第一行必须包含列名
- 日期: 使用
YYYY-MM-DD(例如 2025-01-15) - 空值: 留空;将应用默认值
5. 导入后
- 导入数量 - 成功添加的资产数量
- 失败数量 - 无法导入的行
- 错误 - 错误列表(例如 "Row 5: Missing asset name")
在 CSV 中修复错误,必要时重新导入失败的行。
6. 导入历史
模块会存储导入历史:
- 文件名
- 总行数、已导入、失败
- 谁导入、何时
- 错误详情
检查 Settings 或 Import History(如有)以查看过去的导入。
最佳实践
- 先用小文件测试(5-10 行)
- 准确匹配列名 与预期格式
- 使用一致的组/单位/位置名称 以便正确分类
- 大量导入前备份 - 导入不易撤销