123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637 |
- `
- <template>
- <div style="position: relative">
- <div class="headerInfo">
- <!-- <div
- class="titleText"
- style="
- width: 300px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- "
- >
- {{ store.processInfo.materialName }} -
- {{ store.processInfo.materialModel }}
- </div>
- <div class="info">
- <div class="item">
- 当前工序:
- {{
- store.scanInfo.operationName ? store.scanInfo.operationName : "-"
- }}
- </div>
- <div class="item">
- 下一工位:{{
- store.scanInfo.nextStation ? store.scanInfo.nextStation : "-"
- }}
- </div>
- <div class="item">
- 卡号:{{ store.scanInfo.seqNo ? store.scanInfo.seqNo : "-" }}
- </div>
- <div class="item">
- 编码:{{
- store.scanInfo.materialCode ? store.scanInfo.materialCode : "-"
- }}
- </div>
- </div> -->
- </div>
- <div class="mainContentBox">
- <el-row :gutter="20">
- <el-col :span="4" class="boxStyle">
- <div class="productInfo" @click="openPop">
- <template v-if="taskIndex != null">
- <div
- class="productitleText"
- style="font-size: 500; font-size: 24px"
- >
- {{ taskArray[taskIndex].materialName }}
- </div>
- <div
- class="productitleText"
- style="
- color: #ffffff60;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- "
- >
- {{ taskArray[taskIndex].materialModel }}
- </div>
- <div style="display: flex">
- <div class="productitleText" style="color: #ffffff60">S/N</div>
- <div class="productitleText">
- {{ snVal ? snVal : "-" }}
- </div>
- </div>
- </template>
- <template v-else>
- <div
- class="productitleText"
- style="
- font-size: 500;
- font-size: 24px;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100%;
- "
- >
- 请选择产品
- </div>
- </template>
- </div>
- <!-- 侧边栏盒子 -->
- <div class="commonTitle">工序</div>
- <el-scrollbar
- style="height: calc(100vh - 220px); padding-bottom: 60px"
- >
- <Steps
- v-if="opsArray.length > 0"
- :opsArray="opsArray"
- @init="init"
- />
- <template v-else>
- <div
- class="productitleText"
- style="
- font-size: 500;
- font-size: 24px;
- display: flex;
- height: calc(100vh - 280px);
- justify-content: center;
- align-items: center;
- background-color: var(--ohos-area-bg);
- border-radius: 16px;
- color: white;
- "
- >
- 暂无工序
- </div>
- </template>
- </el-scrollbar>
- </el-col>
- <el-col :span="20">
- <div class="typeContainer">
- <el-scrollbar>
- <div style="display: flex">
- <div
- v-for="(item, index) in stepComponents"
- :key="index"
- class="scrollbar-demo-item"
- >
- <router-link :to="{ name: item.name }" replace>
- <div
- :class="getNameClass(index)"
- class="typeBox"
- @click="setSelectIndex(index)"
- >
- <div class="svgIcon">
- <svg-icon :icon-class="item.iconName" size="30" />
- </div>
- <div class="name">{{ item.compentName }}</div>
- </div>
- </router-link>
- </div>
- <div
- v-if="snVal == null && taskIndex == null"
- style="
- font-size: 40px;
- font-weight: 500;
- color: white;
- width: 100%;
- height: 80px;
- text-align: center;
- line-height: 80px;
- "
- >
- 请先选择工序
- </div>
- <div
- v-else-if="snVal == null"
- style="
- font-size: 40px;
- font-weight: 500;
- color: white;
- width: 100%;
- height: 80px;
- text-align: center;
- line-height: 80px;
- "
- >
- 请选择其他工序
- </div>
- </div>
- </el-scrollbar>
- </div>
- <div :key="key" class="routerView" v-if="snVal != null">
- <el-scrollbar style="width: 100%">
- <router-view v-slot="{ Component, route }">
- <keep-alive
- include="Dianjian,Jiluxiang,Duomeiticaiji,Esop,Jingu,Mingpaibangding,Shebeijilu,Tiaoshipipei,Wuliaocaiji,Screwdriver"
- >
- <component :is="Component" :key="route.fullPath" />
- </keep-alive>
- </router-view>
- </el-scrollbar>
- </div>
- </el-col>
- </el-row>
- </div>
- <div class="midPopUp" v-if="popStatus" @click.stop="popStatus = false">
- <div class="popView">
- <div class="hang">
- 请扫码:
- <ScanCodeInput
- style="width: 400px"
- v-model="seqVal"
- @keyup.enter="console.log(111)"
- />
- </div>
- <el-divider class="dark" content-position="center"
- ><div
- style="
- background-color: var(--ohos-area-bg);
- width: 100%;
- height: 100%;
- display: flex;
- font-size: 20px;
- padding: 0 20px;
- color: white;
- font-weight: 500;
- "
- >
- 选择近期产品
- </div></el-divider
- >
- <el-scrollbar style="height: calc(100vh - 220px)">
- <div class="taskBox">
- <div
- class="productInfo"
- :key="item + index"
- style="background-color: var(--ohos-area-active-bg)"
- v-for="(item, index) in taskArray"
- @click="selectProduct(index)"
- >
- <div
- class="productitleText"
- style="font-size: 500; font-size: 24px; color: #000000"
- >
- {{ item.materialName }}
- </div>
- <div
- class="productitleText"
- style="
- color: #00000060;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- width: 20vw;
- "
- >
- {{ item.materialModel }}
- </div>
- <div style="display: flex">
- <div class="productitleText" style="color: #00000060">Code</div>
- <div class="productitleText" style="color: #000000">
- {{ item.materialCode }}
- </div>
- </div>
- </div>
- </div>
- </el-scrollbar>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- import OperationBar from "@/views/pro-steps/operationBar.vue";
- import ScanCodeInput from "@/components/ScanCodeInput/index.vue";
- import Steps from "@/views/process/components/steps.vue";
- import { useProcessStore } from "@/store";
- import { getOpCompent } from "@/api/prosteps";
- import { getOrders } from "@/api/process";
- import { getScan } from "@/api/process";
- defineOptions({
- name: "ProSteps",
- });
- const popStatus = ref(null);
- const openPop = async () => {
- await getTaskArray();
- popStatus.value = true;
- };
- const seqVal = ref("");
- const snVal = ref(null);
- const selectProduct = async (index) => {
- taskIndex.value = index;
- selectIndex.value = 0;
- //设置数据
- store.odersData.workOrderCode =
- taskArray.value[taskIndex.value].workOrderCode;
- store.processInfo.materialName =
- taskArray.value[taskIndex.value].materialName;
- store.processInfo.materialModel =
- taskArray.value[taskIndex.value].materialModel;
- if (taskArray.value[taskIndex.value].ops.length > 0) {
- opsArray.value = taskArray.value[taskIndex.value].ops;
- selectStepIndex.value = 0;
- snVal.value =
- taskArray.value[taskIndex.value].ops[selectStepIndex.value].seqs.length >
- 0
- ? taskArray.value[taskIndex.value].ops[selectStepIndex.value].seqs[0]
- .seqNo
- : null;
- } else {
- selectStepIndex.value = null;
- ElMessage.warning("暂无操作步骤");
- }
- if (snVal.value != null) {
- await init(0);
- } else {
- ElMessage.warning("当前工序暂不可操作");
- }
- popStatus.value = false;
- };
- const store = useProcessStore();
- store.odersData.productLineId = 10;
- const taskArray = ref([]);
- const taskIndex = ref(null);
- const getScanData = async () => {
- const value = snVal.value;
- const res = await getScan({
- operationId: Number(
- taskArray.value[taskIndex.value].ops[selectStepIndex.value].operationId
- ),
- qrCode: value,
- workOrderCode: taskArray.value[taskIndex.value].workOrderCode,
- //stationId暂时随便传一个
- stationId: 1,
- });
- if (res) {
- const { code, data, msg } = res;
- if (code == "200") {
- store.scanInfo = data;
- store.useSeqNo = data.seqNo;
- }
- return true;
- } else {
- snVal.value = null;
- stepComponents.value = [];
- router.replace({ name: "ProSteps" });
- return false;
- }
- };
- const getTaskArray = async () => {
- const { data } = await getOrders({
- pageNo: 1,
- pageSize: 999999999,
- queryComplete: 0,
- });
- taskArray.value = data.records;
- };
- const opsArray = ref([]);
- const selectStepIndex = ref(null);
- provide("selectStepIndex", selectStepIndex);
- const key = ref(false);
- const route = useRoute();
- const router = useRouter();
- const instance = getCurrentInstance();
- const loading = ref(false);
- const recondOPId = ref(null);
- const qrCode = ref(null);
- //配置标签信息Data
- const stepComponents = ref([]);
- const defaultComponents = [
- {
- compentName: "物料采集",
- iconName: "wuliaocaiji",
- path: "wuliaocaiji",
- name: "Wuliaocaiji",
- },
- {
- compentName: "记录项",
- iconName: "jiluxiang",
- path: "jiluxiang",
- name: "Jiluxiang",
- },
- {
- compentName: "多媒体采集",
- iconName: "duomeiticaiji",
- path: "duomeiticaiji",
- name: "Duomeiticaiji",
- },
- {
- compentName: "ESOP",
- iconName: "ESOP",
- path: "esop",
- name: "Esop",
- },
- {
- compentName: "点检",
- iconName: "dianjian",
- path: "dianjian",
- name: "Dianjian",
- },
- {
- compentName: "设备记录",
- iconName: "shebeijilu",
- path: "shebeijilu",
- name: "Shebeijilu",
- },
- {
- compentName: "紧固",
- iconName: "jingu",
- path: "jingu",
- name: "Jingu",
- },
- {
- compentName: "调试配对",
- iconName: "tiaoshipipei",
- path: "tiaoshipipei",
- name: "Tiaoshipipei",
- },
- {
- compentName: "铭牌绑定",
- iconName: "mingpai",
- path: "mingpaibangding",
- name: "Mingpaibangding",
- },
- {
- compentName: "测试记录",
- iconName: "mingpai",
- path: "ceshijilu",
- name: "Ceshijilu",
- },
- {
- compentName: "工序表单",
- iconName: "mingpai",
- path: "execl",
- name: "Excel",
- },
- {
- compentName: "数据采集",
- iconName: "mingpai",
- path: "screwdriver",
- name: "Screwdriver",
- },
- ];
- //当前路由在setpComponents中的index
- const selectIndex = ref(0);
- //配置data固定路由参数等
- const setStepComponents = (data) => {
- let resData = [];
- data.forEach((item) => {
- defaultComponents.forEach((obj) => {
- if (item.compentName === obj.compentName) {
- resData.push({ ...item, ...obj });
- }
- });
- });
- return resData;
- };
- const getNameClass = (index) => {
- return index === selectIndex.value ? "typeBoxSelected" : "typeBoxNormal";
- };
- //获取当前tags列表
- const getOpCompentArray = async () => {
- const { data } = await getOpCompent(
- "/" +
- `${Number(
- taskArray.value[taskIndex.value].ops[selectStepIndex.value].operationId
- )}` +
- "/" +
- `${store.scanInfo.id}`
- );
- stepComponents.value = setStepComponents(data);
- router.replace({ name: stepComponents.value[selectIndex.value].name });
- };
- //设置标签是否被选中
- const setSelectIndex = (index) => {
- selectIndex.value = index;
- };
- const init = async (index) => {
- if (taskIndex.value == null) {
- return;
- }
- selectStepIndex.value = index != null ? index : 0;
- //数据设置
- store.odersData.operationId =
- taskArray.value[taskIndex.value].ops[selectStepIndex.value].operationId;
- store.processInfo.operationCode =
- taskArray.value[taskIndex.value].ops[selectStepIndex.value].operationCode;
- store.processInfo.operationName =
- taskArray.value[taskIndex.value].ops[selectStepIndex.value].operationName;
- snVal.value =
- taskArray.value[taskIndex.value].ops[selectStepIndex.value].seqs.length > 0
- ? taskArray.value[taskIndex.value].ops[selectStepIndex.value].seqs[0]
- .seqNo
- : null;
- if (snVal.value != null) {
- const res = await getScanData();
- if (res == true) {
- await getOpCompentArray();
- }
- } else {
- stepComponents.value = [];
- ElMessage.warning("当前工序暂不可操作");
- }
- };
- onActivated(async () => {
- //缓存组件数据逻辑
- init(selectStepIndex.value);
- });
- </script>
- <style lang="scss" scoped>
- :deep(.el-input__wrapper) {
- background-color: #000;
- }
- .boxStyle {
- height: calc(100vh - 80px);
- .commonTitle {
- color: var(--ohos-text);
- font-size: 28px;
- }
- }
- .productInfo {
- width: 100%;
- height: 100px;
- margin-bottom: 10px;
- border-radius: 16px;
- background-color: var(--ohos-area-bg);
- padding: 10px 20px;
- cursor: pointer;
- .productitleText {
- color: white;
- }
- }
- .optionBox {
- height: calc(100vh - 150px);
- background-color: var(--ohos-area-bg);
- border-radius: 16px;
- }
- .headerInfo {
- height: 20px;
- width: calc(100vw - 40px);
- // padding: 10px;
- // margin: 0 20px;
- // display: flex;
- // justify-content: space-between;
- // align-items: center;
- // border-radius: 16px;
- // border-right: 0px;
- // border-left: 0px;
- // box-sizing: border-box;
- // margin-bottom: 10px;
- // background-color: white;
- .info {
- display: flex;
- flex-shrink: 0;
- .item {
- margin: 0 5px;
- font-size: 14px;
- font-weight: 300;
- }
- }
- }
- .scrollbar-demo-item {
- flex-shrink: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- height: 80px;
- width: 135px;
- border-radius: 16px;
- text-align: center;
- background-color: var(--ohos-box-bg);
- margin-right: 10px;
- }
- .typeContainer {
- width: 100%;
- height: 80px;
- overflow-x: auto;
- .svgIcon {
- @include flex;
- }
- }
- .mainContentBox {
- height: calc(100vh - 110px);
- }
- .routerView {
- display: flex;
- flex: 1;
- overflow-y: auto;
- width: 100%;
- height: calc(100vh - 214px);
- margin-top: 20px;
- background-color: #ffffff20 !important;
- padding: 0 20px;
- border-radius: 16px;
- }
- .typeBox {
- height: 80px;
- width: 135px;
- border-radius: 16px;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- .name {
- height: 16px;
- font-weight: 500;
- font-size: $f20;
- line-height: 20px;
- text-align: center;
- font-style: normal;
- text-transform: none;
- margin-top: $p10;
- }
- }
- .typeBoxNormal {
- background: transparent;
- color: var(--ohos-text);
- }
- .typeBoxSelected {
- background-color: var(--ohos-area-active-bg);
- color: black !important;
- }
- :deep(.el-divider__text) {
- padding: 0px;
- }
- .popView {
- width: 80%;
- display: flex;
- flex-direction: column;
- height: 80%;
- background-color: var(--ohos-area-bg);
- border-radius: 16px;
- padding: 20px;
- .hang {
- display: flex;
- align-items: center;
- color: white;
- font-size: 20px;
- }
- .taskBox {
- display: grid;
- grid-template-columns: repeat(3, 1fr); /* 每行 3 列 */
- gap: 20px; /* 设置间距为 20px */
- }
- }
- </style>
|