Browse Source

批量打印

master_hella_20240701
yufei0306 8 months ago
parent
commit
9a280185b8
  1. 45
      src/views/wms/basicDataManage/labelManage/callmaterials/index.vue

45
src/views/wms/basicDataManage/labelManage/callmaterials/index.vue

@ -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,6 +139,8 @@ const buttonBaseClick = (val, item) => {
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} 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()

Loading…
Cancel
Save