|
|
@ -78,7 +78,7 @@ |
|
|
|
<el-form-item prop="examineHourPrice"> |
|
|
|
<div class="addinputInfo" style="display: flex;flex-direction: row;justify-content: flex-start;align-items: center"> |
|
|
|
<el-input style="width: 30%" @input="royaltiesRatioInput(formobj)" @keyup.native="formobj.examineHourPrice = getNumber(formobj.examineHourPrice, 2)" v-model="formobj.examineHourPrice" clearable placeholder="" /> |
|
|
|
<el-input style="width: 40%" @input="examineHourPriceInput(formobj)" @keyup.native="royaltiesRatio = getNumber(royaltiesRatio, 2)" v-model="royaltiesRatio" clearable placeholder="提成比例(%)" /> |
|
|
|
<el-input style="width: 30%" @input="examineHourPriceInput(formobj)" @keyup.native="royaltiesRatio = getNumber(royaltiesRatio, 2)" v-model="royaltiesRatio" clearable placeholder="提成比例" />% |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
@ -287,11 +287,11 @@ export default { |
|
|
|
}, |
|
|
|
// 计算提成比例 = 工时提成 / 销售价 |
|
|
|
royaltiesRatioInput(val) { |
|
|
|
this.royaltiesRatio = Math.round(((parseFloat(val.examineHourPrice !== '' ? val.examineHourPrice : '0') / parseFloat(this.calculatePrice)) * 100) * 100) / 100 |
|
|
|
this.royaltiesRatio = Math.round((((parseFloat(val.examineHourPrice !== '' ? val.examineHourPrice : '0') / parseFloat(this.calculatePrice)) * 100).toFixed(2)) * 100) / 100 |
|
|
|
}, |
|
|
|
// 计算工时提成 = 销售价 * 提成比例 |
|
|
|
examineHourPriceInput(val) { |
|
|
|
val.examineHourPrice = Math.round((parseFloat(this.calculatePrice) * (parseFloat(this.royaltiesRatio !== '' ? this.royaltiesRatio : '0') / 100)) * 100) / 100 |
|
|
|
val.examineHourPrice = Math.round((parseFloat(this.calculatePrice) * ((parseFloat(this.royaltiesRatio !== '' ? this.royaltiesRatio : '0') / 100)).toFixed(2)) * 100) / 100 |
|
|
|
}, |
|
|
|
saveOrUpdate() { |
|
|
|
this.formobj.price = this.calculatePrice |
|
|
|