From d36ff3f80b4891f56342d5fb6bcc4390497ae348 Mon Sep 17 00:00:00 2001 From: whycq <123456> Date: 星期一, 16 五月 2022 22:11:28 +0800 Subject: [PATCH] # --- Monitor-APP/pages/index/data.js | 105 ++++++++++++++++++++++++++-------------------------- 1 files changed, 53 insertions(+), 52 deletions(-) diff --git a/Monitor-APP/pages/index/data.js b/Monitor-APP/pages/index/data.js index b24c254..dc0355a 100644 --- a/Monitor-APP/pages/index/data.js +++ b/Monitor-APP/pages/index/data.js @@ -29,74 +29,75 @@ // {"matnr":"1100349-10000","maknx":"C5S-4-M03/333/KS","batch":"22037505148","count":1.0}], // "emptyMk":false}]} getEEE() { - var result = {'data':{"msg":"鎿嶄綔鎴愬姛","code":200,"data":"鎿嶄綔鎴愬姛"}} + var result = ycqdata.dataEEE + console.log(result) let that = this let res = result.data - if (res.data) { + console.log(res) + if (res.data && res.data !== "") { + console.log('鏈夊紓甯�') that.title = '' that.staNo = '' + that.pakinShow = false that.errorShow = true - that.newspaper = res.data - that.move = false + that.errorPaper = res.data + that.move = false // 鏄剧ず } else { + that.errorPaper = '' that.errorShow = false + console.log('鏃犲紓甯�') + console.log(that.pakinShow) + if (that.pakinShow) { + console.log('鏃犲紓甯�,鏈夋嫞璐�') + return; + } else { + that.move = true // 闅愯棌 + } } }, 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}]} } + var result = ycqdata.dataYYY + console.log(result) let that = this var newsData = '' var str = '' let res = result.data - if (res.data[0].matDtos) { - alert(12) - if (res.data[0].matDtos.length <= 8) { + if(res.data) { + console.log("鎷h揣锛屾湁鎷f枡") + if (res.data[0].matDtos.length > 0) { + console.log("鏈夋嫞鏂�,闀垮害>8") + that.pakinShow = true - } - 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; + that.pakinGun = true + // console.log(that.errorShow,that.pakinShow,that.pakinGun) + + 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) { + // that.pakinShow = false + return; + } else { + that.newspaper = newsData + that.move = false + } + if (res.data[0].matDtos.length <= 8) { + console.log("鏈夋嫞鏂�,闀垮害<=8") + that.errorShow = true + that.pakinShow = true + that.pakinGun = false + + } + console.log(that.errorShow,that.pakinShow,that.pakinGun) } else { - that.newspaper = newsData - that.move = false + that.move = true } - } else { - that.move = true } }, \ No newline at end of file -- Gitblit v1.9.1