feat: 1.可接任务附件接单后才能下载 2.所有页面增加任务状态筛选

This commit is contained in:
Your Name 2026-01-16 11:46:17 +08:00
parent 3bb702a1b9
commit 96f2521511

View File

@ -84,6 +84,18 @@
<!-- 第二行:筛选条件 -->
<div class="filter-row">
<a-select
v-model:value="filters.status"
placeholder="任务状态"
class="filter-select"
allowClear
@change="handleFilterChange"
>
<a-select-option value="">全部待接</a-select-option>
<a-select-option value="pending">待接单</a-select-option>
<a-select-option value="pending_receiving_approval">待部门审核</a-select-option>
</a-select>
<a-select
v-model:value="filters.taskTypeId"
placeholder="任务类型"
@ -320,16 +332,10 @@
<Icon name="paperclip" size="sm" color="#31f08b" />
</span>
<span>附件:
<a
v-for="(url, index) in (task.attachmentUrl || '').split(',').filter(u => u.trim())"
:key="index"
:href="url.trim()"
target="_blank"
class="attachment-link"
@click.stop
>
附件{{ index + 1 }}
</a>
<span class="attachment-locked">
<Icon name="lock" size="xs" style="margin-right: 4px;" />
{{ (task.attachmentUrl || '').split(',').filter(u => u.trim()).length }}个附件(接单后可下载)
</span>
</span>
</div>
<div class="detail-item">
@ -432,6 +438,18 @@
<!-- 第二行:筛选条件 -->
<div class="filter-row">
<a-select
v-model:value="reviewFilters.status"
placeholder="审核状态"
class="filter-select"
allowClear
@change="loadReviewTasks"
>
<a-select-option value="">全部待审核</a-select-option>
<a-select-option value="pending_demand_approval">待需求审核</a-select-option>
<a-select-option value="pending_receiving_approval">待接单审核</a-select-option>
</a-select>
<a-select
v-model:value="reviewFilters.taskTypeId"
placeholder="任务类型"
@ -783,6 +801,19 @@
<!-- 第二行:筛选条件 -->
<div class="filter-row">
<a-select
v-model:value="inProgressFilters.status"
placeholder="任务状态"
class="filter-select"
allowClear
@change="loadInProgressTasks"
>
<a-select-option value="">全部</a-select-option>
<a-select-option value="in_progress">进行中</a-select-option>
<a-select-option value="pending">待接单</a-select-option>
<a-select-option value="locked">待前置完成</a-select-option>
</a-select>
<a-select
v-model:value="inProgressFilters.taskTypeId"
placeholder="任务类型"
@ -2848,6 +2879,7 @@ const taskTypeCascaderOptions = computed(() => {
// 筛选条件
const filters = reactive({
status: '' as string, // 任务状态筛选
taskTypeId: undefined as number | undefined,
demandTypeId: undefined as number | undefined,
brandId: undefined as number | undefined,
@ -2893,6 +2925,7 @@ const publishedFilters = reactive({
// 进行中任务筛选条件
const inProgressFilters = reactive({
keyword: undefined as string | undefined,
status: '' as string, // 任务状态筛选
sortBy: 'latest' as 'latest' | 'deadline' | 'progress',
taskTypeId: undefined as number | undefined,
brandId: undefined as number | undefined,
@ -2906,6 +2939,7 @@ const inProgressFilters = reactive({
// 待审核任务筛选条件
const reviewFilters = reactive({
keyword: undefined as string | undefined,
status: '' as string, // 审核状态筛选
sortBy: 'latest' as 'latest' | 'score',
taskTypeId: undefined as number | undefined,
brandId: undefined as number | undefined,
@ -3256,6 +3290,7 @@ const loadTasks = async (forceReload = false) => {
}
// 添加筛选条件
if (filters.status) params.status = filters.status
if (filters.taskTypeId) params.taskTypeId = filters.taskTypeId
if (filters.demandTypeId) params.demandTypeId = filters.demandTypeId
if (filters.brandId) params.brandId = filters.brandId
@ -4338,7 +4373,7 @@ const loadInProgressTasks = async () => {
const params: any = {
page: inProgressPagination.page,
pageSize: inProgressPagination.pageSize,
status: 'in_progress'
status: inProgressFilters.status || 'in_progress' // 支持状态筛选,默认进行中
}
// 添加筛选条件
@ -4669,6 +4704,7 @@ const loadReviewTasks = async () => {
}
// 添加筛选条件
if (reviewFilters.status) params.status = reviewFilters.status
if (reviewFilters.taskTypeId) params.taskTypeId = reviewFilters.taskTypeId
// 并行加载:主任务 + 子任务组(如果是部门负责人)
@ -7119,6 +7155,18 @@ onUnmounted(() => {
}
}
// 锁定附件提示样式
.attachment-locked {
display: inline-flex;
align-items: center;
color: #888;
font-size: 12px;
padding: 2px 8px;
background: rgba(255, 255, 255, 0.05);
border-radius: 4px;
border: 1px dashed rgba(255, 255, 255, 0.15);
}
// 展开/折叠图标
.expand-subtasks {
display: inline-flex;