| | |
| | | import { ref } from 'vue'; |
| | | import { useRouter } from 'vue-router'; |
| | | |
| | | import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'; |
| | | import { Page, useVbenDrawer, useVbenModal, type VbenFormProps } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import equDrawer from './equ-drawer.vue'; |
| | | import equImportModal from './equ-import-modal.vue'; |
| | | import EquTypeTree from './equ-type-tree.vue'; |
| | | |
| | | // 左边部门用 |
| | |
| | | connectedComponent: equDrawer |
| | | }); |
| | | |
| | | /** |
| | | * 导入 |
| | | */ |
| | | const [EquImportModal, equImportModalApi] = useVbenModal({ |
| | | connectedComponent: equImportModal |
| | | }); |
| | | |
| | | function handleImport() { |
| | | equImportModalApi.open(); |
| | | } |
| | | |
| | | function handleAdd() { |
| | | equDrawerApi.setData({}); |
| | | equDrawerApi.open(); |
| | |
| | | return importStatus ? '未导入' : '已导入'; |
| | | } |
| | | |
| | | function getInventoryFlag(row: any) { |
| | | const inventoryFlag = row.inventoryFlag === null || row.inventoryFlag; |
| | | return inventoryFlag ? '未盘点' : '已盘点'; |
| | | } |
| | | |
| | | const router = useRouter(); |
| | | function handleDetail(record: Recordable<any>) { |
| | | router.push(`/equ/detail/${record.equId}`); |
| | |
| | | <Space> |
| | | <a-button v-access:code="['eims:equ:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <a-button v-access:code="['eims:equ:import']" @click="handleImport"> |
| | | {{ $t('pages.common.import') }} |
| | | </a-button> |
| | | <a-button :disabled="!vxeCheckboxChecked(tableApi)" danger type="primary" v-access:code="['eims:equ:remove']" @click="handleMultiDelete"> |
| | | {{ $t('pages.common.delete') }} |
| | |
| | | <template #importStatus="{ row }"> |
| | | <span>{{ getImportStatus(row) }}</span> |
| | | </template> |
| | | |
| | | <template #inventoryFlag="{ row }"> |
| | | <span>{{ getInventoryFlag(row) }}</span> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | <EquDrawer @reload="tableApi.query()" /> |
| | | <EquImportModal @reload="tableApi.query()" /> |
| | | </Page> |
| | | </template> |