order.vue 3.7 KB

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