feat:生产报表-质检信息对接

pull/1/head
黄伟杰 4 weeks ago
parent 61c3663e96
commit 223ab3367c

@ -5,39 +5,68 @@
<Icon icon="ep:refresh" class="mr-5px" /> 刷新
</el-button>
</div>
<el-table v-loading="loading" :data="qualityList" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="质检编码" align="center" prop="code" width="150px" />
<el-table-column label="质检名称" align="center" prop="name" width="150px" />
<el-table-column label="质检类型" align="center" prop="type" width="100px">
<el-table v-loading="loading" :data="qualityList" :stripe="true" :show-overflow-tooltip="true" @expand-change="handleExpandChange">
<el-table-column type="expand">
<template #default="scope">
<dict-tag :type="DICT_TYPE.MES_QUALITY_TYPE" :value="scope.row.type" />
<div class="expand-content">
<el-table :data="scope.row.results" size="small" :show-header="true">
<el-table-column label="检验项名称" align="center" prop="name" min-width="150px" />
<el-table-column label="检验方式" align="center" prop="tool" min-width="100px" />
<el-table-column label="判定基准" align="center" prop="zjTypeName" min-width="100px" />
<el-table-column label="单位" align="center" prop="unitName" min-width="80px" />
<el-table-column label="上限值" align="center" prop="upperVal" min-width="80px" />
<el-table-column label="下限值" align="center" prop="lowerVal" min-width="80px" />
<el-table-column label="输入值" align="center" prop="textInput" min-width="100px" />
<el-table-column label="图片" align="center" prop="images" min-width="80px">
<template #default="scope">
<el-button v-if="scope.row.images" link type="primary" @click="handlePreviewImage(scope.row.images)"></el-button>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="检验结果" align="center" prop="zjResult" min-width="100px">
<template #default="scope">
<el-tag :type="scope.row.zjResult === 1 ? 'success' : scope.row.zjResult === 2 ? 'danger' : 'info'">
{{ getResultLabel(scope.row.zjResult) }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
</el-table>
</div>
</template>
</el-table-column>
<el-table-column label="方案名称" align="center" prop="schemaName" width="150px" />
<el-table-column label="状态" align="center" prop="status" width="100px">
<el-table-column label="质检编码" align="center" prop="code" min-width="140px" />
<el-table-column label="质检名称" align="center" prop="name" min-width="120px" />
<el-table-column label="质检分类" align="center" prop="type" min-width="100px" />
<el-table-column label="检验方案" align="center" prop="schemaName" min-width="140px" />
<el-table-column label="工序" align="center" prop="orgType" min-width="80px" />
<el-table-column label="负责人" align="center" prop="managerName" min-width="100px" />
<el-table-column label="执行人" align="center" prop="executorName" min-width="100px" />
<el-table-column label="状态" align="center" prop="status" min-width="80px">
<template #default="scope">
<dict-tag type="status" :value="scope.row.status" />
<el-tag :type="getStatusType(scope.row.status)">
{{ getStatusLabel(scope.row.status) }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="结果" align="center" prop="result" width="100px">
<el-table-column label="结果" align="center" prop="resultName" min-width="100px">
<template #default="scope">
<el-tag :type="scope.row.result === '通过' ? 'success' : 'danger'">
{{ scope.row.resultName || scope.row.result || '-' }}
{{ scope.row.resultName || '-' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="执行人" align="center" prop="executorName" width="100px" />
<el-table-column label="执行时间" align="center" prop="executeTime" width="180px">
<el-table-column label="执行时间" align="center" prop="executeTime" min-width="180px">
<template #default="scope">
{{ formatDateTime(scope.row.executeTime) }}
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180px">
<el-table-column label="创建时间" align="center" prop="createTime" min-width="180px">
<template #default="scope">
{{ formatDateTime(scope.row.createTime) }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="备注" align="center" prop="remark" min-width="150px" />
</el-table>
<!-- 分页 -->
<Pagination
@ -51,17 +80,62 @@
<script setup lang="ts">
import dayjs from 'dayjs'
import { DICT_TYPE } from '@/utils/dict'
import { ZjTaskApi } from '@/api/mes/zjtask'
defineOptions({ name: 'ProductionReportQualityInfo' })
interface ZjTaskResult {
id: number
zjType: number
zjTypeName: string
name: string
remark?: string
tool?: string
standardVal?: number
unit?: string
unitName?: string
upperVal?: number
lowerVal?: number
zjResult: number // 0- 1- 2-
images?: string
zjTime?: string
taskId: number
createTime: string
deviceId: number
textInput?: string
}
interface ZjTaskWithResults {
id: number
code: string
name?: string
type: string
schemaId: number
schemaName: string
remark?: string
ticket: number
ticketCode?: string
orgType: string
managerId?: number
managerName?: string
executorId?: number
executorName?: string
status: number
result?: string
resultName?: string
createTime: string
executeTime: string
cancelReason?: string
ticketType?: number
results: ZjTaskResult[]
}
const props = defineProps<{
taskId?: number
}>()
const loading = ref(false)
const qualityList = ref<any[]>([])
const qualityList = ref<ZjTaskWithResults[]>([])
const total = ref(0)
const queryParams = reactive({
ticket: undefined as number | undefined,
@ -105,6 +179,47 @@ const handleRefresh = () => {
getList()
}
const handleExpandChange = (row: ZjTaskWithResults, expandedRows: any[]) => {
//
}
const handlePreviewImage = (imagePath: string) => {
//
window.open(imagePath, '_blank')
}
/** 获取检验结果标签 */
const getResultLabel = (result: number): string => {
const labelMap: Record<number, string> = {
0: '待检测',
1: '检测通过',
2: '检测不通过'
}
return labelMap[result] || '未知'
}
/** 获取状态标签 */
const getStatusLabel = (status: number): string => {
const labelMap: Record<number, string> = {
0: '未开始',
1: '进行中',
2: '已完成',
3: '已取消'
}
return labelMap[status] || '未知'
}
/** 获取状态类型 */
const getStatusType = (status: number): string => {
const typeMap: Record<number, string> = {
0: 'info',
1: 'warning',
2: 'success',
3: 'danger'
}
return typeMap[status] || 'info'
}
/** 格式化日期时间 */
const formatDateTime = (value: string | Date | null) => {
if (!value) return '-'
@ -125,4 +240,8 @@ const formatDateTime = (value: string | Date | null) => {
font-weight: 600;
color: #333;
}
.expand-content {
padding: 12px;
}
</style>

@ -115,17 +115,16 @@
<el-tag :type="scope.row.isScheduled ? 'success' : 'info'">{{ scope.row.isScheduled ? '是' : '否' }}</el-tag>
</template>
</el-table-column>
<el-table-column label="生产进度" align="center" min-width="180px">
<el-table-column label="生产进度" align="center" min-width="60px">
<template #default="scope">
<div class="production-progress-cell">
<el-tooltip :content="getProductionProgressPercent(scope.row) + '%'" placement="top">
<el-progress
type="circle"
:percentage="getProductionProgressPercent(scope.row)"
:show-text="false"
:stroke-width="12"
class="production-progress-bar"
:width="40"
:stroke-width="4"
:color="getProductionProgressPercent(scope.row) === 100 ? '#67c23a' : undefined"
/>
</el-tooltip>
</div>
</template>
</el-table-column>
@ -279,7 +278,17 @@ onMounted(() => {
justify-content: center;
}
.production-progress-bar {
width: 180px;
.production-progress-cell :deep(.el-progress-circle) {
display: flex;
align-items: center;
justify-content: center;
}
.production-progress-cell :deep(.el-progress__text) {
display: flex;
align-items: center;
justify-content: center;
font-size: 10px !important;
min-width: auto !important;
}
</style>

@ -88,7 +88,6 @@ v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" hi
<el-table-column :label="t('ProductionPlan.TaskSummary.tableProductionProgressColumn')" align="center" min-width="60px">
<template #default="scope">
<div class="production-progress-cell">
<el-tooltip :content="getProductionProgressPercent(scope.row) + '%'" placement="top">
<el-progress
type="circle"
:percentage="getProductionProgressPercent(scope.row)"
@ -96,7 +95,6 @@ v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" hi
:stroke-width="4"
:color="getProductionProgressPercent(scope.row) === 100 ? '#67c23a' : undefined"
/>
</el-tooltip>
</div>
</template>
</el-table-column>

Loading…
Cancel
Save