patientInspectLogList.vue 18 KB

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