patientInspectLogList.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504
  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">
  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. simpleQuery: 1,
  137. }
  138. }
  139. post("/simple/data/fetchDataList/patientInspectLog", postData).then((ress) => {
  140. this.SMFlag = true;
  141. uni.hideLoading();
  142. if (ress.status == 200) {
  143. let list = ress.list || [];
  144. if(list.length){
  145. let patientInspectLog = undefined;
  146. patientInspectLog = list[0];
  147. uni.navigateTo({
  148. url: `/pages/patientInspectLog/patientInspectLogDetail?patientInspectLogId=${patientInspectLog.id}&from=patientInpectLogList`
  149. })
  150. }else{
  151. uni.showToast({
  152. icon: "none",
  153. title: "未查询到患者闭环信息!",
  154. });
  155. }
  156. } else {
  157. uni.showToast({
  158. icon: "none",
  159. title: ress.msg || "接口获取数据失败!",
  160. });
  161. }
  162. });
  163. },
  164. // 初始化
  165. onLoadFn(isStorage = false){
  166. this.getTabs(isStorage);
  167. },
  168. // 获取tab选项
  169. getTabs(isStorage = false){
  170. this.getStateList(isStorage);
  171. },
  172. // 获取列表信息
  173. getList(idx){
  174. uni.showLoading({
  175. title: "加载中",
  176. mask: true,
  177. });
  178. this.dataInfo.idx = idx === undefined ? this.dataInfo.idx : idx;
  179. if(this.dataInfo.idx === 0){
  180. this.dataInfo.list = [];
  181. }
  182. let postData = {
  183. "idx": this.dataInfo.idx,
  184. "sum": 20,
  185. "patientInspectLog": {
  186. "hosId": this.hosId,
  187. simpleQuery: 1,
  188. }
  189. }
  190. let tabActiveObj = this.dataInfo.tabs.find(v => v.id == this.dataInfo.tabActiveId);
  191. console.log(tabActiveObj)
  192. if(tabActiveObj && tabActiveObj.id){
  193. if(tabActiveObj.id === 1){
  194. if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.signUser && this.dataInfo.evtFilter.signUser.id){
  195. postData.patientInspectLog.signUser = this.dataInfo.evtFilter.signUser.id;
  196. }
  197. if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.inspectUser && this.dataInfo.evtFilter.inspectUser.id){
  198. postData.patientInspectLog.outDeptUser = this.dataInfo.evtFilter.inspectUser.id;
  199. }
  200. }else if(tabActiveObj.id === 2){
  201. postData.patientInspectLog.outDeptUser = this.loginUser.id;
  202. if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.signUser && this.dataInfo.evtFilter.signUser.id){
  203. postData.patientInspectLog.signUser = this.dataInfo.evtFilter.signUser.id;
  204. }
  205. }else if(tabActiveObj.id === 3){
  206. postData.patientInspectLog.signUser = this.loginUser.id;
  207. if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.inspectUser && this.dataInfo.evtFilter.inspectUser.id){
  208. postData.patientInspectLog.outDeptUser = this.dataInfo.evtFilter.inspectUser.id;
  209. }
  210. }
  211. }
  212. if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.department && this.dataInfo.evtFilter.department.id){
  213. postData.patientInspectLog.deptId = this.dataInfo.evtFilter.department.id;
  214. }
  215. if(this.dataInfo.evtFilter && this.dataInfo.evtFilter.stateList && this.dataInfo.evtFilter.stateList.length){
  216. let values = this.dataInfo.evtFilter.stateList.filter(v => v.checked).map(v => v.value).toString();
  217. postData.patientInspectLog.state = values ? {
  218. value: values
  219. } : undefined;
  220. }
  221. post("/simple/data/fetchDataList/patientInspectLog", postData).then(res => {
  222. uni.hideLoading();
  223. uni.stopPullDownRefresh();
  224. if(res.status == 200){
  225. let list = res.list || [];
  226. if(list.length){
  227. this.dataInfo.hasMore = true;
  228. this.dataInfo.list = this.dataInfo.idx === 0 ? list : this.dataInfo.list.concat(list);
  229. }else{
  230. this.dataInfo.hasMore = false;
  231. }
  232. }else{
  233. uni.showToast({
  234. icon: 'none',
  235. title: res.msg || '请求数据失败!'
  236. });
  237. }
  238. })
  239. },
  240. // 详情
  241. toDetail(data){
  242. uni.navigateTo({
  243. url: `/pages/patientInspectLog/patientInspectLogDetail?patientInspectLogId=${data.id}&from=patientInpectLogList`
  244. })
  245. },
  246. // 标记回科
  247. tagClick(data){
  248. this.selectData = data;
  249. this.models = {
  250. disjunctor: true,
  251. title: "提示",
  252. content: `将${data.patientName}患者标记为已回科,是否确认?`,
  253. icon: "warn",
  254. operate: {
  255. ok: "确定",
  256. cancel: "取消",
  257. },
  258. };
  259. },
  260. //确定
  261. ok() {
  262. this.models.disjunctor = false;
  263. uni.showLoading({
  264. title: "加载中",
  265. mask: true,
  266. });
  267. post("/nurse/patientInspect/setPatientInspectBackDept", {
  268. pilId: this.selectData.id,
  269. }).then((res) => {
  270. uni.hideLoading();
  271. let _this = this;
  272. if (res.state == 200) {
  273. uni.showToast({
  274. icon: "none",
  275. mask: true,
  276. title: "操作成功!",
  277. });
  278. setTimeout(() => {
  279. _this.getList(0);
  280. },300)
  281. } else {
  282. uni.showToast({
  283. icon: 'none',
  284. title: res.msg || '请求数据失败!'
  285. });
  286. }
  287. })
  288. },
  289. //取消
  290. cancel() {
  291. this.models.disjunctor = false;
  292. },
  293. // 点击tab
  294. clickTab(tabId){
  295. this.dataInfo.tabActiveId = tabId;
  296. if(tabId === 1){
  297. this.dataInfo.evtFilter.signUser = {id: 0, name: '全部'};
  298. this.dataInfo.evtFilter.inspectUser = {id: 0, name: '全部'};
  299. }else if(tabId === 2){
  300. this.dataInfo.evtFilter.signUser = {id: 0, name: '全部'};
  301. this.dataInfo.evtFilter.inspectUser = this.loginUser;
  302. }else if(tabId === 3){
  303. this.dataInfo.evtFilter.signUser = this.loginUser;
  304. this.dataInfo.evtFilter.inspectUser = {id: 0, name: '全部'};
  305. }
  306. this.getList(0);
  307. },
  308. // 点击筛选
  309. filterClick(){
  310. this.dataInfo.isFilter = true;
  311. },
  312. // 确认筛选
  313. conformFilter(evtFilter){
  314. uni.setStorageSync('patientInspectLogEvtFilter', evtFilter);//缓存
  315. uni.setStorageSync('patientInspectLogTabActiveId', this.dataInfo.tabActiveId);//缓存
  316. this.dataInfo.evtFilter = evtFilter;
  317. this.dataInfo.isFilter = false;
  318. this.getList(0);
  319. },
  320. // 关闭筛选
  321. cancelFilter(){
  322. this.dataInfo.isFilter = false;
  323. },
  324. },
  325. onLoad(options){
  326. this.onLoadFn(uni.getStorageSync('patientInspectLogEvtFilter') && uni.getStorageSync('patientInspectLogTabActiveId'));
  327. },
  328. onTabItemTap(){
  329. this.onLoadFn();
  330. },
  331. onPullDownRefresh(){
  332. this.getList(0);
  333. },
  334. onReachBottom(){
  335. this.dataInfo.idx += 1;
  336. if (this.dataInfo.hasMore) {
  337. this.getList(); // 当触底时加载更多数据
  338. }
  339. },
  340. };
  341. </script>
  342. <style lang="scss" scoped>
  343. .toolbar {
  344. position: fixed;
  345. left: 0;
  346. bottom: var(--window-bottom);
  347. z-index: 99;
  348. width: 100%;
  349. height: 88rpx;
  350. display: flex;
  351. justify-content: center;
  352. align-items: center;
  353. box-sizing: border-box;
  354. border-radius: 4rpx;
  355. background-color: #E5E8ED;
  356. .toolbar-icon {
  357. font-size: 52rpx;
  358. margin-right: 16rpx;
  359. color: #49B856;
  360. }
  361. .toolbar-sao {
  362. font-size: 36rpx;
  363. color: #333;
  364. }
  365. }
  366. page{
  367. height: calc(100vh - var(--window-bottom));
  368. }
  369. .incidentList{
  370. display: flex;
  371. flex-direction: column;
  372. justify-content: space-between;
  373. .head{
  374. height: 88rpx;
  375. display: flex;
  376. position: fixed;
  377. z-index: 99;
  378. width: 100%;
  379. background-color: #fff;
  380. font-size: 30rpx;
  381. .tab{
  382. flex: 1;
  383. display: flex;
  384. justify-content: center;
  385. align-items: center;
  386. border-bottom: 4rpx solid transparent;
  387. &.active{
  388. color: #49b856;
  389. border-color: #49b856;
  390. }
  391. }
  392. .filter{
  393. width: 84rpx;
  394. display: flex;
  395. justify-content: center;
  396. align-items: center;
  397. .newicon-shaixuan{
  398. font-size: 36rpx;
  399. color: #2C2C2C;
  400. }
  401. }
  402. }
  403. .body{
  404. margin-bottom: calc(var(--window-bottom) + 88rpx);
  405. margin-top: 88rpx;
  406. border-top: 6rpx solid #EBEBEB;
  407. .body_item{
  408. border-bottom: 8rpx solid #EBEBEB;
  409. .body_item_head{
  410. word-break: break-all;
  411. text-align: justify;
  412. text-align: left;
  413. margin: 24rpx;
  414. font-size: 30rpx;
  415. display: flex;
  416. align-items: center;
  417. justify-content: space-between;
  418. .sign{
  419. margin-right: 16rpx;
  420. color: #49B856;
  421. &.signRed{
  422. color: #FF0000;
  423. }
  424. }
  425. }
  426. .body_item_content{
  427. border-top: 1rpx solid #D8D8D8;
  428. padding: 24rpx;
  429. .body_item_content_p{
  430. color: #6A6A6A;
  431. font-size: 26rpx;
  432. display: flex;
  433. justify-content: space-between;
  434. align-items: center;
  435. margin-bottom: 24rpx;
  436. &:last-of-type{
  437. margin-bottom: 0;
  438. }
  439. .name{
  440. flex: 1;
  441. }
  442. .status{
  443. padding: 4rpx 10rpx;
  444. border-radius: 20rpx;
  445. background-color: #DBE8FE;
  446. font-size: 22rpx;
  447. color: #006CF9;
  448. }
  449. .icon_all{
  450. .mic-filled,
  451. .image-filled
  452. {
  453. margin-left: 16rpx;
  454. }
  455. }
  456. }
  457. }
  458. .body_item_foot{
  459. border-top: 1rpx solid #D8D8D8;
  460. font-size: 26rpx;
  461. padding: 24rpx;
  462. .foot_info{
  463. display: flex;
  464. justify-content: space-between;
  465. align-items: center;
  466. .phone-filled{
  467. margin-left: 5rpx;
  468. }
  469. }
  470. }
  471. }
  472. }
  473. .zanwu{
  474. box-sizing: border-box;
  475. margin-bottom: calc(var(--window-bottom) + 88rpx);
  476. margin-top: 88rpx;
  477. border-top: 6rpx solid #EBEBEB;
  478. height: calc(100vh - var(--window-bottom) - 176rpx);
  479. display: flex;
  480. justify-content: center;
  481. background-color: #F7F7F7;
  482. .newicon-zanwu{
  483. font-size: 256rpx;
  484. color: #D6D6D6;
  485. margin-top: 140rpx;
  486. }
  487. }
  488. }
  489. </style>