|  |  |  | 
|---|
|  |  |  | <view class="title">接驳站</view> | 
|---|
|  |  |  | <input placeholder="请扫描接驳站条码" v-model="barcode" ></input> | 
|---|
|  |  |  | <text class='cuIcon-search text-blue' @click="search"></text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="cu-form-group"> | 
|---|
|  |  |  | <view class="title">目标库区</view> | 
|---|
|  |  |  | <view style="width: 75%;"> | 
|---|
|  |  |  | <uni-data-select style="min-width: 50%; max-width: 100%;" v-model="whAreaId" :localdata="range" | 
|---|
|  |  |  | placement="bottom" @change="selChange"></uni-data-select> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </form> | 
|---|
|  |  |  | <view class="flex solid-bottom padding-sm justify-between"> | 
|---|
|  |  |  | <view class="text-blue">容器码:{{container}}</view> | 
|---|
|  |  |  | 
|---|
|  |  |  | <text class="text-grey ">{{item.asnCode}}</text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <view class="cu-item"> | 
|---|
|  |  |  | <view class="content"> | 
|---|
|  |  |  | <text class="text-black">供应商批次:</text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="action"> | 
|---|
|  |  |  | <text class="text-grey">{{item.splrBatch}}</text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <view class="cu-item"> | 
|---|
|  |  |  | <view class="content"> | 
|---|
|  |  |  | <text class="text-black">库存批次:</text> | 
|---|
|  |  |  | <text class="text-black">批次:</text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="action"> | 
|---|
|  |  |  | <text class="text-grey ">{{item.batch}}</text> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | <button class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="confirm">启动</button> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <uni-popup ref="popup" class="cu-popup"> | 
|---|
|  |  |  | <view class="popup-content"> | 
|---|
|  |  |  | <view class="head"> | 
|---|
|  |  |  | <text>推荐</text> | 
|---|
|  |  |  | <text class='cuIcon-close text-red close' @click="close"></text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div class="body"> | 
|---|
|  |  |  | <view class="cu-list grid col-3 no-border"> | 
|---|
|  |  |  | <view class="item" v-for="el in range"> | 
|---|
|  |  |  | <view class="cu-btn round  sm" :class="[el===curCode?'bg-blue':'line-blue']" | 
|---|
|  |  |  | @click="itemChange(el)">{{el}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <view class="cu-bar btn-group "> | 
|---|
|  |  |  | <button class="cu-btn bg-blue shadow-blur" @click="popupSubmit">提交</button> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </uni-popup> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | 
|---|
|  |  |  | container: '', | 
|---|
|  |  |  | list: [], | 
|---|
|  |  |  | range: [], | 
|---|
|  |  |  | curCode: '' | 
|---|
|  |  |  | curCode: '', | 
|---|
|  |  |  | whAreaId:'', | 
|---|
|  |  |  | repeatClick: false, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | computed: { | 
|---|
|  |  |  | ...mapState('user', ['dynamicFields']), | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | mounted() {}, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | selChange(val) { | 
|---|
|  |  |  | uni.setStorageSync('whAreaId', val) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | async search() { | 
|---|
|  |  |  | let that = this | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | 
|---|
|  |  |  | if(data.list.length >0){ | 
|---|
|  |  |  | that.container = data.barcode | 
|---|
|  |  |  | that.list = data.list | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | that.range = data.warehouseAreasList.map(item => ({ | 
|---|
|  |  |  | value: item.id, | 
|---|
|  |  |  | text: item.name | 
|---|
|  |  |  | })); | 
|---|
|  |  |  | that.whAreaId = data.area | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: msg, | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(this.whAreaId === '' || this.whAreaId ===null){ | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: "目标库区不能为空", | 
|---|
|  |  |  | icon: "none", | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.repeatClick = true | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | code, | 
|---|
|  |  |  | data, | 
|---|
|  |  |  | msg | 
|---|
|  |  |  | } = await request('/AGV/staUnBind',{ | 
|---|
|  |  |  | sta: this.barcode | 
|---|
|  |  |  | } = await request('/AGV/task/start',{ | 
|---|
|  |  |  | sta: this.barcode, | 
|---|
|  |  |  | area: this.whAreaId | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | if (code === 200) { | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: '解绑成功' | 
|---|
|  |  |  | title: '启动成功' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.clear() | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | 
|---|
|  |  |  | icon: "none", | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.repeatClick = false | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|