|
|
@@ -20,12 +20,15 @@ import {
|
|
|
type GenericRecord,
|
|
|
type SpecImportApi,
|
|
|
} from '../api/s0QualityApi';
|
|
|
+import type { QualityLookupKey } from './qualityLookups';
|
|
|
|
|
|
export interface QualityColumnDef {
|
|
|
prop: string;
|
|
|
label: string;
|
|
|
width?: number;
|
|
|
minWidth?: number;
|
|
|
+ /** 该列存的是关系/枚举取值时,按此 lookup 解析成业务名称展示,避免列表出现裸 FK id */
|
|
|
+ lookup?: QualityLookupKey;
|
|
|
}
|
|
|
|
|
|
export interface QualityFieldDef {
|
|
|
@@ -33,6 +36,8 @@ export interface QualityFieldDef {
|
|
|
label: string;
|
|
|
type?: 'input' | 'textarea' | 'number';
|
|
|
required?: boolean;
|
|
|
+ /** 该字段存的是关系/枚举取值时,表单渲染为下拉,禁止用户手输内部 id */
|
|
|
+ lookup?: QualityLookupKey;
|
|
|
}
|
|
|
|
|
|
export interface QualitySimplePageConfig {
|
|
|
@@ -100,14 +105,14 @@ export const rawWhitelistConfig: QualitySimplePageConfig = {
|
|
|
queryPlaceholder: '供应商/物料',
|
|
|
api: s0RawWhitelistsApi,
|
|
|
columns: [
|
|
|
- { prop: 'dimensionType', label: '维度类型', width: 140 },
|
|
|
+ { prop: 'dimensionType', label: '维度类型', width: 160, lookup: 'dimensionType' },
|
|
|
{ prop: 'supplierCode', label: '供应商编码', width: 220 },
|
|
|
{ prop: 'supplierName', label: '供应商名称', minWidth: 260 },
|
|
|
{ prop: 'materialCode', label: '物料编码', width: 180 },
|
|
|
{ prop: 'materialName', label: '物料名称', minWidth: 220 },
|
|
|
],
|
|
|
fields: [
|
|
|
- { prop: 'dimensionType', label: '维度类型(supplier/material/material_supplier)', required: true },
|
|
|
+ { prop: 'dimensionType', label: '维度类型', required: true, lookup: 'dimensionType' },
|
|
|
{ prop: 'supplierCode', label: '供应商编码' },
|
|
|
{ prop: 'supplierName', label: '供应商名称' },
|
|
|
{ prop: 'materialCode', label: '物料编码' },
|
|
|
@@ -138,7 +143,7 @@ export const samplingSchemeConfig: QualitySimplePageConfig = {
|
|
|
{ prop: 'strictness', label: '严格程度' },
|
|
|
{ prop: 'aqlValue', label: 'AQL值' },
|
|
|
{ prop: 'inspectionType', label: '检验类型' },
|
|
|
- { prop: 'inspectOrgId', label: '检验组织', type: 'number' },
|
|
|
+ { prop: 'inspectOrgId', label: '检验组织', lookup: 'org' },
|
|
|
{ prop: 'inspectUserId', label: '检验员' },
|
|
|
{ prop: 'status', label: '状态' },
|
|
|
{ prop: 'enableStatus', label: '启用' },
|
|
|
@@ -209,15 +214,15 @@ export const inspectionItemConfig: QualitySimplePageConfig = {
|
|
|
columns: [
|
|
|
{ prop: 'number', label: '编号', width: 180 },
|
|
|
{ prop: 'name', label: '名称', minWidth: 220 },
|
|
|
- { prop: 'checkMethodId', label: '检验方法', width: 120 },
|
|
|
- { prop: 'checkBasisId', label: '检验依据', width: 120 },
|
|
|
+ { prop: 'checkMethodId', label: '检验方法', width: 180, lookup: 'method' },
|
|
|
+ { prop: 'checkBasisId', label: '检验依据', width: 180, lookup: 'basis' },
|
|
|
{ prop: 'checkInstructId', label: '检验指导书', width: 140 },
|
|
|
],
|
|
|
fields: [
|
|
|
{ prop: 'number', label: '编号', required: true },
|
|
|
{ prop: 'name', label: '名称', required: true },
|
|
|
- { prop: 'checkMethodId', label: '检验方法', type: 'number' },
|
|
|
- { prop: 'checkBasisId', label: '检验依据', type: 'number' },
|
|
|
+ { prop: 'checkMethodId', label: '检验方法', lookup: 'method' },
|
|
|
+ { prop: 'checkBasisId', label: '检验依据', lookup: 'basis' },
|
|
|
{ prop: 'checkInstructId', label: '检验指导书', type: 'number' },
|
|
|
{ prop: 'radioGroupField', label: '单选组1' },
|
|
|
{ prop: 'radioGroupField1', label: '单选组2' },
|
|
|
@@ -263,8 +268,8 @@ export const inspectionBasisConfig: QualityAggregatePageConfig = {
|
|
|
{ prop: 'number', label: '编号', required: true },
|
|
|
{ prop: 'name', label: '名称', required: true },
|
|
|
{ prop: 'controlStrategy', label: '控制策略' },
|
|
|
- { prop: 'createOrgId', label: '创建组织', type: 'number' },
|
|
|
- { prop: 'useOrgId', label: '使用组织', type: 'number' },
|
|
|
+ { prop: 'createOrgId', label: '创建组织', lookup: 'org' },
|
|
|
+ { prop: 'useOrgId', label: '使用组织', lookup: 'org' },
|
|
|
{ prop: 'status', label: '状态' },
|
|
|
{ prop: 'enableStatus', label: '启用' },
|
|
|
{ prop: 'comment', label: '备注', type: 'textarea' },
|
|
|
@@ -293,8 +298,8 @@ export const inspectionStandardConfig: QualityAggregatePageConfig = {
|
|
|
{ prop: 'number', label: '编号', required: true },
|
|
|
{ prop: 'name', label: '名称', required: true },
|
|
|
{ prop: 'controlStrategy', label: '控制策略' },
|
|
|
- { prop: 'createOrgId', label: '创建组织', type: 'number' },
|
|
|
- { prop: 'useOrgId', label: '使用组织', type: 'number' },
|
|
|
+ { prop: 'createOrgId', label: '创建组织', lookup: 'org' },
|
|
|
+ { prop: 'useOrgId', label: '使用组织', lookup: 'org' },
|
|
|
{ prop: 'status', label: '状态' },
|
|
|
{ prop: 'enableStatus', label: '启用' },
|
|
|
{ prop: 'comment', label: '备注', type: 'textarea' },
|
|
|
@@ -307,7 +312,7 @@ export const inspectionStandardConfig: QualityAggregatePageConfig = {
|
|
|
{ prop: 'specValue', label: '标准' },
|
|
|
{ prop: 'topValue', label: '上限', type: 'number' },
|
|
|
{ prop: 'downValue', label: '下限', type: 'number' },
|
|
|
- { prop: 'checkBasisId', label: '检验依据', type: 'number' },
|
|
|
+ { prop: 'checkBasisId', label: '检验依据', lookup: 'basis' },
|
|
|
],
|
|
|
initialMaster: { number: '', name: '', controlStrategy: '', createOrgId: undefined, useOrgId: undefined, status: '', enableStatus: '', comment: '' },
|
|
|
createEmptyItem: () => ({ seq: undefined, checkItems: '', checkContent: '', normType: '', specValue: '', topValue: undefined, downValue: undefined, checkBasisId: undefined, checkMethodId: undefined, checkFrequencyId: undefined, checkInstructId: undefined, unit: '', keyQuality: undefined }),
|
|
|
@@ -321,16 +326,16 @@ export const inspectionPlanConfig: QualityAggregatePageConfig = {
|
|
|
listColumns: [
|
|
|
{ prop: 'number', label: '编号', width: 180 },
|
|
|
{ prop: 'name', label: '名称', minWidth: 220 },
|
|
|
- { prop: 'bizTypeId', label: '业务类型', width: 160 },
|
|
|
+ { prop: 'bizTypeId', label: '业务类型', width: 160, lookup: 'bizType' },
|
|
|
{ prop: 'comment', label: '备注', minWidth: 220 },
|
|
|
],
|
|
|
headFields: [
|
|
|
{ prop: 'number', label: '编号', required: true },
|
|
|
{ prop: 'name', label: '名称', required: true },
|
|
|
- { prop: 'bizTypeId', label: '检验业务类型' },
|
|
|
+ { prop: 'bizTypeId', label: '检验业务类型', lookup: 'bizType' },
|
|
|
{ prop: 'controlStrategy', label: '控制策略' },
|
|
|
- { prop: 'createOrgId', label: '创建组织', type: 'number' },
|
|
|
- { prop: 'useOrgId', label: '使用组织', type: 'number' },
|
|
|
+ { prop: 'createOrgId', label: '创建组织', lookup: 'org' },
|
|
|
+ { prop: 'useOrgId', label: '使用组织', lookup: 'org' },
|
|
|
{ prop: 'status', label: '状态' },
|
|
|
{ prop: 'enableStatus', label: '启用' },
|
|
|
{ prop: 'comment', label: '备注', type: 'textarea' },
|
|
|
@@ -341,9 +346,9 @@ export const inspectionPlanConfig: QualityAggregatePageConfig = {
|
|
|
{ prop: 'materialCode', label: '物料编码' },
|
|
|
{ prop: 'materialName', label: '物料名称' },
|
|
|
{ prop: 'supplierId', label: '供应商' },
|
|
|
- { prop: 'samplingSchemeId', label: '抽样方案', type: 'number' },
|
|
|
- { prop: 'inspectionStandardId', label: '检验标准', type: 'number' },
|
|
|
- { prop: 'inspectionFrequencyId', label: '检验频率', type: 'number' },
|
|
|
+ { prop: 'samplingSchemeId', label: '抽样方案', lookup: 'samplingScheme' },
|
|
|
+ { prop: 'inspectionStandardId', label: '检验标准', lookup: 'standard' },
|
|
|
+ { prop: 'inspectionFrequencyId', label: '检验频率', lookup: 'frequency' },
|
|
|
],
|
|
|
initialMaster: { number: '', name: '', bizTypeId: '', controlStrategy: '', createOrgId: undefined, useOrgId: undefined, status: '', enableStatus: '', comment: '' },
|
|
|
createEmptyItem: () => ({ seq: undefined, setupType: '', materialCode: '', materialName: '', materialTypeId: undefined, supplierId: '', samplingSchemeId: undefined, inspectionStandardId: undefined, inspectOrgId: undefined, inspectUserId: undefined, qRouteId: undefined, operationNo: '', operationId: undefined, inspectionFrequencyId: undefined, processSeq: '', inspectionType: undefined }),
|