123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <template>
- <div class="containerBox">
- <div
- v-for="(item, index) in stepComponents"
- :key="index"
- :class="selectIndex == index ? 'operator active' : 'operator'"
- @click="setIndex(index)"
- >
- <div class="operatorText">{{ item.compentName }}</div>
- <div class="operatorIcon">
- <svg-icon :icon-class="item.compentType" size="45" />
- </div>
- </div>
- <ReportBreak ref="reportBreakRef" />
- <ReportWork ref="reportWorkRef" />
- </div>
- </template>
- <script lang="ts" setup>
- import ReportBreak from "@/views/pro-operation/report-break/index.vue"; // ================ 报故
- import ReportWork from "@/views/pro-operation/report-work/index.vue";
- import { useProcessStore } from "@/store";
- const store = useProcessStore();
- // ================ 报故
- const reportBreakRef = ref<InstanceType<typeof ReportBreak>>();
- // ================ 报工
- const reportWorkRef = ref<InstanceType<typeof ReportWork>>();
- const router = useRouter();
- const selectIndex = ref(null);
- const setIndex = (index: number) => {
- // selectIndex.value = index;
- switch (stepComponents.value[index].compentType) {
- case "baogu":
- reportBreakRef.value?.openReportBreakDrawer();
- break;
- case "jiaoliao":
- router.push({ name: "call-materiel" });
- break;
- case "gongweishangliao":
- router.push({ name: "station-up-material" });
- break;
- case "liuzhuan":
- router.push({ name: "material-flow" });
- break;
- case "tuzhi":
- router.push({ name: "drawing-list" });
- break;
- case "weiwai":
- router.push({ name: "appoint-out" });
- break;
- case "fangong":
- router.push({ name: "rework" });
- break;
- case "tichu":
- router.push({ name: "remove" });
- break;
- case "baogong":
- reportWorkRef.value?.openReportWorkDrawer();
- break;
- case "xunjian":
- router.push({ name: "checkOut" });
- break;
- case "printboard":
- router.push({ name: "printing-plate" });
- break;
- case "pdmfile":
- router.push({ name: "pdmfile" });
- break;
- default:
- break;
- }
- };
- const stepComponents = ref([
- // {
- // compentName: "叫料",
- // compentType: "jiaoliao",
- // },
- // {
- // compentName: "物料流转",
- // compentType: "liuzhuan",
- // },
- {
- compentName: "图纸",
- compentType: "tuzhi",
- },
- {
- compentName: "委外",
- compentType: "weiwai",
- },
- {
- compentName: "报故",
- compentType: "baogu",
- },
- {
- compentName: "报工",
- compentType: "baogong",
- },
- {
- compentName: "返工",
- compentType: "fangong",
- },
- {
- compentName: "剔除",
- compentType: "tichu",
- },
- {
- compentName: "印刷板",
- compentType: "printboard",
- },
- ]);
- const setComponents = () => {
- if (store.scanInfo.inspection == 1 || store.scanInfo.firstCheck == 1) {
- stepComponents.value = stepComponents.value.filter(
- (item) => item.compentName !== "检验"
- );
- stepComponents.value.push({
- compentName: "检验",
- compentType: "xunjian",
- });
- }
- if (store.processInfo.documentShow == 1) {
- stepComponents.value = stepComponents.value.filter(
- (item) => item.compentName !== "PDM文档"
- );
- stepComponents.value.push({
- compentName: "PDM文档",
- compentType: "pdmfile",
- });
- }
- if (
- store.odersData.operationType == "SX" ||
- store.odersData.operationType == "RX"
- ) {
- stepComponents.value = stepComponents.value.filter(
- (item) => item.compentName !== "返工"
- );
- }
- };
- onMounted(() => {
- setComponents();
- });
- onActivated(() => {
- setComponents();
- });
- </script>
- <style lang="scss" scoped>
- .containerBox {
- width: 100%;
- font-weight: $Medium;
- .operator {
- width: 100%;
- height: 88px;
- border-radius: 16px;
- background-color: white;
- margin-bottom: 20px;
- display: flex;
- padding: 20px;
- justify-content: space-between;
- align-items: center;
- .operatorText {
- font-size: $f24;
- }
- .operatorIcon {
- font-weight: 800;
- }
- }
- }
- .active {
- background-color: #64bb5c !important;
- color: white;
- }
- </style>
|