|
@@ -94,7 +94,7 @@
|
|
|
:dataSource="detailTable"
|
|
:dataSource="detailTable"
|
|
|
:pagination="false"
|
|
:pagination="false"
|
|
|
style="background: #fff"
|
|
style="background: #fff"
|
|
|
- rowKey="id"
|
|
|
|
|
|
|
+ rowKey="expensesId"
|
|
|
:scroll="{ y: 900 }"
|
|
:scroll="{ y: 900 }"
|
|
|
:loading="detailsLoading"
|
|
:loading="detailsLoading"
|
|
|
@change="sortTable"
|
|
@change="sortTable"
|
|
@@ -196,6 +196,7 @@ export default {
|
|
|
// mixins: [mixin],
|
|
// mixins: [mixin],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ sortedInfo: null,
|
|
|
columns1: [
|
|
columns1: [
|
|
|
{
|
|
{
|
|
|
title: "序号",
|
|
title: "序号",
|
|
@@ -215,6 +216,7 @@ export default {
|
|
|
title: "金额",
|
|
title: "金额",
|
|
|
dataIndex: "applyAmount",
|
|
dataIndex: "applyAmount",
|
|
|
sorter: true,
|
|
sorter: true,
|
|
|
|
|
+ // sortOrder: sortedInfo.columnKey === "applyAmount" && sortedInfo.order,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: "占总支出比例",
|
|
title: "占总支出比例",
|
|
@@ -260,6 +262,11 @@ export default {
|
|
|
],
|
|
],
|
|
|
yearShowOne: false,
|
|
yearShowOne: false,
|
|
|
time: "",
|
|
time: "",
|
|
|
|
|
+ orderBy: null,
|
|
|
|
|
+ detailObj: {
|
|
|
|
|
+ yearAndMonth: "",
|
|
|
|
|
+ type: "",
|
|
|
|
|
+ },
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -271,32 +278,26 @@ export default {
|
|
|
sortTable(pagination, filters, sorter) {
|
|
sortTable(pagination, filters, sorter) {
|
|
|
console.log(sorter);
|
|
console.log(sorter);
|
|
|
if (sorter.order) {
|
|
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;
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ // const sorterColumn = sorter.field;
|
|
|
|
|
+ this.orderBy = sorter.order === "ascend" ? "asc" : "desc";
|
|
|
|
|
+ console.log(this.orderBy);
|
|
|
|
|
+ if (this.orderBy == "asc") {
|
|
|
|
|
+ this.getDetailTreeList(this.detailObj);
|
|
|
} else {
|
|
} else {
|
|
|
- // this.detailTable = this.detailTable.sort((a, b) => {
|
|
|
|
|
- // // console.log(a.applyAmount, b.applyAmount);
|
|
|
|
|
- // // return a.applyAmount - b.applyAmount;
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ this.getDetailTreeList(this.detailObj);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- openDialog(val, type) {
|
|
|
|
|
- // console.log(val, type);
|
|
|
|
|
- this.detailTable = [];
|
|
|
|
|
- this.visible = true;
|
|
|
|
|
|
|
+ getDetailTreeList(obj) {
|
|
|
this.detailsLoading = true;
|
|
this.detailsLoading = true;
|
|
|
this.$API.profit
|
|
this.$API.profit
|
|
|
.getDetails({
|
|
.getDetails({
|
|
|
- yearAndMonth: val.yearAndMonth,
|
|
|
|
|
- expensesType: type,
|
|
|
|
|
|
|
+ yearAndMonth: obj.yearAndMonth,
|
|
|
|
|
+ expensesType: obj.type,
|
|
|
|
|
+ orderBy: this.orderBy,
|
|
|
})
|
|
})
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
- // console.log(res);
|
|
|
|
|
|
|
+ console.log(res);
|
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
|
this.detailsLoading = false;
|
|
this.detailsLoading = false;
|
|
|
|
|
|
|
@@ -304,6 +305,17 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ openDialog(val, type) {
|
|
|
|
|
+ // console.log(val, type);
|
|
|
|
|
+ this.detailTable = [];
|
|
|
|
|
+ this.visible = true;
|
|
|
|
|
+ this.detailObj = {
|
|
|
|
|
+ yearAndMonth: val.yearAndMonth,
|
|
|
|
|
+ type: type,
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ this.getDetailTreeList(this.detailObj);
|
|
|
|
|
+ },
|
|
|
onLoadData(treeNode) {
|
|
onLoadData(treeNode) {
|
|
|
return new Promise((resolve) => {
|
|
return new Promise((resolve) => {
|
|
|
if (treeNode.dataRef.children) {
|
|
if (treeNode.dataRef.children) {
|