JianChaShenQing.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <CyFlex>
  3. <template #header>
  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: 220px"
  13. type="daterange"
  14. />
  15. <el-button-group>
  16. <el-button
  17. icon="Search"
  18. type="primary"
  19. @click="dianJiChaXunHuanZheJianCha"
  20. >查询
  21. </el-button>
  22. <el-button type="primary" @click="imageClick">影像</el-button>
  23. </el-button-group>
  24. <el-divider direction="vertical"></el-divider>
  25. <el-button icon="Check" type="success" @click="saveData">保存</el-button>
  26. <el-button type="primary" @click="batchPrint">批量打印</el-button>
  27. <el-button
  28. icon="Check"
  29. type="primary"
  30. @click="saveTemplate"
  31. :disabled="jcProxy.isEmpty()"
  32. >
  33. 存为模板
  34. </el-button>
  35. <el-button @click="medicalTechnologyAppointment">医技预约</el-button>
  36. </template>
  37. <div style="display: flex; height: 100%; width: 100%">
  38. <CyTabs v-model="asideTabs" type="idea" width="100%" height="100%">
  39. <CyTabPane :name="0" label="新增">
  40. <NewApplication />
  41. </CyTabPane>
  42. <CyTabPane :name="1" label="历史记录">
  43. <template #default="{ height }">
  44. <CheckApplicationHistory
  45. ref="historyTableRef"
  46. @print="
  47. value => {
  48. printListRef.print([value]);
  49. }
  50. "
  51. :data="jianChaShuJu"
  52. :height="height"
  53. />
  54. </template>
  55. </CyTabPane>
  56. <CyTabPane :name="2" label="结果V2">
  57. <JianChaJieGuoV2
  58. :pat-no="huanZheXinXi.inpatientNo"
  59. ref="jieGuoRefV2"
  60. />
  61. </CyTabPane>
  62. </CyTabs>
  63. </div>
  64. </CyFlex>
  65. <save-template-inspection ref="saveTemplateRef" />
  66. <PrintCheckList ref="printListRef" />
  67. </template>
  68. <script setup>
  69. import {
  70. cuoWuXinXi,
  71. huanZheXinXi,
  72. youWuXuanZheHuanZhe,
  73. jsQueryYzData,
  74. jcExtraInformation,
  75. onChangePatient,
  76. openPatientImage,
  77. jcProxy,
  78. jcList,
  79. } from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
  80. import { ref } from "vue";
  81. import {
  82. baoCunJianYanJianCha,
  83. huoQuJianChaShenQing,
  84. } from "@/api/zhu-yuan-yi-sheng/jian-yan-jian-cha-shen-qing";
  85. import { getDateRangeFormatDate } from "@/utils/date";
  86. import { shortcuts } from "@/data/shortcuts";
  87. import CheckApplicationHistory from "@/components/zhu-yuan-yi-sheng/jian-cha-shen-qing/aside/CheckApplicationHistory";
  88. import NewApplication from "@/components/zhu-yuan-yi-sheng/jian-cha-shen-qing/aside/NewApplication";
  89. import SaveTemplateInspection from "@/views/hospitalization/zhu-yuan-yi-sheng/jian-cha-jian-yan-shen-qing/SaveTemplateInspection";
  90. import { BizException, ExceptionEnum } from "@/utils/BizException";
  91. import { yaoPinXiangMuPiPeiYiBao } from "@/api/public-api";
  92. import { stringIsBlank, stringNotBlank } from "@/utils/blank-utils";
  93. import JianChaJieGuoV2 from "@/views/hospitalization/zhu-yuan-yi-sheng/jian-cha-jian-yan-shen-qing/components/jiancha/JianChaJieGuoV2.vue";
  94. import CyFlex from "@/components/cy/flex/src/CyFlex.vue";
  95. import CyTabs from "@/components/cy/tabs/src/CyTabs";
  96. import CyTabPane from "@/components/cy/tabs/src/CyTabPane.vue";
  97. import { CyMessageBox } from "@/utils/cy-message-box";
  98. import XEUtils from "xe-utils";
  99. import PrintCheckList from "@/components/zhu-yuan-yi-sheng/jian-cha-shen-qing/da-ying/PrintCheckList.vue";
  100. import { ElMessageBox } from "element-plus";
  101. import { useCompShallowRef } from "@/utils/useCompRef";
  102. const orderName = ref("");
  103. const dateRange = ref(null);
  104. const jianChaShuJu = ref([]);
  105. const asideTabs = ref(0);
  106. const printListRef = useCompShallowRef(PrintCheckList);
  107. // 检查结果
  108. const jieGuoRefV2 = ref();
  109. /**
  110. * 点击查询患者检查
  111. * @param total
  112. */
  113. const dianJiChaXunHuanZheJianCha = () => {
  114. let { startTime, endTime } = getDateRangeFormatDate(dateRange.value);
  115. let param = {
  116. patNo: huanZheXinXi.value.inpatientNo,
  117. times: huanZheXinXi.value.admissTimes,
  118. orderName: orderName.value,
  119. startTime: startTime,
  120. endTime: endTime,
  121. };
  122. huoQuJianChaShenQing(param).then(res => {
  123. jianChaShuJu.value = res;
  124. });
  125. jieGuoRefV2.value.queryData();
  126. };
  127. // 保存模板
  128. const saveTemplateRef = ref();
  129. const saveTemplate = () => {
  130. saveTemplateRef.value.openOrClose();
  131. };
  132. // 保存数据
  133. const saveData = async () => {
  134. if (youWuXuanZheHuanZhe()) return;
  135. function error() {
  136. if (stringNotBlank(huanZheXinXi.value.inpatientNo)) {
  137. BizException(
  138. ExceptionEnum.LOGICAL_ERROR,
  139. "病史摘要、体征信息、相关辅检结果、临床诊断,不能为空。"
  140. );
  141. }
  142. }
  143. if (stringIsBlank(jcExtraInformation.value.reqComment)) {
  144. error();
  145. }
  146. if (stringIsBlank(jcExtraInformation.value.reqTzComment)) {
  147. error();
  148. }
  149. if (stringIsBlank(jcExtraInformation.value.reqOtherResult)) {
  150. error();
  151. }
  152. if (stringIsBlank(jcExtraInformation.value.diagCode)) {
  153. error();
  154. }
  155. jcProxy.emptyError();
  156. const listCode = [];
  157. jcProxy.forEach(item => {
  158. item.reqComment = jcExtraInformation.value.reqComment;
  159. item.reqTzComment = jcExtraInformation.value.reqTzComment;
  160. item.reqOtherResult = jcExtraInformation.value.reqOtherResult;
  161. item.diagCode = jcExtraInformation.value.diagCode;
  162. item.diagText = jcExtraInformation.value.diagText;
  163. listCode.push(item.orderCode + "-00");
  164. });
  165. const 未匹配医保码 = await yaoPinXiangMuPiPeiYiBao(listCode).catch(() => {
  166. return "";
  167. });
  168. cuoWuXinXi.value = 未匹配医保码;
  169. if (stringNotBlank(未匹配医保码)) {
  170. await CyMessageBox.confirm({
  171. message: 未匹配医保码,
  172. title: "提示",
  173. type: "warning",
  174. dangerouslyUseHTMLString: true,
  175. confirmButtonText: "继续录入",
  176. });
  177. }
  178. baoCunShuJu();
  179. };
  180. async function baoCunShuJu() {
  181. await CyMessageBox.confirm({
  182. message: "确定要保存这些数据吗?",
  183. title: "提示",
  184. type: "warning",
  185. });
  186. let data = XEUtils.clone(huanZheXinXi.value, true);
  187. data.list = jcList.value;
  188. data.list.forEach(item => {
  189. item.reqType = 3;
  190. });
  191. const reqs = await baoCunJianYanJianCha(data);
  192. ElMessageBox.confirm("是否打印申请单", "提示", {
  193. type: "success",
  194. })
  195. .then(() => {
  196. printListRef.value.print(reqs);
  197. })
  198. .catch(XEUtils.noop);
  199. jcProxy.clear();
  200. dianJiChaXunHuanZheJianCha();
  201. asideTabs.value = 1;
  202. // 查询医嘱
  203. jsQueryYzData().then(() => {});
  204. }
  205. function imageClick() {
  206. if (youWuXuanZheHuanZhe()) return;
  207. openPatientImage(huanZheXinXi.value.inpatientNo);
  208. }
  209. const historyTableRef = ref();
  210. function batchPrint() {
  211. const data = historyTableRef.value.getSelectData();
  212. printListRef.value.print(
  213. data.map(i => {
  214. return i.reqNo;
  215. })
  216. );
  217. }
  218. onChangePatient(dianJiChaXunHuanZheJianCha);
  219. function medicalTechnologyAppointment() {
  220. window.open(
  221. `http://172.16.32.208:8010/Third/Clinical/IClinicalRegister.html?ZYH=${huanZheXinXi.value.inpatientNo}`,
  222. "_blank"
  223. );
  224. }
  225. </script>
  226. <style scoped lang="scss">
  227. :deep(.el-table .success-row) {
  228. background: rgba(71, 123, 220, 0.69);
  229. }
  230. </style>