GGDemo hai 3 meses
pai
achega
bddff8b1cc
Modificáronse 2 ficheiros con 27 adicións e 8 borrados
  1. 24 5
      pages/scanLotno/index.vue
  2. 3 3
      unpackage/dist/cache/.vite/deps/_metadata.json

+ 24 - 5
pages/scanLotno/index.vue

@@ -16,8 +16,8 @@
 			<!-- <text class='weight-tip'>复称重量作用是确保句惠完整,防止工作人员计费称車后进行的其他操作引起的物品丢失问题</text> -->
 			<!-- <uni-section title="绑定批托盘号" type="line" padding style="height: calc(100vh - 100px)"> -->
 			<uni-forms-item label="绑定批次号" name="batchNum" class="select-item">
-				<uni-data-select v-if="!editBatchNum" v-model="valiFormData.batchNum"
-					placeholder="请选择批次号" :localdata="options.batch" :clear="false"></uni-data-select>
+				<uni-data-select v-if="!editBatchNum" v-model="valiFormData.batchNum" placeholder="请选择批次号"
+					:localdata="options.batch" :clear="false"></uni-data-select>
 				<uni-easyinput v-if="editBatchNum" :value="batchNum" :disabled="editBatchNum" />
 				<button v-if="!editBatchNum" type="primary" @click="submitBatchNum">确认</button>
 				<button v-if="editBatchNum" type="primary" @click="editBatchNum = false">修改</button>
@@ -180,8 +180,27 @@
 	};
 
 	const palletNum = computed(() => {
-		const res = options.pallet.find(item => item.value === valiFormData.value.palletNum)
-		return res?.text
+
+		function findTextByValue(arr, targetValue) {
+			for (let item of arr) {
+				// 检查当前项的 value 是否匹配
+				if (item.value === targetValue) {
+					return item.text; // 找到匹配,返回对应的 text
+				}
+
+				// 如果有子项,递归查找
+				if (item.children && item.children.length > 0) {
+					const result = findTextByValue(item.children, targetValue);
+					if (result) {
+						return `${item.text}/${result}`; // 返回路径
+					}
+				}
+			}
+			return null; // 如果没有找到,返回 null
+		}
+
+		const textPath = findTextByValue(options.pallet, valiFormData.value.palletNum);
+		return textPath
 	})
 
 	const checkOrder = () => {
@@ -422,7 +441,7 @@
 
 	.select-item {
 		.uni-forms-item__content {
-			display: flex;
+			display: flex !important;
 		}
 
 		.uni-forms-item__label {

+ 3 - 3
unpackage/dist/cache/.vite/deps/_metadata.json

@@ -1,8 +1,8 @@
 {
-  "hash": "adf7464e",
-  "configHash": "fd42d985",
+  "hash": "f40f3ae4",
+  "configHash": "d35ae346",
   "lockfileHash": "e3b0c442",
-  "browserHash": "d1f8efbb",
+  "browserHash": "63a7975d",
   "optimized": {},
   "chunks": {}
 }