|
|
@ -76,9 +76,9 @@ |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty"><span class="icon">*</span>工时提成</div> |
|
|
|
<el-form-item prop="examineHourPrice"> |
|
|
|
<div class="addinputInfo" style="display: flex;flex-direction: row;justify-content: space-between;align-items: center"> |
|
|
|
<el-input style="width: 40%" @input="royaltiesRatioInput(formobj)" @keyup.native="formobj.examineHourPrice = getNumber(formobj.examineHourPrice, 2)" v-model="formobj.examineHourPrice" clearable placeholder="" /> |
|
|
|
<el-input style="width: 100px" @input="examineHourPriceInput(formobj)" @keyup.native="royaltiesRatio = getNumber(royaltiesRatio, 2)" v-model="royaltiesRatio" clearable placeholder="提成比例(%)" /> |
|
|
|
<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="提成比例(%)" /> |
|
|
|
</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(val.price !== '' ? val.price : '0')) * 100) / 100 |
|
|
|
this.royaltiesRatio = Math.round((parseFloat(val.examineHourPrice !== '' ? val.examineHourPrice : '0') / parseFloat(this.calculatePrice)) * 100) / 100 |
|
|
|
}, |
|
|
|
// 计算工时提成 = 销售价 * 提成比例 |
|
|
|
examineHourPriceInput(val) { |
|
|
|
val.examineHourPrice = Math.round((parseFloat(val.price !== '' ? val.price : '0') * parseFloat(this.royaltiesRatio !== '' ? this.royaltiesRatio : '0')) * 100) / 100 |
|
|
|
val.examineHourPrice = Math.round((parseFloat(this.calculatePrice) * parseFloat(this.royaltiesRatio !== '' ? this.royaltiesRatio : '0')) * 100) / 100 |
|
|
|
}, |
|
|
|
saveOrUpdate() { |
|
|
|
this.formobj.price = this.calculatePrice |
|
|
|