patientInspectLogList.vue 14 KB

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