<template>
	<view class="form_warp">
		<view class="form_intro">
			<view>如有填报问题，请咨询公共服务中心</view>
			<view>中心值班电话：<text class="tel">66007587</text></view>
		</view>
		<view class="form_item_box">
			<view class="form_item_title">基本信息</view>
			<view class="form_item">
				<view class="form_item_label">管理单位名称：</view>
				<view class="form_item_input select">
					{{form.organizationName}}
				</view>
			</view>
			<view class="form_item">
				<view class="form_item_label">统计日期：</view>
				<view class="form_item_input select">
					{{form.statDate}}
				</view>
			</view>
			<view class="form_item">
				<view class="form_item_label">统计时段：</view>
				<view class="form_item_input select">
					{{form.statPeriod}}
				</view>
			</view>
		</view>
		<!-- 用户权限收费站 -->
		<view class="station_box">
			<view class="station_item">夏庄收费站</view>
			<view class="station_item">夏庄收费站</view>
			<view class="station_item">夏庄收费站</view>
			<view class="station_item">夏庄收费站</view>
			<view class="station_item">夏庄收费站</view>
		</view>
		<view class="form_item_box">
			<view class="form_item">
				<view class="form_item_label">高速公路名称：</view>
				<view class="form_item_input select"></view>
			</view>
			<view class="form_item">
				<view class="form_item_label">收费站入口车辆数：</view>
				<view class="form_item_input">
					<uni-easyinput class="form_input" placeholder="请输入车辆数" type="number" maxlength="30" ></uni-easyinput>
				</view>
			</view>
			<view class="form_item">
				<view class="form_item_label">收费站出口车辆数：</view>
				<view class="form_item_input">
					<uni-easyinput class="form_input" placeholder="请输入车辆数" type="number" maxlength="30" ></uni-easyinput>
				</view>
			</view>
			<view class="form_item">
				<view class="form_item_label">免收通行费车辆数：</view>
				<view class="form_item_input">
					<uni-easyinput class="form_input" placeholder="请输入车辆数" type="number" maxlength="30" ></uni-easyinput>
				</view>
			</view>
			<view class="form_item">
				<view class="form_item_label">免收通行费金额：</view>
				<view class="form_item_input">
					<uni-easyinput class="form_input" placeholder="请输入金额" type="number" maxlength="30" ></uni-easyinput>
				</view>
			</view>
			<view class="form_item">
				<view class="form_item_label">报送人员及联系方式：</view>
				<view class="form_item_input select">
					{{}}
				</view>
			</view>
			<view class="divider_line"></view>
		</view>
		<!-- 底部按钮 -->
		<view class="foot_btn">
			<view class="act_btn">取消</view>
			<view class="act_btn blue">确认</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				form: {
					organizationName: '',
					statDate: '',
					statPeriod: '',
					highwaySubDataList: [{
						"entranceVehicleCount": 0,
						"entranceVehicleCountMom": 0.0,
						"entranceVehicleCountYoy": 0.0,
						"exitToll": 0.0,
						"exitVehicleCount": 0,
						"exitVehicleCountMom": 0.0,
						"exitVehicleCountYoy": 0.0,
						"highwayId": "string",
						"highwayName": "string",
						"id": "string",
						"parentId": "string",
						"submitPersonnelContact": "string",
						"tollExemptAmount": 0.0,
						"tollExemptVehicleCount": 0,
						"tollExemptVehicleCountMom": 0.0,
						"tollExemptVehicleCountYoy": 0.0,
						"tollStationName": "string"
					}]
				}, //登录form
				codeImg: '', //图形验证码
			}
		},
		onLoad(options) {
			if(options.type == 'add'){
				
			}else if(options.item) {
				this.form = JSON.parse(options.item)
			}
		},
		methods: {
			//获取图形验证码
			getVerCode() {
				this.$request1(getApp().globalData.baseUrl + '/api/common/captchaBase64?type=5&_t=' + new Date(), {}, 'GET')
					.then(res => {
						if (res.code == 200) {
							this.codeImg = res.data.img;
						}
					}).catch(() => {
						console.log('vercode err')
					})
			},
			//登录
			doLogin() {
				if (this.form.username == '' || this.form.password == '') {
					uni.showToast({
						title: '用户名密码不能为空',
						icon: 'none'
					})
					return;
				} else if (this.form.verCode == '') {
					uni.showToast({
						title: '验证码不能为空',
						icon: 'none'
					})
					return;
				}
				uni.showLoading({
					title: '登录中...',
					mask: true
				})
				this.$request1(getApp().globalData.baseUrl + '/api/login/auth', this.form, 'POST').then(res => {
					uni.hideLoading();
					if (res.code == 200) {
						uni.setStorageSync('satoken', res.data.satoken);
					}
				}).catch(() => {
					uni.hideLoading();
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.form_warp {
		padding: 30rpx 30rpx 195rpx;

		.form_intro {
			color: #666;
			font-size: 26rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			line-height: 48rpx;
			text-align: center;

			.tel {
				color: #2D8CF0;
				font-weight: bold;
			}
		}

		.form_item_box {
			padding: 30rpx 20rpx 0 30rpx;
			background-color: #fff;
			border-radius: 30rpx;

			.form_item_title {
				color: #333;
				line-height: 42rpx;
				font-size: 30rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: bold;
				margin-bottom: 30rpx;
			}

			.form_item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				line-height: 37rpx;
				font-family: PingFang SC-Regular, PingFang SC;
				font-weight: 400;
				margin-bottom: 30rpx;
				.form_item_label{
					width: 240rpx;
					color: #666666;
					font-size: 26rpx;
					word-break: break-all;
				}
				.form_item_input{
					color: #333;
					text-align: right;
					word-break: break-all;
				}
			}
		}
	}
	//收费站
	.station_box{
		display: flex;
		flex-wrap: wrap;
		.station_item{
			height: 60rpx;
			color: #666666;
			line-height: 60rpx;
			font-size: 26rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			border-radius: 20rpx;
			border: 1rpx solid #C1C1C1;
			padding:0 20rpx;
			&.active{
				position: relative;
				color: #1ECE5F;
				border-color: #1ECE5F;
				background: #EBFAF2;
				.tag{
					position: absolute;
					top: 0;
					right: 0;
					width: 34rpx;
					height: 23rpx;
					background: #1ECE5F;
					border-radius: 0rpx 20rpx 0rpx 5rpx;
					text-align: center;
				}
			}
		}
	}
	.foot_btn {
		position: fixed;
		left: 30rpx;
		right: 30rpx;
		bottom: 0;
		display: flex;
		justify-content: space-between;
		padding: 40rpx 0;

		.act_btn {
			width: 329rpx;
			height: 90rpx;
			color: #666666;
			font-size: 28rpx;
			line-height: 90rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			text-align: center;
			background: #F6F6F6;
			border-radius: 100rpx;
			border: 1rpx solid #C1C1C1;

			&.blue {
				color: #fff;
				background: #2D8CF0;
				border-color: #2D8CF0;
			}
		}
	}

	button {
		background-color: #007aff;
		color: #ffffff;
	}
</style>