Compare commits
5 Commits
aa9a89c5c5
...
e35e88d0d8
Author | SHA1 | Date |
---|---|---|
|
e35e88d0d8 | |
|
994e4c9538 | |
|
1855bca307 | |
|
363721b0c2 | |
|
c8b44f3620 |
|
@ -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 {
|
||||
|
|
|
@ -49,6 +49,8 @@ export interface SmartCabinetDTO {
|
|||
mode?: number;
|
||||
/** 借呗支付(1-正常使用 0-禁止使用) */
|
||||
balanceEnable?: number;
|
||||
/** 归还期限(天),0表示不限制 */
|
||||
returnDeadline?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -105,6 +105,12 @@ export interface OrderDTO {
|
|||
* 多个商品封面图用逗号分隔
|
||||
*/
|
||||
coverImgs?: string;
|
||||
/**
|
||||
* 退还状态
|
||||
* @remarks
|
||||
* 0-未退还 | 1-已退还
|
||||
*/
|
||||
returnStatus?: number;
|
||||
}
|
||||
|
||||
export const getOrderListApi = (params?: OrderQuery) => {
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
});
|
||||
};
|
|
@ -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)">
|
||||
库存
|
||||
|
|
|
@ -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="请选择商品模式">
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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 },
|
||||
|
|
Loading…
Reference in New Issue