ÎļþÃû´Ó eims-ui/apps/web-antd/src/views/eims/maint-order-st/index.vue ÐÞ¸Ä |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { onMounted, ref } from 'vue'; |
| | | |
| | | import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { addFullName, getPopupContainer, getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Popconfirm, Space } from 'ant-design-vue'; |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { listMaintOrderGroupDetail } from '#/api/eims/maint-order'; |
| | | import { delMaintOrderSt, listMaintOrderSt } from '#/api/eims/maint-order-st'; |
| | | import { delMaintSt, listMaintSt } from '#/api/eims/maint-st'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import BasisSubTable from '#/views/eims/components/basis-sub-table.vue'; |
| | | import { columns as orderCol } from '#/views/eims/maint-order/data'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import maintOrderStDrawer from './maint-order-st-drawer.vue'; |
| | | import type { Recordable } from '@vben/types'; |
| | | import { MAINT_ORDER_STATUS } from '#/constants/dict'; |
| | | import { $t } from '@vben/locales'; |
| | | import maintStDrawer from './maint-st-drawer.vue'; |
| | | |
| | | defineExpose({ |
| | | tableSelect |
| | |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | return await listMaintOrderSt({ |
| | | return await listMaintSt({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | |
| | | } |
| | | ]); |
| | | } |
| | | const [MaintOrderStDrawer, maintOrderStDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: maintOrderStDrawer |
| | | const [MaintStDrawer, maintStDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: maintStDrawer |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | maintOrderStDrawerApi.setData({}); |
| | | maintOrderStDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | maintOrderStDrawerApi.setData({ id: record.id }); |
| | | maintOrderStDrawerApi.open(); |
| | | maintStDrawerApi.setData({ id: record.id }); |
| | | maintStDrawerApi.open(); |
| | | } |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delMaintOrderSt(row.id); |
| | | await delMaintSt(row.id); |
| | | await tableApi.query(); |
| | | } |
| | | |
| | | function handleMultiDelete() { |
| | | const rows = tableApi.grid.getCheckboxRecords(); |
| | | const ids = rows.map((row: any) => row.id); |
| | | Modal.confirm({ |
| | | title: 'æç¤º', |
| | | okType: 'danger', |
| | | content: `确认å é¤éä¸ç${ids.length}æ¡è®°å½åï¼`, |
| | | onOk: async () => { |
| | | await delMaintSt(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | await setupDeptSelect(); |
| | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px] flex-col"> |
| | | <BasicTable class="h-3/5" table-title="ä¿å
»å·¥åå表"> |
| | | <BasicTable class="h-2/3" table-title="ä¿å
»å·¥åå表"> |
| | | <template #toolbar-tools> |
| | | <Space /> |
| | | <Space> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:maintSt:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #equName="{ row }"> |
| | |
| | | </template> |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button v-access:code="['eims:maintOrderSt:edit']" @click.stop="handleEdit(row)"> |
| | | <ghost-button v-access:code="['eims:maintSt:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" |
| | | @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:maintOrderSt:remove']" @click.stop=""> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:maintSt:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | </template> |
| | | |
| | | </BasicTable> |
| | | <BasisSubTable |
| | | :columns="orderCol" |
| | | :list-api="listMaintOrderGroupDetail" |
| | | :req-value="orderId" |
| | | class="h-2/5" |
| | | class="h-1/3" |
| | | req-key="maintCode" |
| | | title="ä¿å
»å®æ½é¡¹ç®" |
| | | /> |
| | | </div> |
| | | <MaintOrderStDrawer @reload="tableApi.query()" /> |
| | | <MaintStDrawer @reload="tableApi.query()" /> |
| | | </Page> |
| | | </template> |