admin_chrg 체크시 삭제 수정중

This commit is contained in:
2023-03-28 14:38:03 +09:00
parent bcc10f0947
commit 2127cc00d2
7 changed files with 97 additions and 16 deletions

View File

@@ -181,7 +181,6 @@ export default {
},
ChrgDetailClose(){
console.log("1")
var dimmed = document.getElementsByClassName('modal53');
for(var i = 0; i < dimmed.length; i++){
dimmed[i].style.display = 'none';
@@ -240,7 +239,6 @@ export default {
},
toComplete(){
console.log("8")
this.$parent.$refs.table.reloadData();
this.ChrgDetailClose();
},

View File

@@ -146,6 +146,8 @@ export default {
custSeq : '',
chrgSeq : '',
row: {},
}
},
components: {
@@ -265,11 +267,6 @@ export default {
this.endDate = initEndDate;
},
saveChrg(){
console.log("this.userId: ", this.userId)
console.log("this.startDate: ", this.startDate)
console.log("this.endDate: ", this.endDate)
console.log("this.chrgAmtE: ", this.chrgAmtE)
let param = {
userId : this.userId,
@@ -278,17 +275,21 @@ export default {
chrgAmt : this.chrgAmtE,
}
custMgtApi
.insertChrg(param)
.then((respose)=> {
custMgtApi.insertChrg(param).then((respose)=> {
var result = respose.data;
if (result.success) {
alert("충전금이 등록되었습니다.");
} else {
// alert("오류가 발생하였습니다");
}
if (result != null && result.retCode == "0000"){
this.row.title = '충전금';
this.row.msg1 = '등록 하였습니다.';
this.$parent.alertInsert(this.row);
this.toComplete();
}
})
},
toComplete(){
this.$parent.$refs.table.reloadData();
this.insertChrgClose();
},
},
};
</script>

View File

@@ -109,6 +109,7 @@ import moment from 'moment';
import InsertChrgModal from '../components/InsertChrgModal';
import chrgDetailPop from '../components/ChrgDetailPop.vue';
import commonModal from "@/components/modal/commonModal";
import custMgtApi from '../service/custMgtApi';
class CustomATagRenderer {
constructor(props) {
@@ -151,7 +152,7 @@ export default {
endYear: '',
endMonth: '',
row: {},
searchType1: '01',
chrgSeq : '',
useYn: '',
@@ -350,10 +351,70 @@ export default {
insertChrg () {
this.$refs.insertChrgModal.insertChrgOpen();
},
deleteChrg(){
if (this.doValidate()) {
this.row.title = '충전금 관리';
this.row.msg1 = '삭제 하시겠습니까?';
console.log("row.list", this.row.list)
this.$refs.commonModal.confirmModalOpen2(this.row);
}
},
async chrgdelete() {
try {
console.log("this.row",this.row)
let respose = await custMgtApi.deleteChrg(this.row);
const result = respose.data;
if (result != null && result.retCode == '0000') {
this.$refs.table.reloadData();
return;
} else {
this.row.title = '충전금 관리';
this.row.msg1 = '실패 하였습니다.';
this.$refs.commonModal.alertModalOpen(this.row);
}
} catch (error) {
this.row.title = '충전금 관리';
this.row.msg1 = '실패 하였습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
}
},
alertInsert(props) {
this.$refs.commonModal.alertModalOpen(props);
},
doValidate() {
//로우데이터 삭제하도록 수정
// this.totalItems==1
// if (this.totalItems == 0) {
// this.row.title = '충전금 관리';
// this.row.msg1 = '검색 결과가 없습니다.';
// this.$refs.commonModal.alertModalOpen(this.row);
// return false;
// }
var chkList = this.$refs.table.checkedElementDatas();
console.log("chkList",chkList)
// console.log("chkList.length", chkList.length)
if (chkList.length == 0) {
this.row.title = '충전금 관리';
this.row.msg1 = '삭제대상을 체크를 해주세요.';
this.$refs.commonModal.alertModalOpen(this.row);
return false;
}
console.log("row.chrgSeq",this.row.chrgSeq)
const param = chkList.map((row) => ({ chrgSeq: row.chrgSeq }));
console.log("param",param)
// console.log("chrgSeq",chrgSeq)
this.row.list = param;
return true;
},
confirmCalbackFnc(props) {
if (props.result) {
this.chrgdelete();
}
},
}
}
</script>