From 30f1c73d3338c7c61a6a0f8cc04b26a8cb1f66be Mon Sep 17 00:00:00 2001
From: whycq <123456>
Date: 星期二, 20 九月 2022 12:58:47 +0800
Subject: [PATCH] #

---
 Monitor-APP/pages/index/index.vue |  279 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 211 insertions(+), 68 deletions(-)

diff --git a/Monitor-APP/pages/index/index.vue b/Monitor-APP/pages/index/index.vue
index 55653ea..dca538d 100644
--- a/Monitor-APP/pages/index/index.vue
+++ b/Monitor-APP/pages/index/index.vue
@@ -16,24 +16,56 @@
 						<view class="box-border box-border2"></view>
 						<view class="box-border box-border3"></view>
 						<view class="box-border box-border4"></view>
-						<!-- 鍏ㄦ澘鍑哄簱 -->
-						<view style="width: 10%;height: 100%;display:inline-block;float: left;text-align: center;padding-top: 180px;">
-							<text>{{title}}</text>
+						<view style="width: 100%;height: 100%;" v-show="!errorShow">
+							<!-- 鍒嗘湁鏃犺鍗曞垝鍒嗕袱閮ㄥ垎 -->
+							<!-- 宸︿晶淇℃伅 -->
+							<view style="" :class="width">
+								<!-- 鍏ㄦ澘鍑哄簱 -->
+								<view class="box-items">{{title}}</view>
+								<!-- 鐩爣绔� -->
+								<view class="box-items">{{staNo}}</view>
+								<!-- 鍟嗗搧缂栧彿 -->
+								<view class="box-items">{{matnr}}</view>
+								<!-- 鍟嗗搧鍚嶇О -->
+								<view class="box-items">{{maknx}}</view>
+								<!-- 鍑哄簱鏁伴噺 -->
+								<view class="box-items">{{count}}</view>
+							</view>
+							<view style="width: 50%;height: 100%;display: inline-block;float: left;" v-show="orderShow">
+								<!-- 璁㈠崟鍙� -->
+								<view class="box-items">{{orderNo}}</view>
+								<!-- 宸插嚭鎵樼洏鏁� -->
+								<view class="box-items">{{doneOfTray}}</view>
+								<!-- 鎵樼洏鎬绘暟閲� -->
+								<view class="box-items">{{totalOfTray}}</view>
+								<!-- 宸插嚭绠辨暟 -->
+								<view class="box-items">{{doneOfUnit}}</view>
+								<!-- 鎬荤鏁� -->
+								<view class="box-items">{{totalOfUnit}}</view>
+							</view>
 						</view>
+						<view style="width: 100%;height: 100%;" v-show="errorShow">
+							<view style="line-height: 700px;font-size: 175rpx;">{{errorMsg}}</view>
+						</view>
+						
+						<!-- 鍏ㄦ澘鍑哄簱 -->
+						<!-- <view style="width: 10%;height: 100%;display:inline-block;float: left;text-align: center;padding-top: 180px;">
+							<text>{{title}}</text>
+						</view> -->
 						<!-- 婊氬姩鍖哄煙 -->
-						<view style="width: 80%;height: 100%;display: inline-block;">
+						<!-- <view style="width: 80%;height: 100%;display: inline-block;"> -->
 							<!--鏄剧ずorder璁㈠崟缂栧彿 -->
-							<text v-show="orderShow" style="display: block;font-size: 140rpx;" >{{orderNo}}</text>
+							<!-- <text v-show="orderShow" style="display: block;font-size: 140rpx;" >{{orderNo}}</text>
 							<swiper :class="swiper" circular="true" vertical="true" display-multiple-items="6" :autoplay="autoplay" :interval="interval" :duration="duration">
 								<swiper-item v-for="(item,index) in matList" :key="index">
 									<view style="font-size: 160rpx;">{{item}}</view>
 								</swiper-item>
 							</swiper>
-						</view>
+						</view> -->
 						<!-- 绔欏彴鍙� -->
-						<view style="width: 10%;height: 100%;display: inline-block;float: right;padding-top: 180px;">
+						<!-- <view style="width: 10%;height: 100%;display: inline-block;float: right;padding-top: 180px;">
 							<text>{{staNo}}</text>
-						</view>
+						</view> -->
 					</view>
 				</view>
 			</view>
@@ -279,11 +311,20 @@
 				errorPaper:'',
 				title:'',
 				staNo:'',
+				matnr:'',
+				maknx:'',
+				count:'',
+				orderNo:null,
+				doneOfTray:'',
+				totalOfTray:'',
+				doneOfUnit:'',
+				totalOfUnit:'',
+				errorMsg:null,
+				width:'full-width',
 				errorShow:'',
 				pakinShow:'',
 				pakinGun:'',
 				orderShow:false,
-				orderNo:null,
 				swiper:'swiper-here',
 				autoplay:true, // 鑷姩寰幆
 				interval:1000, // 璋冪敤鏃堕暱
@@ -326,9 +367,113 @@
 				// this.getYYY();
 				// this.getEEE();
 				this.animation();
-			},2000)
+			},1000)
 		},
 		methods: {
+			// 鑾峰彇閿欒淇℃伅
+			getYYY() {
+				let that = this
+				var result = ycqdata.dataEEE
+				// 娴嬭瘯鐢� 鈫�
+				var	res = result.data
+				// 娴嬭瘯鐢� 鈫�
+				// 杩斿洖缁撴灉鏈夊�� 涓斿�间笉绛変簬绌哄�� 灏辨槸鏈夐敊璇俊鎭渶瑕佸睍绀�
+				if (res.data && res.data !== "") {
+					that.errorMsg = res.data
+					that.errorShow = true
+					that.move = false // 鏄剧ず
+				} else {
+					that.errorPaper = ''
+					that.errorShow = false
+					if (that.pakinShow) {
+						return;
+					} else {
+						that.move = true // 闅愯棌
+					}
+				}
+			},
+			getEEE () {
+				let that = this
+				var newsData = ''
+				var str = ''
+				let result = ycqdata.dataYYY
+						// 娴嬭瘯鐢� 鈫�
+				let	res = result.data
+						// 娴嬭瘯鐢� 鈫�
+					if(res.data && res.data !== null) {
+						// that.move = false
+						// title
+						if (res.data[0].ioType === 101) {
+							that.title = '鍏ㄦ澘鍑哄簱'
+						} else if(res.data[0].ioType === 103) {
+							that.title = '妫�鏂欏嚭搴�'
+						}
+						that.staNo = '鐩爣绔�:' + res.data[0].staNo
+						that.matnr = '鍟嗗搧缂栧彿锛�' + res.data[0].matDtos[0].matnr
+						that.maknx = '鍟嗗搧鍚嶇О锛�' + res.data[0].matDtos[0].maknx
+						that.count = '鍑哄簱鏁伴噺锛�' + res.data[0].matDtos[0].count
+						if (res.data[0].orderNo) {
+							that.orderNo = "璁㈠崟鍙凤細" + res.data[0].orderNo
+							that.orderShow = true
+							that.width = 'half-width'
+						} else {
+							that.orderNo = null;
+							that.orderShow = false
+							that.width = 'full-width'
+						}
+						that.doneOfTray = '宸插嚭鎵樼洏鏁�:' + res.data[0].doneOfTray
+						that.totalOfTray = '鎵樼洏鎬绘暟閲忥細' + res.data[0].totalOfTray
+						that.doneOfUnit = '宸插嚭绠辨暟锛�' + res.data[0].doneOfUnit
+						that.totalOfUnit = '鎬荤鏁帮細' + res.data[0].totalOfUnit
+						if (that.errorShow) {
+									// that.pakinShow = false
+									return;
+								} else {
+									that.newspaper = newsData
+									that.move = false
+								}
+					}else {
+						that.move = true
+					}
+					
+					
+					// if(res.data && res.data !== null) {
+					// 	if (res.data[0].matDtos.length > 0) {
+					// 		that.pakinShow = true
+					// 		that.pakinGun = true
+					// 		if (res.data[0].ioType === 101) {
+					// 			that.title = '鍏ㄦ澘鍑哄簱'
+					// 		} else if(res.data[0].ioType === 103) {
+					// 			that.title = '鎷f枡鍑哄簱'
+					// 		}
+							
+					// 		if (res.data[0].orderNo) {
+					// 			that.orderNo = "璁㈠崟鍙凤細" + res.data[0].orderNo
+					// 			that.swiper = 'swiper-here-oN'
+					// 			that.orderShow = true
+					// 		} else {
+					// 			that.orderNo = null;
+					// 			that.swiper = 'swiper-here'
+					// 			that.orderShow = false
+					// 		}
+					// 		that.staNo = '鐩爣绔�' + res.data[0].staNo
+					// 		for (var i = 0; i < res.data[0].matDtos.length; i++) {
+					// 			var matnr = res.data[0].matDtos[i].matnr + ' - ' + res.data[0].matDtos[i].batch 
+					// 			that.matList.push(matnr)
+					// 		}
+					// 		
+					// 		if (res.data[0].matDtos.length <= 8) {
+					// 			that.errorShow = true
+					// 			that.pakinShow = true
+					// 			that.pakinGun  = false
+					// 		}
+					// 	} else {
+					// 		that.move = true
+					// 		}
+					// } else {
+					// 	that.move = true
+					// }
+			},
 			// 鑾峰彇閿欒淇℃伅
 			getError() {
 				let that = this
@@ -340,24 +485,13 @@
 					},
 					method:'GET',
 					success(result) {
-						// res = result.data 
-						// 娴嬭瘯鐢� 鈫�
-					result = ycqdata.dataEEE
-					res = result.data
-						// 娴嬭瘯鐢� 鈫�
-						// 杩斿洖缁撴灉鏈夊�� 涓斿�间笉绛変簬绌哄�� 灏辨槸鏈夐敊璇俊鎭渶瑕佸睍绀�
+						// console.log(result);
+						res = result.data 
 						if (res.data && res.data !== "") {
-							that.matList = []
-							that.orderNo = null
-							that.matList.push(res.data)
-							that.swiper = 'swiper-here-error'
-							that.title = ''
-							that.staNo = ''
-							that.pakinShow = false
+							that.errorMsg = res.data
 							that.errorShow = true
 							that.move = false // 鏄剧ず
 						} else {
-							that.errorPaper = ''
 							that.errorShow = false
 							if (that.pakinShow) {
 								return;
@@ -381,52 +515,42 @@
 					},
 					method:'GET',
 					success(result) {
-						// res = result.data
-						// 娴嬭瘯鐢� 鈫�
-					result = ycqdata.dataYYY
-					res = result.data
-						// 娴嬭瘯鐢� 鈫�
-						console.log(res)
+						console.log(result);
+						res = result.data
 						if(res.data && res.data !== null) {
-							if (res.data[0].matDtos.length > 0) {
-								that.pakinShow = true
-								that.pakinGun = true
-								if (res.data[0].ioType === 101) {
-									that.title = '鍏ㄦ澘鍑哄簱'
-								} else if(res.data[0].ioType === 103) {
-									that.title = '妫�鏂欏嚭搴�'
-								}
-								if (res.data[0].orderNo) {
-									that.orderNo = "璁㈠崟鍙凤細" + res.data[0].orderNo
-									that.swiper = 'swiper-here-oN'
-									that.orderShow = true
-								} else {
-									that.orderNo = null;
-									that.swiper = 'swiper-here'
-									that.orderShow = false
-								}
-								that.staNo = '鐩爣绔�' + res.data[0].staNo
-								for (var i = 0; i < res.data[0].matDtos.length; i++) {
-									var matnr = res.data[0].matDtos[i].matnr + ' - ' + res.data[0].matDtos[i].batch 
-									that.matList.push(matnr)
-								}
-								if (that.errorShow) {
-									// that.pakinShow = false
-									return;
-								} else {
-									that.newspaper = newsData
-									that.move = false
-								}
-								if (res.data[0].matDtos.length <= 8) {
-									that.errorShow = true
-									that.pakinShow = true
-									that.pakinGun  = false
-								}
+							// that.move = false
+							// title
+							if (res.data[0].ioType === 101) {
+								that.title = '鍏ㄦ澘鍑哄簱'
+							} else if(res.data[0].ioType === 103) {
+								that.title = '妫�鏂欏嚭搴�'
+							}
+							that.staNo = '鐩爣绔�:' + res.data[0].staNo
+							that.matnr = '鍟嗗搧缂栧彿锛�' + res.data[0].matDtos[0].matnr
+							that.maknx = '鍟嗗搧鍚嶇О锛�' + res.data[0].matDtos[0].maknx
+							that.count = '鍑哄簱鏁伴噺锛�' + res.data[0].matDtos[0].count
+							if (res.data[0].orderNo) {
+								that.orderNo = "璁㈠崟鍙凤細" + res.data[0].orderNo
+								that.orderShow = true
+								that.width = 'half-width'
 							} else {
+								that.orderNo = null;
+								that.orderShow = false
+								that.width = 'full-width'
+							}
+							that.doneOfTray = '宸插嚭鎵樼洏鏁�:' + res.data[0].doneOfTray
+							that.totalOfTray = '鎵樼洏鎬绘暟閲忥細' + res.data[0].totalOfTray
+							that.doneOfUnit = '宸插嚭绠辨暟锛�' + res.data[0].doneOfUnit
+							that.totalOfUnit = '鎬荤鏁帮細' + res.data[0].totalOfUnit
+							if (that.errorShow) {
+								// that.pakinShow = false
+								return;
+							} else {
+								that.newspaper = newsData
+								that.move = false
+							}
+						}else {
 								that.move = true
-								}
-						} else {
-							that.move = true
 						}
 					}
 				});
@@ -457,6 +581,7 @@
 					url: that.commonUrl + "/monitor/line/charts",
 					method:'GET',
 					success(result) {
+						// console.log(result)
 						var res = result.data
 						if (res.code === 200) {
 							that.chartsData.Line.categories = [
@@ -570,6 +695,24 @@
 </script>
 
 <style>
+	.full-width {
+		width: 100%;
+		height: 100%;
+		display: inline-block;
+		float: left;
+	}
+	.half-width {
+		width: 50%;
+		height: 100%;
+		display: inline-block;
+		float: left;
+	}
+	.box-items {
+		height: 20%;
+		width: 100%;
+		/* background-color: #233751; */
+		line-height: 300rpx;
+	}
 	/* 褰撳墠椤甸潰鏃� orderNo */
 	.swiper-here {
 		display: inline-block;
@@ -708,7 +851,7 @@
 		position: relative;
 		color: #FFFFFF;
 		text-align: center;
-		font-size: 200rpx;
+		font-size: 120rpx;
 		letter-spacing: 5rpx;
 		background-image: url(../../static/background.png);
 	}

--
Gitblit v1.9.1