detail.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  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. padding-bottom: 108rpx;
  325. // 头部
  326. .orderDetail_header {
  327. position: fixed;
  328. z-index: 98;
  329. width: 100%;
  330. height: 88rpx;
  331. background-color: #fff;
  332. color: #333;
  333. @include flex;
  334. .orderDetail_header_item {
  335. flex: 1;
  336. font-size: 32rpx;
  337. @include border(right);
  338. @include border(bottom);
  339. @include flex(center, center);
  340. &:last-of-type {
  341. border-right: none;
  342. }
  343. &.active {
  344. color: $defaultColor;
  345. border-bottom: 4rpx solid $defaultColor;
  346. }
  347. }
  348. }
  349. // tab
  350. // 工单详情
  351. .orderDetail_info {
  352. padding: 108rpx 24rpx 0;
  353. .orderDetail_infoItem {
  354. width: 702rpx;
  355. height: calc(100vh - 340rpx);
  356. background-color: #fff;
  357. margin-top: 8rpx;
  358. border-radius: 8rpx;
  359. position: relative;
  360. padding: 0 24rpx;
  361. font-size: 32rpx;
  362. @include border;
  363. @include semicircle(#f9fafb, 82rpx);
  364. @include flex(flex-start, stretch, column);
  365. .ji,
  366. .jiaji {
  367. width: 60rpx;
  368. position: absolute;
  369. right: 0;
  370. top: 0;
  371. }
  372. .orderDetail_infoItem_header {
  373. height: 86rpx;
  374. @include border($directive:bottom, $style:dashed);
  375. @include flex(space-between, center);
  376. .orderDetail_infoItem_header_title {
  377. color: #333;
  378. flex: 1;
  379. @include flex(flex-start, center);
  380. .icon {
  381. width: 10rpx;
  382. height: 46rpx;
  383. border-radius: 2rpx;
  384. background-color: #F0F6ED;
  385. @include btn_background;
  386. }
  387. .taskNameAndWorkerName {
  388. flex: 1;
  389. @include flex;
  390. .taskName {
  391. max-width: 10em;
  392. margin-left: 8rpx;
  393. font-size: 38rpx;
  394. font-weight: bold;
  395. @include clamp;
  396. }
  397. }
  398. }
  399. .orderDetail_infoItem_header_more {
  400. color: #333;
  401. font-weight: bold;
  402. font-size: 38rpx;
  403. @include clamp;
  404. }
  405. }
  406. .orderDetail_infoItem_item {
  407. padding-top: 12rpx;
  408. padding-bottom: 12rpx;
  409. color: #333;
  410. font-size: 30rpx;
  411. flex: 1;
  412. @include border(bottom);
  413. @include flex(flex-start, stretch, column);
  414. &.process {
  415. padding-top: 90rpx;
  416. padding-bottom: 90rpx;
  417. }
  418. &:last-of-type {
  419. border-bottom: none;
  420. }
  421. // 工单信息
  422. .orderDetail_infoItem_item_content {
  423. margin-top: 20rpx;
  424. @include flex(space-between, stretch);
  425. .orderDetail_infoItem_item_name {
  426. font-size: 34rpx;
  427. color: #666;
  428. max-width: 4em;
  429. }
  430. .orderDetail_infoItem_item_value {
  431. font-size: 38rpx;
  432. color: #333;
  433. font-weight: bold;
  434. max-width: 420rpx;
  435. text-align: justify;
  436. word-break: break-all;
  437. }
  438. }
  439. // 流程信息
  440. .orderDetail_process_item {
  441. min-height: 120rpx;
  442. line-height: 50rpx;
  443. color: #333;
  444. @include flex(center);
  445. &:last-of-type {
  446. .step_icon {
  447. &::after {
  448. display: none;
  449. }
  450. }
  451. }
  452. .step_infoStart {
  453. font-size: 28rpx;
  454. flex: 1;
  455. @include flex(flex-end);
  456. .step_time {
  457. margin-left: 16rpx;
  458. }
  459. }
  460. .step_icon {
  461. font-size: 38rpx;
  462. margin-left: 30rpx;
  463. margin-right: 30rpx;
  464. position: relative;
  465. color: #E5E9ED;
  466. &.active {
  467. color: #07863C;
  468. }
  469. &::after {
  470. content: '';
  471. position: absolute;
  472. top: 60rpx;
  473. left: 18rpx;
  474. width: 1px;
  475. height: calc(100% - 70rpx);
  476. background-color: #DDE1E5;
  477. }
  478. }
  479. .step_infoEnd {
  480. font-size: 34rpx;
  481. flex: 1;
  482. padding-bottom: 16rpx;
  483. }
  484. }
  485. // 业务信息-检查
  486. &.business_inspect {
  487. .inspect_info {
  488. font-size: 34rpx;
  489. color: #333;
  490. padding-top: 20rpx;
  491. padding-bottom: 20rpx;
  492. @include border($directive:bottom, $style:dashed);
  493. .inspect_info_block {
  494. height: 60rpx;
  495. @include flex(space-between, center);
  496. .inspect_info_left {
  497. @include flex;
  498. .inspect_info_icon {
  499. width: 50rpx;
  500. height: 50rpx;
  501. line-height: 50rpx;
  502. background-color: #FFE8EB;
  503. border-radius: 50%;
  504. border: 1px solid #FF3B53;
  505. color: #FF3B53;
  506. font-size: 28rpx;
  507. margin-right: 8rpx;
  508. @include flex(center, center);
  509. &.green {
  510. border: 1px solid $defaultColor;
  511. background-color: rgba(73, 184, 86, 0.1);
  512. }
  513. }
  514. .inspect_info_name {
  515. font-weight: bold;
  516. }
  517. }
  518. .inspect_info_right {
  519. font-weight: bold;
  520. }
  521. }
  522. }
  523. .inspect_item {
  524. color: #333;
  525. font-size: 34rpx;
  526. line-height: 48rpx;
  527. padding-top: 26rpx;
  528. padding-bottom: 26rpx;
  529. @include border($directive:bottom, $style:dashed);
  530. .inspect_item_name {
  531. font-weight: bold;
  532. }
  533. .inspect_item_yytime {
  534. font-weight: bold;
  535. }
  536. .inspect_item_info {
  537. margin-top: 16rpx;
  538. margin-bottom: 16rpx;
  539. @include flex(space-between, center);
  540. .inspect_item_dept {
  541. flex: 1;
  542. word-break: break-all;
  543. @include clamp;
  544. }
  545. .inspect_item_number {
  546. flex: 1;
  547. text-align: right;
  548. word-break: break-all;
  549. @include clamp;
  550. }
  551. }
  552. }
  553. }
  554. // 业务信息-标本
  555. &.business_specimen {
  556. font-size: 34rpx;
  557. .th {
  558. background-color: red;
  559. @include btn_background;
  560. th {
  561. color: #fff;
  562. }
  563. }
  564. .td {
  565. position: relative;
  566. .urgent {
  567. width: 60rpx;
  568. position: absolute !important;
  569. right: 0;
  570. top: 0;
  571. }
  572. }
  573. .table--border {
  574. border: none;
  575. }
  576. ::v-deep .uni-table {
  577. min-width: 0;
  578. }
  579. ::v-deep .uni-table-td {
  580. word-break: break-all;
  581. }
  582. }
  583. // 业务信息-药品
  584. &.business_drugsBag {
  585. .drugsBag_item {
  586. color: #333;
  587. font-size: 34rpx;
  588. margin-top: 20rpx;
  589. @include flex(space-between, center);
  590. .drugsBag_item_name {}
  591. .drugsBag_item_value {
  592. font-weight: bold;
  593. }
  594. }
  595. }
  596. }
  597. }
  598. }
  599. }
  600. </style>