From 87409d0c93ccafb6dfadffc977733386edc24049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E9=94=A6=E6=B6=9B?= <26050301730@qq.com> Date: Thu, 30 Oct 2025 15:38:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E8=8D=AF=E6=88=BF/?= =?UTF-8?q?=E5=BA=93=E6=88=BF=E7=9A=84=E5=88=A0=E9=99=A4=E7=9A=84=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warehouseLocation/components/api.js | 6 +++- .../basicmanage/warehouseLocation/index.vue | 34 ++++++++++++++----- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/openhis-ui-vue3/src/views/basicmanage/warehouseLocation/components/api.js b/openhis-ui-vue3/src/views/basicmanage/warehouseLocation/components/api.js index e28adfe8..55fa4bd6 100644 --- a/openhis-ui-vue3/src/views/basicmanage/warehouseLocation/components/api.js +++ b/openhis-ui-vue3/src/views/basicmanage/warehouseLocation/components/api.js @@ -36,8 +36,12 @@ export function updateWarehouse(data) { // 删除 export function deleteWarehouse(data) { return request({ - url: '/base-data-manage/location/location?locationId=' + data.locationId, + url: '/base-data-manage/location/location', method: 'delete', + params: { + locationId: data.locationId, + busNo: data.busNo + } }) } diff --git a/openhis-ui-vue3/src/views/basicmanage/warehouseLocation/index.vue b/openhis-ui-vue3/src/views/basicmanage/warehouseLocation/index.vue index a71209e7..391fa168 100644 --- a/openhis-ui-vue3/src/views/basicmanage/warehouseLocation/index.vue +++ b/openhis-ui-vue3/src/views/basicmanage/warehouseLocation/index.vue @@ -173,7 +173,7 @@ const { warehous_type } = proxy.useDict('warehous_type'); const rules = ref({ busNo: [{ required: false, message: '请输入科室编号', trigger: 'change' }], name: [ - { required: true, message: '请输入仓库名称', trigger: 'change' }, + { required: true, message: '请输入', trigger: 'change' }, { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'change' }, ], formEnum: [{ required: true, message: '请选择仓库类型', trigger: 'change' }], @@ -211,7 +211,7 @@ function resetQuery() { } function handleEnable(row) { - enableLocation([row.id]).then((res) => { + enableLocation({ locationId: row.id, busNo: row.busNo }).then((res) => { if (res.code == 200) { proxy.$modal.msgSuccess('启用成功'); handleQuery(); @@ -220,7 +220,7 @@ function handleEnable(row) { } function handleUnable(row) { - unableLocation([row.id]).then((res) => { + unableLocation({ locationId: row.id, busNo: row.busNo }).then((res) => { if (res.code == 200) { proxy.$modal.msgSuccess('停用成功'); handleQuery(); @@ -294,11 +294,29 @@ function submitForm() { // 删除 function handelDelete(data) { - loading.value = true; - deleteWarehouse({ locationId: data.id }).then((res) => { - proxy.$modal.msgSuccess('操作成功'); - loading.value = false; - getPageList(); + proxy.$modal.confirm('是否确认删除该仓库位置?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + loading.value = true; + deleteWarehouse({ locationId: data.id, busNo: data.busNo }).then((res) => { + if (res.code === 200) { + proxy.$modal.msgSuccess('删除成功'); + getPageList(); + } else { + // 检查错误信息是否与药品数据关联有关 + if (res.msg && res.msg.includes('药品')) { + proxy.$modal.msgError('该仓库名称已有药品信息请核对确认'); + } else { + proxy.$modal.msgError('删除失败:' + (res.msg || '未知错误')); + } + } + }).catch(() => { + proxy.$modal.msgError('删除失败'); + }).finally(() => { + loading.value = false; + }); }); } // // 停用