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

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

parent 7885e008
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<u-form-item prop="truck_id" required label="车牌号" labelWidth="25%" borderBottom> <u-form-item prop="truck_id" required label="车牌号" labelWidth="25%" borderBottom>
<view @click="showProcess"> <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> </view>
</u-form-item> </u-form-item>
...@@ -29,8 +29,21 @@ ...@@ -29,8 +29,21 @@
<u-form-item prop="early_pickup_date" required label="预计提货时间" labelWidth="35%" borderBottom> <u-form-item prop="early_pickup_date" required label="预计提货时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('early_pickup_date')"> <view @click="onVisibleDate('early_pickup_date')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择提货时间" <u-input
:value="convertTime(formData.early_pickup_date)" /> :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> </view>
</u-form-item> </u-form-item>
...@@ -137,11 +150,15 @@ ...@@ -137,11 +150,15 @@
methods: { methods: {
//弹出车辆 //弹出车辆
showProcess() { showProcess() {
this.visible = true this.visible = true
this.pageNum = 1
this.onAreaSuccess()
}, },
//弹出司机 //弹出司机
showProcess1() { showProcess1() {
this.visible1 = true this.visible1 = true
this.pageNum = 1
this.onAreaSuccess1()
}, },
// 时间选择 // 时间选择
onSelsectDate(dateInfo) { onSelsectDate(dateInfo) {
...@@ -330,7 +347,7 @@ ...@@ -330,7 +347,7 @@
const nowDate = new Date(timestamp) const nowDate = new Date(timestamp)
var year = nowDate.getFullYear(); var year = nowDate.getFullYear();
var month = nowDate.getMonth() < 10 ? '0' + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1; 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` return `${year}-${ month}-${date} 00:00:00`
}, },
...@@ -344,6 +361,10 @@ ...@@ -344,6 +361,10 @@
this.formData[key] = value this.formData[key] = value
} }
}, },
clearDate(key) {
this.formData[key] = ''; // 清空对应字段
this.$refs.myForm.clearValidate(key); // 清除表单验证状态(如果有)
},
} }
} }
</script> </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