|
|
|
@ -338,8 +338,19 @@
|
|
|
|
|
<dict-tag :options="tire_markings" :value="scope.row.tireMarkings"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="最小停放时间" align="center" prop="minParkingTime" v-if="columns[39].visible"/>
|
|
|
|
|
<el-table-column label="最大停放时间" align="center" prop="maxParkingTime" v-if="columns[40].visible"/>
|
|
|
|
|
<!-- <el-table-column label="最小停放时间" align="center" prop="minParkingTime" v-if="columns[39].visible"/>-->
|
|
|
|
|
<el-table-column label="最小停放时间" align="center" prop="minParkingTime" v-if="columns[39].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ formatDayHourMinutes(scope.row.minParkingTime) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<!-- <el-table-column label="最大停放时间" align="center" prop="maxParkingTime" v-if="columns[40].visible"/>-->
|
|
|
|
|
<el-table-column label="最大停放时间" align="center" prop="maxParkingTime" v-if="columns[40].visible">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ formatDayHourMinutes(scope.row.maxParkingTime) }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column label="标准重量" align="center" prop="standardWeight" v-if="columns[41].visible"/>
|
|
|
|
|
<el-table-column label="标准重量上限" align="center" prop="weightUpperLimit" v-if="columns[42].visible"/>
|
|
|
|
|
<el-table-column label="标准重量下限" align="center" prop="weightLowerLimit" v-if="columns[43].visible"/>
|
|
|
|
@ -618,10 +629,28 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="最小停放时间" prop="minParkingTime">
|
|
|
|
|
<el-input v-model="form.minParkingTime" placeholder="请输入最小停放时间" />
|
|
|
|
|
<!-- <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> 天 </span>
|
|
|
|
|
<el-input-number v-model="form.minParkingHours" placeholder="请输入小时" :min="0" :max="23"
|
|
|
|
|
:controls="false" :style="{ width: '50px' }"/>
|
|
|
|
|
<span> 小时 </span>
|
|
|
|
|
<el-input-number v-model="form.minParkingMinutes" placeholder="请输入分钟" :min="0" :max="59"
|
|
|
|
|
:controls="false" :style="{ width: '50px' }"/>
|
|
|
|
|
<span> 分钟 </span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="最大停放时间" prop="maxParkingTime">
|
|
|
|
|
<el-input v-model="form.maxParkingTime" placeholder="请输入最大停放时间" />
|
|
|
|
|
<!-- <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> 天 </span>
|
|
|
|
|
<el-input-number v-model="form.maxParkingHours" placeholder="请输入小时" :min="0" :max="23"
|
|
|
|
|
:controls="false" :style="{ width: '50px' }"/>
|
|
|
|
|
<span> 小时 </span>
|
|
|
|
|
<el-input-number v-model="form.maxParkingMinutes" placeholder="请输入分钟" :min="0" :max="59"
|
|
|
|
|
:controls="false" :style="{ width: '50px' }"/>
|
|
|
|
|
<span> 分钟 </span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="标准重量" prop="standardWeight">
|
|
|
|
|
<el-input v-model="form.standardWeight" placeholder="请输入标准重量" />
|
|
|
|
@ -811,6 +840,13 @@ const initFormData: BaseMaterialInfoForm = {
|
|
|
|
|
innerTubeFlag: undefined,
|
|
|
|
|
saleType: undefined,
|
|
|
|
|
remark: undefined,
|
|
|
|
|
minParkingDays:0,
|
|
|
|
|
minParkingHours:0,
|
|
|
|
|
minParkingMinutes:0,
|
|
|
|
|
maxParkingDays:0,
|
|
|
|
|
maxParkingHours:0,
|
|
|
|
|
maxParkingMinutes:0,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
const data = reactive<PageData<BaseMaterialInfoForm, BaseMaterialInfoQuery>>({
|
|
|
|
|
form: {...initFormData},
|
|
|
|
@ -955,6 +991,7 @@ const handleUpdate = async (row?: BaseMaterialInfoVO) => {
|
|
|
|
|
const _materialId = row?.materialId || ids.value[0]
|
|
|
|
|
const res = await getBaseMaterialInfo(_materialId);
|
|
|
|
|
Object.assign(form.value, res.data);
|
|
|
|
|
convertToTime();
|
|
|
|
|
dialog.visible = true;
|
|
|
|
|
dialog.title = "修改物料信息";
|
|
|
|
|
}
|
|
|
|
@ -964,6 +1001,7 @@ const submitForm = () => {
|
|
|
|
|
baseMaterialInfoFormRef.value?.validate(async (valid: boolean) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
buttonLoading.value = true;
|
|
|
|
|
convertToSeconds();
|
|
|
|
|
if (form.value.materialId) {
|
|
|
|
|
await updateBaseMaterialInfo(form.value).finally(() => buttonLoading.value = false);
|
|
|
|
|
} else {
|
|
|
|
@ -1016,6 +1054,7 @@ const getMaterialType = async () => {
|
|
|
|
|
materialTypeList.value = res.data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//左侧物料类型树
|
|
|
|
|
let InfoOptions = ref([]);
|
|
|
|
|
const getInfoOptions = async () => {
|
|
|
|
@ -1029,24 +1068,91 @@ const handleTreeNodeClick = async (data: any) => {
|
|
|
|
|
handleQuery();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 过滤节点函数
|
|
|
|
|
* 用于筛选或显示数据节点,基于提供的值和数据对象
|
|
|
|
|
*
|
|
|
|
|
* @param {string} value - 用户输入的过滤值如果为空,则显示所有节点
|
|
|
|
|
* @param {any} data - 当前数据节点对象,包含需要过滤的属性
|
|
|
|
|
* @returns {boolean} - 返回一个布尔值,决定节点是否应该显示
|
|
|
|
|
*/
|
|
|
|
|
const filterNode = (value: string, data: any) => {
|
|
|
|
|
// 当没有输入值时,显示所有节点
|
|
|
|
|
if (!value) return true;
|
|
|
|
|
// 检查数据节点的类型名称是否包含输入值,不区分大小写
|
|
|
|
|
return data.matrialTypeName.toLowerCase().includes(value.toLowerCase());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 树形组件过滤功能相关逻辑
|
|
|
|
|
*
|
|
|
|
|
* @var filterBoxName 用于绑定过滤关键词的响应式字符串,控制树节点过滤条件
|
|
|
|
|
* @var props 树形组件配置对象,包含字段映射配置:
|
|
|
|
|
* @property {string} children 子节点字段名(默认:'children')
|
|
|
|
|
* @property {string} label 节点显示文本字段名(默认:'matrialTypeName')
|
|
|
|
|
* @property {string} value 节点值字段名(默认:'matrialTypeId')
|
|
|
|
|
*/
|
|
|
|
|
const filterBoxName = ref('');
|
|
|
|
|
const props = reactive({
|
|
|
|
|
children: 'children',
|
|
|
|
|
label: 'matrialTypeName',
|
|
|
|
|
value: 'matrialTypeId'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 树形组件实例引用,用于调用组件方法
|
|
|
|
|
*/
|
|
|
|
|
const tree = ref();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 监听过滤关键词变化,实时执行树节点过滤
|
|
|
|
|
* @param newVal 新的过滤关键词,将传递给树组件的filter方法
|
|
|
|
|
*/
|
|
|
|
|
watch(filterBoxName, (newVal) => {
|
|
|
|
|
if (tree.value) {
|
|
|
|
|
tree.value.filter(newVal);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 天小时分钟转换为秒 */
|
|
|
|
|
const convertToSeconds = () => {
|
|
|
|
|
const maxDaysInSeconds = form.value.maxParkingDays * 24 * 60 * 60;
|
|
|
|
|
const maxHoursInSeconds = form.value.maxParkingHours * 60 * 60;
|
|
|
|
|
const maxMinutesInSeconds = form.value.maxParkingMinutes * 60;
|
|
|
|
|
form.value.maxParkingTime = maxDaysInSeconds + maxHoursInSeconds + maxMinutesInSeconds;
|
|
|
|
|
|
|
|
|
|
const minDaysInSeconds = form.value.minParkingDays * 24 * 60 * 60;
|
|
|
|
|
const minHoursInSeconds = form.value.minParkingHours * 60 * 60;
|
|
|
|
|
const minMinutesInSeconds = form.value.minParkingMinutes * 60;
|
|
|
|
|
form.value.minParkingTime = minDaysInSeconds + minHoursInSeconds + minMinutesInSeconds;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 秒转换为天小时分钟 */
|
|
|
|
|
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);
|
|
|
|
|
// 更新到表单中
|
|
|
|
|
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);
|
|
|
|
|
form.value.minParkingDays = minDays;
|
|
|
|
|
form.value.minParkingHours = minHours;
|
|
|
|
|
form.value.minParkingMinutes = minMinutes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getInfoOptions();
|
|
|
|
|
getList();
|
|
|
|
|