<template>
	<view>
		<u-navbar title="职位管理"></u-navbar>
		
		<view class="jp-tab">
			<view class="jp-quantity">
				<p>数量</p><span>{{list[current].recordsTotal}}</span>
			</view>
			<u-tabs :list="list" :current="current" @change="change"></u-tabs>
		</view>
		<view class="jp-work">
			<view class="jp-work-list">
				<view class="jp-work-item" v-for="(item ,index) in list[current].list" :key="index" 
				 @click="gotoUrl('pages/hr/index/recruitInfo/recruitInfo?id='+item.recruitmentId)">
					<view class="jp-work-name">
						<h3>{{item.title}}</h3>
						<span>{{list[current].name}}</span>
					</view>
					<view class="jp-work-line">
						<span>{{item.position_name}}</span>
						<u-line color="#ccc" length="20" direction="col" margin="0 20rpx"/>
						<span>{{item.workYear}}</span>
						<u-line color="#ccc" length="20" direction="col" margin="0 20rpx"/>
						<span>{{item.educationName}}</span>
						<u-line color="#ccc" length="20" direction="col" margin="0 20rpx"/>
						<span>{{item.wageTypeName}}</span>
					</view>
					<view class="jp-work-info">
						<p>{{item.updateTime}}</p>
						<u-button size="mini" type="error" v-if="current!=1&&item.status==1" :custom-style="customStyle" plain @click="publish(0,item.recruitmentId)">下架</u-button>
						<u-button size="mini" type="primary"   v-if="current!=1&&item.status==0":custom-style="customStyle" plain @click="publish(1,item.recruitmentId)">上架</u-button>
						<u-button size="mini" style="margin:0;"  v-if="current==1" :disabled="true">上架</u-button>
						
					</view>
				</view>	
			</view>
			
			<u-loadmore @loadmore="myLoadmore" :status="list[current].list.length<list[current].recordsTotal?'loadmore':'nomore'" ></u-loadmore>
			
		</view>
	</view>
</template>

<script>
	import api from './index.js'
	export default api;
</script>

<style>
	page{
		background-color: #F7F7F7;
	}
</style>
<style scoped lang="scss">
	.jp-quantity{
		background-color: #fff;
		height: 80rpx;
		display: flex;
		align-items: center;
		font-size: 32rpx;
		padding-left: 30rpx;
		margin-top: 20rpx;
		border-bottom: 1px solid #f7f7f7;
		p{
			color:#666;
		}
		span{
			color:#1A91EA;
			margin-left: 10rpx;
		}
	}
	.jp-search{
		background-color: #fff;
		padding: 20rpx;
	}
	.jp-work-item{
		padding:30rpx;
		background-color: #fff;
		margin: 20rpx 0;
		&:last-child{
			border-bottom:none;
		}
		.jp-work-name{
			display: flex;
			justify-content: space-between;
			align-items: center;
			h3{
				font-size: 36rpx;
			}
			span{
				font-size: 32rpx;
				color:#1677FF
			}
		}
		.jp-work-tag{
			display: flex;
			align-items: center;
			margin-top: 10rpx;
			*{
				margin-right: 10rpx;
			}
		}
		.jp-work-info{
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 10rpx;
			
			p{
				color:#999;
				font-size: 24rpx;
			}
		}
	}
	.jp-work-line{
		display: flex;
		align-items: center;
		margin-top:10rpx;
	}
</style>
