home.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  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. feedbackFunc(){
  200. uni.navigateTo({
  201. url: '/pages/suggestionsFeedback/suggestionsFeedback'
  202. });
  203. },
  204. journalOk() {
  205. this.showJournal = false;
  206. this.$store.dispatch({
  207. type: 'home/commActions',
  208. payload: {
  209. key: 'hadRead',
  210. data: {
  211. versionNO: this.version,
  212. versionId: this.journalData.logId
  213. }
  214. }
  215. });
  216. },
  217. showVersionInfo(){
  218. this.$store.dispatch({
  219. type: 'home/commActions',
  220. payload: {
  221. key: 'getThisVersionInfo',
  222. data: {
  223. versionNo: this.version,
  224. }
  225. }
  226. }).then(data=>{
  227. // console.log({'getThisVersionInfo':data});
  228. this.versionData = data;
  229. this.ifshowVersionInfo = true;
  230. });
  231. }
  232. },
  233. computed: {
  234. isMsgShow() {
  235. return this.totalTodo <= 0 ? false : true;
  236. }
  237. }
  238. }
  239. </script>
  240. <style lang="less">
  241. .journal {
  242. overflow: hidden;
  243. position: absolute;
  244. top: 50%;
  245. left: 50%;
  246. transform: translateX(-50%) translateY(-50%);
  247. border-radius: 15rpx;
  248. padding: 50rpx;
  249. padding-bottom: 75rpx;
  250. width: 562.5rpx;
  251. // height: 625rpx;
  252. font-size: 22.5rpx;
  253. line-height: 35rpx;
  254. background: #FFFFFF;
  255. .journal-title {
  256. display: flex;
  257. flex-direction: column;
  258. text {
  259. font-size: 35rpx;
  260. line-height: 52.5rpx;
  261. &:last-child {
  262. font-size: 22.5rpx;
  263. line-height: 33.75rpx;
  264. color: #666E80;
  265. }
  266. }
  267. }
  268. .journal-content {
  269. margin: 25rpx 0;
  270. max-height: 332.5rpx;
  271. }
  272. .journal-ok {
  273. position: fixed;
  274. left: 0;
  275. bottom: 0;
  276. border-radius: 0;
  277. border: 0;
  278. width: 100%;
  279. height: 75rpx;
  280. line-height: 75rpx;
  281. font-size: 22.5rpx;
  282. color: #fff;
  283. background-color: #3377FF;
  284. }
  285. }
  286. .home-page {
  287. height: 100%;
  288. .content-info {
  289. height: 596.25rpx;
  290. background-color: #FFFFFF;
  291. .top-box {
  292. position: relative;
  293. height: 350rpx;
  294. .bgpic {
  295. width: 750rpx;
  296. height: 350rpx;
  297. }
  298. .hosname {
  299. font-size: 45rpx;
  300. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  301. font-weight: 400;
  302. color: #FFFFFF;
  303. position: absolute;
  304. left: 50rpx;
  305. top: 92.5rpx;
  306. }
  307. }
  308. .info-box {
  309. width: 700rpx;
  310. height: 250rpx;
  311. border-radius: 15rpx;
  312. background-color: #FFFFFF;
  313. position: absolute;
  314. left: 25rpx;
  315. right: 25rpx;
  316. top: 226.25rpx;
  317. box-shadow: 0px 10px 30px 0px rgba(0, 13, 51, 0.1);
  318. .head {
  319. margin-left: 37.5rpx;
  320. margin-top: 68.75rpx;
  321. .name {
  322. font-size: 35rpx;
  323. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  324. font-weight: 400;
  325. color: #17181A;
  326. }
  327. .gender {
  328. width: 25rpx;
  329. height: 25rpx;
  330. background: linear-gradient(135deg, #4DA6FF 0%, #4D88FF 100%);
  331. border-radius: 6.25rpx;
  332. margin-left: 15rpx;
  333. }
  334. .username {
  335. font-size: 25rpx;
  336. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  337. font-weight: 400;
  338. color: #17181A;
  339. margin-left: 55rpx;
  340. }
  341. }
  342. .row {
  343. margin-left: 37.5rpx;
  344. margin-top: 62.5rpx;
  345. .col {
  346. display: inline-block;
  347. margin-right: 25rpx;
  348. }
  349. }
  350. .text {
  351. font-size: 22.5rpx;
  352. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  353. font-weight: 400;
  354. color: #666E80;
  355. }
  356. }
  357. .avatar-box {
  358. width: 125rpx;
  359. height: 125rpx;
  360. position: absolute;
  361. right: 75rpx;
  362. top: 187.5rpx;
  363. background: #FFFFFF;
  364. z-index: 2;
  365. border-radius: 50%
  366. }
  367. .avatar {
  368. width: 112.5rpx;
  369. height: 112.5rpx;
  370. margin-left: 6.25rpx;
  371. margin-top: 6.25rpx;
  372. border-radius: 50%
  373. }
  374. .function-box {
  375. position: absolute;
  376. top: 496.25rpx;
  377. width: 750rpx;
  378. background-color: #FFFFFF;
  379. .role-switch {
  380. height: 100rpx;
  381. width: 725rpx;
  382. margin-left: 25rpx;
  383. background: #FFFFFF;
  384. border-bottom: 0.62rpx solid #DADEE6;
  385. .msg-box {
  386. width: 50rpx;
  387. height: 30rpx;
  388. float: left;
  389. margin-top: 35rpx;
  390. margin-left: 15rpx;
  391. position: relative;
  392. background: #FF4060;
  393. border-radius: 24px;
  394. text-align: center;
  395. .msg-text {
  396. font-size: 17.5rpx;
  397. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  398. font-weight: 400;
  399. color: #FFFFFF;
  400. line-height: 30rpx;
  401. }
  402. }
  403. .role {
  404. font-size: 22.5rpx;
  405. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  406. font-weight: 400;
  407. color: #7A8599;
  408. line-height: 100rpx;
  409. float: right;
  410. margin-right: 25rpx;
  411. }
  412. }
  413. // .sys-setting{
  414. // height: 100rpx;
  415. // width: 725rpx;
  416. // margin-left: 25rpx;
  417. // background: #FFFFFF;
  418. // }
  419. .suggestions-feedback-btn {
  420. height: 100rpx;
  421. width: 725rpx;
  422. margin-left: 25rpx;
  423. background: #FFFFFF;
  424. // border-bottom: 0.62rpx solid #DADEE6;
  425. .func-text {
  426. }
  427. }
  428. .func-text {
  429. font-size: 22.5rpx;
  430. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  431. font-weight: 500;
  432. color: #292C33;
  433. line-height: 100rpx;
  434. float: left;
  435. }
  436. .icon-more {
  437. width: 12.37rpx;
  438. height: 21.21rpx;
  439. line-height: 100rpx;
  440. float: right;
  441. margin-top: 39.37rpx;
  442. margin-right: 25rpx;
  443. }
  444. }
  445. }
  446. .logout-box {
  447. width: 750rpx;
  448. height: 100rpx;
  449. background-color: #FFFFFF;
  450. margin-top:112.5rpx;
  451. .logout-text {
  452. font-size: 22.5rpx;
  453. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  454. font-weight: 500;
  455. color: #292C33;
  456. line-height: 100rpx;
  457. margin-left: 330rpx;
  458. }
  459. }
  460. .copyright {
  461. position: absolute;
  462. bottom: 90rpx;
  463. left: 0;
  464. display: flex;
  465. flex-direction: column;
  466. justify-content: center;
  467. align-items: center;
  468. width: 100%;
  469. color: #666E80;
  470. }
  471. }
  472. </style>