Explorar el Código

JLHWEB: 1、床垫报价主副规格,取消主规格没有床网时检测弹簧排列逻辑

JohnnyChan hace 2 días
padre
commit
32e59c14d3
Se han modificado 1 ficheros con 13 adiciones y 12 borrados
  1. 13 12
      JLHWEB/src/views/quote/mattressQuote/detail.vue

+ 13 - 12
JLHWEB/src/views/quote/mattressQuote/detail.vue

@@ -1764,20 +1764,21 @@ const save = async () => {
           itm => Number(itm.mattress_width) > 0 || Number(itm.mattress_length) > 0 || Number(itm.mattress_height) > 0
         );
 
-        console.log("subspecs :>> ", subspecs);
-
-        subspecs.map(itm => {
-          if (Number(itm.mattress_width) <= 0 || Number(itm.mattress_length) <= 0 || Number(itm.mattress_height) <= 0) {
-            throw new Error("主副规格相关尺寸输入有误(不能为空),请输入正数");
-          }
-          for (const key in itm) {
-            if (key.indexOf("spring_qty_") > -1) {
-              if (Number(itm[key]) <= 0) {
-                throw new Error("主副规格相关弹簧排列数不能为空,请检查");
+        let ifHas99 = mattressMx.filter(itm => itm.formulakind == 99 && itm.mtrlid > 0);
+        if (ifHas99.length > 0) {
+          subspecs.map(itm => {
+            if (Number(itm.mattress_width) <= 0 || Number(itm.mattress_length) <= 0 || Number(itm.mattress_height) <= 0) {
+              throw new Error("主副规格相关尺寸输入有误(不能为空),请输入正数");
+            }
+            for (const key in itm) {
+              if (key.indexOf("spring_qty_") > -1) {
+                if (Number(itm[key]) <= 0) {
+                  throw new Error("主副规格相关弹簧排列数不能为空,请检查");
+                }
               }
             }
-          }
-        });
+          });
+        }
       } catch (error) {
         ElMessage.error(error.message);
         return false;