Browse Source

库位标签批量打印

master_hella_20240701
zhaoyiran 6 months ago
parent
commit
4c07b12841
  1. 46
      src/views/wms/basicDataManage/labelManage/locationLabel/index.vue

46
src/views/wms/basicDataManage/labelManage/locationLabel/index.vue

@ -16,7 +16,7 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table v-clientTable 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 #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
@ -90,6 +91,7 @@ const { getList, setSearchParams } = tableMethods
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:package:create'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:package:export'}), //
defaultButtons.mainLisSelectiontPointBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -110,7 +112,9 @@ const buttonBaseClick = (val, item) => {
getList()
}
} else if (val == 'filtrate') { //
} else { //
} else if (val=='selection_point'){//
handleSelectionPoint()
}else { //
console.log('其他按钮', item)
}
}
@ -186,6 +190,16 @@ const handlePoint = async (row) => {
window.open(src.value+'&id='+row.id)
}
const srcPoint = ref(BASE_URL + '/jmreport/view/953469704945139712?token=' + getAccessToken())
const handleSelectionPoint = async ()=>{
let rows:any = []
selectionRows.value.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.id)]
})
console.log('批量打印',rows.join(','))
window.open(srcPoint.value+'&relateNumber='+rows.join(','))
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
@ -196,6 +210,34 @@ 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