feat(rental): 添加退还格口功能并扩展格口实体

- 在租赁页面添加退还格口按钮及处理函数
- 扩展 RetingCellEntity 接口添加 orderId 和 orderGoodsId 字段
- 更新 LockerItem 接口和格口列表映射逻辑
This commit is contained in:
dzq 2025-07-02 16:23:09 +08:00
parent 32f90300c8
commit 602c6b6b82
2 changed files with 27 additions and 2 deletions

View File

@ -14,7 +14,12 @@ export interface RentingCabinetDetailDTO {
/** 锁控编号 */ /** 锁控编号 */
lockControlNo: number lockControlNo: number
/** 柜格列表 */ /** 柜格列表 */
cells: CabinetCellEntity[] cells: RetingCellEntity[]
}
export interface RetingCellEntity extends CabinetCellEntity {
orderId: number;
orderGoodsId: number;
} }
/** 智能柜格口实体类 */ /** 智能柜格口实体类 */

View File

@ -28,6 +28,10 @@
</div> </div>
</div> </div>
<div class="button-group"> <div class="button-group">
<van-button size="small" plain hairline :loading="openingLockerId === locker.lockerId"
@click="handleRefund(locker.orderId, locker.orderGoodsId)">
退还格口
</van-button>
<van-button size="small" plain hairline :loading="openingLockerId === locker.lockerId" <van-button size="small" plain hairline :loading="openingLockerId === locker.lockerId"
@click="handleOpenLocker(locker)"> @click="handleOpenLocker(locker)">
开启格口 开启格口
@ -51,6 +55,7 @@ import { publicPath } from "@/common/utils/path";
import { showDialog, showToast } from 'vant'; import { showDialog, showToast } from 'vant';
import { useAb98UserStore } from '@/pinia/stores/ab98-user'; import { useAb98UserStore } from '@/pinia/stores/ab98-user';
const router = useRouter();
const wxStore = useWxStore(); const wxStore = useWxStore();
const { userid: userid, qyUserId: qyUserId, name: qyName, corpid, ab98User } = storeToRefs(wxStore); const { userid: userid, qyUserId: qyUserId, name: qyName, corpid, ab98User } = storeToRefs(wxStore);
@ -79,6 +84,8 @@ interface LockerItem {
goodsName?: string goodsName?: string
price?: number price?: number
coverImg?: string coverImg?: string
orderId: number;
orderGoodsId: number;
} }
// //
@ -116,7 +123,9 @@ const updateLockerList = (cabinet: RentingCabinetDetailDTO) => {
// //
goodsName: '', goodsName: '',
price: cell.cellPrice, price: cell.cellPrice,
coverImg: `${publicPath}img/product-image.svg` coverImg: `${publicPath}img/product-image.svg`,
orderId: cell.orderId,
orderGoodsId: cell.orderGoodsId,
})) }))
} }
@ -147,6 +156,17 @@ const handleOpenLocker = async (locker: LockerItem) => {
} }
} }
const handleRefund = (orderId: number, orderGoodsId: number) => {
router.push({
path: '/approval/submit',
query: {
orderGoodsId,
orderId,
}
})
}
// //
const init = async () => { const init = async () => {
await loadUserRentedCabinetDetail(); await loadUserRentedCabinetDetail();