|
|
|
@ -3,17 +3,34 @@
|
|
|
|
|
<Spin v-if="saving" fix>加载中...</Spin>
|
|
|
|
|
<Form ref="formValidate" :model="formValidate" :label-width="80">
|
|
|
|
|
<Row :gutter="10">
|
|
|
|
|
<i-col span="6">
|
|
|
|
|
<FormItem label="选择日期" prop>
|
|
|
|
|
<i-col span="4">
|
|
|
|
|
<FormItem label="开始日期" prop>
|
|
|
|
|
<Date-picker
|
|
|
|
|
v-model="formValidate.date"
|
|
|
|
|
type="daterange"
|
|
|
|
|
v-model="formValidate.startDate"
|
|
|
|
|
:options='startDateOptions'
|
|
|
|
|
type="date"
|
|
|
|
|
placement="bottom-end"
|
|
|
|
|
placeholder="选择日期区间"
|
|
|
|
|
format="yyyy-MM-dd"
|
|
|
|
|
@on-change="startDateChange"
|
|
|
|
|
></Date-picker>
|
|
|
|
|
</FormItem>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="6">
|
|
|
|
|
|
|
|
|
|
<i-col span="4">
|
|
|
|
|
<FormItem label="结束日期" prop>
|
|
|
|
|
<Date-picker
|
|
|
|
|
v-model="formValidate.endDate"
|
|
|
|
|
:options='endDateOptions'
|
|
|
|
|
type="date"
|
|
|
|
|
placement="bottom-end"
|
|
|
|
|
placeholder="选择结束日期"
|
|
|
|
|
format="yyyy-MM-dd"
|
|
|
|
|
@on-change="endDateChange"
|
|
|
|
|
></Date-picker>
|
|
|
|
|
</FormItem>
|
|
|
|
|
</i-col>
|
|
|
|
|
<i-col span="4">
|
|
|
|
|
<FormItem label="零售公司" prop>
|
|
|
|
|
<Select
|
|
|
|
|
v-model="formValidate.organizationId"
|
|
|
|
@ -123,8 +140,12 @@ export default {
|
|
|
|
|
date: null,
|
|
|
|
|
organizationId: null,
|
|
|
|
|
storeId: null,
|
|
|
|
|
status: 2
|
|
|
|
|
status: 2,
|
|
|
|
|
startDate:null,
|
|
|
|
|
endDate:null,
|
|
|
|
|
},
|
|
|
|
|
startDateOptions:{},
|
|
|
|
|
endDateOptions:{},
|
|
|
|
|
activityData: [
|
|
|
|
|
{
|
|
|
|
|
activityStatus: "进行中"
|
|
|
|
@ -391,21 +412,17 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
searchTable(params = {}) {
|
|
|
|
|
debugger
|
|
|
|
|
this.loading = true;
|
|
|
|
|
if (
|
|
|
|
|
this.formValidate.date !== null &&
|
|
|
|
|
this.formValidate.date.length > 0
|
|
|
|
|
) {
|
|
|
|
|
if (this.formValidate.date[0] !== "") {
|
|
|
|
|
this.formValidate.startDate = formatDate(this.formValidate.date[0]);
|
|
|
|
|
} else {
|
|
|
|
|
this.formValidate.startDate = undefined;
|
|
|
|
|
}
|
|
|
|
|
if (this.formValidate.date[1] !== "") {
|
|
|
|
|
this.formValidate.endDate = formatDate(this.formValidate.date[1]);
|
|
|
|
|
} else {
|
|
|
|
|
this.formValidate.endDate = undefined;
|
|
|
|
|
}
|
|
|
|
|
if (this.formValidate.startDate !== "") {
|
|
|
|
|
this.formValidate.startDate = formatDate(this.formValidate.startDate);
|
|
|
|
|
} else {
|
|
|
|
|
this.formValidate.startDate = undefined;
|
|
|
|
|
}
|
|
|
|
|
if (!!this.formValidate.endDate) {
|
|
|
|
|
this.formValidate.endDate = formatDate(this.formValidate.endDate);
|
|
|
|
|
} else {
|
|
|
|
|
this.formValidate.endDate = undefined;
|
|
|
|
|
}
|
|
|
|
|
params.pageNum = this.pageNum;
|
|
|
|
|
params.pageSize = this.pageSize;
|
|
|
|
@ -421,7 +438,25 @@ export default {
|
|
|
|
|
this.totalSize = data.total || 0;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
startDateChange:function(e){
|
|
|
|
|
//设置开始时间
|
|
|
|
|
this.endDateOptions = {
|
|
|
|
|
disabledDate:date =>{
|
|
|
|
|
let startTime = this.formValidate.startDate ? new Date(this.formValidate.startDate).valueOf() : '';
|
|
|
|
|
return date && (date.valueOf() < startTime)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
endDateChange:function(e){
|
|
|
|
|
//设置结束时间
|
|
|
|
|
let endTime = this.formValidate.endDate ? new Date( this.formValidate.endDate ).valueOf()-1*24*60*60*1000 :'';
|
|
|
|
|
this.startDateOptions = {
|
|
|
|
|
disabledDate:date =>{
|
|
|
|
|
return date && (date.valueOf() >endTime);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|