给报表增加列的显示和隐藏功能
This commit is contained in:
@@ -89,6 +89,32 @@
|
||||
:scroll="scroll"
|
||||
:loading="loading"
|
||||
@change="handleTableChange">
|
||||
<span slot="customTitle">
|
||||
<a-popover trigger="click" placement="right">
|
||||
<template slot="content">
|
||||
<a-checkbox-group @change="onColChange" v-model="settingDataIndex" :defaultValue="settingDataIndex">
|
||||
<a-row style="width: 600px">
|
||||
<template v-for="(item,index) in defColumns">
|
||||
<template>
|
||||
<a-col :span="6">
|
||||
<a-checkbox :value="item.dataIndex" v-if="item.dataIndex==='rowIndex'" disabled></a-checkbox>
|
||||
<a-checkbox :value="item.dataIndex" v-if="item.dataIndex!=='rowIndex'">
|
||||
<j-ellipsis :value="item.title" :length="10"></j-ellipsis>
|
||||
</a-checkbox>
|
||||
</a-col>
|
||||
</template>
|
||||
</template>
|
||||
</a-row>
|
||||
<a-row style="padding-top: 10px;">
|
||||
<a-col>
|
||||
恢复默认列配置:<a-button @click="handleRestDefault" type="link" size="small">恢复默认</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-checkbox-group>
|
||||
</template>
|
||||
<a-icon type="setting" />
|
||||
</a-popover>
|
||||
</span>
|
||||
</a-table>
|
||||
<a-row :gutter="24" style="margin-top: 8px;text-align:right;">
|
||||
<a-col :md="24" :sm="24">
|
||||
@@ -156,10 +182,14 @@
|
||||
orgaTree: [],
|
||||
realityPriceTotal: '',
|
||||
tabKey: "1",
|
||||
// 表头
|
||||
columns: [
|
||||
pageName: 'retailOutReport',
|
||||
// 默认索引
|
||||
defDataIndex:['rowIndex','barCode','materialName','materialStandard','materialModel','materialOther','materialUnit',
|
||||
'outSum','outSumPrice','inSum','inSumPrice','outInSumPrice'],
|
||||
// 默认列
|
||||
defColumns: [
|
||||
{
|
||||
title: '#', dataIndex: 'rowIndex', width:60, align:"center",
|
||||
dataIndex: 'rowIndex', width:60, align:"center", slots: { title: 'customTitle' },
|
||||
customRender:function (t,r,index) {
|
||||
return (t !== '合计') ? (parseInt(index) + 1) : t
|
||||
}
|
||||
@@ -185,6 +215,7 @@
|
||||
this.initRetail()
|
||||
this.getDepotData()
|
||||
this.loadAllOrgaData()
|
||||
this.initColumnsSetting()
|
||||
},
|
||||
methods: {
|
||||
moment,
|
||||
|
||||
Reference in New Issue
Block a user