|
|
@ -16,7 +16,7 @@ |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table |
|
|
|
<Table ref="tableRef" :selection="true" |
|
|
|
:columns="tableColumns" |
|
|
|
:data="tableObject.tableList" |
|
|
|
:loading="tableObject.loading" |
|
|
@ -26,6 +26,7 @@ |
|
|
|
v-model:pageSize="tableObject.pageSize" |
|
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
|
v-model:sort="tableObject.sort" |
|
|
|
@getSelectionRows="getSelectionRows" |
|
|
|
> |
|
|
|
<template #itemCode="{row}"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.itemCode)"> |
|
|
@ -111,6 +112,7 @@ const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:callmaterials:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:callmaterials:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:callmaterials:export'}), // 导出 |
|
|
|
defaultButtons.mainLisSelectiontPointBtn(null), // 批量标签打印 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -137,7 +139,9 @@ const buttonBaseClick = (val, item) => { |
|
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
|
getList() |
|
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
|
} else { // 其他按钮 |
|
|
|
} else if (val=='selection_point'){//批量打印 |
|
|
|
handleSelectionPoint() |
|
|
|
}else { // 其他按钮 |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
|
} |
|
|
@ -229,6 +233,7 @@ const handleExport = async () => { |
|
|
|
} finally { |
|
|
|
exportLoading.value = false |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
@ -237,7 +242,14 @@ const src = ref(BASE_URL + '/jmreport/view/924811818898698240?token=' + getAcces |
|
|
|
const handlePoint = async (row) => { |
|
|
|
window.open(src.value+'&relateNumber='+row.id) |
|
|
|
} |
|
|
|
|
|
|
|
// 批量打印 |
|
|
|
const handleSelectionPoint = ()=>{ |
|
|
|
let rows:any = [] |
|
|
|
selectionRows.value.forEach(item=>{ |
|
|
|
rows = [...rows,...item.selectionRows.map(item1=>item1.id)] |
|
|
|
}) |
|
|
|
console.log('批量打印',rows) |
|
|
|
} |
|
|
|
/** 导入 */ |
|
|
|
const importFormRef = ref() |
|
|
|
const handleImport = () => { |
|
|
@ -262,6 +274,35 @@ const searchFormClick = (searchData) => { |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
|
|
|
|
watch( |
|
|
|
() => tableObject.tableList, |
|
|
|
() => { |
|
|
|
const currentRows = selectionRows.value.find(item=>item.currentPage==tableObject.currentPage) |
|
|
|
if(currentRows){ |
|
|
|
nextTick(() => { |
|
|
|
currentRows.selectionRows.forEach(item=>{ |
|
|
|
tableRef.value.toggleRowSelection(item,true) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
|
|
|
|
const selectionRows = ref<any>([]) |
|
|
|
const tableRef = ref() |
|
|
|
|
|
|
|
const getSelectionRows = (currentPage,currentPageSelectionRows) => { |
|
|
|
console.log("getSelectionRows",currentPage,currentPageSelectionRows) |
|
|
|
const currentRows = selectionRows.value.find(item=>item.currentPage==currentPage) |
|
|
|
if(currentRows){ |
|
|
|
currentRows.selectionRows = currentPageSelectionRows |
|
|
|
}else{ |
|
|
|
selectionRows.value.push({ |
|
|
|
currentPage, |
|
|
|
selectionRows:currentPageSelectionRows |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|