index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div>
  3. <div class="app-container" v-if="isList">
  4. <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true">
  5. <el-form-item label="员工" prop="staffName">
  6. <el-input
  7. v-model="queryParams.staffName"
  8. clearable
  9. @keyup.enter.native="btnSearch"
  10. />
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button type="primary" icon="el-icon-search" size="mini" @click="btnSearch">搜索</el-button>
  14. <el-button icon="el-icon-refresh" size="mini" @click="btnResetQuery">重置</el-button>
  15. </el-form-item>
  16. </el-form>
  17. <div style="float:right">
  18. <el-button type="primary" size="mini" @click="btnGetRelation">同步EHR评估关系</el-button>
  19. </div>
  20. <el-table size="mini" height="500px" v-loading="loading" :data="listData" @row-dblclick="btnDetails">
  21. <el-table-column label="员工编号" align="center" prop="staff" />
  22. <el-table-column label="员工姓名" align="center" prop="staffName" />
  23. <el-table-column label="创建时间" align="center" prop="createTime" />
  24. <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
  25. <template slot-scope="scope">
  26. <el-button
  27. size="mini"
  28. type="text"
  29. icon="el-icon-search"
  30. @click="btnDetails(scope.row)"
  31. >详情</el-button>
  32. </template>
  33. </el-table-column>
  34. </el-table>
  35. <div class="paginationClass">
  36. <pagination
  37. v-show="total>0"
  38. :total="total"
  39. :page.sync="queryParams.pageNum"
  40. :limit.sync="queryParams.pageSize"
  41. @pagination="getList"
  42. />
  43. </div>
  44. </div>
  45. <detail v-model="isList" v-if="!isList" :enterState="page" :rowId="rowId" :ids="ids" @refresh="refresh" />
  46. </div>
  47. </template>
  48. <script>
  49. import detail from './detail.vue'
  50. import { listPsnrelation,sync} from "@/api/business/ehr/pm/psnrelation";
  51. export default {
  52. name: "psnrelation",
  53. components: {detail},
  54. data() {
  55. return {
  56. // 总条数
  57. total: 0,
  58. // 表格数据
  59. listData: [],
  60. // id集合
  61. ids: [],
  62. // 查询参数
  63. queryParams: {
  64. pageNum: 1,
  65. pageSize: 10,
  66. staffName: null,
  67. },
  68. //页面显示
  69. isList: true,
  70. //页面状态
  71. page: '',
  72. //详情id
  73. rowId: '',
  74. };
  75. },
  76. created() {
  77. this.getList();
  78. },
  79. methods: {
  80. /** 查询绩效列表 */
  81. getList() {
  82. this.loading = true;
  83. listPsnrelation(this.queryParams).then(response => {
  84. this.listData = response.rows;
  85. this.ids = response.rows.map(item => item.id);
  86. this.total = response.total;
  87. this.loading = false;
  88. });
  89. },
  90. /** 搜索按钮操作 */
  91. btnSearch() {
  92. this.queryParams.pageNum = 1;
  93. this.getList();
  94. },
  95. /** 重置按钮操作 */
  96. btnResetQuery() {
  97. this.resetForm("queryForm");
  98. this.dateRange = [];
  99. this.btnSearch();
  100. },
  101. /** 刷新 */
  102. refresh(){
  103. this.resetForm("queryForm");
  104. this.dateRange = [];
  105. this.getList();
  106. },
  107. /** 进入详情 */
  108. btnDetails(row){
  109. this.rowId = row.id;
  110. this.page = 'see';
  111. this.isList = false;
  112. },
  113. //获取EHR评估关系按钮
  114. btnGetRelation(){
  115. sync().then(response => {
  116. if(response.code == 200){
  117. this.$modal.msgSuccess(response.rows.length > 0 ? "同步成功" + "新增下列人员" + response.rows : "同步成功");
  118. this.getList();
  119. }
  120. });
  121. }
  122. }
  123. };
  124. </script>
  125. <style lang="scss" scoped>
  126. .btn_grooup {
  127. margin-bottom: 10px;
  128. display: flex;
  129. justify-content: flex-end;
  130. }
  131. .paginationClass {
  132. z-index: 500;
  133. position: fixed;
  134. bottom: 10px;
  135. right: 10px;
  136. width: 100%;
  137. line-height: var(--footer-height);
  138. color: #fff;
  139. }
  140. </style>