修改治具字段名
增加 lodash 库
This commit is contained in:
@@ -8,7 +8,7 @@ const route = useRoute();
|
||||
const menuItems = [
|
||||
{ label: '主材', key: 'PrimaryMaterial', progress: 30 },
|
||||
{ label: '材料', key: 'RawMaterial', progress: 50 },
|
||||
{ label: '治具', key: 'Fixture', progress: 80 },
|
||||
{ label: '治具', key: 'Mask', progress: 80 },
|
||||
];
|
||||
|
||||
const activeKey = computed(() => route.name as string);
|
||||
@@ -30,8 +30,8 @@ defineExpose({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-row :gutter="24" class="infeed-layout">
|
||||
<a-col :span="4">
|
||||
<a-row class="infeed-layout">
|
||||
<a-col :span="4" class="menu-wrapper">
|
||||
<div class="menu-list">
|
||||
<span class="infeed-title">进站</span>
|
||||
<div
|
||||
@@ -130,7 +130,14 @@ defineExpose({
|
||||
}
|
||||
}
|
||||
|
||||
.menu-wrapper {
|
||||
padding: 12px;
|
||||
border-radius: 7px;
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
|
||||
.content-wrapper {
|
||||
height: 100%;
|
||||
padding: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import type { ColumnsType } from 'ant-design-vue/es/table/interface';
|
||||
import { listMaskCombination, listCombinationAssignMask } from "@/api/pwoManage/fixtureCombination";
|
||||
import { listMaskCombination, listCombinationAssignMask } from "@/api/pwoManage/maskCombination";
|
||||
|
||||
interface FixtureTableItem {
|
||||
interface MaskTableItem {
|
||||
key: string;
|
||||
operationTitle: string;
|
||||
operationCode: string;
|
||||
@@ -13,7 +13,7 @@ interface FixtureTableItem {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface FixtureCombinationItem {
|
||||
interface MaskCombinationItem {
|
||||
key: string;
|
||||
combinationCode: string;
|
||||
combinationName: string;
|
||||
@@ -21,7 +21,7 @@ interface FixtureCombinationItem {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
const fixtureColumns = [
|
||||
const maskColumns = [
|
||||
{ title: '序号', dataIndex: 'index', key: 'index', align: 'center', width: 80 },
|
||||
{ title: '工序编码', dataIndex: 'operationCode', key: 'operationCode', align: 'center' },
|
||||
{ title: '工序名称', dataIndex: 'operationTitle', key: 'operationTitle', align: 'center' },
|
||||
@@ -30,24 +30,24 @@ const fixtureColumns = [
|
||||
];
|
||||
|
||||
// 治具表格
|
||||
const fixtureTableData = ref<FixtureTableItem[]>([]);
|
||||
const maskTableData = ref<MaskTableItem[]>([]);
|
||||
|
||||
const fixtureInput = ref<string>('');
|
||||
const maskInput = ref<string>('');
|
||||
|
||||
const openFixtureModal = ref(false)
|
||||
const fixtureCombinationColumns = [
|
||||
const openMaskModal = ref(false)
|
||||
const maskCombinationColumns = [
|
||||
{ title: '序号', dataIndex: 'index', key: 'index', align: 'center', width: 80 },
|
||||
{ title: '组合编码', dataIndex: 'combinationCode', key: 'combinationCode', align: 'center' },
|
||||
{ title: '组合名称', dataIndex: 'combinationName', key: 'combinationName', align: 'center' },
|
||||
{ title: '组合状态', dataIndex: 'combinationStatus', key: 'combinationStatus', align: 'center' },
|
||||
{ title: '操作', dataIndex: 'action', key: 'action', align: 'center', width: 100 },
|
||||
]
|
||||
const fixtureCombinationTableData = ref<FixtureCombinationItem[]>([])
|
||||
const maskCombinationTableData = ref<MaskCombinationItem[]>([])
|
||||
const fetchCombinationList = async () => {
|
||||
try {
|
||||
const { rows, total } = await listMaskCombination({})
|
||||
if (total as number <= 0) throw new Error('未查询到组合列表');
|
||||
fixtureCombinationTableData.value = rows;
|
||||
maskCombinationTableData.value = rows;
|
||||
} catch (error: any) {
|
||||
message.error(error.message || '获取工单信息失败');
|
||||
}
|
||||
@@ -63,7 +63,7 @@ const handleBind = async (id: number) => {
|
||||
|
||||
const newCombination = rows.filter(item => !existingCombination.value.has(item.id))
|
||||
newCombination.forEach(item => {
|
||||
fixtureTableData.value.push({
|
||||
maskTableData.value.push({
|
||||
key: item.id,
|
||||
operationCode: item.operationCode,
|
||||
operationTitle: item.operationTitle,
|
||||
@@ -74,7 +74,7 @@ const handleBind = async (id: number) => {
|
||||
})
|
||||
|
||||
message.success('绑定成功')
|
||||
openFixtureModal.value = false
|
||||
openMaskModal.value = false
|
||||
}
|
||||
|
||||
// 计算表格高度
|
||||
@@ -99,13 +99,13 @@ fetchCombinationList()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="fixture__container">
|
||||
<div class="mask__container">
|
||||
<a-row class="main-content" :gutter="24">
|
||||
<a-col :span="14" class="fixture-item__container">
|
||||
<a-col :span="14" class="mask-item__container">
|
||||
<div class="main-title">治具组合信息</div>
|
||||
<a-button size="large" @click="() => openFixtureModal = true">绑定治具组合</a-button>
|
||||
<a-button size="large" @click="() => openMaskModal = true">绑定治具组合</a-button>
|
||||
<div class="table-wrapper" ref="customTable">
|
||||
<a-table :dataSource="fixtureTableData" :columns="fixtureColumns as ColumnsType<FixtureTableItem>"
|
||||
<a-table :dataSource="maskTableData" :columns="maskColumns as ColumnsType<MaskTableItem>"
|
||||
:pagination="false" bordered sticky size="middle" :scroll="{ y: tableHeight }">
|
||||
<template #bodyCell="{ column, index }">
|
||||
<template v-if="column.key === 'index'">{{ index + 1 }}</template>
|
||||
@@ -113,11 +113,11 @@ fetchCombinationList()
|
||||
</a-table>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="10" class="fixture-item__container">
|
||||
<a-col :span="10" class="mask-item__container">
|
||||
<div class="main-title">治具校验</div>
|
||||
<a-row>
|
||||
<a-col :span="20">
|
||||
<a-input size="large" v-model:value="fixtureInput" @pressEnter="" placeholder="按下回车校验" />
|
||||
<a-input size="large" v-model:value="maskInput" @pressEnter="" placeholder="按下回车校验" />
|
||||
</a-col>
|
||||
<a-col :span="3" :offset="1">
|
||||
<a-button size="large" @click="">校验</a-button>
|
||||
@@ -136,8 +136,8 @@ fetchCombinationList()
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-modal v-model:open="openFixtureModal" title="绑定治具组合" width="50vw" :bodyStyle="{ padding: '20px 0' }">
|
||||
<a-table :dataSource="fixtureCombinationTableData" :columns="fixtureCombinationColumns as ColumnsType<FixtureCombinationItem>"
|
||||
<a-modal v-model:open="openMaskModal" title="绑定治具组合" width="50vw" :bodyStyle="{ padding: '20px 0' }">
|
||||
<a-table :dataSource="maskCombinationTableData" :columns="maskCombinationColumns as ColumnsType<MaskCombinationItem>"
|
||||
:pagination="false" bordered sticky :scroll="{ y: tableHeight }">
|
||||
<template #bodyCell="{ column, index, record }">
|
||||
<template v-if="column.key === 'index'">{{ index + 1 }}</template>
|
||||
@@ -151,7 +151,7 @@ fetchCombinationList()
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.fixture__container {
|
||||
.mask__container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -161,7 +161,7 @@ fetchCombinationList()
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
|
||||
.fixture-item__container {
|
||||
.mask-item__container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
Reference in New Issue
Block a user