<template>
	<div>
		<el-descriptions title="产品互斥" :column="1" border>
			<el-descriptions-item label="产品名称">{{ detailInfo.productName }}</el-descriptions-item>
			<el-descriptions-item label="订购互斥">{{ detailInfo.productRule == '1' ? detailInfo.orderHuchiToName :
				detailInfo.relaUnsubToName }}</el-descriptions-item>
			<el-descriptions-item label="规则类型">{{ detailInfo.productRule == '1' ? '订购互斥' : '关联退订' }}</el-descriptions-item>
			<el-descriptions-item label="创建时间">{{ detailInfo.createTime | dateTime }}</el-descriptions-item>
			<el-descriptions-item label="状态">
				<el-tag v-if="detailInfo.status == 0" size="small">生效</el-tag>
				<el-tag v-if="detailInfo.status == 1" type="danger" size="small">失效</el-tag>
			</el-descriptions-item>

		</el-descriptions>
	</div>
</template>

<script>
export default {
	props: {
		detailInfo: Object
	},
	filters: {
		dateTime (val) {
			let date = new Date(val)
			let y = date.getFullYear()
			let m = date.getMonth();
			let mm = m < 10 ? '0' + m : m
			let d = date.getDate()
			let dd = d < 10 ? '0' + d : d
			let h = date.getHours()
			let M = date.getMinutes()
			let s = date.getSeconds()
			return `${y}-${mm}-${dd}  ${h}:${M}:${s}`
		}
	}

}
</script>

<style></style>