<template>
	<div>
		<form class="mui-input-group">
			<div class="mui-input-row">
				<label>调班日期</label>
				<span>{{adjustShiftDetail.adjustDate}}</span>
			</div>
			<div class="mui-input-row">
				<label>原班次</label>
				<span>{{adjustShiftDetail.oldShift}}</span>
			</div>
			<div class="mui-input-row">
				<label>调整为</label>
				<span>{{adjustShiftDetail.newShift}}</span>
			</div>
			<div class="mui-input-row">
				<label>备注</label>
				<span>{{adjustShiftDetail.remark}}</span>
			</div>
			<div class="mui-input-row">
				<label>申请时间</label>
				<span>{{adjustShiftDetail.createTime}}</span>
			</div>
		</form>
	</div>
</template>


<script>
	import * as API from '@/apis-xsy/applyclass'
	import * as API_sp from '@/apis-xsy/xsy'
import ExamineDetail from '$project/components/ExamineDetail.vue'

	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: '',
		components: {
			Common,
			Loading,
			TopHeader,ExamineDetail
		},
		data() {
			return {
				pageTitle: '申请调班详情',

				isLoading: false,
				id: '',
				adjustShiftDetail: {},
				examineDetail: {},
				only: "test"

			}
		},
		created() {
			this.id = this.$route.query.id;
		},
		methods: {
			allowExamine(op){
				this.$emit('allowExamine',op);
				
			},
			getClass(ac, i) {
				var reclass = ""
				
				if (ac.action == "0") {
					if (this.only == "test") {

						this.only = i;
					}
					if (this.only == i) {
						return "color3385FF"
					} else {
						return "mui-hidden"
					}

				}

				if (ac.action == "3" || ac.action == "2") {
					return "colorfe616c"
				}

				if (ac.action == "1" || ac.action == "4") {
					return "color389E0D"
				}
				return reclass
			},
		 
			getAdjustShiftDetail() {
				this.isLoading = true;

				API.adjustShiftDetail(this.id).then(response => {
					this.adjustShiftDetail = response;
					this.adjustShiftDetail.sp=true;
					this.isLoading = false;
					
					if(this.adjustShiftDetail.status==4){
						this.adjustShiftDetail.text="安排调班"
					}else{
						this.adjustShiftDetail.text="申请调班"
					}
					 this.$emit('getInfo',this.adjustShiftDetail);
					
				}).catch(error => {
					this.isLoading = false;
					mui.toast(error);
				})
			},
			asynCallBack() {

			},
			update() {
				this.adjustShiftDetail.sp=false;
				this.getAdjustShiftDetail();
			 
			}
		},
		mounted() {
			this.getAdjustShiftDetail();
			
		},
		destroyed() {},

	}
</script>

<style src="$project/assets/css/iconfont.css"></style>
<style scoped src="$project/assets/css/xpwyfyy.css"></style>
<style src="$project/assets/css/xsy.css"></style>
<style scoped>
	.color3385FF {
		color: #3385FF
	}

	.color389E0D {
		color: #389E0D
	}
</style>
