<template>
	<!-- 待办单查询 -->
	<u-popup v-model="isshow" class="search-popup" mode="right" @close="handleClose" :custom-style="{top:'var(--status-bar-height)'}" length="80%">
		<view class="search-title">待办单查询</view>
		<u-form class="form-content" :model="form" ref="uForm" label-width="150">
			<u-form-item label="发起时间" prop="time">
				<u-input v-model="form.time" disabled placeholder="请选择发起时间区间" @click="showPicker=true"/>
			</u-form-item>
			<u-form-item label="门店" prop="storeName">
				<u-input v-model="form.storeName" placeholder="请输入门店名称" />
			</u-form-item>
			<u-form-item label="巡店人" prop="userName">
				<u-input v-model="form.userName" placeholder="请输入巡店人名称" />
			</u-form-item>
			<u-form-item label="单据状态" prop="status"> 
				<u-input v-model="form.status" placeholder="请输入巡店人名称" />
			</u-form-item>
			<u-form-item label="检查方式" prop="status">
				<u-input v-model="form.status" placeholder="请输入巡店人名称" />
			</u-form-item>
			<u-form-item label="过期状态" prop="status">
				<u-input v-model="form.status" placeholder="请输入巡店人名称" />
			</u-form-item>
		</u-form>
		<view class="uni-list-btns">
			<button type="primary" @click="pageInit(false)">查询</button>
			<button type="info" @click="resetForm">重置</button>
		</view>
		<!-- 时间选择器 -->
		<mx-date-picker :show="showPicker" type="range" :value="form.time" :show-tips="true" @confirm="onSelected" @cancel="onSelected" />
	</u-popup>
</template>

<script>
	import MxDatePicker from "@/components/mx-datepicker/mx-datepicker.vue"
	export default {
		components: {
			MxDatePicker
		},
		props: {
			visible: {
				type: Boolean,
				default: false
			}
		},
		watch: {
			visible (newValue, oldValue) {
				if (newValue) {
					this.isshow = newValue
				} else {
				}
			},
			isshow (newValue, oldValue) {
				if (newValue) {
				} else {
					this.$emit('close')
				}
			}
		},
		data() {
			return {
				isshow: this.visible,  // 显示隐藏
				showPicker: false, // 是否显示时间弹窗
				form: {
					time: null,
				},
			}
		},
		methods: {
			// 关闭弹窗
			handleClose () {
				this.isshow = false
			}
		},
	}
</script>

<style lang="scss" scoped>
	.search-popup{
		.search-title{
			text-align: center;
			padding: 22upx;
			color: #333;
			border-bottom: 1px solid #eee;
		}
		.form-content {
			padding: 0 20upx;
		}
		.uni-list{
			margin: 20upx;
			.uni-list-cell{
				display: flex;
				align-items: center;
				border-bottom: 1px dashed #EEEEEE;
				.uni-list-cell-db{
					flex: 1;
				}
				.uni-input{
					height: 2.5em;
					line-height: 2.5em;
				}
			}
		}
		.uni-list-btns{
			display: flex;
			padding: 20upx;
			uni-button{
				font-size: 28upx;
				margin: 0 30upx;
				flex:1;
			}
		}
		
	}
</style>
