优化系统全局状态管理结构
This commit is contained in:
@@ -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 = '主材类型异常'
|
||||
|
||||
Reference in New Issue
Block a user