1
huangxiaoqiang
8 天以前 4dfe8ece141f05a163cf7d290b6fe4c520d89909
ÏîÄ¿´úÂë/PDA/pages/task/Outbound.vue
@@ -1,48 +1,47 @@
<template>
   <view>
      <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
      </uni-segmented-control>
      <view v-show="current === 0">
         <view style="padding: 5%;">
            <uni-forms label-width="120">
               <uni-forms-item label="托盘编码">
                  <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="PalletCode"
                     placeholder="请输入托盘编码" ref='midInput' />
               </uni-forms-item>
               <uni-forms-item label="搬运起点">
                  <uni-easyinput type="text" :focus="istrue" v-model="SourceAddress"
                     placeholder="请输入AGV搬运起点" ref='midInput' />
               </uni-forms-item>
               <uni-forms-item label="搬运终点">
                  <uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="TargetAddress"
                     placeholder="请输入AGV搬运终点" ref='midInput' />
               </uni-forms-item>
            </uni-forms>
            <button @click="InboundTask" type="primary" size="default" style="margin-top: 2%;">搬运</button>
            <u-toast ref="InboundTaskluToast" />
      <u-sticky>
         <view style="background-color: #ffffff;">
            <uni-search-bar @confirm="search" v-model="searchValue"></uni-search-bar>
         </view>
      </view>
      <view v-show="current === 1">
         <view style="padding: 5%;">
            <uni-forms label-width="120">
               <uni-forms-item label="托 ç›˜ ç¼– ç ">
                  <uni-easyinput type="text" :focus="barcodefocus" @input="inputChangebarcode" v-model="Barcode"
                     placeholder="请输入托盘编码" ref='midInput' />
               </uni-forms-item>
               <uni-forms-item label="跨楼层起点">
                  <uni-easyinput type="text" :focus="barcodefocus" v-model="StartAddress"
                     placeholder="请输入跨楼层起点" ref='midInput' />
               </uni-forms-item>
               <uni-forms-item label="跨楼层终点">
                  <uni-easyinput type="text" :focus="barcodefocus" v-model="EndAddress"
                     placeholder="请输入跨楼层终点" ref='midInput' />
               </uni-forms-item>
            </uni-forms>
            <button @click="OutboundTask" type="primary" size="default" style="margin-top: 2%;">下发任务</button>
            <u-toast ref="OutboundTaskluToast" />
         </view>
      </view>
   </view>
      </u-sticky>
      <uni-list :border="true">
         <uni-list-item direction="column" clickable
            v-for="item in allReceivingOrders" :key="item.id">
            <template v-slot:body>
               <uni-group margin-top="20">
                  <view class="flex-row">
                     <view class="label">托盘条码:</view>
                     <view class="value">{{item.palletCode}}</view>
                  </view>
                  <view class="flex-row">
                     <view class="label">货位编码:</view>
                     <view class="value">{{item.locationCode}}</view>
                  </view>
                  <view class="flex-row">
                     <view class="label">物料编码:</view>
                     <view class="value">{{item.materielCode}}</view>
                  </view>
                  <view class="flex-row">
                     <view class="label">物料名称:</view>
                     <view class="value">{{item.materielName}}</view>
                  </view>
                  <view class="flex-row">
                     <view class="label">库存数量:</view>
                     <view class="value">{{item.quantity}}</view>
                  </view>
                  <view>
                     <button @click="Outbound(item.palletCode)" type="primary" size="default" style="margin-top: 2%;">出库</button>
                  </view>
               </uni-group>
            </template>
         </uni-list-item>
      </uni-list>
      <!-- <uni-load-more :status="status" v-if="loadVisible"></uni-load-more>
      <u-back-top :scroll-top="scrollTop" top="400"></u-back-top> -->
      <u-toast ref="luToast" />
   </view>
</template>
@@ -50,88 +49,73 @@
   export default {
      data() {
         return {
            page: "/pages/Production/ProductionOutorderboxing?orderNo=",
            loadVisible: false,
            istrue: false,
            barcodefocus: false,
            range: [],
            EndAddress: "",
            StartAddress: "",
            Barcode: "",
            TargetAddress:"",
            PalletCode: "",
            SourceAddress: "",
            items: ['搬运', '跨楼层'],
            current: 0
            searchValue: "",
            status: "more",
            allReceivingOrders: [],
            pageNo: 1,
            scrollTop: 0
         }
      },
      onLoad(res) {
         this.getData();
      },
      onReachBottom() {
         this.pageNo += 1;
         this.getData();
      },
      onPageScroll(e) {
         this.scrollTop = e.scrollTop;
      },
      methods: {
         onClickItem(e) {
            if (this.current != e.currentIndex) {
               this.current = e.currentIndex;
            }
         search(res) {
            this.getData();
         },
         InboundTask() {
            if (this.PalletCode.length <= 0 && this.Point.length) {
               this.$refs.InboundTaskluToast.show({
                  title: "托盘编码跟绑定货位不能为空",
                  type: "error"
               })
               return;
         getData() {
            var postData = {
               materielCode: this.searchValue,
               pageNo: this.pageNo
            }
            var param = {
               "PalletCode": this.PalletCode,
               "Position": this.SourceAddress,
               "TargetAddress":this.TargetAddress
            }
            console.log(param);
            this.$u.post('/api/Task/RequestAGVCarryTaskAsync', param).then(res => {
            this.allReceivingOrders=[];
            this.$u.post('/api/StockInfo/GetStockView', postData).then((res) => {
               if (res.status) {
                  this.$refs.InboundTaskluToast.show({
                  if (this.searchValue == '') {
                     this.allReceivingOrders = res.data;
                     if (this.allReceivingOrders.length > 3) {
                        this.loadVisible = true;
                     } else {
                        this.loadVisible = false;
                     }
                  } else {
                     this.allReceivingOrders = res.data;
                     if (this.allReceivingOrders.length > 3) {
                        this.loadVisible = true;
                     } else {
                        this.loadVisible = false;
                     }
                  }
               }
            })
         },
         Outbound(palletCode) {
            this.$u.post('/api/Task/OutBoundTaskAsync?palletCode='+palletCode, "").then((res) => {
               if (res.status) {
               this.$refs.luToast.show({
                     title: res.message,
                     type: "success"
                  })
                  this.PalletCode = "";
                  this.SourceAddress = "";
                  this.TargetAddress="";
                  this.istrue = false;
                  this.getData();
               } else {
                  this.$refs.InboundTaskluToast.show({
                  this.$refs.luToast.show({
                     title: res.message,
                     type: "error"
                  })
               }
            })
         },
         OutboundTask() {
            if (this.EndAddress.length <= 0 && this.Barcode.length) {
               this.$refs.OutboundTaskluToast.show({
                  title: "请输入起点站台",
                  type: "error"
               })
               return;
            }
            var param = {
               "PalletCode": this.Barcode,
               "Position": this.StartAddress,
               "TargetAddress":this.EndAddress
            }
            this.$u.post('/api/Task/RequestAcrossFloorTaskAsync', param).then(res => {
               if (res.status) {
                  this.$refs.OutboundTaskluToast.show({
                     title: res.message,
                     type: "success"
                  })
                  this.Barcode = "";
                  this.EndAddress = "";
                  this.StartAddress="";
                  this.barcodefocus = false;
               } else {
                  this.$refs.OutboundTaskluToast.show({
                     title: res.message,
                     type: "error"
                  })
               }
            })
         },
         }
      }
   }
</script>
@@ -199,4 +183,42 @@
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
   }
   .customcss {
      display: flex;
      position: fixed;
      width: 100%;
      top: 10px;
      text-align: center;
      z-index: 999;
      left: 30px;
      height: 20%;
   }
   .footer {
      padding-top: 50%;
   }
   .flex-row {
      display: flex;
      justify-content: space-between;
      /* å·¦å³å¯¹é½ */
      align-items: center;
      /* åž‚直居中 */
      padding: 10rpx 0;
   }
   .label {
      color: #666;
      width: 200rpx;
      /* å›ºå®šæ ‡ç­¾å®½åº¦ */
      text-align: left;
   }
   .value {
      flex: 1;
      text-align: right;
      color: #333;
      font-weight: bold;
   }
</style>