|
|
|
@ -348,12 +348,20 @@ |
|
|
|
<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-form> |
|
|
|
<el-table |
|
|
|
ref="templateTable" |
|
|
|
:data="detailList" |
|
|
|
:height="secondHeight - 68" |
|
|
|
border |
|
|
|
@selection-change="handleTemplateSelectionChange" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column |
|
|
|
type="selection" |
|
|
|
width="55" |
|
|
|
align="center"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columnDetailList" :key="index" |
|
|
|
:sortable="item.columnSortable" |
|
|
|
@ -1352,6 +1360,7 @@ |
|
|
|
detailList: [], |
|
|
|
defectTrackingList: [], |
|
|
|
labelTemplateList: [], |
|
|
|
selectedTemplates: [], // 选中的质量检验模板 |
|
|
|
dataListLoading: false, |
|
|
|
// 展示列集 |
|
|
|
columnList: [ |
|
|
|
@ -2453,6 +2462,57 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 质量检验模板多选变化 |
|
|
|
handleTemplateSelectionChange (val) { |
|
|
|
this.selectedTemplates = val |
|
|
|
}, |
|
|
|
|
|
|
|
// 批量删除质量检验模板 |
|
|
|
batchDeleteTemplates () { |
|
|
|
if (this.selectedTemplates.length === 0) { |
|
|
|
this.$message.warning('请至少选择一项') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.$confirm(`确认删除选中的 ${this.selectedTemplates.length} 个检验模板吗?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
// 创建删除请求的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 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// ==================== 物料缺陷跟踪 ==================== |
|
|
|
|
|
|
|
// 查询物料缺陷跟踪 |
|
|
|
|