mao 1 年之前
父節點
當前提交
8c94df4cfe
共有 2 個文件被更改,包括 30 次插入6 次删除
  1. 28 4
      components/dialog-selectProduction/dialog-selectProduction.vue
  2. 2 2
      manifest.json

+ 28 - 4
components/dialog-selectProduction/dialog-selectProduction.vue

@@ -13,9 +13,9 @@
 		</view>
 		<view class="carrierList uni-row">
 			<view class="carrierItem uni-row" v-for="(item,index) in carrierList">
-				<view class="uni-row" style="width: 46%;justify-content: flex-start;">{{ item.lotCode }}</view>
-				<view class="uni-row" style="width: 27%;justify-content: flex-start;">{{ item.carrierCode }}</view>
-				<view class="uni-row" style="width: 27%;word-wrap: break-word;">{{ item.place }}</view>
+				<view  style="width: 46%;text-align: left;">{{ item.lotCode }}</view>
+				<view  style="width: 27%;text-align: left;">{{ item.carrierCode }}</view>
+				<view  style="width: 27%;word-wrap: break-word;text-align: left;">{{ item.place }}</view>
 			</view>
 		</view>	
 	</dialog-base>
@@ -90,7 +90,29 @@
 
 				console.log(processList.value)
 			}
-			carrierList.value = response.data;
+			/* 处理结果格式 */
+			// 用于存放处理后的结果
+			const result = {};
+			// 遍历原始数组的每个对象
+			response.data.forEach(item => {
+			  const { lotCode, place,carrierCode } = item;  
+			  // 如果lotCode不存在于结果中,则以该lotCode为键,创建一个新对象
+			  if (!result[lotCode]) {  
+			    result[lotCode] = {
+			      lotCode: lotCode,
+			      place: place,
+				  carrierCode: carrierCode
+			    };
+			  // 如果lotCode已存在于结果中,则将place进行字符串拼接
+			  } else {
+				  if (result[lotCode].place !== place){
+					  result[lotCode].place += `, ${place}`;
+				  }
+				result[lotCode].carrierCode += `, ${carrierCode}`;
+			  }
+			});
+			carrierList.value = Object.values(result);
+			console.log(carrierList.value)
 			baseDialog.value.open();
 		})
 	}
@@ -191,6 +213,8 @@
 				line-height: 64rpx;
 				text-align: center;
 				justify-content: flex-start;
+				align-items: center;
+				border-bottom: 1rpx solid #999999;
 			}
 		}
 	}

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "德迈仕数字生产管理平台",
     "appid" : "__UNI__B065984",
     "description" : "",
-    "versionName" : "1.0.17",
-    "versionCode" : 116,
+    "versionName" : "1.0.18",
+    "versionCode" : 117,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {