ShouShuShenQing.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <el-container>
  3. <el-header style="height: 30px">
  4. 检查名称:
  5. <el-autocomplete v-model="orderName" :fetch-suggestions="querySearchAsync" clearable style="width: 220px"
  6. @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="small"
  15. start-placeholder="开始日期"
  16. style="width: 280px"
  17. type="daterange"
  18. ></el-date-picker>
  19. <el-button icon="Search" type="primary" @click="dianJiChaXunShouShu(0)">查询</el-button>
  20. <el-button icon="Plus" type="success" @click="dianJiXinZhenShouShu">新增</el-button>
  21. </el-header>
  22. <el-container>
  23. <el-aside style="width: 450px">
  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="statusName" show-overflow-tooltip></el-table-column>
  27. <el-table-column label="项目名称" prop="opName" show-overflow-tooltip></el-table-column>
  28. <el-table-column label="手术时间" prop="opDatetime" show-overflow-tooltip></el-table-column>
  29. <el-table-column fixed="right" label="操作" width="120">
  30. <template #default="scope">
  31. <el-dropdown split-button type="primary" @click="dianJiChaKanShouShu(scope.row, scope.$index)">
  32. 查看
  33. <template #dropdown>
  34. <el-dropdown-menu>
  35. <el-dropdown-item>
  36. <el-button icon="Printer" type="warning" @click="dianJiDaYing(scope.row, scope.$index)">打印
  37. </el-button>
  38. </el-dropdown-item>
  39. <br/>
  40. <el-dropdown-item>
  41. <el-button icon="Delete" type="danger" @click="dianJiShanChu(scope.row, scope.$index)"> 删除
  42. </el-button>
  43. </el-dropdown-item>
  44. </el-dropdown-menu>
  45. </template>
  46. </el-dropdown>
  47. </template>
  48. </el-table-column>
  49. </el-table>
  50. <el-pagination
  51. :current-page="shouShuShuJu.currentPage"
  52. :page-size="shouShuShuJu.pageSize"
  53. :total="shouShuShuJu.total"
  54. layout="total,prev, pager, next"
  55. small
  56. @current-change="handleCurrentChange"
  57. >
  58. </el-pagination>
  59. </el-aside>
  60. <el-main>
  61. <da-ying-shou-shu-sheng-qing-dan ref="daYing" :height="windowSize.h / 1.2"></da-ying-shou-shu-sheng-qing-dan>
  62. </el-main>
  63. </el-container>
  64. </el-container>
  65. </template>
  66. <script setup name="ShouShuShenQing">
  67. import {computed, ref, watch} from 'vue'
  68. import {
  69. huoQuShouShu,
  70. huoQuShouShuMingCheng,
  71. huoQuShouShuShenQingDaYing,
  72. shanChuShouShu
  73. } from '@/api/zhu-yuan-yi-sheng/shou-shu-shen-qing'
  74. import {huanZheXinXi, youWuXuanZheHuanZhe} from '@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng'
  75. import {shortcuts} from '@/data/shortcuts'
  76. import store from '@/store'
  77. import DaYingShouShuShengQingDan from '@/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/DaYingShouShuShengQingDan.vue'
  78. import {stringNotBlank} from '@/utils/blank-utils'
  79. import router from '@/router'
  80. import {ElMessageBox} from 'element-plus'
  81. const windowSize = computed(() => {
  82. return store.state.app.windowSize
  83. })
  84. const orderName = ref('')
  85. const dateRange = ref([])
  86. const daYing = ref()
  87. const tableIndex = ref(-1)
  88. const shouShuShuJu = ref({
  89. data: [],
  90. currentPage: 1,
  91. pageSize: 20,
  92. total: 0,
  93. })
  94. const dianJiChaXunShouShu = (val) => {
  95. const data = {
  96. patNo: huanZheXinXi.value.inpatientNo,
  97. times: huanZheXinXi.value.admissTimes,
  98. currentPage: shouShuShuJu.value.currentPage,
  99. pageSize: shouShuShuJu.value.pageSize,
  100. total: val,
  101. }
  102. huoQuShouShu(data).then((res) => {
  103. if (val === 0) {
  104. shouShuShuJu.value.total = res.total
  105. }
  106. shouShuShuJu.value.data = res.records
  107. })
  108. }
  109. const querySearchAsync = (val, cd) => {
  110. if (youWuXuanZheHuanZhe()) return
  111. if (val.length > 1) {
  112. huoQuShouShuMingCheng(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, val).then((res) => {
  113. cd(res)
  114. })
  115. }
  116. }
  117. const handleCurrentChange = (val) => {
  118. shouShuShuJu.value.currentPage = val
  119. dianJiChaXunShouShu(shouShuShuJu.value.total)
  120. }
  121. const dianJiDaYing = (row, index) => {
  122. huoQuShouShuShenQingDaYing(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, row.recordId).then((res) => {
  123. daYing.value.data = res
  124. tableIndex.value = index
  125. if (stringNotBlank(res.applyDate)) {
  126. res.applyDate = res.applyDate.split(' ')[0]
  127. }
  128. if (stringNotBlank(res.opDatetime)) {
  129. res.opDatetime = res.opDatetime.split(' ')[0]
  130. }
  131. setTimeout(() => {
  132. daYing.value.daYing()
  133. }, 500)
  134. })
  135. }
  136. const dianJiChaKanShouShu = (row, index) => {
  137. huoQuShouShuShenQingDaYing(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, row.recordId).then((res) => {
  138. daYing.value.data = res
  139. tableIndex.value = index
  140. console.log(res)
  141. if (stringNotBlank(res.applyDate)) {
  142. res.applyDate = res.applyDate.split(' ')[0]
  143. }
  144. if (stringNotBlank(res.opDatetime)) {
  145. res.opDatetime = res.opDatetime.split(' ')[0]
  146. }
  147. })
  148. }
  149. const dianJiShanChu = (row, index) => {
  150. ElMessageBox.confirm(`您确定要删除【${row.opName}】吗?`, '提示', {})
  151. .then(() => {
  152. shanChuShouShu(row.recordId)
  153. })
  154. .catch(() => {
  155. })
  156. }
  157. watch(
  158. () => huanZheXinXi.value,
  159. () => {
  160. dianJiChaXunShouShu(0)
  161. }
  162. )
  163. const rowClass = ({rowIndex}) => {
  164. if (rowIndex === tableIndex.value) {
  165. return 'success-row'
  166. } else {
  167. return ''
  168. }
  169. }
  170. const dianJiXinZhenShouShu = () => {
  171. router.push({
  172. name: 'xinZengShuJu',
  173. params: {
  174. name: '手术',
  175. passRule: true,
  176. },
  177. query: {
  178. path: '/inpatient/zhuYuanYiSheng/shouShuShenQing',
  179. },
  180. })
  181. }
  182. </script>
  183. <style scoped>
  184. :deep(.el-table .success-row) {
  185. background: rgba(71, 123, 220, 0.69);
  186. }
  187. </style>