<template>
  <hs-popup-buttom-custom
    :show="props?.show"
    title="装修延期"
    @close="handleClose"
    mode="bottom"
    :closeable="true"
    :round="20"
    :safeAreaInsetBottom="false"
    :insetBottom="0"
  >
    <view class="popup_content">
      <hs-cell title="原竣工结束时间"> {{ props?.items?.construction_end_date }} </hs-cell>
      <hs-date-picker
        title="新竣工结束时间"
        v-model:valueModel="popupFormData.extension_date"
        required
        borderTop
        isLink
      />
      <view class="popup_footer">
        <hs-button label="提交" size="md" @click="handleSubmit" />
      </view>
    </view>
  </hs-popup-buttom-custom>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
import { showToastBack, showToast } from '@/common/libraries/naviHelper'
const props = defineProps(['show', 'items'])
const emit = defineEmits(['click', 'handleSubmit', 'handleClose'])
const popupFormData = ref<any>({})
const handleSubmit = () => {
  if (!popupFormData.value?.extension_date) {
    return showToast('请选择新竣工结束时间！')
  }
  emit('handleSubmit', { ...props?.items, ...popupFormData.value })
}
const handleClose = () => {
  emit('handleClose')
}
</script>
<style lang="scss" scoped>
.popup_content {
  padding: 30rpx;
  .popup_footer {
    padding: 30rpx 0 100rpx 0;
  }
}
</style>
