耗材修改
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user