车间能级提升-智能设备管理系统
zhuguifei
2025-02-28 74448f9a9f1f8cb779023db3ea9eda762fc6ad0a
eims-ui/apps/web-antd/src/views/eims/repair-req/index.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { onMounted } from 'vue';
import { onMounted, ref } from 'vue';
import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui';
import { $t } from '@vben/locales';
@@ -19,6 +19,7 @@
import { columns, querySchema } from './data';
import repairReqDrawer from './repair-req-drawer.vue';
import sendWorkDrawer from './send-work-drawer.vue';
import RepairRecord from '#/views/eims/repair-record/index.vue';
interface Props {
  filterFlag?: boolean;
@@ -93,12 +94,16 @@
  },
  id: 'eims-repair-req-index'
};
const reqId = 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;
      reqId.value = row.id;
    }
  }
});
@@ -114,7 +119,8 @@
function openSendWork() {
  const rows = tableApi.grid.getCheckboxRecords();
  const ids = rows.map((row: any) => row.id).join(',');
  const filterData = rows.filter((item) => item.status === REPAIR_REQ_STATUS.WEIXIU || item.status === REPAIR_REQ_STATUS.WANCHENG);
  //  不允许选择待接单以外状态的数据
  const filterData = rows.filter((item) => item.status !== REPAIR_REQ_STATUS.DAIJIEDAN);
  if (rows.length === 0) {
    message.warn('请选择报修单后派工!');
    return;
@@ -244,8 +250,8 @@
<template>
  <Page :auto-content-height="true">
    <div class="flex h-full gap-[8px]">
      <BasicTable class="flex-1 overflow-hidden" table-title="故障报修列表">
    <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:repairReq:send']" @click="openSendWork"> 派工 </a-button>
@@ -280,6 +286,7 @@
          </Space>
        </template>
      </BasicTable>
      <RepairRecord :req-id="reqId" class="h-1/3" table-title="维修记录" />
    </div>
    <RepairReqDrawer @reload="tableApi.query()" />
    <SendWorkDrawer @reload="tableApi.query()" />