From a2e3cae366f652d41827a7eeac09516059dedbac Mon Sep 17 00:00:00 2001 From: SjS Date: Sat, 7 Jun 2025 18:02:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E5=8F=B0=E5=AD=98=E9=85=92=E5=8F=96?= =?UTF-8?q?=E9=85=92=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bst/storage.js | 8 -- .../bst/location/components/LocationTree.vue | 18 ++-- src/views/bst/storage/index.vue | 78 +++++------------- src/views/bst/storageRecord/index.vue | 82 +++++-------------- 4 files changed, 52 insertions(+), 134 deletions(-) diff --git a/src/api/bst/storage.js b/src/api/bst/storage.js index ab6ef38..639b145 100644 --- a/src/api/bst/storage.js +++ b/src/api/bst/storage.js @@ -34,11 +34,3 @@ export function updateStorage(data) { data: data }) } - -// 删除存酒 -export function delStorage(id) { - return request({ - url: '/bst/storage/' + id, - method: 'delete' - }) -} diff --git a/src/views/bst/location/components/LocationTree.vue b/src/views/bst/location/components/LocationTree.vue index d462069..efbb459 100644 --- a/src/views/bst/location/components/LocationTree.vue +++ b/src/views/bst/location/components/LocationTree.vue @@ -101,10 +101,12 @@ export default { this.$refs.tree.filter(this.searchValue); }, filterNode(value, data) { - if (!value) { - return true; + if (!value) return true; + + if (data.type === "location" && data.originalName) { + return data.originalName.includes(value); } - return data.name.indexOf(value) !== -1; + return data.name.includes(value); }, async getList() { this.loading = true; @@ -128,11 +130,13 @@ export default { .filter(location => location.storeId === store.storeId) .map(location => ({ id: location.id, - name: location.name, + name: `${location.name}(${location.currentNum || 0})`, + originalName: location.name, storeId: location.storeId, storeName: store.storeName, locationId: location.id, - type: "location" + type: "location", + currentNum: location.currentNum })) })); @@ -163,14 +167,14 @@ export default { this.form = { id: data.locationId || data.id, storeId: data.storeId, - name: data.name + name: data.originalName }; this.dialogVisible = true; }, // 删除按钮点击 handleDelete(data) { - this.$confirm(`是否确认删除【${data.name}】?`, "提示", { + this.$confirm(`是否确认删除【${data.originalName}】?`, "提示", { type: "warning" }).then(async () => { await delLocation(data.locationId); diff --git a/src/views/bst/storage/index.vue b/src/views/bst/storage/index.vue index ba5bbaf..676d4cf 100644 --- a/src/views/bst/storage/index.vue +++ b/src/views/bst/storage/index.vue @@ -1,26 +1,10 @@ + + @@ -123,13 +94,6 @@ @click="handleUpdate(scope.row)" v-has-permi="['bst:storage:edit']" >修改 - 删除 @@ -189,11 +153,10 @@