feat(柜体管理): 添加格口价格字段及配置功能
在柜体管理模块中新增格口价格字段,支持在特定模式下配置格口价格。主要修改包括: 1. 在DTO和表单中添加cellPrice字段 2. 在编辑模态框中添加价格输入项 3. 根据shopInfo.mode显示不同的配置按钮 4. 在详情页中根据模式显示格口价格或商品价格
This commit is contained in:
parent
fa5beaa423
commit
73e9afceed
|
@ -36,6 +36,8 @@ export interface CabinetCellDTO {
|
||||||
stock?: number;
|
stock?: number;
|
||||||
/** 历史订单数量 */
|
/** 历史订单数量 */
|
||||||
orderCount?: number;
|
orderCount?: number;
|
||||||
|
/** 商品价格 */
|
||||||
|
cellPrice?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AddCabinetCellCommand {
|
export interface AddCabinetCellCommand {
|
||||||
|
|
|
@ -16,6 +16,7 @@ export interface FormDTO {
|
||||||
availableStatus: number;
|
availableStatus: number;
|
||||||
usageStatus: number;
|
usageStatus: number;
|
||||||
stock: number;
|
stock: number;
|
||||||
|
cellPrice?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -26,6 +27,10 @@ const props = defineProps({
|
||||||
row: {
|
row: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null
|
default: null
|
||||||
|
},
|
||||||
|
mode: {
|
||||||
|
type: Number,
|
||||||
|
default: null
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -40,7 +45,8 @@ const formData = reactive<FormDTO>({
|
||||||
cellType: 1,
|
cellType: 1,
|
||||||
availableStatus: 1,
|
availableStatus: 1,
|
||||||
usageStatus: 1,
|
usageStatus: 1,
|
||||||
stock: 0
|
stock: 0,
|
||||||
|
cellPrice: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
const rules = reactive<FormRules>({
|
const rules = reactive<FormRules>({
|
||||||
|
@ -129,6 +135,10 @@ watch(() => props.row, (val) => {
|
||||||
<el-option label="超大格" :value="4" />
|
<el-option label="超大格" :value="4" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item v-if="props.mode == 3" label="格口价格" class="price-input-item">
|
||||||
|
<el-input v-model="formData.cellPrice" placeholder="请输入格口价格" style="width: 120px; margin-right: 10px;" />
|
||||||
|
元
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item v-if="props.row.goodsId" label="商品ID">
|
<el-form-item v-if="props.row.goodsId" label="商品ID">
|
||||||
<el-input :model-value="props.row.goodsId" disabled />
|
<el-input :model-value="props.row.goodsId" disabled />
|
||||||
|
@ -143,7 +153,7 @@ watch(() => props.row, (val) => {
|
||||||
<el-input :model-value="props.row.price" disabled />
|
<el-input :model-value="props.row.price" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="props.row.goodsId" label="库存" prop="stock">
|
<el-form-item v-if="props.row.goodsId" label="库存" prop="stock">
|
||||||
<el-input-number v-model="formData.stock" :min="0" :max="1000" class="stock-input" />
|
<el-input-number v-model="formData.stock" :min="0" :max="1000" class="stock-input" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
|
@ -161,4 +171,14 @@ watch(() => props.row, (val) => {
|
||||||
.save-btn, .clear-btn {
|
.save-btn, .clear-btn {
|
||||||
margin-right: 10px;
|
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);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -310,7 +310,8 @@ onMounted(() => {
|
||||||
|
|
||||||
<div class="info-details" v-if="activeTab === 'basic'">
|
<div class="info-details" v-if="activeTab === 'basic'">
|
||||||
<div style="display: flex; justify-content: flex-end; margin-bottom: 16px;">
|
<div style="display: flex; justify-content: flex-end; margin-bottom: 16px;">
|
||||||
<el-button v-if="hasPermission('shop:cabinet:write')" type="primary" link :icon="useRenderIcon(EditPen)" @click="editCabinetDrawerVisible = true">
|
<el-button v-if="hasPermission('shop:cabinet:write')" type="primary" link :icon="useRenderIcon(EditPen)"
|
||||||
|
@click="editCabinetDrawerVisible = true">
|
||||||
编辑柜体
|
编辑柜体
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -320,11 +321,13 @@ onMounted(() => {
|
||||||
<el-descriptions-item label="柜体格式">{{ CabinetImgMap[cabinetInfo.templateNo]?.name || '-'
|
<el-descriptions-item label="柜体格式">{{ CabinetImgMap[cabinetInfo.templateNo]?.name || '-'
|
||||||
}}</el-descriptions-item>
|
}}</el-descriptions-item>
|
||||||
<el-descriptions-item label="柜体地址">{{ cabinetInfo.shopName || '-' }}
|
<el-descriptions-item label="柜体地址">{{ cabinetInfo.shopName || '-' }}
|
||||||
<el-button v-if="hasPermission('shop:cabinet:write')" type="success" link @click="shopConfigVisible = true">
|
<el-button v-if="hasPermission('shop:cabinet:write')" type="success" link
|
||||||
|
@click="shopConfigVisible = true">
|
||||||
配置
|
配置
|
||||||
</el-button></el-descriptions-item>
|
</el-button></el-descriptions-item>
|
||||||
<el-descriptions-item label="柜体网关">{{ cabinetInfo.mqttServerId || '-' }}
|
<el-descriptions-item label="柜体网关">{{ cabinetInfo.mqttServerId || '-' }}
|
||||||
<el-button v-if="hasPermission('shop:cabinet:write')" type="warning" link @click="gatewayConfigVisible = true">
|
<el-button v-if="hasPermission('shop:cabinet:write')" type="warning" link
|
||||||
|
@click="gatewayConfigVisible = true">
|
||||||
配置
|
配置
|
||||||
</el-button></el-descriptions-item>
|
</el-button></el-descriptions-item>
|
||||||
<el-descriptions-item label="借呗支付">{{ getBalanceEnableText(shopInfo.balanceEnable)
|
<el-descriptions-item label="借呗支付">{{ getBalanceEnableText(shopInfo.balanceEnable)
|
||||||
|
@ -369,7 +372,7 @@ onMounted(() => {
|
||||||
</svg>
|
</svg>
|
||||||
<div class="cell-info">
|
<div class="cell-info">
|
||||||
<!-- <div class="cell-no">格口号: {{ item.cellNo }}</div> -->
|
<!-- <div class="cell-no">格口号: {{ item.cellNo }}</div> -->
|
||||||
<div class="price">价格: {{ item.price }}</div>
|
<div class="price">价格: {{ shopInfo?.mode == 3 ? item.cellPrice : item.price }}</div>
|
||||||
<div class="stock">库存: {{ item.stock }}</div>
|
<div class="stock">库存: {{ item.stock }}</div>
|
||||||
<!-- <div class="cell-type">类型: {{ switchCellType(item.cellType) }}</div> -->
|
<!-- <div class="cell-type">类型: {{ switchCellType(item.cellType) }}</div> -->
|
||||||
</div>
|
</div>
|
||||||
|
@ -380,16 +383,19 @@ onMounted(() => {
|
||||||
<span class="line-number">{{ item.cellNo }}</span>
|
<span class="line-number">{{ item.cellNo }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="action-buttons">
|
<div class="action-buttons">
|
||||||
<el-button v-if="!item.goodsId" :disabled="!hasPermission('shop:cabinet:write')"
|
<el-button v-if="!item.goodsId && (!shopInfo || shopInfo.mode !== 3)"
|
||||||
link type="success"
|
:disabled="!hasPermission('shop:cabinet:write')" link type="success" @click="handleConfigure(item)"
|
||||||
@click="handleConfigure(item)" class="cell-btn">
|
class="cell-btn">
|
||||||
商品配置
|
商品配置
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="item.goodsId" :disabled="!hasPermission('shop:cabinet:write')"
|
<el-button v-if="item.goodsId" :disabled="!hasPermission('shop:cabinet:write')" link type="primary"
|
||||||
link type="primary"
|
|
||||||
@click="handleEditCell(item)" class="cell-btn">
|
@click="handleEditCell(item)" class="cell-btn">
|
||||||
{{ item.goodsName }}
|
{{ item.goodsName }}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button v-if="!item.goodsId && shopInfo && shopInfo.mode == 3" :disabled="!hasPermission('shop:cabinet:write')" link type="primary"
|
||||||
|
@click="handleEditCell(item)" class="cell-btn">
|
||||||
|
格口配置
|
||||||
|
</el-button>
|
||||||
<!-- <el-button v-if="item.goodsId" type="warning" link :icon="useRenderIcon(EditPen)"
|
<!-- <el-button v-if="item.goodsId" type="warning" link :icon="useRenderIcon(EditPen)"
|
||||||
@click="handleStockConfig(item)">
|
@click="handleStockConfig(item)">
|
||||||
库存
|
库存
|
||||||
|
@ -414,10 +420,12 @@ onMounted(() => {
|
||||||
<el-table-column label="锁控板序号" prop="lockControlNo" width="120" />
|
<el-table-column label="锁控板序号" prop="lockControlNo" width="120" />
|
||||||
<el-table-column label="操作" width="150" fixed="right">
|
<el-table-column label="操作" width="150" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button v-if="hasPermission('shop:cabinet:write')" type="primary" link :icon="useRenderIcon(EditPen)" @click="handleEditMainboard(row)">
|
<el-button v-if="hasPermission('shop:cabinet:write')" type="primary" link :icon="useRenderIcon(EditPen)"
|
||||||
|
@click="handleEditMainboard(row)">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="hasPermission('shop:cabinet:write')" type="danger" link :icon="useRenderIcon(Delete)" @click="handleDeleteMainboard(row)">
|
<el-button v-if="hasPermission('shop:cabinet:write')" type="danger" link :icon="useRenderIcon(Delete)"
|
||||||
|
@click="handleDeleteMainboard(row)">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
|
@ -450,7 +458,7 @@ onMounted(() => {
|
||||||
<CellFormModal v-model="cellFormVisible" :initial-cabinet-id="cabinetId" @refresh="fetchCellList" />
|
<CellFormModal v-model="cellFormVisible" :initial-cabinet-id="cabinetId" @refresh="fetchCellList" />
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
<el-drawer v-model="cellEditVisible" title="编辑格口" size="30%" direction="rtl">
|
<el-drawer v-model="cellEditVisible" title="编辑格口" size="30%" direction="rtl">
|
||||||
<CellEditModal v-model="cellEditVisible" :row="currentCell" @refresh="fetchCellList" />
|
<CellEditModal v-model="cellEditVisible" :row="currentCell" :mode="shopInfo?.mode" @refresh="fetchCellList" />
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue