YzQueryCondition.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div style="display: flex">
  3. <button @click="queryYz">重置</button>
  4. <label>
  5. 显示范围:
  6. <select v-model="queryParam.displayRange">
  7. <option :value="0">全部</option>
  8. <option :value="1">停止</option>
  9. <option :value="2">当前</option>
  10. <option :value="3">今天</option>
  11. </select>
  12. </label>
  13. <label>
  14. 类型:
  15. <select v-model="queryParam.frequCode">
  16. <option :value="0">全部</option>
  17. <option :value="1">临时</option>
  18. <option :value="2">长期</option>
  19. </select>
  20. </label>
  21. <label>
  22. 状态:
  23. <select v-model.number="queryParam.zhuangTai">
  24. <option :value="0">全部</option>
  25. <option :value="1">录入</option>
  26. <option :value="2">确认</option>
  27. <option :value="3">执行</option>
  28. <option :value="5">停止</option>
  29. </select>
  30. </label>
  31. <label>
  32. 药房:
  33. <select v-model="queryParam.groupNo">
  34. <option value="73">住院</option>
  35. <option value="71">门诊</option>
  36. </select>
  37. </label>
  38. <button style="margin-left: 5px" @click="props.addYiZhuClick" title="ALT+A">添加</button>
  39. <button style="margin-left: 5px" @click="props.toDeleteAnOrder">删除</button>
  40. <button style="margin-left: 5px" @click="batchDeleteOrdersClick">批量删除</button>
  41. <button style="margin-left: 5px" @click="currentConfirmOrdersClick">确认</button>
  42. <button style="margin-left: 5px" @click="props.clickOnTheOrderTemplate">模板</button>
  43. <div style="display: flex;">
  44. <status-color color="#05ff00" label="R:录入"/>
  45. <status-color color="#0000fb" label="Q:确认"/>
  46. <status-color color="#ff07f3" label="Z:执行"/>
  47. <status-color color="red" label="T:停止"/>
  48. <status-color color="#00ffe0" label="D:作废"/>
  49. <!-- <span style="color: red">-->
  50. <!-- 修改数据后请点击,录入医嘱按钮,否则会导致数据丢失-->
  51. <!-- </span>-->
  52. </div>
  53. </div>
  54. </template>
  55. <script setup name='YzQueryCondition'>
  56. import {deleteMultipleOrders, huoQuYiZhuShuJu} from "@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru";
  57. import StatusColor from "@/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/yz-header/StatusColor";
  58. import {
  59. errorMsg, getYzIndex,
  60. queryParam,
  61. selectedData,
  62. yzData
  63. } from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
  64. import {BizException, ExceptionEnum} from "@/utils/BizException";
  65. import {ElMessageBox} from "element-plus";
  66. const props = defineProps({
  67. patientInfo: {
  68. type: Object
  69. },
  70. returnData: {
  71. type: Function
  72. },
  73. addYiZhuClick: Function,
  74. toDeleteAnOrder: Function,
  75. frequCodeChange: Function,
  76. confirmOrdersClick: Function,
  77. clickOnTheOrderTemplate: Function
  78. })
  79. const queryYz = async () => {
  80. if (!props.patientInfo.inpatientNo) {
  81. BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择患者')
  82. }
  83. queryParam.value.patNo = props.patientInfo.inpatientNo
  84. queryParam.value.times = props.patientInfo.admissTimes
  85. try {
  86. yzData.value = await huoQuYiZhuShuJu(queryParam.value)
  87. } catch (e) {
  88. yzData.value = []
  89. }
  90. }
  91. const currentConfirmOrdersClick = () => {
  92. if (!props.patientInfo.inpatientNo) {
  93. BizException(ExceptionEnum.MESSAGE_ERROR, '请先选择患者')
  94. }
  95. props.confirmOrdersClick()
  96. }
  97. /**
  98. * 点击批量删除数据
  99. */
  100. const batchDeleteOrdersClick = () => {
  101. if (selectedData.value.length === 0) {
  102. BizException(ExceptionEnum.LOGICAL_ERROR, "请先选择要删除的数据");
  103. }
  104. ElMessageBox.confirm('是否要批量删除这些医嘱?', '提示', {
  105. type: 'warning'
  106. }).then((res) => {
  107. let param = {
  108. inpatientNo: props.patientInfo.inpatientNo,
  109. admissTimes: props.patientInfo.admissTimes,
  110. list: selectedData.value
  111. }
  112. deleteMultipleOrders(param).then((res) => {
  113. if (res !== null && res.error) {
  114. let errData = []
  115. for (const key in res.data) {
  116. let index = getYzIndex(key)
  117. let tempYzData = yzData.value[index]
  118. yzData.value[index].error = true
  119. errData.push({
  120. actOrderNo: key,
  121. orderName: tempYzData.orderName,
  122. errorMessage: res.data[key]
  123. })
  124. }
  125. errorMsg.value.dialog = true
  126. errorMsg.value.type = 2
  127. errorMsg.value.data = errData
  128. } else {
  129. queryYz();
  130. }
  131. })
  132. }).catch(() => {
  133. })
  134. }
  135. watch(() => props.patientInfo, () => {
  136. queryYz()
  137. })
  138. defineExpose({
  139. queryYz
  140. })
  141. </script>
  142. <style scoped lang="scss">
  143. .status_color {
  144. width: 10px;
  145. height: 10px;
  146. }
  147. </style>