index.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view class="page-container uni-column">
  3. <view class="logo-container uni-row">
  4. <image class="logo" src="../../static/images/logo.png" />
  5. </view>
  6. <view class="title"><text class="label">德迈仕数字生产线管理平台</text></view>
  7. <view class="user-info-container uni-row">
  8. <view class="icon"><text class="label">{{ userInfo.nickName.charAt(0) }}</text></view>
  9. <view class="user-info uni-column">
  10. <view class="nickname uni-row"><text class="label">{{ userInfo.userName }}</text><text class="label"
  11. style="margin-left: 12rpx">ID</text><text class="label"
  12. style="margin-left: 8rpx">{{ userInfo.userId }}</text>
  13. </view>
  14. <view class="process uni-row"><text class="label">当前工段:</text><text class="label">{{ deptName }}</text>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="business-btn uni-row" @click="handleToRecerptSfprod"><text class="label">半成品接收</text></view>
  19. <view class="business-btn uni-row" @click="handleToProductionPlan"><text class="label">报工</text></view>
  20. <view class="business-btn uni-row" @click="handleToHandlingList"><text class="label">周转</text></view>
  21. <view class="bottom-btn-container">
  22. <view class="start-batch-btn uni-row"><text class="label" @click="handleToEquiPmentList">绑定设备</text></view>
  23. <view class="start-batch-btn uni-row" @click="handleSwitchOrQuit"><text class="label">切换 / 退出账号</text>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script setup>
  29. import {
  30. ref
  31. } from 'vue'
  32. import {
  33. onLoad,
  34. onReady
  35. } from '@dcloudio/uni-app'
  36. import {
  37. getSubPlanDetailsList
  38. } from '../../api/business/subPlanDetails'
  39. import {
  40. getDeptName
  41. } from '@/api/login/index.js'
  42. import { store } from '@/store/index.js'
  43. const deptName = ref('')
  44. const name = ref('')
  45. const userName = ref('')
  46. const userId = ref(null)
  47. const userInfo = ref({})
  48. onLoad((options) => {
  49. userInfo.value = store.userInfo || {
  50. nickName: ""
  51. };
  52. console.log(userInfo.value)
  53. getDepartmentName()
  54. })
  55. const handleToRecerptSfprod = () => {
  56. uni.navigateTo({
  57. url: '/pages/recerptSfprod/index'
  58. })
  59. }
  60. const handleToProductionPlan = () => {
  61. uni.navigateTo({
  62. url: '/pages/productionPlan/index'
  63. })
  64. }
  65. const handleToHandlingList = () => {
  66. uni.navigateTo({
  67. url: '/pages/handlingList/index'
  68. })
  69. }
  70. const handleSwitchOrQuit = () => {
  71. uni.navigateTo({
  72. url: '/pages/index/index'
  73. })
  74. }
  75. function handleToEquiPmentList() {
  76. uni.navigateTo({
  77. url: "/pages/equipmentList/index"
  78. })
  79. }
  80. function getDepartmentName() {
  81. getDeptName(userInfo.value.userId).then((res) => {
  82. if (res.code == 200) {
  83. deptName.value = res.msg
  84. }
  85. })
  86. }
  87. </script>
  88. <style lang="scss">
  89. .logo-container {
  90. justify-content: center;
  91. .logo {
  92. width: 120rpx;
  93. height: 120rpx;
  94. }
  95. }
  96. .title {
  97. align-items: center;
  98. .label {
  99. font-size: 40rpx;
  100. font-weight: bold;
  101. }
  102. }
  103. .user-info-container {
  104. margin: 64rpx 0 40rpx 8rpx;
  105. .icon {
  106. width: 120rpx;
  107. height: 120rpx;
  108. justify-content: center;
  109. align-items: center;
  110. border-radius: 60rpx;
  111. border: 1px solid #e1e1e1;
  112. .label {
  113. font-size: 64rpx;
  114. }
  115. }
  116. .user-info {
  117. margin-left: 8rpx;
  118. justify-content: center;
  119. // font-size: 20rpx;
  120. .nickname {
  121. margin-bottom: 16rpx;
  122. .label {
  123. font-weight: bold;
  124. font-size: 32rpx;
  125. }
  126. }
  127. .process {
  128. .label {
  129. font-size: 32rpx;
  130. }
  131. }
  132. }
  133. }
  134. .business-btn {
  135. margin: 0 20rpx 20rpx 20rpx;
  136. background-color: #fff;
  137. height: 200rpx;
  138. border-radius: 4;
  139. align-items: center;
  140. justify-content: center;
  141. border: 1px solid #e1e1e1;
  142. border-radius: 8rpx;
  143. .label {
  144. font-size: 40rpx;
  145. }
  146. }
  147. .bottom-btn-container {
  148. position: fixed;
  149. right: 20rpx;
  150. bottom: 0;
  151. left: 20rpx;
  152. .start-batch-btn {
  153. background-color: grey;
  154. margin-bottom: 24rpx;
  155. border-radius: 8rpx;
  156. justify-content: center;
  157. align-items: center;
  158. height: 80rpx;
  159. .label {
  160. font-size: 32rpx;
  161. color: #ffffff;
  162. }
  163. }
  164. }
  165. </style>