|
@@ -8,7 +8,8 @@ import {downloadByFlow} from '@/utils/common-methods'
|
|
|
|
|
|
const moment = inject('$moment')
|
|
|
const timeTypeData=[{label:'开票日期',value:1},{label:'到款日期',value:2},{label:'开票日期&到款日期',value:3}]
|
|
|
- const dateButtonData=[{text:'近1月',tabId:1},{text:'近2月',tabId:2},{text:'近3月',tabId:3}]
|
|
|
+ const dateButtonData=[{text:'近1周',tabId:1,type:'week',diff:1},{text:'近1月',tabId:2,type:'month',diff:1},
|
|
|
+ {text:'近2月',tabId:3,type:'month',diff:2},{text:'近3月',tabId:4,type:'month',diff:3}]
|
|
|
|
|
|
// const groupList=ref([])
|
|
|
|
|
@@ -105,11 +106,15 @@ const moment = inject('$moment')
|
|
|
}
|
|
|
|
|
|
// 切换日期 近1月、近2月、近3月 从今天开始往后推
|
|
|
- const changeDateType=(tabId)=>{
|
|
|
+ const changeDateType=({tabId,type,diff})=>{
|
|
|
if(currentDateTab.value==tabId) return
|
|
|
currentDateTab.value=tabId
|
|
|
- searchDate.value=[moment(new Date()).subtract(tabId, 'months').format('YYYY-MM-DD'),
|
|
|
- moment(new Date()).format('YYYY-MM-DD')]
|
|
|
+ let startOfType='month'
|
|
|
+ if(type=='week'){
|
|
|
+ startOfType='isoWeek'
|
|
|
+ }
|
|
|
+ searchDate.value=[moment().startOf(startOfType).subtract((diff-1), type+'s').format('YYYY-MM-DD'),
|
|
|
+ moment().format('YYYY-MM-DD')]
|
|
|
}
|
|
|
|
|
|
// 切换每页的数量
|
|
@@ -309,7 +314,7 @@ const moment = inject('$moment')
|
|
|
<el-button size="large" v-for="(item,index) in dateButtonData" :key="item.tabId"
|
|
|
class="date-button"
|
|
|
:class="[index==0?'first-button':index==(dateButtonData.length-1)?'last-button':'inner-button',currentDateTab==item.tabId?'selectTab':'']"
|
|
|
- @click="changeDateType(item.tabId)">{{ item.text }}</el-button>
|
|
|
+ @click="changeDateType(item)">{{ item.text }}</el-button>
|
|
|
</div>
|
|
|
<el-select v-model="searchParams.time_type" placeholder="请选择日期类型" @change="searchCommodityP"
|
|
|
style="width: 200px;" clearable>
|