ChangeSalaryBase.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div class="reply" ref = "replyModal">
  3. <a-modal
  4. title="调整工资基数"
  5. width="25%"
  6. :visible="visible"
  7. :confirmLoading="loading"
  8. :getContainer ='()=>$refs.replyModal'
  9. @cancel="handleCancel"
  10. :closable="!loading"
  11. :maskClosable="!loading"
  12. destroyOnClose
  13. >
  14. <template #footer>
  15. <a-button @click="handleCancel" :loading = "loading">取消</a-button>
  16. <a-button @click="handleOk" type="primary" style="margin-left: 8px;" :loading = "loading">确认</a-button>
  17. </template>
  18. <div class="table-page-search-wrapper">
  19. <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
  20. <a-row :gutter="24">
  21. <a-col :md="24">
  22. <a-form-model-item label="当前工资基数" prop="totalNum" :labelCol="{offset: 0}">
  23. <a-input placeholder="请输入" v-model="formState.oldSalaryBase" disabled/>
  24. </a-form-model-item>
  25. </a-col>
  26. <a-col :md="24" >
  27. <a-form-model-item label="新工资基数" prop="basicSalary" >
  28. <a-input-number style="width: 100%;" placeholder="请输入" v-model="formState.basicSalary" />
  29. </a-form-model-item>
  30. </a-col>
  31. </a-row>
  32. </a-form-model>
  33. </div>
  34. </a-modal>
  35. </div>
  36. </template>
  37. <script>
  38. import moment from 'moment'
  39. import pick from 'lodash.pick'
  40. import { FormTypes } from '@/utils/JEditableTableUtil'
  41. import { putAction,getAction } from '@/api/manage'
  42. export default {
  43. name: 'ChangeSalaryBase',
  44. components: {
  45. moment,
  46. },
  47. data() {
  48. return {
  49. formState:{},
  50. visible:false,
  51. loading:false,
  52. validatorRules: {
  53. basicSalary: [{required: true, message: '请输入!' }],
  54. },
  55. }
  56. },
  57. created(){
  58. },
  59. watch: {
  60. },
  61. methods: {
  62. handleCancel(){
  63. this.visible = false
  64. this.formState={}
  65. },
  66. handleOk(){
  67. this.$refs.form.validate(valid => {
  68. if (valid) {
  69. this.loading = true
  70. getAction('/salary/salaryChangeRecord/insertSalaryBasicSalaryRecord', {basicSalary:this.formState.basicSalary}).then((res) => {
  71. if (res.success) {
  72. this.$message.success(res.message);
  73. this.handleCancel()
  74. this.$emit('ok')
  75. } else {
  76. this.$message.error(res.message);
  77. }
  78. }).finally(() => {
  79. this.loading = false
  80. })
  81. }
  82. })
  83. },
  84. getOldSalaryBase(){
  85. this.loading = true
  86. getAction('/salary/salaryChangeRecord/selectSalary').then(res=>{
  87. this.loading = false
  88. if(res||res==0){
  89. this.formState.oldSalaryBase = res
  90. }else{
  91. this.$message.error(res.message);
  92. }
  93. })
  94. },
  95. }
  96. }
  97. </script>
  98. <style scoped lang="less">
  99. /deep/ .nresume .ant-input{
  100. height: 100px !important;
  101. }
  102. /deep/ .ant-select{
  103. width: 100%;
  104. }
  105. .form-table-heard:before {
  106. content: '*';
  107. color: red;
  108. }
  109. /deep/ .ant-calendar-picker{
  110. width: 113px !important;
  111. }
  112. /deep/.ant-modal-root>.ant-modal-wrap>.ant-modal {
  113. min-width: 0 !important;
  114. }
  115. </style>