Browse Source

修改盘点扫描

hella_online_20240829
lijuncheng 3 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();
// }
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) {
// 按照时间降序

16
src/mycomponents/scan/winScanPackAndLocation.vue

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

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

@ -1,42 +1,50 @@
<template>
<job-com-main-card :dataContent="dataContent">
<jobComMainDetailCard :dataContent="dataContent"></jobComMainDetailCard>
</job-com-main-card>
</template>
<job-com-main-card :dataContent="dataContent">
<script>
import {
getCountStageName
} from '@/common/directory.js';
import jobComMainCard from '@/mycomponents/job/jobComMainCard.vue'
<jobComMainDetailCard :dataContent="dataContent">
</jobComMainDetailCard>
<view class="" style="margin-left: 40rpx; font-size: 32rpx; font-weight: bold;">
阶段 : {{getCountStageName(dataContent.stage)}}
</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'
export default {
components: {
jobComMainCard,
export default {
components: {
jobComMainCard,
jobComMainDetailCard
},
data() {
return {};
},
},
data() {
return {};
},
props: {
dataContent: {
type: Object,
default: {}
},
},
props: {
dataContent: {
type: Object,
default: {}
},
},
methods: {
getCountStageName(value){
methods: {
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value){
return value=="TRUE"?"明盘":"盲盘"
isOpenCount(value) {
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>
<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>
<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>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<comMessage ref="comMessage"></comMessage>
@ -69,7 +74,9 @@
calc
} from '@/common/calc.js';
import { Decimal } from 'decimal.js';//
import {
Decimal
} from 'decimal.js'; //
import {
goHome,
@ -570,7 +577,7 @@
if (res) {
var item = this.createAddItemInfo(this.balance, this.package);
let newDetail = this.createAddDetailInfo(qty, inventoryStatus); //
item.subList.push(newDetail);
item.subList.unshift(newDetail);
this.detailSource.push(item)
this.showMessage('添加成功');
this.updateData()
@ -587,7 +594,7 @@
if (res) {
// detail.qty = calc.add(qty, qty)
let newDetail = that.createAddDetailInfo(qty, inventoryStatus); //
detail.subList.push(newDetail);
detail.subList.unshift(newDetail);
this.showMessage('添加成功');
that.updateData()
}

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

@ -21,6 +21,10 @@
<uni-load-more :status="loadingType" />
</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>
</view>
</template>
@ -47,6 +51,9 @@
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 jobList from '@/mycomponents/jobList/jobList.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackJob from "@/mycomponents/scan/winScanPackJob.vue"
export default {
name: 'receipt',
@ -55,7 +62,10 @@
jobFilter,
comCountJobCard,
jobListPopup,
jobInfoPopup
jobInfoPopup,
winScanPackJob,
jobList,
winScanButton
},
data() {
return {
@ -196,6 +206,16 @@
this.openJobDetail(item);
},
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
selectItem(item) {
this.$refs.scanPopup.closeScanPopup();
this.openJobDetail(item)
},
swipeClick(e, dataContent) {
if (e.content.text == "详情") {
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>

Loading…
Cancel
Save