gaoluyang
14 小时以前 cb9cd49627b65a4c0e137e08063271a8cefe1826
src/views/mes/pro/feedback/index.vue
@@ -2,10 +2,10 @@
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { MesProFeedbackApi } from '#/api/mes/pro/feedback';
import { DocAlert, Page, useVbenModal } from '..\..\..\..\packages\effects\common-ui\src';
import { MesProFeedbackStatusEnum } from '..\..\..\..\packages\constants\src';
import { useUserStore } from '..\..\..\..\packages\stores\src';
import { downloadFileFromBlobPart } from '..\..\..\..\packages\utils\src';
import { Page, useVbenModal } from '@vben/common-ui';
import { MesProFeedbackStatusEnum } from '@vben/constants';
import { useUserStore } from '@vben/stores';
import { downloadFileFromBlobPart } from '@vben/utils';
import { Button, message } from 'ant-design-vue';
@@ -19,12 +19,24 @@
import { useGridColumns, useGridFormSchema } from './data';
import Form from './modules/form.vue';
import QuickFeedbackForm from '../workorder-center/modules/quick-feedback.vue';
import BatchFeedbackForm from './modules/batch-feedback.vue';
const userStore = useUserStore();
const currentUserId = userStore.userInfo?.id; // 当前登录用户 ID,用于审批人权限判断
const [FormModal, formModalApi] = useVbenModal({
  connectedComponent: Form,
  destroyOnClose: true,
});
const [QuickFeedbackModal, quickFeedbackModalApi] = useVbenModal({
  connectedComponent: QuickFeedbackForm,
  destroyOnClose: true,
});
const [BatchFeedbackModal, batchFeedbackModalApi] = useVbenModal({
  connectedComponent: BatchFeedbackForm,
  destroyOnClose: true,
});
@@ -40,7 +52,7 @@
/** 编辑生产报工 */
function handleEdit(row: MesProFeedbackApi.Feedback) {
  formModalApi.setData({ formType: 'update', id: row.id }).open();
  formModalApi.setData({ formType: 'update', id: row.id, showSubmitButton: false }).open();
}
/** 提交生产报工 */
@@ -79,6 +91,16 @@
  downloadFileFromBlobPart({ fileName: '生产报工.xls', source: data });
}
/** 快速报工 */
function handleQuickCreate() {
  quickFeedbackModalApi.setData({}).open();
}
/** 批量报工 */
function handleBatchCreate() {
  batchFeedbackModalApi.setData({}).open();
}
const [Grid, gridApi] = useVbenVxeGrid({
  formOptions: { schema: useGridFormSchema() },
  gridOptions: {
@@ -104,13 +126,9 @@
<template>
  <Page auto-content-height>
    <template #doc>
      <DocAlert
        title="【生产】生产报工"
        url="https://doc.iocoder.cn/mes/pro/feedback/"
      />
    </template>
    <FormModal @success="handleRefresh" />
    <QuickFeedbackModal @success="handleRefresh" />
    <BatchFeedbackModal @success="handleRefresh" />
    <Grid table-title="生产报工列表">
      <template #toolbar-tools>
        <TableAction
@@ -123,6 +141,19 @@
              onClick: handleCreate,
            },
            {
              label: '快速报工',
              type: 'primary',
              icon: ACTION_ICON.ADD,
              auth: ['mes:pro-feedback:create'],
              onClick: handleQuickCreate,
            },
            {
              label: '批量报工',
              type: 'primary',
              auth: ['mes:pro-feedback:create'],
              onClick: handleBatchCreate,
            },
            {
              label: $t('ui.actionTitle.export'),
              type: 'primary',
              icon: ACTION_ICON.DOWNLOAD,