#
whycq
2022-11-01 4ecea7f67f2cf90ddb0b6d9ff3232770951b99d1
pages/basics/stockCheck.vue
@@ -1,7 +1,7 @@
<template>
   <view>
      <scroll-view scroll-y>
         <view class="pak-seach-box">
         <!-- <view class="pak-seach-box">
            <view class="box-top">
               <view class="color-block-blue"></view>
               <text class="title">选择站台</text>
@@ -12,7 +12,7 @@
                  <uni-combox @input="getCheckDetl" emptyTips="暂无数据" :candidates="staNoList" v-model="staNo" placeholder="请选择"></uni-combox>
               </view>
            </view>
         </view>
         </view> -->
         
         <view class="square-2">
            <view class="square-title">
@@ -136,83 +136,30 @@
         const PROJ = uni.getStorageSync('UPROJ');
         this.baseUrl = PROJ
         this.getUrl()
         this.getOutBound();
      },
      methods: {
         // 获取url
         getUrl() {
            this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
         },
         getOutBound() {         // 获取出库口
            let that = this
            uni.request({
               url: that.commonUrl + '/available/take/check/site',
               method: 'POST',
               header: {
                  'token':uni.getStorageSync('token')
               },
               success(result) {
                  var res = result.data
                  if (res.code === 200) {
                     that.staNoList = res.data
                  } 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'})
                  }
               },
            });
         }, // getOutBound
         getCheckDetl() {   // 获取出库口货物信息
            let that = this
            uni.request({
               url: that.commonUrl + '/mobile/checkDetl/auth',
               method: 'POST',
               data: {
                  staNo:that.staNo
               },
               header: {
                  'token':uni.getStorageSync('token')
               },
               success(result) {
                  var res = result.data
                  console.log(result)
                  if (res.code === 200) {
                     console.log(res.data)
                  } 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'})
                  }
               },
            });
         }, // getCheckDetl
         selectMat() {  // 选择商品
            let that = this
            uni.vibrateShort();
            uni.navigateTo({
               url: "matSelect",
               events: {
                   // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                   // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据  另外一个页面传过来的
                   acceptDataFromOpenedPage: function(data) {
                     that.matnr = data.data
                     that.findMat(that.matnr)
                   },
                 },
                 success: function(res) {
                   // 通过eventChannel向被打开页面传送数据
                   res.eventChannel.emit('acceptDataFromOpenerPage', {baseIP:that.baseIP, basePORT:that.basePORT })
                 }
               },
               success: function(res) {
                   // 通过eventChannel向被打开页面传送数据   向另外一个页面传递值的
                   res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
               },
            });
            that.matnr = ''
         }, // selectMat
@@ -249,6 +196,14 @@
               }
            });
         }, // findMat
         removeMatnr() {
            this.matnr = ''
            uni.vibrateShort();
            this.focus = false;
            this.$nextTick(function() {
               this.focus = true;
            });
         },
         revise(item,index) {
            var maxCount = this.matList[index].maxCount
            if (maxCount == undefined ) {
@@ -262,8 +217,9 @@
            // this.show = true
         }, 
         remove(item,index) {
            this.matList.splice(index,1)
            this.matList[index].anfme = 0
            uni.vibrateShort();
            this.$forceUpdate() // 强制刷新
         },
         eject(type) {
            this.type = type
@@ -279,6 +235,7 @@
         confirm() {
            this.matList[this.rowNum].anfme = this.count
            this.$refs.revise.close()
            this.$forceUpdate() // 强制刷新
         },
         resst() {
            this.matList = []