From 53fbb03ad4f8c69f971bc22a606e196bac82581b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 28 Mar 2026 23:26:57 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(mes):=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E5=BA=93=E5=8C=BA=E6=B7=B7=E6=94=BE=E8=A7=84=E5=88=99=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=80=BB=E8=BE=91=EF=BC=8C=E7=AE=80=E5=8C=96=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/wm/warehouse/location/index.ts | 8 +++ .../wm/warehouse/location/LocationForm.vue | 72 +++++++++++++++++-- 2 files changed, 74 insertions(+), 6 deletions(-) diff --git a/src/api/mes/wm/warehouse/location/index.ts b/src/api/mes/wm/warehouse/location/index.ts index 2a41fd80f..62fc54e20 100644 --- a/src/api/mes/wm/warehouse/location/index.ts +++ b/src/api/mes/wm/warehouse/location/index.ts @@ -45,4 +45,12 @@ export const WmWarehouseLocationApi = { deleteWarehouseLocation: async (id: number) => { return await request.delete({ url: '/mes/wm/warehouse-location/delete?id=' + id }) }, + + // 批量设置库区下所有库位的混放规则 + updateAreaByLocationId: async (locationId: number, allowItemMixing?: boolean, allowBatchMixing?: boolean) => { + return await request.put({ + url: '/mes/wm/warehouse-location/update-by-location-id', + params: { locationId, allowItemMixing, allowBatchMixing } + }) + }, } diff --git a/src/views/mes/wm/warehouse/location/LocationForm.vue b/src/views/mes/wm/warehouse/location/LocationForm.vue index 295a1dc7a..cee1ddbce 100644 --- a/src/views/mes/wm/warehouse/location/LocationForm.vue +++ b/src/views/mes/wm/warehouse/location/LocationForm.vue @@ -65,10 +65,46 @@ + + @@ -99,11 +135,6 @@ const formLoading = ref(false) // 表单的加载中 const formType = ref('') // 表单的类型:create - 新增;update - 修改;detail - 详情 const isDetail = computed(() => formType.value === 'detail') // 是否详情模式(只读) const warehouseList = ref([]) // 仓库列表 - -/** 生成库区编码 */ -const generateCode = async () => { - formData.value.code = await AutoCodeRecordApi.generateAutoCode(MesAutoCodeRuleCode.WM_LOCATION_CODE) -} const formData = ref({ id: undefined, code: undefined, @@ -122,6 +153,13 @@ const formRules = reactive({ }) const formRef = ref() // 表单 Ref +/** 生成库区编码 */ +const generateCode = async () => { + formData.value.code = await AutoCodeRecordApi.generateAutoCode( + MesAutoCodeRuleCode.WM_LOCATION_CODE + ) +} + /** 打开弹窗 */ const open = async (type: string, id?: number, defaultWarehouseId?: number) => { dialogVisible.value = true @@ -183,4 +221,26 @@ const resetForm = () => { } formRef.value?.resetFields() } + +/** 设置产品混放规则 */ +const setProductMixing = async (allow: boolean) => { + try { + await ElMessageBox.confirm('确认要重置库区下所有库位的产品混放规则吗?', '提示', { + type: 'warning' + }) + await WmWarehouseLocationApi.updateAreaByLocationId(formData.value.id!, allow, undefined) + message.success('设置成功') + } catch {} +} + +/** 设置批次混放规则 */ +const setBatchMixing = async (allow: boolean) => { + try { + await ElMessageBox.confirm('确认要重置库区下所有库位的批次混放规则吗?', '提示', { + type: 'warning' + }) + await WmWarehouseLocationApi.updateAreaByLocationId(formData.value.id!, undefined, allow) + message.success('设置成功') + } catch {} +}