xiaojiao
3 天以前 2c69e642303e9f9c3b2e37194c4c6cdf7e1b3001
ÏîÄ¿´úÂë/PDA/pages/Inbound/Inbound.vue
@@ -60,18 +60,22 @@
         </view> -->
         <view style="padding: 5%;">
            <uni-forms label-width="120">
               <uni-forms-item label="零件编号:">
                  <uni-easyinput type="text" placeholder="请扫描零件号" ref='midInput' :focus="focus" v-model="materSn" @blur="inputChangebarcode" />
               </uni-forms-item>
               <uni-forms-item label="载具编号">
                  <uni-easyinput type="text" :focus="barcodefocus" @input="inputChangebarcode"
                  <uni-easyinput type="text" :focus="barcodefocus1"
                     v-model="VehicleNumber" placeholder="请输入载具编号" ref='midInput' />
               </uni-forms-item>
               <uni-forms-item label="零件编号:">
                  <uni-easyinput type="text" placeholder="请扫描零件号" ref='midInput' :focus="focus" v-model="materSn" />
               <uni-forms-item label="车型信息">
                  <uni-easyinput type="text"
                     v-model="Carmodel" placeholder="自动获取车型(除开手动输入零件号)" ref='midInput' />
               </uni-forms-item>
               <uni-forms-item label="当前位置:">
                  <uni-easyinput type="text" placeholder="请输入备料点位" ref='midInput' :focus="focus2" v-model="Position"/>
               </uni-forms-item>
            </uni-forms>
            <button @click="GroupPlate" type="primary" size="default" style="margin-top: 2%;">组盘</button>
            <button @click="GroupPlate" type="primary" size="default" style="margin-top: 2%;">组盘绑定</button>
         </view>
      </view>
      <view v-show="current === 1">
@@ -82,7 +86,7 @@
                     placeholder="请输入托盘编码" ref='midInput' />
               </uni-forms-item>
            </uni-forms>
            <button @click="SolvePlate" type="primary" size="default" style="margin-top: 2%;">解盘</button>
            <button @click="SolvePlate" type="primary" size="default" style="margin-top: 2%;">解绑</button>
         </view>
      </view>
      <u-toast ref="luToast" />
@@ -103,6 +107,7 @@
            istrue: false,
            addressFocus:false,
            barcodefocus: false,
            barcodefocus1:false,
            range: [],
            rangethree:[],
            group: [{
@@ -125,6 +130,7 @@
            items: ['物料绑定', '物料解绑'],
            current: 0,
            Position: '', //容器所在位置
            Carmodel:'', // è½¦åž‹
         }
      },
      onLoad(res) {
@@ -214,7 +220,10 @@
            //    })
            //    return;
            // }
            if (this.VehicleNumber.length <= 0 || this.materSn.length <= 0 || this.Position.length <= 0) {
            if (this.VehicleNumber.length <= 0
            || this.materSn.length <= 0
            || this.Position.length <= 0
            || this.Carmodel.length <= 0) {
               this.$refs.luToast.show({
                  title: "数据输入不完整!",
                  type: "error"
@@ -225,7 +234,8 @@
            var param = {
               "VehicleNumber": this.VehicleNumber,
               "materSn":this.materSn,
               "Position": this.Position
               "Position": this.Position,
               "Carmodel":this.Carmodel
            }
            console.log(param)
            
@@ -235,9 +245,7 @@
                     title: res.message,
                     type: "success"
                  })
                  this.PalletCode2 = "";
                  this.group = [];
                  this.barcodefocus = false;
                  this.Init();
               } else {
                  this.$refs.luToast.show({
                     title: res.message,
@@ -246,7 +254,12 @@
               }
            })
         },
         Init(){
            this.VehicleNumber = '';
            this.materSn = '';
            this.Position = '';
            this.Carmodel = '';
         },
         SolvePlate() {
            if (this.PalletCode3.length <= 0) {
               this.$refs.luToast.show({
@@ -258,7 +271,7 @@
            var param = {
               "PalletCode": this.PalletCode3,
            }
            this.$u.post('/api/BoxingInfo/DeleteGroupPlateAsync', param).then(res => {
            this.$u.post('/api/PDA/DeleteGroupPlateAsync?PalletCode='+this.PalletCode3, '').then(res => {
               if (res.status) {
                  this.$refs.luToast.show({
                     title: res.message,
@@ -276,9 +289,9 @@
         },
         updateFocus() {
            this.$nextTick(() => {
               this.materSn = '';
               if (!this.focus) {
                  this.focus = true;
               this.VehicleNumber = '';
               if (!this.barcodefocus1) {
                  this.barcodefocus1 = true;
               }
            });
         },
@@ -327,6 +340,21 @@
            })
         },
         inputChangebarcode() {
            var materSns = this.materSn;
            console.log(materSns)
            this.barcodefocus1 = true;
            if(materSns.indexOf(',') === -1){
               return;
            }
            // 1. å¤„理零件号,取最后一段
            this.materSn = materSns.split(',').pop();
            // // 2. å¤„理车型,取第一段
            this.Carmodel = materSns.split(',')[0];
            // 3. å…³é”®ï¼šè¿”回处理后的值,uni-easyinput会自动更新v-model和界面
            console.log('处理后的零件号:', this.materSn);
            // this.$nextTick(() => {
            //    this.$u.post('/api/BoxingInfo/GetPalletCodeInfo?palletCode=' + this.PalletCode2, "").then(
            //       res => {
@@ -340,7 +368,7 @@
            //          }
            //       })
            // })
            setTimeout(this.updateFocus, 200);
         },
         removeScanItem(orderNo) {
            this.group = this.group.filter(item => item.orderNo !== orderNo);