jiangping
2025-02-18 754f0eea0b16985a4dc8e8448e1bde7a8aec6f26
pda/pages/index/center.vue
@@ -182,8 +182,7 @@
         <view class="TransformModal">
            <view class="title">转移月台</view>
            <view class="transform_list">
               <view class="line" @click="transformPlatClick(item)" v-for="item in TransferList"
                  :key="item.id">
               <view class="line" @click="transformPlatClick(item)" v-for="item in TransferList" :key="item.id">
                  <view class="name">{{ item.name  || item.platformName}}</view>
                  <view class="status" :class="{ green: item.workStatus == 1 }">({{ item.workStatus == 0 ? "空闲" : "作业中" }})
                  </view>
@@ -248,7 +247,8 @@
            transformId: '', // 转移记录任务id
            TransferList: [],
            wmsInfo: {},
            timer: null
            timer: null,
            timer1: null,
         }
      },
      onLoad() {
@@ -256,6 +256,22 @@
         // setInterval(() => {
         //    this.getPlatformGroup()
         // }, 1000 * 30)
      },
      onHide(){
         if(this.timer1){
            clearInterval(this.timer1)
         }
         if(this.timer){
            clearInterval(this.timer)
         }
      },
      onUnload(){
         if(this.timer1){
            clearInterval(this.timer1)
         }
         if(this.timer){
            clearInterval(this.timer)
         }
      },
      methods: {
         getTransferList() {
@@ -265,7 +281,9 @@
            }).then(res => {
               const platformGroupList = res.data || []
               if (platformGroupList.length > 0) {
                  const { activePlatformGroup } = this
                  const {
                     activePlatformGroup
                  } = this
                  const temp = platformGroupList.find(i => i.id === activePlatformGroup.id)
                  this.TransferList = temp.platformList || []
               }
@@ -290,24 +308,34 @@
            })
         },
         getPlatformTask() {
            if(this.timer1){
               clearInterval(this.timer1)
            }
            getPlatformWorkData({
               platformId: this.activePlatform.id
            }).then(res => {
               this.platformTaskInfo = res.data
               this.currentDate = new Date(res.data.currentDate).getTime()
               this.circulInitTaskList()
               setInterval(() => {
               this.currentDate = this.currentDate + 1000
               this.timer1 = setInterval(() => {
                  this.circulInitTaskList()
                  this.currentDate = this.currentDate + 1000
               }, 1000)
            }, () => {
            })
            }, () => {})
         },
         circulInitTaskList() {
            let time = this.currentDate
            if (this.platformTaskInfo && this.platformTaskInfo.platformJobList && this.platformTaskInfo.platformJobList
               .length > 0) {
               let time = new Date()
               this.platformTaskInfo.platformJobList.forEach(item => {
                  if (item.newCallDate) {
                     let timeNum = time.getTime() - new Date(item.newCallDate).getTime()
                     let timeNum = 0
                     if(time > new Date(item.newCallDate).getTime()){
                        timeNum = time - new Date(item.newCallDate).getTime()
                     }else{
                        timeNum = 0
                     }
                     if (timeNum > 3600000) {
                        item.callDateTemp = dayjs.duration(timeNum).format('H小时m分s秒')
                     } else {
@@ -315,7 +343,12 @@
                     }
                  }
                  if (item.newStartDate) {
                     let timeNum = time.getTime() - new Date(item.newStartDate).getTime()
                     let timeNum = 0
                     if(time > new Date(item.newStartDate).getTime()){
                        timeNum = time - new Date(item.newStartDate).getTime()
                     }else{
                        timeNum = 0
                     }
                     if (timeNum > 3600000) {
                        item.startDateTemp = dayjs.duration(timeNum).format('H小时m分s秒')
                     } else {
@@ -360,16 +393,20 @@
            finishWork({
               jobId: item.id
            }).then(res => {
                  if (res && res.code == 200) {
               this.showToast('完成作业')
               this.getPlatformTask()
                  }
            })
         },
         handleWork(item) { // 开始作业
            beginWork({
               jobId: item.id
            }).then(res => {
               if (res && res.code == 200) {
               this.showToast('已开始作业')
               this.getPlatformTask()
               }
            })
         },
         handlePass(item) {
@@ -401,17 +438,23 @@
                  jobId: item.id,
                  platformId: activePlatform.id
               }).then(res => {
                  if (res && res.code == 200) {
                  this.showToast('叫号成功')
                  this.getPlatformCallList()
                  }
               })
            } else { // 月台叫号
               platformCallNumber({
                  platformId: activePlatform.id,
                  jobId: item.id
               }).then(res => {
                  if (res && res.code == 200) {
                  this.showToast('叫号成功')
                  this.getPlatformCallList()
                  this.getPlatformTask()
                  }
               })
            }
         },
@@ -508,6 +551,10 @@
   }
</script>
<style lang="scss">
   page {
      background-color: #f1f2f2;
   }
   .main_app {
      padding: 0rpx;
      height: calc(100vh - 44px);
@@ -539,6 +586,7 @@
               white-space: nowrap;
               overflow: hidden;
               text-overflow: ellipsis;
               &:nth-of-type(3n) {
                  margin-right: 0;
               }
@@ -615,6 +663,7 @@
                  justify-content: center;
                  align-items: center;
                  height: 100%;
                  &:nth-of-type(1) {
                     background: #e9f5f6;
                     padding: 0 12rpx;
@@ -737,6 +786,7 @@
      .order_list {
         height: calc(100% - 160rpx);
         margin-top: 20rpx;
         .scroll_view {
            height: 100%;
         }
@@ -744,6 +794,7 @@
         .platform_ing {
            border-radius: 8rpx;
            border: 1rpx solid #dfe2e8;
            &:nth-of-type(1){
               margin-top: 0;
            }
@@ -903,6 +954,7 @@
      padding: 36rpx 30rpx;
      border-radius: 12rpx;
      box-shadow: 0 0 6rpx rgba(0, 0, 0, 0.5);
      .modal_title {
         font-weight: 600;
         font-size: 32rpx;
@@ -911,37 +963,46 @@
         text-align: center;
         margin-bottom: 36rpx;
      }
      .contract_wrap{
         height: calc( 100% - 400rpx );
         overflow-y: auto;
      }
      .contract_list {
         border-top: 1rpx solid #E5E5E5;
         margin-bottom: 30rpx;
         padding-top: 30rpx;
         &:nth-last-child(1){
            margin-bottom: 0;
         }
         .list {
            background: #f7f7f7;
            border-radius: 8rpx;
            padding: 20rpx;
            .item{
               border-bottom: 1rpx solid #e5e5e5;
               padding-bottom: 20rpx;
               margin-bottom: 20rpx;
               &:nth-last-child(1){
                  border: none;
                  padding-bottom: 0;
                  margin-bottom: 0;
               }
            }
            .line {
               display: flex;
               margin-bottom: 20rpx;
               &:nth-last-child(1){
                  margin-bottom: 0rpx;
               }
               .label {
                  color: #666666;
                  width: 92rpx;