ShouShuShenQing.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <div style="height: 30px">
  3. 申请时间:
  4. <el-date-picker
  5. v-model="dateRange"
  6. :shortcuts="shortcuts"
  7. end-placeholder="结束日期"
  8. placeholder="选择日期"
  9. range-separator="至"
  10. size="small"
  11. start-placeholder="开始日期"
  12. style="width: 280px"
  13. type="daterange"
  14. ></el-date-picker>
  15. <el-button icon="Search" type="primary" @click="dianJiChaXunShouShu(0)">查询</el-button>
  16. <el-button icon="Plus" type="success" @click="dianJiXinZhenShouShu">新增</el-button>
  17. <el-button icon="Check" type="success" @click="clickSave">保存手术</el-button>
  18. <el-button type="danger" @click="error.dialog = true">打开错误信息</el-button>
  19. </div>
  20. <div style="display: flex">
  21. <div>
  22. <el-table :data="shouShuShuJu.data"
  23. :height="getWindowSize.h - (yzHeaderSize + 10)"
  24. highlight-current-row
  25. @row-click="dianJiChaKanShouShu">
  26. <el-table-column label="申请号" prop="recordId" show-overflow-tooltip></el-table-column>
  27. <el-table-column label="申请号" prop="statusName" show-overflow-tooltip></el-table-column>
  28. <el-table-column label="项目名称" prop="opName" show-overflow-tooltip></el-table-column>
  29. <el-table-column label="手术时间" prop="opDatetime" show-overflow-tooltip></el-table-column>
  30. <el-table-column fixed="right" label="操作" width="120">
  31. <template #default="scope">
  32. <el-button icon="Delete" type="danger" @click.stop="dianJiShanChu(scope.row, scope.$index)">
  33. 删除
  34. </el-button>
  35. </template>
  36. </el-table-column>
  37. </el-table>
  38. <el-pagination
  39. :current-page="shouShuShuJu.currentPage"
  40. :page-size="shouShuShuJu.pageSize"
  41. :total="shouShuShuJu.total"
  42. layout="total,prev, pager, next"
  43. small
  44. @current-change="handleCurrentChange">
  45. </el-pagination>
  46. </div>
  47. <div>
  48. <el-tabs v-model="tabs" closable
  49. @tab-remove="removeTab">
  50. <el-tab-pane v-for="(item,index) in operationApplication"
  51. :label="tabsName(item.opName,index)"
  52. :name="index + 1">
  53. <bian-ji-shou-shu
  54. :anesthetic-mode="anestheticMode"
  55. :data="item"
  56. :item="index"/>
  57. </el-tab-pane>
  58. <el-tab-pane label="手术查看" :name="0">
  59. <da-ying-shou-shu-sheng-qing-dan
  60. ref="daYing"
  61. :height="getWindowSize.h - (yzHeaderSize + 70)"/>
  62. </el-tab-pane>
  63. </el-tabs>
  64. <surgical-error-info :data="error"/>
  65. </div>
  66. </div>
  67. </template>
  68. <script setup name="ShouShuShenQing">
  69. import {computed, ref, watch} from 'vue'
  70. import {
  71. huoQuShouShu,
  72. huoQuShouShuMingCheng,
  73. huoQuShouShuShenQingDaYing,
  74. shanChuShouShu, xinZengShouShuShenQing
  75. } from '@/api/zhu-yuan-yi-sheng/shou-shu-shen-qing'
  76. import {
  77. huanZheXinXi,
  78. operationApplication,
  79. youWuXuanZheHuanZhe, yzHeaderSize
  80. } from '@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng'
  81. import {shortcuts} from '@/data/shortcuts'
  82. import store from '@/store'
  83. import DaYingShouShuShengQingDan from '@/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/DaYingShouShuShengQingDan.vue'
  84. import {stringIsBlank, stringNotBlank} from '@/utils/blank-utils'
  85. import {ElMessageBox} from 'element-plus'
  86. import BianJiShouShu from "@/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/BianJiShouShu";
  87. import {getServerDateApi, maZuiFangShi} from "@/api/public-api";
  88. import SurgicalErrorInfo from "@/components/zhu-yuan-yi-sheng/shou-shu-shen-qing/SurgicalErrorInfo";
  89. import {BizException, ExceptionEnum} from "@/utils/BizException";
  90. import {getWindowSize} from "@/utils/window-size";
  91. import {isDev} from "@/utils/public";
  92. const windowSize = computed(() => {
  93. return store.state.app.windowSize
  94. })
  95. const orderName = ref('')
  96. const dateRange = ref([])
  97. const daYing = ref()
  98. const tabs = ref(0)
  99. const shouShuShuJu = ref({
  100. data: [],
  101. currentPage: 1,
  102. pageSize: 20,
  103. total: 0,
  104. })
  105. const error = ref({
  106. dialog: false,
  107. msg: {}
  108. })
  109. /**
  110. * 点击查询手术
  111. * @param val
  112. */
  113. const dianJiChaXunShouShu = (val) => {
  114. const data = {
  115. patNo: huanZheXinXi.value.inpatientNo,
  116. times: huanZheXinXi.value.admissTimes,
  117. currentPage: shouShuShuJu.value.currentPage,
  118. pageSize: shouShuShuJu.value.pageSize,
  119. total: val,
  120. }
  121. huoQuShouShu(data).then((res) => {
  122. if (val === 0) {
  123. shouShuShuJu.value.total = res.total
  124. }
  125. shouShuShuJu.value.data = res.records
  126. })
  127. }
  128. /**
  129. * 点击分页
  130. * @param val
  131. */
  132. const handleCurrentChange = (val) => {
  133. shouShuShuJu.value.currentPage = val
  134. dianJiChaXunShouShu(shouShuShuJu.value.total)
  135. }
  136. const tabsName = (val, index) => {
  137. if (stringIsBlank(val)) {
  138. return '添加手术' + index;
  139. }
  140. return val
  141. }
  142. const clickSave = async () => {
  143. if (youWuXuanZheHuanZhe()) return
  144. let data = huanZheXinXi.value
  145. data.execDept = store.state.user.info.deptCode
  146. data.list = operationApplication.value
  147. try {
  148. await ElMessageBox.confirm('是否要生成全排斥医嘱?', '提示', {
  149. type: 'warning',
  150. confirmButtonText: '生成排斥医嘱',
  151. cancelButtonText: '生成处置医嘱',
  152. distinguishCancelAndClose: true
  153. })
  154. data.generateRejectedOrders = true
  155. } catch (e) {
  156. if (e === 'cancel') {
  157. data.generateRejectedOrders = false
  158. } else {
  159. return
  160. }
  161. }
  162. xinZengShouShuShenQing(data).then((res) => {
  163. if (res !== null && res.error !== null) {
  164. error.value.dialog = true
  165. error.value.msg = res.data
  166. } else {
  167. tabs.value = 0
  168. operationApplication.value = []
  169. }
  170. })
  171. }
  172. const removeTab = (targetName) => {
  173. if (targetName === 0) {
  174. BizException(ExceptionEnum.MESSAGE_ERROR, '无法删除')
  175. }
  176. operationApplication.value.splice(targetName - 1, 1)
  177. tabs.value = tabs.value - 1
  178. }
  179. const dianJiChaKanShouShu = (row) => {
  180. huoQuShouShuShenQingDaYing(huanZheXinXi.value.inpatientNo, huanZheXinXi.value.admissTimes, row.recordId).then((res) => {
  181. daYing.value.data = res
  182. if (stringNotBlank(res.applyDate)) {
  183. res.applyDate = res.applyDate.split(' ')[0]
  184. }
  185. if (stringNotBlank(res.opDatetime)) {
  186. res.opDatetime = res.opDatetime.split(' ')[0]
  187. }
  188. })
  189. tabs.value = 0
  190. }
  191. const dianJiShanChu = (row, index) => {
  192. ElMessageBox.confirm(`您确定要删除【${row.opName}】吗?`, '提示', {})
  193. .then(() => {
  194. shanChuShouShu(row.recordId)
  195. shouShuShuJu.value.data.splice(index, 1)
  196. })
  197. .catch(() => {
  198. })
  199. }
  200. watch(
  201. () => huanZheXinXi.value,
  202. () => {
  203. dianJiChaXunShouShu(0)
  204. },
  205. {immediate: true}
  206. )
  207. const dianJiXinZhenShouShu = async () => {
  208. operationApplication.value.push({
  209. inpatientNo: huanZheXinXi.value.inpatientNo,
  210. admissTimes: huanZheXinXi.value.admissTimes,
  211. opCode: '',
  212. opName: '添加手术' + operationApplication.value.length,
  213. applyDate: await getServerDateApi(),
  214. opDatetime: '',
  215. urgentClinicFlag: '',
  216. ssbc: '',
  217. diagBeforeCode: '',
  218. ybSelfFlag: '',
  219. partCode: '',
  220. opScale: '',
  221. hocusCode: '',
  222. doctorZd: '',
  223. doctor1: '',
  224. doctor2: '',
  225. doctor3: '',
  226. doctorMz: '',
  227. nurseQx: '',
  228. nurseXh: '',
  229. remark: '',
  230. })
  231. tabs.value = operationApplication.value.length
  232. }
  233. // 麻醉方式
  234. const anestheticMode = ref()
  235. onMounted(() => {
  236. maZuiFangShi().then(res => {
  237. anestheticMode.value = res
  238. })
  239. if (isDev) {
  240. dianJiXinZhenShouShu()
  241. }
  242. })
  243. </script>
  244. <style scoped>
  245. :deep(.el-table .success-row) {
  246. background: rgba(71, 123, 220, 0.69);
  247. }
  248. </style>