数量选择编码
This commit is contained in:
		
							parent
							
								
									663a51e2a5
								
							
						
					
					
						commit
						a722518b0e
					
				| 
						 | 
				
			
			@ -110,12 +110,6 @@
 | 
			
		|||
                            <view class="cont">{{ item.maCode }}</view>
 | 
			
		||||
                        </uni-col>
 | 
			
		||||
                    </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-col :span="6">设备数量:</uni-col>
 | 
			
		||||
                        <uni-col :span="16">
 | 
			
		||||
| 
						 | 
				
			
			@ -134,17 +128,14 @@
 | 
			
		|||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup>
 | 
			
		||||
import { ref, computed, onUnmounted } from 'vue'
 | 
			
		||||
import { ref, computed } from 'vue'
 | 
			
		||||
import { onLoad, onShow } from '@dcloudio/uni-app'
 | 
			
		||||
import {
 | 
			
		||||
    getCodeDetailAPI,
 | 
			
		||||
    getCodeDeviceListAPI,
 | 
			
		||||
    setOutboundNumAPI,
 | 
			
		||||
    getCodeScanAPI,
 | 
			
		||||
    getInfoByTypeId,
 | 
			
		||||
    getBoxDetailsAPI,
 | 
			
		||||
} from '@/services/picking/outbound.js'
 | 
			
		||||
import { getBoxBindByCode } from '@/services/standard.js'
 | 
			
		||||
import { debounce } from 'lodash-es'
 | 
			
		||||
import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue'
 | 
			
		||||
import ScanQrCodeBox from '@/pages/devicesSearch/ScanQrCodeBox.vue'
 | 
			
		||||
| 
						 | 
				
			
			@ -321,7 +312,7 @@ const handleScanErrorBox = (error) => {
 | 
			
		|||
const boxOut = async () => {
 | 
			
		||||
    console.log(queryParams)
 | 
			
		||||
    try {
 | 
			
		||||
        const res = await getBoxDetailsAPI({ boxCode: 'BOX-20250220221725' })
 | 
			
		||||
        const res = await getBoxDetailsAPI({ boxCode: boxCode.value })
 | 
			
		||||
        console.log('🚀 ~ boxOut ~ res:', res)
 | 
			
		||||
        if (res.code === 200 && res.data && res.data.length > 0) {
 | 
			
		||||
            const maCodeList = res.data.map((item) => ({
 | 
			
		||||
| 
						 | 
				
			
			@ -336,56 +327,6 @@ const boxOut = async () => {
 | 
			
		|||
        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, // 出库方式 0数量,1编码,2二维码,3标准箱
 | 
			
		||||
            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 = () => {
 | 
			
		||||
| 
						 | 
				
			
			@ -423,11 +364,16 @@ const getMaInfoScan = async () => {
 | 
			
		|||
        qrCode: qrCodeScan.value,
 | 
			
		||||
    }
 | 
			
		||||
    const res = await getCodeScanAPI(param)
 | 
			
		||||
    console.log(res)
 | 
			
		||||
    if (res.code == 200) {
 | 
			
		||||
        if (res.data && res.data.recordList.length > 0) {
 | 
			
		||||
            codeData.value = res.data.recordList[0]
 | 
			
		||||
            confirmCodeOutBound()
 | 
			
		||||
            const maCodeList = res.data.recordList.map((item) => ({
 | 
			
		||||
                maId: item.maId,
 | 
			
		||||
                maCode: item.maCode,
 | 
			
		||||
                typeId: queryParams.value.typeId,
 | 
			
		||||
            }))
 | 
			
		||||
            console.log('🚀 ~ maCodeList ~ maCodeList:', maCodeList)
 | 
			
		||||
            uni.$emit('maCodeList', { maCodeList })
 | 
			
		||||
            uni.navigateBack()
 | 
			
		||||
        } else {
 | 
			
		||||
            uni.showToast({ title: res.data.msg, icon: 'none' })
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			@ -435,42 +381,6 @@ const getMaInfoScan = async () => {
 | 
			
		|||
        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,
 | 
			
		||||
        // 出库方式 0数量,1编码,2二维码,3标准箱
 | 
			
		||||
        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>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue