1
huangxiaoqiang
2025-10-21 6c663b92b0078aa89657df22ec188dff65599f04
ÏîÄ¿´úÂë/PDA/pages/task/Inbound.vue
@@ -23,7 +23,7 @@
               </uni-forms-item>
            </uni-forms>
            <button @click="InboundTask" type="primary" size="default" style="margin-top: 2%;">入库</button>
            <u-toast ref="InboundTaskluToast" />
         </view>
      </view>
      <view v-show="current === 1">
@@ -54,15 +54,14 @@
                              @click="deleteList(item.orderNo)">
                           </uni-icons>
                           <view class="uni-content">
                              <view class="uni-title-sub uni-ellipsis-2">订单号:{{item.orderNo}}</view>
                              <view class="uni-title-sub uni-ellipsis-2">订单唯一编码:{{item.orderNo}}</view>
                           </view>
                        </view>
                     </template>
                  </uni-list-item>
               </uni-list>
            </uni-forms>
            <button @click="OutboundTask" type="primary" size="default" style="margin-top: 2%;">组盘</button>
            <u-toast ref="OutboundTaskluToast" />
            <button @click="GroupPlate" type="primary" size="default" style="margin-top: 2%;">组盘</button>
         </view>
      </view>
      <view v-show="current === 2">
@@ -73,10 +72,10 @@
                     placeholder="请输入托盘编码" ref='midInput' />
               </uni-forms-item>
            </uni-forms>
            <button @click="OutboundTask" type="primary" size="default" style="margin-top: 2%;">解盘</button>
            <u-toast ref="OutboundTaskluToast" />
            <button @click="SolvePlate" type="primary" size="default" style="margin-top: 2%;">解盘</button>
         </view>
      </view>
      <u-toast ref="luToast" />
   </view>
   </view>
</template>
@@ -89,10 +88,11 @@
   export default {
      data() {
         return {
            focus: false,
            istrue: false,
            barcodefocus: false,
            range: [],
            AreaId: "",
            AreaId: 0,
            SourceAddress: "",
            TargetAddress: "",
            PalletCode1: "",
@@ -100,6 +100,7 @@
            PalletCode3: "",
            materSn: "",
            InBoundOrder: [],
            OrderNos: [],
            items: ['入库', '组盘', '解盘'],
            current: 0
         }
@@ -113,68 +114,109 @@
               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({
            if (this.PalletCode1.length <= 0 && this.SourceAddress.length) {
               this.$refs.luToast.show({
                  title: "托盘编码跟绑定货位不能为空",
                  type: "error"
               })
               return;
            }
            var param = {
               "PalletCode": this.PalletCode,
               "PalletCode": this.PalletCode1,
               "Position": this.SourceAddress,
               "TargetAddress": this.TargetAddress
               "TargetAddress": this.TargetAddress,
               "AreaId": this.AreaId,
            }
            console.log(param);
            this.$u.post('/api/Task/RequestTaskAsync', param).then(res => {
            this.$u.post('/api/Task/RequestInboundTaskAsync', param).then(res => {
               if (res.status) {
                  this.$refs.InboundTaskluToast.show({
                  this.$refs.luToast.show({
                     title: res.message,
                     type: "success"
                  })
                  this.PalletCode = "";
                  this.PalletCode1 = "";
                  this.SourceAddress = "";
                  this.TargetAddress = "";
                  this.AreaId = "";
                  this.istrue = false;
               } 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({
         GroupPlate() {
            if (this.PalletCode2.length <= 0 && this.InBoundOrder.length) {
               this.$refs.luToast.show({
                  title: "请输入起点站台",
                  type: "error"
               })
               return;
            }
            var param = {
               "PalletCode": this.Barcode,
               "Position": this.StartAddress,
               "TargetAddress": this.EndAddress
               "PalletCode": this.PalletCode2,
               "OrderNos": this.OrderNos
            }
            this.$u.post('/api/Task/RequestOutTaskAsync', param).then(res => {
            this.$u.post('/api/BoxingInfo/AddBoxingInfo', param).then(res => {
               if (res.status) {
                  this.$refs.OutboundTaskluToast.show({
                  this.$refs.luToast.show({
                     title: res.message,
                     type: "success"
                  })
                  this.Barcode = "";
                  this.EndAddress = "";
                  this.StartAddress = "";
                  this.PalletCode2 = "";
                  this.InBoundOrder = [];
                  this.OrderNos = [];
                  this.barcodefocus = false;
               } else {
                  this.$refs.OutboundTaskluToast.show({
                  this.$refs.luToast.show({
                     title: res.message,
                     type: "error"
                  })
               }
            })
         },
         SolvePlate(){
            if (this.PalletCode3.length <= 0) {
               this.$refs.luToast.show({
                  title: "请输入托盘条码",
                  type: "error"
               })
               return;
            }
            var param = {
               "PalletCode": this.PalletCode3,
            }
            this.$u.post('/api/BoxingInfo/DeleteBoxingInfoAsync', param).then(res => {
               if (res.status) {
                  this.$refs.luToast.show({
                     title: res.message,
                     type: "success"
                  })
                  this.PalletCode3 = "";
                  this.barcodefocus = false;
               } else {
                  this.$refs.luToast.show({
                     title: res.message,
                     type: "error"
                  })
               }
            })
         },
         updateFocus() {
            this.$nextTick(() => {
               this.materSn = '';
               if (!this.focus) {
                  this.focus = true;
               }
            });
         },
         snInput() {
            this.$nextTick(() => {
@@ -182,9 +224,9 @@
                  orderNo: this.materSn,
               }
               var temp = this.InBoundOrder.find(x => x.orderNo == matObj.orderNo);
               console.log(temp)
               if (!temp) {
                  this.InBoundOrder.push(matObj);
                  this.OrderNos.push(this.materSn);
                  setTimeout(this.updateFocus, 200);
                  setTimeout(() => {
                     this.voiceSpeech('../../static/success.mp3');
@@ -202,32 +244,20 @@
            })
         },
         // deleteList(res) {
         //    this.matInfos.map((item, index) => {
         //       if (item.orderNo == res) {
         //          this.matInfos.splice(index, 1);
         //       }
         //    })
         //    this.orderNo.map((item, index) => {
         //       if (item == res) {
         //          this.orderNo.splice(index, 1);
         //       }
         //    })
         // },
         deleteList(res) {
               // åˆ é™¤matInfos中orderNo匹配项
               this.matInfos = this.matInfos.filter(item => item.orderNo !== res);
               // åˆ é™¤orderNo中匹配项
               this.orderNo = this.orderNo.filter(item => item !== res);
               // å¯é€‰ï¼šæ·»åŠ åˆ é™¤åé¦ˆ
               this.$refs.uToast.show({
                 title: `已删除: ${res}`,
                 type: "success"
               });
             }
            this.InBoundOrder.map((item, index) => {
               console.log(res, item);
               if (item.orderNo == res) {
                  this.InBoundOrder.splice(index, 1);
               }
            })
            this.OrderNos.map((item, index) => {
               if (item == res) {
                  this.OrderNos.splice(index, 1);
               }
            })
         },
      }
   }
</script>