This commit is contained in:
weiwei committed 2025-04-14 20:26:06 +08:00
1 parent 44acbcfe51
commit 83a88a4606
1 file changed
+77 -15
+77 -15
View File
@@ -14,9 +14,7 @@
<el-descriptions :column="3" title="智能柜设置" border>
<template #extra>
<div class="flex justify-center items-center">
<el-button icon="Edit" type="primary" @click="changeInfo">修改</el-button>
</div>
<el-button icon="Edit" type="primary" @click="changeInfo">修改</el-button>
</template>
<el-descriptions-item label="商户名称:">{{}}</el-descriptions-item>
<el-descriptions-item label="设备编号:">{{ state.deviceDetail.deviceCode }}</el-descriptions-item>
@@ -31,9 +29,7 @@
<el-descriptions :column="3" title="运行信息" border>
<template #extra>
<div class="flex justify-center items-center">
<el-button icon="Edit" type="primary" @click="doVolumeSetting">音量设置</el-button>
</div>
<el-button icon="Edit" type="primary" @click="doVolumeSetting">音量设置</el-button>
</template>
<el-descriptions-item label="售卖状态:">
<el-tag v-if="state.deviceDetail.saleStatus == 1" type="primary">在售</el-tag>
@@ -69,11 +65,43 @@
<el-descriptions-item label="上次重启时间:">{{ state.deviceDetail.restartTime }}</el-descriptions-item>
</el-descriptions>
<el-descriptions :column="3" title="货柜信息" border>
<template #extra>
<el-button icon="CircleCheck" type="primary" @click="checkOpenAccess">检修开门</el-button>
</template>
</el-descriptions>
<el-tabs type="border-card" @tab-click="doorTabClick">
<el-tab-pane
v-if="state.deviceDetail.cabinetList?.length"
:label="state.deviceDetail.deviceCode + '-' + item.cabinetNo"
v-for="(item, index) in state.deviceDetail.cabinetList"
:key="index"
>
<el-descriptions :column="3" title="" border>
<el-descriptions-item label="货柜号:">{{ item.cabinetNo }}</el-descriptions-item>
<el-descriptions-item label="在线门锁状态:">
<el-tag v-if="item.isLockOnline == 'Y'" type="primary">正常</el-tag>
<el-tag v-else type="danger">异常</el-tag>
</el-descriptions-item>
<el-descriptions-item label="门锁状态:">
<el-tag v-if="item.lockStatus == 1" type="primary">正常</el-tag>
<el-tag v-if="item.lockStatus == 2" type="danger">异常</el-tag>
</el-descriptions-item>
<el-descriptions-item label="柜门状态:">
<el-tag v-if="item.doorStatus == 1" type="primary">正常</el-tag>
<el-tag v-if="item.doorStatus == 2" type="danger">异常</el-tag>
</el-descriptions-item>
<el-descriptions-item label="售卖状态:">
<el-tag v-if="item.saleStatus == 1" type="primary">在售</el-tag>
<el-tag v-if="item.saleStatus == 2" type="danger">停售</el-tag>
</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
</el-tabs>
<el-descriptions :column="0" title="货柜商品" border>
<!-- <template #extra>
<div class="flex justify-center items-center">
<el-button icon="Edit" type="primary">设置</el-button>
</div>
</template> -->
</el-descriptions>
@@ -90,19 +118,36 @@
<div class="text-center w-24 text-lg font-bold">第 {{ floorIndex + 1 }} 层:</div>
<div class="flex flex-wrap">
<div class="flex flex-col items-center justify-start" v-for="(v, indexNo) in floorItem[floorIndex + 1]" :key="indexNo">
<div
class="bg-blue-50 w-20 h-20 border border-black mx-4 my-1 flex items-center justify-center cursor-pointer rounded-lg"
@click="clickPutaway(v.id)"
>
<div v-if="v.spuId && v.spuDetail" class="relative">
<div v-if="v.spuId && v.spuDetail" class="w-20 mx-4 my-1 flex flex-col items-center">
<div class="relative">
<el-icon @click.stop="deleteGoods(v)" class="absolute right-[-8px] top-[-8px] text-xl text-blue-600 z-50">
<CircleClose />
</el-icon>
<preview-image width="86px" height="86px" :src="v.spuDetail.pic" @click.stop />
</div>
<span v-else>点击上架</span>
<el-tooltip effect="dark" :content="v.spuDetail?.name">
<div class="line-clamp-1">{{ v.spuDetail?.name }}</div>
</el-tooltip>
<div
class="color-primary w-full flex items-center"
:class="v.spuDetail.specsCapacity ? 'justify-between' : 'justify-center'"
>
<span>{{ displayPrice(v.spuDetail.price) }}</span>
<span>{{ v.spuDetail.specsCapacity }}</span>
</div>
<!-- <div class="w-full flex items-center justify-between">
<span>{{ v.spuDetail.specsTaste }}</span>
<span>{{ v.spuDetail.specsWeight }}</span>
<span>{{ v.spuDetail.categoryName }}</span>
</div> -->
</div>
<div
v-else
class="bg-blue-50 w-20 h-20 border border-black mx-4 my-1 flex items-center justify-center cursor-pointer rounded-lg"
@click="clickPutaway(v.id)"
>
点击上架
</div>
<div class="h-10">{{ v.spuDetail?.name }}</div>
</div>
</div>
</div>
@@ -129,6 +174,7 @@ import { displayPrice } from "/@/utils/formatMoney"
import * as hardDoorManager from "/@/api/hard/hard-door-manager"
import { ElMessageBox } from "element-plus"
import { getByCabinetNo, unPutaway } from "/@/api/hard/hard-spu"
import { openAccess } from "/@/api/hard/hard-door-manager"
const InfoSetting = defineAsyncComponent(() => import("./info-setting.vue"))
const VolumeSetting = defineAsyncComponent(() => import("./volume-setting.vue"))
@@ -143,6 +189,7 @@ const state = reactive<any>({
hardId: "",
deviceDetail: {},
cabinetData: [],
curActivedDoorTabIndex: 0,
curActivedTabIndex: 0,
})
@@ -196,7 +243,22 @@ const refreshVolume = (data: { hardId: string; mediaVolume: number; systemVolume
state.deviceDetail.systemVolume = data.systemVolume
}
// 检修开门
const checkOpenAccess = async () => {
const res = await openAccess({ hardDoorId: "", cabinetNo: state.deviceDetail.cabinetList[state.curActivedDoorTabIndex].cabinetNo })
if (res.code == 0) {
useMessage().success("操作成功")
return
}
useMessage().error(res.msg || "操作失败")
}
// 点击柜门tab
const doorTabClick = async (tab: any) => {
state.curActivedDoorTabIndex = tab.index
}
// 点击柜门商品tab
const tabClick = async (tab: any) => {
state.curActivedTabIndex = tab.index
await getCabinet(tab.index)