#
whycq
2023-10-05 40b7a1d53e96b1af5c2241fa3dcd39ae5a0d9726
pages/basics/matQuery.vue
New file
@@ -0,0 +1,189 @@
<template>
   <view>
      <view class="container">
         <view class="text-box">
            <view class="text-title text-desc"><text>商品编码</text></view>
            <view class="text-title"><text>{{matData.matnr}}</text></view>
         </view>
         <view class="text-box">
            <view class="text-title text-desc"><text>商品名称</text></view>
            <view class="text-title">{{matData.maktx}}</view>
         </view>
         <view class="text-box">
            <view class="text-title text-desc"><text>规格</text></view>
            <view class="text-title">{{matData.specs}}</view>
         </view>
         <view class="text-box">
            <view class="text-title text-desc"><text>入库区域</text></view>
            <view class="text-title">{{matData.matType$}}</view>
         </view>
         <view class="text-box">
            <view class="text-title text-desc"><text>批号</text></view>
            <view class="text-title"><input type="text" v-model="matData.batch"></view>
         </view>
         <view class="text-box">
            <view class="text-title text-desc"><text>备注</text></view>
            <view class="text-title"><input type="text" v-model="matData.memo"></view>
         </view>
         <view class="text-box">
            <view class="text-title text-desc"><text>客户信息</text></view>
            <uni-combox :candidates="owners" placeholder="请选择客户类别"
            v-model="matData.owner"></uni-combox>
            <!-- <view class="text-title"><input type="text" v-model="matData.cstmr"></view> -->
         </view>
         <view class="text-box">
            <view class="text-title text-desc"><text>数量</text></view>
            <view class="text-title">
               <view>
                  <uni-number-box :value="matData.anfme" :max="9999999" color="#747474" @change="changeValue"/>
               </view>
            </view>
         </view>
      </view>
      <view class="foot flex justify-center">
         <label>
            <button class="cu-btn bg-blue" @click="back()">提取</button>
         </label>
      </view>
   </view>
</template>
<script>
   export default {
      data() {
         return {
            matData: {
               matnr: null,
               maktx: null,
               batch: null,
               anfme: null,
               owner: null
            },
            owners: [],
            owner: '',
            baseIP:'',
            basePORT:'',
            commonUrl: ''
         }
      },
      onLoad(option) {
         let that = this
         // #ifdef APP-NVUE
         const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
         // #endif
         // #ifndef APP-NVUE
         const eventChannel = this.getOpenerEventChannel();
         // #endif
         // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
         eventChannel.on('matData', function(data) {
         that.matData = data.data
         that.matData.anfme = 0
         })
         eventChannel.on('url', function(data) {
            that.commonUrl = data.data
         })
         this.locOwner()
      },
      methods: {
         locOwner() {
            let _this = this
            uni.request({
               url: _this.commonUrl + '/locOwner/list/auth',
               data:{curr:1,limit:15},
               header: { 'token':uni.getStorageSync('token') },
               success(res) {
                  res = res.data
                  if (res.code === 200) {
                     _this.owner = res.data.records
                     for (let k of res.data.records) {
                        _this.owners.push(k.owner)
                     }
                  }
               }
            })
         },
         blur() {
         },
         focus() {
         },
         changeValue(value) {
            this.matData.anfme = value
         },
         back() {
            if (this.matData.anfme === 0) {
               uni.showToast({title: '请输入数量', icon: "none", position: 'top'});
               return;
            }
            this.getOpenerEventChannel().emit('matList', {data: this.matData});
            this.getOpenerEventChannel().emit('owner', {data: this.owner});
            uni.vibrateShort();
            uni.navigateBack({
            })
         }
      }
   }
</script>
<style>
   .container {
      width: 100%;
      height: 100%;
      background-color: #ffffff;
   }
   .text-box {
      display: flex;
      height: 100rpx;
      /* line-height: 100rpx; */
      margin-top: 20rpx;
      margin-left: 10%;
      width: 80%;
      font-size: 32rpx;
      font-weight: 400;
      color: #434343;
      border-bottom: 1rpx solid #e8e8e8;
   }
   .text-box:last-child {
      border-bottom: none;
   }
   .text-box .text-title {
      width: 30%;
      height: 100rpx;
      float: left;
      display: inline-block;
   }
   .text-box .text-title:last-child {
      display: inline-block;
      margin-left: 5%;
      width: 65%;
      font-size: 30rpx;
      font-weight: 400;
      color: #747474;
      display: flex;
      align-items: center;
   }
   .text-box .text-title:last-child input {
      border-bottom: 1rpx solid #e8e8e8 ;
      width: 100%;
   }
   .text-desc {
      line-height: 100rpx;
   }
   .foot {
      width: 100%;
      height: 100rpx;
      line-height: 100rpx;
      background-color: rgba(255,255,255,1);
      /* background-color: #434343; */
      position: fixed;
      bottom: 0%;
      border-top: 1px solid #d8d8d8;
      z-index: 1;
   }
</style>