车间能级提升-智能设备管理系统
zhuguifei
2025-02-26 d85cb9da90d1dd24f6ecfa187aa8c4198394c29a
eims-ui/apps/web-antd/src/views/eims/repair-req/index.vue
@@ -5,6 +5,7 @@
import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { useUserStore } from '@vben/stores';
import { addFullName, getPopupContainer, getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
@@ -16,11 +17,23 @@
import { columns, querySchema } from './data';
import repairReqDrawer from './repair-req-drawer.vue';
import { useUserStore } from '@vben/stores';
interface Props {
  filterFlag?: boolean;
  status?: string;
}
const props = withDefaults(defineProps<Props>(), { filterFlag: false, status: undefined });
const userStore = useUserStore();
const userId = userStore.userInfo?.userId;
const deptId = userStore.userInfo?.deptId;
defineExpose({
  tableSelect
});
const formOptions: VbenFormProps = {
  commonConfig: {
@@ -45,13 +58,21 @@
    // 点击行选中
    // trigger: 'row'
  },
  columns,
  columns: columns?.filter((item) => (props.filterFlag ? item.field !== 'action' : item.field !== '-1')),
  height: 'auto',
  keepSource: true,
  pagerConfig: {},
  toolbarConfig: {
    enabled: !props.filterFlag
  },
  proxyConfig: {
    ajax: {
      query: async ({ page }, formValues = {}) => {
        // 如果传入了equId则只查询当前id数据
        if (props.filterFlag && props.status) {
          const params = { status: props.status };
          Object.assign(formValues, params);
        }
        return await listRepairReq({
          pageNum: page.currentPage,
          pageSize: page.pageSize,
@@ -191,12 +212,16 @@
    }
  ]);
}
// 选中数据
function tableSelect() {
  return tableApi.grid.getCheckboxRecords();
}
</script>
<template>
  <Page :auto-content-height="true">
    <div class="flex h-full gap-[8px]">
      <BasicTable class="flex-1 overflow-hidden" table-title="设备盘点列表">
      <BasicTable class="flex-1 overflow-hidden" table-title="故障报修列表">
        <template #toolbar-tools>
          <Space>
            <a-button v-access:code="['eims:repairReq:export']" @click="handleDownloadExcel">