|
|
|
|
@ -17,19 +17,14 @@
|
|
|
|
|
:disabled='activeTab !== "pending"'
|
|
|
|
|
filterable
|
|
|
|
|
clearable
|
|
|
|
|
:filter-method='filterWorkstation'
|
|
|
|
|
@change='handleWorkstationChange'
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for='item in filteredWorkstationList'
|
|
|
|
|
:key='item.stationId'
|
|
|
|
|
:label='item.stationName || item.stationCode'
|
|
|
|
|
:label='item.stationName'
|
|
|
|
|
:value='item.stationId'
|
|
|
|
|
>
|
|
|
|
|
<span>{{ item.stationName || item.stationCode }}</span>
|
|
|
|
|
<span v-if='item.stationCode && item.stationName' style='font-size: 13px; margin-left: 8px;'>
|
|
|
|
|
({{ item.stationCode }})
|
|
|
|
|
</span>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</span>
|
|
|
|
|
@ -52,6 +47,7 @@
|
|
|
|
|
<el-tab-pane label='待处理任务' name='pending' />
|
|
|
|
|
<el-tab-pane label='当前任务' name='current' />
|
|
|
|
|
<el-tab-pane label='报工记录' name='record' />
|
|
|
|
|
<el-tab-pane label='质检记录' name='inspection' />
|
|
|
|
|
<el-tab-pane label='工艺文件查看' name='document' />
|
|
|
|
|
</el-tabs>
|
|
|
|
|
</div>
|
|
|
|
|
@ -67,6 +63,9 @@
|
|
|
|
|
<div v-show='activeTab === "record"' class='tab-content'>
|
|
|
|
|
<WorkReportRecord ref='recordRef' :workstationId='workstationId' />
|
|
|
|
|
</div>
|
|
|
|
|
<div v-show='activeTab === "inspection"' class='tab-content'>
|
|
|
|
|
<InspectionRecord ref='inspectionRef' :workstation='workstation' />
|
|
|
|
|
</div>
|
|
|
|
|
<div v-show='activeTab === "document"' class='tab-content'>
|
|
|
|
|
<ProcessDocuments ref='documentRef' :workstationId='workstationId' />
|
|
|
|
|
</div>
|
|
|
|
|
@ -91,6 +90,7 @@ import { ArrowLeft, Menu } from '@element-plus/icons-vue';
|
|
|
|
|
import PendingTasks from './components/PendingTasks.vue';
|
|
|
|
|
import CurrentTask from './components/CurrentTask.vue';
|
|
|
|
|
import WorkReportRecord from './components/WorkReportRecord.vue';
|
|
|
|
|
import InspectionRecord from './components/InspectionRecord.vue';
|
|
|
|
|
import ProcessDocuments from './components/ProcessDocuments.vue';
|
|
|
|
|
import { parseTime } from '@/utils/ruoyi';
|
|
|
|
|
import useUserStore from '@/store/modules/user';
|
|
|
|
|
@ -107,11 +107,12 @@ const activeTab = ref('pending');
|
|
|
|
|
const pendingTasksRef = ref();
|
|
|
|
|
const currentTaskRef = ref();
|
|
|
|
|
const recordRef = ref();
|
|
|
|
|
const inspectionRef = ref();
|
|
|
|
|
const documentRef = ref();
|
|
|
|
|
|
|
|
|
|
// 工位信息(可以从路由参数或用户信息中获取)
|
|
|
|
|
const productionLine = ref('DJ01');
|
|
|
|
|
const workstation = ref('DJ01-01'); // 工位编码,用于显示
|
|
|
|
|
const workstation = ref(''); // 工位名称
|
|
|
|
|
const workstationId = ref<string | number>(''); // 工位ID,用于查询
|
|
|
|
|
const currentShift = ref('白班');
|
|
|
|
|
const workstationList = ref<BaseStationInfoVO[]>([]);
|
|
|
|
|
@ -146,6 +147,9 @@ const handleTabChange = (tabName: string) => {
|
|
|
|
|
} else if (tabName === 'record') {
|
|
|
|
|
// 切换到报工记录时刷新数据
|
|
|
|
|
recordRef.value?.refresh?.();
|
|
|
|
|
} else if (tabName === 'inspection') {
|
|
|
|
|
// 切换到质检记录时刷新数据
|
|
|
|
|
inspectionRef.value?.refresh?.();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -159,13 +163,13 @@ const getWorkstationList = async () => {
|
|
|
|
|
filteredWorkstationList.value = data;
|
|
|
|
|
// 如果列表不为空且当前工位不在列表中,设置默认工位
|
|
|
|
|
if (data.length > 0) {
|
|
|
|
|
const foundWorkstation = data.find(item => item.stationCode === workstation.value);
|
|
|
|
|
const foundWorkstation = data.find(item => item.stationName === workstation.value);
|
|
|
|
|
if (foundWorkstation) {
|
|
|
|
|
// 如果找到匹配的工位编码,设置对应的工位ID(watch会自动触发刷新)
|
|
|
|
|
workstationId.value = foundWorkstation.stationId;
|
|
|
|
|
} else {
|
|
|
|
|
// 如果找不到匹配的工位,设置第一个工位为默认值(watch会自动触发刷新)
|
|
|
|
|
workstation.value = data[0].stationCode;
|
|
|
|
|
workstation.value = data[0].stationName;
|
|
|
|
|
workstationId.value = data[0].stationId;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -175,21 +179,6 @@ const getWorkstationList = async () => {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 工位搜索过滤
|
|
|
|
|
const filterWorkstation = (query: string) => {
|
|
|
|
|
workstationSearchText.value = query;
|
|
|
|
|
if (!query) {
|
|
|
|
|
filteredWorkstationList.value = workstationList.value;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const lowerQuery = query.toLowerCase();
|
|
|
|
|
filteredWorkstationList.value = workstationList.value.filter(item => {
|
|
|
|
|
const stationName = (item.stationName || '').toLowerCase();
|
|
|
|
|
const stationCode = (item.stationCode || '').toLowerCase();
|
|
|
|
|
return stationName.includes(lowerQuery) || stationCode.includes(lowerQuery);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 刷新所有组件数据
|
|
|
|
|
const refreshAllData = () => {
|
|
|
|
|
// 刷新待处理任务
|
|
|
|
|
@ -198,6 +187,8 @@ const refreshAllData = () => {
|
|
|
|
|
currentTaskRef.value?.refresh?.();
|
|
|
|
|
// 刷新报工记录
|
|
|
|
|
recordRef.value?.refresh?.();
|
|
|
|
|
// 刷新质检记录
|
|
|
|
|
inspectionRef.value?.refresh?.();
|
|
|
|
|
// 刷新工艺文件(如果需要)
|
|
|
|
|
documentRef.value?.refresh?.();
|
|
|
|
|
};
|
|
|
|
|
@ -207,7 +198,7 @@ const handleWorkstationChange = (stationId: string | number) => {
|
|
|
|
|
// 根据工位ID找到对应的工位编码
|
|
|
|
|
const selectedWorkstation = workstationList.value.find(item => item.stationId === stationId);
|
|
|
|
|
if (selectedWorkstation) {
|
|
|
|
|
workstation.value = selectedWorkstation.stationCode;
|
|
|
|
|
workstation.value = selectedWorkstation.stationName;
|
|
|
|
|
}
|
|
|
|
|
// 更新工位ID(不在这里刷新,由watch统一处理,避免重复调用)
|
|
|
|
|
workstationId.value = stationId;
|
|
|
|
|
|