Commit 1d72f46b by 王志慧

fixed

1 parent c53f9a43
...@@ -70,10 +70,10 @@ ...@@ -70,10 +70,10 @@
<div class="constructionBonus-wrap"> <div class="constructionBonus-wrap">
<el-form ref="editFormRef2" size="small" :rules="editRule" :model="employeePerformanceConfig" label-width="160px" :inline="true"> <el-form ref="editFormRef2" size="small" :rules="editRule" :model="employeePerformanceConfig" label-width="160px" :inline="true">
<el-form-item label="升级订单施工奖励/元:" prop="upgradeConstructionBonus"> <el-form-item label="升级订单施工奖励/元:" prop="upgradeConstructionBonus">
<el-input v-model="employeePerformanceConfig.upgradeConstructionBonus" placeholder="请输入"></el-input> <el-input v-model="employeePerformanceConfig.upgradeConstructionBonus" @blur="handleCalcuPrice('employeePerformanceConfig', 'upgradeConstructionBonus')" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="战败订单施工奖励/元:" prop="notUpgradeConstructionBonus"> <el-form-item label="战败订单施工奖励/元:" prop="notUpgradeConstructionBonus">
<el-input v-model="employeePerformanceConfig.notUpgradeConstructionBonus" placeholder="请输入"></el-input> <el-input v-model="employeePerformanceConfig.notUpgradeConstructionBonus" placeholder="请输入" @blur="handleCalcuPrice('employeePerformanceConfig', 'notUpgradeConstructionBonus')" ></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -570,6 +570,7 @@ export default { ...@@ -570,6 +570,7 @@ export default {
}, },
handleCalcuPrice(formName, data) { handleCalcuPrice(formName, data) {
this[formName][data] = this[formName][data] ? new BigNumber(this[formName][data]).dp(2).toNumber() : '' this[formName][data] = this[formName][data] ? new BigNumber(this[formName][data]).dp(2).toNumber() : ''
if(!this[formName][data]) this[formName][data]=''
}, },
handleCalculate(item, key, index) { handleCalculate(item, key, index) {
let formData = this.employeePerformanceConfig[item + 'List'] let formData = this.employeePerformanceConfig[item + 'List']
...@@ -580,7 +581,9 @@ export default { ...@@ -580,7 +581,9 @@ export default {
formData[index][key] = formData[index][key] > max ? max : formData[index][key] formData[index][key] = formData[index][key] > max ? max : formData[index][key]
formData[index][key] = formData[index][key] ? new BigNumber(formData[index][key]).dp(2).toNumber() : '' formData[index][key] = formData[index][key] ? new BigNumber(formData[index][key]).dp(2).toNumber() : ''
//下一行区间开启值自动在上一行的区间结束值的基础上+0.01 //下一行区间开启值自动在上一行的区间结束值的基础上+0.01
if (formData[index + 1] && key == 'endValue' && formData[index][key]) formData[index + 1].startValue = new BigNumber(formData[index][key]).plus(0.01).toNumber() if (formData[index + 1] && key == 'endValue' && formData[index][key]) formData[index + 1].startValue = new BigNumber(formData[index][key]).plus(0.01).toNumber()
if(! formData[index][key]) formData[index][key]=''
}, },
handleDelete(item, index) { handleDelete(item, index) {
let bonusType = item == 'commissionBonus' ? 0 : item == 'highCustomerUnitBonus' ? 1 : 2 let bonusType = item == 'commissionBonus' ? 0 : item == 'highCustomerUnitBonus' ? 1 : 2
...@@ -668,7 +671,6 @@ export default { ...@@ -668,7 +671,6 @@ export default {
let params = {} let params = {}
let form1 = this.$refs.editFormRef.$refs[this.editChildRef].validate() let form1 = this.$refs.editFormRef.$refs[this.editChildRef].validate()
let form2 = this.$refs.editFormRef1.$refs[this.editChildRef].validate() let form2 = this.$refs.editFormRef1.$refs[this.editChildRef].validate()
console.log(this.$refs.editFormRef2)
let form3 = this.$refs.editFormRef2 && this.$refs.editFormRef2[0].validate() let form3 = this.$refs.editFormRef2 && this.$refs.editFormRef2[0].validate()
Promise.all([form1, form2, form3]) Promise.all([form1, form2, form3])
.then(res => { .then(res => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!