patientInformationList.vue 22 KB

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