btnCopyItem.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div>
  3. <el-button size="mini" @click="click">复制指标</el-button>
  4. <el-dialog title="历史绩效" :visible.sync="open" width="1000px" :close-on-click-modal="false">
  5. 复制操作将覆盖当前绩效指标
  6. <el-table size="mini" height="500px" v-loading="loading" :data="listData" @row-dblclick="btnCopy">
  7. <el-table-column label="员工" align="center" prop="staffName" />
  8. <el-table-column label="评估周期" align="center" prop="name" />
  9. <el-table-column label="月度" align="center" prop="month" />
  10. <el-table-column label="创建时间" align="center" prop="createTime" />
  11. <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
  12. <template slot-scope="scope">
  13. <el-button
  14. size="mini"
  15. type="text"
  16. icon="el-icon-document-copy"
  17. @click="btnCopy(scope.row)"
  18. >复制</el-button>
  19. </template>
  20. </el-table-column>
  21. </el-table>
  22. <div>
  23. <pagination
  24. v-show="total>0"
  25. :total="total"
  26. :page.sync="queryParams.pageNum"
  27. :limit.sync="queryParams.pageSize"
  28. @pagination="getList"
  29. />
  30. </div>
  31. </el-dialog>
  32. </div>
  33. </template>
  34. <script>
  35. import { listPerformance,getPerformance} from "@/api/business/ehr/pm/performance";
  36. export default {
  37. name: "CopyItemDialog",
  38. props: [],
  39. data() {
  40. return {
  41. // 查询参数
  42. queryParams: {
  43. pageNum: 1,
  44. pageSize: 10,
  45. staff: null,
  46. },
  47. // 总条数
  48. total: 0,
  49. // 表格数据
  50. listData: [],
  51. // 遮罩层
  52. loading: true,
  53. // 是否显示弹出层
  54. open: false,
  55. };
  56. },
  57. methods: {
  58. /** 查询绩效列表 */
  59. getList() {
  60. this.loading = true;
  61. listPerformance(this.queryParams).then(response => {
  62. this.listData = response.rows;
  63. this.total = response.total;
  64. this.loading = false;
  65. });
  66. },
  67. //点击了当前按钮
  68. click() {
  69. this.queryParams.staff = this.$store.state.user.name;
  70. this.open = true;
  71. this.getList();
  72. },
  73. //复制
  74. async btnCopy(row){
  75. let res = await getPerformance(row.id);
  76. if(res.code === 200){
  77. this.$emit('setItems',res.data.performanceItem);
  78. this.$modal.msgSuccess("复制成功");
  79. this.open = false;
  80. }
  81. },
  82. },
  83. created() {},
  84. };
  85. </script>