patientInspectLogList.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  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. let newList = list.map(i =>{
  268. return{
  269. patientName: i.patientName,
  270. bedNum: i.bedNum,
  271. patientCode: i.patientCode,
  272. id: i.id,
  273. checked: i.checked
  274. }
  275. })
  276. if(list.length){
  277. let arr = list.filter(v => v.deptDTO).map(v => v.deptDTO.id);
  278. arr = uniq(arr);
  279. if(arr.length > 1){
  280. uni.showToast({
  281. icon: "none",
  282. title: "您选择的患者中含多个科室,请调整好再试!",
  283. });
  284. }else if(arr.length === 1){
  285. uni.navigateTo({
  286. url: `/pages/patientInspectLog/patientInspectLogSendBack?deptId=${arr[0]}&patientList=${encodeURIComponent(JSON.stringify(newList))}`,
  287. })
  288. }else{
  289. uni.showToast({
  290. icon: "none",
  291. title: "您选择的患者中没有科室,请调整好再试!",
  292. });
  293. }
  294. }else{
  295. uni.showToast({
  296. icon: "none",
  297. title: "请选择患者!",
  298. });
  299. }
  300. },
  301. getConfig1(){
  302. const postData = {
  303. "idx":0,
  304. "sum":1,
  305. "taskTypeConfig":{
  306. "taskTypeDTO":{
  307. "hosId": {"id": this.hosId},
  308. "associationType": {
  309. "key": "association_types",
  310. "value":"inspect",
  311. },
  312. },
  313. },
  314. };
  315. post("/simple/data/fetchDataList/taskTypeConfig", postData).then((res) => {
  316. if (res.status == 200) {
  317. let list = res.list || [];
  318. if(list.length){
  319. this.config = res.list[0];
  320. }else{
  321. this.config = {};
  322. }
  323. } else {
  324. uni.showToast({
  325. icon: "none",
  326. title: res.msg || "接口获取数据失败!",
  327. });
  328. }
  329. })
  330. },
  331. // 标记回科
  332. tagClick(data){
  333. this.selectData = data;
  334. this.models = {
  335. disjunctor: true,
  336. title: "提示",
  337. content: `将${data.patientName}患者标记为已回科,是否确认?`,
  338. icon: "warn",
  339. operate: {
  340. ok: "确定",
  341. cancel: "取消",
  342. },
  343. };
  344. },
  345. //确定
  346. ok() {
  347. this.models.disjunctor = false;
  348. uni.showLoading({
  349. title: "加载中",
  350. mask: true,
  351. });
  352. post("/nurse/patientInspect/setPatientInspectBackDept", {
  353. pilIds: this.selectData.id.toString(),
  354. }).then((res) => {
  355. uni.hideLoading();
  356. let _this = this;
  357. if (res.state == 200) {
  358. uni.showToast({
  359. icon: "none",
  360. mask: true,
  361. title: "操作成功!",
  362. });
  363. setTimeout(() => {
  364. _this.getList(0);
  365. },300)
  366. } else {
  367. uni.showToast({
  368. icon: 'none',
  369. title: res.msg || '请求数据失败!'
  370. });
  371. }
  372. })
  373. },
  374. //取消
  375. cancel() {
  376. this.models.disjunctor = false;
  377. },
  378. // 点击tab
  379. clickTab(tabId){
  380. this.dataInfo.tabActiveId = tabId;
  381. if(tabId === 1){
  382. this.dataInfo.evtFilter.signUser = {id: 0, name: '全部'};
  383. this.dataInfo.evtFilter.inspectUser = {id: 0, name: '全部'};
  384. }else if(tabId === 2){
  385. this.dataInfo.evtFilter.signUser = {id: 0, name: '全部'};
  386. this.dataInfo.evtFilter.inspectUser = this.loginUser;
  387. }else if(tabId === 3){
  388. this.dataInfo.evtFilter.signUser = this.loginUser;
  389. this.dataInfo.evtFilter.inspectUser = {id: 0, name: '全部'};
  390. }
  391. this.getList(0);
  392. },
  393. // 点击筛选
  394. filterClick(){
  395. this.dataInfo.isFilter = true;
  396. },
  397. // 确认筛选
  398. conformFilter(evtFilter){
  399. uni.setStorageSync('patientInspectLogEvtFilter', evtFilter);//缓存
  400. uni.setStorageSync('patientInspectLogTabActiveId', this.dataInfo.tabActiveId);//缓存
  401. this.dataInfo.evtFilter = evtFilter;
  402. this.dataInfo.isFilter = false;
  403. this.getList(0);
  404. },
  405. // 关闭筛选
  406. cancelFilter(){
  407. this.dataInfo.isFilter = false;
  408. },
  409. },
  410. onLoad(options){
  411. this.getConfig1();
  412. this.onLoadFn(uni.getStorageSync('patientInspectLogEvtFilter') && uni.getStorageSync('patientInspectLogTabActiveId'));
  413. },
  414. onTabItemTap(){
  415. this.onLoadFn();
  416. },
  417. onPullDownRefresh(){
  418. this.getList(0);
  419. },
  420. onReachBottom(){
  421. this.dataInfo.idx += 1;
  422. if (this.dataInfo.hasMore) {
  423. this.getList(); // 当触底时加载更多数据
  424. }
  425. },
  426. };
  427. </script>
  428. <style lang="scss" scoped>
  429. .checkbox{
  430. /deep/ .uni-checkbox-input.uni-checkbox-input-checked{
  431. color: #42b983!important;
  432. }
  433. }
  434. /deep/ .checkbox:not([disabled]) .uni-checkbox-input:hover {
  435. border-color: #42b983 !important;
  436. color: #42b983 !important;
  437. }
  438. .toolbar {
  439. position: fixed;
  440. left: 0;
  441. bottom: var(--window-bottom);
  442. z-index: 99;
  443. width: 100%;
  444. display: flex;
  445. padding: 24rpx;
  446. gap: 24rpx;
  447. box-sizing: border-box;
  448. background-color: #f9f9fb;
  449. .primaryButton{
  450. padding: 0;
  451. }
  452. .btn{
  453. flex: 1;
  454. }
  455. .toolbar-btn{
  456. height: 88rpx;
  457. display: flex;
  458. justify-content: center;
  459. align-items: center;
  460. box-sizing: border-box;
  461. border-radius: 4rpx;
  462. background-color: #E5E8ED;
  463. }
  464. .toolbar-icon {
  465. font-size: 52rpx;
  466. margin-right: 16rpx;
  467. color: #49B856;
  468. }
  469. .toolbar-sao {
  470. font-size: 36rpx;
  471. color: #333;
  472. }
  473. }
  474. page{
  475. height: calc(100vh - var(--window-bottom));
  476. }
  477. .incidentList{
  478. display: flex;
  479. flex-direction: column;
  480. justify-content: space-between;
  481. .head{
  482. height: 88rpx;
  483. display: flex;
  484. position: fixed;
  485. z-index: 99;
  486. width: 100%;
  487. background-color: #fff;
  488. font-size: 30rpx;
  489. .tab{
  490. flex: 1;
  491. display: flex;
  492. justify-content: center;
  493. align-items: center;
  494. border-bottom: 4rpx solid transparent;
  495. &.active{
  496. color: #49b856;
  497. border-color: #49b856;
  498. }
  499. }
  500. .filter{
  501. width: 84rpx;
  502. display: flex;
  503. justify-content: center;
  504. align-items: center;
  505. .newicon-shaixuan{
  506. font-size: 36rpx;
  507. color: #2C2C2C;
  508. }
  509. }
  510. }
  511. .body{
  512. margin-bottom: calc(var(--window-bottom) + 88rpx + 48rpx);
  513. margin-top: 88rpx;
  514. border-top: 6rpx solid #EBEBEB;
  515. .body_item{
  516. border-bottom: 8rpx solid #EBEBEB;
  517. &:last-of-type{
  518. border-bottom: none;
  519. }
  520. .body_item_head{
  521. word-break: break-all;
  522. text-align: justify;
  523. text-align: left;
  524. margin: 24rpx;
  525. font-size: 30rpx;
  526. display: flex;
  527. align-items: center;
  528. justify-content: space-between;
  529. .patientName{
  530. display: flex;
  531. align-items: center;
  532. }
  533. .sign{
  534. margin-left: 16rpx;
  535. color: #49B856;
  536. &.signRed{
  537. color: #FF0000;
  538. }
  539. }
  540. }
  541. .body_item_content{
  542. border-top: 1rpx solid #D8D8D8;
  543. padding: 24rpx;
  544. .body_item_content_p{
  545. color: #6A6A6A;
  546. font-size: 26rpx;
  547. display: flex;
  548. justify-content: space-between;
  549. align-items: center;
  550. margin-bottom: 24rpx;
  551. &:last-of-type{
  552. margin-bottom: 0;
  553. }
  554. .name{
  555. flex: 1;
  556. }
  557. .status{
  558. padding: 4rpx 10rpx;
  559. border-radius: 20rpx;
  560. background-color: #DBE8FE;
  561. font-size: 22rpx;
  562. color: #006CF9;
  563. }
  564. .icon_all{
  565. .mic-filled,
  566. .image-filled
  567. {
  568. margin-left: 16rpx;
  569. }
  570. }
  571. }
  572. }
  573. .body_item_foot{
  574. border-top: 1rpx solid #D8D8D8;
  575. font-size: 26rpx;
  576. padding: 24rpx;
  577. .foot_info{
  578. display: flex;
  579. justify-content: space-between;
  580. align-items: center;
  581. .phone-filled{
  582. margin-left: 5rpx;
  583. }
  584. }
  585. }
  586. }
  587. }
  588. .zanwu{
  589. box-sizing: border-box;
  590. margin-bottom: calc(var(--window-bottom) + 88rpx);
  591. margin-top: 88rpx;
  592. border-top: 6rpx solid #EBEBEB;
  593. height: calc(100vh - var(--window-bottom) - 176rpx);
  594. display: flex;
  595. justify-content: center;
  596. background-color: #F7F7F7;
  597. .newicon-zanwu{
  598. font-size: 256rpx;
  599. color: #D6D6D6;
  600. margin-top: 140rpx;
  601. }
  602. }
  603. }
  604. </style>