소스 검색

JLHWEB:1、床垫报价,修改动作改为复制

JohnnyChan 1 일 전
부모
커밋
47c44feefd

+ 2 - 1
JLHWEB/src/layouts/components/Tabs/index.vue

@@ -113,7 +113,8 @@ watch(
       }
       console.log("keilll name :>> ", name);
       tabStore.setTabs(tabsMenuList);
-      name && keepAliveStore.removeKeepAliveName(route);
+      // name && keepAliveStore.removeKeepAliveName(route);
+      route.meta.isKeepAlive && keepAliveStore.updateKeepAliveName(route);
     } else if (tabsParams.path.indexOf("/detail?") > -1 || tabsParams.path.indexOf("/detail/") > -1) {
       let key = "/detail?";
       let _path = tabsParams.path.replace(key, "/edit?");

+ 9 - 1
JLHWEB/src/views/quote/bednetQuote/detail.vue

@@ -142,6 +142,10 @@ interface DetailProps {
    * @description 是否只读
    */
   onlyView?: boolean;
+  /**
+   * @description 是否复制
+   */
+  ifcopy?: boolean;
 }
 
 const props = withDefaults(defineProps<DetailProps>(), {
@@ -432,6 +436,10 @@ const orderDefaultAction: detailAction[] = [
           bednet.deptid = initParams.value.deptid;
         }
 
+        if (props?.ifcopy) {
+          bednet.copy_id = bednet.bednetid;
+        }
+
         let _param_mf = {
           bednet,
           bednetMx,
@@ -447,7 +455,7 @@ const orderDefaultAction: detailAction[] = [
                 type: "success"
               });
               if (typeof props.bednetid != "undefined") {
-                emit("aftersave", res);
+                emit("aftersave", res, bednet.bednetid);
               } else {
                 if (res.bednet.bednetid) {
                   tabRemove(route.fullPath);

+ 1 - 1
JLHWEB/src/views/quote/bednetQuote/hooks/index.tsx

@@ -865,7 +865,7 @@ export const useHooks = (t?: any, props?: any) => {
       }
     },
     {
-      title: "床高/CM",
+      title: "床高/CM",
       field: "mattress_height",
       basicinfo: {
         el: "input",

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

@@ -760,6 +760,7 @@
     <BednetDetail
       :mattress-width="LjDetailRef._mainData.mattress_width"
       :mattress-length="LjDetailRef._mainData.mattress_length"
+      :ifcopy="ifcopy"
       v-bind="bednetDrawerProps"
       @aftersave="autoBednetSave"
       @aftercancel="LjDrawerRef.hide()"
@@ -826,6 +827,7 @@ const route = useRoute();
 const router = useRouter();
 const globalStore = useGlobalStore();
 // const { isShowOriginFormulaMattress } = storeToRefs(globalStore);
+const ifcopy = ref(false);
 
 const showOriginFormulaMattress = (value: any) => {
   globalStore.setGlobalState("isShowOriginFormulaMattress", Boolean(value));
@@ -2860,6 +2862,8 @@ const handleAddBednetMx = () => {
     bednetDrawerProps.bednetid = 0;
     bednetDrawerProps.state = "new";
     bednetDrawerProps.onlyView = false;
+
+    ifcopy.value = false;
     LjDrawerRef.value.show(true);
   });
 };
@@ -2881,6 +2885,8 @@ const handleEditBednetMx = () => {
           bednetDrawerProps.dannum_type = LjDetailRef.value._mainData.dannum_type;
           bednetDrawerProps.state = "edit";
           bednetDrawerProps.onlyView = false;
+
+          ifcopy.value = true;
           LjDrawerRef.value.show(true);
         });
       }
@@ -2888,14 +2894,14 @@ const handleEditBednetMx = () => {
   }
 };
 
-const autoBednetSave = async (res: any) => {
+const autoBednetSave = async (res: any, oldBednetid: number) => {
   const $table = bednetMxRef.value.element;
 
   let _res = res.bednet;
   _res.bednet_height = res.bednet.mattress_height;
   if ($table) {
     const { visibleData } = $table.getTableData();
-    let idx = visibleData.findIndex(t => t.mtrlid == _res.bednetid || t.mtrlid == 0);
+    let idx = visibleData.findIndex(t => t.mtrlid == oldBednetid || oldBednetid == 0);
     let _mtrlname =
       _res.typename + " " + _res.bednetcode + " " + _res.mattress_width + "*" + _res.mattress_length + "*" + _res.mattress_height;
     if (idx > -1) {