order.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <!-- 子订单盒子 -->
  3. <div :class="hoverStatus ? 'body bodyHover ' : 'body'">
  4. <div class="topArea">
  5. <div class="productName">{{ item.materialName }}</div>
  6. <div class="productMsg">
  7. <span :class="hoverStatus ? 'msgName msgNameHover' : 'msgName'">产品型号</span>
  8. <span class="msgValue">{{ item.materialModel }}</span>
  9. </div>
  10. <div class="productMsg">
  11. <span :class="hoverStatus ? 'msgName msgNameHover' : 'msgName'">工单编号</span>
  12. <span class="msgValue">{{ item.workOrderCode }}</span>
  13. </div>
  14. <div class="productMsg">
  15. <span :class="hoverStatus ? 'msgName msgNameHover' : 'msgName'">计划编号</span>
  16. <span class="msgValue">{{ item.orderCode }}</span>
  17. </div>
  18. </div>
  19. <div class="bottomArea">
  20. <div class="bottomBox">
  21. <div class="boxNum">{{ parseInt(item.planNum) }}</div>
  22. <div :class="hoverStatus ? 'boxText boxTextHover' : 'boxText'">
  23. 产品数量
  24. </div>
  25. </div>
  26. <div class="textDivider">
  27. <div class="dividerBox">
  28. <el-divider direction="vertical" style="height: 60%" />
  29. </div>
  30. </div>
  31. <div class="bottomBox">
  32. <div class="boxNum">{{ parseInt(item.planNum) }}</div>
  33. <div :class="hoverStatus ? 'boxText boxTextHover' : 'boxText'">
  34. 主料齐套
  35. </div>
  36. </div>
  37. </div>
  38. <!-- 右下角状态盒子 -->
  39. <div class="statusBox" :style="`background-color:${planStyle(item.workOrderState).bgColor};`">
  40. {{ dictS.getLableByValue("plan_work_order_state", item.workOrderState) }}
  41. </div>
  42. </div>
  43. </template>
  44. <script lang="ts" setup>
  45. import { useDictionaryStore } from "@/store";
  46. const dictS = useDictionaryStore();
  47. defineProps<{
  48. hoverStatus?: boolean;
  49. item: object;
  50. }>();
  51. //工单右下角盒子样式动态控制
  52. const planStyle = (val) => {
  53. let obj = {
  54. bgColor: "#0A59F7",
  55. color: "#FFFFFF",
  56. };
  57. switch (val) {
  58. case "0":
  59. obj.bgColor = "#00FFFF";
  60. break;
  61. case "1":
  62. obj.bgColor = "#FF00FF";
  63. break;
  64. case "2":
  65. obj.bgColor = "#FF8080";
  66. break;
  67. case "3":
  68. obj.bgColor = "#008040";
  69. break;
  70. case "4":
  71. obj.bgColor = "#FF8000";
  72. break;
  73. case "5":
  74. obj.bgColor = "#FF0000";
  75. break;
  76. case "6":
  77. obj.bgColor = "#0A59F7";
  78. break;
  79. default:
  80. break;
  81. }
  82. return obj;
  83. };
  84. </script>
  85. <style lang="scss" scoped>
  86. //盒子间隔在MAR-bottom
  87. .body {
  88. position: relative;
  89. width: 100%;
  90. height: 244px;
  91. border-radius: 16px;
  92. margin-bottom: 10px;
  93. display: flex;
  94. flex-direction: column;
  95. justify-content: space-between;
  96. padding: 15px 0 15px 20px;
  97. background-color: #ffffff;
  98. }
  99. .bodyHover {
  100. background-color: $select-hover;
  101. color: white;
  102. }
  103. .boxTextHover {
  104. color: white !important;
  105. }
  106. .productName {
  107. font-size: $f24;
  108. }
  109. .msgName {
  110. font-size: $f20;
  111. color: $font-default-60;
  112. }
  113. .msgNameHover {
  114. color: white !important;
  115. }
  116. .msgValue {
  117. margin-left: 5px;
  118. font-size: $f20;
  119. }
  120. .bottomArea {
  121. height: 60px;
  122. }
  123. .bottomBox {
  124. width: 80px;
  125. display: inline-block;
  126. }
  127. .textDivider {
  128. display: inline-block;
  129. .dividerBox {
  130. height: 60px;
  131. display: flex;
  132. }
  133. }
  134. .boxNum {
  135. text-align: center;
  136. line-height: 38px;
  137. font-size: $f38;
  138. }
  139. .boxText {
  140. text-align: center;
  141. font-size: $f20;
  142. line-height: 20px;
  143. color: $font-default-60;
  144. }
  145. .statusBox {
  146. position: absolute;
  147. bottom: 0;
  148. right: 0;
  149. width: 90px;
  150. height: 40px;
  151. border-radius: 10px 0 10px 0;
  152. display: flex;
  153. align-items: center;
  154. justify-content: center;
  155. background-color: $select-hover;
  156. font-size: $f20;
  157. }
  158. </style>