|
|
|
@ -130,11 +130,14 @@ |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" @click="searchSOSRouting()" style="margin-top: 5px" class="" :loading="seqNoModalLoading">添加</el-button> |
|
|
|
<el-button type="danger" @click="deleteSeqNoByOrderNo()" style="margin-top: 5px" class="">删除</el-button> |
|
|
|
<el-button type="danger" @click="deleteSelectedSeqNo()" style="margin-top: 5px" class="" :disabled="selectedSeqNoRows.length === 0">删除勾选</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<el-table :height="400" :data="seqNoList" border style="width: 100%;" class="choose-sos-table"> |
|
|
|
<el-table :height="400" :data="seqNoList" border style="width: 100%;" class="choose-sos-table" |
|
|
|
@selection-change="handleSeqNoSelectionChange" ref="seqNoTable"> |
|
|
|
<el-table-column type="selection" width="55" header-align="center" align="center"></el-table-column> |
|
|
|
<el-table-column v-for="(item,index) in columnList2" :key="index" :sortable="item.columnSortable" |
|
|
|
:prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip" |
|
|
|
:align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth" |
|
|
|
@ -481,6 +484,7 @@ export default { |
|
|
|
endDate: '', |
|
|
|
}, |
|
|
|
seqNoList: [], |
|
|
|
selectedSeqNoRows: [], // 存储选中的行数据 |
|
|
|
height: 200, |
|
|
|
pageIndex: 1, |
|
|
|
pageSize: 20, |
|
|
|
@ -1902,6 +1906,38 @@ export default { |
|
|
|
// 用户取消删除 |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 处理表格选择变化 |
|
|
|
handleSeqNoSelectionChange(selection) { |
|
|
|
this.selectedSeqNoRows = selection |
|
|
|
}, |
|
|
|
// 删除勾选的数据 |
|
|
|
deleteSelectedSeqNo() { |
|
|
|
if (this.selectedSeqNoRows.length === 0) { |
|
|
|
this.$message.warning('请先勾选要删除的数据!') |
|
|
|
return false |
|
|
|
} |
|
|
|
this.$confirm(`确定要删除选中的 ${this.selectedSeqNoRows.length} 条数据吗?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
}).then(() => { |
|
|
|
// 获取要删除的行的唯一标识(使用 orderNo + lineItemNo 作为唯一标识) |
|
|
|
const deleteKeys = this.selectedSeqNoRows.map(row => `${row.orderNo}_${row.lineItemNo || ''}`) |
|
|
|
// 过滤掉选中的行 |
|
|
|
this.seqNoList = this.seqNoList.filter(row => { |
|
|
|
const rowKey = `${row.orderNo}_${row.lineItemNo || ''}` |
|
|
|
return !deleteKeys.includes(rowKey) |
|
|
|
}) |
|
|
|
// 清空选中状态 |
|
|
|
this.selectedSeqNoRows = [] |
|
|
|
if (this.$refs.seqNoTable) { |
|
|
|
this.$refs.seqNoTable.clearSelection() |
|
|
|
} |
|
|
|
this.$message.success(`成功删除 ${deleteKeys.length} 条数据`) |
|
|
|
}).catch(() => { |
|
|
|
// 用户取消删除 |
|
|
|
}) |
|
|
|
}, |
|
|
|
saveMaterialDetail() { |
|
|
|
for (let i = 0; i < this.sobomList.length; i++) { |
|
|
|
if ( |
|
|
|
|