<el-form-item label="记录日期" label-width="160">
<div class="block">
<el-date-picker
v-model="payTime"
type="datetimerange"
:picker-options="pickerOptions"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
/>
</div>
</el-form-item>
data() {
return {
list: [],
sum: 0,
payTime: [], // 收入日期
data: {
curPage: 1,
limit: 20,
payTime1:null , // 收入日期1
payTime2: null // 收入日期2
},
//方法内部写入需要传递的两个时间段参数
this.data.payTime1 = this.payTime[0]
this.data.payTime2 = this.payTime[1]
sql:
<if test="for_time!= null and time2!=null">
and for_time BETWEEN #{for_time} and #{time2}
</if>
积少成多,
积沙成塔.