<template>
  <div class="page">
    <LayoutTable :data="tableData" notAdd notDel :config="tableConfig">
    </LayoutTable>

    <dialog-show ref="dialogform" @ok="getData" />
  </div>
</template>

<script>
/** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow";
import table from "@/assets/mixins/table";
export default {
  name: "StaffPerformSummaryList",
  components: {
    dialogShow,
  },
  mixins: [table],
  created() {},
  methods: {
    /** 重写新增方法 */
    toAdd(row) {
      this.$refs.dialogform.add(row);
    },
    /** 重写编辑方法 */
    toEdit(row) {
      this.$refs.dialogform.edit(row);
    },
    /** 重写查看方法 */
    toView(row) {
      this.$refs.dialogform.view(row);
    },
  },
  data() {
    return {
      config: {
        isshowTabPane: true,
        search: [
          {
            name: "createTimeStart",
            type: "date",
            label: "月份",
          },

          {
            name: "deptId",
            type: "select",
            label: "所属部门",
          },

          {
            name: "staffName",
            type: "text",
            label: "员工姓名",
          },
        ],
        columns: [
          { type: "selection", width: 60 },
          { type: "index", label: "序号", width: 50 },

          { label: "姓名", prop: "staffName" },

          { label: "工号", prop: "workNum" },

          { label: "所属部门", prop: "deptName" },

          { label: "考勤绩效", prop: "attendScore", formatter: this.formatter },

          { label: "评价绩效", prop: "assessScore", formatter: this.formatter },

          { label: "办件绩效", prop: "workScore", formatter: this.formatter },

          { label: "效能绩效", prop: "effectScore", formatter: this.formatter },

          { label: "其它绩效", prop: "otherScore", formatter: this.formatter },

          {
            label: "累计异常分数",
            prop: "errorScore",
            formatter: this.formatter,
          },

          {
            label: "本月得分数",
            prop: "totalScore",
            formatter: this.formatter,
          },
          {
            label: "操作",
            width: 240,
            formatter: (row) => {
              return (
                <table-buttons
                  noAdd
                  noEdit
                  noDel
                  row={row}
                  onEdit={this.toEdit}
                  onView={this.toView}
                  onDel={this.toDel}
                />
              );
            },
          },
        ],
      },
    };
  },
};
</script>
