#
whycq
2023-06-26 95cbe9595aa314006519b06640710023baa6eeac
pages/order/orderPutOn2.vue
@@ -2,26 +2,26 @@
   <view>
      <view class="code">
         <view class="item">
            <view class="code-decs">库位号:</view>
            <view class="code-decs">托盘码:</view>
            <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus"
               @input="barcodeInput()">
         </view>
         <view class="item">
            <view class="code-decs">物料号:</view>
            <input type="text" placeholder=" 扫码 / 输入" v-model="matnr" :focus="matFocus" @input="findMat()">
            <view class="item-right">
               <button></button>
               <text style="text-align: right;color: #409EFF;" @click="selectMat()">搜索</text>
               <uni-icons type="right" color="#c1c1c1"></uni-icons>
            </view>
            <view class="code-decs">订单号:</view>
            <uni-combox :candidates="orderNoList" placeholder="请选择订单" v-model="orderNo" @input="getOrderDet"></uni-combox>
         </view>
      </view>
      <view class="mat-list-title">
         商品列表
         <view style="width: 200rpx;"></view>
         <view style="-webkit-flex: 1;flex: 1;">商品列表</view>
         <view style="width: 200rpx;"><button size="mini" type="primary" @click="getChecked">提取</button></view>
      </view>
      <scroll-view>
         <view class="list" v-for="(item,i) in dataList" :key="i">
            <view class="list-left">
         <checkbox-group class="list" v-for="(item,i) in dataList" :key="i" @change="checkboxChange">
            <view class="aside">
               <checkbox :value="item.matnr" :checked="item.checked" @click="set(i)"/>
            </view>
            <view class="list-left" style="margin: 0;">
               <view class="list-left-item">
                  <view class="desc">No:</view>
                  <view class="left-item">{{i + 1}}</view>
@@ -67,7 +67,7 @@
               <uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons>
               <uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons>
            </view>
         </view>
         </checkbox-group>
      </scroll-view>
      <!-- 底部操作按钮 -->
      <view class="buttom">
@@ -99,7 +99,8 @@
               <view class="popup-item">
                  <view class="popup-item-left">数量:</view>
                  <view class="popup-item-right" style="border: none;justify-content: center;">
                     <uni-number-box :value="count" :step='0.01' :max="9999999" color="#747474" @change="changeValue" />
                     <uni-number-box :value="count" :step='0.01' :max="9999999" color="#747474"
                        @change="changeValue" />
                  </view>
               </view>
               <view class="btn">
@@ -148,7 +149,7 @@
<script>
   export default {
      data () {
      data() {
         return {
            baseUrl: '',
            token: '',
@@ -156,6 +157,7 @@
            barcode: '',
            barcodeFocus: '',
            dataList: [],
            checkedDataList: [],
            count: 0,
            rowNum: '',
            matnr: '',
@@ -170,14 +172,64 @@
            barcodeFocus: true,
            matFocus: false,
            matData: '',
            removeNum: 0
            removeNum: 0,
            orderNoList: [],
            orderNo: '',
         }
      },
      onShow() {
         this.baseUrl = uni.getStorageSync('baseUrl');
         this.token = uni.getStorageSync('token');
         this.getOrderNoList()
      },
      methods: {
         set(e) {
            var ck = this.dataList[e].checked
            this.dataList[e].checked = ck ? false:true
         },
         getChecked() {
            var checkedList = []
            for(var i = 0; i < this.dataList.length; i++) {
               var t = !this.dataList[i].checked
               if (this.dataList[i].checked) {
                  checkedList.push(this.dataList[i])
               }
            }
            this.dataList = checkedList
         },
         getOrderDet() {
            let that = this
            uni.request({
               url: that.baseUrl + '/order/list/orderNo',
               data: {orderNo: that.orderNo} ,
               method: 'GET',
               success(res) {
                  res = res.data;
                  if (res.code === 200) {
                     that.dataList = res.data
                     for (var i = 0; i < that.dataList.length; i++) {
                        that.$set(that.dataList[i],'checked',false)
                     }
                  }
               }
            })
         },
         checkboxChange: function (e) {
         },
         getOrderNoList() {
            let that = this
            uni.request({
               url: this.baseUrl + '/order/list/all',
               method: 'POST',
               success(res) {
                  res = res.data
                  for (var i = 0; i < res.data.length; i++) {
                     that.orderNoList.push(res.data[i].order_no)
                  }
               }
            })
         },
         messageToggle(type) {
            this.msgType1 = type
            this.$refs.message.open()
@@ -209,7 +261,7 @@
         // 搜索物料
         findMat() {
            let that = this
            var matnr =  that.matnr.split(";")
            var matnr = that.matnr.split(";")
            that.order = matnr[0]
            that.matnr = matnr[1]
            uni.request({
@@ -261,15 +313,16 @@
                        position: 'top'
                     })
                  }
               }
            });
         },
         checkMat(mat) {
            mat['orderNo'] = this.order
            var len = this.dataList.length
            var add = true ,sameItem = false
            var add = true,
               sameItem = false
            for (var i = 0; i < len; i++) {
               if (mat.orderNo != this.dataList[i].orderNo) {
                  add = true
@@ -289,7 +342,7 @@
                        } else {
                           add = true
                        }
                     } else {
                        // 相同物料相同批号 数量累加
                        this.dataList[i].anfme += mat.anfme
@@ -298,7 +351,7 @@
                     }
                  }
               }
            }
            if (add) {
               this.dataList.unshift(mat)
@@ -331,9 +384,9 @@
               }
            }
            uni.request({
               url: that.baseUrl + '/mobile/manDetl/in',
               url: that.baseUrl + '/mobile/comb/auth',
               data: JSON.stringify({
                  locNo: that.barcode,
                  barcode: that.barcode,
                  combMats: that.dataList
               }),
               method: 'POST',
@@ -370,14 +423,14 @@
         // 确认重置
         resetConfirm() {
            this.dataList = []
            this.order = ''
            this.orderNo = ''
            this.barcode = ''
            this.messageText = "重置完成"
            this.messageToggle('success')
         },
         // 取消重置
         resetClose() {
         },
         // 修改批号
         revise(item, i) {
@@ -394,7 +447,7 @@
         },
         // 列表移除按钮
         remove(item, i, type) {
            this.removeNum  = i
            this.removeNum = i
            this.msgType = type
            this.title = '警告'
            this.content = '是否移除当前商品!'
@@ -440,20 +493,32 @@
<style>
   @import url('../../static/css/wms.css/wms.css');
   .list {
      display: flex;
      min-height: 80rpx;
      background-color: #FFF;
      margin: auto 20rpx;
      margin: 20rpx 20rpx;
      border-radius: 20rpx;
      box-shadow: 0px 0px 30px 0px rgba(0,0,0,0.2);
      box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.2);
   }
   .list:first-child {
      margin-top: 410rpx;
      margin-top: 360rpx;
   }
   .list:last-child {
      margin-bottom: 120rpx;
   }
   .aside {
      width: 100rpx;
      /* background-color: #303133; */
      display: flex;
      align-items: center;
      justify-content: center;
   }
   .code {
      width: 100%;
      position: fixed;
@@ -461,6 +526,7 @@
      background-color: #FFF;
      z-index: 10;
   }
   .item {
      display: flex;
      align-items: center;
@@ -468,7 +534,7 @@
      margin-left: 20rpx;
      border-bottom: 1px solid #DCDFE6;
   }
   .item input {
      height: 50rpx;
      line-height: 50rpx;
@@ -476,23 +542,24 @@
      font-size: 36upx;
      font-family: PingFang SC;
      width: 55vw;
   }
   .code-decs {
      width: 20vw;
      font-size: 18px;
      color: #303133;
   }
   .item-right {
      margin-left: auto;
      margin-right: 20rpx;
   }
   .mat-list-title {
      display: flex;
      align-items: center;
      height: 80rpx;
      line-height: 80rpx;
      width: 100%;
      background-color: white;
      position: fixed;
@@ -501,5 +568,7 @@
      /* border-top: 1px solid #DCDFE6; */
      text-align: center;
      box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.5);
   }
</style>