页面优化

test
liutao 4 weeks ago
parent 06e27720c8
commit 63e565bb51

@ -52,7 +52,7 @@
:placeholder="t('QualityManagement.ZjItem.placeholderLowerVal')" :placeholder="t('QualityManagement.ZjItem.placeholderLowerVal')"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="t('QualityManagement.ZjItem.unit')" prop="unitId"> <el-form-item :label="t('QualityManagement.ZjItem.unit')" prop="unit">
<el-select <el-select
v-model="formData.unit" v-model="formData.unit"
clearable clearable
@ -63,7 +63,7 @@
v-for="unit in unitList" v-for="unit in unitList"
:key="unit.id" :key="unit.id"
:label="unit.name" :label="unit.name"
:value="unit.id" :value="String(unit.id)"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -86,7 +86,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ZjItemApi, ZjItemVO } from '@/api/mes/zjitem' import { ZjItemApi, ZjItemVO } from '@/api/mes/zjitem'
import {ZjTypeApi, ZjTypeVO} from "@/api/mes/zjtype"; import { ZjTypeApi, ZjTypeVO } from '@/api/mes/zjtype'
import { ProductUnitApi, ProductUnitVO } from '@/api/erp/product/unit' import { ProductUnitApi, ProductUnitVO } from '@/api/erp/product/unit'
/** 质量管理-检验项目 表单 */ /** 质量管理-检验项目 表单 */
@ -125,17 +125,18 @@ const open = async (type: string, id?: number) => {
formType.value = type formType.value = type
resetForm() resetForm()
typeList.value = await ZjTypeApi.getZjTypeList() typeList.value = await ZjTypeApi.getZjTypeList()
unitList.value = await ProductUnitApi.getProductUnitSimpleList()
// //
if (id) { if (id) {
formLoading.value = true formLoading.value = true
try { try {
formData.value = await ZjItemApi.getZjItem(id) formData.value = await ZjItemApi.getZjItem(id)
formData.value.unit = formData.value.unit == null ? undefined : String(formData.value.unit)
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
} }
// //
unitList.value = await ProductUnitApi.getProductUnitSimpleList()
} }
defineExpose({ open }) // open defineExpose({ open }) // open

Loading…
Cancel
Save