<template>
  <div class="page">
    <div class="btn_box" style="position: absolute;top: 54px;left: 10px;">
      <el-radio-group v-model="radio1" @input="changeRadio">
        <el-radio-button label="1">窗口考核</el-radio-button>
        <el-radio-button label="2">工作人员考核</el-radio-button>
        <el-radio-button label="3">工作人员一张表</el-radio-button>
      </el-radio-group>
      <el-button
        slot="table-head-left2"
        style="margin-left: 10px"
        icon="el-icon-tickets"
        size="mini"
        @click="doExport"
        :disabled="isExport"
        >导出</el-button
      >
    </div>
    <LayoutTable :data="tableData" notAdd notDel :config="tableConfig">
    </LayoutTable>
  </div>
</template>

<script>
/** 表单弹出框模式需引入 */
import table from "@/assets/mixins/table";
export default {
  name: "WindowWorkmanPerformDetailList",

  mixins: [table],
  created() {},
  methods: {
    /** 导出Excel */
    doExport() {
      this.isExport = true;
      this.$download(
        "window/workman/perform/detail/exportExcel",
        {
          page: 1,
          size: -1,
        },
        { type: "excel" }
      )
        .then(() => (this.isExport = false))
        .catch((error) => {
          this.isExport = false;
          this.$message.error(error.message);
        });
    },
    // 切换表格
    changeRadio() {
      this.radio1 == 1
        ? this.$router.push("/check/window/perform/list?page=1")
        : this.radio1 == 2
        ? this.$router.push("/check/window/workman/perform/list?page=1")
        : this.radio1 == 3
        ? this.$router.push("/window/workman/perform/detail/list?page=1")
        : "";
    },
  },
  data() {
    return {
      radio1: "3",
      isExport: false,
      config: {
        search: [],
        columns: [
          { type: "selection", width: 60 },
          { type: "index", label: "序号", width: 50 },

          { label: "工作人员名称", prop: "staffName" },
          { label: "所属部门名称", prop: "deptName" },

          { label: "所属大厅名称", prop: "salaName" },

          {
            label: "工作纪律得分",
            prop: "discipline",
            formatter: this.formatter,
          },

          {
            label: "服务规范得分",
            prop: "specification",
            formatter: this.formatter,
          },

          {
            label: "综合管理得分",
            prop: "management",
            formatter: this.formatter,
          },

          {
            label: "群众评议得分",
            prop: "evaluation",
            formatter: this.formatter,
          },

          {
            label: "工作效能得分",
            prop: "efficiency",
            formatter: this.formatter,
          },

          { label: "加分", prop: "bonusScore", formatter: this.formatter },

          { label: "合计得分", prop: "sumScore", formatter: this.formatter },

          {
            label: "考核等级1好2较好3一般4较差",
            prop: "examineLevel",
            formatter: this.formatter,
          },
        ],
      },
    };
  },
};
</script>
<style lang="less" scoped>
/deep/.el-radio-button__inner {
  border: 1px solid #eee !important;
  height: 28px;
  line-height: 3px;
}
/deep/.el-radio-button__orig-radio:checked + .el-radio-button__inner {
  background: #00b565;
  border: none !important;
  color: #fff !important;
  line-height: 3px;
}
</style>
