| | |
| | | import { ref } from "vue"; |
| | | |
| | | import { |
| | | confirm, |
| | | Page, |
| | | useVbenModal, |
| | | } from "@vben/common-ui"; |
| | | import { DICT_TYPE } from "@vben/constants"; |
| | | import { getDictLabel } from "@vben/hooks"; |
| | | import { downloadFileFromBlobPart } from "@vben/utils"; |
| | | |
| | | import { Button, Card, message } from "ant-design-vue"; |
| | |
| | | deleteItem, |
| | | exportItem, |
| | | getItemPage, |
| | | updateItemStatus, |
| | | } from "#/api/mes/md/item"; |
| | | import { $t } from "#/locales"; |
| | | import { MdItemTypeTree } from "#/views/mes/md/item/type/components"; |
| | | import { PrinterLabel } from "#/views/wls/barcode/components"; |
| | | // import { PrinterLabel } from "#/views/wls/barcode/components"; |
| | | |
| | | import { useGridColumns, useGridFormSchema } from "./data"; |
| | | import Form from "./modules/form.vue"; |
| | |
| | | handleRefresh(); |
| | | } |
| | | |
| | | /** 更新物料状态 */ |
| | | async function handleStatusChange( |
| | | newStatus: number, |
| | | row: MesMdItemApi.Item |
| | | ): Promise<boolean | undefined> { |
| | | try { |
| | | await confirm( |
| | | `确认要将"${row.name}"物料切换为【${getDictLabel( |
| | | DICT_TYPE.COMMON_STATUS, |
| | | newStatus |
| | | )}】吗?` |
| | | ); |
| | | } catch { |
| | | return false; |
| | | } |
| | | await updateItemStatus(row.id!, newStatus); |
| | | message.success($t("ui.actionMessage.operationSuccess")); |
| | | return true; |
| | | } |
| | | |
| | | const [Grid, gridApi] = useVbenVxeGrid({ |
| | | formOptions: { |
| | | schema: useGridFormSchema(), |
| | | }, |
| | | gridOptions: { |
| | | columns: useGridColumns(handleStatusChange), |
| | | columns: useGridColumns(), |
| | | height: "auto", |
| | | keepSource: true, |
| | | proxyConfig: { |
| | |
| | | <template #toolbar-tools> |
| | | <TableAction :actions="[ |
| | | { |
| | | label: $t('ui.actionTitle.import'), |
| | | type: 'primary', |
| | | icon: ACTION_ICON.UPLOAD, |
| | | auth: ['mes:md-item:import'], |
| | | onClick: handleImport, |
| | | }, |
| | | { |
| | | label: $t('ui.actionTitle.export'), |
| | | type: 'primary', |
| | | icon: ACTION_ICON.DOWNLOAD, |
| | |
| | | }, |
| | | }, |
| | | ]" /> |
| | | <PrinterLabel :biz-id="row.id" |
| | | <!-- <PrinterLabel :biz-id="row.id" |
| | | :biz-code="row.code" |
| | | biz-type="ITEM" /> |
| | | biz-type="ITEM" /> --> |
| | | </div> |
| | | </template> |
| | | </Grid> |