|
|
@ -16,7 +16,8 @@ |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table v-clientTable |
|
|
|
<Table ref="tableRef" :selection="true" |
|
|
|
v-clientTable |
|
|
|
: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 #number="{row}"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|
|
@ -125,6 +127,7 @@ const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:package:create'}), // 新增 |
|
|
|
// defaultButtons.defaultImportBtn({hasPermi:'wms:package:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:package:export'}), // 导出 |
|
|
|
defaultButtons.mainLisSelectiontPointBtn(null), // 批量标签打印 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -148,6 +151,8 @@ const buttonBaseClick = (val, item) => { |
|
|
|
handleImport() |
|
|
|
} else if (val == 'export') { // 导出 |
|
|
|
handleExport() |
|
|
|
} else if (val=='selection_point'){// 批量打印 |
|
|
|
handleSelectionPoint() |
|
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
|
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { |
|
|
|
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) => { |
|
|
|
// if (val.indexOf(row.status) > -1) { |
|
|
|