feat: 在开柜接口中添加格口ID并更新操作类型

在OpenCabinetApiData接口中添加了格口ID字段,并更新了多个页面中的操作类型值,以支持不同的操作场景。此外,开柜接口现在支持传递完整的开柜数据,确保操作信息的完整性。
This commit is contained in:
dzq 2025-04-22 17:47:25 +08:00
parent 627d9b557c
commit 168069f6a1
6 changed files with 20 additions and 8 deletions

View File

@ -1,5 +1,6 @@
import { request } from '@/http/axios'
import type { CabinetDetailResponse } from './type'
import { OpenCabinetApiData } from '../shop/type'
/** 获取智能柜详情接口 */
export function getCabinetDetailApi() {
@ -9,9 +10,10 @@ export function getCabinetDetailApi() {
})
}
export function openCabinet(lockControlNo: number, pinNo: number) {
export function openCabinet(lockControlNo: number, pinNo: number, data: OpenCabinetApiData) {
return request<ApiResponseData<void>>({
url: `cabinet/openCabinet/${lockControlNo}/${pinNo}`,
method: 'post'
method: 'post',
data
})
}

View File

@ -111,6 +111,8 @@ export interface QyLoginDTO {
}
export interface OpenCabinetApiData {
// 格口ID
cellId?: number
// 用户ID
userid: string
// 是否内部用户0否 1汇邦云用户 2企业微信用户

View File

@ -200,7 +200,7 @@ const handleOpenCabinet = async () => {
isInternal: isInternal,
name: isInternal === 2 ? qyName.value : name.value,
mobile: tel.value,
operationType: 0
operationType: 2
}
)
if (result.code !== 0) {

View File

@ -56,10 +56,11 @@
import { ref } from 'vue'
import { getCabinetDetailApi, openCabinet } from '@/common/apis/cabinet'
import type { CabinetDetailDTO } from '@/common/apis/cabinet/type'
import { useWxStoreOutside } from '@/pinia/stores/wx'
import { useWxStore, useWxStoreOutside } from '@/pinia/stores/wx'
import { publicPath } from "@/common/utils/path"
const wxStore = useWxStoreOutside()
const wxStore = useWxStore();
const { userid: qyUserid, name: qyName } = storeToRefs(wxStore);
const activeCabinet = ref(0)
const cabinetList = ref<CabinetItem[]>([])
@ -132,7 +133,14 @@ const handleOpenLocker = async (locker: LockerItem) => {
openingLockerId.value = locker.lockerId
try {
//
await openCabinet(cabinetList.value[activeCabinet.value].lockControlNo, locker.lockerNumber)
await openCabinet(cabinetList.value[activeCabinet.value].lockControlNo, locker.lockerNumber, {
cellId: locker.lockerId,
userid: qyUserid.value,
isInternal: 2,
name: qyName.value,
mobile: '',
operationType: 2
})
} catch (error) {
console.error('打开柜口失败:', error)
} finally {

View File

@ -29,7 +29,7 @@ async function handleOpenCabinet(orderId: number, orderGoodsId: number) {
isInternal: isInternal,
name: isInternal === 2 ? qyName.value : name.value,
mobile: tel.value,
operationType: 0
operationType: 1
});
if (result.code !== 0) {
showFailToast(result.msg || '开启失败,请稍后重试')

View File

@ -78,7 +78,7 @@ async function handleOpenCabinet(item: OrderGoods) {
isInternal: isInternal,
name: isInternal === 2 ? qyName.value : name.value,
mobile: tel.value,
operationType: 0
operationType: 1
})
if (result.code !== 0) {
showFailToast(result.msg || '开启失败,请稍后重试')