|
@@ -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;
|