瀏覽代碼

feature/bug修复

dengrui 10 月之前
父節點
當前提交
1b4ecd3ee8
共有 2 個文件被更改,包括 13 次插入11 次删除
  1. 1 1
      public/version.json
  2. 12 10
      src/views/base/craftManagement/route/components/bottomTable.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "version": "2.3"
+  "version": "2.4"
 }

+ 12 - 10
src/views/base/craftManagement/route/components/bottomTable.vue

@@ -76,7 +76,7 @@ const props = defineProps({
 });
 
 const route = useRoute();
-const tableConfig = getTableConfig(route.params.id);
+const tableConfig = getTableConfig(route.fullPath.split("/")[4]);
 
 // 传入一个url,后面不带/
 const { url, form, data, option, search, page, toDeleteIds, Methords, Utils } =
@@ -97,13 +97,13 @@ const startCreat = () => {
       bomVersion.value = data.value[0].recordVersion;
     }
 
-    if (!route.query.prodtCode) {
+    if (!route.fullPath.split("/")[5]) {
       ElMessage.error("物料编号读取错误");
       return;
     }
     //根据物料编码和版本号获取对应的物料BOM
     let bomParam = {
-      materialCode: route.query.prodtCode,
+      materialCode: route.fullPath.split("/")[5],
     };
     getBomVersion(bomParam).then((res) => {
       let resListMap = [];
@@ -116,7 +116,7 @@ const startCreat = () => {
       });
       //查询参数
       let configParam = {};
-      configParam.materialCode = route.query.prodtCode;
+      configParam.materialCode = route.fullPath.split("/")[5];
       if (bomVersion.value) {
         configParam.bomVersion = bomVersion.value;
       }
@@ -143,7 +143,7 @@ const startCreat = () => {
     commonTableType.value = "ESOP";
     nextTick(() => {
       commonTableRef.value?.startSelect({
-        materialCode: route.query.prodtCode,
+        materialCode: route.fullPath.split("/")[5],
         enable: 1,
       });
     });
@@ -207,8 +207,8 @@ const getSOAPpdf = (itemValue) => {
 };
 
 onMounted(() => {
-  routeId.value = route.query.routeId;
-  search.value.operationId = route.params.id;
+  routeId.value = route.fullPath.split("/")[4];
+  search.value.operationId = route.fullPath.split("/")[4];
   url.value = tableConfig[props.tableType].url;
   option.value = Object.assign(option.value, {
     addBtn: false,
@@ -219,7 +219,7 @@ onMounted(() => {
   });
   dataList();
   getRouteMaxVersion(
-    route.query.routeId ? route.query.routeId : routeId.value
+    route.fullPath.split("/")[4] ? route.fullPath.split("/")[4] : routeId.value
   ).then(({ data }) => {
     if (data) {
       bomVersion.value = data;
@@ -230,7 +230,7 @@ onMounted(() => {
 watch(
   () => props.tableType,
   () => {
-    routeId.value = route.query.routeId;
+    routeId.value = route.fullPath.split("/")[4];
     url.value = tableConfig[props.tableType].url;
     option.value = Object.assign(option.value, {
       addBtn: false,
@@ -241,7 +241,9 @@ watch(
     });
     dataList();
     getRouteMaxVersion(
-      route.query.routeId ? route.query.routeId : routeId.value
+      route.fullPath.split("/")[4]
+        ? route.fullPath.split("/")[4]
+        : routeId.value
     ).then(({ data }) => {
       if (data) {
         bomVersion.value = data;