Browse Source

模拟扫描功能

hella_online_20240829
wangyufei 3 months ago
parent
commit
2cd14de25b
  1. 13
      src/mycomponents/package/packageCard.vue
  2. 3
      src/mycomponents/scan/winComScan.vue
  3. 7
      src/mycomponents/scan/winScanPack.vue
  4. 35
      src/mycomponents/scan/winScanPackAndLocation.vue
  5. 3
      src/pages/productReceipt/job/productReceiptDetail.vue
  6. 52
      src/pages/purchaseReceipt/job/receiptDetail.vue
  7. 42
      src/pages/putaway/job/putawayDetail.vue
  8. 2
      src/pages/putaway/job/putawayJob.vue

13
src/mycomponents/package/packageCard.vue

@ -93,6 +93,19 @@
}, },
watch: { watch: {
//
dataContent: {
handler(newVal, oldVal) {
if(newVal.scaned){
newVal.copyContent = "HPQ;V1.0;I" + newVal.itemCode + ";P" + newVal.packingNumber + ";B" + newVal.batch + ";Q" + newVal.qty
}else{
newVal.copyContent = ''
}
console.log('newVal.copyContent',newVal.copyContent)
},
immediate: true,
deep: true
}
}, },
methods: { methods: {

3
src/mycomponents/scan/winComScan.vue

@ -145,6 +145,9 @@
this.placeholderValue = '请扫描' + this.placeholder; this.placeholderValue = '请扫描' + this.placeholder;
}, },
methods: { methods: {
setItemCodeSimulate(scanMsg) {
this.scanMsg = scanMsg;
},
hide() { hide() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
// //

7
src/mycomponents/scan/winScanPack.vue

@ -20,6 +20,8 @@
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType" :isShowHistory="false" :clearResult="true"></win-com-scan>
<comMessage ref="comMessage" @afterClose="getfocus"></comMessage> <comMessage ref="comMessage" @afterClose="getfocus"></comMessage>
</view> </view>
</template> </template>
@ -55,6 +57,10 @@
}, },
methods: { methods: {
simulateScan(item){
this.$refs.comscansimulate.setItemCodeSimulate(item.copyContent)
this.$refs.comscansimulate.clickScanMsg();
},
openScanPopup() { openScanPopup() {
setTimeout(res => { setTimeout(res => {
this.$refs.popup.open('bottom') this.$refs.popup.open('bottom')
@ -75,6 +81,7 @@
}, },
getScanResult(result) { getScanResult(result) {
if (result.success) { if (result.success) {
this.$emit("getResult", result); this.$emit("getResult", result);
} else { } else {

35
src/mycomponents/scan/winScanPackAndLocation.vue

@ -46,6 +46,9 @@
</view> </view>
</uni-popup> </uni-popup>
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> <balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType" :isShowHistory="false" :clearResult="true"></win-com-scan>
</view> </view>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</template> </template>
@ -172,6 +175,38 @@
this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //; // this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //; //
this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); // this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //
}, },
//
openScanPopupForJobSimulate(fromLocationCode, fromLocationList, jobContent,item) {
this.fromLocationCode = fromLocationCode;
this.fromLocationList = fromLocationList;
if (fromLocationCode != '') {
// this.packGetFocus();
if (this.$refs.comscansimulate != undefined) {
this.$refs.comscansimulate.getfocus();
}
} else {
if (this.fromLocationList.length == 0) {
// this.locationGetFocus();
alert('没有来源库位:List')
} else {
this.fromLocationCode = this.fromLocationList[0];
}
}
this.fromInventoryStatuses = getDirectoryItemArray(jobContent.outInventoryStatuses)
this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //; //
this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //
let timer = setTimeout(res => {
if(timer){
clearTimeout(timer)
}
// this.$refs.comscansimulate.setItemCodeSimulate(item.copyContent)
// this.$refs.comscansimulate.clickScanMsg();
}, 500)
},
closeScanPopup(content) { closeScanPopup(content) {
this.$refs.popup.close(); this.$refs.popup.close();

3
src/pages/productReceipt/job/productReceiptDetail.vue

@ -224,7 +224,8 @@
if (this.scanedPackingNumber && this.scanedPackingNumber == s if (this.scanedPackingNumber && this.scanedPackingNumber == s
.packingNumber){ .packingNumber){
s.scaned = true s.scaned = true
s.handleQty =s.qty this.$refs.scanPopup.simulateScan(s);
// s.handleQty =s.qty
} }
}) })
}) })

52
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -102,6 +102,9 @@
import { import {
productDismantleJobClose productDismantleJobClose
} from '@/api/request2.js'; } from '@/api/request2.js';
import {
nextTick
} from 'vue';
export default { export default {
name: 'receipt_detail', name: 'receipt_detail',
@ -137,7 +140,7 @@
onLoad(option) { onLoad(option) {
this.id = option.id; this.id = option.id;
// this.scanedPackingNumber = option.scaned || ''; this.scanedPackingNumber = option.scaned || '';
this.operation = option.operation; this.operation = option.operation;
if (this.id != undefined) { if (this.id != undefined) {
// //
@ -219,13 +222,19 @@
that.jobStatus = res.data.status that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode that.jobToLocationCode = that.subList[0].toLocationCode
that.detailSource = getTreeDataSource(that.subList) that.detailSource = getTreeDataSource(that.subList)
that.detailSource.forEach(r => { that.isAllReceived = false;
r.subList.forEach(s => { nextTick(() => {
if (this.scanedPackingNumber && this.scanedPackingNumber == s that.detailSource.forEach(r => {
.packingNumber) s.scaned = true r.subList.forEach(s => {
if (this.scanedPackingNumber && this
.scanedPackingNumber == s
.packingNumber) {
s.scaned = true
this.$refs.scanPopup.simulateScan(s);
}
})
}) })
}) })
that.isAllReceived = false;
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');
} }
@ -423,7 +432,7 @@
mask: true mask: true
}); });
productDismantleJobClose(this.id).then(res => { productDismantleJobClose(this.id).then(res => {
console.log('拒收',res) console.log('拒收', res)
if (res.data) { if (res.data) {
navigateBack(1) navigateBack(1)
} else { } else {
@ -462,8 +471,8 @@
// //
let timerCount = 0 let timerCount = 0
const timer1 = setInterval(async ()=>{ const timer1 = setInterval(async () => {
if(timerCount == 15){ if (timerCount == 15) {
clearInterval(timer1) clearInterval(timer1)
uni.showToast({ uni.showToast({
title: "跳转打印页面失败", title: "跳转打印页面失败",
@ -479,25 +488,32 @@
}], }],
pageNo: 1, pageNo: 1,
pageSize: 1000, pageSize: 1000,
}).then(res1=>{ }).then(res1 => {
timerCount = timerCount + 1 timerCount = timerCount + 1
if(res1.data && res1.data.list&&res1.data.list.length&&(res1.data.total >= res.data.detailCount)){ if (res1.data && res1.data.list && res1.data
.list.length && (res1.data.total >= res
.data.detailCount)) {
uni.hideLoading() uni.hideLoading()
clearInterval(timer1) clearInterval(timer1)
const dataParams = { const dataParams = {
toLocationCode: res1.data.list[0].toLocationCode, toLocationCode: res1.data.list[0]
number: res1.data.list[0].number, .toLocationCode,
creator: res1.data.list[0].creator, number: res1.data.list[0].number,
createTime: res1.data.list[0].createTime, creator: res1.data.list[0].creator,
ids : res1.data.list.map(item=>item.masterId).join(',') createTime: res1.data.list[0]
.createTime,
ids: res1.data.list.map(item =>
item.masterId).join(',')
} }
console.log(dataParams) console.log(dataParams)
uni.navigateTo({ uni.navigateTo({
url:'/pages/pointPutawayJob/index?data='+encodeURIComponent(JSON.stringify(dataParams)) url: '/pages/pointPutawayJob/index?data=' +
encodeURIComponent(JSON
.stringify(dataParams))
}) })
} }
}) })
},2000) }, 2000)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")

42
src/pages/putaway/job/putawayDetail.vue

@ -190,15 +190,6 @@
that.jobStatus = res.data.status that.jobStatus = res.data.status
that.subList = res.data.subList; that.subList = res.data.subList;
that.detailSource = getTreeDataSource(that.subList) that.detailSource = getTreeDataSource(that.subList)
that.detailSource.forEach(r => {
r.subList.forEach(s => {
if (this.scanedPackingNumber && this.scanedPackingNumber == s
.packingNumber) s.scaned = true
s.inventoryStatus = s.inspectResult; //
})
})
that.fromLocationCode = that.subList[0].fromLocationCode that.fromLocationCode = that.subList[0].fromLocationCode
that.jobToLocationCode = that.subList[0].toLocationCode; that.jobToLocationCode = that.subList[0].toLocationCode;
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes) that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
@ -208,6 +199,18 @@
} else { } else {
that.toLocationCode = that.jobToLocationCode; that.toLocationCode = that.jobToLocationCode;
} }
that.detailSource.forEach(r => {
r.subList.forEach(s => {
if (this.scanedPackingNumber && this.scanedPackingNumber == s
.packingNumber) {
s.scaned = true
s.packList.forEach(item=>item.scaned = true)
s.inventoryStatus = s.inspectResult; //
this.openScanPopupSimulate(s)
}
})
})
} else { } else {
that.showMessage('列表数据为0'); that.showMessage('列表数据为0');
@ -252,6 +255,27 @@
// this.calcHandleQty(); // this.calcHandleQty();
calcTreeHandleQty(this.detailSource) calcTreeHandleQty(this.detailSource)
}, },
//
openScanPopupSimulate(item){
let fromlocationCode = '';
let fromlocationList = [];
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.find(res => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromlocationCode == '') {
fromlocationCode = l.fromLocationCode;
}
})
}
this.$refs.scanPopup.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, this.jobContent,item);
},
openScanPopup() { openScanPopup() {
let fromlocationCode = ''; let fromlocationCode = '';

2
src/pages/putaway/job/putawayJob.vue

@ -298,7 +298,7 @@
selectItem(item) { selectItem(item) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
uni.navigateTo({ uni.navigateTo({
url: './putawayDetail?id=' + item.masterId + '&status=' + item.status url: './putawayDetail?id=' + item.masterId + '&status=' + item.status+'&scaned='+item.packingNumber
}); });
}, },
getScanResult(result) { getScanResult(result) {

Loading…
Cancel
Save