|
|
@ -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 = [ |
|
|
|
// { |
|
|
|