优化系统全局状态管理结构

This commit is contained in:
tao
2026-01-12 17:17:58 +08:00
parent 84797e76cd
commit 9a1fec8cbc
17 changed files with 243 additions and 327 deletions

View File

@@ -1,12 +1,11 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { usePwoStore, useJobStore } from '@/store'
import { useTraceOrderStore } from '@/store'
import type { ColumnsType } from 'ant-design-vue/es/table/interface';
import { message } from 'ant-design-vue'
import { listMainMaterialEntryLog, addWaferEntryLogByCarrier, addDieEntryLogByCarrier, addWaferEntryLog, addDieEntryLog, delMainMaterialEntryLog } from '@/api/pwoManage/primaryMaterial'
const pwoStore = usePwoStore();
const jobStore = useJobStore();
const traceOrderStore = useTraceOrderStore();
interface MaterialTableItem {
key: string;
@@ -29,7 +28,7 @@ const materialColumns = [
// 查询站点下主材信息
const loadingMaterialTableData = ref(false);
const fetchPrimaryMaterialList = async () => {
const stationId = jobStore.jobInfo.id;
const stationId = traceOrderStore.currentStationId;
if (!stationId) return;
loadingMaterialTableData.value = true;
try {
@@ -48,7 +47,7 @@ const insertCarrier = async () => {
if (!carrierInput.value) return;
const form = {
carrierCode: carrierInput.value,
stationCode: jobStore.jobInfo.code
stationCode: traceOrderStore.currentStationCode,
};
try {
if (materialType.value === "Wafer") {
@@ -73,7 +72,7 @@ const insertMaterial = async () => {
if (!materialInput.value) return;
const form = {
mainMaterialCodes: [materialInput.value],
stationCode: jobStore.jobInfo.code
stationCode: traceOrderStore.currentStationCode,
};
try {
if (materialType.value === "Wafer") {
@@ -126,8 +125,8 @@ defineExpose({
// 初始化主材类型
const materialType = ref()
if (pwoStore.pwoInfo.orderType) {
const num = parseInt(pwoStore.pwoInfo.orderType)
if (traceOrderStore.traceOrderInfo.orderType) {
const num = parseInt(traceOrderStore.traceOrderInfo.orderType)
materialType.value = num % 4 === 0 ? 'Die' : 'Wafer'
} else {
materialType.value = '主材类型异常'