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