This commit is contained in:
zlwu committed 2026-07-05 10:07:24 +08:00
1 parent 33c038b8d9
commit 54b27a3f0e
253 files changed
+30060 -14298

No files matched your search

+55 -74
View File
@@ -29,7 +29,7 @@
<el-option label="草稿" value="draft" />
<el-option label="进行中" value="processing" />
<el-option label="已完成" value="completed" />
<el-option label="已取消" value="cancelled" />
<el-option label="已作废" value="cancelled" />
</el-select>
</el-form-item>
<el-form-item label="运输状态">
@@ -38,52 +38,33 @@
<el-option label="已安排" value="arranged" />
</el-select>
</el-form-item>
</div>
<div v-show="filterExpanded" id="pl-plan-archive-filter-extra" class="filter-extra">
<div class="filter-grid">
<el-form-item label="客户名称">
<el-input
v-model="searchForm.customerName"
placeholder="搜索客户名称"
clearable
/>
</el-form-item>
<el-form-item label="计划日期">
<el-date-picker
v-model="dateRange"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="归档状态">
<el-select v-model="searchForm.archiveStatus" placeholder="全部" clearable>
<el-option label="未归档" value="unarchived" />
<el-option label="已归档" value="archived" />
</el-select>
</el-form-item>
</div>
<el-form-item label="客户名称">
<el-input
v-model="searchForm.customerName"
placeholder="搜索客户名称"
clearable
/>
</el-form-item>
<el-form-item label="计划日期">
<el-date-picker
v-model="dateRange"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="归档状态">
<el-select v-model="searchForm.archiveStatus" placeholder="全部" clearable>
<el-option label="未归档" value="unarchived" />
<el-option label="已归档" value="archived" />
</el-select>
</el-form-item>
</div>
<div class="filter-actions">
<div class="filter-actions-start">
<button
v-if="showFilterToggle"
type="button"
class="btn-link btn-filter-toggle"
:aria-expanded="filterExpanded"
aria-controls="pl-plan-archive-filter-extra"
@click="filterExpanded = !filterExpanded"
>
{{ filterExpanded ? '收起更多' : '展开更多' }}
<el-icon>
<ArrowUpBold v-if="filterExpanded" />
<ArrowDownBold v-else />
</el-icon>
</button>
</div>
<div class="filter-actions-start" />
<div class="filter-actions-end">
<el-button class="btn-ghost" :loading="loading" @click="handleReset">
<el-icon><RefreshLeft /></el-icon>重置
@@ -106,18 +87,12 @@
aria-label="计划日期快捷筛选"
@change="handleDateShortcut"
/>
<el-input
<ListQuickSearchInput
v-model="quickSearch"
class="quick-search-input"
placeholder="计划编号/客户名称"
clearable
@keyup.enter="handleQuickSearch"
@search="handleQuickSearch"
@clear="handleQuickSearchClear"
>
<template #suffix>
<el-icon class="quick-search-icon" @click="handleQuickSearch"><Search /></el-icon>
</template>
</el-input>
/>
<el-button
v-if="selectedPlan && selectedPlan.followStatus !== 'cancelled'"
class="btn-ghost"
@@ -283,10 +258,14 @@
<PlPlanFormDialog
v-model:visible="formDialogVisible"
:plan-id="editingPlanId"
@success="fetchData"
@success="handlePlanMutationSuccess"
/>
<PlPlanViewDialog v-model:visible="viewVisible" :plan-id="viewPlanId">
<PlPlanViewDialog
ref="viewDialogRef"
v-model:visible="viewVisible"
:plan-id="viewPlanId"
>
<template v-if="viewingPlan" #hero-actions>
<el-button
v-if="viewingPlan.followStatus !== 'cancelled'"
@@ -309,17 +288,16 @@
<PlPlanArchiveDialog
v-model:visible="archiveDialogVisible"
:plan-id="archivePlanId"
@success="fetchData"
@success="handlePlanMutationSuccess"
/>
</div>
</template>
<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 { usePersistedListColumns } from '@/composables/usePersistedListColumns'
import {
ArrowDownBold,
ArrowUpBold,
Edit,
FolderChecked,
RefreshLeft,
@@ -337,15 +315,16 @@ import {
getPlPlanArchiveStatusLabel,
getPlPlanArchiveStatusTagType
} from '@/utils/pl-display'
import { syncViewRowFromFlatList } from '@/utils/view-dialog-refresh'
const loading = ref(false)
const formDialogVisible = ref(false)
const editingPlanId = ref('')
const viewVisible = ref(false)
const viewPlanId = ref('')
const viewDialogRef = ref<InstanceType<typeof PlPlanViewDialog>>()
const archiveDialogVisible = ref(false)
const archivePlanId = ref('')
const filterExpanded = ref(false)
const planList = ref<Plan[]>([])
const listColumnDefs = [
@@ -371,6 +350,21 @@ const {
const selectedRows = ref<Plan[]>([])
const viewingPlan = ref<Plan | null>(null)
function syncViewingPlanFromList() {
syncViewRowFromFlatList(viewingPlan, planList.value)
}
async function refreshViewIfOpen() {
if (!viewVisible.value || !viewPlanId.value) return
syncViewingPlanFromList()
await viewDialogRef.value?.reload()
}
async function handlePlanMutationSuccess() {
await fetchData()
await refreshViewIfOpen()
}
const selectedPlan = computed(() => (selectedRows.value.length === 1 ? selectedRows.value[0] : null))
const dateRange = ref<string[]>([])
const quickSearch = ref('')
@@ -390,9 +384,6 @@ const pagination = reactive({
total: 0
})
const PLAN_FILTER_FIELD_COUNT = 7
const showFilterToggle = computed(() => PLAN_FILTER_FIELD_COUNT > 4)
function getPlanTypeTagType(type: string) {
const map: Record<string, string> = { direct: 'primary', inbound: 'success', outbound: 'warning' }
return map[type] || 'info'
@@ -418,7 +409,7 @@ function getFollowStatusLabel(status: string) {
draft: '草稿',
processing: '进行中',
completed: '已完成',
cancelled: '已取消'
cancelled: '已作废'
}
return map[status] || status
}
@@ -462,7 +453,6 @@ function handleReset() {
searchForm.archiveStatus = ''
quickSearch.value = ''
resetDateShortcut()
filterExpanded.value = false
pagination.page = 1
fetchData()
}
@@ -551,13 +541,4 @@ onMounted(() => {
.pl-plan-list-toolbar-row {
flex-wrap: wrap;
}
.quick-search-input {
width: 280px;
flex-shrink: 0;
}
.quick-search-icon {
cursor: pointer;
}
</style>