dengjunjie
2025-01-13 d78b5a2c4fa691df7471f7ec1a52b6d38d96bedb
´úÂë¹ÜÀí/»´°²PDA/pages/stash/boxing.vue
@@ -14,8 +14,9 @@
                     <uni-easyinput type="text" placeholder="请扫描内箱标签" ref='midInput' :focus="focus"
                        v-model="materSn" @input="snInput" />
                  </uni-forms-item>
                  <uni-forms-item label="初始寿命:" v-if="Test">
                     <uni-easyinput type="text" placeholder="请输入初始寿命" ref='midInput' v-model="Initiallife" />
                  <uni-forms-item :label="Testlabel" v-if="Test">
                     <uni-easyinput type="text" :placeholder="Testplaceholder" ref='midInput'
                        v-model="Initiallife" />
                  </uni-forms-item>
                  <!-- <uni-forms-item>
                     <checkbox checked="check">是否满盘</checkbox>
@@ -70,6 +71,33 @@
                     <button @click="inbound" type="primary" size="default" style="margin-top: 2%;">入库确认</button>
                  </uni-forms-item>
               </uni-forms>
            </view>
            <view>
               <uni-list>
                  <uni-list-item direction="column" v-if="inboundBarcode">
                     <template v-slot:body>
                        <view class="uni-list-box">
                           <view class="uni-content">
                              <view class="uni-title-sub uni-ellipsis-2">组盘总数量:{{Summmary}}</view>
                           </view>
                        </view>
                     </template>
                  </uni-list-item>
                  <uni-list-item direction="column" v-for="(item,index) in stockInfoDetail" :key="index">
                     <template v-slot:body>
                        <view class="uni-list-box">
                           <view class="uni-content">
                              <view class="uni-title-sub uni-ellipsis-2">物料编号:{{item.materielCode}}</view>
                              <view class="uni-note">物料名称:{{item.materielName}}</view>
                              <view class="uni-note">物料批次:{{item.batchNo}}</view>
                              <view class="uni-note">组盘数量:{{item.stockQuantity}}</view>
                              <view class="uni-note">生产日期:{{item.productionDate}}</view>
                              <view class="uni-note">有 æ•ˆ æœŸï¼š{{item.effectiveDate}}</view>
                           </view>
                        </view>
                     </template>
                  </uni-list-item>
               </uni-list>
            </view>
         </view>
         <view v-if="current === 2" class="headerstyle">
@@ -166,6 +194,7 @@
            materSn: "",
            Initiallife: 1000,
            sns: [],
            sn: "",
            addressFocus: false,
            inboundBarcode: "",
            address: "",
@@ -176,7 +205,11 @@
            matTotals: [],
            warehouseId: "",
            Test: false,
            Testlabel: "",
            Testplaceholder: "",
            Testcheck: false,
            Summmary:0,
            stockInfoDetail:[]
         }
      },
      onShow() {},
@@ -185,7 +218,18 @@
         this.addressFocus = false;
         this.orderNo = res.orderNo;
         this.warehouseId = res.warehouseId;
         this.Test = this.warehouseId == 6; //测试架仓库区ID
         if (this.warehouseId == 6) { //测试架仓库区ID
            this.Test = true;
            this.Testlabel = "初始寿命:";
            this.Testplaceholder = "请输入初始寿命";
         } else if (this.warehouseId == 2) { //油墨仓库区ID
            this.Test = true;
            this.Testlabel = "数量:";
            this.Testplaceholder = "请输入数量";
            this.Initiallife = 16;
         } else if (this.warehouseId == 5) { //辅料仓库区ID
            this.address = "8005";
         }
         this.label = "单据编号:" + this.orderNo;
         this.getData();
      },
@@ -335,6 +379,11 @@
         },
         snInput() {
            this.$nextTick(() => {
               if (this.warehouseId == 6 || this.warehouseId == 2) {
                  if (this.sns.length > 0) {
                     this.sns = [];
                  }
               }
               if (this.materSn != "") {
                  this.focus = false;
                  var matSn = this.materSn;
@@ -344,37 +393,31 @@
                  this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
                     this.Testcheck = false;
                     if (res.status) {
                        // debugger
                        // this.matTotal.push({
                        //    matCode: res.data.materielCode,
                        //    matQuantity: parseInt(res.data.quantity)
                        // });
                        this.sns.push(res.data.serialNumber);
                        // this.matInfos.splice(0, this.matInfos.length);
                        if (this.warehouseId == 6 || this.warehouseId == 2) {
                           if (this.matInfos.length > 0) {
                              this.matInfos = [];
                           }
                        }
                        this.matInfos.push(res.data);
                        if (res.message) {
                           this.$refs.uToast.show({
                              title: res.message,
                              type: "error"
                           })
                           // setTimeout(this.updateFocus,200);
                           setTimeout(() => {
                              this.voiceSpeech('../../static/fail.mp3');
                           }, 100);
                           return;
                        }
                        // setTimeout(this.updateFocus,200);
                        setTimeout(() => {
                           this.voiceSpeech('../../static/success.mp3');
                        }, 100);
                     } else {
                        // this.innerCode = "";
                        this.$refs.uToast.show({
                           title: res.message,
                           type: "error"
                        })
                        // setTimeout(this.updateFocus,200);
                        setTimeout(() => {
                           this.voiceSpeech('../../static/fail.mp3');
                        }, 100);
@@ -407,11 +450,14 @@
            }
            this.$u.post('/api/Task/RequestInboundTask', postData).then(res => {
               if (res.status) {
                  uni.$showMsg(res.message);
                  this.inboundBarcode = "";
                  this.address = "";
                  if (this.warehouseId != 5) this.address = "";
                  setTimeout(() => {
                     this.addressFocus = false;
                     this.$refs.uToast.show({
                        title: "成功",
                        type: "success"
                     })
                  }, 200);
               } else {
                  this.$refs.uToast.show({
@@ -431,6 +477,34 @@
            this.$nextTick(function(x) {
               if (this.inboundBarcode != '') {
                  this.addressFocus = true;
               }
            })
            this.$nextTick(function(x) {
               if (this.inboundBarcode != '') {
                  var postData = {
                     MainData: {
                        "barcode": this.inboundBarcode,
                        "warehouseId": this.warehouseId,
                     }
                  };
                  this.$u.post('/api/StockInfo/StockQueryData', postData).then(res => {
                     // this.stockInfo = [];
                     this.stockInfoDetail = [];
                     if (res.status) {
                           // this.stockInfo = res.data,
                           this.stockInfoDetail = res.data.details
                           //获取总数量
                           this.stockInfoDetail.forEach(item => {
                              this.Summmary+= item.stockQuantity;
                           });
                     } else {
                        this.$refs.uToast.show({
                           // title: "未找到托盘信息",
                           title: res.message,
                           type: "error"
                        })
                     }
                  })
               }
            })
         },
@@ -456,16 +530,29 @@
            if (this.Test) {
               if (!this.Testcheck) {
                  this.Testcheck = true;
                  this.$refs.uToast.show({
                     title: "请确认初始寿命",
                     type: 'error'
                  })
                  if (this.warehouseId == 2) {
                     this.$refs.uToast.show({
                        title: "请确认数量",
                        type: 'error'
                     })
                  } else if (this.warehouseId == 6) {
                     this.$refs.uToast.show({
                        title: "请确认初始寿命",
                        type: 'error'
                     })
                  }
                  return;
               }
            }
            if (this.warehouseId == 2) { //油墨仓库区ID
               this.sn = this.sns[0];
               for (var i = 0; i < this.Initiallife - 1; i++) {
                  this.sns.push(this.sn);
               }
            }
            let url = 'palletCode=' + this.barcode + '&initiallife=' + this.Initiallife + '&warehouseId=' + this
               .warehouseId;
            let url = 'palletCode=' + this.barcode + '&initiallife=' + this.Initiallife + '&warehouseId=' + this.warehouseId;
            this.$u.post('/api/InboundOrder/ManualMaterielGroup?' + url, this.sns).then(res => {
               this.Testcheck = false;
               if (res.status) {