mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-11 23:46:44 +08:00
自动计算健康险续保选择月份的第一天和最后一天的日期
This commit is contained in:
@@ -1,16 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="sale-list-container pb50">
|
<div class="sale-list-container pb50">
|
||||||
<!-- <van-search placeholder="请选择客户经理姓名" v-model="searchName" show-action @change="searchList" @keyup.enter="searchList">-->
|
<van-search placeholder="请选择客户经理姓名" v-model="searchName" show-action @change="searchList" @keyup.enter="searchList">
|
||||||
<!-- <template #action>-->
|
<template #action>
|
||||||
<!-- <div style="display: flex;">-->
|
<div style="display: flex;">
|
||||||
<!-- <div @click="searchList" style="padding: 0px 10px;border: 1px solid #eee;border-radius: 5px;">搜索</div>-->
|
<div @click="searchList" style="padding: 0px 10px;border: 1px solid #eee;border-radius: 5px;">搜索</div>
|
||||||
<!-- <div style="padding: 0px 10px;border: 1px solid #eee;border-radius: 5px;margin-left: 15px;" @click="openshowDataPicker">日期</div>-->
|
|
||||||
<!-- </div>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </van-search>-->
|
|
||||||
<div style="display: flex;line-height: 36px;background:#fff;padding: 10px;">
|
|
||||||
<div style="padding: 0px 10px;border: 1px solid #eee;border-radius: 5px;margin-left: 15px;" @click="openshowDataPicker">日期</div>
|
<div style="padding: 0px 10px;border: 1px solid #eee;border-radius: 5px;margin-left: 15px;" @click="openshowDataPicker">日期</div>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
</van-search>
|
||||||
|
<!-- <div style="display: flex;line-height: 36px;background:#fff;padding: 10px;">-->
|
||||||
|
<!-- <div style="padding: 0px 10px;border: 1px solid #eee;border-radius: 5px;margin-left: 15px;" @click="openshowDataPicker">日期</div>-->
|
||||||
|
<!-- </div>-->
|
||||||
<van-sticky>
|
<van-sticky>
|
||||||
<van-tabs :line-width="45" v-model="active" @change="tabChange" sticky>
|
<van-tabs :line-width="45" v-model="active" @change="tabChange" sticky>
|
||||||
<van-tab name="0" title="未续保"></van-tab>
|
<van-tab name="0" title="未续保"></van-tab>
|
||||||
@@ -82,7 +82,9 @@ export default {
|
|||||||
showDataPicker:false,
|
showDataPicker:false,
|
||||||
minDate: new Date(2000, 0),
|
minDate: new Date(2000, 0),
|
||||||
maxDate: new Date(2100, 12),
|
maxDate: new Date(2100, 12),
|
||||||
currentDate: new Date()
|
cvaliStartDate: '',
|
||||||
|
currentDate: '',
|
||||||
|
cvaliEndDate: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -164,14 +166,23 @@ export default {
|
|||||||
},
|
},
|
||||||
//日期选择
|
//日期选择
|
||||||
onConfirmDate(value){
|
onConfirmDate(value){
|
||||||
let aaa = new Date(value)
|
let thisDate = new Date(value)
|
||||||
let thisYear = aaa.getFullYear()
|
let thisYear = thisDate.getFullYear()
|
||||||
let thisMonth = aaa.getMonth()+1
|
let thisMonth = thisDate.getMonth()+1
|
||||||
if(thisMonth < 10){
|
if(thisMonth < 10){
|
||||||
thisMonth = '0'+thisMonth
|
thisMonth = '0'+thisMonth
|
||||||
}
|
}
|
||||||
this.currentDate = thisYear + '-' + thisMonth
|
this.currentDate = thisYear + '-' + thisMonth
|
||||||
console.log(this.currentDate)
|
|
||||||
|
let date = new Date(this.currentDate);
|
||||||
|
date.setDate(1);
|
||||||
|
let firstDay1 = date.toLocaleDateString();
|
||||||
|
this.cvaliStartDate = firstDay1.replaceAll('/','-')
|
||||||
|
|
||||||
|
date.setMonth(date.getMonth() + 1);
|
||||||
|
date.setDate(0);
|
||||||
|
let lastDay1 = date.toLocaleDateString();
|
||||||
|
this.cvaliEndDate = lastDay1.replaceAll('/','-')
|
||||||
this.showDataPicker = false
|
this.showDataPicker = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user