소스 검색

工资单-福利现金/年终奖

jingbb 1 년 전
부모
커밋
f3a08f75d8

+ 19 - 3
src/views/oa/salary_management/personnelSalary/Payroll.vue

@@ -45,6 +45,8 @@
                     <a-select-option value="加班工资单">加班工资单</a-select-option>
                     <a-select-option value="年休工资单">年休工资单</a-select-option>
                     <a-select-option value="月度工资单">月度工资单</a-select-option>
+                    <a-select-option value="福利现金">福利现金</a-select-option>
+                    <a-select-option value="年终奖">年终奖</a-select-option>
                   </a-select>
               </a-form-item>
             </a-col>
@@ -62,6 +64,7 @@
       <!-- 操作按钮区域 -->
       <div class="table-operator">
         <a-button @click="createPayroll" type="primary" icon="plus">生成工资单</a-button>
+        <a-button @click="addPayroll" type="primary" icon="plus">导入</a-button>
       </div>
 
   
@@ -92,6 +95,8 @@
       <AnnualLeavePayroll ref="AnnualLeavePayroll"></AnnualLeavePayroll>
       <OvertimePayroll ref="OvertimePayroll"></OvertimePayroll>
       <uploadModal ref="uploadModal" @ok="searchQuery"></uploadModal>
+      <uploadPayroll ref="uploadPayroll" @ok="searchQuery"></uploadPayroll>
+      <YearEndBonusPayroll ref="YearEndBonusPayroll" @ok="searchQuery"></YearEndBonusPayroll>
     </a-card>
   </template>
   
@@ -104,6 +109,8 @@
     import AnnualLeavePayroll from './modules/AnnualLeavePayroll.vue'
     import OvertimePayroll from './modules/OvertimePayroll.vue'
     import uploadModal from './modules/uploadModal.vue'
+    import uploadPayroll from './modules/uploadPayroll.vue'
+    import YearEndBonusPayroll from './modules/YearEndBonusPayroll.vue'
     import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
     export default {
       name: "Payroll",
@@ -113,8 +120,10 @@
         PayrollDetail,
         JSearchSelectTag,
         uploadModal,
+        uploadPayroll,
         AnnualLeavePayroll,
-        OvertimePayroll
+        OvertimePayroll,
+        YearEndBonusPayroll
       },
       data () {
         return {
@@ -212,7 +221,7 @@
             if(res.success){
                 this.loading = false
                 this.dataSource =res.result.records
-                this.dataSource.map(item=>item.version=item.version+'.0')
+                this.dataSource.map(item=>item.version=item.version?item.version+'.0':'')
                 this.ipagination = {
                   total: res.result.total,
                   current: res.result.current,
@@ -226,6 +235,9 @@
         createPayroll(){
           this.$refs.uploadModal.visible = true
         },
+        addPayroll(){
+          this.$refs.uploadPayroll.visible = true
+        },
         handleDetail(record){
           if(record.type=='加班工资单'){
             this.$refs.OvertimePayroll.visible = true
@@ -235,8 +247,12 @@
             this.$refs.AnnualLeavePayroll.detail(record.id)
           }else if(record.type=='月度工资单'){
             this.$refs.PayrollDetail.visible = true
-            this.$refs.PayrollDetail.detail(record.id)
+            this.$refs.PayrollDetail.detail(record.id,)
+          }else if(record.type=='福利现金'||record.type=='年终奖'){
+            this.$refs.YearEndBonusPayroll.visible = true
+            this.$refs.YearEndBonusPayroll.detail(record.id,record.type)
           }
+          
         },
         handleDownload(record){
           downFile('/salary/salaryManagement/exportXls',{id:record.id,type:record.type}).then(data => {

+ 218 - 0
src/views/oa/salary_management/personnelSalary/modules/YearEndBonusPayroll.vue

@@ -0,0 +1,218 @@
+<template>
+    <div class="reply" ref = "replyModal">
+      <a-modal
+        :title="formState.type=='0'?'福利现金':'年终奖'"
+        width="85%"
+        :visible="visible"
+        :confirmLoading="loading"
+        :getContainer ='()=>$refs.replyModal'
+        @cancel="handleCancel"
+        destroyOnClose
+       >
+            <template #footer>
+                <a-button  @click="handleCancel" style="margin-left: 8px;">取消</a-button>
+            </template>
+            <div class="table-page-search-wrapper">
+                <a-form-model layout="inline" ref="form" :model="formState" >
+                    <a-row :gutter="24">
+                        <a-col :md="6" :sm="8">
+                            <a-form-model-item label="姓名"  >
+                                <j-search-select-tag v-model="formState.name" placeholder="请选择名称" 
+                                    dict="sys_user,realname,realname" allowClear/>
+                            </a-form-model-item>
+                        </a-col>
+                        <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
+                            <a-form-item label="部门">
+                                <j-search-select-tag v-model="formState.sysOrgCode" placeholder="请选择部门" 
+                                    dict="sys_depart,depart_name,depart_name,org_type='3' or org_code='TBD' order by org_code"/>
+                            </a-form-item>
+                        </a-col> -->
+                        <a-col :md="6" :sm="8">
+                            <a-form-model-item label=""  >
+                                <a-button type="primary" icon="search" @click="searchSonList">查询</a-button>
+                            </a-form-model-item>
+                        </a-col>
+                    </a-row>
+                </a-form-model>
+                <a-table
+                    ref="tableRef"
+                    bordered
+                    :columns="columns"
+                    :data-source="dataSource"
+                    :loading="loading"
+                    :scroll="{x: 1000 ,y:400}"
+                    :pagination="false"
+                    :footer="showTotal"
+                >
+                </a-table>
+            </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'
+      import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
+      import JEllipsis from '@/components/jeecg/JEllipsis'
+      export default {
+        name: 'YearEndBonusPayroll',
+        components: {
+            moment,
+            JEllipsis,
+            JSearchSelectTag
+        },
+        data() {
+            let ellipsis = (v, l) => <j-ellipsis value={v} length={l} />
+          return {
+              formState:{},
+              dataSource: [{}],
+              visible:false,
+              loading:false,
+              columns: [
+                {
+                    title: '序号',
+                    align:"center",
+                    width:'5%',
+                    dataIndex: 'index',
+                },
+                {
+                    title: '姓名',
+                    align: "center",
+                    dataIndex: 'name',
+                    customRender: (t) => ellipsis(t,17),
+                    width:'10%',
+                },
+                {
+                    title: '税前金额',
+                    align: "center",
+                    dataIndex: 'beforeTaxAmount',
+                    ellipsis: true,
+                    width:'10%',
+                },
+                {
+                    title: '个税',
+                    align: "center",
+                    dataIndex: 'personalTax',
+                    ellipsis: true,
+                    width:'10%',
+                },
+                {
+                    title: '税后金额',
+                    align: "center",
+                    dataIndex: 'afterTaxAmount',
+                    ellipsis: true,
+                    width:'10%',
+                },
+             ]
+          }
+        },
+        created(){
+        },
+        watch:{
+            dataSource(){
+                this.$nextTick(()=>{  
+                    const dom = this.$refs.tableRef.$el.getElementsByClassName('ant-table-body')[0];
+                    dom.addEventListener(
+                        'scroll',
+                        () => {
+                             this.$refs.tableInfo.$el.querySelectorAll(
+                             '.ant-table-body'
+                            )[0].scrollLeft = dom.scrollLeft
+                        },
+                        true
+                    )
+                 })
+            }
+        },
+        computed: {
+                // 合计展示
+            totalDataSource(){
+                 var item = {
+                     "name":"合计"
+                 };
+                var allBeforeTaxAmount = 0
+                var allPersonalTax = 0
+                var allAfterTaxAmount = 0
+                for (let row of this.dataSource){
+                    allBeforeTaxAmount += row.beforeTaxAmount*1;
+                    allPersonalTax+=row.personalTax*1;
+                    allAfterTaxAmount+=row.afterTaxAmount*1;
+                }
+      
+                item.beforeTaxAmount= parseFloat(allBeforeTaxAmount.toFixed(2));
+                item.personalTax= parseFloat(allPersonalTax.toFixed(2));
+                item.afterTaxAmount = parseFloat(allAfterTaxAmount.toFixed(2));
+                return [item];
+
+            }
+        },
+        methods: {
+            handleCancel(){
+                this.visible = false
+            },
+            detail(id,typeR){
+                this.formState = {}
+                this.formState.id = id
+                this.formState.type = typeR=='福利现金'?'0':'1'
+                this.getTableList()
+            },
+            getTableList(){
+                this.loading = true
+                getAction('/salary/salaryManagement/querySalaryManagementExtraListByMainId',this.formState).then(res=>{
+                    this.loading = false
+                    if(res.success){
+                        this.dataSource =res.result
+                    }else{
+                        this.$message.error(res.message);
+                    }
+                })
+            },
+            searchSonList(){
+                this.getTableList()
+            },
+            showTotal(data) {
+                return (
+                    <a-table
+                        ref="tableInfo"
+                        pagination={false}
+                        columns={this.columns}
+                        dataSource={this.totalDataSource || []}
+                        showHeader={false}
+                        scroll={{x:1000 ,y:400}}
+                    ></a-table>
+                )
+            },
+        }
+    }
+    </script>
+    
+    <style scoped lang="less">
+    /deep/ .nresume .ant-input{
+      height: 150px !important;
+    }
+
+    /deep/ .ant-select{
+      width: 100%;
+    }
+    .form-table-heard:before {
+          content: '*';
+          color: red;
+    }
+    /deep/ .ant-calendar-picker{
+      width: 113px !important;
+    }
+    /deep/ .ant-table-footer .ant-table-body {
+        overflow-x: hidden !important;
+    }
+    /deep/.ant-table-footer{
+        padding:0 !important;
+        overflow: hidden !important;
+    }
+    /deep/.ant-table-fixed-left .ant-table-body-inner {
+        margin-right: -28px !important;
+        padding-right: 20px !important;
+    }
+    </style>

+ 129 - 0
src/views/oa/salary_management/personnelSalary/modules/uploadPayroll.vue

@@ -0,0 +1,129 @@
+<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>
+            </template>
+            <div class="table-page-search-wrapper">
+                <a-form-model layout="inline" ref="form" :model="formState" >
+                    <a-row :gutter="24">                        
+                        <a-col :md="24">
+                            <a-form-model-item label="类型"  prop="totalNum">
+                                <a-select  v-model="formState.type">
+                                    <a-select-option value="福利现金">福利现金</a-select-option>
+                                    <a-select-option value="年终奖">年终奖</a-select-option>
+                                </a-select>
+                            </a-form-model-item>
+                        </a-col>
+                        <a-col :md="24" >
+                            <a-form-model-item label="方式"  prop="id ">
+                                <a-checkbox v-model:checked="checked">覆盖上传</a-checkbox>
+                            </a-form-model-item>
+                        </a-col>
+                        <a-col :md="24">
+                            <a-form-model-item label="文件" >
+                                <a-upload name="file" :multiple="false" :showUploadList="showUploadList" action="/jeecg-boot/salary/salaryManagement/importExcel" :before-upload="beforeUpload" @change="handleUploadChange" :data="{'type':formState.type,'id':this.checked}"  :headers="tokenHeader" >
+                                    <a-button> <a-icon type="upload" /> 上  传 </a-button>
+                                </a-upload>
+                            </a-form-model-item>
+                        </a-col>
+                    </a-row>
+                </a-form-model>
+            </div>
+      </a-modal>
+    </div>
+</template>
+<script>
+      import { defineComponent, ref } from 'vue';
+      import moment from 'moment'
+      import pick from 'lodash.pick'
+      import { FormTypes } from '@/utils/JEditableTableUtil'
+      import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+      import { putAction,getAction } from '@/api/manage'
+      export default {
+        name: 'uploadPayroll',
+        mixins: [JeecgListMixin],
+        components: {
+            moment,
+        },
+        data() {
+          return {
+              checked: ref(false),
+              formState:{
+                type:'福利现金',
+                yearWithMonth:moment().subtract(1, 'months')
+              },
+              dataSource: [{}],
+              fileList:[],
+              visible:false,
+              loading:false,
+              showUploadList:true,
+              headers: {
+                authorization: 'authorization-text',
+             },
+            
+          }
+        },
+        created(){
+        },
+        watch: {
+        },
+        methods: {
+            handleCancel(){
+                this.visible = false
+                this.formState={
+                    type:'福利现金',
+                    yearWithMonth:moment().subtract(1, 'months')
+                }
+            },
+            handleOk(){
+
+            },
+            onChange(data){
+            },
+            beforeUpload(){
+                
+            },
+            handleUploadChange({ file, fileList }){
+                if (file.status === 'done'&&file.response.success) {
+                    this.showUploadList = true
+                    this.$message.success(file.response.message)
+                    this.$emit('ok')
+                    this.handleCancel()
+                }else if(file.status === 'done'&&!file.response.success){
+                    this.showUploadList = false
+                    this.$message.error(file.response.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>