index.vue 5.1 KB

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