patientInspectLogList.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. <template>
  2. <view class="incidentList">
  3. <view class="head">
  4. <view class="tab" :class="{active: tab.id === dataInfo.tabActiveId}" v-for="tab in dataInfo.tabs" :key="tab.id" @click="clickTab(tab.id)">
  5. {{tab.name}}<text v-if="tab.num !== ''">({{tab.num}})</text>
  6. </view>
  7. <view class="filter" @click="filterClick">
  8. <text class="newicon newicon-shaixuan"></text>
  9. </view>
  10. </view>
  11. <view class="body" v-if="dataInfo.list.length">
  12. <view class="body_item" v-for="data in dataInfo.list" :key="data.id" @click="toDetail(data)">
  13. <view class="body_item_head" @click.stop="changeCheckbox(data)">
  14. <view class="patientName">
  15. <checkbox-group v-if="config.batchPatientBackDept == 1 && data.state.value === '4'">
  16. <label>
  17. <checkbox class="checkbox" :checked="data.checked" />
  18. </label>
  19. </checkbox-group>
  20. <text>
  21. {{ data.patientName }}<text class="sign signRed">{{ data.careLevel ? data.careLevel.name.slice(0, 1) : '' }}<template v-if="data.careLevel && data.illnessState">、</template>{{ data.illnessState ? data.illnessState.name : '' }}</text>
  22. </text>
  23. </view>
  24. <text>{{ data.state ? data.state.name : '' }}</text>
  25. </view>
  26. <view class="body_item_content">
  27. <view class="body_item_content_p">
  28. <text class="name ellipsis">住院号:{{data.patientCode}}<text v-if="data.bedNum">({{ data.bedNum }})</text></text>
  29. <text>{{(data.patientDTO && data.patientDTO.gender) ? data.patientDTO.gender.name : ''}}<text v-if="data.age !== undefined" class="ml24">{{data.age}}<text v-if="data.age !== undefined">岁</text></text></text>
  30. </view>
  31. <view class="body_item_content_p">
  32. <text class="name ellipsis">患者科室:{{ data.deptDTO ? data.deptDTO.dept : '' }}</text>
  33. <text>{{data.tripTypeDTO ? data.tripTypeDTO.inspectMode : ''}}</text>
  34. </view>
  35. <view class="body_item_content_p">
  36. <text class="name ellipsis">签到信息:{{data.signDeptDTO ? data.signDeptDTO.dept : ''}}</text>
  37. <text>{{data.signTime | formatDate('MM-dd hh:mm')}}</text>
  38. </view>
  39. </view>
  40. <!-- <view class="body_item_foot" v-if="data.state.value === '4'">
  41. <view class="btns pt0">
  42. <button @click.stop="tagClick(data)" type="default" class="primaryButton btn">标记回科</button>
  43. </view>
  44. </view> -->
  45. </view>
  46. </view>
  47. <view class="zanwu" v-else>
  48. <text class="newicon newicon-zanwu"></text>
  49. </view>
  50. <view class="toolbar">
  51. <button @click="tagClickList()" type="default" class="primaryButton btn" v-if="config.batchPatientBackDept == 1">批量回科</button>
  52. <view class="toolbar-btn btn" @click="scan()">
  53. <text class="toolbar-icon newicon newicon-saoma"></text>
  54. <text class="toolbar-sao">扫一扫</text>
  55. </view>
  56. </view>
  57. <!-- 弹窗 -->
  58. <showModel :title="models.title" :icon="models.icon" :disjunctor="models.disjunctor" :content="models.content" @ok="ok" @cancel="cancel" @know="know" :operate="models.operate"></showModel>
  59. <!-- 搜索 -->
  60. <patientInspectLogListFilter v-if="dataInfo.isFilter" @cancelEmit="cancelFilter" @confirmEmit="conformFilter" :evt="dataInfo.evtFilter" :tabActiveId="dataInfo.tabActiveId"></patientInspectLogListFilter>
  61. </view>
  62. </template>
  63. <script>
  64. import patientInspectLogListFilter from './components/patientInspectLogListFilter.vue';
  65. import { get, post, SM, deleteIt, webHandle } from "../../http/http.js";
  66. import uniq from 'lodash-es/uniq'
  67. export default {
  68. components:{
  69. patientInspectLogListFilter,
  70. },
  71. onShow() {
  72. this.SMFlag = true;
  73. },
  74. data(){
  75. return {
  76. config: {},
  77. selectData: {},
  78. SMFlag: true,
  79. loginUser: uni.getStorageSync('userData').user,
  80. hosId: uni.getStorageSync('userData').user.currentHospital.id,
  81. // 弹窗model
  82. models: {
  83. disjunctor: false,
  84. },
  85. dataInfo: {
  86. tabs: [
  87. {id: 1, name: '全部', value: '1', num: ''},
  88. {id: 2, name: '我带出的', value: '2', num: ''},
  89. {id: 3, name: '我接收的', value: '3', num: ''},
  90. ],
  91. tabActiveId: 1,//当前选择的tab
  92. list: [],//工单列表
  93. idx: 0,//页码
  94. hasMore: true,//是否有更多数据
  95. isFilter: false,//筛选框开关
  96. evtFilter: {
  97. signUser: {id: 0, name: '全部'},
  98. inspectUser: {id: 0, name: '全部'},
  99. department: {id: 0, dept: '全部'},
  100. stateList: [],
  101. },//筛选框数据
  102. }
  103. }
  104. },
  105. methods: {
  106. // 多选框
  107. changeCheckbox(data){
  108. if(this.config.batchPatientBackDept == 1 && data.state.value === '4'){
  109. this.$set(data, 'checked', !data.checked);
  110. }
  111. },
  112. // 获取状态列表
  113. getStateList(isStorage = false){
  114. let postData = {
  115. "type": "list",
  116. "key": "patient_inspect_state",
  117. };
  118. post("/common/common/getDictionary", postData).then(res => {
  119. let stateList = res || [];
  120. if(isStorage){
  121. this.dataInfo.evtFilter = uni.getStorageSync('patientInspectLogEvtFilter');
  122. this.dataInfo.tabActiveId = +uni.getStorageSync('patientInspectLogTabActiveId');
  123. }else{
  124. // 默认出科陪检中
  125. this.dataInfo.evtFilter.stateList = stateList.map(v => ({...v, checked: v.value == 4}));
  126. }
  127. this.getList(0);
  128. })
  129. },
  130. // 扫一扫
  131. scan(isFlag = false) {
  132. if (!this.SMFlag) {
  133. return;
  134. }
  135. this.SMFlag = false;
  136. SM().then((ress1) => {
  137. this.scan_common(ress1, isFlag);
  138. }).catch(err => {
  139. this.SMFlag = true;
  140. });
  141. },
  142. // 扫一扫方法
  143. scan_common(ress1, isFlag = false){
  144. uni.showLoading({
  145. title: "加载中",
  146. mask: true,
  147. });
  148. let postData = {
  149. idx: 0,
  150. sum: 1,
  151. patientInspectLog: {
  152. hosId: this.hosId,
  153. scanCode: ress1,
  154. simpleQuery: 1,
  155. }
  156. }
  157. post("/simple/data/fetchDataList/patientInspectLog", postData).then((ress) => {
  158. this.SMFlag = true;
  159. uni.hideLoading();
  160. if (ress.status == 200) {
  161. let list = ress.list || [];
  162. if(list.length){
  163. let patientInspectLog = undefined;
  164. patientInspectLog = list[0];
  165. uni.navigateTo({
  166. url: `/pages/patientInspectLog/patientInspectLogDetail?patientInspectLogId=${patientInspectLog.id}&from=patientInpectLogList`
  167. })
  168. }else{
  169. uni.showToast({
  170. icon: "none",
  171. title: "未查询到患者闭环信息!",
  172. });
  173. }
  174. } else {
  175. uni.showToast({
  176. icon: "none",
  177. title: ress.msg || "接口获取数据失败!",
  178. });
  179. }
  180. });
  181. },
  182. // 初始化
  183. onLoadFn(isStorage = false){
  184. this.getTabs(isStorage);
  185. },
  186. // 获取tab选项
  187. getTabs(isStorage = false){
  188. this.getStateList(isStorage);
  189. },
  190. // 获取列表信息
  191. getList(idx){
  192. uni.showLoading({
  193. title: "加载中",
  194. mask: true,
  195. });
  196. this.dataInfo.idx = idx === undefined ? this.dataInfo.idx : idx;
  197. if(this.dataInfo.idx === 0){
  198. this.dataInfo.list = [];
  199. }
  200. let postData = {
  201. "idx": this.dataInfo.idx,
  202. "sum": 20,
  203. "patientInspectLog": {
  204. "hosId": this.hosId,
  205. simpleQuery: 1,
  206. }
  207. }
  208. let tabActiveObj = this.dataInfo.tabs.find(v => v.id == this.dataInfo.tabActiveId);
  209. console.log(tabActiveObj)
  210. if(tabActiveObj && tabActiveObj.id){
  211. if(tabActiveObj.id === 1){
  212. if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.signUser && this.dataInfo.evtFilter.signUser.id){
  213. postData.patientInspectLog.signUser = this.dataInfo.evtFilter.signUser.id;
  214. }
  215. if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.inspectUser && this.dataInfo.evtFilter.inspectUser.id){
  216. postData.patientInspectLog.outDeptUser = this.dataInfo.evtFilter.inspectUser.id;
  217. }
  218. }else if(tabActiveObj.id === 2){
  219. postData.patientInspectLog.outDeptUser = this.loginUser.id;
  220. if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.signUser && this.dataInfo.evtFilter.signUser.id){
  221. postData.patientInspectLog.signUser = this.dataInfo.evtFilter.signUser.id;
  222. }
  223. }else if(tabActiveObj.id === 3){
  224. postData.patientInspectLog.signUser = this.loginUser.id;
  225. if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.inspectUser && this.dataInfo.evtFilter.inspectUser.id){
  226. postData.patientInspectLog.outDeptUser = this.dataInfo.evtFilter.inspectUser.id;
  227. }
  228. }
  229. }
  230. if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.department && this.dataInfo.evtFilter.department.id){
  231. postData.patientInspectLog.deptId = this.dataInfo.evtFilter.department.id;
  232. }
  233. if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.stateList && this.dataInfo.evtFilter.stateList.length){
  234. let values = this.dataInfo.evtFilter.stateList.filter(v => v.checked).map(v => v.value).toString();
  235. postData.patientInspectLog.state = values ? {
  236. value: values
  237. } : undefined;
  238. }
  239. post("/simple/data/fetchDataList/patientInspectLog", postData).then(res => {
  240. uni.hideLoading();
  241. uni.stopPullDownRefresh();
  242. if(res.status == 200){
  243. let list = res.list || [];
  244. if(list.length){
  245. this.dataInfo.hasMore = true;
  246. this.dataInfo.list = this.dataInfo.idx === 0 ? list : this.dataInfo.list.concat(list);
  247. }else{
  248. this.dataInfo.hasMore = false;
  249. }
  250. }else{
  251. uni.showToast({
  252. icon: 'none',
  253. title: res.msg || '请求数据失败!'
  254. });
  255. }
  256. })
  257. },
  258. // 详情
  259. toDetail(data){
  260. uni.navigateTo({
  261. url: `/pages/patientInspectLog/patientInspectLogDetail?patientInspectLogId=${data.id}&from=patientInpectLogList`
  262. })
  263. },
  264. // 批量回科
  265. tagClickList(){
  266. let list = this.dataInfo.list.filter(v => v.checked);
  267. if(list.length){
  268. let arr = list.filter(v => v.deptDTO).map(v => v.deptDTO.id);
  269. arr = uniq(arr);
  270. if(arr.length > 1){
  271. uni.showToast({
  272. icon: "none",
  273. title: "您选择的患者中含多个科室,请调整好再试!",
  274. });
  275. }else if(arr.length === 1){
  276. uni.navigateTo({
  277. url: `/pages/patientInspectLog/patientInspectLogSendBack?deptId=${arr[0]}&patientList=${encodeURIComponent(JSON.stringify(list))}`,
  278. })
  279. }else{
  280. uni.showToast({
  281. icon: "none",
  282. title: "您选择的患者中没有科室,请调整好再试!",
  283. });
  284. }
  285. }else{
  286. uni.showToast({
  287. icon: "none",
  288. title: "请选择患者!",
  289. });
  290. }
  291. },
  292. getConfig1(){
  293. const postData = {
  294. "idx":0,
  295. "sum":1,
  296. "taskTypeConfig":{
  297. "taskTypeDTO":{
  298. "hosId": {"id": this.hosId},
  299. "associationType": {
  300. "key": "association_types",
  301. "value":"inspect",
  302. },
  303. },
  304. },
  305. };
  306. post("/simple/data/fetchDataList/taskTypeConfig", postData).then((res) => {
  307. if (res.status == 200) {
  308. let list = res.list || [];
  309. if(list.length){
  310. this.config = res.list[0];
  311. }else{
  312. this.config = {};
  313. }
  314. } else {
  315. uni.showToast({
  316. icon: "none",
  317. title: res.msg || "接口获取数据失败!",
  318. });
  319. }
  320. })
  321. },
  322. // 标记回科
  323. tagClick(data){
  324. this.selectData = data;
  325. this.models = {
  326. disjunctor: true,
  327. title: "提示",
  328. content: `将${data.patientName}患者标记为已回科,是否确认?`,
  329. icon: "warn",
  330. operate: {
  331. ok: "确定",
  332. cancel: "取消",
  333. },
  334. };
  335. },
  336. //确定
  337. ok() {
  338. this.models.disjunctor = false;
  339. uni.showLoading({
  340. title: "加载中",
  341. mask: true,
  342. });
  343. post("/nurse/patientInspect/setPatientInspectBackDept", {
  344. pilIds: this.selectData.id.toString(),
  345. }).then((res) => {
  346. uni.hideLoading();
  347. let _this = this;
  348. if (res.state == 200) {
  349. uni.showToast({
  350. icon: "none",
  351. mask: true,
  352. title: "操作成功!",
  353. });
  354. setTimeout(() => {
  355. _this.getList(0);
  356. },300)
  357. } else {
  358. uni.showToast({
  359. icon: 'none',
  360. title: res.msg || '请求数据失败!'
  361. });
  362. }
  363. })
  364. },
  365. //取消
  366. cancel() {
  367. this.models.disjunctor = false;
  368. },
  369. // 点击tab
  370. clickTab(tabId){
  371. this.dataInfo.tabActiveId = tabId;
  372. if(tabId === 1){
  373. this.dataInfo.evtFilter.signUser = {id: 0, name: '全部'};
  374. this.dataInfo.evtFilter.inspectUser = {id: 0, name: '全部'};
  375. }else if(tabId === 2){
  376. this.dataInfo.evtFilter.signUser = {id: 0, name: '全部'};
  377. this.dataInfo.evtFilter.inspectUser = this.loginUser;
  378. }else if(tabId === 3){
  379. this.dataInfo.evtFilter.signUser = this.loginUser;
  380. this.dataInfo.evtFilter.inspectUser = {id: 0, name: '全部'};
  381. }
  382. this.getList(0);
  383. },
  384. // 点击筛选
  385. filterClick(){
  386. this.dataInfo.isFilter = true;
  387. },
  388. // 确认筛选
  389. conformFilter(evtFilter){
  390. uni.setStorageSync('patientInspectLogEvtFilter', evtFilter);//缓存
  391. uni.setStorageSync('patientInspectLogTabActiveId', this.dataInfo.tabActiveId);//缓存
  392. this.dataInfo.evtFilter = evtFilter;
  393. this.dataInfo.isFilter = false;
  394. this.getList(0);
  395. },
  396. // 关闭筛选
  397. cancelFilter(){
  398. this.dataInfo.isFilter = false;
  399. },
  400. },
  401. onLoad(options){
  402. this.getConfig1();
  403. this.onLoadFn(uni.getStorageSync('patientInspectLogEvtFilter') && uni.getStorageSync('patientInspectLogTabActiveId'));
  404. },
  405. onTabItemTap(){
  406. this.onLoadFn();
  407. },
  408. onPullDownRefresh(){
  409. this.getList(0);
  410. },
  411. onReachBottom(){
  412. this.dataInfo.idx += 1;
  413. if (this.dataInfo.hasMore) {
  414. this.getList(); // 当触底时加载更多数据
  415. }
  416. },
  417. };
  418. </script>
  419. <style lang="scss" scoped>
  420. .checkbox{
  421. /deep/ .uni-checkbox-input.uni-checkbox-input-checked{
  422. color: #42b983!important;
  423. }
  424. }
  425. /deep/ .checkbox:not([disabled]) .uni-checkbox-input:hover {
  426. border-color: #42b983 !important;
  427. color: #42b983 !important;
  428. }
  429. .toolbar {
  430. position: fixed;
  431. left: 0;
  432. bottom: var(--window-bottom);
  433. z-index: 99;
  434. width: 100%;
  435. display: flex;
  436. padding: 24rpx;
  437. gap: 24rpx;
  438. box-sizing: border-box;
  439. background-color: #f9f9fb;
  440. .primaryButton{
  441. padding: 0;
  442. }
  443. .btn{
  444. flex: 1;
  445. }
  446. .toolbar-btn{
  447. height: 88rpx;
  448. display: flex;
  449. justify-content: center;
  450. align-items: center;
  451. box-sizing: border-box;
  452. border-radius: 4rpx;
  453. background-color: #E5E8ED;
  454. }
  455. .toolbar-icon {
  456. font-size: 52rpx;
  457. margin-right: 16rpx;
  458. color: #49B856;
  459. }
  460. .toolbar-sao {
  461. font-size: 36rpx;
  462. color: #333;
  463. }
  464. }
  465. page{
  466. height: calc(100vh - var(--window-bottom));
  467. }
  468. .incidentList{
  469. display: flex;
  470. flex-direction: column;
  471. justify-content: space-between;
  472. .head{
  473. height: 88rpx;
  474. display: flex;
  475. position: fixed;
  476. z-index: 99;
  477. width: 100%;
  478. background-color: #fff;
  479. font-size: 30rpx;
  480. .tab{
  481. flex: 1;
  482. display: flex;
  483. justify-content: center;
  484. align-items: center;
  485. border-bottom: 4rpx solid transparent;
  486. &.active{
  487. color: #49b856;
  488. border-color: #49b856;
  489. }
  490. }
  491. .filter{
  492. width: 84rpx;
  493. display: flex;
  494. justify-content: center;
  495. align-items: center;
  496. .newicon-shaixuan{
  497. font-size: 36rpx;
  498. color: #2C2C2C;
  499. }
  500. }
  501. }
  502. .body{
  503. margin-bottom: calc(var(--window-bottom) + 88rpx + 48rpx);
  504. margin-top: 88rpx;
  505. border-top: 6rpx solid #EBEBEB;
  506. .body_item{
  507. border-bottom: 8rpx solid #EBEBEB;
  508. &:last-of-type{
  509. border-bottom: none;
  510. }
  511. .body_item_head{
  512. word-break: break-all;
  513. text-align: justify;
  514. text-align: left;
  515. margin: 24rpx;
  516. font-size: 30rpx;
  517. display: flex;
  518. align-items: center;
  519. justify-content: space-between;
  520. .patientName{
  521. display: flex;
  522. align-items: center;
  523. }
  524. .sign{
  525. margin-left: 16rpx;
  526. color: #49B856;
  527. &.signRed{
  528. color: #FF0000;
  529. }
  530. }
  531. }
  532. .body_item_content{
  533. border-top: 1rpx solid #D8D8D8;
  534. padding: 24rpx;
  535. .body_item_content_p{
  536. color: #6A6A6A;
  537. font-size: 26rpx;
  538. display: flex;
  539. justify-content: space-between;
  540. align-items: center;
  541. margin-bottom: 24rpx;
  542. &:last-of-type{
  543. margin-bottom: 0;
  544. }
  545. .name{
  546. flex: 1;
  547. }
  548. .status{
  549. padding: 4rpx 10rpx;
  550. border-radius: 20rpx;
  551. background-color: #DBE8FE;
  552. font-size: 22rpx;
  553. color: #006CF9;
  554. }
  555. .icon_all{
  556. .mic-filled,
  557. .image-filled
  558. {
  559. margin-left: 16rpx;
  560. }
  561. }
  562. }
  563. }
  564. .body_item_foot{
  565. border-top: 1rpx solid #D8D8D8;
  566. font-size: 26rpx;
  567. padding: 24rpx;
  568. .foot_info{
  569. display: flex;
  570. justify-content: space-between;
  571. align-items: center;
  572. .phone-filled{
  573. margin-left: 5rpx;
  574. }
  575. }
  576. }
  577. }
  578. }
  579. .zanwu{
  580. box-sizing: border-box;
  581. margin-bottom: calc(var(--window-bottom) + 88rpx);
  582. margin-top: 88rpx;
  583. border-top: 6rpx solid #EBEBEB;
  584. height: calc(100vh - var(--window-bottom) - 176rpx);
  585. display: flex;
  586. justify-content: center;
  587. background-color: #F7F7F7;
  588. .newicon-zanwu{
  589. font-size: 256rpx;
  590. color: #D6D6D6;
  591. margin-top: 140rpx;
  592. }
  593. }
  594. }
  595. </style>