prescriptionExecute.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <template>
  2. <view>
  3. <nav-bar :navbarData="navbarData"></nav-bar>
  4. <view
  5. v-if="pdaScanStatus === 'N'"
  6. :style="'background-image:url(' +imgDomain +'/images/icon/bg_patients_bg.png)'"
  7. class="page">
  8. <view class="main">
  9. <view class="patinfo">
  10. <view class="topinfo">
  11. <view class="paticon">
  12. <image
  13. :src="
  14. patInfo.basicInfo.patSexCode === '1'
  15. ? imgDomain + '/images/icon/gender-male.png'
  16. : imgDomain + '/images/icon/gender-female.png'"
  17. class="icon"></image>
  18. </view>
  19. <view class="detail">
  20. <view class="item">
  21. <view class="bedcode">{{ patInfo.admInfo.admBedCode }}</view>
  22. <view class="border"></view>
  23. <view class="info">{{ patInfo.basicInfo.patName }}</view>
  24. <view
  25. v-if="patInfo.admInfo.nurseLv === '特级'"
  26. class="nurse-lv-css-red"
  27. >{{ patInfo.admInfo.nurseLv }}</view
  28. >
  29. <view
  30. v-if="patInfo.admInfo.nurseLv === '一级'"
  31. class="nurse-lv-css-pink"
  32. >{{ patInfo.admInfo.nurseLv }}</view
  33. >
  34. <view
  35. v-if="patInfo.admInfo.nurseLv === '二级'"
  36. class="nurse-lv-css-blue"
  37. >{{ patInfo.admInfo.nurseLv }}</view
  38. >
  39. <view
  40. v-if="patInfo.admInfo.nurseLv === '三级'"
  41. class="nurse-lv-css-greenyellow"
  42. >{{ patInfo.admInfo.nurseLv }}</view
  43. >
  44. </view>
  45. <view class="item">
  46. <view class="bedcode">{{ patInfo.basicInfo.patSexDesc }}</view>
  47. <view class="border"></view>
  48. <view class="info">{{ patInfo.basicInfo.patAge }}</view>
  49. <view class="border"></view>
  50. <view class="info">{{ patInfo.basicInfo.patNo }}</view>
  51. </view>
  52. <view class="item">
  53. <view class="info">入院时间:{{ patInfo.admInfo.admDatetime }}</view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="main2">
  59. <view class="tabs">
  60. <view class="tab-item" :class="{active:active===0}" @click="active=0">
  61. <text :class="{active:active===0}">单据执行</text>
  62. </view>
  63. <view class="tab-item" :class="{active:active===1}" @click="active=1">
  64. <text :class="{active:active===1}">全部医嘱</text>
  65. </view>
  66. <view class="tab-item" :class="{active:active===2}" @click="active=2">
  67. <text :class="{active:active===2}">需处理</text>
  68. </view>
  69. </view>
  70. <view v-show="active===0">
  71. <DocumentExe :activeTab="active" :patNo="patNo"/>
  72. </view>
  73. <view v-show="active===1 || active===2">
  74. <OrdersList :activeTab="active" :patNo="patNo"/>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <view v-if="pdaScanStatus === 'Y'" class="main2Scan">
  80. <view class="scan-container">
  81. <!-- 扫描提示图片 -->
  82. <image
  83. class="scan-img"
  84. src="/static/pdaphone.jpeg"
  85. mode="widthFix"
  86. ></image>
  87. <view class="scan-text">请点击PDA侧边按钮扫描患者标识</view>
  88. </view>
  89. </view>
  90. </view>
  91. </template>
  92. <script setup>
  93. import { ref, onMounted, onUnmounted } from 'vue';
  94. import { httpconfig } from '../../config/httpconfig';
  95. import { onLoad, onShow } from '@dcloudio/uni-app';
  96. import { $http } from '../../config/https';
  97. import Util from '../../utils/util.js';
  98. import navBar from '@/pages/components/navbar/index';
  99. import DocumentExe from './components/DocumentExe.vue';
  100. import OrdersList from './components/OrdersList.vue';
  101. // 响应式数据
  102. const height = ref('');
  103. const navbarData = ref({
  104. background: '',
  105. title: '医嘱执行',
  106. height: '100',
  107. bottom: true,
  108. isGoBack: true,
  109. isGoHome: true,
  110. cleanPat: 'Y',
  111. });
  112. const patInfo = ref(uni.getStorageSync('patInfo') || {});
  113. const patNo = ref('');
  114. const moinfoflag = ref(false);
  115. const nurserecordflag = ref(true);
  116. const otherfunction = ref(true);
  117. const templateList = ref([]);
  118. const imgDomain = ref(httpconfig.imgDomain);
  119. const active = ref(0);
  120. const pdaScanStatus = ref('Y'); // Y:需要扫码 N:已有患者信息
  121. const viewotherfunction = () => {
  122. otherfunction.value = !otherfunction.value;
  123. };
  124. onShow(() => {
  125. try {
  126. const pages = getCurrentPages();
  127. if (pages.length > 0) {
  128. const currentPage = pages[pages.length - 1];
  129. const currentRoute = currentPage.route; // 当前页面路由
  130. // 更新全局变量
  131. if (uni.$appGlobal) {
  132. uni.$appGlobal.globalData.value.currentRoute = currentRoute;
  133. }
  134. }
  135. } catch (err) {
  136. console.error('更新当前路由失败:', err);
  137. }
  138. });
  139. onMounted(() => {
  140. if (!imgDomain.value) {
  141. imgDomain.value = uni.getStorageSync('appUrlAddress');
  142. }
  143. patInfo.value = uni.getStorageSync('patInfo') || {};
  144. // 注册全局事件
  145. uni.$on('callGetPDAScanInfo', (code) => {
  146. getPDAScanInfo(code);
  147. });
  148. });
  149. onUnmounted(() => {
  150. // 销毁全局事件,避免内存泄漏
  151. uni.$off('callGetPDAScanInfo');
  152. });
  153. //暴露给外部函数,获取PDA扫码反馈
  154. function getPDAScanInfo(code) {
  155. patNo.value = code;
  156. Util.getPatInfoNew(code, (res) => {
  157. const newPatInfo = res;
  158. if (Object.keys(patInfo.value).length === 0) {
  159. patInfo.value = { ...newPatInfo }; // 初始化响应式对象
  160. } else {
  161. Object.assign(patInfo.value, newPatInfo);
  162. }
  163. pdaScanStatus.value = 'N';
  164. active.value = 0;
  165. });
  166. }
  167. </script>
  168. <style>
  169. /* 样式部分保持不变 */
  170. .page {
  171. background-size: 100% auto;
  172. background-repeat: no-repeat;
  173. }
  174. .main {
  175. height: calc(100% - 28rpx);
  176. width: 100%;
  177. padding-top: 28rpx;
  178. }
  179. .main2Scan{
  180. /* 淡蓝色边框,宽度1px,线条类型为实线 */
  181. border: 1px solid #7cb5ff;
  182. /* 边角圆润,数值可根据需求调整 */
  183. border-radius: 8px;
  184. /* 内部留白,避免内容贴边 */
  185. padding: 15px;
  186. /* 可选:添加轻微阴影增强层次感 */
  187. box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  188. margin:10px; /* 与其他元素保持间距,可按需删除 */
  189. }
  190. /* 内部容器布局 */
  191. .scan-container {
  192. display: flex;
  193. flex-direction: column;
  194. align-items: center;
  195. justify-content: center;
  196. gap: 15px; /* 图片与文字间距 */
  197. }
  198. /* 图片样式 */
  199. .scan-img {
  200. width: 100%; /* 图片宽度,可按需调整 */
  201. height: auto;
  202. opacity: 0.9;
  203. }
  204. /* 文字样式 - 高亮、放大、闪烁 */
  205. .scan-text {
  206. font-size: 20px; /* 大字体 */
  207. font-weight: bold;
  208. color: #1890ff; /* 高亮蓝色 */
  209. text-align: center;
  210. padding: 10px 15px;
  211. border-radius: 6px;
  212. background-color: rgba(255, 255, 255, 0.8); /* 白色背景增强对比度 */
  213. animation: blink 1.5s infinite;
  214. }
  215. /* 闪烁动画定义 */
  216. @keyframes blink {
  217. 0%, 100% {
  218. opacity: 1;
  219. transform: scale(1);
  220. }
  221. 50% {
  222. opacity: 0.6;
  223. transform: scale(1.05); /* 轻微放大增强闪烁感 */
  224. }
  225. }
  226. .main2 {
  227. overflow: auto;
  228. min-height: 80vh;
  229. background-color: #f2f2f2;
  230. }
  231. /* 极简样式,仅保留核心视觉区分 */
  232. .tabs{display:flex;height:88rpx;line-height:88rpx;border-bottom:1px solid #eee;background-color: white;}
  233. .tab-item{flex:1;text-align:center;}
  234. /* 选中态样式 */
  235. .tab-item.active text{color:#1989fa;font-weight:500;}
  236. /* 加下划线的补充样式 */
  237. .tab-item{position:relative;}
  238. .tab-item.active::after{
  239. content:'';
  240. position:absolute;
  241. bottom:0;left:50%;
  242. transform:translateX(-50%);
  243. width:300rpx;height:4rpx;
  244. background:#1989fa;
  245. }
  246. .patinfo {
  247. width: calc(100% - 60rpx);
  248. background: #fff;
  249. margin: 0 30rpx;
  250. border-radius: 8rpx 8rpx 0 0;
  251. box-shadow: 0px 2px 21px 0px rgba(198, 198, 198, 0.3);
  252. }
  253. .patinfo .topinfo {
  254. display: flex;
  255. flex-direction: row;
  256. width: calc(100% - 22rpx);
  257. padding: 0 11rpx;
  258. }
  259. .topinfo .paticon {
  260. width: 100rpx;
  261. height: 100rpx;
  262. padding: 29rpx 0;
  263. }
  264. .topinfo .detail {
  265. width: calc(100%);
  266. padding: 14rpx 10rpx;
  267. font-size: 14px;
  268. font-weight: 400;
  269. color: #666666;
  270. }
  271. .detail .item {
  272. display: flex;
  273. flex-direction: row;
  274. line-height: 46rpx;
  275. height: 46rpx;
  276. width: 100%;
  277. display: flex;
  278. }
  279. .item .border {
  280. border: 1rpx solid #e5e5e5;
  281. margin: 10rpx 10rpx;
  282. width: 0px;
  283. height: 28rpx;
  284. line-height: 46rpx;
  285. }
  286. .item .bedcode {
  287. width: 60rpx;
  288. }
  289. .item .info {
  290. overflow: hidden;
  291. text-overflow: ellipsis;
  292. white-space: nowrap;
  293. }
  294. .nurse-lv-css-red {
  295. background-color: red;
  296. color: #fff;
  297. border-radius: 4rpx;
  298. padding: 0rpx 18rpx;
  299. font-size: 20rpx;
  300. width: 50rpx;
  301. margin-left: 20rpx;
  302. }
  303. .nurse-lv-css-pink {
  304. background-color: pink;
  305. color: #fff;
  306. border-radius: 4rpx;
  307. padding: 0rpx 18rpx;
  308. font-size: 20rpx;
  309. width: 50rpx;
  310. margin-left: 20rpx;
  311. }
  312. .nurse-lv-css-greenyellow {
  313. background-color: rgb(93, 187, 93);
  314. color: #fff;
  315. border-radius: 4rpx;
  316. padding: 0rpx 18rpx;
  317. font-size: 20rpx;
  318. width: 50rpx;
  319. margin-left: 20rpx;
  320. }
  321. .nurse-lv-css-blue {
  322. background-color: #007aff;
  323. color: #fff;
  324. border-radius: 4rpx;
  325. padding: 0rpx 18rpx;
  326. font-size: 20rpx;
  327. width: 50rpx;
  328. margin-left: 20rpx;
  329. }
  330. .paticon .icon {
  331. width: 100rpx;
  332. height: 100rpx;
  333. }
  334. </style>