homePage.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. <template>
  2. <view class="home">
  3. <div class="bg-card" />
  4. <div class="title-operation">
  5. <div class="user-profilephoto">
  6. <img src="https://pic2.zhimg.com/50/v2-48ad5fee92cb9fc7292db33223452313_hd.png" alt="" srcset="">
  7. </div>
  8. <div class="user-detail">
  9. <text>{{ users.nickname }} 欢迎回来!</text>
  10. <text class="role-style">{{ users.roleStr }}</text>
  11. </div>
  12. <div class="user-mess">
  13. <text class="font-icons" style="font-size: 26px;">&#xe6a4;</text>
  14. </div>
  15. </div>
  16. <div class="title-panel">
  17. <div class="card-title">今日待办</div>
  18. <div class="card-row">
  19. <div class="card-col">
  20. <text style="color: #828282">0</text>
  21. <text>待审批</text>
  22. </div>
  23. <div class="card-col">
  24. <text style="color: orange;">0</text>
  25. <text>预警</text>
  26. </div>
  27. <div class="card-col">
  28. <text style="color: #539cf8;">6</text>
  29. <text>未读公告</text>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="content">
  34. <div class="content-panel">
  35. <div class="card-title">
  36. <div class="card-title-left">
  37. <text class="font-icons"
  38. style="width: 20px;font-size: 18px;margin-right: 4px;color: #539cf8;">&#xe679;</text>企业公告
  39. </div>
  40. <div class="card-title-right">更多<i class="font-icons">&#xe66b;</i></div>
  41. </div>
  42. <div class="card-row">
  43. <text>2023-06-01 关于启用加密管理制度的说明</text>
  44. <text class="font-icons font-icons2">&#xe694;</text>
  45. </div>
  46. <div class="card-row">
  47. <text>2023-06-03 端午节放假通知</text>
  48. <text class="font-icons font-icons2">&#xe694;</text>
  49. </div>
  50. <div class="card-row">
  51. <text>2023-06-11 再次申明节前请假及调休所需填写的审批明细</text>
  52. <text class="font-icons font-icons2">&#xe694;</text>
  53. </div>
  54. <div class="card-row">
  55. <text>2023-06-24 关于放假期间供应商提供送货的单据相关的订单</text>
  56. <text class="font-icons font-icons2">&#xe694;</text>
  57. </div>
  58. </div>
  59. <div class="content-panel">
  60. <div class="card-title">
  61. <div class="card-title-left">
  62. <text class="font-icons"
  63. style="width: 20px;font-size: 18px;margin-right: 4px;color: #2cb755;">&#xe6be;</text>我的待办
  64. </div>
  65. <div class="card-title-right">更多<i class="font-icons">&#xe66b;</i></div>
  66. </div>
  67. <div class="card-row">
  68. <text>2023-06-11 采购订单CGDD2023060149101011000021需要进行采购</text>
  69. <text class="font-icons font-icons2">&#xe694;</text>
  70. </div>
  71. <div class="card-row">
  72. <text>2023-06-18 采购订单CGDD2023062149101011000021即将到期</text>
  73. <text class="font-icons font-icons2">&#xe694;</text>
  74. </div>
  75. <div class="card-row">
  76. <text>2023-06-19 采购订单CGDD2023060191010119000021需要进行采购</text>
  77. <text class="font-icons font-icons2">&#xe694;</text>
  78. </div>
  79. <div class="card-row">
  80. <text>2023-06-24 采购订单CGDD2023060249101011000021需要进行采购</text>
  81. <text class="font-icons font-icons2">&#xe694;</text>
  82. </div>
  83. </div>
  84. <div class="content-panel">
  85. <div class="card-title">
  86. <div class="card-title-left">
  87. <text class="font-icons"
  88. style="width: 20px;font-size: 18px;margin-right: 4px;color: orange;">&#xe6e0;</text>
  89. 预警信息
  90. </div>
  91. <div class="card-title-right">更多<i class="font-icons">&#xe66b;</i></div>
  92. </div>
  93. <div class="card-row">
  94. <text>2023-06-01 您有4笔采购订单即将超时,请立即进行处理!</text>
  95. <text class="font-icons font-icons2">&#xe694;</text>
  96. </div>
  97. <div class="card-row">
  98. <text>2023-06-03 您有2笔采购订单已经逾期,请立即进行处理!</text>
  99. <text class="font-icons font-icons2">&#xe694;</text>
  100. </div>
  101. <div class="card-row">
  102. <text>2024-03-21 您有1笔采购订单已经逾期,请立即进行处理!</text>
  103. <text class="font-icons font-icons2">&#xe694;</text>
  104. </div>
  105. <div class="card-row">
  106. <text>2024-04-13 您有12笔采购订单已经逾期,请立即进行处理!</text>
  107. <text class="font-icons font-icons2">&#xe694;</text>
  108. </div>
  109. <div class="card-row">
  110. <text>2024-05-09 您有1笔采购订单已经逾期,请立即进行处理!</text>
  111. <text class="font-icons font-icons2">&#xe694;</text>
  112. </div>
  113. </div>
  114. </div>
  115. </view>
  116. </template>
  117. <script>
  118. import {
  119. useSetDictStore
  120. } from '@/stores/useSetDictStore';
  121. import {
  122. useSetWareHouseStore
  123. } from '@/stores/useSetWareHouseStore.js';
  124. export default {
  125. data() {
  126. return {
  127. users: {
  128. nickname: '',
  129. roles: [],
  130. roleStr: ''
  131. }
  132. }
  133. },
  134. mounted() {
  135. this.handleSetDictStore()
  136. this.handleSetWarehousStore()
  137. // 获取用户信息
  138. this.handleGetUserInfo()
  139. },
  140. methods: {
  141. // 获取仓库信息
  142. handleSetWarehousStore() {
  143. const store = useSetWareHouseStore()
  144. store.$reset()
  145. store.getList()
  146. },
  147. // 获取字典数据
  148. handleSetDictStore() {
  149. const store = useSetDictStore()
  150. store.$reset()
  151. store.getList()
  152. },
  153. handleGetUserInfo() {
  154. uni.$reqGet('getMesSystemUserDetails')
  155. .then(({
  156. data
  157. }) => {
  158. uni.setStorageSync('userInfo', JSON.stringify(data))
  159. this.users.nickname = data?.username
  160. this.users.roles = data?.roles
  161. data?.roles.forEach((item, index) => {
  162. if (index === data?.roles.length - 1) {
  163. this.users.roleStr += item.name
  164. } else {
  165. this.users.roleStr += item.name + ', '
  166. }
  167. })
  168. })
  169. }
  170. }
  171. }
  172. </script>
  173. <style lang="scss" scoped>
  174. .home {
  175. width: 100vw;
  176. height: 100vh;
  177. }
  178. .bg-card {
  179. position: fixed;
  180. left: 0%;
  181. top: 0%;
  182. width: 100vw;
  183. height: 100vh;
  184. z-index: 1;
  185. background: linear-gradient(180deg, #2979fe, #fafafb);
  186. }
  187. .title-operation {
  188. position: fixed;
  189. left: 0%;
  190. top: 24px;
  191. z-index: 2;
  192. width: calc(100vw - 24px);
  193. min-height: 75px;
  194. padding: 0 12px;
  195. display: grid;
  196. grid-template-rows: 1fr;
  197. grid-template-columns: 2fr 8fr 1fr;
  198. .user-profilephoto {
  199. display: flex;
  200. justify-content: center;
  201. align-items: center;
  202. img {
  203. width: 55px;
  204. height: 55px;
  205. }
  206. }
  207. .user-detail {
  208. padding: 8px;
  209. display: grid;
  210. grid-template-rows: 1fr 1fr;
  211. grid-template-columns: 1fr;
  212. align-items: center;
  213. .role-style {
  214. // width: calc(100vw - 150px);
  215. overflow: hidden;
  216. white-space: nowrap;
  217. text-overflow: ellipsis;
  218. -o-text-overflow: ellipsis;
  219. }
  220. text {
  221. font-weight: bold;
  222. color: white;
  223. }
  224. text:nth-of-type(1) {
  225. font-size: 16px;
  226. }
  227. }
  228. .user-mess {
  229. display: flex;
  230. justify-content: center;
  231. align-items: center;
  232. color: white;
  233. }
  234. }
  235. .title-panel {
  236. position: fixed;
  237. left: 0%;
  238. top: 120px;
  239. height: 130px;
  240. width: calc(100vw - 12px);
  241. margin: 12px 4px;
  242. border-radius: 6px;
  243. z-index: 3;
  244. box-shadow: 3px 3px 1px 1px #d5dffd;
  245. background-color: white;
  246. .card-title {
  247. height: 46px;
  248. line-height: 46px;
  249. padding: 0 16px;
  250. font-weight: bold;
  251. font-size: 14px;
  252. }
  253. .card-row {
  254. height: 78px;
  255. padding: 0 24px;
  256. display: flex;
  257. justify-content: space-between;
  258. .card-col {
  259. display: grid;
  260. grid-template-rows: 2fr 3fr;
  261. grid-template-columns: 1fr;
  262. align-items: center;
  263. justify-content: center;
  264. >text:nth-of-type(1) {
  265. text-align: center;
  266. font-weight: bold;
  267. font-size: 22px;
  268. }
  269. }
  270. }
  271. }
  272. .content {
  273. width: 100vw;
  274. height: calc(100vh - 330px);
  275. position: fixed;
  276. top: 270px;
  277. left: 0;
  278. z-index: 2;
  279. overflow-y: scroll;
  280. .content-panel {
  281. width: calc(100vw - 12px);
  282. margin: 12px 4px;
  283. border-radius: 6px;
  284. z-index: 3;
  285. box-shadow: 3px 3px 1px 1px #d5dffd;
  286. overflow-y: hidden;
  287. background-color: white;
  288. .card-title {
  289. position: relative;
  290. display: grid;
  291. grid-template-rows: 1fr;
  292. grid-template-columns: 1fr 1fr;
  293. .card-title-left {
  294. height: 30px;
  295. padding: 0 8px;
  296. margin-bottom: 4px;
  297. font-weight: bold;
  298. font-size: 14px;
  299. display: flex;
  300. align-items: flex-end;
  301. }
  302. .card-title-right {
  303. position: absolute;
  304. right: 6px;
  305. top: 10px;
  306. display: flex;
  307. justify-content: center;
  308. align-items: center;
  309. font-size: 12px;
  310. }
  311. }
  312. .card-row {
  313. position: relative;
  314. height: 36px;
  315. line-height: 36px;
  316. padding: 2px 10px 6px 22px;
  317. display: grid;
  318. grid-template-rows: 1fr;
  319. grid-template-columns: 19fr 1fr;
  320. text:nth-of-type(1) {
  321. overflow: hidden;
  322. white-space: nowrap;
  323. text-overflow: ellipsis;
  324. -o-text-overflow: ellipsis;
  325. }
  326. & >uni-text::before {
  327. content: '';
  328. position: absolute;
  329. left: 12px;
  330. top: 17px;
  331. width: 4px;
  332. height: 4px;
  333. border-radius: 50%;
  334. transform: translate(-50%, 0);
  335. background-color: #23a8f2;
  336. z-index: 2;
  337. }
  338. & >uni-text::after {
  339. content: '';
  340. position: absolute;
  341. left: 12px;
  342. top: 15px;
  343. width: 2px;
  344. height: 100%;
  345. transform: translate(-50%, 0);
  346. background-image: linear-gradient(#cfe1fc 50%, rgba(255,255,255,0) 0%); /* 35%设置虚线点x轴上的长度 */
  347. background-position: left; /* top配置上边框位置的虚线 */
  348. background-size: 1.5px 14px; /* 第一个参数设置虚线点的间距;第二个参数设置虚线点y轴上的长度 */
  349. background-repeat: repeat-y;
  350. z-index: 1;
  351. }
  352. }
  353. }
  354. }
  355. .font-icons {
  356. font-size: 12px;
  357. font-weight: bold;
  358. text-align: right;
  359. }
  360. .font-icons2 {
  361. font-size: 12px;
  362. text-align: right;
  363. }
  364. </style>