detail.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. <template>
  2. <view class="orderDetail">
  3. <!-- 头部 -->
  4. <view class="orderDetail_header">
  5. <view class="orderDetail_header_item" v-for="tab in tabs" :key="tab.id" :class="{active:tab.id === selectedTab}"
  6. @click="debouncedChangeTab(tab.id)">
  7. {{tab.name}}
  8. </view>
  9. </view>
  10. <!-- tab -->
  11. <!-- 检查信息 -->
  12. <view class="orderDetail_info" v-show="selectedTab === 1">
  13. <scroll-view scroll-y class="orderDetail_infoItem" v-if="info.id">
  14. <view class="orderDetail_infoItem_header">
  15. <view class="orderDetail_infoItem_header_title">
  16. <view class="icon"></view>
  17. <view class="taskNameAndWorkerName">
  18. <text class="taskName">检查单号</text>
  19. </view>
  20. </view>
  21. <text class="orderDetail_infoItem_header_more">{{info.inspectCode||'暂无'}}</text>
  22. </view>
  23. <view class="orderDetail_infoItem_item">
  24. <view class="orderDetail_infoItem_item_content">
  25. <text class="orderDetail_infoItem_item_name">患者姓名</text>
  26. <text class="orderDetail_infoItem_item_value">{{info.patientName||'暂无'}}</text>
  27. </view>
  28. <view class="orderDetail_infoItem_item_content">
  29. <text class="orderDetail_infoItem_item_name">患者床号</text>
  30. <text class="orderDetail_infoItem_item_value">{{info.bedNum ?info.bedNum + '床': '暂无'}}</text>
  31. </view>
  32. <view class="orderDetail_infoItem_item_content">
  33. <text class="orderDetail_infoItem_item_name">住院号</text>
  34. <text class="orderDetail_infoItem_item_value">{{info.residenceNo || '暂无'}}</text>
  35. </view>
  36. <view class="orderDetail_infoItem_item_content">
  37. <text class="orderDetail_infoItem_item_name">检查项目</text>
  38. <text class="orderDetail_infoItem_item_value">{{info.inspectName||'暂无'}}</text>
  39. </view>
  40. <view class="orderDetail_infoItem_item_content">
  41. <text class="orderDetail_infoItem_item_name">预约时间</text>
  42. <text class="orderDetail_infoItem_item_value">{{info.yyTime||'暂无'}}</text>
  43. </view>
  44. <view class="orderDetail_infoItem_item_content">
  45. <text class="orderDetail_infoItem_item_name">叫号信息</text>
  46. <text class="orderDetail_infoItem_item_value">{{info.reservationNumber||'暂无'}}</text>
  47. </view>
  48. <view class="orderDetail_infoItem_item_content">
  49. <text class="orderDetail_infoItem_item_name">状态</text>
  50. <text class="orderDetail_infoItem_item_value">{{info.inspectState?info.inspectState.name:'暂无'}}</text>
  51. </view>
  52. </view>
  53. </scroll-view>
  54. </view>
  55. <!-- 标本信息 -->
  56. <view class="orderDetail_info" v-show="selectedTab === 2">
  57. <scroll-view scroll-y class="orderDetail_infoItem" v-if="info.id">
  58. <view class="orderDetail_infoItem_header">
  59. <view class="orderDetail_infoItem_header_title">
  60. <view class="icon"></view>
  61. <view class="taskNameAndWorkerName">
  62. <text class="taskName">标本编码</text>
  63. </view>
  64. </view>
  65. <text class="orderDetail_infoItem_header_more">{{info.scode||'暂无'}}</text>
  66. </view>
  67. <view class="orderDetail_infoItem_item">
  68. <view class="orderDetail_infoItem_item_content">
  69. <text class="orderDetail_infoItem_item_name">患者姓名</text>
  70. <text class="orderDetail_infoItem_item_value">{{info.patientName||'暂无'}}</text>
  71. </view>
  72. <view class="orderDetail_infoItem_item_content">
  73. <text class="orderDetail_infoItem_item_name">患者床号</text>
  74. <text class="orderDetail_infoItem_item_value">{{info.bedNum ?info.bedNum + '床': '暂无'}}</text>
  75. </view>
  76. <view class="orderDetail_infoItem_item_content">
  77. <text class="orderDetail_infoItem_item_name">住院号</text>
  78. <text class="orderDetail_infoItem_item_value">{{info.residenceNo || '暂无'}}</text>
  79. </view>
  80. <view class="orderDetail_infoItem_item_content">
  81. <text class="orderDetail_infoItem_item_name">标本类型</text>
  82. <text class="orderDetail_infoItem_item_value">{{info.stype?info.stype.name:'暂无'}}</text>
  83. </view>
  84. <view class="orderDetail_infoItem_item_content">
  85. <text class="orderDetail_infoItem_item_name">检验科室</text>
  86. <text
  87. class="orderDetail_infoItem_item_value">{{info.checkDept?(deptDisplay == 2?info.checkDept.deptalias:info.checkDept.dept):'暂无'}}</text>
  88. </view>
  89. <view class="orderDetail_infoItem_item_content">
  90. <text class="orderDetail_infoItem_item_name">申请科室</text>
  91. <text
  92. class="orderDetail_infoItem_item_value">{{info.sickRoom?(deptDisplay == 2?info.sickRoom.deptalias:info.sickRoom.dept):'暂无'}}</text>
  93. </view>
  94. <view class="orderDetail_infoItem_item_content">
  95. <text class="orderDetail_infoItem_item_name">状态</text>
  96. <text class="orderDetail_infoItem_item_value">{{info.speState?info.speState.name:'暂无'}}</text>
  97. </view>
  98. </view>
  99. </scroll-view>
  100. </view>
  101. <!-- 流程信息 -->
  102. <view class="orderDetail_info" v-show="selectedTab === 3">
  103. <scroll-view scroll-y class="orderDetail_infoItem">
  104. <view class="orderDetail_infoItem_header">
  105. <view class="orderDetail_infoItem_header_title">
  106. <view class="icon"></view>
  107. <view class="taskNameAndWorkerName">
  108. <text class="taskName">过程信息</text>
  109. </view>
  110. </view>
  111. </view>
  112. </scroll-view>
  113. </view>
  114. <!-- 底部 -->
  115. <seiminFooterBtn :btns="btns"></seiminFooterBtn>
  116. <seiminModel ref="seiminModel"></seiminModel>
  117. </view>
  118. </template>
  119. <script>
  120. import {
  121. debounce
  122. } from 'lodash/function';
  123. import {
  124. reqFetchData,
  125. reqFetchWorkOrderLog,
  126. } from "../../request/api.js";
  127. import {
  128. mapState
  129. } from "vuex";
  130. import {
  131. GDSTATE
  132. } from "../../utils/enum.gdstate.js";
  133. import {
  134. ASSOCIATION_TYPES
  135. } from "../../utils/enum.association_types.js";
  136. import {
  137. showAppraise,
  138. openRecallModal,
  139. openExecModal,
  140. showJiaji,
  141. } from "../../utils/index.js";
  142. export default {
  143. data() {
  144. return {
  145. debouncedChangeTab: null,
  146. // 路由传参
  147. queryParams: {},
  148. // 关联类型
  149. ASSOCIATION_TYPES,
  150. // 选项卡
  151. tabs: [],
  152. // 当前选中的tab
  153. selectedTab: 1,
  154. // 标本信息、检查信息
  155. info: {},
  156. //底部按钮
  157. btns: [],
  158. };
  159. },
  160. computed: {
  161. ...mapState('other', ["deptDisplay"]),
  162. },
  163. methods: {
  164. init(queryParams) {
  165. this.queryParams = queryParams;
  166. let type = 0;
  167. switch (queryParams.associationType) {
  168. case 'inspect':
  169. this.tabs = [{
  170. id: 1,
  171. name: '检查信息'
  172. },
  173. {
  174. id: 3,
  175. name: '过程信息'
  176. },
  177. ];
  178. this.changeTab(1);
  179. break;
  180. case 'specimen':
  181. this.tabs = [{
  182. id: 2,
  183. name: '标本信息'
  184. },
  185. {
  186. id: 3,
  187. name: '过程信息'
  188. },
  189. ];
  190. this.changeTab(2);
  191. break;
  192. }
  193. },
  194. // 格式化时分秒
  195. // (时间小于一分钟则显示秒,时间大于一分钟则显示分钟数,如超出一小时则显示小时和分钟。)time单位:秒
  196. formatTime(time) {
  197. let timeStr = "";
  198. if (time >= 0 && time < 60) {
  199. // 秒
  200. timeStr = time + "秒";
  201. } else if (time >= 60 && time < 3600) {
  202. // 分钟
  203. timeStr = Math.floor(time / 60) + "分钟";
  204. } else if (time >= 3600) {
  205. // 时 + 分
  206. let h = "";
  207. let m = "";
  208. h = Math.floor(time / 3600) + "小时";
  209. m = time % 3600 >= 60 ? Math.floor((time % 3600) / 60) + "分钟" : "";
  210. timeStr = h + m;
  211. }
  212. return timeStr;
  213. },
  214. // 计算流程信息耗时
  215. filterTime(step) {
  216. let num = 0;
  217. step.forEach((e) => {
  218. num += e.difTime;
  219. });
  220. return this.formatTime(num / 1000);
  221. },
  222. // 切换tab
  223. changeTab(id) {
  224. this.selectedTab = id;
  225. switch (id) {
  226. case 1:
  227. this.getInspect(this.queryParams);
  228. break;
  229. case 2:
  230. this.getSpecimen(this.queryParams);
  231. break;
  232. case 3:
  233. break;
  234. }
  235. },
  236. //获取检查信息数据
  237. getInspect(queryParams) {
  238. uni.showLoading({
  239. mask: true,
  240. title: '加载中',
  241. })
  242. reqFetchData('api', 'inspect', queryParams.id).then(res => {
  243. uni.hideLoading();
  244. if (res.status == 200) {
  245. // 工单信息
  246. this.info = res.data;
  247. //底部按钮处理
  248. this.btns = [{
  249. name: "返回",
  250. type: "default",
  251. click: () => {
  252. uni.navigateBack();
  253. },
  254. }];
  255. } else {
  256. this.btns = [{
  257. name: "回到列表",
  258. type: "default",
  259. click: () => {
  260. uni.navigateTo({
  261. url: "/pages/orderList/orderList",
  262. });
  263. },
  264. }, ];
  265. this.$refs.seiminModel.show({
  266. skin: 'toast',
  267. icon: 'error',
  268. content: '请求失败',
  269. })
  270. }
  271. })
  272. },
  273. //获取标本信息数据
  274. getSpecimen(queryParams) {
  275. uni.showLoading({
  276. mask: true,
  277. title: '加载中',
  278. })
  279. reqFetchData('api', 'specimen', queryParams.id).then(res => {
  280. uni.hideLoading();
  281. if (res.status == 200) {
  282. // 流程信息
  283. this.info = res.data;
  284. //底部按钮处理
  285. this.btns = [{
  286. name: "返回",
  287. type: "default",
  288. click: () => {
  289. uni.navigateBack();
  290. },
  291. }];
  292. } else {
  293. //底部按钮处理
  294. this.btns = [{
  295. name: "返回",
  296. type: "default",
  297. click: () => {
  298. uni.navigateBack();
  299. },
  300. }];
  301. this.$refs.seiminModel.show({
  302. skin: 'toast',
  303. icon: 'error',
  304. content: '请求失败',
  305. })
  306. }
  307. })
  308. },
  309. },
  310. onLoad(queryParams) {
  311. console.log(queryParams);
  312. this.init(queryParams);
  313. },
  314. created() {
  315. this.debouncedChangeTab = debounce(this.changeTab, 166);
  316. },
  317. beforeDestroy() {
  318. this.debouncedChangeTab.cancel()
  319. }
  320. }
  321. </script>
  322. <style lang="scss" scoped>
  323. .orderDetail {
  324. // 头部
  325. .orderDetail_header {
  326. position: fixed;
  327. z-index: 98;
  328. width: 100%;
  329. height: 88rpx;
  330. background-color: #fff;
  331. color: #333;
  332. @include flex;
  333. .orderDetail_header_item {
  334. flex: 1;
  335. font-size: 32rpx;
  336. @include border(right);
  337. @include border(bottom);
  338. @include flex(center, center);
  339. &:last-of-type {
  340. border-right: none;
  341. }
  342. &.active {
  343. color: $defaultColor;
  344. border-bottom: 4rpx solid $defaultColor;
  345. }
  346. }
  347. }
  348. // tab
  349. // 工单详情
  350. .orderDetail_info {
  351. padding: 108rpx 24rpx;
  352. .orderDetail_infoItem {
  353. width: 702rpx;
  354. background-color: #fff;
  355. margin-top: 8rpx;
  356. border-radius: 8rpx;
  357. position: relative;
  358. padding: 0 24rpx 24rpx;
  359. font-size: 32rpx;
  360. @include border;
  361. @include semicircle(#f9fafb, 82rpx);
  362. @include flex(flex-start, stretch, column);
  363. .ji,
  364. .jiaji {
  365. width: 60rpx;
  366. position: absolute;
  367. right: 0;
  368. top: 0;
  369. }
  370. .orderDetail_infoItem_header {
  371. height: 86rpx;
  372. @include border($directive:bottom, $style:dashed);
  373. @include flex(space-between, center);
  374. .orderDetail_infoItem_header_title {
  375. color: #333;
  376. flex: 1;
  377. @include flex(flex-start, center);
  378. .icon {
  379. width: 10rpx;
  380. height: 46rpx;
  381. border-radius: 2rpx;
  382. background-color: #F0F6ED;
  383. @include btn_background;
  384. }
  385. .taskNameAndWorkerName {
  386. flex: 1;
  387. @include flex;
  388. .taskName {
  389. max-width: 10em;
  390. margin-left: 8rpx;
  391. font-size: 38rpx;
  392. font-weight: bold;
  393. @include clamp;
  394. }
  395. }
  396. }
  397. .orderDetail_infoItem_header_more {
  398. color: #333;
  399. font-weight: bold;
  400. font-size: 38rpx;
  401. @include clamp;
  402. }
  403. }
  404. .orderDetail_infoItem_item {
  405. padding-top: 12rpx;
  406. padding-bottom: 12rpx;
  407. color: #333;
  408. font-size: 30rpx;
  409. flex: 1;
  410. @include border(bottom);
  411. @include flex(flex-start, stretch, column);
  412. &.process {
  413. padding-top: 90rpx;
  414. padding-bottom: 90rpx;
  415. }
  416. &:last-of-type {
  417. border-bottom: none;
  418. }
  419. // 工单信息
  420. .orderDetail_infoItem_item_content {
  421. margin-top: 20rpx;
  422. @include flex(space-between, stretch);
  423. .orderDetail_infoItem_item_name {
  424. font-size: 34rpx;
  425. color: #666;
  426. max-width: 4em;
  427. }
  428. .orderDetail_infoItem_item_value {
  429. font-size: 38rpx;
  430. color: #333;
  431. font-weight: bold;
  432. max-width: 420rpx;
  433. text-align: justify;
  434. word-break: break-all;
  435. }
  436. }
  437. // 流程信息
  438. .orderDetail_process_item {
  439. min-height: 120rpx;
  440. line-height: 50rpx;
  441. color: #333;
  442. @include flex(center);
  443. &:last-of-type {
  444. .step_icon {
  445. &::after {
  446. display: none;
  447. }
  448. }
  449. }
  450. .step_infoStart {
  451. font-size: 28rpx;
  452. flex: 1;
  453. @include flex(flex-end);
  454. .step_time {
  455. margin-left: 16rpx;
  456. }
  457. }
  458. .step_icon {
  459. font-size: 38rpx;
  460. margin-left: 30rpx;
  461. margin-right: 30rpx;
  462. position: relative;
  463. color: #E5E9ED;
  464. &.active {
  465. color: #07863C;
  466. }
  467. &::after {
  468. content: '';
  469. position: absolute;
  470. top: 60rpx;
  471. left: 18rpx;
  472. width: 1px;
  473. height: calc(100% - 70rpx);
  474. background-color: #DDE1E5;
  475. }
  476. }
  477. .step_infoEnd {
  478. font-size: 34rpx;
  479. flex: 1;
  480. padding-bottom: 16rpx;
  481. }
  482. }
  483. // 业务信息-检查
  484. &.business_inspect {
  485. .inspect_info {
  486. font-size: 34rpx;
  487. color: #333;
  488. padding-top: 20rpx;
  489. padding-bottom: 20rpx;
  490. @include border($directive:bottom, $style:dashed);
  491. .inspect_info_block {
  492. height: 60rpx;
  493. @include flex(space-between, center);
  494. .inspect_info_left {
  495. @include flex;
  496. .inspect_info_icon {
  497. width: 50rpx;
  498. height: 50rpx;
  499. line-height: 50rpx;
  500. background-color: #FFE8EB;
  501. border-radius: 50%;
  502. border: 1px solid #FF3B53;
  503. color: #FF3B53;
  504. font-size: 28rpx;
  505. margin-right: 8rpx;
  506. @include flex(center, center);
  507. &.green {
  508. border: 1px solid $defaultColor;
  509. background-color: rgba(73, 184, 86, 0.1);
  510. }
  511. }
  512. .inspect_info_name {
  513. font-weight: bold;
  514. }
  515. }
  516. .inspect_info_right {
  517. font-weight: bold;
  518. }
  519. }
  520. }
  521. .inspect_item {
  522. color: #333;
  523. font-size: 34rpx;
  524. line-height: 48rpx;
  525. padding-top: 26rpx;
  526. padding-bottom: 26rpx;
  527. @include border($directive:bottom, $style:dashed);
  528. .inspect_item_name {
  529. font-weight: bold;
  530. }
  531. .inspect_item_yytime {
  532. font-weight: bold;
  533. }
  534. .inspect_item_info {
  535. margin-top: 16rpx;
  536. margin-bottom: 16rpx;
  537. @include flex(space-between, center);
  538. .inspect_item_dept {
  539. flex: 1;
  540. word-break: break-all;
  541. @include clamp;
  542. }
  543. .inspect_item_number {
  544. flex: 1;
  545. text-align: right;
  546. word-break: break-all;
  547. @include clamp;
  548. }
  549. }
  550. }
  551. }
  552. // 业务信息-标本
  553. &.business_specimen {
  554. font-size: 34rpx;
  555. .th {
  556. background-color: red;
  557. @include btn_background;
  558. th {
  559. color: #fff;
  560. }
  561. }
  562. .td {
  563. position: relative;
  564. .urgent {
  565. width: 60rpx;
  566. position: absolute !important;
  567. right: 0;
  568. top: 0;
  569. }
  570. }
  571. .table--border {
  572. border: none;
  573. }
  574. ::v-deep .uni-table {
  575. min-width: 0;
  576. }
  577. ::v-deep .uni-table-td {
  578. word-break: break-all;
  579. }
  580. }
  581. // 业务信息-药品
  582. &.business_drugsBag {
  583. .drugsBag_item {
  584. color: #333;
  585. font-size: 34rpx;
  586. margin-top: 20rpx;
  587. @include flex(space-between, center);
  588. .drugsBag_item_name {}
  589. .drugsBag_item_value {
  590. font-weight: bold;
  591. }
  592. }
  593. }
  594. }
  595. }
  596. }
  597. }
  598. </style>