Browse Source

库位标签批量打印

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

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

@ -16,7 +16,7 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table v-clientTable ref="tableRef" :selection="true"
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -26,6 +26,7 @@
v-model:pageSize="tableObject.pageSize" v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage" v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
@getSelectionRows="getSelectionRows"
> >
<template #number="{row}"> <template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> <el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
@ -90,6 +91,7 @@ const { getList, setSearchParams } = tableMethods
const HeadButttondata = [ const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:package:create'}), // // defaultButtons.defaultAddBtn({hasPermi:'wms:package:create'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:package:export'}), // defaultButtons.defaultExportBtn({hasPermi:'wms:package:export'}), //
defaultButtons.mainLisSelectiontPointBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -110,6 +112,8 @@ const buttonBaseClick = (val, item) => {
getList() getList()
} }
} else if (val == 'filtrate') { // } else if (val == 'filtrate') { //
} else if (val=='selection_point'){//
handleSelectionPoint()
}else { // }else { //
console.log('其他按钮', item) console.log('其他按钮', item)
} }
@ -186,6 +190,16 @@ const handlePoint = async (row) => {
window.open(src.value+'&id='+row.id) 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) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {
@ -196,6 +210,34 @@ const searchFormClick = (searchData) => {
getList() // 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 () => { onMounted(async () => {
getList() getList()

Loading…
Cancel
Save