<!-- 到货质检详情页 -->
<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>
				<span style="padding: 0 5rpx;color: #FFFFFF;">{{ userInfo.name }}</span>
			</view>
			<view slot="right" @tap="$utils.back()">
				<span style="color: #FFFFFF;">返回</span>
			</view>
		</uni-nav-bar>
		<view class="container">
			<view class="info">
				<view class="row">物料名称：{{ option.materialName }}</view>
				<view class="row">物料编码：{{ option.materialCode }}</view>
				<view class="row">仓库名称：{{ option.stockHouseName }}</view>
				<view class="row">放置区域：{{ option.stockArea }}</view>
			</view>
			<view class="list">
				<view class="item" v-for="(item, index) in option.stockInItems" :key="index">
					<view class="row">
						<view class="col">
							<view class="label">物料名称：</view>
							<view class="value">{{ option.materialName }}</view>
						</view>
					</view>
					<view class="row">
						<view class="col">
							<view class="label">入库单号：</view>
							<view class="value">{{ item.stockInOutBillNo }}</view>
						</view>
					</view>
					<view class="row border">
						<view class="col">
							<view class="label">供应商：</view>
							<view class="value">{{ item.supplierName }}</view>
						</view>
					</view>
					<view class="row">
						<view class="col">
							<view class="label">采购数量：</view>
							<view class="value">{{ item.purQuantity }}</view>
						</view>
						<view class="col">
							<view class="label">未入库：</view>
							<view class="value">{{ item.unStockInQty }}</view>
						</view>
					</view>
					<view class="row" style="justify-content: center;">
						<a href="#" @tap="bind(item)">绑定标签</a>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	// #ifdef APP-PLUS
	// #endif
	export default {
		data() {
			return {
				isReading: true,
				option: {}
			};
		},
		methods: {
			/* 绑定标签 */
			bind(item) {
				let data = {
					...item,
					materialName: this.option.materialName,
					materialCode: this.option.materialCode,
					spec: this.option.spec,
					unitName: this.option.unitName
				}
				this.$utils.open(`/pages/store-in-manage/artificial-paste/artificial-paste-scan?data=${this.$utils.object2Code(data)}`)
			}
		},
		onLoad(option) {
			this.option = this.$utils.code2Object(option.data)
		},
		onUnload() {
			// #ifdef APP-PLUS
			// #endif
		}
	}
</script>

<style lang="scss" scoped>
.container-wrap {
	overflow: hidden;
	.container {
		padding: 10rpx;
		height: calc(100vh - var(--status-bar-height) - 44px);
		overflow: auto;
		.info {
			padding: 10rpx 20rpx;
			font-size: 32rpx;
		}
		.title {
			text-align: center;
			font-size: 36rpx;
			font-weight: bold;
		}
		.sub-title {
			text-align: center;
		}
		.list {
			.item {
				padding: 20rpx;
				margin-bottom: 10rpx;
				background-color: #FFFFFF;
				border: 1rpx solid rgba(215, 215, 215, 1);
				border-radius: 10rpx;
				.row {
					&.border {
						padding-bottom: 20rpx;
						border-bottom: 1px solid rgba(215, 215, 215, 1);
					}
				}
			}
		}
	}
}
</style>
