<template>
	<div>
		
		<div class="mui-content vongi-wordcard">
			 

			<div class="mui-content-padded vongi-wordcard-center">
				<ul class="mui-table-view">
					 
					 
					<li class="mui-table-view-cell mui-media">
						<div class="mui-media-body">申请班次</div>
						<span class="colorf6f448" v-text="detail.attendanceDate"></span>
					</li>
				 
					<li class="mui-table-view-cell mui-media">
						<div class="mui-media-body">申请时间</div>
						<span v-text="detail.createTime"></span>
					</li>
					<li class="mui-table-view-cell mui-media">
						<div class="mui-media-body">申请理由</div>
						<span class="colorf8b155" v-text="detail.reason"></span>
					</li>
					<li class="mui-table-view-cell mui-media">
						<div class="mui-media-body">相关照片</div>
					</li>
					<li class="mui-table-view-cell mui-media fyy-upphoto">
						<div class="mui-col-xs-3" v-for="(item,index) in picList">
							<img :src="item" v-viewer />
						</div>
					</li>

				</ul>
			</div>
            
			
			<!-- <div v-if="detail.status && detail.status=='2' && detail.personId==person_data.id" class="fyy-scon-botton">
				<div class="examine-btn examine-btn1-blue" @click="resetApply">重新申请</div>
			</div> -->

			<!-- <div v-if="can_remark" class="fyy-scon-botton">
				<div class="examine-btn examine-btn1-blue" @click="openFromVisible=true">填写意见</div>
			</div> -->
		</div>

	 
 		

 	</div>
</template>

<script>
	import * as API_Attendance from '@/apis/Master/annual'
	import Common from '$project/components/Common.vue'
	import Loading from '$project/components/Loading.vue'
	import TopHeader from '$project/components/TopHeader.vue'
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	export default {
		name: 'MasterAnnualInfo',
		components: {
			Common,
			Loading,
			TopHeader
		},
		data() {
			return {
				pageTitle: '打卡详情',

				isLoading: false,

				subForm: {
					id: this.$route.query.id
				},
				detail: {},

				can_remark: this.$route.query.remark,
				remarkForm: {
					id: this.$route.query.id,
					remark: ''
				},
				openFromVisible: false
			}
		},
		created() {

		},
		methods: {
			//重新申请
			resetApply(){
				this.$router.push({
					name: 'MasterAnnualApply',
					query: {
						id: this.$route.query.applyId
					}
				})
			},
            //获取状态颜色
            getColor(status) {
                var color = '';
                if (status == '0') {
                    color = '#4fc5f7';
                } else if (status == '1') {
                    color = '#55f868';
                } else if (status == '2') {
                    color = '#fe616c';
                }
                return 'color:' + color + ';border-color:' + color + ';';
            },
			//获取详情
			getDetail() {
				this.isLoading = true;
				API_Attendance.supplementWorkDetail(this.subForm).then(response => {

					this.detail = response;

					this.remarkForm.remark = response.remark;
					this.detail.text="补卡申请"
					this.$emit('getInfo',this.detail);
					this.isLoading = false;
				}).catch(error => {
					this.isLoading = false;
					mui.toast(error);
				})
			},
			//领导添加备注
			addRemark() {
				if (!this.remarkForm.remark) {
					mui.toast('请填写意见');
				} else {
					this.isLoading = true;
					API_Attendance.addRemark(this.remarkForm).then(response => {
						this.isLoading = false;

						this.openFromVisible = false;
						mui.toast('提交成功');
						this.getDetail();
					}).catch(error => {
						this.isLoading = false;
						mui.toast(error);
					})
				}
			},
			asynCallBack() {

			},
		},
		mounted() {
			//获取详情
			this.getDetail();
		},
		destroyed() {},
		computed: {
			picList: {
				// getter
				get: function() {
					if (this.detail && this.detail.imageUrl) {
						return this.detail.imageUrl.split(',');
					} else {
						return [];
					}
				},
				// setter
				set: function(newValue) {
					console.log(newValue)
				}
			},
			...mapGetters({
				openId: 'wx_openid',
				token: 'token',
				person_data: 'person_data',
			})
		}
	}
</script>

<style scoped src="$project/assets/css/xpwyfyy.css"></style>
<style src="$project/assets/css/iconfont.css"></style>
<style scoped>
	.status_r {
		color: #fe616c !important;
		border: 1px solid #fe616c !important;
	}

	.status_a {
		color: #05c8af !important;
		border: 1px solid #05c8af !important;
	}

	.examine-btn1-blue {
		background-color: #3385FF;
	}
</style>
