<template>
  <view>
    <view class="update_form_content">
      <view class="form_card">
        <view class="form_card_title"> <text></text> 施工方负责人信息 </view>
        <hs-cell title="姓名" required borderTop>
          <hs-input
            v-model:valueModel="useModel.formData.value.construction_principal_name"
            textAlign="right"
          />
        </hs-cell>
        <hs-cell title="手机号" required borderTop>
          <hs-input
            v-model:valueModel="useModel.formData.value.construction_principal_phone"
            maxLength="11"
            textAlign="right"
          />
        </hs-cell>
        <hs-radio-cell-picker
          title="证件类型"
          required
          borderTop
          isLink
          :Enums="HouseOccupantsCardTypeEnum"
          v-model:valueModel="useModel.formData.value.construction_principal_card_type"
        />
        <hs-cell title="证件号" required borderTop>
          <hs-input
            v-model:valueModel="useModel.formData.value.construction_principal_id_card"
            maxLength="18"
            textAlign="right"
          />
        </hs-cell>
        <hs-upload-id-card
          required
          borderTop
          v-model:valueFrontModel="useModel.formData.value.construction_principal_id_card_front"
          v-model:valueBackModel="useModel.formData.value.construction_principal_id_card_back"
        />
      </view>

      <view class="form_card" v-if="useModel?.formData?.value?.type === 'RenovationCompany'">
        <view class="form_card_title"> <text></text> 施工公司信息 </view>
        <!-- <hs-cell title="装修公司负责人名称" required borderTop>
          <hs-input
            v-model:valueModel="useModel.formData.value.company_principal_name"
            textAlign="right"
          />
        </hs-cell>
        <hs-cell title="装修公司负责人手机" required borderTop>
          <hs-input
            v-model:valueModel="useModel.formData.value.company_principal_phone"
            maxLength="11"
            textAlign="right"
          />
        </hs-cell> -->
        <hs-cell title="装修公司全称" required borderTop>
          <hs-input v-model:valueModel="useModel.formData.value.company_name" textAlign="right" />
        </hs-cell>
        <hs-cell title="社会统一信用代码" required borderTop>
          <hs-input
            v-model:valueModel="useModel.formData.value.company_business_license_num"
            textAlign="right"
          />
        </hs-cell>
        <hs-upload
          title="营业执照照片"
          :count="1"
          :size="4"
          required
          borderTop
          v-model:valueModel="useModel.formData.value.company_business_license"
        />

        <hs-upload
          title="资质证明"
          :count="1"
          :size="4"
          required
          borderTop
          v-model:valueModel="useModel.formData.value.company_asset_certificate"
        />
        <hs-upload
          title="装修授权书"
          :count="1"
          :size="4"
          required
          borderTop
          v-model:valueModel="useModel.formData.value.company_power_attorney"
        />
      </view>
      <view class="form_card">
        <view class="form_card_title"> <text></text> 施工内容 </view>
        <hs-date-picker
          title="施工开始时间"
          v-model:valueModel="useModel.formData.value.construction_start_date"
          required
          borderTop
          isLink
        />
        <hs-date-picker
          title="施工结束时间"
          v-model:valueModel="useModel.formData.value.construction_end_date"
          required
          borderTop
          isLink
        />
        <hs-cell title="装修内容" borderTop required>
          <hs-radio
            :Enums="RenovationAppliesRenovationContentEnum"
            v-model:valueModel="useModel.formData.value.renovation_content"
            required
          />
        </hs-cell>

        <view class="refund_info">
          <view class="label"> 装修内容说明 </view>
          <view class="refund_reason">
            <textarea
              v-model="useModel.formData.value.renovation_remark"
              placeholder-style="color:#C9CDD4;font-size:28rpx;"
              placeholder="请输入装修内容说明，例如:厨卫墙地砖拆除、安装衣柜、更换地板、客厅吊顶、全屋刷漆等"
            />
          </view>
        </view>
      </view>
      <view class="form_card">
        <view class="form_card_title"> <text></text> 其他资料 </view>
        <hs-upload
          title="施工图"
          :count="10"
          :size="4"
          borderTop
          v-model:valueModel="useModel.formData.value.construction_draw"
        />
        <hs-upload
          title="装修承诺书"
          :count="1"
          :size="4"
          borderTop
          v-model:valueModel="useModel.formData.value.construction_commitment_letter"
        />
        <hs-upload
          title="其他附件"
          :count="20"
          :size="4"
          borderTop
          v-model:valueModel="useModel.formData.value.other_attachments"
        />
      </view>
    </view>
    <hs-footer btnParimaryName="提交" @handleParmaryClick="method.handleNextSubmit" />
  </view>
</template>
<script setup lang="ts">
import { onLoad, onShow, onUnload } from '@dcloudio/uni-app'
import method from './method'
import useModel from './model'
import { HouseOccupantsCardTypeEnum, RenovationAppliesRenovationContentEnum } from '@/gen/Enums'

onLoad((e: any) => {
  method?.getShow(e)
})
</script>

<style lang="scss">
@import './style.scss';
</style>
