home.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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>
  48. </view>
  49. <view class="logout-box" @click="logOut">
  50. <text class="logout-text">退出登录</text>
  51. </view>
  52. <view class="copyright">
  53. <text>浙江新医智联信息科技有限公司</text>
  54. <text>{{version}}</text>
  55. </view>
  56. <tm-tabbar :permission="nowPermission" />
  57. <tm-modal v-if="showJournal">
  58. <view class="journal">
  59. <view class="journal-title">
  60. <text>{{journalData.logTitle}}</text>
  61. <text>{{journalData.logDate}}</text>
  62. </view>
  63. <scroll-view scroll-y="true" class="journal-content">
  64. {{journalData.logContent}}
  65. </scroll-view>
  66. <button class="journal-ok" @click="journalOk">确定</button>
  67. </view>
  68. </tm-modal>
  69. </view>
  70. </template>
  71. <script>
  72. export default {
  73. data() {
  74. return {
  75. showJournal: false,
  76. version: '0.5.4',
  77. journalData: {
  78. logId: '',
  79. logTitle: '',
  80. logDate: '',
  81. logContent: ''
  82. },
  83. nowPermission: '', //用户当前第一权限
  84. nowPermissionName:'',//当前权限名
  85. code:'',//用户名
  86. name:'',//名字
  87. dep:'',//所属查核组
  88. depManager:'',//查核组组长
  89. hospName:'',//医院名
  90. totalTodo:0,//总待办数
  91. pemissionList:[
  92. {permission: 1, name: '管理员'},
  93. {permission: 2, name: '查核组长'},
  94. {permission: 3, name: '查核组员'},
  95. {permission: 4, name: '单位负责人'},
  96. {permission: 5, name: '改善者'}
  97. ]
  98. }
  99. },
  100. created: function() {
  101. this.$store.dispatch({
  102. type: 'home/commActions',
  103. payload: {
  104. key: 'getuser',
  105. }
  106. }).then((data) => {
  107. if (data) {
  108. uni.setStorageSync('permissions', data.permissions);
  109. uni.setStorageSync('nowPermission', data.nowPermission);
  110. this.code=data.code;
  111. this.name=data.name;
  112. this.nowPermission=data.nowPermission;
  113. this.dep=data.dep;
  114. this.depManager=data.depManager;
  115. this.hospName=data.hospName;
  116. let current=this.pemissionList.find(item => item.permission == data.nowPermission);
  117. this.nowPermissionName=current.name;
  118. this.totalTodo=data.permissions.reduce(function(total,currentValue){
  119. return total+currentValue.todoNum;
  120. },0);
  121. }
  122. });
  123. this.$store.dispatch({
  124. type: 'home/commActions',
  125. payload: {
  126. key: 'getVersionLog',
  127. data: {versionNo: this.version}
  128. }
  129. }).then((data) => {
  130. if (data) {
  131. if(!data.logId) {
  132. this.showJournal = false;
  133. } else {
  134. this.showJournal = true;
  135. this.journalData = data;
  136. }
  137. }
  138. });
  139. },
  140. methods: {
  141. logOut() {
  142. this.$store.dispatch({
  143. type: 'home/commActions',
  144. payload: {
  145. key: 'logout',
  146. }
  147. }).then((data)=>{
  148. if(data){
  149. uni.redirectTo({
  150. url: `/pages/login/login?hospSign=${uni.getStorageSync('hospSign')}`
  151. });
  152. }
  153. });
  154. },
  155. switchRole() {
  156. uni.navigateTo({
  157. url: '/pages/role-switching/role-switching'
  158. });
  159. },
  160. journalOk() {
  161. this.showJournal = false;
  162. this.$store.dispatch({
  163. type: 'home/commActions',
  164. payload: {
  165. key: 'hadRead',
  166. data: {versionNO: this.version, versionId: this.journalData.logId}
  167. }
  168. });
  169. }
  170. },
  171. computed:{
  172. isMsgShow(){
  173. return this.totalTodo<=0?false:true;
  174. }
  175. }
  176. }
  177. </script>
  178. <style lang="less">
  179. .journal {
  180. overflow: hidden;
  181. position: absolute;
  182. top: 50%;
  183. left: 50%;
  184. transform: translateX(-50%) translateY(-50%);
  185. border-radius: 15rpx;
  186. padding: 50rpx;
  187. padding-bottom: 75rpx;
  188. width: 562.5rpx;
  189. // height: 625rpx;
  190. font-size: 22.5rpx;
  191. line-height: 35rpx;
  192. background: #FFFFFF;
  193. .journal-title {
  194. display: flex;
  195. flex-direction: column;
  196. text {
  197. font-size: 35rpx;
  198. line-height: 52.5rpx;
  199. &:last-child {
  200. font-size: 22.5rpx;
  201. line-height: 33.75rpx;
  202. color: #666E80;
  203. }
  204. }
  205. }
  206. .journal-content {
  207. margin: 25rpx 0;
  208. max-height: 332.5rpx;
  209. }
  210. .journal-ok {
  211. position: fixed;
  212. left: 0;
  213. bottom: 0;
  214. border-radius: 0;
  215. border: 0;
  216. width: 100%;
  217. height: 75rpx;
  218. line-height: 75rpx;
  219. font-size: 22.5rpx;
  220. color: #fff;
  221. background-color: #3377FF;
  222. }
  223. }
  224. .home-page {
  225. height: 100%;
  226. .content-info {
  227. height: 596.25rpx;
  228. background-color: #FFFFFF;
  229. .top-box {
  230. position: relative;
  231. height: 350rpx;
  232. .bgpic {
  233. width: 750rpx;
  234. height: 350rpx;
  235. }
  236. .hosname {
  237. font-size: 45rpx;
  238. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  239. font-weight: 400;
  240. color: #FFFFFF;
  241. position: absolute;
  242. left: 50rpx;
  243. top: 92.5rpx;
  244. }
  245. }
  246. .info-box {
  247. width: 700rpx;
  248. height: 250rpx;
  249. border-radius: 15rpx;
  250. background-color: #FFFFFF;
  251. position: absolute;
  252. left: 25rpx;
  253. right: 25rpx;
  254. top: 226.25rpx;
  255. box-shadow: 0px 10px 30px 0px rgba(0, 13, 51, 0.1);
  256. .head {
  257. margin-left: 37.5rpx;
  258. margin-top: 68.75rpx;
  259. .name {
  260. font-size: 35rpx;
  261. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  262. font-weight: 400;
  263. color: #17181A;
  264. }
  265. .gender {
  266. width: 25rpx;
  267. height: 25rpx;
  268. background: linear-gradient(135deg, #4DA6FF 0%, #4D88FF 100%);
  269. border-radius: 6.25rpx;
  270. margin-left: 15rpx;
  271. }
  272. .username {
  273. font-size: 25rpx;
  274. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  275. font-weight: 400;
  276. color: #17181A;
  277. margin-left: 55rpx;
  278. }
  279. }
  280. .row {
  281. margin-left: 37.5rpx;
  282. margin-top: 62.5rpx;
  283. .col {
  284. display: inline-block;
  285. margin-right: 25rpx;
  286. }
  287. }
  288. .text {
  289. font-size: 22.5rpx;
  290. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  291. font-weight: 400;
  292. color: #666E80;
  293. }
  294. }
  295. .avatar-box {
  296. width: 125rpx;
  297. height: 125rpx;
  298. position: absolute;
  299. right: 75rpx;
  300. top: 187.5rpx;
  301. background: #FFFFFF;
  302. z-index: 2;
  303. border-radius: 50%
  304. }
  305. .avatar {
  306. width: 112.5rpx;
  307. height: 112.5rpx;
  308. margin-left: 6.25rpx;
  309. margin-top: 6.25rpx;
  310. border-radius: 50%
  311. }
  312. .function-box {
  313. position: absolute;
  314. top: 496.25rpx;
  315. width: 750rpx;
  316. .role-switch {
  317. height: 100rpx;
  318. width: 725rpx;
  319. margin-left: 25rpx;
  320. background: #FFFFFF;
  321. border-bottom: 0.62rpx solid #DADEE6;
  322. .msg-box {
  323. width: 50rpx;
  324. height: 30rpx;
  325. float: left;
  326. margin-top: 35rpx;
  327. margin-left: 15rpx;
  328. position: relative;
  329. background: #FF4060;
  330. border-radius: 24px;
  331. text-align: center;
  332. .msg-text {
  333. font-size: 17.5rpx;
  334. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  335. font-weight: 400;
  336. color: #FFFFFF;
  337. line-height: 30rpx;
  338. }
  339. }
  340. .role {
  341. font-size: 22.5rpx;
  342. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  343. font-weight: 400;
  344. color: #7A8599;
  345. line-height: 100rpx;
  346. float: right;
  347. margin-right: 25rpx;
  348. }
  349. }
  350. // .sys-setting{
  351. // height: 100rpx;
  352. // width: 725rpx;
  353. // margin-left: 25rpx;
  354. // background: #FFFFFF;
  355. // }
  356. .func-text {
  357. font-size: 22.5rpx;
  358. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  359. font-weight: 500;
  360. color: #292C33;
  361. line-height: 100rpx;
  362. float: left;
  363. }
  364. .icon-more {
  365. width: 12.37rpx;
  366. height: 21.21rpx;
  367. line-height: 100rpx;
  368. float: right;
  369. margin-top: 39.37rpx;
  370. margin-right: 25rpx;
  371. }
  372. }
  373. }
  374. .logout-box {
  375. width: 750rpx;
  376. height: 100rpx;
  377. background-color: #FFFFFF;
  378. margin-top: 15rpx;
  379. .logout-text {
  380. font-size: 22.5rpx;
  381. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  382. font-weight: 500;
  383. color: #292C33;
  384. line-height: 100rpx;
  385. margin-left: 330rpx;
  386. }
  387. }
  388. .copyright {
  389. position: absolute;
  390. bottom: 90rpx;
  391. left: 0;
  392. display: flex;
  393. flex-direction: column;
  394. justify-content: center;
  395. align-items: center;
  396. width: 100%;
  397. color: #666E80;
  398. }
  399. }
  400. </style>