|
|
@ -1,7 +1,23 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="SupplierApbalanceMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search ref="searchRef" :schema="SupplierApbalanceMain.allSchemas.searchSchema" @search="searchClick" @reset="resetClick" > |
|
|
|
<template #year> |
|
|
|
<el-select v-model="year" placeholder="请选择年" @change="(value)=>selectChange(value,'year')"> |
|
|
|
<el-option v-for="dict in yearList" :key="dict.value" :label="dict.label" :value="dict.value"/> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
<template #month> |
|
|
|
<el-select v-model="month" placeholder="请选择月" @change="(value)=>selectChange(value,'month')"> |
|
|
|
<el-option v-for="dict in monthList" :key="dict.value" :label="dict.label" :value="dict.value"/> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
<template #day> |
|
|
|
<el-select v-model="day" placeholder="请选择日" @change="(value)=>selectChange(value,'day')"> |
|
|
|
<el-option v-for="dict in dayList" :key="dict.value" :label="dict.label" :value="dict.value"/> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</Search> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
@ -92,6 +108,7 @@ import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
import * as BasicSpotCheckOptionApi from "@/api/eam/basicSpotCheckOption"; |
|
|
|
import TableFormAdjustment from '@/components/TableFormAdjustment/src/TableFormAdjustment.vue' |
|
|
|
import AdjustmentDialog from '@/components/TableFormAdjustment/src/AdjustmentDialog.vue' |
|
|
|
import dayjs from 'dayjs' |
|
|
|
|
|
|
|
import {getJmreportBaseUrl} from "@/utils/systemParam"; |
|
|
|
import {getAccessToken} from "@/utils/auth"; |
|
|
@ -296,8 +313,91 @@ const searchFormClick = (searchData) => { |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
|
|
|
|
const year = ref('') |
|
|
|
const month = ref('') |
|
|
|
const day = ref('') |
|
|
|
// 年份 |
|
|
|
const yearList = ref([]) |
|
|
|
const getDefaultYear = ()=>{ |
|
|
|
yearList.value = [] |
|
|
|
let current = new Date().getFullYear() |
|
|
|
for(let i=-10;i<=10;i++){ |
|
|
|
yearList.value.push({ |
|
|
|
label:current+i, |
|
|
|
value:current+i |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
// 月份 |
|
|
|
const daysInMonths = ref([]) |
|
|
|
const monthList = ref([]) |
|
|
|
const getMonthDay = async ()=>{ |
|
|
|
getDefaultYear() |
|
|
|
monthList.value = [] |
|
|
|
let res = await SupplierApbalanceMainApi.getMonthDay() |
|
|
|
console.log('获取年月日',res) |
|
|
|
if(res){ |
|
|
|
daysInMonths.value = res |
|
|
|
res.forEach(item => { |
|
|
|
monthList.value.push({ |
|
|
|
label:item['beginMonth'], |
|
|
|
value:item['beginMonth'], |
|
|
|
}) |
|
|
|
}); |
|
|
|
console.log('monthList',monthList.value) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const searchRef = ref() |
|
|
|
// 日期 |
|
|
|
const dayList = ref([]) |
|
|
|
const selectChange = (value,field)=>{ |
|
|
|
searchRef.value.setFormValues({ |
|
|
|
[field]:value, |
|
|
|
}) |
|
|
|
if(field=='month'){ |
|
|
|
//重置日期 |
|
|
|
dayList.value = [] |
|
|
|
//更新日期数组 |
|
|
|
let dayObj = daysInMonths.value.find(item=>item['beginMonth']==month.value) |
|
|
|
if(dayObj){ |
|
|
|
for(let i= Number(dayObj['beginDay']);i<=Number(dayObj['endDay']);i++){ |
|
|
|
dayList.value.push({ |
|
|
|
label:i, |
|
|
|
value:i |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
if(dayList.value.length>0){ |
|
|
|
day.value = dayList.value[0]['value'] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const resetClick = async (data)=>{ |
|
|
|
year.value = '' |
|
|
|
month.value = '' |
|
|
|
day.value = '' |
|
|
|
searchClick(data) |
|
|
|
} |
|
|
|
|
|
|
|
const searchClick = async (data)=>{ |
|
|
|
if((data['year']||data['month']||data['day'])&&(!data['year']||!data['month']||!data['day'])){ |
|
|
|
message.error('请选择年月日') |
|
|
|
return |
|
|
|
} |
|
|
|
if(data['month'].length==1){ |
|
|
|
data['month'] = '0'+data['month'] |
|
|
|
} |
|
|
|
if((''+data['day']).length==1){ |
|
|
|
data['day'] = '0' + data['day'] |
|
|
|
} |
|
|
|
data['searchTime'] = `${data['year']}-${data['month']}-${data['day']}` |
|
|
|
setSearchParams(data) |
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getMonthDay() |
|
|
|
getList() |
|
|
|
importTemplateData.templateUrl = await SupplierApbalanceMainApi.importTemplate() |
|
|
|
}) |
|
|
|