Compare commits

..

No commits in common. "7b10c956da8ecfef9f50c3bc7025b335490072e4" and "4a372c24405c25a87b2f43471a714affa5bb7c7a" have entirely different histories.

4 changed files with 48 additions and 90 deletions

View File

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

View File

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

View File

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

View File

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