#
zhou zhou
2026-01-07 9adc3c142e94bca536b481c8f0a568a047555de3
pages/emptyTray/outBound.vue
@@ -3,233 +3,240 @@
      <form>
         <view class="cu-form-group margin-top">
            <view class="title">接驳站点</view>
            <input placeholder=" 请扫描接驳站点条码" v-model="barcode" ></input>
         </view>
            <input
               placeholder=" 请扫描接驳站点条码"
               v-model="barcode"
            />
         </view>
         <view class="cu-form-group margin-bottom">
            <view class="title">容器类型</view>
            <view style="width: 78%;">
               <uni-data-select style="min-width: 80%; max-width: 80%;" v-model="palletTypeId" :localdata="range"
                  placement="bottom" @change="selChange"></uni-data-select>
            <view style="width: 78%">
               <uni-data-select
                  style="min-width: 80%; max-width: 80%"
                  v-model="palletTypeId"
                  :localdata="range"
                  placement="bottom"
                  @change="selChange"
               ></uni-data-select>
            </view>
         </view>
      </form>
      <view class="cu-bar btn-group foot">
         <button class="cu-btn text-blue line-blue shadow" @click="clear">清空</button>
         <button class="cu-btn bg-blue shadow-blur" @click="confirm">呼叫</button>
      </view>
         <button
            class="cu-btn text-blue line-blue shadow"
            @click="clear"
         >
            清空
         </button>
         <button
            class="cu-btn bg-blue shadow-blur"
            @click="confirm"
         >
            呼叫
         </button>
      </view>
   </view>
</template>
<script>
   import {
      request
   } from '../../common/request.js'
   import {
      mapState,
      mapMutations,
      mapActions,
      mapGetters
   } from 'vuex';
   export default {
      data() {
         return {
            barcode: '',
            areaName: '',
            locCode: '',
            container: '',
            list: [],
            range: [],
            curCode: ''
import { request } from '../../common/request.js'
import { mapState, mapMutations, mapActions, mapGetters } from 'vuex'
export default {
   data() {
      return {
         barcode: '',
         areaName: '',
         locCode: '',
         container: '',
         list: [],
         range: [],
         curCode: '',
         palletTypeId: ''
      }
   },
   computed: {
      ...mapState('user', ['dynamicFields'])
   },
   mounted() {
      this.getPalletType(),
         (this.palletTypeId = uni.getStorageSync('palletTypeId'))
   },
   methods: {
      selChange(val) {
         uni.setStorageSync('palletTypeId', val.value)
      },
      // async search() {
      //    const {
      //       code,
      //       data,
      //       msg
      //    } = await request('/stock/operate/list', {
      //       barcode: this.container,
      //       sta: this.barcode
      //    })
      //    if (code === 200) {
      //       // const find = this.list.find(el => el.id === data.id);
      //       // !find &&
      //        this.list = data
      //    } else {
      //       uni.showToast({
      //          title: msg,
      //          icon: "none",
      //       })
      //    }
      // },
      remove(index) {
         this.list.splice(index, 1)
      },
      clear() {
         this.list = []
         this.palletTypeId = ''
         this.container = ''
         this.barcode = ''
      },
      open() {
         this.$refs.popup.open()
      },
      close() {
         this.$refs.popup.close()
      },
      popupSubmit() {
         this.$refs.popup.close()
      },
      itemChange(el) {
         this.curCode = el
      },
      async getPalletType() {
         const { code, data, msg } = await request(
            '/info/palletType/list',
            {},
            'get'
         )
         if (code === 200) {
            this.range = data.map((item) => ({
               value: item.id,
               text:
                  item.group === null
                     ? item.label
                     : item.group + '-- ' + item.label
            }))
         }
      },
      computed: {
         ...mapState('user', ['dynamicFields']),
      },
      mounted() {
         this.getPalletType(),
         this.palletTypeId = uni.getStorageSync('palletTypeId')
      },
      methods: {
         selChange(val) {
            uni.setStorageSync('palletTypeId', val.value)
         },
         // async search() {
         //    const {
         //       code,
         //       data,
         //       msg
         //    } = await request('/stock/operate/list', {
      async confirm() {
         if (this.barcode === '' || this.barcode === null) {
            uni.showToast({
               title: '接驳站点不能为空',
               icon: 'none'
            })
            return
         }
         if (this.palletTypeId === '' || this.palletTypeId === null) {
            uni.showToast({
               title: '请选择托盘类型',
               icon: 'none'
            })
            return
         } else {
            const { code, data, msg } = await request('/orders/confirm', {
               receipts: newArr,
               palletTypeId: this.palletTypeId
            })
            if (code === 200) {
               uni.showToast({
                  title: '呼叫空托盘中,请稍作等待'
               })
               this.list = []
               this.barcode = ''
               this.isconfirm = false
            } else {
               uni.showToast({
                  title: msg,
                  icon: 'none',
                  position: 'top'
               })
            }
         }
         // const {
         //    code,
         //    data,
         //    msg
         // } = await request('/AGV/staBind',{
         //       barcode: this.container,
         //       sta: this.barcode
         //    })
         //    if (code === 200) {
         //       // const find = this.list.find(el => el.id === data.id);
         //       // !find &&
         //        this.list = data
         //    } else {
         //       uni.showToast({
         //          title: msg,
         //          icon: "none",
         //       })
         //    }
         // },
         remove(index) {
            this.list.splice(index, 1);
         },
         clear() {
            this.list = []
            this.palletTypeId = ''
            this.container = ''
            this.barcode = ''
         },
         open() {
            this.$refs.popup.open()
         },
         close() {
            this.$refs.popup.close()
         },
         popupSubmit() {
            this.$refs.popup.close()
         },
         itemChange(el) {
            this.curCode = el
         },
         async getPalletType() {
            const {
               code,
               data,
               msg
            } = await request('/info/palletType/list', {}, 'get')
            if (code === 200) {
               this.range = data.map(item => ({
                  value: item.id,
                  text: item.group === null ? item.label : item.group + "-- " + item.label
               }));
            }
         },
         async confirm() {
            if(this.barcode === '' || this.barcode === null){
               uni.showToast({
                  title: "接驳站点不能为空",
                  icon: "none",
               })
               return ;
            }
            if(this.palletTypeId === '' || this.palletTypeId === null){
               uni.showToast({
                  title: "请选择托盘类型",
                  icon: "none",
               })
               return ;
            } else {
               const {
                  code,
                  data,
                  msg
               } = await request('/orders/confirm', {
                  receipts: newArr,
                  palletTypeId: this.palletTypeId
               })
               if (code === 200) {
                  uni.showToast({
                     title: '呼叫空托盘中,请稍作等待'
                  })
                  this.list = []
                  this.barcode = ''
                  this.isconfirm = false
               } else {
                  uni.showToast({
                     title: msg,
                     icon: "none",
                     position: 'top'
                  })
               }
            }
            // const {
            //    code,
            //    data,
            //    msg
            // } = await request('/AGV/staBind',{
            //       barcode: this.container,
            //       sta: this.barcode
            //    }
            // )
            // if (code === 200) {
            //    uni.showToast({
            //       title: '绑定成功'
            //    })
            //    this.clear()
            // } else {
            //    uni.showToast({
            //       title: msg,
            //       icon: "none",
            //    })
            // }
         },
         // )
         // if (code === 200) {
         //    uni.showToast({
         //       title: '绑定成功'
         //    })
         //    this.clear()
         // } else {
         //    uni.showToast({
         //       title: msg,
         //       icon: "none",
         //    })
         // }
      }
   }
}
</script>
<style>
   .index {
      border: 1px solid #e54d42;
      color: #e54d42;
      border-radius: 50%;
      display: block;
      width: 50rpx;
      height: 50rpx;
      line-height: 48rpx;
      text-align: center;
      margin-right: 20rpx;
      font-size: 30rpx;
   }
.index {
   border: 1px solid #e54d42;
   color: #e54d42;
   border-radius: 50%;
   display: block;
   width: 50rpx;
   height: 50rpx;
   line-height: 48rpx;
   text-align: center;
   margin-right: 20rpx;
   font-size: 30rpx;
}
   .text-blue {
      color: #0081ff !important;
.text-blue {
   color: #0081ff !important;
}
   }
.item {
   position: relative;
   display: flex;
   min-height: 80upx;
   align-items: center;
}
   .item {
      position: relative;
      display: flex;
      min-height: 80upx;
      align-items: center;
   }
.uni-file-picker {
   width: 100%;
   margin-bottom: 10px;
}
   .uni-file-picker {
      width: 100%;
      margin-bottom: 10px;
   }
.uni-select__selector {
   z-index: 999;
}
   .uni-select__selector {
      z-index: 999;
   }
.tj {
   height: auto;
   padding: 6px 8px;
   display: inline-block;
   border-radius: 6px;
}
   .tj {
      height: auto;
      padding: 6px 8px;
      display: inline-block;
      border-radius: 6px;
   }
.item {
   display: flex;
   justify-content: center;
}
   .item {
      display: flex;
      justify-content: center;
   }
   .item .cu-btn {
      font-size: 26upx;
   }
</style>
.item .cu-btn {
   font-size: 26upx;
}
</style>