bug修复

This commit is contained in:
hongchao 2024-12-26 18:36:11 +08:00
parent c1e08bd4cf
commit fae075f9a4
4 changed files with 52 additions and 22 deletions

View File

@ -74,7 +74,7 @@
<script setup>
import { ref, computed } from 'vue'
import { getCodeDeviceListAPI, setOutboundNumAPI } from '@/services/picking/outbound.js'
import { getCodeScanAPI, setOutboundNumAPI } from '@/services/picking/outbound.js'
import { onBackPress } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es'
import { onShow } from '@dcloudio/uni-app'
@ -105,7 +105,7 @@ onLoad((options) => {
//
const maxNum = computed(() => {
//
const waitNum = queryParams.value.preNum - queryParams.value.alNum - codeNum.value
const waitNum = queryParams.value.preNum - queryParams.value.alNum
return waitNum
})
//
@ -176,7 +176,7 @@ const scanStart = () => {
//
const getMaInfoScan = async () => {
const res = await getCodeDeviceListAPI(queryCodeParams.value)
const res = await getCodeScanAPI(queryCodeParams.value)
console.log(res)
if (res.code == 200) {
if (res.data && res.data.recordList.length > 0) {
@ -193,19 +193,19 @@ const getMaInfoScan = async () => {
}
//
const getMaInfo = async () => {
console.log('queryCodeParams', queryCodeParams.value)
const res = await getCodeDeviceListAPI(queryCodeParams.value)
console.log(res)
if (res.code == 200) {
if (res.rows && res.rows.length > 0) {
codeData.value = res.rows[0]
} else {
uni.showToast({ title: '未查询到该编码', icon: 'none' })
}
}
}
// //
// const getMaInfo = async () => {
// console.log('queryCodeParams', queryCodeParams.value)
// const res = await getCodeDeviceListAPI(queryCodeParams.value)
// console.log(res)
// if (res.code == 200) {
// if (res.rows && res.rows.length > 0) {
// codeData.value = res.rows[0]
// } else {
// uni.showToast({ title: '', icon: 'none' })
// }
// }
// }
//
const onHandleOutbound = async () => {
@ -231,10 +231,11 @@ const onHandleOutbound = async () => {
title: '出库成功!',
icon: 'none',
})
queryParams.value.alNum = queryParams.value.alNum + 1
queryCodeParams.value.maCode = ''
codeData.value = {}
codeNum.value = codeNum.value + 1
uni.$emit('onUpdate', codeNun.value)
// codeNum.value = codeNum.value + 1
// uni.$emit('onUpdate', codeNun.value)
}
}
//
@ -244,6 +245,20 @@ onShow(() => {
}, 500)
})
//
// onBackPress(() => {
// //
// // uni.redirectTo({
// // url: '/pages/fixed-page/fixed-page' //
// // });
// console.log('2222222222222222222',queryParams.value.id)
// uni.redirectTo({
// url: `/pages/picking/outbound/code-outbound?queryParams=${JSON.stringify(queryParams.value)}`
// });
// // true
// return true;
// });
</script>
<style lang="scss" scoped>

View File

@ -121,10 +121,9 @@
<script setup>
import { ref, computed, onUnmounted } from 'vue'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { onLoad, onShow, } from '@dcloudio/uni-app'
import { getCodeDeviceListAPI, setOutboundNumAPI } from '@/services/picking/outbound.js'
import { getBoxBindByCode } from '@/services/standard.js'
import { onBackPress } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es'
// const query = defineProps() //
// const queryParams = JSON.parse(query.queryParams)
@ -250,8 +249,10 @@ const maxNum = ref(0)
const getCodeDeviceListData = async () => {
console.log('queryCodeParams', queryCodeParams.value)
const res = await getCodeDeviceListAPI(queryCodeParams.value)
console.log('xxxxxxxxxxxxxxx', )
console.log('333132133', res)
codeDeviceList.value.push(...res.rows)
console.log('21313131',codeDeviceList.value)
if (codeDeviceList.value.length > 0) {
codeDeviceList.value = codeDeviceList.value.map((e) => {
return { ...e, checked: false }
@ -376,10 +377,17 @@ onLoad((options) => {
})
queryParams.value = JSON.parse(options.queryParams)
console.log('111111111111111111111',queryParams.value.id)
maxNum.value = queryParams.value.preNum - queryParams.value.alNum
queryCodeParams.value.typeId = queryParams.value.typeId
getCodeDeviceListData()
})
onShow(() => {
// maxNum
maxNum.value = queryParams.value.preNum - queryParams.value.alNum
})
//
onUnmounted(() => {
uni.$off('onUpdate') //

View File

@ -116,7 +116,7 @@ import { ref, computed } from 'vue'
import { getPickingOutboundListAPI } from '@/services/picking/outbound.js'
import { onLoad, onShow } from '@dcloudio/uni-app'
import { debounce } from 'lodash-es'
import { onBackPress } from '@dcloudio/uni-app';
const total = ref(0) //
const active = ref(1) // tap
const tableList = ref([]) //

View File

@ -33,6 +33,13 @@ export const setOutboundNumAPI = (data) => {
* 领料出库 ---- 编码出库 ---- 获取编码设备列表
*/
export const getCodeDeviceListAPI = (data) => {
return http({
method: 'GET',
url: '/material/ma_machine/list',
data,
})
}
export const getCodeScanAPI = (data) => {
return http({
method: 'GET',
url: '/material/lease_apply_info/getInfoByQrcode',