Bläddra i källkod

fix:"优化机器查询功能"

soobin 10 månader sedan
förälder
incheckning
210e73b387

+ 55 - 25
pages/Insert/addMachine.vue

@@ -2,34 +2,34 @@
 	<view>
 		<form @submit="submit">
 			<form @submit="addMachine">
-				<view class="title"> 机器</view>
+				<view class="bigTitle">机器</view>
 				<view class="body">
 					<input class="input" style="display:none;" name="coding" :value=coding />
 					机器编码:<input class="input" v-model="coding" />
-					<button type="primary" @click="saoma('coding')" class="button1">
+					<button type="primary" @click="saoma('coding')" class="button1" size="mini">
 						<p class="p">扫码</p>
 					</button>
-					<button type="primary" @click="getMachine(coding)" class="button1">
+					<button type="primary" @click="getMachine(coding)" class="button1" size="mini">
 						<p class="p">获取</p>
 					</button>
 				</view>
 				<view class="bodyname">
 					名称:<input class="input" name="name" :value="name" />
-					<button type="primary" form-type="submit" class="button1">
+<!-- 					<button type="primary" form-type="submit" class="button1">
 						<p class="p">确认</p>
-					</button>
+					</button> -->
 				</view>
 				<view class="body">
 					机身铭牌:<input class="input" name="nameplate" :value="nameplate" />
-					<button type="primary" form-type="submit" class="button1">
+<!-- 					<button type="primary" form-type="submit" class="button1">
 						<p class="p">确认</p>
-					</button>
+					</button> -->
 				</view>
 				<view class="body">
 					设备编号:<input class="input" name="clientId" :value="clientId" />
-					<button type="primary" form-type="submit" class="button1">
+<!-- 					<button type="primary" form-type="submit" class="button1">
 						<p class="p">确认</p>
-					</button>
+					</button> -->
 				</view>
 				<view class="body">
 					<!-- 订单编号:<input class="input" name="orderNo" :value="orderNo" /> -->
@@ -38,27 +38,32 @@
 					<button type="primary" @click="saoma('orderNo')" class="button1">
 						<p class="p">扫码</p>
 					</button>
-					<button type="primary" form-type="submit" class="button1">
+<!-- 					<button type="primary" form-type="submit" class="button1">
 						<p class="p">确认</p>
-					</button>
+					</button> -->
 					<!-- <button type="primary" @click="getMessage(orderNo)" class="button1">
 						<p class="p">获取</p>
 					</button> -->
 				</view>
 				<view class="body">
 					客户编号:<input class="input" name="customerNo" :value="customerNo" />
-					<button type="primary" form-type="submit" class="button1">
+<!-- 					<button type="primary" form-type="submit" class="button1">
 						<p class="p">确认</p>
-					</button>
+					</button> -->
 				</view>
 				<view class="body">
 					<input class="input" style="display:none;" name="cardReader" :value=cardReader />
-					刷卡器:<input class="input" v-model="cardReader" />
+					<span style="margin-left: 25upx;">刷卡器:</span><input class="input" v-model="cardReader" />
 					<button type="primary" @click="saoma('cardReader')" class="button1">
 						<p class="p">扫码</p>
 					</button>
-					<button type="primary" form-type="submit" class="button1">
+<!-- 					<button type="primary" form-type="submit" class="button1">
 						<p class="p">确认</p>
+					</button> -->
+				</view>
+				<view class="">
+					<button type="primary" form-type="submit" class="submitButton">
+						确认
 					</button>
 				</view>
 			</form>
@@ -657,7 +662,7 @@
 					<p class="p1">检查</p>
 				</button>
 			</view>
-			<view class="">
+			<view class="checkContent">
 				{{weiname}} </br>
 				{{Modulesname}}
 			</view>
@@ -773,8 +778,9 @@
 				// 允许从相机和相册扫码
 				uni.scanCode({
 					success(res) {
-						// console.log('条码类型:' + res.scanType);
-						// console.log('条码内容:' + res.result);
+						console.log('res:' + res);
+						console.log('条码类型:' + res.scanType);
+						console.log('条码内容:' + res.result);
 						if (cod == 'coding') {
 							that.coding = res.result;
 						}
@@ -841,6 +847,15 @@
 						if (cod == 'cardReader') {
 							that.cardReader = res.result;
 						}
+					},
+					fail(err) {
+						console.log('err:' + JSON.stringify(err));
+						uni.showToast({
+							icon: 'none',
+							title: '请使用正确的条形码或二维码!',
+							duration: 2000
+						});
+
 					}
 				});
 			},
@@ -1640,25 +1655,30 @@
 
 	.input {
 		/* padding: 10upx 20upx 10upx 0upx; */
-		padding-left: 20upx;
-		padding-top: 10upx;
+		padding-left: 10upx;
+		/* padding-top: 10upx; */
 		background-color: #FFFFFF;
-		width: 400upx;
+		width: 350upx;
 		height: 50upx;
 		box-shadow: 0upx 0upx 20upx #D3D3D3;
 		border-radius: 5upx;
 	}
 
 	.button {
-		margin: auto;
-		width: 60%;
+		/* margin: auto; */
+		margin: 50upx 100upx ;
+		/* width: 60%; */
 		height: 100upx;
 	}
 
 	.button1 {
 		margin: auto;
-		width: 75upx;
-		height: 50upx;
+		width: 90upx;
+		height: 55upx;
+	}
+	
+	.submitButton {
+		margin: 20upx 200upx;
 	}
 
 	.p {
@@ -1710,6 +1730,11 @@
 		height: 10upx;
 	}
 
+	.bigTitle {
+		font-size: 35upx;
+		margin-left: 20upx;
+	}
+
 	.title {
 		font-size: 35upx;
 	}
@@ -1723,6 +1748,11 @@
 		flex-direction: row;
 		justify-content: flex-start;
 	}
+	
+	.checkContent {
+		margin: 50upx 30upx;
+		font-size: 30upx;
+	}
 
 	.modules {
 		width: 95%;

+ 4 - 4
pages/Insert/addModules.vue

@@ -155,10 +155,10 @@
 
 	.input {
 		/* padding: 10upx 20upx 10upx 0upx; */
-		padding-left: 20upx;
-		padding-top: 10upx;
+		padding: 0 10upx;
+		/* padding-top: 10upx; */
 		background-color: #FFFFFF;
-		width: 400upx;
+		width: 350upx;
 		height: 50upx;
 		box-shadow: 0upx 0upx 20upx #D3D3D3;
 		border-radius: 5upx;
@@ -172,7 +172,7 @@
 
 	.button1 {
 		margin: auto;
-		width: 75upx;
+		width: 90upx;
 		height: 50upx;
 	}
 

+ 8 - 7
pages/Insert/workingProcedure.vue

@@ -1146,12 +1146,13 @@
 									this.aeProducePersonnel = date.producePersonnel;
 								}
 							}
-						} else {
-							uni.showModal({
-								title: '提示',
-								content: res.data.message,
-							});
 						}
+						//  else {
+						// 	uni.showModal({
+						// 		title: '提示',
+						// 		content: "未添加工序",
+						// 	});
+						// }
 
 					}
 				});
@@ -1175,8 +1176,8 @@
 
 	.input {
 		/* padding: 10upx 20upx 10upx 0upx; */
-		padding-left: 20upx;
-		padding-top: 10upx;
+		padding: 0 10upx;
+		/* padding-top: 10upx; */
 		background-color: #FFFFFF;
 		width: 400upx;
 		height: 50upx;

+ 4 - 1
pages/Login/Login.vue

@@ -179,10 +179,12 @@
 				}
 				
 				.input-account, .input-pwd {
-				  border: 1px outset #1aad19; /* 设置边框颜色为绿色,边框宽度为2px */
+				  border: 1px outset #000000; /* 设置边框颜色为绿色,边框宽度为2px */
 				  border-radius: 4px; /* 添加圆角 */
 				  box-sizing: border-box; /* 确保内边距和边框不会影响元素的总宽度 */
 				  // box-shadow: 0 0 0 0.1rem #1aad19;
+				  padding: 0 10upx;
+				  height: 80upx;
 				}
 
 				.btn-area {
@@ -190,6 +192,7 @@
 
 					button {
 						background-color: $uni-color-primary;
+						margin: 0 200upx;
 					}
 				}
 			}

+ 44 - 31
pages/select/selectMachine.vue

@@ -3,36 +3,38 @@
 		<view class="body">
 			<input class="input" style="display:none;" name="code" :value=code />
 			编码:<input class="input" v-model="code" />
-			<button type="primary" @click="saoma()" class="button1">
-				<p class="p">扫码</p>
+			<button type="primary" @click="saoma()" class="" size="mini">
+				<!-- <p class="p">扫码</p> -->
+				扫码
 			</button>
-			<button type="primary" @click="getMessage(code)" class="button1">
-				<p class="p">获取</p>
+			<button type="primary" @click="getMessage(code)" class="" size="mini">
+				<!-- <p class="p">获取</p> -->
+				获取
 			</button>
 		</view>
 
 		<view class="">
 			<t-table>
 				<t-tr class="tr">
-					机器编码:<input class="input" v-model="coding" />
+					机器编码:<input class="input" v-model="coding" disabled="true"/>
 				</t-tr>
 				<t-tr class="tr">
-					机器铭牌:{{nameplate}}
+					机器铭牌:{{nameplate != null ? nameplate : ''}}
 				</t-tr>
 				<t-tr class="tr">
-					设备编码:{{clientId}}
+					设备编码:{{clientId != null ? clientId : ''}}
 				</t-tr>
 				<t-tr class="tr">
-					订单编码:{{orderNo}}
+					订单编码:{{orderNo != null ? orderNo : ''}}
 				</t-tr>
 				<t-tr class="tr">
-					客户编码:{{customerNo}}
+					客户编码:{{customerNo != null ? customerNo : ''}}
 				</t-tr>
 				<t-tr class="tr">
-					机器名称:{{name}}
+					机器名称:{{name != null ? name : ''}}
 				</t-tr>
 				<t-tr class="tr">
-					总装开始时间:{{startDate}}
+					总装开始时间:{{startDate != null ? startDate : ''}}
 				</t-tr>
 				<t-tr class="tr">
 					工序状态:{{weiname}}
@@ -41,10 +43,10 @@
 					模块状态:{{Modulesname}}
 				</t-tr>
 				<t-tr class="tr">
-					总装结束时间:{{endDate}}
+					总装结束时间:{{endDate != null ? endDate : ''}}
 				</t-tr>
 				<t-tr class="tr">
-					刷卡器:{{cardReader}}
+					刷卡器:{{cardReader != null ? cardReader : ''}}
 				</t-tr>
 			</t-table>
 		</view>
@@ -53,18 +55,18 @@
 			<uni-list-item title="工序查询" @click="gongxu()" />
 		</view>
 		<view class="line"></view>
-		<view class="line"></view>
+		<!-- <view class="line"></view> -->
 		<view class="">
 
-			<view v-for="(item,index) in modulesList" :key="index">
+			<view v-for="(item,index) in groupedModules" :key="index">
 				<t-table class="table">
 					<t-tr class="tr table">
 						名称:{{item.name}}
 					</t-tr>
-					<t-tr class="tr">
-						<t-td>编码:{{item.coding}}</t-td>
+					<t-tr class="tr" v-for="(item1,index1) in item.items" :key="index1">
+						<t-td>编码:{{item1.coding}}</t-td>
 						<t-td class="td">
-							<button type="primary" @click="tran(item.coding)" class="button1">
+							<button type="primary" @click="tran(item1.coding)" class="button1">
 								<p class="p">详情</p>
 							</button>
 						</t-td>
@@ -72,8 +74,6 @@
 				</t-table>
 				<view class="line"></view>
 			</view>
-
-
 		</view>
 
 	</view>
@@ -100,7 +100,8 @@
 				endDate: '',
 				modulesList: [],
 				Modulesname: '',
-				weiname: ''
+				weiname: '',
+				groupedModules: [], // 用于存储分组后的结果
 			}
 		},
 		onShow() {
@@ -132,6 +133,18 @@
 					url: '../Insert/workingProcedure?item=' + encodeURIComponent(JSON.stringify(item))
 				});
 			},
+			groupModules() {
+			    const grouped = {};
+				console.log("grouped")
+			    this.modulesList.forEach(item => {
+			        if (!grouped[item.name]) {
+			          grouped[item.name] = { name: item.name, items: [] };
+			        }
+			        grouped[item.name].items.push(item);
+			    });
+			    this.groupedModules = Object.values(grouped); // 将分组结果赋值给 groupedModules
+				console.log("groupedModules", this.groupedModules)
+			},
 			getMessage(coding) {
 				var that = this;
 				var serverUrl = that.serverurl;
@@ -159,6 +172,8 @@
 								that.startDate = tmachine.startDate;
 								that.endDate = tmachine.endDate;
 								that.modulesList = res.data.data.modulesList;
+								that.groupModules()
+								// console.log("groupedModules", that.groupedModules)
 							} else {
 								var codes = res.data.data;
 								that.name = codes.name;
@@ -248,23 +263,22 @@
 	}
 
 	.tr {
-		padding-left: 30upx;
-		padding-top: 13upx;
+		padding: 13upx 30upx;
 		font-size: 30upx;
-		padding-bottom: 13upx;
 	}
 
 	.td {
-		padding-left: 280upx;
+		padding-left: 250upx;
 
 	}
 
 	.input {
 		/* padding: 10upx 20upx 10upx 0upx; */
-		padding-left: 20upx;
-		padding-top: 10upx;
+		padding-left: 10upx;
+		/* padding-top: 10upx; */
+		margin-right: 10upx;
 		background-color: #FFFFFF;
-		width: 400upx;
+		/* width: 400upx; */
 		height: 50upx;
 		box-shadow: 0upx 0upx 20upx #D3D3D3;
 		border-radius: 5upx;
@@ -278,9 +292,8 @@
 
 	.button1 {
 		margin: auto;
-		width: 75upx;
-		height: 50upx;
-		text-align: right
+		width: 100upx;
+		height: 55upx;
 	}
 
 	.p {

+ 28 - 25
pages/select/selectModules.vue

@@ -2,13 +2,16 @@
 	<view>
 		<form @submit="add">
 			<view class="body">
-				<input class="input" style="display:none;" name="coding" :value=coding />
-				编码:<input class="input" v-model="coding" />
-				<button type="primary" @click="saoma()" class="button1">
-					<p class="p">扫码</p>
+				<input class="input" style="display:none;" name="coding" :value=coding >
+				编码:</input>
+				<input class="input" v-model="coding" />
+				<button type="primary" @click="saoma()" class="button1" size="mini">
+					<!-- <p class="p">扫码</p> -->
+					扫码
 				</button>
-				<button type="primary" @click="getMessage(coding)" class="button1">
-					<p class="p">获取</p>
+				<button type="primary" @click="getMessage(coding)" class="button1" size="mini"> 
+					<!-- <p class="p">获取</p> -->
+					获取
 				</button>
 			</view>
 			<view class="">
@@ -17,7 +20,7 @@
 						名称:{{name}}
 					</t-tr>
 					<t-tr class="tr">
-						所属机器编码:<input class="input" v-model="machineCoding" />
+						所属机器编码:<input class="input" v-model="machineCoding" disabled="true"/>
 					</t-tr>
 					<t-tr class="tr">
 						版本号:{{versions}}
@@ -31,8 +34,8 @@
 					<t-tr class="tr">
 						出货日期:{{shipmentDate}}  
 						<button v-show="shipmentDate==''" type="primary" @click="chuhuo(coding)"
-							class="button1">
-							<p class="p">出货</p>
+							class="button1" size="mini">
+							出货
 						</button>
 					</t-tr>
 					<view class="" v-if="installPersonnel!=''&&installPersonnel!=null">
@@ -50,8 +53,9 @@
 						</t-tr>
 						<t-tr class="tr">
 							本模块更换原因:<input class="input" v-model="replaceReason" />
-							<button type="primary" @click="updateReplaceReason()" class="button1">
-								<p class="p">更正</p>
+							<button type="primary" @click="updateReplaceReason()" class="button1" size="mini">
+								<!-- <p class="p">更正</p> -->
+								更正
 							</button>
 						</t-tr>
 						<t-tr class="tr">
@@ -75,16 +79,15 @@
 					</view>
 					<t-tr class="tr">
 						状态:{{status}}
-
 					</t-tr>
 					<t-tr class="ttr">
 						操作:
-						<button v-show="status!=''" type="primary" @click="change(coding,machineCoding)"
-							class="button1">
-							<p class="p">更换</p>
+						<button v-if="status!=''" type="primary" @click="change(coding,machineCoding)"
+							class="button1" size="mini">
+							更换
 						</button>
-						<button v-if="level>2" type="primary" @click="del(coding)" class="button1">
-							<p class="p">删除</p>
+						<button v-if="level>2" type="primary" @click="del(coding)" class="button1" size="mini">
+							删除
 						</button>
 					</t-tr>
 				</t-table>
@@ -265,7 +268,7 @@
 								that.producePersonnel = codes.producePersonnel;
 								that.produceDate = codes.createDate;
 								var sta = codes.status;
-								if (sta == '0') {
+								if (sta == '0' || sta == null) {
 									that.status = "未安装";
 								}
 								if (sta == '1') {
@@ -345,8 +348,10 @@
 		font-size: 30upx;
 		padding-bottom: 13upx;
 		display: flex;
-		flex-direction: row;
+		/* flex-direction: row; */
+		gap: 20upx;
 		justify-content: flex-start;
+		
 	}
 
 	.tr {
@@ -358,13 +363,13 @@
 
 	.input {
 		/* padding: 10upx 20upx 10upx 0upx; */
-		padding-left: 20upx;
-		padding-top: 10upx;
+		padding-left: 10upx;
+		/* padding-top: 10upx; */
 		background-color: #FFFFFF;
-		width: 400upx;
 		height: 50upx;
 		box-shadow: 0upx 0upx 20upx #D3D3D3;
 		border-radius: 5upx;
+		margin-right: 10upx;
 	}
 
 	.button {
@@ -374,9 +379,7 @@
 	}
 
 	.button1 {
-		margin: auto;
-		width: 75upx;
-		height: 50upx;
+		
 	}
 
 	.p {

+ 14 - 6
pages/select/selectOrderNo.vue

@@ -2,11 +2,11 @@
 	<view>
 		<view class="body">
 			订单编号:<input class="input" v-model="orderNo" />
-			<button type="primary" @click="select(orderNo)" class="button1">
-				<p class="p">搜索</p>
+			<button type="primary" @click="select(orderNo)" class="" size="mini">
+				搜索
 			</button>
-			<button type="primary" @click="expert(orderNo)" class="button1">
-				<p class="p">导出</p>
+			<button type="primary" @click="expert(orderNo)" class="" size="mini">
+				导出
 			</button>
 		</view>
 		<view class="">
@@ -141,10 +141,18 @@
 <style>
 	.body {
 		background-color: #FFFFFF;
-		padding: 20upx 20upx 20upx 20upx;
-		font-size: 30upx;
+		padding: 20upx;
 		display: flex;
 		flex-direction: row;
 		justify-content: flex-start;
+		
+	}
+	.input {
+		padding-left: 10upx;
+		background-color: #FFFFFF;
+		width: 280upx;
+		height: 55upx;
+		box-shadow: 0upx 0upx 20upx #D3D3D3;
+		border-radius: 5upx;
 	}
 </style>

+ 10 - 8
pages/update/update.vue

@@ -31,7 +31,7 @@
 			<view class="body">
 				更换原因:<textarea class="input-two" name="replaceReason" />
 			</view>
-			<view class="">
+			<view class="submitButton">
 				<button type="primary" formType="submit" class="button">
 					<p class="p1">提交</p>
 				</button>
@@ -149,12 +149,10 @@
 	}
 
 	.input {
-		/* padding: 10upx 20upx 10upx 0upx; */
-		padding-left: 20upx;
-		padding-top: 10upx;
+		padding-left: 10upx;
 		background-color: #FFFFFF;
 		width: 400upx;
-		height: 50upx;
+		height: 55upx;
 		box-shadow: 0upx 0upx 20upx #D3D3D3;
 		border-radius: 5upx;
 	}
@@ -167,8 +165,8 @@
 
 	.button1 {
 		margin: auto;
-		width: 75upx;
-		height: 50upx;
+		width: 80upx;
+		height: 55upx;
 	}
 
 	.p {
@@ -192,7 +190,7 @@
 	}
 
 	.input-two {
-		padding-left: 20upx;
+		padding-left: 10upx;
 		width: 450upx;
 		box-shadow: 0upx 0upx 20upx #D3D3D3;
 		border-radius: 5upx;
@@ -216,4 +214,8 @@
 		-webkit-transform: translateX(-50%);
 		transform: translateX(-50%);
 	}
+	
+	.submitButton {
+		margin-top: 40upx;
+	}
 </style>