<template>
  <div class="container-accountability selfAuditDetail">
    <el-form label-width="100px">
      <el-row>
        <el-col :span="8" :offset="4">
          <el-form-item label="考核年度">
            <el-input v-model="taskInfo.year" disabled></el-input>
          </el-form-item>
        </el-col>
        <!-- <el-col :span="8">
          <el-form-item label="考核方式">
            <el-input
              v-model="taskInfo.khfs"
              disabled
            ></el-input>
          </el-form-item>
        </el-col> -->
      </el-row>
      <el-row>
        <el-col :span="16" :offset="4">
          <el-form-item label="评分标准">
            <el-input
              v-model="taskInfo.pfbz"
              type="textarea"
              :rows="4"
              disabled
              resize="none"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <!-- <el-row>
        <el-col :span="16" :offset="4">
          <el-form-item label="考核指标">
            <el-input
              v-model="taskInfo.khzb"
              type="textarea"
              :rows="4"
              placeholder=""
              disabled
              resize="none"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="16" :offset="4">
          <el-form-item label="重点考核事项">
            <el-input
              v-model="taskInfo.khsx"
              type="textarea"
              :rows="4"
              placeholder=""
              disabled
              resize="none"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="16" :offset="4">
          <el-form-item label="考核内容">
            <el-input
              v-model="taskInfo.khnr"
              type="textarea"
              :rows="4"
              placeholder=""
              disabled
              resize="none"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row> -->
      <el-row>
        <el-col :span="16" :offset="4">
          <el-form-item label="备注">
            <el-input
              type="textarea"
              v-model="taskInfo.pfyj"
              disabled
              resize="none"
              :rows="4"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :offset="4">
          <el-form-item label="农业分值">
            <el-input
              v-model="taskInfo.nyfz"
              disabled
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="非农业分值">
            <el-input
              v-model="taskInfo.fnyfz"
              disabled
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="24">
          <h3 class="titH3">配合部门意见</h3>
        </el-col>
      </el-row>
      <el-row style="margin-bottom: 10px;">
        <el-col :span="16" :offset="4">
          <el-table :data="phbmVOLists" border stripe highlight-current-row>
            <el-table-column align="center" prop="phbm" label="配合部门"></el-table-column>
            <el-table-column align="center" prop="scoreReason" label="存在不足"></el-table-column>
            <el-table-column align="center" prop="zgcs" label="整改措施"></el-table-column>
            <el-table-column align="center" label="佐证材料">
              <template slot-scope="scope">
                <span @click="downfile(scope.row.fileId)" class="hoverA" style="cursor:pointer;">{{scope.row.fileName}}</span>
              </template>
            </el-table-column>
          </el-table>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="24">
          <h3 class="titH3">牵头部门评分</h3>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :offset="4">
          <el-form-item label="自评牵头部门">
            <el-input disabled v-model="qtbmVo.qtbm"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="自评得分">
            <el-input disabled v-model="qtbmVo.score"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="16" :offset="4">
          <el-form-item label="存在不足">
            <el-input
              v-model="qtbmVo.scoreReason"
              disabled
              type="textarea"
              :rows="4"
              resize="none"
              placeholder=""
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="16" :offset="4">
          <el-form-item label="整改措施">
            <el-input
              v-model="qtbmVo.zgcs"
              disabled
              type="textarea"
              :rows="4"
              placeholder=""
              resize="none"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8" :offset="4">
          <el-form-item label="填报人">
            <el-input disabled v-model="qtbmVo.bmtbr"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="审核人">
            <el-input disabled v-model="qtbmVo.bmshr"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="16" :offset="4">
            <el-form-item label="佐证材料" style="margin-bottom: 0px;">
              <span @click="downfile(qtbmVo.fileId)" style="margin-left: 5px;cursor:pointer;" title="下载" class="hoverA">{{qtbmVo.fileName}}</span>
            </el-form-item>
        </el-col>
      </el-row>
      <!-- <el-row>
        <el-col :span="16" :offset="4">
          <el-form-item label="文件下载" style="margin-bottom: 0px;">
            <a :href="`${fileDownload}?id=${item.fileId}`" v-for="(item,index) in zpbmlist.fileVOList" :key="index" style="margin-left: 20px;" title="下载">{{item.fileName}}</a>
          </el-form-item>
        </el-col>
      </el-row> -->
    </el-form>
    <div style="text-align: center;margin-top:10px">
      <el-button type="primary" size="small" class="iconfont iconfanhui" @click="go_index()">返回</el-button>
    </div>
  </div>
</template>

<script>
import {
  getDetailList,
} from "@/api/headResponsibility/selfAudit/index.js";
import { fileDownload } from "@/api/index.js";
export default {
  data() {
    return {
      taskInfo: {},
      fileDownload: `${fileDownload}`,
      phbmVOLists: [],
      qtbmVo: {}
    };
  },
  created() {
    this.get_detailList();
  },
  methods: {
    //返回
    go_index() {
      // this.$router.push("/accountability/selfAudit");
      this.$router.back(-1);
    },
    //获取详情页数据
    get_detailList() {
      let params = {
        id: this.$route.query.id
      };
      getDetailList(params)
        .then(res => {
          if (res.infoCode == 200) {
            this.taskInfo = res.data.taskInfo; //基本信息列表
            this.qtbmVo = res.data.qtbmVO; //牵头部门
            this.phbmVOLists = res.data.phbmVOList//配合部门列表
          }else {
            this.$message({
              message: res.msg,
              type: "error",
              duration: 2000
            });
          }
        })
    },
    downfile(id){
      window.location.href = `${fileDownload}?id=${id}`
    }
  }
};
</script>

<style lang='scss'>
.selfAuditDetail {
  // .lastDialog{
  //   .el-form-item__label{
  //     line-height: 20px;
  //     padding-top: 10px;
  //   }
  // }
  .hoverA:hover{
    color: #06c;
  }
}
</style>
