2025-05-15 10:03:15 +08:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { ref, onMounted } from "vue";
|
2025-05-17 09:57:22 +08:00
|
|
|
import { useRoute, useRouter } from "vue-router";
|
2025-05-15 10:03:15 +08:00
|
|
|
import { getSmartCabinetDetailApi, type SmartCabinetDTO } from "@/api/cabinet/smart-cabinet";
|
2025-05-26 09:59:51 +08:00
|
|
|
import { CabinetCellQuery, changeGoodsCellsStock, clearGoodsCells, getCabinetCellList, type CabinetCellDTO } from "@/api/cabinet/cabinet-cell";
|
2025-05-15 10:03:15 +08:00
|
|
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
|
|
|
import { CabinetImgMap } from "@/utils/cabinetImgMap";
|
|
|
|
import GatewayConfigModal from "@/views/cabinet/smart-cabinet/GatewayConfigModal.vue";
|
|
|
|
import ShopConfigModal from "@/views/cabinet/smart-cabinet/ShopConfigModal.vue";
|
|
|
|
import MainCabinetConfigModal from "@/views/cabinet/smart-cabinet/MainCabinetConfigModal.vue";
|
2025-05-17 09:57:22 +08:00
|
|
|
import CabinetGoodsConfigModal from "@/views/shop/cabinet-goods/cabinet-goods-config-modal.vue";
|
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
2025-05-16 10:21:55 +08:00
|
|
|
const { VITE_PUBLIC_IMG_PATH: IMG_PATH } = import.meta.env;
|
2025-05-17 09:57:22 +08:00
|
|
|
import EditPen from "@iconify-icons/ep/edit-pen";
|
|
|
|
import Delete from "@iconify-icons/ep/delete";
|
|
|
|
import AddFill from "@iconify-icons/ri/add-circle-line";
|
|
|
|
import Search from "@iconify-icons/ep/search";
|
|
|
|
import Refresh from "@iconify-icons/ep/refresh";
|
2025-05-21 11:33:21 +08:00
|
|
|
import CellFormModal from "@/views/cabinet/cabinet-cell/cell-form-modal.vue";
|
|
|
|
import CellEditModal from "@/views/cabinet/cabinet-cell/cell-edit-modal.vue";
|
2025-05-17 09:57:22 +08:00
|
|
|
import { getGoodsInfo } from "@/api/shop/goods";
|
2025-05-21 17:16:30 +08:00
|
|
|
import EditCabinetDrawer from "./edit-cabinet-drawer.vue";
|
2025-05-19 11:21:47 +08:00
|
|
|
import { CabinetMainboardDTO, deleteMainboard, getMainboardList, updateMainboard } from "@/api/cabinet/mainboards";
|
2025-05-15 10:03:15 +08:00
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
name: "SmartCabinetDetail"
|
|
|
|
});
|
|
|
|
|
2025-05-17 09:57:22 +08:00
|
|
|
const router = useRouter();
|
2025-05-15 10:03:15 +08:00
|
|
|
const route = useRoute();
|
2025-05-21 11:33:21 +08:00
|
|
|
const currentCell = ref<CabinetCellDTO>();
|
2025-05-15 10:03:15 +08:00
|
|
|
const cabinetInfo = ref<SmartCabinetDTO>({
|
|
|
|
cabinetName: "",
|
|
|
|
cabinetType: 0,
|
|
|
|
templateNo: "",
|
|
|
|
lockControlNo: 0,
|
|
|
|
location: 0
|
|
|
|
});
|
|
|
|
const loading = ref(false);
|
2025-05-17 16:38:00 +08:00
|
|
|
const activeTab = ref('cells');
|
2025-05-19 11:21:47 +08:00
|
|
|
const mainboardList = ref<CabinetMainboardDTO[]>([]);
|
|
|
|
const mainboardPagination = ref({
|
|
|
|
pageSize: 5,
|
|
|
|
currentPage: 1,
|
|
|
|
total: 0
|
|
|
|
});
|
2025-05-15 10:03:15 +08:00
|
|
|
const cabinetId = ref<number>(0);
|
|
|
|
const gatewayConfigVisible = ref(false);
|
|
|
|
const shopConfigVisible = ref(false);
|
|
|
|
const mainCabinetConfigVisible = ref(false);
|
2025-05-21 17:16:30 +08:00
|
|
|
const editCabinetDrawerVisible = ref(false);
|
2025-05-17 09:57:22 +08:00
|
|
|
const cellList = ref<CabinetCellDTO[]>([]);
|
2025-05-26 09:59:51 +08:00
|
|
|
const searchCellParams = ref<CabinetCellQuery>({
|
|
|
|
goodsName: null
|
|
|
|
});
|
2025-05-17 09:57:22 +08:00
|
|
|
const cellPagination = ref({
|
|
|
|
pageSize: 5,
|
|
|
|
currentPage: 1,
|
|
|
|
total: 0
|
|
|
|
});
|
|
|
|
const goodsConfigVisible = ref(false);
|
|
|
|
const currentCellId = ref<number>();
|
2025-05-21 11:33:21 +08:00
|
|
|
const cellFormVisible = ref(false);
|
|
|
|
const cellEditVisible = ref(false);
|
2025-05-17 09:57:22 +08:00
|
|
|
|
|
|
|
function handleConfigure(row: CabinetCellDTO) {
|
|
|
|
currentCellId.value = row.cellId;
|
|
|
|
goodsConfigVisible.value = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
async function handleStockConfig(row: CabinetCellDTO) {
|
|
|
|
try {
|
|
|
|
const { data } = await getGoodsInfo(row.goodsId!);
|
|
|
|
const remainingStock = data.stock - data.totalStock + row.stock;
|
|
|
|
|
|
|
|
const { value } = await ElMessageBox.prompt(
|
|
|
|
`请输入${row.goodsName || '未配置商品'}的库存数量(本次最多可分配:${remainingStock})。\n 若可分配数量不足,请先调整商品列表中的库存。`,
|
|
|
|
'配置库存',
|
|
|
|
{
|
|
|
|
inputPattern: /^0$|^[1-9]\d*$/,
|
|
|
|
inputValue: row.stock?.toString(),
|
|
|
|
inputErrorMessage: '请输入有效的非负整数',
|
|
|
|
inputValidator: (inputValue: string) => {
|
|
|
|
const num = Number(inputValue);
|
|
|
|
if (num > remainingStock) {
|
|
|
|
return '分配数量不能超过剩余库存';
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
if (Number(value) > remainingStock) {
|
|
|
|
ElMessage.warning('分配数量不能超过剩余库存');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
await changeGoodsCellsStock(row.cellId!, Number(value));
|
|
|
|
ElMessage.success('库存更新成功');
|
|
|
|
fetchCellList();
|
|
|
|
} catch (error) {
|
|
|
|
console.error('库存配置取消或失败', error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async function handleClearGoods(row: CabinetCellDTO) {
|
|
|
|
try {
|
|
|
|
await ElMessageBox.confirm(
|
|
|
|
`确认要下架${row.goodsName || '未配置商品'}吗?`,
|
|
|
|
'警告',
|
|
|
|
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
|
|
|
|
);
|
|
|
|
await clearGoodsCells(row.cellId!);
|
|
|
|
ElMessage.success('商品下架成功');
|
|
|
|
fetchCellList();
|
|
|
|
} catch (error) {
|
|
|
|
console.error('操作取消或失败', error);
|
|
|
|
}
|
|
|
|
}
|
2025-05-15 10:03:15 +08:00
|
|
|
|
2025-05-21 11:33:21 +08:00
|
|
|
function handleEditCell(row: CabinetCellDTO) {
|
|
|
|
currentCell.value = row;
|
|
|
|
cellEditVisible.value = true;
|
|
|
|
}
|
|
|
|
|
2025-05-15 10:03:15 +08:00
|
|
|
async function fetchCabinetDetail() {
|
|
|
|
try {
|
|
|
|
loading.value = true;
|
|
|
|
const { data } = await getSmartCabinetDetailApi(cabinetId.value);
|
|
|
|
cabinetInfo.value = data;
|
|
|
|
} finally {
|
|
|
|
loading.value = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-05-17 09:57:22 +08:00
|
|
|
function switchCellType(cellType: number) {
|
|
|
|
switch (cellType) {
|
|
|
|
case 1: return '小格';
|
|
|
|
case 2: return '中格';
|
|
|
|
case 3: return '大格';
|
|
|
|
case 4: return '超大格';
|
|
|
|
default: return '未知';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-05-26 09:59:51 +08:00
|
|
|
function resetCellSearch() {
|
|
|
|
searchCellParams.value.cellNo = null;
|
|
|
|
fetchCellList();
|
|
|
|
}
|
|
|
|
|
2025-05-17 09:57:22 +08:00
|
|
|
async function fetchCellList() {
|
|
|
|
try {
|
|
|
|
loading.value = true;
|
|
|
|
const { data } = await getCabinetCellList({
|
|
|
|
cabinetId: cabinetId.value,
|
2025-05-26 09:59:51 +08:00
|
|
|
goodsName: searchCellParams.value.goodsName,
|
2025-05-17 09:57:22 +08:00
|
|
|
pageSize: cellPagination.value.pageSize,
|
|
|
|
pageNum: cellPagination.value.currentPage
|
|
|
|
});
|
|
|
|
cellList.value = data.rows;
|
|
|
|
cellPagination.value.total = data.total;
|
|
|
|
} finally {
|
|
|
|
loading.value = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function handleCellSizeChange(val: number) {
|
|
|
|
cellPagination.value.pageSize = val;
|
|
|
|
fetchCellList();
|
|
|
|
}
|
|
|
|
|
|
|
|
function handleCellPageChange(val: number) {
|
|
|
|
cellPagination.value.currentPage = val;
|
|
|
|
fetchCellList();
|
|
|
|
}
|
|
|
|
|
2025-05-19 11:21:47 +08:00
|
|
|
async function fetchMainboardList() {
|
|
|
|
try {
|
|
|
|
loading.value = true;
|
|
|
|
const { data } = await getMainboardList({
|
|
|
|
cabinetId: cabinetId.value,
|
|
|
|
pageSize: mainboardPagination.value.pageSize,
|
|
|
|
pageNum: mainboardPagination.value.currentPage
|
|
|
|
});
|
|
|
|
mainboardList.value = data.rows;
|
|
|
|
mainboardPagination.value.total = data.total;
|
|
|
|
} finally {
|
|
|
|
loading.value = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function handleMainboardSizeChange(val: number) {
|
|
|
|
mainboardPagination.value.pageSize = val;
|
|
|
|
fetchMainboardList();
|
|
|
|
}
|
|
|
|
|
|
|
|
function handleMainboardPageChange(val: number) {
|
|
|
|
mainboardPagination.value.currentPage = val;
|
|
|
|
fetchMainboardList();
|
|
|
|
}
|
|
|
|
|
|
|
|
async function handleEditMainboard(row: CabinetMainboardDTO) {
|
|
|
|
try {
|
|
|
|
const { value } = await ElMessageBox.prompt(
|
|
|
|
'请输入锁控板序号',
|
|
|
|
'编辑主板',
|
|
|
|
{
|
|
|
|
inputPattern: /^\d+$/,
|
|
|
|
inputValue: row.lockControlNo.toString(),
|
|
|
|
inputErrorMessage: '请输入有效的数字'
|
|
|
|
}
|
|
|
|
);
|
|
|
|
await updateMainboard(row.mainboardId!, {
|
|
|
|
mainboardId: row.mainboardId,
|
|
|
|
lockControlNo: Number(value)
|
|
|
|
});
|
|
|
|
ElMessage.success('主板更新成功');
|
|
|
|
fetchMainboardList();
|
|
|
|
} catch (error) {
|
|
|
|
console.error('操作取消或失败', error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async function handleDeleteMainboard(row: CabinetMainboardDTO) {
|
|
|
|
try {
|
|
|
|
await ElMessageBox.confirm(
|
|
|
|
'确认要删除该主板吗?',
|
|
|
|
'警告',
|
|
|
|
{ confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
|
|
|
|
);
|
|
|
|
await deleteMainboard(row.mainboardId!.toString());
|
|
|
|
ElMessage.success('主板删除成功');
|
|
|
|
fetchMainboardList();
|
|
|
|
} catch (error) {
|
|
|
|
console.error('操作取消或失败', error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-05-15 10:03:15 +08:00
|
|
|
onMounted(() => {
|
|
|
|
cabinetId.value = Number(route.query.id);
|
|
|
|
fetchCabinetDetail();
|
2025-05-17 09:57:22 +08:00
|
|
|
fetchCellList();
|
2025-05-19 11:21:47 +08:00
|
|
|
fetchMainboardList();
|
2025-05-15 10:03:15 +08:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="detail-container">
|
|
|
|
<div class="flex-container">
|
|
|
|
<el-card class="cabinet-info-card">
|
|
|
|
<div class="cabinet-header">
|
2025-05-16 10:21:55 +08:00
|
|
|
<img :src="`${IMG_PATH}img/cabinet/${CabinetImgMap[cabinetInfo.templateNo]?.img || 'default.jpg'}`"
|
2025-05-15 10:03:15 +08:00
|
|
|
class="cabinet-image" />
|
|
|
|
<div class="cabinet-name">{{ cabinetInfo.cabinetName }}</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<el-divider />
|
|
|
|
|
|
|
|
<el-descriptions class="cabinet-details" :column="1" border>
|
|
|
|
<el-descriptions-item label="柜体ID">{{ cabinetInfo.cabinetId }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="柜体类型">
|
|
|
|
{{ cabinetInfo.cabinetType === 0 ? '主柜' : '副柜' }}
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="模板">
|
|
|
|
{{ CabinetImgMap[cabinetInfo.templateNo]?.name || '-' }}
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="归属商店">
|
|
|
|
{{ cabinetInfo.shopName || '-' }}
|
|
|
|
<el-button type="success" link :icon="useRenderIcon('ep:shop')" @click="shopConfigVisible = true">
|
|
|
|
配置
|
|
|
|
</el-button>
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="MQTT网关">
|
|
|
|
{{ cabinetInfo.mqttServerId || '-' }}
|
|
|
|
<el-button type="warning" link :icon="useRenderIcon('ant-design:gateway-outlined')"
|
|
|
|
@click="gatewayConfigVisible = true">
|
|
|
|
配置
|
|
|
|
</el-button>
|
|
|
|
</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="归属主柜" v-if="cabinetInfo.cabinetType === 1">
|
|
|
|
{{ cabinetInfo.mainCabinetName || '-' }}
|
|
|
|
<el-button type="primary" link :icon="useRenderIcon('ep:setting')" @click="mainCabinetConfigVisible = true">
|
|
|
|
配置
|
|
|
|
</el-button>
|
|
|
|
</el-descriptions-item>
|
|
|
|
</el-descriptions>
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
<el-card class="info-card">
|
|
|
|
<div class="tab-header">
|
|
|
|
<el-tabs type="card" v-model="activeTab">
|
2025-05-17 09:57:22 +08:00
|
|
|
<el-tab-pane label="格口管理" name="cells"></el-tab-pane>
|
2025-05-17 16:38:00 +08:00
|
|
|
<el-tab-pane label="基本信息" name="basic"></el-tab-pane>
|
2025-05-19 11:21:47 +08:00
|
|
|
<el-tab-pane label="主板管理" name="mainboards"></el-tab-pane>
|
2025-05-15 10:03:15 +08:00
|
|
|
</el-tabs>
|
|
|
|
</div>
|
|
|
|
|
2025-05-21 17:16:30 +08:00
|
|
|
<div class="info-details" v-if="activeTab === 'basic'">
|
|
|
|
<div style="display: flex; justify-content: flex-end; margin-bottom: 16px;">
|
|
|
|
<el-button type="primary" link :icon="useRenderIcon(EditPen)" @click="editCabinetDrawerVisible = true">
|
|
|
|
编辑柜体
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
<el-descriptions :column="2" border>
|
|
|
|
<el-descriptions-item label="主柜ID">{{ cabinetInfo.mainCabinet || '-' }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="主柜名称">{{ cabinetInfo.mainCabinetName || '-' }}</el-descriptions-item>
|
2025-05-27 15:12:49 +08:00
|
|
|
<!-- <el-descriptions-item label="归属类型">
|
2025-05-23 10:49:56 +08:00
|
|
|
{{ cabinetInfo.belongType === 0 ? '借还柜' : '固资通' }}
|
2025-05-27 15:12:49 +08:00
|
|
|
</el-descriptions-item> -->
|
2025-05-21 17:16:30 +08:00
|
|
|
<el-descriptions-item label="MQTT服务器ID">{{ cabinetInfo.mqttServerId || '-' }}</el-descriptions-item>
|
|
|
|
<el-descriptions-item label="操作员">{{ cabinetInfo.operator || '-' }}</el-descriptions-item>
|
|
|
|
</el-descriptions>
|
|
|
|
</div>
|
2025-05-15 10:03:15 +08:00
|
|
|
|
2025-05-17 09:57:22 +08:00
|
|
|
<div class="cell-details" v-if="activeTab === 'cells'">
|
2025-05-27 15:12:49 +08:00
|
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 0px;">
|
2025-05-26 09:59:51 +08:00
|
|
|
<el-form :inline="true" :model="searchCellParams" class="search-form">
|
|
|
|
<el-form-item>
|
2025-05-26 10:23:05 +08:00
|
|
|
<el-input @keydown.enter.prevent="fetchCellList" v-model="searchCellParams.goodsName"
|
2025-05-26 09:59:51 +08:00
|
|
|
placeholder="请输入商品名称" clearable class="!w-[180px]" />
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button type="primary" :icon="useRenderIcon(Search)" :loading="loading" @click="fetchCellList">
|
|
|
|
搜索
|
|
|
|
</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button :icon="useRenderIcon(Refresh)" @click="resetCellSearch">
|
|
|
|
重置
|
|
|
|
</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
<!-- <el-button type="primary" :size="'small'" :icon="useRenderIcon(AddFill)" @click="cellFormVisible = true">
|
2025-05-21 11:33:21 +08:00
|
|
|
新增格口
|
2025-05-26 09:59:51 +08:00
|
|
|
</el-button> -->
|
2025-05-21 11:33:21 +08:00
|
|
|
</div>
|
2025-05-17 09:57:22 +08:00
|
|
|
<el-table v-loading="loading" :data="cellList" border>
|
|
|
|
<el-table-column label="格口ID" prop="cellId" width="80" />
|
|
|
|
<el-table-column label="格口号" prop="cellNo" width="80" />
|
2025-05-21 11:33:21 +08:00
|
|
|
<el-table-column label="针脚号" prop="pinNo" width="80" />
|
2025-05-17 09:57:22 +08:00
|
|
|
<el-table-column label="商品图片" width="120">
|
|
|
|
<template #default="{ row }">
|
2025-05-21 11:33:21 +08:00
|
|
|
<el-image :src="row.coverImg" :preview-src-list="[row.coverImg]" :preview-teleported="true"
|
|
|
|
:hide-on-click-modal="true" fit="cover" class="rounded" width="60" height="60" />
|
2025-05-17 09:57:22 +08:00
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="商品名称">
|
|
|
|
<template #default="{ row }">
|
|
|
|
{{ row.goodsId ? row.goodsName : '未配置商品' }}
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="价格" prop="price" width="80" />
|
|
|
|
<el-table-column label="库存" prop="stock" width="80" />
|
|
|
|
<el-table-column label="单元格类型" prop="cellType" width="120">
|
|
|
|
<template #default="{ row }">
|
|
|
|
{{ switchCellType(row.cellType) }}
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="购买次数" prop="orderCount" width="100" />
|
|
|
|
<el-table-column label="相关信息" width="150" fixed="right">
|
|
|
|
<template #default="{ row }">
|
|
|
|
<el-button type="success" link :icon="useRenderIcon('document')"
|
|
|
|
@click="router.push({ path: '/shop/order/index', query: { cellId: row.cellId } })">
|
|
|
|
购买记录
|
|
|
|
</el-button>
|
|
|
|
<el-button type="warning" link :icon="useRenderIcon('document')"
|
|
|
|
@click="router.push({ path: '/cabinet/operation/index', query: { cellId: row.cellId } })">
|
|
|
|
开启记录
|
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="操作" width="150" fixed="right">
|
|
|
|
<template #default="{ row }">
|
2025-05-26 09:59:51 +08:00
|
|
|
<el-button v-if="cabinetInfo.belongType === 0" type="success" link :icon="useRenderIcon(AddFill)"
|
|
|
|
@click="handleConfigure(row)">
|
2025-05-17 09:57:22 +08:00
|
|
|
配置商品
|
|
|
|
</el-button>
|
2025-05-21 11:33:21 +08:00
|
|
|
|
|
|
|
<el-button type="primary" link :icon="useRenderIcon(EditPen)" @click="handleEditCell(row)">
|
|
|
|
编辑格口
|
|
|
|
</el-button>
|
2025-05-17 09:57:22 +08:00
|
|
|
<el-button v-if="row.goodsId" type="warning" link :icon="useRenderIcon(EditPen)"
|
|
|
|
@click="handleStockConfig(row)">
|
|
|
|
配置库存
|
|
|
|
</el-button>
|
|
|
|
<el-button v-if="row.goodsId" type="danger" link :icon="useRenderIcon(Delete)"
|
|
|
|
@click="handleClearGoods(row)">
|
|
|
|
下架商品
|
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
<el-pagination v-model:current-page="cellPagination.currentPage" v-model:page-size="cellPagination.pageSize"
|
2025-05-17 16:38:00 +08:00
|
|
|
:page-sizes="[5, 8, 16, 24, 32]" layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
:total="cellPagination.total" @size-change="handleCellSizeChange" @current-change="handleCellPageChange"
|
|
|
|
class="pagination" />
|
2025-05-15 10:03:15 +08:00
|
|
|
</div>
|
2025-05-19 11:21:47 +08:00
|
|
|
|
|
|
|
<div class="mainboard-details" v-if="activeTab === 'mainboards'">
|
|
|
|
<el-table v-loading="loading" :data="mainboardList" border>
|
|
|
|
<el-table-column label="主板ID" prop="mainboardId" width="80" />
|
|
|
|
<el-table-column label="锁控板序号" prop="lockControlNo" width="120" />
|
|
|
|
<el-table-column label="操作" width="150" fixed="right">
|
|
|
|
<template #default="{ row }">
|
|
|
|
<el-button type="primary" link :icon="useRenderIcon(EditPen)" @click="handleEditMainboard(row)">
|
|
|
|
编辑
|
|
|
|
</el-button>
|
|
|
|
<el-button type="danger" link :icon="useRenderIcon(Delete)" @click="handleDeleteMainboard(row)">
|
|
|
|
删除
|
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
<el-pagination v-model:current-page="mainboardPagination.currentPage"
|
|
|
|
v-model:page-size="mainboardPagination.pageSize" :page-sizes="[5, 8, 16, 24, 32]"
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="mainboardPagination.total"
|
|
|
|
@size-change="handleMainboardSizeChange" @current-change="handleMainboardPageChange" class="pagination" />
|
|
|
|
</div>
|
2025-05-15 10:03:15 +08:00
|
|
|
</el-card>
|
2025-05-17 09:57:22 +08:00
|
|
|
<GatewayConfigModal v-model="gatewayConfigVisible" :cabinet-id="cabinetId" @refresh="fetchCabinetDetail" />
|
2025-05-15 10:03:15 +08:00
|
|
|
<ShopConfigModal v-model="shopConfigVisible" :cabinet-id="cabinetId" @refresh="fetchCabinetDetail" />
|
|
|
|
<MainCabinetConfigModal v-model="mainCabinetConfigVisible" :cabinet-id="cabinetId"
|
|
|
|
@refresh="fetchCabinetDetail" />
|
2025-05-27 15:57:04 +08:00
|
|
|
<el-drawer v-model="editCabinetDrawerVisible"
|
|
|
|
title="编辑柜体" size="30%" direction="rtl">
|
2025-05-21 17:16:30 +08:00
|
|
|
<EditCabinetDrawer v-model="editCabinetDrawerVisible" :cabinet-info="cabinetInfo"
|
|
|
|
@refresh="fetchCabinetDetail" />
|
|
|
|
</el-drawer>
|
2025-05-27 15:57:04 +08:00
|
|
|
<el-drawer v-model="goodsConfigVisible" title="配置商品"
|
|
|
|
size="50%" direction="rtl">
|
2025-05-17 09:57:22 +08:00
|
|
|
<CabinetGoodsConfigModal v-model="goodsConfigVisible" :cell-id="currentCellId" @refresh="fetchCellList" />
|
|
|
|
</el-drawer>
|
2025-05-27 15:57:04 +08:00
|
|
|
<el-drawer v-model="cellFormVisible" title="新增格口"
|
|
|
|
size="30%" direction="rtl">
|
2025-05-21 11:33:21 +08:00
|
|
|
<CellFormModal v-model="cellFormVisible" :initial-cabinet-id="cabinetId" @refresh="fetchCellList" />
|
|
|
|
</el-drawer>
|
2025-05-27 15:57:04 +08:00
|
|
|
<el-drawer v-model="cellEditVisible" title="编辑格口"
|
|
|
|
size="30%" direction="rtl">
|
2025-05-21 11:33:21 +08:00
|
|
|
<CellEditModal v-model="cellEditVisible" :row="currentCell" @refresh="fetchCellList" />
|
|
|
|
</el-drawer>
|
2025-05-15 10:03:15 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
2025-05-27 15:12:49 +08:00
|
|
|
:deep(.el-tabs__header) {
|
|
|
|
margin-bottom: 8px;
|
|
|
|
}
|
2025-05-27 15:57:04 +08:00
|
|
|
|
|
|
|
:deep(.el-drawer__header) {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.el-drawer__body) {
|
|
|
|
padding: 4px;
|
|
|
|
}
|
|
|
|
|
2025-05-27 15:12:49 +08:00
|
|
|
.el-form-item {
|
|
|
|
margin-bottom: 8px;
|
|
|
|
}
|
2025-05-15 10:03:15 +08:00
|
|
|
.detail-container {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
.flex-container {
|
|
|
|
display: flex;
|
|
|
|
flex: 1;
|
2025-05-17 09:57:22 +08:00
|
|
|
gap: 12px;
|
2025-05-15 10:03:15 +08:00
|
|
|
min-height: 0;
|
|
|
|
|
|
|
|
.cabinet-info-card {
|
2025-05-17 09:57:22 +08:00
|
|
|
width: 20%;
|
|
|
|
height: 88vh;
|
2025-05-15 10:03:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.info-card {
|
2025-05-17 09:57:22 +08:00
|
|
|
width: 80%;
|
|
|
|
height: 88vh;
|
|
|
|
overflow-y: auto;
|
2025-05-15 10:03:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.cabinet-header {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
|
|
|
.cabinet-image {
|
|
|
|
width: 100%;
|
|
|
|
height: 420px;
|
|
|
|
object-fit: contain;
|
|
|
|
margin-bottom: 15px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.cabinet-name {
|
|
|
|
font-size: 20px;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.tab-header {
|
2025-05-21 11:33:21 +08:00
|
|
|
margin-bottom: 0px;
|
2025-05-15 10:03:15 +08:00
|
|
|
}
|
|
|
|
}
|
2025-05-27 10:59:54 +08:00
|
|
|
.pagination {
|
|
|
|
margin-top: 10px;
|
|
|
|
}
|
2025-05-15 10:03:15 +08:00
|
|
|
</style>
|