#
whycq
2022-09-22 295c9eb2c051406c89dcf975abe7eb9dd2a28c4b
pages/basics/pickOffLines.vue
@@ -1,5 +1,6 @@
<template>
   <view>
      <scroll-view scroll-y class="scroll-Y">
      <view class="square-2">
         <view class="square-title">
            <view class="title-sign"><view class="sign"></view></view>
@@ -7,7 +8,7 @@
         </view>
         <view class="square-content">
            <view class="content-input">
               <input readonly="value" v-model="doc_num" type="text" placeholder="扫码 / 输入" maxlength="8"
               <input readonly="value" v-model="doc_num" type="text" placeholder="扫码 / 输入"
               :focus="barcodeFocus" @input="nextInput">
               <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
            </view>
@@ -48,6 +49,16 @@
            </view>
         </view>
      </view>
      </scroll-view>
      <view class="footer flex justify-around">
         <view>
            <button class="cu-btn lg" @click="resst()">重置</button>
         </view>
         <!-- <view>
            <button class="cu-btn lg pakin-btn bg-blue" @click="comb()">确认</button>
         </view> -->
      </view>
      <!-- 弹出层 -->
      <view class="popup-mask" v-if="popShow">
         <view class="popup">
@@ -56,13 +67,13 @@
               <view class="popup-text-key">拣货单号:</view>
               <view>{{doc_num}}</view>
            </view>
            <view class="column">
            <!-- <view class="column">
               <view class="popup-text-key">货架号:</view>
               <input type="text">
            </view>
            </view> -->
            <view class="column">
               <view class="popup-text-key">库位号:</view>
               <input type="text">
               <input type="text" v-model="locNo">
            </view>
            <view class="column event">
               <view class="close" @click="close">取消</view>
@@ -80,26 +91,12 @@
            commonUrl:null,
            doc_num: '',
            barcodeFocus:true,
            matList:[
               {
                  locNo:"010022",
                  maktx:"属性用于设置字体",
                  anfme:"9999",
                  btnType:"default", // default
                  btnText: '未确认', // 未确认
               },
               {
                  locNo:"01001",
                  maktx:"属性用于设置字体",
                  anfme:"9999",
                  btnType:"primary", // default
                  btnText: '已出库', // 未确认
               }
            ],
            matList:[],
            btnType:"primary", // default
            btnText: '已出库', // 未确认
            popShow:false,
            index:0,
            locNo: ''
            
            
            
@@ -129,17 +126,24 @@
         nextInput() {
            let that = this
            uni.request({
               url: 'http://192.168.4.188:8081/sxjzwms/ManPakOut/list/auth',
               data:{doc_num:"202209211053"},
               url: that.commonUrl + '/ManPakOut/list/auth',
               data:{doc_num:that.doc_num},
               header: { 'token':uni.getStorageSync('token'),},
               method:'GET',
               success(result) {
                  console.log(result);
                  let res = result.data
                  if (res.code === 200) {
                     let records = res.data.records
                     for(var i = 0; i < records.length; i++) {
                        records[i]['btnType'] = 'default'
                        records[i]['btnText'] = '未确认'
                        if (records[i].status == 0) {
                           records[i]['btnType'] = 'default'
                           records[i]['btnText'] = '未确认'
                        } else if (records[i].status == 1) {
                           records[i]['btnType'] = 'primary'
                           records[i]['btnText'] = '已出库'
                        }
                     }
                     that.matList = res.data.records
                  } else if (res.code === 403) {
@@ -162,12 +166,44 @@
         close() {
            this.popShow = false
         },
         confirm() {
            this.popShow = false
            this.matList[this.index].btnText= '已出库'
            this.matList[this.index].btnType = 'primary'
         removeBarcode() {
            this.doc_num = ''
         },
         confirm() {
            let that = this
            if(!that.matList[that.index].locNo == that.locNo) {
               uni.showToast({title: '请确认库位号是否正确', icon: "none", position: 'top'});
               return
            }
            this.matList[this.index].status= 1
            uni.request({
               url: that.commonUrl + '/manPakOut/finish',
               data:JSON.stringify(that.matList[that.index]),
               method:'POST',
               success(result) {
                  var res = result.data
                  if(res.code === 200) {
                     that.popShow = false
                     that.matList[that.index].btnText= '已出库'
                     that.matList[that.index].btnType = 'primary'
                  } else if (res.code === 403) {
                     uni.showToast({title: res.msg, icon: "none", position: 'top'})
                        setTimeout(() => {
                           uni.reLaunch({
                              url: '../login/login'
                           });
                     }, 1000);
                  } else {
                     uni.showToast({title: res.msg, icon: "none",position: 'top'})
                  }
               }
            })
         },
         resst() {
            this.matList = []
            this.doc_num = ''
         }
         
      }
   }
@@ -188,6 +224,7 @@
      /* height: 130rpx; */
      margin: 25rpx;
      border-radius: 20rpx;
      font-size: 32rpx;
   }
   .data-list:first-child {
      margin-top: 20rpx;
@@ -208,7 +245,7 @@
      line-height: 70rpx;
   }
   .indent {
      text-indent: 32rpx;
      text-indent: 24rpx;
   }
   .column button {
      width: 150rpx;