inspectList.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757
  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,30",
  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. label: item.name,
  198. value: item.value
  199. }
  200. });
  201. this.inspectStateList.unshift({
  202. label: '全部',
  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. sourceId: 4,
  263. taskType: {
  264. id: taskId,
  265. isHalfInspect: obj[0].isHalfInspect === 1 ? 1 : 0
  266. },
  267. createDept: this.currenDept.id,
  268. startDept: {
  269. id: this.currenDept.id
  270. },
  271. patient: {
  272. patientCode: this.jdItem.patientCode
  273. },
  274. checkList: [{
  275. id: this.jdItem.id
  276. }],
  277. goods: "",
  278. worker: {
  279. id: uni.getStorageSync("userData").user.id
  280. },
  281. workerStartOrderFlag: 1,
  282. },
  283. };
  284. //根据检查的紧急度加急
  285. if (this.jdItem.priority === 1 || this.jdItem.priority === '1') {
  286. postData.workOrder["urgentDetails"] = {
  287. checkStatus: {
  288. id: 329
  289. },
  290. urgentReason: '系统根据检查信息,自动进行加急',
  291. };
  292. }
  293. post("/api/startOrder", postData).then((res) => {
  294. uni.hideLoading();
  295. let msg = res.msg;
  296. let icon = "error";
  297. if (res.status == 200) {
  298. msg = "建单成功";
  299. icon = "success";
  300. }
  301. this.models = {
  302. disjunctor: true,
  303. content: msg,
  304. icon: icon,
  305. operate: {
  306. know: "知道了",
  307. },
  308. };
  309. });
  310. } else {
  311. uni.hideLoading();
  312. this.models = {
  313. disjunctor: true,
  314. content: "建单失败,科室未开通!",
  315. icon: "error",
  316. operate: {
  317. know: "知道了",
  318. },
  319. };
  320. }
  321. } else {
  322. uni.hideLoading();
  323. uni.showToast({
  324. icon: "none",
  325. title: "请求失败!",
  326. });
  327. }
  328. });
  329. },
  330. //建单取消
  331. cancel() {
  332. this.models.disjunctor = false;
  333. },
  334. //点击确定后返回参数
  335. resultConditon(obj) {
  336. console.log(obj);
  337. this.visibleDrawer = obj.visibleDrawer;
  338. if (obj.str_result) {
  339. this.searchlist = {
  340. yyTime: obj.str_result.yyTime,
  341. keyWord: obj.str_result.keyWord,
  342. bedNumSort: obj.str_result.bedNumSort,
  343. inspectState: obj.str_result.inspectState,
  344. };
  345. this.idx = 0;
  346. this.totalNum = -1;
  347. this.waitingOrders(0);
  348. }
  349. },
  350. // 切换科室
  351. changeDept() {
  352. uni.navigateTo({
  353. url: `../search/search?type=inspectList`,
  354. });
  355. },
  356. //检查列表数据获取
  357. waitingOrders(idx) {
  358. if (this.zxzData.length == this.totalNum) {
  359. uni.showToast({
  360. icon: "none",
  361. title: "没有更多数据了!",
  362. });
  363. this.freshing = true;
  364. return;
  365. }
  366. console.log(this.searchlist, 222222)
  367. let postData = {
  368. idx,
  369. sum: 99999,
  370. inspect: {
  371. hosId: uni.getStorageSync("userData").user.currentHospital.id,
  372. platForm: 2,
  373. searchDays: 10000,
  374. applyDept: {
  375. id: this.currenDept.id,
  376. },
  377. clickSort: this.searchlist.bedNumSort,
  378. yyTime: this.searchlist.yyTime.split("/").join("-") + " 00:00:00",
  379. },
  380. };
  381. if (this.searchlist.inspectState) {
  382. let arr = this.searchlist.inspectState.split(',');
  383. let flag = arr.includes('0');
  384. postData.inspect.inspectState = {
  385. "value": flag ? '0' : arr.join(',')
  386. };
  387. }
  388. // url传递过来的住院号
  389. if (this.currenDept.residenceNo) {
  390. this.searchlist.keyWord = this.currenDept.residenceNo;
  391. this.currenDept.residenceNo = "";
  392. }
  393. if (this.searchlist.keyWord) {
  394. postData.inspect.keyWord = this.searchlist.keyWord;
  395. }
  396. uni.showLoading({
  397. title: "加载中",
  398. mask: true,
  399. });
  400. // 请求列表数据
  401. post("/nurse/fetchDataList/inspect", postData).then((res) => {
  402. uni.hideLoading();
  403. if (res.status == 200) {
  404. this.triggered = false;
  405. this.freshing = true;
  406. this.totalNum = res.totalNum;
  407. if (idx === 0) {
  408. this.zxzData = res.list;
  409. } else {
  410. this.zxzData.push(...res.list);
  411. }
  412. } else {
  413. uni.showToast({
  414. icon: "none",
  415. title: "请求失败!",
  416. });
  417. }
  418. });
  419. },
  420. //刷新
  421. refresherrefresh() {
  422. if (this.triggered) {
  423. return;
  424. }
  425. console.log("下拉刷新");
  426. this.triggered = true;
  427. this.idx = 0;
  428. this.totalNum = -1;
  429. this.waitingOrders(0);
  430. },
  431. // 下拉刷新复位
  432. refresherrestore() {
  433. this.triggered = false;
  434. console.log("下拉刷新复位");
  435. },
  436. //下拉刷新中止
  437. refresherabort() {
  438. this.triggered = false;
  439. console.log("下拉刷新中止");
  440. },
  441. //分页,上拉加载
  442. scrolltolower() {
  443. if (this.freshing) {
  444. console.log("上拉加载");
  445. this.freshing = false;
  446. this.waitingOrders(++this.idx);
  447. }
  448. },
  449. // 滚动
  450. scroll(e) {
  451. this.scrollYY = e.detail.scrollTop;
  452. if (e.detail.scrollTop < 20) {
  453. this.scroll_refresher_enabled = true;
  454. } else {
  455. this.scroll_refresher_enabled = false;
  456. }
  457. },
  458. // 阻止浏览器滑动
  459. stop(e) {
  460. e.preventDefault();
  461. },
  462. },
  463. onLoad(options) {
  464. let patientCurrentDept = uni.getStorageSync("patientCurrentDept");
  465. if (Object.keys(options).length) {
  466. let {
  467. id,
  468. dept,
  469. residenceNo
  470. } = options;
  471. this.currenDept.id = id;
  472. this.currenDept.dept = dept;
  473. this.currenDept.residenceNo = residenceNo;
  474. } else if (patientCurrentDept) {
  475. this.currenDept.id = patientCurrentDept.id;
  476. this.currenDept.dept = patientCurrentDept.dept;
  477. } else {
  478. this.currenDept = uni.getStorageSync("userData").user.dept;
  479. }
  480. this.waitingOrders(0);
  481. // #ifdef APP-PLUS
  482. webHandle("no", "app");
  483. // #endif
  484. // #ifdef H5
  485. webHandle("no", "wx");
  486. // #endif
  487. },
  488. onShow() {
  489. // #ifdef H5
  490. document.body.addEventListener("touchmove", this.stop, {
  491. passive: false,
  492. });
  493. // #endif
  494. },
  495. onHide() {
  496. // #ifdef H5
  497. document.body.removeEventListener("touchmove", this.stop, {
  498. passive: false,
  499. });
  500. // #endif
  501. },
  502. };
  503. </script>
  504. <style lang="less">
  505. .inspectList {
  506. width: 100%;
  507. height: 100%;
  508. position: relative;
  509. .icon_transport {
  510. color: #49b856;
  511. font-size: 36rpx;
  512. &.colorRed {
  513. color: red;
  514. font-size: 32rpx;
  515. }
  516. }
  517. .page_tab {
  518. width: 100%;
  519. height: 96rpx;
  520. display: flex;
  521. position: fixed;
  522. left: 0;
  523. top: 0;
  524. z-index: 999;
  525. .page_tab_bar {
  526. flex: 1;
  527. font-size: 36rpx;
  528. background: #fff;
  529. display: flex;
  530. justify-content: center;
  531. align-items: center;
  532. position: relative;
  533. &:after {
  534. content: "";
  535. position: absolute;
  536. left: 0;
  537. bottom: 0;
  538. height: 2rpx;
  539. width: 100%;
  540. background-color: transparent;
  541. }
  542. .tab_dept {
  543. position: relative;
  544. .changeDept {
  545. width: 140rpx;
  546. white-space: nowrap;
  547. margin: 0;
  548. position: absolute;
  549. right: 0;
  550. top: 50%;
  551. transform: translate(105%, -50%);
  552. padding: 0 0.5em;
  553. line-height: 2;
  554. }
  555. .moreFilter {
  556. left: 0;
  557. transform: translate(-105%, -50%);
  558. }
  559. }
  560. &.active {
  561. color: #49b856;
  562. &:after {
  563. background-color: #49b856;
  564. }
  565. }
  566. }
  567. }
  568. .zwsj {
  569. position: absolute;
  570. left: 50%;
  571. top: 180rpx;
  572. transform: translateX(-50%);
  573. .zwsj-img {
  574. width: 560rpx;
  575. }
  576. .zwsj-txt {
  577. font-size: 36rpx;
  578. font-weight: 700;
  579. margin-top: 20rpx;
  580. text-align: center;
  581. }
  582. }
  583. .page_items {
  584. height: calc(100vh - 184rpx);
  585. padding: 0 20rpx;
  586. padding-top: 96rpx;
  587. .page_items_scroll {
  588. height: 100%;
  589. .page_item_wrap {
  590. position: relative;
  591. margin-bottom: 32rpx;
  592. .page_item {
  593. margin-bottom: 16rpx;
  594. background: #fff;
  595. border-radius: 8rpx;
  596. overflow: hidden;
  597. border: 2rpx solid #e5e9ed;
  598. display: flex;
  599. flex-direction: column;
  600. justify-content: space-between;
  601. .L {
  602. width: 40rpx;
  603. height: 40rpx;
  604. border-radius: 50%;
  605. background: #f9fafb;
  606. position: absolute;
  607. left: -24rpx;
  608. top: 68rpx;
  609. border: 2rpx solid #e5e9ed;
  610. }
  611. .R {
  612. width: 40rpx;
  613. height: 40rpx;
  614. border-radius: 50%;
  615. background: #f9fafb;
  616. position: absolute;
  617. float: right;
  618. right: -24rpx;
  619. top: 68rpx;
  620. border: 2rpx solid #e5e9ed;
  621. }
  622. .page_item_top {
  623. height: 86rpx;
  624. border-bottom: 2rpx dashed #e5e9ed;
  625. padding: 0 16rpx;
  626. display: flex;
  627. align-items: center;
  628. justify-content: space-between;
  629. .page_item_top_L {
  630. height: 100%;
  631. float: left;
  632. display: flex;
  633. align-items: center;
  634. line-height: 88rpx;
  635. text-overflow: ellipsis;
  636. overflow: hidden;
  637. white-space: nowrap;
  638. color: #6cc076;
  639. .L_time {
  640. font-size: 28rpx;
  641. }
  642. }
  643. .page_item_top_R {
  644. float: right;
  645. display: flex;
  646. align-items: center;
  647. justify-content: space-between;
  648. text {
  649. font-size: 28rpx;
  650. color: #49b856;
  651. margin-right: 16rpx;
  652. }
  653. button {
  654. font-size: 28rpx;
  655. color: #49b856;
  656. height: 50rpx;
  657. line-height: 50rpx;
  658. margin: 0;
  659. }
  660. }
  661. }
  662. .page_item_cont {
  663. padding: 16rpx;
  664. text-align: left;
  665. position: relative;
  666. .page_item_conts {
  667. color: rgb(102, 102, 102);
  668. font-size: 28rpx;
  669. view {
  670. margin-bottom: 10rpx;
  671. margin-left: 40rpx;
  672. display: flex;
  673. }
  674. .p_title {
  675. width: 160rpx;
  676. }
  677. .p_info {
  678. flex: 1;
  679. &.red {
  680. color: red;
  681. }
  682. }
  683. .num {
  684. float: right;
  685. }
  686. }
  687. }
  688. .page_item_btn {
  689. height: 88rpx;
  690. background-image: linear-gradient(to right, #72c172, #3bb197);
  691. border-radius: 8rpx;
  692. line-height: 88rpx;
  693. color: #fff;
  694. font-size: 36rpx;
  695. font-weight: 700;
  696. text-align: center;
  697. }
  698. }
  699. .L-l {
  700. width: 2rpx;
  701. height: 40rpx;
  702. background: #f9fafb;
  703. position: absolute;
  704. left: 20rpx;
  705. top: 72rpx;
  706. display: none;
  707. }
  708. .R-l {
  709. width: 2rpx;
  710. height: 40rpx;
  711. background: #f9fafb;
  712. position: absolute;
  713. right: 20rpx;
  714. top: 72rpx;
  715. display: none;
  716. }
  717. }
  718. }
  719. }
  720. }
  721. </style>