inspectList.vue 21 KB

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