[fix] 建议书, 如果计算值小数为.00 的话, 就直接隐藏小数了

This commit is contained in:
tgy
2020-05-30 21:39:37 +08:00
parent 137098f7a2
commit 4d737941e6

View File

@@ -44,7 +44,7 @@
<div class="line_gray"></div>
<div class="text-center">
<label class="fs14 color_3A81F6 fw600 lh24">首年保费</label><br />
<label class="fs13 color_FFA42F lh20">{{ pageShowInfo.showInsuredDTO.totalPrem }}</label>
<label class="fs13 color_FFA42F lh20">{{ pageShowInfo.showInsuredDTO.totalPrem | numFormat}}</label>
</div>
</div>
<div class="fs15 line_title">产品计划</div>
@@ -110,7 +110,7 @@
<div v-html="initDutyColor(subItem4.dutyStairExplain)"></div>
</div>
<div class="fs13 color_666666 div_17" v-if="subItem4.dutyDetailExplain && subItem4.dutyDetailExplain != ''">
{{ subItem4.dutyDetailExplain }}
{{ subItem4.dutyDetailExplain | numFormat }}
</div>
</div>
</div>
@@ -132,7 +132,7 @@
<div v-html="initDutyColor(subItem2.dutyStairExplain)"></div>
</div>
<div class="fs13 div_17 color_666666" v-if="subItem2.dutyDetailExplain && subItem2.dutyDetailExplain != ''">
{{ subItem2.dutyDetailExplain }}
{{ subItem2.dutyDetailExplain | numFormat }}
</div>
</div>
</div>
@@ -360,6 +360,9 @@ export default {
return dataDictionary.productRateUnit[i].label
}
}
},
numFormat(str){
return str.replace(/\.00/,'')
}
},
mounted() {
@@ -395,7 +398,7 @@ export default {
methods: {
initDutyColor(code) {
if (code) {
return code.replace(new RegExp('<span>', 'g'), '<span style="color: #3a81f6;font-weight: 600;">')
return code.replace(new RegExp('<span>', 'g'), '<span style="color: #3a81f6;font-weight: 600;">').replace(/\.00/,'')
} else {
return ''
}