Compare commits

..

5 Commits

Author SHA1 Message Date
dzq e35e88d0d8 feat(智能柜): 添加归还期限字段及表单展示
在智能柜DTO中新增returnDeadline字段表示归还期限
在详情页和编辑表单中添加归还期限的显示和输入功能
0表示不限制归还期限,正整数表示具体天数
2025-07-19 17:43:46 +08:00
dzq 994e4c9538 feat(订单): 添加退还状态字段及展示
在订单DTO中新增退还状态字段,并在订单列表页面添加退还状态的表格列展示。退还状态分为未退还(0)和已退还(1)两种状态,分别用不同样式的标签显示。
2025-07-16 09:35:02 +08:00
dzq 1855bca307 feat(智能柜详情): 添加支付方式显示功能
在智能柜详情页面中,新增计算属性 currentPaymentMethods 用于根据店铺模式显示对应的支付方式标签。替换原有的借呗支付显示为多种支付方式的标签展示,提升用户体验。
2025-07-07 08:51:03 +08:00
dzq 363721b0c2 feat(智能柜): 增加柜格租赁相关字段和用户详情跳转功能
在 CabinetCellDTO 中新增租赁相关字段,包括租赁状态、订单信息和用户信息
添加 handleAb98ViewDetail 方法处理用户详情页跳转,并显示租赁用户信息
修改柜格卡片显示逻辑,支持展示租赁用户头像和姓名
2025-07-01 11:38:35 +08:00
dzq c8b44f3620 fix: 修复获取统计数据时缺少corpid参数的问题
在获取统计数据时添加corpid参数,确保接口请求正确过滤对应企业的数据
2025-07-01 08:27:27 +08:00
8 changed files with 98 additions and 12 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

@ -49,6 +49,8 @@ export interface SmartCabinetDTO {
mode?: number;
/** 借呗支付1-正常使用 0-禁止使用) */
balanceEnable?: number;
/** 归还期限0表示不限制 */
returnDeadline?: number;
}
/**

View File

@ -105,6 +105,12 @@ export interface OrderDTO {
*
*/
coverImgs?: string;
/**
* 退
* @remarks
* 0-退 | 1-退
*/
returnStatus?: number;
}
export const getOrderListApi = (params?: OrderQuery) => {

View File

@ -78,6 +78,10 @@ export interface StatsDTO {
*
* @returns
*/
export const getStats = () => {
return http.request<ResponseData<StatsDTO>>('get', '/shop/shops/Stats');
export const getStats = (corpid: string) => {
return http.request<ResponseData<StatsDTO>>('get', '/shop/shops/Stats', {
params: {
corpid,
},
});
};

View File

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { ref, onMounted, computed } from "vue";
import { useRoute, useRouter } from "vue-router";
import { getSmartCabinetDetailApi, type SmartCabinetDTO, getBalanceEnableText } from "@/api/cabinet/smart-cabinet";
import { CabinetCellQuery, changeGoodsCellsStock, clearGoodsCells, getCabinetCellList, type CabinetCellDTO } from "@/api/cabinet/cabinet-cell";
@ -24,6 +24,8 @@ 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";
import { modeToPaymentMethodMap, paymentMethodOptions } from "@/utils/maps/payment";
defineOptions({
name: "SmartCabinetDetail"
@ -81,6 +83,15 @@ const currentCellId = ref<number>();
const cellFormVisible = ref(false);
const cellEditVisible = ref(false);
const currentPaymentMethods = computed(() => {
if (typeof shopInfo.value.mode !== 'number') return [];
const methodValues = modeToPaymentMethodMap[shopInfo.value.mode] || [];
return methodValues.map(value => {
const option = paymentMethodOptions.find(item => item.value === value);
return option ? { label: option.label, type: option.type } : null;
}).filter(Boolean);
});
function handleConfigure(row: CabinetCellDTO) {
if (row.goodsId) {
currentCell.value = row;
@ -268,6 +279,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();
@ -330,11 +361,16 @@ onMounted(() => {
@click="gatewayConfigVisible = true">
配置
</el-button></el-descriptions-item>
<el-descriptions-item label="借呗支付">{{ getBalanceEnableText(shopInfo.balanceEnable)
}}</el-descriptions-item>
<el-descriptions-item label="支付方式">
<el-tag v-for="method in currentPaymentMethods" :key="method.label" :type="method.type"
style="margin-right: 5px;">
{{ method.label }}
</el-tag>
</el-descriptions-item>
<!-- <el-descriptions-item label="商品模式">
{{ cabinetInfo.belongType === 0 ? '借还模式' : '固资模式' }}
</el-descriptions-item> -->
<el-descriptions-item label="归还期限">{{ cabinetInfo.returnDeadline === 0 ? '不限制' : cabinetInfo.returnDeadline + '天' }}</el-descriptions-item>
</el-descriptions>
</div>
@ -360,7 +396,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 +429,15 @@ 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)">
库存

View File

@ -2,7 +2,7 @@
import { ref, reactive, watch } from "vue";
import { ElMessage } from "element-plus";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import { updateSmartCabinet } from "@/api/cabinet/smart-cabinet";
import { SmartCabinetDTO, updateSmartCabinet } from "@/api/cabinet/smart-cabinet";
import Confirm from "@iconify-icons/ep/check";
import type { FormRules } from 'element-plus';
import { CabinetImgMap } from "@/utils/cabinetImgMap";
@ -22,7 +22,7 @@ const props = defineProps({
const emit = defineEmits(["update:modelValue", "refresh"]);
const formRef = ref();
const formData = reactive({
const formData = reactive<SmartCabinetDTO>({
cabinetName: "",
cabinetType: 1,
templateNo: "",
@ -30,7 +30,8 @@ const formData = reactive({
location: 0,
belongType: 0,
mode: 0,
balanceEnable: 1
balanceEnable: 1,
returnDeadline: 0
});
const rules = reactive<FormRules>({
@ -52,6 +53,10 @@ const rules = reactive<FormRules>({
],
balanceEnable: [
{ required: true, message: "请选择借呗支付状态", trigger: "change" }
],
returnDeadline: [
{ required: true, message: "请输入归还期限", trigger: "blur" },
{ type: 'number', min: 0, message: '归还期限不能为负数', trigger: 'blur' }
]
});
@ -112,6 +117,12 @@ watch(() => props.cabinetInfo, (newVal) => {
<el-option v-for="option in templateOptions" :key="option.value" :label="option.label" :value="option.value" />
</el-select>
</el-form-item>
<el-form-item label="归还期限" prop="returnDeadline">
<div style="width: 200px; display: flex; align-items: center;">
<el-input v-model.number="formData.returnDeadline" :min="0" type="number" placeholder="0表示不限制" style="margin-right: 8px;" />
<span></span>
</div>
</el-form-item>
<!-- <el-form-item label="商品模式" prop="belongType">
<el-select v-model="formData.belongType" placeholder="请选择商品模式">

View File

@ -232,6 +232,13 @@ getList();
</el-tag>
</template>
</el-table-column>
<el-table-column label="退还状态" prop="returnStatus" width="120">
<template #default="{ row }">
<el-tag :type="row.returnStatus === 1 ? 'success' : 'info'">
{{ { 0: '未退还', 1: '已退还' }[row.returnStatus] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="支付方式" prop="paymentMethod" width="120">
<template #default="{ row }">
{{ { wechat: '微信支付', balance: '借呗支付' }[row.paymentMethod] || row.paymentMethod }}

View File

@ -64,7 +64,7 @@ const handleSubmit = async () => {
onMounted(async () => {
try {
const { data } = await getStats();
const { data } = await getStats(wxStore.corpid);
shopData.value = [
{ name: '商店', icon: markRaw(Shop), value: data.shopCount },
{ name: '商品总数量', icon: markRaw(Goods), value: data.goodsCount },