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 @@