From de398f47dd12b3890c9ee545422da78e82b60fa9 Mon Sep 17 00:00:00 2001
From: yanjinhui <3306209981@qq.com>
Date: 星期一, 08 十二月 2025 09:22:06 +0800
Subject: [PATCH] 修改PDA出入库中出现undefined问题,修改job中因为上游调用频率过快导致job死掉,修改前端报警信息使用不同颜色
---
新建文件夹/PDA/pages/stash/CheckFinish.vue | 282 +++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 228 insertions(+), 54 deletions(-)
diff --git "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckFinish.vue" "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckFinish.vue"
index 3275a7c..5d6593e 100644
--- "a/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckFinish.vue"
+++ "b/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/PDA/pages/stash/CheckFinish.vue"
@@ -16,12 +16,18 @@
</uni-forms-item>
<uni-forms-item :label="order_qty">
</uni-forms-item>
+ <uni-forms-item label="寰呮壂鐗╂枡缂栫爜:">
+ <uni-easyinput type="text" placeholder="璇锋壂鎻忕墿鏂欑紪鐮�" ref='materialInput'
+ :focus="step === 1" v-model="materialCode"
+ @confirm="materialCodeInput"
+ @blur="materialCodeInput" />
+ </uni-forms-item>
<uni-forms-item label="搴撲綅缂栧彿:">
- <uni-easyinput type="text" placeholder="璇锋壂鎻忓簱浣嶇紪鍙�" ref='midInput' :focus="!focus"
+ <uni-easyinput type="text" placeholder="璇锋壂鎻忓簱浣嶇紪鍙�" ref='midInput' :focus="step === 2"
v-model="barcode" @confirm="barcodeInput" />
</uni-forms-item>
<uni-forms-item label="瀹炵洏鏁伴噺:">
- <uni-easyinput type="text" placeholder="璇疯緭鍏ュ疄鐩樻暟閲�" ref='midInput' :focus="focus"
+ <uni-easyinput type="text" placeholder="璇疯緭鍏ュ疄鐩樻暟閲�" ref='midInput' :focus="step === 3"
v-model="materSn" @confirm="snInput" />
</uni-forms-item>
@@ -37,7 +43,7 @@
<view style="display: flex;justify-content: space-around;margin-top: 2%;">
<!-- <button @click="reset" type="default" size="default"
style="width: 160rpx;border: 1rpx solid #007aff;color: #007aff;">閲嶇疆</button> -->
- <button @click="submit" type="primary" size="default" style="width: 200rpx;">鐩樼偣瀹屾垚</button>
+ <button @click="submit" type="primary" size="default" style="width: 250rpx;">鐩樼偣瀹屾垚</button>
</view>
</uni-forms-item>
</uni-forms>
@@ -167,7 +173,10 @@
Testcheck: false,
pkmaterSn: "",
pkmatInfos: [],
- addressdisabled: false
+ addressdisabled: false,
+ materialCode: "", // 鏂板锛氭壂鎻忕殑鐗╂枡缂栫爜
+ materialCodeValid: false, // 鏂板锛氱墿鏂欑紪鐮侀獙璇佺姸鎬�
+ step: 1, // 鏂板锛�1-鐗╂枡缂栫爜锛�2-搴撲綅缂栧彿锛�3-鍏ュ簱鏁伴噺
}
},
onShow() {},
@@ -185,9 +194,60 @@
this.order_qty="璐﹂潰鏁伴噺锛�"+res.stockQuantity;
this.order_Inqty="鐗╂枡鍚嶇О锛�"+res.materielName;
this.goods_no="鐗╂枡缂栧彿锛�"+res.materielCode;
+ this.materielCode = res.materielCode; // 璁剧疆鐢ㄤ簬楠岃瘉鐨勭墿鏂欑紪鐮�
+
// this.getData();
},
methods: {
+ // 鐗╂枡缂栫爜楠岃瘉
+materialCodeInput() {
+ console.log("materialCodeInput 琚Е鍙�");
+ console.log("杈撳叆鍊�:", this.materialCode);
+ this.$nextTick(() => {
+ if (this.materialCode.trim() !== "") {
+ const scannedCode = this.materialCode.trim();
+ const expectedCode = this.materielCode;
+
+ console.log("鎵弿缂栫爜:", scannedCode);
+ console.log("鏈熸湜缂栫爜锛坢aterielCode锛�:", expectedCode);
+
+ if (scannedCode === expectedCode) {
+ this.materialCodeValid = true;
+ console.log("鉁� 鐗╂枡缂栫爜楠岃瘉鎴愬姛");
+
+ // 楠岃瘉鎴愬姛鍚庝笉娓呯┖鍊硷紝鐩存帴鍒囨崲鍒颁笅涓�姝�
+ this.step = 2;
+ this.$refs.uToast.show({
+ title: "鐗╂枡缂栫爜楠岃瘉鎴愬姛",
+ type: "success"
+ });
+ // 浣跨敤 $nextTick 纭繚鐒︾偣鍒囨崲鍦� DOM 鏇存柊鍚庢墽琛�
+ this.$nextTick(() => {
+ // 璁╁簱浣嶇紪鍙疯緭鍏ユ鑾峰緱鐒︾偣
+ this.$refs.midInput.focus();
+ });
+ } else {
+ this.materialCodeValid = false;
+ console.log("鉂� 鐗╂枡缂栫爜楠岃瘉澶辫触");
+
+ this.$refs.uToast.show({
+ title: `鐗╂枡缂栫爜涓嶅尮閰峘,
+ type: "error"
+ });
+
+ // 楠岃瘉澶辫触鏃舵竻绌哄�煎苟淇濇寔鐒︾偣鍦ㄧ墿鏂欑紪鐮佽緭鍏ユ
+ setTimeout(() => {
+ this.materialCode = "";
+ this.step = 1;
+ // 纭繚鐒︾偣鍥炲埌鐗╂枡缂栫爜杈撳叆妗�
+ this.$nextTick(() => {
+ this.$refs.materialInput.focus();
+ });
+ }, 500);
+ }
+ }
+ });
+},
// voiceSpeech(src) {
// innerAudioContext.src = src; // '../../static/success.mp3';
// innerAudioContext.play();
@@ -234,19 +294,23 @@
}
},
barcodeInput() {
- this.$nextTick(function(x) {
+ this.$nextTick(() => {
if (this.barcode.length > 0) {
- // if (this.barcode.substring(0, 1) == 'A' || this.barcode.substring(0, 2) == 'TP') {
- this.focus = true;
- // } else {
- // this.$refs.uToast.show({
- // title: "鎵爜閿欒,璇锋壂鎻忔墭鐩樼爜",
- // type: "error"
- // })
- // }
+ this.step = 3; // 鍒囨崲鍒板叆搴撴暟閲�
+ this.$refs.uToast.show({
+ title: "搴撲綅缂栧彿鎵弿鎴愬姛",
+ type: "success"
+ });
+ // 娣诲姞寤舵椂纭繚鎵爜瀹屾垚
+ setTimeout(() => {
+ this.$nextTick(() => {
+ this.$refs.midInput.focus();
+ });
+ }, 100);
}
})
},
+
snInput() {
this.$nextTick(() => {
if (this.materSn != "") {
@@ -438,50 +502,160 @@
}
})
},
- submit() {
- if (this.barcode == "") {
- this.$refs.uToast.show({
- title: "璇锋壂鎻忚揣浣嶇紪鍙�",
- type: 'error'
- })
- return;
- }
- if (this.materSn.length == 0) {
- this.$refs.uToast.show({
- title: "璇疯緭鍏ュ疄鐩樻暟閲�",
- type: 'error'
- })
- return;
- }
+ // submit() {
+ // if (this.barcode == "") {
+ // this.$refs.uToast.show({
+ // title: "璇锋壂鎻忚揣浣嶇紪鍙�",
+ // type: 'error'
+ // })
+ // return;
+ // }
+ // if (this.materSn.length == 0) {
+ // this.$refs.uToast.show({
+ // title: "璇疯緭鍏ュ疄鐩樻暟閲�",
+ // type: 'error'
+ // })
+ // return;
+ // }
+ // this.$u.post('/api/DeliveryOrder/CheckFinish', {
+ // MainData: {
+ // "locationCode": this.barcode,
+ // "taskId":this.taskId,
+ // // "warehouseCode": this.warehouseId,
+ // // "orderNo": this.orderNo,
+ // "qty": this.materSn,
+ // // "batchNo": this.batchNo,
+ // },
+ // // DelKeys: this.sns
+ // }).then(res => {
+ // this.Testcheck = false;
+ // if (res.status) {
+ // this.$refs.uToast.show({
+ // title: "鐩樼偣鎴愬姛",
+ // type: "success"
+ // })
+ // // this.Inqty=res.message;
+ // // this.order_Inqty="宸插嚭搴撴暟閲忥細"+this.Inqty;
+ // this.barcode="";
+ // // uni.setStorageSync('checkTask',true);
+
+
+ // //鍏抽敭淇敼锛氫娇鐢� getCurrentPages 鑾峰彇鍓嶄竴涓〉闈㈠苟鐩存帴璋冪敤鍏舵柟娉� Y
+ // const pages = getCurrentPages();
+ // const prevPage = pages[pages.length - 2]; // 鑾峰彇涓婁竴涓〉闈㈠疄渚�
+ // console.log('鍓嶄竴涓〉闈�:', prevPage);
+
+ // if (prevPage && prevPage.refreshData) {
+ // // 鐩存帴璋冪敤涓婁竴涓〉闈㈢殑鍒锋柊鏂规硶
+ // prevPage.refreshData();
+ // console.log('宸茶皟鐢ㄥ墠涓�涓〉闈㈢殑鐩樼偣鍒锋柊鏂规硶');
+ // }
+
+ // setTimeout(() => {
+ // uni.navigateBack({
+ // delta: 1
+ // });
+ // }, 300);
+ // // this.materSn="";
+ // } else {
+ // this.$refs.uToast.show({
+ // title: res.message,
+ // type: "error"
+ // })
+ // }
+ // })
+ // }
+ submit() {
+ if (!this.materialCodeValid) {
+ this.$refs.uToast.show({
+ title: "璇峰厛鎵弿骞堕獙璇佺墿鏂欑紪鐮�",
+ type: 'error'
+ });
+ return;
+ }
+ if (this.barcode == "") {
+ this.$refs.uToast.show({
+ title: "璇锋壂鎻忚揣浣嶇紪鍙�",
+ type: 'error'
+ })
+ return;
+ }
+ if (this.materSn.length == 0) {
+ this.$refs.uToast.show({
+ title: "璇疯緭鍏ュ疄鐩樻暟閲�",
+ type: 'error'
+ })
+ return;
+ }
+
+ // 鏂板浜屾纭閫昏緫
+ uni.showModal({
+ title: '纭鐩樼偣',
+ content: '鎮ㄧ‘瀹氳鎻愪氦鐩樼偣淇℃伅鍚楋紵',
+ success: (res) => {
+ if (res.confirm) {
+ // 鏄剧ず鍔犺浇涓�
+ uni.showLoading({
+ title: '鎻愪氦涓�...',
+ mask: true
+ });
+
this.$u.post('/api/DeliveryOrder/CheckFinish', {
- MainData: {
- "locationCode": this.barcode,
- "taskId":this.taskId,
- // "warehouseCode": this.warehouseId,
- // "orderNo": this.orderNo,
- "qty": this.materSn,
- // "batchNo": this.batchNo,
- },
- // DelKeys: this.sns
+ MainData: {
+ "locationCode": this.barcode,
+ "taskId": this.taskId,
+ "qty": this.materSn,
+ },
}).then(res => {
- this.Testcheck = false;
- if (res.status) {
- this.$refs.uToast.show({
- title: "鐩樼偣鎴愬姛",
- type: "success"
- })
- this.Inqty=res.message;
- // this.order_Inqty="宸插嚭搴撴暟閲忥細"+this.Inqty;
- this.barcode="";
- // this.materSn="";
- } else {
- this.$refs.uToast.show({
- title: res.message,
- type: "error"
- })
- }
- })
+ uni.hideLoading();
+
+ this.Testcheck = false;
+ if (res.status) {
+ this.$refs.uToast.show({
+ title: "鐩樼偣鎴愬姛",
+ type: "success"
+ })
+
+ // 鎵嬪姩娓呯┖鎵�鏈夎緭鍏ユ暟鎹�
+ this.materialCode = "";
+ this.materialCodeValid = false;
+ this.barcode = "";
+ this.materSn = "";
+ this.step = 1; // 閲嶇疆姝ラ鍒扮涓�姝�
+
+ // 璁剧疆鐩樼偣涓撶敤鐨勫埛鏂版爣璁�
+ uni.setStorageSync('needRefreshCheck', true);
+
+ // 寤惰繜杩斿洖锛岃B椤甸潰鍒锋柊鏁版嵁
+ setTimeout(() => {
+ uni.navigateBack({
+ delta: 1
+ });
+ }, 500);
+
+ // 浣跨敤 $nextTick 纭繚鐒︾偣璁剧疆鍦� DOM 鏇存柊鍚庢墽琛�
+ this.$nextTick(() => {
+ // 纭繚鐗╂枡缂栫爜杈撳叆妗嗚幏寰楃劍鐐�
+ this.$refs.materialInput.focus();
+ });
+
+ } else {
+ this.$refs.uToast.show({
+ title: res.message,
+ type: "error"
+ })
+ }
+ }).catch(err => {
+ uni.hideLoading();
+ this.$refs.uToast.show({
+ title: "璇锋眰澶辫触锛岃閲嶈瘯",
+ type: "error"
+ });
+ });
}
+ }
+ });
+ }
}
}
</script>
--
Gitblit v1.9.3