detail.vue 21 KB

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