index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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.reLaunch({
  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. .page-container {
  119. height: calc(100% - 208rpx);
  120. overflow: auto;
  121. }
  122. .logo-container {
  123. justify-content: center;
  124. .logo {
  125. width: 120rpx;
  126. height: 120rpx;
  127. }
  128. }
  129. .title {
  130. align-items: center;
  131. .label {
  132. font-size: 40rpx;
  133. font-weight: bold;
  134. }
  135. }
  136. .user-info-container {
  137. margin: 16rpx 0 20rpx 20rpx;
  138. .icon {
  139. width: 120rpx;
  140. height: 120rpx;
  141. justify-content: center;
  142. align-items: center;
  143. border-radius: 60rpx;
  144. border: 1px solid #e1e1e1;
  145. .label {
  146. font-size: 64rpx;
  147. }
  148. }
  149. .user-info {
  150. margin-left: 8rpx;
  151. justify-content: center;
  152. // font-size: 20rpx;
  153. .nickname {
  154. margin-bottom: 16rpx;
  155. .label {
  156. font-weight: bold;
  157. font-size: 32rpx;
  158. }
  159. }
  160. .process {
  161. .label {
  162. font-size: 32rpx;
  163. }
  164. }
  165. }
  166. .data-select {
  167. flex: 3;
  168. width: 100%;
  169. height: 50rpx;
  170. border-radius: 18rpx;
  171. background-color: #FFF;
  172. .data-select-options {
  173. width: 200rpx;
  174. }
  175. }
  176. }
  177. .business-btn {
  178. margin: 0 20rpx 20rpx 20rpx;
  179. background-color: #fff;
  180. height: 200rpx;
  181. width: 94%;
  182. border-radius: 4;
  183. align-items: center;
  184. justify-content: center;
  185. border: 1px solid #e1e1e1;
  186. border-radius: 8rpx;
  187. .label {
  188. font-size: 40rpx;
  189. }
  190. }
  191. .bottom-btn-container {
  192. position: fixed;
  193. right: 20rpx;
  194. bottom: 0;
  195. left: 20rpx;
  196. .start-batch-btn {
  197. // background-color: grey;
  198. background-color: #1684fc;
  199. margin-bottom: 24rpx;
  200. border-radius: 8rpx;
  201. justify-content: center;
  202. align-items: center;
  203. height: 80rpx;
  204. .label {
  205. font-size: 32rpx;
  206. color: #ffffff;
  207. }
  208. }
  209. }
  210. </style>