|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="[...InventoryinitRecordMain.allSchemas.searchSchema,...InventoryinitRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search :schema="[...InventoryinitRecordMain.allSchemas.searchSchema,...InventoryinitRecordDetail.allSchemas.searchSchema]" @search="searchList" @reset="searchList" /> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
@ -17,7 +17,8 @@ |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
|
<Table v-clientTable |
|
|
|
<Table ref="tableRef" v-clientTable |
|
|
|
:selection="true" |
|
|
|
:columns="tableColumns" |
|
|
|
:data="tableObject.tableList" |
|
|
|
:loading="tableObject.loading" |
|
|
@ -27,6 +28,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)"> |
|
|
@ -68,6 +70,8 @@ import * as InventoryinitRecordMainApi from '@/api/wms/inventoryinitRecordMain' |
|
|
|
import * as InventoryinitRecordDetailApi from '@/api/wms/inventoryinitRecordDetail' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' |
|
|
|
import { getAccessToken } from '@/utils/auth' |
|
|
|
|
|
|
|
// 库存初始化记录主 |
|
|
|
defineOptions({ name: 'InventoryinitRecordMain' }) |
|
|
|
|
|
|
@ -94,6 +98,7 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:inventoryinit-record-main:export'}), // 导出 |
|
|
|
defaultButtons.mainLisSelectiontPointBtn(null), // 批量标签打印 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -120,6 +125,8 @@ const buttonBaseClick = (val, item) => { |
|
|
|
getList() |
|
|
|
} |
|
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
|
} else if (val=='selection_point'){// 批量打印 |
|
|
|
handleSelectionPoint() |
|
|
|
} else { // 其他按钮 |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
@ -171,7 +178,55 @@ const searchFormClick = (searchData) => { |
|
|
|
} |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
const searchList = (model)=>{ |
|
|
|
selectionRows.value = [] |
|
|
|
setSearchParams(model) |
|
|
|
} |
|
|
|
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 BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL |
|
|
|
const handleSelectionPoint = async ()=>{ |
|
|
|
let rows:any = [] |
|
|
|
selectionRows.value.forEach(item=>{ |
|
|
|
rows = [...rows,...item.selectionRows.map(item1=>item1.id)] |
|
|
|
}) |
|
|
|
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) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
getLoading?.close() |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|