This commit is contained in:
zlwu committed 2026-05-28 08:37:37 +08:00
1 parent 2020f371f4
commit f1f5d24eff
31 files changed
+13600 -13813

No files matched your search

@@ -312,6 +312,7 @@
if (sourceType === 'task_complete') return 'primary'
if (sourceType === 'manual_in') return 'success'
if (sourceType === 'manual_out') return 'warning'
if (sourceType === 'outbound_handover') return 'primary'
return 'info'
}
@@ -319,6 +320,7 @@
if (sourceType === 'task_complete') return '任务完成'
if (sourceType === 'manual_in') return '手动入库'
if (sourceType === 'manual_out') return '手动出库'
if (sourceType === 'outbound_handover') return '出库交接'
return sourceType || '-'
}
@@ -1,4 +1,4 @@
<!-- 旧「质检任务」菜单入口:重定向至质检管理 · 质检任务 Tab -->
<!-- 旧「质检任务」菜单入口:重定向至质检工单(层级列表) -->
<template>
<div />
</template>
@@ -10,9 +10,10 @@
const route = useRoute()
onMounted(() => {
const { tab: _tab, ...rest } = route.query
router.replace({
name: 'QualityInspectionQcWorkOrder',
query: { ...route.query, tab: 'task' }
query: rest
})
})
</script>
File diff suppressed because it is too large. Load diff
@@ -3,38 +3,10 @@
<template>
<div class="page-container">
<section class="panel">
<div class="panel-entity-switch" role="tablist" aria-label="视图类型">
<button
type="button"
class="entity-switch-card"
:class="{ 'is-active': mainTab === 'work-order' }"
role="tab"
:aria-selected="mainTab === 'work-order'"
@click="mainTab = 'work-order'"
>
<span class="entity-switch-card__icon"><el-icon><Document /></el-icon></span>
<span class="entity-switch-card__main">
<span class="entity-switch-card__title">质检工单</span>
<span class="entity-switch-card__desc">工单创建、配置与跟踪</span>
</span>
</button>
<button
type="button"
class="entity-switch-card"
:class="{ 'is-active': mainTab === 'task' }"
role="tab"
:aria-selected="mainTab === 'task'"
@click="mainTab = 'task'"
>
<span class="entity-switch-card__icon"><el-icon><Tickets /></el-icon></span>
<span class="entity-switch-card__main">
<span class="entity-switch-card__title">质检任务</span>
<span class="entity-switch-card__desc">任务执行与结果录入</span>
</span>
</button>
<div class="panel-top">
<h2 class="title-bar-heading">质检工单</h2>
</div>
<div v-show="mainTab === 'work-order'" class="panel-entity-body">
<el-tabs
v-model="activeTypeTab"
class="work-order-type-tabs"
@@ -117,12 +89,29 @@
<div class="list-body list-wrap">
<el-table
:class="['list-table', { 'list-table--no-action-col list-table--all-tab': activeTypeTab === 'all' }]"
ref="qcWorkOrderListTableRef"
:class="[
'qc-work-order-table list-table',
{ 'list-table--no-action-col list-table--all-tab': activeTypeTab === 'all' }
]"
:data="tableData"
v-loading="loading"
stripe
row-key="id"
@row-dblclick="handleView"
@expand-change="handleWorkOrderRowExpand"
>
<el-table-column type="expand" min-width="48">
<template #default="{ row }">
<QcWorkOrderTaskSubList
v-if="activeTypeTab !== 'all'"
:work-order="row"
:refresh-token="taskSubListRefreshToken"
@changed="handleWorkOrderTasksChanged"
/>
<div v-else class="qc-work-order-expand-all-hint">全部工单视图请进入具体类型 Tab 查看任务</div>
</template>
</el-table-column>
<el-table-column
type="index"
label="序号"
@@ -487,6 +476,7 @@
width="900px"
class="dialog-form-layout"
align-center
append-to-body
destroy-on-close
:close-on-click-modal="false"
>
@@ -716,16 +706,14 @@
v-model:visible="outboundViewVisible"
:work-order-id="outboundViewId"
/>
</div>
<QcTaskTab v-if="mainTab === 'task'" />
</section>
</div>
</template>
<script setup lang="ts">
import { formatMoneyDisplay } from '@/utils/money-format'
import { ref, reactive, computed, onMounted } from 'vue'
import { ref, reactive, computed, onMounted, nextTick } from 'vue'
import type { TableInstance } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
Close,
@@ -738,8 +726,7 @@
Plus,
EditPen,
Delete,
More,
Tickets
More
} from '@element-plus/icons-vue'
import { fetchQcLabTestItemsActive, type QcLabTestItem } from '@/api/qc-lab-test-item'
import { fetchQcThirdPartyItemsActive, type QcThirdPartyItem } from '@/api/qc-third-party-item'
@@ -817,12 +804,12 @@
import { downloadAttachmentFile } from '@/utils/download-attachment'
import WorkOrderRemarkDialog from '@/components/business/work-order-remark-dialog/index.vue'
import OutboundQcViewDialog from './OutboundQcViewDialog.vue'
import QcTaskTab from './QcTaskTab.vue'
import QcWorkOrderTaskSubList from './QcWorkOrderTaskSubList.vue'
defineOptions({ name: 'QualityInspectionQcWorkOrder' })
const route = useRoute()
const mainTab = ref('work-order')
const qcWorkOrderListTableRef = ref<TableInstance>()
const taskSubListRefreshToken = ref(0)
type WorkOrderTypeTab = 'inbound' | 'temporary' | 'outbound' | 'all'
const activeTypeTab = ref<WorkOrderTypeTab>('inbound')
@@ -1637,12 +1624,28 @@
await fetchConfigureQcWorkOrder(configuringId.value, { ...configureForm })
ElMessage.success(configureIsEdit.value ? '检测项目已更新' : '配置成功,已生成质检任务')
configureVisible.value = false
loadData()
taskSubListRefreshToken.value += 1
await loadData()
} finally {
configureLoading.value = false
}
}
async function layoutWorkOrderTable() {
await nextTick()
qcWorkOrderListTableRef.value?.doLayout?.()
}
async function handleWorkOrderRowExpand(_row: unknown, _expandedRows: unknown[]) {
await layoutWorkOrderTable()
}
async function handleWorkOrderTasksChanged() {
taskSubListRefreshToken.value += 1
await loadData()
await layoutWorkOrderTable()
}
const outboundViewVisible = ref(false)
const outboundViewId = ref('')
@@ -1709,96 +1712,54 @@
)
onMounted(() => {
const tab = route.query.tab
if (tab === 'task') {
mainTab.value = 'task'
}
loadData()
})
</script>
<style scoped lang="scss">
.panel-entity-switch {
display: flex;
justify-content: center;
gap: 12px;
padding: 16px 16px 12px;
.qc-work-order-table :deep(td.el-table__expanded-cell) {
padding: 0 !important;
text-align: left !important;
}
.entity-switch-card {
display: flex;
align-items: center;
gap: 12px;
min-width: 220px;
max-width: 280px;
flex: 1;
padding: 14px 18px;
.qc-work-order-table :deep(td.el-table__expanded-cell > .cell) {
display: block !important;
padding: 0 !important;
text-align: left !important;
}
.qc-work-order-table :deep(.el-table__expand-icon) {
width: 28px;
height: 28px;
border-radius: 6px;
border: 1px solid var(--mint-border, #d9e8e2);
border-radius: 10px;
background: var(--surface, #fff);
cursor: pointer;
text-align: left;
transition:
border-color 0.2s ease,
background-color 0.2s ease,
box-shadow 0.2s ease;
&:hover:not(.is-active) {
border-color: #a7f3d0;
background: #f8fafc;
}
&.is-active {
border-color: var(--primary, #10b981);
background: var(--primary-bg, #ecfdf5);
box-shadow: 0 0 0 1px rgb(16 185 129 / 12%);
}
}
.entity-switch-card__icon {
display: flex;
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
flex-shrink: 0;
border-radius: 8px;
background: #f1f5f9;
color: #64748b;
font-size: 20px;
.entity-switch-card.is-active & {
background: #fff;
color: var(--primary-dark, #059669);
}
}
.entity-switch-card__main {
display: flex;
flex-direction: column;
gap: 2px;
min-width: 0;
}
.entity-switch-card__title {
font-size: 14px;
font-weight: 600;
color: var(--text, #1e293b);
line-height: 1.4;
.entity-switch-card.is-active & {
color: var(--primary-dark, #059669);
}
}
.entity-switch-card__desc {
font-size: 12px;
transition:
background 0.15s ease,
border-color 0.15s ease;
color: var(--mint-text-muted, #64748b);
line-height: 1.4;
background: var(--mint-surface, #fff);
}
.panel-entity-body {
min-width: 0;
.qc-work-order-table :deep(.el-table__expand-icon:hover) {
background: var(--mint-primary-bg, #ecfdf5);
border-color: #10b981;
color: var(--mint-primary-dark, #059669);
}
.qc-work-order-table :deep(.el-table__expand-icon--expanded) {
background: var(--mint-primary-bg, #ecfdf5);
border-color: #10b981;
color: var(--mint-primary-dark, #059669);
}
.qc-work-order-expand-all-hint {
padding: 16px 16px 16px 40px;
font-size: 13px;
color: var(--mint-text-muted, #64748b);
background: #f8fafc;
}
/* 全部工单 Tab 无操作列,略增高行高便于阅读多列信息 */