index.vue 5.1 KB

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