|
|
@ -4536,6 +4536,17 @@ export default { |
|
|
this.componentData.componentPart = normalizedComponentPart |
|
|
this.componentData.componentPart = normalizedComponentPart |
|
|
return normalizedComponentPart |
|
|
return normalizedComponentPart |
|
|
}, |
|
|
}, |
|
|
|
|
|
normalizePartNo (partNo) { |
|
|
|
|
|
return (partNo || '').toString().trim().toUpperCase() |
|
|
|
|
|
}, |
|
|
|
|
|
isSelfAsComponent (parentPartNo, componentPart) { |
|
|
|
|
|
const parent = this.normalizePartNo(parentPartNo) |
|
|
|
|
|
const child = this.normalizePartNo(componentPart) |
|
|
|
|
|
return parent !== '' && parent === child |
|
|
|
|
|
}, |
|
|
|
|
|
findSelfAsComponent (parentPartNo, list) { |
|
|
|
|
|
return (list || []).find(item => this.isSelfAsComponent(parentPartNo, item && item.componentPart)) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 子物料编码失焦事件 |
|
|
// 子物料编码失焦事件 |
|
|
componentPartBlur () { |
|
|
componentPartBlur () { |
|
|
@ -4743,8 +4754,12 @@ export default { |
|
|
if (this.checkedPasteBar.length === 0) { |
|
|
if (this.checkedPasteBar.length === 0) { |
|
|
this.$message.warning('请选择要复制的信息!') |
|
|
this.$message.warning('请选择要复制的信息!') |
|
|
return |
|
|
return |
|
|
} else { |
|
|
|
|
|
this.$confirm("是否确认复制信息?", "提示", { |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
if (this.findSelfAsComponent(this.detailData.partNo, this.checkedPasteBar)) { |
|
|
|
|
|
this.$message.warning('不能将自己作为子物料!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.$confirm("是否确认复制信息?", "提示", { |
|
|
confirmButtonText: "确定", |
|
|
confirmButtonText: "确定", |
|
|
cancelButtonText: "取消", |
|
|
cancelButtonText: "取消", |
|
|
type: "warning" |
|
|
type: "warning" |
|
|
@ -4786,7 +4801,6 @@ export default { |
|
|
this.saveComponentLoading = false |
|
|
this.saveComponentLoading = false |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 删除粘贴栏 |
|
|
// 删除粘贴栏 |
|
|
@ -4932,6 +4946,10 @@ export default { |
|
|
this.$message.warning('请选择子物料编码!') |
|
|
this.$message.warning('请选择子物料编码!') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
if (this.isSelfAsComponent(this.componentData.partNo, normalizedComponentPart)) { |
|
|
|
|
|
this.$message.warning('不能将自己作为子物料!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
if (this.componentData.productFlag === 'component' && (this.componentData.consumptionItem === '' || this.componentData.consumptionItem == null)) { |
|
|
if (this.componentData.productFlag === 'component' && (this.componentData.consumptionItem === '' || this.componentData.consumptionItem == null)) { |
|
|
this.$message.warning('请选择消耗项目!') |
|
|
this.$message.warning('请选择消耗项目!') |
|
|
return |
|
|
return |
|
|
@ -5159,6 +5177,10 @@ export default { |
|
|
this.$message.warning('失效日期必须大于生效日期!') |
|
|
this.$message.warning('失效日期必须大于生效日期!') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
if (this.findSelfAsComponent(this.copyBomData.partNo, [...(this.subDetailList || []), ...(this.byProductList || [])])) { |
|
|
|
|
|
this.$message.warning('不能将自己作为子物料!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
this.copyBomData.previousVersion = this.modalData |
|
|
this.copyBomData.previousVersion = this.modalData |
|
|
this.copyLoading = true |
|
|
this.copyLoading = true |
|
|
// 新增主表信息 |
|
|
// 新增主表信息 |
|
|
@ -5232,6 +5254,10 @@ export default { |
|
|
this.$message.warning('请填写替代编码!') |
|
|
this.$message.warning('请填写替代编码!') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
if (this.findSelfAsComponent(this.copyAlternativeData.partNo, [...(this.subDetailList || []), ...(this.byProductList || [])])) { |
|
|
|
|
|
this.$message.warning('不能将自己作为子物料!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
// if (this.copyAlternativeData.alternativeDescription === '' || this.copyAlternativeData.alternativeDescription == null) { |
|
|
// if (this.copyAlternativeData.alternativeDescription === '' || this.copyAlternativeData.alternativeDescription == null) { |
|
|
// this.$message.warning('请填写替代名称!') |
|
|
// this.$message.warning('请填写替代名称!') |
|
|
// return |
|
|
// return |
|
|
|