Browse Source

修改盘点扫描

hella_online_20240829
lijuncheng 5 months ago
parent
commit
25b50d5638
  1. 8
      src/common/basic.js
  2. 16
      src/mycomponents/scan/winScanPackAndLocation.vue
  3. 70
      src/pages/count/coms/comCountJobCard.vue
  4. 17
      src/pages/count/job/countDetail.vue
  5. 72
      src/pages/count/job/countJob.vue

8
src/common/basic.js

@ -728,6 +728,14 @@ 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) {
// 按照时间降序 // 按照时间降序

16
src/mycomponents/scan/winScanPackAndLocation.vue

@ -97,6 +97,11 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
//
isCount: {
type: Boolean,
default: false
},
// //
allowModifyLocation: { allowModifyLocation: {
type: Boolean, type: Boolean,
@ -334,11 +339,16 @@
if (this.allowNullBalance) { if (this.allowNullBalance) {
this.allowNoneBalance(datas); this.allowNoneBalance(datas);
} else if (this.noShowBalanceMessage) { } else if (this.noShowBalanceMessage) {
if (Array.isArray(datas)) { if(this.isCount){
this.countCallBack(datas[0]);
} else {
this.countCallBack(datas); this.countCallBack(datas);
}else {
if (Array.isArray(datas)) {
this.countCallBack(datas[0]);
} else {
this.countCallBack(datas);
}
} }
} else { } else {
this.mustHavaBalance(datas); this.mustHavaBalance(datas);
} }

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

@ -1,42 +1,50 @@
<template> <template>
<job-com-main-card :dataContent="dataContent"> <job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
</job-com-main-card>
</template>
<script> <jobComMainDetailCard :dataContent="dataContent">
import { </jobComMainDetailCard>
getCountStageName <view class="" style="margin-left: 40rpx; font-size: 32rpx; font-weight: bold;">
} from '@/common/directory.js'; 阶段 : {{getCountStageName(dataContent.stage)}}
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue' </view>
<view class="" style="margin-left: 40rpx; font-size: 32rpx;font-weight: bold;">
策略 : {{isOpenCount(dataContent.isOpenCount) }}
</view>
</job-com-main-card>
</template>
<script>
import {
getCountStageName
} from '@/common/directory.js';
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue'
import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue' import jobComMainDetailCard from '@/mycomponents/job/jobComMainDetailCard.vue'
export default { export default {
components: { components: {
jobComMainCard, jobComMainCard,
jobComMainDetailCard jobComMainDetailCard
}, },
data() { data() {
return {}; return {};
}, },
props: { props: {
dataContent: { dataContent: {
type: Object, type: Object,
default: {} default: {}
}, },
}, },
methods: { methods: {
getCountStageName(value){ getCountStageName(value) {
return getCountStageName(value) return getCountStageName(value)
}, },
isOpenCount(value){ isOpenCount(value) {
return value=="TRUE"?"明盘":"盲盘" return value == "TRUE" ? "明盘" : "盲盘"
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
</style> </style>

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

@ -48,10 +48,15 @@
</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
ref="scanPopup" :noShowBalanceMessage="true"
:isCount="true"
@getCountScanResult='getScanResult'>
</win-scan-pack-and-location> </win-scan-pack-and-location>
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" @close="editClose" :isShowStatus="true" <count-qty-edit ref="countQtyEdit" @confirm="editConfirm" @close="editClose" :isShowStatus="true"
:allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount=='TRUE'"> :allowEditStatus="editInventoryStatus"
:isShowBalance="jobContent.isOpenCount=='TRUE'">
</count-qty-edit> </count-qty-edit>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> <balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
@ -69,7 +74,9 @@
calc calc
} from '@/common/calc.js'; } from '@/common/calc.js';
import { Decimal } from 'decimal.js';// import {
Decimal
} from 'decimal.js'; //
import { import {
goHome, goHome,
@ -570,7 +577,7 @@
if (res) { if (res) {
var item = this.createAddItemInfo(this.balance, this.package); var item = this.createAddItemInfo(this.balance, this.package);
let newDetail = this.createAddDetailInfo(qty, inventoryStatus); // let newDetail = this.createAddDetailInfo(qty, inventoryStatus); //
item.subList.push(newDetail); item.subList.unshift(newDetail);
this.detailSource.push(item) this.detailSource.push(item)
this.showMessage('添加成功'); this.showMessage('添加成功');
this.updateData() this.updateData()
@ -587,7 +594,7 @@
if (res) { if (res) {
// detail.qty = calc.add(qty, qty) // detail.qty = calc.add(qty, qty)
let newDetail = that.createAddDetailInfo(qty, inventoryStatus); // let newDetail = that.createAddDetailInfo(qty, inventoryStatus); //
detail.subList.push(newDetail); detail.subList.unshift(newDetail);
this.showMessage('添加成功'); this.showMessage('添加成功');
that.updateData() that.updateData()
} }

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

@ -21,6 +21,10 @@
<uni-load-more :status="loadingType" /> <uni-load-more :status="loadingType" />
</view> </view>
<win-scan-button @goScan='openScanPopup' v-if="jobList.length>0"></win-scan-button>
<winScanPackJob title="库位" ref="scanPopup" @getResult='getScanResult' >
</winScanPackJob>
<jobList ref="jobList" @selectItem="selectItem"></jobList>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -47,6 +51,9 @@
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 jobList from '@/mycomponents/jobList/jobList.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
export default { export default {
name: 'receipt', name: 'receipt',
@ -55,7 +62,10 @@
jobFilter, jobFilter,
comCountJobCard, comCountJobCard,
jobListPopup, jobListPopup,
jobInfoPopup jobInfoPopup,
winScanPackJob,
jobList,
winScanButton
}, },
data() { data() {
return { return {
@ -196,6 +206,16 @@
this.openJobDetail(item); this.openJobDetail(item);
}, },
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item)
},
swipeClick(e, dataContent) { swipeClick(e, dataContent) {
if (e.content.text == "详情") { if (e.content.text == "详情") {
this.openjobInfoPopup(dataContent); this.openjobInfoPopup(dataContent);
@ -286,6 +306,56 @@
} }
}); });
}, },
getScanResult(result){
let that = this;
uni.showLoading({
title: "加载中....",
mask: true
});
var filters = []
filters.push({
column: "status",
action: "in",
value: '1,2'
})
filters.push({
column: "locationCode",
action: "==",
value: result.label.code
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 1000,
}
getCountJobList(params).then(res => {
uni.hideLoading();
let resultList = res.data.list;
resultList.forEach(item => {
item.title = item.number;
item.selected = false
})
let list = []
resultList.forEach(item => {
if (!list.find(subItem => subItem.title == item.title)) {
list.push(item)
}
})
if (resultList == 0) {
that.showMessage('未查找到库位' + '【' + result.label.code + '】的盘点任务');
} else if (resultList == 1) {
that.selectItem(list[0]);
}else {
that.$refs.jobList.openList(list)
}
}).catch(error => {
uni.hideLoading();
that.showMessage(error);
})
}
} }
} }
</script> </script>

Loading…
Cancel
Save