| | |
| | | <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'; |
| | |
| | | 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; |
| | |
| | | }, |
| | | 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; |
| | | } |
| | | } |
| | | }); |
| | | |
| | |
| | | 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; |
| | |
| | | |
| | | <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> |
| | |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | <RepairRecord :req-id="reqId" class="h-1/3" table-title="维修记录" /> |
| | | </div> |
| | | <RepairReqDrawer @reload="tableApi.query()" /> |
| | | <SendWorkDrawer @reload="tableApi.query()" /> |