inspectList.vue 21 KB

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