<template>
	<view class="container">
		<view class="form-box">
			<view class="item">
				<view class="label">房屋地址</view>
				<view class="input">
					<u-input height="102" @click="addressShow = true" type="text" disabled input-align="right" v-model="form.houseAddressName" placeholder="请选择房屋地址"></u-input>
					<image class="path" src="/static/path.png" mode="" @click="addressShow = true"/>
					<u-select confirm-color="#FF6D25" v-model="addressShow" :list="sourceList" @confirm="confirmSource"></u-select>
				</view>
			</view>
			<view class="item">
				<view class="label">台账号</view>
				<view class="input">
					<u-input :clearable="false" type="text" input-align="right" v-model="form.tel" placeholder="请输入台账号"></u-input>
				</view>
			</view>
			<view class="item">
				<view class="label">上门时间</view>
				<view class="input" >
					<u-input height="102" @click="calendarShow = true" disabled input-align="right" v-model="form.date" placeholder="请选择上门时间"></u-input>
					<image class="calendar" @click="calendarShow = true" src="/static/kehu/calendar.png" mode=""/>
					<u-picker mode="time" confirm-color="#FF6D25" :default-time="form.date" v-model="calendarShow" :params="params" @confirm="dateConfirm"></u-picker>
				</view>
			</view>
			<view class="item">
				<view class="label">申请部门</view>
				<view class="input">
					<u-input :clearable="false" type="text" input-align="right" v-model="form.deptName" placeholder="请输入申请部门"></u-input>
				</view>
			</view>
			<view class="item">
				<view class="label">申请人</view>
				<view class="input">
					<u-input :clearable="false" type="text" input-align="right" v-model="form.applyPerson" placeholder="请输入申请人"></u-input>
				</view>
			</view>
			<view class="last-item">
				<view class="label">备注内容</view>
					<u-input style="flex:1" input-align="right"  :custom-style="customStyle" v-model="form.mark" :height="60" :auto-height="true" type="textarea" :clearable="false"  placeholder="请输入备注内容"></u-input>
			</view>
		</view>
		<view class="submit-btn" @click="submit">提交</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				calendarShow: false,
				addressShow: false,
				params: {
					year: true,
					month: true,
					day: true,
					hour: true,
					minute: true,
					second: true
				},
				form: {
					houseAddress: '',
					houseAddressName: '',
					deptName: '开发部一处',
					applyPerson:'张三地方',
					date:'',
					mark: ''//备注
				},
				sourceList: [
					{
						value: '1',
						label: '来电'
					},
					{
						value: '2',
						label: '来访'
					},
					{
						value: '3',
						label: '到访'
					},
					{
						value: '4',
						label: '2来访'
					},
				],
				customStyle:{
					maxHeight:'200rpx',
					padding: '20rpx',
					fontSize: '30rpx',
					borderBottom:'1px solid #e0e0e0'
				}
			};
		},
		onLoad(options) {
		},
		onShow() {
		
		},
		methods: {
			dateConfirm(e){
				console.log(e)
				this.form.date = e.year + '-'+e.month + '-'+e.day+ ' '+e.hour+':'+e.minute+':'+e.second
			},
			confirmSource(e){
				console.log(e)
				this.form.houseAddress = e[0].value
				this.form.houseAddressName = e[0].label
			},
			submit() {
				
			},
		},
	};
</script>

<style lang="scss" scoped>
.container {
	width: 750rpx;
	min-height: 100vh;
	background: #F8F8F8;
	padding-top: 20rpx;
	.form-box{
		background: #fff;
		padding: 0 30rpx;
		.item{
			height: 102rpx;
			font-size: 30rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			line-height: 102rpx;
			color: #333333;
			border-bottom: 1px solid #e0e0e0;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.label{
				width: 120rpx;
				margin-right: 20rpx;
			}
			.input{
				width: 380rpx;
				display: flex;
				align-items: center;
				justify-content: flex-end;
				.path{
					width: 14rpx;
					height: 30rpx;
					margin-left: 20rpx;
				}
				.calendar{
					width: 40rpx;
					height: 40rpx;
					margin-left: 20rpx;
				}

			}
		}
		.last-item{
			display: flex;
			.label{
				line-height: 102rpx;
				font-size: 30rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #333333;
				margin-right: 150rpx;
			}

		}
	}
	.submit-btn{
		width: 690rpx;
		height: 88rpx;
		line-height: 88rpx;
		text-align: center;
		background: #FFB692;
		border-radius: 12rpx;
		margin-left: 30rpx;
		font-size: 32rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		position: fixed;
		bottom: 90rpx;
	}
}
</style>
