Browse Source

JLHWEB: 1、修复床垫报价新建时,新建床网后的垫层数据异常问题
2、床垫清单,明细名称下拉宽度跟随输入框宽度
3、优化标签页生成逻辑,处理成复制报价操作后标签页转变详情页

JohnnyChan 6 ngày trước cách đây
mục cha
commit
0f5999482c

+ 1 - 1
JLHWEB/src/enums/dwnameEnum.ts

@@ -145,7 +145,7 @@ export enum DwnameEnum {
   /**
    * @description 床垫接口-主体内容
    */
-  mattressInterfaceDetail = "u_mattress_interface_zt",
+  mattressInterfaceDetail = "u_mattress_interface",
   /**
    * @description 床垫接口清单
    */

+ 85 - 83
JLHWEB/src/layouts/components/Tabs/index.vue

@@ -58,6 +58,7 @@ import MoreButton from "./components/MoreButton.vue";
 
 const route = useRoute();
 const router = useRouter();
+console.log("router !!!!!!!!!!!!!!!!!!!!!!!!!!:>> ", router);
 const tabStore = useTabsStore();
 const authStore = useAuthStore();
 const globalStore = useGlobalStore();
@@ -84,91 +85,92 @@ watch(
   () => route.fullPath,
   () => {
     if (route.meta.isFull) return;
+
     console.log("watch route :>> ", route);
     tabsMenuValue.value = route.fullPath;
-    const tabsParams = {
-      icon: route.meta.icon as string,
-      title: route.meta.title as string,
-      path: route.fullPath,
-      name: route.name as string,
-      close: !route.meta.isAffix
-    };
-    console.log("tabStore :>> ", tabStore, route);
-    console.log("tabsParams :>> ", tabsParams, route);
-    let isReplace = false;
-    // console.log(
-    //   'tabsParams.path.indexOf("/edit?") > -1 , :>> ',
-    //   tabsParams.path.indexOf("/edit?") > -1,
-    //   tabsParams.path.indexOf("/edit/") > -1
-    // );
-    // console.log(
-    //   'tabsParams.path.indexOf("/detail?") > -1 , :>> ',
-    //   tabsParams.path.indexOf("/detail?") > -1,
-    //   tabsParams.path.indexOf("/detail/") > -1
-    // );
-    if (tabsParams.path.indexOf("/edit?") > -1 || tabsParams.path.indexOf("/edit/") > -1) {
-      let key = "/edit?";
-      let name = "";
-      let _path = tabsParams.path.replace(key, "/detail?");
-      // 使用路由参数的地址,忽略查询参数后,查找相同地址
-      let _path2 = tabsParams.path.replace("/edit/", "/detail/");
-      let hasPath1 = route.fullPath.indexOf("/edit?") > -1;
-      let hasPath2 = route.fullPath.indexOf("/edit/") > -1;
-      let tabsMenuList = tabStore.tabsMenuList;
-      for (let i = 0; i < tabsMenuList.length; i++) {
-        if (
-          (hasPath1 && tabsMenuList[i].path == _path) ||
-          (hasPath2 && tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0])
-        ) {
-          name = tabsMenuList[i].name;
-          tabsMenuList[i] = tabsParams;
-          isReplace = true;
-          break;
-        }
-      }
-      console.log("keilll name edit:>> ", name);
-      tabStore.setTabs(tabsMenuList);
-      name && keepAliveStore.updateKeepAliveName(route);
-      // route.meta.isKeepAlive && keepAliveStore.updateKeepAliveName(route);
-    } else if (tabsParams.path.indexOf("/detail?") > -1 || tabsParams.path.indexOf("/detail/") > -1) {
-      let key = "/detail?";
-      let name = "";
-      let _path = tabsParams.path.replace(key, "/edit?");
-      // 使用路由参数的地址,忽略查询参数后,查找相同地址
-      let _path2 = tabsParams.path.replace("/detail/", "/edit/");
-      let hasPath1 = route.fullPath.indexOf("/detail?") > -1;
-      let hasPath2 = route.fullPath.indexOf("/detail/") > -1;
-      let tabsMenuList = tabStore.tabsMenuList;
-      for (let i = 0; i < tabsMenuList.length; i++) {
-        if (
-          (hasPath1 && tabsMenuList[i].path == _path) ||
-          (hasPath2 && tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0])
-        ) {
-          // console.log(
-          //   " (hasPath2 && tabsMenuList[i].path.split('?)[0] == _path2.split('?')[0])",
-          //   tabsMenuList[i].path,
-          //   _path,
-          //   tabsMenuList[i].path == _path,
-          //   hasPath2,
-          //   tabsMenuList[i].path.split("?")[0],
-          //   _path2.split("?")[0],
-          //   tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0],
-          //   tabsMenuList[i]
-          // );
-          name = tabsMenuList[i].name;
-          tabsMenuList[i] = tabsParams;
-          isReplace = true;
-          break;
-        }
-      }
-      tabStore.setTabs(tabsMenuList);
-      console.log("keilll name detail:>> ", name);
-      name && keepAliveStore.updateKeepAliveName(route);
-      // route.meta.isKeepAlive && keepAliveStore.addKeepAliveName(route);
-      console.log("add keepAliveStore.keepAliveName :>> ", keepAliveStore.keepAliveName);
-    }
-    !isReplace && tabStore.addTabs(tabsParams);
-    !isReplace && route.meta.isKeepAlive && keepAliveStore.addKeepAliveName(route);
+    // const tabsParams = {
+    //   icon: route.meta.icon as string,
+    //   title: route.meta.title as string,
+    //   path: route.fullPath,
+    //   name: route.name as string,
+    //   close: !route.meta.isAffix
+    // };
+    // console.log("tabStore :>> ", tabStore, route);
+    // console.log("tabsParams router:>> ", tabsParams, router);
+    // let isReplace = false;
+    // // console.log(
+    // //   'tabsParams.path.indexOf("/edit?") > -1 , :>> ',
+    // //   tabsParams.path.indexOf("/edit?") > -1,
+    // //   tabsParams.path.indexOf("/edit/") > -1
+    // // );
+    // // console.log(
+    // //   'tabsParams.path.indexOf("/detail?") > -1 , :>> ',
+    // //   tabsParams.path.indexOf("/detail?") > -1,
+    // //   tabsParams.path.indexOf("/detail/") > -1
+    // // );
+    // if (tabsParams.path.indexOf("/edit?") > -1 || tabsParams.path.indexOf("/edit/") > -1) {
+    //   let key = "/edit?";
+    //   let name = "";
+    //   let _path = tabsParams.path.replace(key, "/detail?");
+    //   // 使用路由参数的地址,忽略查询参数后,查找相同地址
+    //   let _path2 = tabsParams.path.replace("/edit/", "/detail/");
+    //   let hasPath1 = route.fullPath.indexOf("/edit?") > -1;
+    //   let hasPath2 = route.fullPath.indexOf("/edit/") > -1;
+    //   let tabsMenuList = tabStore.tabsMenuList;
+    //   for (let i = 0; i < tabsMenuList.length; i++) {
+    //     if (
+    //       (hasPath1 && tabsMenuList[i].path == _path) ||
+    //       (hasPath2 && tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0])
+    //     ) {
+    //       name = tabsMenuList[i].name;
+    //       tabsMenuList[i] = tabsParams;
+    //       isReplace = true;
+    //       break;
+    //     }
+    //   }
+    //   console.log("keilll name edit:>> ", name);
+    //   tabStore.setTabs(tabsMenuList);
+    //   name && keepAliveStore.updateKeepAliveName(route);
+    //   // route.meta.isKeepAlive && keepAliveStore.updateKeepAliveName(route);
+    // } else if (tabsParams.path.indexOf("/detail?") > -1 || tabsParams.path.indexOf("/detail/") > -1) {
+    //   let key = "/detail?";
+    //   let name = "";
+    //   let _path = tabsParams.path.replace(key, "/edit?");
+    //   // 使用路由参数的地址,忽略查询参数后,查找相同地址
+    //   let _path2 = tabsParams.path.replace("/detail/", "/edit/");
+    //   let hasPath1 = route.fullPath.indexOf("/detail?") > -1;
+    //   let hasPath2 = route.fullPath.indexOf("/detail/") > -1;
+    //   let tabsMenuList = tabStore.tabsMenuList;
+    //   for (let i = 0; i < tabsMenuList.length; i++) {
+    //     if (
+    //       (hasPath1 && tabsMenuList[i].path == _path) ||
+    //       (hasPath2 && tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0])
+    //     ) {
+    //       console.log(
+    //         " (hasPath2 && tabsMenuList[i].path.split('?)[0] == _path2.split('?')[0])",
+    //         tabsMenuList[i].path,
+    //         _path,
+    //         tabsMenuList[i].path == _path,
+    //         hasPath2,
+    //         tabsMenuList[i].path.split("?")[0],
+    //         _path2.split("?")[0],
+    //         tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0],
+    //         tabsMenuList[i]
+    //       );
+    //       name = tabsMenuList[i].name;
+    //       tabsMenuList[i] = tabsParams;
+    //       isReplace = true;
+    //       break;
+    //     }
+    //   }
+    //   tabStore.setTabs(tabsMenuList);
+    //   console.log("keilll name detail:>> ", name);
+    //   name && keepAliveStore.updateKeepAliveName(route);
+    //   // route.meta.isKeepAlive && keepAliveStore.addKeepAliveName(route);
+    //   console.log("add keepAliveStore.keepAliveName :>> ", keepAliveStore.keepAliveName);
+    // }
+    // !isReplace && tabStore.addTabs(tabsParams);
+    // !isReplace && route.meta.isKeepAlive && keepAliveStore.addKeepAliveName(route);
   },
   { immediate: true }
 );

+ 1 - 0
JLHWEB/src/routers/index.ts

@@ -44,6 +44,7 @@ router.beforeEach(async (to, from, next) => {
   const keepAliveStore = useKeepAliveStore();
   const { keepAliveName } = storeToRefs(keepAliveStore);
 
+  keepAliveStore.computedKeepAliveName(to, from);
   console.log("keepAliveName :>> ", keepAliveName);
   console.log("to :>> ", to);
   console.log("from :>> ", from);

+ 115 - 0
JLHWEB/src/stores/modules/keepAlive.ts

@@ -1,6 +1,7 @@
 import { defineStore } from "pinia";
 import { KeepAliveState } from "@/stores/interface";
 import { cloneDeep } from "lodash-es";
+import { useTabsStore } from "@/stores/modules/tabs";
 
 export const useKeepAliveStore = defineStore({
   id: "geeker-keepAlive",
@@ -53,6 +54,7 @@ export const useKeepAliveStore = defineStore({
     },
     async updateKeepAliveName(route: any) {
       this.addKeepAliveName(route);
+      console.log("updateKeepAliveName route :>> ", route, this.keepAliveList);
       this.keepAliveList.forEach((item: any) => {
         console.log("updateKeepAliveName item :>> ", item.fullPath, route.fullPath, item.fullPath == route.fullPath);
         if (item.fullPath == route.fullPath) {
@@ -70,6 +72,119 @@ export const useKeepAliveStore = defineStore({
         this.keepAliveList.push(routeItem);
       }
       return routeItem;
+    },
+    computedKeepAliveName(to, from) {
+      const tabStore = useTabsStore();
+
+      const tabsParams = {
+        icon: to.meta.icon as string,
+        title: to.meta.title as string,
+        path: to.fullPath,
+        name: to.name as string,
+        close: !to.meta.isAffix
+      };
+      console.log("tabStore :>> ", tabStore, to);
+      console.log("tabsParams router:>> ", tabsParams);
+      let isReplace = false;
+      // console.log(
+      //   'tabsParams.path.indexOf("/edit?") > -1 , :>> ',
+      //   tabsParams.path.indexOf("/edit?") > -1,
+      //   tabsParams.path.indexOf("/edit/") > -1
+      // );
+      // console.log(
+      //   'tabsParams.path.indexOf("/detail?") > -1 , :>> ',
+      //   tabsParams.path.indexOf("/detail?") > -1,
+      //   tabsParams.path.indexOf("/detail/") > -1
+      // );
+      console.log(
+        'to.fullPath.split("?")[0] != from.fullPath.split("?")[0] :>> ',
+        to.fullPath.split("?")[0],
+        from.fullPath.split("?")[0],
+        to.fullPath.split("?")[0] != from.fullPath.split("?")[0]
+      );
+      // if (from.meta?.activeMenu == to.meta?.activeMenu && to.fullPath.split("?")[0] != from.fullPath.split("?")[0]) {
+      if (tabsParams.path.indexOf("/edit?") > -1 || tabsParams.path.indexOf("/edit/") > -1) {
+        let key = "/edit?";
+        let name = "";
+        let _path = tabsParams.path.replace(key, "/detail?");
+        // let _path = from.fullPath;
+        // 使用路由参数的地址,忽略查询参数后,查找相同地址
+        let _path2 = tabsParams.path.replace("/edit/", "/detail/");
+        let hasPath1 = to.fullPath.indexOf("/edit?") > -1;
+        let hasPath2 = to.fullPath.indexOf("/edit/") > -1;
+        let tabsMenuList = tabStore.tabsMenuList;
+        console.log("tabsMenuList :>> ", JSON.stringify(tabsMenuList));
+        for (let i = 0; i < tabsMenuList.length; i++) {
+          if (
+            (hasPath1 && tabsMenuList[i].path == _path) ||
+            (hasPath2 && tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0])
+          ) {
+            console.log(
+              "computedKeepAliveName edit ====>",
+              i,
+              tabsMenuList[i].path,
+              _path,
+              tabsMenuList[i].path == _path,
+              hasPath2,
+              tabsMenuList[i].path.split("?")[0],
+              _path2.split("?")[0],
+              tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0],
+              tabsMenuList[i]
+            );
+            name = tabsMenuList[i].name;
+            tabsMenuList[i] = tabsParams;
+            isReplace = true;
+            break;
+          }
+        }
+        console.log("keilll name edit:>> ", name);
+        tabStore.setTabs(tabsMenuList);
+        name && this.updateKeepAliveName(to);
+        // to.meta.isKeepAlive && this.updateKeepAliveName(route);
+      } else if (tabsParams.path.indexOf("/detail?") > -1 || tabsParams.path.indexOf("/detail/") > -1) {
+        let key = "/detail?";
+        let name = "";
+        let _path = tabsParams.path.replace(key, "/edit?");
+        // let _path = from.fullPath;
+        // 使用路由参数的地址,忽略查询参数后,查找相同地址
+        let _path2 = tabsParams.path.replace("/detail/", "/edit/");
+        let hasPath1 = to.fullPath.indexOf("/detail?") > -1;
+        let hasPath2 = to.fullPath.indexOf("/detail/") > -1;
+        let tabsMenuList = tabStore.tabsMenuList;
+        console.log("tabsMenuList :>> ", JSON.stringify(tabsMenuList));
+        for (let i = 0; i < tabsMenuList.length; i++) {
+          if (
+            (hasPath1 &&
+              (tabsMenuList[i].path == _path ||
+                (tabsMenuList[i].path == from.fullPath && from.fullPath.indexOf("/copy?") > -1))) ||
+            (hasPath2 && tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0])
+          ) {
+            console.log(
+              "computedKeepAliveName detail ====>",
+              tabsMenuList[i].path,
+              _path,
+              tabsMenuList[i].path == _path,
+              hasPath2,
+              tabsMenuList[i].path.split("?")[0],
+              _path2.split("?")[0],
+              tabsMenuList[i].path.split("?")[0] == _path2.split("?")[0],
+              tabsMenuList[i]
+            );
+            name = tabsMenuList[i].name;
+            tabsMenuList[i] = tabsParams;
+            isReplace = true;
+            break;
+          }
+        }
+        tabStore.setTabs(tabsMenuList);
+        console.log("keilll name detail:>> ", name);
+        name && this.updateKeepAliveName(to);
+        // to.meta.isKeepAlive && this.addKeepAliveName(to);
+        console.log("add this.keepAliveName :>> ", this.keepAliveName);
+      }
+      // }
+      !isReplace && tabStore.addTabs(tabsParams);
+      !isReplace && to.meta.isKeepAlive && this.addKeepAliveName(to);
     }
   }
 });

+ 0 - 1
JLHWEB/src/views/erpapi/mattressInterface/detail.vue

@@ -4,7 +4,6 @@
     ref="LjDetailRef"
     v-bind="detailProps"
     :data="mainData"
-    :request-auto="false"
     v-model:order-status="orderStatus"
     :action="orderDefaultAction"
     @after-mounted="funcAfterMound"

+ 2 - 1
JLHWEB/src/views/erpapi/mattressInterface/hooks/index.tsx

@@ -902,7 +902,7 @@ export const useHooks = (t?: any) => {
     {
       field: "bj_namemx",
       title: "明细名称",
-      width: 280,
+      width: 420,
       editRender: {},
       editColRender: (scope: any) => {
         const { $table, column, row, status } = scope;
@@ -918,6 +918,7 @@ export const useHooks = (t?: any) => {
               value={scope.row.bj_namemx}
               {...params}
               clearable
+              fit-input-width
               placeholder="请选择配置"
               onOpenModal={() => fModelChoseCodeMx(row, params, rModelSetCodemx, scope.row.bj_namemx, $table)}
               onSelect={val => rModelSetCodemx(scope.row, val, $table)}

+ 2 - 2
JLHWEB/src/views/quote/mattressQuote/detail.vue

@@ -2887,11 +2887,11 @@ const autoBednetSave = async (res: any, oldBednetid: number) => {
       };
       if (visibleData.length == 1 && visibleData[0].mtrlid == 0) {
         await $table.reloadData([_row]);
+        wf_rtr_cwdc(_row, _res, "set");
       } else {
         await $table.insertAt(_row, -1);
+        wf_rtr_cwdc(_row, _res, "add");
       }
-
-      wf_rtr_cwdc(_row, _res, "add");
     }
   }
 

+ 0 - 8
JLHWEB/src/views/system/selector/codemx/select.vue

@@ -6,7 +6,6 @@
     :loading="loading"
     v-bind="$attrs"
     :remote-method="remoteMethod"
-    popper-class="lj-select-codemx__popper"
     @select="handleSelect"
     @open-modal="openModal"
   >
@@ -82,10 +81,3 @@ const openModal = (e: any) => {
   emit("openModal", e);
 };
 </script>
-
-<style lang="scss">
-.lj-select-codemx__popper {
-  max-width: 300px !important;
-  min-width: 300px !important;
-}
-</style>