Merge branch 'master' of https://git.evo-techina.com/sgc/mes-vue
This commit is contained in:
commit
e56f0900c6
@ -143,6 +143,7 @@ export interface ProcessPlanItemVO {
|
|||||||
|
|
||||||
assignWorkList?: AssignWorkItem[]
|
assignWorkList?: AssignWorkItem[]
|
||||||
|
|
||||||
|
reportedQuantity?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ export interface AssingWork {
|
|||||||
id:number,
|
id:number,
|
||||||
processId:number,
|
processId:number,
|
||||||
processName:number,
|
processName:number,
|
||||||
|
processCode?:string,
|
||||||
userId:string,
|
userId:string,
|
||||||
quantity:number,
|
quantity:number,
|
||||||
rework:number,
|
rework:number,
|
||||||
@ -22,6 +23,11 @@ export interface AssingWork {
|
|||||||
workshopId:number,
|
workshopId:number,
|
||||||
sectionId:number,
|
sectionId:number,
|
||||||
deviceId:number,
|
deviceId:number,
|
||||||
|
deviceName?:string,
|
||||||
|
workshopName?:string,
|
||||||
|
sectionName?:string,
|
||||||
|
materialCode?:string,
|
||||||
|
materialName?:string,
|
||||||
traceId:number,
|
traceId:number,
|
||||||
qcNum:number
|
qcNum:number
|
||||||
}
|
}
|
||||||
@ -65,7 +71,15 @@ export function pauseresume(data:any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//我的派工任务
|
//我的派工任务
|
||||||
export function mytasks(params:{page:number,pageSize:number,processName:string}) {
|
export function mytasks(params:{
|
||||||
|
page:number
|
||||||
|
pageSize:number
|
||||||
|
processName?:string
|
||||||
|
processId?:number | string
|
||||||
|
assingCode?:string
|
||||||
|
materialCode?:string
|
||||||
|
materialName?:string
|
||||||
|
}) {
|
||||||
return request({
|
return request({
|
||||||
url: `/mes/dispatch/my-tasks`,
|
url: `/mes/dispatch/my-tasks`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
|||||||
@ -46,13 +46,26 @@
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="pagination"
|
|
||||||
:row-key="(row) => row.id"
|
:row-key="(row) => row.id"
|
||||||
:scroll-x="1200"
|
:scroll-x="1200"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">
|
||||||
|
<n-pagination
|
||||||
|
v-model:page="pagination.page"
|
||||||
|
v-model:page-size="pagination.pageSize"
|
||||||
|
:item-count="pagination.itemCount"
|
||||||
|
:page-sizes="[2,10, 20, 50, 100]"
|
||||||
|
show-size-picker
|
||||||
|
show-quick-jumper
|
||||||
@update:page="handlePageChange"
|
@update:page="handlePageChange"
|
||||||
@update:page-size="handlePageSizeChange"
|
@update:page-size="handlePageSizeChange"
|
||||||
@update:checked-row-keys="handleCheck"
|
>
|
||||||
/>
|
<template #prefix>
|
||||||
|
共 {{ pagination.itemCount }} 条
|
||||||
|
</template>
|
||||||
|
</n-pagination>
|
||||||
|
</div>
|
||||||
</n-card>
|
</n-card>
|
||||||
|
|
||||||
<!-- 新增/编辑弹窗 -->
|
<!-- 新增/编辑弹窗 -->
|
||||||
@ -181,6 +194,8 @@ const formRules = {
|
|||||||
// 表格列
|
// 表格列
|
||||||
const columns: DataTableColumns<FlowingAround> = [
|
const columns: DataTableColumns<FlowingAround> = [
|
||||||
{ type: 'selection' },
|
{ type: 'selection' },
|
||||||
|
{ title: '物料名称', key: 'materialName' },
|
||||||
|
{ title: '物料编码', key: 'materialCode' },
|
||||||
{ title: '当前序ID', key: 'currentlyPrefaceName' },
|
{ title: '当前序ID', key: 'currentlyPrefaceName' },
|
||||||
{ title: '下一序ID', key: 'nextPrefaceName' },
|
{ title: '下一序ID', key: 'nextPrefaceName' },
|
||||||
{ title: '业务来源', key: 'businessName' },
|
{ title: '业务来源', key: 'businessName' },
|
||||||
|
|||||||
@ -28,12 +28,12 @@
|
|||||||
<div class="card-stats">
|
<div class="card-stats">
|
||||||
<div class="stat-row">
|
<div class="stat-row">
|
||||||
<span class="stat-label">完成</span>
|
<span class="stat-label">完成</span>
|
||||||
<span class="stat-value">{{ completedQty }} / {{ totalQty }}</span>
|
<span class="stat-value">{{ reportedQuantity }} / {{ totalQty }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="stat-row">
|
<div class="stat-row">
|
||||||
<span class="stat-label">合格 / 不合格</span>
|
<span class="stat-label">合格 / 不合格</span>
|
||||||
<span class="stat-value">
|
<span class="stat-value">
|
||||||
<em class="ok">{{ qualifiedQty }}</em>
|
<em class="ok">{{ completedQty }}</em>
|
||||||
<span class="sep">/</span>
|
<span class="sep">/</span>
|
||||||
<em class="bad">{{ scrapQty }}</em>
|
<em class="bad">{{ scrapQty }}</em>
|
||||||
</span>
|
</span>
|
||||||
@ -155,6 +155,7 @@ const emit = defineEmits<{
|
|||||||
submitDetail: [process: ProcessPlanItemVO]
|
submitDetail: [process: ProcessPlanItemVO]
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
const reportedQuantity = computed(() => props.process.reportedQuantity ?? 0)
|
||||||
const totalQty = computed(() => props.process.quantity ?? 0)
|
const totalQty = computed(() => props.process.quantity ?? 0)
|
||||||
const completedQty = computed(() => props.process.completedQty ?? 0)
|
const completedQty = computed(() => props.process.completedQty ?? 0)
|
||||||
const scrapQty = computed(() => props.process.scrapQty ?? 0)
|
const scrapQty = computed(() => props.process.scrapQty ?? 0)
|
||||||
|
|||||||
@ -37,6 +37,7 @@
|
|||||||
clearable
|
clearable
|
||||||
remote
|
remote
|
||||||
:clear-filter-after-select="false"
|
:clear-filter-after-select="false"
|
||||||
|
@change="loadNc"
|
||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</n-gi>
|
</n-gi>
|
||||||
@ -192,11 +193,11 @@ async function loadSection() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//加载下发数据
|
//加载下发数据
|
||||||
async function loadNc() {
|
async function loadNc(row) {
|
||||||
const res = await loadAllNcCode()
|
const res = await loadAllNcCode(row)
|
||||||
ncList.value = res.map((n: any) => {
|
ncList.value = res.map((n: any) => {
|
||||||
return {
|
return {
|
||||||
label: n.ncName,
|
label: n.name,
|
||||||
value: n.id
|
value: n.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -206,6 +207,5 @@ async function loadNc() {
|
|||||||
|
|
||||||
loadSection()
|
loadSection()
|
||||||
slehand()
|
slehand()
|
||||||
loadNc()
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -50,6 +50,7 @@
|
|||||||
|
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<n-data-table
|
<n-data-table
|
||||||
|
remote
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
|
|||||||
@ -480,15 +480,28 @@ const formRules = {
|
|||||||
const columns: DataTableColumns<QualityTesting> = [
|
const columns: DataTableColumns<QualityTesting> = [
|
||||||
// { type: 'selection' },
|
// { type: 'selection' },
|
||||||
{ title: '质检编号', key: 'qcNo',align: 'center' },
|
{ title: '质检编号', key: 'qcNo',align: 'center' },
|
||||||
{ title: '来源类型', key: 'sourceType',align: 'center',
|
{
|
||||||
render(row) {
|
title: '物料名称',
|
||||||
const val = row.sourceType
|
key: 'materialName',
|
||||||
const opt = qcSourceTypeOptions.value.find(o => o.value === val || String(o.value) === String(val))
|
align: 'center',
|
||||||
if (!opt) return val ?? '-'
|
width: 150
|
||||||
|
|
||||||
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '物料编码',
|
||||||
|
key: 'materialCode',
|
||||||
|
align: 'center',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
// { 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))
|
||||||
|
// if (!opt) return val ?? '-'
|
||||||
|
|
||||||
|
// return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
{ title: '业务来源', key: 'businessName',align: 'center'},
|
||||||
// { title: '来源业务ID(汇报单/派工单等)', key: 'sourceId' },
|
// { title: '来源业务ID(汇报单/派工单等)', key: 'sourceId' },
|
||||||
// { title: '关联生产订单ID', key: 'orderId' },
|
// { title: '关联生产订单ID', key: 'orderId' },
|
||||||
// { title: '关联工序计划ID', key: 'processId' },
|
// { title: '关联工序计划ID', key: 'processId' },
|
||||||
|
|||||||
@ -1,16 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="toolbar">
|
|
||||||
<n-space>
|
|
||||||
<n-button
|
|
||||||
size="small"
|
|
||||||
:disabled="tableLoading || !AssingWorkTableData.length"
|
|
||||||
@click="AssingWorkToggleExpandAll"
|
|
||||||
>
|
|
||||||
{{ AssingWorkAllExpanded ? '全部收起' : '全部展开' }}
|
|
||||||
</n-button>
|
|
||||||
</n-space>
|
|
||||||
</div>
|
|
||||||
<n-scrollbar x-scrollable>
|
<n-scrollbar x-scrollable>
|
||||||
<n-data-table
|
<n-data-table
|
||||||
v-model:expanded-row-keys="AssingWorkExpandedKeys"
|
v-model:expanded-row-keys="AssingWorkExpandedKeys"
|
||||||
@ -18,7 +7,7 @@
|
|||||||
:data="AssingWorkTableData"
|
:data="AssingWorkTableData"
|
||||||
:loading="tableLoading"
|
:loading="tableLoading"
|
||||||
:row-key="RowKey"
|
:row-key="RowKey"
|
||||||
:scroll-x="1800"
|
:scroll-x="1700"
|
||||||
:max-height="1000"
|
:max-height="1000"
|
||||||
size="small"
|
size="small"
|
||||||
style="margin-bottom:15px"
|
style="margin-bottom:15px"
|
||||||
@ -26,7 +15,15 @@
|
|||||||
/>
|
/>
|
||||||
</n-scrollbar>
|
</n-scrollbar>
|
||||||
|
|
||||||
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">
|
<div class="pagination-container">
|
||||||
|
<n-button
|
||||||
|
size="small"
|
||||||
|
quaternary
|
||||||
|
:disabled="tableLoading || !AssingWorkTableData.length"
|
||||||
|
@click="AssingWorkToggleExpandAll"
|
||||||
|
>
|
||||||
|
{{ AssingWorkAllExpanded ? '全部收起' : '全部展开' }}
|
||||||
|
</n-button>
|
||||||
<n-pagination
|
<n-pagination
|
||||||
v-model:page="pagination.page"
|
v-model:page="pagination.page"
|
||||||
v-model:page-size="pagination.pageSize"
|
v-model:page-size="pagination.pageSize"
|
||||||
@ -135,6 +132,9 @@ const AssingWorkTableData = ref<AssingWork[]>([])
|
|||||||
const AssingWorkExpandedKeys = ref<Array<string |number>>([])
|
const AssingWorkExpandedKeys = ref<Array<string |number>>([])
|
||||||
|
|
||||||
const processName = ref<string>()
|
const processName = ref<string>()
|
||||||
|
const assingCode = ref<string>()
|
||||||
|
const materialCode = ref<string>()
|
||||||
|
const materialName = ref<string>()
|
||||||
|
|
||||||
|
|
||||||
//派工详情弹窗
|
//派工详情弹窗
|
||||||
@ -153,7 +153,7 @@ const AssingWorkColumns :DataTableColumns<AssingWork> = [
|
|||||||
align:"center",
|
align:"center",
|
||||||
title:"派工编号",
|
title:"派工编号",
|
||||||
key:"assingCode",
|
key:"assingCode",
|
||||||
minWidth:150,
|
width: 170,
|
||||||
render(row:any) {
|
render(row:any) {
|
||||||
return h(
|
return h(
|
||||||
'a',
|
'a',
|
||||||
@ -175,21 +175,74 @@ const AssingWorkColumns :DataTableColumns<AssingWork> = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
align:'center',
|
align:'center',
|
||||||
title: '工序名称',
|
title: '物料编码',
|
||||||
key: 'processName',
|
key: 'materialCode',
|
||||||
minWidth: 200
|
width: 120,
|
||||||
|
ellipsis: { tooltip: true },
|
||||||
|
render(row:any) {
|
||||||
|
return row.materialCode || '-'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
align:'center',
|
||||||
|
title: '物料名称',
|
||||||
|
key: 'materialName',
|
||||||
|
width: 140,
|
||||||
|
ellipsis: { tooltip: true },
|
||||||
|
render(row:any) {
|
||||||
|
return row.materialName || '-'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
align:'center',
|
||||||
|
title: '工序名称',
|
||||||
|
key: 'processName',
|
||||||
|
width: 120,
|
||||||
|
ellipsis: { tooltip: true }
|
||||||
|
},
|
||||||
|
/*{
|
||||||
align:'center',
|
align:'center',
|
||||||
title: '工序编号',
|
title: '工序编号',
|
||||||
key: 'processCode',
|
key: 'processCode',
|
||||||
minWidth: 200
|
width: 100
|
||||||
|
}, */
|
||||||
|
{
|
||||||
|
align:'center',
|
||||||
|
title: '是否质检',
|
||||||
|
key: 'qualityInspection',
|
||||||
|
width: 90,
|
||||||
|
render(row) {
|
||||||
|
var opt = row.qualityInspection
|
||||||
|
if (opt == 0) {
|
||||||
|
return h(NTag, { type: 'error', size: 'small' }, { default: () => "否" })
|
||||||
|
}
|
||||||
|
if (opt == 1) {
|
||||||
|
return h(NTag, { type: 'success', size: 'small' }, { default: () => "是" })
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
align:'center',
|
||||||
|
title: '是否入库',
|
||||||
|
key: 'storageEntry',
|
||||||
|
width: 90,
|
||||||
|
render(row) {
|
||||||
|
var opt = row.storageEntry
|
||||||
|
if (opt == 0) {
|
||||||
|
return h(NTag, { type: 'error', size: 'small' }, { default: () => "否" })
|
||||||
|
}
|
||||||
|
if (opt == 1) {
|
||||||
|
return h(NTag, { type: 'success', size: 'small' }, { default: () => "是" })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
align:'center',
|
align:'center',
|
||||||
title: '派工状态',
|
title: '派工状态',
|
||||||
key: 'assingStatus',
|
key: 'assingStatus',
|
||||||
minWidth: 150,
|
width: 90,
|
||||||
render(row:any) {
|
render(row:any) {
|
||||||
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))
|
||||||
@ -215,31 +268,32 @@ const AssingWorkColumns :DataTableColumns<AssingWork> = [
|
|||||||
align:'center',
|
align:'center',
|
||||||
title: '工位/设备',
|
title: '工位/设备',
|
||||||
key: 'deviceName',
|
key: 'deviceName',
|
||||||
minWidth: 200
|
width: 110,
|
||||||
|
ellipsis: { tooltip: true }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align:'center',
|
align:'center',
|
||||||
title: '数量',
|
title: '数量',
|
||||||
minWidth: 100,
|
width: 70,
|
||||||
key: 'quantity'
|
key: 'quantity'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align:'center',
|
align:'center',
|
||||||
title: '完成数量',
|
title: '完成数量',
|
||||||
key: 'completedQuantity',
|
key: 'completedQuantity',
|
||||||
minWidth: 150
|
width: 80
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align:'center',
|
align:'center',
|
||||||
title: '完成时间',
|
title: '完成时间',
|
||||||
key: 'completedTime',
|
key: 'completedTime',
|
||||||
minWidth: 180
|
width: 160
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
align:'center',
|
align:'center',
|
||||||
title: '状态',
|
title: '状态',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
minWidth: 100,
|
width: 80,
|
||||||
render(row:any) {
|
render(row:any) {
|
||||||
if(row.status == 0){
|
if(row.status == 0){
|
||||||
return h(NTag, {
|
return h(NTag, {
|
||||||
@ -278,7 +332,7 @@ const AssingWorkColumns :DataTableColumns<AssingWork> = [
|
|||||||
align:'center',
|
align:'center',
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
width: 250,
|
width: 180,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
render(row:any) {
|
render(row:any) {
|
||||||
const buttons:any = []
|
const buttons:any = []
|
||||||
@ -402,25 +456,34 @@ function handlePageSizeChange(pageSize: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// //获取列表数据
|
// //获取列表数据
|
||||||
function getlist() {
|
async function getlist() {
|
||||||
try{
|
tableLoading.value = true
|
||||||
mytasks({
|
try {
|
||||||
page:pagination.page,
|
const rps: any = await mytasks({
|
||||||
pageSize:pagination.pageSize,
|
page: pagination.page,
|
||||||
processName:processName.value
|
pageSize: pagination.pageSize,
|
||||||
}).then((rps:any) => {
|
processName: processName.value || undefined,
|
||||||
AssingWorkTableData.value = rps.records
|
assingCode: assingCode.value || undefined,
|
||||||
pagination.itemCount = rps.total
|
materialCode: materialCode.value || undefined,
|
||||||
|
materialName: materialName.value || undefined,
|
||||||
})
|
})
|
||||||
}catch(error) {
|
AssingWorkTableData.value = rps?.records ?? []
|
||||||
console.log(error);
|
pagination.itemCount = rps?.total ?? 0
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
} finally {
|
||||||
|
tableLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadTableData = async(params:Record<string,any>) => {
|
const loadTableData = async (params: Record<string, any> = {}) => {
|
||||||
processName.value = params.processName
|
processName.value = params.processName || undefined
|
||||||
getlist()
|
assingCode.value = params.assingCode || undefined
|
||||||
|
materialCode.value = params.materialCode || undefined
|
||||||
|
materialName.value = params.materialName || undefined
|
||||||
|
pagination.page = 1
|
||||||
|
AssingWorkExpandedKeys.value = []
|
||||||
|
await getlist()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -628,8 +691,11 @@ defineExpose({
|
|||||||
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.toolbar {
|
.pagination-container {
|
||||||
margin-bottom: 12px;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 12px;
|
||||||
}
|
}
|
||||||
.pgClass {
|
.pgClass {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|||||||
@ -47,14 +47,42 @@
|
|||||||
</template>
|
</template>
|
||||||
</n-pagination>
|
</n-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!--质检详情弹窗-->
|
||||||
|
<n-modal v-model:show="showAssingWorkDetail" title="派工详情" style="width: 1000px" >
|
||||||
|
<n-card hoverable>
|
||||||
|
<template #header>
|
||||||
|
<div style="display:flex;justify-content:space-between;align-items:center;width:100%">
|
||||||
|
<span>明细列表</span>
|
||||||
|
<n-button text @click="detailIsCollapse = !detailIsCollapse">
|
||||||
|
<n-icon :component="detailIsCollapse ? ArrowDownOutline : ArrowUpOutline" />
|
||||||
|
</n-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<n-data-table
|
||||||
|
v-show="!detailIsCollapse"
|
||||||
|
:columns="detailColumns"
|
||||||
|
:data="detailTableData"
|
||||||
|
:row-key="(row:any) => row.id"
|
||||||
|
:scroll-x="700"
|
||||||
|
max-height="320"
|
||||||
|
:pagination="{ pageSize:4 }"
|
||||||
|
/>
|
||||||
|
</n-card>
|
||||||
|
</n-modal>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</n-card>
|
</n-card>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NCard, NDataTable, NGi,NTag, NGrid,DataTableColumns} from "naive-ui";
|
import {NCard, NDataTable, NGi, NTag, NGrid, DataTableColumns, NIcon, NButton} from "naive-ui";
|
||||||
import {onMounted, ref, h, reactive} from "vue";
|
import {onMounted, ref, h, reactive} from "vue";
|
||||||
import { dictDataApi } from '@/api/org'
|
import { dictDataApi } from '@/api/org'
|
||||||
|
|
||||||
import {QualityTesting,qualityTestingApi} from "@/api/qualityTesting.ts";
|
import {QualityTesting,qualityTestingApi} from "@/api/qualityTesting.ts";
|
||||||
|
import {ArrowDownOutline, ArrowUpOutline} from "@vicons/ionicons5";
|
||||||
|
import type {QcResultDetail} from "@/api/qcResultDetail.ts";
|
||||||
|
|
||||||
const props =defineProps(
|
const props =defineProps(
|
||||||
{
|
{
|
||||||
@ -76,7 +104,27 @@ const qcStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
|
|||||||
//汇报信息表格
|
//汇报信息表格
|
||||||
const reportRecordsColums:DataTableColumns<QualityTesting> = [
|
const reportRecordsColums:DataTableColumns<QualityTesting> = [
|
||||||
|
|
||||||
{ title: '质检编号', key: 'qcNo',align: 'center' },
|
{ title: '质检编号', key: 'qcNo',align: 'center',
|
||||||
|
render(row:any) {
|
||||||
|
return h(
|
||||||
|
'a',
|
||||||
|
{
|
||||||
|
class:"route-code-link",
|
||||||
|
href: 'javascript:;',
|
||||||
|
style:{
|
||||||
|
color: '#2080f0',
|
||||||
|
textDecoration: 'underline',
|
||||||
|
cursor: 'pointer',
|
||||||
|
},
|
||||||
|
onClick: (e: MouseEvent) => {
|
||||||
|
viewQualityResultDetail(row)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
row.qcNo
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
},
|
||||||
{ title: '来源类型', key: 'sourceType',align: 'center',
|
{ title: '来源类型', key: 'sourceType',align: 'center',
|
||||||
render(row) {
|
render(row) {
|
||||||
const val = row.sourceType
|
const val = row.sourceType
|
||||||
@ -109,6 +157,14 @@ async function loadDictOptions() {
|
|||||||
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),class: d.listClass }))
|
||||||
}catch {}
|
}catch {}
|
||||||
|
try {
|
||||||
|
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 }))
|
||||||
|
}catch {}
|
||||||
|
try {
|
||||||
|
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 }))
|
||||||
|
}catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -134,6 +190,80 @@ function handlePageSizeChange(pageSize: number) {
|
|||||||
loadQualityTestingList()
|
loadQualityTestingList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const showAssingWorkDetail = ref<Boolean>(false)
|
||||||
|
const detailIsCollapse = ref(false)
|
||||||
|
|
||||||
|
const detailColumns: DataTableColumns<QcResultDetail> = [
|
||||||
|
{
|
||||||
|
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))
|
||||||
|
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 ?? '-'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '不良代码',
|
||||||
|
key: 'defectCode',
|
||||||
|
width: 80,
|
||||||
|
align: 'center',
|
||||||
|
render: (row) => {
|
||||||
|
const val = row.defectCode
|
||||||
|
return val ?? '-'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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))
|
||||||
|
if (!opt) return val ?? '-'
|
||||||
|
|
||||||
|
return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const detailTableData = ref<Object[]>([])
|
||||||
|
const qcResultTypeOptions = ref<{ label: string; value: any;class:any }[]>([])
|
||||||
|
//动作执行状态
|
||||||
|
const qcActionStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
|
||||||
|
|
||||||
|
function viewQualityResultDetail(row) {
|
||||||
|
showAssingWorkDetail.value = true
|
||||||
|
detailTableData.value = row.qcResultDetailList
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
loadDictOptions()
|
loadDictOptions()
|
||||||
loadQualityTestingList()
|
loadQualityTestingList()
|
||||||
|
|||||||
@ -77,6 +77,8 @@ const pagination = reactive({
|
|||||||
const reportRecordsColums:DataTableColumns<SubmitLog> = [
|
const reportRecordsColums:DataTableColumns<SubmitLog> = [
|
||||||
|
|
||||||
{ title: '汇报数量', key: 'quantity',align: 'center'},
|
{ title: '汇报数量', key: 'quantity',align: 'center'},
|
||||||
|
{ title: '合格数量', key: 'qualifiedQty',align: 'center'},
|
||||||
|
{ title: '报废数量', key: 'scrapQty',align: 'center'},
|
||||||
{ title: '汇报人', key: 'userName',align: 'center' },
|
{ title: '汇报人', key: 'userName',align: 'center' },
|
||||||
{ title: '派工状态', key: 'submitStatus',align: 'center',
|
{ title: '派工状态', key: 'submitStatus',align: 'center',
|
||||||
render: (row) => {
|
render: (row) => {
|
||||||
|
|||||||
@ -9,22 +9,24 @@
|
|||||||
label-placement="left"
|
label-placement="left"
|
||||||
>
|
>
|
||||||
<n-grid :cols="24" :x-gap="24">
|
<n-grid :cols="24" :x-gap="24">
|
||||||
<!-- <n-form-item-gi :span="6" label="工序编码">
|
<n-form-item-gi :span="4" label="派工编号">
|
||||||
<n-input v-model:value="searchForm.processId" placeholder="请输入工序编号" clearable />
|
<n-input v-model:value="searchForm.assingCode" placeholder="请输入派工编号" clearable />
|
||||||
</n-form-item-gi> -->
|
</n-form-item-gi>
|
||||||
<n-form-item-gi :span="6" label="工序名称">
|
<n-form-item-gi :span="4" label="物料编码">
|
||||||
|
<n-input v-model:value="searchForm.materialCode" placeholder="请输入物料编码" clearable />
|
||||||
|
</n-form-item-gi>
|
||||||
|
<n-form-item-gi :span="4" label="物料名称">
|
||||||
|
<n-input v-model:value="searchForm.materialName" placeholder="请输入物料名称" clearable />
|
||||||
|
</n-form-item-gi>
|
||||||
|
<n-form-item-gi :span="4" label="工序名称">
|
||||||
<n-input v-model:value="searchForm.processName" placeholder="请输入工序名称" clearable />
|
<n-input v-model:value="searchForm.processName" placeholder="请输入工序名称" clearable />
|
||||||
</n-form-item-gi>
|
</n-form-item-gi>
|
||||||
<n-form-item-gi :span="6">
|
<n-form-item-gi :span="4">
|
||||||
<n-space>
|
<n-space>
|
||||||
<n-button type="primary" @click="search">
|
<n-button type="primary" @click="search">
|
||||||
<template #icon><n-icon><SearchOutline /></n-icon></template>
|
<template #icon><n-icon><SearchOutline /></n-icon></template>
|
||||||
搜索
|
搜索
|
||||||
</n-button>
|
</n-button>
|
||||||
<!-- <n-button type="primary" @click="search">
|
|
||||||
<template #icon><n-icon><SearchOutline /></n-icon></template>
|
|
||||||
我的派工
|
|
||||||
</n-button> -->
|
|
||||||
<n-button @click="reset">
|
<n-button @click="reset">
|
||||||
<template #icon><n-icon><RefreshOutline /></n-icon></template>
|
<template #icon><n-icon><RefreshOutline /></n-icon></template>
|
||||||
重置
|
重置
|
||||||
@ -263,6 +265,9 @@ const searchForm = reactive({
|
|||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
processId:'',
|
processId:'',
|
||||||
processName:'',
|
processName:'',
|
||||||
|
assingCode:'',
|
||||||
|
materialCode:'',
|
||||||
|
materialName:'',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -489,23 +494,31 @@ const columns = [
|
|||||||
|
|
||||||
//搜索数据
|
//搜索数据
|
||||||
function search() {
|
function search() {
|
||||||
treeTableRef.value?.loadTableData({...searchForm})
|
treeTableRef.value?.loadTableData({
|
||||||
|
processName: searchForm.processName,
|
||||||
|
assingCode: searchForm.assingCode,
|
||||||
|
materialCode: searchForm.materialCode,
|
||||||
|
materialName: searchForm.materialName,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//重置
|
//重置
|
||||||
function reset() {
|
function reset() {
|
||||||
searchForm.processId =''
|
searchForm.processId = ''
|
||||||
searchForm.processName = ''
|
searchForm.processName = ''
|
||||||
treeTableRef.value?.loadTableData({...searchForm})
|
searchForm.assingCode = ''
|
||||||
|
searchForm.materialCode = ''
|
||||||
|
searchForm.materialName = ''
|
||||||
|
treeTableRef.value?.loadTableData({})
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取列表数据
|
//获取列表数据
|
||||||
function getlist() {
|
function getlist() {
|
||||||
searchForm.page = pagination.page
|
treeTableRef.value?.loadTableData({
|
||||||
searchForm.pageSize = pagination.pageSize
|
processName: searchForm.processName,
|
||||||
mytasks(searchForm).then((rps:any) => {
|
assingCode: searchForm.assingCode,
|
||||||
datalist.value = rps.records
|
materialCode: searchForm.materialCode,
|
||||||
pagination.itemCount = rps.total
|
materialName: searchForm.materialName,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user