耗材修改

This commit is contained in:
魏啾
2024-10-12 11:00:50 +08:00
parent 49a458de76
commit 893ec1bec4
3 changed files with 26 additions and 18 deletions

View File

@@ -752,17 +752,21 @@ export default {
// 提交
submitHandle() {
console.log(this.form.skuList)
// 如果找到undefined立即停止搜索并返回true
const hasUndefined = this.form.skuList.some(obj => {
for (const key in obj) {
console.log(key, obj)
if (obj['salePrice'] === undefined || obj['memberPrice'] === undefined || obj['costPrice'] === undefined || obj['originPrice'] === undefined) {
return true; // 如果找到undefined立即停止搜索并返回true
if (this.shopTypesActive == 0) {//单规格判断
if (obj['salePrice'] == undefined || obj['memberPrice'] == undefined) {
return true;
}
} else {//多规格判断
if (obj['salePrice'] == undefined || obj['memberPrice'] == undefined || obj['costPrice'] == undefined || obj['originPrice'] == undefined) {
return true;
}
}
}
return false; // 如果没有找到undefined返回false
return false;
});
// 停止执行下面的数据
if (hasUndefined) {
this.$message({
message: "请完善规格属性的参数!",
@@ -770,6 +774,7 @@ export default {
});
return false;
}
let arr = [];
this.imgList.forEach((ele) => {
arr.push(ele.url);