Browse Source

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

pull/1/head
zhang_li 5 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. 10
      src/pages/issue/job/issueDetail.vue

7
src/common/basic.js

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

2
src/mycomponents/job/jobComMainDetailCard.vue

@ -1,7 +1,7 @@
<template>
<view class="">
<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>
<pack v-if="isShowPack && dataContent.packingNumber != null" :packingCode="dataContent.packingNumber"> </pack>
<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,
default: false
},
//
isCount: {
type: Boolean,
default: false
},
//
allowModifyLocation: {
type: Boolean,
@ -282,7 +287,9 @@ const afterQueryBalance = (datas) => {
if (props.allowNullBalance) {
allowNoneBalance(datas)
} else if (props.noShowBalanceMessage) {
if (Array.isArray(datas)) {
if (props.isCount) {
countCallBack(datas)
} else if (Array.isArray(datas)) {
countCallBack(datas[0])
} else {
countCallBack(datas)

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

@ -1,6 +1,9 @@
<template>
<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>
</template>
@ -8,6 +11,7 @@
import { getCountStageName } from '@/common/directory.js'
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue'
import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
const props = defineProps({
dataContent: {

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

@ -42,7 +42,7 @@
</view>
<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>
<balance-select ref="balanceSelectRef" @onSelectItem="selectBalanceItem"></balance-select>
<com-message ref="comMessageRef" />
@ -509,7 +509,7 @@ const addExistItemCodeToList = (detail, qty, inventoryStatus) => {
if (res) {
// detail.qty = calc.add(qty, qty)
const newDetail = createAddDetailInfo(qty, inventoryStatus) //
detail.subList.push(newDetail)
detail.subList.unshift(newDetail)
showMessage('添加成功')
updateData()
}

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

@ -20,6 +20,9 @@
<u-loadmore :status="loadingType" />
</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" />
</view>
</template>
@ -39,6 +42,9 @@ import jobFilter from '@/mycomponents/job/jobFilter.vue'
import comCountJobCard from '@/pages/count/coms/comCountJobCard.vue'
import jobListPopup from '@/pages/count/coms/jobListPopup.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'
// store
@ -60,6 +66,8 @@ const filter = ref()
const comMessageRef = ref()
const jobInfoPopupRef = ref()
const jobListPopupRef = ref()
const jobListRef = ref()
const scanPopup = ref()
onShow(() => {
nextTick(() => {
getList('refresh')
@ -162,6 +170,14 @@ const openJobDetail = (item) => {
const selectedItem = (item) => {
openJobDetail(item)
}
const openScanPopup = () => {
scanPopup.value.openScanPopup()
}
const selectItem = (item) => {
scanPopup.value.closeScanPopup()
openJobDetail(item)
}
const showItemList = (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>
<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
}
fromLocation.Batchs.unshift(batch)
emit('afterScan')
}
})
} else {

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

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

Loading…
Cancel
Save