diff --git a/src/views/modules/part/bom_create.vue b/src/views/modules/part/bom_create.vue index bbb7dab..5f1a5ce 100644 --- a/src/views/modules/part/bom_create.vue +++ b/src/views/modules/part/bom_create.vue @@ -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 || '未知错误')) }) }) diff --git a/src/views/modules/part/quicklyCreateBom.vue b/src/views/modules/part/quicklyCreateBom.vue index c7df406..6e9f860 100644 --- a/src/views/modules/part/quicklyCreateBom.vue +++ b/src/views/modules/part/quicklyCreateBom.vue @@ -5457,7 +5457,7 @@ export default { lock: true, text: '正在加载商品组数据...', spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' + background: 'rgba(0, 0, 0, 0.3)' }) // 先查询该BU下所有商品组1 @@ -5513,7 +5513,7 @@ export default { lock: true, text: '正在加载ProcessTimeMatrix数据...', spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' + background: 'rgba(0, 0, 0, 0.3)' }) } else { // 更新loading文本 @@ -5689,7 +5689,7 @@ export default { lock: true, text: '正在添加参数...', spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' + background: 'rgba(0, 0, 0, 0.3)' }) // 直接添加该行的参数