|
|
@@ -1,72 +1,46 @@
|
|
|
<!-- 生产工单展开行 · 生产任务子列表 -->
|
|
|
<template>
|
|
|
<div class="work-order-task-sublist">
|
|
|
- <div class="list-toolbar work-order-task-sublist__toolbar">
|
|
|
- <div class="list-toolbar-row">
|
|
|
- <el-button
|
|
|
- class="btn-main"
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- :disabled="!canDispatch"
|
|
|
- @click="handleDispatch"
|
|
|
+ <div class="work-order-task-sublist__panel" v-loading="loading">
|
|
|
+ <div v-if="tableData.length" class="work-order-task-cards-wrap">
|
|
|
+ <div class="work-order-task-sublist__summary">
|
|
|
+ <span class="work-order-task-sublist__count">共 {{ tableData.length }} 项任务</span>
|
|
|
+ <el-button
|
|
|
+ class="work-order-task-sublist__refresh-icon"
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ :loading="loading"
|
|
|
+ @click="loadData"
|
|
|
+ >
|
|
|
+ <el-icon><RefreshLeft /></el-icon>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ class="btn-main work-order-task-sublist__dispatch"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ :disabled="!canDispatch"
|
|
|
+ @click="handleDispatch"
|
|
|
+ >
|
|
|
+ <el-icon><Position /></el-icon>派发任务
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-for="(row, idx) in tableData"
|
|
|
+ :key="row.id || idx"
|
|
|
+ class="work-order-task-card"
|
|
|
+ @dblclick="handleViewDetail(row)"
|
|
|
>
|
|
|
- <el-icon><Position /></el-icon>派发任务
|
|
|
- </el-button>
|
|
|
- <el-button class="btn-ghost" size="small" :loading="loading" @click="loadData">
|
|
|
- <el-icon><RefreshLeft /></el-icon>刷新
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="work-order-task-sublist__body">
|
|
|
- <el-table
|
|
|
- class="list-table work-order-task-sublist__table"
|
|
|
- :data="tableData"
|
|
|
- v-loading="loading"
|
|
|
- stripe
|
|
|
- size="small"
|
|
|
- @row-dblclick="handleViewDetail"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- type="index"
|
|
|
- label="序号"
|
|
|
- min-width="68"
|
|
|
- align="center"
|
|
|
- :index="(i) => i + 1"
|
|
|
- />
|
|
|
- <el-table-column prop="taskNo" label="任务号" min-width="150" align="center" />
|
|
|
- <el-table-column prop="taskType" label="任务类型" min-width="120" align="center">
|
|
|
- <template #default="{ row }">
|
|
|
+ <div class="work-order-task-card__head">
|
|
|
+ <span class="work-order-task-card__name">{{ row.taskName || row.taskNo || '—' }}</span>
|
|
|
+ <el-tag :type="taskStatusTag(row.taskStatus).type" size="small">
|
|
|
+ {{ taskStatusTag(row.taskStatus).label }}
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ <div class="work-order-task-card__meta">
|
|
|
+ <span class="work-order-task-card__code">{{ row.taskNo || '—' }}</span>
|
|
|
<el-tag :type="productionTaskTypeTag(row.taskType, row.orderSource).type" size="small">
|
|
|
{{ productionTaskTypeTag(row.taskType, row.orderSource).label }}
|
|
|
</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="taskName"
|
|
|
- label="任务名称"
|
|
|
- min-width="160"
|
|
|
- align="center"
|
|
|
- show-overflow-tooltip
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="routeName"
|
|
|
- label="工艺路线"
|
|
|
- min-width="140"
|
|
|
- align="center"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
- <template #default="{ row }">{{ row.routeName || '—' }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="taskStatus" label="任务状态" min-width="110" align="center">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-tag :type="taskStatusTag(row.taskStatus).type" size="small">{{
|
|
|
- taskStatusTag(row.taskStatus).label
|
|
|
- }}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="conclusion" label="生产结论" min-width="100" align="center">
|
|
|
- <template #default="{ row }">
|
|
|
<el-tag
|
|
|
v-if="productionConclusionTagType(row.conclusion)"
|
|
|
:type="productionConclusionTagType(row.conclusion)"
|
|
|
@@ -74,63 +48,81 @@
|
|
|
>
|
|
|
{{ row.conclusionLabel || productionConclusionLabel(row.conclusion) }}
|
|
|
</el-tag>
|
|
|
- <span v-else>—</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="startedTime" label="开始时间" min-width="170" align="center">
|
|
|
- <template #default="{ row }">{{ row.startedTime || '—' }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="completedTime" label="完成时间" min-width="170" align="center">
|
|
|
- <template #default="{ row }">{{ row.completedTime || '—' }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" min-width="260" fixed="right" align="center">
|
|
|
- <template #default="{ row }">
|
|
|
- <div class="work-order-task-sublist__ops">
|
|
|
- <el-button
|
|
|
- v-if="canEnterExecution(row)"
|
|
|
- class="btn-op-item primary"
|
|
|
- type="primary"
|
|
|
- @click="handleEnterExecution(row)"
|
|
|
- >
|
|
|
- <el-icon><VideoPlay /></el-icon>进入执行
|
|
|
- </el-button>
|
|
|
- <el-button v-else class="btn-op-item primary" @click="handleViewDetail(row)">
|
|
|
- <el-icon><View /></el-icon>查看
|
|
|
+ </div>
|
|
|
+ <div class="work-order-task-sublist__ops">
|
|
|
+ <el-button
|
|
|
+ v-if="canEnterExecution(row)"
|
|
|
+ class="btn-op-item primary"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click.stop="handleEnterExecution(row)"
|
|
|
+ >
|
|
|
+ <el-icon><VideoPlay /></el-icon>进入执行
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-else
|
|
|
+ class="btn-op-item primary"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ @click.stop="handleViewDetail(row)"
|
|
|
+ >
|
|
|
+ <el-icon><View /></el-icon>查看
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown
|
|
|
+ v-if="hasMoreTaskActions(row)"
|
|
|
+ trigger="hover"
|
|
|
+ @command="(cmd) => handleDropdownCommand(cmd, row)"
|
|
|
+ >
|
|
|
+ <el-button class="btn-op-item" size="small" @click.stop>
|
|
|
+ <el-icon><More /></el-icon>
|
|
|
</el-button>
|
|
|
- <el-dropdown
|
|
|
- v-if="hasMoreTaskActions(row)"
|
|
|
- trigger="hover"
|
|
|
- @command="(cmd) => handleDropdownCommand(cmd, row)"
|
|
|
- >
|
|
|
- <el-button class="btn-op-item">
|
|
|
- <el-icon><More /></el-icon>
|
|
|
- </el-button>
|
|
|
- <template #dropdown>
|
|
|
- <el-dropdown-menu>
|
|
|
- <el-dropdown-item v-if="canEnterExecution(row)" command="view">
|
|
|
- <el-icon><View /></el-icon>查看
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item v-if="canEditTask(row)" command="editInfo">
|
|
|
- <el-icon><EditPen /></el-icon>编辑信息
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item v-if="canEditTask(row)" command="editRoute">
|
|
|
- <el-icon><EditPen /></el-icon>编辑工艺
|
|
|
- </el-dropdown-item>
|
|
|
- <el-dropdown-item v-if="canDeleteTask(row)" command="delete" divided>
|
|
|
- <el-icon><Delete /></el-icon>删除
|
|
|
- </el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </template>
|
|
|
- </el-dropdown>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <el-empty
|
|
|
- v-if="!loading && !tableData.length"
|
|
|
- description="暂无任务,可点击「派发任务」创建"
|
|
|
- :image-size="72"
|
|
|
- />
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item v-if="canEnterExecution(row)" command="view">
|
|
|
+ <el-icon><View /></el-icon>查看
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item v-if="canEditTask(row)" command="editInfo">
|
|
|
+ <el-icon><EditPen /></el-icon>编辑信息
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item v-if="canEditTask(row)" command="editRoute">
|
|
|
+ <el-icon><EditPen /></el-icon>编辑工艺
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item v-if="canDeleteTask(row)" command="delete" divided>
|
|
|
+ <el-icon><Delete /></el-icon>删除
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="!loading" class="work-order-task-cards-wrap work-order-task-cards-wrap--empty">
|
|
|
+ <div class="work-order-task-sublist__summary">
|
|
|
+ <el-button
|
|
|
+ class="work-order-task-sublist__refresh-icon"
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ :loading="loading"
|
|
|
+ @click="loadData"
|
|
|
+ >
|
|
|
+ <el-icon><RefreshLeft /></el-icon>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ class="btn-main work-order-task-sublist__dispatch"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ :disabled="!canDispatch"
|
|
|
+ @click="handleDispatch"
|
|
|
+ >
|
|
|
+ <el-icon><Position /></el-icon>派发任务
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <el-empty
|
|
|
+ class="work-order-task-sublist__empty"
|
|
|
+ description="暂无任务,可点击「派发任务」创建"
|
|
|
+ :image-size="56"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<TaskExecutionDialog
|
|
|
@@ -325,36 +317,139 @@
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.work-order-task-sublist {
|
|
|
- padding: 12px 16px 16px 40px;
|
|
|
+ padding: 8px 12px 10px 40px;
|
|
|
background: #f8fafc;
|
|
|
text-align: left;
|
|
|
}
|
|
|
|
|
|
- .work-order-task-sublist__toolbar {
|
|
|
- padding: 0 0 8px;
|
|
|
- border-bottom: none;
|
|
|
+ .work-order-task-sublist__panel {
|
|
|
+ min-height: 32px;
|
|
|
}
|
|
|
|
|
|
- .work-order-task-sublist__body {
|
|
|
- display: block;
|
|
|
- width: 100%;
|
|
|
- max-width: 100%;
|
|
|
- overflow: hidden;
|
|
|
+ .work-order-task-cards-wrap {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ align-items: flex-start;
|
|
|
+ gap: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .work-order-task-sublist__summary {
|
|
|
+ flex: 0 0 auto;
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 4px 8px;
|
|
|
+ padding-top: 8px;
|
|
|
+ min-height: 34px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .work-order-task-sublist__count {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #94a3b8;
|
|
|
+ line-height: 1.35;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+
|
|
|
+ .work-order-task-sublist__refresh-icon {
|
|
|
+ flex-shrink: 0;
|
|
|
+ padding: 0 2px;
|
|
|
+ height: 20px;
|
|
|
+ font-size: 14px;
|
|
|
+
|
|
|
+ .el-icon {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .work-order-task-sublist__dispatch {
|
|
|
+ flex-shrink: 0;
|
|
|
}
|
|
|
|
|
|
- .work-order-task-sublist__table {
|
|
|
- width: 100%;
|
|
|
+ .work-order-task-cards-wrap--empty {
|
|
|
+ align-items: center;
|
|
|
|
|
|
- :deep(.el-table__inner-wrapper),
|
|
|
- :deep(.el-table__header-wrapper),
|
|
|
- :deep(.el-table__body-wrapper) {
|
|
|
- width: 100%;
|
|
|
+ .work-order-task-sublist__summary {
|
|
|
+ padding-top: 0;
|
|
|
+ min-height: auto;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ .work-order-task-sublist__empty {
|
|
|
+ flex: 1;
|
|
|
+ min-width: 200px;
|
|
|
+ padding: 4px 0;
|
|
|
+
|
|
|
+ :deep(.el-empty__description) {
|
|
|
+ margin-top: 4px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .work-order-task-card {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 6px;
|
|
|
+ flex: 0 0 248px;
|
|
|
+ width: 248px;
|
|
|
+ max-width: 248px;
|
|
|
+ padding: 8px 10px;
|
|
|
+ border: 1px solid #e2e8f0;
|
|
|
+ border-radius: 8px;
|
|
|
+ background: #fff;
|
|
|
+ cursor: default;
|
|
|
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ border-color: #a7f3d0;
|
|
|
+ box-shadow: 0 2px 6px rgba(16, 185, 129, 0.1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .work-order-task-card__head {
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
+ justify-content: space-between;
|
|
|
+ gap: 6px;
|
|
|
+ min-width: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .work-order-task-card__name {
|
|
|
+ flex: 1;
|
|
|
+ min-width: 0;
|
|
|
+ font-size: 13px;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #1e293b;
|
|
|
+ line-height: 1.35;
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ overflow: hidden;
|
|
|
+ word-break: break-word;
|
|
|
+ }
|
|
|
+
|
|
|
+ .work-order-task-card__meta {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ align-items: center;
|
|
|
+ gap: 4px 6px;
|
|
|
+ min-width: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .work-order-task-card__code {
|
|
|
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
|
+ font-size: 11px;
|
|
|
+ color: #475569;
|
|
|
+ line-height: 1.35;
|
|
|
+ max-width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ }
|
|
|
+
|
|
|
.work-order-task-sublist__ops {
|
|
|
display: flex;
|
|
|
- justify-content: center;
|
|
|
- gap: 8px;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ align-items: center;
|
|
|
+ gap: 6px;
|
|
|
+ padding-top: 2px;
|
|
|
}
|
|
|
</style>
|