시스템관리 - 권한관리, 고객관리 - 청약고객관리/회원관리 추가

This commit is contained in:
kimre
2022-06-09 21:36:05 +09:00
parent b832e1a0be
commit 940707deaa
113 changed files with 9134 additions and 2100 deletions

View File

@@ -0,0 +1,325 @@
<template>
<div class="contents">
<div class="contents_wrap">
<div class="top_wrap">
<h3 class="title">청약고객관리</h3>
<p class="breadcrumb">고객관리 &gt; 청약고객관리 &gt; 청약고객관리</p>
</div>
<div class="top_tab">
<a href="javascript:void(0);" class="on">청약고객관리</a>
<a href="javascript:void(0);" @click="toMove('memberList')">회원관리</a>
</div>
<div class="search_form">
<div class="search_wrap">
<div class="group">
<div class="input_box cal">
<label for="right" class="label">조회기간</label>
<input class="" type="text" id="" v-model="grid.params.startDt"/>
<input class="" type="text" id="" v-model="grid.params.endDt"/>
</div>
<div class="select_box id">
<label for="right" class="label">상태</label>
<select name="" id="" v-model="grid.params.searchType1">
<option value="" selected>전체</option>
<option value="" >사용</option>
<option value="" >미납중지</option>
<option value="" >사용중지</option>
<option value="" >해지</option>
<!-- <option v-for="(option, i) in statType" v-bind:value="option.code" v-bind:key="i">
{{ option.codeNm }}
</option> -->
</select>
</div>
<div class="select_box">
<label for="right" class="label">유치채널</label>
<select name="" id="" v-model="grid.params.searchType2">
<option value="" selected>전체</option>
<option value="" >고객셀프가입</option>
<option value="" >대리점</option>
<option value="" >고객센터</option>
<option value="" >직접영업</option>
<!-- <option v-for="(option, i) in userType" v-bind:value="option.code" v-bind:key="i">
{{ option.codeNm }}
</option> -->
</select>
</div>
</div>
<div class="group">
<div class="select_box">
<label for="right" class="label">상세검색</label>
<select name="" id="" v-model="grid.params.searchType3">
<option value="">전체</option>
<option value="01">고객사명</option>
<option value="02">가입번호</option>
<option value="03">서비스ID</option>
</select>
</div>
<div class="input_box">
<input class="search-box" type="text" id="search" placeholder="검색어 입력" v-model="grid.params.searchText1"/>
</div>
<button type="button" class="button grey" @click="search">조회</button>
</div>
</div>
</div>
<div class="info">
<div class="count"> <span>{{ totalItems }}</span>
<div class="select_box NumberSe">
<select name="" id="" v-model="perPageCnt" @change="changePerPage()">
<option v-for="option in options" v-bind:value="option.value" v-bind:key="option.value">{{ option.text }}</option>
</select>
</div>
</div>
<div class="button_group">
<button type="button" class="button blue download" @click="excelDown();">엑셀 다운로드</button>
</div>
</div>
<div class="table">
<custom-grid
ref="table"
:totalItems="'totalItems'"
:url="grid.url"
:pagePerRows="grid.pagePerRows"
:initialRequest="grid.initialRequest"
:pagination="grid.pagination"
:isCheckbox="grid.isCheckbox"
:columns="grid.columns"
:noDataStr="grid.noDataStr"
:addCls="grid.addCls"
:header="grid.headder"
></custom-grid>
</div>
</div>
</div>
</template>
<script>
import customGrid from '@/components/CustomGrid';
import moment from 'moment';
import api from '@/service/api.js';
import custMgtApi from "../service/custMgtApi.js";
import xlsx from '@/common/excel';
class CustomATagRenderer {
constructor(props) {
this.props = props;
const el = document.createElement('a');
el.href = 'javascript:void(0);';
el.className = 'btn_text';
el.innerText= String(props.colValue)
this.el = el;
}
getElement() {
return this.el;
}
addEvent(selEl) {
selEl.addEventListener("click", () => {
const { callback } = this.props["cgrido" + this.props.colName].options;
callback(this.props);
});
}
}
export default {
name: 'subsList',
data() {
return {
// 달력 데이터
sDateDiv: 'day',
eDateDiv: 'year',
startDate: null,
endDate: null,
disabledSDate: { from: new Date()},
disabledEDate: { to: new Date()},
statType: [],
userType: [],
row:{},
pageType: 'SUBS',
// 테이블 리스트 데이터
perPageCnt: 50,
options: [
{ text: '20', value: 20},
{ text: '50', value: 50},
{ text: '100', value: 100}
],
totalItems: 0,
grid: {
url: '/api/v1/bo/custMgt/subsList',
pagePerRows: 20,
pagination: true,
isCheckbox: false, // true:첫번째 컬럼 앞에 체크박스 생성 / false:체크박스 제거
initialRequest: false,
addCls: 'box_OFvis',
columns: [
{ name: 'no', header: 'No', align: 'center', width: 60},
{ name: 'serviceId', header: '서비스 ID\n(관리자 ID)', align: 'center', width: 160 , renderer: {
type: CustomATagRenderer
, options: {
callback: this.custDetail,
}
}
},
{ name: 'custNm', header: '고객사명', align: 'center', width: 130},
{ name: 'regNo', header: '가입번호', align: 'center', width: 130},
{ name: 'regDt', header: '가입일', align: 'center', width: 130, cls: 'td_line'},
{ name: 'stat', header: '상태', align: 'center', width: 130},
{ name: 'channel', header: '유치채널', align: 'center', width: 130},
{ name: 'plan', header: '요금제', align: 'center', width: 130},
{ name: 'carryOver', header: '이월누적금액', align: 'center', width: 130}
],
noDataStr: '검색 결과가 없습니다.',
params: {
searchType1: '',
searchType2: '',
searchType3: '',
searchText1: '',
startDt: '',
endDt: ''
},
excelHeader: []
}
};
},
components: {
customGrid: customGrid
},
created(){
this.$store.commit("login/isLogin", true);
this.$store.commit("login/isAuthChk", true);
this.setCodeData();
this.getExcelHeader();
},
destroyed() {
},
mounted() {
// 달력 세팅
let page = 1;
// 페이지 정보 및 검색 조건
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
console.log('getCondition : '+getCondition);
// store에 저장된 페이지 정보 및 검색 조건을 불러오기
let isKeep = false;
if (getCondition) {
this.grid.pagePerRows = getCondition.perPage;
this.grid.params = getCondition.params;
page = getCondition.page;
isKeep = true;
}
this.search(isKeep);
},
methods: {
search: function(isKeep) {
console.log('this.perPageCnt'+this.perPageCnt);
//console.log(this.grid.params);
this.$refs.table.search(this.grid.params, isKeep);
this.sendStoreData();
},
toMove(routeName) {
this.$router.push({ name: routeName, params: { page: 1, searchText: '' } });
},
custDetail(props){
this.row.serviceId = props.serviceId;
this.$router.push({ name: 'subsDetail', params: this.row });
},
changePerPage: function(){ // 페이지당 조회할 개수
this.grid.pagePerRows = this.perPageCnt;
this.search(true);
},
sendStoreData: function() {
const getP = this.$refs.table.getPagination();
console.log("==========getP : " + getP._currentPage);
this.$store.commit('searchcondition/updateSearchCondition', {
page: getP._currentPage,
perPage: this.perPageCnt,
params: this.grid.params
});
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
console.log("getCondition : "+ getCondition.perPage);
},
setCodeData() {
// 상태 옵션 셋팅.
api.commCode({'grpCd' : 'SVCUSER_STTUS_CD'}).then(response => {
this.statType = response.data.data.list;
});
//
api.commCode({'grpCd' : 'SVCUSER_TP_CD'}).then(response => {
this.userType = response.data.data.list;
});
},
async getExcelDataDown() {
try {
let response;
const params = {
startDt: this.grid.params.startDt,
endDt: this.grid.params.endDt,
searchType1: this.grid.params.searchType1,
searchType2: this.grid.params.searchType2,
searchType3: this.grid.params.searchType3,
searchText1: this.grid.params.searchText1
};
response = await custMgtApi.subsListExcel(params);
const result = response.data;
if (result != null && result.retCode == "0000") {
return result.data;
}else{
return false;
}
} catch (err) {
return false;
}
}, // end of getExcelDataDown
async excelDown() {
if (this.$refs.table.getData().length <= 0) {
alert('조회된 데이터가 없습니다.');
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(() => {});
},
getExcelHeader() {
// 헤더를 mockup으로 관리한다.
custMgtApi.getExcelHeader(this.pageType).then(res => {
this.excelHeader = res;
});
},
},
beforeRouteLeave(to, from, next) {
const getP = this.$refs.table.getPagination();
console.log("==========getP : " + getP._currentPage);
this.$store.commit('searchcondition/updateSearchCondition', {
page: getP._currentPage,
perPage: this.perPageCnt,
params: this.grid.params
});
// 라우트 하기전 실행
next();
},
};
</script>