|
@@ -40,12 +40,12 @@
|
|
|
</a-col>
|
|
|
<a-col :md="24">
|
|
|
<a-form-model-item label="加薪" :labelCol="{offset: 1}" prop="salaryIncrease">
|
|
|
- <a-input placeholder="请输入" v-model="formState.salaryIncrease" @change="changeSalaryIncrease" :disabled="formState.salaryReduction!==''&&formState.salaryReduction"/>
|
|
|
+ <a-input-number style="width: 70%;" placeholder="请输入" v-model="formState.salaryIncrease" @change="changeSalaryIncrease" :disabled="formState.salaryReduction!==''&&formState.salaryReduction"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="24">
|
|
|
<a-form-model-item label="减薪" :labelCol="{offset: 1}" prop="salaryReduction">
|
|
|
- <a-input placeholder="请输入" v-model="formState.salaryReduction" @change="changeSalaryReduction" :disabled="formState.salaryIncrease!==''&&formState.salaryIncrease"/>
|
|
|
+ <a-input-number style="width: 70%;" placeholder="请输入" v-model="formState.salaryReduction" @change="changeSalaryReduction" :disabled="formState.salaryIncrease!==''&&formState.salaryIncrease"/>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="24">
|
|
@@ -134,6 +134,15 @@
|
|
|
}
|
|
|
},
|
|
|
changeSalaryIncrease(data){
|
|
|
+
|
|
|
+
|
|
|
+ let num = Number(this.formState.beforeAdjustment)+Number(this.formState.salaryIncrease)
|
|
|
+ console.log(num);
|
|
|
+ if(num < 0){
|
|
|
+ this.$message.error('调整后薪资不能为负数!');
|
|
|
+ this.formState.salaryIncrease = 0;
|
|
|
+ }
|
|
|
+
|
|
|
this.formState.afterAdjustment=Number(this.formState.beforeAdjustment)+Number(this.formState.salaryIncrease)
|
|
|
if(!this.formState.salaryIncrease||this.formState.salaryIncrease==''){
|
|
|
this.validatorRules.salaryReduction[0].required = true
|
|
@@ -144,6 +153,13 @@
|
|
|
this.$refs.form.clearValidate();
|
|
|
},
|
|
|
changeSalaryReduction(){
|
|
|
+
|
|
|
+ let num = Number(this.formState.beforeAdjustment)-Number(this.formState.salaryReduction);
|
|
|
+ if(num < 0){
|
|
|
+ this.$message.error('调整后薪资不能为负数!');
|
|
|
+ this.formState.salaryReduction = 0;
|
|
|
+ }
|
|
|
+
|
|
|
this.formState.afterAdjustment=Number(this.formState.beforeAdjustment)-Number(this.formState.salaryReduction)
|
|
|
if(!this.formState.salaryReduction||this.formState.salaryReduction==''){
|
|
|
this.validatorRules.salaryIncrease[0].required = true
|