bug修复
This commit is contained in:
parent
c1e08bd4cf
commit
fae075f9a4
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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') // 移除事件监听
|
||||
|
|
|
|||
|
|
@ -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([]) // 列表数据源
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in New Issue