patientInspectLogList.vue 16 KB

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