1
wankeda
2025-03-22 867aba2636e34a1050b1c4c84bbe78cc9c39b553
´úÂë¹ÜÀí/AGVjiaoliaoPDA/pages/materielGroup/OutboundTask.vue
@@ -3,54 +3,6 @@
      <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
      </uni-segmented-control>
      <view class="content">
         <!-- <view v-if="current === 0" class="headerstyle">
            <view class="itemstyle">
               <uni-forms label-width="180">
                  <uni-forms-item :label="label">
                  </uni-forms-item>
                  <uni-forms-item label="托盘条码:">
                     <uni-easyinput type="text" placeholder="请扫描托盘条码" ref='midInput' :focus="!focus"
                        v-model="barcode" @input="barcodeInput" />
                  </uni-forms-item>
                  <uni-forms-item label="内箱标签:">
                     <uni-easyinput type="text" placeholder="请扫描内箱标签" ref='midInput' :focus="focus"
                        v-model="materSn" @input="snInput" />
                  </uni-forms-item>
                  <uni-forms-item>
                     <checkbox checked="check">是否满盘</checkbox>
                  </uni-forms-item>
                  <uni-forms-item>
                     <button @click="submit" type="primary" size="default" style="margin-top: 2%;">组盘</button>
                  </uni-forms-item>
               </uni-forms>
               <uni-list>
                  <uni-list-item direction="column" v-for="item in matTotal" :key="item.matCode">
                     <template v-slot:body>
                        <view class="uni-list-box">
                           <view class="uni-content">
                              <view class="uni-title-sub uni-ellipsis-2">物料编码:{{item.matCode}}</view>
                              <view class="uni-title-sub uni-ellipsis-2">数量:{{item.matQuantity}}</view>
                           </view>
                        </view>
                     </template>
                  </uni-list-item>
                  <uni-list-item direction="column" v-for="(item,index) in matInfos" :key="item.sn">
                     <template v-slot:body>
                        <view class="uni-list-box">
                           <uni-icons type="trash" size="22" style="position: absolute;right: 5%;"
                              @click="deleteList(item.sn)">
                           </uni-icons>
                           <view class="uni-content">
                              <view class="uni-title-sub uni-ellipsis-2">订单号:{{item.orderNo}}</view>
                              <view class="uni-note">物料编码:{{item.matCode}}</view>
                              <view class="uni-note">数量:{{item.matQty}}</view>
                           </view>
                        </view>
                     </template>
                  </uni-list-item>
               </uni-list>
            </view>
         </view> -->
         <view v-if="current === 0" class="headerstyle">
            <view class="itemstyle">
               <uni-forms label-width="120">
@@ -58,13 +10,8 @@
            <uni-easyinput type="text" :focus="!addressFocus" v-model="stationcode"
               placeholder="请扫瞄缓存架编号" ref='midInput' @input="inputChangebarcode" />
                  </uni-forms-item>
               <!--    <uni-forms-item label="托盘条码">
                     <uni-easyinput type="text" :focus="!addressFocus" v-model="inboundBarcode"
                        placeholder="请扫描托盘条码" ref='midInput' @input="inputChangebarcode" />
                  </uni-forms-item> -->
                  <uni-forms-item label="物料类型">
                     <uni-easyinput type="text" v-model="PalletCode" placeholder="请扫描物料类型" ref='midInput'
                        :focus="addressFocus" />
                        <uni-data-select v-model="PalletCode" :localdata="rangs"></uni-data-select>
                  </uni-forms-item>
                  <uni-forms-item>
                     <button @click="inbound" type="primary" size="default" style="margin-top: 2%;">出库确认</button>
@@ -82,7 +29,6 @@
   export default {
      data() {
         return {
            // items: ['组盘', '入库', '单据信息', '解盘'],
            items: ['出库'],
            current: 0,
            matTotal: [],
@@ -102,10 +48,13 @@
            value: "",
            matInfo: [],
            value2: "",
            matTotals: []
               matTotals: [],
               rangs: [] // å­˜å‚¨ç‰©æ–™ç±»åž‹æ•°æ®
         }
      },
      onShow() {},
         onShow() {
            this.getMaterialTypes(); // é¡µé¢æ˜¾ç¤ºæ—¶èŽ·å–ç‰©æ–™ç±»åž‹æ•°æ®
         },
      onLoad(res) {
         this.focus = false;
         this.addressFocus = false;
@@ -115,7 +64,7 @@
      },
      methods: {
         voiceSpeech(src) {
            innerAudioContext.src = src; // '../../static/success.mp3';
               innerAudioContext.src = src;
            innerAudioContext.play();
         },
         
@@ -134,7 +83,7 @@
            }
         },
         getData() {
            var postData = this.orderNo
               var postData = this.orderNo;
            this.$u.post('/api/InboundOrder/GetInboundOrderDetail', postData).then((res) => {
               if (res.status) {
@@ -144,6 +93,24 @@
                  }
               }
            })
            },
            getMaterialTypes() {
               this.$u.post('/api/MaterielInfo/GetMaterialTypes').then((res) => {
                  if (res.status) {
                     console.log(res.data);
                     this.rangs = res.data.map(item => {
                        return {
                           value: item.number, // å‡è®¾åŽç«¯è¿”回的数据中有 id å’Œ name å­—段
                           text: item.number
                        };
                     });
                  }
               }).catch(err => {
                  this.$refs.uToast.show({
                     title: err.message,
                     type: "error"
                  });
               });
         },
         onClickItem(e) {
            this.focus = false;
@@ -174,9 +141,6 @@
                  uni.$showMsg("任务添加成功");
                  this.stationcode = "";
                  this.PalletCode = "";
                  // setTimeout(() => {
                  //    this.materialtype = false;
                  // }, 200);
               } else {
                  this.$refs.uToast.show({
                     title: res.message,
@@ -198,67 +162,6 @@
               }
            })
         },
         deleteList(res) {
            var sn = '';
            this.matInfos.map((item, index) => {
               if (item.sn == res) {
                  this.matInfos.splice(index, 1);
                  sn = item.sn;
                  var tmp = this.matTotal.find(x => x.matCode == item.matCode);
                  if (tmp) {
                     tmp.matQuantity -= parseInt(item.matQty);
                  } else {
                  }
               }
            })
            this.sns.map((item, index) => {
               if (item == res) {
                  this.sns.splice(index, 1);
               }
            })
         },
         submit() {
            if (this.barcode == "") {
               this.$refs.uToast.show({
                  title: "请扫描托盘条码",
                  type: 'error'
               })
               return;
            }
            if (this.sns.length == 0) {
               this.$refs.uToast.show({
                  title: "请扫描内箱标签",
                  type: 'error'
               })
               return;
            }
            this.$u.post('/api/Bill_group_stock/PDA_ScanInStock', {
               MainData: {
                  "pallet_barcode": this.barcode,
                  "orderNo": this.orderNo,
                  "isFull": this.check
               },
               DelKeys: this.sns
            }).then(res => {
               if (res.status) {
                  this.$refs.uToast.show({
                     title: "组盘成功",
                     type: "success"
                  })
                  this.focus = false;
                  this.barcode = "";
                  this.matInfos = [];
                  this.sns = [];
                  this.matTotal = [];
               } else {
                  this.$refs.uToast.show({
                     title: res.message,
                     type: "error"
                  })
               }
            })
         }
      }
   }
</script>