From dddfaee650217e867fa08e2a9fbe9a6e4347445e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com> Date: Fri, 12 Jul 2024 15:38:44 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/qms/aql/aql.data.ts | 1177 +++++++++-------- src/views/qms/counter/counter.data.ts | 333 +++-- src/views/qms/dynamicRule/dynamicRule.data.ts | 170 ++- .../inspectionJob/inspectionJobMain.data.ts | 68 +- .../inspectionMethod/inspectionMethod.data.ts | 218 +-- .../inspectionRecordMain.data.ts | 61 +- .../inspectionRequestMain.data.ts | 81 +- .../inspectionScheme/inspectionScheme.data.ts | 489 +++---- .../inspectionTemplate.data.ts | 253 ++-- .../qualityNotice/qualityNoticeMain.data.ts | 629 +++++---- src/views/qms/sampleCode/sampleCode.data.ts | 302 +++-- .../samplingProcess/samplingProcess.data.ts | 265 ++-- .../qms/samplingScheme/samplingScheme.data.ts | 166 ++- src/views/qms/selectedSet/selectedSet.data.ts | 152 ++- 14 files changed, 2542 insertions(+), 1822 deletions(-) diff --git a/src/views/qms/aql/aql.data.ts b/src/views/qms/aql/aql.data.ts index 4c9fa28fc..f60bf83b7 100644 --- a/src/views/qms/aql/aql.data.ts +++ b/src/views/qms/aql/aql.data.ts @@ -1,583 +1,614 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -import { getSamplingScheme } from "@/api/qms/aql"; -import {validateNum, validateSampleCode} from "@/utils/validator"; +import { getSamplingScheme } from '@/api/qms/aql' +import { validateNum, validateSampleCode } from '@/utils/validator' // 表单校验 export const AqlRules = reactive({ code: [required], inspectionQualification: [required], - sampleCharacterCode: [required, {max: 1, message: '长度不得超过1个字符', trigger: 'blur' }, {validator: validateSampleCode, message: '请输入1个大写字母', trigger: 'blur' }], - sampleQty: [required,{ validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a0separator010: [required,{ validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r0separator010: [required,{ validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a0separator015: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r0separator015: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a0separator025: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r0separator025: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a0separator040: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r0separator040: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a0separator065: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r0separator065: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a0separator10: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r0separator10: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a0separator15: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r0separator15: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a0separator25: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r0separator25: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a0separator40: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r0separator40: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a0separator65: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r0separator65: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a1separator0: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r1separator0: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a1separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r1separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a2separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r2separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a4separator0: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r4separator0: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a6separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r6separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a10: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r10: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a15: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r15: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a25: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r25: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a40: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r40: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a65: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r65: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a100: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r100: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a150: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r150: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a250: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r250: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a400: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r400: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a650: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r650: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - a1000: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], - r1000: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], + sampleCharacterCode: [ + required, + { max: 1, message: '长度不得超过1个字符', trigger: 'blur' }, + { validator: validateSampleCode, message: '请输入1个大写字母', trigger: 'blur' } + ], + sampleQty: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a0separator010: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r0separator010: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a0separator015: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r0separator015: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a0separator025: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r0separator025: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a0separator040: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r0separator040: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a0separator065: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r0separator065: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a0separator10: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r0separator10: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a0separator15: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r0separator15: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a0separator25: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r0separator25: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a0separator40: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r0separator40: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a0separator65: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r0separator65: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a1separator0: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r1separator0: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a1separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r1separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a2separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r2separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a4separator0: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r4separator0: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a6separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r6separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a10: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r10: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a15: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r15: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a25: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r25: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a40: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r40: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a65: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r65: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a100: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r100: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a150: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r150: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a250: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r250: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a400: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r400: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a650: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r650: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + a1000: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }], + r1000: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }] }) const samplingSchemeList = await getSamplingScheme() -export const Aql = useCrudSchemas(reactive([ - { - label: '采样方案编码', - field: 'code', - sort: 'custom', - isSearch: true, - form: { - component: 'Select', - componentProps: { - options: samplingSchemeList, - optionsAlias: { - labelField: 'description', - valueField: 'code' - }, - } - }, - table: { - width: 175, - fixed: 'left' - } - }, - { - label: '检验严格性', - field: 'inspectionQualification', - sort: 'custom', - dictType: DICT_TYPE.INSPECTION_SEVERITY, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - isSearch: true, - form: { - component: 'Select' - }, - table: { - width: 130 - } - }, - { - label: '样本字码', - field: 'sampleCharacterCode', - sort: 'custom', - isSearch: true, - table: { - width: 110 - } - }, - { - label: '样品份数', - field: 'sampleQty', - sort: 'custom', - table: { - width: 95 - } - }, - { - label: 'A0.01', - field: 'a0separator010', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R0.01', - field: 'r0separator010', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A0.015', - field: 'a0separator015', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R0.015', - field: 'r0separator015', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A0.025', - field: 'a0separator025', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R0.025', - field: 'r0separator025', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A0.04', - field: 'a0separator040', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R0.04', - field: 'r0separator040', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A0.065', - field: 'a0separator065', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R0.065', - field: 'r0separator065', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A0.1', - field: 'a0separator10', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R0.1', - field: 'r0separator10', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A0.15', - field: 'a0separator15', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R0.15', - field: 'r0separator15', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A0.25', - field: 'a0separator25', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R0.25', - field: 'r0separator25', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A0.4', - field: 'a0separator40', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R0.4', - field: 'r0separator40', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A0.65', - field: 'a0separator65', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R0.65', - field: 'r0separator65', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A1.0', - field: 'a1separator0', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R1.0', - field: 'r1separator0', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A1.5', - field: 'a1separator5', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R1.5', - field: 'r1separator5', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A2.5', - field: 'a2separator5', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R2.5', - field: 'r2separator5', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A4.0', - field: 'a4separator0', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R4.0', - field: 'r4separator0', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A6.5', - field: 'a6separator5', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R6.5', - field: 'r6separator5', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A10', - field: 'a10', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R10', - field: 'r10', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A15', - field: 'a15', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R15', - field: 'r15', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A25', - field: 'a25', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R25', - field: 'r25', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A40', - field: 'a40', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R40', - field: 'r40', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A65', - field: 'a65', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R65', - field: 'r65', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A100', - field: 'a100', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R100', - field: 'r100', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A150', - field: 'a150', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R150', - field: 'r150', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A250', - field: 'a250', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R250', - field: 'r250', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A400', - field: 'a400', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R400', - field: 'r400', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A650', - field: 'a650', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R650', - field: 'r650', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'A1000', - field: 'a1000', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: 'R1000', - field: 'r1000', - sort: 'custom', - table: { - width: 105 - } - }, - { - label: '创建时间', - field: 'createTime', - sort: 'custom', - formatter: dateFormatter, - isForm: false, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, - form: { - component: 'DatePicker', - componentProps: { - style: { width: '100%' }, - type: 'datetime', - dateFormat: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'x', - } - }, - table: { - width: 175 - } - }, - // { - // label: '是否可用', - // field: 'available', - // sort: 'custom', - // dictType: DICT_TYPE.TRUE_FALSE, - // dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - // form: { - // component: 'Switch', - // value: 'TRUE', - // componentProps: { - // inactiveValue: 'FALSE', - // activeValue: 'TRUE' - // } - // }, - // table: { - // width: 110 - // } - // }, - { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 150, - fixed: 'right' +export const Aql = useCrudSchemas( + reactive([ + { + label: '采样方案编码', + field: 'code', + sort: 'custom', + isSearch: true, + form: { + component: 'Select', + componentProps: { + options: samplingSchemeList, + optionsAlias: { + labelField: 'description', + valueField: 'code' + } + } + }, + table: { + width: 175, + fixed: 'left' + } + }, + { + label: '检验严格性', + field: 'inspectionQualification', + sort: 'custom', + dictType: DICT_TYPE.INSPECTION_SEVERITY, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: true, + form: { + component: 'Select' + }, + table: { + width: 130 + } + }, + { + label: '样本字码', + field: 'sampleCharacterCode', + sort: 'custom', + isSearch: true, + table: { + width: 110 + } + }, + { + label: '样品份数', + field: 'sampleQty', + sort: 'custom', + table: { + width: 95 + } + }, + { + label: 'A0.01', + field: 'a0separator010', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R0.01', + field: 'r0separator010', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A0.015', + field: 'a0separator015', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R0.015', + field: 'r0separator015', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A0.025', + field: 'a0separator025', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R0.025', + field: 'r0separator025', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A0.04', + field: 'a0separator040', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R0.04', + field: 'r0separator040', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A0.065', + field: 'a0separator065', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R0.065', + field: 'r0separator065', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A0.1', + field: 'a0separator10', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R0.1', + field: 'r0separator10', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A0.15', + field: 'a0separator15', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R0.15', + field: 'r0separator15', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A0.25', + field: 'a0separator25', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R0.25', + field: 'r0separator25', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A0.4', + field: 'a0separator40', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R0.4', + field: 'r0separator40', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A0.65', + field: 'a0separator65', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R0.65', + field: 'r0separator65', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A1.0', + field: 'a1separator0', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R1.0', + field: 'r1separator0', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A1.5', + field: 'a1separator5', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R1.5', + field: 'r1separator5', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A2.5', + field: 'a2separator5', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R2.5', + field: 'r2separator5', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A4.0', + field: 'a4separator0', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R4.0', + field: 'r4separator0', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A6.5', + field: 'a6separator5', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R6.5', + field: 'r6separator5', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A10', + field: 'a10', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R10', + field: 'r10', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A15', + field: 'a15', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R15', + field: 'r15', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A25', + field: 'a25', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R25', + field: 'r25', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A40', + field: 'a40', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R40', + field: 'r40', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A65', + field: 'a65', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R65', + field: 'r65', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A100', + field: 'a100', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R100', + field: 'r100', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A150', + field: 'a150', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R150', + field: 'r150', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A250', + field: 'a250', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R250', + field: 'r250', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A400', + field: 'a400', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R400', + field: 'r400', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A650', + field: 'a650', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R650', + field: 'r650', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'A1000', + field: 'a1000', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: 'R1000', + field: 'r1000', + sort: 'custom', + table: { + width: 105 + } + }, + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 150, + fixed: 'right' + } } - } -])) + ]) +) diff --git a/src/views/qms/counter/counter.data.ts b/src/views/qms/counter/counter.data.ts index 5d17afaae..96a3cb3ea 100644 --- a/src/views/qms/counter/counter.data.ts +++ b/src/views/qms/counter/counter.data.ts @@ -13,147 +13,214 @@ export const CounterRules = reactive({ concurrencyStamp: [required] }) -export const Counter = useCrudSchemas(reactive([ - { - label: '物料编码', - field: 'itemCode', - sort: 'custom', - isSearch: true, - fixed: 'left', - table: { +export const Counter = useCrudSchemas( + reactive([ + { + label: '物料编码', + field: 'itemCode', + sort: 'custom', + isSearch: true, fixed: 'left', - width: 175 - } - }, - { - label: '检验类型编码', - field: 'inspectionType', - sort: 'custom', - isSearch: true, - dictType: DICT_TYPE.INSPECTION_TYPE, - table: { - width: 175 - } - }, - { - label: '供应商编码', - field: 'supplierCode', - sort: 'custom', - isSearch: true, - table: { - width: 175 - } - }, - { - label: '连续合格次数', - field: 'qualifiedTimes', - sort: 'custom', - isSearch: false, - table: { - width: 140 - } - }, - { - label: '最后合格批次', - field: 'lastQualifiedBatch', - sort: 'custom', - isSearch: false, - table: { - width: 140 - } - }, - { - label: '最后合格时间', - field: 'lastQualifiedTime', - sort: 'custom', - formatter: dateFormatter, - isSearch: true, - search: { - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + table: { + fixed: 'left', + width: 175 } }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' + { + label: '检验类型编码', + field: 'inspectionType', + sort: 'custom', + isSearch: true, + dictType: DICT_TYPE.INSPECTION_TYPE, + table: { + width: 175 } }, - table: { - width: 175 - } - }, - { - label: '连续不合格次数', - field: 'unqualifiedTimes', - sort: 'custom', - isSearch: false, - form: { - component: 'InputNumber', - value: 0 + { + label: '供应商编码', + field: 'supplierCode', + sort: 'custom', + isSearch: true, + table: { + width: 175 + } + }, + { + label: '连续合格次数', + field: 'qualifiedTimes', + sort: 'custom', + isSearch: false, + table: { + width: 140 + } + }, + { + label: '最后合格批次', + field: 'lastQualifiedBatch', + sort: 'custom', + isSearch: false, + table: { + width: 140 + } + }, + { + label: '最后合格时间', + field: 'lastQualifiedTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: true, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + table: { + width: 175 + } + }, + { + label: '连续不合格次数', + field: 'unqualifiedTimes', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + table: { + width: 140 + } + }, + { + label: '最后不合格批次', + field: 'lastUnqualifiedBatch', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + table: { + width: 175 + } + }, + { + label: '最后不合格时间', + field: 'lastUnqualifiedTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + table: { + width: 175 + } + }, + { + label: '下一检验阶段', + field: 'nextStage', + sort: 'custom', + isSearch: false, + table: { + width: 140 + } + }, + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } }, - table: { - width: 140 - } - }, - { - label: '最后不合格批次', - field: 'lastUnqualifiedBatch', - sort: 'custom', - isSearch: false, - form: { - component: 'InputNumber', - value: 0 + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true }, - table: { - width: 175 - } - }, - { - label: '最后不合格时间', - field: 'lastUnqualifiedTime', - sort: 'custom', - formatter: dateFormatter, - isSearch: false, - search: { - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } } }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 } }, - table: { - width: 175 - } - }, - { - label: '下一检验阶段', - field: 'nextStage', - sort: 'custom', - isSearch: false, - table: { - width: 140 - } - }, - // { - // label: '操作', - // field: 'action', - // isForm: false, - // table: { - // width: 150, - // fixed: 'right' - // } - // } -])) + + // { + // label: '操作', + // field: 'action', + // isForm: false, + // table: { + // width: 150, + // fixed: 'right' + // } + // } + ]) +) diff --git a/src/views/qms/dynamicRule/dynamicRule.data.ts b/src/views/qms/dynamicRule/dynamicRule.data.ts index 55c0c56fa..3bf0ed6ca 100644 --- a/src/views/qms/dynamicRule/dynamicRule.data.ts +++ b/src/views/qms/dynamicRule/dynamicRule.data.ts @@ -2,63 +2,129 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import { string } from 'vue-types' -const trueFalse = [{ - label: '是', - value: true -}, { - label: '否', - value: false -}] +const trueFalse = [ + { + label: '是', + value: true + }, + { + label: '否', + value: false + } +] // 表单校验 export const DynamicRuleRules = reactive({ - description: [ - required, - { max: 1024, message: '不得超过1024个字符', trigger: 'blur' }, - ] + description: [required, { max: 1024, message: '不得超过1024个字符', trigger: 'blur' }] }) -export const DynamicRule = useCrudSchemas(reactive([ - { - label: '编码', - field: 'code', - sort: 'custom', - isSearch: true, - isForm: false, - fixed: 'left' - }, - { - label: '描述', - field: 'description', - sort: 'custom', - isSearch: true - }, - { - label: '是否可用', - field: 'available', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' +export const DynamicRule = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'code', + sort: 'custom', + isSearch: true, + isForm: false, + fixed: 'left' + }, + { + label: '描述', + field: 'description', + sort: 'custom', + isSearch: true + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + table: { + width: 110 } }, - table: { - width: 110 + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 150, + fixed: 'right' + } } - }, - { - label: '操作', - field: 'action', - isDetail: false, - isForm: false, - table: { - width: 330, - fixed: 'right' - }, - } -])) + ]) +) diff --git a/src/views/qms/inspectionJob/inspectionJobMain.data.ts b/src/views/qms/inspectionJob/inspectionJobMain.data.ts index cf3999056..e9f6f983b 100644 --- a/src/views/qms/inspectionJob/inspectionJobMain.data.ts +++ b/src/views/qms/inspectionJob/inspectionJobMain.data.ts @@ -438,13 +438,77 @@ export const InspectionJobMain = useCrudSchemas( // } // } // }, + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, { label: '操作', field: 'action', - isDetail: false, isForm: false, + isDetail: false, table: { - width: 300, + width: 150, fixed: 'right' } } diff --git a/src/views/qms/inspectionMethod/inspectionMethod.data.ts b/src/views/qms/inspectionMethod/inspectionMethod.data.ts index 3079f5f52..821f809d9 100644 --- a/src/views/qms/inspectionMethod/inspectionMethod.data.ts +++ b/src/views/qms/inspectionMethod/inspectionMethod.data.ts @@ -3,99 +3,145 @@ import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const InspectionMethodRules = reactive({ - description: [required], + description: [required] }) -export const InspectionMethod = useCrudSchemas(reactive([ - { - label: '编码', - field: 'code', - sort: 'custom', - isSearch: true, - isForm:false, - table: { - fixed: 'left' - } - }, - { - label: '描述', - field: 'description', - sort: 'custom', - }, - { - label: '版本', - field: 'version', - sort: 'custom', - }, - { - label: '操作指导', - field: 'operationGuidance', - sort: 'custom', - }, - { - label: '文件', - field: 'videoAddress', - sort: 'custom', - isTable: false, - table: { +export const InspectionMethod = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'code', + sort: 'custom', + isSearch: true, + isForm: false, + table: { + fixed: 'left' + } + }, + { + label: '描述', + field: 'description', + sort: 'custom' + }, + { + label: '版本', + field: 'version', + sort: 'custom' + }, + { + label: '操作指导', + field: 'operationGuidance', + sort: 'custom' }, - form: { - component: 'UploadFile', - componentProps: { - upData:{ - tableName:'basicInspectionMethod', - tableId:'', - }, - fileType:['doc', 'xls', 'ppt', 'txt'], - modelValue:[] + { + label: '文件', + field: 'videoAddress', + sort: 'custom', + isTable: false, + table: {}, + form: { + component: 'UploadFile', + componentProps: { + upData: { + tableName: 'basicInspectionMethod', + tableId: '' + }, + fileType: ['doc', 'xls', 'ppt', 'txt'], + modelValue: [] + } + } + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } }, - - } - }, - { - label: '创建时间', - field: 'createTime', - sort: 'custom', - formatter: dateFormatter, - isForm: false, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' + table: { + width: 110 + } }, - form: { - component: 'DatePicker', - componentProps: { - style: {width: '100%'}, - type: 'datetime', - dateFormat: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'x', + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } } }, - }, - { - label: '是否可用', - field: 'available', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } } }, - table: { - width: 110 - } - }, - { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 150, - fixed: 'right' + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 150, + fixed: 'right' + } } - }, -])) + ]) +) diff --git a/src/views/qms/inspectionRecord/inspectionRecordMain.data.ts b/src/views/qms/inspectionRecord/inspectionRecordMain.data.ts index 8837aa808..356557dd2 100644 --- a/src/views/qms/inspectionRecord/inspectionRecordMain.data.ts +++ b/src/views/qms/inspectionRecord/inspectionRecordMain.data.ts @@ -399,33 +399,74 @@ export const InspectionRecordMain = useCrudSchemas( { label: '创建时间', field: 'createTime', - sort: 'custom', + isForm: false, + table: { + width: 180 + }, formatter: dateFormatter, - isSearch: false, - search: { + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { component: 'DatePicker', componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' } + } + }, + { + label: '创建者', + field: 'creator', + table: { + width: 130 }, isForm: false, + isTable: true + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, detail: { dateFormat: 'YYYY-MM-DD HH:mm:ss' }, table: { - width: 175 + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 } }, - { label: '操作', field: 'action', - isDetail: false, isForm: false, + isDetail: false, table: { - width: 200, + width: 150, fixed: 'right' } } diff --git a/src/views/qms/inspectionRequest/inspectionRequestMain.data.ts b/src/views/qms/inspectionRequest/inspectionRequestMain.data.ts index c7af0319c..af771ca97 100644 --- a/src/views/qms/inspectionRequest/inspectionRequestMain.data.ts +++ b/src/views/qms/inspectionRequest/inspectionRequestMain.data.ts @@ -388,14 +388,79 @@ export const InspectionMain = useCrudSchemas( } }, { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 240, - fixed: 'right' - } - } +      label: '创建时间', +      field: 'createTime', +      isForm: false, +      table: { +        width: 180 +      }, +      formatter: dateFormatter, +      detail: { +        dateFormat: 'YYYY-MM-DD HH:mm:ss' +      }, +      form: { +        component: 'DatePicker', +        componentProps: { +          style: { width: '100%' }, +          type: 'datetime', +          dateFormat: 'YYYY-MM-DD HH:mm:ss', +          valueFormat: 'x' +        } +      } +    }, +    { +      label: '创建者', +      field: 'creator', +      table: { +        width: 130 +      }, +      isForm: false, +      isTable: true +    }, +    { +      label: '最后更新时间', +      field: 'updateTime', +      sort: 'custom', +      isDetail: true, +      isForm: false, +      isTable: false, +      formatter: dateFormatter, +      detail: { +        dateFormat: 'YYYY-MM-DD HH:mm:ss' +      }, +      table: { +        width: 180 +      }, +      form: { +        component: 'DatePicker', +        componentProps: { +          style: { width: '100%' }, +          type: 'datetime', +          dateFormat: 'YYYY-MM-DD HH:mm:ss', +          valueFormat: 'x' +        } +      } +    }, +    { +      label: '最后更新者', +      field: 'updater', +      isDetail: true, +      isForm: false, +      isTable: false, +      table: { +        width: 150 +      } +    }, +    { +      label: '操作', +      field: 'action', +      isForm: false, +      isDetail: false, +      table: { +        width: 150, +        fixed: 'right' +      } +    } ]) ) diff --git a/src/views/qms/inspectionScheme/inspectionScheme.data.ts b/src/views/qms/inspectionScheme/inspectionScheme.data.ts index df35c591c..ceca52b8e 100644 --- a/src/views/qms/inspectionScheme/inspectionScheme.data.ts +++ b/src/views/qms/inspectionScheme/inspectionScheme.data.ts @@ -4,241 +4,272 @@ import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const InspectionTemplateRules = reactive({ - description: [ - { required: true, message: '请填写描述', trigger: 'blur' } - ], - version: [ - { required: true, message: '请填写版本', trigger: 'blur' } - ], - inspectionCode: [ - { required: true, message: '请选择检验方案模板编码', trigger: 'blur' } - ], - sequenceCode: [ - { required: true, message: '请填写顺序号', trigger: 'blur' } - ], - inspectionCharCode: [ - { required: true, message: '请选择检验特性编码', trigger: 'blur' } - ], - describe: [ - { required: true, message: '请填写描述', trigger: 'blur' } - ], - inspectionMethodCode: [ - { required: true, message: '请选择检验方法编码', trigger: 'blur' } - ], - dynamicUpdateCode: [ - { required: true, message: '请选择采样过程编码', trigger: 'blur' } - ], - inspectionMethod: [ - { required: true, message: '请选择动态修改规则编码', trigger: 'blur' } - ], - isCanUpdate: [ - { required: true, message: '请选择是否允许修改特征值', trigger: 'blur' } - ], - isDestructionInspection: [ - { required: true, message: '请选择是否破坏性检验', trigger: 'blur' } - ], - resultEntryMethod: [ - { required: true, message: '请选择结果录入方式', trigger: 'blur' } - ], - featureType: [ - { required: true, message: '请选择特征类型', trigger: 'blur' } - ], - quantifyIsCapping: [ - { required: true, message: '请选择是否设定上限', trigger: 'blur' } - ], - quantifyIsLowlimit: [ - { required: true, message: '请选择是否设定下限', trigger: 'blur' } - ], - quantifyTarget: [ - { required: true, message: '请输入目标值', trigger: 'blur' } - ], - quantifyCapping: [ - { required: true, message: '请输入上限值', trigger: 'blur' } - ], - quantifyLowlimit: [ - { required: true, message: '请输入下限值', trigger: 'blur' } - ], - quantifyquantifyUomLowlimit: [ - { required: true, message: '请选择计量单位', trigger: 'blur' } - ], - quantifyDecimal: [ - { required: true, message: '请输入小数位', trigger: 'blur' } - ], - quantifyQuantifyCode: [ - { required: true, message: '请输入选择集编码', trigger: 'blur' } - ], + description: [{ required: true, message: '请填写描述', trigger: 'blur' }], + version: [{ required: true, message: '请填写版本', trigger: 'blur' }], + inspectionCode: [{ required: true, message: '请选择检验方案模板编码', trigger: 'blur' }], + sequenceCode: [{ required: true, message: '请填写顺序号', trigger: 'blur' }], + inspectionCharCode: [{ required: true, message: '请选择检验特性编码', trigger: 'blur' }], + describe: [{ required: true, message: '请填写描述', trigger: 'blur' }], + inspectionMethodCode: [{ required: true, message: '请选择检验方法编码', trigger: 'blur' }], + dynamicUpdateCode: [{ required: true, message: '请选择采样过程编码', trigger: 'blur' }], + inspectionMethod: [{ required: true, message: '请选择动态修改规则编码', trigger: 'blur' }], + isCanUpdate: [{ required: true, message: '请选择是否允许修改特征值', trigger: 'blur' }], + isDestructionInspection: [{ required: true, message: '请选择是否破坏性检验', trigger: 'blur' }], + resultEntryMethod: [{ required: true, message: '请选择结果录入方式', trigger: 'blur' }], + featureType: [{ required: true, message: '请选择特征类型', trigger: 'blur' }], + quantifyIsCapping: [{ required: true, message: '请选择是否设定上限', trigger: 'blur' }], + quantifyIsLowlimit: [{ required: true, message: '请选择是否设定下限', trigger: 'blur' }], + quantifyTarget: [{ required: true, message: '请输入目标值', trigger: 'blur' }], + quantifyCapping: [{ required: true, message: '请输入上限值', trigger: 'blur' }], + quantifyLowlimit: [{ required: true, message: '请输入下限值', trigger: 'blur' }], + quantifyquantifyUomLowlimit: [{ required: true, message: '请选择计量单位', trigger: 'blur' }], + quantifyDecimal: [{ required: true, message: '请输入小数位', trigger: 'blur' }], + quantifyQuantifyCode: [{ required: true, message: '请输入选择集编码', trigger: 'blur' }] }) -export const InspectionSchemeMain = useCrudSchemas(reactive([ - { - label: '编码', - field: 'code', - sort: 'custom', - table: { - width: 220, - fixed: 'left' - }, - isSearch: true, - form: { - componentProps: { - disabled: true, - placeholder: '系统自动获取' +export const InspectionSchemeMain = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'code', + sort: 'custom', + table: { + width: 220, + fixed: 'left' + }, + isSearch: true, + form: { + componentProps: { + disabled: true, + placeholder: '系统自动获取' + } } - } - }, - { - label: '物料名称', - field: 'itemName', - sort: 'custom', - table: { - width: 200 - }, - isSearch: true, - }, - { - label: '物料编码', - field: 'itemCode', - sort: 'custom', - table: { - width: 150 - }, - isSearch: true, - }, { - label: '描述', - field: 'description', - sort: 'custom', - table: { - width: 150 - }, - }, { - label: '版本', - field: 'version', - sort: 'custom', - table: { - width: 150 - } - }, { - label: '检验类型编码', - field: 'inspectionType', - dictType: DICT_TYPE.INSPECTION_TYPE, - dictClass: 'string', - sort: 'custom', - table: { - width: 175 - } - }, { - label: '检验模板编码', - field: 'programmeTemplateCode', - sort: 'custom', - table: { - width: 175 - } - }, { - label: '拆分规则', - field: 'splitRule', - sort: 'custom', - dictType: DICT_TYPE.SPLIT_RULES, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - table: { - width: 175 - }, - }, { - label: 'aql', - field: 'aql', - sort: 'custom', - dictType: DICT_TYPE.BASIC_AQL, - dictClass: 'string', - table: { - width: 150 - } - }, { - label: '检验水平', - field: 'inspectionLevel', - sort: 'custom', - dictType: DICT_TYPE.INSPECTION_LEVEL, - dictClass: 'string', - table: { - width: 150 - }, - isSearch: true, - }, - { - label: '每份样品量', - field: 'samplePieceSize', - sort: 'custom', - table: { - width: 140 - } - }, - { - label: '生效时间', - field: 'effectiveDate', - sort: 'custom', - formatter: dateFormatter, - isForm: false, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, - form: { - component: 'DatePicker', - componentProps: { - style: { width: '100%' }, - type: 'datetime', - dateFormat: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'x', + }, + { + label: '物料名称', + field: 'itemName', + sort: 'custom', + table: { + width: 200 + }, + isSearch: true + }, + { + label: '物料编码', + field: 'itemCode', + sort: 'custom', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '描述', + field: 'description', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '版本', + field: 'version', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '检验类型编码', + field: 'inspectionType', + dictType: DICT_TYPE.INSPECTION_TYPE, + dictClass: 'string', + sort: 'custom', + table: { + width: 175 + } + }, + { + label: '检验模板编码', + field: 'programmeTemplateCode', + sort: 'custom', + table: { + width: 175 + } + }, + { + label: '拆分规则', + field: 'splitRule', + sort: 'custom', + dictType: DICT_TYPE.SPLIT_RULES, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + table: { + width: 175 + } + }, + { + label: 'aql', + field: 'aql', + sort: 'custom', + dictType: DICT_TYPE.BASIC_AQL, + dictClass: 'string', + table: { + width: 150 + } + }, + { + label: '检验水平', + field: 'inspectionLevel', + sort: 'custom', + dictType: DICT_TYPE.INSPECTION_LEVEL, + dictClass: 'string', + table: { + width: 150 + }, + isSearch: true + }, + { + label: '每份样品量', + field: 'samplePieceSize', + sort: 'custom', + table: { + width: 140 + } + }, + { + label: '生效时间', + field: 'effectiveDate', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + }, + table: { + width: 175 } }, - table: { - width: 175 - }, - }, - { - label: '失效时间', - field: 'expirationDate', - sort: 'custom', - formatter: dateFormatter, - isForm: false, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, - form: { - component: 'DatePicker', - componentProps: { - style: { width: '100%' }, - type: 'datetime', - dateFormat: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'x', + { + label: '失效时间', + field: 'expirationDate', + sort: 'custom', + formatter: dateFormatter, + isForm: false, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + }, + table: { + width: 175 } }, - table: { - width: 175 - }, - }, - { - label: '是否可用', - field: 'available', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + table: { + width: 110 } }, - table: { - width: 110 + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 150, + fixed: 'right' + } } - }, - { - label: '操作', - field: 'action', - isDetail: false, - isForm: false, - table: { - width: 150, - fixed: 'right' - }, - } -])) + ]) +) diff --git a/src/views/qms/inspectionTemplate/inspectionTemplate.data.ts b/src/views/qms/inspectionTemplate/inspectionTemplate.data.ts index fd906fac4..03ba803a2 100644 --- a/src/views/qms/inspectionTemplate/inspectionTemplate.data.ts +++ b/src/views/qms/inspectionTemplate/inspectionTemplate.data.ts @@ -4,124 +4,151 @@ import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const InspectionTemplateRules = reactive({ - description: [ - { required: true , message: '请填写描述', trigger: 'blur' } - ], - version: [ - { required: true , message: '请填写版本', trigger: 'blur' } - ], - inspectionCode: [ - { required: true, message: '请选择检验方案模板编码', trigger: 'blur' } - ], - sequenceCode: [ - { required: true, message: '请填写顺序号', trigger: 'blur' } - ], - inspectionCharCode: [ - { required: true, message: '请选择检验特性编码', trigger: 'blur' } - ], - describe: [ - { required: true, message: '请填写描述', trigger: 'blur' } - ], - inspectionMethodCode: [ - { required: true, message: '请选择检验方法编码', trigger: 'blur' } - ], - dynamicUpdateCode: [ - { required: true, message: '请选择采样过程编码', trigger: 'blur' } - ], - inspectionMethod: [ - { required: true, message: '请选择动态修改规则编码', trigger: 'blur' } - ], - isCanUpdate: [ - { required: true, message: '请选择是否允许修改特征值', trigger: 'blur' } - ], - isDestructionInspection: [ - { required: true, message: '请选择是否破坏性检验', trigger: 'blur' } - ], - resultEntryMethod: [ - { required: true, message: '请选择结果录入方式', trigger: 'blur' } - ], - featureType: [ - { required: true, message: '请选择特征类型', trigger: 'blur' } - ], - quantifyIsCapping: [ - { required: true, message: '请选择是否设定上限', trigger: 'blur' } - ], - quantifyIsLowlimit: [ - { required: true, message: '请选择是否设定下限', trigger: 'blur' } - ], - quantifyTarget: [ - { required: true, message: '请输入目标值', trigger: 'blur' } - ], - quantifyCapping: [ - { required: true, message: '请输入上限值', trigger: 'blur' } - ], - quantifyLowlimit: [ - { required: true, message: '请输入下限值', trigger: 'blur' } - ], - quantifyquantifyUomLowlimit: [ - { required: true, message: '请选择计量单位', trigger: 'blur' } - ], - quantifyDecimal: [ - { required: true, message: '请输入小数位', trigger: 'blur' } - ], - quantifyQuantifyCode: [ - { required: true, message: '请输入选择集编码', trigger: 'blur' } - ], + description: [{ required: true, message: '请填写描述', trigger: 'blur' }], + version: [{ required: true, message: '请填写版本', trigger: 'blur' }], + inspectionCode: [{ required: true, message: '请选择检验方案模板编码', trigger: 'blur' }], + sequenceCode: [{ required: true, message: '请填写顺序号', trigger: 'blur' }], + inspectionCharCode: [{ required: true, message: '请选择检验特性编码', trigger: 'blur' }], + describe: [{ required: true, message: '请填写描述', trigger: 'blur' }], + inspectionMethodCode: [{ required: true, message: '请选择检验方法编码', trigger: 'blur' }], + dynamicUpdateCode: [{ required: true, message: '请选择采样过程编码', trigger: 'blur' }], + inspectionMethod: [{ required: true, message: '请选择动态修改规则编码', trigger: 'blur' }], + isCanUpdate: [{ required: true, message: '请选择是否允许修改特征值', trigger: 'blur' }], + isDestructionInspection: [{ required: true, message: '请选择是否破坏性检验', trigger: 'blur' }], + resultEntryMethod: [{ required: true, message: '请选择结果录入方式', trigger: 'blur' }], + featureType: [{ required: true, message: '请选择特征类型', trigger: 'blur' }], + quantifyIsCapping: [{ required: true, message: '请选择是否设定上限', trigger: 'blur' }], + quantifyIsLowlimit: [{ required: true, message: '请选择是否设定下限', trigger: 'blur' }], + quantifyTarget: [{ required: true, message: '请输入目标值', trigger: 'blur' }], + quantifyCapping: [{ required: true, message: '请输入上限值', trigger: 'blur' }], + quantifyLowlimit: [{ required: true, message: '请输入下限值', trigger: 'blur' }], + quantifyquantifyUomLowlimit: [{ required: true, message: '请选择计量单位', trigger: 'blur' }], + quantifyDecimal: [{ required: true, message: '请输入小数位', trigger: 'blur' }], + quantifyQuantifyCode: [{ required: true, message: '请输入选择集编码', trigger: 'blur' }] }) -export const InspectionTemplateMain = useCrudSchemas(reactive([ - { - label: '编码', - field: 'code', - sort: 'custom', - isSearch:true, - form:{ - componentProps:{ - disabled:true, - placeholder:'系统自动获取' +export const InspectionTemplateMain = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'code', + sort: 'custom', + isSearch: true, + form: { + componentProps: { + disabled: true, + placeholder: '系统自动获取' + } } - } - }, - { - label: '描述', - field: 'description', - sort: 'custom', - },{ - label: '动态修改规则', - field: 'dynamicUpdateName', - sort: 'custom', - },{ - label: '版本', - field: 'version', - sort: 'custom', - }, - { - label: '是否可用', - field: 'available', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' + }, + { + label: '描述', + field: 'description', + sort: 'custom' + }, + { + label: '动态修改规则', + field: 'dynamicUpdateName', + sort: 'custom' + }, + { + label: '版本', + field: 'version', + sort: 'custom' + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + table: { + width: 110 } }, - table: { - width: 110 - } - }, - { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 150, - fixed: 'right' + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 150, + fixed: 'right' + } } - } -])) + ]) +) export const InspectionTemplateProcess = useCrudSchemas(reactive([ { label: '编码', diff --git a/src/views/qms/qualityNotice/qualityNoticeMain.data.ts b/src/views/qms/qualityNotice/qualityNoticeMain.data.ts index b38140725..00d24e626 100644 --- a/src/views/qms/qualityNotice/qualityNoticeMain.data.ts +++ b/src/views/qms/qualityNotice/qualityNoticeMain.data.ts @@ -8,324 +8,391 @@ const { t } = useI18n() // 国际化 /** * @returns {Array}质量通知主表 */ -export const QualityNoticeMain = useCrudSchemas(reactive([ - { - label: '编码', - field: 'number', - sort: 'custom', - isSearch: true, - isForm: false, - table: { - width: 200, - fixed: 'left' - } - }, - { - label: '类型', - field: 'type', - dictType: DICT_TYPE.QUALITY_NOTIFICATION_TYPE, - sort: 'custom', - isSearch: true, - isForm: false, - table: { - width: 150 - } - }, - { - label: '描述', - field: 'description', - sort: 'custom', - isSearch: false, - isForm: false, - table: { - width: 200 - } - }, - { - label: '详情', - field: 'detail', - sort: 'custom', - isSearch: false, - isForm: false, - table: { - width: 200 - } - }, { - label: '优先级', - field: 'priority', - sort: 'custom', - isSearch: false, - isForm: false, - table: { - width: 150 - }, - form: { - componentProps: { - disabled: true +export const QualityNoticeMain = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'number', + sort: 'custom', + isSearch: true, + isForm: false, + table: { + width: 200, + fixed: 'left' } }, - }, - { - label: '状态', - field: 'status', - sort: 'custom', - isSearch: false, - isForm: false, - table: { - width: 150 - }, - form: { - componentProps: { - disabled: true + { + label: '类型', + field: 'type', + dictType: DICT_TYPE.QUALITY_NOTIFICATION_TYPE, + sort: 'custom', + isSearch: true, + isForm: false, + table: { + width: 150 } }, - }, - { - label: '报告人', - field: 'reporter', - sort: 'custom', - isSearch: false, - isForm: false, - table: { - width: 150 + { + label: '描述', + field: 'description', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 200 + } }, - form: { - componentProps: { - disabled: true + { + label: '详情', + field: 'detail', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 200 } }, - }, - { - label: '报告时间', - field: 'reportTime', - sort: 'custom', - formatter: dateFormatter, - isSearch: false, - isForm: false, - search: { - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + { + label: '优先级', + field: 'priority', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } } }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' + { + label: '状态', + field: 'status', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } } }, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' + { + label: '报告人', + field: 'reporter', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 150 + }, + form: { + componentProps: { + disabled: true + } + } }, - table: { - width: 175 - } - }, - { - label: '要求开始时间', - field: 'requestStartTime', - sort: 'custom', - formatter: dateFormatter, - isSearch: false, - isForm: false, - search: { - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + { + label: '报告时间', + field: 'reportTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isForm: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 } }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' + { + label: '要求开始时间', + field: 'requestStartTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isForm: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 } }, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' + { + label: '要求结束时间', + field: 'requestEndTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isForm: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } }, - table: { - width: 175 - } - }, - { - label: '要求结束时间', - field: 'requestEndTime', - sort: 'custom', - formatter: dateFormatter, - isSearch: false, - isForm: false, - search: { - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + { + label: '是否造成停机', + field: 'whetherCausesMachineHalt', + dictType: DICT_TYPE.FALSE_OR_TRUE, + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 150 } }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' + { + label: '停机开始时间', + field: 'machineHaltStartTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isForm: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 } }, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' + { + label: '停机结束时间', + field: 'machineHaltEndTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isForm: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } }, - table: { - width: 175 - } - }, - { - label: '是否造成停机', - field: 'whetherCausesMachineHalt', - dictType: DICT_TYPE.FALSE_OR_TRUE, - sort: 'custom', - isSearch: false, - isForm: false, - table: { - width: 150 - } - }, - { - label: '停机开始时间', - field: 'machineHaltStartTime', - sort: 'custom', - formatter: dateFormatter, - isSearch: false, - isForm: false, - search: { - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + { + label: '协调人', + field: 'coordinator', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 150 } }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' + { + label: '任务模板编号', + field: 'taskTemplateCode', + sort: 'custom', + isSearch: false, + isForm: false, + table: { + width: 150 } }, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' + { + label: '完成时间', + field: 'finishTime', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + isForm: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 175 + } }, - table: { - width: 175 - } - }, - { - label: '停机结束时间', - field: 'machineHaltEndTime', - sort: 'custom', - formatter: dateFormatter, - isSearch: false, - isForm: false, - search: { - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + { + // reference_certificate_row + label: '参考通知编号', + field: 'referenceNoticeCode', + sort: 'custom', + isSearch: false, + isForm: false, + form: { + component: 'InputNumber', + value: 0 + }, + table: { + width: 175 } }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } } }, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true }, - table: { - width: 175 - } - }, - { - label: '协调人', - field: 'coordinator', - sort: 'custom', - isSearch: false, - isForm: false, - table: { - width: 150 - } - }, - { - label: '任务模板编号', - field: 'taskTemplateCode', - sort: 'custom', - isSearch: false, - isForm: false, - table: { - width: 150 - } - }, - { - label: '完成时间', - field: 'finishTime', - sort: 'custom', - formatter: dateFormatter, - isSearch: false, - isForm: false, - search: { - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } } }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 } }, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, - table: { - width: 175 - } - }, - { - // reference_certificate_row - label: '参考通知编号', - field: 'referenceNoticeCode', - sort: 'custom', - isSearch: false, - isForm: false, - form: { - component: 'InputNumber', - value: 0 - }, - table: { - width: 175 - } - }, - { - label: '操作', - field: 'action', - isDetail: false, - isForm: false, - table: { - width: 200, - fixed: 'right' + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 150, + fixed: 'right' + } } - } -])) + ]) +) //表单校验 export const QualityNoticeMainRules = reactive({ diff --git a/src/views/qms/sampleCode/sampleCode.data.ts b/src/views/qms/sampleCode/sampleCode.data.ts index 3c7a5eaee..330f5dec9 100644 --- a/src/views/qms/sampleCode/sampleCode.data.ts +++ b/src/views/qms/sampleCode/sampleCode.data.ts @@ -1,145 +1,193 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -import {getSamplingScheme} from '@/api/qms/sampleCode/index' -import {validateNum} from "@/utils/validator"; +import { getSamplingScheme } from '@/api/qms/sampleCode/index' +import { validateNum } from '@/utils/validator' // 表单校验 export const SampleCodeRules = reactive({ code: [required], - batchLowLimiting: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}], - batchUpperLimiting: [{ required:true, message: '该项为必填', trigger: 'blur'}, { validator:validateNum, message: '请输入整数', trigger: 'blur'}], - s1: [ required ], - s2: [required ], - s3: [ required ], - s4: [ required ], - g1: [ required ], - g2: [ required ], - g3: [ required ] + batchLowLimiting: [{ validator: validateNum, message: '请输入整数', trigger: 'blur' }], + batchUpperLimiting: [ + { required: true, message: '该项为必填', trigger: 'blur' }, + { validator: validateNum, message: '请输入整数', trigger: 'blur' } + ], + s1: [required], + s2: [required], + s3: [required], + s4: [required], + g1: [required], + g2: [required], + g3: [required] }) const samplingSchemeList = await getSamplingScheme() -export const SampleCode = useCrudSchemas(reactive([ - { - label: '采样方案编码', - field: 'code', - sort: 'custom', - isSearch: true, - form: { - component: 'Select', - componentProps: { - options: samplingSchemeList, - optionsAlias: { - labelField: 'code', - valueField: 'code' - }, +export const SampleCode = useCrudSchemas( + reactive([ + { + label: '采样方案编码', + field: 'code', + sort: 'custom', + isSearch: true, + form: { + component: 'Select', + componentProps: { + options: samplingSchemeList, + optionsAlias: { + labelField: 'code', + valueField: 'code' + } + } + }, + table: { + width: 175, + fixed: 'left' } }, - table: { - width: 175, - fixed: 'left' - } - }, - { - label: '批量下限', - field: 'batchLowLimiting', - sort: 'custom', - isSearch: true, - form: { - component: 'InputNumber', - value: 0 + { + label: '批量下限', + field: 'batchLowLimiting', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '批量上限', + field: 'batchUpperLimiting', + sort: 'custom', + isSearch: true, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: 's1', + field: 's1', + sort: 'custom' + }, + { + label: 's2', + field: 's2', + sort: 'custom' + }, + { + label: 's3', + field: 's3', + sort: 'custom' + }, + { + label: 's4', + field: 's4', + sort: 'custom' + }, + { + label: 'g1', + field: 'g1', + sort: 'custom' }, - }, - { - label: '批量上限', - field: 'batchUpperLimiting', - sort: 'custom', - isSearch: true, - form: { - component: 'InputNumber', - value: 0 + { + label: 'g2', + field: 'g2', + sort: 'custom' }, - }, - { - label: 's1', - field: 's1', - sort: 'custom', - }, - { - label: 's2', - field: 's2', - sort: 'custom', - }, - { - label: 's3', - field: 's3', - sort: 'custom', - }, - { - label: 's4', - field: 's4', - sort: 'custom', - }, - { - label: 'g1', - field: 'g1', - sort: 'custom', - }, - { - label: 'g2', - field: 'g2', - sort: 'custom', - }, - { - label: 'g3', - field: 'g3', - sort: 'custom', - }, - { - label: '创建时间', - field: 'createTime', - sort: 'custom', - formatter: dateFormatter, - isForm: false, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' + { + label: 'g3', + field: 'g3', + sort: 'custom' }, - form: { - component: 'DatePicker', - componentProps: { - style: {width: '100%'}, - type: 'datetime', - dateFormat: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'x', + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + table: { + width: 110 } }, - table: { - width: 175 - } - }, - { - label: '是否可用', - field: 'available', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } } }, - table: { - width: 110 - } - }, - { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 150, - fixed: 'right' + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 150, + fixed: 'right' + } } - } -])) + ]) +) diff --git a/src/views/qms/samplingProcess/samplingProcess.data.ts b/src/views/qms/samplingProcess/samplingProcess.data.ts index e8d087169..08d418c6e 100644 --- a/src/views/qms/samplingProcess/samplingProcess.data.ts +++ b/src/views/qms/samplingProcess/samplingProcess.data.ts @@ -1,118 +1,173 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -import {getSamplingScheme} from "@/api/qms/samplingProcess"; -import { validateInteger ,validateTwoNum} from '@/utils/validator' +import { getSamplingScheme } from '@/api/qms/samplingProcess' +import { validateInteger, validateTwoNum } from '@/utils/validator' // 表单校验 export const SamplingProcessRules = reactive({ sampleType: [required], evaluationMode: [required], description: [required], - sampleQty:[{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}], - sampleProgCode:[{ required: true, message: '该项为必填项', trigger: 'blur' }], - inspectionQty: [required, {validator:validateInteger, message: '请输入正确的整数', trigger: 'blur'}] + sampleQty: [ + { required: true, message: '该项为必填项', trigger: 'blur' }, + { validator: validateTwoNum, message: '小数点后最多2位', trigger: 'blur' } + ], + sampleProgCode: [{ required: true, message: '该项为必填项', trigger: 'blur' }], + inspectionQty: [ + required, + { validator: validateInteger, message: '请输入正确的整数', trigger: 'blur' } + ] }) const samplingSchemeList = await getSamplingScheme() -export const SamplingProcess = useCrudSchemas(reactive([ - { - label: '编码', - field: 'code', - sort: 'custom', - isSearch: true, - isForm: false, - table: { - width: 175, - fixed: 'left' - } - }, - { - label: '描述', - field: 'description', - sort: 'custom', - isSearch: true - }, - { - label: '取样类型', - field: 'sampleType', - sort: 'custom', - dictType: DICT_TYPE.SAMPLING_TYPE, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - isSearch: true, - form: { - component: 'Select' - } - }, - { - label: '评估模式', - field: 'evaluationMode', - sort: 'custom', - dictType: DICT_TYPE.EVALUATION_MODE, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - form: { - component: 'Select' - } - }, - { - label: '样品份数', - field: 'sampleQty', - sort: 'custom' - }, - { - label: '采样方案编码', - field: 'sampleProgCode', - sort: 'custom', - form: { - component: 'Select', - componentProps: { - options: samplingSchemeList, - optionsAlias: { - labelField: 'description', - valueField: 'code' - }, +export const SamplingProcess = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'code', + sort: 'custom', + isSearch: true, + isForm: false, + table: { + width: 175, + fixed: 'left' } - } - }, - { - label: '创建时间', - field: 'createTime', - sort: 'custom', - formatter: dateFormatter, - isForm: false, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' - }, - form: { - component: 'DatePicker', - componentProps: { - style: {width: '100%'}, - type: 'datetime', - dateFormat: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'x', - } - } - }, - { - label: '是否可用', - field: 'available', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' + }, + { + label: '描述', + field: 'description', + sort: 'custom', + isSearch: true + }, + { + label: '取样类型', + field: 'sampleType', + sort: 'custom', + dictType: DICT_TYPE.SAMPLING_TYPE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + isSearch: true, + form: { + component: 'Select' + } + }, + { + label: '评估模式', + field: 'evaluationMode', + sort: 'custom', + dictType: DICT_TYPE.EVALUATION_MODE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'Select' + } + }, + { + label: '样品份数', + field: 'sampleQty', + sort: 'custom' + }, + { + label: '采样方案编码', + field: 'sampleProgCode', + sort: 'custom', + form: { + component: 'Select', + componentProps: { + options: samplingSchemeList, + optionsAlias: { + labelField: 'description', + valueField: 'code' + } + } + } + }, + + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 150, + fixed: 'right' } } - }, - { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 150, - fixed: 'right' - } - } -])) + ]) +) diff --git a/src/views/qms/samplingScheme/samplingScheme.data.ts b/src/views/qms/samplingScheme/samplingScheme.data.ts index 4085ec49d..7ede5cd2f 100644 --- a/src/views/qms/samplingScheme/samplingScheme.data.ts +++ b/src/views/qms/samplingScheme/samplingScheme.data.ts @@ -3,70 +3,118 @@ import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const SamplingSchemeRules = reactive({ - description: [required], + description: [required] }) -export const SamplingScheme = useCrudSchemas(reactive([ - { - label: '编码', - field: 'code', - sort: 'custom', - isSearch: true, - isForm: false, - table: { - fixed: 'left' - } - }, - { - label: '描述', - field: 'description', - sort: 'custom', - isSearch: true, - }, - { - label: '创建时间', - field: 'createTime', - sort: 'custom', - formatter: dateFormatter, - isForm: false, - detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' +export const SamplingScheme = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'code', + sort: 'custom', + isSearch: true, + isForm: false, + table: { + fixed: 'left' + } + }, + { + label: '描述', + field: 'description', + sort: 'custom', + isSearch: true }, - form: { - component: 'DatePicker', - componentProps: { - style: {width: '100%'}, - type: 'datetime', - dateFormat: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'x', + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + table: { + width: 110 } }, - }, - { - label: '是否可用', - field: 'available', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } } }, - table: { - width: 110 - } - }, - { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 150, - fixed: 'right' + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true + }, + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 150, + fixed: 'right' + } } - } -])) + ]) +) diff --git a/src/views/qms/selectedSet/selectedSet.data.ts b/src/views/qms/selectedSet/selectedSet.data.ts index 9bd2e1a8c..b13c7af2d 100644 --- a/src/views/qms/selectedSet/selectedSet.data.ts +++ b/src/views/qms/selectedSet/selectedSet.data.ts @@ -1,6 +1,6 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import * as DictTypeApi from '@/api/system/dict/dict.type' - +import { dateFormatter } from '@/utils/formatTime' // 表单校验 export const SelectedSetRules = reactive({ @@ -10,49 +10,113 @@ export const SelectedSetRules = reactive({ concurrencyStamp: [required] }) -export const SelectedSet = useCrudSchemas(reactive([ - - { - label: '编码', - field: 'code', - sort: 'custom', - isForm: false, - isSearch: true, - fixed: 'left' - }, - { - label: '描述', - field: 'description', - sort: 'custom', - isSearch: true - }, - { - label: '是否可用', - field: 'available', - sort: 'custom', - dictType: DICT_TYPE.TRUE_FALSE, - dictClass: 'string', // 默认都是字符串类型其他暂不考虑 - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' +export const SelectedSet = useCrudSchemas( + reactive([ + { + label: '编码', + field: 'code', + sort: 'custom', + isForm: false, + isSearch: true, + fixed: 'left' + }, + { + label: '描述', + field: 'description', + sort: 'custom', + isSearch: true + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', // 默认都是字符串类型其他暂不考虑 + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + }, + table: { + width: 110 } }, - table: { - width: 110 - } - }, - { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 150, - fixed: 'right' + { + label: '创建时间', + field: 'createTime', + isForm: false, + table: { + width: 180 + }, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '创建者', + field: 'creator', + table: { + width: 130 + }, + isForm: false, + isTable: true }, - isTableForm: false, - isDetail: false - } -])) + { + label: '最后更新时间', + field: 'updateTime', + sort: 'custom', + isDetail: true, + isForm: false, + isTable: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x' + } + } + }, + { + label: '最后更新者', + field: 'updater', + isDetail: true, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 150, + fixed: 'right' + } + } + ]) +)