|
@@ -20,6 +20,7 @@
|
|
|
:summary-method="summaryMethod"
|
|
|
@selection-change="selectionChange"
|
|
|
@expand-change="expandChange"
|
|
|
+ @search-criteria-switch="searchCriteriaSwitch"
|
|
|
>
|
|
|
<template slot-scope="{ row }" slot="expand">
|
|
|
<avue-crud
|
|
@@ -249,16 +250,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ searchCriteriaSwitch(type){
|
|
|
+ if (type){
|
|
|
+ this.option.height = this.option.height-190
|
|
|
+ }else {
|
|
|
+ this.option.height = this.option.height+190
|
|
|
+ }
|
|
|
+ this.$refs.crud.getTableHeight()
|
|
|
+ },
|
|
|
cellStyle() {
|
|
|
return "padding:0;height:40px;";
|
|
|
},
|
|
|
expandChange(row) {
|
|
|
if (!row.itemData) {
|
|
|
- getGoodsInfo({ id: row.id, tradeType: "CK" })
|
|
|
- .then(res => {
|
|
|
+ getGoodsInfo({ id: row.id, tradeType: "CK" }).then(res => {
|
|
|
this.dataList[row.$index].itemData = res.data.data;
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
+ }).finally(() => {
|
|
|
this.dataList[row.$index].itemLoading = false;
|
|
|
});
|
|
|
}
|
|
@@ -359,8 +366,7 @@ export default {
|
|
|
this.dataList.forEach(item => {
|
|
|
this.$refs.crud.toggleRowExpansion(item, false);
|
|
|
});
|
|
|
- getList(page.currentPage, page.pageSize, params)
|
|
|
- .then(res => {
|
|
|
+ getList(page.currentPage, page.pageSize, params).then(res => {
|
|
|
if (res.data.data.records) {
|
|
|
res.data.data.records.forEach(e => {
|
|
|
e.itemLoading = true;
|
|
@@ -369,10 +375,9 @@ export default {
|
|
|
this.dataList = res.data.data.records ? res.data.data.records : [];
|
|
|
this.page.total = res.data.data.total;
|
|
|
if (this.page.total) {
|
|
|
- this.option.height = window.innerHeight - 350;
|
|
|
+ this.option.height = window.innerHeight - 210;
|
|
|
}
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
+ }).finally(() => {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|