#
whycq
2024-03-18 f2232657e8109b0ed4f76b3913e0d4b9713e2af6
pages/project/jmAGV/floorOne.vue
@@ -11,6 +11,7 @@
      <view class="zcard">
         <view class="zcard-flex">
            <view class="button-nk" style="background-color: brown;" @click="click('right')">下架</view>
            <view class="button-nk" style="background-color: brown;" @click="putOut('out2')">仓库-满托盘(出库)</view>
         </view>
      </view>
      
@@ -19,6 +20,43 @@
            <view class="popup">
               <view  class="popup3-input-title">{{text}}</view>
               <view class="button-nk" @click="option(item)" v-for="item in btns">{{item.name}}</view>
            </view>
         </uni-popup>
      </view>
      <view>
         <uni-popup ref="numberPopup" type="dialog">
            <view class="popup2">
               <view  class="popup3-input-title">{{tipsTitle}}</view>
               <view class="button-nk" @click="goUp(2)">2个</view>
               <view class="button-nk" @click="goUp(4)">4个</view>
            </view>
         </uni-popup>
      </view>
      <view>
         <uni-popup ref="inputPopup" type="dialog">
            <view class="popup3">
               <view class="popup3-input-title">{{tipsTitle}}</view>
               <view class="popup3-input-box2"  :class="item.chose"
                  v-if="!meterShow" v-for="item in emptyMatList" @click="chose(item.matnr)">
                  <view>
                     {{item.maktx}}
                  </view>
               </view>
               <view class="popup3-input-box" v-if="meterShow">
                  <text>{{desc}}:</text>
                  <view style="margin-left: 3rpx;">
                     <input type="text" v-model="code"/>
                  </view>
               </view>
               <view class="popup3-input-box" v-if="meterShow">
                  <text>米数:</text>
                  <view style="margin-left: 3rpx;">
                     <input type="text" v-model="meter"/>
                  </view>
               </view>
               <view class="button-nk" @click="confirm(2)">确定</view>
            </view>
         </uni-popup>
      </view>
@@ -33,7 +71,7 @@
            token: '',
            onBtns: [
               {name: '1号空盘位上架',code:'1-Q1',traget: '12-F1',type: 'foolr'},
               {name: '2号空盘位上架',code:'1-Q1',traget: '12-F1',type: 'foolr'},
               {name: '2号空盘位上架',code:'2-Q1',traget: '12-F1',type: 'foolr'},
            ],
            outBtns: [
               {name: '下架至1号位',code:'11-Q1',traget: '1-F1',type: 'foolr'},
@@ -44,7 +82,14 @@
            outType: '',
            text: '',
            btnTitle: '',
            type: ''
            type: '',
            tipsTitle: '',
            item: {},
            meterShow: false,
            code: '',
            emptyMatList: '',
            meter: ''
            
         }
      },
@@ -57,29 +102,89 @@
      },
      methods: {
         jump() {
            uni.navigateTo({
            uni.redirectTo({
               url: '/pages/project/jmAGV/home'
            })
         },
         // 满版出库
         putOut(type) {
            this.type = type
            this.inputPopup()
         },
         inputPopup() {
            if (this.type == 'out1') {
               this.tipsTitle = '空托盘出库'
               this.desc = '物料码'
               this.meterShow = false
               let that = this
               uni.request({
                  url: `${that.baseUrl}/agv/getEmptyMat`,
                  header: { 'token': uni.getStorageSync('token') },
                  method: 'GET',
                  success(res) {
                     res = res.data
                     if (res.code === 200) {
                        res.data['chose'] = ''
                        that.emptyMatList = res.data
                     }
                  }
               })
            } else {
               this.tipsTitle = '满托盘出库'
               this.desc = '订单号'
               this.meterShow = true
               this.$refs.inputPopup.open('center')
            }
            this.$refs.inputPopup.open('center')
         },
         click(type) {
            if (type == 'left') {
               this.btns = this.onBtns
               this.text = '上架'
               this.type = 'load'
               this.tipsTitle = '上架数量'
            } else {
               this.btns = this.outBtns
               this.type = 'unload'
               this.text = '下架'
               this.tipsTitle = '下架数量'
            }
            this.$refs.revise.open(type)
         },
         option(item) {
            this.item = item
            this.$refs.numberPopup.open('center')
         },
         goUp(num) {
            let _this = this
            let data = {
               originLocal: item.code,
               targetLocal: item.traget,
               originLocal: this.item.code,
               targetLocal: this.item.traget,
               type: this.type,
               anfme: num
            }
            this.webServer(data)
         },
         confirm() {
            let data = {}
            data = {
               originLocal: '11-Q1',
               targetLocal: '11-Q1',
               type: this.type,
               orderNo: this.code,
               meter: this.meter
            }
            this.webServer(data)
            setTimeout(()=>{
               this.$refs.inputPopup.close()
               this.code = ''
               this.meter = ''
            },300)
         },
         // 所有服务
         webServer(data) {
            let _this = this
            uni.request({
               url: `${_this.baseUrl}/agv/requestTask`,
               data: data,
@@ -124,7 +229,7 @@
      margin: 10rpx 0rpx;
      /* padding: 20rpx 70rpx; */
      /* background-color: azure; */
      min-width: 150rpx;
      min-width: 350rpx;
      /* margin: 0 auto; */
      height: 50rpx;
      text-align: center;
@@ -152,6 +257,22 @@
      flex-direction: column;
      justify-content: space-around;
   }
   .popup2 {
      background-color: #eee;
      width: 30vw;
      height: 100%;
      padding: 0 10vw;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      border-radius: 10rpx;
   }
   .popup3-input-title {
      text-align: center;
      margin: 10rpx;
      font-size: 18px;
      font-weight: bold;
   }
   .select {
      position: absolute;
      bottom: 12px;
@@ -162,4 +283,36 @@
         inset -2px -2px 2px rgba(255, 255, 255, .7),
         -2px -2px 2px rgba(0, 0, 0, .4);
   }
   .popup3 {
      background-color: #eee;
      max-height: 80vw;
      width: 50vw;
      padding: 0 10vw;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      border-radius: 10rpx;
      color: #565656;
   }
   .popup3-input-title {
      text-align: center;
      margin: 10rpx;
      font-size: 18px;
      font-weight: bold;
   }
   .popup3-input-box  {
      display: flex;
      border: 1px solid #cecece;
      border-radius: 5rpx;
      padding: 2rpx 10rpx;
      margin: 20rpx;
   }
   .popup3-input-box2 {
      display: flex;
      border: 1px solid #cecece;
      border-radius: 5rpx;
      padding: 2rpx 10rpx;
      margin: 10rpx;
      background-color: #FFF;
   }
</style>