检修开门和检修关门
This commit is contained in:
1 parent
bedfdf0403
commit
35d4b2c663
3 files changed
+46
-5
No files matched your search
@@ -81,7 +81,15 @@
|
||||
</tm-sheet>
|
||||
|
||||
<tm-sheet v-for="(item, index) in state.detail.cabinetList" :key="index" :margin="[0, 20]" class="second-text-28">
|
||||
<tm-text font-size="32">{{ "柜门" + state.detail.deviceCode + "-" + item.cabinetNo }}</tm-text>
|
||||
<view class="flex justify-between items-center">
|
||||
<tm-text font-size="32">{{ "柜门" + state.detail.deviceCode + "-" + item.cabinetNo }}</tm-text>
|
||||
<view class="flex">
|
||||
<tm-button block size="s" class="px-1" @click="checkOpenAccess(item.cabinetNo)">检修开门</tm-button>
|
||||
|
||||
<tm-button block size="s" class="px-1" color="warn" @click="checkCloseAccess(item.cabinetNo)">检修关门</tm-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="flex justify-between mt-1">
|
||||
<text>货柜号:</text>
|
||||
<text>{{ item.cabinetNo }}</text>
|
||||
@@ -134,13 +142,47 @@ onShow(async () => {
|
||||
const res = await doorApi.hardDoorDetail({ hardDoorId: state.id })
|
||||
if (res.code == 0) {
|
||||
state.detail = res.data
|
||||
return
|
||||
} else {
|
||||
uni.showToast({ title: res.msg, icon: "none" })
|
||||
}
|
||||
uni.showToast({ title: res.msg, icon: "none" })
|
||||
} catch (error: any) {
|
||||
uni.showToast({ title: error.msg, icon: "none" })
|
||||
} finally {
|
||||
uni.hideLoading()
|
||||
}
|
||||
})
|
||||
|
||||
// 检修开门
|
||||
const checkOpenAccess = async (cabinetNo: string) => {
|
||||
try {
|
||||
uni.showLoading({ title: "开门中...", mask: true })
|
||||
const res: any = await doorApi.openAccess({ hardDoorId: state.id, cabinetNo })
|
||||
if (res.code == 0) {
|
||||
uni.showToast({ title: "开门成功", icon: "none" })
|
||||
} else {
|
||||
uni.showToast({ title: res.msg, icon: "none" })
|
||||
}
|
||||
} catch (error: any) {
|
||||
uni.showToast({ title: error.msg, icon: "none" })
|
||||
} finally {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
// 检修关门
|
||||
const checkCloseAccess = async (cabinetNo: string) => {
|
||||
try {
|
||||
uni.showLoading({ title: "关门中...", mask: true })
|
||||
const res = await doorApi.closeAccess({ hardDoorId: state.id, cabinetNo })
|
||||
if (res.code == 0) {
|
||||
uni.showToast({ title: "关门成功", icon: "none" })
|
||||
} else {
|
||||
uni.showToast({ title: res.msg, icon: "none" })
|
||||
}
|
||||
} catch (error: any) {
|
||||
uni.showToast({ title: error.msg, icon: "none" })
|
||||
} finally {
|
||||
uni.hideLoading()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -17,7 +17,7 @@
|
||||
<view class="h-30rpx" />
|
||||
<tm-sheet v-for="(item, index) in pageHook.list" :key="index" :margin="[0, 20]">
|
||||
<tm-text font-size="32">{{ item.hardName }} {{ item.deviceCode }}</tm-text>
|
||||
<view class="flex justify-around items-center my-1 p-2">
|
||||
<view class="flex justify-around items-center my-1">
|
||||
<view class="flex-col items-center p-2 rounded-1 active:bg-#E8E8E8" @click="doDetail(item.id)">
|
||||
<image class="w-50 h-50" src="@/static/page/货柜详情.svg" />
|
||||
<tm-text>货柜详情</tm-text>
|
||||
|
||||
@@ -173,7 +173,6 @@ export default {
|
||||
showLoading: false,
|
||||
},
|
||||
}),
|
||||
|
||||
/**
|
||||
* app检修关门
|
||||
* @param hardDoorId 智能柜id
|
||||
|
||||
Reference in new issue
Block a user