yangan
2024-07-30 4e4842518007726677c1dd23dc57f3448e7b08b4
pages/loadUnload-page/selectTarget/selectTarget.vue
@@ -11,6 +11,7 @@
         ></u-tag>
      </view>
      <!-- 点击查看原盐钙镁 -->
         <view class="self-deliver">
               <view class="self-deliver_text">
                  查看原盐钙镁结果
@@ -22,6 +23,11 @@
                     @click="todoDetail"></u-button>
               </view>
            </view>
            <view
         class="notice-bar"><u-notice-bar :text="messageText"
          :fontSize="30" :showIcon = 'true'
          :direction='messageObj.carNo ? "row" :"column"'
          ></u-notice-bar></view>
      <!-- <u--form labelPosition="top"
         labelWidth="20%"
         :borderBottom="false"
@@ -231,6 +237,7 @@
<script>
   import { BaseUrl } from '@/api/publicInterface.js'
   import { mapState, mapMutations, mapGetters } from 'vuex';
   export default {
      props: {
         loadUnloadData: {
@@ -254,7 +261,16 @@
               
            }
         }
         },
         messageText(){
            if(this.messageObj.carNo){
               return `时间:${this.messageObj.now},${this.messageObj.carNo},产品${this.messageObj.productNames}在${this.messageObj.bunkerName}入场了,请及时检查!`
            }else{
               return '暂无消息'
            }
         },
           ...mapGetters(['websocketData'])
      
      },
      watch: {
@@ -265,6 +281,29 @@
            },
            deep: true,
            immediate: true
         },
         //监听消息
         'websocketData': {
        handler(v) {
          console.log(v, '接受的ws数据');
          if(v) {
            if (v.startsWith('kgTipHead')) {
            console.log('vvvvv',v.slice(11))
               let nowWeighObj = JSON.parse(v.slice(11));
            console.log(nowWeighObj,'nowWeight');
            this.messageObj = nowWeighObj;
            //   this.messageList = JSON.parse(v.slice(5));
            //   this.messageList = {
            //     ...this.messageList,
            //     title: this.messageList.title.slice(0, 8) + '...',
            //     content: removeTags(this.messageList.content).trim().slice(0, 8) + '...'
            //   }
            //   this.messagePushShow = true;
            }
          }
        },
        deep: true,
        immediate: true
         }
      },
      data() {
@@ -274,6 +313,9 @@
               secondClass: "",
               orderType: '',
               bunkerIds:""
            },
            messageObj:{
               carNo:'',
            },
            isEmptyCar:null, //是否空车出厂
            checkStatusList:[
@@ -572,13 +614,26 @@
  }
   
}
.notice-bar{
      margin-left: vww(10);
      margin-bottom: 20rpx;
      margin-top: 20rpx;
         width: 98%;
         .u-notice-bar{
            border-radius: 20rpx;
               margin-top: 20rpx;
               height: 40rpx;
         }
}
      // 自主配送
         .self-deliver {
         position: relative;
         text-indent: 20rpx;
            top: vww(10);
            width: 98%;
            width: 96%;
            height: vww(40);
            margin: vww(8) 10rpx;
            margin: vww(13) 10rpx;
            padding: 0 vww(8);
            background: #ffffff;
            box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(73, 120, 240, 0.14), 0rpx 7rpx 45rpx 0rpx rgba(73, 120, 240, 0.12);
@@ -591,6 +646,7 @@
               height: 28px !important;
               line-height: 40px;
               padding: 0 12px;
               text-indent: 0!important;
               font-size: 28rpx;
               font-weight: 300;
               color: #ffffff;