| | |
| | | import type { VxeTableGridOptions } from '#/adapter/vxe-table'; |
| | | import type { MesWmTransactionApi } from '#/api/mes/wm/transaction'; |
| | | |
| | | import { Page } from '@vben/common-ui'; |
| | | import { Page, useVbenModal } from '@vben/common-ui'; |
| | | |
| | | import { Tag } from 'ant-design-vue'; |
| | | import { Button, Tag } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { getTransactionPage } from '#/api/mes/wm/transaction'; |
| | | |
| | | import QrTraceModal from '#/views/mes/pro/components/qr-trace-modal.vue'; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from './data'; |
| | | |
| | | const [QrTraceQueryModal, qrTraceQueryModalApi] = useVbenModal({ |
| | | connectedComponent: QrTraceModal, |
| | | destroyOnClose: true, |
| | | }); |
| | | |
| | | function handleBatchClick(row: MesWmTransactionApi.Transaction) { |
| | | if (!row.batchCode) { |
| | | return; |
| | | } |
| | | qrTraceQueryModalApi.setData({ code: row.batchCode }).open(); |
| | | } |
| | | |
| | | const [Grid, gridApi] = useVbenVxeGrid({ |
| | | formOptions: { |
| | |
| | | |
| | | <template> |
| | | <Page auto-content-height> |
| | | <QrTraceQueryModal /> |
| | | <Grid table-title="库存事务流水"> |
| | | <template #batchCode="{ row }"> |
| | | <Button |
| | | v-if="row.batchCode" |
| | | type="link" |
| | | class="!px-0" |
| | | @click="handleBatchClick(row)" |
| | | > |
| | | {{ row.batchCode }} |
| | | </Button> |
| | | <span v-else>-</span> |
| | | </template> |
| | | <template #typeName="{ row }"> |
| | | <Tag :color="row.type === 1 ? 'green' : 'red'"> |
| | | {{ row.typeName || '-' }} |