index.vue 3.9 KB

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