차감기능, 유선기능 추가

This commit is contained in:
zxcxz2002
2023-03-13 05:32:30 +09:00
parent 5d397023bf
commit fb136e3c03
7 changed files with 127 additions and 27 deletions
@@ -40,6 +40,7 @@ public class SellInfoDto extends BaseDto{
String payBackNumber;
String etc;
String guestKinds;
long deduction;
long installment;
long phoneId;
@@ -82,7 +83,8 @@ public class SellInfoDto extends BaseDto{
.installment(sellInfo.getInstallment())
.phoneId(sellInfo.getPhoneId())
.usim(sellInfo.getUsim())
.faceValueRebate(sellInfo.getFaceValueRebate())
.faceValueRebate(sellInfo.getFaceValueRebate())
.deduction(sellInfo.getDeduction())
.guestMoney(sellInfo.getGuestMoney())
.introductionPay(sellInfo.getIntroductionPay())
.payBack(sellInfo.getPayBack())
@@ -48,6 +48,7 @@ public class SellInfo extends BaseEntity{
private long disclosureSubsidy;
private long addRebate;
private long cashRebate;
private long deduction;
private boolean payBackYn;
private boolean disclosureSubsidyYn;
@@ -33,6 +33,7 @@ public class SellAddInfoParameter{
private long faceValueRebate;
private long guestMoney;
private long introductionPay;
private long deduction;
private long payBack;
private String payBackDay;
private String payBackBank;
@@ -122,6 +122,7 @@ public class SellInfoServiceImpl implements SellInfoService{
.formula(parameter.getFormula())
.payBackYn(parameter.isPayBackYn())
.payBackBank(parameter.getPayBackBank())
.deduction(parameter.getDeduction())
.payBackNumber(parameter.getPayBackNumber())
.installment(parameter.getInstallment())
.phoneId(parameter.getPhoneId())
@@ -30,6 +30,7 @@ let appVue = new Vue({
insertType: 'change',
usim: '',
formula: '',
addFormula: '',
faceValueRebate: '',
guestMoney: '',
introductionPay: '',
@@ -44,7 +45,9 @@ let appVue = new Vue({
addRebate: '',
cashRebate: '',
etc: '',
guestKind: ''
guestKind: '',
deductionFormula: '',
deduction: ''
},
mounted: function () {
this.init();
@@ -102,18 +105,12 @@ let appVue = new Vue({
alert('생일을 입력하세요');
return false;
}
if($this.phoneNumber== ''){
alert('핸드폰번호를 입력하세요');
return false;
}
if($this.mainRatePlan== ''){
alert('요금제를 입력하세요');
return false;
}
if($this.phoneId== ''){
alert('핸드폰을 선택하세요');
return false;
}
if($this.formula== ''){
alert('리베이트 계산식을 입력하세요');
return false;
@@ -126,9 +123,19 @@ let appVue = new Vue({
alert('현금수납를 입력하세요');
return false;
}
if($this.factoryPrice== '' ||$this.factoryPrice== 0){
alert('출고가를 입력하세요');
return false;
if($this.insertType != 'other'){
if($this.phoneNumber== ''){
alert('핸드폰번호를 입력하세요');
return false;
}
if($this.phoneId== ''){
alert('핸드폰을 선택하세요');
return false;
}
if($this.factoryPrice== '' ||$this.factoryPrice== 0){
alert('출고가를 입력하세요');
return false;
}
}
if($this.disclosureSubsidy != '' && $this.disclosureSubsidy != 0 && $this.disclosureSubsidy != '0'){
$this.disclosureSubsidyYn = true;
@@ -136,20 +143,30 @@ let appVue = new Vue({
let index = $('#businessPartner').find(':selected').index();
//시리얼 입력 여부
if($this.info.businessPartnerList[index].serialYn){
let confirmAction = confirm("시리얼 번호 필수인데 그냥 입력 하시겠습니까?");
if (confirmAction) {
}else{
return false;
if($this.serialNumber == ''){
let confirmAction = confirm("시리얼 번호 필수인데 그냥 입력 하시겠습니까?");
if (confirmAction) {
}else{
return false;
}
}
}
debugger;
let realFormula = $this.formula;
if($this.addRebate != '' && $this.addRebate != 0 && $this.addRebate != '0'){
realFormula = realFormula + '+' + $this.addFormula;
}
if($this.deduction != '' && $this.deduction != 0 && $this.deduction != '0'){
realFormula = realFormula + $this.deductionFormula;
}
let parameter = {
openingDate : $this.openingDate,
birthday : $this.birthday,
pbirthday : $this.pbirthday,
payBackDay : $this.payBackDay,
usim : $this.usim.replaceAll(',', ''),
faceValueRebate : $this.faceValueRebate.replaceAll(',', ''),
guestMoney : $this.guestMoney.replaceAll(',', ''),
@@ -159,6 +176,7 @@ let appVue = new Vue({
disclosureSubsidy : $this.disclosureSubsidy.replaceAll(',', ''),
cashRebate: $this.cashRebate.replaceAll(',', ''),
addRebate: $this.addRebate.replaceAll(',', ''),
deduction : $this.deduction.replaceAll(',', '').replaceAll('-', ''),
businessPartner : $this.businessPartner,
mobileCarrier : $this.mobileCarrier,
@@ -172,7 +190,7 @@ let appVue = new Vue({
installment : $this.installment,
phoneId : $this.phoneId,
insertType : $this.insertType,
formula : $this.formula,
formula : realFormula,
payBackYn : $this.payBackYn,
payBackBank : $this.payBackBank,
payBackNumber : $this.payBackNumber,
@@ -315,7 +333,7 @@ let appVue = new Vue({
formulaChange: function(e){
let $this = this;
var result = 0;
var calc = e.target.value; //-1-2-3 = -6
var calc = $this.formula+'+'+$this.addFormula + $this.deductionFormula; //-1-2-3 = -6
var plusList = calc.split('+');//-1-2-3
for(var i=0;i<plusList.length;i++){
@@ -337,6 +355,59 @@ let appVue = new Vue({
var value = result*10000;
$this.faceValueRebate = moneyText(value.toString());
},
addFormulaChange: function(e){
let $this = this;
var result = 0;
var calc = $this.addFormula; //-1-2-3 = -6
var plusList = calc.split('+');//-1-2-3
for(var i=0;i<plusList.length;i++){
if(plusList[i].indexOf('-') == -1){ //only 숫자
result += Number(plusList[i]);
}else{
var subList = plusList[i].split('-');//-1-2-3
for(var j=0;j<subList.length;j++){
if(subList[j] == '' && j == 0){
}else if(subList[j] != '' && j == 0){
result +=Number(subList[j]);
}else{
result -=Number(subList[j]);
}
}
}
}
var value = result*10000;
$this.addRebate = moneyText(value.toString());
$this.formulaChange();
},
deductionFormulaChange: function(e){
let $this = this;
var result = 0;
var calc = $this.deductionFormula; //-1-2-3 = -6
var plusList = calc.split('+');//-1-2-3
for(var i=0;i<plusList.length;i++){
if(plusList[i].indexOf('-') == -1){ //only 숫자
result += Number(plusList[i]);
}else{
var subList = plusList[i].split('-');//-1-2-3
for(var j=0;j<subList.length;j++){
if(subList[j] == '' && j == 0){
}else if(subList[j] != '' && j == 0){
result +=Number(subList[j]);
}else{
result -=Number(subList[j]);
}
}
}
}
var value = result*10000;
$this.deduction = moneyText(value.toString());
$this.formulaChange();
},
callMoneyText: function(value){
return moneyText(value);
},
+26 -4
View File
@@ -46,7 +46,7 @@
<div class="row d-flex justify-content-center">
<label for="formula" class="col-sm-2 col-form-label mb-3 pt-3">계산식</label>
<div class="col-sm-3 mb-3 pt-3">
<input type="text" class="form-control" id="formula" value="1+2+4+5+6-2" v-model="formula" @input="formulaChange" tabindex="4">
<input type="text" class="form-control" id="formula" value="1+2+4+5+6-2" v-model="formula" @input="formulaChange" tabindex="3">
</div>
<div class="vr p-0 m-0"></div>
<label for="faceValueRebate" class="col-sm-2 col-form-label mb-3 pt-3">R(액면R/B)</label>
@@ -54,6 +54,28 @@
<input type="text" class="form-control" id="faceValueRebate" v-model="faceValueRebate" disabled="disabled" value="160000">
</div>
</div>
<div class="row d-flex justify-content-center">
<label for="formula" class="col-sm-2 col-form-label mb-3 pt-3">추가 계산식</label>
<div class="col-sm-3 mb-3 pt-3">
<input type="text" class="form-control" id="addFormula" value="1+2+4+5+6-2" v-model="addFormula" @input="addFormulaChange" tabindex="4">
</div>
<div class="vr p-0 m-0"></div>
<label for="faceValueRebate" class="col-sm-2 col-form-label mb-3 pt-3">추가R/B</label>
<div class="col-sm-3 mb-3 pt-3">
<input type="text" class="form-control" id="addRebate" v-model="addRebate" value="130000" disabled="disabled">
</div>
</div>
<div class="row d-flex justify-content-center">
<label for="formula" class="col-sm-2 col-form-label mb-3 pt-3">차감 계산식</label>
<div class="col-sm-3 mb-3 pt-3">
<input type="text" class="form-control" id="deductionFormula" value="1+2+4+5+6-2" v-model="deductionFormula" @input="deductionFormulaChange" tabindex="4">
</div>
<div class="vr p-0 m-0"></div>
<label for="faceValueRebate" class="col-sm-2 col-form-label mb-3 pt-3">차감</label>
<div class="col-sm-3 mb-3 pt-3">
<input type="text" class="form-control" id="deduction" v-model="deduction" value="130000" disabled="disabled">
</div>
</div>
<div class="row d-flex justify-content-center">
<label for="cashRebate" class="col-sm-2 col-form-label mb-3">P(현금수납 or 상품권)</label>
<div class="col-sm-3 mb-3">
@@ -78,7 +100,7 @@
</div>
</div>
</div>
※ 유선시 P(현금수납 or 상품권) = 고객현금 + 페이백(P/B)
<h5 class="mt-3 mb-3">고객정보 등록</h5>
<div class="border border-2 mb-3">
<div class="row d-flex justify-content-center">
@@ -189,9 +211,9 @@
<h5 class="mt-3 mb-3">기타</h5>
<div class="border border-2 mb-3">
<div class="row d-flex justify-content-center">
<label for="addRebate" class="col-sm-2 col-form-label mb-3 pt-3">추가R/B</label>
<label for="" class="col-sm-2 col-form-label mb-3 pt-3">공란</label>
<div class="col-sm-3 mb-3 pt-3">
<input type="text" class="form-control" id="addRebate" v-model="addRebate" value="130000" @blur="addRebate = callMoneyText(addRebate)" tabindex="23">
<input type="text" class="form-control" id="" value="" disabled="disabled">
</div>
<div class="vr p-0 m-0"></div>
<label for="usim" class="col-sm-2 col-form-label mb-3 pt-3">유심비</label>
@@ -70,8 +70,10 @@
<th scope="col">액면R/B</th>
<th scope="col">추가R/B</th>
<th scope="col">고객현금</th>
<th scope="col">차감</th>
<th scope="col">차감내용</th>
<th scope="col">현금수납 or 유선상품권</th>
<th scope="col">유심비</th>
<th scope="col">수수료</th>
@@ -126,8 +128,8 @@
<td>{{callMoneyText(x.faceValueRebate)}}</td>
<td>{{callMoneyText(x.addRebate)}}</td>
<td>{{callMoneyText(x.guestMoney)}}</td>
<td>0</td>
<td>0</td>
<td>{{callMoneyText(x.deduction)}}</td> <!-- 차감 -->
<td>0</td> <!-- 차감 내용 -->
<td>{{callMoneyText(x.cashRebate)}}</td>
<td>{{callMoneyText(x.usim)}}</td>
<td>{{getFees(x)}}</td>