{{ scope.row.chargePrice }}
@@ -934,18 +934,21 @@ export default {
let lfind = -1;
this.selectedData.forEach(e => {
totalOri += Number(e.amount * e.chargePriceOri); //原始实收价格
- lfind = arrayExistObj(this.asbItemsForFee, 'id', e.id)
+ lfind = arrayExistObj(this.asbItemsForFee, 'id', e.id)
if (lfind > -1 && e.chargePriceOri != 0) {
- e.chargePrice = Math.round(e.chargePriceOri * discount) / 100;
- e.discount = Math.round(10000 * e.chargePrice / e.standardPrice) / 100;
+ // 允许折扣的项目,才可以调整折扣
+ if(e.isDiscount == 'Y'){
+ e.chargePrice = Math.round(e.standardPrice * discount) / 100;
+ e.discount = discount;
+ }
totalCompute += Math.round(e.chargePrice * e.amount * 100) / 100;
}
});
- totalPlan = Math.round(totalOri * discount) / 100;
+ totalPlan = Math.round(totalCompute * 100) / 100;
this.form.total = totalPlan;
//this.form.preTotal = totalPlan;
//明细和与总金额不符处理
- this.handleBalance(totalPlan, totalCompute);
+ // this.handleBalance(totalPlan, totalCompute); 通过折扣计算时,无需处理
this.findBalance()
},
@@ -954,22 +957,29 @@ export default {
totalToDetails() {
let discount = 100;
let totalOri = 0, totalCompute = 0, totalPlan = Number(this.form.total);
+ let totalUnDiscount = 0 // 不允许折扣的金额
let lfind = -1;
this.selectedData.forEach(e => {
- totalOri += Math.round(100 * e.amount * e.chargePriceOri) / 100; //原始实收价格
+ totalOri += Math.round(100 * e.amount * e.standardPrice) / 100; //原始实收价格
+ if(e.isDiscount == 'N'){
+ totalUnDiscount += Math.round(100 * e.amount * e.standardPrice) / 100; //不允许折扣的金额
+ }
});
if (totalOri != 0) {
- discount = Math.round(10000 * totalPlan / totalOri) / 100;
+ discount = Math.round(10000 * (totalPlan - totalUnDiscount) / (totalOri - totalUnDiscount)) / 100;
this.form.discount = discount;
}
+
//
this.selectedData.forEach(e => {
lfind = arrayExistObj(this.asbItemsForFee, 'id', e.id);
if (lfind > -1) {
- e.chargePrice = Math.round(e.chargePriceOri * discount) / 100;
- e.discount = Math.round(10000 * e.chargePrice / e.standardPrice) / 100;
+ if(e.isDiscount == 'Y'){
+ e.chargePrice = Math.round(e.standardPrice * discount) / 100;
+ e.discount = discount;
+ }
totalCompute += Math.round(100 * e.chargePrice * e.amount) / 100;
}
});
@@ -992,7 +1002,8 @@ export default {
// break;
// }
//console.log('this.selectedData[i].amount', this.selectedData[i].amount)
- if (this.selectedData[i].amount == 1) {
+ // 允许折扣的项目,才可以调整折扣
+ if (this.selectedData[i].amount == 1 && this.selectedData[i].isDiscount == 'Y') {
let chargePrice = this.selectedData[i].chargePrice
this.selectedData[i].chargePrice = Math.round((Number(chargePrice) + Number(totalPlan) - totalCompute)*100)/100 ;
this.selectedData[i].discount = Math.round(this.selectedData[i].chargePrice * 10000/this.selectedData[i].standardPrice)/100
diff --git a/src/views/fee-settings/Asbitem.vue b/src/views/fee-settings/Asbitem.vue
index 5a79641..1cff506 100644
--- a/src/views/fee-settings/Asbitem.vue
+++ b/src/views/fee-settings/Asbitem.vue
@@ -89,14 +89,14 @@
@row-click="rowick"
@row-dblclick="dblClick"
highlight-current-row
- :row-style="{ height: '36px' }"
- ref="tableData"
+ :row-style="{ height: '28px' }"
+ ref="tableData" border
>
-