Browse Source

批量打印功能

master_hella_20240701
yufei0306 7 months ago
parent
commit
80ec265349
  1. 19
      src/components/Table/src/Table.vue
  2. 13
      src/utils/disposition/defaultButtons.ts

19
src/components/Table/src/Table.vue

@ -58,7 +58,7 @@ export default defineComponent({
default: () => []
}
},
emits: ['update:pageSize', 'update:currentPage', 'register', 'update:sort'],
emits: ['update:pageSize', 'update:currentPage', 'register', 'update:sort','getSelectionRows'],
setup(props, { attrs, slots, emit, expose }) {
const elTableRef = ref<ComponentRef<typeof ElTable>>()
@ -101,9 +101,19 @@ export default defineComponent({
}
}
const toggleRowSelection = (row: Recordable, selected: boolean) => {
const tableRef = unref(elTableRef)
tableRef?.toggleRowSelection(unref(getProps).data.find(item=>item.id === row.id), selected)
}
const selections = ref<Recordable[]>([])
const sortRef = ref()
const selectRow = ()=>{
emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows())
}
const selectAll = (val)=>{
emit('getSelectionRows', currentPageRef.value,elTableRef.value?.getSelectionRows())
}
const selectionChange = (selection: Recordable[]) => {
selections.value = selection
}
@ -116,7 +126,8 @@ export default defineComponent({
expose({
setProps,
setColumn,
selections
selections,
toggleRowSelection
})
const pagination = computed(() => {
@ -306,6 +317,8 @@ export default defineComponent({
header-cell-class-name="tableHeader"
row-class-name="tableRow"
cell-class-name="tableRow"
onSelect={selectRow}
onSelect-all={selectAll}
onSelection-change={selectionChange}
onSort-change={sortChange}
{...unref(getBindValue)}

13
src/utils/disposition/defaultButtons.ts

@ -741,6 +741,19 @@ export function mainListPointBtn(option:any) {
hasPermi: ''
})
}
// 主列表-批量打印
export function mainLisSelectiontPointBtn(option:any) {
return __defaultBtnOption(option,{
label: '批量打印',
name: 'selection_point',
hide: false,
type: 'primary',
icon: 'ep:download',
color: '',
float:'left',
hasPermi: ''
})
}
// 主列表-生成采购收货申请
export function mainListGenerateApplicationBtn(option:any) {
return __defaultBtnOption(option,{

Loading…
Cancel
Save