<template>
	<view class="content">
		<view class="main-box">
			<view class="main-item">
				<view class="main-font">
					扣款类型
				</view>
				<picker @change="bindPickerType" :range="typelist" class="input">
					<text>{{ type }}</text>
				</picker>
			</view>
			<view class="main-item">
				<view class="main-font">
					扣款人
				</view>
				<input class="input" type="text" v-model="name" placeholder="请填写姓名">
			</view>
			<view class="main-item">
				<view class="main-font">
					处罚日期
				</view>
				<view class="input">
					<view class="uni-list-cell">
						<picker mode="date" :value="date" @change="bindDateChange">
							<view class="uni-input">{{date}}</view>
						</picker>
					</view>
				</view>
			</view>
			<view class="main-item">
				<view class="main-font">
					扣款金额
				</view>
				<input class="input" type="text" v-model="money" placeholder="请填写金额">
			</view>
			<view class="main-item">
				<view class="main-font">
					是否征求员工意见
				</view>
				<picker class="input" @change="bindPickerSf" :range="array">
					<text>{{ sex }}</text>
				</picker>
			</view>
			<view class="info-box">
				<view class="info-title">
					处罚说明<text class="info-tip">(限XX字)</text>
				</view>
				<textarea class="info-box" placeholder="请填写处罚说明..." v-model="info" id="" cols="30" rows="10"></textarea>
			</view>
		</view>
		<view class="btn">
			确认添加
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name: '',
				money: '',
				type: '请选择扣款类型',
				typelist: ['迟到', '早退', '旷工'],
				date: '请选择日期',
				array: ['是', '否'],
				sex: '请选择是否',
				info: ''
			};
		},
		onLoad() {},
		onShow() {},
		onReachBottom() {},
		onReady() {},
		methods: {
			// 选择类型
			bindPickerType: function(e) {
				this.type = this.typelist[e.target.value];
			},
			bindDateChange: function(e) {
				this.date = e.detail.value;
				console.log(e);
			},
			bindPickerSf: function(e) {
				this.sex = this.array[e.target.value];
			},
		}
	};
</script>

<style lang="scss">
	page,
	.content {
		min-height: 100%;
		height: auto;
	}


	.main-box {
		margin-top: 20rpx;
		padding: 0 30rpx 20rpx;
		background: #ffffff;

		.main-item {
			padding: 35rpx 18rpx;
			border-bottom: 1px solid #f5f5f5;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.main-font {
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #222222;
			}

			.input {
				text-align: right;
				padding: 0 20rpx;
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #999999;
			}
		}
	}

	.info-box {
		margin-top: 20rpx;

		.info-title {
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #222222;

			.info-tip {
				font-size: 24rpx;
				color: #666666;
			}
		}

		.info-box {
			width: 100%;
			margin-top: 20rpx;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #999999;
		}
	}

	.btn {
		margin: 100rpx auto 0;
		width: 622rpx;
		height: 85rpx;
		background: #069CFA;
		border-radius: 15rpx;
		text-align: center;
		line-height: 85rpx;
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #FFFFFF;
	}
</style>