From 8c2265ccf1bc78a91a43198b1507c81ebd4991b9 Mon Sep 17 00:00:00 2001 From: dzq Date: Sat, 26 Apr 2025 16:09:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=A0=BC=E5=8F=A3?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E8=AE=B0=E5=BD=95=E5=8A=9F=E8=83=BD=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增格口操作记录页面及API接口,支持查看格口开启记录 - 在商品管理页面添加“开启记录”按钮,跳转至操作记录页面 - 优化按钮间距及样式,修复样式文件中多余的空行 - 为CabinetCellDTO接口添加orderCount字段,用于记录购买次数 --- src/api/cabinet/cabinet-cell.ts | 21 ++++ src/api/cabinet/cell-operation.ts | 78 ++++++++++++++ src/style/element-plus.scss | 10 +- src/views/cabinet/operation/index.vue | 144 +++++++++++++++++++++++++ src/views/shop/cabinet-goods/index.vue | 13 ++- 5 files changed, 260 insertions(+), 6 deletions(-) create mode 100644 src/api/cabinet/cell-operation.ts create mode 100644 src/views/cabinet/operation/index.vue diff --git a/src/api/cabinet/cabinet-cell.ts b/src/api/cabinet/cabinet-cell.ts index b0a3f74..7a10763 100644 --- a/src/api/cabinet/cabinet-cell.ts +++ b/src/api/cabinet/cabinet-cell.ts @@ -7,27 +7,48 @@ export interface CabinetCellQuery extends BasePageQuery { } export interface CabinetCellDTO { + /** 格口唯一ID */ cellId?: number; + /** 关联柜机ID */ cabinetId: number; + /** 格口号 */ cellNo: number; + /** 针脚序号 */ pinNo: number; + /** 格口类型(1小格 2中格 3大格 4超大格) */ cellType: number; + /** 使用状态(1空闲 2已占用) */ usageStatus: number; + /** 可用状态(1正常 2故障) */ availableStatus: number; + /** 操作人 */ operator?: string; + /** 关联商品ID */ goodsId?: number; + /** 商品名称 */ goodsName?: string; + /** 商品价格 */ price?: number; + /** 商品封面图 */ coverImg?: string; + /** 库存数量 */ stock?: number; + /** 历史订单数量 */ + orderCount?: number; } export interface AddCabinetCellCommand { + /** 关联柜机ID */ cabinetId: number; + /** 格口号 */ cellNo: number; + /** 针脚序号 */ pinNo: number; + /** 格口类型(1小格 2中格 3大格 4超大格) */ cellType: number; + /** 使用状态(1空闲 2已占用) */ usageStatus: number; + /** 可用状态(1正常 2故障) */ availableStatus: number; } diff --git a/src/api/cabinet/cell-operation.ts b/src/api/cabinet/cell-operation.ts new file mode 100644 index 0000000..f5d826e --- /dev/null +++ b/src/api/cabinet/cell-operation.ts @@ -0,0 +1,78 @@ +import { http } from '@/utils/http'; + +export interface SearchCabinetCellOperationQuery extends BasePageQuery { + /** 关联格口ID */ + cellId?: number; + /** 关联商品ID */ + goodsId?: number; + /** 操作类型(1: 用户操作 2: 管理员操作) */ + operationType?: number; + /** 操作状态(1: 正常 2: 操作失败) */ + status?: number; +} + +export interface CabinetCellOperationDTO { + /** 操作流水号 */ + operationId: number; + /** 关联格口ID */ + cellId: number; + /** 关联商品ID */ + goodsId: number; + /** 商品名称 */ + goodsName: string; + /** 企业微信用户ID */ + userid: string; + /** 是否内部用户(false: 否 true: 是) */ + isInternal: boolean; + /** 成员名称 */ + name: string; + /** 手机号码 */ + mobile: string; + /** 操作类型(1: 用户操作 2: 管理员操作) */ + operationType: number; + /** 操作状态(1: 正常 2: 操作失败) */ + status: number; + /** 状态说明 */ + statusDesc: string; + /** 操作人 */ + operator: string; + /** 创建时间 */ + createTimeStr: string; +} + +export interface AddCabinetCellOperationCommand { + /** 关联格口ID */ + cellId: number; + /** 关联商品ID */ + goodsId: number; + /** 操作类型(1: 用户操作 2: 管理员操作) */ + operationType: number; + /** 操作状态(1: 正常 2: 操作失败) */ + status: number; +} + +export interface UpdateCabinetCellOperationCommand extends AddCabinetCellOperationCommand { + operationId: number; +} + +export const getCabinetCellOperationList = (params?: SearchCabinetCellOperationQuery) => { + return http.request>>('get', '/cabinet/cellOperations', { + params + }); +}; + +export const addCabinetCellOperation = (data: AddCabinetCellOperationCommand) => { + return http.request>('post', '/cabinet/cellOperations', { + data + }); +}; + +export const updateCabinetCellOperation = (operationId: number, data: UpdateCabinetCellOperationCommand) => { + return http.request>('put', `/cabinet/cellOperations/${operationId}`, { + data + }); +}; + +export const deleteCabinetCellOperation = (ids: string) => { + return http.request>('delete', `/cabinet/cellOperations/${ids}`); +}; \ No newline at end of file diff --git a/src/style/element-plus.scss b/src/style/element-plus.scss index 59b0c5f..7c7ffe0 100644 --- a/src/style/element-plus.scss +++ b/src/style/element-plus.scss @@ -37,10 +37,15 @@ } /* 重置 el-button 中 icon 的 margin */ -.reset-margin [class*="el-icon"] + span { +.reset-margin [class*="el-icon"]+span { margin-left: 2px !important; } +/* 移除所有相邻按钮的左侧间距 */ +.el-button+.el-button { + margin-left: 0 !important; +} + /* 自定义 popover 的类名 */ .pure-popper { padding: 0 !important; @@ -93,6 +98,7 @@ } .el-icon { + &.el-dialog__close, &.el-drawer__close, &.el-message-box__close, @@ -168,4 +174,4 @@ padding-bottom: 10px; box-shadow: 0 -1px 0 0 #e0e3e8, 0 -3px 6px 0 rgb(69 98 155 / 12%); } -} +} \ No newline at end of file diff --git a/src/views/cabinet/operation/index.vue b/src/views/cabinet/operation/index.vue new file mode 100644 index 0000000..65b6aff --- /dev/null +++ b/src/views/cabinet/operation/index.vue @@ -0,0 +1,144 @@ + + + + + \ No newline at end of file diff --git a/src/views/shop/cabinet-goods/index.vue b/src/views/shop/cabinet-goods/index.vue index 7dd41b7..cca9a50 100644 --- a/src/views/shop/cabinet-goods/index.vue +++ b/src/views/shop/cabinet-goods/index.vue @@ -37,7 +37,7 @@ const pagination = ref({ }); const loading = ref(false); -const dataList = ref([]); +const dataList = ref([]); const multipleSelection = ref([]); const currentRow = ref(); const configVisible = ref(false); @@ -275,17 +275,22 @@ const handleClearGoods = async (row: CabinetCellDTO) => { - + + @@ -315,7 +320,7 @@ const handleClearGoods = async (row: CabinetCellDTO) => { -