#
whycq
2022-07-29 8b86031dfb1eee0f12902590a5b6fe82663b39f0
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 = '拣料出库'
               //       }
               //       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,12 @@
               },
               method:'GET',
               success(result) {
                  // res = result.data
                  // 测试用 ↓
               result = ycqdata.dataEEE
               res = result.data
                  // 测试用 ↑
                  // 返回结果有值 且值不等于空值 就是有错误信息需要展示
                  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 +514,41 @@
               },
               method:'GET',
               success(result) {
                  // res = result.data
                  // 测试用 ↓
               result = ycqdata.dataYYY
               res = result.data
                  // 测试用 ↑
                  console.log(res)
                  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
                  }
               }
            });
@@ -570,6 +692,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 +848,7 @@
      position: relative;
      color: #FFFFFF;
      text-align: center;
      font-size: 200rpx;
      font-size: 120rpx;
      letter-spacing: 5rpx;
      background-image: url(../../static/background.png);
   }