<template>
	<view class="groundtials-wrap">
		<!-- <qs-scanlistener @scan="scan"></qs-scanlistener> -->
		<view class="inventory-wrap">
			<view class="inner-item" v-for="(item,index) in listData" :key="index">
				<view class="inventory-item">
					<view class="shuo-item cont-item">
						<view class="shuo-label">
							名称:
						</view>
						<view class="shuo-cont">
							{{item.factory}}
						</view>
					</view>
				</view>
				<view class="inventory-item">
					<view class="shuo-item">
						<view class="shuo-label">
							规格:
						</view>
						<view class="shuo-cont">
							{{item.spec}}
						</view>
					</view>
				</view>
				<view class="inventory-item">
					<view class="shuo-item">
						<view class="shuo-label">
							型号:
						</view>
						<view class="shuo-cont">
							{{item.model}}
						</view>
					</view>
				</view>
				<view class="inventory-item">
					<view class="shuo-item">
						<view class="shuo-label">
							待上架数:
						</view>
						<view class="shuo-await">
							{{item.qty}}
						</view>
					</view>
					<view class="shuo-item">
						<view class="shuo-label">
							已上架数:
						</view>
						<view class="shuo-ready">
							{{item.yishangj}}
						</view>
					</view>
				</view>
			</view>
			<view class="inner-item detais-item" v-for="(item,index) in detailsData" :key="index">
				<view class="inventory-item ">
					<view class="shuo-item">
						<view class="shuo-label">
							S&nbsp;N&nbsp;码:
						</view>
						<view class="shuo-cont">
							{{item.id_lot}}
						</view>
					</view>
					<view class="shuo-item">
						<view class="shuo-label">
							RFID码:
						</view>
						<view class="shuo-cont">
							{{item.rfcode}}
						</view>
					</view>
				</view>
				<view class="inventory-item">
					<view class="shuo-item">
						<view class="shuo-label">
							批次:
						</view>
						<view class="shuo-cont">
							{{item.lot}}
						</view>
					</view>
					<view class="shuo-item">
						<view class="shuo-label">
							包装单位:
						</view>
						<view class="shuo-cont">
							{{item.unit}}
						</view>
					</view>
				</view>
				<view class="inventory-item">
					<view class="shuo-item">
						<view class="shuo-label">
							有效期至:
						</view>
						<view class="shuo-cont">
							{{item.date_expire}}
						</view>
					</view>
				</view>

				<view class="ready-text">
					{{item.zt}}
				</view>
				<view class="index-text">
					{{index+1}}
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		listData,
		pinData
	} from './list.js';
	import {
		mapState,
		mapMutations,
		mapActions
	} from 'vuex';
	export default {
		data() {
			return {
				data: [{
					code: "KMT20231126",
					hispName: "国药山西长治有限公司",
					snub: 200,
					danjuTime: "2023-11-26  14:05:08",
					daohuoTime: "2023-11-26  14:05:08"
				}],
				codeVal: "",
				listData: [],
				pinData: pinData
			}
		},
		computed: {
			...mapState(['detailsData'])
		},
		mounted() {
			let data = uni.getStorageSync('detailsCont');
			this.listData = data;
			this.getdetilsCont({id_material:data[0].id_material})
		},
		onLoad() {
              
		},
		methods: {
			...mapActions(['getdetilsCont']),
			queryList(pageNo, pageSize) {
				this.$refs.paging.complete(this.data);
			},
			//跳转上架详情	 
			itemDetails(item) {
				uni.navigateTo({
					url: '/pages/groundetials/groundetials',
					success: function(res) {}
				});
			},
			scan(code) {
				this.codeVal = code;

			}
		}

	}
</script>

<style lang="scss" scoped>
	.groundtials-wrap {
		width: 100%;
		height: 100%;
		padding: 20rpx;
		box-sizing: border-box;
		background-color: #F1F1F1;

		.inventory-wrap {
			width: 100%;
			border: 2rpx solid #BDBDBD;
			margin-top: 10rpx;
			border-radius: 20rpx;

			.inner-item {
				width: 100%;
				height: 260rpx;
				border-bottom: 2rpx solid #BDBDBD;
				padding: 20rpx 20rpx 20rpx 55rpx;
				box-sizing: border-box;
				position: relative;
				background-color: #fff;
				border-radius: 20rpx;
				position: relative;

				.all-text {
					width: 150rpx;
					height: 40rpx;
					position: absolute;
					right: 20rpx;
					bottom: 25rpx;
					font-family: PingFangSC-regular;
					font-size: 28rpx;
					color: rgba(52, 124, 175, 0.6);
				}

				.inventory-item {
					width: 100%;
					height: 40rpx;
					color: rgba(16, 16, 16, 1);
					font-size: 28rpx;
					text-align: left;
					font-family: PingFangSC-semiBold;
					margin-top: 10rpx;
					display: flex;
					align-items: center;

					.shuo-label {
						color: rgba(16, 16, 16, 1);
						font-size: 28rpx;
						text-align: left;
						font-family: PingFangSC-regular;
					}

					.shuo-cont {
						color: rgba(16, 16, 16, 1);
						font-size: 20rpx;
						text-align: left;
						font-family: PingFangSC-regular;
						margin-left: 10rpx;
					}

					.shuo-item {
						width: 50%;
						height: 100%;
						line-height: 20rpx;
						display: flex;
						align-items: center;

						.shuo-label {
							color: rgba(16, 16, 16, 1);
							font-size: 28rpx;
							text-align: left;
							font-family: PingFangSC-regular;
						}

						.shuo-cont {
							color: rgba(16, 16, 16, 1);
							font-size: 28rpx;
							text-align: left;
							font-family: PingFangSC-regular;
						}

						.shuo-await {
							color: rgba(255, 191, 107, 1);
							font-size: 28rpx;
							text-align: left;
							font-family: PingFangSC-regular;
							margin-left: 20rpx;
						}

						.shuo-ready {
							color: rgba(162, 239, 77, 1);
							font-size: 28rpx;
							text-align: left;
							font-family: PingFangSC-regular;
							margin-left: 20rpx;
						}
					}
					.cont-item{
						 width:100%;
					}
				}
			}

			.detais-item {
				height: 200rpx !important;
				position: relative;
				z-index: 10;
				overflow: hidden;
				margin-top: 10rpx;

				.ready-text {
					z-index: 1;
					position: absolute;
					right: -40rpx;
					top: 20rpx;
					width: 150rpx;
					height: 30rpx;
					color: #fff;
					background-color: #3789EA;
					text-align: center;
					line-height: 30rpx;
					font-size: 20rpx;
					font-family: PingFangSC-regular;
					transform: rotate(45deg);

				}

				.index-text {
					z-index: 1;
					width: 40rpx;
					height: 20rpx;
					position: absolute;
					left: 10rpx;
					top: 50%;
					margin-top: -10rpx;
					text-align: center;
					line-height: 20rpx;
					font-size: 30rpx;
					font-family: PingFangSC-regular;
				}
			}
		}
	}
</style>