Compare commits

..

2 Commits

Author SHA1 Message Date
shaoleiliu-netizen123
7b10c956da Merge branch 'master' of https://git.evo-techina.com/sgc/mes-vue 2026-06-03 08:41:49 +08:00
shaoleiliu-netizen123
8931cf0404 页面优化 2026-06-03 08:41:47 +08:00
4 changed files with 90 additions and 48 deletions

View File

@ -400,6 +400,8 @@ const formData = reactive<OrderProject>({ ...defaultFormData })
// //使
const sourceOptions = ref<{ label: string; value: any }[]>([])
const statusOptions = ref<{ label: string; value: any }[]>([])
const prodTypeOptions = ref<{label: string; value:any} []>([])
//
const formRules = {
@ -419,11 +421,23 @@ const columns: DataTableColumns<OrderProject> = [
{ title: '项目来源', key: 'source', width: 110,align: 'center',
render(row) {
const val = row.source
console.log(sourceOptions.value);
const opt = sourceOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
},
{ title: '生产类型', key: 'prodType', width: 100 ,align: 'center',
render(row) {
const val = row.prodType
const opt = prodTypeOptions.value.find(o => o.value === val || String(o.value) === String(val))
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
},
{ title: '生产类型', key: 'prodType', width: 100 ,align: 'center'},
{ title: 'BOM版本', key: 'bomVersion', width: 100 ,align: 'center'},
{ title: '规格型号', key: 'specModel', width: 140, ellipsis: { tooltip: true } },
{ title: '单位', key: 'unit', width: 70 ,align: 'center'},
@ -434,7 +448,9 @@ const columns: DataTableColumns<OrderProject> = [
render(row) {
const val = row.status
const opt = statusOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
},
{ title: '计划完成日期', key: 'planFinishTime', width: 170 ,align: 'center'},
@ -470,8 +486,9 @@ const columns: DataTableColumns<OrderProject> = [
]
const pickMtrlStatusMap: Record<string, string> = {
'0': '未领料',
'1': '已领料',
'1': '未领料',
'2': '待定',
'3': '已领料',
}
const kingdeeMoColumns: DataTableColumns<KingdeeMoTableRow> = [
@ -516,6 +533,8 @@ const kingdeeMoColumns: DataTableColumns<KingdeeMoTableRow> = [
title: '领料状态', key: 'pickMtrlStatus', width: 90, align: 'center',
render(row) {
const val = row.pickMtrlStatus
console.log(val);
return val != null ? (pickMtrlStatusMap[String(val)] ?? val) : '-'
}
},
@ -864,11 +883,16 @@ async function handleImportUpload({ file }: UploadCustomRequestOptions) {
async function loadDictOptions() {
try {
const data = await dictDataApi.listByType('pro_source')
sourceOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
sourceOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
} catch {}
try {
const data = await dictDataApi.listByType('pro_status')
statusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
statusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
} catch {}
try {
const data = await dictDataApi.listByType("prod_type")
prodTypeOptions.value = data.map(d=>({label: d.dictLabel,value:(Number(d.dictValue) || d.dictValue),class:d.listClass}))
} catch {}
}

View File

@ -317,7 +317,7 @@
<script setup lang="ts">
import { ref, reactive, h, onMounted } from 'vue'
import {
NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions,
NButton, NSpace, NIcon, NUpload,NTag, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions,
NDropdown
} from 'naive-ui'
import {
@ -391,22 +391,27 @@ const detailColumns: DataTableColumns<Object> = [
{
title: '判定类型',
key: 'resultType',
align: 'center',
width: 80,
render: (row) => {
const val = row.resultType
const opt = qcResultTypeOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
},
{
title: '判定数量',
key: 'qty',
align: 'center',
width: 80
},
{
title: '批次号',
key: 'traceCode',
width: 80,
align: 'center',
render: (row) => {
const val = row.traceCode
return val ?? '-'
@ -416,6 +421,7 @@ const detailColumns: DataTableColumns<Object> = [
title: '不良代码',
key: 'defectCode',
width: 80,
align: 'center',
render: (row) => {
const val = row.defectCode
return val ?? '-'
@ -425,16 +431,19 @@ const detailColumns: DataTableColumns<Object> = [
title: '后续动作',
key: 'handleAction',
width: 80,
align: 'center'
},
{
title: '动作执行状态',
key: 'actionStatus',
width: 80,
align: 'center',
render: (row) => {
const val = row.actionStatus
const opt = qcActionStatusOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
}
]
@ -497,37 +506,42 @@ const formRules = {
//
const columns: DataTableColumns<QualityTesting> = [
{ type: 'selection' },
{ title: '质检编号', key: 'qcNo' },
{ title: '来源类型', key: 'sourceType',
{ title: '质检编号', key: 'qcNo',align: 'center' },
{ title: '来源类型', key: 'sourceType',align: 'center',
render(row) {
const val = row.sourceType
const opt = qcSourceTypeOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
},
// { title: 'ID(/)', key: 'sourceId' },
// { title: 'ID', key: 'orderId' },
// { title: 'ID', key: 'processId' },
// { title: 'ID', key: 'itemId' },
{ title: '报检总数', key: 'totalQty' },
{ title: '质检状态', key: 'status',
{ title: '报检总数', key: 'totalQty',align: 'center' },
{ title: '质检状态', key: 'status',align: 'center',
render(row) {
const val = row.status
const opt = qcStatusOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
},
{ title: '检验员', key: 'inspector' },
{ title: '检验完成时间', key: 'inspectTime' },
{ title: '追溯类型', key: 'traceType',
{ title: '检验员', key: 'inspector',align: 'center' },
{ title: '检验完成时间', key: 'inspectTime',align: 'center' },
{ title: '追溯类型', key: 'traceType',align: 'center',
render(row) {
const val = row.traceType
const opt = qcTraceTypeOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
},
{ title: '创建时间', key: 'createTime', width: 180 },
{ title: '更新时间', key: 'updateTime', width: 180 },
{ title: '创建时间', key: 'createTime',align: 'center', width: 180 },
{ title: '更新时间', key: 'updateTime',align: 'center', width: 180 },
{
title: '操作',
key: 'actions',
@ -781,28 +795,28 @@ async function handleImportUpload({ file }: UploadCustomRequestOptions) {
async function loadDictOptions() {
try {
const data = await dictDataApi.listByType('sys_status')
statusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
statusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class: d.listClass }))
} catch {}
try {
const data = await dictDataApi.listByType('qc_status')
qcStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
qcStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class: d.listClass }))
}catch {}
try {
const data = await dictDataApi.listByType('source_type')
qcSourceTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
qcSourceTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class: d.listClass }))
}catch {}
try {
const data = await dictDataApi.listByType('qc_trace_type')
qcTraceTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
qcTraceTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class: d.listClass }))
}catch {}
try {
const data = await dictDataApi.listByType('qc_result_type')
qcResultTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
qcResultTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class: d.listClass }))
}catch {}
try {
const data = await dictDataApi.listByType('qc_action_status')
qcActionStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
qcActionStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class: d.listClass }))
}catch {}
}

View File

@ -184,7 +184,7 @@
<script setup lang="ts">
import { ref, reactive, h, onMounted } from 'vue'
import { NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
import { NButton, NSpace, NIcon,NTag, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline, Options } from '@vicons/ionicons5'
import { submitLogApi, type SubmitLog } from '@/api/submitLog'
import { dictDataApi } from '@/api/org'
@ -243,18 +243,20 @@ const formRules = {
//
const columns: DataTableColumns<SubmitLog> = [
{ type: 'selection' },
{ title: '工序名称', key: 'processName' },
{ title: '工序编号', key: 'processCode' },
{ title: '派工编号', key: 'assingCode' },
{ title: '派工人', key: 'userName' },
{ title: '派工状态', key: 'assingStatus',
{ title: '工序名称', key: 'processName',align: 'center' },
{ title: '工序编号', key: 'processCode',align: 'center' },
{ title: '派工编号', key: 'assingCode',align: 'center' },
{ title: '派工人', key: 'userName',align: 'center' },
{ title: '派工状态', key: 'assingStatus',align: 'center',
render: (row) => {
const val = row.assingStatus
const opt = qcAssingStatusOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
},
{ title: '派工完成时间', key: 'completedTime'},
{ title: '派工完成时间', key: 'completedTime',align: 'center'},
{
title: '操作',
key: 'actions',
@ -286,7 +288,9 @@ const submitColumns = ref([
render: (row) => {
const val = row.submitStatus
const opt = qcResultTypeOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
if (!opt) return val ?? '-'
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
}
}
])
@ -474,19 +478,19 @@ async function handleImportUpload({ file }: UploadCustomRequestOptions) {
async function loadDictOptions() {
try {
const data = await dictDataApi.listByType('qc_result_type')
qcResultTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
qcResultTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
}catch {}
try {
const data = await dictDataApi.listByType('source_type')
qcSourceTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
qcSourceTypeOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
}catch {}
try {
const data = await dictDataApi.listByType('qc_status')
qcStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
qcStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
}catch {}
try {
const data = await dictDataApi.listByType('assing_status')
qcAssingStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue) }))
qcAssingStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class:d.listClass }))
}catch {}
}

View File

@ -355,15 +355,15 @@ const columns = [
minWidth: 150,
render(row:any) {
let text = ''
if(row.assingStatus == 0){
if(row.assingStatus == 1){
text = '待执行'
}else if(row.assingStatus == 1){
text = '执行中'
}else if(row.assingStatus == 2){
text = '质检中'
text = '执行中'
}else if(row.assingStatus == 3){
text = '已汇报'
text = '质检中'
}else if(row.assingStatus == 4){
text = '已汇报'
}else if(row.assingStatus == 5){
text = '已关闭'
}
@ -374,7 +374,7 @@ const columns = [
{
align:'center',
title: '工人名称',
key: 'stringUserName',
key: 'userName',
minWidth: 200
},
{