车间能级提升-智能设备管理系统
baoshiwei
2025-07-11 1524fa42ddf01fd72207a8a4b4667a48e4f233aa
eims-ui/apps/web-antd/src/views/eims/maint-plan/index.vue
@@ -3,7 +3,7 @@
import { onMounted, ref } from 'vue';
import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui';
import { Page, useVbenDrawer, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { addFullName, getPopupContainer, getVxePopupContainer } from '@vben/utils';
@@ -11,17 +11,20 @@
import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table';
import { delMaintPlan, listMaintPlan, maintPlanExport } from '#/api/eims/maint-plan';
import { listMaintStand } from '#/api/eims/maint-stand';
import { generateCode } from '#/api/eims/utils';
import { getDeptTree, userList } from '#/api/system/user';
import { MAINT_ORDER_STATUS } from '#/constants/dict';
import { commonDownloadExcel } from '#/utils/file/download';
import BasisSubTable from '#/views/eims/components/basis-sub-table.vue';
import maintOrderDrawer from '#/views/eims/maint-order/maint-order-drawer.vue';
import { columns as maintSrandCol } from '#/views/eims/maint-stand/data';
import { columns, querySchema } from './data';
import maintPlanDrawer from './maint-plan-drawer.vue';
import maintPlanImportModal from './maint-plan-import-modal.vue';
defineExpose({
  tableSelect
});
const formOptions: VbenFormProps = {
  commonConfig: {
@@ -92,6 +95,17 @@
  connectedComponent: maintOrderDrawer,
});
/**
 * 导入
 */
const [MaintPlanImportModal, maintPlanImportModalApi] = useVbenModal({
  connectedComponent: maintPlanImportModal
});
function handleImport() {
  maintPlanImportModalApi.open();
}
function handleAdd() {
  maintPlanDrawerApi.setData({});
  maintPlanDrawerApi.open();
@@ -145,6 +159,7 @@
  }
  const planOrder = {
    equId: record.equId,
    planId: record.id,
    equName: record.equName,
    maintUser: record.maintUser,
    maintUserName: record.maintUserName,
@@ -153,7 +168,8 @@
    maintType: record.maintType,
    planTime: record.maintNextTime,
    status: MAINT_ORDER_STATUS.DAIBAOYANG,
    maintCode: code
    maintCode: code,
    maintName: record.maintName
  };
  maintOrderDrawerApi.setData({ planOrder });
@@ -230,16 +246,24 @@
onMounted(async () => {
  await setupDeptSelect();
});
// 选中数据
function tableSelect() {
  return tableApi.grid.getCheckboxRecords();
}
</script>
<template>
  <Page :auto-content-height="true">
    <div class="flex h-full gap-[8px] flex-col">
      <BasicTable class="h-2/3" table-title="保养计划列表">
      <BasicTable  table-title="保养计划列表">
        <template #toolbar-tools>
          <Space>
            <a-button v-access:code="['eims:maintPlan:export']" @click="handleDownloadExcel">
              {{ $t('pages.common.export') }}
            </a-button>
            <a-button v-access:code="['eims:maintPlan:import']" @click="handleImport">
              {{ $t('pages.common.import') }}
            </a-button>
            <a-button
              :disabled="!vxeCheckboxChecked(tableApi)"
@@ -285,9 +309,9 @@
          </Dropdown>
        </template>
      </BasicTable>
      <BasisSubTable :columns="maintSrandCol" :list-api="listMaintStand" :req-value="equId" class="h-1/3" req-key="equId" title="保养实施项目" />
    </div>
    <MaintPlanDrawer @reload="tableApi.query()" />
    <MaintOrderDrawer @reload="tableApi.query()" />
    <MaintPlanImportModal @reload="tableApi.query()" />
  </Page>
</template>