From 5bae1f405be3d1daf5d72f5cf87716dc89f6889c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Tue, 13 Jan 2026 15:49:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E8=87=B31.3.23=E5=B9=B6=E6=96=B0=E5=A2=9E=E7=9C=9F?= =?UTF-8?q?=E5=AE=9E=E5=BA=93=E5=8C=BA=E9=80=89=E6=8B=A9=E5=99=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor(warehouse-picker): 重构逻辑库区选择器组件 feat(actual-warehouse-picker): 新增真实库区选择器组件 fix(easycode.vue): 调整钢卷质量状态校验逻辑 style(search.vue): 优化表单样式和字段显示 --- apps/hand-factory/api/wms/actualWarehouse.js | 10 + .../klp-actual-warehouse-picker.vue | 402 ++++++++++++++++++ .../klp-material-picker.vue | 56 ++- .../klp-warehouse-picker.vue | 132 +++--- apps/hand-factory/config.js | 2 +- apps/hand-factory/manifest.json | 2 +- apps/hand-factory/pages/easycode/easycode.vue | 64 +-- apps/hand-factory/pages/search/search.vue | 38 +- apps/hand-factory/utils/update.js | 2 +- apps/hand-factory/version.json | 2 +- 10 files changed, 555 insertions(+), 155 deletions(-) create mode 100644 apps/hand-factory/components/klp-actual-warehouse-picker/klp-actual-warehouse-picker.vue diff --git a/apps/hand-factory/api/wms/actualWarehouse.js b/apps/hand-factory/api/wms/actualWarehouse.js index b9edb67..fa2e625 100644 --- a/apps/hand-factory/api/wms/actualWarehouse.js +++ b/apps/hand-factory/api/wms/actualWarehouse.js @@ -42,3 +42,13 @@ export function delActualWarehouse(actualWarehouseId) { method: 'delete' }) } + +// 获取两级的树结构 +export function treeActualWarehouseTwoLevel(query) { + return request({ + url: '/wms/actualWarehouse/levelTwo', + method: 'get', + params: query + }) +} + diff --git a/apps/hand-factory/components/klp-actual-warehouse-picker/klp-actual-warehouse-picker.vue b/apps/hand-factory/components/klp-actual-warehouse-picker/klp-actual-warehouse-picker.vue new file mode 100644 index 0000000..35e2c60 --- /dev/null +++ b/apps/hand-factory/components/klp-actual-warehouse-picker/klp-actual-warehouse-picker.vue @@ -0,0 +1,402 @@ + + + + + \ No newline at end of file diff --git a/apps/hand-factory/components/klp-material-picker/klp-material-picker.vue b/apps/hand-factory/components/klp-material-picker/klp-material-picker.vue index f9601f6..f48bde1 100644 --- a/apps/hand-factory/components/klp-material-picker/klp-material-picker.vue +++ b/apps/hand-factory/components/klp-material-picker/klp-material-picker.vue @@ -7,7 +7,9 @@ {{ itemType === 'product' ? '成品' : itemType === 'raw_material' ? '原料' : '请选择物品类型' }} - + + + @@ -18,7 +20,9 @@ {{ loadingProducts ? '加载中...' : selectedName || '请选择产品' }} - + + + @@ -29,7 +33,9 @@ {{ loadingRawMaterials ? '加载中...' : selectedName || '请选择原材料' }} - + + + @@ -259,7 +265,6 @@ const keyword = this.rawMaterialSearchKeyword.trim().toLowerCase(); this.filteredRawMaterials = keyword ? this.rawMaterials.filter(m => { - console.log(m.specification) // 只基于原材料名称过滤,且确保是原材料数据 return (m.rawMaterialName && m.rawMaterialName.toLowerCase().includes(keyword)) || m?.specification?.toLowerCase()?.includes(keyword) @@ -324,13 +329,36 @@ }, closeRawMaterialPicker() { this.$refs.rawMaterialPopup.close(); + }, + + // ✅ 新增核心清除方法1:清空物品类型 + 所有关联数据(完全重置) + handleClearItemType() { + this.$emit('update:itemType', ''); + this.$emit('update:itemId', undefined); + this.$emit('update:materialType', undefined); + this.selectedName = ''; + uni.showToast({ title: '已清空物品类型', icon: 'none' }); + }, + + // ✅ 新增核心清除方法2:仅清空选中的产品,保留物品类型为成品 + handleClearProduct() { + this.$emit('update:itemId', undefined); + this.selectedName = ''; + uni.showToast({ title: '已清空产品选择', icon: 'none' }); + }, + + // ✅ 新增核心清除方法3:仅清空选中的原材料,保留物品类型为原料 + handleClearRawMaterial() { + this.$emit('update:itemId', undefined); + this.selectedName = ''; + uni.showToast({ title: '已清空原材料选择', icon: 'none' }); } } };