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) => { export const getBalanceToPackage = async (packingNumber: String) => {
return await request.get({ url: `/wms/package/getBalanceToPackage?packingNumber=` + packingNumber}) 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> <ContentWrap>
<Table v-clientTable <Table ref="tableRef" v-clientTable
:selection="true"
: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 #itemCode="{row}"> <template #itemCode="{row}">
<el-button type="primary" link @click="openDetail(row, '物料代码', row.itemCode)"> <el-button type="primary" link @click="openDetail(row, '物料代码', row.itemCode)">
@ -96,6 +98,7 @@ const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:balance:create'}), // // defaultButtons.defaultAddBtn({hasPermi:'wms:balance:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:balance:import'}), // // defaultButtons.defaultImportBtn({hasPermi:'wms:balance:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:balance:export'}), // defaultButtons.defaultExportBtn({hasPermi:'wms:balance:export'}), //
defaultButtons.mainLisSelectiontPointBtn(null), //
defaultButtons.defaultFreshBtn(null),// defaultButtons.defaultFreshBtn(null),//
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
@ -126,11 +129,64 @@ 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)
} }
} }
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 = [ const butttondata = [
// { // {

Loading…
Cancel
Save