liu
昨天 c6ce881a26895edc9e89aea8317be15572f48b23
Merge remote-tracking branch 'origin/dev_pro2.0' into dev_pro2.0
已修改2个文件
48 ■■■■ 文件已修改
src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/workbench/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/workbench/components/tabs/FeedbackHistoryTab.vue
@@ -32,6 +32,7 @@
const props = defineProps<{
  taskId?: number;
  task?: Record<string, any>;
  /** 外部触发刷新 */
  refreshKey?: number;
}>();
@@ -47,7 +48,16 @@
const router = useRouter();
const batchDialogRef = ref<InstanceType<typeof BatchInputDialog>>();
const approvingRow = ref<MesProFeedbackApi.Feedback>();
const batchActionType = ref<'submit' | 'approve'>('approve');
const actionRow = ref<MesProFeedbackApi.Feedback>();
/** 执行提交(含批次属性) */
async function doSubmit(row: MesProFeedbackApi.Feedback, batchFields?: Record<string, unknown>) {
  await submitFeedback({ id: row.id!, ...batchFields });
  message.success('报工单已提交');
  refreshGrid();
  emit('reported');
}
/** 执行审批(含批次属性) */
async function doApprove(row: MesProFeedbackApi.Feedback, batchFields?: Record<string, unknown>) {
@@ -79,10 +89,23 @@
/** 提交(仅草稿) */
async function handleSubmit(row: MesProFeedbackApi.Feedback) {
  await submitFeedback({ id: row.id! });
  message.success('报工单已提交');
  refreshGrid();
  emit('reported');
  if (props.task?.feedbackApprove) {
    await doSubmit(row);
    return;
  }
  try {
    const checkResult = await getBatchRequirements(row.id!);
    if (checkResult?.needBatchInput) {
      batchActionType.value = 'submit';
      actionRow.value = row;
      batchDialogRef.value?.open({ checkResult });
    } else {
      await doSubmit(row);
    }
  } catch {
    await doSubmit(row);
  }
}
/** 审批通过(仅审批中) */
@@ -90,7 +113,8 @@
  try {
    const checkResult = await getBatchRequirements(row.id!);
    if (checkResult?.needBatchInput) {
      approvingRow.value = row;
      batchActionType.value = 'approve';
      actionRow.value = row;
      batchDialogRef.value?.open({ checkResult });
    } else {
      await doApprove(row);
@@ -102,8 +126,12 @@
/** 批次弹窗确认回调 */
function handleBatchConfirm(batchData: Record<string, unknown>) {
  if (approvingRow.value) {
    doApprove(approvingRow.value, batchData);
  if (actionRow.value) {
    if (batchActionType.value === 'approve') {
      doApprove(actionRow.value, batchData);
    } else if (batchActionType.value === 'submit') {
      doSubmit(actionRow.value, batchData);
    }
  }
}
src/views/mes/workbench/index.vue
@@ -267,18 +267,21 @@
          <FeedbackHistoryTab
            v-else-if="activeTab === 'history'"
            :task-id="selectedTask?.id"
            :task="selectedTask"
            :refresh-key="reportRefreshKey"
            @reported="onReported"
          />
          <RecordParamTab
            v-else-if="activeTab === 'record-param'"
            :task-id="selectedTask?.id"
            :task="selectedTask"
            :work-order-id="selectedTask?.id"
            :workstation-id="workstationId"
          />
          <ProductIssueTab
            v-else-if="activeTab === 'product-issue'"
            :task-id="selectedTask?.id"
            :task="selectedTask"
            :task-code="selectedTask?.code"
            :task-name="selectedTask?.name"
            :work-order-id="selectedTask?.workOrderId"
@@ -288,6 +291,7 @@
          <ReturnIssueTab
            v-else-if="activeTab === 'return-issue'"
            :task-id="selectedTask?.id"
            :task="selectedTask"
            :task-code="selectedTask?.code"
            :task-name="selectedTask?.name"
            :work-order-id="selectedTask?.workOrderId"