mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-09 11:06:43 +08:00
自动计算健康险续保选择月份的第一天和最后一天的日期
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<div class="sale-list-container pb50">
|
||||
<!-- <van-search placeholder="请选择客户经理姓名" v-model="searchName" show-action @change="searchList" @keyup.enter="searchList">-->
|
||||
<!-- <template #action>-->
|
||||
<!-- <div style="display: flex;">-->
|
||||
<!-- <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>
|
||||
<van-search placeholder="请选择客户经理姓名" v-model="searchName" show-action @change="searchList" @keyup.enter="searchList">
|
||||
<template #action>
|
||||
<div style="display: flex;">
|
||||
<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>-->
|
||||
<van-sticky>
|
||||
<van-tabs :line-width="45" v-model="active" @change="tabChange" sticky>
|
||||
<van-tab name="0" title="未续保"></van-tab>
|
||||
@@ -82,7 +82,9 @@ export default {
|
||||
showDataPicker:false,
|
||||
minDate: new Date(2000, 0),
|
||||
maxDate: new Date(2100, 12),
|
||||
currentDate: new Date()
|
||||
cvaliStartDate: '',
|
||||
currentDate: '',
|
||||
cvaliEndDate: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -164,14 +166,23 @@ export default {
|
||||
},
|
||||
//日期选择
|
||||
onConfirmDate(value){
|
||||
let aaa = new Date(value)
|
||||
let thisYear = aaa.getFullYear()
|
||||
let thisMonth = aaa.getMonth()+1
|
||||
let thisDate = new Date(value)
|
||||
let thisYear = thisDate.getFullYear()
|
||||
let thisMonth = thisDate.getMonth()+1
|
||||
if(thisMonth < 10){
|
||||
thisMonth = '0'+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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user