<template>
	<uni-collapse class="fwnr-collapse-box collapse-border-box" @change="handleChange">
		<uni-collapse-item title="服务时间" :open="true">
			<view class="form-label-select">
				<view class="phone-form-label"><text class="form-label-require"></text>三方合同服务期限(开始)</view>
				<picker mode='date' :value="data.hetong.jiabingStartDate" @change="onDateStartSelect"
					class="form-radio-select">
					<view class="data-select-box">
						<view>{{data.hetong.jiabingStartDate}}</view>
						<icon></icon>
					</view>
				</picker>
			</view>
			<view class="form-label-select">
				<view class="phone-form-label"><text class="form-label-require"></text>三方合同服务期限(结束)</view>
				<picker mode='date' :value="data.hetong.jiabingEndDate" @change="onDateEndSelect"
					class="form-radio-select">
					<view class="data-select-box">
						<view>{{data.hetong.jiabingEndDate}}</view>
						<icon></icon>
					</view>
				</picker>
			</view>
			<view class="form-label-select" v-if="false">
				<view class="phone-form-label"><text class="form-label-require"></text>甲乙双方服务期限(开始)</view>
				<picker mode='date' :value="data.hetong.jiayiStartDate" @change="onDateStartSelect2"
					class="form-radio-select">
					<view class="data-select-box">
						<view>{{data.hetong.jiayiStartDate}}</view>
						<icon></icon>
					</view>
				</picker>
			</view>
			<view class="form-label-select" v-if="false">
				<view class="phone-form-label"><text class="form-label-require"></text>甲乙双方服务期限(结束)</view>
				<picker mode='date' :value="data.hetong.jiayiEndDate" @change="onDateEndSelect2"
					class="form-radio-select">
					<view class="data-select-box">
						<view>{{data.hetong.jiayiEndDate}}</view>
						<icon></icon>
					</view>
				</picker>
			</view>
		</uni-collapse-item>
	</uni-collapse>
</template>

<script setup>
	import {
		useHetong
	} from "../useHetong.js"

	const {
		injectHetong
	} = useHetong();
	const data = injectHetong();

	const emits = defineEmits(['change'])

	function handleChange() {
		emits('change')
	}

	function onDateStartSelect(e) {
		console.log('cccc', e)
		data.hetong.jiabingStartDate = e.detail.value
	}

	function onDateEndSelect(e) {
		data.hetong.jiabingEndDate = e.detail.value
	}

	function onDateStartSelect2(e) {
		data.hetong.jiayiStartDate = e.detail.value
	}

	function onDateEndSelect2(e) {
		data.hetong.jiayiEndDate = e.detail.value
	}
</script>
<style>
</style>