<template>
	<view class="marginTop">
		<view v-for="(item, index) in list" class="kd-row" :key="item.id" @click="goDetail(item)" v-show="list.length !== 0">
			<!-- 进度组件 -->
			<view class="kd-col">
				<text class="title">{{ item.bizNo }}</text>
				<text>{{ sceneState.filter(ite => item.bizType == ite.value)[0].text }}</text>
			</view>
			<view class="kd-col">
				<text>{{ item.verifyName }}</text>
				<text>{{ item.createUserName }}</text>
			</view>
			<view class="kd-col">
				<text class="status" :class="statusList[item.verifyStatus] && statusList[item.verifyStatus].class">{{ statusList[item.verifyStatus] && statusList[item.verifyStatus].label }}</text>
				<text class="text-danger" style="width: 400rpx">入库时间 {{ item.storageTime }}</text>
			</view>
		</view>
		<view v-show="list.length === 0" class="no_data">
			<u-empty mode="data" textSize="22"></u-empty>
		</view>
	</view>
</template>

<script>
	import { sceneState } from '../../common'
	export default {
		props: {
			list: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {
				sceneState,
				statusList: {
					0: { class: '', label: '未提交' },
					1: { class: 'text-warning', label: '审核中' },
					2: { class: 'text-primary', label: '审核通过' },
					3: { class: 'text-danger', label: '已驳回' }
				}
			}
		},
		methods: {
			goDetail({ id }) {
				uni.navigateTo({
					url: `/pages/warehouse/enterHouse/details?&id=${id}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.marginTop {
		border-top: 20rpx solid $page-bg;

		.kd-row {
			font-size: 28rpx;
			padding: 14rpx 12rpx 6rpx;
			border-bottom: 1rpx solid $page-bg;
			.kd-col {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 2rpx;
				color: #aaaaaa;

				.status {
					background-color: $page-bg;
					display: inline-block;
					padding: 4rpx 10rpx;
					border-radius: 18rpx;
				}
			}
			.title {
				font-weight: bold;
				color: #333333;
			}
		}

		.center {
			text-align: center;
			margin-bottom: 10rpx;
			color: #999;
		}
		.no_data {
			position: fixed;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			color: #999;
			font-size: 28rpx;
		}
	}
</style>
