车间能级提升-智能设备管理系统
baoshiwei
2025-04-17 bb79260cbeeac88cfbadc9606eea57002e8945bc
eims-ui/apps/web-antd/src/views/eims/spare/index.vue
@@ -10,11 +10,12 @@
import { Image, Modal, Popconfirm, Space } from 'ant-design-vue';
import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table';
import { delSpare, listSpare, spareExport } from '#/api/eims/spare';
import { delSpare, listInout, listSpare, spareExport } from '#/api/eims/spare';
import { configInfoByKey } from '#/api/system/config';
import { commonDownloadExcel } from '#/utils/file/download';
import BasisSubTable from '#/views/eims/components/basis-sub-table.vue';
import { columns, querySchema } from './data';
import { columns, inoutCol, querySchema } from './data';
import spareDrawer from './spare-drawer.vue';
import SpareTypeTree from './spare-type-tree.vue';
@@ -59,7 +60,7 @@
  height: 'auto',
  keepSource: true,
  pagerConfig: {
    enabled: false,
    enabled: false
  },
  proxyConfig: {
    enabled: true,
@@ -84,7 +85,7 @@
    keyField: 'id'
  },
  columnConfig: {
    resizable: true,
    resizable: true
  },
  sortConfig: {
    // 远程排序
@@ -94,12 +95,16 @@
  },
  id: 'eims-spare-index'
};
const id = ref<string>();
const [BasicTable, tableApi] = useVbenVxeGrid({
  formOptions,
  gridOptions,
  gridEvents: {
    sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams)
    sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams),
    cellClick: (e: any) => {
      const { row } = e;
      id.value = row.id;
    }
  }
});
@@ -163,7 +168,9 @@
  <Page :auto-content-height="true">
    <div class="flex h-full gap-[8px]">
      <SpareTypeTree v-model:select-type-id="selectTypeId" class="w-[260px]" @reload="() => tableApi.reload()" @select="() => tableApi.reload()" />
      <BasicTable class="flex-1 overflow-hidden" table-title="备件台账">
      <div class="flex-1 overflow-hidden">
        <div class="flex h-full gap-[8px] flex-col">
          <BasicTable class="h-2/3" table-title="备件台账">
        <template #toolbar-tools>
          <Space>
            <a-button v-access:code="['eims:spare:export']" @click="handleDownloadExcel">
@@ -202,12 +209,15 @@
          </Space>
        </template>
      </BasicTable>
          <BasisSubTable :columns="inoutCol" :list-api="listInout" :req-value="id" class="h-1/3" req-key="id" title="出入库明细" />
        </div>
      </div>
    </div>
    <SpareDrawer @reload="tableApi.query()" />
  </Page>
</template>
<style>
<style lang="scss" scoped>
/* 统一所有列的边框和行高 */
.vxe-table--body .vxe-body--row .vxe-body--column {
  height: 56px !important;