patientInformationList.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. <template>
  2. <view class="patientInformationList">
  3. <view class="page_tab">
  4. <view class="page_tab_bar active">
  5. <view class="tab_dept">{{ currenDept.dept
  6. }}<button type="default" size="mini" class="changeDept" @click="changeDept">
  7. 切换科室
  8. </button></view>
  9. </view>
  10. </view>
  11. <view v-if="zxzData.length == 0" class="zwsj">
  12. <image class="zwsj-img" mode="widthFix" src="../../static/img/zanwushuju.png"></image>
  13. <view class="zwsj-txt">暂无数据</view>
  14. </view>
  15. <view v-if="zxzData.length" class="page_items">
  16. <scroll-view class="page_items_scroll" scroll-y :refresher-enabled="scroll_refresher_enabled"
  17. :refresher-triggered="triggered" @refresherrefresh="refresherrefresh" @refresherrestore="refresherrestore"
  18. @scrolltolower="scrolltolower" :scroll-top="scroll_top" @refresherabort="refresherabort" @scroll="scroll"
  19. refresher-background="transport">
  20. <view class="page_item_wrap" v-for="(item, index) of zxzData" :key="index">
  21. <view class="page_item">
  22. <view class="L"></view>
  23. <view class="R"></view>
  24. <view class="page_item_top">
  25. <view class="page_item_top_L">
  26. <template v-if="item.illnessState">
  27. <text v-if="item.illnessState.value === '2'"
  28. class="colorRed icon_transport transport-tubiao_wei"></text>
  29. <text v-if="item.illnessState.value === '3'" class="colorRed icon_transport transport-zhong"></text>
  30. </template>
  31. <template v-if="item.careLevel">
  32. <text v-if="item.careLevel.value === '0'" class="icon_transport transport-te1"></text>
  33. <text v-if="item.careLevel.value === '1'" class="icon_transport transport-1_round_solid"></text>
  34. <text v-if="item.careLevel.value === '2'" class="icon_transport transport-2_round_solid"></text>
  35. <text v-if="item.careLevel.value === '3'" class="icon_transport transport-3_round_solid"></text>
  36. </template>
  37. <view class="page_item_top_R" v-show="wechatFocusSwitch == 1 && item.focusPatient == 1">
  38. 需要帮助
  39. </view>
  40. <view class="page_item_top_R" style="background-color: #49b856"
  41. v-show="wechatFocusSwitch == 1 && !item.focusPatient">
  42. 无需帮助
  43. </view>
  44. </view>
  45. <view class="send_wrap">
  46. <view class="sendBack">
  47. <button @click="sendBack(item)">送回病房</button>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="page_item_cont">
  52. <view class="page_item_conts">
  53. <view>{{ item.patientName }}({{ item.patientCode }})</view>
  54. <view> 床号:{{ item.bedNum || "-" }} </view>
  55. <view> 待检:{{ item.watingCount }} </view>
  56. </view>
  57. </view>
  58. <view class="page_item_btn" hover-class="seimin-btn-hover" @click="itemInfo(item.patientCode)">患者详情</view>
  59. </view>
  60. <view class="L-l"></view>
  61. <view class="R-l"></view>
  62. </view>
  63. </scroll-view>
  64. </view>
  65. <!-- 底部扫一扫 -->
  66. <bigScreen></bigScreen>
  67. <!-- 送回病房弹窗 -->
  68. <showModel :title="models1.title" :icon="models1.icon" :disjunctor="models1.disjunctor" :content="models1.content"
  69. :operate="models1.operate" @ok="ok1" @cancel="cancel1"></showModel>
  70. <!-- 送回病房建单弹窗 -->
  71. <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content"
  72. :operate="models2.operate" @ok="ok2" @cancel="cancel2"></showModel>
  73. </view>
  74. </template>
  75. <script>
  76. import bigScreen from "../../components/bigScreen/bigScreen.vue";
  77. import {
  78. get,
  79. post,
  80. deleteIt,
  81. webHandle
  82. } from "../../http/http.js";
  83. export default {
  84. data() {
  85. return {
  86. hosId: uni.getStorageSync("userData").user.currentHospital.id,
  87. // 选中的患者项
  88. currentItem: {},
  89. // 送回病房弹窗model
  90. models1: {
  91. disjunctor: false,
  92. },
  93. // 送回病房建单弹窗model
  94. models2: {
  95. disjunctor: false,
  96. },
  97. scrollYY: 0, //滚动条滚动的距离
  98. options: {},
  99. wechatFocusSwitch: 0,
  100. //当前登录人所属科室
  101. currenDept: {},
  102. // 抢单的id
  103. qdId: "",
  104. //列表数据
  105. zxzData: [],
  106. //分页页码
  107. idx: 0,
  108. // 列表项总数
  109. totalNum: -1,
  110. triggered: false, //下拉刷新状态
  111. freshing: false, //上拉加载开关
  112. scroll_top: 0, //距离顶部的距离
  113. scroll_refresher_enabled: true, //是否开启自定义下拉刷新
  114. };
  115. },
  116. components: {
  117. bigScreen,
  118. },
  119. methods: {
  120. ok2() {
  121. this.models2.disjunctor = false;
  122. let currentItem = JSON.parse(this.options.currentItem);
  123. uni.showLoading({
  124. mask: true,
  125. title: '加载中'
  126. })
  127. let userId = uni.getStorageSync("userData").user.id;
  128. let postData = {
  129. "workOrder": {
  130. sourceId: 4,
  131. "hosId": this.hosId,
  132. "startDept": {
  133. "id": this.options.did
  134. },
  135. "createDept": this.options.did,
  136. "patient": {
  137. "patientCode": currentItem.patientCode
  138. },
  139. "worker": {
  140. "id": userId
  141. }
  142. }
  143. };
  144. console.log(postData)
  145. post("/workerOrder/returnSickRoom", postData).then((res) => {
  146. uni.hideLoading();
  147. if (res.status == 200) {
  148. uni.showToast({
  149. icon: 'success',
  150. title: '建单成功',
  151. });
  152. } else {
  153. uni.showToast({
  154. icon: "none",
  155. title: "请求失败!",
  156. });
  157. }
  158. })
  159. },
  160. cancel2() {
  161. this.models2.disjunctor = false;
  162. },
  163. // 送回病房-建单
  164. sendBuild() {
  165. let currentItem = JSON.parse(this.options.currentItem);
  166. this.models2 = {
  167. disjunctor: true,
  168. title: "提示",
  169. content: `您选择的起点科室为【${this.options.ddept}】,您将从【${this.options.ddept}】把【${currentItem.patientName}】送回【${this.options.dept}】,如您确认请点击“确认建单”。`,
  170. icon: "warn",
  171. operate: {
  172. ok: "确认建单",
  173. cancel: "取消",
  174. },
  175. };
  176. },
  177. // 送回病房-选择起点科室
  178. sendBack(item) {
  179. this.currentItem = item;
  180. this.models1 = {
  181. disjunctor: true,
  182. title: "提示",
  183. content: `您好,您是要将【${item.patientName}】送回病房吗?如确认请您点击“选择起点科室”建立工单。`,
  184. icon: "warn",
  185. operate: {
  186. ok: "选择起点科室",
  187. cancel: "取消",
  188. },
  189. };
  190. },
  191. ok1() {
  192. this.models1.disjunctor = false;
  193. uni.navigateTo({
  194. url: `../search/search?type=sendBackPatientList&currentItem=${JSON.stringify(this.currentItem)}&cid=${this.currenDept.id}&cdept=${this.currenDept.dept}&scrollYY=${this.scrollYY}`,
  195. });
  196. },
  197. cancel1() {
  198. this.models1.disjunctor = false;
  199. },
  200. // 切换科室
  201. changeDept() {
  202. uni.navigateTo({
  203. url: `../search/search?type=patientInformationList`,
  204. });
  205. },
  206. // 进入详情页
  207. itemInfo(patientCode) {
  208. // #ifdef H5
  209. document.body.removeEventListener("touchmove", this.stop, {
  210. passive: false,
  211. });
  212. // #endif
  213. uni.navigateTo({
  214. url: `../patientInformationInfo/patientInformationInfo?patientCode=${patientCode}`,
  215. });
  216. },
  217. //患者列表数据获取
  218. waitingOrders(idx) {
  219. if (this.zxzData.length == this.totalNum) {
  220. uni.showToast({
  221. icon: "none",
  222. title: "没有更多数据了!",
  223. });
  224. this.freshing = true;
  225. return;
  226. }
  227. let data = {
  228. idx,
  229. sum: 99999,
  230. patient: {
  231. department: {
  232. id: this.currenDept.id,
  233. },
  234. },
  235. };
  236. uni.showLoading({
  237. title: "加载中",
  238. mask: true,
  239. });
  240. // 请求列表数据
  241. post("/nurse/fetchDataList/patient", data).then((res) => {
  242. uni.hideLoading();
  243. if (res.status == 200) {
  244. this.triggered = false;
  245. this.freshing = true;
  246. this.totalNum = res.totalNum;
  247. if (idx === 0) {
  248. this.zxzData = res.list;
  249. } else {
  250. this.zxzData.push(...res.list);
  251. }
  252. } else {
  253. uni.showToast({
  254. icon: "none",
  255. title: "请求失败!",
  256. });
  257. }
  258. });
  259. },
  260. //刷新
  261. refresherrefresh() {
  262. if (this.triggered) {
  263. return;
  264. }
  265. console.log("下拉刷新");
  266. this.triggered = true;
  267. this.idx = 0;
  268. this.totalNum = -1;
  269. this.waitingOrders(0);
  270. },
  271. // 下拉刷新复位
  272. refresherrestore() {
  273. this.triggered = false;
  274. console.log("下拉刷新复位");
  275. },
  276. //下拉刷新中止
  277. refresherabort() {
  278. this.triggered = false;
  279. console.log("下拉刷新中止");
  280. },
  281. //分页,上拉加载
  282. scrolltolower() {
  283. if (this.freshing) {
  284. console.log("上拉加载");
  285. this.freshing = false;
  286. this.waitingOrders(++this.idx);
  287. }
  288. },
  289. // 滚动
  290. scroll(e) {
  291. this.scrollYY = e.detail.scrollTop;
  292. if (e.detail.scrollTop < 20) {
  293. this.scroll_refresher_enabled = true;
  294. } else {
  295. this.scroll_refresher_enabled = false;
  296. }
  297. },
  298. // 阻止浏览器滑动
  299. stop(e) {
  300. e.preventDefault();
  301. },
  302. // 获取需要帮助权限
  303. getWechatFocusSwitch() {
  304. let postData = {
  305. idx: 0,
  306. sum: 1,
  307. taskType: {
  308. hosIds: this.hosId,
  309. associationType: {
  310. id: 260,
  311. },
  312. },
  313. };
  314. post("/configuration/fetchDataList/taskType", postData).then((res) => {
  315. if (res.status == 200) {
  316. this.wechatFocusSwitch = res.list[0].wechatFocusSwitch;
  317. } else {
  318. uni.showToast({
  319. icon: "none",
  320. title: "请求失败!",
  321. });
  322. }
  323. });
  324. },
  325. },
  326. onLoad(options) {
  327. console.log(options);
  328. this.options = options;
  329. //滚动条位置设置
  330. if (options.scrollYY !== undefined) {
  331. this.scroll_top = options.scrollYY;
  332. }
  333. if (options.did && options.ddept && options.currentItem) {
  334. this.sendBuild();
  335. }
  336. let patientCurrentDept = uni.getStorageSync("patientCurrentDept");
  337. if (options.id && options.dept) {
  338. let {
  339. id,
  340. dept
  341. } = options;
  342. this.currenDept.id = id;
  343. this.currenDept.dept = dept;
  344. } else if (patientCurrentDept) {
  345. this.currenDept.id = patientCurrentDept.id;
  346. this.currenDept.dept = patientCurrentDept.dept;
  347. } else {
  348. this.currenDept = uni.getStorageSync("userData").user.dept;
  349. }
  350. this.getWechatFocusSwitch();
  351. this.waitingOrders(0);
  352. // #ifdef APP-PLUS
  353. webHandle("no", "app");
  354. // #endif
  355. // #ifdef H5
  356. webHandle("no", "wx");
  357. // #endif
  358. },
  359. onShow() {
  360. // #ifdef H5
  361. document.body.addEventListener("touchmove", this.stop, {
  362. passive: false,
  363. });
  364. // #endif
  365. },
  366. onHide() {
  367. // #ifdef H5
  368. document.body.removeEventListener("touchmove", this.stop, {
  369. passive: false,
  370. });
  371. // #endif
  372. },
  373. };
  374. </script>
  375. <style lang="less">
  376. .patientInformationList {
  377. width: 100%;
  378. height: 100%;
  379. position: relative;
  380. .icon_transport {
  381. color: #49b856;
  382. font-size: 50rpx;
  383. &.colorRed {
  384. color: red;
  385. font-size: 40rpx;
  386. }
  387. }
  388. .page_tab {
  389. width: 100%;
  390. height: 96rpx;
  391. display: flex;
  392. position: fixed;
  393. left: 0;
  394. top: 0;
  395. z-index: 999;
  396. .page_tab_bar {
  397. flex: 1;
  398. font-size: 36rpx;
  399. background: #fff;
  400. display: flex;
  401. justify-content: center;
  402. align-items: center;
  403. position: relative;
  404. &:after {
  405. content: "";
  406. position: absolute;
  407. left: 0;
  408. bottom: 0;
  409. height: 2rpx;
  410. width: 100%;
  411. background-color: transparent;
  412. }
  413. .tab_dept {
  414. position: relative;
  415. .changeDept {
  416. white-space: nowrap;
  417. margin: 0;
  418. position: absolute;
  419. right: 0;
  420. top: 50%;
  421. transform: translate(105%, -50%);
  422. padding: 0 0.5em;
  423. line-height: 2;
  424. }
  425. }
  426. &.active {
  427. color: #49b856;
  428. &:after {
  429. background-color: #49b856;
  430. }
  431. }
  432. }
  433. }
  434. .zwsj {
  435. position: absolute;
  436. left: 50%;
  437. top: 180rpx;
  438. transform: translateX(-50%);
  439. .zwsj-img {
  440. width: 560rpx;
  441. }
  442. .zwsj-txt {
  443. font-size: 36rpx;
  444. font-weight: 700;
  445. margin-top: 20rpx;
  446. text-align: center;
  447. }
  448. }
  449. .page_items {
  450. height: calc(100vh - 184rpx);
  451. padding: 0 20rpx;
  452. padding-top: 96rpx;
  453. .page_items_scroll {
  454. height: 100%;
  455. .page_item_wrap {
  456. position: relative;
  457. margin-bottom: 32rpx;
  458. .page_item {
  459. margin-bottom: 16rpx;
  460. height: 276rpx;
  461. background: #fff;
  462. border-radius: 8rpx;
  463. overflow: hidden;
  464. border: 2rpx solid #e5e9ed;
  465. display: flex;
  466. flex-direction: column;
  467. justify-content: space-between;
  468. .L {
  469. width: 40rpx;
  470. height: 40rpx;
  471. border-radius: 50%;
  472. background: #f9fafb;
  473. position: absolute;
  474. left: -24rpx;
  475. top: 68rpx;
  476. border: 2rpx solid #e5e9ed;
  477. }
  478. .R {
  479. width: 40rpx;
  480. height: 40rpx;
  481. border-radius: 50%;
  482. background: #f9fafb;
  483. position: absolute;
  484. float: right;
  485. right: -24rpx;
  486. top: 68rpx;
  487. border: 2rpx solid #e5e9ed;
  488. }
  489. .page_item_top {
  490. height: 86rpx;
  491. border-bottom: 2rpx dashed #e5e9ed;
  492. padding: 0 16rpx;
  493. display: flex;
  494. align-items: center;
  495. justify-content: space-between;
  496. .send_wrap {
  497. display: flex;
  498. justify-content: space-between;
  499. align-items: center;
  500. }
  501. .sendBack {
  502. button {
  503. font-size: 28rpx;
  504. height: 52rpx;
  505. line-height: 52rpx;
  506. margin: 0;
  507. color: rgb(7, 134, 60);
  508. }
  509. }
  510. .page_item_top_L {
  511. height: 100%;
  512. float: left;
  513. display: flex;
  514. align-items: center;
  515. line-height: 88rpx;
  516. .L_time {
  517. color: #6cc076;
  518. font-size: 32rpx;
  519. }
  520. }
  521. .page_item_top_R {
  522. height: 40rpx;
  523. float: right;
  524. line-height: 40rpx;
  525. font-size: 24rpx;
  526. padding: 0 8rpx;
  527. background-color: red;
  528. color: #fff;
  529. }
  530. }
  531. .page_item_cont {
  532. min-height: 100rpx;
  533. max-height: 344rpx;
  534. padding: 0 16rpx;
  535. text-align: left;
  536. position: relative;
  537. .page_item_conts {
  538. color: rgb(102, 102, 102);
  539. font-size: 28rpx;
  540. display: flex;
  541. align-items: center;
  542. min-height: 100rpx;
  543. max-height: 344rpx;
  544. view {
  545. margin-bottom: 10rpx;
  546. margin-left: 40rpx;
  547. &:first-of-type {
  548. margin-left: 0;
  549. }
  550. }
  551. text {
  552. color: #49b856;
  553. }
  554. .num {
  555. float: right;
  556. }
  557. }
  558. }
  559. .page_item_btn {
  560. height: 88rpx;
  561. background-image: linear-gradient(to right, #72c172, #3bb197);
  562. border-radius: 8rpx;
  563. line-height: 88rpx;
  564. color: #fff;
  565. font-size: 36rpx;
  566. font-weight: 700;
  567. text-align: center;
  568. }
  569. }
  570. .L-l {
  571. width: 2rpx;
  572. height: 40rpx;
  573. background: #f9fafb;
  574. position: absolute;
  575. left: 20rpx;
  576. top: 72rpx;
  577. display: none;
  578. }
  579. .R-l {
  580. width: 2rpx;
  581. height: 40rpx;
  582. background: #f9fafb;
  583. position: absolute;
  584. right: 20rpx;
  585. top: 72rpx;
  586. display: none;
  587. }
  588. }
  589. }
  590. }
  591. }
  592. </style>