数量选择编码

This commit is contained in:
bb_pan 2025-07-04 09:43:19 +08:00
parent 663a51e2a5
commit a722518b0e
1 changed files with 10 additions and 100 deletions

View File

@ -110,12 +110,6 @@
<view class="cont">{{ item.maCode }}</view> <view class="cont">{{ item.maCode }}</view>
</uni-col> </uni-col>
</uni-row> </uni-row>
<uni-row :gutter="24">
<uni-col :span="6">设备状态</uni-col>
<uni-col :span="16">
<view class="cont">{{ item.maStatus }}</view>
</uni-col>
</uni-row>
<uni-row :gutter="24"> <uni-row :gutter="24">
<uni-col :span="6">设备数量</uni-col> <uni-col :span="6">设备数量</uni-col>
<uni-col :span="16"> <uni-col :span="16">
@ -134,17 +128,14 @@
</template> </template>
<script setup> <script setup>
import { ref, computed, onUnmounted } from 'vue' import { ref, computed } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app' import { onLoad, onShow } from '@dcloudio/uni-app'
import { import {
getCodeDetailAPI, getCodeDetailAPI,
getCodeDeviceListAPI,
setOutboundNumAPI,
getCodeScanAPI, getCodeScanAPI,
getInfoByTypeId, getInfoByTypeId,
getBoxDetailsAPI, getBoxDetailsAPI,
} from '@/services/picking/outbound.js' } from '@/services/picking/outbound.js'
import { getBoxBindByCode } from '@/services/standard.js'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue' import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue'
import ScanQrCodeBox from '@/pages/devicesSearch/ScanQrCodeBox.vue' import ScanQrCodeBox from '@/pages/devicesSearch/ScanQrCodeBox.vue'
@ -321,7 +312,7 @@ const handleScanErrorBox = (error) => {
const boxOut = async () => { const boxOut = async () => {
console.log(queryParams) console.log(queryParams)
try { try {
const res = await getBoxDetailsAPI({ boxCode: 'BOX-20250220221725' }) const res = await getBoxDetailsAPI({ boxCode: boxCode.value })
console.log('🚀 ~ boxOut ~ res:', res) console.log('🚀 ~ boxOut ~ res:', res)
if (res.code === 200 && res.data && res.data.length > 0) { if (res.code === 200 && res.data && res.data.length > 0) {
const maCodeList = res.data.map((item) => ({ const maCodeList = res.data.map((item) => ({
@ -336,56 +327,6 @@ const boxOut = async () => {
console.log('🚀 ~ boxOut ~ error:', error) console.log('🚀 ~ boxOut ~ error:', error)
} }
} }
//
const boxOutBound = async () => {
//
const { typeId, parentId } = queryParams.value
//
const paramsList = []
boxInfo.value.recordList.map((e) => {
paramsList.push({
leaseType: 0,
boxId: e.boxId,
maId: e.maId,
maCode: e.maCode,
manageType: 0,
outType: 3, // 0123
outNum: 1,
parentId,
typeId,
})
})
console.log(paramsList)
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
if (res.code === 200) {
uni.showToast({
title: '出库成功!',
icon: 'none',
})
getCodeDetailData(
queryParams.value.id,
queryParams.value.publishTask,
queryParams.value.typeId,
) //
}
}
//
const onCodeIdentify = () => {
console.log('编码识别--')
if (maxNum.value == 0) {
uni.showToast({
title: '待出库数量已为0',
icon: 'none',
})
} else {
uni.navigateTo({
url: `/pages/picking/outbound/codeOutScan?queryParams=${JSON.stringify(
queryParams.value,
)}`,
})
}
}
// //
const scanStart = () => { const scanStart = () => {
@ -423,11 +364,16 @@ const getMaInfoScan = async () => {
qrCode: qrCodeScan.value, qrCode: qrCodeScan.value,
} }
const res = await getCodeScanAPI(param) const res = await getCodeScanAPI(param)
console.log(res)
if (res.code == 200) { if (res.code == 200) {
if (res.data && res.data.recordList.length > 0) { if (res.data && res.data.recordList.length > 0) {
codeData.value = res.data.recordList[0] const maCodeList = res.data.recordList.map((item) => ({
confirmCodeOutBound() maId: item.maId,
maCode: item.maCode,
typeId: queryParams.value.typeId,
}))
console.log('🚀 ~ maCodeList ~ maCodeList:', maCodeList)
uni.$emit('maCodeList', { maCodeList })
uni.navigateBack()
} else { } else {
uni.showToast({ title: res.data.msg, icon: 'none' }) uni.showToast({ title: res.data.msg, icon: 'none' })
} }
@ -435,42 +381,6 @@ const getMaInfoScan = async () => {
uni.showToast({ title: res.data.msg, icon: 'none' }) uni.showToast({ title: res.data.msg, icon: 'none' })
} }
} }
//
const confirmCodeOutBound = async () => {
//
const { typeId, parentId } = queryParams.value
//
const paramsList = []
paramsList.push({
leaseType: 0,
maId: codeData.value.maId,
maCode: codeData.value.maCode,
manageType: 0,
// 0123
outType: 2,
outNum: 1,
parentId,
typeId,
typeName: codeData.value.typeName,
typeModelName: codeData.value.typeModelName,
})
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
console.log('333333333333', res)
if (res.code === 200) {
uni.showToast({
title: '出库成功!',
icon: 'none',
})
getCodeDetailData(
queryParams.value.id,
queryParams.value.publishTask,
queryParams.value.typeId,
) //
setTimeout(() => {
scanStart()
}, 800)
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>