<!-- 扫描盘点 -->
<template>
	<view class="container-wrap">
		<uni-nav-bar title="库存盘点" :status-bar="true" background-color="#3F92F9" color="#FFF">
			<view slot="left">
				<u-icon name="account-fill" color="#FFF" size="35"></u-icon>
			</view>
			<view slot="right" @tap="$utils.back()">
				<span style="color: #FFFFFF;">返回</span>
			</view>
		</uni-nav-bar>
		<view class="container flex-column-center">
			<view class="pic" v-if="type == 1">
				<u-image height="400rpx" mode="aspectFit" src="../../static/images/scan.png"></u-image>
			</view>
			<view class="pic" v-if="type == 2">
				<u-image height="300rpx" mode="aspectFit" src="../../static/images/rfid.png"></u-image>
			</view>
			<view class="text">
				扫描完成
			</view>
			<view class="info">
				<view class="row flex-start">
					<view class="label">物料编号：</view>
					<view class="value">{{ data.materialId }}</view>
				</view>
				<view class="row flex-start">
					<view class="label">物料名称：</view>
					<view class="value">{{ data.materialName }}</view>
				</view>
				<view class="row flex-start">
					<view class="label">物料类型：</view>
					<view class="value">{{ data.materialCategoryName }}</view>
				</view>
				<view class="row flex-start">
					<view class="label">所在仓库：</view>
					<view class="value">{{ data.stockName }}</view>
				</view>
				<view class="row flex-start" style="margin-bottom: 10rpx;">
					<view class="label">旋转区域：</view>
					<view class="value">{{ data.placeArea }}</view>
				</view>
				<view class="row flex-start big">
					<view class="label">库存数量：</view>
					<view class="value">
						{{ data.quantity }}
						<span style="padding: 0 10rpx;" v-if="data.quantity">米</span>
					</view>
				</view>
				<view class="row flex-start big">
					<view class="label">盘点结果：</view>
					<view class="value flex-start">
						<u-input v-model="quantity" type="number" :border="true" placeholder="请输入数量" border-color="#000" />
						<span style="padding: 0 10rpx;">米</span>
					</view>
				</view>
				<view class="row">
					<u-button throttleTime="300" type="primary" style="width: 100%;">完成并继续</u-button>
				</view>
				<view class="row">
					<u-button throttleTime="300" type="primary" style="width: 100%;">完成并返回</u-button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				quantity: '',
				code: '',
				type: 1,
				data: {}
			};
		},
		methods: {
			// 获取标签详情
			getMaterialStock() {
				
			}
		},
		onLoad(option) {
			this.code = option.code || ''
			this.type = option.type
			this.$http.GetMaterialStock({
				scanCodeWay: this.type,
				scanCode: this.code
			}).then(res => {
				console.log(res)
				if(res.code === 0) {
					this.data = res.result
				}
			})
		}
	}
</script>

<style lang="scss" scoped>
@import '../../static/css/mycss.scss';
.container-wrap {
	position: relative;
	.container {
		height: calc(100vh - 150rpx);
		overflow: auto;
		.pic {
			width: 650rpx;
		}
		.text {
			padding: 30rpx 0;
			font-size: 36rpx;
			font-weight: bold;
		}
		.info {
			padding: 20rpx;
			width: 700rpx;
			border-radius: 10rpx;
			background-color: #FFFFFF;
			.row {
				padding-bottom: 20rpx;
				&.big {
					font-weight: bold;
					
				}
				&:last-child {
					padding-bottom: 0;
				}
			}
		}
	}
}
</style>
