segment to enable enter MYR Rate

This commit is contained in:
edmondlang
2023-04-28 12:30:45 +08:00
parent cc99933f52
commit ddf85d5a30
2 changed files with 20 additions and 2 deletions
@@ -128,7 +128,7 @@
</div>
<div class="row p-t-5">
<div class="col">
<currency-converter-component :data="serviceType" :section="section" :id="data.id" v-on:newCalculation="updateCalculation($event)"></currency-converter-component>
<currency-converter-component :companySegment="data.segments" :data="serviceType" :section="section" :id="data.id" v-on:newCalculation="updateCalculation($event)"></currency-converter-component>
</div>
</div>
<div class="row p-b-15" v-if="(summary.calculation.total > 0 && (data.status === 1 || data.status === 2)) || ($store.getters.isAdmin && summary.calculation.total > 0)">
@@ -111,7 +111,7 @@
<div class="col no-padding">
<div class="form-group form-group-default m-b-0">
<label>You're Sending</label>
<input id="cc_sending" name="cc_sending" type="text" placeholder="0.00" value="0.00" v-model="senderInput" class="form-control not-allowed" @keyup="updateAmount($event, 0)" v-money="money" :disabled="true">
<input id="cc_sending" name="cc_sending" type="text" placeholder="0.00" value="0.00" v-model="senderInput" class="form-control" :class="[{'not-allowed': disabledMyr}]" @keyup="updateAmount($event, 0)" v-money="money" :disabled="disabledMyr">
</div>
</div>
<div class="col-auto bg-primary text-white">
@@ -178,6 +178,10 @@
required: true,
type: Object
},
companySegment: {
required: true,
type: Array
},
id: {
required: true,
type: Number
@@ -211,6 +215,20 @@
created(){
this.serviceType = this.data;
},
computed: {
currentSegmentNames(){
return this.companySegment.map(function (value){
return value.name;
})
},
disabledMyr(){
if (!this.currentSegmentNames.includes('Enable MYR Exchange')) {
return true;
}
return false;
},
},
watch: {
data: {
handler: function (val) {