From 6ac8dfa47953097663fe3b87331d4b1eb18ac102 Mon Sep 17 00:00:00 2001
From: whycq <123456>
Date: 星期日, 15 五月 2022 19:45:30 +0800
Subject: [PATCH] #

---
 Monitor-APP/pages/index/index.vue |  105 ++++++++++++++++++++++----
 Monitor-APP/pages/index/data.js   |  119 ++++++++++++++++-------------
 2 files changed, 155 insertions(+), 69 deletions(-)

diff --git a/Monitor-APP/pages/index/data.js b/Monitor-APP/pages/index/data.js
index c8a0d47..be40313 100644
--- a/Monitor-APP/pages/index/data.js
+++ b/Monitor-APP/pages/index/data.js
@@ -28,56 +28,71 @@
 // 			{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504810","count":1.0},
 // 			{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037505148","count":1.0}],
 // 			"emptyMk":false}]} 
+	getEEE() {
+		var  result = {'data':{"msg":"鎿嶄綔鎴愬姛","code":200,"data":"鎿嶄綔鎴愬姛"}}
+		let that = this
+		let res = result.data
+		if (res.data) {
+			that.title = ''
+			that.staNo = ''
+			that.errorShow = true
+			that.newspaper = res.data
+			that.move = false
+		} else {
+			that.errorShow = false
+		}
+	},
 	getYYY() {
-				
-				var result = {"msg":"鎿嶄綔鎴愬姛",
-								"code":200,
-								"data":[{
-									"title":"鍏ㄦ澘鍑哄簱",
-									"workNo":7016,
-									"ioType":101, 
-									"staNo":188,
-									"sourceStaNo":null,
-									"locNo":null,
-									"sourceLocNo":"0900107",
-									"matDtos":[
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037502300","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037505146","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504801","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027507729","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027507727","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027507731","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504807","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504805","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504797","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504794","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504791","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504793","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037505141","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027507728","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504810","count":1.0},
-										{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037505148","count":1.0}],
-										"emptyMk":false}]} 
-				let that = this
-				var newsData = ''
-				var str = ''
-				let res = result.data
-				if (res[0]) {
-					if (res[0].ioType === 101) {
-						that.title = '鍏ㄦ澘鍑哄簱'
-					} else if(res[0].ioType === 103) {
-						that.title = '妫�鏂欏嚭搴�'
-					}
-					that.staNo = '鐩爣绔�' + res[0].staNo
-					
-					for (var i = 0; i < res[0].matDtos.length; i++) {
-						str = res[0].matDtos[i].matnr + ' - ' + res[0].matDtos[i].batch + '\n'
-						newsData = newsData + str 
-					}
-					that.newspaper = newsData
-					that.move = false
-				} else {
-					that.newspaper = ''
-					that.move = true
-				}
-			},
\ No newline at end of file
+		var result = {
+			'data':{"msg":"鎿嶄綔鎴愬姛","code":200,"data":[{
+				"title":"鍏ㄦ澘鍑哄簱",
+				"workNo":7016,
+				"ioType":101, 
+				"staNo":188,
+				"sourceStaNo":null,
+				"locNo":null,
+				"sourceLocNo":"0900107",
+				"matDtos":[
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037502300","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037505146","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504801","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027507729","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027507727","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027507731","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504807","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504805","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504797","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504794","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504791","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504793","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037505141","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027507728","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504810","count":1.0},
+					{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037505148","count":1.0},
+					],
+					"emptyMk":false}]} }
+		let that = this
+		var newsData = ''
+		var str = ''
+		let res = result.data
+		if (res.data[0].matDtos.length > 0) {
+			if (res.data[0].ioType === 101) {
+				that.title = '鍏ㄦ澘鍑哄簱'
+			} else if(res.data[0].ioType === 103) {
+				that.title = '妫�鏂欏嚭搴�'
+			}
+			that.staNo = '鐩爣绔�' + res.data[0].staNo
+			for (var i = 0; i < res.data[0].matDtos.length; i++) {
+				str = res.data[0].matDtos[i].matnr + ' - ' + res.data[0].matDtos[i].batch + '\n'
+				newsData = newsData + str 
+			}
+			if (that.errorShow) {
+				return;
+			} else {
+				that.newspaper = newsData
+				that.move = false
+			}
+		} else {
+			that.move = true
+		}
+	},
\ No newline at end of file
diff --git a/Monitor-APP/pages/index/index.vue b/Monitor-APP/pages/index/index.vue
index 9858af8..e4828b5 100644
--- a/Monitor-APP/pages/index/index.vue
+++ b/Monitor-APP/pages/index/index.vue
@@ -18,7 +18,8 @@
 							<text>{{title}}</text>
 						</view>
 						<view style="width: 80%;height: 100%;display: inline-block;float: left;font-size: 170rpx;">
-							<text class="animate">{{newspaper}}</text>
+							<text class="animate" v-show="!errorShow">{{newspaper}}</text>
+							<text v-show="errorShow">{{newspaper}}</text>
 						</view>
 						<view style="width: 10%;height: 100%;display: inline-block;float: right;padding-top: 180px;">
 							<text>{{staNo}}</text>
@@ -255,7 +256,8 @@
 				// newspaper:'鎷f枡鍑哄簱锛�4426)\n婧愬簱浣嶏細1200101\n鐩爣绔欙細186\n1101842-10000-22047518517\n\n',	
 				newspaper:'',
 				title:'',
-				staNo:''
+				staNo:'',
+				errorShow:'',
 			}
 		},
 		mounted() {
@@ -285,10 +287,12 @@
 			}, 1000);
 			setInterval(() => {
 				this.getDate();
-				this.getPakin();
-				this.getError();
+				// this.getPakin();
+				// this.getError();
+				this.getYYY();
+				this.getEEE();
 				this.animation();
-			},1000)
+			},2000)
 		},
 		onLoad() {
 			// var that=this
@@ -298,6 +302,74 @@
 		},
 		methods: {
 			
+			getEEE() {
+				var  result = {'data':{"msg":"鎿嶄綔鎴愬姛","code":200,"data":"鎿嶄綔鎴愬姛"}}
+				let that = this
+				let res = result.data
+				if (res.data) {
+					that.title = ''
+					that.staNo = ''
+					that.errorShow = true
+					that.newspaper = res.data
+					that.move = false
+				} else {
+					that.errorShow = false
+				}
+			},
+			getYYY() {
+				var result = {
+					'data':{"msg":"鎿嶄綔鎴愬姛","code":200,"data":[{
+						"title":"鍏ㄦ澘鍑哄簱",
+						"workNo":7016,
+						"ioType":101, 
+						"staNo":188,
+						"sourceStaNo":null,
+						"locNo":null,
+						"sourceLocNo":"0900107",
+						"matDtos":[
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037502300","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037505146","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504801","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027507729","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027507727","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027507731","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504807","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504805","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504797","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504794","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504791","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504793","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037505141","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027507728","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22027504810","count":1.0},
+							{"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037505148","count":1.0},
+							],
+							"emptyMk":false}]} }
+						let that = this
+						var newsData = ''
+						var str = ''
+						let res = result.data
+						if (res.data[0].matDtos.length > 0) {
+							if (res.data[0].ioType === 101) {
+								that.title = '鍏ㄦ澘鍑哄簱'
+							} else if(res.data[0].ioType === 103) {
+								that.title = '妫�鏂欏嚭搴�'
+							}
+							that.staNo = '鐩爣绔�' + res.data[0].staNo
+							for (var i = 0; i < res.data[0].matDtos.length; i++) {
+								str = res.data[0].matDtos[i].matnr + ' - ' + res.data[0].matDtos[i].batch + '\n'
+								newsData = newsData + str 
+							}
+							if (that.errorShow) {
+								return;
+							} else {
+								that.newspaper = newsData
+								that.move = false
+							}
+						} else {
+							that.move = true
+						}
+					},
 			getError() {
 				let that = this
 				uni.request({
@@ -307,16 +379,15 @@
 					},
 					method:'GET',
 					success(result) {
-						that.title = ''
-						that.staNo = ''
-						console.log(result)
 						let res = result.data 
 						if (res.data) {
+							that.title = ''
+							that.staNo = ''
+							that.errorShow = true
 							that.newspaper = res.data
 							that.move = false
 						} else {
-							that.newspaper = ''
-							that.move = true
+							that.errorShow = false
 						}
 					}
 				});
@@ -334,24 +405,24 @@
 						var newsData = ''
 						var str = ''
 						let res = result.data
-						if (res.data[0]) {
+						if (res.data[0].matDtos) {
 							if (res.data[0].ioType === 101) {
 								that.title = '鍏ㄦ澘鍑哄簱'
 							} else if(res.data[0].ioType === 103) {
 								that.title = '妫�鏂欏嚭搴�'
 							}
 							that.staNo = '鐩爣绔�' + res.data[0].staNo
-							
 							for (var i = 0; i < res.data[0].matDtos.length; i++) {
 								str = res.data[0].matDtos[i].matnr + ' - ' + res.data[0].matDtos[i].batch + '\n'
 								newsData = newsData + str 
 							}
-							that.newspaper = newsData
-							that.move = false
+							if (that.errorShow) {
+								return;
+							} else {
+								that.newspaper = newsData
+								that.move = false
+							}
 						} else {
-							that.newspaper = ''
-							that.title = ''
-							that.staNo = ''
 							that.move = true
 						}
 					}

--
Gitblit v1.9.1