dy 1 год назад
Родитель
Сommit
4517824939

+ 1 - 1
.env.development

@@ -13,7 +13,7 @@ VITE_APP_UPLOAD_URL = 'http://192.168.101.4:9000'
 # 线上接口地址
 # VITE_APP_API_URL = http://vapi.youlai.tech
 # 开发接口地址
- VITE_APP_API_URL = 'http://192.168.101.4:8079'
+ VITE_APP_API_URL = 'http://192.168.101.30:8079'
 
 ``
 # 是否启用 Mock 服务

+ 9 - 0
src/api/prosteps/wuliaocaiji.ts

@@ -35,3 +35,12 @@ export function itemRecordAdd(data: any) {
     data: data,
   });
 }
+
+//获取采集详情
+export function getInfo(data: any) {
+  return request({
+    url: `/api/v1/process/itemRecord/itemInfo/list`,
+    method: "post",
+    data,
+  });
+}

+ 8 - 0
src/api/repair/index.ts

@@ -22,3 +22,11 @@ export function getEscalationFaultList(data: any) {
     data,
   });
 }
+
+//开工前获取序列号 WQId
+export function getWorkOrderCode(seqNo: any) {
+  return request({
+    url: "/api/v1/process/escalationFault/getWorkOrderCode/" + `${seqNo}`,
+    method: "get",
+  });
+}

Разница между файлами не показана из-за своего большого размера
+ 1 - 0
src/assets/icons/zanwusuju.svg


+ 15 - 0
src/components/Empty/index.vue

@@ -0,0 +1,15 @@
+<template>
+  <el-empty :description="description" :image="emptyImage" />
+</template>
+
+<script setup lang="ts">
+import { ref } from "vue";
+import EmptyImageSvg from "@/assets/icons/zanwusuju.svg";
+defineProps({
+  description: {
+    type: String,
+    default: "暂无数据",
+  },
+});
+const emptyImage = ref(EmptyImageSvg);
+</script>

+ 0 - 2
src/utils/request.ts

@@ -26,7 +26,6 @@ service.interceptors.request.use(
 service.interceptors.response.use(
   (response: AxiosResponse) => {
     const { code, msg } = response.data;
-
     if (code === "200") {
       return response.data;
     }
@@ -62,7 +61,6 @@ service.interceptors.response.use(
     return Promise.reject(error.message);
   }
 );
-
 // 导出 axios 实例
 export default service;
 

+ 15 - 13
src/views/pro-steps/components/wuliaocaiji.vue

@@ -35,6 +35,7 @@ import {
   recordList,
   searchMaterial,
   itemRecordAdd,
+  getInfo,
 } from "@/api/prosteps/wuliaocaiji";
 import { useProcessStore } from "@/store";
 
@@ -49,30 +50,32 @@ const showCJ = ref(false);
 const scanData = ref([]);
 provide("scanData", scanData);
 const enterfnc = async () => {
-  // const { code, data } = await searchMaterial({
-  //   operationId: store.odersData.operationId,
-  //   processId: "",
-  //   seqNo: scanCode.value,
-  //   workOrderCode: store.odersData.workOrderCode,
-  // });
   const { code, data } = await searchMaterial({
-    operationId: "242",
-    processId: "14",
-    seqNo: "1202010000005",
-    workOrderCode: "GD2404150002",
+    operationId: store.odersData.operationId,
+    processId: store.scanInfo.id,
+    seqNo: scanCode.value,
+    workOrderCode: store.odersData.workOrderCode,
   });
   if (code == "200") {
-    scanData.value = [...data, ...data];
+    scanData.value = data;
     showCJ.value = true;
   }
 };
 const opCompentDataList = ref([]);
+//通过id获取详情
+const getInfoById = async (item: any) => {
+  const { data } = await getInfo({
+    itemCode: item.itemCode,
+    opId: store.odersData.operationId,
+    processId: store.scanInfo.id,
+  });
+};
 const toXQPop = async (item: any) => {
+  await getInfoById(item);
   showXQ.value = true;
 };
 //提交录入信息
 const submitRecordAdd = async (index) => {
-  console.log(index, "222");
   const { data } = await itemRecordAdd({
     itemCode: "242",
     itemModel: "14",
@@ -86,7 +89,6 @@ const submitRecordAdd = async (index) => {
 };
 const submit = () => {
   let selectIndex = caijiRef.value.selectIndex;
-  console.log(selectIndex);
   submitRecordAdd(selectIndex);
 };
 

+ 2 - 0
src/views/pro-steps/index.vue

@@ -22,6 +22,7 @@
             </div>
           </el-scrollbar>
         </div>
+        <Empty v-if="stepComponents.length == 0" />
         <div class="routerView">
           <el-scrollbar>
             <router-view v-slot="{ Component, route }">
@@ -182,6 +183,7 @@ onMounted(async () => {
   overflow-y: auto;
   width: 100%;
   height: calc(100vh - 184px);
+  padding-top: $p20;
 }
 
 .typeBox {

+ 8 - 8
src/views/pro-steps/popUpView/caijiRightPopUp.vue

@@ -41,16 +41,16 @@
 
 <script lang="ts" setup>
 const emits = defineEmits(["update:modelValue", "submit"]);
-const props = defineProps<{
+const props = defineProps({
   modelValue: {
-    type: Boolean;
-    default: false;
-  };
+    type: Boolean,
+    default: false,
+  },
   seqNo: {
-    type: String;
-    default: "";
-  };
-}>();
+    type: String,
+    default: "",
+  },
+});
 const selectIndex = ref();
 const setSelectIndex = (index: number) => {
   selectIndex.value = index;

+ 5 - 5
src/views/pro-steps/popUpView/xiangqingPopUp.vue

@@ -30,12 +30,12 @@
 
 <script lang="ts" setup>
 const emits = defineEmits(["update:modelValue"]);
-const props = defineProps<{
+const props = defineProps({
   modelValue: {
-    type: Boolean;
-    default: false;
-  };
-}>();
+    type: Boolean,
+    default: false,
+  },
+});
 const scanCode = ref("");
 const handleClose = () => {
   emits("update:modelValue", false);

+ 2 - 1
src/views/process/components/currentOrderInfo.vue

@@ -1,5 +1,4 @@
 <template>
-  <!-- 当前订单板块 -->
   <div class="commonTitle">当前订单</div>
   <div class="body">
     <div class="box">
@@ -94,6 +93,8 @@ import { reactive, ref } from "vue";
         line-height: 60px;
         position: absolute;
         bottom: 1px;
+        width: 100%;
+        text-align: center;
       }
     }
 

+ 0 - 1
src/views/process/components/operate.vue

@@ -1,5 +1,4 @@
 <template>
-  <!-- 操作板块 -->
   <div class="commonTitle">操作</div>
   <div class="body">
     <div class="operateBox">

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

@@ -20,11 +20,12 @@
 import { getEscalationFaultById } from "@/api/repair";
 const ordersDataArray = inject("ordersDataArray");
 const selectOrderIndex = inject("selectOrderIndex");
-const infoData = ref({  });
+const infoData = ref({});
 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;
 };
@@ -114,7 +115,7 @@ const infoBottomData = [
 ];
 
 watch(selectOrderIndex, () => {
-  getInfoData(ordersDataArray[selectOrderIndex].id);
+  getInfoData(ordersDataArray.value[selectOrderIndex.value].id);
 });
 </script>
 

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

@@ -3,7 +3,7 @@
   <el-scrollbar class="barHeight">
     <Order v-for="(item, index) in ordersDataArray" :key="index" @click="setSlectIndex(index)"
       :hoverStatus="index == selectIndex ? true : false" :item="item" />
-    <el-empty v-if="!ordersDataArray" description="暂无数据" />
+    <Empty v-if="ordersDataArray.length < 1" />
   </el-scrollbar>
 </template>
 <script lang="ts" setup>

+ 29 - 17
src/views/repair/main/components/scanCode.vue

@@ -12,32 +12,44 @@
 <script lang="ts" setup>
 import ScanCodeInput from "@/components/ScanCodeInput/index.vue";
 import { useRepairStore } from "@/store";
-
-
+import { getWorkOrderCode } from "@/api/repair";
 import { getScan } from "@/api/process";
 const store = useRepairStore();
 const router = useRouter();
-const inputValue = ref("12020100000052404100011");
-const toProSteps = () => {
+const inputValue = ref("");
+const toProSteps = async () => {
   store.odersData.qrCode = inputValue.value;
-  getScanData();
+  const res = await getIds();
+  if (res) {
+    getScanData();
+  }
 };
 const setInputValue = (value: any) => {
   inputValue.value = value;
 };
+//扫码开工前获取必要的ids
+const getIds = async () => {
+  console.log(getWorkOrderCode(inputValue.value));
+  const { data, code } = await getWorkOrderCode(inputValue.value);
+  if (code != "200") {
+    return false;
+  }
+  store.odersData.operationId = data.operationId;
+  store.odersData.workOrderCode = data.workOrderCode;
+  return true;
+};
 const getScanData = async () => {
-  // const { code, data, msg } = await getScan({
-  //   operationId: Number(store.odersData.operationId),
-  //   qrCode: store.odersData.qrCode,
-  //   workOrderCode: store.odersData.workOrderCode,
-  //   //stationId暂时随便传一个
-  //   stationId: 1,
-  // });
-  // if (code == "200") {
-  //   store.scanInfo = data;
-  //   router.push({ path: "/pro-steps" });
-  // }
-  router.push({ path: "/repair/operation" });
+  const { code, data, msg } = await getScan({
+    operationId: store.odersData.operationId,
+    qrCode: store.odersData.qrCode,
+    workOrderCode: store.odersData.workOrderCode,
+    //stationId暂时随便传一个
+    stationId: 0,
+  });
+  if (code == "200") {
+    store.scanInfo = data;
+    router.push({ path: "/repair/operation" });
+  }
 };
 </script>
 

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

@@ -22,7 +22,7 @@
 import Orders from "@/views/repair/main/components/orders.vue";
 import Info from "@/views/repair/components/info.vue";
 import CurrentProduction from "@/views/repair/main/components/currentProduction.vue";
-import { getEscalationFaultList } from "@/api/repair";
+import { getEscalationFaultList, getWorkOrderCode } from "@/api/repair";
 import { useRepairStore } from "@/store";
 const store = useRepairStore();
 

+ 1 - 1
vite.config.ts

@@ -112,7 +112,7 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
           }),
         ],
         // 指定自定义组件位置(默认:src/components)
-        dirs: ["src/components", "src/**/components"],
+        dirs: ["src/components"],
         // 指定自动导入组件TS类型声明文件路径 (false:关闭自动生成)
         dts: false,
         // dts: "src/typings/components.d.ts",