ShouShuShenQing.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <el-container>
  3. <el-header style="height: 30px">
  4. 检查名称:
  5. <el-autocomplete v-model="orderName" :fetch-suggestions="querySearchAsync" clearable
  6. style="width: 220px" @keyup.enter="dianJiChaXunShouShu(0)"></el-autocomplete>
  7. 申请时间:
  8. <el-date-picker
  9. v-model="dateRange"
  10. :shortcuts="shortcuts"
  11. end-placeholder="结束日期"
  12. placeholder="选择日期"
  13. range-separator="至"
  14. size="mini"
  15. start-placeholder="开始日期"
  16. style="width: 280px"
  17. type="daterange"
  18. ></el-date-picker>
  19. <el-button icon="el-icon-search" type="primary" @click="dianJiChaXunShouShu(0)">查询</el-button>
  20. <el-button icon="el-icon-plus" type="success" @click="dianJiXinZhenShouShu">新增</el-button>
  21. </el-header>
  22. <el-container>
  23. <el-aside>
  24. <el-table :data="shouShuShuJu.data" :height="windowSize.h / 1.4" :row-class-name="rowClass">
  25. <el-table-column label="申请号" prop="recordId" show-overflow-tooltip></el-table-column>
  26. <el-table-column label="项目名称" prop="opName" show-overflow-tooltip></el-table-column>
  27. <el-table-column label="手术时间" prop="opDatetime" show-overflow-tooltip></el-table-column>
  28. <el-table-column fixed="right" label="操作" width="80">
  29. <template #default="scope">
  30. <el-button circle icon="el-icon-view" title="查看"
  31. @click="dianJiChaKanShouShu(scope.row,scope.$index)"></el-button>
  32. <el-button circle icon="iconfont icon-dayin" title="打印"
  33. @click="dianJiDaYing(scope.row,scope.$index)"></el-button>
  34. </template>
  35. </el-table-column>
  36. </el-table>
  37. <el-pagination
  38. :current-page="shouShuShuJu.currentPage"
  39. :page-size="shouShuShuJu.pageSize"
  40. :total="shouShuShuJu.total"
  41. layout="total,prev, pager, next"
  42. small
  43. @current-change="handleCurrentChange">
  44. </el-pagination>
  45. </el-aside>
  46. <el-main>
  47. <da-ying-shou-shu-sheng-qing-dan ref="daYing" :height="windowSize.h / 1.4"></da-ying-shou-shu-sheng-qing-dan>
  48. </el-main>
  49. </el-container>
  50. </el-container>
  51. </template>
  52. <script>
  53. import {computed, ref, watch} from "vue";
  54. import {
  55. huoQuShouShu,
  56. huoQuShouShuMingCheng,
  57. huoQuShouShuShenQingDaYing
  58. } from "@/api/zhu-yuan-yi-sheng/shou-shu-shen-qing";
  59. import {huanZheXinXi, youWuXuanZheHuanZhe} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
  60. import {shortcuts} from '@/data/shortcuts'
  61. import store from "@/store";
  62. import DaYingShouShuShengQingDan from "@/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/DaYingShouShuShengQingDan.vue";
  63. import {stringNotBlank} from "@/utils/blank-utils";
  64. import router from "@/router";
  65. export default {
  66. name: "ShouShuShenQing",
  67. components: {DaYingShouShuShengQingDan},
  68. setup() {
  69. const windowSize = computed(() => {
  70. return store.state.app.windowSize
  71. })
  72. const orderName = ref('')
  73. const dateRange = ref([])
  74. const daYing = ref()
  75. const tableIndex = ref(-1)
  76. const shouShuShuJu = ref({
  77. data: [],
  78. currentPage: 1,
  79. pageSize: 20,
  80. total: 0
  81. })
  82. const dianJiChaXunShouShu = (val) => {
  83. const data = {
  84. patNo: huanZheXinXi.value.inpatientNo,
  85. times: huanZheXinXi.value.admissTimes,
  86. currentPage: shouShuShuJu.value.currentPage,
  87. pageSize: shouShuShuJu.value.pageSize,
  88. total: val
  89. }
  90. huoQuShouShu(data).then((res) => {
  91. if (val === 0) {
  92. shouShuShuJu.value.total = res.total
  93. }
  94. shouShuShuJu.value.data = res.records
  95. })
  96. }
  97. const querySearchAsync = (val, cd) => {
  98. if (youWuXuanZheHuanZhe()) return
  99. if (val.length > 1) {
  100. huoQuShouShuMingCheng(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, val).then((res) => {
  101. cd(res)
  102. })
  103. }
  104. }
  105. const handleCurrentChange = (val) => {
  106. shouShuShuJu.value.currentPage = val
  107. dianJiChaXunShouShu(shouShuShuJu.value.total)
  108. }
  109. const dianJiDaYing = (row, index) => {
  110. huoQuShouShuShenQingDaYing(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, row.recordId).then((res) => {
  111. daYing.value.data = res
  112. tableIndex.value = index
  113. if (stringNotBlank(res.applyDate)) {
  114. res.applyDate = res.applyDate.split(" ")[0]
  115. }
  116. if (stringNotBlank(res.opDatetime)) {
  117. res.opDatetime = res.opDatetime.split(" ")[0]
  118. }
  119. setTimeout(() => {
  120. daYing.value.daYing()
  121. }, 500)
  122. })
  123. }
  124. const dianJiChaKanShouShu = (row, index) => {
  125. huoQuShouShuShenQingDaYing(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, row.recordId).then((res) => {
  126. daYing.value.data = res
  127. tableIndex.value = index
  128. console.log(res)
  129. if (stringNotBlank(res.applyDate)) {
  130. res.applyDate = res.applyDate.split(" ")[0]
  131. }
  132. if (stringNotBlank(res.opDatetime)) {
  133. res.opDatetime = res.opDatetime.split(" ")[0]
  134. }
  135. })
  136. }
  137. watch(() => huanZheXinXi.value, () => {
  138. dianJiChaXunShouShu(0)
  139. })
  140. const rowClass = ({rowIndex}) => {
  141. if (rowIndex === tableIndex.value) {
  142. return 'success-row'
  143. } else {
  144. return ''
  145. }
  146. }
  147. const dianJiXinZhenShouShu = () => {
  148. if (youWuXuanZheHuanZhe()) return
  149. router.push('/inpatient/zhuYuanYiSheng/xinZengShouShuShenQing')
  150. }
  151. return {
  152. orderName,
  153. dianJiChaXunShouShu,
  154. dateRange,
  155. shortcuts,
  156. querySearchAsync,
  157. shouShuShuJu,
  158. windowSize,
  159. handleCurrentChange,
  160. dianJiChaKanShouShu,
  161. dianJiDaYing,
  162. daYing,
  163. rowClass,
  164. dianJiXinZhenShouShu,
  165. }
  166. }
  167. }
  168. </script>
  169. <style scoped>
  170. :deep(.el-table .success-row) {
  171. background: rgba(71, 123, 220, 0.69);
  172. }
  173. </style>