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

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

@@ -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();
}
},