requirements.md 4.3 KB

Requirements Document

Introduction

本文档定义了将物料采购模块(dingdan/manage-vue)整合到芋道管理后台项目的需求。该模块包含三个核心功能页面:物料采购订单、委外加工订单、物料采购申请。整合后将作为一级菜单"物料采购"显示在系统中。

Glossary

  • Material_Purchase_System: 物料采购管理系统,用于管理物料采购订单、委外加工订单和采购申请的前端模块
  • Menu_Configuration: 系统菜单配置,存储在 system_menu 数据库表中的菜单层级结构
  • Vue_Component: Vue 3 单文件组件,包含模板、脚本和样式的 .vue 文件
  • Component_Path: 菜单配置中指向 Vue 组件的相对路径,基于 src/views 目录

Requirements

Requirement 1

User Story: As a system administrator, I want to add a new "物料采购" top-level menu, so that users can access material purchase management functions.

Acceptance Criteria

  1. WHEN the system administrator executes the menu SQL script THEN the Material_Purchase_System SHALL create a new top-level menu with name "物料采购" and icon "ep:shopping-bag"
  2. WHEN the menu is created THEN the Material_Purchase_System SHALL assign a unique menu ID in the 6500-6599 range to avoid conflicts with existing menus
  3. WHEN the menu is displayed THEN the Material_Purchase_System SHALL show the menu with sort order 130 (between 异常管理 120 and 建模管理 140)

Requirement 2

User Story: As a system administrator, I want to configure three second-level menus under "物料采购", so that users can navigate to specific purchase management pages.

Acceptance Criteria

  1. WHEN the menu configuration is complete THEN the Material_Purchase_System SHALL display "物料采购订单" as the first second-level menu item
  2. WHEN the menu configuration is complete THEN the Material_Purchase_System SHALL display "委外加工订单" as the second second-level menu item
  3. WHEN the menu configuration is complete THEN the Material_Purchase_System SHALL display "物料采购申请" as the third second-level menu item
  4. WHEN each second-level menu is configured THEN the Material_Purchase_System SHALL specify the correct component path pointing to the Vue component in src/views/caigou/

Requirement 3

User Story: As a developer, I want to copy Vue components from the source module to the target directory, so that the menu configuration can correctly load the pages.

Acceptance Criteria

  1. WHEN copying components THEN the Material_Purchase_System SHALL place MaterialPurchaseOrder.vue in src/views/caigou/ directory
  2. WHEN copying components THEN the Material_Purchase_System SHALL place SubcontractOrder.vue in src/views/caigou/ directory
  3. WHEN copying components THEN the Material_Purchase_System SHALL place MaterialPurchaseRequest.vue in src/views/caigou/ directory
  4. WHEN components are copied THEN the Material_Purchase_System SHALL preserve the original component functionality including search, filter, pagination, and export features

Requirement 4

User Story: As a developer, I want to ensure component compatibility with the main project, so that the pages render correctly without errors.

Acceptance Criteria

  1. WHEN components are integrated THEN the Material_Purchase_System SHALL use Element Plus components that are already available in the main project
  2. WHEN components reference icons THEN the Material_Purchase_System SHALL use @element-plus/icons-vue icons that are available in the main project
  3. WHEN components use local storage THEN the Material_Purchase_System SHALL use unique storage keys prefixed with the module name to avoid conflicts

Requirement 5

User Story: As a system administrator, I want to execute a SQL script to configure all menus, so that the integration can be completed efficiently.

Acceptance Criteria

  1. WHEN the SQL script is executed THEN the Material_Purchase_System SHALL create all menu records in a single transaction
  2. WHEN the SQL script is executed THEN the Material_Purchase_System SHALL clean up any existing menus in the 6500-6599 ID range before inserting new records
  3. WHEN the SQL script is executed THEN the Material_Purchase_System SHALL set appropriate permissions for each menu item following the naming convention "caigou:module:action"