| | |
| | | import { useUserStore } from '@vben/stores'; |
| | | import { addFullName, getPopupContainer, getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | import { message, Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { delRepairReq, listRepairReq, repairReqExport } from '#/api/eims/repair-req'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import { REPAIR_REQ_STATUS } from '#/constants/dict'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import repairReqDrawer from './repair-req-drawer.vue'; |
| | | |
| | | import sendWorkDrawer from './send-work-drawer.vue'; |
| | | |
| | | interface Props { |
| | | filterFlag?: boolean; |
| | | status?: string; |
| | | } |
| | | const props = withDefaults(defineProps<Props>(), { filterFlag: false, status: undefined }); |
| | | |
| | | |
| | | const userStore = useUserStore(); |
| | | const userId = userStore.userInfo?.userId; |
| | |
| | | defineExpose({ |
| | | tableSelect |
| | | }); |
| | | |
| | | |
| | | const formOptions: VbenFormProps = { |
| | | commonConfig: { |
| | |
| | | connectedComponent: repairReqDrawer |
| | | }); |
| | | |
| | | const [SendWorkDrawer, drawerApi] = useVbenDrawer({ |
| | | connectedComponent: sendWorkDrawer, |
| | | title: '派工' |
| | | }); |
| | | |
| | | 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); |
| | | if (rows.length === 0) { |
| | | message.warn('请选择报修单后派工!'); |
| | | return; |
| | | } else if (filterData.length > 0) { |
| | | message.warn('请选择未接单报修单后派工!'); |
| | | return; |
| | | } |
| | | drawerApi.setData({ batchReqIds: ids }); |
| | | drawerApi.open(); |
| | | } |
| | | |
| | | function handleAdd() { |
| | | repairReqDrawerApi.setData({ reqUser: userId, reqDept: deptId }); |
| | | repairReqDrawerApi.open(); |
| | |
| | | fieldMappingTime: formOptions.fieldMappingTime |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 派工 |
| | | */ |
| | | function handleSendWork() {} |
| | | |
| | | onMounted(async () => { |
| | | await setupDeptSelect(); |
| | |
| | | <BasicTable class="flex-1 overflow-hidden" table-title="故障报修列表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | | <a-button v-access:code="['eims:repairReq:send']" @click="openSendWork"> 派工 </a-button> |
| | | <a-button v-access:code="['eims:repairReq:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | |
| | | </BasicTable> |
| | | </div> |
| | | <RepairReqDrawer @reload="tableApi.query()" /> |
| | | <SendWorkDrawer @reload="tableApi.query()" /> |
| | | </Page> |
| | | </template> |