Browse Source

JLHWEB: 1、修复床垫清单主副规格配置复制操作错误

JohnnyChan 1 day ago
parent
commit
5cb240467f

+ 15 - 2
JLHWEB/src/views/erpapi/mattressInterface/detail.vue

@@ -1066,6 +1066,7 @@ const orderDefaultAction = [
   // ],
   buttonDefault({
     label: "覆盖配置到副规格产品",
+    loading: () => loadingStatus.value.main2sec,
     limited: () => {
       return !!orderStatus.value || LjDetailRef.value?._mainData.child_count == 0;
     },
@@ -1078,11 +1079,18 @@ const orderDefaultAction = [
     clickFunc: item => {
       fModelChoseMattress("副规格", { arg_parentid: LjDetailRef.value?._mainData.mattressid }, 0, t("common.okText")).then(
         (res: any) => {
+          console.log("res :>> ", res);
           CoverMattressInterfaceList(
             res.map(t => {
               return { mattressid: t.mattressid };
             })
-          );
+          )
+            .then(() => {
+              loadingStatus.value.main2sec = false;
+            })
+            .catch(() => {
+              loadingStatus.value.main2sec = false;
+            });
         }
       );
     }
@@ -1099,7 +1107,12 @@ const orderDefaultAction = [
       return "";
     },
     clickFunc: item => {
-      RefreshMattressInterfaceList(LjDetailRef.value?._mainData.parentid, 1, LjDetailRef.value?._mainData.erp_configcodetype);
+      RefreshMattressInterfaceList(
+        LjDetailRef.value?._mainData.parentid,
+        1,
+        LjDetailRef.value?._mainData.erp_configcodetype,
+        LjDetailRef.value?._mainData.mattressid
+      );
     }
   }),
   buttonDefault({

+ 6 - 4
JLHWEB/src/views/erpapi/mattressInterface/hooks/index.tsx

@@ -97,7 +97,8 @@ export const useHooks = (t?: any) => {
       save: false,
       synchsL1: false,
       mtrldef: false,
-      prdpf: false
+      prdpf: false,
+      main2sec: false
     }
   });
 
@@ -2110,13 +2111,14 @@ export const useHooks = (t?: any) => {
       state.MattressDialogProps = {
         multipleLimit: multipleLimit,
         onSubmit: (res: any) => {
+          state.loadingStatus.main2sec = true;
           // submit
           console.log("openCustDialog res", res);
           nextTick(() => {
-            if (multipleLimit > 1) {
-              resolve(res.value);
-            } else {
+            if (multipleLimit == 1) {
               resolve(res.value[0]);
+            } else {
+              resolve(res.value);
             }
           });
         },

+ 18 - 5
JLHWEB/src/views/system/selector/mattress/index.vue

@@ -102,8 +102,19 @@ const subtitle = ref("");
 const handleClickTable = async ({ row, column, rowIndex }: any) => {
   const $table = LjTableRef.value.element;
   if ($table) {
-    selectList.value = [row];
-    $table.setRadioRow(row);
+    if (props.multipleLimit == 1) {
+      selectList.value = [row];
+      $table.setRadioRow(row);
+    } else {
+      let ifHas = selectList.value.find((item: any) => item[TABLE_KEY] == row[TABLE_KEY]);
+      if (ifHas) {
+        selectList.value = selectList.value.filter((item: any) => item[TABLE_KEY] != row[TABLE_KEY]);
+        $table.setCheckboxRow(row, false);
+      } else {
+        selectList.value.push(row);
+        $table.setCheckboxRow(row, true);
+      }
+    }
   }
 };
 
@@ -113,10 +124,12 @@ const handleClickTable = async ({ row, column, rowIndex }: any) => {
 const handleDBlClickTable = async ({ row, column, rowIndex }: any) => {
   const $table = LjTableRef.value.element;
   if ($table) {
-    selectList.value = [row];
-    $table.setRadioRow(row);
+    if (props.multipleLimit == 1) {
+      selectList.value = [row];
+      $table.setRadioRow(row);
 
-    LjSelectorRef.value.funcSubmit();
+      LjSelectorRef.value.funcSubmit();
+    }
   }
 };