EmrRelieveRule.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <div class="layout_container">
  3. <header>
  4. <cy-date-range v-model="queryParam.dateRange" />
  5. <el-select v-model="queryParam.flag" style="width: 120px">
  6. <el-option label="全部" :value="-1" />
  7. <el-option label="待审核" :value="0" />
  8. <el-option label="通过" :value="1" />
  9. <el-option label="不通过" :value="2" />
  10. </el-select>
  11. <el-button icon="Search" @click="queryData()" type="primary"
  12. >查询
  13. </el-button>
  14. <el-button icon="Download" @click="download" type="primary"
  15. >导出
  16. </el-button>
  17. </header>
  18. <div class="layout_main layout_el-table">
  19. <xc-table :data="queryParam" @current-change="currentPage" open-paging>
  20. <el-table-column label="住院号" prop="patNo" width="90" />
  21. <el-table-column label="次数" prop="times" width="90" />
  22. <el-table-column label="申请人" prop="applicantName" width="90" />
  23. <el-table-column label="申请时间" prop="applicationTime" width="130" />
  24. <el-table-column label="申请权限" prop="unlockJson" width="130" />
  25. <el-table-column label="申请编辑" prop="effectiveTime" width="130" />
  26. <el-table-column
  27. label="申请备注"
  28. prop="requestRemarks"
  29. width="450"
  30. show-overflow-tooltip
  31. show-tooltip-when-overflow
  32. />
  33. <el-table-column label="状态" prop="state" width="100">
  34. <template #default="{ row }">
  35. <component :is="stateHtml(row.state)" />
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="审核人" prop="approveName" width="90" />
  39. <el-table-column label="审核时间" prop="reviewTime" width="130" />
  40. <el-table-column label="审核备注" prop="reviewNotes" width="130" />
  41. <el-table-column label="操作" width="120" fixed="right">
  42. <template #default="{ row }">
  43. <el-button @click="approved(row)">通过</el-button>
  44. <el-button @click="refuseToPass(row)">拒绝</el-button>
  45. </template>
  46. </el-table-column>
  47. </xc-table>
  48. </div>
  49. </div>
  50. </template>
  51. <script setup>
  52. import {
  53. getApplicationData,
  54. reviewMedicalRecordsToUnlock,
  55. } from "@/api/zhu-yuan-yi-sheng/emr-control-rule";
  56. import XcTable from "@/components/xiao-chan/xc-table/XcTable.vue";
  57. import { ElMessageBox, ElTag } from "element-plus";
  58. import { clone } from "@/utils/clone";
  59. import { downloadExcel } from "@/utils/excel";
  60. import CyDateRange from "@/components/cy/date-range/CyDateRange.vue";
  61. const queryParam = ref({
  62. dateRange: [],
  63. flag: 0,
  64. currentPage: 1,
  65. pageSize: 30,
  66. total: 0,
  67. data: [],
  68. });
  69. const queryData = (total = 0) => {
  70. queryParam.value.total = total;
  71. getApplicationData(queryParam.value).then(res => {
  72. queryParam.value.data = res.records;
  73. queryParam.value.total = res.total;
  74. });
  75. };
  76. const currentPage = val => {
  77. queryParam.value.currentPage = val;
  78. queryData(queryParam.value.total);
  79. };
  80. const download = () => {
  81. const tempData = {
  82. param: queryParam.value,
  83. url: "/emrControlRule/exportExcelUnlock",
  84. fileName: "质控解锁导出",
  85. };
  86. setTimeout(() => {
  87. downloadExcel(tempData);
  88. });
  89. };
  90. const approved = row => {
  91. toExamine(row, 1);
  92. };
  93. const refuseToPass = row => {
  94. ElMessageBox.prompt("审核备注", "提示", {
  95. inputPattern: /\S/,
  96. inputErrorMessage: "审核备注不能为空",
  97. }).then(({ value }) => {
  98. toExamine(row, 2, value);
  99. });
  100. };
  101. const toExamine = (data, state, reviewNotes = "审核通过") => {
  102. let temp = clone(data);
  103. temp.state = state;
  104. temp.reviewNotes = reviewNotes;
  105. reviewMedicalRecordsToUnlock(temp).then(() => {
  106. queryData();
  107. });
  108. };
  109. onMounted(() => {
  110. queryData();
  111. });
  112. const stateHtml = val => {
  113. switch (val) {
  114. case 0:
  115. return h(
  116. ElTag,
  117. {
  118. type: "info",
  119. },
  120. { default: () => "待审核" }
  121. );
  122. case 1:
  123. return h(
  124. ElTag,
  125. {
  126. type: "success",
  127. },
  128. { default: () => "审核通过" }
  129. );
  130. case 2:
  131. return h(
  132. ElTag,
  133. {
  134. type: "danger",
  135. },
  136. { default: () => "审核拒绝" }
  137. );
  138. case 3:
  139. return h(
  140. ElTag,
  141. {
  142. type: "warning",
  143. },
  144. { default: () => "申请替换" }
  145. );
  146. }
  147. };
  148. </script>