|
@@ -11,10 +11,10 @@
|
|
|
>
|
|
|
<template #footer>
|
|
|
<a-button @click="handleCancel" style="margin-left: 8px;">取消</a-button>
|
|
|
- <a-button @click="handleOk" type="primary" style="margin-left: 8px;">确认</a-button>
|
|
|
+ <a-button @click="handleOk" type="primary" style="margin-left: 8px;" :loading = "loading">确认</a-button>
|
|
|
</template>
|
|
|
- <div class="table-page-search-wrapper">
|
|
|
- <a-form-model layout="inline" ref="form" :model="formState" >
|
|
|
+ <div class="table-page-search-wrapper" >
|
|
|
+ <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :md="24" >
|
|
|
<a-form-model-item label="姓名" :labelCol="{offset: 2}">
|
|
@@ -37,12 +37,12 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="24">
|
|
|
- <a-form-model-item label="加薪" :labelCol="{offset: 2}">
|
|
|
+ <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-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="24">
|
|
|
- <a-form-model-item label="减薪" :labelCol="{offset: 2}">
|
|
|
+ <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-form-model-item>
|
|
|
</a-col>
|
|
@@ -78,6 +78,10 @@
|
|
|
formState:{},
|
|
|
visible:false,
|
|
|
loading:false,
|
|
|
+ validatorRules: {
|
|
|
+ salaryIncrease: [{required: true}],
|
|
|
+ salaryReduction: [{required: true}],
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
@@ -89,18 +93,22 @@
|
|
|
this.visible = false
|
|
|
},
|
|
|
handleOk(){
|
|
|
- this.loading = true
|
|
|
- postAction('/salary/salaryChangeRecord/saveSalaryChangeRecord', this.formState).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- this.$message.success('添加成功!');
|
|
|
- this.handleCancel()
|
|
|
- this.$emit('ok')
|
|
|
- } else {
|
|
|
- this.$message.error(res.message);
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
+ if((!this.formState.salaryIncrease||this.formState.salaryIncrease=='')&&(!this.formState.salaryReduction||this.formState.salaryReduction=='')){
|
|
|
+ this.$message.warning("请输入'加薪'或者'减薪'!")
|
|
|
+ }else{
|
|
|
+ this.loading = true
|
|
|
+ postAction('/salary/salaryChangeRecord/saveSalaryChangeRecord', this.formState).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('添加成功!');
|
|
|
+ this.handleCancel()
|
|
|
+ this.$emit('ok')
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message);
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
getData(record){
|
|
|
this.formState = record
|