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.

175 lines
3.4 KiB

4 months ago
4 months ago
4 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
3 months ago
4 months ago
3 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 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>生产订单入库</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: "passed",
  34. label: "生产入库",
  35. iconClass: "qualified",
  36. to: "/productionInboundRegister",
  37. disabled: false,
  38. },
  39. {
  40. icon: "revoke",
  41. label: "生产退库",
  42. iconClass: "qualified",
  43. to: "/productionWithdrawalOrderList",
  44. disabled: false,
  45. },
  46. ],
  47. };
  48. },
  49. methods: {
  50. handleButtonClick(btn) {
  51. if (btn.disabled) {
  52. this.$message.warning("正在开发中,敬请期待...");
  53. } else {
  54. this.$router.push(btn.to);
  55. }
  56. },
  57. },
  58. };
  59. </script>
  60. <style>
  61. :root {
  62. --columns: 3;
  63. --button-size: calc(100vw / var(--columns) - 20px);
  64. }
  65. /* 头部栏 */
  66. .header-bar {
  67. display: flex;
  68. justify-content: space-between;
  69. align-items: center;
  70. padding: 8px 16px;
  71. background: #17b3a3;
  72. color: white;
  73. height: 40px;
  74. min-height: 40px;
  75. max-height: 40px;
  76. }
  77. .header-left {
  78. display: flex;
  79. align-items: center;
  80. cursor: pointer;
  81. font-size: 16px;
  82. font-weight: 500;
  83. }
  84. .header-left i {
  85. margin-right: 8px;
  86. font-size: 18px;
  87. }
  88. .header-right {
  89. cursor: pointer;
  90. font-size: 16px;
  91. font-weight: 500;
  92. }
  93. .menu-grid {
  94. display: grid;
  95. grid-template-columns: repeat(3, 1fr);
  96. gap: 15px;
  97. padding: 20px;
  98. justify-content: center; /* 水平居中 */
  99. align-content: center; /* 垂直居中 */
  100. width: 100%; /* 确保占满容器宽度 */
  101. }
  102. .menu-item {
  103. background: white;
  104. border-radius: 12px;
  105. padding: 12px 6px;
  106. text-align: center;
  107. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  108. transition: transform 0.2s;
  109. cursor: pointer;
  110. }
  111. .menu-item:active {
  112. transform: scale(0.95);
  113. }
  114. .menu-item.disabled {
  115. opacity: 0.6;
  116. position: relative;
  117. }
  118. .menu-item.disabled::after {
  119. content: "开发中";
  120. position: absolute;
  121. top: 8px;
  122. right: 8px;
  123. background: #ff9500;
  124. color: white;
  125. font-size: 8px;
  126. padding: 2px 4px;
  127. border-radius: 8px;
  128. font-weight: bold;
  129. }
  130. .menu-icon {
  131. width: 38px;
  132. height: 38px;
  133. border-radius: 50%;
  134. display: flex;
  135. align-items: center;
  136. justify-content: center;
  137. margin: 0 auto 6px;
  138. color: white;
  139. }
  140. .menu-icon.purchase {
  141. background: linear-gradient(135deg, #17b3a3 0%, #1dc5ef 100%);
  142. }
  143. .menu-icon.inspection {
  144. background: linear-gradient(135deg, #17b3a3 0%, #1dc5ef 100%);
  145. }
  146. .menu-icon.qualified {
  147. background: linear-gradient(135deg, #17b3a3 0%, #1dc5ef 100%);
  148. }
  149. .menu-text {
  150. font-size: 10px;
  151. color: #333;
  152. font-weight: bold; /* 加粗字体 */
  153. white-space: nowrap; /* 防止文字换行 */
  154. overflow: hidden;
  155. text-overflow: ellipsis;
  156. margin-top: 2px;
  157. }
  158. </style>