From dabc6657e05499d5e1a4366bf2c7776ea8c1d797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Tue, 23 Dec 2025 10:23:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor(KLPService):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9B=AE=E5=BD=95=E7=BB=93=E6=9E=84=E5=B9=B6?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A4=9A=E4=B8=AA=E8=A1=A8=E5=8D=95=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重构KLPService组件目录结构,将原有组件迁移至formItems子目录并新增多个表单选择组件。主要变更包括: 1. 移除CategorySelect组件及相关引用 2. 新增CraftSelect、AmountSelect、VendorSelect等表单组件 3. 优化WarehouseSelect组件支持禁用状态 4. 重构ProductSelect和RawMaterialSelect为卡片式选择器 5. 新增统一导出机制支持按需导入 同时更新相关视图文件以适配新的组件结构,改进代码可维护性和复用性。 --- .../KLPService/CategorySelect/index.vue | 90 ---- .../KLPService/WarehouseSelect/index.vue | 6 +- .../formItems/ActualWarehouseSelect/index.vue | 213 ++++++++++ .../formItems/AmountSelect/index.vue | 49 +++ .../formItems/CheckItemSelect/index.vue | 186 ++++++++ .../formItems/CraftSelect/index.vue | 45 ++ .../formItems/CustomerSelect/index.vue | 48 +++ .../formItems/MaterialSelect/index.vue | 75 ++++ .../formItems/OrderDetailSelect/index.vue | 79 ++++ .../formItems/OrderSelect/index.vue | 82 ++++ .../formItems/ProductSelect/index.vue | 395 +++++++++++++++++ .../formItems/RawMaterialSelect/index.vue | 398 ++++++++++++++++++ .../KLPService/formItems/UserSelect/index.vue | 112 +++++ .../formItems/VendorSelect/index.vue | 59 +++ .../formItems/WarehouseSelect/index.vue | 121 ++++++ .../components/KLPService/formItems/index.js | 15 + klp-ui/src/components/KLPService/index.js | 1 - klp-ui/src/views/wms/coil/split.vue | 12 +- klp-ui/src/views/wms/coil/typing.vue | 12 +- klp-ui/src/views/wms/product/index.vue | 4 +- klp-ui/src/views/wms/product/semi.vue | 79 ---- klp-ui/src/views/wms/rawMaterial/index.vue | 12 +- 22 files changed, 1897 insertions(+), 196 deletions(-) delete mode 100644 klp-ui/src/components/KLPService/CategorySelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/ActualWarehouseSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/AmountSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/CheckItemSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/CraftSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/CustomerSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/MaterialSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/OrderDetailSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/OrderSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/ProductSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/RawMaterialSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/UserSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/VendorSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/WarehouseSelect/index.vue create mode 100644 klp-ui/src/components/KLPService/formItems/index.js diff --git a/klp-ui/src/components/KLPService/CategorySelect/index.vue b/klp-ui/src/components/KLPService/CategorySelect/index.vue deleted file mode 100644 index d97286d6..00000000 --- a/klp-ui/src/components/KLPService/CategorySelect/index.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - - - diff --git a/klp-ui/src/components/KLPService/WarehouseSelect/index.vue b/klp-ui/src/components/KLPService/WarehouseSelect/index.vue index 00de50e2..fba1f5da 100644 --- a/klp-ui/src/components/KLPService/WarehouseSelect/index.vue +++ b/klp-ui/src/components/KLPService/WarehouseSelect/index.vue @@ -13,7 +13,8 @@ v-for="item in warehouseOptions" :key="item.warehouseId" :label="item.warehouseName" - :value="item.warehouseId" + :value="item.warehouseId" + :disabled="item.isEnabled == 0" > {{ item.warehouseName }} @@ -88,7 +89,8 @@ export default { const option = { warehouseId: item.warehouseId, warehouseName: item.warehouseName, - level: level + level: level, + isEnabled: item.isEnabled, }; // 递归构建子节点 diff --git a/klp-ui/src/components/KLPService/formItems/ActualWarehouseSelect/index.vue b/klp-ui/src/components/KLPService/formItems/ActualWarehouseSelect/index.vue new file mode 100644 index 00000000..fb8fcf5a --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/ActualWarehouseSelect/index.vue @@ -0,0 +1,213 @@ + + + + + diff --git a/klp-ui/src/components/KLPService/formItems/AmountSelect/index.vue b/klp-ui/src/components/KLPService/formItems/AmountSelect/index.vue new file mode 100644 index 00000000..0ae0c13f --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/AmountSelect/index.vue @@ -0,0 +1,49 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/components/KLPService/formItems/CheckItemSelect/index.vue b/klp-ui/src/components/KLPService/formItems/CheckItemSelect/index.vue new file mode 100644 index 00000000..673262fc --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/CheckItemSelect/index.vue @@ -0,0 +1,186 @@ + + + + + \ No newline at end of file diff --git a/klp-ui/src/components/KLPService/formItems/CraftSelect/index.vue b/klp-ui/src/components/KLPService/formItems/CraftSelect/index.vue new file mode 100644 index 00000000..91ecf0f7 --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/CraftSelect/index.vue @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/components/KLPService/formItems/CustomerSelect/index.vue b/klp-ui/src/components/KLPService/formItems/CustomerSelect/index.vue new file mode 100644 index 00000000..ed1dafc8 --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/CustomerSelect/index.vue @@ -0,0 +1,48 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/components/KLPService/formItems/MaterialSelect/index.vue b/klp-ui/src/components/KLPService/formItems/MaterialSelect/index.vue new file mode 100644 index 00000000..72691b82 --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/MaterialSelect/index.vue @@ -0,0 +1,75 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/components/KLPService/formItems/OrderDetailSelect/index.vue b/klp-ui/src/components/KLPService/formItems/OrderDetailSelect/index.vue new file mode 100644 index 00000000..9251caca --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/OrderDetailSelect/index.vue @@ -0,0 +1,79 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/components/KLPService/formItems/OrderSelect/index.vue b/klp-ui/src/components/KLPService/formItems/OrderSelect/index.vue new file mode 100644 index 00000000..4d2068ef --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/OrderSelect/index.vue @@ -0,0 +1,82 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/components/KLPService/formItems/ProductSelect/index.vue b/klp-ui/src/components/KLPService/formItems/ProductSelect/index.vue new file mode 100644 index 00000000..e0a88820 --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/ProductSelect/index.vue @@ -0,0 +1,395 @@ + + + + + \ No newline at end of file diff --git a/klp-ui/src/components/KLPService/formItems/RawMaterialSelect/index.vue b/klp-ui/src/components/KLPService/formItems/RawMaterialSelect/index.vue new file mode 100644 index 00000000..355e1216 --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/RawMaterialSelect/index.vue @@ -0,0 +1,398 @@ + + + + + \ No newline at end of file diff --git a/klp-ui/src/components/KLPService/formItems/UserSelect/index.vue b/klp-ui/src/components/KLPService/formItems/UserSelect/index.vue new file mode 100644 index 00000000..8a39408f --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/UserSelect/index.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/klp-ui/src/components/KLPService/formItems/VendorSelect/index.vue b/klp-ui/src/components/KLPService/formItems/VendorSelect/index.vue new file mode 100644 index 00000000..02a6a853 --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/VendorSelect/index.vue @@ -0,0 +1,59 @@ + + + \ No newline at end of file diff --git a/klp-ui/src/components/KLPService/formItems/WarehouseSelect/index.vue b/klp-ui/src/components/KLPService/formItems/WarehouseSelect/index.vue new file mode 100644 index 00000000..fba1f5da --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/WarehouseSelect/index.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/klp-ui/src/components/KLPService/formItems/index.js b/klp-ui/src/components/KLPService/formItems/index.js new file mode 100644 index 00000000..be3a99a5 --- /dev/null +++ b/klp-ui/src/components/KLPService/formItems/index.js @@ -0,0 +1,15 @@ +// 所有表单组件,查找该目录下的所有文件夹下的index.vue文件,并设置统一导出 +const req = require.context('./', true, /\/index\.vue$/) // 注意:第一个参数是当前目录,第二个参数改为true(递归查找子文件夹) + +const modules = {} +req.keys().forEach(key => { + // 提取文件夹名称作为组件名(比如 ./Input/index.vue → Input) + const componentName = key.replace(/^\.\/(.*)\/index\.vue$/, '$1') + modules[componentName] = req(key).default + + // 关键:为每个组件添加命名导出(支持按需导入) + module.exports[componentName] = req(key).default +}) + +// 保持默认导出(支持全部导入) +module.exports.default = modules \ No newline at end of file diff --git a/klp-ui/src/components/KLPService/index.js b/klp-ui/src/components/KLPService/index.js index 36aeed07..68c7ddfb 100644 --- a/klp-ui/src/components/KLPService/index.js +++ b/klp-ui/src/components/KLPService/index.js @@ -1,4 +1,3 @@ -export { default as CategorySelect } from './CategorySelect/index.vue'; export { default as CheckItemSelect } from './CheckItemSelect/index.vue'; export { default as ProductSelect } from './ProductSelect/index.vue'; export { default as RawMaterialSelect } from './RawMaterialSelect/index.vue'; diff --git a/klp-ui/src/views/wms/coil/split.vue b/klp-ui/src/views/wms/coil/split.vue index 23d20e88..3ad6cd77 100644 --- a/klp-ui/src/views/wms/coil/split.vue +++ b/klp-ui/src/views/wms/coil/split.vue @@ -164,11 +164,11 @@ - - - + - - - + @@ -234,6 +234,7 @@ import { listProductWithBom } from '@/api/wms/product'; import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect"; import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect"; import ProductSelect from "@/components/KLPService/ProductSelect"; +import WarehouseSelect from "@/components/KLPService/WarehouseSelect"; export default { name: 'TypingCoil', @@ -241,6 +242,7 @@ export default { ActualWarehouseSelect, RawMaterialSelect, ProductSelect, + WarehouseSelect, }, data() { return { diff --git a/klp-ui/src/views/wms/product/index.vue b/klp-ui/src/views/wms/product/index.vue index 95e66303..561f7998 100644 --- a/klp-ui/src/views/wms/product/index.vue +++ b/klp-ui/src/views/wms/product/index.vue @@ -136,8 +136,7 @@