Browse Source

2025-11-27

master
fengyuan_yang 2 months ago
parent
commit
8e2a2abe01
  1. 12
      src/views/modules/qc/qcPartAttribute.vue
  2. 8
      src/views/modules/qc/sopListComponent.vue

12
src/views/modules/qc/qcPartAttribute.vue

@ -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
})
})
},

8
src/views/modules/qc/sopListComponent.vue

@ -3,7 +3,7 @@
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-button type="primary" @click="fileUploadHandle()">文件上传</el-button>
<el-button type="danger" @click="batchDeleteHandle()" :disabled="dataListSelections.length === 0">删除</el-button>
<el-button type="danger" @click="batchDeleteHandle()" :disabled="dataListSelections.length === 0" :loading="deleteLoading">删除</el-button>
</el-form-item>
</el-form>
@ -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(() => {})
}

Loading…
Cancel
Save