Browse Source

模拟扫描功能

hella_online_20240829
wangyufei 5 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. 34
      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: {
//
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: {

3
src/mycomponents/scan/winComScan.vue

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

7
src/mycomponents/scan/winScanPack.vue

@ -20,6 +20,8 @@
</view>
</view>
</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>
</view>
</template>
@ -55,6 +57,10 @@
},
methods: {
simulateScan(item){
this.$refs.comscansimulate.setItemCodeSimulate(item.copyContent)
this.$refs.comscansimulate.clickScanMsg();
},
openScanPopup() {
setTimeout(res => {
this.$refs.popup.open('bottom')
@ -75,6 +81,7 @@
},
getScanResult(result) {
if (result.success) {
this.$emit("getResult", result);
} else {

35
src/mycomponents/scan/winScanPackAndLocation.vue

@ -46,6 +46,9 @@
</view>
</uni-popup>
<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>
<comMessage ref="comMessage"></comMessage>
</template>
@ -172,6 +175,38 @@
this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //; //
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) {
this.$refs.popup.close();

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

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

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

@ -102,6 +102,9 @@
import {
productDismantleJobClose
} from '@/api/request2.js';
import {
nextTick
} from 'vue';
export default {
name: 'receipt_detail',
@ -137,7 +140,7 @@
onLoad(option) {
this.id = option.id;
// this.scanedPackingNumber = option.scaned || '';
this.scanedPackingNumber = option.scaned || '';
this.operation = option.operation;
if (this.id != undefined) {
//
@ -219,13 +222,19 @@
that.jobStatus = res.data.status
that.jobToLocationCode = that.subList[0].toLocationCode
that.detailSource = getTreeDataSource(that.subList)
that.isAllReceived = false;
nextTick(() => {
that.detailSource.forEach(r => {
r.subList.forEach(s => {
if (this.scanedPackingNumber && this.scanedPackingNumber == s
.packingNumber) s.scaned = true
if (this.scanedPackingNumber && this
.scanedPackingNumber == s
.packingNumber) {
s.scaned = true
this.$refs.scanPopup.simulateScan(s);
}
})
})
})
that.isAllReceived = false;
} else {
that.showMessage('列表数据为0');
}
@ -481,19 +490,26 @@
pageSize: 1000,
}).then(res1 => {
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()
clearInterval(timer1)
const dataParams = {
toLocationCode: res1.data.list[0].toLocationCode,
toLocationCode: res1.data.list[0]
.toLocationCode,
number: res1.data.list[0].number,
creator: res1.data.list[0].creator,
createTime: res1.data.list[0].createTime,
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)
uni.navigateTo({
url:'/pages/pointPutawayJob/index?data='+encodeURIComponent(JSON.stringify(dataParams))
url: '/pages/pointPutawayJob/index?data=' +
encodeURIComponent(JSON
.stringify(dataParams))
})
}
})

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

@ -190,15 +190,6 @@
that.jobStatus = res.data.status
that.subList = res.data.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.jobToLocationCode = that.subList[0].toLocationCode;
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes)
@ -208,6 +199,18 @@
} else {
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 {
that.showMessage('列表数据为0');
@ -252,6 +255,27 @@
// this.calcHandleQty();
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() {
let fromlocationCode = '';

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

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

Loading…
Cancel
Save