|
@@ -70,7 +70,7 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="主营业务收入" prop="mainBusinessIncomeFix" class="one-form-item">
|
|
|
- <el-input v-model="ruleForm.mainBusinessIncomeFix" placeholder="请输入主营业务收入" :disabled="disabled">
|
|
|
+ <el-input v-model="ruleForm.mainBusinessIncomeFix" @blur="calcMainBusinessProfit" placeholder="请输入主营业务收入" :disabled="disabled">
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
@@ -80,7 +80,7 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="主营业务成本" prop="mainBusinessCostFix" class="one-form-item">
|
|
|
- <el-input v-model="ruleForm.mainBusinessCostFix" placeholder="请输入主营业务成本" :disabled="disabled">
|
|
|
+ <el-input v-model="ruleForm.mainBusinessCostFix" @blur="calcMainBusinessProfit" placeholder="请输入主营业务成本" :disabled="disabled">
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
@@ -90,8 +90,8 @@
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="上年度毛利率" prop="mainBusinessProfitFix" class="one-form-item">
|
|
|
- <el-input v-model="ruleForm.mainBusinessProfitFix" placeholder="请输入上年度毛利率" :disabled="disabled">
|
|
|
- <template slot="append">元</template>
|
|
|
+ <el-input v-model="ruleForm.mainBusinessProfitFix" placeholder="请输入上年度毛利率" disabled>
|
|
|
+ <template slot="append">%</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
@@ -219,6 +219,14 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ calcMainBusinessProfit() {
|
|
|
+ const { mainBusinessIncomeFix, mainBusinessCostFix } = this.ruleForm
|
|
|
+ if (mainBusinessIncomeFix && mainBusinessCostFix) {
|
|
|
+ this.ruleForm.mainBusinessProfitFix = ((Number(mainBusinessIncomeFix) - Number(mainBusinessCostFix)) / Number(mainBusinessIncomeFix) * 100).toFixed(2)
|
|
|
+ } else {
|
|
|
+ this.ruleForm.mainBusinessProfitFix = ''
|
|
|
+ }
|
|
|
+ },
|
|
|
async getParams() {
|
|
|
const _this = this
|
|
|
return new Promise((resolve, reject) => {
|