Commit b2f971f9 authored by 刘威龙's avatar 刘威龙

所有页面的时间消除功能和时间格式转化的问题调整

parent 0bd2077b
......@@ -28,7 +28,14 @@
<u-form-item prop="occur_time" label="发生时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('occur_time')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择发生时间"
:value="convertTime(formData.occur_time)" />
:value="convertTime(formData.occur_time)" >
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.occur_time" @click.stop="clearDate('occur_time')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
<u-form-item prop="abnormal_reason" label="异常原因" labelWidth="25%" borderBottom>
......@@ -215,7 +222,11 @@
})
},
//一级异常
showProcess() {this.visible = true },
showProcess() {
this.visible = true
this.pageNum = 1
this.onLevelAbnormal()
},
//一级异常关闭弹出框
closeProcess() {
this.visible = false
......@@ -380,6 +391,10 @@
}
this.showPopup = !this.showPopup
},
clearDate(key) {
this.formData[key] = ''; // 清空对应字段
this.$refs.myForm.clearValidate(key); // 清除表单验证状态(如果有)
},
}
}
</script>
......
......@@ -264,7 +264,9 @@
},
methods: {
showProcess() {
this.visible = true
this.visible = true
this.pageNum = 1
this.onAreaSuccess()
},
// 时间选择
onSelsectDate(dateInfo) {
......
......@@ -43,55 +43,118 @@
<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)" />
: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>
<u-form-item prop="epo" required label="预计开港时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('epo')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择开港时间"
:value="convertTime(formData.epo)" />
:value="convertTime(formData.epo)" >
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.epo" @click.stop="clearDate('epo')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
<u-form-item prop="epc" required label="预计截港时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('epc')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择截港时间"
:value="convertTime(formData.epc)" />
:value="convertTime(formData.epc)" >
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.epc" @click.stop="clearDate('epc')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
<u-form-item prop="etd" required label="预计开船时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('etd')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择开船时间"
:value="convertTime(formData.etd)" />
:value="convertTime(formData.etd)" >
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.etd" @click.stop="clearDate('etd')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
<u-form-item prop="eta" required label="预计到港时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('eta')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择到港时间"
:value="convertTime(formData.eta)" />
:value="convertTime(formData.eta)" >
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.eta" @click.stop="clearDate('eta')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
<u-form-item prop="actual_sail_time" required label="实际开船时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('actual_sail_time')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择实际开船时间"
:value="convertTime(formData.actual_sail_time)" />
:value="convertTime(formData.actual_sail_time)" >
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.actual_sail_time" @click.stop="clearDate('actual_sail_time')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
<u-form-item prop="f_etd" required label="驳船预计开船时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('f_etd')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择驳船开船时间"
:value="convertTime(formData.f_etd)" />
:value="convertTime(formData.f_etd)" >
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.f_etd" @click.stop="clearDate('f_etd')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
<u-form-item prop="f_eta" required label="驳船预计到港时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('f_eta')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择驳船到港时间"
:value="convertTime(formData.f_eta)" />
:value="convertTime(formData.f_eta)" >
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.f_eta" @click.stop="clearDate('f_eta')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
<u-form-item prop="f_atd" required label="驳船实际开船时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('f_atd')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择驳船实际开船时间"
:value="convertTime(formData.f_atd)" />
:value="convertTime(formData.f_atd)">
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.f_atd" @click.stop="clearDate('f_atd')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
......@@ -386,6 +449,10 @@
this.formData[key] = value
}
},
clearDate(key) {
this.formData[key] = ''; // 清空对应字段
this.$refs.myForm.clearValidate(key); // 清除表单验证状态(如果有)
},
}
}
</script>
......
......@@ -18,7 +18,14 @@
<u-form-item prop="on_board_time" required label="On board日期" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('on_board_time')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择On board日期"
:value="convertTime(formData.on_board_time)" />
:value="convertTime(formData.on_board_time)" >
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.on_board_time" @click.stop="clearDate('on_board_time')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
</view>
......@@ -230,6 +237,10 @@
this.formData[key] = value
}
},
clearDate(key) {
this.formData[key] = ''; // 清空对应字段
this.$refs.myForm.clearValidate(key); // 清除表单验证状态(如果有)
},
}
}
</script>
......
......@@ -56,7 +56,14 @@
<u-form-item prop="time" label="签收时间" labelWidth="35%" :required="disableSignQ()" borderBottom>
<view @click="onVisibleDate('time')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择签收时间"
:value="convertTime(formData.time)" />
:value="convertTime(formData.time)" >
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.time" @click.stop="clearDate('time')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
<u-form-item prop="sign_status" required label="签收状态" labelWidth="35%" borderBottom>
......@@ -302,10 +309,14 @@
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`
},
clearDate(key) {
this.formData[key] = ''; // 清空对应字段
this.$refs.myForm.clearValidate(key); // 清除表单验证状态(如果有)
},
}
}
</script>
......
......@@ -117,7 +117,14 @@
<u-form-item prop="time" required label="签收时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('time')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择签收时间"
:value="convertTime(formData.time)" />
:value="convertTime(formData.time)" >
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.time" @click.stop="clearDate('time')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
<u-form-item prop="sign_status" required label="签收状态" labelWidth="35%" borderBottom>
......@@ -393,10 +400,14 @@
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`
},
clearDate(key) {
this.formData[key] = ''; // 清空对应字段
this.$refs.myForm.clearValidate(key); // 清除表单验证状态(如果有)
},
}
}
</script>
......
......@@ -27,7 +27,14 @@
<u-form-item prop="empty_container_finish_time" label="提箱时间" labelWidth="35%" borderBottom>
<view @click="onVisibleDate('empty_container_finish_time')">
<u-input :disabledColor="'#ffffff'" disabled border="none" readonly placeholder="请选择提箱时间"
:value="convertTime(formData.empty_container_finish_time)" />
:value="convertTime(formData.empty_container_finish_time)" >
<!-- 使用 suffix 插槽添加清除图标 -->
<template #suffix>
<view v-if="formData.empty_container_finish_time" @click.stop="clearDate('empty_container_finish_time')">
<u-icon name="close-circle-fill" size="24" color="#909399" />
</view>
</template>
</u-input>
</view>
</u-form-item>
......@@ -156,7 +163,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`
},
......@@ -170,6 +177,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