|  |  |  | 
|---|
|  |  |  | <!-- 目标站 --> | 
|---|
|  |  |  | <view class="box-items">{{staNo}}</view> | 
|---|
|  |  |  | <!-- 商品编号 --> | 
|---|
|  |  |  | <view class="box-items">{{matnr}}</view> | 
|---|
|  |  |  | <!-- <view class="box-items">{{matnr}}</view> --> | 
|---|
|  |  |  | <!-- 商品名称 --> | 
|---|
|  |  |  | <view class="box-items">{{maknx}}</view> | 
|---|
|  |  |  | <!-- 商品名称 --> | 
|---|
|  |  |  | <view class="box-items">{{specs}}</view> | 
|---|
|  |  |  | <!-- 出库数量 --> | 
|---|
|  |  |  | <view class="box-items">{{count}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | 
|---|
|  |  |  | <p class="english">Today</p> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="sub-main"> | 
|---|
|  |  |  | <!-- 折线图 --> | 
|---|
|  |  |  | <view class="charts-box ring"> | 
|---|
|  |  |  | <qiun-data-charts type="ring" :opts="{legend:{position:'bottom'}}" :eopts="ringOpts" :chartData="chartsDataPie2" :echartsH5="true" :echartsApp="true"/> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | 
|---|
|  |  |  | <view class="box-border box-border4"></view> | 
|---|
|  |  |  | <!-- <text>浙江中扬立库技术有限公司</text> | 
|---|
|  |  |  | <text>当前版本号</text> --> | 
|---|
|  |  |  | <view @click="crn()">浙江中扬立库技术有限公司</view> | 
|---|
|  |  |  | <image src="../../static/barcode.png" mode="aspectFit"></image> | 
|---|
|  |  |  | <view @click="crn()">嘉善边锋机械股份有限公司</view> | 
|---|
|  |  |  | <!-- <image src="../../static/barcode.png" mode="aspectFit"></image> --> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="item"> | 
|---|
|  |  |  | <view class="desc">crnId:</view> | 
|---|
|  |  |  | <view class="desc">CrnId:</view> | 
|---|
|  |  |  | <view class="input"> | 
|---|
|  |  |  | <input type="text" v-model="crnId"> | 
|---|
|  |  |  | <input type="text" v-model="baseCrnId"> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | 
|---|
|  |  |  | week:'星期四', | 
|---|
|  |  |  | ani:'', | 
|---|
|  |  |  | // move: 'upMove 1.5s 1;', | 
|---|
|  |  |  | move:true, | 
|---|
|  |  |  | move:false, | 
|---|
|  |  |  | topMove:'topUp', | 
|---|
|  |  |  | floorMove:'', | 
|---|
|  |  |  | version:'', | 
|---|
|  |  |  | 
|---|
|  |  |  | staNo:'', | 
|---|
|  |  |  | matnr:'', | 
|---|
|  |  |  | maknx:'', | 
|---|
|  |  |  | specs:'', | 
|---|
|  |  |  | count:'', | 
|---|
|  |  |  | orderNo:null, | 
|---|
|  |  |  | doneOfTray:'', | 
|---|
|  |  |  | 
|---|
|  |  |  | const BaseLedId = uni.getStorageSync('BaseLedId'); | 
|---|
|  |  |  | const BasePort = uni.getStorageSync('BasePort'); | 
|---|
|  |  |  | const BaseCrnId = uni.getStorageSync('BaseCrnId'); | 
|---|
|  |  |  | // if (BaseIP && BaseLedId) { | 
|---|
|  |  |  | that.baseIP = BaseIP | 
|---|
|  |  |  | that.baseLedId = BaseLedId | 
|---|
|  |  |  | that.basePort = BasePort | 
|---|
|  |  |  | that.baseCrnId = BaseCrnId | 
|---|
|  |  |  | // } else { | 
|---|
|  |  |  | //    that.baseUrl = '' | 
|---|
|  |  |  | //    that.baseLedId = '' | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | this.getUrl() | 
|---|
|  |  |  | console.log(this.commonUrl); | 
|---|
|  |  |  | // this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePort + this.baseUr | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onLoad() { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onReady() { | 
|---|
|  |  |  | // 获得初始数据 | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | setInterval(() => { | 
|---|
|  |  |  | // 获得初始数据 | 
|---|
|  |  |  | this.initlineChart(); | 
|---|
|  |  |  | this.initPieChart(); | 
|---|
|  |  |  | }, 0); | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | // 主页信息 | 
|---|
|  |  |  | this.getServerData(); | 
|---|
|  |  |  | this.getOther(); | 
|---|
|  |  |  | this.getPakin(); | 
|---|
|  |  |  | }, 1000); | 
|---|
|  |  |  | setInterval(() => { | 
|---|
|  |  |  | // 其他信息 | 
|---|
|  |  |  | this.getDate(); | 
|---|
|  |  |  | this.getPakin(); | 
|---|
|  |  |  | this.getError(); | 
|---|
|  |  |  | // this.getYYY(); | 
|---|
|  |  |  | // this.getEEE(); | 
|---|
|  |  |  | this.animation(); | 
|---|
|  |  |  | this.animation() | 
|---|
|  |  |  | this.getUrl() | 
|---|
|  |  |  | },1000) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | // 获取url | 
|---|
|  |  |  | getUrl() { | 
|---|
|  |  |  | this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl | 
|---|
|  |  |  | this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePort + this.baseUrl | 
|---|
|  |  |  | this.chartsDataLine1 = JSON.parse(JSON.stringify(demodata.Line)) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 获取错误信息 | 
|---|
|  |  |  | getYYY() { | 
|---|
|  |  |  | 
|---|
|  |  |  | // 测试用 ↑ | 
|---|
|  |  |  | // 返回结果有值 且值不等于空值 就是有错误信息需要展示 | 
|---|
|  |  |  | if (res.data && res.data !== "") { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | that.errorMsg = res.data | 
|---|
|  |  |  | that.errorShow = true | 
|---|
|  |  |  | that.move = false // 显示 | 
|---|
|  |  |  | 
|---|
|  |  |  | 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.doneOfUnit = '已出箱数:' + res.data[0].doneOfUnit | 
|---|
|  |  |  | that.totalOfUnit = '总箱数:' + res.data[0].totalOfUnit | 
|---|
|  |  |  | if (that.errorShow) { | 
|---|
|  |  |  | // that.pakinShow = false | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | that.newspaper = newsData | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 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 (res.data[0].matDtos.length <= 8) { | 
|---|
|  |  |  | //          that.errorShow = true | 
|---|
|  |  |  | //          that.pakinShow = true | 
|---|
|  |  |  | //          that.pakinGun  = false | 
|---|
|  |  |  | //       } | 
|---|
|  |  |  | //    } else { | 
|---|
|  |  |  | //       that.move = true | 
|---|
|  |  |  | //       } | 
|---|
|  |  |  | // } else { | 
|---|
|  |  |  | //    that.move = true | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 获取错误信息 | 
|---|
|  |  |  | getError() { | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | method:'GET', | 
|---|
|  |  |  | success(result) { | 
|---|
|  |  |  | console.log(result); | 
|---|
|  |  |  | res = result.data | 
|---|
|  |  |  | if (res.data && res.data !== "") { | 
|---|
|  |  |  | that.errorMsg = res.data | 
|---|
|  |  |  | 
|---|
|  |  |  | that.move = false // 显示 | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | that.errorShow = false | 
|---|
|  |  |  | if (that.pakinShow) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | that.move = true // 隐藏 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // if (that.pakinShow) { | 
|---|
|  |  |  | //    return; | 
|---|
|  |  |  | // } else { | 
|---|
|  |  |  | //    // that.move = true // 隐藏 | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | method:'GET', | 
|---|
|  |  |  | success(result) { | 
|---|
|  |  |  | // console.log(result); | 
|---|
|  |  |  | res = result.data | 
|---|
|  |  |  | if (that.errorShow) { | 
|---|
|  |  |  | return;  // 有错误信息 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 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 = '检料出库' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else | 
|---|
|  |  |  | that.title = res.data[0].title | 
|---|
|  |  |  | that.staNo = '目标站:' + res.data[0].staNo | 
|---|
|  |  |  | that.matnr = '商品编号:' + res.data[0].matDtos[0].matnr | 
|---|
|  |  |  | that.maknx = '商品名称:' + res.data[0].matDtos[0].maknx | 
|---|
|  |  |  | that.specs = '规格:' + res.data[0].matDtos[0].specs | 
|---|
|  |  |  | that.count = '出库数量:' + res.data[0].matDtos[0].count | 
|---|
|  |  |  | if (res.data[0].orderNo) { | 
|---|
|  |  |  | that.orderNo = "订单号:" + res.data[0].orderNo | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | that.newspaper = newsData | 
|---|
|  |  |  | that.move = false | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | that.move = true | 
|---|
|  |  |  | that.move = true | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | animation() { | 
|---|
|  |  |  | if (this.move) { | 
|---|
|  |  |  | // 上层向上 / 下层向上 | 
|---|
|  |  |  | if (this.move) { | 
|---|
|  |  |  | this.topMove = 'topUp' | 
|---|
|  |  |  | this.floorMove = 'floorUp' | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | // 上层向下 / 下层向下 | 
|---|
|  |  |  | this.topMove = 'topDown' | 
|---|
|  |  |  | this.floorMove = 'floorDown' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | url: that.commonUrl + "/monitor/line/charts", | 
|---|
|  |  |  | method:'GET', | 
|---|
|  |  |  | success(result) { | 
|---|
|  |  |  | // console.log(result) | 
|---|
|  |  |  | var res = result.data | 
|---|
|  |  |  | console.log(result); | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | that.chartsData.Line.categories = [ | 
|---|
|  |  |  | that.getDateFormat(-11),that.getDateFormat(-10),that.getDateFormat(-9),that.getDateFormat(-8), | 
|---|
|  |  |  | 
|---|
|  |  |  | ledId: 1, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | success(result) { | 
|---|
|  |  |  | console.log(result); | 
|---|
|  |  |  | var res = result.data | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | that.xDistance = res.data.xDistance | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 弹出层确认 | 
|---|
|  |  |  | ejectConfirm() { | 
|---|
|  |  |  | uni.setStorageSync('BaseIp', this.baseIp); | 
|---|
|  |  |  | uni.setStorageSync('BaseIp', this.baseIP); | 
|---|
|  |  |  | uni.setStorageSync('BaseLedId', this.baseLedId); | 
|---|
|  |  |  | uni.setStorageSync('BasePort',this.basePort); | 
|---|
|  |  |  | uni.setStorageSync('BaseCrnId',this.baseCrnId); | 
|---|
|  |  |  | this.getUrl() | 
|---|
|  |  |  | console.log(uni.getStorageSync('BaseIp')); | 
|---|
|  |  |  | console.log(this.baseIP); | 
|---|
|  |  |  | console.log(this.commonUrl); | 
|---|
|  |  |  | this.ejectShow = false | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 弹出层取消 | 
|---|