|
@@ -3,8 +3,11 @@ import {useRouter} from 'vue-router'
|
|
|
import {getIandPList} from '@/api/financialMana'
|
|
|
import { downloadByFlow } from '@/utils/common-methods'
|
|
|
export default function getIandPListCom(type) {
|
|
|
+ const moment = inject('$moment')
|
|
|
const router = useRouter()
|
|
|
|
|
|
+ const dateButtonData=[{text:'本月',tabId:1},{text:'上月',tabId:2},{text:'前月',tabId:3}]
|
|
|
+
|
|
|
const placement=reactive({
|
|
|
searchParams:{
|
|
|
current:1,
|
|
@@ -21,7 +24,8 @@ export default function getIandPListCom(type) {
|
|
|
tableData:[],
|
|
|
total:0,
|
|
|
amountTotal:0,
|
|
|
- countryAmountList:[]
|
|
|
+ countryAmountList:[],
|
|
|
+ currentDateTab:0
|
|
|
})
|
|
|
|
|
|
|
|
@@ -94,6 +98,19 @@ export default function getIandPListCom(type) {
|
|
|
ElMessage.warning('开始金额不能大于结束金额')
|
|
|
}
|
|
|
}
|
|
|
+ // 切换日期 本月、上月、前月
|
|
|
+ const changeDateType=(tabId)=>{
|
|
|
+ if(placement.currentDateTab==tabId) return
|
|
|
+ placement.currentDateTab=tabId
|
|
|
+ if(tabId==1){
|
|
|
+ // 本月指 本月初 至 今天
|
|
|
+ placement.dateRange=[moment().subtract((tabId-1), 'months').startOf('month').format('YYYY-MM-DD'),
|
|
|
+ moment(new Date()).format('YYYY-MM-DD')]
|
|
|
+ }else{
|
|
|
+ placement.dateRange=[moment().subtract((tabId-1), 'months').startOf('month').format('YYYY-MM-DD'),
|
|
|
+ moment().subtract((tabId-1), 'months').endOf('month').format('YYYY-MM-DD')]
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 切换每页的数量
|
|
|
const changePageSize=(pageSize)=>{
|
|
@@ -114,8 +131,10 @@ export default function getIandPListCom(type) {
|
|
|
downloadByFlow(res,'xlxs',fileName)
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
return {
|
|
|
data:placement,
|
|
|
+ dateButtonData,
|
|
|
placementList,
|
|
|
searchPlacement,
|
|
|
moneyChange,
|
|
@@ -123,6 +142,7 @@ export default function getIandPListCom(type) {
|
|
|
placementDetail,
|
|
|
changePageNo,
|
|
|
changePageSize,
|
|
|
- checkMoney
|
|
|
+ checkMoney,
|
|
|
+ changeDateType
|
|
|
}
|
|
|
}
|