<template>
  <div class="m-pop">
    <div class="wrap">
      <cpt-card>
        <div class="title">
          <img src="@/assets/img/shuju/title-tip.png" />
          <span>详情</span>
        </div>

        <div class="btn-close"
             @click="handleClose">
          <img src="@/assets/img/shuju/people/close.png" />
        </div>
        <div class="m-content">
          <div class="m-info">

            <div class="info-prop">
              <span class="info-title-2">姓名：</span>
              <span>{{ info.name||'--' }}</span>
            </div>
            <div class="info-prop">
              <span class="info-title-2">手机：</span>
              <span>{{ info.mobile||'--'  }}</span>
            </div>

            <div class="info-prop">
              <span class="info-title-2">证件号：</span>
              <span>{{ info.idCard||'--' }}</span>
            </div>
            <div class="info-prop">
              <span class="info-title-2">来源地：</span>
              <span>{{ info.sourceAddress||'--' }}</span>
            </div>

            <div class="info-prop">
              <span class="info-title-2">来曹事由：</span>
              <span>{{ info.describeContent||'--' }}</span>
            </div>
            <div class="info-prop">
              <span class="info-title-2">48小时核酸：</span>
              <span>{{ info.natOutComeName||'--' }}</span>
            </div>
            <div class="info-prop">
              <span class="info-title-2">7天旅居史：</span>
              <span>{{ info.sojournHistoryName||'--' }}</span>
            </div>
            <div class="info-prop">
              <span class="info-title-2">隔离状态：</span>
              <span>{{ info.isolateTypeName||'--' }}</span>
            </div>
            <div class="info-prop">
              <span class="info-title-2">来曹时间：</span>
              <span>{{ info.arriveDate||'--' }}</span>
            </div>

          </div>

        </div>
      </cpt-card>
    </div>
  </div>
</template>

<script>
import cptCard from "@/views/modules/visual/cpts/card";
import screenLoading from "@/views/modules/visual/cpts/loading";
import { requestPost } from "@/js/dai/request";

import dateFormat from "dai-js/tools/dateFormat";

export default {
  name: "demandInfo",
  props: {
    detailId: {
      type: String,
      default: "",
    },

  },

  components: {
    cptCard,

    screenLoading,
  },

  data () {
    return {
      info: {
        name: "",
        mobile: "",
        idCard: "",
        sourceAddress: "",
        describeContent: "",
        natOutcome: "",
        sojournHistory: "",
        isolateType: "",
        arriveDate: '',


      },


    };
  },

  computed: {},

  watch: {
    detailId () {
      this.getApiData();
    },
  },

  mounted () {
    this.getApiData();
  },

  methods: {

    handleClose () {
      this.$emit("close");
    },

    async getApiData () {

      await this.getInfo();

    },

    //加载组织数据
    async getInfo () {
      const url = "/epmetuser/tripreport/emphasisTripDetail";
      // const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icTripReportRecord/emphasisTripDetail";
      let params = {
        id: this.detailId,
      };

      const { data, code, msg } = await requestPost(url, params);

      if (code === 0) {
        this.info = data

        if (this.info.topicInfo && this.info.topicInfo.publishedTime) {
          this.info.topicInfo.publishedTimeShow = dateFormat(new Date(this.info.topicInfo.publishedTime * 1000), "yyyy-MM-dd")

        }
      } else {
        this.$message.error(msg);
      }
    },



  },
};
</script>

<style
  lang="scss"
  src="@/assets/scss/modules/visual/issue-info.scss"
  scoped
></style>
