标准箱-信息查询

This commit is contained in:
bb_pan 2025-06-30 14:01:42 +08:00
parent b7bbf03e27
commit 287745de4e
5 changed files with 262 additions and 3 deletions

View File

@ -530,6 +530,18 @@
"navigationBarTitleText": "标准箱接收"
}
},
{
"path": "pages/standardBox/infoRecord",
"style": {
"navigationBarTitleText": "标准箱创建"
}
},
{
"path": "pages/standardBox/boxInfoList",
"style": {
"navigationStyle": "custom"
}
},
//
{
"path": "pages/stquery/deviceStatusRecord/index",

View File

@ -171,7 +171,7 @@ const newPurchaseListTwo = computed(() => {
const pickingList = ref([
{
title: '实时信息查询',
url: '',
url: '/pages/standardBox/infoRecord',
iconSrc: '../../static/searchModel/infoRecord.png',
},
{

View File

@ -0,0 +1,92 @@
<template>
<uni-nav-bar
:fixed="true"
:border="false"
background-color="#dcf4ff"
status-bar
title="标准箱明细列表"
color="#333"
>
<template v-slot:left>
<view style="font-size: 18px; display: flex; align-items: center" @click="back">
<!-- 图标 -->
<uni-icons type="left" size="20" color="#333"></uni-icons>
</view>
</template>
</uni-nav-bar>
<div class="content">
<div class="search-form">
<uni-easyinput placeholder="请输入内容" v-model="maCode" style="margin-right: 10px" />
<button type="primary" size="mini" @click="getBoxList">查询</button>
</div>
<!-- 滚动列表 -->
<scroll-view scroll-y class="scroll-view">
<div class="box-item" v-for="(item, index) in boxList" :key="index">
<div style="margin-right: 5px">{{ index + 1 }}.</div>
<div>
<div>机具类型{{ item.typeName }}</div>
<div>机具型号{{ item.typeModelName }}</div>
<div>设备编号{{ item.maCode }}</div>
<div>设备状态{{ item.maStatus }}</div>
<div>时间{{ item.createTime }}</div>
</div>
</div>
</scroll-view>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { getBoxDetailsApi } from '@/services/standard'
const maCode = ref('')
const boxCode = ref('')
const boxList = ref([])
onLoad((opt) => {
console.log('onLoad', opt.boxCode)
boxCode.value = opt.boxCode ? JSON.parse(opt.boxCode) : ''
getBoxList()
})
const back = () => {
uni.reLaunch({
url: '/pages/search/index',
})
}
const getBoxList = async () => {
try {
const res = await getBoxDetailsApi({
boxCode: boxCode.value,
maCode: maCode.value,
})
console.log('🚀 ~ getBoxList ~ res:', res)
boxList.value = res.data
} catch (error) {
console.log('🚀 ~ getBoxList ~ error:', error)
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 10px;
}
.search-form {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.scroll-view {
height: calc(100vh - 100px);
.box-item {
display: flex;
background-color: #fff;
padding: 10px;
margin-bottom: 10px;
}
}
</style>

View File

@ -0,0 +1,140 @@
<template>
<div>
<uni-popup
ref="popupDialog"
type="center"
border-radius="6px"
:mask-click="false"
background-color="#f8f8f8"
>
<!-- 弹窗内容区 -->
<view class="modal-wrapper">
<view class="modal-title">智能机具</view>
<view class="modal-content">
<div>名称{{ popupData.boxName }}</div>
<div>编码{{ popupData.boxCode }}</div>
<div>数量{{ popupData.inputNum }}</div>
<div>在库{{ popupData.boxStatus }}</div>
</view>
<view class="modal-footer">
<view class="btn cancel-btn" @click="onCancel">取消</view>
<view class="btn confirm-btn" @click="onConfirm">确认</view>
</view>
</view>
</uni-popup>
<ScanQrCodeBox
ref="scanQrCodeRefBox"
@scanSuccessBox="handleScanSuccessBox"
@scanErrorBox="handleScanErrorBox"
/>
</div>
</template>
<script setup>
import { ref, onMounted, reactive } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import ScanQrCodeBox from '@/pages/devicesSearch/ScanQrCodeBox.vue'
import { getBoxInfoApi } from '@/services/standard'
const scanQrCodeRefBox = ref()
const boxCode = ref('')
const popupDialog = ref()
const popupData = reactive({})
onMounted(() => {
// getBoxInfo()
//
if (scanQrCodeRefBox.value) {
scanQrCodeRefBox.value.scanQrCode()
}
})
//
const handleScanSuccessBox = (result) => {
boxCode.value = result?.text || ''
if (boxCode.value === '') {
uni.showToast({ title: '扫码识别失败', icon: 'none' })
} else {
getBoxInfo()
}
}
//
const handleScanErrorBox = (error) => {
console.error('扫描出错:', error.message)
uni.showToast({ title: error.message, icon: 'none' })
}
//
const getBoxInfo = async () => {
const res = await getBoxInfoApi({
boxCode: boxCode.value,
})
if (res.code === 200) {
popupDialog.value.open()
popupData.boxName = res.data.boxName
popupData.boxCode = res.data.boxCode
popupData.inputNum = res.data.inputNum
popupData.boxStatus = res.data.boxStatus
}
}
//
const onCancel = () => {
popupDialog.value.close()
//
uni.navigateBack()
}
//
const onConfirm = () => {
popupDialog.value.close()
//
const boxCode = popupData.boxCode
uni.navigateTo({
url: '/pages/standardBox/boxInfoList?boxCode=' + JSON.stringify(boxCode),
})
}
</script>
<style lang="scss" scoped>
.modal-wrapper {
padding: 40rpx 30rpx 20rpx;
width: 560rpx;
border-radius: 8rpx;
box-sizing: border-box;
}
.modal-title {
font-size: 32rpx;
font-weight: bold;
text-align: left;
margin-bottom: 24rpx;
}
.modal-content {
font-size: 28rpx;
color: #333;
text-align: left;
margin-bottom: 36rpx;
}
.modal-footer {
display: flex;
border-top: 1px solid #eee;
}
.btn {
flex: 1;
padding: 20rpx 0;
text-align: center;
font-size: 28rpx;
}
.cancel-btn {
color: #333;
border-right: 1px solid #eee;
}
.confirm-btn {
color: #007aff;
}
</style>

View File

@ -128,8 +128,23 @@ export const appTransferRejectApi = (data)=> {
})
}
// 获取标准箱内容
export const getBoxInfoApi = (data) => {
return http({
method: 'GET',
url: '/material/bm_qrcode_box/getBoxInfo',
data:data,
})
}
// 获取标准箱内容-详情列表
export const getBoxDetailsApi = (data) => {
return http({
method: 'GET',
url: '/material/bm_qrcode_box/getBoxDetails',
data:data,
})
}