#
whycq
2022-10-15 4ab124f41c545363113cf17d3a6a33100efbcb07
pages/basics/matSelect.vue
@@ -30,11 +30,14 @@
                     <view class="cu-tag bg-cyan ">商品</view>
                  </view>
                  <view class="matnr"><text style="width: 400rpx;">{{item.matnr}}</text></view>
                  <view class="matnr"><text style="width: 400rpx;">{{item.maktx}}</text></view>
                  <view class="matnr"><text style="width: 400rpx;">{{item.specs}}</text></view>
               </view>
            </label>
         </checkbox-group>
      </scroll-view>
      <!-- <view class="record">
      </view> -->
      </view>
</template>
@@ -42,13 +45,10 @@
   export default {
      data() {
         return {
            commonUrl:null,
            condition:null,
            tag: [],
            data: [],
            baseHttp:'http://',
            baseIP:'',
            basePORT:'',
            baseUrl:'/lywms'
         }
      },
      onLoad() {
@@ -57,9 +57,8 @@
         const eventChannel = this.getOpenerEventChannel();
         
         // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
         eventChannel.on('acceptDataFromOpenerPage', function(data) {
            that.baseIP = data.baseIP
            that.basePORT = data.basePORT
         eventChannel.on('commonUrl', function(data) {
            that.commonUrl = data.commonUrl
            that.showTag(1)
         })
      },
@@ -81,7 +80,7 @@
            });
            uni.request({
               // url: "http://localhost:8081/jkwms/tag/list/pda/auth",
                url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/search/pda/auth',
                url: that.commonUrl + '/mat/search/pda/auth',
                data: {
                  condition: condition
                },
@@ -111,7 +110,7 @@
            let that = this
            uni.showLoading();
            uni.request({
                url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/tag/list/pda/auth',
                url: that.commonUrl + '/tag/list/pda/auth',
               header: {
                  'token':uni.getStorageSync('token'),
               },
@@ -123,6 +122,7 @@
                  'token':uni.getStorageSync('token'),
               },
               success(result) {
                  uni.hideLoading();
                  that.tag = null
                  that.data = null
                  var res = result.data
@@ -142,19 +142,18 @@
                  } else {
                     uni.showToast({title: res.msg, icon: "none",position: 'top'})
                  }
                  uni.hideLoading();
               }
            });
         },
         showMat(tagId) {
            uni.vibrateShort();
            uni.showLoading();
            let that = this
            if (tagId == null || tagId == '' || tagId == undefined) {
               return;
            }
            uni.request({
               // url: "http://localhost:8081/jkwms/mat/list/pda/auth",
                url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/list/pda/auth',
                url: that.commonUrl + '/mat/list/pda/auth',
                data: {
                  tagId: tagId
                },
@@ -163,13 +162,13 @@
                  'token':uni.getStorageSync('token'),
                },
               success(result) {
                  uni.hideLoading();
                  that.tag = null
                  var res = result.data
                  if (res.code === 200) {
                     if (res.data != null && res.data.length > 0) {
                        uni.showLoading();
                        that.data = res.data
                        uni.hideLoading();
                     } else {
                        // that.tagId = parentId
                     }
@@ -183,7 +182,7 @@
                  } else {
                     uni.showToast({title: res.msg, icon: "none",position: 'top'})
                  }
               }
            });
         },
@@ -200,6 +199,14 @@
</script>
<style>
   .record {
      z-index: 1;
      position: fixed;
      top: 188rpx;
      width: 100%;
      min-height: 50rpx;
      background-color: #6f6f6f;
   }
   .matnr {
      margin-left: 60rpx;
      margin-top: 20rpx;