md
This commit is contained in:
parent
d35aa6049a
commit
20c2d47c32
@ -300,7 +300,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
||||||
handleSortChange(column) {
|
handleSortChange(column) {
|
||||||
this.emisSettleSubBillList = this.emisSettleSubBillList.sort(
|
this.emisCreditCustomerList = this.emisCreditCustomerList.sort(
|
||||||
this.sortFun(column.prop, column.order === 'ascending')
|
this.sortFun(column.prop, column.order === 'ascending')
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -349,12 +349,7 @@ export default {
|
|||||||
this.selectionList=selection;
|
this.selectionList=selection;
|
||||||
|
|
||||||
},
|
},
|
||||||
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
|
||||||
handleSortChange(column) {
|
|
||||||
this.queryParams.orderByColumn = column.prop;
|
|
||||||
this.queryParams.isAsc = column.order;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd(row) {
|
handleAdd(row) {
|
||||||
this.currentId=null;
|
this.currentId=null;
|
||||||
|
|||||||
@ -124,7 +124,7 @@
|
|||||||
{{ scope.row.useMoney }}
|
{{ scope.row.useMoney }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('剩余比例(%)')" align="center" prop="curMoneyRate" min-width="130" >
|
<el-table-column :label="$t('剩余比例(%)')" align="center" prop="curMoneyRate" min-width="130" :sortable="true">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ ( ((scope.row.creditMoney - scope.row.useMoney)/scope.row.creditMoney)*100 ).toFixed(2) }}%
|
{{ ( ((scope.row.creditMoney - scope.row.useMoney)/scope.row.creditMoney)*100 ).toFixed(2) }}%
|
||||||
</template>
|
</template>
|
||||||
@ -232,6 +232,40 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getProperty(obj, str) {
|
||||||
|
str = str.replace(/\[(\w+)\]/g, ".$1"); // 处理数组下标
|
||||||
|
let arr = str.split(".");
|
||||||
|
for (let i in arr) {
|
||||||
|
obj = obj[arr[i]] || "";
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
},
|
||||||
|
sortFun: function (attr, rev) {
|
||||||
|
//第一个参数传入info里的prop表示排的是哪一列,第二个参数是升还是降排序
|
||||||
|
if (rev == undefined||rev==null) {
|
||||||
|
rev = 1;
|
||||||
|
} else {
|
||||||
|
rev = (rev) ? 1 : -1;
|
||||||
|
}
|
||||||
|
let that=this;
|
||||||
|
return function (a, b) {
|
||||||
|
a = that.getProperty(a,attr);
|
||||||
|
b = that.getProperty(b,attr);
|
||||||
|
if (a < b) {
|
||||||
|
return rev * -1;
|
||||||
|
}
|
||||||
|
if (a > b) {
|
||||||
|
return rev * 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
||||||
|
handleSortChange(column) {
|
||||||
|
this.emisCreditSalesmenList = this.emisCreditSalesmenList.sort(
|
||||||
|
this.sortFun(column.prop, column.order === 'ascending')
|
||||||
|
);
|
||||||
|
},
|
||||||
/** 查询销售信用额度列表 */
|
/** 查询销售信用额度列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
@ -285,12 +319,6 @@ export default {
|
|||||||
this.single = selection.length!==1
|
this.single = selection.length!==1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
|
||||||
handleSortChange(column) {
|
|
||||||
this.queryParams.orderByColumn = column.prop;
|
|
||||||
this.queryParams.isAsc = column.order;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
handleAdd(row) {
|
handleAdd(row) {
|
||||||
this.currentId=null;
|
this.currentId=null;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user