From 9d5f8857668eb5f72d9ce9330cc608d0ec11d281 Mon Sep 17 00:00:00 2001 From: dzq Date: Wed, 4 Jun 2025 11:50:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=99=BA=E8=83=BD=E6=9F=9C=E7=AE=A1?= =?UTF-8?q?=E7=90=86):=20=E9=87=8D=E6=9E=84=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86=E7=95=8C=E9=9D=A2=E5=B9=B6?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E5=93=81=E9=85=8D=E7=BD=AE=E6=A8=A1?= =?UTF-8?q?=E6=80=81=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将单元格列表从表格布局改为卡片式布局,提升可视化效果 - 新增商品配置模态框用于管理已配置商品的库存和下架操作 - 优化单元格编辑模态框,增加商品信息展示和库存修改功能 - 添加默认商品图片占位符 - 调整分页参数和样式,优化移动端显示效果 --- public/img/product-image.svg | 6 + .../cabinet/cabinet-cell/cell-edit-modal.vue | 72 ++++--- .../configured-goods-modal.vue | 117 +++++++++++ .../cabinet/smart-cabinet-card/detail.vue | 188 +++++++++++------- 4 files changed, 288 insertions(+), 95 deletions(-) create mode 100644 public/img/product-image.svg create mode 100644 src/views/cabinet/smart-cabinet-card/configured-goods-modal.vue diff --git a/public/img/product-image.svg b/public/img/product-image.svg new file mode 100644 index 0000000..f12a898 --- /dev/null +++ b/public/img/product-image.svg @@ -0,0 +1,6 @@ + + + 空闲 + \ No newline at end of file diff --git a/src/views/cabinet/cabinet-cell/cell-edit-modal.vue b/src/views/cabinet/cabinet-cell/cell-edit-modal.vue index 7537c76..e0eff53 100644 --- a/src/views/cabinet/cabinet-cell/cell-edit-modal.vue +++ b/src/views/cabinet/cabinet-cell/cell-edit-modal.vue @@ -1,8 +1,8 @@ + + + + \ No newline at end of file diff --git a/src/views/cabinet/smart-cabinet-card/detail.vue b/src/views/cabinet/smart-cabinet-card/detail.vue index bd7742c..9d6aac8 100644 --- a/src/views/cabinet/smart-cabinet-card/detail.vue +++ b/src/views/cabinet/smart-cabinet-card/detail.vue @@ -9,6 +9,7 @@ import GatewayConfigModal from "@/views/cabinet/smart-cabinet/GatewayConfigModal import ShopConfigModal from "@/views/cabinet/smart-cabinet/ShopConfigModal.vue"; import MainCabinetConfigModal from "@/views/cabinet/smart-cabinet/MainCabinetConfigModal.vue"; import CabinetGoodsConfigModal from "@/views/shop/cabinet-goods/cabinet-goods-config-modal.vue"; +import ConfiguredGoodsModal from "./configured-goods-modal.vue"; import { ElMessage, ElMessageBox } from "element-plus"; const { VITE_PUBLIC_IMG_PATH: IMG_PATH } = import.meta.env; import EditPen from "@iconify-icons/ep/edit-pen"; @@ -54,18 +55,24 @@ const searchCellParams = ref({ goodsName: null }); const cellPagination = ref({ - pageSize: 5, + pageSize: 18, currentPage: 1, total: 0 }); const goodsConfigVisible = ref(false); +const configuredGoodsVisible = ref(false); const currentCellId = ref(); const cellFormVisible = ref(false); const cellEditVisible = ref(false); function handleConfigure(row: CabinetCellDTO) { - currentCellId.value = row.cellId; - goodsConfigVisible.value = true; + if (row.goodsId) { + currentCell.value = row; + configuredGoodsVisible.value = true; + } else { + currentCellId.value = row.cellId; + goodsConfigVisible.value = true; + } } async function handleStockConfig(row: CabinetCellDTO) { @@ -259,7 +266,8 @@ onMounted(() => { {{ cabinetInfo.cabinetName }} {{ getModeText(cabinetInfo.mode) }} - {{ CabinetImgMap[cabinetInfo.templateNo]?.name || '-' }} + {{ CabinetImgMap[cabinetInfo.templateNo]?.name || '-' + }} {{ cabinetInfo.usedCells || '0' }} {{ cabinetInfo.availableCells || '0' }} {{ cabinetInfo.shopName || '-' }} @@ -285,17 +293,17 @@ onMounted(() => { {{ cabinetInfo.cabinetName || '-' }} {{ getModeText(cabinetInfo.mode) }} {{ CabinetImgMap[cabinetInfo.templateNo]?.name || '-' - }} + }} {{ cabinetInfo.shopName || '-' }} 配置 {{ cabinetInfo.mqttServerId || '-' }} - + 配置 - {{ getBalanceEnableText(cabinetInfo.balanceEnable) }} + {{ getBalanceEnableText(cabinetInfo.balanceEnable) + }} @@ -314,74 +322,48 @@ onMounted(() => { 搜索 - - - 重置 - - - - - - - - - - - - - - - - - - - - - - - - - + + + +
+ +
+
格口号: {{ item.cellNo }}
+
{{ item.goodsId ? item.goodsName : '未配置商品' }}
+
价格: {{ item.price }}
+
库存: {{ item.stock }}
+
类型: {{ switchCellType(item.cellType) }}
+
+
+
+ + 商品配置 + + + 编辑格口 + + +
+
+
+
@@ -418,6 +400,11 @@ onMounted(() => { + + + @@ -429,6 +416,65 @@ onMounted(() => {