<template>
	<div class="card" @tap='goDetail' v-if="item" :class="{ 'conten-border': item.SORTNUM == 0 }">
		<div class="uni-flex plr32" style="justify-content: space-between;">
			<p class="contentName" :class="{ 'is-urgent': item.URGENCY_DEGREE == 1 }">
				{{ item.LEAVE_PERSON + "【" + item.DEPARTMENT_NAME + "】" }}</p>
			<text class="typeText" :class="item.FINANCEPROINST_NEXTID == '9000' ? 'typeText-color' : ''">{{ item.SORTNUM == 0
				? '待我处理' : proStatus[item.FINANCEPROINST_NEXTID] }}</text>
		</div>
		<view class="title-ico ">
			<!-- <image src="../../../static/images/leave/qj.png" mode="aspectFit"></image> -->
			<image src="http://saas.eshangtech.com/ShopICO/ahyd-BID/leave/qj.png" mode="aspectFit"></image>
		</view>
		<view class="uni-flex plr32 leave-type" style="">
			<!-- <text class="text-gray fs26">请假类型：</text> -->
			<text>{{ item.LEAVE_VALUE }}</text>
		</view>
		<!-- <view class="uni-flex" style="align-items: center;margin-top: 4upx;">
		
			<text class="text-gray fs26">请假天数：</text>
			<text class=" fs26">{{item.DURATION_DAYS}}天</text>
			
		</view> -->
		<view class="uni-flex card-bom " style="align-items: center;margin-top: 4upx;">
			<text class="text-gray">起止时间：</text>
			<text>{{ $util.cutDate(item.LEAVE_STARTDATE, 'YYYY.MM.DD') + ' -
			'+$util.cutDate(item.LEAVE_ENDDATE,'YYYY.MM.DD')}}</text>
			<text class="ml24">{{ item.DURATION_DAYS }}天</text>
		</view>
	</div>
</template>

<script>
export default {
	props: {
		item: {
			type: Object,
			required: true
		},
		i: {
			type: Number,
			required: true
		}
	},
	data() {
		return {
			proStatus: {
				1000: '制单中',
				2000: '办理中',
				3000: '已驳回',
				4000: '已移交',
				9000: '已完成'
			}
		}
	},
	computed: {
		// getStatus () {
		// 	let _this = this
		// 	if (_this.item) {
		// 		let item = _this.item
		// 		_this.item.SERVERPART_NAME = item.SERVERPART_NAME+" "+item.HIGHWAYPROINST_DESC.split('【')[0]
		// 		_this.item.STAFF_NAME = item.STAFF_NAME
		// 		_this.item.HIGHWAYPROINST_CREATEDATE = _this.dateEmpty(_this.item.HIGHWAYPROINST_CREATEDATE)
		// 		if(item.SORTNUM === 0){
		// 			return '待我处理'
		// 		}else{
		// 			return _this.proStatus[_this.item.HIGHWAYPROINST_NEXTID]
		// 		}
		// 	}

		// }
	},
	methods: {
		goDetail() {
			this.$emit('goDetail', this.item)
		},
		dateEmpty(v) {
			return this.$util.cutDate(v, 'YYYY/MM/DD')
		}
	}
}
</script>

<style scoped>
@import url('../../../common/css/listUnit.css');

.text-gray {
	color: #74838E;
}

.plr32 {
	padding-left: 32upx;
	padding-right: 32upx;
}

.leave-type {
	align-items: center;
	margin-top: 28upx;
	margin-bottom: 16upx;
	justify-content: center;
	font-size: 32upx;

}

.contentName {
	margin-left: 56upx;
}

.ml24 {
	margin-left: 24upx;
}

.title-ico {
	position: absolute;
	top: 31upx;
	left: 30upx;
}

.title-ico image {
	height: 45upx;
	width: 45upx;
}

.is-urgent:after {
	content: '紧急';
	padding: 0upx 16upx;
	border: 1upx solid #E5A06E;
	color: #E5A06E;
	font-size: 22rpx;
	/* margin-left: 16upx; */
	border-radius: 24upx;
}

.card {
	box-shadow: none;
	border-radius: 18upx;
	padding: 28upx 0 0 0;
	overflow: hidden;
}

.conten-border {
	box-shadow: 0 0px 6upx #f9b297;
}

.typeText-color {
	color: #62C194;
}

.card-bom {
	background-color: #fdfdfd;
	padding: 16upx 32upx 16upx 32upx;
	font-size: 26upx;

}
</style>
