<template>
  <div class="p25">
    <div class="lh35 font-size-14 text-grey">
      <h3 class="font-size-16 text-black">{{ detailMsg.ddrw_name }}</h3>
      <div class="d-flex">
        <div class="mr20">
          <span class="text-black">督导对象:</span> {{ detailMsg.dddx }}
        </div>
        <div>
          <span class="text-black">督导类型:</span> {{ detailMsg.ddlx }}
        </div>
      </div>
      <div>
        <span class="text-black">任务内容:</span>
        <br />
        {{ detailMsg.rwnr }}
      </div>
      <div>
        <div class="text-black">
          <span style="margin-right: 10px;"> 培训人员:</span>
          <span v-for="i in pxry" :key="i.user_id">
            {{ i.user_realname }}
          </span>
        </div>
      </div>
      <div>
        <span class="text-black">培训内容: </span>
        <br />
        {{ detailMsg.jddp_pxnr }}
      </div>
      <div>
        <span class="text-black">佐证材料: </span>
        <br />
        <div v-for="(f, i) in zzcl" :key="i">
          <a :href="https + f.split('|')[0]">{{ f.split("|")[1] }}</a>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { ddpx_detail, ddrw_list } from "./api";
export default {
  name: "index",
  data() {
    return {
      loading: false,
      detailMsg: {},
      https: window.globalVariables.api,
      rwList: [],
      pxry: "",
      zzcl: [],
    };
  },
  methods: {
    getDetail() {
      let data = {
        jddp_id: this.$route.params.id,
      };
      ddpx_detail(data).then((res) => {
        if (res.code == "1") {
          this.detailMsg = res.data.one_info;
          let detailData = res.data.one_info;
          this.pxry = JSON.parse(detailData.jddp_pxry_json);
          this.zzcl = detailData.jddp_zzcl.split(";");
          this.rwList.forEach((el) => {
            if (el.jdd_id === detailData.jdd_id) {
              detailData.ddrw_name = el.jdd_name;
              detailData.ddlx = el.jdd_ddlx;
              detailData.dddx = el.jdd_dddx;
              detailData.rwnr = el.jdd_content;
            }
          });
        }
      });
    },
    getRw() {
      let data = {};
      ddrw_list(data).then((res) => {
        if (res.code == "1") {
          this.getDetail();
          this.rwList = res.data.page_data;
        }
      });
    },
  },
  mounted() {
    // this.getDetail();
    this.getRw();
  },
};
</script>
<style lang="scss" scoped>
.wight {
  font-weight: 500;
}
span {
  display: inline-block;
  width: 70px;
}
</style>