<template>
  <div class="dialog" v-if="dialogForm">
    <div class="head_box">
      <span class="title">新增</span>
      <div>
        <el-button size="small" @click="close">关闭</el-button>
      </div>
    </div>
    <div class="cntinfo">
      <el-form
        :model="listQuery"
        :label-width="130"
        inline
        label-position="right"
      >
        <el-divider content-position="left">基础信息</el-divider>
        <el-form-item label="线索名称">
          <el-input v-model="listQuery.xsmc" placeholder="请输入线索名称" />
        </el-form-item>
        <el-form-item label="线索来源">
          <el-input v-model="listQuery.xsly" placeholder="请输入线索来源" />
        </el-form-item>
        <el-form-item label="线索编号">
          <el-input v-model="listQuery.xsbh" placeholder="请输入线索编号" />
        </el-form-item>
        <el-form-item label="所属专题">
          <el-input v-model="listQuery.sszt" placeholder="请输入所属专题" />
        </el-form-item>
        <el-form-item label="群体名称">
          <el-input v-model="listQuery.qtmc" placeholder="请输入群体名称" />
        </el-form-item>
        <el-form-item label="群体类型">
          <el-input v-model="listQuery.qtlx" placeholder="请输入群体类型" />
        </el-form-item>
        <el-form-item label="上报单位">
          <el-input v-model="listQuery.sbdw" placeholder="请输入上报单位" />
        </el-form-item>
        <el-form-item label="上报时间">
          <el-date-picker
          style="width:100%"
            v-model="listQuery.sbsj"
            type="datetime"
            placeholder="请选择上报时间"
          />
        </el-form-item>
        <el-form-item label="线索内容" style="width: 100%">
          <el-input
            v-model="listQuery.xsnr"
            type="textarea"
            style="width: 100%"
            :rows="3"
            placeholder="请输入线索内容"
          />
        </el-form-item>
        <el-divider content-position="left">标签信息</el-divider>
        <el-form-item label="线索类型">
          <el-select v-model="listQuery.xslx" placeholder="请选择线索类型">
            <el-option label="类型1" value="1" />
            <el-option label="类型2" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="线索类型标签大类">
          <el-select
            v-model="listQuery.xsbqdl"
            placeholder="请选择线索类型标签大类"
          >
            <el-option label="类型1" value="1" />
            <el-option label="类型2" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="线索类型标签细类">
          <el-select
            v-model="listQuery.xsbqxl"
            placeholder="请选择线索类型标签细类"
          >
            <el-option label="类型1" value="1" />
            <el-option label="类型2" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="线索来源">
          <el-input v-model="listQuery.xsly" placeholder="请输入线索来源" />
        </el-form-item>
        <el-form-item label="线索风险等级">
          <el-select
            v-model="listQuery.xsfxdj"
            placeholder="请选择线索风险等级"
          >
            <el-option label="状态1" value="1" />
            <el-option label="状态2" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="线索备注">
          <el-input v-model="listQuery.xsbz" placeholder="请输入线索备注" />
        </el-form-item>
        <el-form-item label="市内外">
          <el-input v-model="listQuery.snw" placeholder="请输入市内外" />
        </el-form-item>
        <el-form-item label="是否设计外地">
          <el-select
            v-model="listQuery.xsfxdj"
            placeholder="请选择是否设计外地"
          >
            <el-option label="是" value="1" />
            <el-option label="否" value="0" />
          </el-select>
        </el-form-item>
        <el-form-item label="指向地点">
          <el-input v-model="listQuery.zxdd" placeholder="请输入指向地点" />
        </el-form-item>
        <el-form-item label="具体部位">
          <el-input v-model="listQuery.jtbw" placeholder="请输入具体部位" />
        </el-form-item>
        <el-form-item label="指向时间类型">
          <el-input v-model="listQuery.sjlx" placeholder="请输入指向时间类型" />
        </el-form-item>

        <el-form-item label="指向时间段">
          <el-date-picker
            v-model="listQuery.sjd"
            type="daterange"
            placeholder="请选择指向时间段"
          />
        </el-form-item>

        <el-divider content-position="left">涉及人员</el-divider>
        <el-form-item label="姓名">
          <el-input v-model="listQuery.xm" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="身份证号">
          <el-input v-model="listQuery.sfzh" placeholder="请输入身份证号" />
        </el-form-item>
        <el-form-item label="联系方式">
          <el-input v-model="listQuery.lxfs" placeholder="请输入联系方式" />
        </el-form-item>
        <el-form-item label="住址">
          <el-input v-model="listQuery.zz" placeholder="请输入住址" />
        </el-form-item>

        <el-divider content-position="left">审批信息</el-divider>
        <el-form-item label="申请单位">
          <el-input v-model="listQuery.sqdw" placeholder="请输入申请单位" />
        </el-form-item>
        <el-form-item label="申请人">
          <el-input v-model="listQuery.sqr" placeholder="请输入申请人" />
        </el-form-item>
        <el-form-item label="审核单位">
          <el-input v-model="listQuery.shdw" placeholder="请输入审核单位" />
        </el-form-item>
        <el-form-item label="审核人">
          <el-input v-model="listQuery.shr" placeholder="请输入审核人" />
        </el-form-item>
        <el-form-item label="审批单位">
          <el-input v-model="listQuery.spdw" placeholder="请输入审批单位" />
        </el-form-item>
        <el-form-item label="审批人">
          <el-input v-model="listQuery.spr" placeholder="请输入审批人" />
        </el-form-item>

        <el-form-item label="申请原因" style="width: 100%">
          <el-input
            style="width: 100%"
            v-model="listQuery.sqyy"
            type="textarea"
            :rows="3"
            placeholder="请输入申请原因"
          />
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";

const dialogForm = ref(false);
const listQuery = ref({
  xsmc: "", // 线索名称
  xsly: "", // 线索来源
  xsbh: "", // 线索编号
  sbsj: "", // 上报时间
  xslx: "", // 线索类型
  xszt: "", // 线索状态
  xsnr: "", // 线索内容
  xm: "", // 姓名
  sfzh: "", // 身份证号
  lxfs: "", // 联系方式
  zz: "", // 住址
  sqr: "", // 申请人
  sqsj: "", // 申请时间
  sqyy: "" // 申请原因
});

// 初始化数据
const init = (type, row) => {
  dialogForm.value = true;
  // 根据type和row初始化表单数据
};

const close = () => {
  dialogForm.value = false;
};

defineExpose({ init });
</script>

<style lang="scss" scoped>
.dialog {
  padding: 20px;
  .head_box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }
  .cntinfo {
    height: calc(100% - 70px);
    overflow: hidden;
    overflow-y: auto;
  }
}
</style>
