<template>
  <div>
    <el-button size="mini" @click="click">绩效审批记录</el-button>
    <el-dialog title="绩效审批记录" :visible.sync="open" width="1000px" :close-on-click-modal="false">
      <el-table size="mini" height="500px" v-loading="loading" :data="listData">
        <el-table-column label="时间" align="center" prop="createTime" />
        <el-table-column label="阶段" align="center" prop="performanceStatus" >
          <template slot-scope="scope">
            <dict-tag :options="dict.type.ehr_pm_status" :value="scope.row.performanceStatus"/>
          </template>
        </el-table-column>
        <el-table-column label="评估人" align="center" prop="staffName" />
        <el-table-column label="状态" align="center" prop="status" >
          <template slot-scope="scope">
            <dict-tag :options="dict.type.ehr_pm_flow_status" :value="scope.row.status"/>
          </template>
        </el-table-column>
        <el-table-column label="意见" align="center" prop="result" />
      </el-table>
    </el-dialog>
  </div>
</template>


<script>
import { listFlow} from "@/api/business/ehr/pm/flow";
export default {
  name: "ApproveLogDialog",
  dicts: ['ehr_pm_status','ehr_pm_flow_status'],
  props: ['pmId'],
  data() {
    return {
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 1000,
        performanceId: null,
      },
      // 总条数
      total: 0,
      // 表格数据
      listData: [],
      // 遮罩层
      loading: true,
      // 是否显示弹出层
      open: false,
    };
  },
  watch: {},
  methods: {
    //点击了当前按钮
    click() {
      this.queryParams.performanceId = this.pmId;
      this.open = true;
      this.loading = true;
      listFlow(this.queryParams).then(response => {
        this.listData = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
  },
  created() {},
  mounted() {},
  destroyed() {},
};
</script>
