diff --git a/apps/web-antd/src/api/mes/md/autocode/part/index.ts b/apps/web-antd/src/api/mes/md/autocode/part/index.ts new file mode 100644 index 000000000..2962ae55e --- /dev/null +++ b/apps/web-antd/src/api/mes/md/autocode/part/index.ts @@ -0,0 +1,53 @@ +import { requestClient } from '#/api/request'; + +export namespace MesMdAutoCodePartApi { + /** MES 编码规则分段 */ + export interface AutoCodePart { + id?: number; // 分段编号 + ruleId?: number; // 规则编号 + sort?: number; // 排序 + type?: number; // 分段类型 + length?: number; // 长度 + dateFormat?: string; // 日期格式 + fixCharacter?: string; // 固定字符 + serialStartNo?: number; // 流水号起始值 + serialStep?: number; // 流水号步长 + cycleFlag?: boolean; // 是否循环 + cycleMethod?: number; // 循环方式 + remark?: string; // 备注 + } +} + +/** 查询编码规则分段详情 */ +export function getAutoCodePart(id: number) { + return requestClient.get( + `/mes/md/auto-code-part/get?id=${id}`, + ); +} + +/** 查询编码规则分段列表 */ +export function getAutoCodePartListByRuleId(ruleId: number) { + return requestClient.get( + '/mes/md/auto-code-part/list-by-rule-id', + { params: { ruleId } }, + ); +} + +/** 新增编码规则分段 */ +export function createAutoCodePart( + data: MesMdAutoCodePartApi.AutoCodePart, +) { + return requestClient.post('/mes/md/auto-code-part/create', data); +} + +/** 修改编码规则分段 */ +export function updateAutoCodePart( + data: MesMdAutoCodePartApi.AutoCodePart, +) { + return requestClient.put('/mes/md/auto-code-part/update', data); +} + +/** 删除编码规则分段 */ +export function deleteAutoCodePart(id: number) { + return requestClient.delete(`/mes/md/auto-code-part/delete?id=${id}`); +} diff --git a/apps/web-antd/src/api/mes/md/autocode/rule/index.ts b/apps/web-antd/src/api/mes/md/autocode/rule/index.ts new file mode 100644 index 000000000..be4d81f2f --- /dev/null +++ b/apps/web-antd/src/api/mes/md/autocode/rule/index.ts @@ -0,0 +1,60 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace MesMdAutoCodeRuleApi { + /** MES 编码规则 */ + export interface AutoCodeRule { + id?: number; // 规则编号 + code?: string; // 规则编码 + name?: string; // 规则名称 + description?: string; // 规则描述 + maxLength?: number; // 最大长度 + padded?: boolean; // 是否补齐 + paddedChar?: string; // 补齐字符 + paddedMethod?: number; // 补齐方式 + status?: number; // 状态 + remark?: string; // 备注 + createTime?: Date; // 创建时间 + } +} + +/** 查询编码规则分页 */ +export function getAutoCodeRulePage(params: PageParam) { + return requestClient.get< + PageResult + >('/mes/md/auto-code-rule/page', { params }); +} + +/** 查询编码规则详情 */ +export function getAutoCodeRule(id: number) { + return requestClient.get( + `/mes/md/auto-code-rule/get?id=${id}`, + ); +} + +/** 新增编码规则 */ +export function createAutoCodeRule( + data: MesMdAutoCodeRuleApi.AutoCodeRule, +) { + return requestClient.post('/mes/md/auto-code-rule/create', data); +} + +/** 修改编码规则 */ +export function updateAutoCodeRule( + data: MesMdAutoCodeRuleApi.AutoCodeRule, +) { + return requestClient.put('/mes/md/auto-code-rule/update', data); +} + +/** 删除编码规则 */ +export function deleteAutoCodeRule(id: number) { + return requestClient.delete(`/mes/md/auto-code-rule/delete?id=${id}`); +} + +/** 导出编码规则 */ +export function exportAutoCodeRule(params: PageParam) { + return requestClient.download('/mes/md/auto-code-rule/export-excel', { + params, + }); +} diff --git a/apps/web-antd/src/api/mes/wm/itemreceipt/index.ts b/apps/web-antd/src/api/mes/wm/itemreceipt/index.ts new file mode 100644 index 000000000..d7086de99 --- /dev/null +++ b/apps/web-antd/src/api/mes/wm/itemreceipt/index.ts @@ -0,0 +1,34 @@ +import { requestClient } from '#/api/request'; + +export namespace MesWmItemReceiptApi { + /** MES 采购入库单 */ + export interface ItemReceipt { + id?: number; // 入库单编号 + code?: string; // 入库单编码 + name?: string; // 入库单名称 + iqcId?: number; // 来料检验单编号 + iqcCode?: string; // 来料检验单编码 + noticeId?: number; // 到货通知单编号 + noticeCode?: string; // 到货通知单编码 + purchaseOrderCode?: string; // 采购订单号 + vendorId?: number; // 供应商编号 + vendorName?: string; // 供应商名称 + warehouseId?: number; // 仓库编号 + warehouseName?: string; // 仓库名称 + locationId?: number; // 库区编号 + locationName?: string; // 库区名称 + areaId?: number; // 库位编号 + areaName?: string; // 库位名称 + receiptDate?: Date | number | string; // 入库日期 + status?: number; // 状态 + remark?: string; // 备注 + createTime?: Date; // 创建时间 + } +} + +/** 查询采购入库单详情 */ +export function getItemReceipt(id: number) { + return requestClient.get( + `/mes/wm/item-receipt/get?id=${id}`, + ); +} diff --git a/apps/web-antd/src/views/mes/md/autocode/data.ts b/apps/web-antd/src/views/mes/md/autocode/data.ts new file mode 100644 index 000000000..ce59ec37d --- /dev/null +++ b/apps/web-antd/src/views/mes/md/autocode/data.ts @@ -0,0 +1,472 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { MesMdAutoCodePartApi } from '#/api/mes/md/autocode/part'; +import type { MesMdAutoCodeRuleApi } from '#/api/mes/md/autocode/rule'; + +import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; + +import { z } from '#/adapter/form'; +import { MesAutoCodePartTypeEnum } from '#/views/mes/utils/constants'; + +/** 新增/修改编码规则的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'id', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'code', + label: '规则编码', + component: 'Input', + componentProps: { + placeholder: '请输入规则编码', + }, + rules: 'required', + }, + { + fieldName: 'name', + label: '规则名称', + component: 'Input', + componentProps: { + placeholder: '请输入规则名称', + }, + rules: 'required', + }, + { + fieldName: 'description', + label: '规则描述', + component: 'Input', + componentProps: { + placeholder: '请输入规则描述', + }, + }, + { + fieldName: 'maxLength', + label: '最大长度', + component: 'InputNumber', + componentProps: { + class: '!w-full', + max: 100, + min: 1, + precision: 0, + }, + rules: 'required', + }, + { + fieldName: 'padded', + label: '是否补齐', + component: 'RadioGroup', + componentProps: { + buttonStyle: 'solid', + optionType: 'button', + options: getDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING, 'boolean'), + }, + rules: z.boolean().default(false), + }, + { + fieldName: 'paddedChar', + label: '补齐字符', + component: 'Input', + componentProps: { + maxLength: 1, + placeholder: '请输入补齐字符', + }, + dependencies: { + triggerFields: ['padded'], + show: (values) => values.padded === true, + }, + rules: 'required', + }, + { + fieldName: 'paddedMethod', + label: '补齐方式', + component: 'RadioGroup', + componentProps: { + buttonStyle: 'solid', + optionType: 'button', + options: getDictOptions( + DICT_TYPE.MES_MD_AUTO_CODE_PADDED_METHOD, + 'number', + ), + }, + dependencies: { + triggerFields: ['padded'], + show: (values) => values.padded === true, + }, + rules: 'required', + }, + { + fieldName: 'status', + label: '状态', + component: 'RadioGroup', + componentProps: { + buttonStyle: 'solid', + optionType: 'button', + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + rules: z.number().default(CommonStatusEnum.ENABLE), + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + rows: 3, + }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'code', + label: '规则编码', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入规则编码', + }, + }, + { + fieldName: 'name', + label: '规则名称', + component: 'Input', + componentProps: { + allowClear: true, + placeholder: '请输入规则名称', + }, + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + placeholder: '请选择状态', + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'code', + title: '规则编码', + width: 150, + }, + { + field: 'name', + title: '规则名称', + width: 200, + }, + { + field: 'description', + title: '规则描述', + minWidth: 180, + }, + { + field: 'maxLength', + title: '最大长度', + width: 100, + align: 'center', + }, + { + field: 'padded', + title: '是否补齐', + width: 100, + align: 'center', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, + }, + }, + { + field: 'status', + title: '状态', + width: 100, + align: 'center', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.COMMON_STATUS }, + }, + }, + { + field: 'remark', + title: '备注', + minWidth: 160, + }, + { + field: 'createTime', + title: '创建时间', + width: 180, + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 150, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 新增/修改编码规则分段的表单 */ +export function usePartFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'id', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'ruleId', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'sort', + label: '分段排序', + component: 'InputNumber', + componentProps: { + class: '!w-full', + min: 1, + precision: 0, + }, + rules: z.number().default(1), + }, + { + fieldName: 'length', + label: '分段长度', + component: 'InputNumber', + componentProps: { + class: '!w-full', + max: 50, + min: 1, + precision: 0, + }, + rules: 'required', + }, + { + fieldName: 'type', + label: '分段类型', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions( + DICT_TYPE.MES_MD_AUTO_CODE_PART_TYPE, + 'number', + ), + placeholder: '请选择分段类型', + }, + rules: 'selectRequired', + }, + { + fieldName: 'dateFormat', + label: '日期格式', + component: 'Select', + componentProps: { + allowClear: true, + options: [ + { label: 'yyyy', value: 'yyyy' }, + { label: 'yyyyMM', value: 'yyyyMM' }, + { label: 'yyyyMMdd', value: 'yyyyMMdd' }, + { label: 'yyyyMMddHH', value: 'yyyyMMddHH' }, + { label: 'yyyyMMddHHmm', value: 'yyyyMMddHHmm' }, + ], + placeholder: '请选择日期格式', + }, + dependencies: { + triggerFields: ['type'], + show: (values) => values.type === MesAutoCodePartTypeEnum.DATE, + }, + rules: 'selectRequired', + }, + { + fieldName: 'fixCharacter', + label: '固定字符', + component: 'Input', + componentProps: { + placeholder: '请输入固定字符', + }, + dependencies: { + triggerFields: ['type'], + show: (values) => values.type === MesAutoCodePartTypeEnum.FIX, + }, + rules: 'required', + }, + { + fieldName: 'serialStartNo', + label: '流水号起始值', + component: 'InputNumber', + componentProps: { + class: '!w-full', + min: 1, + precision: 0, + }, + dependencies: { + triggerFields: ['type'], + show: (values) => values.type === MesAutoCodePartTypeEnum.SERIAL, + }, + rules: 'required', + }, + { + fieldName: 'serialStep', + label: '流水号步长', + component: 'InputNumber', + componentProps: { + class: '!w-full', + min: 1, + precision: 0, + }, + dependencies: { + triggerFields: ['type'], + show: (values) => values.type === MesAutoCodePartTypeEnum.SERIAL, + }, + rules: 'required', + }, + { + fieldName: 'cycleFlag', + label: '是否循环', + component: 'Switch', + componentProps: { + checkedChildren: '是', + unCheckedChildren: '否', + }, + dependencies: { + triggerFields: ['type'], + show: (values) => values.type === MesAutoCodePartTypeEnum.SERIAL, + }, + rules: z.boolean().default(false), + }, + { + fieldName: 'cycleMethod', + label: '循环方式', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions( + DICT_TYPE.MES_MD_AUTO_CODE_CYCLE_METHOD, + 'number', + ), + placeholder: '请选择循环方式', + }, + dependencies: { + triggerFields: ['type', 'cycleFlag'], + show: (values) => + values.type === MesAutoCodePartTypeEnum.SERIAL && + values.cycleFlag === true, + }, + rules: 'selectRequired', + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + rows: 3, + }, + }, + ]; +} + +/** 编码规则分段的字段 */ +export function usePartGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'sort', + title: '分段排序', + width: 90, + align: 'center', + }, + { + field: 'type', + title: '分段类型', + width: 120, + align: 'center', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.MES_MD_AUTO_CODE_PART_TYPE }, + }, + }, + { + field: 'length', + title: '分段长度', + width: 90, + align: 'center', + }, + { + field: 'dateFormat', + title: '日期格式', + width: 150, + align: 'center', + }, + { + field: 'fixCharacter', + title: '固定字符', + width: 120, + align: 'center', + }, + { + field: 'serialStartNo', + title: '流水号起始', + width: 110, + align: 'center', + }, + { + field: 'serialStep', + title: '流水号步长', + width: 110, + align: 'center', + }, + { + field: 'cycleFlag', + title: '是否循环', + width: 100, + align: 'center', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.INFRA_BOOLEAN_STRING }, + }, + }, + { + field: 'cycleMethod', + title: '循环方式', + width: 120, + align: 'center', + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.MES_MD_AUTO_CODE_CYCLE_METHOD }, + }, + }, + { + field: 'remark', + title: '备注', + minWidth: 160, + }, + { + title: '操作', + width: 130, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-antd/src/views/mes/md/autocode/index.vue b/apps/web-antd/src/views/mes/md/autocode/index.vue new file mode 100644 index 000000000..1eeefc0b0 --- /dev/null +++ b/apps/web-antd/src/views/mes/md/autocode/index.vue @@ -0,0 +1,150 @@ + + + diff --git a/apps/web-antd/src/views/mes/md/autocode/modules/form.vue b/apps/web-antd/src/views/mes/md/autocode/modules/form.vue new file mode 100644 index 000000000..b1ba5fdf2 --- /dev/null +++ b/apps/web-antd/src/views/mes/md/autocode/modules/form.vue @@ -0,0 +1,102 @@ + + + diff --git a/apps/web-antd/src/views/mes/md/autocode/modules/part-form.vue b/apps/web-antd/src/views/mes/md/autocode/modules/part-form.vue new file mode 100644 index 000000000..538f594cc --- /dev/null +++ b/apps/web-antd/src/views/mes/md/autocode/modules/part-form.vue @@ -0,0 +1,115 @@ + + + diff --git a/apps/web-antd/src/views/mes/md/autocode/modules/part-list.vue b/apps/web-antd/src/views/mes/md/autocode/modules/part-list.vue new file mode 100644 index 000000000..8107f808b --- /dev/null +++ b/apps/web-antd/src/views/mes/md/autocode/modules/part-list.vue @@ -0,0 +1,131 @@ + + + diff --git a/apps/web-antd/src/views/mes/md/item/components/index.ts b/apps/web-antd/src/views/mes/md/item/components/index.ts index e5aa3ce08..348ae8798 100644 --- a/apps/web-antd/src/views/mes/md/item/components/index.ts +++ b/apps/web-antd/src/views/mes/md/item/components/index.ts @@ -1,2 +1,4 @@ export { default as MdItemSelectDialog } from './md-item-select-dialog.vue'; export { default as MdItemSelect } from './md-item-select.vue'; +export { default as MdProductBomSelectDialog } from './md-product-bom-select-dialog.vue'; +export { default as MdProductBomSelect } from './md-product-bom-select.vue'; diff --git a/apps/web-antd/src/views/mes/md/item/components/md-product-bom-select-dialog.vue b/apps/web-antd/src/views/mes/md/item/components/md-product-bom-select-dialog.vue new file mode 100644 index 000000000..90ae85a32 --- /dev/null +++ b/apps/web-antd/src/views/mes/md/item/components/md-product-bom-select-dialog.vue @@ -0,0 +1,116 @@ + + + diff --git a/apps/web-antd/src/views/mes/md/item/components/md-product-bom-select.vue b/apps/web-antd/src/views/mes/md/item/components/md-product-bom-select.vue new file mode 100644 index 000000000..12d7185aa --- /dev/null +++ b/apps/web-antd/src/views/mes/md/item/components/md-product-bom-select.vue @@ -0,0 +1,148 @@ + + + diff --git a/apps/web-antd/src/views/mes/md/vendor/modules/item-receipt-detail.vue b/apps/web-antd/src/views/mes/md/vendor/modules/item-receipt-detail.vue new file mode 100644 index 000000000..e9cd9f261 --- /dev/null +++ b/apps/web-antd/src/views/mes/md/vendor/modules/item-receipt-detail.vue @@ -0,0 +1,138 @@ + + + diff --git a/apps/web-antd/src/views/mes/md/vendor/modules/item-receipt-list.vue b/apps/web-antd/src/views/mes/md/vendor/modules/item-receipt-list.vue index 86635ab07..579b4db05 100644 --- a/apps/web-antd/src/views/mes/md/vendor/modules/item-receipt-list.vue +++ b/apps/web-antd/src/views/mes/md/vendor/modules/item-receipt-list.vue @@ -2,17 +2,40 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table'; import type { MesWmItemReceiptLineApi } from '#/api/mes/wm/itemreceipt/line'; +import { useVbenModal } from '@vben/common-ui'; + +import { Button } from 'ant-design-vue'; + import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { getItemReceiptLinePage } from '#/api/mes/wm/itemreceipt/line'; +import ItemReceiptDetail from './item-receipt-detail.vue'; + const props = defineProps<{ vendorId: number; }>(); +const [DetailModal, detailModalApi] = useVbenModal({ + connectedComponent: ItemReceiptDetail, + destroyOnClose: true, +}); + +/** 查看采购入库单详情 */ +function handleViewReceipt(row: MesWmItemReceiptLineApi.ItemReceiptLine) { + if (row.receiptId) { + detailModalApi.setData({ id: row.receiptId }).open(); + } +} + const [Grid] = useVbenVxeGrid({ gridOptions: { columns: [ - { field: 'receiptCode', title: '入库单编号', minWidth: 160 }, + { + field: 'receiptCode', + title: '入库单编号', + minWidth: 160, + slots: { default: 'receiptCode' }, + }, { field: 'purchaseOrderCode', title: '采购订单号', minWidth: 150 }, { field: 'itemCode', title: '物料编码', width: 140 }, { field: 'itemName', title: '物料名称', minWidth: 150 }, @@ -45,5 +68,12 @@ const [Grid] = useVbenVxeGrid({ diff --git a/apps/web-ele/src/api/mes/md/autocode/part/index.ts b/apps/web-ele/src/api/mes/md/autocode/part/index.ts new file mode 100644 index 000000000..c64684c9b --- /dev/null +++ b/apps/web-ele/src/api/mes/md/autocode/part/index.ts @@ -0,0 +1,49 @@ +import { requestClient } from '#/api/request'; + +export namespace MesMdAutoCodePartApi { + /** MES 编码规则分段 */ + export interface AutoCodePart { + id?: number; // 分段编号 + ruleId?: number; // 规则编号 + sort?: number; // 排序 + type?: number; // 分段类型 + length?: number; // 长度 + dateFormat?: string; // 日期格式 + fixCharacter?: string; // 固定字符 + serialStartNo?: number; // 流水号起始值 + serialStep?: number; // 流水号步长 + cycleFlag?: boolean; // 是否循环 + cycleMethod?: number; // 循环方式 + remark?: string; // 备注 + } +} + +/** 查询编码规则分段详情 */ +export function getAutoCodePart(id: number) { + return requestClient.get( + `/mes/md/auto-code-part/get?id=${id}`, + ); +} + +/** 查询编码规则分段列表 */ +export function getAutoCodePartListByRuleId(ruleId: number) { + return requestClient.get( + '/mes/md/auto-code-part/list-by-rule-id', + { params: { ruleId } }, + ); +} + +/** 新增编码规则分段 */ +export function createAutoCodePart(data: MesMdAutoCodePartApi.AutoCodePart) { + return requestClient.post('/mes/md/auto-code-part/create', data); +} + +/** 修改编码规则分段 */ +export function updateAutoCodePart(data: MesMdAutoCodePartApi.AutoCodePart) { + return requestClient.put('/mes/md/auto-code-part/update', data); +} + +/** 删除编码规则分段 */ +export function deleteAutoCodePart(id: number) { + return requestClient.delete(`/mes/md/auto-code-part/delete?id=${id}`); +} diff --git a/apps/web-ele/src/api/mes/md/autocode/rule/index.ts b/apps/web-ele/src/api/mes/md/autocode/rule/index.ts new file mode 100644 index 000000000..d33e6e0fc --- /dev/null +++ b/apps/web-ele/src/api/mes/md/autocode/rule/index.ts @@ -0,0 +1,57 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace MesMdAutoCodeRuleApi { + /** MES 编码规则 */ + export interface AutoCodeRule { + id?: number; // 规则编号 + code?: string; // 规则编码 + name?: string; // 规则名称 + description?: string; // 规则描述 + maxLength?: number; // 最大长度 + padded?: boolean; // 是否补齐 + paddedChar?: string; // 补齐字符 + paddedMethod?: number; // 补齐方式 + status?: number; // 状态 + remark?: string; // 备注 + createTime?: Date; // 创建时间 + } +} + +/** 查询编码规则分页 */ +export function getAutoCodeRulePage(params: PageParam) { + return requestClient.get>( + '/mes/md/auto-code-rule/page', + { params }, + ); +} + +/** 查询编码规则详情 */ +export function getAutoCodeRule(id: number) { + return requestClient.get( + `/mes/md/auto-code-rule/get?id=${id}`, + ); +} + +/** 新增编码规则 */ +export function createAutoCodeRule(data: MesMdAutoCodeRuleApi.AutoCodeRule) { + return requestClient.post('/mes/md/auto-code-rule/create', data); +} + +/** 修改编码规则 */ +export function updateAutoCodeRule(data: MesMdAutoCodeRuleApi.AutoCodeRule) { + return requestClient.put('/mes/md/auto-code-rule/update', data); +} + +/** 删除编码规则 */ +export function deleteAutoCodeRule(id: number) { + return requestClient.delete(`/mes/md/auto-code-rule/delete?id=${id}`); +} + +/** 导出编码规则 */ +export function exportAutoCodeRule(params: PageParam) { + return requestClient.download('/mes/md/auto-code-rule/export-excel', { + params, + }); +} diff --git a/apps/web-ele/src/api/mes/wm/itemreceipt/index.ts b/apps/web-ele/src/api/mes/wm/itemreceipt/index.ts new file mode 100644 index 000000000..d7086de99 --- /dev/null +++ b/apps/web-ele/src/api/mes/wm/itemreceipt/index.ts @@ -0,0 +1,34 @@ +import { requestClient } from '#/api/request'; + +export namespace MesWmItemReceiptApi { + /** MES 采购入库单 */ + export interface ItemReceipt { + id?: number; // 入库单编号 + code?: string; // 入库单编码 + name?: string; // 入库单名称 + iqcId?: number; // 来料检验单编号 + iqcCode?: string; // 来料检验单编码 + noticeId?: number; // 到货通知单编号 + noticeCode?: string; // 到货通知单编码 + purchaseOrderCode?: string; // 采购订单号 + vendorId?: number; // 供应商编号 + vendorName?: string; // 供应商名称 + warehouseId?: number; // 仓库编号 + warehouseName?: string; // 仓库名称 + locationId?: number; // 库区编号 + locationName?: string; // 库区名称 + areaId?: number; // 库位编号 + areaName?: string; // 库位名称 + receiptDate?: Date | number | string; // 入库日期 + status?: number; // 状态 + remark?: string; // 备注 + createTime?: Date; // 创建时间 + } +} + +/** 查询采购入库单详情 */ +export function getItemReceipt(id: number) { + return requestClient.get( + `/mes/wm/item-receipt/get?id=${id}`, + ); +} diff --git a/apps/web-ele/src/views/iot/ota/firmware/data.ts b/apps/web-ele/src/views/iot/ota/firmware/data.ts index c3a854768..63f95018e 100644 --- a/apps/web-ele/src/views/iot/ota/firmware/data.ts +++ b/apps/web-ele/src/views/iot/ota/firmware/data.ts @@ -12,6 +12,14 @@ import { getRangePickerDefaultProps } from '#/utils'; let productList: IotProductApi.Product[] = []; getSimpleProductList().then((data) => (productList = data)); +/** 根据产品 ID 取产品名称 */ +export function getProductName(productId?: number): string { + if (!productId) { + return '-'; + } + return productList.find((p) => p.id === productId)?.name || '-'; +} + /** 固件详情的描述字段 */ export function useDetailSchema(): DescriptionItemSchema[] { return [ @@ -58,6 +66,10 @@ export function useFormSchema(): VbenFormSchema[] { placeholder: '请选择产品', }, rules: 'required', + dependencies: { + triggerFields: ['id'], + show: (values) => !values.id, + }, }, { fieldName: 'version', @@ -67,6 +79,10 @@ export function useFormSchema(): VbenFormSchema[] { placeholder: '请输入版本号', }, rules: 'required', + dependencies: { + triggerFields: ['id'], + show: (values) => !values.id, + }, }, { fieldName: 'description', @@ -88,6 +104,10 @@ export function useFormSchema(): VbenFormSchema[] { helpText: '支持上传 .bin、.hex、.zip 格式的固件文件,最大 50MB', }, rules: 'required', + dependencies: { + triggerFields: ['id'], + show: (values) => !values.id, + }, }, ]; } @@ -131,7 +151,6 @@ export function useGridFormSchema(): VbenFormSchema[] { /** 列表的字段 */ export function useGridColumns(): VxeTableGridOptions['columns'] { return [ - { type: 'checkbox', width: 40 }, { field: 'id', title: '固件编号', @@ -156,8 +175,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { field: 'productId', title: '所属产品', minWidth: 150, - formatter: ({ cellValue }) => - productList.find((p) => p.id === cellValue)?.name || '-', + slots: { default: 'productName' }, }, { field: 'fileUrl', diff --git a/apps/web-ele/src/views/iot/ota/firmware/index.vue b/apps/web-ele/src/views/iot/ota/firmware/index.vue index e3479cfc1..8b98ae31b 100644 --- a/apps/web-ele/src/views/iot/ota/firmware/index.vue +++ b/apps/web-ele/src/views/iot/ota/firmware/index.vue @@ -13,7 +13,7 @@ import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { deleteOtaFirmware, getOtaFirmwarePage } from '#/api/iot/ota/firmware'; import { $t } from '#/locales'; -import { useGridColumns, useGridFormSchema } from './data'; +import { getProductName, useGridColumns, useGridFormSchema } from './data'; import OtaFirmwareForm from './modules/form.vue'; const { push } = useRouter(); @@ -57,6 +57,11 @@ function handleDetail(row: IoTOtaFirmwareApi.Firmware) { push({ name: 'IoTOtaFirmwareDetail', params: { id: row.id } }); } +/** 跳转到产品详情 */ +function handleOpenProductDetail(productId: number) { + push({ name: 'IoTProductDetail', params: { id: productId } }); +} + const [Grid, gridApi] = useVbenVxeGrid({ formOptions: { schema: useGridFormSchema(), @@ -105,6 +110,17 @@ const [Grid, gridApi] = useVbenVxeGrid({ ]" /> + +