增加出站功能

This commit is contained in:
tao
2025-12-30 15:51:25 +08:00
parent 7b36211f04
commit f724b40e24
4 changed files with 67 additions and 41 deletions

15
components.d.ts vendored
View File

@@ -10,7 +10,6 @@ declare module 'vue' {
export interface GlobalComponents {
AButton: typeof import('ant-design-vue/es')['Button']
ACard: typeof import('ant-design-vue/es')['Card']
ACheckbox: typeof import('ant-design-vue/es')['Checkbox']
ACol: typeof import('ant-design-vue/es')['Col']
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
ActionButtons: typeof import('./src/components/common/ActionButtons/index.vue')['default']
@@ -21,7 +20,6 @@ declare module 'vue' {
AForm: typeof import('ant-design-vue/es')['Form']
AFormItem: typeof import('ant-design-vue/es')['FormItem']
AInput: typeof import('ant-design-vue/es')['Input']
AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
AMenu: typeof import('ant-design-vue/es')['Menu']
AMenuItem: typeof import('ant-design-vue/es')['MenuItem']
AModal: typeof import('ant-design-vue/es')['Modal']
@@ -35,20 +33,19 @@ declare module 'vue' {
ATable: typeof import('ant-design-vue/es')['Table']
ATableSummaryCell: typeof import('ant-design-vue/es')['TableSummaryCell']
ATableSummaryRow: typeof import('ant-design-vue/es')['TableSummaryRow']
ATag: typeof import('ant-design-vue/es')['Tag']
ATypographyText: typeof import('ant-design-vue/es')['TypographyText']
Header: typeof import('./src/components/Header/index.vue')['default']
DictTag: typeof import('./src/components/common/DictTag/index.vue')['default']
Header: typeof import('./src/components/common/Header/index.vue')['default']
ILucideBuilding: typeof import('~icons/lucide/building')['default']
ILucideChevronDown: typeof import('~icons/lucide/chevron-down')['default']
ILucideCopy: typeof import('~icons/lucide/copy')['default']
ILucideCpu: typeof import('~icons/lucide/cpu')['default']
ILucideLoader: typeof import('~icons/lucide/loader')['default']
ILucideLock: typeof import('~icons/lucide/lock')['default']
ILucideRefreshCw: typeof import('~icons/lucide/refresh-cw')['default']
ILucideRotateCcw: typeof import('~icons/lucide/rotate-ccw')['default']
ILucideRotateCw: typeof import('~icons/lucide/rotate-cw')['default']
ILucideShieldCheck: typeof import('~icons/lucide/shield-check')['default']
ILucideUser: typeof import('~icons/lucide/user')['default']
Lucide: typeof import('./src/components/common/Lucide/index.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
Subtitle: typeof import('./src/components/common/Subtitle/index.vue')['default']
Title: typeof import('./src/components/common/Title/index.vue')['default']
}
}

View File

@@ -398,7 +398,7 @@ onUnmounted(() => {
.bottom-section {
background: #fff;
padding: 16px;
padding: 12px 14px;
border-radius: 8px;
flex: 1;
min-height: 0;

View File

@@ -1,9 +1,13 @@
<script setup lang="ts">
import { ref, onMounted, computed } from 'vue';
import { ref, onMounted, computed, getCurrentInstance } from 'vue';
import { message } from 'ant-design-vue';
import { useJobStore } from '@/store';
import type { ColumnsType } from 'ant-design-vue/es/table/interface';
import { delay } from '@/utils/mock';
import { listMainMaterialEntryLog } from '@/api/pwoManage/primaryMaterial'
import { listMainMaterialOutboundLog } from '@/api/pwoManage/primaryMaterial';
const { proxy } = getCurrentInstance() as any
const { main_material_ok_level, main_material_ng_level } = proxy.useDict("main_material_ok_level", "main_material_ng_level")
const jobStore = useJobStore();
@@ -20,11 +24,12 @@ const primaryMaterialColumns = [
{ title: '序号', dataIndex: 'index', key: 'index', align: 'center', width: 80 },
{ title: 'Wafer ID', dataIndex: 'waferCode', key: 'waferCode', align: 'center' },
{ title: 'Die ID', dataIndex: 'dieCode', key: 'dieCode', align: 'center' },
{ title: '结果', dataIndex: 'result', key: 'result', filters: [{ text: 'OK', value: 'OK', }, { text: 'NG', value: 'NG', }], onFilter: (value: string, record: any) => record.result.indexOf(value) === 0, align: 'center' },
{ title: '质量等级', dataIndex: 'qualityLevel', key: 'qualityLevel', filters: [{ text: 'A', value: 'A', }, { text: 'B', value: 'B', }], onFilter: (value: string, record: any) => record.qualityLevel.indexOf(value) === 0, align: 'center' },
{ title: '结果', dataIndex: 'result', key: 'result', align: 'center' },
{ title: '质量等级', dataIndex: 'qualityLevel', key: 'qualityLevel' },
{ title: '操作', key: 'action', align: 'center', width: 120 },
];
// 总计数据
const totals = computed(() => {
let okNum = 0;
let ngNum = 0;
@@ -43,15 +48,11 @@ const primaryMaterialTableData = ref<PrimaryMaterialTableItem[]>([]);
const loadingPrimaryMaterialList = ref(false);
const fetchPrimaryMaterialList = async () => {
// const stationId = jobStore.jobInfo.id;
// if (!stationId) return;
const stationId = jobStore.jobInfo.id;
if (!stationId) return;
loadingPrimaryMaterialList.value = true;
try {
const rows = await delay(1000, [
{ key: '1', waferCode: 'WF-20250401-0001', dieCode: 'DIE-20250401-0001', result: 'OK', qualityLevel: 'A' },
{ key: '2', waferCode: 'WF-20250401-0001', dieCode: 'DIE-20250401-0001', result: 'NG', qualityLevel: 'A' },
{ key: '3', waferCode: 'WF-20250401-0001', dieCode: 'DIE-20250401-0001', result: 'OK', qualityLevel: 'B' }
]);
const { rows } = await listMainMaterialEntryLog({ stationId });
primaryMaterialTableData.value = rows;
} catch (error: any) {
message.error(error.message || '查询治具列表失败');
@@ -83,7 +84,7 @@ fetchPrimaryMaterialList()
<template>
<div class="equipment__container">
<div class="main-title">主材报工</div>
<Title name="主材报工" showRefresh @refresh="fetchPrimaryMaterialList" />
<div class="table-wrapper" ref="customTable">
<a-table :dataSource="primaryMaterialTableData" :columns="primaryMaterialColumns as ColumnsType<PrimaryMaterialTableItem>"
:pagination="false" bordered sticky size="middle" :scroll="{ y: tableHeight }"
@@ -91,12 +92,14 @@ fetchPrimaryMaterialList()
<template #bodyCell="{ column, index, record }">
<template v-if="column.key === 'index'">{{ index + 1 }}</template>
<template v-if="column.key === 'result'">
<a-switch v-model:checked="record.result" checked-children="OK" checkedValue="OK" un-checked-children="NG" unCheckedValue="NG" />
<a-switch v-model:checked="record.result" checked-children="NG" checkedValue="NG" un-checked-children="OK" unCheckedValue="OK" />
</template>
<template v-if="column.key === 'qualityLevel'">
<a-select v-model:value="record.qualityLevel" style="width: 80%">
<a-select-option value="A">A</a-select-option>
<a-select-option value="B">B</a-select-option>
<a-select v-model:value="record.qualityLevel" style="width: 80%" v-if="record.result === 'OK'">
<a-select-option v-for="dict in main_material_ok_level" :value="dict.value">{{ dict.label }}</a-select-option>
</a-select>
<a-select v-model:value="record.qualityLevel" style="width: 80%" v-else>
<a-select-option v-for="dict in main_material_ng_level" :value="dict.value">{{ dict.label }}</a-select-option>
</a-select>
</template>
<template v-if="column.key === 'action'">
@@ -145,29 +148,21 @@ fetchPrimaryMaterialList()
}
}
.main-title {
font-size: 20px;
font-weight: 600;
border-bottom: 1px solid #c9c9c9;
padding: 0 0 8px;
}
.table-wrapper {
height: 100%;
overflow: auto;
}
::v-deep(.ant-switch) {
background-color: #ff0000;
background-color: #04d903;
&:hover {
background-color: #ff2525;
background-color: #02eb02;
}
&.ant-switch-checked {
background-color: #04d903;
background-color: #ff0000;
&:hover {
background-color: #02eb02;
background-color: #ff2525;
}
}
}

View File

@@ -1,11 +1,16 @@
<script setup lang="ts">
import { ref, computed } from 'vue';
import { ref, computed, reactive } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { message } from 'ant-design-vue';
import { listStorageLocation } from '@/api/pwoManage/location';
import { completeStation } from '@/api/pwoManage/station';
import { useJobStore } from '@/store';
const router = useRouter();
const route = useRoute();
const jobStore = useJobStore();
const menuItems = [
{ label: '主材报工', key: 'JobReport', progress: 30 },
{ label: '工序参数', key: 'ParameterConfiguration', progress: 80 },
@@ -18,12 +23,35 @@ const handleMenuClick = (name: string) => {
router.push({ name });
};
const locationOptions = ref<any>([]);
const fetchLocationList = async () => {
try {
const { rows } = await listStorageLocation({});
locationOptions.value = rows;
} catch (error: any) {
message.error(error.message || '获取库位列表失败');
}
};
const openSelectLocation = ref(false);
const handleSelectLocation = () => {
fetchLocationList();
openSelectLocation.value = true;
};
const storage = reactive({});
const handleChangeLocation = (value: any, option: any) => {
Object.assign(storage, option);
};
// 确认出站
const outfeeding = ref(false);
const handleOutfeed = async () => {
outfeeding.value = true;
try {
router.push({ name: 'JobReport' });
await completeStation(jobStore.jobInfo.id, storage);
openSelectLocation.value = false;
message.success('出站成功');
} catch (error: any) {
message.error(error.message || '出站失败');
} finally {
@@ -41,6 +69,8 @@ function renderTableHeight() {
defineExpose({
renderTableHeight
});
fetchLocationList();
</script>
<template>
@@ -62,10 +92,14 @@ defineExpose({
:stroke-color="activeKey === item.key ? '#1890ff' : undefined" class="menu-progress" />
</div>
</div>
<a-button type="primary" size="large" @click="handleOutfeed">确认出站</a-button>
<a-button type="primary" size="large" @click="handleSelectLocation">确认出站</a-button>
</div>
</a-col>
</a-row>
<a-modal title="选择出站库位" :open="openSelectLocation" @ok="handleOutfeed" @cancel="openSelectLocation = false">
<a-select style="width: 100%" @change="handleChangeLocation" :options="locationOptions" :fieldNames="{ label: 'storageLocationCode', value: 'id' }" />
</a-modal>
</a-spin>
</template>