|
@@ -0,0 +1,537 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="container">
|
|
|
|
|
+ <van-nav-bar title="海康上架" left-arrow fixed placeholder @click-left="goBack">
|
|
|
|
|
+ <template #left>
|
|
|
|
|
+ <van-icon name="arrow-left" size="25" /><div style="color: #fff">返回</div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #right>
|
|
|
|
|
+ <div class="nav-right" @click="setPutaway(1)">料箱回库</div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </van-nav-bar>
|
|
|
|
|
+ <div class="putaway">
|
|
|
|
|
+ <div class="putaway-top">
|
|
|
|
|
+ <div class="putaway-tips">
|
|
|
|
|
+ <div style="flex: 1"><van-notice-bar left-icon="volume-o">{{ tips }}</van-notice-bar></div>
|
|
|
|
|
+ <div class="putaway-tips-box" v-if="dataList.length>0">剩余料箱:{{ dataList[0].remainBoxCount || 0 }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="putaway-input">
|
|
|
|
|
+ <div class="code-input">
|
|
|
|
|
+ <van-field v-model="workBinNo" placeholder="请扫描料箱号" label="料箱编号:" left-icon="" :class="[scanType===1?'search-input-barcode':'']"
|
|
|
|
|
+ autocomplete="off" readonly @click="setBarcodeInput(workBinNo,1)"></van-field>
|
|
|
|
|
+ <van-field v-model="searchBarcode" placeholder="请扫描商品条码" label="商品条码:" left-icon="" readonly :class="[scanType===2?'search-input-barcode':'']"
|
|
|
|
|
+ autocomplete="off" @click="setBarcodeInput(searchBarcode,2)"></van-field>
|
|
|
|
|
+ <van-field ref="countRef" v-model="count" type="number" placeholder="上架数量" label="上架数量:" left-icon="" autocomplete="off"
|
|
|
|
|
+ :class="{'search-input-barcode': scanType === 3,'input-count': barcodeActive.qty}" @keydown.enter="setPutaway(2)"
|
|
|
|
|
+ :max="barcodeActive.qty?barcodeActive.qty:10000"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #button>
|
|
|
|
|
+ <div style="display: flex; align-items: center;flex-direction: column;margin-left: 20px;color:#333" v-if="barcodeActive.qty">
|
|
|
|
|
+ <div style="height: 20px;font-size: 12px">预计</div>
|
|
|
|
|
+ <div style="font-size: 16px;font-weight: bold">{{ barcodeActive.qty ||0 }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </van-field>
|
|
|
|
|
+ <van-field v-model="searchLocation" placeholder="请扫描库位" label="上架库位:" left-icon="" readonly :class="[scanType===4?'search-input-barcode':'']"
|
|
|
|
|
+ autocomplete="off" @click="setBarcodeInput(searchLocation,4)"></van-field>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="putaway-button">
|
|
|
|
|
+ <van-button type="primary" size="small" block @click="setPutaway(2)" >提交上架</van-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="putaway-box" v-if="barcodeActive.bin">
|
|
|
|
|
+ <div><box ref="boxRef" :box="{name:workBinNo,category:barcodeActive.gridCount}"></box></div>
|
|
|
|
|
+ <div style="font-size: 14px;" v-if="barcodeActive.gridNum" >料箱格口:{{ barcodeActive.gridNum }}</div>
|
|
|
|
|
+ <div style="font-size: 14px;" v-else >料箱格口:请手动扫描</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="putaway-bottom" v-if="equipmentBarcodeList.length>0">
|
|
|
|
|
+ <div class="wall-list-box">
|
|
|
|
|
+ <div style="font-size: 14px">分拨墙-{{equipmentBarcodeList[0].equipment}}</div>
|
|
|
|
|
+ <div class="wall-list">
|
|
|
|
|
+ <div class="wall-item" v-for="(wall, wallIndex) in wallBinList" :key="wallIndex">
|
|
|
|
|
+ <div class="wall-item-sub" v-for="(bin, binIndex) in getRows(wall)" :key="binIndex">
|
|
|
|
|
+ <div class="wall-item-bin" v-for="item in bin">
|
|
|
|
|
+ <div class="wall-item-bin-text">{{ item }}</div>
|
|
|
|
|
+ <div class="wall-item-bin-high" :style="locationScanBarcodeBinList.includes(Number(item))?'background:#45d200':''" v-if="locationBarcodeBinList.includes(Number(item))">{{ item }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <input-barcode ref="inputBarcodeRef" @setBarcode="_handlerScan" />
|
|
|
|
|
+ <go-back ref="goBackRef" v-model:scanType="scanType" @setGoBack="setGoBack" />
|
|
|
|
|
+ <van-action-sheet v-model:show="equipmentTrueFalseBy" cancel-text="取消" description="请选择分拨墙" close-on-click-action>
|
|
|
|
|
+ <van-cell-group>
|
|
|
|
|
+ <van-cell v-for="(value,key) in equipmentMap" @click="selectEquipment(key)">
|
|
|
|
|
+ <template #title>
|
|
|
|
|
+ 分拨墙:{{ key}}(容器:{{value[0].container}})
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </van-cell>
|
|
|
|
|
+ </van-cell-group>
|
|
|
|
|
+ </van-action-sheet>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+<script setup lang="ts">
|
|
|
|
|
+import { onMounted, onUnmounted, ref } from 'vue'
|
|
|
|
|
+import { getHeader, goBack, scanError, scanSuccess } from '@/utils/android'
|
|
|
|
|
+import { closeListener, openListener, scanInit } from '@/utils/keydownListener'
|
|
|
|
|
+import { useStore } from '@/store/modules/user'
|
|
|
|
|
+import { showNotify } from 'vant'
|
|
|
|
|
+import { barcodeToUpperCase, toMap } from '@/utils/dataType'
|
|
|
|
|
+import InputBarcode from '@/views/outbound/picking/components/InputBarcode.vue'
|
|
|
|
|
+import Box from '@/views/haikang/putaway/components/Box.vue'
|
|
|
|
|
+import GoBack from '@/views/haikang/putaway/components/GoBack.vue'
|
|
|
|
|
+import { boxReturn, getShelveItemInfo, outboundEmptyBoxAndBindTask, setBoxInboundInventory } from '@/api/haikang'
|
|
|
|
|
+import { closeLoading, showLoading } from '@/utils/loading'
|
|
|
|
|
+const store = useStore()
|
|
|
|
|
+const warehouse = store.warehouse
|
|
|
|
|
+try {
|
|
|
|
|
+ getHeader()
|
|
|
|
|
+} catch (error) {
|
|
|
|
|
+}
|
|
|
|
|
+// 页面初始化
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ openListener()
|
|
|
|
|
+ scanInit(_handlerScan)
|
|
|
|
|
+ loadData()
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const dataList=ref([])
|
|
|
|
|
+
|
|
|
|
|
+//料箱编号
|
|
|
|
|
+const workBinNo = ref('')
|
|
|
|
|
+//扫描类型
|
|
|
|
|
+const scanType = ref(1) //料箱1、商品条码2,站台3
|
|
|
|
|
+//提示
|
|
|
|
|
+const tips = ref('请扫描料箱编号')
|
|
|
|
|
+//匹配库位条码
|
|
|
|
|
+const matchedBarcodeItem=ref([])
|
|
|
|
|
+//条码
|
|
|
|
|
+const searchBarcode = ref('')
|
|
|
|
|
+//上架数量
|
|
|
|
|
+const count = ref('')
|
|
|
|
|
+const countRef=ref(null)
|
|
|
|
|
+//上架库位
|
|
|
|
|
+const searchLocation=ref('')
|
|
|
|
|
+const locationList = (data) => {
|
|
|
|
|
+ return data.reduce((acc, item) => {
|
|
|
|
|
+ const key = item.boxCode
|
|
|
|
|
+ acc[key] = acc[key] || []
|
|
|
|
|
+ acc[key].push(item)
|
|
|
|
|
+ return acc
|
|
|
|
|
+ }, {})
|
|
|
|
|
+}
|
|
|
|
|
+//料箱库位
|
|
|
|
|
+const locationMap = ref({})
|
|
|
|
|
+const wallBinList = ref([
|
|
|
|
|
+ ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20'],
|
|
|
|
|
+ ['21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40'],
|
|
|
|
|
+ ['41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60'],
|
|
|
|
|
+])
|
|
|
|
|
+const getRows = (wall) => {
|
|
|
|
|
+ let rows = []
|
|
|
|
|
+ for (let i = 0; i < wall.length; i += 4) {
|
|
|
|
|
+ rows.push(wall.slice(i, i + 4))
|
|
|
|
|
+ }
|
|
|
|
|
+ return rows.reverse()
|
|
|
|
|
+}
|
|
|
|
|
+//料箱内商品
|
|
|
|
|
+const locationDetailList = ref([])
|
|
|
|
|
+// //当前扫描商品
|
|
|
|
|
+const barcodeActive = ref({})
|
|
|
|
|
+//分拨墙是否展示
|
|
|
|
|
+const equipmentTrueFalseBy=ref(false)
|
|
|
|
|
+// 分拨墙map
|
|
|
|
|
+const equipmentMap=ref({})
|
|
|
|
|
+//分拨墙条码列表
|
|
|
|
|
+const equipmentBarcodeList=ref([])
|
|
|
|
|
+//料箱内已扫描条码
|
|
|
|
|
+const locationScanBarcodeBinList = ref([])
|
|
|
|
|
+//料箱内商品所有格口
|
|
|
|
|
+const locationBarcodeBinList = ref([])
|
|
|
|
|
+const boxRef = ref(null)
|
|
|
|
|
+const _handlerScan = (code) => {
|
|
|
|
|
+ if (scanType.value == 1) {
|
|
|
|
|
+ workBinNo.value = code
|
|
|
|
|
+ showLoading()
|
|
|
|
|
+ getShelveItemInfo({warehouse, boxCode: code, }).then(res => {
|
|
|
|
|
+ if(res.data.length>0){
|
|
|
|
|
+ reset()
|
|
|
|
|
+ dataList.value=res.data
|
|
|
|
|
+ locationMap.value = locationList(res.data)
|
|
|
|
|
+ locationDetailList.value = locationMap.value[barcodeToUpperCase(code)]
|
|
|
|
|
+ equipmentMap.value=locationDetailList.value.reduce((acc, item) => {
|
|
|
|
|
+ if (!acc[item.equipment]) {
|
|
|
|
|
+ acc[item.equipment] = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ acc[item.equipment].push(item);
|
|
|
|
|
+ return acc;
|
|
|
|
|
+ }, {});
|
|
|
|
|
+ const keys = Object.keys(equipmentMap.value);
|
|
|
|
|
+ if (keys.length==1) {
|
|
|
|
|
+ equipmentBarcodeList.value = equipmentMap.value[keys[0]]
|
|
|
|
|
+ equipmentBarcodeList.value.forEach((item) => {
|
|
|
|
|
+ locationBarcodeBinList.value.push(item.bin)
|
|
|
|
|
+ })
|
|
|
|
|
+ locationBarcodeBinList.value = [...new Set(locationBarcodeBinList.value)]
|
|
|
|
|
+ } else {
|
|
|
|
|
+ equipmentTrueFalseBy.value=true
|
|
|
|
|
+ }
|
|
|
|
|
+ scanType.value = 2
|
|
|
|
|
+ tips.value = `请扫描商品条码`
|
|
|
|
|
+ scanSuccess()
|
|
|
|
|
+ }else{
|
|
|
|
|
+ scanError()
|
|
|
|
|
+ tips.value = `${workBinNo.value},待上架任务已取消`
|
|
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message: `${workBinNo.value},待上架任务已取消` })
|
|
|
|
|
+ workBinNo.value=''
|
|
|
|
|
+ }
|
|
|
|
|
+ closeLoading()
|
|
|
|
|
+ }).catch(err=>{
|
|
|
|
|
+ reset()
|
|
|
|
|
+ searchBarcode.value = ''
|
|
|
|
|
+ count.value=''
|
|
|
|
|
+ searchLocation.value=''
|
|
|
|
|
+ tips.value = err.message
|
|
|
|
|
+ barcodeActive.value={}
|
|
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message: err.message })
|
|
|
|
|
+ scanError()
|
|
|
|
|
+ closeLoading()
|
|
|
|
|
+ })
|
|
|
|
|
+ } else if (scanType.value == 2) {
|
|
|
|
|
+ matchedBarcodeItem.value = equipmentBarcodeList.value.filter(item =>
|
|
|
|
|
+ barcodeToUpperCase(item.barcode)== barcodeToUpperCase(code)|| barcodeToUpperCase(item.sku)== barcodeToUpperCase(code)||
|
|
|
|
|
+ item.barcodeAs== barcodeToUpperCase(code)
|
|
|
|
|
+ )
|
|
|
|
|
+ if (matchedBarcodeItem.value.length>0) {
|
|
|
|
|
+ searchBarcode.value = code
|
|
|
|
|
+ matchedBarcodeItem.value.forEach((item) => {
|
|
|
|
|
+ locationScanBarcodeBinList.value.push(item.bin)
|
|
|
|
|
+ })
|
|
|
|
|
+ locationScanBarcodeBinList.value = [...new Set(locationScanBarcodeBinList.value)]
|
|
|
|
|
+ barcodeActive.value =matchedBarcodeItem.value[0]
|
|
|
|
|
+ searchLocation.value=barcodeActive.value.locationId
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ boxRef.value?.clearHigh()
|
|
|
|
|
+ boxRef.value?.high(barcodeActive.value.gridNum || 1)
|
|
|
|
|
+ }, 300)
|
|
|
|
|
+ scanType.value = 3
|
|
|
|
|
+ count.value=1
|
|
|
|
|
+ countRef.value?.focus()
|
|
|
|
|
+ tips.value = `请扫输入上架数量`
|
|
|
|
|
+ scanError()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ count.value=''
|
|
|
|
|
+ searchBarcode.value = ''
|
|
|
|
|
+ searchLocation.value=''
|
|
|
|
|
+ barcodeActive.value={}
|
|
|
|
|
+ tips.value = `${code}-商品条码不匹配,请重新扫描`
|
|
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message: `${code}-商品条码不匹配,请重新扫描` })
|
|
|
|
|
+ scanError()
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if(scanType.value==4){
|
|
|
|
|
+ searchLocation.value = code
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 选择分拨墙
|
|
|
|
|
+const selectEquipment=(key)=>{
|
|
|
|
|
+ equipmentBarcodeList.value = equipmentMap.value[key]
|
|
|
|
|
+ equipmentTrueFalseBy.value=false
|
|
|
|
|
+ equipmentBarcodeList.value.forEach((item) => {
|
|
|
|
|
+ locationBarcodeBinList.value.push(item.bin)
|
|
|
|
|
+ })
|
|
|
|
|
+ locationBarcodeBinList.value = [...new Set(locationBarcodeBinList.value)]
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+const reset=()=>{
|
|
|
|
|
+ count.value=''
|
|
|
|
|
+ equipmentBarcodeList.value=[]
|
|
|
|
|
+ locationBarcodeBinList.value=[]
|
|
|
|
|
+ locationScanBarcodeBinList.value=[]
|
|
|
|
|
+ equipmentMap.value={}
|
|
|
|
|
+ dataList.value=[]
|
|
|
|
|
+}
|
|
|
|
|
+const inputCheck=()=>{
|
|
|
|
|
+ if(!workBinNo.value){
|
|
|
|
|
+ scanType.value = 1
|
|
|
|
|
+ tips.value = `请扫描料箱编号`
|
|
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message: `请扫描料箱编号` })
|
|
|
|
|
+ scanError()
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!searchBarcode.value){
|
|
|
|
|
+ scanType.value = 2
|
|
|
|
|
+ tips.value = `请扫描商品条码`
|
|
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message: `请扫描商品条码` })
|
|
|
|
|
+ scanError()
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!count.value){
|
|
|
|
|
+ scanType.value = 3
|
|
|
|
|
+ tips.value = `请输入上架数量`
|
|
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message: `请扫输入上架数量` })
|
|
|
|
|
+ countRef.value?.focus()
|
|
|
|
|
+ scanError()
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if(!searchLocation.value){
|
|
|
|
|
+ scanType.value = 4
|
|
|
|
|
+ tips.value = `请扫描上架库位`
|
|
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message: `请扫描上架库位` })
|
|
|
|
|
+ scanError()
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if(Number(count.value)>Number(barcodeActive.qty)){
|
|
|
|
|
+ scanType.value = 3
|
|
|
|
|
+ tips.value = `请输入上架数量`
|
|
|
|
|
+ scanError()
|
|
|
|
|
+ countRef.value?.focus()
|
|
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message: `上架数量不能大于预计上架数量` })
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ return true
|
|
|
|
|
+}
|
|
|
|
|
+const goBackRef=ref(null)
|
|
|
|
|
+const setPutaway=async (type)=>{
|
|
|
|
|
+ if(type==2){
|
|
|
|
|
+ if(!inputCheck()) return
|
|
|
|
|
+ //料箱需要分拨墙格口和扫描格口不一致
|
|
|
|
|
+ if(locationBarcodeBinList.value.length!=locationScanBarcodeBinList.value.length){
|
|
|
|
|
+ const res= await _setBoxInboundInventory()
|
|
|
|
|
+ refreshPutawayList(barcodeActive.value)
|
|
|
|
|
+ if(res){
|
|
|
|
|
+ barcodeActive.value=''
|
|
|
|
|
+ searchBarcode.value=''
|
|
|
|
|
+ searchLocation.value=''
|
|
|
|
|
+ count.value=''
|
|
|
|
|
+ scanType.value = 2
|
|
|
|
|
+ tips.value = `请继续扫描商品条码`
|
|
|
|
|
+ scanSuccess()
|
|
|
|
|
+ showNotify({ type: 'success', duration: 3000, message: `请继续扫描商品条码` })
|
|
|
|
|
+ }
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ let activeType='1'
|
|
|
|
|
+ if(locationBarcodeBinList.value.length==1 && count.value!=barcodeActive.value.qty){
|
|
|
|
|
+ activeType='2'
|
|
|
|
|
+ }
|
|
|
|
|
+ goBackRef.value?.show(workBinNo.value,activeType,count.value,barcodeActive.value)
|
|
|
|
|
+ }else if(type==1){
|
|
|
|
|
+ if(!barcodeActive.value.container){
|
|
|
|
|
+ scanType.value = 1
|
|
|
|
|
+ tips.value = `请先扫描商品条码,查询待上架信息`
|
|
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message: `请先扫描商品条码,查询待上架信息` })
|
|
|
|
|
+ scanError()
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ goBackRef.value?.show(workBinNo.value,'1','', {})
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+const setGoBack=async (item)=>{
|
|
|
|
|
+ console.log(item,'回库')
|
|
|
|
|
+ const res= await _setBoxInboundInventory()
|
|
|
|
|
+ if(res){
|
|
|
|
|
+ if(item.active==1){
|
|
|
|
|
+ const {warehouse,container,boxCode}=barcodeActive.value
|
|
|
|
|
+ const boxRes= await boxReturn({warehouse,container,boxCode})
|
|
|
|
|
+ if(boxRes){
|
|
|
|
|
+ reset()
|
|
|
|
|
+ barcodeActive.value={}
|
|
|
|
|
+ workBinNo.value=''
|
|
|
|
|
+ searchBarcode.value=''
|
|
|
|
|
+ searchLocation.value=''
|
|
|
|
|
+ scanType.value = 1
|
|
|
|
|
+ tips.value = `请扫描料箱编号`
|
|
|
|
|
+ showNotify({ type: 'success', duration: 3000, message: `请扫描下一个料箱编号` })
|
|
|
|
|
+ scanSuccess()
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if(item.active==2){
|
|
|
|
|
+ const {warehouse,container,boxCode,lotNum}=barcodeActive.value
|
|
|
|
|
+ const boxRes= await outboundEmptyBoxAndBindTask({warehouse,container,originalBoxCode:boxCode,lotNum,boxType:item.bin,boxEmpty:item.boxEmpty}).catch((err=>{
|
|
|
|
|
+ reset()
|
|
|
|
|
+ barcodeActive.value={}
|
|
|
|
|
+ workBinNo.value=''
|
|
|
|
|
+ searchBarcode.value=''
|
|
|
|
|
+ searchLocation.value=''
|
|
|
|
|
+ scanType.value = 1
|
|
|
|
|
+ tips.value = `请扫描料箱编号`
|
|
|
|
|
+ scanError()
|
|
|
|
|
+ }))
|
|
|
|
|
+ if(boxRes){
|
|
|
|
|
+ reset()
|
|
|
|
|
+ barcodeActive.value={}
|
|
|
|
|
+ workBinNo.value=''
|
|
|
|
|
+ searchBarcode.value=''
|
|
|
|
|
+ searchLocation.value=''
|
|
|
|
|
+ scanType.value = 1
|
|
|
|
|
+ tips.value = `料箱调取成功,请继续扫描料箱编号`
|
|
|
|
|
+ showNotify({ type: 'success', duration: 3000, message: `料箱调取成功,请继续扫描料箱编号` })
|
|
|
|
|
+ scanSuccess()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+// 上架
|
|
|
|
|
+const _setBoxInboundInventory = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ console.log(barcodeActive.value)
|
|
|
|
|
+ const {container,sku,boxCode,taskLineNoList,taskNo,warehouse,lotNum}=barcodeActive.value
|
|
|
|
|
+ const data={
|
|
|
|
|
+ container,sku,boxCode,taskLineNoList,taskNo,warehouse,lotNum,
|
|
|
|
|
+ location:searchLocation.value,
|
|
|
|
|
+ quantity:count.value
|
|
|
|
|
+ }
|
|
|
|
|
+ const res = await setBoxInboundInventory(data)
|
|
|
|
|
+ return res
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ scanError()
|
|
|
|
|
+ console.error('上架操作失败:', error);
|
|
|
|
|
+ return null
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+//设置条码
|
|
|
|
|
+const inputBarcodeRef = ref(null)
|
|
|
|
|
+const setBarcodeInput = (code, type) => {
|
|
|
|
|
+ const typeMap = { 1: '请扫描料箱编号', 2: '请扫商品条码', 3: '请扫站台编号', 4: '请扫上架库位' }
|
|
|
|
|
+ scanType.value = type
|
|
|
|
|
+ inputBarcodeRef.value?.show(code, typeMap[type])
|
|
|
|
|
+}
|
|
|
|
|
+// 数据刷新
|
|
|
|
|
+const loadData = () => {
|
|
|
|
|
+ // locationMap.value = locationList(result.value.items)
|
|
|
|
|
+}
|
|
|
|
|
+// 刷新待上架数据
|
|
|
|
|
+const refreshPutawayList = (item) => {
|
|
|
|
|
+ getShelveItemInfo({warehouse:item.warehouse, boxCode:item.boxCode,}).then(res => {
|
|
|
|
|
+ if(res.data.length>0) {
|
|
|
|
|
+ dataList.value = res.data
|
|
|
|
|
+ locationMap.value = locationList(res.data)
|
|
|
|
|
+ locationDetailList.value = locationMap.value[barcodeToUpperCase(item.boxCode)]
|
|
|
|
|
+ equipmentMap.value=locationDetailList.value.reduce((acc, item) => {
|
|
|
|
|
+ if (!acc[item.equipment]) {
|
|
|
|
|
+ acc[item.equipment] = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ acc[item.equipment].push(item);
|
|
|
|
|
+ return acc;
|
|
|
|
|
+ }, {})
|
|
|
|
|
+ equipmentBarcodeList.value = equipmentMap.value[item.equipment]
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+onUnmounted(() => {
|
|
|
|
|
+ closeListener()
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+window.onRefresh = loadData
|
|
|
|
|
+</script>
|
|
|
|
|
+<style scoped lang="sass">
|
|
|
|
|
+.container
|
|
|
|
|
+ background: #e9f4ff
|
|
|
|
|
+
|
|
|
|
|
+ .putaway
|
|
|
|
|
+ display: flex
|
|
|
|
|
+ flex-direction: column
|
|
|
|
|
+ height: calc(100vh - 46px)
|
|
|
|
|
+ justify-content: space-between
|
|
|
|
|
+ .putaway-tips
|
|
|
|
|
+ display: flex
|
|
|
|
|
+ justify-content: space-between
|
|
|
|
|
+ .putaway-tips-box
|
|
|
|
|
+ padding-right: 10px
|
|
|
|
|
+ background: #fffbe8
|
|
|
|
|
+ color: #333
|
|
|
|
|
+ font-size: 14px
|
|
|
|
|
+ font-weight: bold
|
|
|
|
|
+ .putaway-input
|
|
|
|
|
+ .code-input
|
|
|
|
|
+ ::v-deep(.van-cell)
|
|
|
|
|
+ padding: 5px 20px 0 20px
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep(.van-field__control)
|
|
|
|
|
+ border-bottom: 2px solid #efefef
|
|
|
|
|
+ font-size: 16px
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep(.van-field__label)
|
|
|
|
|
+ width: unset
|
|
|
|
|
+ font-size: 16px
|
|
|
|
|
+
|
|
|
|
|
+ .search-input-barcode
|
|
|
|
|
+ ::v-deep(.van-field__control)
|
|
|
|
|
+ border-bottom: 2px solid #0077ff
|
|
|
|
|
+ z-index: 2
|
|
|
|
|
+ .input-count
|
|
|
|
|
+ ::v-deep(.van-field__control)
|
|
|
|
|
+ line-height: 43px
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ .putaway-button
|
|
|
|
|
+ padding: 10px 20px
|
|
|
|
|
+
|
|
|
|
|
+ .wall-list-box
|
|
|
|
|
+ background: #646566
|
|
|
|
|
+ color: #fff
|
|
|
|
|
+ font-size: 14px
|
|
|
|
|
+ font-weight: bold
|
|
|
|
|
+ //position: fixed
|
|
|
|
|
+ bottom: 0
|
|
|
|
|
+ left: 0
|
|
|
|
|
+ z-index: 9
|
|
|
|
|
+ width: 100%
|
|
|
|
|
+
|
|
|
|
|
+ .wall-list
|
|
|
|
|
+ background: #c8c9cc
|
|
|
|
|
+ text-align: left
|
|
|
|
|
+ font-size: 14px
|
|
|
|
|
+ display: flex
|
|
|
|
|
+ gap: 5px
|
|
|
|
|
+
|
|
|
|
|
+ .wall-item
|
|
|
|
|
+ flex: 1
|
|
|
|
|
+ gap: 2px
|
|
|
|
|
+ display: flex
|
|
|
|
|
+ flex-direction: column
|
|
|
|
|
+
|
|
|
|
|
+ .wall-item-sub
|
|
|
|
|
+ display: flex
|
|
|
|
|
+ gap: 2px
|
|
|
|
|
+
|
|
|
|
|
+ .wall-item-bin
|
|
|
|
|
+ flex: 1
|
|
|
|
|
+ display: flex
|
|
|
|
|
+ background: #fff
|
|
|
|
|
+ align-items: center
|
|
|
|
|
+ justify-content: center
|
|
|
|
|
+ padding: 15px 0
|
|
|
|
|
+ font-size: 14px
|
|
|
|
|
+ color: #333
|
|
|
|
|
+ position: relative
|
|
|
|
|
+ //.wall-item-bin-text
|
|
|
|
|
+ .wall-item-bin-high
|
|
|
|
|
+ position: absolute
|
|
|
|
|
+ height: 100%
|
|
|
|
|
+ width: 100%
|
|
|
|
|
+ background: #ff8d29
|
|
|
|
|
+ font-size: 18px
|
|
|
|
|
+ font-weight: bold
|
|
|
|
|
+ display: flex
|
|
|
|
|
+ align-items: center
|
|
|
|
|
+ justify-content: center
|
|
|
|
|
+ animation: scaleAnimation 3s infinite
|
|
|
|
|
+ @keyframes scaleAnimation
|
|
|
|
|
+ 0%
|
|
|
|
|
+ transform: scale(0.8)
|
|
|
|
|
+ 50%
|
|
|
|
|
+ transform: scale(1)
|
|
|
|
|
+ 100%
|
|
|
|
|
+ transform: scale(0.8)
|
|
|
|
|
+
|
|
|
|
|
+ .nav-right
|
|
|
|
|
+ padding: 14px 0 12px 5px
|
|
|
|
|
+ color: #fff
|
|
|
|
|
+
|
|
|
|
|
+</style>
|