You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
3.4 KiB

6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
1 month ago
4 months ago
4 months ago
4 months ago
1 month ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
6 months ago
4 months ago
  1. <template>
  2. <div class="pda-container">
  3. <div class="header-bar">
  4. <div class="header-left" @click="$router.back()">
  5. <i class="el-icon-arrow-left"></i>
  6. <span>MR 发料</span>
  7. </div>
  8. <div class="header-right" @click="$router.push({ path: '/' })">首页</div>
  9. </div>
  10. <!-- 功能菜单 -->
  11. <div class="menu-grid">
  12. <div
  13. class="menu-item"
  14. v-for="(btn, index) in buttons"
  15. :key="index"
  16. :class="{ disabled: btn.disabled }"
  17. @click="handleButtonClick(btn)"
  18. >
  19. <div class="menu-icon" :class="btn.iconClass">
  20. <van-icon :name="btn.icon" size="24" />
  21. </div>
  22. <div class="menu-text">{{ btn.label }}</div>
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. export default {
  29. data() {
  30. return {
  31. buttons: [
  32. {
  33. icon: "scan",
  34. label: "MR发料",
  35. iconClass: "purchase",
  36. to: "mrPicking",
  37. disabled: false,
  38. },
  39. /* MR没有退料 */
  40. /* {
  41. icon: "records",
  42. label: "MR退料",
  43. iconClass: "qualified",
  44. to: "mrPickingReturn",
  45. disabled: false,
  46. }, */
  47. ],
  48. };
  49. },
  50. methods: {
  51. handleButtonClick(btn) {
  52. if (btn.disabled) {
  53. this.$message.warning("正在开发中,敬请期待...");
  54. } else {
  55. this.$router.push(btn.to);
  56. }
  57. },
  58. },
  59. };
  60. </script>
  61. <style>
  62. :root {
  63. --columns: 3;
  64. --button-size: calc(100vw / var(--columns) - 20px);
  65. }
  66. /* 头部栏 */
  67. .header-bar {
  68. display: flex;
  69. justify-content: space-between;
  70. align-items: center;
  71. padding: 8px 16px;
  72. background: #17b3a3;
  73. color: white;
  74. height: 40px;
  75. min-height: 40px;
  76. max-height: 40px;
  77. }
  78. .header-left {
  79. display: flex;
  80. align-items: center;
  81. cursor: pointer;
  82. font-size: 16px;
  83. font-weight: 500;
  84. }
  85. .header-left i {
  86. margin-right: 8px;
  87. font-size: 18px;
  88. }
  89. .header-right {
  90. cursor: pointer;
  91. font-size: 16px;
  92. font-weight: 500;
  93. }
  94. .menu-grid {
  95. display: grid;
  96. grid-template-columns: repeat(3, 1fr);
  97. gap: 15px;
  98. padding: 20px;
  99. justify-content: center; /* 水平居中 */
  100. align-content: center; /* 垂直居中 */
  101. width: 100%; /* 确保占满容器宽度 */
  102. }
  103. .menu-item {
  104. background: white;
  105. border-radius: 12px;
  106. padding: 12px 6px;
  107. text-align: center;
  108. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  109. transition: transform 0.2s;
  110. cursor: pointer;
  111. }
  112. .menu-item:active {
  113. transform: scale(0.95);
  114. }
  115. .menu-item.disabled {
  116. opacity: 0.6;
  117. position: relative;
  118. }
  119. .menu-item.disabled::after {
  120. content: "开发中";
  121. position: absolute;
  122. top: 8px;
  123. right: 8px;
  124. background: #ff9500;
  125. color: white;
  126. font-size: 8px;
  127. padding: 2px 4px;
  128. border-radius: 8px;
  129. font-weight: bold;
  130. }
  131. .menu-icon {
  132. width: 38px;
  133. height: 38px;
  134. border-radius: 50%;
  135. display: flex;
  136. align-items: center;
  137. justify-content: center;
  138. margin: 0 auto 6px;
  139. color: white;
  140. }
  141. .menu-icon.purchase {
  142. background: linear-gradient(135deg, #17b3a3 0%, #1dc5ef 100%);
  143. }
  144. .menu-icon.inspection {
  145. background: linear-gradient(135deg, #17b3a3 0%, #1dc5ef 100%);
  146. }
  147. .menu-icon.qualified {
  148. background: linear-gradient(135deg, #17b3a3 0%, #1dc5ef 100%);
  149. }
  150. .menu-text {
  151. font-size: 10px;
  152. color: #333;
  153. font-weight: bold; /* 加粗字体 */
  154. white-space: nowrap; /* 防止文字换行 */
  155. overflow: hidden;
  156. text-overflow: ellipsis;
  157. margin-top: 2px;
  158. }
  159. </style>