From 73e9afceeda5ceed9bd94ca8000a6812a5ac13b3 Mon Sep 17 00:00:00 2001 From: dzq Date: Thu, 26 Jun 2025 11:40:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=9F=9C=E4=BD=93=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=BC=E5=8F=A3=E4=BB=B7=E6=A0=BC=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=8F=8A=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在柜体管理模块中新增格口价格字段,支持在特定模式下配置格口价格。主要修改包括: 1. 在DTO和表单中添加cellPrice字段 2. 在编辑模态框中添加价格输入项 3. 根据shopInfo.mode显示不同的配置按钮 4. 在详情页中根据模式显示格口价格或商品价格 --- src/api/cabinet/cabinet-cell.ts | 2 ++ .../cabinet/cabinet-cell/cell-edit-modal.vue | 24 ++++++++++++-- .../cabinet/smart-cabinet-card/detail.vue | 32 ++++++++++++------- 3 files changed, 44 insertions(+), 14 deletions(-) diff --git a/src/api/cabinet/cabinet-cell.ts b/src/api/cabinet/cabinet-cell.ts index 095e9c5..352f55f 100644 --- a/src/api/cabinet/cabinet-cell.ts +++ b/src/api/cabinet/cabinet-cell.ts @@ -36,6 +36,8 @@ export interface CabinetCellDTO { stock?: number; /** 历史订单数量 */ orderCount?: number; + /** 商品价格 */ + cellPrice?: number; } export interface AddCabinetCellCommand { diff --git a/src/views/cabinet/cabinet-cell/cell-edit-modal.vue b/src/views/cabinet/cabinet-cell/cell-edit-modal.vue index e0eff53..b743ec5 100644 --- a/src/views/cabinet/cabinet-cell/cell-edit-modal.vue +++ b/src/views/cabinet/cabinet-cell/cell-edit-modal.vue @@ -16,6 +16,7 @@ export interface FormDTO { availableStatus: number; usageStatus: number; stock: number; + cellPrice?: number; } const props = defineProps({ @@ -26,6 +27,10 @@ const props = defineProps({ row: { type: Object, default: null + }, + mode: { + type: Number, + default: null } }); @@ -40,7 +45,8 @@ const formData = reactive({ cellType: 1, availableStatus: 1, usageStatus: 1, - stock: 0 + stock: 0, + cellPrice: 0 }); const rules = reactive({ @@ -129,6 +135,10 @@ watch(() => props.row, (val) => { + + + 元 + @@ -143,7 +153,7 @@ watch(() => props.row, (val) => { - + @@ -161,4 +171,14 @@ watch(() => props.row, (val) => { .save-btn, .clear-btn { margin-right: 10px; } +.price-input-item .el-input__wrapper { + border-radius: 6px; + border-color: #dcdfe6; + box-shadow: 0 0 0 0 rgba(144, 147, 153, 0); + transition: all 0.3s; +} +.price-input-item .el-input__wrapper:focus-within { + border-color: #409eff; + box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2); +} \ 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 b5e435b..fcc3f29 100644 --- a/src/views/cabinet/smart-cabinet-card/detail.vue +++ b/src/views/cabinet/smart-cabinet-card/detail.vue @@ -310,7 +310,8 @@ onMounted(() => {
- + 编辑柜体
@@ -320,11 +321,13 @@ onMounted(() => { {{ CabinetImgMap[cabinetInfo.templateNo]?.name || '-' }} {{ cabinetInfo.shopName || '-' }} - + 配置 {{ cabinetInfo.mqttServerId || '-' }} - + 配置 {{ getBalanceEnableText(shopInfo.balanceEnable) @@ -369,7 +372,7 @@ onMounted(() => {
-
价格: {{ item.price }}
+
价格: {{ shopInfo?.mode == 3 ? item.cellPrice : item.price }}
库存: {{ item.stock }}
@@ -380,16 +383,19 @@ onMounted(() => { {{ item.cellNo }}
- + 商品配置 - {{ item.goodsName }} + + 格口配置 +