index.vue 5.4 KB

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