|
|
@ -74,8 +74,13 @@ |
|
|
|
<el-form-item prop="price"><span class="addinputInfo">{{ calculatePrice }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty"><span class="icon">*</span>考核工时</div> |
|
|
|
<el-form-item prop="examineHourPrice"><el-input class="addinputInfo addinputw" @keyup.native="formobj.examineHourPrice = getNumber(formobj.examineHourPrice, 2)" v-model="formobj.examineHourPrice" clearable placeholder="" /></el-form-item> |
|
|
|
<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> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">备注</div> |
|
|
@ -129,6 +134,7 @@ export default { |
|
|
|
goodsModel_list: [], |
|
|
|
manufacturer_list: [], |
|
|
|
subject_list: [], |
|
|
|
royaltiesRatio: '', // 提成比例 |
|
|
|
formobj: { |
|
|
|
sid: '', |
|
|
|
createBySid: '', |
|
|
@ -224,6 +230,8 @@ export default { |
|
|
|
req.fetchBySid(row.sid).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.formobj = res.data |
|
|
|
// 因提成比例不存数据库,则编辑信息时需要计算出值 |
|
|
|
this.examineHourPriceInput(this.formobj) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -277,6 +285,14 @@ export default { |
|
|
|
this.formobj.manufacturerSid = '' |
|
|
|
} |
|
|
|
}, |
|
|
|
// 计算提成比例 = 工时提成 / 销售价 |
|
|
|
royaltiesRatioInput(val) { |
|
|
|
this.royaltiesRatio = Math.round((parseFloat(val.examineHourPrice !== '' ? val.examineHourPrice : '0') / parseFloat(val.price !== '' ? val.price : '0')) * 100) / 100 |
|
|
|
}, |
|
|
|
// 计算工时提成 = 销售价 * 提成比例 |
|
|
|
examineHourPriceInput(val) { |
|
|
|
val.examineHourPrice = Math.round((parseFloat(val.price !== '' ? val.price : '0') * parseFloat(this.royaltiesRatio !== '' ? this.royaltiesRatio : '0')) * 100) / 100 |
|
|
|
}, |
|
|
|
saveOrUpdate() { |
|
|
|
this.formobj.price = this.calculatePrice |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|