标准箱
This commit is contained in:
parent
c341db3674
commit
3706fc63c4
|
|
@ -24,7 +24,7 @@ import { onMounted, reactive, ref } from 'vue'
|
|||
import { appLoginAPI, getUserInfoAPI, iwsLoginAPI } from '@/services/index.js'
|
||||
import { useMemberStore } from '@/stores'
|
||||
const memberStore = useMemberStore()
|
||||
const origin = []
|
||||
const origin = window.location.href
|
||||
// 登录参数
|
||||
const loginForm = reactive({
|
||||
username: uni.getStorageSync('username'),
|
||||
|
|
|
|||
|
|
@ -25,9 +25,9 @@
|
|||
<uni-col :span="6">
|
||||
<view class="coding-btn" @click="codeScan">二维码识别</view>
|
||||
</uni-col>
|
||||
<!-- <uni-col :span="6">
|
||||
<uni-col :span="6">
|
||||
<view class="coding-btn" @click="boxScan">标准箱识别</view>
|
||||
</uni-col> -->
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
<scan-qr-code
|
||||
|
|
@ -35,6 +35,12 @@
|
|||
@scanSuccess="handleScanSuccess"
|
||||
@scanError="handleScanError"
|
||||
/>
|
||||
|
||||
<ScanQrCodeBox
|
||||
ref="scanQrCodeRefBox"
|
||||
@scanSuccessBox="handleScanSuccessBox"
|
||||
@scanErrorBox="handleScanErrorBox"
|
||||
/>
|
||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" style="padding-bottom: 50rpx">
|
||||
<view class="table-list-item" v-for="item in codeDeviceList" :key="item.id">
|
||||
<uni-row :gutter="24">
|
||||
|
|
@ -85,7 +91,7 @@ import { getInfoBindByCode, appWarehouseApi } from '@/services/standard.js'
|
|||
import { getTypeByQrcode } from '@/services/new-purchase/bind.js'
|
||||
import { onBackPress, onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue'
|
||||
|
||||
import ScanQrCodeBox from '@/pages/devicesSearch/ScanQrCodeBox.vue'
|
||||
const codeDeviceList = ref([])
|
||||
const total = ref(0) //已选择数量
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
|
|
@ -96,6 +102,7 @@ const boxInfo = ref({})
|
|||
const qrCode = ref('')
|
||||
const maInfo = ref({})
|
||||
const scanQrCodeRef = ref(null)
|
||||
const scanQrCodeRefBox = ref(null)
|
||||
// const typeId = ref('')
|
||||
// const taskId = ref('')
|
||||
// const maTypeName = ref('')
|
||||
|
|
@ -236,35 +243,56 @@ const confirmCodeInBound = async () => {
|
|||
// 标准箱识别
|
||||
const boxScan = async () => {
|
||||
boxCode.value = ''
|
||||
var mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
|
||||
mpaasScanModule.mpaasScan(
|
||||
{
|
||||
// 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
|
||||
scanType: ['qrCode', 'barCode'],
|
||||
// 是否隐藏相册,默认false不隐藏
|
||||
hideAlbum: false,
|
||||
//ios需要设置这个参数,只支持中英文 zh-Hans、en,默认中文
|
||||
language: 'en',
|
||||
//相册选择照片识别错误提示(ios)
|
||||
failedMsg: '未识别到二维码,请重试',
|
||||
//Android支持全屏需要设置此参数
|
||||
screenType: 'full',
|
||||
},
|
||||
(ret) => {
|
||||
console.log(ret)
|
||||
if (ret.resp_code == 10) {
|
||||
uni.showToast({ title: '用户取消', icon: 'none' })
|
||||
}
|
||||
if (ret.resp_code == 11) {
|
||||
uni.showToast({ title: '扫码失败', icon: 'none' })
|
||||
}
|
||||
if (ret.resp_code == 1000) {
|
||||
boxCode.value = ret.resp_result
|
||||
boxInBound()
|
||||
}
|
||||
},
|
||||
)
|
||||
if (scanQrCodeRefBox.value) {
|
||||
scanQrCodeRefBox.value.scanQrCode()
|
||||
}
|
||||
// var mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
|
||||
// mpaasScanModule.mpaasScan(
|
||||
// {
|
||||
// // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
|
||||
// scanType: ['qrCode', 'barCode'],
|
||||
// // 是否隐藏相册,默认false不隐藏
|
||||
// hideAlbum: false,
|
||||
// //ios需要设置这个参数,只支持中英文 zh-Hans、en,默认中文
|
||||
// language: 'en',
|
||||
// //相册选择照片识别错误提示(ios)
|
||||
// failedMsg: '未识别到二维码,请重试',
|
||||
// //Android支持全屏需要设置此参数
|
||||
// screenType: 'full',
|
||||
// },
|
||||
// (ret) => {
|
||||
// console.log(ret)
|
||||
// if (ret.resp_code == 10) {
|
||||
// uni.showToast({ title: '用户取消', icon: 'none' })
|
||||
// }
|
||||
// if (ret.resp_code == 11) {
|
||||
// uni.showToast({ title: '扫码失败', icon: 'none' })
|
||||
// }
|
||||
// if (ret.resp_code == 1000) {
|
||||
// boxCode.value = ret.resp_result
|
||||
// boxInBound()
|
||||
// }
|
||||
// },
|
||||
// )
|
||||
}
|
||||
|
||||
// 处理扫描成功事件
|
||||
const handleScanSuccessBox = (result) => {
|
||||
boxCode.value = result?.text || ''
|
||||
if (boxCode.value === '') {
|
||||
uni.showToast({ title: '扫码识别失败', icon: 'none' })
|
||||
} else {
|
||||
boxInBound()
|
||||
}
|
||||
}
|
||||
|
||||
// 处理扫描失败事件
|
||||
const handleScanErrorBox = (error) => {
|
||||
console.error('扫描出错:', error.message)
|
||||
uni.showToast({ title: error.message, icon: 'none' })
|
||||
}
|
||||
|
||||
|
||||
// 标准箱入库
|
||||
const boxInBound = async () => {
|
||||
if (boxCode.value == '') {
|
||||
|
|
@ -275,7 +303,7 @@ const boxInBound = async () => {
|
|||
maTypeId: queryParams.value.typeId,
|
||||
}
|
||||
const res = await getInfoBindByCode(param)
|
||||
console.log(res)
|
||||
uni.showToast({ title: JSON.stringify(res, null, 2), icon: 'none' })
|
||||
if (res.code == 200) {
|
||||
boxInfo.value = res.data
|
||||
uni.showModal({
|
||||
|
|
@ -284,11 +312,9 @@ const boxInBound = async () => {
|
|||
confirmText: '确定',
|
||||
cancelText: '取消',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
if (boxInfo.value.successMaTotal > 0) {
|
||||
confirmBoxInBound()
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@
|
|||
/>
|
||||
<ScanQrCodeBox
|
||||
ref="scanQrCodeRefBox"
|
||||
@scanSuccess="handleScanSuccessBox"
|
||||
@scanError="handleScanErrorBox"
|
||||
@scanSuccessBox="handleScanSuccessBox"
|
||||
@scanErrorBox="handleScanErrorBox"
|
||||
/>
|
||||
<view class="table-list-item">
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center">
|
||||
|
|
|
|||
|
|
@ -9,12 +9,21 @@
|
|||
<uni-col :span="6">
|
||||
<view class="coding-btn" @click="codeScan">二维码识别</view>
|
||||
</uni-col>
|
||||
<!-- <uni-col :span="6">
|
||||
<uni-col :span="6">
|
||||
<view class="coding-btn" @click="boxScan">标准箱识别</view>
|
||||
</uni-col> -->
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
|
||||
<ScanQrCode
|
||||
ref="scanQrCodeRef"
|
||||
@scanSuccess="handleScanSuccess"
|
||||
@scanError="handleScanError"
|
||||
/>
|
||||
<ScanQrCodeBox
|
||||
ref="scanQrCodeRefBox"
|
||||
@scanSuccessBox="handleScanSuccessBox"
|
||||
@scanErrorBox="handleScanErrorBox"
|
||||
/>
|
||||
<view class="card" style="margin-top: 10px;">
|
||||
<view style="font-size: 32rpx;font-weight: 600;margin-bottom: 20rpx;">设备信息</view>
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
|
|
@ -85,8 +94,9 @@
|
|||
import { ref, reactive } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getCodeListApi,repairInputWarehouseApi,rejectWarehouseApi,getInfoByQrcodeApi,repairInputWarehouseApiTwo } from '@/services/repair/testedInBound.js'
|
||||
import { getBoxCodeListApi } from '@/services/standard.js'
|
||||
|
||||
import { getBoxCodeListApi,sanQrBoxInputApi } from '@/services/standard.js'
|
||||
import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue'
|
||||
import ScanQrCodeBox from '@/pages/devicesSearch/ScanQrCodeBox.vue'
|
||||
const taskInfo = ref({})
|
||||
const maId = ref("") //编码
|
||||
const maCode = ref("") //编码
|
||||
|
|
@ -99,60 +109,51 @@ const maInfo = ref({}) //二维码
|
|||
|
||||
const boxCode = ref("") //标准箱
|
||||
const boxInfo = ref([])
|
||||
|
||||
const scanQrCodeRef = ref(null)
|
||||
const scanQrCodeRefBox = ref(null)
|
||||
//编码识别
|
||||
const ocrScan = () => {
|
||||
|
||||
}
|
||||
|
||||
// 二维码扫码
|
||||
const codeScan = async () => {
|
||||
qrCode.value=""
|
||||
// var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
|
||||
uni.scanCode({
|
||||
success: function (res) {
|
||||
// qrCode.value = res.resp_result.split("qrcode=")[1];
|
||||
console.log('条码内容:' + res.result);
|
||||
qrCode.value = res.result
|
||||
codeInBound()
|
||||
}
|
||||
});
|
||||
// mpaasScanModule.mpaasScan({
|
||||
// // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
|
||||
// 'scanType': ['qrCode','barCode'],
|
||||
// // 是否隐藏相册,默认false不隐藏
|
||||
// 'hideAlbum': false,
|
||||
// //ios需要设置这个参数,只支持中英文 zh-Hans、en,默认中文
|
||||
// 'language' : 'en',
|
||||
// //相册选择照片识别错误提示(ios)
|
||||
// 'failedMsg': '未识别到二维码,请重试',
|
||||
// //Android支持全屏需要设置此参数
|
||||
// 'screenType': 'full'
|
||||
// },(ret) => {
|
||||
// console.log(ret)
|
||||
// if(ret.resp_code==10){
|
||||
// uni.showToast({ title: '用户取消', icon: 'none' })
|
||||
// maInfo.value = {}
|
||||
// }
|
||||
// if(ret.resp_code==11){
|
||||
// uni.showToast({ title: '扫码失败', icon: 'none' })
|
||||
// }
|
||||
// if(ret.resp_code==1000){
|
||||
// // uni.showToast({ title: '扫码成功', icon: 'none' })
|
||||
// qrCode.value = ret.resp_result.split("qrcode=")[1];
|
||||
// codeInBound()
|
||||
// }
|
||||
// // uni.showModal({
|
||||
// // title: "弹窗标题",
|
||||
// // // 返回值中,resp_code 表示返回结果值,10:用户取消,11:其他错误,1000:成功
|
||||
// // // 返回值中,resp_message 表示返回结果信息
|
||||
// // // 返回值中,resp_result 表示扫码结果,只有成功才会有返回
|
||||
// // content: JSON.stringify(ret),
|
||||
// // showCancel: false,
|
||||
// // confirmText: "确定"
|
||||
// // })
|
||||
// })
|
||||
// 扫码识别按钮
|
||||
const codeScan = () => {
|
||||
if (scanQrCodeRef.value) {
|
||||
scanQrCodeRef.value.scanQrCode()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 处理扫描成功事件
|
||||
const handleScanSuccess = (result) => {
|
||||
qrCode.value = result?.text || ''
|
||||
if (qrCode.value === '') {
|
||||
uni.showToast({ title: '扫码识别失败', icon: 'none' })
|
||||
} else {
|
||||
codeInBound()
|
||||
}
|
||||
}
|
||||
|
||||
// 处理扫描失败事件
|
||||
const handleScanError = (error) => {
|
||||
console.error('扫描出错:', error.message)
|
||||
uni.showToast({ title: error.message, icon: 'none' })
|
||||
}
|
||||
|
||||
|
||||
// 二维码扫码
|
||||
// const codeScan = async () => {
|
||||
// qrCode.value=""
|
||||
// // var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
|
||||
// uni.scanCode({
|
||||
// success: function (res) {
|
||||
// // qrCode.value = res.resp_result.split("qrcode=")[1];
|
||||
// console.log('条码内容:' + res.result);
|
||||
// qrCode.value = res.result
|
||||
// codeInBound()
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// 二维码入库
|
||||
const codeInBound = async () => {
|
||||
if(qrCode.value==""){
|
||||
|
|
@ -205,36 +206,59 @@ const cinfirmCodeInBound = async () => {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 标准箱识别
|
||||
const boxScan = async () => {
|
||||
boxCode.value=""
|
||||
var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
|
||||
mpaasScanModule.mpaasScan({
|
||||
// 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
|
||||
'scanType': ['qrCode','barCode'],
|
||||
// 是否隐藏相册,默认false不隐藏
|
||||
'hideAlbum': false,
|
||||
//ios需要设置这个参数,只支持中英文 zh-Hans、en,默认中文
|
||||
'language' : 'en',
|
||||
//相册选择照片识别错误提示(ios)
|
||||
'failedMsg': '未识别到二维码,请重试',
|
||||
//Android支持全屏需要设置此参数
|
||||
'screenType': 'full'
|
||||
},(ret) => {
|
||||
console.log(ret)
|
||||
if(ret.resp_code==10){
|
||||
uni.showToast({ title: '用户取消', icon: 'none' })
|
||||
}
|
||||
if(ret.resp_code==11){
|
||||
uni.showToast({ title: '扫码失败', icon: 'none' })
|
||||
}
|
||||
if(ret.resp_code==1000){
|
||||
boxCode.value = ret.resp_result;
|
||||
boxInBound()
|
||||
}
|
||||
})
|
||||
if (scanQrCodeRefBox.value) {
|
||||
scanQrCodeRefBox.value.scanQrCode()
|
||||
}
|
||||
}
|
||||
|
||||
// 处理扫描成功事件
|
||||
const handleScanSuccessBox = (result) => {
|
||||
boxCode.value = result?.text || ''
|
||||
if (boxCode.value === '') {
|
||||
uni.showToast({ title: '扫码识别失败', icon: 'none' })
|
||||
} else {
|
||||
boxInBound()
|
||||
}
|
||||
}
|
||||
|
||||
// 处理扫描失败事件
|
||||
const handleScanErrorBox = (error) => {
|
||||
console.error('扫描出错:', error.message)
|
||||
uni.showToast({ title: error.message, icon: 'none' })
|
||||
}
|
||||
|
||||
|
||||
// 标准箱识别
|
||||
// const boxScan = async () => {
|
||||
// boxCode.value=""
|
||||
// var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
|
||||
// mpaasScanModule.mpaasScan({
|
||||
// // 扫码识别类型,参数可多选,qrCode、barCode,不设置,默认识别所有
|
||||
// 'scanType': ['qrCode','barCode'],
|
||||
// // 是否隐藏相册,默认false不隐藏
|
||||
// 'hideAlbum': false,
|
||||
// //ios需要设置这个参数,只支持中英文 zh-Hans、en,默认中文
|
||||
// 'language' : 'en',
|
||||
// //相册选择照片识别错误提示(ios)
|
||||
// 'failedMsg': '未识别到二维码,请重试',
|
||||
// //Android支持全屏需要设置此参数
|
||||
// 'screenType': 'full'
|
||||
// },(ret) => {
|
||||
// console.log(ret)
|
||||
// if(ret.resp_code==10){
|
||||
// uni.showToast({ title: '用户取消', icon: 'none' })
|
||||
// }
|
||||
// if(ret.resp_code==11){
|
||||
// uni.showToast({ title: '扫码失败', icon: 'none' })
|
||||
// }
|
||||
// if(ret.resp_code==1000){
|
||||
// boxCode.value = ret.resp_result;
|
||||
// boxInBound()
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// 标准箱入库
|
||||
const boxInBound = async () => {
|
||||
if(boxCode.value==""){
|
||||
|
|
@ -242,25 +266,22 @@ const boxInBound = async () => {
|
|||
}else{
|
||||
let param = {
|
||||
boxCode: boxCode.value,
|
||||
maTypeId:queryParams.value.typeId
|
||||
// maTypeId:queryParams.value.typeId
|
||||
}
|
||||
const res = await getBoxCodeListApi(param)
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
if(res.data.length>0){
|
||||
let successMaTotal = res.data.length
|
||||
boxInfo.value = res.data
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: `监测到${boxCode.value}标准箱中符合入库条件设备${boxInfo.value.successMaTotal}台,是否确定入库?`,
|
||||
content: `监测到${boxCode.value}标准箱中符合入库条件设备${successMaTotal}台,是否确定入库?`,
|
||||
confirmText: '确定',
|
||||
cancelText: '取消',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
if(boxInfo.value.successMaTotal>0){
|
||||
confirmBoxInBound()
|
||||
}
|
||||
}
|
||||
if(successMaTotal>0){
|
||||
confirmBoxInBound()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -274,7 +295,15 @@ const boxInBound = async () => {
|
|||
}
|
||||
// 标准箱入库确认
|
||||
const confirmBoxInBound = async () => {
|
||||
|
||||
let param = {
|
||||
boxCode: boxCode.value,
|
||||
}
|
||||
const res = await sanQrBoxInputApi(param)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '入库成功', icon: 'none'})
|
||||
}else{
|
||||
uni.showToast({ title: '入库失败', icon: 'none'})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -313,6 +313,7 @@ const confirmTransfer = () => {
|
|||
"inputUser":transferUser.value,
|
||||
}
|
||||
console.log(param)
|
||||
|
||||
appTransferApi(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code=200){
|
||||
|
|
|
|||
|
|
@ -119,7 +119,14 @@ export const appTransferRejectApi = (data)=> {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
// 标准箱识别--确认入库
|
||||
export const sanQrBoxInputApi = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material/repair_input_details/sanQrBoxInput',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue