fix(mes): 修改多个组件以使用整数类型的字典选项
parent
e80e5203a4
commit
d08413a68e
|
|
@ -5,7 +5,7 @@ export interface WmMiscIssueVO {
|
|||
id: number
|
||||
code: string
|
||||
name: string
|
||||
type: string
|
||||
type: number
|
||||
sourceDocType: string
|
||||
sourceDocId: number
|
||||
sourceDocCode: string
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
:disabled="isHeaderReadonly"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.MES_WM_MISC_ISSUE_TYPE)"
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.MES_WM_MISC_ISSUE_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
@ -120,7 +120,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import { WmMiscIssueApi, WmMiscIssueVO } from '@/api/mes/wm/miscissue'
|
||||
import { AutoCodeRecordApi } from '@/api/mes/md/autocode/record'
|
||||
import MiscIssueLineList from './MiscIssueLineList.vue'
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.MES_WM_MISC_ISSUE_TYPE)"
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.MES_WM_MISC_ISSUE_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
@ -195,7 +195,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter2 } from '@/utils/formatTime'
|
||||
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import download from '@/utils/download'
|
||||
import { WmMiscIssueApi, WmMiscIssueVO } from '@/api/mes/wm/miscissue'
|
||||
import MiscIssueForm from './MiscIssueForm.vue'
|
||||
|
|
|
|||
|
|
@ -118,13 +118,12 @@
|
|||
</template>
|
||||
<template v-else-if="formData.type === MesWmStockTakingParamTypeEnum.QUALITY_STATUS">
|
||||
<el-select
|
||||
v-model="formData.valueCode"
|
||||
v-model="qualityStatusValue"
|
||||
placeholder="请选择质量状态"
|
||||
class="!w-full"
|
||||
@change="handleQualityStatusChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.MES_WM_QUALITY_STATUS)"
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.MES_WM_QUALITY_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
|
|
@ -148,7 +147,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
|
||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||
import {
|
||||
StockTakingPlanParamApi,
|
||||
type StockTakingPlanParamVO
|
||||
|
|
@ -219,6 +218,10 @@ const formData = ref<StockTakingPlanParamVO>({
|
|||
valueName: '',
|
||||
remark: ''
|
||||
})
|
||||
const qualityStatusValue = computed({
|
||||
get: () => (formData.value.valueCode ? Number(formData.value.valueCode) : undefined),
|
||||
set: (val?: number) => handleQualityStatusChange(val)
|
||||
})
|
||||
const formRules = reactive({
|
||||
type: [{ required: true, message: '请选择条件类型', trigger: 'change' }],
|
||||
valueId: [
|
||||
|
|
@ -331,11 +334,11 @@ const handleBatchChange = (batch?: any) => {
|
|||
}
|
||||
|
||||
/** 质量状态选择器变化 */
|
||||
const handleQualityStatusChange = (val: string) => {
|
||||
const dictOptions = getStrDictOptions(DICT_TYPE.MES_WM_QUALITY_STATUS)
|
||||
const handleQualityStatusChange = (val?: number) => {
|
||||
const dictOptions = getIntDictOptions(DICT_TYPE.MES_WM_QUALITY_STATUS)
|
||||
const selected = dictOptions.find((d) => d.value === val)
|
||||
formData.value.valueId = undefined // 质量状态无实体 ID
|
||||
formData.value.valueCode = val
|
||||
formData.value.valueCode = val == null ? '' : String(val)
|
||||
formData.value.valueName = selected?.label || ''
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue