<template>
	<view class="material-box">
		<uni-card :title="materialInfo.patchCode" :is-full="true">
			<template v-slot:extra>
				<u-tag v-if="index===0" text="主箱" plain size="mini" type="error"></u-tag>
				<u-tag v-else text="次箱" plain size="mini" type="info"></u-tag>
			</template>
			<view class="package-card-body">
				<view class="package-card-describe">
					<view>零件号：{{ materialInfo.partNumner }}</view>
					<view>描述：{{ materialInfo.productionDescribe }}</view>
				</view>
				<view class="package-card-time">
					<view class="package-card-quantity">数量：{{ materialInfo.quantity }}</view>
					<view>生产日期</view>
					<view>{{ materialInfo.productionTime }}</view>
				</view>
			</view>
		</uni-card>

		<!-- 		<view class="title left">{{materialInfo.patchCode}}</view>
		<view class="title right">{{materialInfo.productionTime}}</view> -->
	</view>
</template>

<script>
	export default {
		name: "material-item",
		props: {
			index: {
				default: -1,
			},
			materialInfo: {
				default: {
					// 原始编码
					originalCode: "",
					// 批次号
					patchCode: "",
					// 班组
					team: "",
					// 零件号
					partNumner: "",
					// 工单号
					workoderID: "",
					// 数量
					quantity: 0,
					//生产时间
					productionTime: "",
					// 产品描述
					productionDescribe: ""
				}
			},
			data() {
				return {

				};
			}
		},
	}
</script>

<style scoped>
	.package-card-body {
		width: 100%;
		display: flex;
		flex-direction: row;
		align-items: center;
	}
	.package-card-describe {
		font-size: 16px;
		font-weight: 600;
		width: 70%;
		display: flex;
		flex-direction: column;
	}
	.package-card-quantity{
		margin-bottom: 10px;
	}
</style>