<!-- 到货质检 -->
<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="list">
				<view class="item" v-for="(item, index) in data" :key="index">
					<view class="row">
						<view class="col">
							<view class="label">合同号：</view>
							<view class="value">{{ item.purchaseBillNo }}</view>
						</view>
					</view>
					<view class="row">
						<view class="col">
							<view class="label">批次号：</view>
							<view class="value">{{ item.batchNo }}</view>
						</view>
					</view>
					<view class="row">
						<view class="col">
							<view class="label">供应商：</view>
							<view class="value">{{ item.supplier }}</view>
						</view>
					</view>
					<view class="row">
						<view class="col">
							<view class="label">物料名称：</view>
							<view class="value">{{ item.materialName }}</view>
						</view>
					</view>
					<view class="row">
						<view class="col">
							<view class="label">物料规格：</view>
							<view class="value">{{ item.spec }}</view>
						</view>
					</view>
					<view class="row border">
						<view class="col">
							<view class="label">到货时间：</view>
							<view class="value">{{ item.arriveTime }}</view>
						</view>
					</view>
					<view class="row">
						<view class="col">
							<view class="label">申购数量：</view>
							<view class="value">{{ item.purchaseCount }}</view>
						</view>
						<view class="col">
							<view class="label">到货数量：</view>
							<view class="value">{{ item.inStockQty }}</view>
						</view>
					</view>
					<view class="row" style="justify-content: center;">
						<a href="#" @tap="toDetail(item)">开始质检</a>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	// #ifdef APP-PLUS
	// #endif
	export default {
		data() {
			return {
				isReading: false,
				data: []
			};
		},
		methods: {
			/* 跳转详情 */
			toDetail(data) {
				this.$utils.open(`/pages/store-in-manage/quality/quality-detail?data=${this.$utils.object2Code(data)}`)
			},
			getList() {
				this.$http.GetStockCheckList().then(res => {
					console.log(res)
					if(res.code === 0) {
						this.data = res.result
					}
				})
			}
		},
		onShow() {
			this.getList()
		},
		onUnload() {
		}
	}
</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;
		}
		.list {
			.item {
				padding: 20rpx;
				margin-bottom: 10rpx;
				background-color: #FFFFFF;
				border: 1rpx solid rgba(215, 215, 215, 1);
				border-radius: 10rpx;
				.row {
					&.border {
						border-bottom: 1px solid rgba(215, 215, 215, 1);
					}
				}
			}
		}
	}
}
</style>
