|
|
|
@ -348,7 +348,7 @@ |
|
|
|
<el-button type="primary" @click="addFastModal()" icon="el-icon-plus">新增模板</el-button> |
|
|
|
<el-button v-if="!editBatchVisible" @click="editBatchModel">批量编辑</el-button> |
|
|
|
<el-button v-if="editBatchVisible" @click="batchModel" :loading="batchLoading">批量保存</el-button> |
|
|
|
<el-button v-if="!editBatchVisible" type="danger" @click="batchDeleteTemplates" :disabled="selectedTemplates.length === 0">批量删除</el-button> |
|
|
|
<el-button v-if="!editBatchVisible" type="danger" @click="batchDeleteTemplates" :disabled="selectedTemplates.length === 0" :loading="templateDeleteLoading">批量删除</el-button> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
ref="templateTable" |
|
|
|
@ -494,7 +494,7 @@ |
|
|
|
width="80" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="text" size="small" @click="deletePartAttributeDetails(scope.row)" style="color: #f56c6c;">删除</el-button> |
|
|
|
<el-button type="text" size="small" @click="deletePartAttributeDetails(scope.row)" style="color: #f56c6c;" :loading="scope.row.deleting">删除</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -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 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|