From cea628b1a1e60e8b54c2cd4d895d888df51ec343 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 29 May 2026 16:27:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(mes-qc):=20=E8=BF=81=E7=A7=BB=20antd=20?= =?UTF-8?q?=E6=9D=A5=E6=96=99=E6=A3=80=E9=AA=8C=E5=8F=8A=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E3=80=81=E7=BC=BA=E9=99=B7=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=EF=BC=88=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/mes/qc/defectrecord/index.ts | 7 + .../mes/qc/defectrecord/components/data.ts | 93 +++++++++++ .../components/defect-record-inline-form.vue | 101 ++++-------- .../components/defect-record-inline-list.vue | 72 +++------ .../mes/qc/indicatorresult/components/data.ts | 89 +++++++++++ .../components/qc-indicator-result-form.vue | 148 ++++++------------ .../components/qc-indicator-result-list.vue | 17 +- .../src/views/mes/qc/iqc/modules/form.vue | 13 +- .../src/api/mes/qc/defectrecord/index.ts | 7 + 9 files changed, 302 insertions(+), 245 deletions(-) create mode 100644 apps/web-antd/src/views/mes/qc/defectrecord/components/data.ts create mode 100644 apps/web-antd/src/views/mes/qc/indicatorresult/components/data.ts diff --git a/apps/web-antd/src/api/mes/qc/defectrecord/index.ts b/apps/web-antd/src/api/mes/qc/defectrecord/index.ts index 0d5182b15..a434a29b6 100644 --- a/apps/web-antd/src/api/mes/qc/defectrecord/index.ts +++ b/apps/web-antd/src/api/mes/qc/defectrecord/index.ts @@ -16,6 +16,13 @@ export namespace MesQcDefectRecordApi { } } +/** 查询质检缺陷记录 */ +export function getDefectRecord(id: number) { + return requestClient.get( + `/mes/qc/defect-record/get?id=${id}`, + ); +} + /** 查询质检缺陷记录分页 */ export function getDefectRecordPage( params: PageParam & { lineId?: number; qcId?: number; qcType?: number; }, diff --git a/apps/web-antd/src/views/mes/qc/defectrecord/components/data.ts b/apps/web-antd/src/views/mes/qc/defectrecord/components/data.ts new file mode 100644 index 000000000..4047517e0 --- /dev/null +++ b/apps/web-antd/src/views/mes/qc/defectrecord/components/data.ts @@ -0,0 +1,93 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { MesQcDefectRecordApi } from '#/api/mes/qc/defectrecord'; + +import { DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; + +/** 表单类型 */ +export type FormType = 'create' | 'update'; + +/** 新增/修改缺陷记录的表单 */ +export function useDefectRecordInlineFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'name', + label: '缺陷描述', + component: 'Textarea', + formItemClass: 'col-span-2', + componentProps: { + placeholder: '请输入缺陷描述', + rows: 2, + }, + rules: 'required', + }, + { + fieldName: 'level', + label: '缺陷等级', + component: 'Select', + componentProps: { + allowClear: true, + options: getDictOptions(DICT_TYPE.MES_DEFECT_LEVEL, 'number'), + placeholder: '请选择缺陷等级', + }, + rules: 'selectRequired', + }, + { + fieldName: 'quantity', + label: '缺陷数量', + component: 'InputNumber', + componentProps: { + class: '!w-full', + min: 1, + placeholder: '请输入缺陷数量', + }, + rules: 'required', + }, + { + fieldName: 'remark', + label: '备注', + component: 'Input', + formItemClass: 'col-span-2', + componentProps: { + placeholder: '请输入备注', + }, + }, + ]; +} + +/** 缺陷记录列表的字段 */ +export function useDefectRecordInlineGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'name', + title: '缺陷描述', + minWidth: 200, + }, + { + field: 'level', + title: '缺陷等级', + width: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.MES_DEFECT_LEVEL }, + }, + }, + { + field: 'quantity', + title: '缺陷数量', + width: 100, + }, + { + field: 'remark', + title: '备注', + minWidth: 150, + }, + { + title: '操作', + width: 130, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-antd/src/views/mes/qc/defectrecord/components/defect-record-inline-form.vue b/apps/web-antd/src/views/mes/qc/defectrecord/components/defect-record-inline-form.vue index 874b078e0..e74c34ccf 100644 --- a/apps/web-antd/src/views/mes/qc/defectrecord/components/defect-record-inline-form.vue +++ b/apps/web-antd/src/views/mes/qc/defectrecord/components/defect-record-inline-form.vue @@ -1,11 +1,11 @@