patientInformationList.vue 17 KB

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