diff --git a/src/views/modules/qc/qcPartAttribute.vue b/src/views/modules/qc/qcPartAttribute.vue index f57d42b..7dcebd9 100644 --- a/src/views/modules/qc/qcPartAttribute.vue +++ b/src/views/modules/qc/qcPartAttribute.vue @@ -348,7 +348,7 @@ 新增模板 批量编辑 批量保存 - 批量删除 + 批量删除 @@ -1362,6 +1362,7 @@ labelTemplateList: [], selectedTemplates: [], // 选中的质量检验模板 dataListLoading: false, + templateDeleteLoading: false, // 批量删除loading // 展示列集 columnList: [ { @@ -2449,6 +2450,7 @@ cancelButtonText: '取消', type: 'warning' }).then(() => { + this.$set(row, 'deleting', true) deletePartAttributeDetails(row).then(({data}) => { if (data && data.code === 0) { searchPartAttributeDetails(this.detailData).then(({data}) => { @@ -2458,6 +2460,9 @@ } else { this.$message.error(data.msg) } + this.$set(row, 'deleting', false) + }).catch(() => { + this.$set(row, 'deleting', false) }) }) }, @@ -2479,6 +2484,7 @@ cancelButtonText: '取消', type: 'warning' }).then(() => { + this.templateDeleteLoading = true // 创建删除请求的Promise数组 const deletePromises = this.selectedTemplates.map(row => { return deletePartAttributeDetails(row) @@ -2503,12 +2509,14 @@ // 清空选中状态 this.$refs.templateTable.clearSelection() this.selectedTemplates = [] + this.templateDeleteLoading = false }).catch(() => { this.$message.error('批量删除失败') // 刷新列表 searchPartAttributeDetails(this.detailData).then(({data}) => { this.detailList = data.rows }) + this.templateDeleteLoading = false }) }) }, diff --git a/src/views/modules/qc/sopListComponent.vue b/src/views/modules/qc/sopListComponent.vue index 07e7056..55909d2 100644 --- a/src/views/modules/qc/sopListComponent.vue +++ b/src/views/modules/qc/sopListComponent.vue @@ -3,7 +3,7 @@ 文件上传 - 删除 + 删除 @@ -154,7 +154,8 @@ export default { totalPage: 0, dataListLoading: false, dataListSelections: [], - sopFileUploadVisible: false + sopFileUploadVisible: false, + deleteLoading: false } }, watch: { @@ -243,6 +244,7 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { + this.deleteLoading = true const deletePromises = this.dataListSelections.map(row => { return sopRecordDelete({ site: row.site, @@ -260,8 +262,10 @@ export default { this.$message.warning(`删除了${successCount}条记录,${this.dataListSelections.length - successCount}条删除失败`) } this.getDataList() + this.deleteLoading = false }).catch(() => { this.$message.error('删除失败') + this.deleteLoading = false }) }).catch(() => {}) }