From eb7892b61b050646ad11e7a36942c2a2a16a24f2 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期四, 03 七月 2025 20:12:58 +0800
Subject: [PATCH] 1

---
 代码管理/淮安PDA/pages/stash/receiveorderoutbound.vue |  228 +++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 150 insertions(+), 78 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/pages/stash/receiveorderoutbound.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/pages/stash/receiveorderoutbound.vue"
index c8b5f39..2603ece 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/pages/stash/receiveorderoutbound.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/pages/stash/receiveorderoutbound.vue"
@@ -9,7 +9,7 @@
 					<!-- <uni-forms-item label="鍗曟嵁绫诲瀷锛氱敓浜ч鏂欏崟" style="margin-top: -20px;"></uni-forms-item> -->
 					<uni-forms-item label="鍐呯鐮侊細" style="margin-top: -20px;">
 						<uni-easyinput type="text" placeholder="璇锋壂鎻忓唴绠辩爜" ref='midInput' :focus="!focus"
-							v-model="innerCode" @input="innercodeInput" />
+							v-model="innerCode" @confirm="innercodeInput" />
 					</uni-forms-item>
 					<uni-forms-item :label="PurchaseOrderNo" style="margin-top: -20px;"></uni-forms-item>
 					<uni-forms-item :label="matCode" style="margin-top: -20px;"></uni-forms-item>
@@ -58,6 +58,8 @@
 									<view>鏀惰揣鍗曞彿锛歿{orderNo}}</view>
 									<view>閲囪喘鍗曞彿锛歿{item.purchaseOrderNo}}</view>
 									<view>鐗╂枡缂栧彿锛歿{item.materielCode}}</view>
+									<view>鐗╂枡鍚嶇О锛歿{item.materielName}}</view>
+									<view>鐗╂枡瑙勬牸锛歿{item.materielSpec}}</view>
 									<view>鎵规鍙凤細{{item.lotNo}}</view>
 									<view>鏀惰揣鏁伴噺锛歿{item.receivedQuantity}}</view>
 									<view>鏄惁璐ㄦ锛歿{item.ifInspection==1?"鏄�":"鍚�"}}</view>
@@ -175,6 +177,7 @@
 	import {
 		config
 	} from '../../common/config';
+import message from '../../tuniao-ui/libs/function/message';
 	const innerAudioContext = uni.createInnerAudioContext();
 	export default {
 		data() {
@@ -228,7 +231,9 @@
 				endTypeRange: [],
 				sns: "",
 				receiveOrderId: 0,
-				warehouseId:""
+				warehouseId:"",
+				toastQueue: [], // 鎻愮ず闃熷垪
+				isShowingToast: false
 			}
 		},
 
@@ -258,14 +263,37 @@
 			}
 		},
 		methods: {
+			showToast(options) {
+			            this.toastQueue.push(options);
+			            this.processToastQueue();
+			        },
+			        
+			        // 澶勭悊鎻愮ず闃熷垪
+			        processToastQueue() {
+			            // 濡傛灉姝e湪鏄剧ず鎻愮ず鎴栭槦鍒椾负绌猴紝鍒欎笉鎵ц
+			            if (this.isShowingToast || this.toastQueue.length === 0) return;
+			            
+			            this.isShowingToast = true;
+			            const toastOptions = this.toastQueue.shift();
+			            
+			            // 鏄剧ず鎻愮ず
+			            this.$refs.uToast.show({
+			                ...toastOptions,
+			                complete: () => {
+			                    // 鎻愮ず鍏抽棴鍚庡鐞嗕笅涓�涓�
+			                    this.isShowingToast = false;
+			                    this.processToastQueue();
+			                }
+			            });
+			        },
 			inputDialogToggle(itemCode) {
 				this.itemCode = itemCode;
 				this.$refs.inputDialog.open()
 			},
-			voiceSpeech(src) {
-				innerAudioContext.src = src; // '../../static/success.mp3';
-				innerAudioContext.play();
-			},
+			// voiceSpeech(src) {
+			// 	innerAudioContext.src = src; // '../../static/success.mp3';
+			// 	innerAudioContext.play();
+			// },
 			search() {
 				this.getData();
 			},
@@ -374,53 +402,91 @@
 				});
 			},
 			submit() {
-				if (this.sns == "") {
-					this.$refs.uToast.show({
-						title: "璇锋壂鎻忓唴绠辨爣绛�",
-						type: 'error'
+			    // 鎻愬彇鐢熶骇鏃ユ湡锛堟牸寮忎负"鐢熶骇鏃ユ湡锛歒YYY-MM"锛�
+			    const productionDateStr = this.ProductionDate.replace('鐢熶骇鏃ユ湡锛�', '');
+			    if (!productionDateStr) {
+					this.showToast({
+			            title: "鏈幏鍙栧埌鐢熶骇鏃ユ湡",
+			            type: 'error'
+			        });
+			        return;
+			    }
+			                
+			    // 瑙f瀽鐢熶骇鏃ユ湡鐨勫勾鏈�
+			    const [prodYear, prodMonth] = productionDateStr.split('-').map(Number);
+			                
+			    // 鑾峰彇褰撳墠鏃ユ湡鐨勫勾鏈�
+			    const currentDate = new Date();
+			    const currentYear = currentDate.getFullYear();
+			    const currentMonth = currentDate.getMonth() + 1;
+			                
+			    // 姣旇緝骞存湀鏄惁涓�鑷�
+			    const isDateMismatch = prodYear !== currentYear || prodMonth !== currentMonth;
+			    if (isDateMismatch) {
+			        this.showToast({
+			            title: "璇ョ墿鏂欑敓浜ф棩鏈熺殑骞存湀涓庡綋鍓嶅勾鏈堜笉涓�鑷�",
+			            type: 'warning',
+			            duration: 1500
+			        });
+			    }
+			    
+			    // 鍘熸湁鐨勭‘璁ゆ敹璐ч�昏緫
+			    if (this.sns == "") {
+			        this.$refs.uToast.show({
+			            title: "璇锋壂鎻忓唴绠辨爣绛�",
+			            type: 'error'
+			        })
+			        return;
+			    }
+			    if (this.Quantity == "") {
+			        this.$refs.uToast.show({
+			            title: "璇疯緭鍏ュ疄闄呮暟閲�",
+			            type: 'error'
+			        })
+			        return;
+			    }
+			    if(this.warehouseId==2){
+			        //鏇挎崲鎸囧畾涓や釜瀛楃闂寸殑瀛楃
+			        this.sns = this.sns.replace(/(Q:)([^,PO]+)(,PO)/, (match, p1, p2, p3) => {
+			            return p1 + this.Quantity + p3;
+			        });
+			    }
+				const sendRequest = () => {
+					this.$u.post('/api/ReceiveOrderDetail/AddReceiveOrderDetail?serNum=' + this.sns + '&orderNo=' + this
+						.orderNo, {}).then(res => {
+						if (res.status) {
+							this.PurchaseOrderNo="閲囪喘鍗曞彿锛�";
+							this.matCode="鐗╂枡缂栫爜锛�";
+							this.LotNo="鐗╂枡鎵规锛�";
+							this.orderQty="璁㈠崟鏁伴噺锛�";
+							this.ProductionDate="鐢熶骇鏃ユ湡锛�";
+							this.EffectiveDate="鏈夋晥鏃ユ湡锛�";
+							this.Quantity="";
+							setTimeout(() => {
+								this.innerCode="";
+								this.focus=false;
+							}, 100);
+							this.orderInfo=[];
+							this.sns = "";
+							this.$refs.uToast.show({
+								title:"纭鏀惰揣鎴愬姛",
+								type: "success"
+							})
+						} else {
+							this.$refs.uToast.show({
+								title: res.message,
+								type: "error"
+							})
+						}
 					})
-					return;
+					
+				};
+				// 濡傛灉鏈夋棩鏈熶笉鍖归厤鎻愮ず锛岀瓑寰呮彁绀哄畬鎴愬悗鍙戦�佽姹�
+				if (isDateMismatch) {
+				    setTimeout(sendRequest, 1500); // 绛夊緟1.5绉掞紙涓庢彁绀烘椂闀夸竴鑷达級
+				} else {
+				    sendRequest(); // 娌℃湁鏃ユ湡鎻愮ず锛岀珛鍗冲彂閫佽姹�
 				}
-				if (this.Quantity == "") {
-					this.$refs.uToast.show({
-						title: "璇疯緭鍏ュ疄闄呮暟閲�",
-						type: 'error'
-					})
-					return;
-				}
-				if(this.warehouseId==2){
-					//鏇挎崲鎸囧畾涓や釜瀛楃闂寸殑瀛楃
-					this.sns = this.sns.replace(/(Q:)([^,PO]+)(,PO)/, (match, p1, p2, p3) => {
-					  return p1 + this.Quantity + p3;
-					});
-				}
-				this.$u.post('/api/ReceiveOrderDetail/AddReceiveOrderDetail?serNum=' + this.sns + '&orderNo=' + this
-					.orderNo, {}).then(res => {
-					if (res.status) {
-						this.PurchaseOrderNo="閲囪喘鍗曞彿锛�";
-						this.matCode="鐗╂枡缂栫爜锛�";
-						this.LotNo="鐗╂枡鎵规锛�";
-						this.orderQty="璁㈠崟鏁伴噺锛�";
-						this.ProductionDate="鐢熶骇鏃ユ湡锛�";
-						this.EffectiveDate="鏈夋晥鏃ユ湡锛�";
-						this.Quantity="";
-						setTimeout(() => {
-							this.innerCode="";
-							this.focus=false;
-						}, 100);
-						this.orderInfo=[];
-						this.sns = "";
-						this.$refs.uToast.show({
-							title: "纭鏀惰揣鎴愬姛",
-							type: "success"
-						})
-					} else {
-						this.$refs.uToast.show({
-							title: res.message,
-							type: "error"
-						})
-					}
-				})
 			},
 			submit1() {
 				this.$u.post('/api/ReceiveOrder/FeedbackReceiveOrder?orderId=' + this
@@ -520,36 +586,42 @@
 						return;
 					}
 					var innerCode = this.innerCode;
+					//灏唅nnerCode,SC鍚庨潰鐨勮繘琛屾浛鎹㈢┖
+					if(this.warehouseId==11){
+						innerCode=innerCode.replace(/,SC.*/, '');
+					}
+					
+					if(innerCode.indexOf("POHA")>0){
+						this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + innerCode, {}).then((res) => {
+							if (res.status) {
+								this.sns = res.data.serialNumber;
+								// this.matInfos.splice(0, this.matInfos.length);
+								// this.matInfos.push(res.data);
+								this.matCode = "鐗╂枡缂栫爜锛�" + res.data.materielCode;
+								this.LotNo = "鐗╂枡鎵规锛�" + res.data.lotNo;
+								this.PurchaseOrderNo = "閲囪喘鍗曞彿锛�" + res.data.purchaseOrderNo;
+								this.EffectiveDate = "鏈夋晥鏃ユ湡锛�" + res.data.effectiveDate;
+								this.ProductionDate = "鐢熶骇鏃ユ湡锛�" + res.data.productionDate;
+								this.orderQty = "璁㈠崟鏁伴噺锛�" + res.data.quantity;
+								this.Quantity = res.data.quantity;
+								// setTimeout(() => {
+								// 	this.voiceSpeech('../../static/success.mp3');
+								// }, 100);
+							} else {
+								this.$refs.uToast.show({
+									title: res.message,
+									type: "error"
+								})
+								// setTimeout(() => {
+								// 	this.voiceSpeech('../../static/fail.mp3');
+								// }, 100);
+							}
+						})
+					}
 					setTimeout(() => {
 						this.innerCode = "";
 						this.focus=true;
-					}, 1);
-
-					this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + innerCode, {}).then((res) => {
-						if (res.status) {
-							this.sns = res.data.serialNumber;
-							// this.matInfos.splice(0, this.matInfos.length);
-							// this.matInfos.push(res.data);
-							this.matCode = "鐗╂枡缂栫爜锛�" + res.data.materielCode;
-							this.LotNo = "鐗╂枡鎵规锛�" + res.data.lotNo;
-							this.PurchaseOrderNo = "閲囪喘鍗曞彿锛�" + res.data.purchaseOrderNo;
-							this.EffectiveDate = "鏈夋晥鏃ユ湡锛�" + res.data.effectiveDate;
-							this.ProductionDate = "鐢熶骇鏃ユ湡锛�" + res.data.productionDate;
-							this.orderQty = "璁㈠崟鏁伴噺锛�" + res.data.quantity;
-							this.Quantity = res.data.quantity;
-							setTimeout(() => {
-								this.voiceSpeech('../../static/success.mp3');
-							}, 100);
-						} else {
-							this.$refs.uToast.show({
-								title: res.message,
-								type: "error"
-							})
-							setTimeout(() => {
-								this.voiceSpeech('../../static/fail.mp3');
-							}, 100);
-						}
-					})
+					}, 100);
 				})
 			},
 			tagInput() {

--
Gitblit v1.9.3