Browse Source

BUG修改

hella_online_20240829
parent
commit
dddfaee650
  1. 191
      src/views/qms/aql/aql.data.ts
  2. 71
      src/views/qms/counter/counter.data.ts
  3. 90
      src/views/qms/dynamicRule/dynamicRule.data.ts
  4. 68
      src/views/qms/inspectionJob/inspectionJobMain.data.ts
  5. 104
      src/views/qms/inspectionMethod/inspectionMethod.data.ts
  6. 61
      src/views/qms/inspectionRecord/inspectionRecordMain.data.ts
  7. 81
      src/views/qms/inspectionRequest/inspectionRequestMain.data.ts
  8. 193
      src/views/qms/inspectionScheme/inspectionScheme.data.ts
  9. 177
      src/views/qms/inspectionTemplate/inspectionTemplate.data.ts
  10. 83
      src/views/qms/qualityNotice/qualityNoticeMain.data.ts
  11. 122
      src/views/qms/sampleCode/sampleCode.data.ts
  12. 93
      src/views/qms/samplingProcess/samplingProcess.data.ts
  13. 82
      src/views/qms/samplingScheme/samplingScheme.data.ts
  14. 78
      src/views/qms/selectedSet/selectedSet.data.ts

191
src/views/qms/aql/aql.data.ts

@ -1,69 +1,74 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { getSamplingScheme } from "@/api/qms/aql"; import { getSamplingScheme } from '@/api/qms/aql'
import {validateNum, validateSampleCode} from "@/utils/validator"; import { validateNum, validateSampleCode } from '@/utils/validator'
// 表单校验 // 表单校验
export const AqlRules = reactive({ export const AqlRules = reactive({
code: [required], code: [required],
inspectionQualification: [required], inspectionQualification: [required],
sampleCharacterCode: [required, {max: 1, message: '长度不得超过1个字符', trigger: 'blur' }, {validator: validateSampleCode, message: '请输入1个大写字母', trigger: 'blur' }], sampleCharacterCode: [
sampleQty: [required,{ validator: validateNum, message: '请输入整数', trigger: 'blur' }], required,
a0separator010: [required,{ validator: validateNum, message: '请输入整数', trigger: 'blur' }], { max: 1, message: '长度不得超过1个字符', trigger: 'blur' },
r0separator010: [required,{ validator: validateNum, message: '请输入整数', trigger: 'blur' }], { validator: validateSampleCode, message: '请输入1个大写字母', trigger: 'blur' }
a0separator015: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], ],
r0separator015: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], sampleQty: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a0separator025: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a0separator010: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r0separator025: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r0separator010: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a0separator040: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a0separator015: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r0separator040: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r0separator015: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a0separator065: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a0separator025: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r0separator065: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r0separator025: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a0separator10: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a0separator040: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r0separator10: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r0separator040: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a0separator15: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a0separator065: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r0separator15: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r0separator065: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a0separator25: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a0separator10: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r0separator25: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r0separator10: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a0separator40: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a0separator15: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r0separator40: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r0separator15: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a0separator65: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a0separator25: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r0separator65: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r0separator25: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a1separator0: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a0separator40: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r1separator0: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r0separator40: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a1separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a0separator65: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r1separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r0separator65: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a2separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a1separator0: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r2separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r1separator0: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a4separator0: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a1separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r4separator0: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r1separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a6separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a2separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r6separator5: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r2separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a10: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a4separator0: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r10: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r4separator0: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a15: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a6separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r15: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r6separator5: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a25: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a10: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r25: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r10: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a40: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a15: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r40: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r15: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a65: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a25: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r65: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r25: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a100: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a40: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r100: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r40: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a150: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a65: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r150: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r65: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a250: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a100: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r250: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r100: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a400: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a150: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r400: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r150: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a650: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a250: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r650: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], r250: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
a1000: [required,{validator: validateNum, message: '请输入整数', trigger: 'blur' }], a400: [required, { validator: validateNum, message: '请输入整数', trigger: 'blur' }],
r1000: [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() const samplingSchemeList = await getSamplingScheme()
export const Aql = useCrudSchemas(reactive<CrudSchema[]>([ export const Aql = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '采样方案编码', label: '采样方案编码',
field: 'code', field: 'code',
@ -76,7 +81,7 @@ export const Aql = useCrudSchemas(reactive<CrudSchema[]>([
optionsAlias: { optionsAlias: {
labelField: 'description', labelField: 'description',
valueField: 'code' valueField: 'code'
}, }
} }
}, },
table: { table: {
@ -534,50 +539,76 @@ export const Aql = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
sort: 'custom', isForm: false,
table: {
width: 180
},
formatter: dateFormatter, 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, isForm: false,
isTable: false,
formatter: dateFormatter,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
table: {
width: 180
},
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
style: { width: '100%' }, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
}
} }
}, },
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: { table: {
width: 175 width: 150
} }
}, },
// {
// 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: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
isDetail: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'
} }
} }
])) ])
)

71
src/views/qms/counter/counter.data.ts

@ -13,7 +13,8 @@ export const CounterRules = reactive({
concurrencyStamp: [required] concurrencyStamp: [required]
}) })
export const Counter = useCrudSchemas(reactive<CrudSchema[]>([ export const Counter = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '物料编码', label: '物料编码',
field: 'itemCode', field: 'itemCode',
@ -147,6 +148,71 @@ export const Counter = useCrudSchemas(reactive<CrudSchema[]>([
width: 140 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'
}
}
},
{
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: '操作', // label: '操作',
// field: 'action', // field: 'action',
@ -156,4 +222,5 @@ export const Counter = useCrudSchemas(reactive<CrudSchema[]>([
// fixed: 'right' // fixed: 'right'
// } // }
// } // }
])) ])
)

90
src/views/qms/dynamicRule/dynamicRule.data.ts

@ -2,23 +2,24 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { string } from 'vue-types' import { string } from 'vue-types'
const trueFalse = [{ const trueFalse = [
{
label: '是', label: '是',
value: true value: true
}, { },
{
label: '否', label: '否',
value: false value: false
}] }
]
// 表单校验 // 表单校验
export const DynamicRuleRules = reactive({ export const DynamicRuleRules = reactive({
description: [ description: [required, { max: 1024, message: '不得超过1024个字符', trigger: 'blur' }]
required,
{ max: 1024, message: '不得超过1024个字符', trigger: 'blur' },
]
}) })
export const DynamicRule = useCrudSchemas(reactive<CrudSchema[]>([ export const DynamicRule = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '编码', label: '编码',
field: 'code', field: 'code',
@ -51,14 +52,79 @@ export const DynamicRule = useCrudSchemas(reactive<CrudSchema[]>([
width: 110 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: '操作', label: '操作',
field: 'action', field: 'action',
isDetail: false,
isForm: false, isForm: false,
isDetail: false,
table: { table: {
width: 330, width: 150,
fixed: 'right' fixed: 'right'
},
} }
])) }
])
)

68
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: '操作', label: '操作',
field: 'action', field: 'action',
isDetail: false,
isForm: false, isForm: false,
isDetail: false,
table: { table: {
width: 300, width: 150,
fixed: 'right' fixed: 'right'
} }
} }

104
src/views/qms/inspectionMethod/inspectionMethod.data.ts

@ -3,16 +3,17 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const InspectionMethodRules = reactive({ export const InspectionMethodRules = reactive({
description: [required], description: [required]
}) })
export const InspectionMethod = useCrudSchemas(reactive<CrudSchema[]>([ export const InspectionMethod = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '编码', label: '编码',
field: 'code', field: 'code',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm:false, isForm: false,
table: { table: {
fixed: 'left' fixed: 'left'
} }
@ -20,82 +21,127 @@ export const InspectionMethod = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '描述', label: '描述',
field: 'description', field: 'description',
sort: 'custom', sort: 'custom'
}, },
{ {
label: '版本', label: '版本',
field: 'version', field: 'version',
sort: 'custom', sort: 'custom'
}, },
{ {
label: '操作指导', label: '操作指导',
field: 'operationGuidance', field: 'operationGuidance',
sort: 'custom', sort: 'custom'
}, },
{ {
label: '文件', label: '文件',
field: 'videoAddress', field: 'videoAddress',
sort: 'custom', sort: 'custom',
isTable: false, isTable: false,
table: { table: {},
},
form: { form: {
component: 'UploadFile', component: 'UploadFile',
componentProps: { componentProps: {
upData:{ upData: {
tableName:'basicInspectionMethod', tableName: 'basicInspectionMethod',
tableId:'', tableId: ''
}, },
fileType:['doc', 'xls', 'ppt', 'txt'], fileType: ['doc', 'xls', 'ppt', 'txt'],
modelValue:[] modelValue: []
}
}
}, },
{
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: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false, isForm: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
style: {width: '100%'}, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
}
} }
}, },
{
label: '创建者',
field: 'creator',
table: {
width: 130
},
isForm: false,
isTable: true
}, },
{ {
label: '是否可用', label: '最后更新时间',
field: 'available', field: 'updateTime',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, isDetail: true,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isForm: false,
isTable: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: { form: {
component: 'Switch', component: 'DatePicker',
value: 'TRUE',
componentProps: { componentProps: {
inactiveValue: 'FALSE', style: { width: '100%' },
activeValue: 'TRUE' type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
} }
}, },
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: { table: {
width: 110 width: 150
} }
}, },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
isDetail: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'
} }
}, }
])) ])
)

61
src/views/qms/inspectionRecord/inspectionRecordMain.data.ts

@ -399,33 +399,74 @@ export const InspectionRecordMain = useCrudSchemas(
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
sort: 'custom', isForm: false,
table: {
width: 180
},
formatter: dateFormatter, formatter: dateFormatter,
isSearch: false, detail: {
search: { dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss', style: { width: '100%' },
type: 'daterange', type: 'datetime',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] 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, isForm: false,
isTable: false,
formatter: dateFormatter,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
table: { 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: '操作', label: '操作',
field: 'action', field: 'action',
isDetail: false,
isForm: false, isForm: false,
isDetail: false,
table: { table: {
width: 200, width: 150,
fixed: 'right' fixed: 'right'
} }
} }

81
src/views/qms/inspectionRequest/inspectionRequestMain.data.ts

@ -388,14 +388,79 @@ export const InspectionMain = useCrudSchemas(
} }
}, },
{ {
label: '操作',       label: '创建时间',
field: 'action',       field: 'createTime',
isForm: false,       isForm: false,
table: {       table: {
width: 240,         width: 180
fixed: 'right'       },
}       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'
      }
    }
]) ])
) )

193
src/views/qms/inspectionScheme/inspectionScheme.data.ts

@ -4,71 +4,30 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const InspectionTemplateRules = reactive({ export const InspectionTemplateRules = reactive({
description: [ description: [{ required: true, message: '请填写描述', trigger: 'blur' }],
{ required: true, message: '请填写描述', trigger: 'blur' } version: [{ required: true, message: '请填写版本', trigger: 'blur' }],
], inspectionCode: [{ required: true, message: '请选择检验方案模板编码', trigger: 'blur' }],
version: [ sequenceCode: [{ required: true, message: '请填写顺序号', trigger: 'blur' }],
{ required: true, message: '请填写版本', trigger: 'blur' } inspectionCharCode: [{ required: true, message: '请选择检验特性编码', trigger: 'blur' }],
], describe: [{ required: true, message: '请填写描述', trigger: 'blur' }],
inspectionCode: [ inspectionMethodCode: [{ required: true, message: '请选择检验方法编码', trigger: 'blur' }],
{ required: true, message: '请选择检验方案模板编码', trigger: 'blur' } dynamicUpdateCode: [{ required: true, message: '请选择采样过程编码', trigger: 'blur' }],
], inspectionMethod: [{ required: true, message: '请选择动态修改规则编码', trigger: 'blur' }],
sequenceCode: [ isCanUpdate: [{ required: true, message: '请选择是否允许修改特征值', trigger: 'blur' }],
{ required: true, message: '请填写顺序号', trigger: 'blur' } isDestructionInspection: [{ required: true, message: '请选择是否破坏性检验', trigger: 'blur' }],
], resultEntryMethod: [{ required: true, message: '请选择结果录入方式', trigger: 'blur' }],
inspectionCharCode: [ featureType: [{ required: true, message: '请选择特征类型', trigger: 'blur' }],
{ required: true, message: '请选择检验特性编码', trigger: 'blur' } quantifyIsCapping: [{ required: true, message: '请选择是否设定上限', trigger: 'blur' }],
], quantifyIsLowlimit: [{ required: true, message: '请选择是否设定下限', trigger: 'blur' }],
describe: [ quantifyTarget: [{ required: true, message: '请输入目标值', trigger: 'blur' }],
{ required: true, message: '请填写描述', trigger: 'blur' } quantifyCapping: [{ required: true, message: '请输入上限值', trigger: 'blur' }],
], quantifyLowlimit: [{ required: true, message: '请输入下限值', trigger: 'blur' }],
inspectionMethodCode: [ quantifyquantifyUomLowlimit: [{ required: true, message: '请选择计量单位', trigger: 'blur' }],
{ required: true, message: '请选择检验方法编码', trigger: 'blur' } quantifyDecimal: [{ required: true, message: '请输入小数位', trigger: 'blur' }],
], quantifyQuantifyCode: [{ 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<CrudSchema[]>([ export const InspectionSchemeMain = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '编码', label: '编码',
field: 'code', field: 'code',
@ -92,7 +51,7 @@ export const InspectionSchemeMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 200 width: 200
}, },
isSearch: true, isSearch: true
}, },
{ {
label: '物料编码', label: '物料编码',
@ -101,22 +60,25 @@ export const InspectionSchemeMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
isSearch: true, isSearch: true
}, { },
{
label: '描述', label: '描述',
field: 'description', field: 'description',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}
}, },
}, { {
label: '版本', label: '版本',
field: 'version', field: 'version',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
} }
}, { },
{
label: '检验类型编码', label: '检验类型编码',
field: 'inspectionType', field: 'inspectionType',
dictType: DICT_TYPE.INSPECTION_TYPE, dictType: DICT_TYPE.INSPECTION_TYPE,
@ -125,14 +87,16 @@ export const InspectionSchemeMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 175 width: 175
} }
}, { },
{
label: '检验模板编码', label: '检验模板编码',
field: 'programmeTemplateCode', field: 'programmeTemplateCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 175 width: 175
} }
}, { },
{
label: '拆分规则', label: '拆分规则',
field: 'splitRule', field: 'splitRule',
sort: 'custom', sort: 'custom',
@ -140,8 +104,9 @@ export const InspectionSchemeMain = useCrudSchemas(reactive<CrudSchema[]>([
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 dictClass: 'string', // 默认都是字符串类型其他暂不考虑
table: { table: {
width: 175 width: 175
}
}, },
}, { {
label: 'aql', label: 'aql',
field: 'aql', field: 'aql',
sort: 'custom', sort: 'custom',
@ -150,7 +115,8 @@ export const InspectionSchemeMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
} }
}, { },
{
label: '检验水平', label: '检验水平',
field: 'inspectionLevel', field: 'inspectionLevel',
sort: 'custom', sort: 'custom',
@ -159,7 +125,7 @@ export const InspectionSchemeMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
isSearch: true, isSearch: true
}, },
{ {
label: '每份样品量', label: '每份样品量',
@ -184,12 +150,12 @@ export const InspectionSchemeMain = useCrudSchemas(reactive<CrudSchema[]>([
style: { width: '100%' }, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
table: { table: {
width: 175 width: 175
}, }
}, },
{ {
label: '失效时间', label: '失效时间',
@ -206,12 +172,12 @@ export const InspectionSchemeMain = useCrudSchemas(reactive<CrudSchema[]>([
style: { width: '100%' }, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
} }
}, },
table: { table: {
width: 175 width: 175
}, }
}, },
{ {
label: '是否可用', label: '是否可用',
@ -231,14 +197,79 @@ export const InspectionSchemeMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 110 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: '操作', label: '操作',
field: 'action', field: 'action',
isDetail: false,
isForm: false, isForm: false,
isDetail: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'
},
} }
])) }
])
)

177
src/views/qms/inspectionTemplate/inspectionTemplate.data.ts

@ -4,95 +4,56 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const InspectionTemplateRules = reactive({ export const InspectionTemplateRules = reactive({
description: [ description: [{ required: true, message: '请填写描述', trigger: 'blur' }],
{ required: true , message: '请填写描述', trigger: 'blur' } version: [{ required: true, message: '请填写版本', trigger: 'blur' }],
], inspectionCode: [{ required: true, message: '请选择检验方案模板编码', trigger: 'blur' }],
version: [ sequenceCode: [{ required: true, message: '请填写顺序号', trigger: 'blur' }],
{ required: true , message: '请填写版本', trigger: 'blur' } inspectionCharCode: [{ required: true, message: '请选择检验特性编码', trigger: 'blur' }],
], describe: [{ required: true, message: '请填写描述', trigger: 'blur' }],
inspectionCode: [ inspectionMethodCode: [{ required: true, message: '请选择检验方法编码', trigger: 'blur' }],
{ required: true, message: '请选择检验方案模板编码', trigger: 'blur' } dynamicUpdateCode: [{ required: true, message: '请选择采样过程编码', trigger: 'blur' }],
], inspectionMethod: [{ required: true, message: '请选择动态修改规则编码', trigger: 'blur' }],
sequenceCode: [ isCanUpdate: [{ required: true, message: '请选择是否允许修改特征值', trigger: 'blur' }],
{ required: true, message: '请填写顺序号', trigger: 'blur' } isDestructionInspection: [{ required: true, message: '请选择是否破坏性检验', trigger: 'blur' }],
], resultEntryMethod: [{ required: true, message: '请选择结果录入方式', trigger: 'blur' }],
inspectionCharCode: [ featureType: [{ required: true, message: '请选择特征类型', trigger: 'blur' }],
{ required: true, message: '请选择检验特性编码', trigger: 'blur' } quantifyIsCapping: [{ required: true, message: '请选择是否设定上限', trigger: 'blur' }],
], quantifyIsLowlimit: [{ required: true, message: '请选择是否设定下限', trigger: 'blur' }],
describe: [ quantifyTarget: [{ required: true, message: '请输入目标值', trigger: 'blur' }],
{ required: true, message: '请填写描述', trigger: 'blur' } quantifyCapping: [{ required: true, message: '请输入上限值', trigger: 'blur' }],
], quantifyLowlimit: [{ required: true, message: '请输入下限值', trigger: 'blur' }],
inspectionMethodCode: [ quantifyquantifyUomLowlimit: [{ required: true, message: '请选择计量单位', trigger: 'blur' }],
{ required: true, message: '请选择检验方法编码', trigger: 'blur' } quantifyDecimal: [{ required: true, message: '请输入小数位', trigger: 'blur' }],
], quantifyQuantifyCode: [{ 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<CrudSchema[]>([ export const InspectionTemplateMain = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '编码', label: '编码',
field: 'code', field: 'code',
sort: 'custom', sort: 'custom',
isSearch:true, isSearch: true,
form:{ form: {
componentProps:{ componentProps: {
disabled:true, disabled: true,
placeholder:'系统自动获取' placeholder: '系统自动获取'
} }
} }
}, },
{ {
label: '描述', label: '描述',
field: 'description', field: 'description',
sort: 'custom', sort: 'custom'
},{ },
{
label: '动态修改规则', label: '动态修改规则',
field: 'dynamicUpdateName', field: 'dynamicUpdateName',
sort: 'custom', sort: 'custom'
},{ },
{
label: '版本', label: '版本',
field: 'version', field: 'version',
sort: 'custom', sort: 'custom'
}, },
{ {
label: '是否可用', label: '是否可用',
@ -112,16 +73,82 @@ export const InspectionTemplateMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 110 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: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
isDetail: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'
} }
} }
])) ])
)
export const InspectionTemplateProcess = useCrudSchemas(reactive<CrudSchema[]>([ export const InspectionTemplateProcess = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '编码', label: '编码',

83
src/views/qms/qualityNotice/qualityNoticeMain.data.ts

@ -8,7 +8,8 @@ const { t } = useI18n() // 国际化
/** /**
* @returns {Array} * @returns {Array}
*/ */
export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([ export const QualityNoticeMain = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '编码', label: '编码',
field: 'number', field: 'number',
@ -50,7 +51,8 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 200 width: 200
} }
}, { },
{
label: '优先级', label: '优先级',
field: 'priority', field: 'priority',
sort: 'custom', sort: 'custom',
@ -63,7 +65,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
disabled: true disabled: true
} }
}, }
}, },
{ {
label: '状态', label: '状态',
@ -78,7 +80,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
disabled: true disabled: true
} }
}, }
}, },
{ {
label: '报告人', label: '报告人',
@ -93,7 +95,7 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
componentProps: { componentProps: {
disabled: true disabled: true
} }
}, }
}, },
{ {
label: '报告时间', label: '报告时间',
@ -315,17 +317,82 @@ export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 175 width: 175
} }
}, },
{
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: '操作', label: '操作',
field: 'action', field: 'action',
isDetail: false,
isForm: false, isForm: false,
isDetail: false,
table: { table: {
width: 200, width: 150,
fixed: 'right' fixed: 'right'
} }
} }
])) ])
)
//表单校验 //表单校验
export const QualityNoticeMainRules = reactive({ export const QualityNoticeMainRules = reactive({

122
src/views/qms/sampleCode/sampleCode.data.ts

@ -1,23 +1,27 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import {getSamplingScheme} from '@/api/qms/sampleCode/index' import { getSamplingScheme } from '@/api/qms/sampleCode/index'
import {validateNum} from "@/utils/validator"; import { validateNum } from '@/utils/validator'
// 表单校验 // 表单校验
export const SampleCodeRules = reactive({ export const SampleCodeRules = reactive({
code: [required], code: [required],
batchLowLimiting: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}], batchLowLimiting: [{ validator: validateNum, message: '请输入整数', trigger: 'blur' }],
batchUpperLimiting: [{ required:true, message: '该项为必填', trigger: 'blur'}, { validator:validateNum, message: '请输入整数', trigger: 'blur'}], batchUpperLimiting: [
s1: [ required ], { required: true, message: '该项为必填', trigger: 'blur' },
s2: [required ], { validator: validateNum, message: '请输入整数', trigger: 'blur' }
s3: [ required ], ],
s4: [ required ], s1: [required],
g1: [ required ], s2: [required],
g2: [ required ], s3: [required],
g3: [ required ] s4: [required],
g1: [required],
g2: [required],
g3: [required]
}) })
const samplingSchemeList = await getSamplingScheme() const samplingSchemeList = await getSamplingScheme()
export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([ export const SampleCode = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '采样方案编码', label: '采样方案编码',
field: 'code', field: 'code',
@ -30,7 +34,7 @@ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
optionsAlias: { optionsAlias: {
labelField: 'code', labelField: 'code',
valueField: 'code' valueField: 'code'
}, }
} }
}, },
table: { table: {
@ -46,7 +50,7 @@ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
}, }
}, },
{ {
label: '批量上限', label: '批量上限',
@ -56,90 +60,134 @@ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
form: { form: {
component: 'InputNumber', component: 'InputNumber',
value: 0 value: 0
}, }
}, },
{ {
label: 's1', label: 's1',
field: 's1', field: 's1',
sort: 'custom', sort: 'custom'
}, },
{ {
label: 's2', label: 's2',
field: 's2', field: 's2',
sort: 'custom', sort: 'custom'
}, },
{ {
label: 's3', label: 's3',
field: 's3', field: 's3',
sort: 'custom', sort: 'custom'
}, },
{ {
label: 's4', label: 's4',
field: 's4', field: 's4',
sort: 'custom', sort: 'custom'
}, },
{ {
label: 'g1', label: 'g1',
field: 'g1', field: 'g1',
sort: 'custom', sort: 'custom'
}, },
{ {
label: 'g2', label: 'g2',
field: 'g2', field: 'g2',
sort: 'custom', sort: 'custom'
}, },
{ {
label: 'g3', label: 'g3',
field: 'g3', field: 'g3',
sort: 'custom'
},
{
label: '是否可用',
field: 'available',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 110
}
}, },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false, isForm: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
style: {width: '100%'}, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
}
} }
}, },
{
label: '创建者',
field: 'creator',
table: { table: {
width: 175 width: 130
} },
isForm: false,
isTable: true
}, },
{ {
label: '是否可用', label: '最后更新时间',
field: 'available', field: 'updateTime',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, isDetail: true,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isForm: false,
isTable: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: { form: {
component: 'Switch', component: 'DatePicker',
value: 'TRUE',
componentProps: { componentProps: {
inactiveValue: 'FALSE', style: { width: '100%' },
activeValue: 'TRUE' type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
} }
}, },
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: { table: {
width: 110 width: 150
} }
}, },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
isDetail: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'
} }
} }
])) ])
)

93
src/views/qms/samplingProcess/samplingProcess.data.ts

@ -1,19 +1,26 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import {getSamplingScheme} from "@/api/qms/samplingProcess"; import { getSamplingScheme } from '@/api/qms/samplingProcess'
import { validateInteger ,validateTwoNum} from '@/utils/validator' import { validateInteger, validateTwoNum } from '@/utils/validator'
// 表单校验 // 表单校验
export const SamplingProcessRules = reactive({ export const SamplingProcessRules = reactive({
sampleType: [required], sampleType: [required],
evaluationMode: [required], evaluationMode: [required],
description: [required], description: [required],
sampleQty:[{ required: true, message: '该项为必填项', trigger: 'blur' },{validator:validateTwoNum, message: '小数点后最多2位', trigger: 'blur'}], sampleQty: [
sampleProgCode:[{ required: true, message: '该项为必填项', trigger: 'blur' }], { required: true, message: '该项为必填项', trigger: 'blur' },
inspectionQty: [required, {validator:validateInteger, 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() const samplingSchemeList = await getSamplingScheme()
export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([ export const SamplingProcess = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '编码', label: '编码',
field: 'code', field: 'code',
@ -68,51 +75,99 @@ export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
optionsAlias: { optionsAlias: {
labelField: 'description', labelField: 'description',
valueField: 'code' 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: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false, isForm: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
style: {width: '100%'}, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
} }
} }
}, },
{ {
label: '是否可用', label: '创建者',
field: 'available', field: 'creator',
table: {
width: 130
},
isForm: false,
isTable: true
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, isDetail: true,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isForm: false,
isTable: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: { form: {
component: 'Switch', component: 'DatePicker',
value: 'TRUE',
componentProps: { componentProps: {
inactiveValue: 'FALSE', style: { width: '100%' },
activeValue: 'TRUE' type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
} }
},
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: {
width: 150
} }
}, },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
isDetail: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'
} }
} }
])) ])
)

82
src/views/qms/samplingScheme/samplingScheme.data.ts

@ -3,10 +3,11 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const SamplingSchemeRules = reactive({ export const SamplingSchemeRules = reactive({
description: [required], description: [required]
}) })
export const SamplingScheme = useCrudSchemas(reactive<CrudSchema[]>([ export const SamplingScheme = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '编码', label: '编码',
field: 'code', field: 'code',
@ -21,52 +22,99 @@ export const SamplingScheme = useCrudSchemas(reactive<CrudSchema[]>([
label: '描述', label: '描述',
field: 'description', field: 'description',
sort: 'custom', sort: 'custom',
isSearch: true, 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
}
}, },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false, isForm: false,
table: {
width: 180
},
formatter: dateFormatter,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
form: { form: {
component: 'DatePicker', component: 'DatePicker',
componentProps: { componentProps: {
style: {width: '100%'}, style: { width: '100%' },
type: 'datetime', type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', valueFormat: 'x'
}
} }
}, },
{
label: '创建者',
field: 'creator',
table: {
width: 130
},
isForm: false,
isTable: true
}, },
{ {
label: '是否可用', label: '最后更新时间',
field: 'available', field: 'updateTime',
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, isDetail: true,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 isForm: false,
isTable: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: { form: {
component: 'Switch', component: 'DatePicker',
value: 'TRUE',
componentProps: { componentProps: {
inactiveValue: 'FALSE', style: { width: '100%' },
activeValue: 'TRUE' type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
} }
}, },
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: { table: {
width: 110 width: 150
} }
}, },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
isDetail: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'
} }
} }
])) ])
)

78
src/views/qms/selectedSet/selectedSet.data.ts

@ -1,6 +1,6 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import * as DictTypeApi from '@/api/system/dict/dict.type' import * as DictTypeApi from '@/api/system/dict/dict.type'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const SelectedSetRules = reactive({ export const SelectedSetRules = reactive({
@ -10,8 +10,8 @@ export const SelectedSetRules = reactive({
concurrencyStamp: [required] concurrencyStamp: [required]
}) })
export const SelectedSet = useCrudSchemas(reactive<CrudSchema[]>([ export const SelectedSet = useCrudSchemas(
reactive<CrudSchema[]>([
{ {
label: '编码', label: '编码',
field: 'code', field: 'code',
@ -44,15 +44,79 @@ export const SelectedSet = useCrudSchemas(reactive<CrudSchema[]>([
width: 110 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: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
isDetail: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'
},
isTableForm: false,
isDetail: false
} }
])) }
])
)

Loading…
Cancel
Save