|
@@ -35,12 +35,14 @@
|
|
|
</a-row>
|
|
|
</a-form-model>
|
|
|
<a-table
|
|
|
+ ref="tableRef"
|
|
|
bordered
|
|
|
:columns="columns"
|
|
|
:data-source="dataSource"
|
|
|
:loading="loading"
|
|
|
- :scroll="{x: 1200 ,y:400}"
|
|
|
+ :scroll="{x: 1000 ,y:400}"
|
|
|
:pagination="false"
|
|
|
+ :footer="showTotal"
|
|
|
>
|
|
|
</a-table>
|
|
|
</div>
|
|
@@ -73,75 +75,156 @@
|
|
|
{
|
|
|
title: '序号',
|
|
|
align:"center",
|
|
|
- width:'5%',
|
|
|
+ fixed: 'left',
|
|
|
+ width:80,
|
|
|
dataIndex: 'index',
|
|
|
- customRender:function (t, r, index) {
|
|
|
- return parseInt(index)+1;
|
|
|
+ customRender:function (t, record, index) {
|
|
|
+ if(record.name=='合计'){
|
|
|
+ return ''
|
|
|
+ }else{
|
|
|
+ return parseInt(index)+1;
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- title: '编号',
|
|
|
+ title: '姓名',
|
|
|
align: "center",
|
|
|
- dataIndex: 'code',
|
|
|
- ellipsis: true,
|
|
|
+ dataIndex: 'name',
|
|
|
customRender: (t) => ellipsis(t,17),
|
|
|
- width:'10%'
|
|
|
+ width:120,
|
|
|
+ fixed: 'left',
|
|
|
},
|
|
|
{
|
|
|
- title: '姓名',
|
|
|
+ title: '编号',
|
|
|
align: "center",
|
|
|
- dataIndex: 'name',
|
|
|
- customRender: (t) => ellipsis(t,17),
|
|
|
- width:'10%'
|
|
|
+ dataIndex: 'code',
|
|
|
+ ellipsis: true,
|
|
|
+ customRender: (t) => ellipsis(t,10),
|
|
|
+ customCell: column => {
|
|
|
+ return {
|
|
|
+ style: {
|
|
|
+ 'min-width': "100px",
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ customHeaderCell: () => ({ style: { 'min-width': "100px" } }),
|
|
|
+ // width:120,
|
|
|
},
|
|
|
{
|
|
|
title: '年假天数',
|
|
|
align: "center",
|
|
|
dataIndex: 'annualLeave',
|
|
|
ellipsis: true,
|
|
|
- width:'10%'
|
|
|
+ customCell: column => {
|
|
|
+ return {
|
|
|
+ style: {
|
|
|
+ 'min-width': "100px",
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ customHeaderCell: () => ({ style: { 'min-width': "100px" } }),
|
|
|
},
|
|
|
{
|
|
|
title: '已请天数',
|
|
|
align: "center",
|
|
|
dataIndex: 'used',
|
|
|
ellipsis: true,
|
|
|
- width:'10%'
|
|
|
+ customCell: column => {
|
|
|
+ return {
|
|
|
+ style: {
|
|
|
+ 'min-width': "100px",
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ customHeaderCell: () => ({ style: { 'min-width': "100px" } }),
|
|
|
},
|
|
|
{
|
|
|
title: '剩余天数',
|
|
|
align: "center",
|
|
|
dataIndex: 'surplus',
|
|
|
ellipsis: true,
|
|
|
- width:'10%'
|
|
|
+ customCell: column => {
|
|
|
+ return {
|
|
|
+ style: {
|
|
|
+ 'min-width': "100px",
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ customHeaderCell: () => ({ style: { 'min-width': "100px" } }),
|
|
|
},
|
|
|
{
|
|
|
title: '应发薪资',
|
|
|
align: "center",
|
|
|
dataIndex: 'wages',
|
|
|
ellipsis: true,
|
|
|
- width:'10%'
|
|
|
+ customCell: column => {
|
|
|
+ return {
|
|
|
+ style: {
|
|
|
+ 'min-width': "100px",
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ customHeaderCell: () => ({ style: { 'min-width': "100px" } }),
|
|
|
},
|
|
|
{
|
|
|
title: '个税',
|
|
|
align: "center",
|
|
|
dataIndex: 'personalTax',
|
|
|
ellipsis: true,
|
|
|
- width:'10%'
|
|
|
+ customCell: column => {
|
|
|
+ return {
|
|
|
+ style: {
|
|
|
+ 'min-width': "100px",
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ customHeaderCell: () => ({ style: { 'min-width': "100px" } }),
|
|
|
},
|
|
|
{
|
|
|
title: '实发合计',
|
|
|
align: "center",
|
|
|
dataIndex: 'actualOccurrence',
|
|
|
ellipsis: true,
|
|
|
- width:'10%'
|
|
|
+ width:180,
|
|
|
+ fixed: 'right',
|
|
|
},
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
|
},
|
|
|
- watch: {
|
|
|
+ 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
|
|
|
+ for (let row of this.dataSource){
|
|
|
+ allNumber += row.actualOccurrence*1;
|
|
|
+ }
|
|
|
+
|
|
|
+ item.actualOccurrence= parseFloat(allNumber.toFixed(2));
|
|
|
+ return [item];
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
handleCancel(){
|
|
@@ -165,14 +248,26 @@
|
|
|
},
|
|
|
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;
|
|
|
+ height: 150px !important;
|
|
|
}
|
|
|
|
|
|
/deep/ .ant-select{
|
|
@@ -185,4 +280,14 @@
|
|
|
/deep/ .ant-calendar-picker{
|
|
|
width: 113px !important;
|
|
|
}
|
|
|
+ /deep/ .ant-table-footer .ant-table-body {
|
|
|
+ overflow: hidden !important;
|
|
|
+ }
|
|
|
+ /deep/.ant-table-footer{
|
|
|
+ padding:0 !important;
|
|
|
+ overflow: hidden !important;
|
|
|
+ }
|
|
|
+ /deep/.ant-table-fixed-left{
|
|
|
+ min-width:200px !important
|
|
|
+ }
|
|
|
</style>
|