home.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. <template>
  2. <view class="home-page">
  3. <view class="content-info">
  4. <view class="top-box">
  5. <image class="bgpic" src="/static/images/pcbg.png"></image>
  6. <text class="hosname">{{hospName}}</text>
  7. </view>
  8. <view class="avatar-box">
  9. <image class="avatar" src="/static/images/boy-avatar.png"></image>
  10. </view>
  11. <view class="info-box">
  12. <view class="head">
  13. <text class="name">
  14. {{name}}
  15. </text>
  16. <!-- <image class="gender" src="/static/images/boy.png"></image> -->
  17. <text class="username">{{code}}</text>
  18. </view>
  19. <!-- <view class="row">
  20. <text class="text">心血管内科</text>
  21. </view> -->
  22. <view class="row">
  23. <view class="col">
  24. <text class="text">主管:{{depManager}}</text>
  25. </view>
  26. <view class="col">
  27. <text class="text">|</text>
  28. </view>
  29. <view class="col">
  30. <text class="text">所属查核组:{{dep}}</text>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="function-box">
  35. <view class="role-switch" @click="switchRole">
  36. <text class="func-text">角色切换</text>
  37. <view class="msg-box" v-show="isMsgShow">
  38. <text class="msg-text">{{this.totalTodo}}</text>
  39. </view>
  40. <image class="icon-more" src="/static/images/icon-more.png"></image>
  41. <text class="role">{{nowPermissionName}}</text>
  42. </view>
  43. <!-- <view class="sys-setting">
  44. <text class="func-text">系统设置</text>
  45. <image class="icon-more" src="/static/images/icon-more.png"></image>
  46. </view> -->
  47. <view class="suggestions-feedback-btn" @click="feedbackFunc">
  48. <text class="func-text">建议与反馈</text>
  49. <image class="icon-more" src="/static/images/icon-more.png"></image>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="logout-box" @click="logOut">
  54. <text class="logout-text">退出登录</text>
  55. </view>
  56. <view class="copyright" @click="showVersionInfo">
  57. <text>浙江新医智联信息科技有限公司</text>
  58. <text>{{version}}</text>
  59. </view>
  60. <tm-tabbar :permission="nowPermission" />
  61. <tm-modal v-if="showJournal">
  62. <view class="journal">
  63. <view class="journal-title">
  64. <text>{{journalData.logTitle}}</text>
  65. <text>{{journalData.logDate}}</text>
  66. </view>
  67. <scroll-view scroll-y="true" class="journal-content">
  68. {{journalData.logContent}}
  69. </scroll-view>
  70. <button class="journal-ok" @click="journalOk">确定</button>
  71. </view>
  72. </tm-modal>
  73. <tm-modal v-if="ifshowVersionInfo">
  74. <view class="journal">
  75. <view class="journal-title">
  76. <text>{{versionData.versionNo}}</text>
  77. <text>{{versionData.versionDate}}</text>
  78. </view>
  79. <scroll-view scroll-y="true" class="journal-content">
  80. {{versionData.versionContent}}
  81. </scroll-view>
  82. <button class="journal-ok" @click="ifshowVersionInfo = false">确定</button>
  83. </view>
  84. </tm-modal>
  85. </view>
  86. </template>
  87. <script>
  88. export default {
  89. data() {
  90. return {
  91. ifshowVersionInfo:false,
  92. showJournal: false,
  93. version: '0.5.3',
  94. versionData: {
  95. versionNo: '',
  96. versionId: '',
  97. versionDate: '',
  98. versionContent: ''
  99. },
  100. journalData: {
  101. logId: '',
  102. logTitle: '',
  103. logDate: '',
  104. logContent: ''
  105. },
  106. nowPermission: '', //用户当前第一权限
  107. nowPermissionName: '', //当前权限名
  108. code: '', //用户名
  109. name: '', //名字
  110. dep: '', //所属查核组
  111. depManager: '', //查核组组长
  112. hospName: '', //医院名
  113. totalTodo: 0, //总待办数
  114. pemissionList: [{
  115. permission: 1,
  116. name: '管理员'
  117. },
  118. {
  119. permission: 2,
  120. name: '查核组长'
  121. },
  122. {
  123. permission: 3,
  124. name: '查核组员'
  125. },
  126. {
  127. permission: 4,
  128. name: '单位负责人'
  129. },
  130. {
  131. permission: 5,
  132. name: '改善者'
  133. }
  134. ]
  135. }
  136. },
  137. created: function() {
  138. this.$store.dispatch({
  139. type: 'home/commActions',
  140. payload: {
  141. key: 'getuser',
  142. }
  143. }).then((data) => {
  144. if (data) {
  145. uni.setStorageSync('permissions', data.permissions);
  146. uni.setStorageSync('nowPermission', data.nowPermission);
  147. this.code = data.code;
  148. this.name = data.name;
  149. this.nowPermission = data.nowPermission;
  150. this.dep = data.dep;
  151. this.depManager = data.depManager;
  152. this.hospName = data.hospName;
  153. let current = this.pemissionList.find(item => item.permission == data.nowPermission);
  154. this.nowPermissionName = current.name;
  155. this.totalTodo = data.permissions.reduce(function(total, currentValue) {
  156. return total + currentValue.todoNum;
  157. }, 0);
  158. }
  159. });
  160. this.$store.dispatch({
  161. type: 'home/commActions',
  162. payload: {
  163. key: 'getVersionLog',
  164. data: {
  165. versionNo: this.version
  166. }
  167. }
  168. }).then((data) => {
  169. if (data) {
  170. if (!data.logId) {
  171. this.showJournal = false;
  172. } else {
  173. this.showJournal = true;
  174. this.journalData = data;
  175. }
  176. }
  177. });
  178. },
  179. methods: {
  180. logOut() {
  181. this.$store.dispatch({
  182. type: 'home/commActions',
  183. payload: {
  184. key: 'logout',
  185. }
  186. }).then((data) => {
  187. if (data) {
  188. uni.redirectTo({
  189. url: `/pages/login/login?hospSign=${uni.getStorageSync('hospSign')}`
  190. });
  191. }
  192. });
  193. },
  194. switchRole() {
  195. uni.navigateTo({
  196. url: '/pages/role-switching/role-switching'
  197. });
  198. }
  199. },
  200. created: function() {
  201. this.$store.dispatch({
  202. type: 'home/commActions',
  203. payload: {
  204. key: 'getuser',
  205. }
  206. }).then((data) => {
  207. if (data) {
  208. uni.setStorageSync('permissions', data.permissions);
  209. uni.setStorageSync('nowPermission', data.nowPermission);
  210. this.code=data.code;
  211. this.name=data.name;
  212. this.nowPermission=data.nowPermission;
  213. this.dep=data.dep;
  214. this.depManager=data.depManager;
  215. this.hospName=data.hospName;
  216. let current=this.pemissionList.find(item => item.permission == data.nowPermission);
  217. this.nowPermissionName=current.name;
  218. this.totalTodo=data.permissions.reduce(function(total,currentValue){
  219. return total+currentValue.todoNum;
  220. },0);
  221. }
  222. });
  223. this.$store.dispatch({
  224. type: 'home/commActions',
  225. payload: {
  226. key: 'getVersionLog',
  227. data: {versionNo: this.version}
  228. }
  229. }).then((data) => {
  230. if (data) {
  231. if(!data.logId) {
  232. this.showJournal = false;
  233. } else {
  234. this.showJournal = true;
  235. this.journalData = data;
  236. }
  237. }
  238. });
  239. },
  240. methods: {
  241. logOut() {
  242. this.$store.dispatch({
  243. type: 'home/commActions',
  244. payload: {
  245. key: 'logout',
  246. }
  247. }).then((data)=>{
  248. if(data){
  249. uni.redirectTo({
  250. url: `/pages/login/login?hospSign=${uni.getStorageSync('hospSign')}`
  251. });
  252. }
  253. });
  254. },
  255. feedbackFunc(){
  256. uni.navigateTo({
  257. url: '/pages/suggestionsFeedback/suggestionsFeedback'
  258. });
  259. },
  260. journalOk() {
  261. this.showJournal = false;
  262. this.$store.dispatch({
  263. type: 'home/commActions',
  264. payload: {
  265. key: 'hadRead',
  266. data: {
  267. versionNO: this.version,
  268. versionId: this.journalData.logId
  269. }
  270. }
  271. });
  272. },
  273. showVersionInfo(){
  274. this.$store.dispatch({
  275. type: 'home/commActions',
  276. payload: {
  277. key: 'getThisVersionInfo',
  278. data: {
  279. versionNo: this.version,
  280. }
  281. }
  282. }).then(data=>{
  283. // console.log({'getThisVersionInfo':data});
  284. this.versionData = data;
  285. this.ifshowVersionInfo = true;
  286. });
  287. }
  288. },
  289. computed: {
  290. isMsgShow() {
  291. return this.totalTodo <= 0 ? false : true;
  292. }
  293. }
  294. }
  295. </script>
  296. <style lang="less">
  297. .journal {
  298. overflow: hidden;
  299. position: absolute;
  300. top: 50%;
  301. left: 50%;
  302. transform: translateX(-50%) translateY(-50%);
  303. border-radius: 15rpx;
  304. padding: 50rpx;
  305. padding-bottom: 75rpx;
  306. width: 562.5rpx;
  307. // height: 625rpx;
  308. font-size: 22.5rpx;
  309. line-height: 35rpx;
  310. background: #FFFFFF;
  311. .journal-title {
  312. display: flex;
  313. flex-direction: column;
  314. text {
  315. font-size: 35rpx;
  316. line-height: 52.5rpx;
  317. &:last-child {
  318. font-size: 22.5rpx;
  319. line-height: 33.75rpx;
  320. color: #666E80;
  321. }
  322. }
  323. }
  324. .journal-content {
  325. margin: 25rpx 0;
  326. max-height: 332.5rpx;
  327. }
  328. .journal-ok {
  329. position: fixed;
  330. left: 0;
  331. bottom: 0;
  332. border-radius: 0;
  333. border: 0;
  334. width: 100%;
  335. height: 75rpx;
  336. line-height: 75rpx;
  337. font-size: 22.5rpx;
  338. color: #fff;
  339. background-color: #3377FF;
  340. }
  341. }
  342. .home-page {
  343. height: 100%;
  344. .content-info {
  345. height: 596.25rpx;
  346. background-color: #FFFFFF;
  347. .top-box {
  348. position: relative;
  349. height: 350rpx;
  350. .bgpic {
  351. width: 750rpx;
  352. height: 350rpx;
  353. }
  354. .hosname {
  355. font-size: 45rpx;
  356. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  357. font-weight: 400;
  358. color: #FFFFFF;
  359. position: absolute;
  360. left: 50rpx;
  361. top: 92.5rpx;
  362. }
  363. }
  364. .info-box {
  365. width: 700rpx;
  366. height: 250rpx;
  367. border-radius: 15rpx;
  368. background-color: #FFFFFF;
  369. position: absolute;
  370. left: 25rpx;
  371. right: 25rpx;
  372. top: 226.25rpx;
  373. box-shadow: 0px 10px 30px 0px rgba(0, 13, 51, 0.1);
  374. .head {
  375. margin-left: 37.5rpx;
  376. margin-top: 68.75rpx;
  377. .name {
  378. font-size: 35rpx;
  379. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  380. font-weight: 400;
  381. color: #17181A;
  382. }
  383. .gender {
  384. width: 25rpx;
  385. height: 25rpx;
  386. background: linear-gradient(135deg, #4DA6FF 0%, #4D88FF 100%);
  387. border-radius: 6.25rpx;
  388. margin-left: 15rpx;
  389. }
  390. .username {
  391. font-size: 25rpx;
  392. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  393. font-weight: 400;
  394. color: #17181A;
  395. margin-left: 55rpx;
  396. }
  397. }
  398. .row {
  399. margin-left: 37.5rpx;
  400. margin-top: 62.5rpx;
  401. .col {
  402. display: inline-block;
  403. margin-right: 25rpx;
  404. }
  405. }
  406. .text {
  407. font-size: 22.5rpx;
  408. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  409. font-weight: 400;
  410. color: #666E80;
  411. }
  412. }
  413. .avatar-box {
  414. width: 125rpx;
  415. height: 125rpx;
  416. position: absolute;
  417. right: 75rpx;
  418. top: 187.5rpx;
  419. background: #FFFFFF;
  420. z-index: 2;
  421. border-radius: 50%
  422. }
  423. .avatar {
  424. width: 112.5rpx;
  425. height: 112.5rpx;
  426. margin-left: 6.25rpx;
  427. margin-top: 6.25rpx;
  428. border-radius: 50%
  429. }
  430. .function-box {
  431. position: absolute;
  432. top: 496.25rpx;
  433. width: 750rpx;
  434. background-color: #FFFFFF;
  435. .role-switch {
  436. height: 100rpx;
  437. width: 725rpx;
  438. margin-left: 25rpx;
  439. background: #FFFFFF;
  440. border-bottom: 0.62rpx solid #DADEE6;
  441. .msg-box {
  442. width: 50rpx;
  443. height: 30rpx;
  444. float: left;
  445. margin-top: 35rpx;
  446. margin-left: 15rpx;
  447. position: relative;
  448. background: #FF4060;
  449. border-radius: 24px;
  450. text-align: center;
  451. .msg-text {
  452. font-size: 17.5rpx;
  453. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  454. font-weight: 400;
  455. color: #FFFFFF;
  456. line-height: 30rpx;
  457. }
  458. }
  459. .role {
  460. font-size: 22.5rpx;
  461. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  462. font-weight: 400;
  463. color: #7A8599;
  464. line-height: 100rpx;
  465. float: right;
  466. margin-right: 25rpx;
  467. }
  468. }
  469. // .sys-setting{
  470. // height: 100rpx;
  471. // width: 725rpx;
  472. // margin-left: 25rpx;
  473. // background: #FFFFFF;
  474. // }
  475. .suggestions-feedback-btn {
  476. height: 100rpx;
  477. width: 725rpx;
  478. margin-left: 25rpx;
  479. background: #FFFFFF;
  480. // border-bottom: 0.62rpx solid #DADEE6;
  481. .func-text {
  482. }
  483. }
  484. .func-text {
  485. font-size: 22.5rpx;
  486. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  487. font-weight: 500;
  488. color: #292C33;
  489. line-height: 100rpx;
  490. float: left;
  491. }
  492. .icon-more {
  493. width: 12.37rpx;
  494. height: 21.21rpx;
  495. line-height: 100rpx;
  496. float: right;
  497. margin-top: 39.37rpx;
  498. margin-right: 25rpx;
  499. }
  500. }
  501. }
  502. .logout-box {
  503. width: 750rpx;
  504. height: 100rpx;
  505. background-color: #FFFFFF;
  506. margin-top:112.5rpx;
  507. .logout-text {
  508. font-size: 22.5rpx;
  509. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  510. font-weight: 500;
  511. color: #292C33;
  512. line-height: 100rpx;
  513. margin-left: 330rpx;
  514. }
  515. }
  516. .copyright {
  517. position: absolute;
  518. bottom: 90rpx;
  519. left: 0;
  520. display: flex;
  521. flex-direction: column;
  522. justify-content: center;
  523. align-items: center;
  524. width: 100%;
  525. color: #666E80;
  526. }
  527. }
  528. </style>