Compare commits

..

No commits in common. "e35e88d0d80672c7b2832d2f9baebb01e687b172" and "aa9a89c5c5df4a3a77511aa55bf906f956107997" have entirely different histories.

8 changed files with 12 additions and 98 deletions

View File

@ -38,20 +38,6 @@ export interface CabinetCellDTO {
orderCount?: number; orderCount?: number;
/** 商品价格 */ /** 商品价格 */
cellPrice?: 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 { export interface AddCabinetCellCommand {

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, computed } from "vue"; import { ref, onMounted } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import { getSmartCabinetDetailApi, type SmartCabinetDTO, getBalanceEnableText } from "@/api/cabinet/smart-cabinet"; import { getSmartCabinetDetailApi, type SmartCabinetDTO, getBalanceEnableText } from "@/api/cabinet/smart-cabinet";
import { CabinetCellQuery, changeGoodsCellsStock, clearGoodsCells, getCabinetCellList, type CabinetCellDTO } from "@/api/cabinet/cabinet-cell"; import { CabinetCellQuery, changeGoodsCellsStock, clearGoodsCells, getCabinetCellList, type CabinetCellDTO } from "@/api/cabinet/cabinet-cell";
@ -24,8 +24,6 @@ import EditCabinetDrawer from "./edit-cabinet-drawer.vue";
import { CabinetMainboardDTO, deleteMainboard, getMainboardList, updateMainboard } from "@/api/cabinet/mainboards"; import { CabinetMainboardDTO, deleteMainboard, getMainboardList, updateMainboard } from "@/api/cabinet/mainboards";
import { getShopById, ShopDTO, getModeText } from "@/api/shop/shop"; import { getShopById, ShopDTO, getModeText } from "@/api/shop/shop";
import { useBtnPermissionStore } from "@/store/modules/btnPermission"; import { useBtnPermissionStore } from "@/store/modules/btnPermission";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { modeToPaymentMethodMap, paymentMethodOptions } from "@/utils/maps/payment";
defineOptions({ defineOptions({
name: "SmartCabinetDetail" name: "SmartCabinetDetail"
@ -83,15 +81,6 @@ const currentCellId = ref<number>();
const cellFormVisible = ref(false); const cellFormVisible = ref(false);
const cellEditVisible = 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) { function handleConfigure(row: CabinetCellDTO) {
if (row.goodsId) { if (row.goodsId) {
currentCell.value = row; currentCell.value = row;
@ -279,26 +268,6 @@ 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(() => { onMounted(() => {
cabinetId.value = Number(route.query.id); cabinetId.value = Number(route.query.id);
fetchCabinetDetail(); fetchCabinetDetail();
@ -361,16 +330,11 @@ onMounted(() => {
@click="gatewayConfigVisible = true"> @click="gatewayConfigVisible = true">
配置 配置
</el-button></el-descriptions-item> </el-button></el-descriptions-item>
<el-descriptions-item label="支付方式"> <el-descriptions-item label="借呗支付">{{ getBalanceEnableText(shopInfo.balanceEnable)
<el-tag v-for="method in currentPaymentMethods" :key="method.label" :type="method.type" }}</el-descriptions-item>
style="margin-right: 5px;">
{{ method.label }}
</el-tag>
</el-descriptions-item>
<!-- <el-descriptions-item label="商品模式"> <!-- <el-descriptions-item label="商品模式">
{{ cabinetInfo.belongType === 0 ? '借还模式' : '固资模式' }} {{ cabinetInfo.belongType === 0 ? '借还模式' : '固资模式' }}
</el-descriptions-item> --> </el-descriptions-item> -->
<el-descriptions-item label="归还期限">{{ cabinetInfo.returnDeadline === 0 ? '不限制' : cabinetInfo.returnDeadline + '天' }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</div> </div>
@ -396,8 +360,7 @@ onMounted(() => {
<el-card class="cell-card" :body-style="{ padding: '8px 10px' }"> <el-card class="cell-card" :body-style="{ padding: '8px 10px' }">
<div class="card-content"> <div class="card-content">
<el-image v-if="item.coverImg" :src="item.coverImg" class="cell-image" fit="contain" /> <el-image v-if="item.coverImg" :src="item.coverImg" class="cell-image" fit="contain" />
<el-image v-if="item.faceImg" :src="item.faceImg" class="cell-image" fit="contain" /> <svg v-if="!item.coverImg" width="80" height="80" viewBox="0 0 100 100"
<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"> 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" /> <rect x="5" y="5" width="90" height="90" rx="10" fill="#E8F5E9" stroke="#81C784" stroke-width="2" />
<!-- 添加在矩形和文本之间的虚线 --> <!-- 添加在矩形和文本之间的虚线 -->
@ -429,15 +392,10 @@ onMounted(() => {
@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 && !item.isRented && shopInfo && shopInfo.mode == 3" <el-button v-if="!item.goodsId && shopInfo && shopInfo.mode == 3" :disabled="!hasPermission('shop:cabinet:write')" link type="primary"
:disabled="!hasPermission('shop:cabinet:write')" link type="primary" @click="handleEditCell(item)" @click="handleEditCell(item)" class="cell-btn">
class="cell-btn">
格口配置 格口配置
</el-button> </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)" <!-- <el-button v-if="item.goodsId" type="warning" link :icon="useRenderIcon(EditPen)"
@click="handleStockConfig(item)"> @click="handleStockConfig(item)">
库存 库存

View File

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

View File

@ -232,13 +232,6 @@ getList();
</el-tag> </el-tag>
</template> </template>
</el-table-column> </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"> <el-table-column label="支付方式" prop="paymentMethod" width="120">
<template #default="{ row }"> <template #default="{ row }">
{{ { wechat: '微信支付', balance: '借呗支付' }[row.paymentMethod] || row.paymentMethod }} {{ { wechat: '微信支付', balance: '借呗支付' }[row.paymentMethod] || row.paymentMethod }}

View File

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