From a70034659894cf2c3cd88584cd3e424f3203c8e5 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期二, 24 十二月 2024 17:05:49 +0800 Subject: [PATCH] 添加PDA拣选完成 --- 代码管理/淮安PDA/pages/raworderboxing/raworderboxing.vue | 153 +++++++++++++++++++++++++++++++++----------------- 1 files changed, 100 insertions(+), 53 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/pages/raworderboxing/raworderboxing.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/pages/raworderboxing/raworderboxing.vue" index 69d5602..ae5ce1f 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/pages/raworderboxing/raworderboxing.vue" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/pages/raworderboxing/raworderboxing.vue" @@ -24,7 +24,7 @@ </uni-forms-item> </uni-forms> <uni-list> - <uni-list-item direction="column" v-for="item in matTotal" :key="item.matCode"> + <!-- <uni-list-item direction="column" v-for="item in matTotal" :key="item.matCode"> <template v-slot:body> <view class="uni-list-box"> <view class="uni-content"> @@ -33,7 +33,7 @@ </view> </view> </template> - </uni-list-item> + </uni-list-item> --> <uni-list-item direction="column" v-for="(item,index) in matInfos" :key="item.sn"> <template v-slot:body> <view class="uni-list-box"> @@ -41,9 +41,12 @@ @click="deleteList(item.sn)"> </uni-icons> <view class="uni-content"> - <view class="uni-title-sub uni-ellipsis-2">璁㈠崟鍙凤細{{item.orderNo}}</view> - <view class="uni-note">鐗╂枡缂栫爜锛歿{item.matCode}}</view> - <view class="uni-note">鏁伴噺锛歿{item.matQty}}</view> + <view class="uni-title-sub uni-ellipsis-2">閲囪喘鍗曞彿锛歿{item.purchaseOrderNo}}</view> + <view class="uni-note">鐗╂枡缂栫爜锛歿{item.materielCode}}</view> + <view class="uni-note">鎵规鍙凤細{{item.lotNo}}</view> + <view class="uni-note">鏁伴噺锛歿{item.quantity}}</view> + <view class="uni-note">鐢熶骇鏃ユ湡锛歿{item.productionDate}}</view> + <view class="uni-note">鏈夋晥鏈燂細{{item.effectiveDate}}</view> </view> </view> </template> @@ -150,7 +153,7 @@ export default { data() { return { - items: ['缁勭洏', '鍏ュ簱', '鍗曟嵁淇℃伅'],//, '瑙g洏' + items: ['缁勭洏', '鍏ュ簱', '鍗曟嵁淇℃伅'], //, '瑙g洏' current: 0, matTotal: [], matInfos: [], @@ -168,7 +171,8 @@ value: "", matInfo: [], value2: "", - matTotals:[] + matTotals: [], + warehouseId:"" } }, onShow() {}, @@ -176,6 +180,7 @@ this.focus = false; this.addressFocus = false; this.orderNo = res.orderNo; + this.warehouseId=res.warehouseId; this.label = "鍗曟嵁缂栧彿锛�" + this.orderNo; this.getData(); }, @@ -185,7 +190,7 @@ innerAudioContext.play(); }, //瑙g洏 - releasebox(){ + releasebox() { if (this.value.length == 0) { this.$refs.uToast.show({ title: "璇锋壂鐮�", @@ -223,7 +228,7 @@ } }) }, - releaseboxInput(){ + releaseboxInput() { this.$nextTick(() => { if (this.value.length == 0) { return; @@ -267,7 +272,7 @@ } }) }, - + updateFocus() { this.$nextTick(() => { this.materSn = ''; @@ -311,7 +316,7 @@ this.$nextTick(function(x) { if (this.barcode.length > 0) { // if (this.barcode.substring(0, 1) == 'A' || this.barcode.substring(0, 2) == 'TP') { - this.focus = true; + this.focus = true; // } else { // this.$refs.uToast.show({ // title: "鎵爜閿欒,璇锋壂鎻忔墭鐩樼爜", @@ -329,53 +334,93 @@ setTimeout(() => { this.materSn = ""; }, 10); - var matInfo = matSn.split('|'); - - if (matInfo.length == 7) { - var matObj = { - matCode: matInfo[1], - matProductionDate: matInfo[3], - matQty: matInfo[5], - orderNo: matInfo[6], - sn: matSn - } - var temp = this.matInfos.find(x => x.orderNo == matObj.orderNo); - if (!temp) { - var tmp = this.matTotal.find(x => x.matCode == matObj.matCode); - if (!tmp) { - this.matTotal.push({ - matCode: matObj.matCode, - matQuantity: parseInt(matObj.matQty) + this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => { + if (res.status) { + // debugger + // this.matTotal.push({ + // matCode: res.data.materielCode, + // matQuantity: parseInt(res.data.quantity) + // }); + // this.sns.push(res.data.serialNumber); + + this.matInfos.splice(0, this.matInfos.length); + this.matInfos.push(res.data); + if (res.message) { + this.$refs.uToast.show({ + title: res.message, + type: "error" }) - } else { - tmp.matQuantity += parseInt(matObj.matQty); + // setTimeout(this.updateFocus,200); + setTimeout(() => { + this.voiceSpeech('../../static/fail.mp3'); + }, 100); + return; } - this.sns.push(matSn); - this.matInfos.push(matObj); - setTimeout(this.updateFocus, 200); + // setTimeout(this.updateFocus,200); setTimeout(() => { this.voiceSpeech('../../static/success.mp3'); }, 100); } else { + // this.innerCode = ""; this.$refs.uToast.show({ - title: "鎵爜閲嶅", + title: res.message, type: "error" }) - setTimeout(this.updateFocus, 200); + // setTimeout(this.updateFocus,200); setTimeout(() => { this.voiceSpeech('../../static/fail.mp3'); }, 100); } - } else { - this.$refs.uToast.show({ - title: "鎵爜閿欒,璇锋壂鎻忔纭唴绠辩爜", - type: "error" - }) - setTimeout(this.updateFocus, 200); - setTimeout(() => { - this.voiceSpeech('../../static/fail.mp3'); - }, 100); - } + }) + + + // var matInfo = matSn.split('|'); + + // if (matInfo.length == 7) { + // var matObj = { + // matCode: matInfo[1], + // matProductionDate: matInfo[3], + // matQty: matInfo[5], + // orderNo: matInfo[6], + // sn: matSn + // } + // var temp = this.matInfos.find(x => x.orderNo == matObj.orderNo); + // if (!temp) { + // var tmp = this.matTotal.find(x => x.matCode == matObj.matCode); + // if (!tmp) { + // this.matTotal.push({ + // matCode: matObj.matCode, + // matQuantity: parseInt(matObj.matQty) + // }) + // } else { + // tmp.matQuantity += parseInt(matObj.matQty); + // } + // this.sns.push(matSn); + // this.matInfos.push(matObj); + // setTimeout(this.updateFocus, 200); + // setTimeout(() => { + // this.voiceSpeech('../../static/success.mp3'); + // }, 100); + // } else { + // this.$refs.uToast.show({ + // title: "鎵爜閲嶅", + // type: "error" + // }) + // setTimeout(this.updateFocus, 200); + // setTimeout(() => { + // this.voiceSpeech('../../static/fail.mp3'); + // }, 100); + // } + // } else { + // this.$refs.uToast.show({ + // title: "鎵爜閿欒,璇锋壂鎻忔纭唴绠辩爜", + // type: "error" + // }) + // setTimeout(this.updateFocus, 200); + // setTimeout(() => { + // this.voiceSpeech('../../static/fail.mp3'); + // }, 100); + // } } }) }, @@ -383,17 +428,18 @@ var postData = { MainData: { "barcode": this.inboundBarcode, - "startPoint": this.address + "startPoint": this.address, + "warehouseId":this.warehouseId } } - this.$u.post('/api/Inbound/RequestInbound', postData).then(res => { + this.$u.post('/api/Task/RequestInboundTask', postData).then(res => { if (res.status) { uni.$showMsg(res.message); this.inboundBarcode = ""; this.address = ""; - setTimeout(()=>{ + setTimeout(() => { this.addressFocus = false; - },200); + }, 200); } else { this.$refs.uToast.show({ title: res.message, @@ -423,7 +469,7 @@ sn = item.sn; var tmp = this.matTotal.find(x => x.matCode == item.matCode); if (tmp) { - tmp.matQuantity -= parseInt(item.matQty); + tmp.matQuantity -= parseInt(item.quantity); } else { } @@ -443,7 +489,7 @@ }) return; } - if (this.sns.length == 0) { + if (this.matInfos.length == 0) { this.$refs.uToast.show({ title: "璇锋壂鎻忓唴绠辨爣绛�", type: 'error' @@ -452,9 +498,10 @@ } this.$u.post('/api/InboundOrder/MaterielGroup', { MainData: { - "pallet_barcode": this.barcode, + "palletCode": this.barcode, "orderNo": this.orderNo, - "isFull": this.check + // "isFull": this.check + "warehouseId":this.warehouseId }, DelKeys: this.sns }).then(res => { -- Gitblit v1.9.3