Compare commits
6 Commits
feat/更新采集模
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
729497a30d | ||
|
|
9fd6aee93f | ||
|
|
a383b1b01e | ||
|
|
3b801a270e | ||
|
|
4455b90854 | ||
|
|
2fb376ffa0 |
21
docs/托盘登录表单UX验证.md
Normal file
21
docs/托盘登录表单UX验证.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# 托盘登录表单 UX 验证记录
|
||||||
|
|
||||||
|
验证日期:2026-06-24
|
||||||
|
页面:`src/views/planning-production/production-monitoring/tray-registration/index.vue`
|
||||||
|
|
||||||
|
## Findings
|
||||||
|
|
||||||
|
- **已修复** `批次选择弹窗`:批次表格双击事件现在通过 `page-table` 的 `table-listeners` 明确透传到内部 `el-table`,双击行会直接写入批次号并关闭弹窗。同时新增单击选中后点“确定”的兜底路径,避免只依赖双击。
|
||||||
|
- **Medium** `托盘编码 / 电池编码校验`:格式错误、缺少托盘号、缺少电池编码主要通过全局 `$message` 提示,字段附近没有持久化错误状态。用户需要记住错误来源,移动端或扫码连续输入时更容易丢失上下文。建议后续改为 `el-form` rules 或字段级错误文案。
|
||||||
|
- **Medium** `登录按钮`:按钮只在提交中禁用,未选择批次、未选择格式、未录入电池时仍可点击,再由全局提示拦截。建议后续在按钮附近或必填字段处暴露阻塞原因,减少试错。
|
||||||
|
- **Low** `批次选择弹窗`:批次列表没有搜索框或分页;如果批次数量较大,只能滚动查找。建议后续加入批次号过滤或服务端分页。
|
||||||
|
- **Low** `格式编辑弹窗`:新增格式表单没有字段级必填状态和提交 loading,重复点击可能造成重复请求。建议后续补充表单规则和提交态。
|
||||||
|
|
||||||
|
## Evidence
|
||||||
|
|
||||||
|
- Browser:未启动浏览器,采用 source-only 验证。
|
||||||
|
- Notes:已检查 `page-table` 事件透传、批次弹窗选择状态、提交校验入口和格式编辑入口。当前仓库未配置 Playwright;本次通过构建、ESLint 和 JSON 解析作为可执行验证。
|
||||||
|
|
||||||
|
## Suggested Shape
|
||||||
|
|
||||||
|
批次选择保留“单击选中 + 确定”和“双击直接确定”两条路径;主表单后续应把必填与格式校验迁移到字段局部反馈,登录按钮附近只保留简短阻塞原因。
|
||||||
22
docs/用户管理模块表单UX验证.md
Normal file
22
docs/用户管理模块表单UX验证.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# 用户管理模块表单 UX 验证
|
||||||
|
|
||||||
|
## Findings
|
||||||
|
|
||||||
|
- **High** `src/views/system-administration/user-management/user/index.vue`: 已修复新增/编辑弹窗表单模型未在 `data()` 中声明的问题。该问题会导致 Vue 2 根级动态属性不具备可靠响应式,输入框和下拉框在弹窗中表现为无法正常录入或选择。
|
||||||
|
- **Medium** `src/views/system-administration/user-management/user/index.vue`: 已补充状态查询项,查询参数会随 `username`、`nickname` 一起传给列表接口,用于按启用/停用筛选用户。
|
||||||
|
- **Medium** `src/views/system-administration/user-management/user/index.vue`: 已将账号重复校验、确认密码一致性校验接入 Element 表单规则,错误会出现在对应字段附近,而不是只依赖提交后的全局提示。
|
||||||
|
- **Medium** `src/views/system-administration/user-management/user/index.vue`: 当前用户数据模型没有手机号、邮箱字段,接口封装也没有对应字段或独立校验接口。因此手机号/邮箱格式校验无法在不扩展前后端契约的情况下落地。建议后续先确认字段设计,再补充表单项、列表列、接口字段和格式规则。
|
||||||
|
- **Low** `src/components/page-dialog-form/index.vue`: 已补充 `show-password` 透传,并修复自定义 validator 没有 `message` 时被无条件翻译的问题,避免后续自定义表单校验不稳定。
|
||||||
|
|
||||||
|
## Evidence
|
||||||
|
|
||||||
|
- Browser: source-only。当前页面依赖登录态和后端接口,未做真实浏览器端新增用户提交。
|
||||||
|
- Source checks: 用户弹窗字段状态、表单规则、状态查询、权限按钮声明已核对。
|
||||||
|
- Build checks: 已通过 `eslint`、locale JSON 解析和生产构建验证语法与编译兼容性。
|
||||||
|
- Confidence limits: 账号重复检查复用现有列表接口,并按用户名精确匹配;如果后端列表接口只做模糊查询或分页限制异常,最终仍需后端唯一约束兜底。
|
||||||
|
|
||||||
|
## Suggested Shape
|
||||||
|
|
||||||
|
- 保持“账号/密码/确认密码/用户组/姓名/出入证编号/状态”的当前录入顺序,必填项优先,状态默认启用。
|
||||||
|
- 若业务确认需要手机号/邮箱,应放在姓名之后、出入证编号之前,并使用字段级格式提示。
|
||||||
|
- 删除、批量删除、重置密码、启停用等操作保持二次确认;接口失败时不应显示成功提示。
|
||||||
190
docs/迁移任务列表.md
190
docs/迁移任务列表.md
@@ -3,101 +3,103 @@
|
|||||||
> 根据 `后台Webman界面截图对照表.md` 生成。状态以当前 V2 项目中已落地的页面目录为准。
|
> 根据 `后台Webman界面截图对照表.md` 生成。状态以当前 V2 项目中已落地的页面目录为准。
|
||||||
|
|
||||||
- 总功能数:91
|
- 总功能数:91
|
||||||
- 已迁移:79
|
- 已迁移:91
|
||||||
- 未迁移:12
|
- 未迁移:0
|
||||||
|
- 人工测试:0
|
||||||
|
- 最终完成:0
|
||||||
|
|
||||||
| 状态 | 一级模块 | 二级模块 | 三级模块 | 功能说明 | V2 目标路径 |
|
| 一级模块 | 二级模块 | 三级模块 | 功能说明 | V2 目标路径 | 迁移状态 | 人工测试 | 最终完成 |
|
||||||
|:---:|---|---|---|---|---|
|
|:---:|---:|---:|---:|---:|---:|---:|---:|
|
||||||
| ✅ | 系统设置 (System Administration) | 用户管理 (User Management) | 角色 (Role) | 设置用户组并分配权限(增删改查用户组,并实现权限分配功能) | `src/views/system-administration/user-management/role/` |
|
| 系统设置 (System Administration) | 用户管理 (User Management) | 角色 (Role) | 设置用户组并分配权限(增删改查用户组,并实现权限分配功能) | `src/views/system-administration/user-management/role/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 系统设置 (System Administration) | 用户管理 (User Management) | 用户 (User) | 管理用户账号并绑定对应角色 | `src/views/system-administration/user-management/user/` |
|
| 系统设置 (System Administration) | 用户管理 (User Management) | 用户 (User) | 管理用户账号并绑定对应角色 | `src/views/system-administration/user-management/user/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 系统设置 (System Administration) | 菜单管理 (Menu Management) | 菜单配置 (Menu Configuration) | 系统菜单配置 | `src/views/system-administration/menu-management/menu-configuration/` |
|
| 系统设置 (System Administration) | 菜单管理 (Menu Management) | 菜单配置 (Menu Configuration) | 系统菜单配置 | `src/views/system-administration/menu-management/menu-configuration/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 系统设置 (System Administration) | 系统助手 (System Utilities) | 操作日志 (Operation Logs) | 系统操作日志 | `src/views/system-administration/system-utilities/operation-logs/` |
|
| 系统设置 (System Administration) | 系统助手 (System Utilities) | 操作日志 (Operation Logs) | 系统操作日志 | `src/views/system-administration/system-utilities/operation-logs/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 系统设置 (System Administration) | 系统助手 (System Utilities) | 接口日志 (API Logs) | 与设备对接流程交互日志(支持按 IP 和接口名称查询) | `src/views/system-administration/system-utilities/api-logs/` |
|
| 系统设置 (System Administration) | 系统助手 (System Utilities) | 接口日志 (API Logs) | 与设备对接流程交互日志(支持按 IP 和接口名称查询) | `src/views/system-administration/system-utilities/api-logs/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 系统设置 (System Administration) | 系统监控 (System Monitoring) | 监控设置 (Monitoring Configuration) | 系统监控配置 | `src/views/system-administration/system-monitoring/monitoring-configuration/` |
|
| 系统设置 (System Administration) | 系统监控 (System Monitoring) | 监控设置 (Monitoring Configuration) | 系统监控配置 | `src/views/system-administration/system-monitoring/monitoring-configuration/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 工厂模型 (Factory Model) | 产线设置 (Production Line) | 管理产线(支持增删改查) | `src/views/production-master-data/factory-model/production-line/` |
|
| 生产配置 (Production Master Data) | 工厂模型 (Factory Model) | 产线设置 (Production Line) | 管理产线(支持增删改查) | `src/views/production-master-data/factory-model/production-line/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 工厂模型 (Factory Model) | 工厂区域 (Factory Area) | 管理工厂区域(支持增删改查) | `src/views/production-master-data/factory-model/factory-area/` |
|
| 生产配置 (Production Master Data) | 工厂模型 (Factory Model) | 工厂区域 (Factory Area) | 管理工厂区域(支持增删改查) | `src/views/production-master-data/factory-model/factory-area/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 工艺模型 (Process Model) | 工艺流程类别 (Process Category) | 工艺流程类别的增删改查 | `src/views/production-master-data/process-model/process-category/` |
|
| 生产配置 (Production Master Data) | 工艺模型 (Process Model) | 工艺流程类别 (Process Category) | 工艺流程类别的增删改查 | `src/views/production-master-data/process-model/process-category/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 工艺模型 (Process Model) | 工序单元 (Process Step) | 配置工序单元(节点),支持参数预设 | `src/views/production-master-data/process-model/process-step/` |
|
| 生产配置 (Production Master Data) | 工艺模型 (Process Model) | 工序单元 (Process Step) | 配置工序单元(节点),支持参数预设 | `src/views/production-master-data/process-model/process-step/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 工艺模型 (Process Model) | 工艺流程 (Process Routing) | 设置生产工艺流程并管理流程卡 | `src/views/production-master-data/process-model/process-routing/` |
|
| 生产配置 (Production Master Data) | 工艺模型 (Process Model) | 工艺流程 (Process Routing) | 设置生产工艺流程并管理流程卡 | `src/views/production-master-data/process-model/process-routing/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 产品管理 (Product Management) | 产品列表 (Product List) | 产品管理(增删改查) | `src/views/production-master-data/product-management/product-list/` |
|
| 生产配置 (Production Master Data) | 产品管理 (Product Management) | 产品列表 (Product List) | 产品管理(增删改查) | `src/views/production-master-data/product-management/product-list/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 产品管理 (Product Management) | 不良管理 (Defect Management) | 不良代码及描述管理,支持批量导入 | `src/views/production-master-data/product-model/product-ng-info/` |
|
| 生产配置 (Production Master Data) | 产品管理 (Product Management) | 不良管理 (Defect Management) | 不良代码及描述管理,支持批量导入 | `src/views/production-master-data/product-model/product-ng-info/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 物料模型 (Material Model) | 物料类别列表 (Material Category) | 区分原材料和半成品 | `src/views/production-master-data/material-model/material-category/` |
|
| 生产配置 (Production Master Data) | 物料模型 (Material Model) | 物料类别列表 (Material Category) | 区分原材料和半成品 | `src/views/production-master-data/material-model/material-category/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 物料模型 (Material Model) | 物料信息管理 (Material Master) | 维护物料编码、名称、规格等属性 | `src/views/production-master-data/material-model/material-master/` |
|
| 生产配置 (Production Master Data) | 物料模型 (Material Model) | 物料信息管理 (Material Master) | 维护物料编码、名称、规格等属性 | `src/views/production-master-data/material-model/material-master/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 物料模型 (Material Model) | BOM物料清单 (Bill of Materials) | 产品BOM管理 | `src/views/production-master-data/material-model/bill-of-materials/` |
|
| 生产配置 (Production Master Data) | 物料模型 (Material Model) | BOM物料清单 (Bill of Materials) | 产品BOM管理 | `src/views/production-master-data/material-model/bill-of-materials/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 物料模型 (Material Model) | 计量单位 (Unit of Measure) | 计量单位配置与管理 | `src/views/production-master-data/material-model/material-unit/` |
|
| 生产配置 (Production Master Data) | 物料模型 (Material Model) | 计量单位 (Unit of Measure) | 计量单位配置与管理 | `src/views/production-master-data/material-model/material-unit/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | SPC采集模型 (SPC Configuration) | SPC采集配置 (Data Collection Configuration) | 配置SPC采集参数 | `src/views/production-master-data/spc-configuration/data-collection-configuration/` |
|
| 生产配置 (Production Master Data) | SPC采集模型 (SPC Configuration) | SPC采集配置 (Data Collection Configuration) | 配置SPC采集参数 | `src/views/production-master-data/spc-configuration/data-collection-configuration/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 班组模型 (Team Model) | 班组管理 (Team Management) | 管理生产班组 | `src/views/production-master-data/team-model/team-management/` |
|
| 生产配置 (Production Master Data) | 班组模型 (Team Model) | 班组管理 (Team Management) | 管理生产班组 | `src/views/production-master-data/team-model/team-management/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 班组模型 (Team Model) | 班次管理 (Shift Management) | 管理生产班次 | `src/views/production-master-data/team-model/shift-management/` |
|
| 生产配置 (Production Master Data) | 班组模型 (Team Model) | 班次管理 (Shift Management) | 管理生产班次 | `src/views/production-master-data/team-model/shift-management/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 生产配置 (Production Master Data) | 班组模型 (Team Model) | 排班日历 (Scheduling Calendar) | 查看排班日历 | `src/views/production-master-data/team-model/scheduling-calendar/` |
|
| 生产配置 (Production Master Data) | 班组模型 (Team Model) | 排班日历 (Scheduling Calendar) | 查看排班日历 | `src/views/production-master-data/team-model/scheduling-calendar/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备类别 (Equipment Category) | 设备类别 (Equipment Category) | 管理设备类别 | `src/views/equipment-management/equipment-model/equipment-category/` |
|
| 设备模型 (Equipment Management) | 设备类别 (Equipment Category) | 设备类别 (Equipment Category) | 管理设备类别 | `src/views/equipment-management/equipment-model/equipment-category/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备信息 (Equipment Management) | 设备信息 (Equipment Registry) | 管理设备信息 | `src/views/equipment-management/equipment-model/equipment-registry/` |
|
| 设备模型 (Equipment Management) | 设备信息 (Equipment Management) | 设备信息 (Equipment Registry) | 管理设备信息 | `src/views/equipment-management/equipment-model/equipment-registry/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备点检 (Inspection Management) | 设备点检项目 (Inspection Items) | 点检项目管理 | `src/views/equipment-management/inspection-management/inspection-items/` |
|
| 设备模型 (Equipment Management) | 设备点检 (Inspection Management) | 设备点检项目 (Inspection Items) | 点检项目管理 | `src/views/equipment-management/inspection-management/inspection-items/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备点检 (Inspection Management) | 设备点检记录 (Inspection Records) | 点检记录管理 | `src/views/equipment-management/inspection-management/inspection-records/` |
|
| 设备模型 (Equipment Management) | 设备点检 (Inspection Management) | 设备点检记录 (Inspection Records) | 点检记录管理 | `src/views/equipment-management/inspection-management/inspection-records/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备点检 (Inspection Management) | 设备点检日志 (Inspection Logs) | 点检日志查询 | `src/views/equipment-management/inspection-management/inspection-logs/` |
|
| 设备模型 (Equipment Management) | 设备点检 (Inspection Management) | 设备点检日志 (Inspection Logs) | 点检日志查询 | `src/views/equipment-management/inspection-management/inspection-logs/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备保养 (Maintenance Management) | 设备保养项目 (Maintenance Items) | 保养项目管理 | `src/views/equipment-management/maintenance-management/maintenance-items/` |
|
| 设备模型 (Equipment Management) | 设备保养 (Maintenance Management) | 设备保养项目 (Maintenance Items) | 保养项目管理 | `src/views/equipment-management/maintenance-management/maintenance-items/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备保养 (Maintenance Management) | 设备保养详情 (Maintenance Details) | 保养详情管理 | `src/views/equipment-management/maintenance-management/maintenance-details/` |
|
| 设备模型 (Equipment Management) | 设备保养 (Maintenance Management) | 设备保养详情 (Maintenance Details) | 保养详情管理 | `src/views/equipment-management/maintenance-management/maintenance-details/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备保养 (Maintenance Management) | 设备保养日志 (Maintenance Logs) | 保养日志查询 | `src/views/equipment-management/maintenance-management/maintenance-logs/` |
|
| 设备模型 (Equipment Management) | 设备保养 (Maintenance Management) | 设备保养日志 (Maintenance Logs) | 保养日志查询 | `src/views/equipment-management/maintenance-management/maintenance-logs/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备维修 (Repair Management) | 设备维修管理 (Repair Management) | 维修管理 | `src/views/equipment-management/repair-management/repair-management/` |
|
| 设备模型 (Equipment Management) | 设备维修 (Repair Management) | 设备维修管理 (Repair Management) | 维修管理 | `src/views/equipment-management/repair-management/repair-management/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备维修 (Repair Management) | 设备维修日志 (Repair Logs) | 维修日志查询 | `src/views/equipment-management/repair-management/repair-logs/` |
|
| 设备模型 (Equipment Management) | 设备维修 (Repair Management) | 设备维修日志 (Repair Logs) | 维修日志查询 | `src/views/equipment-management/repair-management/repair-logs/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备损耗品 (Consumables Management) | 设备损耗品类别 (Consumables Category) | 损耗品分类管理 | `src/views/equipment-management/consumables-management/consumables-category/` |
|
| 设备模型 (Equipment Management) | 设备损耗品 (Consumables Management) | 设备损耗品类别 (Consumables Category) | 损耗品分类管理 | `src/views/equipment-management/consumables-management/consumables-category/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备损耗品 (Consumables Management) | 设备损耗品项目 (Consumables Items) | 损耗品项目管理 | `src/views/equipment-management/consumables-management/consumables-items/` |
|
| 设备模型 (Equipment Management) | 设备损耗品 (Consumables Management) | 设备损耗品项目 (Consumables Items) | 损耗品项目管理 | `src/views/equipment-management/consumables-management/consumables-items/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备损耗品 (Consumables Management) | 设备损耗品寿命管理 (Consumables Lifecycle Management) | 寿命管理 | `src/views/equipment-management/consumables-management/consumables-lifecycle/` |
|
| 设备模型 (Equipment Management) | 设备损耗品 (Consumables Management) | 设备损耗品寿命管理 (Consumables Lifecycle Management) | 寿命管理 | `src/views/equipment-management/consumables-management/consumables-lifecycle/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 设备模型 (Equipment Management) | 设备损耗品 (Consumables Management) | 设备损耗品更换日志 (Replacement Logs) | 更换记录查询 | `src/views/equipment-management/consumables-management/replacement-logs/` |
|
| 设备模型 (Equipment Management) | 设备损耗品 (Consumables Management) | 设备损耗品更换日志 (Replacement Logs) | 更换记录查询 | `src/views/equipment-management/consumables-management/replacement-logs/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 计划与生产 (Planning & Production) | 生产批次管理 (Batch Management) | 批次列表 (Batch List) | 批次管理 | `src/views/planning-production/batch-management/batch-list/` |
|
| 计划与生产 (Planning & Production) | 生产批次管理 (Batch Management) | 批次列表 (Batch List) | 批次管理 | `src/views/planning-production/batch-management/batch-list/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 计划与生产 (Planning & Production) | 生产批次管理 (Batch Management) | 批次托盘 (Tray Tracking) | 托盘跟踪与操作 | `src/views/planning-production/batch-management/tray-tracking/` |
|
| 计划与生产 (Planning & Production) | 生产批次管理 (Batch Management) | 批次托盘 (Tray Tracking) | 托盘跟踪与操作 | `src/views/planning-production/batch-management/tray-tracking/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 计划与生产 (Planning & Production) | 生产批次管理 (Batch Management) | 生产批次不良报表 (Batch Defect Report) | 不良报表 | `src/views/planning-production/batch-management/batch-defect-report/` |
|
| 计划与生产 (Planning & Production) | 生产批次管理 (Batch Management) | 生产批次不良报表 (Batch Defect Report) | 不良报表 | `src/views/planning-production/batch-management/batch-defect-report/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 计划与生产 (Planning & Production) | 预警中心 (Alert Center) | 预警中心 (Alert Center) | 预警中心 | `src/views/planning-production/alert-center/` |
|
| 计划与生产 (Planning & Production) | 预警中心 (Alert Center) | 预警中心 (Alert Center) | 预警中心 | `src/views/planning-production/alert-center/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 物料监控 (Material Monitoring) | 物料监控 | `src/views/planning-production/production-monitoring/material-monitoring/` |
|
| 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 物料监控 (Material Monitoring) | 物料监控 | `src/views/planning-production/production-monitoring/material-monitoring/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 电池复投管理 (Rework Management) | 返工管理 | `src/views/planning-production/production-monitoring/rework-management/` |
|
| 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 电池复投管理 (Rework Management) | 返工管理 | `src/views/planning-production/production-monitoring/rework-management/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 托盘管理 (Tray Management) | 托盘管理 | `src/views/planning-production/production-monitoring/tray-management/` |
|
| 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 托盘管理 (Tray Management) | 托盘管理 | `src/views/planning-production/production-monitoring/tray-management/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 托盘登录 (Tray Registration) | 托盘登记 | `src/views/planning-production/production-monitoring/tray-registration/` |
|
| 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 托盘登录 (Tray Registration) | 托盘登记 | `src/views/planning-production/production-monitoring/tray-registration/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 设备监控 (Equipment Monitoring) | 设备监控 | `src/views/planning-production/production-monitoring/equipment-monitoring/` |
|
| 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 设备监控 (Equipment Monitoring) | 设备监控 | `src/views/planning-production/production-monitoring/equipment-monitoring/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 电池工序管理 (Process Execution) | 工序管理 | `src/views/planning-production/production-monitoring/process-execution/` |
|
| 计划与生产 (Planning & Production) | 生产监控 (Production Monitoring) | 电池工序管理 (Process Execution) | 工序管理 | `src/views/planning-production/production-monitoring/process-execution/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | 过程控制 (Process Control) | 检验类别管理 (Inspection Type Management) | | `src/views/quality-management/process-control/inspection-type-management/` |
|
| 质量管理 (Quality Management) | 过程控制 (Process Control) | 检验类别管理 (Inspection Type Management) | | `src/views/quality-management/process-control/inspection-type-management/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | 过程控制 (Process Control) | 首巡检项目配置 (First Article Inspection Configuration) | | `src/views/quality-management/process-control/first-article-inspection-configuration/` |
|
| 质量管理 (Quality Management) | 过程控制 (Process Control) | 首巡检项目配置 (First Article Inspection Configuration) | | `src/views/quality-management/process-control/first-article-inspection-configuration/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | 过程控制 (Process Control) | 首巡检录入 (First Article Inspection Records) | | `src/views/quality-management/process-control/first-article-inspection-records/` |
|
| 质量管理 (Quality Management) | 过程控制 (Process Control) | 首巡检录入 (First Article Inspection Records) | | `src/views/quality-management/process-control/first-article-inspection-records/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | 过程控制 (Process Control) | 首巡检报表 (First Article Inspection Reports) | | `src/views/quality-management/process-control/first-article-inspection-reports/` |
|
| 质量管理 (Quality Management) | 过程控制 (Process Control) | 首巡检报表 (First Article Inspection Reports) | | `src/views/quality-management/process-control/first-article-inspection-reports/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检验单管理 (Inspection Orders) | | `src/views/quality-management/inspection-management/inspection-orders/` |
|
| 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检验单管理 (Inspection Orders) | | `src/views/quality-management/inspection-management/inspection-orders/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检验标准 (Inspection Standards) | | `src/views/quality-management/inspection-management/inspection-standards/` |
|
| 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检验标准 (Inspection Standards) | | `src/views/quality-management/inspection-management/inspection-standards/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 接收质量限 (AQL Standards) | | `src/views/quality-management/inspection-management/aql-standards/` |
|
| 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 接收质量限 (AQL Standards) | | `src/views/quality-management/inspection-management/aql-standards/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检测方案维护 (Inspection Plans) | | `src/views/quality-management/inspection-management/inspection-plans/` |
|
| 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检测方案维护 (Inspection Plans) | | `src/views/quality-management/inspection-management/inspection-plans/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检验项目 (Inspection Items) | | `src/views/quality-management/inspection-management/inspection-items/` |
|
| 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 检验项目 (Inspection Items) | | `src/views/quality-management/inspection-management/inspection-items/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 抽样方案配置 (Sampling Plans) | | `src/views/quality-management/inspection-management/sampling-plans/` |
|
| 质量管理 (Quality Management) | 检验控制 (Inspection Management) | 抽样方案配置 (Sampling Plans) | | `src/views/quality-management/inspection-management/sampling-plans/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC统计过程控制 (SPC Control) | SPC渲染条件配置 (SPC Configuration) | | `src/views/quality-management/spc-control/spc-configuration/` |
|
| 质量管理 (Quality Management) | SPC统计过程控制 (SPC Control) | SPC渲染条件配置 (SPC Configuration) | | `src/views/quality-management/spc-control/spc-configuration/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | XBar-R (XBar-R Chart) | | `src/views/quality-management/spc-variable-charts/xbar-r/` |
|
| 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | XBar-R (XBar-R Chart) | | `src/views/quality-management/spc-variable-charts/xbar-r/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | XBar-S (XBar-S Chart) | | `src/views/quality-management/spc-variable-charts/xbar-s/` |
|
| 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | XBar-S (XBar-S Chart) | | `src/views/quality-management/spc-variable-charts/xbar-s/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | I-MR (I-MR Chart) | | `src/views/quality-management/spc-variable-charts/i-mr/` |
|
| 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | I-MR (I-MR Chart) | | `src/views/quality-management/spc-variable-charts/i-mr/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | Levey-Jennings (Levey-Jennings Chart) | | `src/views/quality-management/spc-variable-charts/levey-jennings/` |
|
| 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | Levey-Jennings (Levey-Jennings Chart) | | `src/views/quality-management/spc-variable-charts/levey-jennings/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | EWMA (EWMA Chart) | | `src/views/quality-management/spc-variable-charts/ewma/` |
|
| 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | EWMA (EWMA Chart) | | `src/views/quality-management/spc-variable-charts/ewma/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | CUSUM (CUSUM Chart) | | `src/views/quality-management/spc-variable-charts/cusum/` |
|
| 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | CUSUM (CUSUM Chart) | | `src/views/quality-management/spc-variable-charts/cusum/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | MA (Moving Average Chart) | | `src/views/quality-management/spc-variable-charts/ma/` |
|
| 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | MA (Moving Average Chart) | | `src/views/quality-management/spc-variable-charts/ma/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | MAMR (Moving Average MR Chart) | | `src/views/quality-management/spc-variable-charts/mamr/` |
|
| 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | MAMR (Moving Average MR Chart) | | `src/views/quality-management/spc-variable-charts/mamr/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | MAMS (Moving Average S Chart) | | `src/views/quality-management/spc-variable-charts/mams/` |
|
| 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | MAMS (Moving Average S Chart) | | `src/views/quality-management/spc-variable-charts/mams/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | CPK (Process Capability Index) | | `src/views/quality-management/spc-variable-charts/cpk/` |
|
| 质量管理 (Quality Management) | SPC计量型报表 (SPC Variable Charts) | CPK (Process Capability Index) | | `src/views/quality-management/spc-variable-charts/cpk/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | DPMO (DPMO) | | `src/views/quality-management/spc-attribute-charts/dpmo/` |
|
| 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | DPMO (DPMO) | | `src/views/quality-management/spc-attribute-charts/dpmo/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | PChart (P Chart) | | `src/views/quality-management/spc-attribute-charts/pchart/` |
|
| 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | PChart (P Chart) | | `src/views/quality-management/spc-attribute-charts/pchart/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | NPChart (NP Chart) | | `src/views/quality-management/spc-attribute-charts/npchart/` |
|
| 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | NPChart (NP Chart) | | `src/views/quality-management/spc-attribute-charts/npchart/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | CChart (C Chart) | | `src/views/quality-management/spc-attribute-charts/cchart/` |
|
| 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | CChart (C Chart) | | `src/views/quality-management/spc-attribute-charts/cchart/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | UChart (U Chart) | | `src/views/quality-management/spc-attribute-charts/uchart/` |
|
| 质量管理 (Quality Management) | SPC计数型报表 (SPC Attribute Charts) | UChart (U Chart) | | `src/views/quality-management/spc-attribute-charts/uchart/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 数据中台 (Data Platform) | 基础追溯 (Traceability) | 反向追溯 (Backward Traceability) | 反向追溯 | `src/views/data-platform/traceability/backward/` |
|
| 数据中台 (Data Platform) | 基础追溯 (Traceability) | 反向追溯 (Backward Traceability) | 反向追溯 | `src/views/data-platform/traceability/backward/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 数据中台 (Data Platform) | 基础追溯 (Traceability) | 正向追溯 (Forward Traceability) | 正向追溯 | `src/views/data-platform/traceability/forward/` |
|
| 数据中台 (Data Platform) | 基础追溯 (Traceability) | 正向追溯 (Forward Traceability) | 正向追溯 | `src/views/data-platform/traceability/forward/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 数据中台 (Data Platform) | 基础追溯 (Traceability) | 电池曲线 (Battery Curve) | 电池曲线 | `src/views/data-platform/traceability/battery-curve/` |
|
| 数据中台 (Data Platform) | 基础追溯 (Traceability) | 电池曲线 (Battery Curve) | 电池曲线 | `src/views/data-platform/traceability/battery-curve/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 数据中台 (Data Platform) | 基础追溯 (Traceability) | 托盘追溯 (Tray Traceability) | 托盘追溯 | `src/views/data-platform/traceability/tray/` |
|
| 数据中台 (Data Platform) | 基础追溯 (Traceability) | 托盘追溯 (Tray Traceability) | 托盘追溯 | `src/views/data-platform/traceability/tray/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 数据中台 (Data Platform) | 基础追溯 (Traceability) | 电池追溯 (Battery Traceability) | 电池追溯 | `src/views/data-platform/traceability/battery/` |
|
| 数据中台 (Data Platform) | 基础追溯 (Traceability) | 电池追溯 (Battery Traceability) | 电池追溯 | `src/views/data-platform/traceability/battery/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 数据中台 (Data Platform) | 生产报表 (Production Reports) | 设备履历报表 (Equipment History Report) | 设备履历报表 | `src/views/data-platform/production-reports/equipment-history/` |
|
| 数据中台 (Data Platform) | 生产报表 (Production Reports) | 设备履历报表 (Equipment History Report) | 设备履历报表 | `src/views/data-platform/production-reports/equipment-history/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 数据中台 (Data Platform) | 生产报表 (Production Reports) | 电池详情报表 (Battery Detail Report) | 电池详情报表 | `src/views/data-platform/production-reports/battery-detail/` |
|
| 数据中台 (Data Platform) | 生产报表 (Production Reports) | 电池详情报表 (Battery Detail Report) | 电池详情报表 | `src/views/data-platform/production-reports/battery-detail/` | ✅ | 0 | 0 |
|
||||||
| ✅ | 数据中台 (Data Platform) | 相关性分析 (Correlation Analysis) | 鹰眼 (Hawkeye) | 鹰眼 | `src/views/data-platform/correlation-analysis/hawkeye/` |
|
| 数据中台 (Data Platform) | 相关性分析 (Correlation Analysis) | 鹰眼 (Hawkeye) | 鹰眼 | `src/views/data-platform/correlation-analysis/hawkeye/` | ✅ | 0 | 0 |
|
||||||
| ⬜ | SCADA管理 (SCADA Management) | SCADA管理 (SCADA Management) | SCADA节点配置 (SCADA Node Configuration) | SCADA节点配置功能 | `src/views/scada_manage/basic_configuration/scada_configure` |
|
| SCADA管理 (SCADA Management) | SCADA管理 (SCADA Management) | SCADA节点配置 (SCADA Node Configuration) | SCADA节点配置功能 | `src/views/scada_manage/basic_configuration/scada_configure` | ✅ | 0 | 0 |
|
||||||
| ⬜ | SCADA管理 (SCADA Management) | SCADA管理 (SCADA Management) | SCADA数据查询 (SCADA Data Query) | SCADA数据查询功能 | `src/views/scada_manage/basic_configuration/scada_query` |
|
| SCADA管理 (SCADA Management) | SCADA管理 (SCADA Management) | SCADA数据查询 (SCADA Data Query) | SCADA数据查询功能 | `src/views/scada_manage/basic_configuration/scada_query` | ✅ | 0 | 0 |
|
||||||
| ⬜ | SCADA管理 (SCADA Management) | SCADA管理 (SCADA Management) | 节点设备映射 (Node Device Mapping) | 节点设备映射功能 | `src/views/scada_manage/basic_configuration/node_mapping_device_code` |
|
| SCADA管理 (SCADA Management) | SCADA管理 (SCADA Management) | 节点设备映射 (Node Device Mapping) | 节点设备映射功能 | `src/views/scada_manage/basic_configuration/node_mapping_device_code` | ✅ | 0 | 0 |
|
||||||
| ⬜ | SCADA管理 (SCADA Management) | 环控管理 (Environmental Control Management) | 环控节点配置 (Environmental Control Node Configuration) | 环控节点配置功能 | `src/views/scada_manage/basic_configuration/ems_configure` |
|
| SCADA管理 (SCADA Management) | 环控管理 (Environmental Control Management) | 环控节点配置 (Environmental Control Node Configuration) | 环控节点配置功能 | `src/views/scada_manage/basic_configuration/ems_configure` | ✅ | 0 | 0 |
|
||||||
| ⬜ | SCADA管理 (SCADA Management) | 环控管理 (Environmental Control Management) | 环控数据查询 (Environmental Control Data Query) | 环控数据查询功能 | `src/views/scada_manage/basic_configuration/ems_query` |
|
| SCADA管理 (SCADA Management) | 环控管理 (Environmental Control Management) | 环控数据查询 (Environmental Control Data Query) | 环控数据查询功能 | `src/views/scada_manage/basic_configuration/ems_query` | ✅ | 0 | 0 |
|
||||||
| ⬜ | SCADA管理 (SCADA Management) | 环控管理 (Environmental Control Management) | 车间配置 (Workshop Configuration) | 车间配置功能 | `src/views/scada_manage/workshop_manage/workshop_config` |
|
| SCADA管理 (SCADA Management) | 环控管理 (Environmental Control Management) | 车间配置 (Workshop Configuration) | 车间配置功能 | `src/views/scada_manage/workshop_manage/workshop_config` | ✅ | 0 | 0 |
|
||||||
| ⬜ | SCADA管理 (SCADA Management) | 环控管理 (Environmental Control Management) | 车间点位管理 (Workshop Point Management) | 车间点位管理功能 | `src/views/scada_manage/workshop_manage/workshop_point` |
|
| SCADA管理 (SCADA Management) | 环控管理 (Environmental Control Management) | 车间点位管理 (Workshop Point Management) | 车间点位管理功能 | `src/views/scada_manage/workshop_manage/workshop_point` | ✅ | 0 | 0 |
|
||||||
| ⬜ | SCADA管理 (SCADA Management) | 前置采集管理 (Pre-acquisition Management) | 服务配置 (Service Configuration) | 服务配置功能 | `src/views/scada_manage/lecpserver/edgeserverconfigure` |
|
| SCADA管理 (SCADA Management) | 前置采集管理 (Pre-acquisition Management) | 服务配置 (Service Configuration) | 服务配置功能 | `src/views/scada_manage/lecpserver/edgeserverconfigure` | ✅ | 0 | 0 |
|
||||||
| ⬜ | SCADA管理 (SCADA Management) | 前置采集管理 (Pre-acquisition Management) | 服务监控 (Service Monitoring) | 服务监控功能 | `src/views/scada_manage/lecpserver/edgeservermonitor` |
|
| SCADA管理 (SCADA Management) | 前置采集管理 (Pre-acquisition Management) | 服务监控 (Service Monitoring) | 服务监控功能 | `src/views/scada_manage/lecpserver/edgeservermonitor` | ✅ | 0 | 0 |
|
||||||
| ⬜ | SCADA管理 (SCADA Management) | 前置采集管理 (Pre-acquisition Management) | 前置服务日志 (Pre-service Logs) | 前置服务日志功能 | `src/views/scada_manage/lecpserver/edgeserver_log` |
|
| SCADA管理 (SCADA Management) | 前置采集管理 (Pre-acquisition Management) | 前置服务日志 (Pre-service Logs) | 前置服务日志功能 | `src/views/scada_manage/lecpserver/edgeserver_log` | ✅ | 0 | 0 |
|
||||||
| ⬜ | SCADA管理 (SCADA Management) | 前置采集管理 (Pre-acquisition Management) | 实时采集监控 (Real-time Gathering Monitoring) | 实时采集监控功能 | `src/views/scada_manage/device_gather/battery_device_gather_monitor` |
|
| SCADA管理 (SCADA Management) | 前置采集管理 (Pre-acquisition Management) | 实时采集监控 (Real-time Gathering Monitoring) | 实时采集监控功能 | `src/views/scada_manage/device_gather/battery_device_gather_monitor` | ✅ | 0 | 0 |
|
||||||
|
|
||||||
## 状态说明
|
## 状态说明
|
||||||
|
|
||||||
|
|||||||
@@ -49,3 +49,11 @@ export function deleteFactoryArea (data) {
|
|||||||
data: apiParams('delete', data)
|
data: apiParams('delete', data)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function exportFactoryAreaTask (data) {
|
||||||
|
return request({
|
||||||
|
url: BASE + 'export',
|
||||||
|
method: 'post',
|
||||||
|
data: apiParams('export', data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -41,3 +41,11 @@ export function deleteProductionLine (data) {
|
|||||||
data: apiParams('delete', data)
|
data: apiParams('delete', data)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function exportProductionLineTask (data) {
|
||||||
|
return request({
|
||||||
|
url: BASE + 'export',
|
||||||
|
method: 'post',
|
||||||
|
data: apiParams('export', data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@
|
|||||||
v-model="formData[col.prop]"
|
v-model="formData[col.prop]"
|
||||||
:placeholder="$t(col.placeholder)"
|
:placeholder="$t(col.placeholder)"
|
||||||
:type="col.inputType || 'text'"
|
:type="col.inputType || 'text'"
|
||||||
|
:show-password="!!col.showPassword"
|
||||||
:autosize="col.autosize"
|
:autosize="col.autosize"
|
||||||
:clearable="col.clearable !== false"
|
:clearable="col.clearable !== false"
|
||||||
:disabled="!!col.disabled"
|
:disabled="!!col.disabled"
|
||||||
@@ -255,7 +256,13 @@ export default {
|
|||||||
const rules = this.rules || {}
|
const rules = this.rules || {}
|
||||||
const translated = {}
|
const translated = {}
|
||||||
for (const [field, validators] of Object.entries(rules)) {
|
for (const [field, validators] of Object.entries(rules)) {
|
||||||
translated[field] = validators.map(v => ({ ...v, message: this.$t(v.message) }))
|
translated[field] = validators.map(v => {
|
||||||
|
const rule = { ...v }
|
||||||
|
if (rule.message) {
|
||||||
|
rule.message = this.$t(rule.message)
|
||||||
|
}
|
||||||
|
return rule
|
||||||
|
})
|
||||||
}
|
}
|
||||||
return translated
|
return translated
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
:row-key="rowKey"
|
:row-key="rowKey"
|
||||||
:header-cell-style="headerCellStyle"
|
:header-cell-style="headerCellStyle"
|
||||||
v-bind="tableAttrs"
|
v-bind="tableAttrs"
|
||||||
v-on="tableListeners"
|
v-on="elTableListeners"
|
||||||
@selection-change="onSelectionChange"
|
@selection-change="onSelectionChange"
|
||||||
>
|
>
|
||||||
<!--
|
<!--
|
||||||
@@ -366,6 +366,20 @@ export default {
|
|||||||
*/
|
*/
|
||||||
headerCellStyle () {
|
headerCellStyle () {
|
||||||
return () => 'background-color: #F8F8F8; color: #000000; font-weight: 500;'
|
return () => 'background-color: #F8F8F8; color: #000000; font-weight: 500;'
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将父组件直接绑定在 page-table 上的 el-table 原生事件透传下去。
|
||||||
|
* selection-change 由当前组件统一维护选中行状态,避免父级监听被触发两次。
|
||||||
|
*/
|
||||||
|
elTableListeners () {
|
||||||
|
const listeners = {
|
||||||
|
...this.$listeners,
|
||||||
|
...this.tableListeners
|
||||||
|
}
|
||||||
|
delete listeners['selection-change']
|
||||||
|
delete listeners['page-change']
|
||||||
|
return listeners
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|||||||
@@ -44,7 +44,14 @@
|
|||||||
"tip": "Tip",
|
"tip": "Tip",
|
||||||
"confirm_delete": "Are you sure to delete?",
|
"confirm_delete": "Are you sure to delete?",
|
||||||
"validation_fail": "Validation failed",
|
"validation_fail": "Validation failed",
|
||||||
"please_enter": "Please enter {name}"
|
"please_enter": "Please enter {name}",
|
||||||
|
"parent_area": "Parent Area",
|
||||||
|
"select_parent_area": "Please select parent area",
|
||||||
|
"export": "Export",
|
||||||
|
"confirm_export": "Create export task?",
|
||||||
|
"length_1_100": "Length should be 1 to 100 characters",
|
||||||
|
"remark_max_500": "Remark cannot exceed 500 characters",
|
||||||
|
"parent_cycle_error": "Parent area cannot be itself or a child area"
|
||||||
},
|
},
|
||||||
"production_line": {
|
"production_line": {
|
||||||
"search": "Search",
|
"search": "Search",
|
||||||
@@ -71,7 +78,11 @@
|
|||||||
"confirm": "Confirm",
|
"confirm": "Confirm",
|
||||||
"tip": "Tip",
|
"tip": "Tip",
|
||||||
"confirm_delete": "Are you sure to delete?",
|
"confirm_delete": "Are you sure to delete?",
|
||||||
"validation_fail": "Validation failed"
|
"validation_fail": "Validation failed",
|
||||||
|
"export": "Export",
|
||||||
|
"confirm_export": "Create export task?",
|
||||||
|
"length_1_100": "Length should be 1 to 100 characters",
|
||||||
|
"remark_max_500": "Remark cannot exceed 500 characters"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"process_model": {
|
"process_model": {
|
||||||
@@ -2323,6 +2334,7 @@
|
|||||||
"status": "Status",
|
"status": "Status",
|
||||||
"enable": "Enabled",
|
"enable": "Enabled",
|
||||||
"disable": "Disabled",
|
"disable": "Disabled",
|
||||||
|
"select_status": "Please select status",
|
||||||
"user_group": "User Group",
|
"user_group": "User Group",
|
||||||
"login_ip": "Last Login IP",
|
"login_ip": "Last Login IP",
|
||||||
"last_login_time": "Last Login Time",
|
"last_login_time": "Last Login Time",
|
||||||
@@ -2349,6 +2361,7 @@
|
|||||||
"password_not_match": "Passwords do not match",
|
"password_not_match": "Passwords do not match",
|
||||||
"password_length": "Length should be 6 to 64 characters",
|
"password_length": "Length should be 6 to 64 characters",
|
||||||
"username_length": "Length should be 3 to 20 characters",
|
"username_length": "Length should be 3 to 20 characters",
|
||||||
|
"username_exists": "Username already exists. Please use another username",
|
||||||
"cannot_delete_self": "Cannot delete own account",
|
"cannot_delete_self": "Cannot delete own account",
|
||||||
"cannot_operate_self": "Cannot operate own account",
|
"cannot_operate_self": "Cannot operate own account",
|
||||||
"batch_delete": "Batch Delete",
|
"batch_delete": "Batch Delete",
|
||||||
|
|||||||
@@ -44,7 +44,14 @@
|
|||||||
"tip": "提示",
|
"tip": "提示",
|
||||||
"confirm_delete": "确定要执行该操作吗?",
|
"confirm_delete": "确定要执行该操作吗?",
|
||||||
"validation_fail": "校验失败",
|
"validation_fail": "校验失败",
|
||||||
"please_enter": "请输入{name}"
|
"please_enter": "请输入{name}",
|
||||||
|
"parent_area": "上级区域",
|
||||||
|
"select_parent_area": "请选择上级区域",
|
||||||
|
"export": "导出",
|
||||||
|
"confirm_export": "确认创建导出任务?",
|
||||||
|
"length_1_100": "长度在 1 到 100 个字符",
|
||||||
|
"remark_max_500": "备注不能超过 500 个字符",
|
||||||
|
"parent_cycle_error": "上级区域不能选择自身或下级区域"
|
||||||
},
|
},
|
||||||
"production_line": {
|
"production_line": {
|
||||||
"search": "查询",
|
"search": "查询",
|
||||||
@@ -71,7 +78,11 @@
|
|||||||
"confirm": "确定",
|
"confirm": "确定",
|
||||||
"tip": "提示",
|
"tip": "提示",
|
||||||
"confirm_delete": "确定要执行该操作吗?",
|
"confirm_delete": "确定要执行该操作吗?",
|
||||||
"validation_fail": "校验失败"
|
"validation_fail": "校验失败",
|
||||||
|
"export": "导出",
|
||||||
|
"confirm_export": "确认创建导出任务?",
|
||||||
|
"length_1_100": "长度在 1 到 100 个字符",
|
||||||
|
"remark_max_500": "备注不能超过 500 个字符"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"process_model": {
|
"process_model": {
|
||||||
@@ -2323,6 +2334,7 @@
|
|||||||
"status": "状态",
|
"status": "状态",
|
||||||
"enable": "启用",
|
"enable": "启用",
|
||||||
"disable": "禁用",
|
"disable": "禁用",
|
||||||
|
"select_status": "请选择状态",
|
||||||
"user_group": "用户组",
|
"user_group": "用户组",
|
||||||
"login_ip": "上次登录IP",
|
"login_ip": "上次登录IP",
|
||||||
"last_login_time": "上次登录时间",
|
"last_login_time": "上次登录时间",
|
||||||
@@ -2349,6 +2361,7 @@
|
|||||||
"password_not_match": "两次输入的密码不一致",
|
"password_not_match": "两次输入的密码不一致",
|
||||||
"password_length": "长度在 6 到 64 个字符",
|
"password_length": "长度在 6 到 64 个字符",
|
||||||
"username_length": "长度在 3 到 20 个字符",
|
"username_length": "长度在 3 到 20 个字符",
|
||||||
|
"username_exists": "账号已存在,请更换账号",
|
||||||
"cannot_delete_self": "不能删除自己的账号",
|
"cannot_delete_self": "不能删除自己的账号",
|
||||||
"cannot_operate_self": "不能操作自己的账号",
|
"cannot_operate_self": "不能操作自己的账号",
|
||||||
"batch_delete": "批量删除",
|
"batch_delete": "批量删除",
|
||||||
|
|||||||
@@ -136,9 +136,15 @@
|
|||||||
:row-buttons="[]"
|
:row-buttons="[]"
|
||||||
:pagination="null"
|
:pagination="null"
|
||||||
:table-attrs="{ size: 'mini', rowKey: 'batch', highlightCurrentRow: true }"
|
:table-attrs="{ size: 'mini', rowKey: 'batch', highlightCurrentRow: true }"
|
||||||
|
:table-listeners="batchTableListeners"
|
||||||
height="420px"
|
height="420px"
|
||||||
@row-dblclick="selectBatch"
|
|
||||||
/>
|
/>
|
||||||
|
<span slot="footer">
|
||||||
|
<el-button size="mini" @click="batchDialogVisible = false">{{ $t(key('cancel')) }}</el-button>
|
||||||
|
<el-button size="mini" type="primary" :disabled="!currentBatch" @click="confirmBatch">
|
||||||
|
{{ $t(key('confirm')) }}
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog :title="$t(key('format_dialog_title'))" :visible.sync="formatDialogVisible" width="820px">
|
<el-dialog :title="$t(key('format_dialog_title'))" :visible.sync="formatDialogVisible" width="820px">
|
||||||
@@ -154,8 +160,8 @@
|
|||||||
:row-buttons="[]"
|
:row-buttons="[]"
|
||||||
:pagination="null"
|
:pagination="null"
|
||||||
:table-attrs="{ size: 'mini', rowKey: 'id', highlightCurrentRow: true }"
|
:table-attrs="{ size: 'mini', rowKey: 'id', highlightCurrentRow: true }"
|
||||||
|
:table-listeners="formatTableListeners"
|
||||||
height="360px"
|
height="360px"
|
||||||
@row-dblclick="selectFormatRow"
|
|
||||||
>
|
>
|
||||||
<template #col-actions="{ row }">
|
<template #col-actions="{ row }">
|
||||||
<el-button type="text" class="danger-action" @click="deleteFormat(row)">
|
<el-button type="text" class="danger-action" @click="deleteFormat(row)">
|
||||||
@@ -239,6 +245,7 @@ export default {
|
|||||||
batchList: [],
|
batchList: [],
|
||||||
formatList: [],
|
formatList: [],
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
|
currentBatch: null,
|
||||||
batchDialogVisible: false,
|
batchDialogVisible: false,
|
||||||
formatDialogVisible: false,
|
formatDialogVisible: false,
|
||||||
formatFormVisible: false,
|
formatFormVisible: false,
|
||||||
@@ -312,6 +319,18 @@ export default {
|
|||||||
selectionWidth: 0,
|
selectionWidth: 0,
|
||||||
indexWidth: 0
|
indexWidth: 0
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
batchTableListeners () {
|
||||||
|
return {
|
||||||
|
'current-change': this.onBatchCurrentChange,
|
||||||
|
'row-click': this.onBatchCurrentChange,
|
||||||
|
'row-dblclick': this.selectBatch
|
||||||
|
}
|
||||||
|
},
|
||||||
|
formatTableListeners () {
|
||||||
|
return {
|
||||||
|
'row-dblclick': this.selectFormatRow
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
@@ -335,11 +354,21 @@ export default {
|
|||||||
return new RegExp(`^${escaped}$`)
|
return new RegExp(`^${escaped}$`)
|
||||||
},
|
},
|
||||||
openBatchDialog () {
|
openBatchDialog () {
|
||||||
|
this.currentBatch = this.batchList.find(item => item.batch === this.form.batch) || null
|
||||||
this.batchDialogVisible = true
|
this.batchDialogVisible = true
|
||||||
if (!this.batchList.length) this.fetchBatchList()
|
if (!this.batchList.length) this.fetchBatchList()
|
||||||
},
|
},
|
||||||
|
onBatchCurrentChange (row) {
|
||||||
|
this.currentBatch = row || null
|
||||||
|
},
|
||||||
|
confirmBatch () {
|
||||||
|
if (!this.currentBatch) return
|
||||||
|
this.selectBatch(this.currentBatch)
|
||||||
|
},
|
||||||
selectBatch (row) {
|
selectBatch (row) {
|
||||||
|
if (!row || !row.batch) return
|
||||||
this.form.batch = row.batch
|
this.form.batch = row.batch
|
||||||
|
this.currentBatch = row
|
||||||
this.batchDialogVisible = false
|
this.batchDialogVisible = false
|
||||||
},
|
},
|
||||||
async fetchBatchList () {
|
async fetchBatchList () {
|
||||||
|
|||||||
@@ -4,30 +4,14 @@
|
|||||||
<div class="search-bar">
|
<div class="search-bar">
|
||||||
<el-form :inline="true" size="mini">
|
<el-form :inline="true" size="mini">
|
||||||
<el-form-item :label="$t(key('code'))">
|
<el-form-item :label="$t(key('code'))">
|
||||||
<el-input
|
<el-input v-model="search.code" :placeholder="$t(key('enter_code'))" clearable style="width:200px" @keyup.enter.native="onSearch" />
|
||||||
v-model="search.code"
|
|
||||||
:placeholder="$t(key('enter_code'))"
|
|
||||||
clearable
|
|
||||||
style="width:200px"
|
|
||||||
@keyup.enter.native="onSearch"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t(key('name'))">
|
<el-form-item :label="$t(key('name'))">
|
||||||
<el-input
|
<el-input v-model="search.name" :placeholder="$t(key('enter_name'))" clearable style="width:200px" @keyup.enter.native="onSearch" />
|
||||||
v-model="search.name"
|
|
||||||
:placeholder="$t(key('enter_name'))"
|
|
||||||
clearable
|
|
||||||
style="width:200px"
|
|
||||||
@keyup.enter.native="onSearch"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="onSearch">
|
<el-button type="primary" icon="el-icon-search" @click="onSearch">{{ $t(key('search')) }}</el-button>
|
||||||
{{ $t(key('search')) }}
|
<el-button icon="el-icon-refresh" @click="onReset">{{ $t(key('reset')) }}</el-button>
|
||||||
</el-button>
|
|
||||||
<el-button icon="el-icon-refresh" @click="onReset">
|
|
||||||
{{ $t(key('reset')) }}
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -35,25 +19,27 @@
|
|||||||
|
|
||||||
<page-table
|
<page-table
|
||||||
ref="pageTable"
|
ref="pageTable"
|
||||||
|
row-key="id"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:toolbar-buttons="toolbarButtons"
|
:toolbar-buttons="toolbarButtons"
|
||||||
:row-buttons="rowButtons"
|
:row-buttons="rowButtons"
|
||||||
:pagination="pagination"
|
:pagination="null"
|
||||||
|
:table-attrs="tableAttrs"
|
||||||
help-url="/help/factory-area"
|
help-url="/help/factory-area"
|
||||||
:help-text="$t(ckey('help'))"
|
:help-text="$t(ckey('help'))"
|
||||||
auto-height
|
auto-height
|
||||||
@page-change="onPageChange"
|
|
||||||
@selection-change="onSelect"
|
@selection-change="onSelect"
|
||||||
/>
|
>
|
||||||
|
</page-table>
|
||||||
|
|
||||||
<page-dialog-form
|
<page-dialog-form
|
||||||
ref="dialogForm"
|
ref="dialogForm"
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
:title="dialogTitle"
|
:title="dialogTitle"
|
||||||
:width="'35%'"
|
:width="'35%'"
|
||||||
:form-cols="formCols"
|
:form-cols="dialogFormCols"
|
||||||
:form-data="formData"
|
:form-data="formData"
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
:label-width="'100px'"
|
:label-width="'100px'"
|
||||||
@@ -70,12 +56,12 @@
|
|||||||
import { useTableColumns } from '@/composables/useTableColumns'
|
import { useTableColumns } from '@/composables/useTableColumns'
|
||||||
import { useTableButtons } from '@/composables/useTableButtons'
|
import { useTableButtons } from '@/composables/useTableButtons'
|
||||||
import { i18nMixin } from '@/composables/useI18n'
|
import { i18nMixin } from '@/composables/useI18n'
|
||||||
import { confirmMixin } from '@/composables/useConfirmHandle'
|
|
||||||
import {
|
import {
|
||||||
getFactoryAreaList,
|
getFactoryAreaList,
|
||||||
createFactoryArea,
|
createFactoryArea,
|
||||||
editFactoryArea,
|
editFactoryArea,
|
||||||
deleteFactoryArea
|
deleteFactoryArea,
|
||||||
|
exportFactoryAreaTask
|
||||||
} from '@/api/production-master-data/factory-area'
|
} from '@/api/production-master-data/factory-area'
|
||||||
import PageTable from '@/components/page-table'
|
import PageTable from '@/components/page-table'
|
||||||
import PageDialogForm from '@/components/page-dialog-form'
|
import PageDialogForm from '@/components/page-dialog-form'
|
||||||
@@ -83,104 +69,72 @@ import PageDialogForm from '@/components/page-dialog-form'
|
|||||||
export default {
|
export default {
|
||||||
name: 'production-master-data-factory-area',
|
name: 'production-master-data-factory-area',
|
||||||
components: { PageTable, PageDialogForm },
|
components: { PageTable, PageDialogForm },
|
||||||
mixins: [i18nMixin('page.production_master_data.factory_model.factory_area'), confirmMixin],
|
mixins: [i18nMixin('page.production_master_data.factory_model.factory_area')],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
submitting: false,
|
submitting: false,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
rawAreaData: [],
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
dialogTitle: '',
|
dialogTitle: '',
|
||||||
editId: '',
|
editId: '',
|
||||||
handleType: 'create',
|
handleType: 'create',
|
||||||
search: { code: '', name: '' },
|
search: { code: '', name: '' },
|
||||||
pagination: { current: 1, size: 10, total: 0 },
|
tableAttrs: { defaultExpandAll: true, treeProps: { children: 'children', hasChildren: 'hasChildren' } },
|
||||||
formData: { code: '', name: '', remark: '' },
|
formData: { code: '', name: '', parent_id: '', remark: '' },
|
||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: this.key('enter_code'), trigger: 'blur' },
|
{ required: true, message: this.key('enter_code'), trigger: 'blur' },
|
||||||
{ min: 1, max: 100, message: this.key('remark_length'), trigger: 'blur' }
|
{ min: 1, max: 100, message: this.key('length_1_100'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: this.key('enter_name'), trigger: 'blur' },
|
{ required: true, message: this.key('enter_name'), trigger: 'blur' },
|
||||||
{ min: 1, max: 100, message: this.key('remark_length'), trigger: 'blur' }
|
{ min: 1, max: 100, message: this.key('length_1_100'), trigger: 'blur' }
|
||||||
]
|
],
|
||||||
|
remark: [{ max: 500, message: this.key('remark_max_500'), trigger: 'blur' }]
|
||||||
},
|
},
|
||||||
columns: [],
|
columns: [],
|
||||||
toolbarButtons: [],
|
toolbarButtons: [],
|
||||||
rowButtons: [],
|
rowButtons: [],
|
||||||
formCols: [
|
baseFormCols: [
|
||||||
[
|
[{ type: 'input', prop: 'code', label: this.key('code'), placeholder: this.key('enter_code'), clearable: true, style: { width: '90%' } }],
|
||||||
{
|
[{ type: 'input', prop: 'name', label: this.key('name'), placeholder: this.key('enter_name'), clearable: true, style: { width: '90%' } }],
|
||||||
type: 'input',
|
[{ type: 'select', prop: 'parent_id', label: this.key('parent_area'), placeholder: this.key('select_parent_area'), clearable: true, filterable: true, style: { width: '90%' }, options: [] }],
|
||||||
prop: 'code',
|
[{ type: 'input', prop: 'remark', inputType: 'textarea', autosize: { minRows: 2, maxRows: 6 }, label: this.key('remark'), placeholder: this.key('remark_required'), clearable: true, style: { width: '90%' } }]
|
||||||
label: this.key('code'),
|
|
||||||
placeholder: this.key('enter_code'),
|
|
||||||
clearable: true,
|
|
||||||
style: { width: '90%' }
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
prop: 'name',
|
|
||||||
label: this.key('name'),
|
|
||||||
placeholder: this.key('enter_name'),
|
|
||||||
clearable: true,
|
|
||||||
style: { width: '90%' }
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
prop: 'remark',
|
|
||||||
inputType: 'textarea',
|
|
||||||
autosize: { minRows: 2, maxRows: 6 },
|
|
||||||
label: this.key('remark'),
|
|
||||||
placeholder: this.key('remark_required'),
|
|
||||||
clearable: true,
|
|
||||||
style: { width: '90%' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
dialogFormCols () {
|
||||||
|
const cols = JSON.parse(JSON.stringify(this.baseFormCols))
|
||||||
|
cols[2][0].options = this.parentAreaOptions
|
||||||
|
return cols
|
||||||
|
},
|
||||||
|
parentAreaOptions () {
|
||||||
|
const disabledIds = this.handleType === 'edit' ? new Set([String(this.editId), ...this.collectDescendantIds(this.editId)]) : new Set()
|
||||||
|
return this.flattenTree(this.tableData)
|
||||||
|
.filter(item => !disabledIds.has(String(this.getId(item))))
|
||||||
|
.map(item => ({ value: this.getId(item), label: item._treeLabel || item.name }))
|
||||||
|
}
|
||||||
|
},
|
||||||
created () {
|
created () {
|
||||||
this.columns = useTableColumns([
|
this.columns = useTableColumns([
|
||||||
{ prop: 'sort', label: this.key('sort'), width: 80 },
|
{ prop: 'sort', label: this.key('sort'), width: 80 },
|
||||||
{ prop: 'code', label: this.key('code'), minWidth: 120 },
|
{ prop: 'code', label: this.key('code'), minWidth: 140 },
|
||||||
{ prop: 'name', label: this.key('name'), minWidth: 120 },
|
{ prop: 'name', label: this.key('name'), minWidth: 160 },
|
||||||
{ prop: 'remark', label: this.key('remark') },
|
{ prop: 'remark', label: this.key('remark') },
|
||||||
{ prop: '_actions', label: this.key('operation'), width: 160, fixed: 'right' }
|
{ prop: '_actions', label: this.key('operation'), width: 160, fixed: 'right' }
|
||||||
])
|
])
|
||||||
const btns = useTableButtons({
|
const btns = useTableButtons({
|
||||||
toolbar: [
|
toolbar: [
|
||||||
{
|
{ key: 'add', label: this.key('add'), icon: 'el-icon-plus', type: 'primary', auth: '/production_configuration/factory_model/factory_area/create', onClick: this.openAdd },
|
||||||
key: 'add',
|
{ key: 'export', label: this.key('export'), icon: 'el-icon-download', auth: '/production_configuration/factory_model/factory_area/export', onClick: this.handleExport }
|
||||||
label: this.key('add'),
|
|
||||||
icon: 'el-icon-plus',
|
|
||||||
type: 'primary',
|
|
||||||
auth: '/production_configuration/factory_model/factory_area/create',
|
|
||||||
onClick: this.openAdd
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
row: [
|
row: [
|
||||||
{
|
{ key: 'edit', label: this.key('edit'), icon: 'el-icon-edit', auth: '/production_configuration/factory_model/factory_area/edit', onClick: this.openEdit },
|
||||||
key: 'edit',
|
{ key: 'delete', label: this.key('delete'), icon: 'el-icon-delete', color: 'danger', auth: '/production_configuration/factory_model/factory_area/delete', onClick: this.handleDelete }
|
||||||
label: this.key('edit'),
|
|
||||||
icon: 'el-icon-edit',
|
|
||||||
auth: '/production_configuration/factory_model/factory_area/edit',
|
|
||||||
onClick: this.openEdit
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'delete',
|
|
||||||
label: this.key('delete'),
|
|
||||||
icon: 'el-icon-delete',
|
|
||||||
color: 'danger',
|
|
||||||
auth: '/production_configuration/factory_model/factory_area/delete',
|
|
||||||
onClick: this.handleDelete
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}, this.$permission)
|
}, this.$permission)
|
||||||
this.toolbarButtons = btns.toolbarButtons
|
this.toolbarButtons = btns.toolbarButtons
|
||||||
@@ -188,41 +142,89 @@ export default {
|
|||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getId (row) {
|
||||||
|
return row && (row.id !== undefined ? row.id : row.area_id)
|
||||||
|
},
|
||||||
|
getParentId (row) {
|
||||||
|
if (!row) return ''
|
||||||
|
if (row.parent_id !== undefined) return row.parent_id || ''
|
||||||
|
if (row.pid !== undefined) return row.pid || ''
|
||||||
|
if (row.parentId !== undefined) return row.parentId || ''
|
||||||
|
return ''
|
||||||
|
},
|
||||||
|
normalizeResponse (res) {
|
||||||
|
const data = res && res.data !== undefined ? res.data : res
|
||||||
|
if (Array.isArray(data)) return { list: data, total: data.length }
|
||||||
|
if (data && Array.isArray(data.list)) return { list: data.list, total: Number(data.count || data.total || data.list.length) }
|
||||||
|
if (data && Array.isArray(data.data)) return { list: data.data, total: Number(data.count || data.total || data.data.length) }
|
||||||
|
if (data && data.data && Array.isArray(data.data.data)) return { list: data.data.data, total: Number(data.data.count || data.data.total || data.data.data.length) }
|
||||||
|
return { list: [], total: 0 }
|
||||||
|
},
|
||||||
|
normalizeNode (row, level = 0) {
|
||||||
|
const children = Array.isArray(row.children) ? row.children.map(item => this.normalizeNode(item, level + 1)) : []
|
||||||
|
const node = { ...row, id: this.getId(row), parent_id: this.getParentId(row), children }
|
||||||
|
node._treeLabel = `${' '.repeat(level)}${node.name || ''}`
|
||||||
|
if (!node.children.length) delete node.children
|
||||||
|
return node
|
||||||
|
},
|
||||||
|
buildTree (list) {
|
||||||
|
if (list.some(item => Array.isArray(item.children))) return list.map(item => this.normalizeNode(item))
|
||||||
|
const map = new Map()
|
||||||
|
const roots = []
|
||||||
|
list.forEach(item => {
|
||||||
|
const node = this.normalizeNode(item)
|
||||||
|
node.children = []
|
||||||
|
map.set(String(node.id), node)
|
||||||
|
})
|
||||||
|
map.forEach(node => {
|
||||||
|
const parentId = this.getParentId(node)
|
||||||
|
const parent = parentId !== '' ? map.get(String(parentId)) : null
|
||||||
|
if (parent && String(parent.id) !== String(node.id)) parent.children.push(node)
|
||||||
|
else roots.push(node)
|
||||||
|
})
|
||||||
|
const mark = (nodes, level = 0) => nodes.map(node => {
|
||||||
|
node._treeLabel = `${' '.repeat(level)}${node.name || ''}`
|
||||||
|
if (node.children.length) node.children = mark(node.children, level + 1)
|
||||||
|
else delete node.children
|
||||||
|
return node
|
||||||
|
})
|
||||||
|
return mark(roots)
|
||||||
|
},
|
||||||
|
flattenTree (tree, result = []) {
|
||||||
|
tree.forEach(item => {
|
||||||
|
result.push(item)
|
||||||
|
if (Array.isArray(item.children)) this.flattenTree(item.children, result)
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
},
|
||||||
|
collectDescendantIds (id) {
|
||||||
|
const current = this.flattenTree(this.tableData).find(item => String(this.getId(item)) === String(id))
|
||||||
|
if (!current || !Array.isArray(current.children)) return []
|
||||||
|
return this.flattenTree(current.children).map(item => String(this.getId(item)))
|
||||||
|
},
|
||||||
async fetchData () {
|
async fetchData () {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
const res = await getFactoryAreaList({
|
const res = await getFactoryAreaList({ ...this.search, page_no: 1, page_size: 10000 })
|
||||||
...this.search,
|
const data = this.normalizeResponse(res)
|
||||||
page_no: this.pagination.current,
|
this.rawAreaData = data.list
|
||||||
page_size: this.pagination.size
|
this.tableData = this.buildTree(data.list)
|
||||||
})
|
|
||||||
const list = Array.isArray(res) ? res : (res.data || [])
|
|
||||||
const total = Array.isArray(res) ? res.length : (res.count || 0)
|
|
||||||
this.tableData = list
|
|
||||||
this.pagination.total = total
|
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSearch () {
|
onSearch () {
|
||||||
this.pagination.current = 1
|
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
onReset () {
|
onReset () {
|
||||||
this.search = { code: '', name: '' }
|
this.search = { code: '', name: '' }
|
||||||
this.pagination.current = 1
|
|
||||||
this.fetchData()
|
|
||||||
},
|
|
||||||
onPageChange (page) {
|
|
||||||
this.pagination.current = page.current
|
|
||||||
this.pagination.size = page.size
|
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
onSelect (rows) {
|
onSelect (rows) {
|
||||||
this.selectedRows = rows
|
this.selectedRows = rows
|
||||||
},
|
},
|
||||||
resetForm () {
|
resetForm () {
|
||||||
this.formData = { code: '', name: '', remark: '' }
|
this.formData = { code: '', name: '', parent_id: '', remark: '' }
|
||||||
this.editId = ''
|
this.editId = ''
|
||||||
},
|
},
|
||||||
openAdd () {
|
openAdd () {
|
||||||
@@ -237,22 +239,25 @@ export default {
|
|||||||
openEdit (row) {
|
openEdit (row) {
|
||||||
this.handleType = 'edit'
|
this.handleType = 'edit'
|
||||||
this.dialogTitle = this.key('edit_title')
|
this.dialogTitle = this.key('edit_title')
|
||||||
this.editId = row.id
|
this.editId = this.getId(row)
|
||||||
this.formData = {
|
this.formData = { code: row.code, name: row.name, parent_id: this.getParentId(row), remark: row.remark || '' }
|
||||||
code: row.code,
|
|
||||||
name: row.name,
|
|
||||||
remark: row.remark || ''
|
|
||||||
}
|
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
|
validateHierarchy () {
|
||||||
|
if (this.handleType !== 'edit' || this.formData.parent_id === '') return true
|
||||||
|
const parentId = String(this.formData.parent_id)
|
||||||
|
if (parentId === String(this.editId) || this.collectDescendantIds(this.editId).includes(parentId)) {
|
||||||
|
this.$message.warning(this.$t(this.key('parent_cycle_error')))
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
},
|
||||||
async onDialogSubmit () {
|
async onDialogSubmit () {
|
||||||
|
if (!this.validateHierarchy()) return
|
||||||
this.submitting = true
|
this.submitting = true
|
||||||
try {
|
try {
|
||||||
if (this.handleType === 'create') {
|
if (this.handleType === 'create') await createFactoryArea(this.formData)
|
||||||
await createFactoryArea(this.formData)
|
else await editFactoryArea({ ...this.formData, id: this.editId })
|
||||||
} else {
|
|
||||||
await editFactoryArea({ ...this.formData, id: this.editId })
|
|
||||||
}
|
|
||||||
this.$message.success(this.$t(this.key('operation_success')))
|
this.$message.success(this.$t(this.key('operation_success')))
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
@@ -263,31 +268,30 @@ export default {
|
|||||||
onDialogClose () {
|
onDialogClose () {
|
||||||
this.resetForm()
|
this.resetForm()
|
||||||
},
|
},
|
||||||
async handleDelete (row) {
|
async confirmAction (message, action) {
|
||||||
const cancelled = await this.$confirmAction(
|
try {
|
||||||
{
|
await this.$confirm(this.$t(message), this.$t(this.key('tip')), { type: 'warning' })
|
||||||
message: this.key('confirm_delete'),
|
} catch {
|
||||||
title: this.key('tip')
|
return false
|
||||||
|
}
|
||||||
|
await action()
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
() => deleteFactoryArea({ id: [row.id] })
|
async handleDelete (row) {
|
||||||
)
|
const ok = await this.confirmAction(this.key('confirm_delete'), () => deleteFactoryArea({ id: [this.getId(row)] }))
|
||||||
if (cancelled) return
|
if (!ok) return
|
||||||
this.$message.success(this.$t(this.key('operation_success')))
|
this.$message.success(this.$t(this.key('operation_success')))
|
||||||
this.pagination.current = Math.min(
|
|
||||||
this.pagination.current,
|
|
||||||
Math.ceil((this.pagination.total - 1) / this.pagination.size) || 1
|
|
||||||
)
|
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
|
},
|
||||||
|
async handleExport () {
|
||||||
|
const ok = await this.confirmAction(this.key('confirm_export'), () => exportFactoryAreaTask({ ...this.search }))
|
||||||
|
if (ok) this.$message.success(this.$t(this.key('operation_success')))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.search-bar {
|
.search-bar { padding: 10px 0; }
|
||||||
padding: 10px 0;
|
/deep/ .el-form-item--mini.el-form-item { margin-bottom: 4px; }
|
||||||
}
|
|
||||||
/deep/ .el-form-item--mini.el-form-item {
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
style="width:200px"
|
style="width:200px"
|
||||||
|
@change="onSearch"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in areaOptions"
|
v-for="item in areaOptions"
|
||||||
@@ -62,7 +63,8 @@
|
|||||||
auto-height
|
auto-height
|
||||||
@page-change="onPageChange"
|
@page-change="onPageChange"
|
||||||
@selection-change="onSelect"
|
@selection-change="onSelect"
|
||||||
/>
|
>
|
||||||
|
</page-table>
|
||||||
|
|
||||||
<page-dialog-form
|
<page-dialog-form
|
||||||
ref="dialogForm"
|
ref="dialogForm"
|
||||||
@@ -86,12 +88,12 @@
|
|||||||
import { useTableColumns } from '@/composables/useTableColumns'
|
import { useTableColumns } from '@/composables/useTableColumns'
|
||||||
import { useTableButtons } from '@/composables/useTableButtons'
|
import { useTableButtons } from '@/composables/useTableButtons'
|
||||||
import { i18nMixin } from '@/composables/useI18n'
|
import { i18nMixin } from '@/composables/useI18n'
|
||||||
import { confirmMixin } from '@/composables/useConfirmHandle'
|
|
||||||
import {
|
import {
|
||||||
getProductionLineList,
|
getProductionLineList,
|
||||||
createProductionLine,
|
createProductionLine,
|
||||||
editProductionLine,
|
editProductionLine,
|
||||||
deleteProductionLine
|
deleteProductionLine,
|
||||||
|
exportProductionLineTask
|
||||||
} from '@/api/production-master-data/production-line'
|
} from '@/api/production-master-data/production-line'
|
||||||
import { getFactoryAreaALL } from '@/api/production-master-data/factory-area'
|
import { getFactoryAreaALL } from '@/api/production-master-data/factory-area'
|
||||||
import PageTable from '@/components/page-table'
|
import PageTable from '@/components/page-table'
|
||||||
@@ -100,7 +102,7 @@ import PageDialogForm from '@/components/page-dialog-form'
|
|||||||
export default {
|
export default {
|
||||||
name: 'production-master-data-production-line',
|
name: 'production-master-data-production-line',
|
||||||
components: { PageTable, PageDialogForm },
|
components: { PageTable, PageDialogForm },
|
||||||
mixins: [i18nMixin('page.production_master_data.factory_model.production_line'), confirmMixin],
|
mixins: [i18nMixin('page.production_master_data.factory_model.production_line')],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -118,74 +120,34 @@ export default {
|
|||||||
rules: {
|
rules: {
|
||||||
code: [
|
code: [
|
||||||
{ required: true, message: this.key('enter_code'), trigger: 'blur' },
|
{ required: true, message: this.key('enter_code'), trigger: 'blur' },
|
||||||
{ min: 1, max: 100, message: this.key('remark_length'), trigger: 'blur' }
|
{ min: 1, max: 100, message: this.key('length_1_100'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: this.key('enter_name'), trigger: 'blur' },
|
{ required: true, message: this.key('enter_name'), trigger: 'blur' },
|
||||||
{ min: 1, max: 100, message: this.key('remark_length'), trigger: 'blur' }
|
{ min: 1, max: 100, message: this.key('length_1_100'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
area_id: [
|
area_id: [
|
||||||
{ required: true, message: this.key('select_area'), trigger: 'change' }
|
{ required: true, message: this.key('select_area'), trigger: 'change' }
|
||||||
|
],
|
||||||
|
remark: [
|
||||||
|
{ max: 500, message: this.key('remark_max_500'), trigger: 'blur' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
columns: [],
|
columns: [],
|
||||||
toolbarButtons: [],
|
toolbarButtons: [],
|
||||||
rowButtons: [],
|
rowButtons: [],
|
||||||
baseFormCols: [
|
baseFormCols: [
|
||||||
[
|
[{ type: 'input', prop: 'code', label: this.key('code'), placeholder: this.key('enter_code'), clearable: true, style: { width: '90%' } }],
|
||||||
{
|
[{ type: 'input', prop: 'name', label: this.key('name'), placeholder: this.key('enter_name'), clearable: true, style: { width: '90%' } }],
|
||||||
type: 'input',
|
[{ type: 'select', prop: 'area_id', label: this.key('area'), placeholder: this.key('select_area'), clearable: true, filterable: true, style: { width: '90%' }, options: [] }],
|
||||||
prop: 'code',
|
[{ type: 'input', prop: 'remark', inputType: 'textarea', autosize: { minRows: 2, maxRows: 6 }, label: this.key('remark'), placeholder: this.key('enter_remark'), clearable: true, style: { width: '90%' } }]
|
||||||
label: this.key('code'),
|
|
||||||
placeholder: this.key('enter_code'),
|
|
||||||
clearable: true,
|
|
||||||
style: { width: '90%' }
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
prop: 'name',
|
|
||||||
label: this.key('name'),
|
|
||||||
placeholder: this.key('enter_name'),
|
|
||||||
clearable: true,
|
|
||||||
style: { width: '90%' }
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
prop: 'area_id',
|
|
||||||
label: this.key('area'),
|
|
||||||
placeholder: this.key('select_area'),
|
|
||||||
clearable: true,
|
|
||||||
filterable: true,
|
|
||||||
style: { width: '90%' },
|
|
||||||
options: []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
prop: 'remark',
|
|
||||||
inputType: 'textarea',
|
|
||||||
autosize: { minRows: 2, maxRows: 6 },
|
|
||||||
label: this.key('remark'),
|
|
||||||
placeholder: this.key('enter_remark'),
|
|
||||||
clearable: true,
|
|
||||||
style: { width: '90%' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
dialogFormCols () {
|
dialogFormCols () {
|
||||||
const idx = 2
|
|
||||||
const cols = JSON.parse(JSON.stringify(this.baseFormCols))
|
const cols = JSON.parse(JSON.stringify(this.baseFormCols))
|
||||||
if (cols[idx] && cols[idx][0]) {
|
cols[2][0].options = this.areaOptions
|
||||||
cols[idx][0].options = this.areaOptions
|
|
||||||
}
|
|
||||||
return cols
|
return cols
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -201,31 +163,12 @@ export default {
|
|||||||
])
|
])
|
||||||
const btns = useTableButtons({
|
const btns = useTableButtons({
|
||||||
toolbar: [
|
toolbar: [
|
||||||
{
|
{ key: 'add', label: this.key('add'), icon: 'el-icon-plus', type: 'primary', auth: '/production_configuration/factory_model/factory_line/create', onClick: this.openAdd },
|
||||||
key: 'add',
|
{ key: 'export', label: this.key('export'), icon: 'el-icon-download', auth: '/production_configuration/factory_model/factory_line/export', onClick: this.handleExport }
|
||||||
label: this.key('add'),
|
|
||||||
icon: 'el-icon-plus',
|
|
||||||
type: 'primary',
|
|
||||||
auth: '/production_configuration/factory_model/factory_line/create',
|
|
||||||
onClick: this.openAdd
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
row: [
|
row: [
|
||||||
{
|
{ key: 'edit', label: this.key('edit'), icon: 'el-icon-edit', auth: '/production_configuration/factory_model/factory_line/edit', onClick: this.openEdit },
|
||||||
key: 'edit',
|
{ key: 'delete', label: this.key('delete'), icon: 'el-icon-delete', color: 'danger', auth: '/production_configuration/factory_model/factory_line/delete', onClick: this.handleDelete }
|
||||||
label: this.key('edit'),
|
|
||||||
icon: 'el-icon-edit',
|
|
||||||
auth: '/production_configuration/factory_model/factory_line/edit',
|
|
||||||
onClick: this.openEdit
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'delete',
|
|
||||||
label: this.key('delete'),
|
|
||||||
icon: 'el-icon-delete',
|
|
||||||
color: 'danger',
|
|
||||||
auth: '/production_configuration/factory_model/factory_line/delete',
|
|
||||||
onClick: this.handleDelete
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}, this.$permission)
|
}, this.$permission)
|
||||||
this.toolbarButtons = btns.toolbarButtons
|
this.toolbarButtons = btns.toolbarButtons
|
||||||
@@ -233,25 +176,28 @@ export default {
|
|||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
normalizeResponse (res) {
|
||||||
|
const data = res && res.data !== undefined ? res.data : res
|
||||||
|
if (Array.isArray(data)) return { list: data, total: data.length }
|
||||||
|
if (data && Array.isArray(data.list)) return { list: data.list, total: Number(data.count || data.total || data.list.length) }
|
||||||
|
if (data && Array.isArray(data.data)) return { list: data.data, total: Number(data.count || data.total || data.data.length) }
|
||||||
|
if (data && data.data && Array.isArray(data.data.data)) return { list: data.data.data, total: Number(data.data.count || data.data.total || data.data.data.length) }
|
||||||
|
return { list: [], total: 0 }
|
||||||
|
},
|
||||||
async initAreaOptions () {
|
async initAreaOptions () {
|
||||||
try {
|
try {
|
||||||
const res = await getFactoryAreaALL()
|
const res = await getFactoryAreaALL()
|
||||||
const data = Array.isArray(res) ? res : (res.data || [])
|
const data = this.normalizeResponse(res).list
|
||||||
this.areaOptions = data.map(item => ({ value: item.area_id || item.id, label: item.name }))
|
this.areaOptions = data.map(item => ({ value: item.area_id || item.id, label: item.name }))
|
||||||
} catch { /* 忽略加载失败 */ }
|
} catch { /* 忽略加载失败 */ }
|
||||||
},
|
},
|
||||||
async fetchData () {
|
async fetchData () {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
const res = await getProductionLineList({
|
const res = await getProductionLineList({ ...this.search, page_no: this.pagination.current, page_size: this.pagination.size })
|
||||||
...this.search,
|
const data = this.normalizeResponse(res)
|
||||||
page_no: this.pagination.current,
|
this.tableData = data.list
|
||||||
page_size: this.pagination.size
|
this.pagination.total = data.total
|
||||||
})
|
|
||||||
const list = Array.isArray(res) ? res : (res.data || [])
|
|
||||||
const total = Array.isArray(res) ? res.length : (res.count || 0)
|
|
||||||
this.tableData = list
|
|
||||||
this.pagination.total = total
|
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
@@ -290,22 +236,14 @@ export default {
|
|||||||
this.handleType = 'edit'
|
this.handleType = 'edit'
|
||||||
this.dialogTitle = this.key('edit_title')
|
this.dialogTitle = this.key('edit_title')
|
||||||
this.editId = row.id
|
this.editId = row.id
|
||||||
this.formData = {
|
this.formData = { code: row.code, name: row.name, area_id: row.area_id, remark: row.remark || '' }
|
||||||
code: row.code,
|
|
||||||
name: row.name,
|
|
||||||
area_id: row.area_id,
|
|
||||||
remark: row.remark || ''
|
|
||||||
}
|
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
},
|
},
|
||||||
async onDialogSubmit () {
|
async onDialogSubmit () {
|
||||||
this.submitting = true
|
this.submitting = true
|
||||||
try {
|
try {
|
||||||
if (this.handleType === 'create') {
|
if (this.handleType === 'create') await createProductionLine(this.formData)
|
||||||
await createProductionLine(this.formData)
|
else await editProductionLine({ ...this.formData, id: this.editId })
|
||||||
} else {
|
|
||||||
await editProductionLine({ ...this.formData, id: this.editId })
|
|
||||||
}
|
|
||||||
this.$message.success(this.$t(this.key('operation_success')))
|
this.$message.success(this.$t(this.key('operation_success')))
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
@@ -316,31 +254,31 @@ export default {
|
|||||||
onDialogClose () {
|
onDialogClose () {
|
||||||
this.resetForm()
|
this.resetForm()
|
||||||
},
|
},
|
||||||
async handleDelete (row) {
|
async confirmAction (message, action) {
|
||||||
const cancelled = await this.$confirmAction(
|
try {
|
||||||
{
|
await this.$confirm(this.$t(message), this.$t(this.key('tip')), { type: 'warning' })
|
||||||
message: this.key('confirm_delete'),
|
} catch {
|
||||||
title: this.key('tip')
|
return false
|
||||||
|
}
|
||||||
|
await action()
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
() => deleteProductionLine({ id: [row.id] })
|
async handleDelete (row) {
|
||||||
)
|
const ok = await this.confirmAction(this.key('confirm_delete'), () => deleteProductionLine({ id: [row.id] }))
|
||||||
if (cancelled) return
|
if (!ok) return
|
||||||
this.$message.success(this.$t(this.key('operation_success')))
|
this.$message.success(this.$t(this.key('operation_success')))
|
||||||
this.pagination.current = Math.min(
|
this.pagination.current = Math.min(this.pagination.current, Math.ceil((this.pagination.total - 1) / this.pagination.size) || 1)
|
||||||
this.pagination.current,
|
|
||||||
Math.ceil((this.pagination.total - 1) / this.pagination.size) || 1
|
|
||||||
)
|
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
|
},
|
||||||
|
async handleExport () {
|
||||||
|
const ok = await this.confirmAction(this.key('confirm_export'), () => exportProductionLineTask({ ...this.search }))
|
||||||
|
if (ok) this.$message.success(this.$t(this.key('operation_success')))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.search-bar {
|
.search-bar { padding: 10px 0; }
|
||||||
padding: 10px 0;
|
/deep/ .el-form-item--mini.el-form-item { margin-bottom: 4px; }
|
||||||
}
|
|
||||||
/deep/ .el-form-item--mini.el-form-item {
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -21,6 +21,18 @@
|
|||||||
@keyup.enter.native="onSearch"
|
@keyup.enter.native="onSearch"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t(key('status'))">
|
||||||
|
<el-select
|
||||||
|
v-model="search.status"
|
||||||
|
:placeholder="$t(key('select_status'))"
|
||||||
|
clearable
|
||||||
|
style="width:140px"
|
||||||
|
@change="onSearch"
|
||||||
|
>
|
||||||
|
<el-option value="1" :label="$t(key('enable'))" />
|
||||||
|
<el-option value="0" :label="$t(key('disable'))" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="onSearch">
|
<el-button type="primary" icon="el-icon-search" @click="onSearch">
|
||||||
{{ $t(key('search')) }}
|
{{ $t(key('search')) }}
|
||||||
@@ -46,7 +58,7 @@
|
|||||||
@selection-change="onSelect"
|
@selection-change="onSelect"
|
||||||
>
|
>
|
||||||
<template #col-status="{ row }">
|
<template #col-status="{ row }">
|
||||||
<span v-if="row.status === 1" style="color: #67c23a;">
|
<span v-if="String(row.status) === '1'" style="color: #67c23a;">
|
||||||
<i class="el-icon-circle-check" />
|
<i class="el-icon-circle-check" />
|
||||||
{{ $t(key('enable')) }}
|
{{ $t(key('enable')) }}
|
||||||
</span>
|
</span>
|
||||||
@@ -79,7 +91,6 @@
|
|||||||
import { useTableColumns } from '@/composables/useTableColumns'
|
import { useTableColumns } from '@/composables/useTableColumns'
|
||||||
import { useTableButtons } from '@/composables/useTableButtons'
|
import { useTableButtons } from '@/composables/useTableButtons'
|
||||||
import { i18nMixin } from '@/composables/useI18n'
|
import { i18nMixin } from '@/composables/useI18n'
|
||||||
import { confirmMixin } from '@/composables/useConfirmHandle'
|
|
||||||
import { getRoleAll } from '@/api/system-administration/role'
|
import { getRoleAll } from '@/api/system-administration/role'
|
||||||
import {
|
import {
|
||||||
getUserList,
|
getUserList,
|
||||||
@@ -99,10 +110,43 @@ const ownUserId = () => localStorage.getItem('user_id')
|
|||||||
export default {
|
export default {
|
||||||
name: 'system-administration-user',
|
name: 'system-administration-user',
|
||||||
components: { PageTable, PageDialogForm },
|
components: { PageTable, PageDialogForm },
|
||||||
mixins: [i18nMixin('page.system_administration.user_management.user'), confirmMixin],
|
mixins: [i18nMixin('page.system_administration.user_management.user')],
|
||||||
data () {
|
data () {
|
||||||
const key = this.key.bind(this)
|
const key = this.key.bind(this)
|
||||||
const $t = this.$t.bind(this)
|
const $t = this.$t.bind(this)
|
||||||
|
const normalizeList = res => {
|
||||||
|
const data = res && res.data !== undefined ? res.data : res
|
||||||
|
if (Array.isArray(data)) return data
|
||||||
|
if (data && Array.isArray(data.list)) return data.list
|
||||||
|
if (data && Array.isArray(data.data)) return data.data
|
||||||
|
if (data && data.data && Array.isArray(data.data.data)) return data.data.data
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
const validateUsernameUnique = async (rule, value, callback) => {
|
||||||
|
const username = String(value || '').trim()
|
||||||
|
if (!username || username.length < 3) {
|
||||||
|
callback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const res = await getUserList({ username, page_no: 1, page_size: 10000 })
|
||||||
|
const exists = normalizeList(res).some(item => {
|
||||||
|
const sameName = String(item.username || '') === username
|
||||||
|
const sameUser = this.handleType === 'edit' && String(item.user_id) === String(this.editId)
|
||||||
|
return sameName && !sameUser
|
||||||
|
})
|
||||||
|
callback(exists ? new Error($t(key('username_exists'))) : undefined)
|
||||||
|
} catch {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const validatePasswordConfirm = (rule, value, callback) => {
|
||||||
|
if (this.handleType === 'create' && value && value !== this.formData.password) {
|
||||||
|
callback(new Error($t(key('password_not_match'))))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
callback()
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
submitting: false,
|
submitting: false,
|
||||||
@@ -112,12 +156,21 @@ export default {
|
|||||||
dialogTitle: '',
|
dialogTitle: '',
|
||||||
editId: '',
|
editId: '',
|
||||||
handleType: 'create',
|
handleType: 'create',
|
||||||
search: { username: '', nickname: '' },
|
search: { username: '', nickname: '', status: '' },
|
||||||
pagination: { current: 1, size: 10, total: 0 },
|
pagination: { current: 1, size: 10, total: 0 },
|
||||||
roleOptions: [],
|
roleOptions: [],
|
||||||
columns: [],
|
columns: [],
|
||||||
toolbarButtons: [],
|
toolbarButtons: [],
|
||||||
rowButtons: [],
|
rowButtons: [],
|
||||||
|
formData: {
|
||||||
|
username: '',
|
||||||
|
password: '',
|
||||||
|
password_confirm: '',
|
||||||
|
role_id: '',
|
||||||
|
nickname: '',
|
||||||
|
pass_number: '',
|
||||||
|
status: '1'
|
||||||
|
},
|
||||||
baseFormCols: {
|
baseFormCols: {
|
||||||
create: [
|
create: [
|
||||||
[{ type: 'input', prop: 'username', label: key('username'), placeholder: key('enter_username'), clearable: true, style: { width: '90%' } }],
|
[{ type: 'input', prop: 'username', label: key('username'), placeholder: key('enter_username'), clearable: true, style: { width: '90%' } }],
|
||||||
@@ -139,7 +192,8 @@ export default {
|
|||||||
baseRules: {
|
baseRules: {
|
||||||
username: [
|
username: [
|
||||||
{ required: true, message: key('enter_username'), trigger: 'blur' },
|
{ required: true, message: key('enter_username'), trigger: 'blur' },
|
||||||
{ min: 3, max: 20, message: key('username_length'), trigger: 'blur' }
|
{ min: 3, max: 20, message: key('username_length'), trigger: 'blur' },
|
||||||
|
{ validator: validateUsernameUnique, trigger: 'blur' }
|
||||||
],
|
],
|
||||||
password: [
|
password: [
|
||||||
{ required: true, message: key('enter_password'), trigger: 'blur' },
|
{ required: true, message: key('enter_password'), trigger: 'blur' },
|
||||||
@@ -147,10 +201,14 @@ export default {
|
|||||||
],
|
],
|
||||||
password_confirm: [
|
password_confirm: [
|
||||||
{ required: true, message: key('enter_confirm_password'), trigger: 'blur' },
|
{ required: true, message: key('enter_confirm_password'), trigger: 'blur' },
|
||||||
{ min: 6, max: 64, message: key('password_length'), trigger: 'blur' }
|
{ min: 6, max: 64, message: key('password_length'), trigger: 'blur' },
|
||||||
|
{ validator: validatePasswordConfirm, trigger: ['blur', 'change'] }
|
||||||
],
|
],
|
||||||
role_id: [
|
role_id: [
|
||||||
{ required: true, message: key('select_user_group'), trigger: 'change' }
|
{ required: true, message: key('select_user_group'), trigger: 'change' }
|
||||||
|
],
|
||||||
|
status: [
|
||||||
|
{ required: true, message: key('select_status'), trigger: 'change' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,7 +226,8 @@ export default {
|
|||||||
if (this.handleType === 'edit') {
|
if (this.handleType === 'edit') {
|
||||||
return {
|
return {
|
||||||
username: this.baseRules.username,
|
username: this.baseRules.username,
|
||||||
role_id: this.baseRules.role_id
|
role_id: this.baseRules.role_id,
|
||||||
|
status: this.baseRules.status
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.baseRules
|
return this.baseRules
|
||||||
@@ -255,10 +314,18 @@ export default {
|
|||||||
async initRoleOptions () {
|
async initRoleOptions () {
|
||||||
try {
|
try {
|
||||||
const res = await getRoleAll()
|
const res = await getRoleAll()
|
||||||
const data = Array.isArray(res) ? res : (res.data || [])
|
const data = this.normalizeResponse(res).list
|
||||||
this.roleOptions = data.map(item => ({ value: item.id, label: item.name }))
|
this.roleOptions = data.map(item => ({ value: item.id, label: item.name }))
|
||||||
} catch { /* 忽略 */ }
|
} catch { /* 忽略 */ }
|
||||||
},
|
},
|
||||||
|
normalizeResponse (res) {
|
||||||
|
const data = res && res.data !== undefined ? res.data : res
|
||||||
|
if (Array.isArray(data)) return { list: data, total: data.length }
|
||||||
|
if (data && Array.isArray(data.list)) return { list: data.list, total: Number(data.count || data.total || data.list.length) }
|
||||||
|
if (data && Array.isArray(data.data)) return { list: data.data, total: Number(data.count || data.total || data.data.length) }
|
||||||
|
if (data && data.data && Array.isArray(data.data.data)) return { list: data.data.data, total: Number(data.data.count || data.data.total || data.data.data.length) }
|
||||||
|
return { list: [], total: 0 }
|
||||||
|
},
|
||||||
async fetchData () {
|
async fetchData () {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
try {
|
try {
|
||||||
@@ -267,10 +334,9 @@ export default {
|
|||||||
page_no: this.pagination.current,
|
page_no: this.pagination.current,
|
||||||
page_size: this.pagination.size
|
page_size: this.pagination.size
|
||||||
})
|
})
|
||||||
const list = Array.isArray(res) ? res : (res.data || [])
|
const data = this.normalizeResponse(res)
|
||||||
const total = Array.isArray(res) ? res.length : (res.count || 0)
|
this.tableData = data.list
|
||||||
this.tableData = list
|
this.pagination.total = data.total
|
||||||
this.pagination.total = total
|
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
}
|
}
|
||||||
@@ -280,7 +346,7 @@ export default {
|
|||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
onReset () {
|
onReset () {
|
||||||
this.search = { username: '', nickname: '' }
|
this.search = { username: '', nickname: '', status: '' }
|
||||||
this.pagination.current = 1
|
this.pagination.current = 1
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
@@ -377,16 +443,34 @@ export default {
|
|||||||
} catch { /* 拦截器已处理 */ }
|
} catch { /* 拦截器已处理 */ }
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
|
async confirmAction (message, action) {
|
||||||
|
try {
|
||||||
|
await this.$confirm(
|
||||||
|
this.$t(message),
|
||||||
|
this.$t(this.key('prompt')),
|
||||||
|
{
|
||||||
|
confirmButtonText: this.$t(this.key('confirm')),
|
||||||
|
cancelButtonText: this.$t(this.key('cancel')),
|
||||||
|
type: 'warning',
|
||||||
|
closeOnClickModal: false
|
||||||
|
}
|
||||||
|
)
|
||||||
|
} catch {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
await action()
|
||||||
|
return true
|
||||||
|
},
|
||||||
async handleDelete (row) {
|
async handleDelete (row) {
|
||||||
if (String(row.user_id) === ownUserId()) {
|
if (String(row.user_id) === ownUserId()) {
|
||||||
this.$message.warning(this.$t(this.key('cannot_delete_self')))
|
this.$message.warning(this.$t(this.key('cannot_delete_self')))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const cancelled = await this.$confirmAction(
|
const ok = await this.confirmAction(
|
||||||
{ message: this.key('confirm_delete'), title: this.key('prompt') },
|
this.key('confirm_delete'),
|
||||||
() => deleteUser({ id: [row.user_id] })
|
() => deleteUser({ id: [row.user_id] })
|
||||||
)
|
)
|
||||||
if (cancelled) return
|
if (!ok) return
|
||||||
this.$message.success(this.$t(this.key('operation_success')))
|
this.$message.success(this.$t(this.key('operation_success')))
|
||||||
this.pagination.current = Math.min(
|
this.pagination.current = Math.min(
|
||||||
this.pagination.current,
|
this.pagination.current,
|
||||||
@@ -405,11 +489,11 @@ export default {
|
|||||||
this.$message.warning(this.$t(this.key('select_rows_first')))
|
this.$message.warning(this.$t(this.key('select_rows_first')))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const cancelled = await this.$confirmAction(
|
const ok = await this.confirmAction(
|
||||||
{ message: this.key('confirm_batch_delete'), title: this.key('prompt') },
|
this.key('confirm_batch_delete'),
|
||||||
() => batchDeleteUser({ id: rows.map(row => row.user_id) })
|
() => batchDeleteUser({ id: rows.map(row => row.user_id) })
|
||||||
)
|
)
|
||||||
if (cancelled) return
|
if (!ok) return
|
||||||
this.$message.success(this.$t(this.key('operation_success')))
|
this.$message.success(this.$t(this.key('operation_success')))
|
||||||
this.fetchData()
|
this.fetchData()
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user