<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>
        <el-col :span="8" :offset="4">
          <el-form-item label="自评牵头部门" prop="qtbm">
            <el-input
              v-model="sectionData.qtbm"
              disabled
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="自评配合部门">
            <!-- <el-select placeholder="请选择" multiple v-model="taskInfo.phbm" disabled>
              <el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in zpbmList"></el-option>
            </el-select> -->
            <el-input
              v-model="sectionData.phbm"
              disabled
            ></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="sectionData.cityQtbm"
              disabled
            ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="市配合部门">
            <el-input
              v-model="sectionData.cityPhbm"
              disabled
            ></el-input>
            <!-- <el-select
              multiple
              v-model="taskInfo.cityPhbm"
              disabled
            >
              <el-option
                v-for="item in assessmentTargetDeptName2"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select> -->
          </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="qujiZp" border stripe highlight-current-row>
            <el-table-column align="center" prop="deptName" label="部门"></el-table-column>
            <!-- <el-table-column align="center" prop="statusValue" label="状态"></el-table-column> -->
            <el-table-column align="center" label="是否牵头">
              <template slot-scope="scope">
                <span v-if="scope.row.type == 40">否</span>
                <span v-if="scope.row.type == 50">是</span>
              </template>
            </el-table-column>
            <el-table-column align="center" prop="score" 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 style="margin-bottom: 10px;">
        <el-col :span="16" :offset="4">
          <el-table :data="cityIdea" border stripe highlight-current-row>
            <el-table-column align="center" prop="deptName" label="部门"></el-table-column>
            <el-table-column align="center" label="是否牵头">
              <template slot-scope="scope">
                <span v-if="scope.row.type == 10">否</span>
                <span v-if="scope.row.type == 20">是</span>
              </template>
            </el-table-column>
            <el-table-column align="center" prop="score" label="考核得分"></el-table-column>
            <el-table-column align="center" prop="status" label="状态">
              <template slot-scope="scope">
                <span v-if='scope.row.status == 10'>未录入</span>
                <span v-if='scope.row.status == 20'>已录入</span>
                <span v-if='scope.row.status == 30'>已提交</span>
              </template>
            </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" v-if="$route.query.isSelected != '未抽中'">
        <el-col :span="24">
          <h3 class="titH3">实地抽查</h3>
        </el-col>
      </el-row>
      <el-row v-if="$route.query.isSelected != '未抽中'">
        <el-col :span="16" :offset="4">
            <el-table :data="selCheckData" border stripe highlight-current-row>
            <el-table-column align="center" prop="deptName" label="部门"></el-table-column>
            <el-table-column align="center" label="是否牵头">
              <template slot-scope="scope">
                <span v-if="scope.row.type == 70">否</span>
                <span v-if="scope.row.type == 60">是</span>
              </template>
            </el-table-column>
            <el-table-column align="center" prop="score" label="抽查得分"></el-table-column>
            <el-table-column align="center" prop="status" label="状态">
              <template slot-scope="scope">
                <span v-if='scope.row.status == 10'>未录入</span>
                <span v-if='scope.row.status == 20'>已录入</span>
                <span v-if='scope.row.status == 30'>已提交</span>
              </template>
            </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.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-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 * as management from "@/api/headResponsibility/assessmentTaskQuery";
import { fileDownload } from "@/api/index.js";
export default {
  data() {
    return {
      sectionData: {},
      taskInfo: {},
      cityIdea: [],
      qujiZp: [],
      fileDownload: `${fileDownload}`,
      qtbmVo: {},
      selCheckData: []
    };
  },
  created() {
    this.getsshijkhxx()
  },
  methods: {
    //返回
    go_index() {
      this.$router.back(-1);
    },
    //获取市级考核信息
    getsshijkhxx() {
      let params = {
        areaCode: this.$route.query.areaCode,
        taskId: this.$route.query.taskId
      };
      management.shijikhxx(params)
        .then(res => {
          if (res.infoCode == 200) {
            this.taskInfo = res.data.taskInfoVO
            this.qujiZp = res.data.opionVOList
            this.cityIdea = res.data.cityVOList
            // this.qtbmVo = res.data.cityVOList[0]
            this.sectionData = res.data
            this.selCheckData = res.data.ccCityVOList
          }else {
            if(res.msg != '单位信息查询失败') {
              this.$message({
                type: 'error',
                message: res.msg,
                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>
