|
|
|
@ -2692,11 +2692,25 @@ |
|
|
|
this.$message.warning('该类型单据不能编辑!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.editBatchVisible) { |
|
|
|
this.editBatchVisible = false |
|
|
|
} else { |
|
|
|
this.editBatchVisible = true |
|
|
|
} |
|
|
|
// 先查询材料汇总数据,校验是否有合计已发数量大于零 |
|
|
|
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,27 +3031,41 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
deleteNotifyMaterial(row){ |
|
|
|
this.$confirm('确认删除?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
deleteNotifyMaterial(row).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.refreshCurrentTabTable() |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
// 先查询材料汇总数据,校验是否有合计已发数量大于零 |
|
|
|
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: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
deleteNotifyMaterial(row).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.refreshCurrentTabTable() |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
deleteNotifySOSPlus(row){ |
|
|
|
// 检查当前状态是否允许编辑 |
|
|
|
@ -3891,28 +3919,44 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
editNotifyMaterialFun(row){ |
|
|
|
// 设置当前行为要编辑的行 |
|
|
|
this.currentRow = JSON.parse(JSON.stringify(row)); |
|
|
|
|
|
|
|
editNotifyMaterial(row).then(({data})=>{ |
|
|
|
if (data.code === 0) { |
|
|
|
//刷新主表数据 |
|
|
|
this.searchTable().then(() => { // 等刷新完成 |
|
|
|
const foundRow = this.dataList.find(item => item.notifyNo === row.notifyNo); |
|
|
|
if (foundRow) { |
|
|
|
this.currentRow = JSON.parse(JSON.stringify(foundRow)); |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.mainTable.setCurrentRow(foundRow); |
|
|
|
}); |
|
|
|
} |
|
|
|
// 先查询该行的材料汇总数据,校验是否有合计已发数量大于零 |
|
|
|
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; |
|
|
|
}); |
|
|
|
this.$message.success( '操作成功') |
|
|
|
}else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
if (hasIssuedQty) { |
|
|
|
this.$message.warning('该单据已有合计已发数量,不能编辑主信息!'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 校验通过,继续执行编辑操作 |
|
|
|
// 设置当前行为要编辑的行 |
|
|
|
this.currentRow = JSON.parse(JSON.stringify(row)); |
|
|
|
|
|
|
|
editNotifyMaterial(row).then(({data})=>{ |
|
|
|
if (data.code === 0) { |
|
|
|
//刷新主表数据 |
|
|
|
this.searchTable().then(() => { // 等刷新完成 |
|
|
|
const foundRow = this.dataList.find(item => item.notifyNo === row.notifyNo); |
|
|
|
if (foundRow) { |
|
|
|
this.currentRow = JSON.parse(JSON.stringify(foundRow)); |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.mainTable.setCurrentRow(foundRow); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
this.$message.success( '操作成功') |
|
|
|
}else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 判断当前状态是否可编辑 |
|
|
|
@ -3956,24 +4000,38 @@ |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// 重置表单数据 |
|
|
|
this.newMaterialData = { |
|
|
|
componentPartNo: '', |
|
|
|
partDesc: '', |
|
|
|
issueType: '替代料', |
|
|
|
orderNo: '', |
|
|
|
itemNo: '', // 申请单序号,将在选择生产订单时自动填充 |
|
|
|
remark: '', |
|
|
|
componentScrap: 0, |
|
|
|
firstInspectionQty: 0, |
|
|
|
standardDosage: 0, |
|
|
|
bomSeqNo: '', |
|
|
|
warehouseId: '', |
|
|
|
qtyToIssueOriginal: 0 |
|
|
|
}; |
|
|
|
// 加载生产订单选项 |
|
|
|
this.loadOrderOptions(); |
|
|
|
this.addMaterialModalFlag = true; |
|
|
|
// 先查询材料汇总数据,校验是否有合计已发数量大于零 |
|
|
|
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: '', |
|
|
|
partDesc: '', |
|
|
|
issueType: '替代料', |
|
|
|
orderNo: '', |
|
|
|
itemNo: '', // 申请单序号,将在选择生产订单时自动填充 |
|
|
|
remark: '', |
|
|
|
componentScrap: 0, |
|
|
|
firstInspectionQty: 0, |
|
|
|
standardDosage: 0, |
|
|
|
bomSeqNo: '', |
|
|
|
warehouseId: '', |
|
|
|
qtyToIssueOriginal: 0 |
|
|
|
}; |
|
|
|
// 加载生产订单选项 |
|
|
|
this.loadOrderOptions(); |
|
|
|
this.addMaterialModalFlag = true; |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 加载生产订单选项 |
|
|
|
|