<template>
	<view class="sh-content" style="padding: 50rpx 50rpx;">

		<view class="task">
			<span>容器编号:</span>
			<u-input v-model="queryForm.containerCode" border placeholder="扫描上架容器编号" style="margin-top: 20rpx;">
			</u-input>
		</view>

		<view class="task" style="margin-top: 400rpx;">
			<span>缓存货位编号:</span>
			<u-input v-model="queryForm.cacheWallCode" border placeholder="扫描放入的缓存墙货位编号" style="margin-top: 20rpx;">
			</u-input>
		</view>
		<view class="footer" style="position: absolute;bottom:8%;left: 50%;transform: translateX(-50%);">
			<u-button type="success" @click="checkOutPick()" style="width: 400rpx;">确认已放入</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				queryForm: {
					//容器编号
					containerCode: '',
					//货位编号
					cacheWallCode: '',
				}
			}
		},

		methods: {
			//查询是否有上架容器
			// queryContainer(){
			// 	this.$u.api.onShelf.queryContainerTask({containerCode:this.queryForm.containerCode}).then(res => {
			// 		if(res.data != null)return true
			// 		this.$u.toast('当前容器任务已在执行，请继续将容器放入输送线入库')
			// 			return false
			// 	} )
			// },

			//确认放入
			async checkOutPick() {
				await this.$u.api.cache.updCacheWallShelf(this.queryForm).then(res => {
					this.$u.toast(res.msg)
					if (res.code == 200) {
						this.queryForm.containerCode = ''
						this.queryForm.cacheWallCode = ''
					}
				}).catch(err => {
					this.queryForm.containerCode = ''
					this.queryForm.cacheWallCode = ''
				})

			},
		}
	}
</script>

<style lang="scss">
	@import "index.scss";
</style>
