inspectList.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735
  1. <template>
  2. <view class="inspectList">
  3. <view class="page_tab">
  4. <view class="page_tab_bar active">
  5. <view class="tab_dept">
  6. <text @click="changeDept">{{ currenDept.dept}}</text>
  7. <!-- <button type="default" size="mini" class="changeDept" @click="changeDept">
  8. 切换科室
  9. </button> -->
  10. <!-- <button class="changeDept moreFilter" type="default" size="mini" @click="moreFilter()">
  11. 更多筛选
  12. </button> -->
  13. <button class="changeDept" type="default" size="mini" @click="moreFilter()">
  14. 更多筛选
  15. </button>
  16. </view>
  17. </view>
  18. </view>
  19. <view v-if="zxzData.length == 0" class="zwsj">
  20. <image class="zwsj-img" mode="widthFix" src="../../static/img/zanwushuju.png"></image>
  21. <view class="zwsj-txt">暂无数据</view>
  22. </view>
  23. <view v-if="zxzData.length" class="page_items">
  24. <scroll-view class="page_items_scroll" scroll-y :refresher-enabled="scroll_refresher_enabled"
  25. :refresher-triggered="triggered" @refresherrefresh="refresherrefresh" @refresherrestore="refresherrestore"
  26. @scrolltolower="scrolltolower" :scroll-top="scroll_top" @refresherabort="refresherabort" @scroll="scroll"
  27. refresher-background="transport">
  28. <view class="page_item_wrap" v-for="(item, index) of zxzData" :key="index">
  29. <view class="page_item">
  30. <view class="L"></view>
  31. <view class="R"></view>
  32. <view class="page_item_top">
  33. <view class="page_item_top_L">
  34. <template v-if="item.illnessState">
  35. <text v-if="item.illnessState.value === '2'"
  36. class="colorRed icon_transport transport-tubiao_wei"></text>
  37. <text v-if="item.illnessState.value === '3'" class="colorRed icon_transport transport-zhong"></text>
  38. </template>
  39. <template v-if="item.careLevel">
  40. <text v-if="item.careLevel.value === '0'" class="icon_transport transport-te1"></text>
  41. <text v-if="item.careLevel.value === '1'" class="icon_transport transport-1_round_solid"></text>
  42. <text v-if="item.careLevel.value === '2'" class="icon_transport transport-2_round_solid"></text>
  43. <text v-if="item.careLevel.value === '3'" class="icon_transport transport-3_round_solid"></text>
  44. </template>
  45. <text class="L_time"
  46. :style="{ color: item.focusPatient == 1 ? 'red' : '' }">{{ item.patientName }}({{ item.bedNum }})</text>
  47. </view>
  48. <view class="page_item_top_R">
  49. <text>{{item.inspectState?item.inspectState.name:''}}</text>
  50. <button @click="build(item)"
  51. v-if="!item.gdId&&(item.inspectState.value==1||item.inspectState.value==30)">建单</button>
  52. <button @click="viewWorkOrder(item)" v-if="item.gdId">查看工单</button>
  53. </view>
  54. </view>
  55. <view class="page_item_cont">
  56. <view class="page_item_conts">
  57. <view>
  58. <text class="p_title">住院号:</text>
  59. <text class="p_info">{{ item.residenceNo || "-" }}</text>
  60. </view>
  61. <view>
  62. <text class="p_title">检查科室:</text>
  63. <text class="p_info">{{
  64. item.execDept ? item.execDept.dept : "-"
  65. }}</text>
  66. </view>
  67. <view>
  68. <text class="p_title">检查项目:</text>
  69. <text class="p_info">{{ item.inspectName || "-" }}</text>
  70. </view>
  71. <view>
  72. <text class="p_title">预约时间:</text>
  73. <text class="p_info">{{ item.yyTime || "-" }}</text>
  74. </view>
  75. <view>
  76. <text class="p_title">预约叫号:</text>
  77. <text class="p_info">{{
  78. item.reservationNumber || "-"
  79. }}</text>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. <view class="L-l"></view>
  85. <view class="R-l"></view>
  86. </view>
  87. </scroll-view>
  88. </view>
  89. <!-- 底部扫一扫 -->
  90. <bigScreen></bigScreen>
  91. <!-- 筛选 -->
  92. <fjj-condition @touchmove.stop :list="list" :visibleDrawer="visibleDrawer" @result="resultConditon"
  93. :keyWordGvie="searchlist.keyWord" :bedNumSortGvie="searchlist.bedNumSort" :inspectStateList="inspectStateList" />
  94. <!-- 弹窗 -->
  95. <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content"
  96. @ok="ok" @cancel="cancel" @know="know" :operate="models.operate"></showModel>
  97. </view>
  98. </template>
  99. <script>
  100. import bigScreen from "../../components/bigScreen/bigScreen.vue";
  101. import {
  102. get,
  103. post,
  104. deleteIt,
  105. webHandle
  106. } from "../../http/http.js";
  107. // https://ext.dcloud.net.cn/plugin?id=2849
  108. import fjjCondition from "@/components/fjj-condition/fjj-condition.vue";
  109. import showModel from "../../components/showModel/showModel.vue";
  110. export default {
  111. data() {
  112. return {
  113. // 记录当前滚动条的位置
  114. scrollYY: 0,
  115. // 建单的对象
  116. jdItem: {},
  117. // 弹窗model
  118. models: {
  119. disjunctor: false,
  120. },
  121. // 面板是否显示
  122. visibleDrawer: false,
  123. // 面板数据
  124. list: [{
  125. title: "时间",
  126. type: "single", //single不带时分秒
  127. key: "yyTime",
  128. },
  129. {
  130. title: "关键词",
  131. type: "keyWord", //keyWord是input
  132. key: "keyWord",
  133. },
  134. {
  135. title: "排序",
  136. type: "bedNumSort", //床号排序
  137. key: "bedNumSort",
  138. },
  139. {
  140. title: "检查信息状态",
  141. type: "inspectState", //检查信息状态
  142. key: "inspectState",
  143. },
  144. ],
  145. // 面板搜索数据
  146. searchlist: {
  147. yyTime: new Date().Format("yyyy/MM/dd"),
  148. keyWord: "",
  149. bedNumSort: false,
  150. inspectState: 0,
  151. },
  152. // 检查信息状态列表
  153. inspectStateList: [],
  154. //当前登录人所属科室
  155. currenDept: {},
  156. // 抢单的id
  157. qdId: "",
  158. //列表数据
  159. zxzData: [],
  160. //分页页码
  161. idx: 0,
  162. // 列表项总数
  163. totalNum: -1,
  164. triggered: false, //下拉刷新状态
  165. freshing: false, //上拉加载开关
  166. scroll_top: 0, //距离顶部的距离
  167. scroll_refresher_enabled: true, //是否开启自定义下拉刷新
  168. };
  169. },
  170. components: {
  171. bigScreen,
  172. fjjCondition,
  173. },
  174. methods: {
  175. // 更多筛选
  176. moreFilter() {
  177. uni.showLoading({
  178. title: "加载中",
  179. mask: true,
  180. });
  181. let postData = {
  182. "type": "list",
  183. "key": "inspect_state"
  184. };
  185. post("/common/common/getDictionary", postData).then((result) => {
  186. this.inspectStateList = result.map(item => {
  187. return {
  188. name: item.name,
  189. value: item.value
  190. }
  191. });
  192. this.inspectStateList.unshift({
  193. name: '全部',
  194. value: 0
  195. });
  196. uni.hideLoading();
  197. this.visibleDrawer = true;
  198. })
  199. },
  200. // 查看工单
  201. viewWorkOrder(data) {
  202. console.log(data)
  203. uni.navigateTo({
  204. url: `../receipt_infopage/receipt_infopage?id=${data.gdId}`,
  205. });
  206. },
  207. // 建单
  208. build(data) {
  209. console.log(data);
  210. this.jdItem = data;
  211. this.models = {
  212. disjunctor: true,
  213. title: "提示",
  214. content: `您即将创建【${data.patientName || ""}】患者前往【${
  215. data.execDept ? data.execDept.dept : ""
  216. }】进行【${data.inspectName || ""}】检查,您确认吗?`,
  217. icon: "warn",
  218. operate: {
  219. ok: "确定",
  220. cancel: "取消",
  221. },
  222. };
  223. },
  224. //建单后知道了
  225. know() {
  226. this.models.disjunctor = false;
  227. this.idx = 0;
  228. this.totalNum = -1;
  229. this.waitingOrders(0);
  230. // this.scroll_top = Math.random(); //回到顶部
  231. this.scroll_top = this.scrollYY; //回到当前位置
  232. },
  233. //建单确定
  234. ok() {
  235. this.models.disjunctor = false;
  236. let postData = {
  237. deptId: this.currenDept.id
  238. };
  239. let taskId;
  240. uni.showLoading({
  241. title: "加载中",
  242. mask: true,
  243. });
  244. post("/nurse/getDeptTaskType", postData).then((result) => {
  245. if (result.status == 200) {
  246. let obj = result.data.allTaskTypes.filter(
  247. (item) => item.associationType.value == "inspect"
  248. );
  249. if (obj.length) {
  250. taskId = obj[0].id;
  251. let postData = {
  252. workOrder: {
  253. taskType: {
  254. id: taskId
  255. },
  256. createDept: this.currenDept.id,
  257. startDept: {
  258. id: this.currenDept.id
  259. },
  260. patient: {
  261. patientCode: this.jdItem.patientCode
  262. },
  263. checkList: [{
  264. id: this.jdItem.id
  265. }],
  266. goods: "",
  267. worker: {
  268. id: uni.getStorageSync("userData").user.id
  269. },
  270. workerStartOrderFlag: 1,
  271. },
  272. };
  273. post("/api/startOrder", postData).then((res) => {
  274. uni.hideLoading();
  275. let msg = res.msg;
  276. let icon = "error";
  277. if (res.status == 200) {
  278. msg = "建单成功";
  279. icon = "success";
  280. }
  281. this.models = {
  282. disjunctor: true,
  283. content: msg,
  284. icon: icon,
  285. operate: {
  286. know: "知道了",
  287. },
  288. };
  289. });
  290. } else {
  291. uni.hideLoading();
  292. this.models = {
  293. disjunctor: true,
  294. content: "建单失败,科室未开通!",
  295. icon: "error",
  296. operate: {
  297. know: "知道了",
  298. },
  299. };
  300. }
  301. } else {
  302. uni.hideLoading();
  303. uni.showToast({
  304. icon: "none",
  305. title: "请求失败!",
  306. });
  307. }
  308. });
  309. },
  310. //建单取消
  311. cancel() {
  312. this.models.disjunctor = false;
  313. },
  314. //点击确定后返回参数
  315. resultConditon(obj) {
  316. console.log(obj);
  317. this.visibleDrawer = obj.visibleDrawer;
  318. if (obj.str_result) {
  319. this.searchlist = {
  320. yyTime: obj.str_result.yyTime,
  321. keyWord: obj.str_result.keyWord,
  322. bedNumSort: obj.str_result.bedNumSort,
  323. inspectState: obj.str_result.inspectState,
  324. };
  325. this.idx = 0;
  326. this.totalNum = -1;
  327. this.waitingOrders(0);
  328. }
  329. },
  330. // 切换科室
  331. changeDept() {
  332. uni.navigateTo({
  333. url: `../search/search?type=inspectList`,
  334. });
  335. },
  336. //检查列表数据获取
  337. waitingOrders(idx) {
  338. if (this.zxzData.length == this.totalNum) {
  339. uni.showToast({
  340. icon: "none",
  341. title: "没有更多数据了!",
  342. });
  343. this.freshing = true;
  344. return;
  345. }
  346. console.log(this.searchlist, 222222)
  347. let postData = {
  348. idx,
  349. sum: 99999,
  350. inspect: {
  351. hosId: uni.getStorageSync("userData").user.currentHospital.id,
  352. platForm: 2,
  353. searchDays: 10000,
  354. applyDept: {
  355. id: this.currenDept.id,
  356. },
  357. clickSort: this.searchlist.bedNumSort,
  358. yyTime: this.searchlist.yyTime.split("/").join("-") + " 00:00:00",
  359. },
  360. };
  361. if (this.searchlist.inspectState) {
  362. postData.inspect.inspectState = {
  363. "value": this.searchlist.inspectState
  364. };
  365. }
  366. // url传递过来的住院号
  367. if (this.currenDept.residenceNo) {
  368. this.searchlist.keyWord = this.currenDept.residenceNo;
  369. this.currenDept.residenceNo = "";
  370. }
  371. if (this.searchlist.keyWord) {
  372. postData.inspect.keyWord = this.searchlist.keyWord;
  373. }
  374. uni.showLoading({
  375. title: "加载中",
  376. mask: true,
  377. });
  378. // 请求列表数据
  379. post("/nurse/fetchDataList/inspect", postData).then((res) => {
  380. uni.hideLoading();
  381. if (res.status == 200) {
  382. this.triggered = false;
  383. this.freshing = true;
  384. this.totalNum = res.totalNum;
  385. if (idx === 0) {
  386. this.zxzData = res.list;
  387. } else {
  388. this.zxzData.push(...res.list);
  389. }
  390. } else {
  391. uni.showToast({
  392. icon: "none",
  393. title: "请求失败!",
  394. });
  395. }
  396. });
  397. },
  398. //刷新
  399. refresherrefresh() {
  400. if (this.triggered) {
  401. return;
  402. }
  403. console.log("下拉刷新");
  404. this.triggered = true;
  405. this.idx = 0;
  406. this.totalNum = -1;
  407. this.waitingOrders(0);
  408. },
  409. // 下拉刷新复位
  410. refresherrestore() {
  411. this.triggered = false;
  412. console.log("下拉刷新复位");
  413. },
  414. //下拉刷新中止
  415. refresherabort() {
  416. this.triggered = false;
  417. console.log("下拉刷新中止");
  418. },
  419. //分页,上拉加载
  420. scrolltolower() {
  421. if (this.freshing) {
  422. console.log("上拉加载");
  423. this.freshing = false;
  424. this.waitingOrders(++this.idx);
  425. }
  426. },
  427. // 滚动
  428. scroll(e) {
  429. this.scrollYY = e.detail.scrollTop;
  430. if (e.detail.scrollTop < 20) {
  431. this.scroll_refresher_enabled = true;
  432. } else {
  433. this.scroll_refresher_enabled = false;
  434. }
  435. },
  436. // 阻止浏览器滑动
  437. stop(e) {
  438. e.preventDefault();
  439. },
  440. },
  441. onLoad(options) {
  442. let patientCurrentDept = uni.getStorageSync("patientCurrentDept");
  443. if (Object.keys(options).length) {
  444. let {
  445. id,
  446. dept,
  447. residenceNo
  448. } = options;
  449. this.currenDept.id = id;
  450. this.currenDept.dept = dept;
  451. this.currenDept.residenceNo = residenceNo;
  452. } else if (patientCurrentDept) {
  453. this.currenDept.id = patientCurrentDept.id;
  454. this.currenDept.dept = patientCurrentDept.dept;
  455. } else {
  456. this.currenDept = uni.getStorageSync("userData").user.dept;
  457. }
  458. this.waitingOrders(0);
  459. // #ifdef APP-PLUS
  460. webHandle("no", "app");
  461. // #endif
  462. // #ifdef H5
  463. webHandle("no", "wx");
  464. // #endif
  465. },
  466. onShow() {
  467. // #ifdef H5
  468. document.body.addEventListener("touchmove", this.stop, {
  469. passive: false,
  470. });
  471. // #endif
  472. },
  473. onHide() {
  474. // #ifdef H5
  475. document.body.removeEventListener("touchmove", this.stop, {
  476. passive: false,
  477. });
  478. // #endif
  479. },
  480. };
  481. </script>
  482. <style lang="less">
  483. .inspectList {
  484. width: 100%;
  485. height: 100%;
  486. position: relative;
  487. .icon_transport {
  488. color: #49b856;
  489. font-size: 36rpx;
  490. &.colorRed {
  491. color: red;
  492. font-size: 32rpx;
  493. }
  494. }
  495. .page_tab {
  496. width: 100%;
  497. height: 96rpx;
  498. display: flex;
  499. position: fixed;
  500. left: 0;
  501. top: 0;
  502. z-index: 999;
  503. .page_tab_bar {
  504. flex: 1;
  505. font-size: 36rpx;
  506. background: #fff;
  507. display: flex;
  508. justify-content: center;
  509. align-items: center;
  510. position: relative;
  511. &:after {
  512. content: "";
  513. position: absolute;
  514. left: 0;
  515. bottom: 0;
  516. height: 2rpx;
  517. width: 100%;
  518. background-color: transparent;
  519. }
  520. .tab_dept {
  521. position: relative;
  522. .changeDept {
  523. width: 140rpx;
  524. white-space: nowrap;
  525. margin: 0;
  526. position: absolute;
  527. right: 0;
  528. top: 50%;
  529. transform: translate(105%, -50%);
  530. padding: 0 0.5em;
  531. line-height: 2;
  532. }
  533. .moreFilter {
  534. left: 0;
  535. transform: translate(-105%, -50%);
  536. }
  537. }
  538. &.active {
  539. color: #49b856;
  540. &:after {
  541. background-color: #49b856;
  542. }
  543. }
  544. }
  545. }
  546. .zwsj {
  547. position: absolute;
  548. left: 50%;
  549. top: 180rpx;
  550. transform: translateX(-50%);
  551. .zwsj-img {
  552. width: 560rpx;
  553. }
  554. .zwsj-txt {
  555. font-size: 36rpx;
  556. font-weight: 700;
  557. margin-top: 20rpx;
  558. text-align: center;
  559. }
  560. }
  561. .page_items {
  562. height: calc(100vh - 184rpx);
  563. padding: 0 20rpx;
  564. padding-top: 96rpx;
  565. .page_items_scroll {
  566. height: 100%;
  567. .page_item_wrap {
  568. position: relative;
  569. margin-bottom: 32rpx;
  570. .page_item {
  571. margin-bottom: 16rpx;
  572. background: #fff;
  573. border-radius: 8rpx;
  574. overflow: hidden;
  575. border: 2rpx solid #e5e9ed;
  576. display: flex;
  577. flex-direction: column;
  578. justify-content: space-between;
  579. .L {
  580. width: 40rpx;
  581. height: 40rpx;
  582. border-radius: 50%;
  583. background: #f9fafb;
  584. position: absolute;
  585. left: -24rpx;
  586. top: 68rpx;
  587. border: 2rpx solid #e5e9ed;
  588. }
  589. .R {
  590. width: 40rpx;
  591. height: 40rpx;
  592. border-radius: 50%;
  593. background: #f9fafb;
  594. position: absolute;
  595. float: right;
  596. right: -24rpx;
  597. top: 68rpx;
  598. border: 2rpx solid #e5e9ed;
  599. }
  600. .page_item_top {
  601. height: 86rpx;
  602. border-bottom: 2rpx dashed #e5e9ed;
  603. padding: 0 16rpx;
  604. display: flex;
  605. align-items: center;
  606. justify-content: space-between;
  607. .page_item_top_L {
  608. height: 100%;
  609. float: left;
  610. display: flex;
  611. align-items: center;
  612. line-height: 88rpx;
  613. text-overflow: ellipsis;
  614. overflow: hidden;
  615. white-space: nowrap;
  616. color: #6cc076;
  617. .L_time {
  618. font-size: 28rpx;
  619. }
  620. }
  621. .page_item_top_R {
  622. float: right;
  623. display: flex;
  624. align-items: center;
  625. justify-content: space-between;
  626. text {
  627. font-size: 28rpx;
  628. color: #49b856;
  629. margin-right: 16rpx;
  630. }
  631. button {
  632. font-size: 28rpx;
  633. color: #49b856;
  634. height: 50rpx;
  635. line-height: 50rpx;
  636. margin: 0;
  637. }
  638. }
  639. }
  640. .page_item_cont {
  641. min-height: 100rpx;
  642. max-height: 344rpx;
  643. padding: 16rpx;
  644. text-align: left;
  645. position: relative;
  646. .page_item_conts {
  647. color: rgb(102, 102, 102);
  648. font-size: 28rpx;
  649. min-height: 100rpx;
  650. max-height: 344rpx;
  651. view {
  652. margin-bottom: 10rpx;
  653. margin-left: 40rpx;
  654. display: flex;
  655. }
  656. .p_title {
  657. width: 160rpx;
  658. }
  659. .p_info {
  660. flex: 1;
  661. }
  662. .num {
  663. float: right;
  664. }
  665. }
  666. }
  667. .page_item_btn {
  668. height: 88rpx;
  669. background-image: linear-gradient(to right, #72c172, #3bb197);
  670. border-radius: 8rpx;
  671. line-height: 88rpx;
  672. color: #fff;
  673. font-size: 36rpx;
  674. font-weight: 700;
  675. text-align: center;
  676. }
  677. }
  678. .L-l {
  679. width: 2rpx;
  680. height: 40rpx;
  681. background: #f9fafb;
  682. position: absolute;
  683. left: 20rpx;
  684. top: 72rpx;
  685. display: none;
  686. }
  687. .R-l {
  688. width: 2rpx;
  689. height: 40rpx;
  690. background: #f9fafb;
  691. position: absolute;
  692. right: 20rpx;
  693. top: 72rpx;
  694. display: none;
  695. }
  696. }
  697. }
  698. }
  699. }
  700. </style>