1
yangpeixing
2025-12-04 885092869d8a27a0b77d6e55d3dd3f00f29e8002
ÏîÄ¿´úÂë/PDA/pages/task/Outbound.vue
@@ -5,63 +5,31 @@
      <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 label="托盘条码">
                  <uni-easyinput type="text" :focus="barcodeFocus" v-model="PalletCode" placeholder="请输入托盘条码"
                     ref='midInput'/>
               </uni-forms-item>
            </uni-forms>
            <button @click="InboundTask" type="primary" size="default" style="margin-top: 2%;">搬运</button>
            <u-toast ref="InboundTaskluToast" />
            <button @click="InboundTask" type="primary" size="default" style="margin-top: 2%;">出库</button>
         </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-toast ref="luToast" />
   </view>
</template>
<script>
   const innerAudioContext = uni.createInnerAudioContext();
   export default {
      data() {
         return {
            istrue: false,
            barcodefocus: false,
            range: [],
            EndAddress: "",
            StartAddress: "",
            Barcode: "",
            TargetAddress:"",
            barcodeFocus:true,
            PalletCode: "",
            SourceAddress: "",
            items: ['搬运', '跨楼层'],
            items: ['出库'],
            current: 0
         }
      },
      onLoad() {
      },
      methods: {
         onClickItem(e) {
@@ -69,70 +37,35 @@
               this.current = e.currentIndex;
            }
         },
         voiceSpeech(src) {
            innerAudioContext.src = src; // '../../static/success.mp3';
            innerAudioContext.play();
         },
         InboundTask() {
            if (this.PalletCode.length <= 0 && this.Point.length) {
               this.$refs.InboundTaskluToast.show({
                  title: "托盘编码跟绑定货位不能为空",
            if (this.PalletCode.length <= 0) {
               this.$refs.luToast.show({
                  title: "托盘条码不能为空",
                  type: "error"
               })
               return;
            }
            var param = {
               "PalletCode": this.PalletCode,
               "Position": this.SourceAddress,
               "TargetAddress":this.TargetAddress
            }
            console.log(param);
            this.$u.post('/api/Task/RequestAGVCarryTaskAsync', param).then(res => {
            this.$u.post('/api/Task/OutBoundTaskAsync?palletCode='+this.PalletCode+'&remark=""').then(res => {
               if (res.status) {
                  this.$refs.InboundTaskluToast.show({
                  this.$refs.luToast.show({
                     title: res.message,
                     type: "success"
                  })
                  this.PalletCode = "";
                  this.SourceAddress = "";
                  this.TargetAddress="";
                  this.istrue = false;
                  this.barcodeFocus=true;
               } 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>