123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <template>
- <div class="reply" ref = "replyModal">
- <a-modal
- title="薪资调整"
- width="25%"
- :visible="visible"
- :confirmLoading="loading"
- :getContainer ='()=>$refs.replyModal'
- @cancel="handleCancel"
- :closable="!loading"
- :maskClosable="!loading"
- destroyOnClose
- >
- <template #footer>
- <a-button @click="handleCancel" style="margin-left: 8px;" :loading = "loading">取消</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" :rules="validatorRules">
- <a-row :gutter="24">
- <a-col :md="24" >
- <a-form-model-item label="姓名" :labelCol="{offset: 2}">
- <a-input placeholder="请输入" v-model="formState.name" disabled/>
- </a-form-model-item>
- </a-col>
- <a-col :md="24" >
- <a-form-model-item label="组织" prop="name" :labelCol="{offset: 2}">
- <a-input v-model="formState.orgName" disabled/>
- </a-form-model-item>
- </a-col>
- <a-col :md="24" >
- <a-form-model-item label="部门" prop="name" :labelCol="{offset: 2}">
- <a-input v-model="formState.sysOrgCode" disabled/>
- </a-form-model-item>
- </a-col>
- <a-col :md="24" >
- <a-form-model-item label="当前薪资" prop="totalNum" >
- <a-input placeholder="" v-model="formState.beforeAdjustment" disabled/>
- </a-form-model-item>
- </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-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-form-model-item>
- </a-col>
- <a-col :md="24">
- <a-form-model-item label="调后薪资">
- <a-input placeholder="请输入" v-model="formState.afterAdjustment" disabled/>
- </a-form-model-item>
- </a-col>
- <a-col :md="24" >
- <a-form-model-item label="调整说明" class="nresume" style="height:100px !important">
- <a-input type="textarea" placeholder="请输入" v-model="formState.remarks" />
- </a-form-model-item>
- </a-col>
- </a-row>
- </a-form-model>
- </div>
- </a-modal>
- </div>
- </template>
- <script>
-
- import moment from 'moment'
- import pick from 'lodash.pick'
- import { FormTypes } from '@/utils/JEditableTableUtil'
- import { putAction,getAction,postAction } from '@/api/manage'
- export default {
- name: 'ChangeBasicSalary',
- components: {
- moment,
- },
- data() {
- return {
- formState:{},
- visible:false,
- loading:false,
- validatorRules: {
- salaryIncrease: [{required: true,message: '请输入!'}],
- salaryReduction: [{required: true,message: '请输入!'}],
- },
- }
- },
- created(){
- },
- watch: {
- },
- methods: {
- handleCancel(){
- this.visible = false
- this.formState = {}
- this.validatorRules.salaryReduction[0].required = true
- this.validatorRules.salaryIncrease[0].required = true
- this.RlabelCol={offset: 1 }
- this.IlabelCol={offset: 1 }
- },
- handleOk(){
- this.$refs.form.validate(valid => {
- if (valid) {
- 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={
- userId :record.userId,
- name:record.name,
- orgName:record.orgName,
- sysOrgCode:record.sysOrgCode,
- beforeAdjustment:record.beforeAdjustment,
- salaryIncrease:record.salaryIncrease,
- salaryReduction:record.salaryReduction,
- afterAdjustment:record.afterAdjustment,
- remarks:record.remarks,
- code:record.code,
- cardNo:record.cardNo,
- }
- },
- changeSalaryIncrease(data){
- this.formState.afterAdjustment=Number(this.formState.beforeAdjustment)+Number(this.formState.salaryIncrease)
- if(!this.formState.salaryIncrease||this.formState.salaryIncrease==''){
- this.validatorRules.salaryReduction[0].required = true
- }else{
- this.validatorRules.salaryReduction[0].required = false
- }
- this.validatorRules.salaryIncrease[0].required = true
- this.$refs.form.clearValidate();
- },
- changeSalaryReduction(){
- this.formState.afterAdjustment=Number(this.formState.beforeAdjustment)-Number(this.formState.salaryReduction)
- if(!this.formState.salaryReduction||this.formState.salaryReduction==''){
- this.validatorRules.salaryIncrease[0].required = true
- }else{
- this.validatorRules.salaryIncrease[0].required = false
- }
- this.validatorRules.salaryReduction[0].required = true
- this.$refs.form.clearValidate();
- }
- }
- }
- </script>
-
- <style scoped lang="less">
- /deep/ .nresume .ant-input{
- height: 100px !important;
- }
- /deep/ .ant-select{
- width: 100%;
- }
- .form-table-heard:before {
- content: '*';
- color: red;
- }
- /deep/ .ant-calendar-picker{
- width: 113px !important;
- }
- /deep/.ant-modal-root>.ant-modal-wrap>.ant-modal {
- min-width: 0 !important;
- }
- /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item>.ant-form-item-label{
- padding-right:0 !important
- }
- </style>
|