<script setup>
import { ClockCircleOutlined } from "@ant-design/icons-vue";

defineProps({
  form: { type: Object, required: true },
  readonly: Boolean,
  showTip: Boolean,
  progressText: { type: String, default: "" },
  showImportedContent: Boolean,
  showFirstContact: { type: Boolean, default: true },
});
</script>

<template>
  <div class="wide-form investigation-form">
    <template v-if="showFirstContact">
      <div class="section-title">首联信息</div>
      <div class="form-row"><label>首联时间</label><input v-model="form.firstContactAt" class="field" :readonly="readonly" type="text" placeholder="请选择日期" /></div>
      <div class="form-row"><label>首联工单号</label><input v-model="form.firstContactNo" class="field" :readonly="readonly" placeholder="请输入首联工单号" /></div>
      <div class="form-row"><label>首联内容</label><input v-model="form.firstContactContent" class="field" :readonly="readonly" placeholder="请填写首联内容" /></div>
    </template>

    <div class="section-title">调查结果</div>
    <div v-if="showTip" class="tip"><ClockCircleOutlined /><span>派工后可先行填报并保存草稿；主责需等待首联及全部初查完成，协查需等待全部初查完成后才能提交。<strong v-if="progressText">当前初查进度：{{ progressText }}</strong></span></div>
    <div class="form-row"><label>调查结果</label><textarea v-model="form.preliminaryContent" class="field" :readonly="readonly" placeholder="请填写调查结果"></textarea></div>

    <div class="section-title">派单选择信息</div>
    <div v-if="showImportedContent" class="form-row"><label>12398受理内容</label><textarea v-model="form.importedContent" class="field" :readonly="readonly" placeholder="导入的12398投诉内容"></textarea></div>
    <div class="form-row long-label"><label>致电时客户是否表达向外部渠道或监管机构反映倾向</label><div class="radio-group"><label><input v-model="form.externalExposureRisk" type="radio" value="是" :disabled="readonly" />是</label><label><input v-model="form.externalExposureRisk" type="radio" value="否" :disabled="readonly" />否</label></div></div>
    <div class="form-row long-label"><label>是否派发内部诉求工单</label><div class="radio-group"><label><input v-model="form.internalAppealIssued" type="radio" value="是" :disabled="readonly" />是</label><label><input v-model="form.internalAppealIssued" type="radio" value="否" :disabled="readonly" />否</label></div></div>
    <div class="form-row"><label>客户诉求概况</label><textarea v-model="form.customerAppealSummary" class="field" :readonly="readonly" placeholder="请填写客户诉求概况"></textarea></div>
    <div class="form-row"><label>客户升级主要原因</label><textarea v-model="form.escalationReason" class="field" :readonly="readonly" placeholder="请填写客户升级主要原因"></textarea></div>
    <div class="form-row"><label>本期诉求调查过程</label><textarea v-model="form.investigationProcess" class="field large" :readonly="readonly" placeholder="请填写调查过程"></textarea></div>
    <div class="form-row"><label>是否本单位事项</label><div class="radio-group"><label><input v-model="form.localResponsibility" type="radio" value="是" :disabled="readonly" />是</label><label><input v-model="form.localResponsibility" type="radio" value="否" :disabled="readonly" />否</label></div></div>
    <div class="form-row"><label>办理情况</label><textarea v-model="form.handlingSituation" class="field" :readonly="readonly" placeholder="请填写办理情况"></textarea></div>
    <div class="form-row"><label>是否有责</label><div class="radio-group"><label><input v-model="form.accountable" type="radio" value="是" :disabled="readonly" />是</label><label><input v-model="form.accountable" type="radio" value="否" :disabled="readonly" />否</label></div></div>
    <div class="form-row"><label>是否有处理依据</label><div class="radio-group"><label><input v-model="form.hasHandlingBasis" type="radio" value="是" :disabled="readonly" />是</label><label><input v-model="form.hasHandlingBasis" type="radio" value="否" :disabled="readonly" />否</label></div></div>
    <div class="form-row"><label>处理方式</label><textarea v-model="form.handlingMethod" class="field" :readonly="readonly" placeholder="请填写处理方式"></textarea></div>
    <div class="form-row"><label>处理结果</label><textarea v-model="form.handlingResult" class="field" :readonly="readonly" placeholder="请填写处理结果"></textarea></div>
  </div>
</template>
