고객관리 > 청약고갹관리/회원관리 기능 추가

This commit is contained in:
kimre
2022-06-13 11:25:42 +09:00
parent 940707deaa
commit 7c87f2a3e8
37 changed files with 2489 additions and 432 deletions

View File

@@ -1,12 +1,12 @@
import TmpltList from '../views/TmpltList'
export default [
{
path: '/channelMgt/tmpltList',
component: TmpltList,
name: 'tmpltList',
meta: { public: true }
},
]
import TmpltList from '../views/TmpltList'
export default [
{
path: '/channelMgt/tmpltList',
component: TmpltList,
name: 'tmpltList',
meta: { public: true }
},
]

View File

@@ -0,0 +1,34 @@
import httpClient from '@/common/http-client';
import channelListExcelHeader from './mock/channelListExcelHeader.json';
// 공통 코드.
const getCommCode = (params) => {
return httpClient.post('/api/v1/bo/comm/getCode', params, { withCredentials: false });
}
// 청약정보 엑셀다운로드 목록 조회
const tmpltListExcel = (params) => {
return httpClient.post('/api/v1/bo/channelMgt/tmpltListExcel', params);
}
const getExcelHeader = category => {
// 엑셀에 출력할 Header 정보를 Mockup 데이터로 관리한다.
return new Promise(function(resolve, reject) {
let header = [];
switch (category) {
case 'CHANN':
header = channelListExcelHeader.header;
break;
default:
header = '';
break;
}
resolve(header);
});
};
export default {
getCommCode,
tmpltListExcel,
getExcelHeader,
}

View File

@@ -0,0 +1,38 @@
{
"header": [
[
{
"key": "no",
"name": "NO"
},
{
"key": "bregNo",
"name": "사업자번호"
},
{
"key": "tmpltCd",
"name": "템플릿코드"
},
{
"key": "tmpltNm",
"name": "템플릿명"
},
{
"key": "tmpltType",
"name": "템플릿유형"
},
{
"key": "stat",
"name": "상태"
},
{
"key": "sendProfile",
"name": "발신프로필"
},
{
"key": "lastChgDt",
"name": "최종수정일"
}
]
]
}

View File

@@ -1,165 +1,336 @@
<template>
<div class="contents">
<div class="contents_wrap">
<div class="top_wrap">
<h3 class="title">알림톡 템플릿 목록 조회</h3>
<p class="breadcrumb">시스템관리 &gt; 관리자/유치채널 관리</p>
</div>
<form autocomplete="off" class="search_form">
<div class="search_wrap">
<div class="select_box">
<label for="right" class="label">권한</label>
<select name="" id="right">
<option value="전체">전체</option>
<option value="대리점">대리점</option>
<option value="운영자">운영자</option>
</select>
</div>
<div class="select_box">
<label for="right" class="label"></label>
<select name="" id="right">
<option value="전체">전체</option>
<option value="사용"></option>
<option value="중지">중지</option>
</select>
</div>
<div class="input_box id">
<label for="id1" class="label">ID</label>
<input type="text" id="id1" placeholder="검색어 입력"/>
</div>
<div class="input_box">
<label for="name" class="label">이름(대리점명)</label>
<input type="text" id="name" placeholder="검색어 입력"/>
</div>
<button type="button" class="button grey">조회</button>
</div>
</form>
<div class="info">
<div class="count"> <span>100</span></div>
<div class="button_group">
<button type="button" class="button blue admin">관리자 등록</button>
<button type="button" class="button blue channel">유지채널 등록</button>
<button type="button" class="button white delete">삭제</button>
</div>
</div>
<!-- <div class="table">
<table>
<colgroup>
<col width="5%"/>
<col width="15%"/>
<col width="15%"/>
<col width="20%"/>
<col width="20%"/>
<col width="5%"/>
<col width="20%"/>
</colgroup>
<thead>
<tr>
<th><input type="checkbox" id="admin_check1"><label for="admin_check1"></label></th>
<th>NO</th>
<th>권한</th>
<th>이름(대리점명)</th>
<th>ID</th>
<th>상태</th>
<th>등록일</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" checked id="admin_check2"><label for="admin_check2"></label></td>
<td>10</td>
<td>대리점</td>
<td>유플러스</td>
<td><a href="javascript:void(0)">uplus1</a></td>
<td>사용</td>
<td>2022-03-10</td>
</tr>
</tbody>
</table>
</div> -->
<div class="table">
<custom-grid
ref="table"
:totalItems="'totalItems'"
:url="testList.url"
:perPage="testList.perPage"
:initialRequest="testList.initialRequest"
:pagination="testList.pagination"
:isCheckbox="testList.isCheckbox"
:columns="testList.columns"
:noDataStr="testList.noDataStr"
:addCls="testList.addCls"
:header="testList.header"
></custom-grid>
</div>
</div>
</div>
</template>
<script>
import customGrid from '@/components/CustomGrid';
//import api from '../service/api';
export default {
name: 'temltList',
data() {
return {
testList: {
url: '/api/v1/bo/sysMgt/adminList',
perPage: 20,
pagination: true,
isCheckbox: true,
initialRequest: false,
addCls: 'box_OFvis',
header: [
[
{ header: 'NO', childNames: [] },
{ header: '권한', childNames: [] },
{ header: '이름(대리점명)', childNames: [] },
{ header: 'ID', childNames: [] },
{ header: '상태', childNames: [] },
{ header: '등록일', childNames: [] }
]
],
columns: [
{ name: 'no', header: 'NO', align: 'center', width: 60 },
{ name: 'auth', header: '권한', align: 'left', width: 160 },
{ name: 'name', header: '이름(대리점명)', align: 'center', width: 130},
{ name: 'adminId', header: 'ID', align: 'center', width: 130},
{ name: 'adminStat', header: '상태', align: 'center', width: 130},
{ name: 'regDt', header: '등록일', width: 90, cls: 'td_line' }
],
noDataStr: '검색 결과가 없습니다.',
// params: {
// apprResult: '',
// searchType: '',
// searchText: '',
// startDate: '',
// endDate: ''
// },
excelHeader: []
}
};
},
components: {
customGrid: customGrid
},
destroyed() {
},
mounted() {
let isKeep = false;
isKeep = true;
this.search(isKeep);
},
methods: {
search: function(isKeep) {
console.log(this.testList.params);
this.$refs.table.search(this.testList.params, isKeep);
},
}
};
<template>
<div class="contents">
<div class="contents_wrap">
<div class="top_wrap">
<h3 class="title">알림톡 템플릿 목록 조회</h3>
<p class="breadcrumb">채널관리 &gt; 알림톡 템플릿 관리</p>
</div>
<form autocomplete="off" class="search_form">
<div class="search_wrap">
<div class="select_box">
<label for="stat" class="label">상태</label>
<select name="" id="stat" v-model="grid.params.searchType1" @keyup.enter="search">
<option value="">전체</option>
<option value="Y">사용</option>
<option value="N">폐기</option>
</select>
</div>
<div class="select_box">
<label for="searchType" class="label">세검색</label>
<select name="" id="searchType" v-model="grid.params.searchType2" @keyup.enter="search">
<option value="custNm" selected="selected">고객사명</option>
<option value="bizNo">업자번호</option>
<option value="tmpltNm">템플릿명</option>
</select>
</div>
<div class="input_box id">
<label for="search" class="label">검색어</label>
<input type="text" id="id1" placeholder="검색어 입력" v-model="grid.params.searchText1" v-on:keydown.enter.prevent="search"/>
</div>
<button type="button" class="button grey" @click="search">조회</button>
</div>
</form>
<div class="info">
<div class="count"> <span>{{ totalItems }}</span>
<div class="select_box NumberSe">
<select name="" id="perPage" v-model="grid.pagePerRows" @keyup.enter="search">
<option value="20">20</option>
<option value="50" selected>50</option>
<option value="100">100</option>
</select>
</div>
</div>
<div class="button_group">
<button type="button" class="button blue admin" @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 channelMgtApi from '../service/channelMgtApi';
import xlsx from '@/common/excel';
import moment from 'moment';
class customBRegNo {
constructor(props) {
this.props = props;
const el = document.createElement('td');
var bregNo = String(props.colValue);
el.innerText= bregNo;
if(bregNo.length == 10){
el.innerText= bregNo.substring(0,3)+'-'+bregNo.substring(3,5)+'-'+bregNo.substring(5,10)
}
this.el = el;
}
getElement() {
return this.el;
}
addEvent(selEl) {
}
}
class customTmpltType {
constructor(props) {
this.props = props;
const el = document.createElement('td');
var tmpltType = String(props.colValue);
el.innerText= "";
switch(tmpltType){
case '01' :
el.innerText= "기본형";
break;
case '02' :
el.innerText= "부가정보형";
break;
case '03' :
el.innerText= "광고추가형";
break;
case '04' :
el.innerText= "복잡형";
break;
default :
break;
}
this.el = el;
}
getElement() {
return this.el;
}
addEvent(selEl) {
}
}
class customStat {
constructor(props) {
this.props = props;
const el = document.createElement('td');
var stat = String(props.colValue);
el.innerText= "";
switch(stat){
case 'T' :
el.innerText= "신청완료";
break;
case 'R' :
el.innerText= "검수요청완료";
break;
case 'Q' :
el.innerText= "카카오 검수중";
break;
case 'A' :
el.innerText= "템플릿승인";
break;
case 'S' :
el.innerText= "반려(" + props.returnReason + ")";
break;
default :
break;
}
this.el = el;
}
getElement() {
return this.el;
}
addEvent(selEl) {
}
}
export default {
name: 'temltList',
data() {
return {
row: {},
authType: [],
statType: [],
cate2Code: "",
totalItems: 0,
pageType: 'CHANN',
// 테이블 리스트 데이터
perPageCnt: 50,
grid: {
url: '/api/v1/bo/channelMgt/tmpltList',
perPage: 50,
pagination: true,
isCheckbox: false,
initialRequest: false,
addCls: 'box_OFvis',
header: [
[
{ header: 'NO', childNames: [] },
{ header: '고객사명', childNames: [] },
{ header: '사업자번호', childNames: [] },
{ header: '템플릿코드', childNames: [] },
{ header: '템플릿명', childNames: [] },
{ header: '템플릿 유형', childNames: [] },
{ header: '상태(반려사유)', childNames: [] },
{ header: '발신프로필', childNames: [] },
{ header: '최종수정일', childNames: [] }
]
],
columns: [
{ name: 'no', header: 'NO', align: 'center', width: 40 },
{ name: 'custNm', header: '고객사명', align: 'left', width: 120 },
{ name: 'bregNo', header: '사업자번호', align: 'center', width: 120,renderer: {type: customBRegNo}},
{ name: 'tmpltCd', header: '템플릿코드', align: 'center', width: 120},
{ name: 'tmpltNm', header: '템플릿명', align: 'center', width: 120},
{ name: 'tmpltType', header: '템플릿 유형', align: 'center', width: 120,renderer: {type: customTmpltType}},
{ name: 'stat', header: '상태(반려사유)', align: 'center', width: 120,renderer: {type: customStat}},
{ name: 'sendProfile', header: '발신프로필', align: 'center', width: 120},
{ name: 'lastChgDt', header: '최종수정일', width: 120, cls: 'td_line' }
],
noDataStr: '검색 결과가 없습니다.',
params: {
searchType1: '',
searchType2: '',
searchText1: ''
},
excelHeader: []
}
};
},
components: {
customGrid: customGrid,
channelMgtApi
},
created(){
this.$store.commit("login/isLogin", true);
this.$store.commit("login/isAuthChk", true);
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
this.getExcelHeader();
},
destroyed() {
this.$store.commit('searchcondition/updateSearchCondition', {
page: 1,
perPage: 50,
params: {
searchType1: '',
searchType2: '',
searchText1: ''}
});
},
mounted() {
let page = 1;
// 페이지 정보 및 검색 조건
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
// 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.grid.params);
this.$refs.table.search(this.grid.params, isKeep);
this.sendStoreData();
},
sendStoreData: function() {
const getP = this.$refs.table.getPagination();
console.log("==========getP : " + getP);
this.$store.commit('searchcondition/updateSearchCondition', {
page: getP._currentPage,
perPage: this.perPageCnt,
params: {
searchType1: '',
searchType2: '',
searchText1: ''
}
});
const getCondition = this.$store.getters['searchcondition/getSearchCondition'];
//console.log("getCondition : "+ getCondition.perPage);
},
async getExcelDataDown() {
try {
let response;
const params = {
searchType1: this.grid.params.searchType1,
searchType2: this.grid.params.searchType2,
searchText1: this.grid.params.searchText1
};
response = await channelMgtApi.tmpltListExcel(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으로 관리한다.
channelMgtApi.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>

View File

@@ -1,5 +1,5 @@
<template>
<div class="wrap bg-wrap">
<div>
<div class="dimmed modal26" @click="ModalClose();"></div>
<div class="popup-wrap modal26">
<div class="popup modal26">

View File

@@ -29,7 +29,7 @@
</tbody>
</table>
<div class="pop-btn2">
<button class="btn-pcolor">저장</button>
<button class="btn-pcolor" @click="saveExcel">저장</button>
<button class="btn-default" @click="excelPopClose">취소</button>
</div>
</div>
@@ -58,6 +58,7 @@ export default {
varList2 : ["이름","기타1","기타2","기타3","기타4"],
nData : [],
oData : [],
totalItems: 0,
}
},
@@ -66,8 +67,10 @@ export default {
},
methods :{
// 모달 띄우기
excelPopOpen(adminId){
excelPopOpen(adminId, totalItems){
this.adminId = adminId;
this.totalItems = totalItems;
console.log(totalItems)
var excelPop = document.getElementsByClassName('modal33');
for(var i = 0; i < excelPop.length; i++){
excelPop[i].style.display = 'block';
@@ -85,7 +88,7 @@ export default {
// 저장 후 부모창 호출.
toComplete(){
this.getParent('custList').$refs.table.reloadData();
this.ModalClose();
this.excelPopClose();
},
async doInsert(){
if(this.doValidate() && window.confirm('등록 하시겠습니까?')){
@@ -118,6 +121,10 @@ export default {
});
},
readFile(event) {
this.nData = []
this.oData = []
const file = event.target.files[0];
console.log(file.name);
@@ -148,24 +155,18 @@ export default {
let data = reader.result;
let workbook = XLSX.read(data, {type: 'binary'});
workbook.SheetNames.forEach(sheetName => {
workbook.Sheets[sheetName].A1.w = "id";
workbook.Sheets[sheetName].B1.w = "name";
workbook.Sheets[sheetName].C1.w = "mdn";
workbook.Sheets[sheetName].D1.w = "email";
workbook.Sheets[sheetName].E1.w = "stat";
// console.log(workbook.Sheets[sheetName].A1);
const rowObj = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName]);
// const rowObj = XLSX.utils.sheet_to_json(wb.Sheets[sheetName],{raw:true});
const rowObj = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName],{raw:true});
tmpResult = rowObj;
const limitCnt = 101;
const limitCnt = 100;
if(rowObj.length > limitCnt){
alert('100건이상은 등록되지 않습니다.');
return false;
}
const totalCnt = Number(this.totalItems) + rowObj.length;
if(totalCnt > limitCnt){
alert('100건이상은 등록되지 않습니다.');
return false;
}
for (const [idx,r] of rowObj.entries()) {
if(idx > limitCnt-1 ) {
break;
@@ -183,28 +184,33 @@ export default {
휴대폰번호='0'+휴대폰번호;
}
}
let {retVal,msg } = vm.validXlxs({이름,휴대폰번호});
let {retVal,msg } = vm.validXlxs({ID,이름,휴대폰번호,이메일,ID잠금});
if(retVal){
const pVal = [{ name:'이름',val:이름, len:20,},
{ name:'ID잠금',val:ID잠금, len:4,},];
const rVal = vm.isTitle(pVal);
if(rVal.retVal){
vm.nData.push({name:이름,mdn:휴대폰번호,msg});
vm.nData.push({userId:ID,userNm:이름,mdn:휴대폰번호,email:이메일,stat:ID잠금,msg});
}else{
vm.oData.push({이름,휴대폰번호,오류내용:rVal.msg});
vm.oData.push({ID,이름,휴대폰번호,이메일,ID잠금,오류내용:rVal.msg});
}
}else{
vm.oData.push({이름,휴대폰번호,오류내용:msg});
vm.oData.push({ID,이름,휴대폰번호,이메일,ID잠금,오류내용:msg});
}
}
});
console.log(vm.nData);
// this.excelJsonData=tmpResult;
console.log(vm.nData.length);
console.log(vm.oData);
console.log(vm.oData.length);
};
reader.readAsBinaryString(file);
},
validXlxs({이름,휴대폰번호}){
validXlxs({이름,휴대폰번호,이메일}){
if(this.isNull(이름)){
return {retVal:false,msg:'이름 누락'};
}
@@ -216,7 +222,9 @@ export default {
return {retVal:false,msg:'휴대폰번호 형식 오류'};
}
}
if(!this.emailCheck(이메일)){
return {retVal:false,msg:'이메일 형식 오류'};
}
return {retVal:true,msg:'정상'};
},
isTitle(pVal) {
@@ -243,7 +251,32 @@ export default {
element.removeChild(element.firstChild);
}
// uploadFile
}
},
async saveExcel(){
//
this.row.adminId = this.adminId;
this.row.list = this.nData;
try {
const response = await custMgtApi.insertMassUser(this.row);
const result = response.data;
console.log(result);
if (result != null && result.retCode == "0000") {
// this.totalCnt = result.data.totalCnt;
// this.successCnt = result.data.successCnt;
// this.failCnt = result.data.failCnt;
// this.toComplete();/
}
} catch (error) {
console.log(error);
alert("실패 하였습니다.");
}
// 오류건수.
console.log(this.oData.length);
},
}
}
</script>

View File

@@ -0,0 +1,267 @@
<template>
<!-- <div class="wrap bg-wrap"> -->
<div>
<div class="dimmed memberUpdate" @click="memberUpdateModalClose();"></div>
<div class="popup-wrap memberUpdate">
<!-- 수정 확인 -->
<div class="popup memberUpdate popup_form">
<div class="pop-head">
<h3 class="pop-tit">사용자 ID 수정</h3>
</div>
<form autocomplete="off">
<table>
<tbody>
<tr>
<th>관리자 ID</th>
<td>{{adminId}}</td>
</tr>
<tr>
<th>ID</th>
<td>{{userId}}</td>
</tr>
<tr>
<th>비밀번호</th>
<td><input type="password" @keypress="onlyPassword" @input="onlyPassword" required minlength="8" maxlength="16" ref="_pwd1" v-model.trim="userPwd1"></td>
</tr>
<tr>
<th>비밀번호 확인</th>
<td><input type="password" @keypress="onlyPassword" @input="onlyPassword" required minlength="8" maxlength="16" ref="_pwd2" v-model.trim="userPwd2"></td>
</tr>
<tr>
<th>이름</th>
<td><input type="text" v-model.trim="userNm" ref="_userNm"></td>
</tr>
<tr>
<th>휴대폰번호</th>
<td><input type="text" v-model.trim="mdn" ref="_phone"></td>
</tr>
<tr>
<th>이메일</th>
<td><input type="email" v-model.trim="email" ref="_email"></td>
</tr>
<tr>
<th class="center">상태</th>
<td>
<input type="radio" name="userStateUpdate" value="01" id="user_popup_update_radio1" v-model="userStat">
<label for="user_popup_update_radio1">사용</label>
<input type="radio" name="userStateUpdate" value="02" id="user_popup_update_radio2" v-model="userStat">
<label for="user_popup_update_radio2">정지</label>
</td>
</tr>
</tbody>
</table>
</form>
<div class="pop-btn2">
<button class="btn-pcolor" @click="memberUpdateConfirm();">저장</button>
<button class="btn-default" @click="memberUpdateModalClose();">취소</button>
</div>
</div>
<validation-confirm-pop ref="validationConfirmPopModal"> </validation-confirm-pop>
</div>
</div>
</template>
<script>
import api from '@/service/api';
import custMgtApi from "../service/custMgtApi.js";
import { utils_mixin, chkPattern2 } from '../service/mixins';
import ValidationConfirmPop from '../components/ValidationConfirmPop.vue';
import lodash from "lodash";
export default {
name: "memberModifyPop",
mixins: [utils_mixin, chkPattern2],
watch:{
stat(){
console.log('watch : ', this.stat)
}
},
components: {
ValidationConfirmPop,
},
model: {
//prop: 'sendData',
//event: 'event-data'
},
//props: ['sendData'],
created(){
// this.setAuthData();
// this.formReset();
},
data(){
return{
row:{},
madangId:'',
name:'',
mdn:'',
email:'',
auth:'',
stat: "",
userId: "",
adminId: "",
userNm:"",
userPwd1:"",
userPwd2:"",
code:"",
userStat:"",
}
},
methods :{
//사용자ID 수정 모달 Open
async memberUpdateModalOpen(props){
this.row.userId = props.userId;
this.adminId = props.adminId;
try {
const response = await custMgtApi.memberDetail(this.row);
const result = response.data;
console.log(result);
if (result != null && result.retCode == "0000") {
this.userId = result.data.userId;
this.userNm = result.data.userNm;
this.email = result.data.email;
this.mdn = result.data.mdn;
this.userStat = result.data.userStat;
} else {
alert("실패 하였습니다.");
}
} catch(err) {
alert("실패 하였습니다.");
}
// 모달 오픈
var dimmed = document.getElementsByClassName('memberUpdate');
for(var i = 0; i < dimmed.length; i++){
dimmed[i].style.display = 'block';
}
},
//사용자ID 수정 Confirm
memberUpdateConfirm(){
// confirm 팝업 노출
if(this.doValidate()){
this.$refs.validationConfirmPopModal.confirmUpdateOpen();
}
},
//사용자ID 수정 처리
async memberUpdate(){
this.row.userId = this.userId;
this.row.userPw = this.userPwd1;
this.row.userNm = this.userNm;
this.row.userEmail = this.email;
this.row.mdn = this.mdn;
this.row.userStat = this.userStat;
try {
const response = await custMgtApi.updateUser(this.row);
const result = response.data;
console.log(result);
if (result != null && result.retCode == "0000") {
alert('수정 완료하였습니다.');
this.toComplete();
} else {
alert("실패 하였습니다.");
}
} catch(err) {
alert("실패 하였습니다.");
}
},
//사용자ID 수정 모달 Close
memberUpdateModalClose(){
var dimmed = document.getElementsByClassName('memberUpdate');
for(var i = 0; i < dimmed.length; i++){
dimmed[i].style.display = 'none';
}
},
toComplete(){
this.row.serviceId = this.adminId;
this.memberUpdateModalClose();
this.$parent.memberDetail(this.adminId);
},
doPwdValidate(){
if(this.isNull(this.userPwd2)){
alert("비밀번호 확인을 입력해 주세요.");
this.$refs._pwd2.focus();
return false;
}
if(!lodash.isEqual(this.userPwd1, this.userPwd2)){
alert("비밀번호가 일치하지 않습니다.");
this.$refs._pwd2.focus();
return false;
}
const pwdLen = this.bytes(this.userPwd1);
if(!(pwdLen >= 8 && pwdLen <= 16)){
alert("비밀번호는 8~16자의 영문, 숫자, 특수문자(!,@, $, %, ^, &, *) 조합이 필요합니다.");
this.$refs._pwd1.focus();
return false;
}
const pEng = /[A-Za-z]/g; // 영문자
const pNum = /[0-9]/g; // 숫자
const pSpc = /[!@$%^&*]/g; // 특수문자
if(!(pEng.test(this.userPwd1) && pNum.test(this.userPwd1) && pSpc.test(this.userPwd1))) {
alert("비밀번호는 8~16자의 영문, 숫자, 특수문자(!,@, $, %, ^, &, *) 조합이 필요합니다.");
this.$refs._pwd1.focus();
return false;
}
return true;
},
doValidate(){
if(!this.isNull(this.userPwd1)){
if(!this.doPwdValidate()){
return false;
}
}
if(this.isNull(this.userNm)){
alert("이름을 입력해 주세요");
this.$refs._userNm.focus();
return false;
}
if(this.isNull(this.email)){
alert('이메일을 입력해주세요.');
this.$refs._email.focus();
return false;
}
const email = this.email;
if(!this.isNull(email) && !lodash.isEqual(email,'@') && !this.emailCheck(email)){
// alert("이메일 형식이 잘못되었습니다. 확인해 주세요");
// this.$refs._email.focus();
this.$refs.validationConfirmPopModal.validationEmailOpen();
return false;
}
if(this.isNull(this.mdn)){
alert('휴대폰번호를 입력해주세요.');
this.$refs._phone.focus();
return false;
}
const hp = this.mdn;
if(!this.isNull(hp) && !this.isMobile(hp)){
//alert("휴대폰 번호 형식이 잘못되었습니다. 확인해 주세요");
//this.$refs._phone.focus();
this.$refs.validationConfirmPopModal.validationPhonenumberOpen();
return false;
}
if(this.isNull(this.userStat)){
alert('상태를 선택 해주세요.');
return false;
}
return true;
},
checkPhoneFocus(){
//this.mdn = '';
this.$refs._phone.focus();
},
checkEmailFocus(){
//this.email = '';
this.$refs._email.focus();
},
}
}
</script>

View File

@@ -0,0 +1,296 @@
<template>
<!-- <div class="wrap bg-wrap"> -->
<div>
<div class="dimmed memberInsert" @click="memberInsertModalClose();"></div>
<div class="popup-wrap memberInsert">
<!-- 수정 확인 -->
<div class="popup memberInsert popup_form">
<div class="pop-head">
<h3 class="pop-tit">사용자 ID 생성</h3>
</div>
<form autocomplete="off">
<table>
<tbody>
<tr>
<th>관리자 ID</th>
<td>{{adminId}}</td>
</tr>
<tr>
<th>ID</th>
<td><input type="text" v-model.trim="userId" ref="_userId"></td>
</tr>
<tr>
<th>비밀번호</th>
<td><input type="password" @keypress="onlyPassword" @input="onlyPassword" required minlength="8" maxlength="16" ref="_pwd1" v-model.trim="userPwd1"></td>
</tr>
<tr>
<th>비밀번호 확인</th>
<td><input type="password" @keypress="onlyPassword" @input="onlyPassword" required minlength="8" maxlength="16" ref="_pwd2" v-model.trim="userPwd2"></td>
</tr>
<tr>
<th>이름</th>
<td><input type="text" v-model.trim="userNm" ref="_userNm"></td>
</tr>
<tr>
<th>휴대폰번호</th>
<td><input type="text" v-model.trim="mdn" ref="_phone"></td>
</tr>
<tr>
<th>이메일</th>
<td><input type="email" v-model.trim="email" ref="_email"></td>
</tr>
<tr>
<th class="center">상태</th>
<td>
<input type="radio" name="userStateInsert" value="01" id="user_popup_insert_radio1" v-model="stat">
<label for="user_popup_insert_radio1">사용</label>
<input type="radio" name="userStateInsert" value="02" id="user_popup_insert_radio2" v-model="stat">
<label for="user_popup_insert_radio2">정지</label>
</td>
</tr>
</tbody>
</table>
</form>
<div class="pop-btn2">
<button class="btn-pcolor" @click="memberInsertConfirm();">저장</button>
<button class="btn-default" @click="memberInsertModalClose();">취소</button>
</div>
</div>
<validation-confirm-pop ref="validationConfirmPopModal"> </validation-confirm-pop>
</div>
</div>
</template>
<script>
import api from '@/service/api';
import custMgtApi from "../service/custMgtApi.js";
import { utils_mixin, chkPattern2 } from '../service/mixins';
import ValidationConfirmPop from '../components/ValidationConfirmPop.vue';
import lodash from "lodash";
export default {
name: "memberRegPop",
mixins: [utils_mixin, chkPattern2],
watch:{
stat(){
console.log('watch : ', this.stat)
}
},
components: {
ValidationConfirmPop,
},
model: {
//prop: 'sendData',
//event: 'event-data'
},
//props: ['sendData'],
created(){
// this.setAuthData();
// this.formReset();
},
data(){
return{
row:{},
madangId:'',
adminId:'',
name:'',
mdn:'',
email:'',
auth:'',
stat: "",
userId:"",
userNm:"",
userPwd1:"",
userPwd2:"",
code:"",
userTotalCnt:0,
}
},
methods :{
//사용자ID 생성 모달 Open
async memberInsertModalOpen(props){
this.adminId = props.adminId;
this.userTotalCnt = props.userTotalCnt;
// 모달 오픈
var dimmed = document.getElementsByClassName('memberInsert');
for(var i = 0; i < dimmed.length; i++){
dimmed[i].style.display = 'block';
}
},
//사용자ID 생성 Confirm
memberInsertConfirm(){
// confirm 팝업 노출
if(this.doValidate()){
this.$refs.validationConfirmPopModal.confirmInsertOpen();
}
},
//사용자ID 수정 처리
async memberInsert(){
this.row.adminId = this.adminId;
this.row.userId = this.userId;
this.row.userPw = this.userPwd1;
this.row.userNm = this.userNm;
this.row.userEmail = this.email;
this.row.mdn = this.mdn;
this.row.userStat = this.stat;
try {
const response = await custMgtApi.insertUser(this.row);
const result = response.data;
console.log(result);
if (result != null && result.retCode == "0000") {
alert('사용자 생성 완료하였습니다.');
this.toComplete();
} else if(result != null && result.retCode == "4018"){
// 이미 사용중인 ID
this.$refs.validationConfirmPopModal.validationIdDuplicateOpen();
} else {
alert("실패 하였습니다.");
}
} catch(err) {
alert("실패 하였습니다.");
}
},
//사용자ID 생성 모달 Close
memberInsertModalClose(){
var dimmed = document.getElementsByClassName('memberInsert');
for(var i = 0; i < dimmed.length; i++){
dimmed[i].style.display = 'none';
}
//this.formReset();
},
toComplete(){
this.row.serviceId = this.adminId;
this.memberInsertModalClose();
this.$parent.memberDetail(this.adminId);
},
setAuthData() {
// 권한 옵션.
api.commAuth().then(response => {
this.authType = response.data.data.list;
});
},
// formReset(){
// var targetAdminId = this.adminId;
// Object.assign(this.$data, this.$options.data());
// this.adminId = targetAdminId;
// },
doPwdValidate(){
if(this.isNull(this.userPwd2)){
alert("비밀번호 확인을 입력해 주세요.");
this.$refs._pwd2.focus();
return false;
}
if(!lodash.isEqual(this.userPwd1, this.userPwd2)){
alert("비밀번호가 일치하지 않습니다.");
this.$refs._pwd2.focus();
return false;
}
const pwdLen = this.bytes(this.userPwd1);
if(!(pwdLen >= 8 && pwdLen <= 16)){
alert("비밀번호는 8~16자의 영문, 숫자, 특수문자(!,@, $, %, ^, &, *) 조합이 필요합니다.");
this.$refs._pwd1.focus();
return false;
}
const pEng = /[A-Za-z]/g; // 영문자
const pNum = /[0-9]/g; // 숫자
const pSpc = /[!@$%^&*]/g; // 특수문자
if(!(pEng.test(this.userPwd1) && pNum.test(this.userPwd1) && pSpc.test(this.userPwd1))) {
alert("비밀번호는 8~16자의 영문, 숫자, 특수문자(!,@, $, %, ^, &, *) 조합이 필요합니다.");
this.$refs._pwd1.focus();
return false;
}
return true;
},
doValidate(){
if(this.userTotalCnt >= 100){
// 사용자등록제한_최대100개까지
this.$refs.validationConfirmPopModal.validationMaxlimitOpen();
return false;
}
if(this.isNull(this.userId)){
alert("ID를 입력해 주세요");
this.$refs._userId.focus();
return false;
}
if(this.isNull(this.userPwd1)){
alert("비밀번호를 입력해 주세요");
this.$refs.__pwd1.focus();
return false;
}
if(this.isNull(this.userPwd2)){
alert("비밀번호 확인을 입력해 주세요");
this.$refs.__pwd2.focus();
return false;
}
if(!this.isNull(this.userPwd1)){
if(!this.doPwdValidate()){
return false;
}
}
if(this.isNull(this.userNm)){
alert("이름을 입력해 주세요");
this.$refs._userNm.focus();
return false;
}
if(this.isNull(this.email)){
alert('이메일을 입력해주세요.');
this.$refs._email.focus();
return false;
}
const email = this.email;
if(!this.isNull(email) && !lodash.isEqual(email,'@') && !this.emailCheck(email)){
// alert("이메일 형식이 잘못되었습니다. 확인해 주세요");
// this.$refs._email.focus();
this.$refs.validationConfirmPopModal.validationEmailOpen();
return false;
}
if(this.isNull(this.mdn)){
alert('휴대폰번호를 입력해주세요.');
this.$refs._phone.focus();
return false;
}
const hp = this.mdn;
if(!this.isNull(hp) && !this.isMobile(hp)){
//alert("휴대폰 번호 형식이 잘못되었습니다. 확인해 주세요");
//this.$refs._phone.focus();
this.$refs.validationConfirmPopModal.validationPhonenumberOpen();
return false;
}
if(this.isNull(this.stat)){
alert('상태를 선택 해주세요.');
return false;
}
return true;
},
checkPhoneFocus(){
//this.mdn = '';
this.$refs._phone.focus();
},
checkEmailFocus(){
//this.email = '';
this.$refs._email.focus();
},
checkIdDupFocus(){
//this.email = '';
this.$refs._userId.focus();
},
}
}
</script>

View File

@@ -0,0 +1,268 @@
<template>
<!-- <div class="wrap bg-wrap"> -->
<div>
<div class="dimmed memoTotal" @click="memoTotalModalClose();"></div>
<div class="popup-wrap memoTotal">
<!-- 수정 확인 -->
<div class="popup memoTotal popup_form b-popup">
<div class="pop-head">
<h3 class="pop-tit">전체 메모보기</h3>
</div>
<table class="table-c">
<!--
<thead>
<tr>
<th>내용</th>
<th>작성자</th>
<th>작성일</th>
<th>삭제</th>
</tr>
</thead>
<tbody>
<tr>
<td class="memo">작성한 메모 내용이 노출됩니다. <br/>
해당영역은 최대 5줄까지 노출되며 이후 우측 스크롤이 생성됩니다.<br/>
작성한 메모 내용이 노출됩니다. <br/>
해당영역은 최대 5줄까지 노출되며 이후 우측 스크롤이 생성됩니다.<br/>
작성한 메모 내용이 노출됩니다.</td>
<td>관리자</td>
<td>2022-03-10</td>
<td><button type="button" class="button white btn-a">삭제</button></td>
</tr>
</tbody>
-->
<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>
</table>
<div class="pop-btn2">
<button class="btn-default" @click="memoTotalModalClose();">닫기</button>
</div>
</div>
</div>
</div>
</template>
<script>
import customGrid from "@/components/CustomGrid";
import api from '@/service/api';
import custMgtApi from "../service/custMgtApi.js";
class CustomATagRenderer {
constructor(props) {
this.props = props;
// const el = document.createElement('a');
const el = document.createElement('button');
el.href = 'javascript:void(0);';
//el.className = 'btn_text';
el.className = 'button white btn-a';
//el.innerText= String(props.colValue)
el.innerText= String('삭제')
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: "memoTatalListPop",
model: {
//prop: 'sendData',
//event: 'event-data'
},
//props: ['sendData'],
// props: [],
created(){
// this.setAuthData();
// this.formReset();
},
data(){
return{
memorow: {},
totalItems: 0,
// 테이블 리스트 데이터
perPageCnt: 10,
userId: '',
grid: {
url: '/api/v1/bo/custMgt/allMemoList',
pagePerRows: 10,
pagination: true,
isCheckbox: false, // true:첫번째 컬럼 앞에 체크박스 생성 / false:체크박스 제거
initialRequest: false,
addCls: 'box_OFvis',
columns: [
{ name: 'memo', header: '내용', align: 'center', cls:'memo'},
{ name: 'register', header: '작성자', align: 'center'},
{ name: 'regDt', header: '작성일', align: 'center'},
{ name: 'delete', header: '삭제', align: 'center', renderer: {
type: CustomATagRenderer
,options: {
callback: this.deleteMemo,
}
}
},
{ name: 'seqNo', header: '내용일련번호', align: 'center', hidden: true},
],
noDataStr: '검색 결과가 없습니다.',
params: {
userId: '',
}
},
}
},
components:{
customGrid: customGrid,
},
created(){
},
mounted() {
let pageMemo = 1;
// 페이지 정보 및 검색 조건
const getCondition_memo = this.$store.getters['searchcondition/getSearchCondition'];
console.log('getCondition_memo : '+getCondition_memo);
// store에 저장된 페이지 정보 및 검색 조건을 불러오기
let isKeepMemo = false;
if (getCondition_memo) {
this.grid.pagePerRows = getCondition_memo.perPage;
this.grid.params = getCondition_memo.params;
pageMemo = getCondition_memo.page;
isKeepMemo = 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();
},
sendStoreData: function() {
const getP_memo = this.$refs.table.getPagination();
this.$store.commit('searchcondition/updateSearchCondition', {
page: getP_memo._currentPage,
perPage: this.perPageCnt,
params: {
userId : this.userId,
}
});
const getCondition_memo = this.$store.getters['searchcondition/getSearchCondition'];
console.log("getCondition_memo : "+ getCondition_memo.perPage);
},
//메모전체 모달 Open
async memoTotalModalOpen(props){
this.grid.params.userId = props.adminId;
this.userId = props.adminId;
console.log(props.adminId);
// 메모 모달팝업 오픈
var dimmed = document.getElementsByClassName('memoTotal');
for(var i = 0; i < dimmed.length; i++){
dimmed[i].style.display = 'block';
}
// 리스트 그리드 오픈
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);
},
//메모전체 모달 Close
memoTotalModalClose(){
var dimmed = document.getElementsByClassName('memoTotal');
for(var i = 0; i < dimmed.length; i++){
dimmed[i].style.display = 'none';
}
//this.formReset();
},
toComplete(){
this.row.serviceId = this.adminId;
this.memoTotalModalClose();
this.$parent.memberDetail(this.adminId);
},
deleteMemo: function(props) {
console.log(props);
var param = {};
param.seqNo = props.seqNo;
param.userId = this.userId;
this.deleteMemoConfirm(param);
},
async deleteMemoConfirm(target){
if(window.confirm('삭제 하시겠습니까?')){
try {
const response = await custMgtApi.deleteMemo(target);
const result = response.data;
console.log(result);
if (result != null && result.retCode == "0000") {
// alert('삭제 성공');
// 그리드 reload
// 리스트 그리드 오픈
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);
} else {
alert("실패 하였습니다.");
}
} catch (error) {
console.log(error);
alert("실패 하였습니다.");
}
}
}
}
}
</script>

View File

@@ -89,7 +89,7 @@
</div>
<!-- 사용자 등록 - 휴대폰번호 형식 체크 -->
<div class="dimmed valication-phonenumber" @click="valicationPhonenumberClose();"></div>
<div class="dimmed valication-phonenumber" @click="validationPhonenumberClose();"></div>
<div class="popup-wrap valication-phonenumber">
<div class="popup valication-phonenumber">
<div class="pop-head">
@@ -99,7 +99,7 @@
<p>휴대폰번호를 확인해 주세요.</p>
</div>
<div class="pop-btn1">
<button class="btn-pcolor" @click="valicationPhonenumberClose();">확인</button>
<button class="btn-pcolor" @click="validationPhonenumberClose();">확인</button>
</div>
</div>
</div>
@@ -138,6 +138,23 @@
</div>
</div>
<!-- 사용자 수정(청약고객:sub) 확인 -->
<div class="dimmed confirm-update-sub" @click="confirmUpdateSubClose();"></div>
<div class="popup-wrap confirm-update-sub">
<div class="popup confirm-update-sub">
<div class="pop-head">
<h3 class="pop-tit">사용자(청약고객) 수정 확인</h3>
</div>
<div class="pop-cont">
<p>변경된 내용을 저장하시겠습니까?</p>
</div>
<div class="pop-btn2">
<button class="btn-pcolor" @click="confirmUpdateSub();">확인</button>
<button class="btn-default" @click="confirmUpdateSubClose();">취소</button>
</div>
</div>
</div>
<!-- 사용자 ID 생성 파일 업로드 - 성공 -->
<div class="dimmed success-fileupload" @click="successFileuploadClose();"></div>
<div class="popup-wrap success-fileupload">
@@ -177,8 +194,6 @@ export default {
dimmed[i].style.display = 'block';
}
//this.$parent.
},
//사용자등록 - 최초등록
confirmInsert(){
@@ -187,7 +202,7 @@ export default {
dimmed[i].style.display = 'none';
}
//this.$parent.
this.$parent.memberInsert();
},
//사용자등록 - 최초등록 Close
@@ -237,7 +252,7 @@ export default {
dimmed[i].style.display = 'none';
}
this.$parent.updateAdminInfo();
this.$parent.memberUpdate();
},
// 사용자 수정 Close
@@ -247,7 +262,31 @@ export default {
dimmed[i].style.display = 'none';
}
this.toComplete();
},
//사용자 수정(청약고객-sub) 확인 Open
confirmUpdateSubOpen(){
var dimmed = document.getElementsByClassName('confirm-update-sub');
for(var i = 0; i < dimmed.length; i++){
dimmed[i].style.display = 'block';
}
},
//사용자 수정(청약고객-sub) 확인
confirmUpdateSub(){
var dimmed = document.getElementsByClassName('confirm-update-sub');
for(var i = 0; i < dimmed.length; i++){
dimmed[i].style.display = 'none';
}
this.$parent.updateAdminInfo();
},
// 사용자 수정(청약고객-sub) Close
confirmUpdateSubClose(){
var dimmed = document.getElementsByClassName('confirm-update-sub');
for(var i = 0; i < dimmed.length; i++){
dimmed[i].style.display = 'none';
}
},
// 이메일 형식 체크 Open
@@ -265,6 +304,8 @@ export default {
dimmed[i].style.display = 'none';
}
this.$parent.checkEmailFocus();
},
// 아이디 중복 체크 Open
validationIdDuplicateOpen(){
@@ -281,6 +322,8 @@ export default {
dimmed[i].style.display = 'none';
}
this.$parent.checkIdDupFocus();
},
// 최대 등록 제한 Open
validationMaxlimitOpen(){
@@ -297,9 +340,11 @@ export default {
dimmed[i].style.display = 'none';
}
this.$parent.toComplete();
},
// 휴대폰번호 형식 체크 Open
valicationPhonenumberOpen(){
validationPhonenumberOpen(){
var dimmed = document.getElementsByClassName('valication-phonenumber');
for(var i = 0; i < dimmed.length; i++){
dimmed[i].style.display = 'block';
@@ -307,11 +352,12 @@ export default {
},
// 휴대폰번호 형식 체크 Close
valicationPhonenumberClose(){
validationPhonenumberClose(){
var dimmed = document.getElementsByClassName('valication-phonenumber');
for(var i = 0; i < dimmed.length; i++){
dimmed[i].style.display = 'none';
}
this.$parent.checkPhoneFocus();
},
// 사용자 ID 생성 파일 업로드 - 성공 Open

View File

@@ -43,6 +43,35 @@ const updateAdminInfo = (params) => {
return httpClient.post('/api/v1/bo/custMgt/updateAdminInfo', params);
}
// 사용자 ID 생성
const insertUser = (params) => {
return httpClient.post('/api/v1/bo/custMgt/insertUser', params);
}
// 사용자 ID 수정
const updateUser = (params) => {
return httpClient.post('/api/v1/bo/custMgt/updateUser', params);
}
// 사용자 ID 대량등록
const insertMassUser = (params) => {
return httpClient.post('/api/v1/bo/custMgt/insertMassUser', params);
}
// 사용자 ID (리스트) 삭제
const deleteUser = (params) => {
return httpClient.post('/api/v1/bo/custMgt/deleteUser', params);
}
// 관리자정보 종합(사용자정보, 메모, 발송한도) 수정
const updateAdminInfoTotal = (params) => {
return httpClient.post('/api/v1/bo/custMgt/updateAdminInfoTotal', params);
}
// 메모삭제
const deleteMemo = (params) => {
return httpClient.post('/api/v1/bo/custMgt/deleteMemo', params);
}
const getExcelHeader = category => {
// 엑셀에 출력할 Header 정보를 Mockup 데이터로 관리한다.
@@ -76,4 +105,10 @@ export default {
memberAdminDetail,
selectSearchMadangId,
updateAdminInfo,
insertUser,
updateUser,
insertMassUser,
deleteUser,
updateAdminInfoTotal,
deleteMemo,
}

View File

@@ -22,29 +22,5 @@
"name": "ID잠금"
}
]
],
"body": [
[
{
"key": "id",
"name": ""
},
{
"key": "userNm",
"name": ""
},
{
"key": "mdn",
"name": ""
},
{
"key": "email",
"name": ""
},
{
"key": "stat",
"name": ""
}
]
]
}

View File

@@ -45,9 +45,9 @@
<th class="center">라인타입</th>
<td colspan="2">
<select name="" id="" v-model="lineType">
<option value="ID">일반</option>
<option value="이름">실시간</option>
<option value="관리자ID">배치</option>
<option value="NORMAL">일반</option>
<option value="BATCH">배치</option>
<option value="REAL">실시간</option>
</select>
</td>
</tr>
@@ -66,12 +66,16 @@
<th>메모</th>
<td colspan="5">
<div class="input-memo">
<textarea class="memo_text" cols="160" rows="10" placeholder="메모 입력란입니다. 작성글은 저장 버튼으로 저장되고 마지막 저장 내용은 남아 있습니다" v-model="memo"></textarea>
<textarea class="memo_text" placeholder="메모 입력란입니다. 작성글은 저장 버튼으로 저장되고 마지막 저장 내용은 남아 있습니다" v-model="memo"></textarea>
<!--
<textarea class="memo_text" cols="160" rows="10" placeholder="메모 입력란입니다. 작성글은 저장 버튼으로 저장되고 마지막 저장 내용은 남아 있습니다" v-model="memo"></textarea>
-->
<!--
textarea 구글 검색하셔서 태그 옵션 확인해보면 좋아요
<textarea name="" id="" cols="30" rows="10" placeholder="메모 입력란입니다. 작성글은 저장 버튼으로 저장되고 마지막 저장 내용은 남아 있습니다"></textarea>
-->
<button type="button" class="button grey btn-a">전체 메모보기</button>
<button type="button" class="button grey btn-a" @click="memoTotalPopOpen();">전체 메모보기</button>
</div>
</td>
</tr>
@@ -86,9 +90,9 @@
<p>( 최대 100개까지 등록 가능 )</p>
</div>
<div class="button_group">
<button type="button" class="button blue add">사용자 ID 생성</button>
<button type="button" class="button blue add" @click="memberInsertPopOpen();">사용자 ID 생성</button>
<button type="button" class="button blue add" @click="excelPopOpen();">사용자 ID 대량생성</button>
<button type="button" class="button white del">삭제</button>
<button type="button" class="button white del" @click="memberDelete">삭제</button>
</div>
</div>
@@ -105,7 +109,7 @@
</colgroup>
<thead>
<tr>
<th><input type="checkbox" id="admin_check1"><label for="admin_check1"></label></th>
<th><input type="checkbox" id="admin_check1" v-model="selectAll"><label for="admin_check1"></label></th>
<th>NO</th>
<th>ID</th>
<th>이름</th>
@@ -116,13 +120,16 @@
</thead>
<tbody>
<tr v-for="(option, i) in list" v-bind:key="i">
<td><input type="checkbox" checked="" id="admin_check2"><label for="admin_check2"></label></td>
<td><input type="checkbox" :id="'chk'+option.userId" v-model="selected" :value="option.userId"><label :for="'chk'+option.userId"></label></td>
<td>{{ option.no }}</td>
<td>{{ option.userId }}</td>
<td>{{ option.userNm }}</td>
<td>{{ option.mdn }}</td>
<td><input type="checkbox" id="user_id_status01" name="user_id_status"><label class="toggle_switch" for="user_id_status01"></label></td>
<td><button type="button" class="button white btn-a">수정</button></td>
<td>
<input type="checkbox" id="user_id_status01" name="user_id_status" v-model="option.userStat" true-value='정상' false-value='사용중지' disabled/>
<label class="toggle_switch" for="user_id_status01"></label>
</td>
<td><button type="button" class="button white btn-a" @click="memberUpdatePopOpen(option.userId);">수정</button></td>
</tr>
</tbody>
</table>
@@ -130,11 +137,14 @@
</div>
<div class="pop-btn2">
<button class="btn-default" type="button" @click="toComplete();">취소</button>
<button class="btn-pcolor" type="button">저장</button>
<button class="btn-pcolor" type="button" @click="updateAdminInfoTotal();">저장</button>
</div>
<member-bulk-reg-pop ref="memberBulkRegPop"> </member-bulk-reg-pop>
<member-reg-pop ref="memberRegPop"> </member-reg-pop>
<member-modify-pop ref="memberModifyPop"> </member-modify-pop>
<memo-total-pop ref="memoTatalListPop"> </memo-total-pop>
</div>
</div>
@@ -144,9 +154,17 @@
<script>
import custMgtApi from "../service/custMgtApi.js";
import MemberBulkRegPop from '../components/MemberBulkRegPop';
import MemberRegPop from '../components/MemberRegPop';
import MemberModifyPop from '../components/MemberModifyPop';
import MemoTotalPop from '../components/MemoTotalPop';
export default {
name: 'memberAdminDetail',
watch:{
stat(){
console.log('watch : ', this.stat)
}
},
data() {
return {
row:{},
@@ -166,6 +184,8 @@ export default {
memo: '',
mdn : '',
email: '',
userTotalCnt:0,
selected: [],
}
},
@@ -177,6 +197,9 @@ export default {
},
components: {
MemberBulkRegPop,
MemberRegPop,
MemberModifyPop,
MemoTotalPop,
},
created(){
this.memberDetail(this.$route.params.serviceId);
@@ -184,11 +207,37 @@ export default {
this.$store.commit("login/isAuthChk", true);
},
destroyed() {
this.$store.commit('searchcondition/updateSearchCondition', {
page: 1,
perPage: 50,
params: {
searchType1: '',
searchType2: '',
searchText1: ''}
});
},
mounted() {
mounted() {
},
},
computed:{
selectAll: {
get() {
return this.list ? (this.selected ? (this.selected.length === this.list.length) : false) : false;
},
set(value) {
const selected = [];
if (value) {
this.list.forEach((com) => {
selected.push(com.userId);
});
}
this.selected = selected;
},
},
},
methods: {
async memberDetail(serviceId){
this.row.userId = serviceId;
@@ -196,6 +245,7 @@ export default {
const response = await custMgtApi.memberAdminDetail(this.row);
const result = response.data;
if (result != null && result.retCode == "0000") {
this.formReset();
this.userNm = result.data.userNm;
this.userId = result.data.userId;
this.regDt = result.data.regDt;
@@ -210,6 +260,38 @@ export default {
this.mdn = result.data.mdn;
this.email = result.data.email;
this.list = result.data.list;
this.userTotalCnt = result.data.list.length;
console.log('userTotalCnt:'+result.data.list.length);
this.totalItems = result.data.paging.totalCnt;
}
} catch (error) {
console.log(error);
alert("실패 하였습니다.");
}
},
async updateAdminInfoTotal(){
this.row.userId = this.adminId;
this.row.sendingLimit = this.sendingLimit;
this.row.lineType = this.lineType;
this.row.userStat = this.userStat;
this.row.memo = this.memo;
console.log(this.row);
try {
const response = await custMgtApi.updateAdminInfoTotal(this.row);
const result = response.data;
if (result != null && result.retCode == "0000") {
alert("저장 완료하였습니다.");
}else if(result != null && result.retCode == "4019"){
alert("발송한도금액이 정액한도금액보다 작습니다.");
}else {
alert("실패 하였습니다.");
}
} catch (error) {
console.log(error);
@@ -223,8 +305,52 @@ export default {
},
excelPopOpen() {
console.log(this.adminId);
this.$refs.memberBulkRegPop.excelPopOpen(this.adminId);
this.$refs.memberBulkRegPop.excelPopOpen(this.adminId, this.totalItems);
},
memberUpdatePopOpen(target) {
this.row.userId = target;
this.row.adminId = this.adminId;
this.$refs.memberModifyPop.memberUpdateModalOpen(this.row);
},
memberInsertPopOpen() {
this.row.adminId = this.adminId;
this.row.userTotalCnt = this.userTotalCnt;
this.$refs.memberRegPop.memberInsertModalOpen(this.row);
},
memoTotalPopOpen(){
this.row.adminId = this.adminId;
this.$refs.memoTatalListPop.memoTotalModalOpen(this.row);
},
async memberDelete(){
// console.log(this.selected)
if(window.confirm('삭제 하시겠습니까?')){
this.row.list = this.selected;
console.log(this.row);
try {
const response = await custMgtApi.deleteUser(this.row);
const result = response.data;
if (result != null && result.retCode == "0000") {
//alert("저장 완료하였습니다.");
}
} catch (error) {
console.log(error);
alert("실패 하였습니다.");
}
}
},
setAuthData() {
// 권한 옵션.
api.commAuth().then(response => {
this.authType = response.data.data.list;
});
},
formReset(){
Object.assign(this.$data, this.$options.data());
},
},
};

View File

@@ -21,7 +21,7 @@
<tr class="tr_input">
<th>이름</th>
<td colspan="2">
<input type="text" v-model="userNm">
<input type="text" v-model="userNm" ref="_userNm">
</td>
</tr>
<tr>
@@ -42,19 +42,19 @@
<tr class="tr_input">
<th>휴대폰번호</th>
<td colspan="2">
<input type="text" v-model="mdn">
<input type="text" v-model="mdn" ref="_phone">
</td>
<th class="center">이메일</th>
<td colspan="2">
<input type="text" v-model="email">
<input type="text" v-model="email" ref="_email">
</td>
</tr>
<tr class="w30">
<th>잠금</th>
<td colspan="2">
<input type="radio" name="userStat" value="01" id="right_radio1" v-model="userStat">
<input type="radio" name="userStat" value="01" id="right_radio1" v-model="stat">
<label for="right_radio1">사용</label>
<input type="radio" name="userStat" value="02" id="right_radio2" v-model="userStat">
<input type="radio" name="userStat" value="02" id="right_radio2" v-model="stat">
<label for="right_radio2">정지</label>
</td>
<th class="center">최종접속일</th>
@@ -67,24 +67,34 @@
<div class="pop-btn2">
<button class="btn-default" type="button" @click="toComplete();">취소</button>
<button class="btn-pcolor" type="button">저장</button>
<button class="btn-pcolor" type="button" @click="memberUpdate();">저장</button>
</div>
<validation-confirm-pop ref="validationConfirmPopModal"> </validation-confirm-pop>
</div>
</div>
</template>
<script>
import custMgtApi from "../service/custMgtApi.js";
import { utils_mixin, chkPattern2 } from '../service/mixins';
import ValidationConfirmPop from '../components/ValidationConfirmPop.vue';
import lodash from "lodash";
export default {
name: 'memberDetail',
mixins: [utils_mixin, chkPattern2],
watch:{
stat(){
console.log('watch : ', this.stat)
}
},
components: {
ValidationConfirmPop,
},
data() {
return {
row:{},
@@ -102,6 +112,7 @@ export default {
memo: '',
mdn : '',
email: '',
stat:'',
}
},
@@ -141,7 +152,7 @@ export default {
this.adminNm = result.data.adminNm;
this.sendingLimit = result.data.sendingLimit;
this.lineType = result.data.lineType;
this.userStat = result.data.userStat;
this.stat = result.data.userStat;
this.lastLoginDt = result.data.lastLoginDt;
this.memo = result.data.memo;
this.mdn = result.data.mdn;
@@ -154,10 +165,86 @@ export default {
}
},
async memberUpdate(){
if(!this.doValidate()){
return false;
}
this.row.userId = this.userId;
this.row.userNm = this.userNm;
this.row.userEmail = this.email;
this.row.mdn = this.mdn;
this.row.userStat = this.stat;
try {
const response = await custMgtApi.updateUser(this.row);
const result = response.data;
console.log(result);
if (result != null && result.retCode == "0000") {
alert('저장 완료하였습니다.');
this.toComplete();
} else {
alert("실패 하였습니다.");
}
} catch(err) {
alert("실패 하였습니다.");
}
},
// 저장 후 부모창 호출.
toComplete(){
this.$router.push({ name: 'memberList', params: this.row });
},
doValidate(){
if(this.isNull(this.userNm)){
alert("이름을 입력해 주세요");
this.$refs._userNm.focus();
return false;
}
if(this.isNull(this.email)){
alert('이메일을 입력해주세요.');
this.$refs._email.focus();
return false;
}
const email = this.email;
if(!this.isNull(email) && !lodash.isEqual(email,'@') && !this.emailCheck(email)){
alert("이메일 형식이 잘못되었습니다. 확인해 주세요");
this.$refs._email.focus();
//this.$refs.validationConfirmPopModal.validationEmailOpen();
return false;
}
if(this.isNull(this.mdn)){
alert('휴대폰번호를 입력해주세요.');
this.$refs._phone.focus();
return false;
}
const hp = this.mdn;
if(!this.isNull(hp) && !this.isMobile(hp)){
alert("휴대폰 번호 형식이 잘못되었습니다. 확인해 주세요");
this.$refs._phone.focus();
//this.$refs.validationConfirmPopModal.validationPhonenumberOpen();
return false;
}
if(this.isNull(this.stat)){
alert('상태를 선택 해주세요.');
return false;
}
return true;
},
checkPhoneFocus(){
//this.mdn = '';
this.$refs._phone.focus();
},
checkEmailFocus(){
//this.email = '';
this.$refs._email.focus();
},
},
};
</script>

View File

@@ -354,7 +354,7 @@ export default {
// this.row.msg = '변경된 내용을 저장하시겠습니까?';
// console.log(this.row);
// this.$refs.confirmPop.confirmModalOpen(this.row);
this.$refs.validationConfirmPop.confirmUpdateOpen();
this.$refs.validationConfirmPop.confirmUpdateSubOpen();
}
},