Bladeren bron

信息添加

dengrui 2 maanden geleden
bovenliggende
commit
9dfcdec5e8
2 gewijzigde bestanden met toevoegingen van 95 en 98 verwijderingen
  1. 86 55
      src/views/pro-steps/index.vue
  2. 9 43
      src/views/process/components/steps.vue

+ 86 - 55
src/views/pro-steps/index.vue

@@ -39,12 +39,27 @@
     <div class="mainContentBox">
       <el-row :gutter="20">
         <el-col :span="4" class="boxStyle">
+          <div class="productInfo">
+            <div
+              class="productitleText"
+              style="font-size: 500; font-size: 24px"
+            >
+              卫星通导模块
+            </div>
+            <div class="productitleText" style="color: #ffffff60">
+              ASF-ASFA-ASD-FAS
+            </div>
+            <div style="display: flex">
+              <div class="productitleText" style="color: #ffffff60">S/N</div>
+              <div class="productitleText">&nbsp;202501020215421532</div>
+            </div>
+          </div>
           <!-- 侧边栏盒子 -->
           <div class="commonTitle">工序</div>
           <el-scrollbar
-            style="height: calc(100vh - 120px); padding-bottom: 60px"
+            style="height: calc(100vh - 220px); padding-bottom: 60px"
           >
-            <Steps :opsArray="opsArray" />
+            <Steps :opsArray="opsArray" @init="init" />
           </el-scrollbar>
         </el-col>
         <el-col :span="20">
@@ -111,38 +126,38 @@ store.processInfo = {
   operationCode: "XFOP-0015",
   operationName: "装配",
 };
-store.scanInfo = {
-  batchReport: 1,
-  changeWhen: null,
-  created: "2025-03-03 17:18:26",
-  creator: "admin",
-  currentState: "start",
-  deptId: "1",
-  id: "347",
-  materialCode: "51264341413213",
-  materialModel: "1S043-17(B)_60051S043T1_1S043-17(B)底遮板弹星发射天线(再入)",
-  materialName: "底遮板弹星发射天线",
-  nextStation: "调试工位-2",
-  offLine: 0,
-  operationId: 536,
-  operationName: "装配",
-  operator: "admin",
-  orderCode: "DD2503010003",
-  orderId: "64",
-  orgId: "1",
-  outsource: 0,
-  realEndWhen: null,
-  realStartWhen: "2025-03-03 17:18:26",
-  repairId: "0",
-  reworkId: "0",
-  seqNo: "10.25.0021-0001",
-  stanId: "54",
-  totalTime: "0",
-  updated: "2025-03-03 17:18:26",
-  updator: "admin",
-  workOrderCode: "10.25.0021",
-  workOrderId: "158",
-};
+// store.scanInfo = {
+//   batchReport: 1,
+//   changeWhen: null,
+//   created: "2025-03-03 17:18:26",
+//   creator: "admin",
+//   currentState: "start",
+//   deptId: "1",
+//   id: "347",
+//   materialCode: "51264341413213",
+//   materialModel: "1S043-17(B)_60051S043T1_1S043-17(B)底遮板弹星发射天线(再入)",
+//   materialName: "底遮板弹星发射天线",
+//   nextStation: "调试工位-2",
+//   offLine: 0,
+//   operationId: 536,
+//   operationName: "装配",
+//   operator: "admin",
+//   orderCode: "DD2503010003",
+//   orderId: "64",
+//   orgId: "1",
+//   outsource: 0,
+//   realEndWhen: null,
+//   realStartWhen: "2025-03-03 17:18:26",
+//   repairId: "0",
+//   reworkId: "0",
+//   seqNo: "10.25.0021-0001",
+//   stanId: "54",
+//   totalTime: "0",
+//   updated: "2025-03-03 17:18:26",
+//   updator: "admin",
+//   workOrderCode: "10.25.0021",
+//   workOrderId: "158",
+// };
 store.useSeqNo = "10.25.0021-0001";
 const opsArray = [
   {
@@ -464,39 +479,55 @@ const getOpCompentArray = async () => {
 const setSelectIndex = (index) => {
   selectIndex.value = index;
 };
+const init = async () => {
+  console.log("111");
+  // if (recondOPId.value == null || qrCode.value == null) {
+  //   //相当于首次进入该路由
+  //   await getOpCompentArray();
+  // } else {
+  //   if (
+  //     recondOPId.value != store.odersData.operationId ||
+  //     qrCode.value != store.scanInfo.seqNo
+  //   ) {
+  //     //当发生改变时
+  //     setSelectIndex(0);
+  //     await getOpCompentArray();
+  //     key.value = !key.value;
+  //   } else {
+  //     await getOpCompentArray();
+  //     if (
+  //       !instance.devtoolsRawSetupState.router.options.history.state.forward
+  //     ) {
+  //       key.value = !key.value;
+  //     }
+  //   }
+  // }
+};
 onActivated(async () => {
   //缓存组件数据逻辑
-  if (recondOPId.value == null || qrCode.value == null) {
-    //相当于首次进入该路由
-    await getOpCompentArray();
-  } else {
-    if (
-      recondOPId.value != store.odersData.operationId ||
-      qrCode.value != store.scanInfo.seqNo
-    ) {
-      //当发生改变时
-      setSelectIndex(0);
-      await getOpCompentArray();
-      key.value = !key.value;
-    } else {
-      await getOpCompentArray();
-      if (
-        !instance.devtoolsRawSetupState.router.options.history.state.forward
-      ) {
-        key.value = !key.value;
-      }
-    }
-  }
+  init();
 });
 </script>
 
 <style lang="scss" scoped>
 .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;
+    .productitleText {
+      color: white;
+    }
+  }
 }
 .optionBox {
   height: calc(100vh - 150px);

+ 9 - 43
src/views/process/components/steps.vue

@@ -65,53 +65,24 @@
   </div>
 </template>
 
-<script lang="ts" setup>
+<script setup>
 import { useProcessStore } from "@/store";
-import { emitter, EventsNames } from "@/utils/common";
 import { getScan } from "@/api/process";
-import { Transition } from "vue";
-import { Translation } from "vue-i18n";
 const store = useProcessStore();
-const selectSeqArray = inject("selectSeqArray");
-const ordersDataArray = inject("ordersDataArray");
-const props = defineProps<{
-  opsArray?: object;
-}>();
+const props = defineProps({
+  opsArray: Object,
+});
+const emit = defineEmits(["init"]);
 //步骤显示index
 const router = useRouter();
-const selectStepIndex = ref(1);
-const selectedOderStatus = inject("selectedOderStatus");
-const selectOrderIndex = inject("selectOrderIndex");
-const centerDialogVisible = ref(false);
-const emitFnc = () => {
-  emitter.emit(EventsNames.PROCESS_STEPOBJ, {
-    index: selectStepIndex.value,
-  });
-};
-emitter.on(EventsNames.PROCESS_STEPINDEX, (val: any) => {
-  selectStepIndex.value = val;
-});
-emitter.on(EventsNames.PROCESS_REDER, () => {
-  selectStepIndex.value = null;
-});
-// const setStepIndex = () => {
-//   for (let i = 0; i < props.opsArray.length; i++) {
-//     if (props.opsArray[i].opComplete == false) {
-//       selectStepIndex.value = i;
-//       return;
-//     }
-//   }
-// };
+const selectStepIndex = ref(0);
+
 const boxClick = (item, index) => {
-  if (item.exists != true) return;
-  selectSeqArray.value =
-    ordersDataArray.value[selectOrderIndex.value].ops[index].seqs;
   store.odersData.operationId = item.operationId;
   store.processInfo.operationCode = item.operationCode;
   store.processInfo.operationName = item.operationName;
   selectStepIndex.value = index;
-  emitFnc();
-  // centerDialogVisible.value = true;
+  emit("init");
 };
 const getScanData = async () => {
   try {
@@ -126,10 +97,7 @@ const getScanData = async () => {
       store.scanInfo = data;
       router.push({ path: "/pro-steps" });
     }
-  } catch {
-  } finally {
-    centerDialogVisible.value = false;
-  }
+  } catch {}
 };
 </script>
 
@@ -158,11 +126,9 @@ const getScanData = async () => {
 .stepBoxHover {
   box-shadow: 0px 0px 0px 0px;
   background-color: var(--ohos-area-active-bg);
-  
 }
 
 .stepExistsHover {
-
   cursor: not-allowed;
 }