EmrHerbs.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <template>
  2. <div style="height: 10%;display: flex">
  3. <el-form inline>
  4. <el-form-item>
  5. <xc-date-picker style="width: 180px"
  6. type="daterange"
  7. clearable
  8. @change="caoYaoShuJu.currentPage = 1"
  9. v-model="dateRange"/>
  10. </el-form-item>
  11. <el-form-item>
  12. <el-switch v-model="shiFouFaYao"
  13. :active-value="true"
  14. :inactive-value="false"
  15. active-color="#13ce66"
  16. active-text="已发药"
  17. inactive-color="#ff4949"
  18. inactive-text="未发药"/>
  19. </el-form-item>
  20. <el-form-item>
  21. <el-button @click="dianJiChaXunYiZhu(0)">查询</el-button>
  22. </el-form-item>
  23. </el-form>
  24. </div>
  25. <div style="height: 90%">
  26. <el-dialog v-model="xiangQing.dialog" title="草药医嘱详情">
  27. <el-table :close-on-click-modal="false"
  28. :data="xiangQing.data"
  29. ref="tableRef"
  30. :height="getWindowSize.h / 1.5"
  31. highlight-current-row
  32. stripe>
  33. <el-table-column label="选择" type="selection"/>
  34. <el-table-column label="编码" prop="chargeCode"></el-table-column>
  35. <el-table-column label="名称" prop="chargeCodeName"></el-table-column>
  36. <el-table-column label="药房" prop="groupNoName"></el-table-column>
  37. <el-table-column label="数量" prop="quantity"></el-table-column>
  38. <el-table-column label="单价" prop="unitPrice"></el-table-column>
  39. <el-table-column label="说明" prop="instruction"></el-table-column>
  40. <el-table-column label="包装规格" prop="serial">
  41. <template #default="scope">
  42. <span v-if="scope.row.serial === '01'">小包装</span>
  43. <span v-else-if="scope.row.serial === '99'">小包装</span>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. <template #footer>
  48. <el-button type="danger" @click="xiangQing.dialog = false">关闭</el-button>
  49. <el-button @click="copyClick" type="success">复制选中</el-button>
  50. <el-button @click="copyAllClick" type="success">复制全部</el-button>
  51. </template>
  52. </el-dialog>
  53. <el-table :data="caoYaoShuJu.data"
  54. @rowClick="caoYaoYiZhuXiangQing"
  55. :height="getWindowSize.h / 1.1">
  56. <el-table-column label="名称" prop="orderName"></el-table-column>
  57. <el-table-column label="开单时间" prop="inputDate" show-overflow-tooltip></el-table-column>
  58. <el-table-column label="医生" prop="doctorCodeName"></el-table-column>
  59. <el-table-column label="状态" prop="statusFlag">
  60. <template #default="scope">
  61. {{ getHerbsStatusFlag(scope.row.statusFlag) }}
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="处方总额" prop="zongJia"></el-table-column>
  65. <el-table-column label="剂数" prop="quantity"></el-table-column>
  66. <el-table-column label="单剂金额" prop="orderJe"></el-table-column>
  67. <el-table-column label="医嘱号" prop="orderNo"></el-table-column>
  68. <el-table-column label="执行科室" prop="execDeptName"></el-table-column>
  69. <el-table-column label="操作" width="90">
  70. <template #default="scope">
  71. <el-button-group>
  72. <el-button type="primary" @click.stop="caoYaoYiZhuXiangQing(scope.row)" icon="View" title="查看详情"/>
  73. </el-button-group>
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. <el-pagination
  78. :current-page="caoYaoShuJu.currentPage"
  79. :page-size="caoYaoShuJu.pageSize"
  80. :pager-count="7"
  81. :total="caoYaoShuJu.total"
  82. layout="total, prev, pager, next"
  83. @current-change="handleCurrentChange"/>
  84. </div>
  85. </template>
  86. <script setup name='EmrHerbs'>
  87. import XcDatePicker from "@/components/xiao-chan/date-picker/XcDatePicker.vue";
  88. import {ref} from "vue";
  89. import {getDateRangeFormatDate} from "@/utils/date";
  90. import {huoQuCaoYaoShuJu, huoQuChaoYaoMingXi} from "@/api/zhu-yuan-yi-sheng/cao-yao-yi-zhu";
  91. import {getWindowSize} from "@/utils/window-size";
  92. import {getHerbsStatusFlag} from "@/views/hospitalization/zhu-yuan-yi-sheng/cao-yao-yi-zhu/cao-yao";
  93. import {listIsBlank} from "@/utils/blank-utils";
  94. import {xcMessage} from "@/utils/xiaochan-element-plus";
  95. import {
  96. emrCopyFunc
  97. } from "@/views/hospitalization/zhu-yuan-yi-sheng/electronic-medical-record/emr-editor/emr-init";
  98. const props = defineProps({
  99. patNo: String,
  100. times: Number
  101. })
  102. const emits = defineEmits(['close'])
  103. const dateRange = ref([])
  104. const caoYaoShuJu = ref({
  105. data: [],
  106. currentPage: 1,
  107. pageSize: 20,
  108. total: 0,
  109. })
  110. const shiFouFaYao = ref(true)
  111. const xiangQing = ref({
  112. dialog: false,
  113. data: [],
  114. yizhu: {},
  115. })
  116. const dianJiChaXunYiZhu = (val) => {
  117. let dateS = getDateRangeFormatDate(dateRange.value)
  118. let data = {
  119. startTime: dateS.startTime,
  120. endTime: dateS.endTime,
  121. shiFouFaYao: shiFouFaYao.value,
  122. patNo: props.patNo,
  123. times: props.times,
  124. currentPage: caoYaoShuJu.value.currentPage,
  125. pageSize: caoYaoShuJu.value.pageSize,
  126. total: val,
  127. }
  128. huoQuCaoYaoShuJu(data).then((res) => {
  129. caoYaoShuJu.value.data = res.records
  130. if (val === 0) {
  131. caoYaoShuJu.value.total = res.total
  132. }
  133. })
  134. }
  135. const caoYaoYiZhuXiangQing = (row) => {
  136. huoQuChaoYaoMingXi(row.orderNo).then((res) => {
  137. xiangQing.value.dialog = true
  138. xiangQing.value.data = res
  139. xiangQing.value.yizhu = row
  140. })
  141. }
  142. const handleCurrentChange = (val) => {
  143. caoYaoShuJu.value.currentPage = val
  144. dianJiChaXunYiZhu(0)
  145. }
  146. const tableRef = ref(null)
  147. const copyFunc = (data) => {
  148. let str = ''
  149. let v = xiangQing.value.yizhu
  150. let length = data.length
  151. data.forEach((item, index) => {
  152. str += item.chargeCodeName + item.quantity + 'g'
  153. if (length !== index + 1) {
  154. str += ' '
  155. }
  156. })
  157. str += '。'
  158. str += v.cyJssm + ',' + '日' + v.cyMtjs + '剂' + ',分' + v.cyFfcs + '次' + ',' + v.cyFysmName + '。'
  159. emrCopyFunc(str)
  160. emits('close')
  161. }
  162. const copyClick = () => {
  163. let temp = tableRef.value.getSelectionRows()
  164. if (listIsBlank(temp)) {
  165. xcMessage.error('请选择数据。')
  166. } else {
  167. copyFunc(temp)
  168. }
  169. }
  170. const copyAllClick = () => {
  171. copyFunc(xiangQing.value.data)
  172. }
  173. onMounted(() => {
  174. dianJiChaXunYiZhu(0)
  175. })
  176. </script>
  177. <style scoped lang="scss">
  178. </style>