Browse Source

送货日历批量删除

intex_online20250311
张立 4 weeks ago
parent
commit
4b2e6466b7
  1. 4
      src/api/wms/deliveryCalendar/index.ts
  2. 45
      src/views/wms/basicDataManage/supplierManage/deliveryCalendar/index.vue

4
src/api/wms/deliveryCalendar/index.ts

@ -40,8 +40,8 @@ export const updateDeliveryCalendar = async (data: DeliveryCalendarVO) => {
}
// 删除送货日历
export const deleteDeliveryCalendar = async (id: number) => {
return await request.delete({ url: `/wms/delivery-calendar/delete?id=` + id })
export const deleteDeliveryCalendar = async (data) => {
return await request.post({ url: `/wms/delivery-calendar/delete`, data })
}
// 导出送货日历 Excel

45
src/views/wms/basicDataManage/supplierManage/deliveryCalendar/index.vue

@ -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()

Loading…
Cancel
Save