Browse Source

批量打印功能

hella_online_20240821
wangyufei 3 months ago
parent
commit
096a045a2f
  1. 56
      src/views/wms/inventoryManage/package/index.vue

56
src/views/wms/inventoryManage/package/index.vue

@ -16,7 +16,8 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<Table v-clientTable <Table ref="tableRef" :selection="true"
v-clientTable
:columns="tableColumns" :columns="tableColumns"
:data="tableObject.tableList" :data="tableObject.tableList"
:loading="tableObject.loading" :loading="tableObject.loading"
@ -26,6 +27,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)">
@ -125,6 +127,7 @@ const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:package:create'}), // defaultButtons.defaultAddBtn({hasPermi:'wms:package:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:package:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'wms:package:import'}), //
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), //
@ -148,6 +151,8 @@ const buttonBaseClick = (val, item) => {
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') { //
handleExport() handleExport()
} else if (val=='selection_point'){//
handleSelectionPoint()
} else if (val == 'refresh') { // } else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
searchFormClick({ searchFormClick({
@ -162,6 +167,55 @@ const buttonBaseClick = (val, item) => {
} }
} }
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
})
}
}
const handleSelectionPoint = async ()=>{
let rows:any = []
selectionRows.value.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.number)]
})
console.log('批量打印',rows.join(','))
let getLoading = ElLoading.service({
lock: true,
text: 'loading...',
background: 'rgba(0, 0, 0, 0.7)'
})
// InventoryinitRecordDetailApi.printLabelBatchByIdSelection(rows.join(",")).then(res => {
// console.log('res',res);
// getLoading?.close()
// if(res.zzLabel){
// //
// const src = ref(BASE_URL + '/jmreport/view/922734157577715712?token=' + getAccessToken())
// window.open(src.value+'&asn_number='+res.zzLabel)
// }
// if (res.cgLabel) {
// //
// const src = ref(BASE_URL + '/jmreport/view/922729953438072832?token=' + getAccessToken())
// window.open(src.value+'&asn_number='+res.cgLabel)
// }
// if(!res.cgLabel&&!res.zzLabel){
// message.warning('线!')
// }
// }).catch(err => {
// console.log(err)
// getLoading?.close()
// })
}
// //
// const isShowMainButton = (row,val) => { // const isShowMainButton = (row,val) => {
// if (val.indexOf(row.status) > -1) { // if (val.indexOf(row.status) > -1) {

Loading…
Cancel
Save