detail.vue 21 KB

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