|
|
|
@ -2692,11 +2692,25 @@ |
|
|
|
this.$message.warning('该类型单据不能编辑!') |
|
|
|
return |
|
|
|
} |
|
|
|
// 先查询材料汇总数据,校验是否有合计已发数量大于零 |
|
|
|
searchSumNotifyMaterialList(this.currentRow).then(({data}) => { |
|
|
|
if (data && data.code === 0 && data.rows && data.rows.length > 0) { |
|
|
|
const hasIssuedQty = data.rows.some(item => { |
|
|
|
const qty = parseFloat(item.qtyToIssueOriginal) || 0; |
|
|
|
return qty > 0; |
|
|
|
}); |
|
|
|
if (hasIssuedQty) { |
|
|
|
this.$message.warning('该单据已有合计已发数量,不能批量编辑材料明细!'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
// 校验通过,继续执行 |
|
|
|
if (this.editBatchVisible) { |
|
|
|
this.editBatchVisible = false |
|
|
|
} else { |
|
|
|
this.editBatchVisible = true |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 批量保存 |
|
|
|
@ -3017,6 +3031,19 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
deleteNotifyMaterial(row){ |
|
|
|
// 先查询材料汇总数据,校验是否有合计已发数量大于零 |
|
|
|
searchSumNotifyMaterialList(this.currentRow).then(({data}) => { |
|
|
|
if (data && data.code === 0 && data.rows && data.rows.length > 0) { |
|
|
|
const hasIssuedQty = data.rows.some(item => { |
|
|
|
const qty = parseFloat(item.qtyToIssueOriginal) || 0; |
|
|
|
return qty > 0; |
|
|
|
}); |
|
|
|
if (hasIssuedQty) { |
|
|
|
this.$message.warning('该单据已有合计已发数量,不能删除材料明细!'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
// 校验通过,继续执行删除 |
|
|
|
this.$confirm('确认删除?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
@ -3038,6 +3065,7 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
deleteNotifySOSPlus(row){ |
|
|
|
// 检查当前状态是否允许编辑 |
|
|
|
@ -3891,6 +3919,21 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
editNotifyMaterialFun(row){ |
|
|
|
// 先查询该行的材料汇总数据,校验是否有合计已发数量大于零 |
|
|
|
searchSumNotifyMaterialList(row).then(({data}) => { |
|
|
|
if (data && data.code === 0 && data.rows && data.rows.length > 0) { |
|
|
|
// 检查是否有合计已发数量大于零的记录 |
|
|
|
const hasIssuedQty = data.rows.some(item => { |
|
|
|
const qty = parseFloat(item.qtyToIssueOriginal) || 0; |
|
|
|
return qty > 0; |
|
|
|
}); |
|
|
|
if (hasIssuedQty) { |
|
|
|
this.$message.warning('该单据已有合计已发数量,不能编辑主信息!'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 校验通过,继续执行编辑操作 |
|
|
|
// 设置当前行为要编辑的行 |
|
|
|
this.currentRow = JSON.parse(JSON.stringify(row)); |
|
|
|
|
|
|
|
@ -3913,6 +3956,7 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 判断当前状态是否可编辑 |
|
|
|
@ -3956,6 +4000,19 @@ |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// 先查询材料汇总数据,校验是否有合计已发数量大于零 |
|
|
|
searchSumNotifyMaterialList(this.currentRow).then(({data}) => { |
|
|
|
if (data && data.code === 0 && data.rows && data.rows.length > 0) { |
|
|
|
const hasIssuedQty = data.rows.some(item => { |
|
|
|
const qty = parseFloat(item.qtyToIssueOriginal) || 0; |
|
|
|
return qty > 0; |
|
|
|
}); |
|
|
|
if (hasIssuedQty) { |
|
|
|
this.$message.warning('该单据已有合计已发数量,不能新增材料明细!'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
// 校验通过,继续执行 |
|
|
|
// 重置表单数据 |
|
|
|
this.newMaterialData = { |
|
|
|
componentPartNo: '', |
|
|
|
@ -3974,6 +4031,7 @@ |
|
|
|
// 加载生产订单选项 |
|
|
|
this.loadOrderOptions(); |
|
|
|
this.addMaterialModalFlag = true; |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 加载生产订单选项 |
|
|
|
|