JohnnyChan vor 1 Monat
Ursprung
Commit
5cc8e18246

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

@@ -542,7 +542,7 @@ const orderDefaultAction = [
       return !!orderStatus.value;
     },
     clickFunc: item => {
-      toCreateMtrl(1, { list: [LjDetailRef.value?._mainData.mattressid] });
+      toCreateMtrl(1, [LjDetailRef.value?._mainData.mattressid]);
     }
   }),
   [
@@ -561,7 +561,7 @@ const orderDefaultAction = [
         return !!orderStatus.value;
       },
       clickFunc: item => {
-        toCreateORDelMtrlPf(1, { list: [LjDetailRef.value?._mainData.mattressid] });
+        toCreateORDelMtrlPf(1, [LjDetailRef.value?._mainData.mattressid]);
       }
     })
     // buttonDefault({

+ 18 - 16
JLHWEB/src/views/erpapi/mattressInterface/hooks/index.tsx

@@ -85,22 +85,24 @@ export const useHooks = (t?: any) => {
 
   const toCreateORDelMtrlPf = (type: number, list: any) => {
     if (type === 1) {
-      const $table = state.QdTableRef.element;
-      if ($table) {
-        $table.clearEdit();
-
-        const { visibleData } = $table.getTableData();
-        console.log("visibleData :>> ", visibleData);
-        try {
-          visibleData.map((o, idx) => {
-            if (!o.erp_mtrlid && idx > 35) {
-              state.QdTableRef.scrollTo(o, "erp_mtrlid");
-              throw new Error(`第${idx + 1}行:产品补充未填入L1物料信息,请先选择L1物料修改`);
-            }
-          });
-        } catch (error) {
-          ElMessage.error(error.message);
-          return false;
+      if (state.QdTableRef) {
+        const $table = state.QdTableRef.element;
+        if ($table) {
+          $table.clearEdit();
+
+          const { visibleData } = $table.getTableData();
+          console.log("visibleData :>> ", visibleData);
+          try {
+            visibleData.map((o, idx) => {
+              if (!o.erp_mtrlid && o.actual_useqty <= 0) {
+                state.QdTableRef.scrollTo(o, "erp_mtrlid");
+                throw new Error(`第${idx + 1}行:产品补充未填入L1物料信息,请先选择L1物料修改`);
+              }
+            });
+          } catch (error) {
+            ElMessage.error(error.message);
+            return false;
+          }
         }
       }