patientInformationList.vue 18 KB

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