<template>
  <div class="ddrwDetail">
    <div class="titleDiv">
      <div class="mb10 flex-row">
        <div>{{detailForm.jdd_name}}</div>
        <div style="color: #265CD4;" v-if="showStatus">{{detailForm.jdd_status_option_n}}</div>
      </div>
      <div class="d-flex">
        <div class="item">
          <span class="label">督导类型</span>
          <span class="value">{{detailForm.jdd_ddlx_option_n}}</span>
        </div>
        <div class="item">
          <span class="label">督导对象</span>
          <span class="value">{{detailForm.jdd_dddx_option_n}}</span>
        </div>
        <div class="item">
          <span class="label">附件数</span>
          <span class="value">{{detailForm.jdd_fjs}}</span>
        </div>
        <div class="item">
          <span class="label">责任人</span>
          <span class="value">{{detailForm.jdd_zrr}}</span>
        </div>
        <div class="item">
          <span class="label">责任部门</span>
          <span class="value">{{detailForm.jdd_uo_name}}</span>
        </div>
      </div>
      <div class="d-flex">
        <div class="item">
          <span class="label">任务开始时间</span>
          <span class="value">{{detailForm.jdd_start_date}}</span>
        </div>
        <div class="item">
          <span class="label">任务结束时间</span>
          <span class="value">{{detailForm.jdd_end_date}}</span>
        </div>
      </div>
      <div class="mt10" style="color: #969696;">{{detailForm.jdd_content}}</div>
    </div>

    <div class="ddrwDetailContent">
      <router-view :ddlx="detailForm.jdd_ddlx"></router-view>
    </div>
  </div>
</template>

<script>
import { ddrwDetail } from "../api";
export default {
  data() {
    return {
      parentId: "",
      detailForm: {},
      showStatus: false
    }
  },
  methods: {
    async initDetailInfo() {
      let res = await ddrwDetail({ jdd_id: this.parentId });
      this.detailForm = res.one_info;
    },
  },
  created() {
    this.parentId = this.$route.params.id;
    this.showStatus = this.$route.name == "dddx-ddrw-detail-index" ? true : false;
    this.initDetailInfo();
  }
}
</script>

<style lang="scss" scoped>
.ddrwDetail {
  .titleDiv {
    border-bottom: 1px solid rgba($color: #707070, $alpha: 0.19);
    padding: 20px;
    margin: -10px -10px 0;
    font-size: 14px;
    line-height: 28px;
    .item {
      margin-right: 30px;
      .value {
        color: #969696;
        margin-left: 5px;
      }
    }
  }
  .ddrwDetailContent {
    padding: 20px 10px;
  }
}
</style>