//判断选中的项是否有不相同的模型
const hasNameProperty = _this.selectedOrderList.filter(order => order.hasOwnProperty("item_model_id"));
if (hasNameProperty.length > 0) {
    const isEveryNameEqual = hasNameProperty.reduce((prev, curr) => {
        if (prev === true && curr.item_model_id === hasNameProperty[0].item_model_id) {
            return true;
        } else {
            return false;
        }
    }, true);
    if (!isEveryNameEqual) {
        alert("请选择需要相同的物料");
        return;
    }
} else {
    alert("请选择需要相同的物料");
    return;
}

  

posted on 2023-09-27 15:23  不讲武德的小趴菜  阅读(525)  评论(0编辑  收藏  举报