Sfoglia il codice sorgente

feature/进程&维修站接口数据对标

dy 1 anno fa
parent
commit
0c11552451

+ 13 - 0
src/api/repair/operation.ts

@@ -0,0 +1,13 @@
+import request from "@/utils/request";
+
+/**
+ * 通过id获取物料采集详情
+ *
+ * @param queryParams
+ */
+export function getItemInfo(id: any) {
+  return request({
+    url: "/api/v1/process/itemRecord/recordItemInfo/list/" + `${id}`,
+    method: "get",
+  });
+}

+ 2 - 1
src/store/modules/repair.ts

@@ -5,7 +5,8 @@ export const useRepairStore = defineStore(
     const odersData = ref<any>({});
     const repairInfo = ref<any>({});
     const scanInfo = ref<any>({});
-    return { odersData, repairInfo, scanInfo };
+    const infoData = ref<any>({});
+    return { odersData, repairInfo, scanInfo, infoData };
   },
   {
     //开启持久化存储

+ 5 - 1
src/views/pro-steps/components/operates.vue

@@ -10,18 +10,22 @@
 
     <ReportBreak ref="reportBreakRef" />
     <ReportWork ref="reportWorkRef" />
+    <ReportOutsourcing ref="reportOutsourcing" />
   </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 ReportWork from "@/views/pro-operation/report-work/index.vue";
+import ReportOutsourcing from "@/views/pro-operation/report-outsourcing/index.vue"; // = 报工
 // ================ 报故
 const reportBreakRef = ref<InstanceType<typeof ReportBreak>>();
 
 // ================ 报工
 const reportWorkRef = ref<InstanceType<typeof ReportWork>>();
 
+// ================ 委外
+const reportOutsourcing = ref<InstanceType<typeof ReportOutsourcing>>();
 const router = useRouter();
 
 const selectIndex = ref(0);

+ 9 - 9
src/views/pro-steps/components/wuliaocaiji.vue

@@ -23,7 +23,7 @@
       <svg-icon icon-class="jiaobiao" size="25" class="svgStyle" />
     </div>
   </div>
-  <xiangqingPopUp v-model="showXQ" />
+  <xiangqingPopUp v-model="showXQ" :showInfoData="showInfoData"  :showInfo="showInfo"/>
   <caijiRightPopUp v-model="showCJ" @submit="submit" ref="caijiRef" :seqNo="scanCode" />
 </template>
 
@@ -47,6 +47,10 @@ const store = useProcessStore();
 const scanCode = ref("");
 const showXQ = ref(false);
 const showCJ = ref(false);
+//详情展示数据
+const showInfoData = ref([]);
+const showInfo = ref({});
+//详情展示数据 ↑
 const scanData = ref([]);
 provide("scanData", scanData);
 const enterfnc = async () => {
@@ -69,6 +73,8 @@ const getInfoById = async (item: any) => {
     opId: store.odersData.operationId,
     processId: store.scanInfo.id,
   });
+  showInfoData.value = data;
+  showInfo.value = item;
 };
 const toXQPop = async (item: any) => {
   await getInfoById(item);
@@ -94,15 +100,9 @@ const submit = () => {
 
 //获取tag列表数据
 const getOpCompentData = async () => {
-  // const { data } = await recordList({
-  //   operationId: store.odersData.operationId,
-  //   workOrderCode: store.odersData.workOrderCode,
-  //   pageNo: 1,
-  //   pageSize: 9999,
-  // });
   const { data } = await recordList({
-    operationId: "241",
-    workOrderCode: "GD2404100005",
+    operationId: store.odersData.operationId,
+    workOrderCode: store.odersData.workOrderCode,
     pageNo: 1,
     pageSize: 9999,
   });

+ 1 - 0
src/views/pro-steps/popUpView/caijiRightPopUp.vue

@@ -29,6 +29,7 @@
               </div>
             </div>
           </div>
+          <Empty v-if="scanData.length == 0" />
         </div>
       </el-scrollbar>
       <div class="bottomBtn">

+ 15 - 6
src/views/pro-steps/popUpView/xiangqingPopUp.vue

@@ -4,11 +4,11 @@
       <div class="headerTittle">物料详情</div>
       <div class="infoBox">
         <div class="leftInfo">
-          <div class="titleText">大号螺丝</div>
-          <div class="describeText">100*200</div>
-          <div class="describeText">计划编号:1231231231233</div>
-          <div class="describeText">订单编号:1231231231233</div>
-          <div class="describeText">入库单号:1231231231233</div>
+          <div class="titleText">{{ showInfo.itemName }}</div>
+          <div class="describeText">{{ showInfo.itemModel }}</div>
+          <div class="describeText">计划编号:{{ showInfo.batchNo }}</div>
+          <div class="describeText">订单编号:{{ showInfo.itemName }}</div>
+          <div class="describeText">入库单号:{{ showInfo.itemName }}</div>
         </div>
         <div class="rightBox">
           <div></div>
@@ -21,7 +21,10 @@
       <el-divider />
       <el-scrollbar>
         <div class="body">
-          <div class="info titleText">adadwad</div>
+          <div class="info titleText" v-for="(item, index) in showInfoData" :key="index">
+            adadwad
+          </div>
+          <Empty v-if="showInfoData.length == 0" />
         </div>
       </el-scrollbar>
     </div>
@@ -35,6 +38,12 @@ const props = defineProps({
     type: Boolean,
     default: false,
   },
+  showInfoData: {
+    type: Object,
+  },
+  showInfo: {
+    type: Object,
+  },
 });
 const scanCode = ref("");
 const handleClose = () => {

+ 9 - 2
src/views/repair/components/info.vue

@@ -18,6 +18,9 @@
 </template>
 <script lang="ts" setup>
 import { getEscalationFaultById } from "@/api/repair";
+import { useRepairStore } from "@/store";
+const store = useRepairStore();
+const route = useRoute();
 const ordersDataArray = inject("ordersDataArray");
 const selectOrderIndex = inject("selectOrderIndex");
 const infoData = ref({});
@@ -25,9 +28,9 @@ const showInfoValue = (value: string) => {
   return infoData.value[value];
 };
 const getInfoData = async (id: any) => {
-  console.log(id, "2222");
   const { data } = await getEscalationFaultById(id);
   infoData.value = data;
+  store.infoData = infoData.value;
 };
 const infoTopData = [
   {
@@ -113,7 +116,11 @@ const infoBottomData = [
     value: "disposalMeasures",
   },
 ];
-
+onMounted(() => {
+  if (route.name == "RepairOperation") {
+    infoData.value = store.infoData;
+  }
+});
 watch(selectOrderIndex, () => {
   getInfoData(ordersDataArray.value[selectOrderIndex.value].id);
 });

+ 1 - 1
src/views/repair/main/components/scanCode.vue

@@ -29,7 +29,6 @@ const setInputValue = (value: any) => {
 };
 //扫码开工前获取必要的ids
 const getIds = async () => {
-  console.log(getWorkOrderCode(inputValue.value));
   const { data, code } = await getWorkOrderCode(inputValue.value);
   if (code != "200") {
     return false;
@@ -45,6 +44,7 @@ const getScanData = async () => {
     workOrderCode: store.odersData.workOrderCode,
     //stationId暂时随便传一个
     stationId: 0,
+    source: "repair",
   });
   if (code == "200") {
     store.scanInfo = data;

+ 2 - 1
src/views/repair/main/index.vue

@@ -24,9 +24,10 @@ import Info from "@/views/repair/components/info.vue";
 import CurrentProduction from "@/views/repair/main/components/currentProduction.vue";
 import { getEscalationFaultList, getWorkOrderCode } from "@/api/repair";
 import { useRepairStore } from "@/store";
-const store = useRepairStore();
+
 
 defineOptions({ name: "RepairMain" });
+const store = useRepairStore();
 const ordersDataArray = ref([]);
 const ordersSum = ref(0);
 const selectOrderIndex = ref(NaN);

+ 3 - 1
src/views/repair/operation/components/replacement.vue

@@ -4,7 +4,7 @@
     <ScanCodeInput class="scanBoxInput" v-model="scanCode" />
   </div>
   <el-scrollbar class="scrollbarHeight">
-    <div class="item" v-for="item in 7" @click="openPop">
+    <div class="item" v-for="(item, index) in listData" @click="openPop" :key="index">
       <div class="titleText">1</div>
       <div class="describleText">2</div>
       <div class="bottomText">
@@ -16,6 +16,7 @@
         </div>
       </div>
     </div>
+    <Empty />
   </el-scrollbar>
   <ReplacePop v-model="showStatus" />
 </template>
@@ -23,6 +24,7 @@
 import { getEscalationFaultById } from "@/api/repair";
 import ReplacePop from "@/views/repair/popUpView/replacePop.vue";
 const scanCode = ref("");
+const listData = inject("listData");
 const showStatus = ref(false);
 const openPop = () => {
   showStatus.value = true;

+ 14 - 103
src/views/repair/operation/index.vue

@@ -23,112 +23,23 @@
 import Jiluxiang from "@/views/repair/operation/components/Jiluxiang.vue";
 import Replacement from "@/views/repair/operation/components/replacement.vue";
 import { useRepairStore } from "@/store";
+import { getItemInfo } from "@/api/repair/operation.ts";
 import Info from "@/views/repair/components/info.vue";
-import { getOpCompent } from "@/api/prosteps";
-
-defineOptions({ name: "ProSteps" });
+//此页面这2个变量无使用逻辑 仅为解决警告
+const ordersDataArray = ref({});
+const selectOrderIndex = ref({});
+const listData = ref([]);
 const store = useRepairStore();
-const route = useRoute();
-const router = useRouter();
-const loading = ref(false);
-
-//配置标签信息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",
-  },
-];
-//当前路由在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("/129/12");
-  stepComponents.value = setStepComponents(data);
-  router.replace({ name: stepComponents.value[0].name });
-};
-//设置标签是否被选中
-const setSelectIndex = (index) => {
-  selectIndex.value = index;
-};
-const setSelectTag = () => {
-  const nowRouteName = route.name;
-  stepComponents.value.forEach((item, index) => {
-    if (item.name == nowRouteName) {
-      setSelectIndex(index);
-    }
-  });
+provide("ordersDataArray", ordersDataArray);
+provide("selectOrderIndex", selectOrderIndex);
+const getListInfo = async (id) => {
+  const { data } = await getItemInfo(id);
+  listData.value = data;
 };
-onMounted(async () => {
-  await getOpCompentArray();
-  setSelectTag();
+provide("listData", listData);
+defineOptions({ name: "RepairOperation" });
+onMounted(() => {
+  getListInfo(store.scanInfo.id);
 });
 </script>