Browse Source

添加动态修改规则的stage字段

master_hella_20240701
ljlong_2630 7 months ago
parent
commit
3788bfee12
  1. 1
      src/api/qms/inspectionStage/index.ts
  2. 132
      src/views/qms/basicDataManage/dynamicRule/dynamicRule.data.ts
  3. 4
      src/views/qms/basicDataManage/dynamicRule/index.vue
  4. 152
      src/views/qms/basicDataManage/inspectionStage/inspectionStage.data.ts

1
src/api/qms/inspectionStage/index.ts

@ -3,6 +3,7 @@ import request from '@/config/axios'
export interface InspectionStageVO {
code: string
masterId: number
stage: number
dynamicModifyCode: string
description: string
okTimes: number

132
src/views/qms/basicDataManage/dynamicRule/dynamicRule.data.ts

@ -40,135 +40,3 @@ export const DynamicRule = useCrudSchemas(reactive<CrudSchema[]>([
}
}
]))
// 表单校验
export const InspectionStageRules = reactive({
dynamicModifyCode: [required],
okTimes: [required],
okTimeStage: [required],
noOkTimes: [required],
noOkTimeStage: [required],
isStartStage: [required],
skipInspection: [required],
inspectionStringency: [required],
})
export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '描述',
field: 'description',
sort: 'custom',
isSearch: true
},
{
label: 'OK次数',
field: 'okTimes',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
label: 'OK次数后的阶段',
field: 'okTimeStage',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
label: 'NOK次数',
field: 'noOkTimes',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
label: 'NOK次数后的阶段',
field: 'noOkTimeStage',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
label: '是否是起始阶段',
field: 'isStartStage',
sort: 'custom',
isSearch: true,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Switch',
value:true
},
tableForm: {
type: 'Switch',
default: true
},
},
{
label: '是否略过检验',
field: 'skipInspection',
sort: 'custom',
isSearch: true,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Switch',
value:true
},
tableForm: {
type: 'Switch',
default: true
}
},
{
label: '检验严格性',
field: 'inspectionStringency',
sort: 'custom',
isSearch: true,
dictType: DICT_TYPE.INSPECTION_SEVERITY,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
tableForm: {
type: 'Select'
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 300,
fixed: 'right'
},
isTableForm: false,
}
]))

4
src/views/qms/basicDataManage/dynamicRule/index.vue

@ -77,7 +77,6 @@
@detailOpenForm="detailOpenForm"
myFuncTypeSign="InspectionStage"
/>
<UploadFile ref="uploadFileRef" :modelValue="uploadFileList" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/dynamic-rule/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -85,7 +84,8 @@
<script setup lang="ts">
import download from '@/utils/download'
import { DynamicRule,DynamicRuleRules,InspectionStage,InspectionStageRules } from './dynamicRule.data'
import { DynamicRule,DynamicRuleRules } from './dynamicRule.data'
import { InspectionStage,InspectionStageRules } from '../inspectionStage/inspectionStage.data'
import * as DynamicRuleApi from '@/api/qms/dynamicRule'
import * as InspectionStageApi from '@/api/qms/inspectionStage'
import * as defaultButtons from '@/utils/disposition/defaultButtons'

152
src/views/qms/basicDataManage/inspectionStage/inspectionStage.data.ts

@ -1,9 +1,17 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
const trueFalse = [{
label: '是',
value: true
}, {
label: '否',
value: false
}]
// 表单校验
export const InspectionStageRules = reactive({
code: [required],
description: [required],
dynamicModifyCode: [required],
okTimes: [required],
okTimeStage: [required],
@ -12,28 +20,28 @@ export const InspectionStageRules = reactive({
isStartStage: [required],
skipInspection: [required],
inspectionStringency: [required],
available: [required],
concurrencyStamp: [required]
})
export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'code',
label: '描述',
field: 'description',
sort: 'custom',
isSearch: true
},
{
label: '动态修改规则编码',
field: 'dynamicModifyCode',
label: '阶段',
field: 'stage',
sort: 'custom',
isSearch: true
},
{
label: '描述',
field: 'description',
sort: 'custom',
isSearch: true
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
label: 'OK次数',
@ -43,6 +51,9 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
@ -53,6 +64,9 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
@ -63,6 +77,9 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
@ -73,6 +90,9 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'InputNumber',
value: 0
},
tableForm: {
type: 'InputNumber',
}
},
{
@ -80,104 +100,58 @@ export const InspectionStage = useCrudSchemas(reactive<CrudSchema[]>([
field: 'isStartStage',
sort: 'custom',
isSearch: true,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Radio'
}
component: 'Switch',
value:true
},
tableForm: {
type: 'Switch',
default: true
},
},
{
label: '是否略过检验',
field: 'skipInspection',
sort: 'custom',
isSearch: true,
formatter: (_: Recordable, __: TableColumn, cellValue: boolean) => {
return trueFalse.find((account) => account.value == cellValue)?.label
},
form: {
component: 'Radio'
component: 'Switch',
value:true
},
tableForm: {
type: 'Switch',
default: true
}
},
{
label: '检验严格性',
field: 'inspectionStringency',
sort: 'custom',
isSearch: true
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isSearch: true
},
{
label: '创建时间',
field: 'createTime',
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')]
}
dictType: DICT_TYPE.INSPECTION_SEVERITY,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: {
component: 'Select'
},
isForm: false
},
{
label: '删除时间',
field: 'deletionTime',
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')]
}
tableForm: {
type: 'Select'
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
}
},
{
label: '删除者ID',
field: 'deleterId',
sort: 'custom',
isSearch: true
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isSearch: true
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '地点id',
field: 'siteId',
sort: 'custom',
isSearch: true
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
width: 300,
fixed: 'right'
}
},
isTableForm: false,
}
]))

Loading…
Cancel
Save