inspectList.vue 22 KB

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