|
|
@ -26,6 +26,9 @@ |
|
|
|
v-model:pageSize="tableObject.pageSize" |
|
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
|
v-model:sort="tableObject.sort" |
|
|
|
row-key="id" |
|
|
|
:selection="true" |
|
|
|
@getSelectionRows="getSelectionRows" |
|
|
|
> |
|
|
|
<template #code="{row}"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|
|
@ -106,11 +109,13 @@ const { tableObject, tableMethods } = useTable({ |
|
|
|
// 获得表格的各种操作 |
|
|
|
const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
const selectionRowsData = ref([])//多选数据 |
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
// defaultButtons.defaultAddBtn({hasPermi:'wms:delivery-calendar:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:delivery-calendar:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn(null), // 导出 |
|
|
|
defaultButtons.mainLisSelectiontDeleteBtn(null), // 批量删除 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -132,6 +137,8 @@ const buttonBaseClick = (val, item) => { |
|
|
|
handleImport() |
|
|
|
} else if (val == 'export') { // 导出 |
|
|
|
handleExport() |
|
|
|
} else if (val == 'selection_delete') { // 批量删除 |
|
|
|
handleDelete() |
|
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
|
getList() |
|
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
@ -151,7 +158,7 @@ const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
handleDelete(row) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -192,12 +199,37 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
} |
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
|
const handleDelete = async (id: number) => { |
|
|
|
const handleDelete = async (row?:any) => { |
|
|
|
try { |
|
|
|
// 发起删除 |
|
|
|
let list = [] |
|
|
|
if (row) { |
|
|
|
// 删除的二次确认 |
|
|
|
await message.delConfirm() |
|
|
|
// 发起删除 |
|
|
|
await DeliveryCalendarApi.deleteDeliveryCalendar(id) |
|
|
|
list.push({ |
|
|
|
supplierCode:row.supplierCode, |
|
|
|
supplierAddress:row.supplierAddress, |
|
|
|
model:row.model, |
|
|
|
yearAndMonth:row.yearAndMonth, |
|
|
|
}) |
|
|
|
} else { |
|
|
|
console.log(selectionRowsData.value) |
|
|
|
if (selectionRowsData.value.length == 0) { |
|
|
|
message.warning('请选择数据') |
|
|
|
return |
|
|
|
} |
|
|
|
// 删除的二次确认 |
|
|
|
await message.delConfirm() |
|
|
|
selectionRowsData.value.forEach(item => { |
|
|
|
list.push({ |
|
|
|
supplierCode:item.supplierCode, |
|
|
|
supplierAddress:item.supplierAddress, |
|
|
|
model:item.model, |
|
|
|
yearAndMonth:item.yearAndMonth, |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
await DeliveryCalendarApi.deleteDeliveryCalendar(list) |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
@ -276,7 +308,10 @@ const updateDateTableColumns = ()=>{ |
|
|
|
tableColumns.value = [...orginTableColumns.value,...dateColumns.value] |
|
|
|
console.log('tableColumns',tableColumns.value) |
|
|
|
} |
|
|
|
|
|
|
|
const getSelectionRows = (currentPage,currentPageSelectionRows) => { |
|
|
|
selectionRowsData.value = currentPageSelectionRows |
|
|
|
console.log(selectionRowsData.value) |
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getListHead() |
|
|
|