feat: 在开柜接口中添加格口ID并更新操作类型
在OpenCabinetApiData接口中添加了格口ID字段,并更新了多个页面中的操作类型值,以支持不同的操作场景。此外,开柜接口现在支持传递完整的开柜数据,确保操作信息的完整性。
This commit is contained in:
parent
627d9b557c
commit
168069f6a1
|
@ -1,5 +1,6 @@
|
||||||
import { request } from '@/http/axios'
|
import { request } from '@/http/axios'
|
||||||
import type { CabinetDetailResponse } from './type'
|
import type { CabinetDetailResponse } from './type'
|
||||||
|
import { OpenCabinetApiData } from '../shop/type'
|
||||||
|
|
||||||
/** 获取智能柜详情接口 */
|
/** 获取智能柜详情接口 */
|
||||||
export function getCabinetDetailApi() {
|
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>>({
|
return request<ApiResponseData<void>>({
|
||||||
url: `cabinet/openCabinet/${lockControlNo}/${pinNo}`,
|
url: `cabinet/openCabinet/${lockControlNo}/${pinNo}`,
|
||||||
method: 'post'
|
method: 'post',
|
||||||
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
|
@ -111,6 +111,8 @@ export interface QyLoginDTO {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface OpenCabinetApiData {
|
export interface OpenCabinetApiData {
|
||||||
|
// 格口ID
|
||||||
|
cellId?: number
|
||||||
// 用户ID
|
// 用户ID
|
||||||
userid: string
|
userid: string
|
||||||
// 是否内部用户(0否 1汇邦云用户 2企业微信用户)
|
// 是否内部用户(0否 1汇邦云用户 2企业微信用户)
|
||||||
|
|
|
@ -200,7 +200,7 @@ const handleOpenCabinet = async () => {
|
||||||
isInternal: isInternal,
|
isInternal: isInternal,
|
||||||
name: isInternal === 2 ? qyName.value : name.value,
|
name: isInternal === 2 ? qyName.value : name.value,
|
||||||
mobile: tel.value,
|
mobile: tel.value,
|
||||||
operationType: 0
|
operationType: 2
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (result.code !== 0) {
|
if (result.code !== 0) {
|
||||||
|
|
|
@ -56,10 +56,11 @@
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { getCabinetDetailApi, openCabinet } from '@/common/apis/cabinet'
|
import { getCabinetDetailApi, openCabinet } from '@/common/apis/cabinet'
|
||||||
import type { CabinetDetailDTO } from '@/common/apis/cabinet/type'
|
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"
|
import { publicPath } from "@/common/utils/path"
|
||||||
|
|
||||||
const wxStore = useWxStoreOutside()
|
const wxStore = useWxStore();
|
||||||
|
const { userid: qyUserid, name: qyName } = storeToRefs(wxStore);
|
||||||
|
|
||||||
const activeCabinet = ref(0)
|
const activeCabinet = ref(0)
|
||||||
const cabinetList = ref<CabinetItem[]>([])
|
const cabinetList = ref<CabinetItem[]>([])
|
||||||
|
@ -132,7 +133,14 @@ const handleOpenLocker = async (locker: LockerItem) => {
|
||||||
openingLockerId.value = locker.lockerId
|
openingLockerId.value = locker.lockerId
|
||||||
try {
|
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) {
|
} catch (error) {
|
||||||
console.error('打开柜口失败:', error)
|
console.error('打开柜口失败:', error)
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -29,7 +29,7 @@ async function handleOpenCabinet(orderId: number, orderGoodsId: number) {
|
||||||
isInternal: isInternal,
|
isInternal: isInternal,
|
||||||
name: isInternal === 2 ? qyName.value : name.value,
|
name: isInternal === 2 ? qyName.value : name.value,
|
||||||
mobile: tel.value,
|
mobile: tel.value,
|
||||||
operationType: 0
|
operationType: 1
|
||||||
});
|
});
|
||||||
if (result.code !== 0) {
|
if (result.code !== 0) {
|
||||||
showFailToast(result.msg || '开启失败,请稍后重试')
|
showFailToast(result.msg || '开启失败,请稍后重试')
|
||||||
|
|
|
@ -78,7 +78,7 @@ async function handleOpenCabinet(item: OrderGoods) {
|
||||||
isInternal: isInternal,
|
isInternal: isInternal,
|
||||||
name: isInternal === 2 ? qyName.value : name.value,
|
name: isInternal === 2 ? qyName.value : name.value,
|
||||||
mobile: tel.value,
|
mobile: tel.value,
|
||||||
operationType: 0
|
operationType: 1
|
||||||
})
|
})
|
||||||
if (result.code !== 0) {
|
if (result.code !== 0) {
|
||||||
showFailToast(result.msg || '开启失败,请稍后重试')
|
showFailToast(result.msg || '开启失败,请稍后重试')
|
||||||
|
|
Loading…
Reference in New Issue