From 2012f8a945dfefe9c8044ef85e0c6450d285eac2 Mon Sep 17 00:00:00 2001 From: weiwei Date: Mon, 14 Apr 2025 15:33:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E8=83=BD=E6=9F=9C=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/hard/hard-door-manager/index.vue | 47 ++++++++++++++----- .../hard/hard-door-manager/volume-setting.vue | 12 +++-- 2 files changed, 42 insertions(+), 17 deletions(-) diff --git a/src/views/hard/hard-door-manager/index.vue b/src/views/hard/hard-door-manager/index.vue index 5bac785..6d63313 100644 --- a/src/views/hard/hard-door-manager/index.vue +++ b/src/views/hard/hard-door-manager/index.vue @@ -19,12 +19,12 @@ {{}} - {{ doorSettingData.id }} - {{}} - {{}} + {{ doorSettingData.deviceCode }} + {{ doorSettingData.hardName }} + {{ doorSettingData.imei }} {{}} - {{}} - {{}} + {{ doorSettingData.simSn }} + {{ doorSettingData.doorCount }} {{}} @@ -34,10 +34,10 @@ 音量设置 - {{}} + {{ doorSettingData.saleStatus }} {{}} - {{}} - {{}} + {{ doorSettingData.powerStatus }} + {{ doorSettingData.netStatus }} {{ doorSettingData.mediaVolume }} {{ doorSettingData.systemVolume }} @@ -51,7 +51,12 @@ - +
@@ -79,7 +84,6 @@
- 22
@@ -100,6 +104,7 @@ import { useMessage } from "/@/hooks/message" import { displayPrice } from "/@/utils/formatMoney" import * as hardDoorManager from "/@/api/hard/hard-door-manager" import { ElMessageBox } from "element-plus" +import { getByCabinetNo } from "/@/api/hard/hard-spu" const InfoSetting = defineAsyncComponent(() => import("./info-setting.vue")) const VolumeSetting = defineAsyncComponent(() => import("./volume-setting.vue")) @@ -108,6 +113,8 @@ const GoodsPutaway = defineAsyncComponent(() => import("./goods-putaway.vue")) const { query } = useRoute() const loading = ref(false) const doorSettingData = ref({}) +const cabinetData = ref([]) +const currentCabinet = ref(0) const state = reactive({ mediaVolume: "", systemVolume: "", @@ -120,8 +127,10 @@ const goodsPutawayRef = ref() onMounted(async () => { await getDetail() + await getCabinet() }) +// 获取柜子详情 const getDetail = async () => { const id = query.id as unknown as any if (!id) return useMessage().error("设备id不存在") @@ -129,13 +138,27 @@ const getDetail = async () => { const { data: orderData } = await hardDoorManager.getByHardId({ hardId: id }) if (orderData) { - doorSettingData.value = orderData + doorSettingData.value = { ...orderData, cabinetList: JSON.parse(orderData.cabinetList) } } if (!doorSettingData.value.hardId) { doorSettingData.value.hardId = id } } +const getCabinet = async (cabinetIndex: number = 0) => { + console.log(doorSettingData.value.cabinetList) + + if (!doorSettingData.value.hardId) return useMessage().error("设备id不存在") + if (!doorSettingData.value.cabinetList?.length) return useMessage().error("设备空间不存在") + const { data } = await getByCabinetNo({ + hardId: doorSettingData.value.hardId, + cabinetNo: doorSettingData.value.cabinetList[cabinetIndex].cabinetNo, + }) + if (data) { + cabinetData.value = data + } +} + // 绑定信息 const doBind = async () => { if (infoSettingRef.value) { @@ -148,7 +171,7 @@ const refreshInfo = () => {} // 音量设置 const doVolumeSetting = async () => { if (volumeSettingRef.value) { - volumeSettingRef.value.openDialog(doorSettingData.value.hardId) + volumeSettingRef.value.openDialog(doorSettingData.value.hardId, doorSettingData.value.mediaVolume, doorSettingData.value.systemVolume) } } const refreshVolume = (data: { hardId: string; mediaVolume: number; systemVolume: number }) => { diff --git a/src/views/hard/hard-door-manager/volume-setting.vue b/src/views/hard/hard-door-manager/volume-setting.vue index 0917cdf..54c274a 100644 --- a/src/views/hard/hard-door-manager/volume-setting.vue +++ b/src/views/hard/hard-door-manager/volume-setting.vue @@ -36,14 +36,16 @@ const form = reactive<{ systemVolume: number }>({ hardId: "", - mediaVolume: 80, - systemVolume: 80, + mediaVolume: 0, + systemVolume: 0, }) -const openDialog = (id: string) => { - if (!id) return useMessage().warning("设备id不存在") +const openDialog = (hardId: string, mediaVolume: number, systemVolume: number) => { + if (!hardId) return useMessage().warning("设备id不存在") + form.hardId = hardId + form.mediaVolume = mediaVolume + form.systemVolume = systemVolume visible.value = true - form.hardId = id } // 提交