123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- <template>
- <div class="reply" ref = "replyModal">
- <a-modal
- title="加班工资单"
- 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: 'OvertimePayroll',
- components: {
- moment,
- JSearchSelectTag,
- JEllipsis
- },
- 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',
- customRender:function (t, record, index) {
- if(record.name=='合计'){
- return ''
- }else{
- return parseInt(index)+1;
- }
- }
- },
- {
- title: '姓名',
- align: "center",
- dataIndex: 'name',
- customRender: (t) => ellipsis(t,17),
- width:'10%'
- },
- // {
- // title: '编号',
- // align: "center",
- // dataIndex: 'code',
- // customRender: (t) => ellipsis(t,17),
- // width:'10%'
- // },
-
- {
- title: '加班工资',
- align: "center",
- dataIndex: 'workOvertimeCost',
- ellipsis: true,
- width:'10%'
- },
- {
- title: '个税',
- align: "center",
- dataIndex: 'personalTax',
- ellipsis: true,
- width:'10%'
- },
- {
- title: '实发合计',
- align: "center",
- dataIndex: 'actualOccurrence',
- customRender: (t) => ellipsis(t,10),
- 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 allNumber = 0
- var allPersonalTax = 0
- for (let row of this.dataSource){
- allNumber += row.actualOccurrence*1;
- allPersonalTax+=row.personalTax*1
- }
-
- item.actualOccurrence= parseFloat(allNumber.toFixed(2));
- item.personalTax = parseFloat(allPersonalTax.toFixed(2));
- return [item];
- }
- },
- methods: {
- handleCancel(){
- this.visible = false
- this.dataSource=[]
- this.formState={}
- },
- detail(id){
- this.formState = {}
- this.formState.id = id
- this.getTableList()
- },
- getTableList(){
- this.loading = true
- getAction('/salary/salaryManagement/querySalaryManagementWorkOvertimeListByMainId',this.formState).then(res=>{
- this.loading = false
- if(res.success){
- this.dataSource =res.result
- var all=0
- this.dataSource.map(item=>{
- item.actualOccurrence = Number(item.actualOccurrence).toFixed(2)
- })
- }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 }}
- ></a-table>
- )
- },
- }
- }
- </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-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>
|