refactor(mes): 将 enableFlag/enabled/areaEnabled 重构为 status/areaStatus(CommonStatus)
QC Template: enableFlag(Boolean) -> status(Integer),使用 CommonStatusEnum Warehouse Area: enabled(Boolean) -> status(Integer),使用 CommonStatusEnum Warehouse Location: areaEnabled(Boolean) -> areaStatus(Integer),使用 CommonStatusEnum 涉及前端 API 定义、列表页、表单页的字段名和字典类型切换(INFRA_BOOLEAN_STRING -> COMMON_STATUS), 以及后端 DO、RespVO、SaveReqVO、PageReqVO、Mapper 的同步修改。 注意:语义反转,原 true(启用) 对应新 status=0(开启),原 false(禁用) 对应新 status=1(关闭)。pull/871/MERGE
parent
e95d613965
commit
545887ed38
|
|
@ -8,7 +8,7 @@ export interface WmWarehouseLocationVO {
|
|||
warehouseId: number
|
||||
warehouseName: string
|
||||
area: number
|
||||
areaEnabled: boolean
|
||||
areaStatus: number
|
||||
frozen: boolean
|
||||
remark: string
|
||||
attribute1: string
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否启用" prop="enableFlag">
|
||||
<el-select v-model="formData.enableFlag" placeholder="请选择" class="!w-1/1">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="formData.status" placeholder="请选择" class="!w-1/1">
|
||||
<el-option
|
||||
v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
||||
:key="dict.value + ''"
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
|
|
@ -90,7 +90,8 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getBoolDictOptions, getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
import { generateRandomStr } from '@/utils'
|
||||
import { QcTemplateApi, QcTemplateVO } from '@/api/mes/qc/template'
|
||||
import TemplateIndicatorList from './TemplateIndicatorList.vue'
|
||||
|
|
@ -111,7 +112,7 @@ const formData = ref({
|
|||
code: undefined,
|
||||
name: undefined,
|
||||
types: [] as number[],
|
||||
enableFlag: true,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
remark: undefined
|
||||
})
|
||||
const formRules = reactive({
|
||||
|
|
@ -120,7 +121,7 @@ const formRules = reactive({
|
|||
types: [
|
||||
{ required: true, message: '检测种类不能为空', trigger: 'change', type: 'array', min: 1 }
|
||||
],
|
||||
enableFlag: [{ required: true, message: '是否启用不能为空', trigger: 'change' }]
|
||||
status: [{ required: true, message: '状态不能为空', trigger: 'change' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
|
|
@ -186,7 +187,7 @@ const resetForm = () => {
|
|||
code: undefined,
|
||||
name: undefined,
|
||||
types: [],
|
||||
enableFlag: true,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
remark: undefined
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
|
|
|
|||
|
|
@ -42,16 +42,16 @@
|
|||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="enableFlag">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.enableFlag"
|
||||
placeholder="请选择是否启用"
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
||||
:key="dict.value as unknown as string"
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
|
|
@ -91,9 +91,9 @@
|
|||
<dict-tag :type="DICT_TYPE.MES_QC_TYPE" :value="scope.row.types" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否启用" align="center" prop="enableFlag" width="100">
|
||||
<el-table-column label="状态" align="center" prop="status" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.enableFlag" />
|
||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" min-width="150" />
|
||||
|
|
@ -143,7 +143,7 @@ import { dateFormatter } from '@/utils/formatTime'
|
|||
import download from '@/utils/download'
|
||||
import { QcTemplateApi, QcTemplateVO } from '@/api/mes/qc/template'
|
||||
import TemplateForm from './TemplateForm.vue'
|
||||
import { DICT_TYPE, getBoolDictOptions, getIntDictOptions } from '@/utils/dict'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
|
||||
defineOptions({ name: 'MesQcTemplate' })
|
||||
|
||||
|
|
@ -159,7 +159,7 @@ const queryParams = reactive({
|
|||
code: undefined,
|
||||
name: undefined,
|
||||
type: undefined,
|
||||
enableFlag: undefined
|
||||
status: undefined
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
|
|
|||
|
|
@ -111,8 +111,15 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否启用" prop="enabled">
|
||||
<el-switch v-model="formData.enabled" />
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="formData.status" placeholder="请选择" class="!w-1/1">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
|
@ -153,6 +160,8 @@
|
|||
import { WmWarehouseApi, WmWarehouseVO } from '@/api/mes/wm/warehouse'
|
||||
import { WmWarehouseLocationApi, WmWarehouseLocationVO } from '@/api/mes/wm/warehouse/location'
|
||||
import { WmWarehouseAreaApi, WmWarehouseAreaVO } from '@/api/mes/wm/warehouse/area'
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
|
||||
defineOptions({ name: 'AreaForm' })
|
||||
|
||||
|
|
@ -176,7 +185,7 @@ const formData = ref({
|
|||
positionX: undefined,
|
||||
positionY: undefined,
|
||||
positionZ: undefined,
|
||||
enabled: true,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
frozen: false,
|
||||
allowItemMixing: true,
|
||||
allowBatchMixing: true,
|
||||
|
|
@ -186,7 +195,7 @@ const formRules = reactive({
|
|||
code: [{ required: true, message: '库位编码不能为空', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '库位名称不能为空', trigger: 'blur' }],
|
||||
locationId: [{ required: true, message: '所属库区不能为空', trigger: 'change' }],
|
||||
enabled: [{ required: true, message: '是否启用不能为空', trigger: 'change' }],
|
||||
status: [{ required: true, message: '状态不能为空', trigger: 'change' }],
|
||||
frozen: [{ required: true, message: '是否冻结不能为空', trigger: 'change' }],
|
||||
allowItemMixing: [{ required: true, message: '物料混放开关不能为空', trigger: 'change' }],
|
||||
allowBatchMixing: [{ required: true, message: '批次混放开关不能为空', trigger: 'change' }]
|
||||
|
|
@ -287,7 +296,7 @@ const resetForm = () => {
|
|||
positionX: undefined,
|
||||
positionY: undefined,
|
||||
positionZ: undefined,
|
||||
enabled: true,
|
||||
status: CommonStatusEnum.ENABLE,
|
||||
frozen: false,
|
||||
allowItemMixing: true,
|
||||
allowBatchMixing: true,
|
||||
|
|
|
|||
|
|
@ -81,9 +81,9 @@
|
|||
<el-table-column label="位置 X" align="center" prop="positionX" min-width="80" />
|
||||
<el-table-column label="位置 Y" align="center" prop="positionY" min-width="80" />
|
||||
<el-table-column label="位置 Z" align="center" prop="positionZ" min-width="80" />
|
||||
<el-table-column label="启用" align="center" prop="enabled" min-width="70">
|
||||
<el-table-column label="状态" align="center" prop="status" min-width="70">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.enabled" />
|
||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="冻结" align="center" prop="frozen" min-width="80">
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
<script setup lang="ts">
|
||||
import { WmWarehouseApi, WmWarehouseVO } from '@/api/mes/wm/warehouse'
|
||||
import { WmWarehouseLocationApi, WmWarehouseLocationVO } from '@/api/mes/wm/warehouse/location'
|
||||
import { CommonStatusEnum } from '@/utils/constants'
|
||||
|
||||
defineOptions({ name: 'LocationForm' })
|
||||
|
||||
|
|
@ -87,7 +88,7 @@ const formData = ref({
|
|||
name: undefined,
|
||||
warehouseId: undefined as number | undefined,
|
||||
area: undefined,
|
||||
areaEnabled: true,
|
||||
areaStatus: CommonStatusEnum.ENABLE,
|
||||
frozen: false,
|
||||
remark: undefined
|
||||
})
|
||||
|
|
@ -155,7 +156,7 @@ const resetForm = () => {
|
|||
name: undefined,
|
||||
warehouseId: undefined as number | undefined,
|
||||
area: undefined,
|
||||
areaEnabled: true,
|
||||
areaStatus: CommonStatusEnum.ENABLE,
|
||||
frozen: false,
|
||||
remark: undefined
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue