提交
This commit is contained in:
1 parent
59fafb92d5
commit
6abfb6e251
1512 files changed
+1565614
-275592
No files matched your search
@@ -27,9 +27,6 @@
|
||||
@search="handleQuickSearch"
|
||||
@clear="handleQuickSearchClear"
|
||||
/>
|
||||
<el-button v-if="hasActiveFilters" class="btn-ghost" @click="clearAllFilters">
|
||||
<el-icon><Filter /></el-icon>清空列过滤
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="selectedRows.length === 1 && isEditableDraftSettlement(selectedRows[0].settlementStatus)"
|
||||
class="btn-main"
|
||||
@@ -48,46 +45,18 @@
|
||||
>
|
||||
<el-icon><Edit /></el-icon>发票信息
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="selectedRows.length === 1 && isEditableDraftSettlement(selectedRows[0].settlementStatus)"
|
||||
class="btn-ghost"
|
||||
:disabled="selectedRows.length !== 1"
|
||||
@click="handleToolbarSubmit"
|
||||
>
|
||||
<el-icon><Promotion /></el-icon>提交审批
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="
|
||||
selectedRows.length === 1 &&
|
||||
isEditableDraftSettlement(selectedRows[0].settlementStatus) &&
|
||||
canDeleteByCreator(selectedRows[0])
|
||||
"
|
||||
class="btn-ghost"
|
||||
type="warning"
|
||||
:disabled="selectedRows.length !== 1 || !canDeleteByCreator(selectedRows[0])"
|
||||
:title="selectedRows.length === 1 && !canDeleteByCreator(selectedRows[0]) ? CREATOR_DELETE_TIP : ''"
|
||||
:loading="cancelLoadingMap[selectedRows[0]?.id]"
|
||||
@click="handleToolbarCancel"
|
||||
>
|
||||
<el-icon><CircleClose /></el-icon>作废
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="selectedRows.length === 1 && selectedRows[0].canWithdraw"
|
||||
class="btn-ghost"
|
||||
type="warning"
|
||||
:disabled="selectedRows.length !== 1"
|
||||
@click="handleToolbarWithdraw"
|
||||
>
|
||||
<el-icon><RefreshLeft /></el-icon>撤回
|
||||
</el-button>
|
||||
<ListExportDropdown
|
||||
:export-fn="freightApi.export"
|
||||
:get-filter-params="getSettlementExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => r.id)"
|
||||
:visible-columns="settlementExportColumns"
|
||||
filename="结算单.xlsx"
|
||||
/>
|
||||
<ListToolbarOverflow :items="toolbarOverflowItems">
|
||||
<template #export>
|
||||
<ListExportDropdown
|
||||
:export-fn="freightApi.export"
|
||||
:get-filter-params="getSettlementExportFilterParams"
|
||||
:has-selection="true"
|
||||
:selected-ids="selectedRows.map((r) => r.id)"
|
||||
:visible-columns="settlementExportColumns"
|
||||
filename="结算单.xlsx"
|
||||
/>
|
||||
</template>
|
||||
</ListToolbarOverflow>
|
||||
|
||||
<ListToolbarEndActions
|
||||
:loading="loading"
|
||||
@@ -328,7 +297,13 @@
|
||||
<script setup lang="ts">
|
||||
import ListQuickSearchInput from '@/components/business/list-quick-search-input/index.vue'
|
||||
import ListToolbarEndActions from '@/components/business/list-toolbar-end-actions/index.vue'
|
||||
import ListToolbarOverflow from '@/components/business/list-toolbar-overflow/index.vue'
|
||||
import type { ListToolbarOverflowItem } from '@/components/business/list-toolbar-overflow/types'
|
||||
import ListExportDropdown from '@/components/business/list-export-dropdown/index.vue'
|
||||
import {
|
||||
overflowClearFiltersItem,
|
||||
overflowExportPlaceholder
|
||||
} from '@/utils/list-toolbar-overflow-items'
|
||||
import ListColumnStatsRow from '@/components/business/list-column-stats-row/index.vue'
|
||||
import ColumnHeaderFilter from '@/components/business/column-header-filter/index.vue'
|
||||
import type { StatsRowColumn } from '@/utils/list-column-stats'
|
||||
@@ -338,7 +313,6 @@ import { useServerColumnFilters } from '@/composables/useServerColumnFilters'
|
||||
import {
|
||||
CircleClose,
|
||||
Edit,
|
||||
Filter,
|
||||
Promotion,
|
||||
RefreshLeft
|
||||
} from '@element-plus/icons-vue'
|
||||
@@ -390,6 +364,42 @@ const {
|
||||
onChange: () => handleSearch()
|
||||
})
|
||||
|
||||
const toolbarOverflowItems = computed<ListToolbarOverflowItem[]>(() => {
|
||||
const row = selectedRows.value.length === 1 ? selectedRows.value[0] : null
|
||||
const draftEditable = !!row && isEditableDraftSettlement(row.settlementStatus)
|
||||
return [
|
||||
{
|
||||
key: 'submit',
|
||||
label: '提交审批',
|
||||
icon: Promotion,
|
||||
hidden: !draftEditable,
|
||||
disabled: !row,
|
||||
onClick: () => handleToolbarSubmit()
|
||||
},
|
||||
{
|
||||
key: 'cancel',
|
||||
label: '作废',
|
||||
icon: CircleClose,
|
||||
type: 'warning',
|
||||
hidden: !draftEditable || !(row && canDeleteByCreator(row)),
|
||||
disabled: !row || !canDeleteByCreator(row),
|
||||
loading: !!(row && cancelLoadingMap[row.id]),
|
||||
onClick: () => handleToolbarCancel()
|
||||
},
|
||||
{
|
||||
key: 'withdraw',
|
||||
label: '撤回',
|
||||
icon: RefreshLeft,
|
||||
type: 'warning',
|
||||
hidden: !(row && row.canWithdraw),
|
||||
disabled: !row,
|
||||
onClick: () => handleToolbarWithdraw()
|
||||
},
|
||||
overflowExportPlaceholder(),
|
||||
overflowClearFiltersItem(hasActiveFilters.value, () => clearAllFilters())
|
||||
]
|
||||
})
|
||||
|
||||
function enumOptionsFor(prop: string) {
|
||||
const def = plFreightBillsColumnFilterDefs.find((d) => d.prop === prop)
|
||||
return (def?.enumOptions || []).map((o) => ({ ...o, count: 0 }))
|
||||
|
||||
Reference in new issue
Block a user