feat(智能柜): 增加柜格租赁相关字段和用户详情跳转功能

在 CabinetCellDTO 中新增租赁相关字段,包括租赁状态、订单信息和用户信息
添加 handleAb98ViewDetail 方法处理用户详情页跳转,并显示租赁用户信息
修改柜格卡片显示逻辑,支持展示租赁用户头像和姓名
This commit is contained in:
dzq 2025-07-01 11:38:35 +08:00
parent c8b44f3620
commit 363721b0c2
2 changed files with 45 additions and 3 deletions

View File

@ -38,6 +38,20 @@ export interface CabinetCellDTO {
orderCount?: number;
/** 商品价格 */
cellPrice?: number;
/** 是否已租用0-未租用1-已租用 */
isRented?: number;
/** 关联订单商品ID */
orderGoodsId?: number;
/** 关联订单ID */
orderId?: number;
/** 购买人姓名 */
name?: string;
/** 购买人手机号 */
mobile?: string;
/** 购买人人脸图片 */
faceImg?: string;
/** 购买人98ab用户ID */
ab98UserId?: number;
}
export interface AddCabinetCellCommand {

View File

@ -24,6 +24,7 @@ import EditCabinetDrawer from "./edit-cabinet-drawer.vue";
import { CabinetMainboardDTO, deleteMainboard, getMainboardList, updateMainboard } from "@/api/cabinet/mainboards";
import { getShopById, ShopDTO, getModeText } from "@/api/shop/shop";
import { useBtnPermissionStore } from "@/store/modules/btnPermission";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
defineOptions({
name: "SmartCabinetDetail"
@ -268,6 +269,26 @@ async function handleDeleteMainboard(row: CabinetMainboardDTO) {
}
}
const handleAb98ViewDetail = (ab98UserId: number, name: string) => {
//
useMultiTagsStoreHook().handleTags("push", {
path: `/user/ab98/detail`,
name: "ab98Detail",
query: { id: ab98UserId },
meta: {
title: `${name}`,
dynamicLevel: 3
}
});
router.push({
path: '/user/ab98/detail',
query: {
id: ab98UserId
}
});
};
onMounted(() => {
cabinetId.value = Number(route.query.id);
fetchCabinetDetail();
@ -360,7 +381,8 @@ onMounted(() => {
<el-card class="cell-card" :body-style="{ padding: '8px 10px' }">
<div class="card-content">
<el-image v-if="item.coverImg" :src="item.coverImg" class="cell-image" fit="contain" />
<svg v-if="!item.coverImg" width="80" height="80" viewBox="0 0 100 100"
<el-image v-if="item.faceImg" :src="item.faceImg" class="cell-image" fit="contain" />
<svg v-if="!item.coverImg && !item.faceImg" width="80" height="80" viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg" class="cell-image">
<rect x="5" y="5" width="90" height="90" rx="10" fill="#E8F5E9" stroke="#81C784" stroke-width="2" />
<!-- 添加在矩形和文本之间的虚线 -->
@ -392,10 +414,16 @@ onMounted(() => {
@click="handleEditCell(item)" class="cell-btn">
{{ item.goodsName }}
</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 v-if="!item.goodsId && !item.isRented && 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 && item.isRented && shopInfo && shopInfo.mode == 3"
link type="primary" @click="handleAb98ViewDetail(item.ab98UserId, item.name)"
class="cell-btn">
{{ item.name }}
</el-button>
<!-- <el-button v-if="item.goodsId" type="warning" link :icon="useRenderIcon(EditPen)"
@click="handleStockConfig(item)">
库存