mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 01:04:20 +09:00
로그인 및 메인 화면 수정 변경
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
<div class="info">
|
||||
<div class="count">집계결과</div>
|
||||
<div class="button_group">
|
||||
<button type="button" class="button blue download">엑셀 다운로드</button>
|
||||
<button type="button" class="button blue download" @click="monthExcelDown();">엑셀 다운로드</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -119,7 +119,7 @@ export default {
|
||||
list:[],
|
||||
totalCnt: '',
|
||||
|
||||
pageType: 'SUBS',
|
||||
pageType: 'BSNM_MONTH',
|
||||
|
||||
// 테이블 리스트 데이터
|
||||
perPageCnt: 50,
|
||||
@@ -248,10 +248,13 @@ export default {
|
||||
},
|
||||
created(){
|
||||
this.setPeriodDay(0);
|
||||
this.getExcelHeader();
|
||||
|
||||
},
|
||||
destroyed() {
|
||||
|
||||
this.grid.params.custNm='';
|
||||
this.grid.params.bizrno='';
|
||||
|
||||
},
|
||||
mounted() {
|
||||
let page = 1;
|
||||
@@ -310,9 +313,10 @@ export default {
|
||||
setPeriodDay(day) {
|
||||
this.periodDay = day;
|
||||
this.endDate = new Date();
|
||||
this.startDate = moment(this.endDate)
|
||||
.subtract(day, 'day')
|
||||
.toDate();
|
||||
// this.startDate = moment(this.endDate)
|
||||
// .subtract(day, 'day')
|
||||
// .toDate();
|
||||
this.initSetStartDate();
|
||||
|
||||
this.closeDate('start');
|
||||
this.closeDate('end');
|
||||
@@ -368,6 +372,54 @@ export default {
|
||||
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
|
||||
console.log("getCondition : "+ getCondition.perPage);
|
||||
},
|
||||
initSetStartDate(){
|
||||
let initStartDate = new Date();
|
||||
initStartDate.setMonth(Number(moment(initStartDate).format('MM')) -3);
|
||||
this.startDate = initStartDate;
|
||||
console.log(moment(this.startDate).format('YYYY-MM-DD'));
|
||||
},
|
||||
getExcelHeader() {
|
||||
// 헤더를 mockup으로 관리한다.
|
||||
custMgtApi.getExcelHeader(this.pageType).then(res => {
|
||||
this.excelHeader = res;
|
||||
});
|
||||
},
|
||||
async getExcelDataDown() {
|
||||
try {
|
||||
let response;
|
||||
|
||||
response = await statsApi.bsnmMonthListExcel(this.grid.params);
|
||||
|
||||
const result = response.data;
|
||||
console.log(result)
|
||||
if (result != null && result.retCode == "0000") {
|
||||
return result.data;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
}, // end of getExcelDataDown
|
||||
async monthExcelDown() {
|
||||
if (this.$refs.table.getData().length <= 0) {
|
||||
this.row.title = '사업자별 월별통계';
|
||||
this.row.msg1 = '조회된 데이터가 없습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
let today = moment().format('YYYYMMDDHHmmss');
|
||||
const saveFileName = `사업자별 월별통계_${today}.xlsx`;
|
||||
|
||||
const data = await this.getExcelDataDown();
|
||||
let options = {
|
||||
header: this.excelHeader,
|
||||
dataOrder: 'header'
|
||||
};
|
||||
console.log(data);
|
||||
xlsx.export(data.list, saveFileName, options).then(() => {});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user