operates.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <div class="containerBox">
  3. <div
  4. v-for="(item, index) in stepComponents"
  5. :key="index"
  6. :class="selectIndex == index ? 'operator active' : 'operator'"
  7. @click="setIndex(index)"
  8. >
  9. <div class="operatorText">{{ item.compentName }}</div>
  10. <div class="operatorIcon">
  11. <svg-icon :icon-class="item.compentType" size="45" />
  12. </div>
  13. </div>
  14. <ReportBreak ref="reportBreakRef" />
  15. <ReportWork ref="reportWorkRef" />
  16. </div>
  17. </template>
  18. <script lang="ts" setup>
  19. import ReportBreak from "@/views/pro-operation/report-break/index.vue"; // ================ 报故
  20. import ReportWork from "@/views/pro-operation/report-work/index.vue";
  21. import { useProcessStore } from "@/store";
  22. const store = useProcessStore();
  23. // ================ 报故
  24. const reportBreakRef = ref<InstanceType<typeof ReportBreak>>();
  25. // ================ 报工
  26. const reportWorkRef = ref<InstanceType<typeof ReportWork>>();
  27. const router = useRouter();
  28. const selectIndex = ref(null);
  29. const setIndex = (index: number) => {
  30. // selectIndex.value = index;
  31. switch (stepComponents.value[index].compentType) {
  32. case "baogu":
  33. reportBreakRef.value?.openReportBreakDrawer();
  34. break;
  35. case "jiaoliao":
  36. router.push({ name: "call-materiel" });
  37. break;
  38. case "gongweishangliao":
  39. router.push({ name: "station-up-material" });
  40. break;
  41. case "liuzhuan":
  42. router.push({ name: "material-flow" });
  43. break;
  44. case "tuzhi":
  45. router.push({ name: "drawing-list" });
  46. break;
  47. case "weiwai":
  48. router.push({ name: "appoint-out" });
  49. break;
  50. case "fangong":
  51. router.push({ name: "rework" });
  52. break;
  53. case "tichu":
  54. router.push({ name: "remove" });
  55. break;
  56. case "baogong":
  57. reportWorkRef.value?.openReportWorkDrawer();
  58. break;
  59. case "xunjian":
  60. router.push({ name: "checkOut" });
  61. break;
  62. case "printboard":
  63. router.push({ name: "printing-plate" });
  64. break;
  65. case "pdmfile":
  66. router.push({ name: "pdmfile" });
  67. break;
  68. default:
  69. break;
  70. }
  71. };
  72. const stepComponents = ref([
  73. // {
  74. // compentName: "叫料",
  75. // compentType: "jiaoliao",
  76. // },
  77. // {
  78. // compentName: "物料流转",
  79. // compentType: "liuzhuan",
  80. // },
  81. {
  82. compentName: "图纸",
  83. compentType: "tuzhi",
  84. },
  85. {
  86. compentName: "委外",
  87. compentType: "weiwai",
  88. },
  89. {
  90. compentName: "报故",
  91. compentType: "baogu",
  92. },
  93. {
  94. compentName: "报工",
  95. compentType: "baogong",
  96. },
  97. {
  98. compentName: "返工",
  99. compentType: "fangong",
  100. },
  101. {
  102. compentName: "剔除",
  103. compentType: "tichu",
  104. },
  105. {
  106. compentName: "印刷板",
  107. compentType: "printboard",
  108. },
  109. ]);
  110. const setComponents = () => {
  111. if (store.scanInfo.inspection == 1 || store.scanInfo.firstCheck == 1) {
  112. stepComponents.value = stepComponents.value.filter(
  113. (item) => item.compentName !== "检验"
  114. );
  115. stepComponents.value.push({
  116. compentName: "检验",
  117. compentType: "xunjian",
  118. });
  119. }
  120. if (store.processInfo.documentShow == 1) {
  121. stepComponents.value = stepComponents.value.filter(
  122. (item) => item.compentName !== "PDM文档"
  123. );
  124. stepComponents.value.push({
  125. compentName: "PDM文档",
  126. compentType: "pdmfile",
  127. });
  128. }
  129. if (
  130. store.odersData.operationType == "SX" ||
  131. store.odersData.operationType == "RX"
  132. ) {
  133. stepComponents.value = stepComponents.value.filter(
  134. (item) => item.compentName !== "返工"
  135. );
  136. }
  137. };
  138. onMounted(() => {
  139. setComponents();
  140. });
  141. onActivated(() => {
  142. setComponents();
  143. });
  144. </script>
  145. <style lang="scss" scoped>
  146. .containerBox {
  147. width: 100%;
  148. font-weight: $Medium;
  149. .operator {
  150. width: 100%;
  151. height: 88px;
  152. border-radius: 16px;
  153. background-color: white;
  154. margin-bottom: 20px;
  155. display: flex;
  156. padding: 20px;
  157. justify-content: space-between;
  158. align-items: center;
  159. .operatorText {
  160. font-size: $f24;
  161. }
  162. .operatorIcon {
  163. font-weight: 800;
  164. }
  165. }
  166. }
  167. .active {
  168. background-color: #64bb5c !important;
  169. color: white;
  170. }
  171. </style>