<template>
	<view class="task-page">
		<div class="head">
			<uni-segmented-control 
			:current="current" 
			:values="items" @clickItem="onClickItem" 
			activeColor="#007aff">	
			</uni-segmented-control>			
		</div>
		<view class="content">
			<view v-show="current === 0">
				<review-form ref="review-form" @success="getWorkflow"></review-form>
			</view>
			<view v-show="current === 1">
				<review-history ref="review-history"></review-history>
			</view>
		</view>
	</view>
</template>

<script>
import reviewForm from './form/form.vue'
import reviewHistory from './history/index.vue'
	export default {
		data() {
			return {
				items: ['基本信息', '历史记录'],
				current: 0
			}
		},
		components:{
			reviewForm,
			reviewHistory
		},
		onLoad() {

		},
		methods: {
			onClickItem(e) {
			  if (this.current != e.currentIndex) {
				this.current = e.currentIndex;
			  }
			},
			getWorkflow(data){
				if(data&&data.activityInsRecordList){
					this.$refs['review-history'].loadData(data.activityInsRecordList)
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
.task-page{
	padding:20rpx;
	position: relative;
	.head{
		position: fixed;
		z-index: 999;
		width: 710rpx;
		left: 10px;
		top: var(--window-top);
		background-color: #fff;
		box-sizing: border-box;
		padding-top: 5px;
	}
	.content{
		margin-top:36px;	
	}
}
</style>
