Browse Source

盘点库位 2024/7/1 13:35:17

pull/1/head
张立 9 months ago
parent
commit
6659954fbe
  1. 7
      src/common/basic.js
  2. 2
      src/mycomponents/job/jobComMainDetailCard.vue
  3. 9
      src/mycomponents/scan/winScanPackAndLocation.vue
  4. 6
      src/pages/count/coms/comCountJobCard.vue
  5. 4
      src/pages/count/job/countDetail.vue
  6. 68
      src/pages/count/job/countJob.vue
  7. 1
      src/pages/issue/coms/comScanIssuePack.vue
  8. 8
      src/pages/issue/job/issueDetail.vue

7
src/common/basic.js

@ -727,6 +727,13 @@ export function getPackingNumberAndBatch(managementList, itemCode, packingNumber
// }) // })
// scanErrorAudio(); // scanErrorAudio();
// } // }
export function compare(key) {
return function(a, b) {
var val1 = a[key];
var val2 = b[key];
return val2 - val1;
}
}
export function compareTime() { export function compareTime() {
return function(a, b) { return function(a, b) {

2
src/mycomponents/job/jobComMainDetailCard.vue

@ -1,7 +1,7 @@
<template> <template>
<view class=""> <view class="">
<view class="task_text" style="border-top: 1px solid #dedede; padding-top: 20rpx"> <view class="task_text" style="border-top: 1px solid #dedede; padding-top: 20rpx">
<!-- <itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="false" :objTextStyle="{ fontWeight: 'bold', fontSize: '40rpx' }"></itemCompareQty> --> <itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="false" :objTextStyle="{ fontWeight: 'bold', fontSize: '40rpx' }"></itemCompareQty>
<div> <div>
<pack v-if="isShowPack && dataContent.packingNumber != null" :packingCode="dataContent.packingNumber"> </pack> <pack v-if="isShowPack && dataContent.packingNumber != null" :packingCode="dataContent.packingNumber"> </pack>
<batch v-if="isShowBatch && dataContent.batch != null" :batch="dataContent.batch"></batch> <batch v-if="isShowBatch && dataContent.batch != null" :batch="dataContent.batch"></batch>

9
src/mycomponents/scan/winScanPackAndLocation.vue

@ -69,6 +69,11 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false default: false
}, },
//
isCount: {
type: Boolean,
default: false
},
// //
allowModifyLocation: { allowModifyLocation: {
type: Boolean, type: Boolean,
@ -282,7 +287,9 @@ const afterQueryBalance = (datas) => {
if (props.allowNullBalance) { if (props.allowNullBalance) {
allowNoneBalance(datas) allowNoneBalance(datas)
} else if (props.noShowBalanceMessage) { } else if (props.noShowBalanceMessage) {
if (Array.isArray(datas)) { if (props.isCount) {
countCallBack(datas)
} else if (Array.isArray(datas)) {
countCallBack(datas[0]) countCallBack(datas[0])
} else { } else {
countCallBack(datas) countCallBack(datas)

6
src/pages/count/coms/comCountJobCard.vue

@ -1,6 +1,9 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard> <!-- <jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard> -->
<to-location title="盘点库位" :locationCode="dataContent.toLocationCode || dataContent.locationCode"> </to-location>
<view class="" style="margin-left: 40rpx; font-size: 32rpx; font-weight: bold"> 阶段 : {{ handleGetCountStageName(dataContent.stage) }} </view>
<view class="" style="margin-left: 40rpx; font-size: 32rpx; font-weight: bold"> 策略 : {{ isOpenCount(dataContent.isOpenCount) }} </view>
</job-com-main-card> </job-com-main-card>
</template> </template>
@ -8,6 +11,7 @@
import { getCountStageName } from '@/common/directory.js' import { getCountStageName } from '@/common/directory.js'
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue' import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue'
import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue' import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
const props = defineProps({ const props = defineProps({
dataContent: { dataContent: {

4
src/pages/count/job/countDetail.vue

@ -42,7 +42,7 @@
</view> </view>
<win-scan-button @goScan="openScanPopup"></win-scan-button> <win-scan-button @goScan="openScanPopup"></win-scan-button>
<win-scan-pack-and-location ref="scanPopup" :noShowBalanceMessage="true" @getCountScanResult="getScanResult"> </win-scan-pack-and-location> <win-scan-pack-and-location ref="scanPopup" :noShowBalanceMessage="true" :isCount="true" @getCountScanResult="getScanResult"> </win-scan-pack-and-location>
<count-qty-edit ref="countQtyEditRef" @confirm="editConfirm" @close="editClose" :isShowStatus="true" :allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount == 'TRUE'"> </count-qty-edit> <count-qty-edit ref="countQtyEditRef" @confirm="editConfirm" @close="editClose" :isShowStatus="true" :allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount == 'TRUE'"> </count-qty-edit>
<balance-select ref="balanceSelectRef" @onSelectItem="selectBalanceItem"></balance-select> <balance-select ref="balanceSelectRef" @onSelectItem="selectBalanceItem"></balance-select>
<com-message ref="comMessageRef" /> <com-message ref="comMessageRef" />
@ -509,7 +509,7 @@ const addExistItemCodeToList = (detail, qty, inventoryStatus) => {
if (res) { if (res) {
// detail.qty = calc.add(qty, qty) // detail.qty = calc.add(qty, qty)
const newDetail = createAddDetailInfo(qty, inventoryStatus) // const newDetail = createAddDetailInfo(qty, inventoryStatus) //
detail.subList.push(newDetail) detail.subList.unshift(newDetail)
showMessage('添加成功') showMessage('添加成功')
updateData() updateData()
} }

68
src/pages/count/job/countJob.vue

@ -20,6 +20,9 @@
<u-loadmore :status="loadingType" /> <u-loadmore :status="loadingType" />
</view> </view>
<win-scan-button @goScan="openScanPopup" v-if="jobList.length > 0"></win-scan-button>
<winScanPackJob title="库位" ref="scanPopup" @getResult="getScanResult"> </winScanPackJob>
<jobListView ref="jobListRef" @selectItem="selectItem"></jobListView>
<com-message ref="comMessageRef" /> <com-message ref="comMessageRef" />
</view> </view>
</template> </template>
@ -39,6 +42,9 @@ import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comCountJobCard from '@/pages/count/coms/comCountJobCard.vue' import comCountJobCard from '@/pages/count/coms/comCountJobCard.vue'
import jobListPopup from '@/pages/count/coms/jobListPopup.vue' import jobListPopup from '@/pages/count/coms/jobListPopup.vue'
import jobInfoPopup from '@/pages/count/coms/jobInfoPopup.vue' import jobInfoPopup from '@/pages/count/coms/jobInfoPopup.vue'
import jobListView from '@/mycomponents/jobList/jobList.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from '@/mycomponents/scan/winScanPackJob.vue'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
@ -60,6 +66,8 @@ const filter = ref()
const comMessageRef = ref() const comMessageRef = ref()
const jobInfoPopupRef = ref() const jobInfoPopupRef = ref()
const jobListPopupRef = ref() const jobListPopupRef = ref()
const jobListRef = ref()
const scanPopup = ref()
onShow(() => { onShow(() => {
nextTick(() => { nextTick(() => {
getList('refresh') getList('refresh')
@ -162,6 +170,14 @@ const openJobDetail = (item) => {
const selectedItem = (item) => { const selectedItem = (item) => {
openJobDetail(item) openJobDetail(item)
} }
const openScanPopup = () => {
scanPopup.value.openScanPopup()
}
const selectItem = (item) => {
scanPopup.value.closeScanPopup()
openJobDetail(item)
}
const showItemList = (itemList) => { const showItemList = (itemList) => {
jobListPopupRef.value.openPopup(itemList) jobListPopupRef.value.openPopup(itemList)
} }
@ -254,6 +270,58 @@ const showMessage = (message) => {
} }
}) })
} }
const getScanResult = (result) => {
uni.showLoading({
title: '加载中....',
mask: true
})
const filters = []
filters.push({
column: 'status',
action: 'in',
value: '1,2'
})
filters.push({
column: 'locationCode',
action: '==',
value: result.label.code
})
const params = {
filters,
pageNo: 1,
pageSize: 1000,
sort: 'number',
by: 'DESC'
}
getCountJobList(params)
.then((res) => {
uni.hideLoading()
const resultList = res.data.list
resultList.forEach((item) => {
item.title = item.number
item.selected = false
})
const list = []
resultList.forEach((item) => {
if (!list.find((subItem) => subItem.title == item.title)) {
list.push(item)
}
})
if (list.length == 0) {
showMessage('未查找到库位' + `${result.label.code}】的盘点任务`)
} else if (list.length == 1) {
selectItem(list[0])
} else {
jobListRef.value.openList(list)
}
})
.catch((error) => {
uni.hideLoading()
showMessage(error)
})
}
</script> </script>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

1
src/pages/issue/coms/comScanIssuePack.vue

@ -290,6 +290,7 @@ const afterGetBalance = (label, balance, packageInfo) => {
batch.detail = fromLocation.Batchs[0].detail batch.detail = fromLocation.Batchs[0].detail
} }
fromLocation.Batchs.unshift(batch) fromLocation.Batchs.unshift(batch)
emit('afterScan')
} }
}) })
} else { } else {

8
src/pages/issue/job/issueDetail.vue

@ -313,12 +313,20 @@ const afterScan = () => {
const s = '' const s = ''
detail.Items.forEach((item) => { detail.Items.forEach((item) => {
let totalHandleQty = 0 let totalHandleQty = 0
let isHandleEmpty = false // handleQty =0;
item.Locations.forEach((lco) => { item.Locations.forEach((lco) => {
lco.Batchs.forEach((batch) => { lco.Batchs.forEach((batch) => {
if (batch.handleQty != 0) {
totalHandleQty = calc.add(totalHandleQty, batch.handleQty) totalHandleQty = calc.add(totalHandleQty, batch.handleQty)
} else {
isHandleEmpty = true
}
}) })
}) })
if (item.qty == totalHandleQty) { if (item.qty == totalHandleQty) {
if (isHandleEmpty) {
return
}
submit() submit()
} else { } else {
comMessageRef.value.showQuestionMessage(`实际扫描数量【${totalHandleQty}】与物料需求数量【${item.qty}】不一致,是否继续提交`, (res) => { comMessageRef.value.showQuestionMessage(`实际扫描数量【${totalHandleQty}】与物料需求数量【${item.qty}】不一致,是否继续提交`, (res) => {

Loading…
Cancel
Save