change(mes): 将品牌、层级、花纹、速度级别、负荷载重字段改为下拉选择

- 使用 el-select 组件替换原有的 el-input 组件
- 添加相应的数据获取接口getSysMasterDataDetailList和变量
- 在组件挂载和打开对话框时获取下拉列表数据
- 优化最小停放时间和最大停放时间的输入方式,使用 el-input-number 组件
master
zch 1 month ago
parent 1357a0e4c3
commit 4a1d2789d0

@ -604,19 +604,43 @@
</el-radio-group>
</el-form-item>
<el-form-item label="品牌" prop="brand">
<el-input v-model="form.brand" placeholder="请输入品牌" />
<!-- <el-input v-model="form.brand" placeholder="请输入品牌" />-->
<el-select v-model="form.brand" placeholder="请选择品牌">
<el-option v-for="item in brandList"
:key="item.masterDataDetailId"
:label="item.dataDetailName"
:value="item.masterDataDetailId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="层级" prop="plyrating">
<el-input v-model="form.plyrating" placeholder="请输入层级" />
<!-- <el-input v-model="form.plyrating" placeholder="请输入层级" />-->
<el-select v-model="form.plyrating" placeholder="请选择层级">
<el-option v-for="item in plyratingList"
:key="item.masterDataDetailId"
:label="item.dataDetailName"
:value="item.masterDataDetailId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="花纹" prop="pattern">
<el-input v-model="form.pattern" placeholder="请输入花纹" />
<!-- <el-input v-model="form.pattern" placeholder="请输入花纹" />-->
<el-select v-model="form.pattern" placeholder="请选择花纹">
<el-option v-for="item in patternList"
:key="item.masterDataDetailId"
:label="item.dataDetailName"
:value="item.masterDataDetailId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="速度级别" prop="speedLevel">
<el-input v-model="form.speedLevel" placeholder="请输入速度级别" />
<!-- <el-input v-model="form.speedLevel" placeholder="请输入速度级别" />-->
<el-select v-model="form.speedLevel" placeholder="请选择速度级别">
<el-option v-for="item in speedLevelList" :key="item.masterDataDetailId" :label="item.dataDetailName" :value="item.masterDataDetailId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="负荷载重" prop="load">
<el-input v-model="form.load" placeholder="请输入负荷载重" />
<!-- <el-input v-model="form.load" placeholder="请输入负荷载重" />-->
<el-select v-model="form.load" placeholder="请选择负荷载重">
<el-option v-for="item in loadList" :key="item.masterDataDetailId" :label="item.dataDetailName" :value="item.masterDataDetailId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="轮胎标记" prop="tireMarkings">
<el-select v-model="form.tireMarkings" placeholder="请选择轮胎标记">
@ -629,27 +653,49 @@
</el-select>
</el-form-item>
<el-form-item label="最小停放时间" prop="minParkingTime">
<!-- <el-input v-model="form.minParkingTime" placeholder="请输入最小停放时间" />-->
<el-input-number v-model="form.minParkingDays" placeholder="请输入天数" :min="0" :max="10000"
:controls="false" :style="{ width: '50px' }"/>
<!-- <el-input v-model="form.minParkingTime" placeholder="请输入最小停放时间" />-->
<el-input-number
v-model="form.minParkingDays"
placeholder="请输入天数"
:min="0"
:max="10000"
:controls="false"
:style="{ width: '50px' }"
/>
<span>&nbsp;&nbsp;</span>
<el-input-number v-model="form.minParkingHours" placeholder="请输入小时" :min="0" :max="23"
:controls="false" :style="{ width: '50px' }"/>
<el-input-number v-model="form.minParkingHours" placeholder="请输入小时" :min="0" :max="23" :controls="false" :style="{ width: '50px' }" />
<span>&nbsp;小时&nbsp;</span>
<el-input-number v-model="form.minParkingMinutes" placeholder="请输入分钟" :min="0" :max="59"
:controls="false" :style="{ width: '50px' }"/>
<el-input-number
v-model="form.minParkingMinutes"
placeholder="请输入分钟"
:min="0"
:max="59"
:controls="false"
:style="{ width: '50px' }"
/>
<span>&nbsp;分钟&nbsp;</span>
</el-form-item>
<el-form-item label="最大停放时间" prop="maxParkingTime">
<!-- <el-input v-model="form.maxParkingTime" placeholder="请输入最大停放时间" />-->
<el-input-number v-model="form.maxParkingDays" placeholder="请输入天数" :min="0" :max="10000"
:controls="false" :style="{ width: '50px' }"/>
<!-- <el-input v-model="form.maxParkingTime" placeholder="请输入最大停放时间" />-->
<el-input-number
v-model="form.maxParkingDays"
placeholder="请输入天数"
:min="0"
:max="10000"
:controls="false"
:style="{ width: '50px' }"
/>
<span>&nbsp;&nbsp;</span>
<el-input-number v-model="form.maxParkingHours" placeholder="请输入小时" :min="0" :max="23"
:controls="false" :style="{ width: '50px' }"/>
<el-input-number v-model="form.maxParkingHours" placeholder="请输入小时" :min="0" :max="23" :controls="false" :style="{ width: '50px' }" />
<span>&nbsp;小时&nbsp;</span>
<el-input-number v-model="form.maxParkingMinutes" placeholder="请输入分钟" :min="0" :max="59"
:controls="false" :style="{ width: '50px' }"/>
<el-input-number
v-model="form.maxParkingMinutes"
placeholder="请输入分钟"
:min="0"
:max="59"
:controls="false"
:style="{ width: '50px' }"
/>
<span>&nbsp;分钟&nbsp;</span>
</el-form-item>
<el-form-item label="标准重量" prop="standardWeight">
@ -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(() => {

Loading…
Cancel
Save