<template>
	<view>
		<view class="card-header">
			<view class="content-combined">
				<text>{{item.matCode}}</text>
				<text>{{currentIndex + 1}}/{{cardData.length}}</text>
			</view>
		</view>
		<view class="card-content">
			<view class="content-item">
				<text>名称:</text>
				<text>{{item.matName}}</text>
			</view>
			<view class="content-item">
				<text>批次:</text>
				<text>{{item.matBatch}}</text>
			</view>
			<view class="content-item">
				<text>规格:</text>
				<text>{{item.matSpec}}</text>
			</view>
			<view class="content-item" style="font-weight: 600;">
				<text>数量:</text>
				<text>{{item.matQty}}</text>
			</view>
			<view class="content-item" style="font-weight: 600;">
				<text>盘点数量:</text>
				<text v-if="item.stocktakingQty !== -1">{{ item.stocktakingQty }}</text>
				<text v-else>未盘点</text>
			</view>
			<view class="content-combined">
				<view class="content-item" style="font-weight: 600;color: firebrick;">
					<text>库位:</text>
					<text>{{item.locationCode}}</text>
				</view>
				<view class="content-item" style="font-weight: 600;color: firebrick;">
					<text>货架:</text>
					<text>{{item.shelfCode}}</text>
				</view>
			</view>
			<view class="content-combined">
				<view class="content-item" style="font-weight: 600;color: violet;">
					<text>人员:</text>
					<text>{{item.modifyUser}}</text>
				</view>
				<view class="content-time">
					<text>绑定时间:</text>
					<text>{{item.modifyTime}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';


	const props = defineProps({
		item: {
			type: Object,
			required: true
		},
		currentIndex: {
			type: Number,
			required: true
		},
		cardData: {
			type: Array,
			required: true
		}
	});
</script>

<style scoped>
	.card-header {
		font-size: 40rpx;
		font-weight: bold;
		margin-bottom: 2rpx;
		text-align: center;
	}

	.content-item {
		margin-bottom: 5rpx;
		font-size: 30rpx;
	}

	.content-time {
		margin-bottom: 0rpx;
		font-size: 18rpx;
		display: flex;
		align-items: center;
	}

	.content-combined {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 5rpx;
	}

	.center-element {
		align-items: center;
	}

	.right-element {
		margin-left: auto;
	}
</style>