|
@@ -95,13 +95,15 @@
|
|
|
:pagination="false"
|
|
:pagination="false"
|
|
|
style="background: #fff"
|
|
style="background: #fff"
|
|
|
rowKey="id"
|
|
rowKey="id"
|
|
|
- :scroll="{ y: 600 }"
|
|
|
|
|
|
|
+ :scroll="{ y: 900 }"
|
|
|
:loading="detailsLoading"
|
|
:loading="detailsLoading"
|
|
|
|
|
+ @change="sortTable"
|
|
|
>
|
|
>
|
|
|
- <div slot="index" slot-scope="{ text, record }">
|
|
|
|
|
- {{ text }}
|
|
|
|
|
- {{ record }}
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <template slot="radio" slot-scope="text">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ {{ text != null ? text + "%" : "0%" }}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
</a-table>
|
|
</a-table>
|
|
|
</a-drawer>
|
|
</a-drawer>
|
|
|
</div>
|
|
</div>
|
|
@@ -212,10 +214,12 @@ export default {
|
|
|
{
|
|
{
|
|
|
title: "金额",
|
|
title: "金额",
|
|
|
dataIndex: "applyAmount",
|
|
dataIndex: "applyAmount",
|
|
|
|
|
+ sorter: true,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: "占总支出比例",
|
|
title: "占总支出比例",
|
|
|
dataIndex: "radio",
|
|
dataIndex: "radio",
|
|
|
|
|
+ scopedSlots: { customRender: "radio" },
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
detailTable: [],
|
|
detailTable: [],
|
|
@@ -264,6 +268,23 @@ export default {
|
|
|
// }, 1000);
|
|
// }, 1000);
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ sortTable(pagination, filters, sorter) {
|
|
|
|
|
+ console.log(sorter);
|
|
|
|
|
+ if (sorter.order) {
|
|
|
|
|
+ const order = sorter.order === "ascend" ? "asc" : "desc";
|
|
|
|
|
+ if (order == "asc") {
|
|
|
|
|
+ // this.detailTable = this.detailTable.sort((a, b) => {
|
|
|
|
|
+ // // console.log(a.applyAmount, b.applyAmount);
|
|
|
|
|
+ // // return b.applyAmount - a.applyAmount;
|
|
|
|
|
+ // });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // this.detailTable = this.detailTable.sort((a, b) => {
|
|
|
|
|
+ // // console.log(a.applyAmount, b.applyAmount);
|
|
|
|
|
+ // // return a.applyAmount - b.applyAmount;
|
|
|
|
|
+ // });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
openDialog(val, type) {
|
|
openDialog(val, type) {
|
|
|
// console.log(val, type);
|
|
// console.log(val, type);
|
|
|
this.detailTable = [];
|
|
this.detailTable = [];
|