mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-06 23:18:19 +09:00
admin_chrg 체크시 삭제 수정중
This commit is contained in:
@@ -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();
|
||||
},
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -590,6 +590,10 @@ public class CustMgtController {
|
||||
@RequestMapping(value="/deleteChrg", method= {RequestMethod.POST})
|
||||
@ResponseBody
|
||||
public DeleteChrgResDto deleteChrg(@RequestBody @Valid DeleteChrgReqDto deleteChrgReqDto, BindingResult bindingResult) {
|
||||
|
||||
logger.debug("deleteChrgReqDto={}",deleteChrgReqDto.getList());
|
||||
logger.debug("deleteChrgReqDto={}",deleteChrgReqDto.getList().get(0));
|
||||
|
||||
if(validComponents.validParameter(bindingResult)) {
|
||||
return new DeleteChrgResDto(ApiResponseCode.CM_PARAMETER_ERROR);
|
||||
}
|
||||
|
||||
@@ -1166,6 +1166,8 @@ public class CustMgtService {
|
||||
* @return
|
||||
*/
|
||||
public DeleteChrgResDto DeleteChrg(@Valid DeleteChrgReqDto deleteChrgReqDto) {
|
||||
|
||||
logger.debug("deleteChrgReqDto={}",deleteChrgReqDto);
|
||||
CustMgtMapper custMgtMapper = sqlSessionMaster.getMapper(CustMgtMapper.class);
|
||||
custMgtMapper.deleteChrg(deleteChrgReqDto);
|
||||
return new DeleteChrgResDto(ApiResponseCode.SUCCESS);
|
||||
|
||||
13
src/main/java/kr/co/uplus/ez/api/custMgt/dto/ChrgDelete.java
Normal file
13
src/main/java/kr/co/uplus/ez/api/custMgt/dto/ChrgDelete.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package kr.co.uplus.ez.api.custMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public class ChrgDelete implements Serializable {
|
||||
|
||||
@ApiModelProperty(example = "사용여부", name = "사용여부", dataType = "String")
|
||||
private String useYn;
|
||||
@ApiModelProperty(example = "충전seq", name = "충전seq", dataType = "String")
|
||||
private String chrgSeq;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package kr.co.uplus.ez.api.custMgt.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -14,4 +15,5 @@ public class DeleteChrgReqDto implements Serializable{
|
||||
@ApiModelProperty(example = "충전seq", name = "충전seq", dataType = "String")
|
||||
private String chrgSeq;
|
||||
|
||||
private List<ChrgDelete> list;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user