diff --git a/src/views/modules/qc/qcPartAttribute.vue b/src/views/modules/qc/qcPartAttribute.vue index 708bccd..158839f 100644 --- a/src/views/modules/qc/qcPartAttribute.vue +++ b/src/views/modules/qc/qcPartAttribute.vue @@ -348,12 +348,20 @@ 新增模板 批量编辑 批量保存 + 批量删除 + + { + // 创建删除请求的Promise数组 + const deletePromises = this.selectedTemplates.map(row => { + return deletePartAttributeDetails(row) + }) + + // 并发执行所有删除请求 + Promise.all(deletePromises).then(results => { + // 检查是否所有请求都成功 + const allSuccess = results.every(({data}) => data && data.code === 0) + + if (allSuccess) { + this.$message.success('批量删除成功') + } else { + this.$message.warning('部分删除失败,请重试') + } + + // 刷新列表 + searchPartAttributeDetails(this.detailData).then(({data}) => { + this.detailList = data.rows + }) + + // 清空选中状态 + this.$refs.templateTable.clearSelection() + this.selectedTemplates = [] + }).catch(() => { + this.$message.error('批量删除失败') + // 刷新列表 + searchPartAttributeDetails(this.detailData).then(({data}) => { + this.detailList = data.rows + }) + }) + }) + }, + // ==================== 物料缺陷跟踪 ==================== // 查询物料缺陷跟踪