From 4a1d2789d0724f92baf0f9b84be70fc22eb12bd1 Mon Sep 17 00:00:00 2001 From: zch Date: Fri, 28 Feb 2025 20:23:54 +0800 Subject: [PATCH] =?UTF-8?q?change(mes):=20=E5=B0=86=E5=93=81=E7=89=8C?= =?UTF-8?q?=E3=80=81=E5=B1=82=E7=BA=A7=E3=80=81=E8=8A=B1=E7=BA=B9=E3=80=81?= =?UTF-8?q?=E9=80=9F=E5=BA=A6=E7=BA=A7=E5=88=AB=E3=80=81=E8=B4=9F=E8=8D=B7?= =?UTF-8?q?=E8=BD=BD=E9=87=8D=E5=AD=97=E6=AE=B5=E6=94=B9=E4=B8=BA=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用 el-select 组件替换原有的 el-input 组件 - 添加相应的数据获取接口getSysMasterDataDetailList和变量 - 在组件挂载和打开对话框时获取下拉列表数据 - 优化最小停放时间和最大停放时间的输入方式,使用 el-input-number 组件 --- src/views/mes/baseMaterialInfo/index.vue | 151 ++++++++++++++++++----- 1 file changed, 123 insertions(+), 28 deletions(-) diff --git a/src/views/mes/baseMaterialInfo/index.vue b/src/views/mes/baseMaterialInfo/index.vue index 557829d..d7821eb 100644 --- a/src/views/mes/baseMaterialInfo/index.vue +++ b/src/views/mes/baseMaterialInfo/index.vue @@ -604,19 +604,43 @@ - + + + + - + + + + - + + + + - + + + + - + + + + @@ -629,27 +653,49 @@ - - + +  天  - +  小时  - +  分钟  - - + +  天  - +  小时  - +  分钟  @@ -701,6 +747,7 @@ import { getFactoryList } from "@/api/mes/baseFactoryInfo"; import {getBaseMeasurementUnitInfoList} from "@/api/mes/baseMeasurementUnitInfo"; import {BaseMeasurementUnitInfoVO} from "@/api/mes/baseMeasurementUnitInfo/types"; import { getBaseMaterialTypeList } from "@/api/mes/baseMaterialType"; +import {getSysMasterDataDetailList} from "@/api/system/masterDataDetail"; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { apply_flag, inner_tube_flag, @@ -976,6 +1023,13 @@ const handleSelectionChange = (selection: BaseMaterialInfoVO[]) => { const handleAdd = () => { reset(); getFactorySelect(); + + getbrandList(); + getplyratingList(); + getpatternList(); + getspeedLevelList(); + getloadList(); + getMeasureUnit(); getMaterialType(); dialog.visible = true; @@ -986,6 +1040,13 @@ const handleAdd = () => { const handleUpdate = async (row?: BaseMaterialInfoVO) => { reset(); getFactorySelect(); + + getbrandList(); + getplyratingList(); + getpatternList(); + getspeedLevelList(); + getloadList(); + getMeasureUnit(); getMaterialType(); const _materialId = row?.materialId || ids.value[0] @@ -1132,25 +1193,59 @@ const convertToSeconds = () => { /** 秒转换为天小时分钟 */ const convertToTime = () => { - const maxTotalSeconds = form.value.maxParkingTime; - const maxDays = Math.floor(totalSeconds / (24 * 60 * 60)); - const maxHours = Math.floor((totalSeconds % (24 * 60 * 60)) / 3600); - const maxMinutes = Math.floor((totalSeconds % 3600) / 60); + // 处理最大停放时间 + const maxTotalSeconds = form.value.maxParkingTime || 0; + const maxDays = Math.floor(maxTotalSeconds / (24 * 60 * 60)); + const maxHours = Math.floor((maxTotalSeconds % (24 * 60 * 60)) / 3600); + const maxMinutes = Math.floor((maxTotalSeconds % 3600) / 60); // 更新到表单中 form.value.maxParkingDays = maxDays; form.value.maxParkingHours = maxHours; form.value.maxParkingMinutes = maxMinutes; - - const minTotalSeconds = form.value.minParkingTime; - const minDays = Math.floor(totalSeconds / (24 * 60 * 60)); - const minHours = Math.floor((totalSeconds % (24 * 60 * 60)) / 3600); - const minMinutes = Math.floor((totalSeconds % 3600) / 60); + // 处理最小停放时间 + const minTotalSeconds = form.value.minParkingTime || 0; + const minDays = Math.floor(minTotalSeconds / (24 * 60 * 60)); + const minHours = Math.floor((minTotalSeconds % (24 * 60 * 60)) / 3600); + const minMinutes = Math.floor((minTotalSeconds % 3600) / 60); form.value.minParkingDays = minDays; form.value.minParkingHours = minHours; form.value.minParkingMinutes = minMinutes; } +/*brand、plyrating、pattern、speed_level、load*/ +//获取品牌列表 +let brandList = ref([]); +const getbrandList = async () => { + const res = await getSysMasterDataDetailList({masterDataId: 1}); + brandList.value = res.data; +}; +//获取层级列表 +let plyratingList = ref([]); +const getplyratingList = async () => { + const res = await getSysMasterDataDetailList({masterDataId: 4}); + plyratingList.value = res.data; +}; +//获取花纹列表 +let patternList = ref([]); +const getpatternList = async () => { + const res = await getSysMasterDataDetailList({masterDataId: 5}); + patternList.value = res.data; +}; +//获取速度等级列表 + +let speedLevelList = ref([]); +const getspeedLevelList = async () => { + const res = await getSysMasterDataDetailList({masterDataId: 7}); + speedLevelList.value = res.data; +}; +//获取负荷载重列表 +let loadList = ref([]); +const getloadList = async () => { + const res = await getSysMasterDataDetailList({masterDataId: 6}); + loadList.value = res.data; +}; + onMounted(() => {