Merge remote-tracking branch 'origin/master'

master
suixy 3 weeks ago
commit 82fbc0715e

@ -0,0 +1,90 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {AskVO} from "@/api/ai/skill/aiChat/types";
// AI报表分析生成SQL语句API
export const generateReportSql = (query?: AskVO): AxiosPromise<AskVO[]> => {
return request({
url: '/ai/aiReport/generateReportSql',
method: 'post',
params: query,
timeout: 1000000
});
};
// AI报表分析API
export function generateReport(data) {
return request({
url: '/ai/aiReport/generateReport',
method: 'post',
data
})
}
// 获取最新AI生成报表信息
export function getRecentReports() {
return request({
url: '/ai/aiReport/getRecentReports',
method: 'get'
})
}
/**
* sessionidmessagedetailtypeAI
* @param query
* @returns {*}
*/
export function getRecentReportInfo (query) {
return request({
url: '/ai/aiReport/getRecentReportInfo',
method: 'get',
params: query
});
};
// 测试报表分析API
export function generateTestReport(data) {
return request({
url: '/ai/aiReport/generateTestReport',
method: 'post',
data
})
}
// 获取快速体验示例
export function getQuickExamples() {
return request({
url: '/ai/aiReport/examples',
method: 'get'
})
}
// 生成SQL测试用
export function generateSQL(prompt) {
return request({
url: '/ai/aiReport/generate-sql',
method: 'post',
params: { prompt }
})
}
// 生成HTML测试用
export function generateHTML(prompt) {
return request({
url: '/ai/aiReport/generate-html',
method: 'post',
params: { prompt }
})
}
// 健康检查
export function healthCheck() {
return request({
url: '/ai/aiReport/health',
method: 'get'
})
}

@ -398,6 +398,9 @@ export interface QcInspectionMainQuery extends PageQuery {
*
*/
params?: any;
planDetailId?: number;
}

@ -355,6 +355,10 @@ const selectForm = async (aiFormSetting: AiFormSettingVO) => {
const resetAiAssistant = () =>{
chatList.value = [];
selectLists.value = [];
type1Elements.value = [];
type2Elements.value = [];
selectedType2Elements.value = [];
}
// function selectForm(aiFormSetting: AiFormSettingVO) {
@ -440,12 +444,130 @@ function onModelChange() {
}
}
watch(state, (newVal) => {
if (newVal.isShowSearch) {
loadForms()
getAiModelList();
//
const resetAllState = () => {
//
selectedFormSettingId.value = null
selectedForm.value = null
//
chatList.value = []
selectLists.value = []
type1Elements.value = []
type2Elements.value = []
selectedType2Elements.value = []
//
inputValue.value = ''
aiThinking.value = false
aiLoading.value = false
//
isRecording.value = false
audioAsrLoading.value = false
recognitionResult.value = ''
uploadProgress.value = 0
isUploading.value = false
//
selectDialog.value = false
selectDialogList.value = null
selectDialogListIndex.value = undefined
selectDialogFilterText.value = ''
selectedOption.value = ''
//
windowPosition.value = { x: 'auto', y: 0 }
windowSize.value = { width: '24%', height: '100vh' }
isCustomPosition.value = false
//
currentComponent.value = null
currentProps.value = {}
isShowLeft.value = false
currentSize.value = "menu"
//
showMore.value = false
moreFilterText.value = ''
// sendForm
sendForm.value = {}
//
if (microphoneStream) {
microphoneStream.getTracks().forEach(track => track.stop())
microphoneStream = null
}
});
if (mediaRecorder && mediaRecorder.state !== 'inactive') {
mediaRecorder.stop()
mediaRecorder = null
}
audioChunks = []
// URL
recordings.value.forEach(recording => {
URL.revokeObjectURL(recording.url)
})
recordings.value = []
}
//
const cleanupOnClose = () => {
//
if (isRecording.value) {
stopRecording()
}
//
if (microphoneStream) {
microphoneStream.getTracks().forEach(track => track.stop())
microphoneStream = null
}
if (mediaRecorder && mediaRecorder.state !== 'inactive') {
mediaRecorder.stop()
mediaRecorder = null
}
audioChunks = []
//
resetAllState()
}
//
watch(() => state.isShowSearch, async (newVal) => {
if (newVal) {
console.log('AI窗口打开重置状态并重新加载')
//
resetAllState()
try {
//
await Promise.all([
loadForms(),
getAiModelList()
])
//
initFormPageMap()
//
sharedStore.updateDynamicValue({
message: null,
timestamp: null
})
} catch (error) {
console.error('重新加载数据失败:', error)
ElMessage.error('加载数据失败,请重试')
}
}
}, { immediate: true })
const selectLists = ref([]);
@ -494,6 +616,7 @@ const sendForm = ref({});
const handleSend = async (selectedText?: string) => {
if ((!canSend.value || aiThinking.value) && !selectedText) return
const userMsg = selectedText || inputValue.value
selectLists.value = [];
chatList.value.push({text: userMsg, from: 'user', type: 'text'})
scrollToBottom()
aiThinking.value = true
@ -1077,8 +1200,9 @@ onMounted(() => {
// processData(testData1);
})
//
onBeforeUnmount(() => {
cleanupOnClose()
})
//
@ -1158,6 +1282,7 @@ function onInputKeydown(e: KeyboardEvent) {
}
function close() {
cleanupOnClose()
state.isShowSearch = false
}

@ -530,7 +530,7 @@ export const dynamicRoutes: RouteRecordRaw[] = [
path: '/ai/skill/knowledgeBaseQA',
component: Layout,
hidden: true,
permissions: ['ai:aiKnowledgeBaseDocs:qa'],
permissions: ['ai:aiKnowledgeBase:qa'],
children: [
{
path: 'index/:knowledgeBaseId/:embeddingModelId/:retrieveLimit',

File diff suppressed because it is too large Load Diff

@ -47,11 +47,28 @@
<el-input v-model="workOrderStatusText" disabled />
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item label="审批状态">
<el-input v-model="approveStatusText" disabled />
</el-form-item>
</el-col> -->
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="申请人">
<el-input :value="workOrder?.applyUser || ''" disabled />
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item label="申请时间">
<el-input :value="workOrder?.applyTime || ''" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="要求完成时间">
<el-input :value="workOrder?.requireEndTime || ''" disabled />
</el-form-item>
</el-col> -->
</el-row>
<el-row>
<el-col :span="8">
@ -65,8 +82,37 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="申请时间">
<el-input :value="workOrder?.applyTime || ''" disabled />
<el-form-item label="设备位置">
<el-input :value="workOrder?.machineLocation || ''" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="实际开始时间">
<el-input :value="workOrder?.realBeginTime || ''" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实际完成时间">
<el-input :value="workOrder?.realEndTime || ''" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="确认状态">
<el-input v-model="confirmStatusText" disabled />
</el-form-item>
</el-col>
</el-row>
<el-row v-if="workOrder?.confirmUser">
<el-col :span="8">
<el-form-item label="确认人">
<el-input :value="workOrder?.confirmUser || ''" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="确认时间">
<el-input :value="workOrder?.confirmTime || ''" disabled />
</el-form-item>
</el-col>
</el-row>
@ -184,6 +230,17 @@
</el-form>
</el-card>
<!-- 维修零件列表 -->
<el-card shadow="never" class="mb-[10px]" v-if="workOrder?.parts && workOrder.parts.length > 0">
<h4 class="form-header">维修更换零件</h4>
<el-table :data="workOrder.parts" border stripe>
<el-table-column label="序号" type="index" width="60" align="center" />
<el-table-column label="零部件名称" prop="partName" min-width="150" />
<el-table-column label="零部件规格" prop="partSpecifications" min-width="150" />
<el-table-column label="数量" prop="amount" width="100" align="center" />
</el-table>
</el-card>
<!-- 审批组件 -->
<submitVerify
ref="submitVerifyRef"
@ -204,6 +261,7 @@ import { ElMessageBox, type FormInstance } from 'element-plus';
import type { ComponentInternalInstance } from 'vue';
import { getDmsBillsFaultInstance, approveWorkOrder, confirmRepairResult } from '@/api/dms/dmsBillsFaultInstance';
import { getDmsBaseOutsourcingInfoList } from '@/api/dms/dmsBaseOutsourcingInfo';
import { pageByTaskWait } from '@/api/workflow/task';
import SubmitVerify from '@/views/dms/dmsFaultInstanceActivity/submitVerify.vue';
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
@ -218,9 +276,12 @@ const buttonLoading = ref(false);
const routeParams = ref<Record<string, any>>({});
const workOrder = ref<any>({});
const workOrderStatusText = ref('');
const approveStatusText = ref('');
const confirmStatusText = ref('');
const outsourceList = ref<any[]>([]);
const outsourcingName = ref('');
//
const processFormRef = ref<FormInstance>();
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
@ -229,6 +290,9 @@ const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
//
const taskVariables = ref<any>({});
//
const isCurrentUserTaskAssignee = ref(false);
//
const initFormData = {
repairInstanceId: undefined,
@ -255,8 +319,15 @@ const rules = reactive({
processHandleResolution: [{ required: false, message: '处理意见不能为空', trigger: 'blur' }]
});
//
const isViewMode = computed(() => {
return routeParams.value.type === 'view';
});
//
const needProcessResolution = computed(() => {
//
if (isViewMode.value) return false;
return isApprovalStage.value || confirmButtonShow.value;
});
@ -268,8 +339,10 @@ const currentStepName = computed(() => {
});
const approvalButtonShow = computed(() => {
// (1)
return workOrder.value?.approveStatus === '1';
//
if (isViewMode.value) return false;
// (1) &&
return workOrder.value?.approveStatus === '1' && isCurrentUserTaskAssignee.value;
});
const confirmButtonShow = computed(() => {
@ -290,20 +363,26 @@ const confirmButtonShow = computed(() => {
const approveStatusMatches = String(workOrder.value?.approveStatus) === '2';
const repairConfirmMatches = String(workOrder.value?.repairConfirm) === '0';
const shouldShow = billsStatusMatches && approveStatusMatches && repairConfirmMatches;
//
if (isViewMode.value) return false;
//
const shouldShow = billsStatusMatches && approveStatusMatches && repairConfirmMatches && isCurrentUserTaskAssignee.value;
console.log('主管确认按钮显示结果:', {
billsStatusMatches,
approveStatusMatches,
repairConfirmMatches,
isCurrentUserTaskAssignee: isCurrentUserTaskAssignee.value,
shouldShow
});
return shouldShow;
});
//
//
const isApprovalStage = computed(() => {
if (isViewMode.value) return false;
return workOrder.value?.approveStatus === '1';
});
@ -319,6 +398,9 @@ onMounted(async () => {
//
await getOutsourceList();
//
await checkCurrentUserTaskPermission();
//
initializeFormData();
@ -333,6 +415,40 @@ onMounted(async () => {
}
});
//
const checkCurrentUserTaskPermission = async () => {
try {
const businessId = routeParams.value.id;
if (!businessId) {
isCurrentUserTaskAssignee.value = false;
return;
}
//
const taskRes = await pageByTaskWait({
pageNum: 1,
pageSize: 100,
flowCode: 'Fault01' //
});
// ID
const matchingTask = taskRes.rows?.find(
(task: any) => String(task.businessId) === String(businessId)
);
isCurrentUserTaskAssignee.value = !!matchingTask;
console.log('用户任务权限检查:', {
businessId,
hasMatchingTask: !!matchingTask,
isCurrentUserTaskAssignee: isCurrentUserTaskAssignee.value
});
} catch (error) {
console.error('检查用户任务权限失败:', error);
isCurrentUserTaskAssignee.value = false;
}
};
//
const loadWorkOrderInfo = async () => {
// querybusinessId
@ -348,6 +464,8 @@ const loadWorkOrderInfo = async () => {
// -
workOrderStatusText.value = getStatusText(workOrder.value.billsStatus || '');
approveStatusText.value = getApproveStatusText(workOrder.value.approveStatus || '');
confirmStatusText.value = getConfirmStatusText(workOrder.value.repairConfirm || '');
};
//
@ -385,7 +503,25 @@ const approvalVerifyOpen = async () => {
if (!processFormRef.value) return;
try {
//
const valid = await processFormRef.value.validate();
if (!valid) {
(proxy as any)?.$modal.msgWarning('请填写必填项');
return;
}
//
if (!form.approveStatus || form.approveStatus === '1') {
(proxy as any)?.$modal.msgWarning('请选择审批状态(通过或拒绝)');
return;
}
//
if (!form.processHandleResolution || form.processHandleResolution.trim() === '') {
(proxy as any)?.$modal.msgWarning('请填写处理意见');
return;
}
if (valid) {
await (proxy as any)?.$modal.confirm('是否确认提交审批?');
@ -433,6 +569,12 @@ const submitCallback = async (approvalResult?: any) => {
//
const handleConfirm = async () => {
//
if (!form.processHandleResolution || form.processHandleResolution.trim() === '') {
(proxy as any)?.$modal.msgWarning('请填写处理意见');
return;
}
try {
// 使
const result = await ElMessageBox.confirm(
@ -528,7 +670,7 @@ const setDynamicValidationRules = () => {
//
const getStatusText = (status: string) => {
const statusMap = {
const statusMap: Record<string, string> = {
'0': '待维修',
'1': '维修中',
'2': '维修完成',
@ -537,6 +679,25 @@ const getStatusText = (status: string) => {
};
return statusMap[status] || '未知状态';
};
const getApproveStatusText = (status: string) => {
const statusMap: Record<string, string> = {
'0': '未提交',
'1': '待审批',
'2': '审批通过',
'3': '审批拒绝'
};
return statusMap[status] || '未知状态';
};
const getConfirmStatusText = (status: string) => {
const statusMap: Record<string, string> = {
'0': '待确认',
'1': '确认通过',
'2': '确认不通过'
};
return statusMap[status] || '未知状态';
};
</script>
<style scoped>

@ -1243,6 +1243,7 @@ const submitForm = () => {
let assemblyData = batchesAddAssemblyData();
if (machineIds.value.length == 0) {
proxy?.$modal.msgWarning('请选择机台!');
buttonLoading.value = false
return;
}
await orderAddProductPlanList({

@ -112,7 +112,7 @@
</el-button>
<el-button
type='primary'
:disabled='!currentWorkOrder'
:disabled='!currentWorkOrder || hasPendingInspection'
@click='handleFirstInspection'
>
首检
@ -127,6 +127,8 @@ import { listPlanInfo, updatePlanInfo, stopPlanInfo, resumePlanInfo, reportPlanI
import { PlanInfoVO, PlanInfoQuery } from '@/api/mes/planInfo/types';
import { getProdProductPlanDetailList, listProductPlanDetail } from '@/api/mes/productPlanDetail';
import { ProductPlanDetailQuery } from '@/api/mes/productPlanDetail/types';
import { listQcInspectionMain } from '@/api/qms/QcInspectionMain';
import { QcInspectionMainQuery } from '@/api/qms/QcInspectionMain/types';
import { parseTime } from '@/utils/ruoyi';
const { proxy } = getCurrentInstance() as any;
@ -141,6 +143,7 @@ const emit = defineEmits<{
const loading = ref(false);
const currentWorkOrder = ref<PlanInfoVO | null>(null);
const hasPendingInspection = ref(false); //
const reportForm = ref({
reportQuantity: 0,
@ -166,6 +169,29 @@ const getStatusText = (status: string) => {
return statusMap[status] || '未知';
};
//
const checkInspectionTask = async (planCode: string, planDetailId: string | number) => {
try {
const query: QcInspectionMainQuery = {
pageNum: 1,
pageSize: 1,
inspectionType: 0, //
status: 0, //
planDetailId: planDetailId
};
const res = await listQcInspectionMain(query);
const inspectionList = res.rows || [];
//
//
hasPendingInspection.value = inspectionList.length > 0;
} catch (error) {
console.error('查询首检任务状态失败:', error);
hasPendingInspection.value = false;
}
};
//
const getCurrentWorkOrder = async () => {
loading.value = true;
@ -184,12 +210,26 @@ const getCurrentWorkOrder = async () => {
const res = await listPlanInfo(query as PlanInfoQuery);
if (res.rows && res.rows.length > 0) {
currentWorkOrder.value = res.rows[0];
//
const detailRes = await getProdProductPlanDetailList({ planId: currentWorkOrder.value.planId });
const detailList = detailRes.data || [];
if (detailList && detailList.length > 0) {
const firstDetail = detailList[detailList.length - 1];
//
await checkInspectionTask(currentWorkOrder.value.planCode, firstDetail.planDetailId);
} else {
hasPendingInspection.value = false;
}
} else {
currentWorkOrder.value = null;
hasPendingInspection.value = false;
}
} catch (error) {
console.error('获取当前工单失败:', error);
currentWorkOrder.value = null;
hasPendingInspection.value = false;
} finally {
loading.value = false;
}
@ -319,9 +359,7 @@ const handleFirstInspection = async () => {
if (!currentWorkOrder.value) return;
try {
await proxy?.$modal.confirm('确认生成首检任务?');
loading.value = true;
//
const detailRes = await getProdProductPlanDetailList({ planId: currentWorkOrder.value.planId });
const detailList = detailRes.data || [];
@ -330,9 +368,21 @@ const handleFirstInspection = async () => {
proxy?.$modal.msgWarning('本工单尚未生成生产信息,无法进行首检');
return;
}
const firstDetail = detailList[detailList.length - 1];
const planDetailId = firstDetail.planDetailId;
//
await checkInspectionTask(currentWorkOrder.value.planCode, planDetailId);
if (hasPendingInspection.value) {
proxy?.$modal.msgWarning('已存在未处理的首检任务,无法重复生成');
return;
}
await proxy?.$modal.confirm('确认生成首检任务?');
loading.value = true;
//
const inspectionData = {
planDetailId: planDetailId,
@ -342,9 +392,11 @@ const handleFirstInspection = async () => {
await generateInspectionTask(inspectionData);
proxy?.$modal.msgSuccess('首检任务生成成功');
//
await checkInspectionTask(currentWorkOrder.value.planCode, planDetailId);
} catch (error: any) {
if (error !== 'cancel') {
proxy?.$modal.msgError('首检任务生成失败');
console.error('首检任务生成失败:', error);
}
} finally {

@ -0,0 +1,144 @@
<template>
<div class='inspection-record'>
<el-card shadow='never'>
<template #header>
<div class='card-header'>
<span>质检记录</span>
<el-button type='primary' icon='Refresh' @click='getList'>刷新</el-button>
</div>
</template>
<el-table
v-loading='loading'
:data='recordList'
border
stripe
style='width: 100%'
>
<el-table-column label='序号' align='center' type='index' width='55' />
<el-table-column label='检测单号' align='center' prop='inspectionNo' />
<el-table-column label='模板名称' align='center' prop='templateName' />
<el-table-column label='物料编码' align='center' prop='materialCode' />
<el-table-column label='物料名称' align='center' prop='materialName' show-overflow-tooltip />
<el-table-column label='工序名称' align='center' prop='processName' />
<el-table-column label='工位名称' align='center' prop='stationName' />
<el-table-column label='质检数量' align='center' prop='inspectionQty' />
<el-table-column label='合格数' align='center' prop='qualifiedQty' />
<el-table-column label='不合格数' align='center' prop='unqualifiedQty' />
<el-table-column label='质检结果' align='center' prop='result'>
<template #default='scope'>
<dict-tag :options='qc_result' :value='scope.row.result' />
</template>
</el-table-column>
<el-table-column label='车间' align='center' prop='workshop' />
<el-table-column label='检测类别' align='center' prop='typeName' />
<el-table-column label='单据状态' align='center' prop='status'>
<template #default='scope'>
<dict-tag :options='qc_status' :value='scope.row.status' />
</template>
</el-table-column>
<el-table-column label='检测人员' align='center' prop='inspector' />
<el-table-column label='班次' align='center' prop='shift' />
<el-table-column label='班组' align='center' prop='team' />
<el-table-column label='检验时间' align='center' prop='inspectionStartTime' width='180'>
<template #default='scope'>
<span>{{ parseTime(scope.row.inspectionStartTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label='检验结束时间' align='center' prop='inspectionEndTime' width='180'>
<template #default='scope'>
<span>{{ parseTime(scope.row.inspectionEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label='业务来源单号' align='center' prop='productionOrder' />
<el-table-column label='批次号' align='center' prop='batchNo' />
<el-table-column label='条码号' align='center' prop='barcode' />
<el-table-column label='供应商名称' align='center' prop='supplierName' />
<el-table-column label='备注' align='center' prop='remark' show-overflow-tooltip />
</el-table>
<pagination
v-show='total > 0'
:total='total'
v-model:page='queryParams.pageNum'
v-model:limit='queryParams.pageSize'
@pagination='getList'
/>
</el-card>
</div>
</template>
<script setup name='InspectionRecord' lang='ts'>
import { ref, onMounted, getCurrentInstance, toRefs } from 'vue';
import { listQcInspectionMain } from '@/api/qms/QcInspectionMain';
import { QcInspectionMainVO, QcInspectionMainQuery } from '@/api/qms/QcInspectionMain/types';
import { parseTime } from '@/utils/ruoyi';
const { proxy } = getCurrentInstance() as any;
const { qc_result, qc_status } = toRefs<any>(proxy?.useDict('qc_result', 'qc_status'));
const props = defineProps<{
workstationId?: string | number;
workstation?: string;
}>();
const loading = ref(false);
const recordList = ref<QcInspectionMainVO[]>([]);
const total = ref(0);
const queryParams = ref<QcInspectionMainQuery>({
pageNum: 1,
pageSize: 10
});
//
const getList = async () => {
loading.value = true;
try {
const query: QcInspectionMainQuery = {
...queryParams.value
};
//
if (props.workstation) {
query.stationName = props.workstation;
}
const res = await listQcInspectionMain(query);
recordList.value = res.rows || [];
total.value = res.total || 0;
} catch (error) {
console.error('获取质检记录失败:', error);
recordList.value = [];
total.value = 0;
} finally {
loading.value = false;
}
};
//
const refresh = () => {
getList();
};
defineExpose({
refresh
});
onMounted(() => {
getList();
});
</script>
<style scoped lang='scss'>
.inspection-record {
width: 100%;
height: 100%;
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
}
</style>

@ -14,12 +14,13 @@
<el-table-column label='产品名称' prop='materialName' width='200' align='center' show-overflow-tooltip />
<el-table-column label='工序名称' prop='processName' width='150' align='center' />
<el-table-column label='计划数量' prop='planAmount' width='100' align='center' />
<el-table-column label='已报工数量' prop='completeAmount' width='100' align='center' />
<el-table-column label='排产日期' prop='planBeginTime' width='150' align='center'>
<template #default='scope'>
<span>{{ parseTime(scope.row.planBeginTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label='计划状态' prop='planStatus' width='100' align='center'>
<el-table-column label='工单状态' prop='planStatus' width='100' align='center'>
<template #default='scope'>
<dict-tag :options='mes_plan_status' :value='scope.row.planStatus' />
</template>

@ -18,7 +18,7 @@
<el-table-column label='工单号' prop='planCode' width='150' align='center' />
<el-table-column label='产品名称' prop='materialName' width='200' align='center' show-overflow-tooltip />
<el-table-column label='工序名称' prop='processName' width='150' align='center' />
<el-table-column label='工位' prop='workstation' width='120' align='center' />
<el-table-column label='工位' prop='stationName' width='120' align='center' />
<el-table-column label='报工数量' prop='reportQuantity' width='100' align='center' />
<el-table-column label='不良数量' prop='remainingAmount' width='100' align='center' />
<el-table-column label='报工时间' prop='reportTime' width='180' align='center'>
@ -50,7 +50,7 @@ import { PlanInfoQuery } from '@/api/mes/planInfo/types';
import { parseTime } from '@/utils/ruoyi';
const props = defineProps<{
workstationId?: string | number;
workstationId?: number;
}>();
const loading = ref(false);
@ -59,7 +59,8 @@ const total = ref(0);
const queryParams = ref<ProductPlanDetailQuery>({
pageNum: 1,
pageSize: 10
pageSize: 10,
stationId: props.workstationId
});
//
@ -83,9 +84,9 @@ const getList = async () => {
processName: (item as any).processName || '-',
reportQuantity: item.completeAmount || 0,
remainingAmount: (item as any).remainingAmount || 0,
reportTime: item.realBeginTime || item.realEndTime || '',
reportUser: item.userName || '-',
workstation: (item as any).workstationName || '-',
reportTime: item.realBeginTime,
reportUser: item.reportUser ,
stationName: (item as any).stationName || '-',
remark: item.remark || '-'
}));

@ -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) {
// IDwatch
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;
}
// IDwatch
workstationId.value = stationId;

@ -710,8 +710,8 @@ const sharedData = computed(() => sharedStore.dynamicValue)
watch(
() => sharedStore.dynamicValue,
(newValue, oldValue) => {
if (newValue !== oldValue) {
ElMessage.info('收到新数据更新')
if (newValue!=null && newValue.message!=null && newValue !== oldValue) {
// ElMessage.info('')
console.log('数据更新:', newValue)
//
// handleDataUpdate(newValue)

Loading…
Cancel
Save