|
|
|
@ -4076,7 +4076,7 @@ export default { |
|
|
|
this.$message.warning('请选择可选物料!') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 转换数据结构:将 componentPart 映射到 partNo,因为后端使用 entity.getPartNo() 作为子件编码 |
|
|
|
const convertedSelections = this.copyBomSelections.map(item => { |
|
|
|
return { |
|
|
|
@ -4087,12 +4087,20 @@ export default { |
|
|
|
qtyPerAssembly: item.qtyPerAssembly || 0 // 单位用量 |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.$confirm("是否确认添加该"+ this.copyBomSelections.length +"条子件记录?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}).then(() => { |
|
|
|
// 显示loading |
|
|
|
const loadingInstance = this.$loading({ |
|
|
|
lock: true, |
|
|
|
text: '正在保存BOM子件...', |
|
|
|
spinner: 'el-icon-loading', |
|
|
|
background: 'rgba(0, 0, 0, 0.3)' |
|
|
|
}) |
|
|
|
|
|
|
|
let tempData = { |
|
|
|
site: this.modalData.site, |
|
|
|
buNo: this.modalData.buNo, |
|
|
|
@ -4117,6 +4125,8 @@ export default { |
|
|
|
batchSaveList: convertedSelections // 使用转换后的数据 |
|
|
|
} |
|
|
|
batchSaveBomComponent(tempData).then(({data}) => { |
|
|
|
loadingInstance.close() // 关闭loading |
|
|
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
this.subDetailList = data.rows.subDetailList |
|
|
|
this.copyBomDialogFlag = false |
|
|
|
@ -4140,6 +4150,9 @@ export default { |
|
|
|
page: 1, |
|
|
|
limit: 10 |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
loadingInstance.close() // 发生错误时也要关闭loading |
|
|
|
this.$message.error('保存失败:' + (error.message || '未知错误')) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|