리스크관리 / 발송통계 추가

This commit is contained in:
kimre
2022-06-29 17:52:26 +09:00
parent 056ccf20e1
commit 0a2e30b1c2
32 changed files with 2864 additions and 992 deletions

View File

@@ -1,234 +1,285 @@
<template>
<div class="contents">
<div class="contents_wrap">
<div class="top_wrap">
<h3 class="title">날짜별 통계</h3>
<p class="breadcrumb">발송통계 &gt; 날짜별 통계</p>
</div>
<div class="top_tab">
<a href="javascript:void(0);" class="on">월별통계</a>
<a href="javascript:void(0);" @click="toMove('dayList')" >일별통계</a>
</div>
<form autocomplete="off" class="search_form">
<div class="search_wrap">
<div class="input_box cal">
<label for="right" class="label txt">날짜</label>
<p> 최대 3개월까지 조회 가능합니다.</p>
<div class="term">
<div class="group" style="width:500px;">
<span class="custom_input icon_date">
<vuejs-datepicker
:language="ko"
:format="customFormatter"
:disabled-dates="disabledSDate"
:minimumView="sDateDiv"
:maximumView="sDateDiv"
v-model="startDate"
@selected="selectedStartDate(0)"
@closed="closeDate('start')"
></vuejs-datepicker>
</span>~
<span class="custom_input icon_date">
<vuejs-datepicker
:language="ko"
:format="customFormatter"
:disabled-dates="disabledEDate"
:minimumView="sDateDiv"
:maximumView="sDateDiv"
v-model="endDate"
@selected="selectedEndDate(0)"
@closed="closeDate('end')"
></vuejs-datepicker>
</span>
<div class="contents">
<div class="contents_wrap">
<div class="top_wrap">
<h3 class="title">날짜별 통계</h3>
<p class="breadcrumb">발송통계 &gt; 날짜별 통계</p>
</div>
<button type="button" class="button grey" @click="search">조회</button>
<div class="top_tab">
<a href="statistics_date.html" class="on">월별통계</a><a href="statistics_date_day.html">일별통계</a>
</div>
</div>
</div>
</div>
<!--<button type="button" class="button grey">조회</button>-->
</div>
</form>
<div class="info">
<div class="count">집계결과</div>
<div class="button_group">
<button type="button" class="button blue download">엑셀 다운로드</button>
</div>
</div>
<div class="table calculate">
<table>
<colgroup>
<col width="7%">
<col width="9.3%">
<col width="9.3%">
<col width="9.3%">
<col width="9.3%">
<col width="9.3%">
<col width="9.3%">
<col width="9.3%">
<col width="9.3%">
<col width="9.3%">
<col width="9.3%">
</colgroup>
<thead>
<tr>
<th rowspan="2">날짜</th>
<th colspan="2">전체</th>
<th colspan="2">SMS</th>
<th colspan="2">LMS</th>
<th colspan="2">MMS</th>
<th colspan="2">알림톡</th>
</tr>
<tr class="total">
<th>발송건수</th>
<th>성공건수/(%)</th>
<th>발송건수</th>
<th>성공건수/(%)</th>
<th>발송건수</th>
<th>성공건수/(%)</th>
<th>발송건수</th>
<th>성공건수/(%)</th>
<th>발송건수</th>
<th>성공건수/(%)</th>
</tr>
</thead>
<tbody>
<tr v-for="(option, i) in list" v-bind:key="i">
<td>{{ option.sumYm }}</td>
<td>{{ option.sndCnt.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.succCnt.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br>({{ option.succRt }}%)</td>
<td>{{ option.sndCntS.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.succCntS.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br>({{ option.succRtS }}%)</td>
<td>{{ option.sndCntL.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.succCntL.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br>({{ option.succRtL }}%)</td>
<td>{{ option.sndCntM.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.succCntM.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br>({{ option.succRtM }}%)</td>
<td>{{ option.sndCntR.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.succCntR.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}<br>({{ option.succRtR }}%)</td>
</tr>
</tbody>
</table>
</div>
<form autocomplete="off" class="search_form">
<div class="search_wrap">
<div class="input_box cal">
<label for="right" class="label txt">날짜</label>
<p> 최대 3개월까지 조회 가능합니다.</p>
<div class="term">
<input class="date" type="text" id="" placeholder="2022-10-12"/>
~
<input class="" type="text" id="" placeholder="2022-10-12"/>
</div>
</div>
<button type="button" class="button grey">조회</button>
</div>
</form>
<div class="info">
<div class="count">집계결과</div>
<div class="button_group">
<button type="button" class="button blue download">엑셀 다운로드</button>
</div>
<common-modal ref="commmonModal"></common-modal>
</div>
<div class="table calculate">
<table>
<colgroup>
<col width="8%">
<col width="9.2%">
<col width="9.2%">
<col width="9.2%">
<col width="9.2%">
<col width="9.2%">
<col width="9.2%">
<col width="9.2%">
<col width="9.2%">
<col width="9.2%">
<col width="9.2%">
</colgroup>
<thead>
<tr>
<th rowspan="2">날짜</th>
<th colspan="2">전체</th>
<th colspan="2">SMS</th>
<th colspan="2">LMS</th>
<th colspan="2">MMS</th>
<th colspan="2">알림톡</th>
</tr>
<tr class="total">
<th>발송건수</th>
<th>성공건수/(%)</th>
<th>발송건수</th>
<th>성공건수/(%)</th>
<th>발송건수</th>
<th>성공건수/(%)</th>
<th>발송건수</th>
<th>성공건수/(%)</th>
<th>발송건수</th>
<th>성공건수/(%)</th>
</tr>
</thead>
<tbody>
<tr>
<td>전체</td>
<td>84,000,000</td>
<td>84,000,000<br>(100%)</td>
<td>21,000,000</td>
<td>21,000,000<br>(100%)</td>
<td>21,000,000</td>
<td>21,000,000<br>(100%)</td>
<td>21,000,000</td>
<td>21,000,000<br>(100%)</td>
<td>21,000,000</td>
<td>21,000,000<br>(100%)</td>
</tr>
<tr>
<td>2022-03</td>
<td>40,000,000</td>
<td>40,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
</tr>
<tr>
<td>2022-02</td>
<td>40,000,000</td>
<td>40,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
</tr>
<tr>
<td>2022-01</td>
<td>40,000,000</td>
<td>40,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
</tr>
<tr>
<td>2021-12</td>
<td>40,000,000</td>
<td>40,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
</tr>
<tr>
<td>2021-11</td>
<td>40,000,000</td>
<td>40,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
</tr>
<tr>
<td>2021-10</td>
<td>40,000,000</td>
<td>40,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
</tr>
<tr>
<td>2021-09</td>
<td>40,000,000</td>
<td>40,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
</tr>
<tr>
<td>2021-08</td>
<td>40,000,000</td>
<td>40,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
</tr>
<tr>
<td>2021-07</td>
<td>40,000,000</td>
<td>40,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
<td>10,000,000</td>
<td>10,000,000<br>(100%)</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import customGrid from '@/components/CustomGrid';
//import api from '../service/api';
import moment from 'moment';
import statsApi from "../service/statsApi.js";
import xlsx from '@/common/excel';
import commonModal from "@/components/modal/commonModal";
// import DatePicker from "vue2-datepicker";
export default {
name: 'monthList',
data() {
return {
// 달력 데이터
ko: vdp_translation_ko.js,
periodDay: 7,
sDateDiv: 'month',
startDate: new Date(),
endDate: new Date(),
startDt:'',
endDt:'',
startYear:'',
startMonth:'',
endYear:'',
endMonth:'',
row: {},
list:[],
totalCnt: '',
};
},
components: {
commonModal,
vuejsDatepicker,
},
components: {
customGrid: customGrid
created(){
this.$store.commit("login/isLogin", true);
this.$store.commit("login/isAuthChk", true);
this.setPeriodDay(0);
this.getMonthList();
},
destroyed() {
destroyed() {
},
mounted() {
},
methods: {
async getMonthList(){
console.log('getMonthList Start');
this.row.startMon = moment(this.startDate).format('YYYYMM');
this.row.endMon = moment(this.endDate).format('YYYYMM');
console.log('검색_시작년월:'+this.row.startMon);
console.log('검색_종료년월:'+this.row.endMon);
if (moment(this.row.startMon).isBefore(moment(this.row.endMon).subtract(2, 'months').format('YYYYMM'))) {
//alert('검색 기간은 최대 3개월까지 선택 가능 합니다.');
this.row.title = '발송통계';
this.row.msg1 = '검색 기간은 최대 3개월까지 선택 가능 합니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
return false
}
try {
const response = await statsApi.monthList(this.row);
const result = response.data;
console.log(result);
if (result != null && result.retCode == "0000") {
this.list = result.data.list;
this.totalCnt = result.data.list.length;
} else {
alert("조회정보가 없습니다.");
}
} catch(err) {
alert("실패 하였습니다.");
}
},
search: function() {
this.getMonthList();
},
toMove(routeName) {
//this.$router.push({ name: routeName, params: { page: 1, searchText: '' } });
this.$router.push({ name: routeName, params: {} });
},
// disabledStDate(date) {
// date = moment(String(date)).format('YYYYMMDD');
// return date > moment().format('YYYYMMDD') || date < moment().add(-1, 'years').format('YYYYMMDD');
// },
// disabledEdDate(date) {
// date = moment(String(date)).format('YYYYMMDD')
// return date > moment().format('YYYYMMDD') || date < this.searchData.startDate ;
// },
// changeDate(type) {
// if (type === 'start') {
// if (this.endDate === null || this.startDate > this.endDate) {
// this.endDate = this.startDate;
// }
// if (moment(this.startDate).isBefore(moment(this.endDate).subtract(2, 'months').format('YYYYMMDD'))) {
// alert('검색 기간은 최대 3개월까지 선택 가능 합니다.');
// this.startDate = moment(this.endDate).subtract(2, 'months').format('YYYYMMDD');
// }
// } else if (type === 'end') {
// if (this.startDate === null || this.startDate > this.endDate) {
// this.startDate = this.endDate;
// }
// if (moment(this.endDate).isAfter(moment(this.startDate).add(2, 'months').format('YYYYMMDD'))) {
// alert('검색 기간은 최대 3개월까지 선택 가능 합니다.')
// this.endDate = moment(this.startDate).add(2, 'months').format('YYYYMMDD');
// }
// }
// },
setPeriodDay(day) {
this.periodDay = day;
this.endDate = new Date();
this.startDate = moment(this.endDate)
.subtract(day, 'day')
.toDate();
this.closeDate('start');
this.closeDate('end');
},
selectedStartDate(day) {
if (day != undefined && day != null) {
this.periodDay = day;
}
if (this.startDate > this.endDate) {
this.startDate = this.endDate;
}
console.log(this.disabledSDate)
// this.grid.params.startDt = day
},
selectedEndDate(day) {
if (day != undefined && day != null) {
this.periodDay = day;
}
},
closeDate(type) {
if (type != undefined && type != null) {
if (type == 'start') {
this.disabledSDate = { from: this.endDate };
this.disabledEDate = { to: this.startDate, from: this.endDate };
} else if (type == 'end') {
this.disabledSDate = { from: this.endDate };
this.disabledEDate = { to: this.startDate, from: new Date() };
}
}
},
customFormatter: function(date) {
if (this.sDateDiv == 'month') {
return moment(date).format('YYYY-MM');
} else if (this.sDateDiv == 'year') {
return moment(date).format('YYYY');
} else {
return moment(date).format('YYYY-MM-DD');
}
},
}
};
</script>
</script>
<style>
</style>