index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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: 24rpx">ID:</text><text class="label"
  12. style="margin-left: 6rpx">{{ 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="user-info uni-column" style="margin: 0 20rpx 20rpx 20rpx;width: 94%;">
  19. <uni-section title="当前厂别" type="line">
  20. <uni-data-select v-model="userInfo.tenantId" :localdata="tenantList"
  21. @change="handleTenantChange"></uni-data-select>
  22. </uni-section>
  23. </view>
  24. <view class="business-btn uni-row" @click="handleRecerptSfprod"><text class="label">半成品接收</text></view>
  25. <view class="business-btn uni-row" @click="handleToProductionPlan"><text class="label">报工</text></view>
  26. <view class="business-btn uni-row" @click="handleToHandlingList"><text class="label">周转</text></view>
  27. <view class="bottom-btn-container">
  28. <view class="start-batch-btn uni-row"><text class="label" @click="handleToEquiPmentList">绑定设备</text></view>
  29. <view class="start-batch-btn uni-row" @click="handleSwitchOrQuit"><text class="label">切换 / 退出账号</text>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script setup>
  35. import {
  36. ref
  37. } from 'vue'
  38. import {
  39. onLoad,
  40. onReady
  41. } from '@dcloudio/uni-app'
  42. import {
  43. getSubPlanDetailsList
  44. } from '../../api/business/subPlanDetails'
  45. import {
  46. getTenantList,
  47. getDeptName
  48. } from '@/api/login/index.js'
  49. import {
  50. store
  51. } from '@/store/index.js'
  52. const deptName = ref('')
  53. const name = ref('')
  54. const userName = ref('')
  55. const userId = ref(null)
  56. const userInfo = ref({})
  57. const tenantList = ref([])
  58. onLoad(() => {
  59. userInfo.value = store.userInfo || {
  60. nickName: ""
  61. };
  62. store.tenantId = userInfo.value.tenantId
  63. getDepartmentName()
  64. getTenant()
  65. })
  66. function handleRecerptSfprod() {
  67. uni.navigateTo({
  68. url: '/pages/recerptSfprod/index'
  69. })
  70. }
  71. function handleToProductionPlan() {
  72. uni.navigateTo({
  73. url: '/pages/productionPlan/index'
  74. })
  75. }
  76. function handleToHandlingList() {
  77. uni.navigateTo({
  78. url: '/pages/handlingList/index'
  79. })
  80. }
  81. function handleSwitchOrQuit() {
  82. uni.navigateTo({
  83. url: '/pages/index/index'
  84. })
  85. }
  86. function handleToEquiPmentList() {
  87. uni.navigateTo({
  88. url: "/pages/equipmentList/index"
  89. })
  90. }
  91. function getDepartmentName() {
  92. getDeptName(userInfo.value.userId).then((res) => {
  93. if (res.code == 200) {
  94. deptName.value = res.msg
  95. }
  96. })
  97. }
  98. function getTenant() {
  99. getTenantList().then((res) => {
  100. if (res.code == 200) {
  101. tenantList.value = res.rows
  102. console.log(tenantList.value)
  103. for (var i = 0; i < res.rows.length; i++) {
  104. tenantList.value[i] = {
  105. text: res.rows[i].orgName,
  106. value: res.rows[i].id
  107. }
  108. }
  109. }
  110. })
  111. }
  112. function handleTenantChange() {
  113. store.tenantId = userInfo.value.tenantId
  114. console.log(store.tenantId)
  115. }
  116. </script>
  117. <style lang="scss">
  118. .logo-container {
  119. justify-content: center;
  120. .logo {
  121. width: 120rpx;
  122. height: 120rpx;
  123. }
  124. }
  125. .title {
  126. align-items: center;
  127. .label {
  128. font-size: 40rpx;
  129. font-weight: bold;
  130. }
  131. }
  132. .user-info-container {
  133. margin: 64rpx 0 20rpx 20rpx;
  134. .icon {
  135. width: 120rpx;
  136. height: 120rpx;
  137. justify-content: center;
  138. align-items: center;
  139. border-radius: 60rpx;
  140. border: 1px solid #e1e1e1;
  141. .label {
  142. font-size: 64rpx;
  143. }
  144. }
  145. .user-info {
  146. margin-left: 8rpx;
  147. justify-content: center;
  148. // font-size: 20rpx;
  149. .nickname {
  150. margin-bottom: 16rpx;
  151. .label {
  152. font-weight: bold;
  153. font-size: 32rpx;
  154. }
  155. }
  156. .process {
  157. .label {
  158. font-size: 32rpx;
  159. }
  160. }
  161. }
  162. .data-select {
  163. flex: 3;
  164. width: 100%;
  165. height: 50rpx;
  166. border-radius: 18rpx;
  167. background-color: #FFF;
  168. .data-select-options {
  169. width: 200rpx;
  170. }
  171. }
  172. }
  173. .business-btn {
  174. margin: 0 20rpx 20rpx 20rpx;
  175. background-color: #fff;
  176. height: 200rpx;
  177. width: 94%;
  178. border-radius: 4;
  179. align-items: center;
  180. justify-content: center;
  181. border: 1px solid #e1e1e1;
  182. border-radius: 8rpx;
  183. .label {
  184. font-size: 40rpx;
  185. }
  186. }
  187. .bottom-btn-container {
  188. position: fixed;
  189. right: 20rpx;
  190. bottom: 0;
  191. left: 20rpx;
  192. .start-batch-btn {
  193. // background-color: grey;
  194. background-color: #1684fc;
  195. margin-bottom: 24rpx;
  196. border-radius: 8rpx;
  197. justify-content: center;
  198. align-items: center;
  199. height: 80rpx;
  200. .label {
  201. font-size: 32rpx;
  202. color: #ffffff;
  203. }
  204. }
  205. }
  206. </style>