inspectList.vue 22 KB

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