<template>
  <div>
    <div
      class="color"
      style="
        background-color: #f6fafd;
        height: 5vh;
        line-height: 5vh;
        padding-left: 20px;
        border-bottom: 1px solid black;
      "
    >
      <el-button v-print="print" plain type="primary">打印</el-button>
    </div>
    <div
      id="printContent"
      style="
        width: 680px;
        font-family: '宋体';
        margin: 0 auto;
        margin-top: 15px;
      "
      class="grid-content ep-bg-purple-light"
    >
      <div
        style="
          width: 680px;
          font-size: 30px;

          height: 4vh;
          line-height: 4vh;
          margin: auto;
          color: black;
          text-align: center;
          margin-top: 50px;
          font-family: '宋体';
          font-weight: 700;
        "
      >
        河北省卫生健康委综合监督服务中心收文呈办笺
      </div>

      <div
        style="
          display: flex;
          justify-content: space-between;
          color: black;
          margin-top: 2vh;
          margin-left: 40px;
          width: 640px;
          font-size: 22px;
          font-weight: 500;
          margin-bottom: 0.5vh;
        "
      >
        <div style="display: inline-block">
          流水号:{{ YbjData.yOffcialReceive.serial }}
        </div>
        <div style="margin-top: 2px; display: inline-block; margin-right: 50px">
          收文时间:
          {{
            parseTime(YbjData.yOffcialReceive.sendTime, "{y} 年 {m} 月 {d} 日")
          }}
        </div>
      </div>
      <div style="margin: 20px; margin-top: 0px; color: black">
        <table
          style="border-collapse: collapse"
          border="1"
          width="100%"
          height="90vh"
          align="center"
        >
          <tr style="height: 8vh">
            <td style="font-size: 22px" width="16.5%" align="center">
              来文 <br />
              单位
            </td>
            <td colspan="6" style="font-size: 22px; text-align: center">
              {{ YbjData.yOffcialReceive.sender }}
            </td>
            <td colspan="1" style="font-size: 22px; width: 9%" align="center">
              文<br />号
            </td>
            <td colspan="5" style="font-size: 22px; text-align: center">
              {{ YbjData.yOffcialReceive.documentNum }}
            </td>
          </tr>
          <tr style="height: 5vh">
            <td
              rowspan="2"
              style="font-size: 22px"
              width="16.5%"
              align="center"
            >
              文件<br />标题
            </td>
            <td
              rowspan="2"
              colspan="6"
              style="font-size: 22px; text-align: center"
            >
              {{ YbjData.yOffcialReceive.title }}
              <!-- {{ YbjData.yOffcialReceive.emergencyDegree }} -->
              <!-- <div v-if="YbjData.yOffcialReceive.emergencyDegree == 0">
                一般
              </div>
              <div v-if="YbjData.yOffcialReceive.emergencyDegree == 1">
                紧急
              </div>
              <div v-if="YbjData.yOffcialReceive.emergencyDegree == 2">
                特急
              </div> -->
            </td>

            <td colspan="2" style="font-size: 22px; height: 5vh" align="center">
              文件类型
            </td>
            <td colspan="4" style="font-size: 22px; text-align: center">
              <!-- {{ YbjData.yOffcialReceive.receiveType }} -->
              <dict-tag
                :options="sw_open_type"
                :value="YbjData.yOffcialReceive.receiveType"
              />
            </td>
          </tr>
          <tr style="height: 5vh">
            <td
              rowspan="1"
              colspan="2"
              style="font-size: 22px"
              width="16.5%"
              align="center"
            >
              紧急程度
            </td>
            <td colspan="4" style="font-size: 22px; text-align: center">
              <!-- {{ YbjData.yOffcialReceive.emergencyDegree }} -->
              <div v-if="YbjData.yOffcialReceive.emergencyDegree == 0">
                一般
              </div>
              <div v-if="YbjData.yOffcialReceive.emergencyDegree == 1">
                紧急
              </div>
              <div v-if="YbjData.yOffcialReceive.emergencyDegree == 2">
                特急
              </div>
            </td>
            <!-- <td style="font-size: 22px" align="center">来文内容</td>
            <td
              style="
                font-family: 楷体;
                font-size: 20px;
                line-height: 35px;
                height: 35px;
              "
              colspan="3"
            >
              {{ YbjData.yOffcialReceive.title }}
            </td> -->
          </tr>
          <tr style="height: 20vh">
            <td style="writing-mode: tb-rl; font-size: 22px" align="center">
              &nbsp;领&nbsp;导&nbsp;批&nbsp;示&nbsp;
            </td>
            <td
              colspan="14"
              style="font-size: 22px; line-height: 35px; height: 35px"
            >
              <div
                v-if="YbjData.ldpsMaps != undefined && YbjData.ldpsMaps != null"
              >
                <template
                  v-for="(item, index) in YbjData.ldpsMaps"
                  :key="index"
                >
                  <div>{{ item.nickName }}：{{ item.Msg }}</div>
                </template>
              </div>
            </td>
          </tr>
          <tr style="height: 16vh">
            <td rowspan="2" style="font-size: 22px" align="center">
              办 <br />
              公<br />室<br />拟<br />办<br />意<br />见
            </td>
            <td
              style="font-size: 22px; line-height: 35px; height: 35px"
              colspan="13"
            >
              <div
                v-if="YbjData.nbyjMaps != undefined && YbjData.nbyjMaps != null"
              >
                <template
                  v-for="(item, index) in YbjData.nbyjMaps"
                  :key="index"
                >
                  <span>{{ item.nickName }}：{{ item.Msg }}</span>
                </template>
              </div>
            </td>
          </tr>
          <tr style="height: 5vh">
            <td align="center" style="font-size: 22px; width: 12vw" colspan="4">
              是否反馈
            </td>
            <td
              colspan="2"
              align="center"
              style="font-size: 22px; padding: 0 5px; width: 10vw"
            >
              {{ YbjData.yOffcialReceive.isFeedback == "1" ? "是" : "否" }}
            </td>
            <td align="center" style="font-size: 22px; width: 15vw" colspan="2">
              反馈时限
            </td>
            <td
              align="center"
              style="font-size: 22px; padding: 0 5px"
              colspan="3"
            >
              {{ YbjData.yOffcialReceive.closeTime }}
            </td>
          </tr>
          <tr style="height: 16vh">
            <td style="writing-mode: tb-rl; font-size: 22px" align="center">
              &nbsp;承&nbsp;办&nbsp;情&nbsp;况&nbsp;
            </td>
            <td
              style="font-size: 22px; line-height: 35px; height: 35px"
              colspan="10"
            >
              <div
                v-if="YbjData.cbcsMaps != undefined && YbjData.cbcsMaps != null"
              >
                <template
                  v-for="(item, index) in YbjData.cbcsMaps"
                  :key="index"
                >
                  <div v-if="item.ActionType == 3">
                    {{ item.EmpFromT }} 移交到 {{ item.EmpToT }} 移交意见：{{
                      item.Msg
                    }}
                  </div>
                  <div v-if="item.ActionType == 22">
                    {{ item.EmpFromT }}：{{ item.Msg }}
                  </div>
                </template>
              </div>
            </td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</template>
<script>
// import { VueHtmlToPaper } from "vue-html-to-paper";
import { getYbjInfo } from "@/api/liucheng";
import { ElMessage } from "element-plus";
import { useDict } from "@/utils/dict";

export default {
  // directives: {
  //   htmlToPaper: VueHtmlToPaper,
  // },

  name: "YinetYbjIndex",
  props: ["id"],
  data() {
    return {
      sw_open_type: useDict("sw_open_type").sw_open_type,

      //打印
      print: {
        id: "printContent",
      },
      YbjData: {
        cbcsStr: "",
        nbyjStr: "",
        ldpsStr: "",
        yOffcialReceive: {},
      },
      aaid: 32,
    };
  },
  mounted() {
    this.getInfoData();
  },
  methods: {
    getInfoData() {
      getYbjInfo(this.id).then((reData) => {
        this.YbjData = reData.data;
      });
    },
  },
};
</script>

<style lang="scss" scoped>
table {
  border-collapse: collapse;
}
</style>
<style>
@media print {
  html,
  body {
    height: inherit;
  }
}
</style>
