#
lty
1 天以前 fbbbc66329808249c7a0689f2efca6c79a6bf892
pages/basics/order.vue
@@ -15,19 +15,36 @@
            </view>
         </view>
         
         <view class="square-2">
         <view class="square-3">
           <!-- 标题部分 -->
            <view class="square-title">
               <view class="title-sign"><view class="sign"></view></view>
               <view class="title-text"><text>单据编号</text></view>
            </view>
            <view class="square-content">
               <view class="content-input">
                  <input v-model="order" type="text" placeholder="扫码 / 输入" @input="findOrder()"
                  :focus="focus" placeholder-style="line-height:  85rpx;">
                  <uni-icons type="closeempty" size="20" color="#dadada" @click="removeOrder()"></uni-icons>
           <!-- 内容区域 -->
           <view class="square-content" style="display: flex; align-items: center;">
            <!-- 下拉输入框 -->
            <view class="content-input" style="flex: 1;">
              <uni-combox
               v-model="orderNo"
               :candidates="orderNoList"
               placeholder="请输入 / 选择订单号"
               placeholderStyle="line-height: 60rpx; font-size: 30rpx; color: #999;"
               @input="getOrderDet"
               @change="onOrderSelect"
              />
            </view>
            <!-- 检索按钮 -->
            <view style="width: 80px; display: flex; align-items: center; justify-content: center; margin-left: 10rpx;">
              <button size="mini" type="primary" @click="getOrderDetlByOrderNo()">检索</button>
               </view>
            </view>
         </view>
         
         <view class="square-1">
            <view class="square-title">
@@ -59,7 +76,7 @@
               <view class="data-list-left">
                  <view class="matnr"><text style="width: 700rpx;">编码:{{item.matnr}}</text></view>
                  <view><text style="width: 700rpx;">品名:{{item.maktx}}</text></view>
                  <view><text style="width: 700rpx;">批号:{{item.batch}}</text></view>
                  <view><text style="width: 700rpx;">规格:{{item.specs}}</text></view>
                  <view>
                     <text style="width: 700rpx;">数量:{{item.anfme}}</text>
                  </view>
@@ -133,7 +150,6 @@
            searchBox: 'hide',
            pick:'hide',
            order:null,
            orderNo:null,
            matList:[],
            result: '',
            count:'',
@@ -144,6 +160,9 @@
            check:false,
            checkText:'全选',
            checkedData:[],
            orderNo: '',
            orderNoList: [],
            showDropdown: false
         }
      },
      mounted(){
@@ -156,6 +175,76 @@
         this.getUrl()
      },
      methods: {
        getOrderDet(orderNo) {
         if (!orderNo || orderNo.trim() === '') return;
         uni.request({
           url: this.commonUrl + '/mobile/order/search/orderNoList/auth',
           method: 'GET',
           data: { orderNo },
           header: {
            token: uni.getStorageSync('token')
           },
           success: res => {
            const list = res.data.data || [];
            this.orderNoList = list.map(o => o.orderNo);
           }
         });
        },
        onOrderSelect(order) {
         this.orderNo = order;
         // 可选:自动触发查询
         // this.getOrderDetlByOrderNo();
        },
      getOrderDetlByOrderNo() {
        if (!this.orderNo) {
         uni.showToast({ title: '请选择订单', icon: 'none' });
         return;
        }
        let that = this;
        uni.request({
         url: that.commonUrl + '/mobile/order/search/orderNo/auth',
         data: {
           orderNo: that.orderNo
         },
         header: {
           token: uni.getStorageSync('token')
         },
         success(result) {
           let res = result.data;
           console.log(res.data[0]);
           if (res.code === 200) {
            if (res.data) {
              uni.showLoading();
              that.matList = res.data[0].combMats;
              that.initAnfme();
              console.log(that.matList);
            }
           } 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' });
           }
         }
        });
      },
         selectOrder(orderNo) {
           this.order = orderNo
           this.showDropdown = false
         },
         removeOrder() {
           this.order = ''
           this.orderSuggestions = []
           this.showDropdown = false
         },
         // 获取url
         getUrl() {
            this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
@@ -197,6 +286,7 @@
            this.matList = []
            this.barcode = ''
            this.order = ''
            this.orderNo = '';
            this.barcodeFocuss()
            uni.vibrateShort();
         },
@@ -224,6 +314,7 @@
         initAnfme() {
         
            for (var i = 0; i < this.matList.length; i++) {
               this.matList[i].enableQty = this.matList[i].anfme
               this.matList[i].anfme = 0
            }
            uni.hideLoading();
@@ -293,6 +384,7 @@
            uni.request({
                url: that.commonUrl + '/mobile/comb/auth',
                data: JSON.stringify({
                  billNo: that.orderNo,
                  orderNo: that.orderNo,
                  barcode: that.barcode,
                  combMats: that.matList
@@ -335,12 +427,12 @@
                  'token':uni.getStorageSync('token')
                },
               success(result) {
                  console.log(result)
                  let res = result.data
                  console.log(res.data[0])
                  if (res.code === 200) {
                     if(res.data) {
                           uni.showLoading();
                        that.matList = res.data;
                        that.matList = res.data[0].combMats;
                        that.orderNo = that.order
                        that.initAnfme()
                        console.log(that.matList)
@@ -640,4 +732,11 @@
      text-align: center;
   }
   
</style>