From f02d3a8ffc05a10a64859b2a16d5d43c8abb0fb9 Mon Sep 17 00:00:00 2001
From: xiaojiao <xiaojiao@kaokeziliao.com>
Date: 星期一, 23 三月 2026 11:13:36 +0800
Subject: [PATCH] 北京回长沙的最终版

---
 项目代码/PDA/pages/Inbound/InboundBoxing_New.vue |  112 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 94 insertions(+), 18 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 afa8a34..20e2057 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" 
@@ -55,9 +55,9 @@
 				  </u-td>
 				</u-tr>
 				<u-tr>
-					<u-td width="30%">鍘傚</u-td>
+					<u-td width="30%">杞存壙鍝佺墝</u-td>
 					<u-td>
-						<u-input v-model="madeUnit" :border="true" :disabled="true"  placeholder="鑷姩鑾峰彇鍘傚" />
+						<u-input v-model="madeUnit" :border="true" :disabled="true"  placeholder="鑷姩鑾峰彇杞存壙鍝佺墝" />
 					</u-td>
 				</u-tr>
 				
@@ -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: '', //褰撳墠鐢ㄦ埛
@@ -131,17 +139,59 @@
 				BearingModels:[], // 瀵瑰簲杞﹀瀷涓嬮潰鐨勬墍鏈夎酱鎵垮瀷鍙�
 				templists:[], // 涓存椂淇濆瓨 杞存壙鍨嬪彿 鍜� 鍘傚
 				StateArray: [{
-						label: 'RO',
+						label: 'R0',
 						value: '鏂伴��'
 					},{
 						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 = {};
@@ -244,20 +294,33 @@
 				}
 			},
 			initInfo() {
-				_this.madeUnit = '';
-				_this.materielId = '';
-				_this.materielType = '';
-				_this.NewOrOld = '';
+				//_this.madeUnit = '';
+				//_this.materielId = '';
+				//_this.materielType = '';
+				//_this.NewOrOld = '';
 				_this.LotNumber = '';
-				_this.ProductDate = '';
+				//_this.ProductDate = '';
 			},
 			SaveInfomation() {
+				let data = {
+					MainData: {
+						rfid: _this.value_rfid,
+						qrcode: _this.value_qrcode,
+						madeUnit: _this.madeUnit,
+						materielId: _this.materielId,
+						materielType: _this.materielType,
+						NewOrOld: _this.NewOrOld,
+						LotNumber: _this.LotNumber,
+						ProductDate: _this.ProductDate
+					},
+				};
+				console.log("鏈�鍚庢彁浜ょ殑缁勭洏淇℃伅",data)
 				//_this.LotNumber == '' ||
 				if (_this.value_rfid.length == 0 || _this.value_qrcode.length == 0 ||
 					_this.madeUnit == '' || _this.materielId == '' ||
 					_this.materielType == '' || _this.NewOrOld == '' ||
 					 _this.ProductDate == '') {
-
+					
 					uni.showToast({
 						title: "缁勭洏淇℃伅涓嶈兘涓虹┖",
 						duration: 2000,
@@ -273,7 +336,7 @@
 					});
 					return;
 				}
-
+				//_this.LotNumber = '111111';
 				uni.showModal({
 					title: '鎻愮ず',
 					content: '鏄惁纭缁勭洏?',
@@ -304,6 +367,7 @@
 									_this.value_qrcode = "";
 									_this.initInfo();
 									_this.rfidFocus = true;
+									
 								} else {
 									uni.showToast({
 										icon: 'none',
@@ -322,6 +386,17 @@
 					}
 				});
 			},
+			getCurrentDate() {
+			      const now = new Date();
+			      // 鑾峰彇骞淬�佹湀銆佹棩锛堣ˉ0澶勭悊锛岀‘淇濇湀浠�/鏃ユ湡鏄袱浣嶆暟锛�
+			      const year = now.getFullYear();
+			      const month = String(now.getMonth() + 1).padStart(2, '0'); // 鏈堜唤浠�0寮�濮嬶紝闇�+1
+			      const day = String(now.getDate()).padStart(2, '0');
+			      // 鎷兼帴鎴怸YYY-MM-DD鏍煎紡
+			      this.currentDate = `${year}-${month}-${day}`;
+			      // 濡傛灉闇�瑕佽繑鍥炲�硷紙姣斿鎺ュ彛浼犲弬锛夛紝鍙互return杩欎釜缁撴灉
+			      return `${year}-${month}-${day}`;
+			    },
 		},
 		created: function() {
 			// 姣忔杩涘叆鐣岄潰鏃讹紝鍏堟竻闄や箣鍓嶇殑鎵�鏈夊畾鏃跺櫒锛岀劧鍚庡惎鍔ㄦ柊鐨勫畾鏃跺櫒
@@ -341,6 +416,7 @@
 		mounted() {
 			_this = this;
 			_this.rfidFocus = true;
+			_this.ProductDate = this.getCurrentDate();
 			this.VehicleType();
 		},
 

--
Gitblit v1.9.3