pang.jiabao
2025-09-23 83ea9dc1674145a338e0d35f8dffce024e2ae49f
Monitor-APP/pages/home/home.vue
@@ -3,7 +3,7 @@
      <uni-transition :duration="duration" :mode-class="homeMode" :show="homeViewShow">
         <view class="home-view">
            <view class="head">
               <text>自动仓库WCS监控平台</text>
               <text>德利众自动仓库WCS监控平台</text>
            </view>
            <!-- 日历 -->
            <view class="time-tools">{{calendar}}</view>
@@ -17,10 +17,22 @@
                        <view class="box-item">
                           <text class="item-title">自动化立体仓库</text>
                           <text class="item-subTitle">Automatic Storageand Retrieval System</text>
                           <!-- <text class="item-text" -->
                              <!-- style="text-align: left;">利用立体仓库设备可实现仓库高层合理化、存取自动化、操作简便化;自动化立体仓库是当前技术水平较高的形式。自动化立体仓库的主体由货架、巷道式堆垛起重机、入(出)库工作台和自动运进(出)及操作控制系统组成。货架是钢结构或钢筋混凝土结构的建筑物或结构体,货架内是标准尺寸的货位空间,巷道堆垛起重机穿行于货架之间的巷道中,完成存、取货的工作。管理上采用计算机及条形码技术。</text> -->
                           <text class="item-text"
                              style="text-align: left;">利用立体仓库设备可实现仓库高层合理化、存取自动化、操作简便化;自动化立体仓库是当前技术水平较高的形式。自动化立体仓库的主体由货架、巷道式堆垛起重机、入(出)库工作台和自动运进(出)及操作控制系统组成。货架是钢结构或钢筋混凝土结构的建筑物或结构体,货架内是标准尺寸的货位空间,巷道堆垛起重机穿行于货架之间的巷道中,完成存、取货的工作。管理上采用计算机及条形码技术。</text>
                                 style="text-align: left;">在自动化立体仓库的运行过程中,信息化系统的支撑至关重要,其中 WMS(仓库管理系统) 和 WCS(仓库控制系统) 构成了核心的信息与控制平台。</text>
                              <text class="item-text"
                                    style="text-align: left;">WMS 系统主要负责仓库的业务管理与决策支持。它通过对入库、出库、移库、盘点等作业流程的优化,实现库位的合理分配和库存的精确管控。WMS 能够与 ERP、MES 等上层业务系统对接,保证物料数据、订单信息与实际货物状态的统一,从而提高整个供应链的透明度和协同性。</text>
                              <text class="item-text"
                                    style="text-align: left;">WCS 系统则承担底层设备的实时调度与控制任务。它接收 WMS 下发的作业指令,分解为具体的设备动作,协调堆垛机、输送线、穿梭车、AGV 等多种设备协同运行,确保作业过程安全高效。WCS 更强调执行层的实时性与稳定性,通过路径优化、任务分配和冲突处理,保障系统的整体吞吐能力。</text>
                              <text class="item-text"
                                    style="text-align: left;">WMS 与 WCS 的紧密结合,使自动化立体仓库不仅具备 高层合理化、存取自动化、操作简便化 的特点,还能实现 库存管理的精细化、物流执行的智能化。这为企业降低运营成本、提升空间利用率和出入库效率提供了坚实保障。</text>
                        </view>
                        <view class="box-item">
                        <view class="box-item"></view>
                  <!--       <view class="box-item">
                           <text class="item-title">仓库数据</text>
                           <text class="item-subTitle">warehouse data</text>
                           <view class="img-box">
@@ -82,7 +94,7 @@
                              </view>
                           </view>
                        </view>
                        </view> -->
                        <view class="box-item">
                           <view class="flex-row" style="width: 100%;">
                              <!-- 左侧 -->
@@ -92,22 +104,22 @@
                                 <text class="item-subTitle">EQUIPMENT USAGE THIS MONTH</text>
                              </view>
                              <!-- 右侧 -->
                              <view style="margin-left: auto;">
                              <!-- <view style="margin-left: auto;"> -->
                                 <!-- 百分比 -->
                                 <view class="flex-col"
                                    style="align-items: flex-end;justify-content: flex-end;">
                                 <!-- <view class="flex-col" -->
                                    <!-- style="align-items: flex-end;justify-content: flex-end;"> -->
                                    <!-- style="justify-content: flex-end;position: absolute;top: 0;right: 1vw;text-align: right;" -->
                                    <text class="item-title">{{baseInfo.usedPr}}%</text>
                                    <!-- <text class="item-title">{{baseInfo.usedPr}}%</text>
                                    <text class="item-subTitle">同比上月 + 5%</text>
                                 </view>
                              </view>
                              </view> -->
                           </view>
                           <view class="flex-col"
                              style="width: 100%;align-items: flex-start;position: relative;font-size: 1vw">
                              <!-- 进度条 -->
                              <view class="flex-row" style="width: 100%;position: relative;margin-top: 5%;">
                                 <view class="progressBar" style="width: 80%;height: 2vw;">
                                 <view class="progressBar" style="width: 85%;height: 2vw;">
                                    <view class="progress" :style="'width:'+ baseInfo.usedPr + '%'"></view>
                                 </view>
                                 <view
@@ -140,8 +152,8 @@
                                       <view class="flex-col"
                                          style="align-items: flex-end;justify-content: flex-end;">
                                          <!-- style="justify-content: flex-end;position: absolute;top: 0;right: 1vw;text-align: right;" -->
                                          <text class="item-title">31</text>
                                          <text class="item-subTitle">今日订单数</text>
                                          <!-- <text class="item-title">31</text> -->
                                          <!-- <text class="item-subTitle">今日订单数</text> -->
                                       </view>
                                    </view>
                                 </view>
@@ -158,7 +170,7 @@
                        <view style="height: 2%;"></view>
                        <view style="height: 43%;">
                        <view style="height: 63%;">
                           <y-box>
                              <view class="box-item">
                                 <view class="flex-row" style="width: 100%;">
@@ -217,15 +229,13 @@
                           </y-box>
                        </view>
                        <view style="height: 2%;"></view>
                        <view style="height: 18%;">
                           <y-box>
                              <view class="flex-col"
                                 style="width: 100%;height: 100%;font-size: 4vh;justify-content: center;letter-spacing: 1vh;">
                                 自动仓库WCS监控平台
                              </view>
                           </y-box>
                        </view>
                  <!--       <view style="height: 2%;"></view>
                        <view style="height: 18%"  class="flex-row">
                              <image style="height: 100%;"
                                 src="" mode="aspectFit"></image>
                              <image style="height: 100%;"
                                 src="../../static/zy_logo.png" mode="aspectFit"></image>
                        </view> -->
                     </view>
                  </view>
               </view>
@@ -246,25 +256,54 @@
            <!-- 主体 -->
            <view class="info-main">
               <view class="info-box">
                  <view class="swiper-head" style="height: 10%;width: 96%;margin-left: 2%;font-size: 2.5vw;">
                     <view style="width: 15%;">订单号</view>
                     <view style="width: 10%;">单行ID</view>
                     <view style="width: 10%;">托盘码</view>
                     <view style="width: 15%;">商品编号</view>
                     <view style="width: 15%;">商品名称</view>
                     <view style="width: 15%;">特殊说明</view>
                     <view style="width: 10%;">作业数量</view>
                     <view style="width: 10%;">剩余数量</view>
                  </view>
                  <y-box>
                     <!-- 文本容器 -->
                     <view class="text-content" v-for="item in swiperList">
                        <view>目标站:{{infoText.staNo}}</view>
                     <!-- <view class="text-content" v-for="item in swiperList" style="font-size: 3vw;"> -->
<!--                         <view>目标站:{{infoText.staNo}}</view>
                        <view>商品编码:{{item.matnr}}</view>
                        <view>商品名称:{{item.maknx}}</view>
                        <view>规格:{{item.specs}}</view>
                        <view>图号:{{item.model ? item.model :''}}</view>
                        <view>数量:{{item.count}} / {{item.total ? item.total : '--'}}</view>
                        <view>数量:{{item.count}} / {{item.total ? item.total : '--'}}</view> -->
         <!--             <view style="display: flex;text-align: left;">
                        <view style="width: 50%;">订单号:{{item.orderNo}}</view>
                        <view style="width: 50%;">单行ID:{{item.memo}}</view>
                     </view>
                     <view style="display: flex;text-align: left;">
                           <view style="width: 50%;">商品编号:{{item.matnr}}</view>
                           <view style="width: 50%;">商品名称:{{item.maknx}}</view>
                     </view>
                     <view style="display: flex;text-align: left;">
                           <view style="width: 50%;">托盘码:{{infoText.barcode}}</view>
                           <view style="width: 50%;">特殊说明:{{item.batch}}</view>
                     </view>
                     <view style="display: flex;text-align: left;">
                           <view style="width: 50%;">作业数量:{{item.count}}</view>
                           <view style="width: 50%;">剩余数量:{{item.total}}</view>
                     </view> -->
                        <!-- head -->
                        <!-- <view class="swiper-head">
                           <view style="width: 20%;">目标站:{{infoText.staNo}}</view>
                           <view style="width: 30%;">商品编号</view>
                           <view style="width: 20%;">商品名称</view>
                           <view style="width: 20%;">规格</view>
                           <view style="width: 10%;">数量</view>
<!--                         <view class="swiper-head" style="height: 15%;">
                           <view style="width: 15%;">订单号</view>
                           <view style="width: 10%;">单行ID</view>
                           <view style="width: 15%;">商品编号</view>
                           <view style="width: 15%;">商品名称</view>
                           <view style="width: 10%;">托盘码</view>
                           <view style="width: 15%;">特殊说明</view>
                           <view style="width: 10%;">作业数量</view>
                           <view style="width: 10%;">剩余数量</view>
                        </view> -->
                        <!-- body -->
                        <!-- <view class="swiper-body"> -->
@@ -272,19 +311,23 @@
                           circular 是否采用衔接滑动,即播放到末尾后重新回到开头
                           vertical 滑动方向是否为纵向 
                           display-multiple-items 同时显示的滑块数量 -->
                        <!-- <swiper class="swiper-body-main" vertical="true"
                           display-multiple-items="8"
                           circular="true" :autoplay="true" :interval="3000" :duration="1000">
                              <swiper-item class="swiper-item" v-for="(item,i) in swiperList" :key="i">
                                 <view style="width: 20%;">No:{{i+1}}</view>
                                 <view style="width: 30%;">{{item.matNo}}</view>
                                 <view style="width: 20%;">{{item.maknx}}</view>
                                 <view style="width: 20%;">{{item.specs}}</view>
                        <swiper class="swiper-body-main" vertical="true"
                           display-multiple-items="3"
                           circular="true" :autoplay="true" :interval="3000" :duration="1000" style="font-size: 2.5vw;">
                              <swiper-item  class="swiper-item" v-for="(item,i) in swiperList" :key="i">
                                 <!-- <view>No:{{i+1}}</view> -->
                                 <view style="width: 15%;">{{item.orderNo}}</view>
                                 <view style="width: 10%;"> {{item.memo}}</view>
                                 <view style="width: 10%;">{{infoText.barcode}}</view>
                                 <view style="width: 15%;">{{item.matnr}}</view>
                                 <view style="width: 15%;">{{item.maknx}}</view>
                                 <view style="width: 15%;">{{item.batch}}</view>
                                 <view style="width: 10%;">{{item.count}}</view>
                                 <view style="width: 10%;">{{item.total}}</view>
                              </swiper-item>
                           </swiper>
                        </view> -->
                     </view>
                        <!-- </view> -->
                     <!-- </view> -->
                  </y-box>
               </view>
            </view>
@@ -358,14 +401,6 @@
            </view>
         </view>
      </view>
      <!-- 小车异常 -->
            <view class="board">
               <uni-transition ref="ani" custom-class="transition" :mode-class="newModeClass" :show="errorBoardShow">
                  <view class="error-board">
                     <text v-for="item in carInfo">{{item}}</text>
                  </view>
               </uni-transition>
            </view>
      <view style="color: #FFF;position: fixed;bottom: 10px;left: 10px;" v-show="timeOut">
         连接超时: {{times}} s
      </view>
@@ -382,6 +417,7 @@
            homeViewShow: true,
            infoViewShow: false,
            errorInfoViewShow: false,
            errorBoardShow: false,
            homeMode: [],
            carInfo: [],
            infoMode: [],
@@ -422,6 +458,13 @@
            baseLedId: '',
            baseCrnId: '',
            baseUrl: '',
            apiIp: '10.10.0.189',
            apiPort: '8080',
            apiUrl: 'dlzwcs',
            // apiIp: '192.168.4.49',
            // apiPort: '9090',
            // apiUrl: 'jsjwcs',
            ledInfosApi: '/console/getLedInfos',
            info: null,
            error: null,
            infoType: 0,
@@ -492,6 +535,8 @@
         }, 500)
      },
      onLoad() {
         this.getLedInfo()
         setInterval(() => {
            this.getDate2()
            this.getUrl()
@@ -507,27 +552,27 @@
            this.initlineChart()
            this.initPieChart()
            this.getOther()
         }, 1800000)
         }, 180000)
      },
      methods: {
         carInfoModel(res) {
                     let infoList = []
                     if (res.code == 200 && res.data != '') {
                        let str = ''
                        for (let k of res.data) {
                           str = `${k.deviceNo}号${k.device}-${k.errorMsg}`
                           infoList.push(str)
                        }
                        this.carInfo = infoList
                        this.errorBoardShow = true
                     } else {
                        this.errorBoardShow = false
                     }
                  },
            let infoList = []
            if (res.code == 200 && res.data != '') {
               let str = ''
               for (let k of res.data) {
                  str = `${k.deviceNo}号${k.device}-${k.errorMsg}`
                  infoList.push(str)
               }
               this.carInfo = infoList
               this.errorBoardShow = true
            } else {
               this.errorBoardShow = false
            }
         },
         changeErrorShow() {
                     this.errorBoardShow = !this.errorBoardShow
                  },
            this.errorBoardShow = !this.errorBoardShow
         },
         timeOuts() {
            console.log(this.times);
         },
@@ -537,6 +582,25 @@
         getServerData() {
            this.chartsDataLine1 = JSON.parse(JSON.stringify(this.chartsData.Line))
            this.chartsDataPie2 = JSON.parse(JSON.stringify(this.chartsData.Pie))
         },
         getLedInfo() {
            let that = this
            uni.request({
               url: this.baseHttp +  that.apiIp + ":" + that.apiPort + "/" + that.apiUrl + "/" + that.ledInfosApi,
               method: "GET",
               data: {},
               success(result) {
                  var res = result.data
                  let data = res.data;
                  uni.setStorageSync('BaseIp', that.apiIp);
                  uni.setStorageSync('BaseLedId', data.staArr);
                  uni.setStorageSync('BasePort', that.apiPort);
                  uni.setStorageSync('BaseCrnId', data.crnId);
                  uni.setStorageSync('UPROJ', that.apiUrl);
                  this.getUrl()
               }
            })
         },
         // 获取错误信息
         getInfo2() {
@@ -630,21 +694,22 @@
                  that.infoText.title = '拣料出库'
               } else if (res.data[0].ioType === 107) {
                  that.infoText.title = '盘点出库'
               }else if (res.data[0].ioType === 1) {
               } else if (res.data[0].ioType === 1) {
                  that.infoText.title = '全板入库'
               }else if (res.data[0].ioType === 10) {
               } else if (res.data[0].ioType === 10) {
                  that.infoText.title = '空板入库'
               }else if (res.data[0].ioType === 54) {
               } else if (res.data[0].ioType === 54) {
                  that.infoText.title = '并板入库'
               }else if (res.data[0].ioType === 110) {
               } else if (res.data[0].ioType === 110) {
                  that.infoText.title = '空板出库'
               }else if (res.data[0].ioType === 53) {
               } else if (res.data[0].ioType === 53) {
                  that.infoText.title = '拣料再入库'
               }else if (res.data[0].ioType === 57) {
               } else if (res.data[0].ioType === 57) {
                  that.infoText.title = '盘点再入库'
               }
               that.infoText.staNo = res.data[0].staNo
               that.infoText.barcode = res.data[0].barcode
               that.swiperList = res.data[0].matDtos
               // that.infoText.matnr = res.data[0].matDtos[0].matnr
               // that.infoText.specs = res.data[0].matDtos[0].specs
@@ -790,6 +855,7 @@
                  var res = result.data.data
                  that.calendar = res.year + "年" + res.month + "月" + res.day + "日 " + res.hour + ":" + res
                     .minute + ":" + res.second + " " + res.week
                  that.currDate = res.year + "/" + res.month + "/" + res.day
               },
               fail(res) {
@@ -967,7 +1033,7 @@
   .head {
      width: 100vw;
      height: 11vh;
      font-size: 4vw;
      font-size: 3vw;
      font-weight: 700;
      display: flex;
      align-items: center;
@@ -1141,7 +1207,7 @@
   .info-box {
      width: 98%;
      height: 98%;
      height: 90%;
   }
   /* 异常信息 */
@@ -1275,25 +1341,26 @@
   .textred {
      color: red;
   }
   .board {
         position: absolute;
         top: 0;
         right: 0;
         /* background-color: #aa00ff; */
         /* height: 13vh; */
         width: 100%;
         /* box-shadow: rgba(0,0,0,.35) 0px 5px 15px; */
      }
      .error-board {
         margin: .2rem;
         height: 11vh;
         background-color: #F56C6C;
         box-shadow: rgba(0, 0, 0, .35) 0px 5px 15px;
         border-radius: .2rem;
         display: flex;
         align-items: center;
         justify-content: space-around;
         font-size: 2rem;
      }
      position: absolute;
      top: 0;
      right: 0;
      /* background-color: #aa00ff; */
      /* height: 13vh; */
      width: 100%;
      /* box-shadow: rgba(0,0,0,.35) 0px 5px 15px; */
   }
   .error-board {
      margin: .2rem;
      height: 11vh;
      background-color: #F56C6C;
      box-shadow: rgba(0, 0, 0, .35) 0px 5px 15px;
      border-radius: .2rem;
      display: flex;
      align-items: center;
      justify-content: space-around;
      font-size: 2rem;
   }
</style>