Commit 908addbd authored by 刘威龙's avatar 刘威龙

派车节点司机不能手工输入问题处理、下拉框默认值添加、时间框清空按钮添加

parent 7885e008
......@@ -14,7 +14,7 @@
<u-form-item prop="truck_id" required label="车牌号" labelWidth="25%" borderBottom>
<view @click="showProcess">
<u-input border="none" readonly placeholder="请选择车牌号" :value="viewEnums[formData.truck_id]" />
<u-input border="none" placeholder="请选择车牌号" :value="viewEnums[formData.truck_id]" />
</view>
</u-form-item>
......@@ -29,8 +29,21 @@
<u-form-item prop="early_pickup_date" required label="预计提货时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('early_pickup_date')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择提货时间"
:value="convertTime(formData.early_pickup_date)" />
<u-input
:disabledColor="'#ffffff'"
disabled
border="none"
readonly
placeholder="请选择提货时间"
:value="convertTime(formData.early_pickup_date)"
>
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.early_pickup_date" @click.stop="clearDate('early_pickup_date')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
......@@ -138,10 +151,14 @@
//弹出车辆
showProcess() {
this.visible = true
this.pageNum = 1
this.onAreaSuccess()
},
//弹出司机
showProcess1() {
this.visible1 = true
this.pageNum = 1
this.onAreaSuccess1()
},
// 时间选择
onSelsectDate(dateInfo) {
......@@ -330,7 +347,7 @@
const nowDate = new Date(timestamp)
var year = nowDate.getFullYear();
var month = nowDate.getMonth() < 10 ? '0' + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
var date = nowDate.getDate();
var date = nowDate.getDate()< 10 ? '0' + (nowDate.getDate()) : nowDate.getDate();
return `${year}-${ month}-${date} 00:00:00`
},
......@@ -344,6 +361,10 @@
this.formData[key] = value
}
},
clearDate(key) {
this.formData[key] = ''; // 清空对应字段
this.$refs.myForm.clearValidate(key); // 清除表单验证状态(如果有)
},
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment