Browse Source

批量打印

master_hella_20240701
yufei0306 6 months ago
parent
commit
ff775c8c9b
  1. 5
      src/api/wms/package/index.ts
  2. 58
      src/views/wms/inventoryManage/balance/index.vue

5
src/api/wms/package/index.ts

@ -115,4 +115,9 @@ export const getLabelDetailPage = async (params) => {
// 根据库存余额获取包装信息进行打印标签
export const getBalanceToPackage = async (packingNumber: String) => {
return await request.get({ url: `/wms/package/getBalanceToPackage?packingNumber=` + packingNumber})
}
// 根据库存余额获取包装信息进行打印标签--批量打印
export const getBalanceToPackageSelection = async (data: any) => {
return await request.post({ url: `/wms/balance/batchPrintLabel` ,data})
}

58
src/views/wms/inventoryManage/balance/index.vue

@ -16,7 +16,8 @@
<!-- 列表 -->
<ContentWrap>
<Table v-clientTable
<Table ref="tableRef" v-clientTable
:selection="true"
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
@ -26,6 +27,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)">
@ -96,6 +98,7 @@ const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:balance:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:balance:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:balance:export'}), //
defaultButtons.mainLisSelectiontPointBtn(null), //
defaultButtons.defaultFreshBtn(null),//
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -126,11 +129,64 @@ const buttonBaseClick = (val, item) => {
getList()
}
} else if (val == 'filtrate') { //
} else if (val=='selection_point'){//
handleSelectionPoint()
} else { //
console.log('其他按钮', item)
}
}
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
})
}
}
const handleSelectionPoint = async ()=>{
let rows:any = []
selectionRows.value.forEach(item=>{
rows = [...rows,...item.selectionRows.map(item1=>item1.packingNumber)]
})
console.log('批量打印',rows.join(','))
PackageApi.getBalanceToPackageSelection(rows).then(res => {
console.log('res',res);
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)
}
}).catch(err => {
console.log(err)
})
// window.open(srcPoint.value+'&relateNumber='+rows.join(','))
}
// -
const butttondata = [
// {

Loading…
Cancel
Save