lty
2026-02-03 7437dd7b944aaeb64e98a1e0a5943ec88db4afab
pages/basics/order.vue
@@ -4,11 +4,11 @@
         <view class="square-2">
            <view class="square-title">
               <view class="title-sign"><view class="sign"></view></view>
               <view class="title-text"><text>托盘条码</text></view>
               <view class="title-text"><text>Pallet Barcode</text></view>
            </view>
            <view class="square-content">
               <view class="content-input">
                  <input  v-model="barcode" type="text" placeholder="扫码 / 输入" maxlength="10"
                  <input  v-model="barcode" type="text" placeholder="Scan / Input" maxlength="10"
                  :focus="barcodeFocus" @input="barcodeInput" placeholder-style="line-height:  85rpx;">
                  <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
               </view>
@@ -16,32 +16,33 @@
         </view>
         
         <view class="square-3">
           <!-- 标题部分 -->
           <!-- Title Section -->
           <view class="square-title">
            <view class="title-sign"><view class="sign"></view></view>
            <view class="title-text"><text>单据编号</text></view>
            <view class="title-text"><text>Order Number</text></view>
           </view>
           <!-- 内容区域 -->
           <!-- Content Area -->
           <view class="square-content" style="display: flex; align-items: center;">
            <!-- 下拉输入框 -->
            <!-- Dropdown Input -->
            <view class="content-input" style="flex: 1;">
              <uni-combox
               v-model="orderNo"
               :candidates="orderNoList"
               placeholder="请输入 / 选择订单号"
               placeholder="Enter / Select Order No."
               placeholderStyle="line-height: 60rpx; font-size: 30rpx; color: #999;"
               emptyTips="No matching items"
               @change="onOrderSelect"
              />
            </view>
            <!-- 检索按钮 -->
            <!-- Search Button -->
            <view style="width: 80px; display: flex; align-items: center; justify-content: center; margin-left: 10rpx;">
              <button size="mini" type="primary" @click="getOrderDetlByOrderNo()">检索</button>
              <button size="mini" type="primary" @click="getOrderDetlByOrderNo()">Search</button>
            </view>
           </view>
         </view>
@@ -49,13 +50,13 @@
         <view class="square-1">
            <view class="square-title">
               <view class="title-sign"><view class="sign"></view></view>
               <view class="title-text"  style="width: 200rpx;"><text>商品列表</text></view>
               <view class="title-text"  style="width: 200rpx;"><text>Item List</text></view>
               <view v-show="matList.length != 0" class="lable">
                  <label class="label-btn" style="width: 170rpx;line-height: 95rpx;"  >
                     <checkbox :checked="check" @click="allChecked()">{{checkText}}</checkbox>
                  </label>
                  <label class="label-btn"  >
                     <text  @click="reChecked()">反选</text>
                     <text  @click="reChecked()">Invert</text>
                  </label>
                  <label >
                     <uni-icons type="trash" size="25" color="#a5a5a5" @click="remove()"></uni-icons>
@@ -65,7 +66,7 @@
            
         </view>
         <view class="square-none" v-show="matList.length === 0">
            <view class="v-show">暂无更多数据...</view>
            <view class="v-show">No more data...</view>
         </view>
         
         <checkbox-group @change="checkbox">
@@ -74,51 +75,51 @@
                  <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" />
               </label>
               <view class="data-list-left">
                  <view class="matnr"><text style="width: 500rpx;">编码:{{item.matnr}}</text>
                  <text style="margin-left: 100rpx;">名称:{{item.maktx}}</text></view>
                  <view><text style="width: 500rpx;">PO:{{item.standby1}}</text>
                  <text style="margin-left: 100rpx;">SKU:{{item.standby3}}</text></view>
                  <view><text style="width: 500rpx;">UPC:{{item.standby2}}</text></view>
                  <view><text style="width: 500rpx;">采购单:{{item.boxType3}}</text>
                  <text style="margin-left: 100rpx;">数量:{{item.anfme}}</text></view>
                  <view class="matnr"><text style="width: 500rpx;">Code: {{item.matnr}}</text>
                  <text style="margin-left: 100rpx;">Name: {{item.maktx}}</text></view>
                  <view><text style="width: 500rpx;">Customer PO: {{item.standby1}}</text>
                  <text style="margin-left: 100rpx;">SKU: {{item.standby3}}</text></view>
                  <view><text style="width: 500rpx;">UPC: {{item.standby2}}</text></view>
                  <view><text style="width: 500rpx;">PO Number: {{item.boxType3}}</text>
                  <text style="margin-left: 100rpx;">Quantity: {{item.anfme}}</text></view>
               </view>
               <view class="data-list-right">
                  <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label>
                  <!-- list中删除键 -->
                  <!-- Delete button in list -->
                  <!-- <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label> -->
               </view>
            </view>
         </checkbox-group>
      </scroll-view>
      
      <!-- 底部按钮 -->
      <!-- Bottom Buttons -->
      <view class="footer flex justify-around">
         <!-- 底部全选 反选按钮 -->
         <!-- Bottom Select All / Invert Buttons -->
         <!-- <label class="label-btn" style="width: 170rpx;">
            <checkbox :checked="check" @click="allChecked()">{{checkText}}</checkbox>
         </label>
         <label class="label-btn" style="width: 100rpx;">
            <text  @click="reChecked()">反选</text>
            <text  @click="reChecked()">Invert</text>
         </label> -->
         
         <label class="label-btn flex justify-center align-center">
            <button class="cu-btn" @click="resst()">重置</button>
            <button class="cu-btn" @click="resst()">Reset</button>
         </label>
         <label class="label-btn flex justify-center align-center">
            <button class="cu-btn bg-blue " @click="comb()">组托</button>
            <button class="cu-btn bg-blue " @click="comb()">Combine</button>
         </label>
      </view>
      
      <view>
         <!-- 修改数量 -->
         <!-- Modify Quantity -->
         <uni-popup ref="revise" background-color="#fff" @change="change">
            <view class="revise-box">
               <view class="revise-box-top">
                  <view class="color-block-blue"></view>
                  <text class="title">组托数量</text>
                  <text class="title">Combine Quantity</text>
               </view>
               <view class="text-box">
                  <text>可组数量:{{enableQty}}</text>
                  <text>Available Qty: {{enableQty}}</text>
               </view>
               <view class="changeBox flex justify-around">
                  <view class="num-box">
@@ -128,7 +129,7 @@
               </view>
               <view class="revise-box-buttom">
                  <view>
                     <button class="cu-btn bg-blue" @click="confirm()">确认</button>
                     <button class="cu-btn bg-blue" @click="confirm()">Confirm</button>
                  </view>
               </view>
               
@@ -159,7 +160,7 @@
            rowNum:'',
            enableQty:'',
            check:false,
            checkText:'全选',
            checkText:'Select All',
            checkedData:[],
            orderNo: '',
            orderNoList: [], 
@@ -194,12 +195,12 @@
        onOrderSelect(order) {
         this.orderNo = order;
         // 可选:自动触发查询
         // Optional: Auto trigger search
         // this.getOrderDetlByOrderNo();
        },
      getOrderDetlByOrderNo() {
        if (!this.orderNo) {
         uni.showToast({ title: '请选择订单', icon: 'none' });
         uni.showToast({ title: 'please enter orderNo', icon: 'none' });
         return;
        }
        let that = this;
@@ -246,15 +247,15 @@
           this.orderSuggestions = []
           this.showDropdown = false
         },
         // 获取url
         // Get URL
         getUrl() {
            this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
         },
         // barcode input 事件
         // Barcode input event
         barcodeInput() {
            var len = this.barcode.length
            if (len != 6) {
               uni.showToast({title: '托盘码有误请重试', icon: "none", position: 'top'});
               uni.showToast({title: 'Invalid pallet barcode', icon: "none", position: 'top'});
               this.barcodeFocuss()
               return;
            }
@@ -262,7 +263,7 @@
               this.focuss()
            }
         },
         // 托盘码有误重置
         // Reset invalid pallet barcode
         barcodeFocuss() {
            // #ifdef APP
            let that = this;
@@ -309,7 +310,7 @@
         },
         eject(type) {
            this.type = type
            // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
            // The parameter passed to open method is equivalent to binding type attribute on uni-popup component
            this.$refs.revise.open(type)
         },
         initAnfme() {
@@ -351,7 +352,7 @@
            this.checkList();
            uni.vibrateShort();
         },
         // 列表中删除
         // Remove from list
         // remove(item,index) {
         //    this.matList.splice(index,1)
         //    uni.vibrateShort();
@@ -365,27 +366,27 @@
            let that = this;
            if (that.barcode === '') {
               uni.showToast({ title: '请扫描托盘条码', icon: "none", position: 'top' });
               uni.showToast({ title: 'Please scan pallet barcode', icon: "none", position: 'top' });
               return;
            }
            if (that.barcode.length !== 6) {
               uni.showToast({ title: '托盘码必须为6位', icon: "none", position: 'top' });
               uni.showToast({ title: 'Pallet barcode must be 6 digits', icon: "none", position: 'top' });
               return;
            }
            if (that.matList.length === 0) {
               uni.showToast({ title: '请添加商品列表', icon: "none", position: 'top' });
               uni.showToast({ title: 'Please add item list', icon: "none", position: 'top' });
               return;
            }
            // 过滤出数量大于0的商品
            // Filter items with quantity > 0
            const validMats = that.matList.filter(item => item.anfme > 0);
            if (validMats.length === 0) {
               uni.showToast({ title: '所有商品组托数量为0,无法组托', icon: "none", position: 'top' });
               uni.showToast({ title: 'All items quantity is 0, cannot combine', icon: "none", position: 'top' });
               return;
            }
            // 删除数量为0的商品
            // Remove items with quantity 0
            that.matList = validMats;
            uni.showLoading();
@@ -459,34 +460,34 @@
            });
         },
         change(e) {
            // console.log('当前模式:' + e.type + ',状态:' + e.show);
            // console.log('Current mode: ' + e.type + ', Status: ' + e.show);
         },
         toggle(type) {
            this.type = type
            // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
            // The parameter passed to open method is equivalent to binding type attribute on uni-popup component
            this.$refs.goodsSearch.open(type)
         },
         // 列表选择
         // List selection
         checkbox(e) {
            const values = e.detail.value;
            this.matList.forEach(item => {
               // 确保 item.id 是字符串
               // Ensure item.id is a string
               const itemId = item.id + '';
               item.checked = values.includes(itemId);
            });
            if (values.length === this.matList.length) {
               this.check = true;
               this.checkText = "取消全选";
               this.checkText = "Unselect All";
            } else {
               this.check = false;
               this.checkText = "全选";
               this.checkText = "Select All";
            }
            uni.vibrateShort();
         },
         // 列表反选
         // Invert selection
         reChecked() { 
            if (this.matList.length == 0) {
               return;
@@ -504,35 +505,35 @@
            }
            if (checkArr.length == this.matList.length) {
               this.check = true
               this.checkText = "取消全选"
               this.checkText = "Unselect All"
            } else {
               this.check = false
               this.checkText = "全选"
               this.checkText = "Select All"
            }
            uni.vibrateShort();
         },
         // 列表全选
         // Select all
         allChecked(e){ 
            if (this.check == true) {
               for (var i = 0; i < this.matList.length;i++) {
                  this.$set(this.matList[i],'checked',false)
               }
               this.check = false
               this.checkText = "全选"
               this.checkText = "Select All"
            } else {
               for (var i = 0; i < this.matList.length;i++) {
                  this.$set(this.matList[i],'checked',true)
               }
               this.check = true
               this.checkText = "取消全选"
               this.checkText = "Unselect All"
            }
            uni.vibrateShort();
         },
         // 检验列表长度 等于0 显示全选
         // Check list length, if 0 show Select All
         checkList() {
            if (this.matList.length == 0) {
               this.check = false
               this.checkText = "全选"
               this.checkText = "Select All"
               return;
            }
         }