btnCopyItem.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <div>
  3. <el-button type="primary" 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} from "@/api/business/ehr/pm/performance";
  36. export default {
  37. name: "CopyItemDialog",
  38. props: ["id"],
  39. data() {
  40. return {
  41. // 查询参数
  42. queryParams: {
  43. pageNum: 1,
  44. pageSize: 10,
  45. staff: null,
  46. params:{
  47. neId: null,
  48. },
  49. },
  50. // 总条数
  51. total: 0,
  52. // 表格数据
  53. listData: [],
  54. // 遮罩层
  55. loading: true,
  56. // 是否显示弹出层
  57. open: false,
  58. };
  59. },
  60. methods: {
  61. /** 查询绩效列表 */
  62. getList() {
  63. this.loading = true;
  64. listPerformance(this.queryParams).then(response => {
  65. this.listData = response.rows;
  66. this.total = response.total;
  67. this.loading = false;
  68. });
  69. },
  70. //点击了当前按钮
  71. click() {
  72. this.queryParams.staff = this.$store.state.user.name;
  73. this.open = true;
  74. this.getList();
  75. },
  76. //复制
  77. async btnCopy(row){
  78. this.$emit('setItems',row.id);
  79. this.open = false;
  80. },
  81. },
  82. created() {
  83. this.queryParams.params.neId = this.id;
  84. },
  85. };
  86. </script>