Ver código fonte

基本薪资-工资基数

jingbb 1 ano atrás
pai
commit
a74e6e543b

+ 11 - 2
src/views/oa/salary_management/personnelSalary/BasicSalary.vue

@@ -38,7 +38,9 @@
       </div>
   
       <!-- 操作按钮区域 -->
-
+        <div class="table-operator">
+          <a-button type="primary" @click="editSalaryBase" icon="plus">工资基数</a-button>
+        </div>
   
         <a-table
           ref="table"
@@ -62,6 +64,7 @@
   
       <!-- 表单区域 -->
       <ChangeBasicSalary ref="ChangeBasicSalary" @ok="getTableList"></ChangeBasicSalary>
+      <ChangeSalaryBase ref="ChangeSalaryBase" @ok="getTableList"></ChangeSalaryBase>
     </a-card>
   </template>
   
@@ -71,6 +74,7 @@
     import { getAction } from '@/api/manage'
     import moment from 'moment'
     import ChangeBasicSalary from './modules/ChangeBasicSalary.vue'
+    import ChangeSalaryBase from './modules/ChangeSalaryBase.vue'
     import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
     export default {
       name: "BasicSalary",
@@ -78,7 +82,8 @@
       components: {
         moment,
         ChangeBasicSalary,
-        JSearchSelectTag
+        JSearchSelectTag,
+        ChangeSalaryBase
       },
       data () {
         return {
@@ -190,6 +195,10 @@
             this.queryParam.pageSize = pagination.pageSize
             this.getTableList()
         },
+        editSalaryBase(){
+            this.$refs.ChangeSalaryBase.visible = true
+            this.$refs.ChangeSalaryBase.getOldSalaryBase()
+        },
       }
     }
   </script>

+ 116 - 0
src/views/oa/salary_management/personnelSalary/modules/ChangeSalaryBase.vue

@@ -0,0 +1,116 @@
+<template>
+    <div class="reply" ref = "replyModal">
+      <a-modal
+        title="生成工资单"
+        width="25%"
+        :visible="visible"
+        :confirmLoading="loading"
+        :getContainer ='()=>$refs.replyModal'
+        @cancel="handleCancel"
+        destroyOnClose
+       >
+            <template #footer>
+                <a-button  @click="handleCancel" style="margin-left: 8px;">取消</a-button>
+                <a-button  @click="handleOk" type="primary" style="margin-left: 8px;">确认</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="工资基数"  prop="totalNum"  :labelCol="{offset: 2}">
+                                <a-input placeholder="请输入" v-model="formState.oldSalaryBase" disabled/>
+                            </a-form-model-item>
+                        </a-col>
+                        <a-col :md="24" >
+                            <a-form-model-item label="更新工资基数"  prop="basicSalary" >
+                                <a-input placeholder="请输入" v-model="formState.basicSalary" />
+                            </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 } from '@/api/manage'
+      export default {
+        name: 'ChangeSalaryBase',
+        components: {
+            moment,
+        },
+        data() {
+          return {
+              formState:{},
+              visible:false,
+              loading:false, 
+              validatorRules: {
+                basicSalary: [{required: true, message: '请输入!' }],
+              },           
+          }
+        },
+        created(){
+        },
+        watch: {
+        },
+        methods: {
+            handleCancel(){
+                this.visible = false
+                this.formState={}
+            },
+            handleOk(){
+                this.$refs.form.validate(valid => {
+                    if (valid) {
+                        this.loading = true
+                        getAction('/salary/salaryChangeRecord/insertSalaryBasicSalaryRecord', {basicSalary:this.formState.basicSalary}).then((res) => {
+                            if (res.success) {
+                                this.$message.success(res.message);
+                                this.handleCancel()
+                                this.$emit('ok')
+                            } else {
+                                this.$message.error(res.message);
+                            }
+                        }).finally(() => {
+                            this.loading = false
+                        })
+                    }
+                })   
+            },
+           getOldSalaryBase(){
+                this.loading = true
+                getAction('/salary/salaryChangeRecord/selectSalary').then(res=>{
+                    this.loading = false
+                    if(res||res==0){
+                        this.formState.oldSalaryBase = res
+                    }else{
+                        this.$message.error(res.message);
+                    }
+                })
+           },
+        }
+    }
+    </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;
+    }
+    </style>