<template>
	<div class="content-main">
		<h1 class="content-title">轮换入库情况登统表</h1>
		<el-form :model="dform" ref="dform" label-position="right" label-width="12em">
			<el-col :span="12"
				><el-form-item
					><label slot="label">仓<i class="space"></i>号:</label></el-form-item
				></el-col
			>
			<el-col :span="12"
				><el-form-item
					><label slot="label">品<i class="space"></i>名:</label></el-form-item
				></el-col
			>
			<el-col :span="12"
				><el-form-item><label slot="label">生产年度:</label></el-form-item></el-col
			>
			<el-col :span="12"
				><el-form-item><label slot="label">储存方式:</label></el-form-item></el-col
			>
		</el-form>
		<el-table :data="dtable" border>
			<el-table-column label="序号" type="index" align="center" width="70"></el-table-column>
			<el-table-column label="车号" prop="index" align="center" show-overflow-tooltip></el-table-column>
			<el-table-column label="入库日期" prop="index" align="center"></el-table-column>
			<el-table-column label="入库数量" prop="index" align="center"></el-table-column>
			<el-table-column label="等级" prop="index" align="center"></el-table-column>
			<el-table-column align="center" :label="item" v-for="(item, index) in qtypes[type]" :key="index">
				<template slot-scope="scope">
					{{ scope.row[qnames(item)] }}
				</template></el-table-column
			>
		</el-table>
		<footer>
			<el-button type="primary" class="iconfont iconfanhui" @click="$router.push('index')">返回</el-button>
		</footer>
	</div>
</template>
<script>
import { qtypes, getType, qnames } from '@/utils/quality'

export default {
	data() {
		return {
			type: '',
			qtypes: qtypes,
			dform: { pzmc: '粳稻谷' },
			dtable: [],
		}
	},
	created() {
		this.handleType(this.dform.pzmc)
	},
	methods: {
		qnames(val) {
			return qnames(val)
		},
		handleType(pzmc) {
			this.type = getType(pzmc)
		},
	},
}
</script>
<style lang="scss" scoped>
.content-title {
	font-size: 20px;
	text-align: center;
}
.space {
	margin: 0 1em;
}
footer {
	margin: 20px;
	text-align: center;
}
</style>
