From c3b60d865c3457c35054446e81b352e93e00a696 Mon Sep 17 00:00:00 2001
From: xiaojiao <xiaojiao@kaokeziliao.com>
Date: 星期一, 12 一月 2026 18:31:11 +0800
Subject: [PATCH] 更改了大部分功能和逻辑

---
 项目代码/PDA/pages/Inbound/InboundBoxing_New.vue |   67 +++++++++++++++++++++++++++++----
 1 files changed, 58 insertions(+), 9 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/PDA/pages/Inbound/InboundBoxing_New.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/PDA/pages/Inbound/InboundBoxing_New.vue"
index 7c76553..14985cc 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/PDA/pages/Inbound/InboundBoxing_New.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/PDA/pages/Inbound/InboundBoxing_New.vue"
@@ -27,7 +27,7 @@
 					<u-td width="30%">杞存壙鏉$爜</u-td>
 					<u-td>
 						<u-input v-model="value_qrcode" :border="true" :focus="qrcodeFocus"
-							placeholder="璇疯緭鍏ヨ酱鎵挎潯鐮�" />
+							placeholder="璇疯緭鍏ヨ酱鎵挎潯鐮�" @input="barcodeChange" />
 					</u-td>
 				</u-tr>
 				<u-tr>
@@ -35,8 +35,8 @@
 					<!-- <u-td>
 						<u-input v-model="materielId" :border="true"  placeholder="" />
 					</u-td> -->
-					<xfl-select :list="CxTypes" :initValue="'璇烽�夋嫨'" :clearable="false" @change="Get_VehicleType_Alls"
-						ref="Get_VehicleType_All">
+					<xfl-select :list="CxTypes" :initValue="stateInitValueCarmodel" :clearable="false" @change="Get_VehicleType_Alls"
+						ref="Get_VehicleType_All" :key="CarmodelKey">
 					</xfl-select>
 				</u-tr>
 				<u-tr>
@@ -46,7 +46,7 @@
 				    <xfl-select 
 				        v-if="showBearingSelect"
 				        :list="BearingModels" 
-				        :initValue="'璇烽�夋嫨'" 
+				        :initValue="stateInitValueBearingModel" 
 				        :clearable="false" 
 				        @change="BearingModelss"
 				        ref="BearingModelsss" 
@@ -67,7 +67,7 @@
 						<u-input v-model="NewOrOld" :border="true"  placeholder="" />
 					</u-td> -->
 					<u-td>
-						<xfl-select :list="StateArray" :initValue="'璇烽�夋嫨'" :clearable="false" @change="StateChange"
+						<xfl-select :key="stateKey" :list="StateArray" :initValue="stateInitValue" :clearable="false" @change="StateChange"
 							ref="StateSelect">
 						</xfl-select>
 					</u-td>
@@ -105,7 +105,15 @@
 	export default {
 		data() {
 			return {
-				bearingSelectKey: 0, // 淇濈暀key浣滀负鍙屼繚闄�
+				stateKey: 0, // 鏂板锛氭帶鍒剁粍浠堕噸寤� 銆愯酱鎵跨被鍒��
+				stateInitValue: '璇烽�夋嫨', // 鍒濆鍊硷紝鍚庣画鍔ㄦ�佷慨鏀广�愯酱鎵跨被鍒��
+				
+				bearingSelectKey: 0, // 淇濈暀key浣滀负鍙屼繚闄� 銆愯酱鎵垮瀷鍙枫��
+				stateInitValueBearingModel:'璇烽�夋嫨', //銆愯酱鎵垮瀷鍙枫��
+				
+				CarmodelKey: 0, //銆愯溅鍨嬨��
+				stateInitValueCarmodel:'璇烽�夋嫨', // 銆愯溅鍨嬨��
+				
 				showBearingSelect: true, // 鏂板锛氭帶鍒剁粍浠堕攢姣�/鍒涘缓
 				date: '',
 				CurrentUser: '', //褰撳墠鐢ㄦ埛
@@ -137,11 +145,53 @@
 						label: 'R1',
 						value: '妫�淇�'
 					}]
-			}
+			} 
 		},
 		methods: {
+			
+			barcodeChange(){
+				// 1. 鎷垮埌鍘熷鐨勭被JSON瀛楃涓诧紙濡傦細{'杞存壙鏉$爜':'1','杞﹀瀷':'2',...}锛�
+				if(_this.value_qrcode.length > 60){
+					const rawStr = _this.value_qrcode;
+					// 2. 淇鏍煎紡锛堝崟寮曞彿鈫掑弻寮曞彿 + 鍒犲熬閫楀彿锛�
+					const fixedStr = rawStr.replace(/'/g, '"').replace(/,\s*}/, '}');
+					console.log(fixedStr)
+					// 3. 瑙f瀽涓哄瓧鍏革紙瀵硅薄锛�
+					const temp_dict = JSON.parse(fixedStr);
+					console.log(temp_dict)
+					// 4. 姝g‘鑾峰彇鍊�
+					console.log(temp_dict['杞存壙鏉$爜']); // 杈撳嚭锛�1锛堜笉鍐嶆槸undefined锛�
+					
+					_this.value_qrcode = temp_dict['杞存壙鏉$爜']; 
+					_this.madeUnit = temp_dict["鍘傚"]
+					_this.LotNumber = temp_dict["杞存壙鍗曞彿"]
+					_this.Bearing_Category(temp_dict["杞存壙绫诲埆"])
+					_this.BearingModel(temp_dict["杞存壙鍨嬪彿"])
+					_this.Carmodel(temp_dict["杞﹀瀷"])
+				}
+			},
+			Bearing_Category (type_name){ 
+				_this.stateKey += 1; // 1. 鍏堟敼key锛屽己鍒堕攢姣佹棫缁勪欢
+				_this.stateInitValue = type_name;
+				
+				const matchedItem = _this.StateArray.find(item => item.value == type_name);
+				    if (matchedItem) {
+				      _this.NewOrOld = matchedItem.label;
+				    }
+					console.log(_this.NewOrOld)
+			},
+			Carmodel(type_name){ // 杞﹀瀷
+				_this.CarmodelKey += 1;
+				_this.stateInitValueCarmodel = type_name;
+				_this.materielId = type_name;
+			},
+			BearingModel(type_name){ // 杞存壙鍨嬪彿
+				_this.bearingSelectKey += 1;
+				_this.stateInitValueBearingModel = type_name;
+				_this.materielType = type_name;
+			},
 			UserChange(value) {
-
+			
 			},
 			VehicleType(){
 				let data = {};
@@ -368,7 +418,6 @@
 			_this.rfidFocus = true;
 			_this.ProductDate = this.getCurrentDate();
 			this.VehicleType();
-			
 		},
 
 

--
Gitblit v1.9.3