排序相关修改

prod
anthonywj 2 years ago
parent 64f7525706
commit f8a383e4f3

@ -58,7 +58,9 @@
</el-button-group>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%" border>
<el-table v-loading="loading" :data="list" style="width: 100%"
:default-sort="defaultSort" @sort-change="handleSortChange"
border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="UDI码"
@ -105,6 +107,8 @@
label="单据日期"
prop="orderTime"
width="150"
:sort-orders="['ascending', 'descending']"
sortable="custom"
show-overflow-tooltip
></el-table-column>
</el-table>
@ -147,6 +151,7 @@ export default {
list: [],
total: 0,
loading: false,
defaultSort: {prop: 'orderTime', order: 'desc'},
};
},
methods: {
@ -176,6 +181,17 @@ export default {
this.invPreProductDetailQuery.page = val;
this.getList();
},
handleSortChange(column, prop, order) {
if (column.order === 'descending') {
this.invPreProductDetailQuery.sort = 'desc'
} else {
this.invPreProductDetailQuery.sort = 'asc'
}
this.invPreProductDetailQuery.orderBy = column.prop;
this.getList();
},
getList() {
this.loading = true;
this.invPreProductDetailQuery.relId = this.inputQuery.relId;

@ -58,7 +58,9 @@
</el-button-group>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%" border>
<el-table v-loading="loading" :data="list" style="width: 100%"
:default-sort="defaultSort" @sort-change="handleSortChange"
border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="UDI码"
@ -104,6 +106,8 @@
<el-table-column
label="单据日期"
prop="orderTime"
:sort-orders="['ascending', 'descending']"
sortable="custom"
width="150"
show-overflow-tooltip
></el-table-column>
@ -142,7 +146,8 @@ export default {
deptCode: null,
invCode: null,
page: 1,
limit: 10
limit: 10,
defaultSort: {prop: 'orderTime', order: 'desc'},
},
list: [],
total: 0,
@ -176,6 +181,17 @@ export default {
this.invPreProductDetailQuery.page = val;
this.getList();
},
handleSortChange(column, prop, order) {
if (column.order === 'descending') {
this.invPreProductDetailQuery.sort = 'desc'
} else {
this.invPreProductDetailQuery.sort = 'asc'
}
this.invPreProductDetailQuery.orderBy = column.prop;
this.getList();
},
getList() {
this.loading = true;
this.invPreProductDetailQuery.relId = this.inputQuery.relId;

@ -56,7 +56,10 @@
</el-button-group>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="list" style="width: 100%" border>
<el-table v-loading="loading" :data="list" style="width: 100%"
:default-sort="defaultSort"
@sort-change="handleSortChange"
border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="UDI码"
@ -102,6 +105,8 @@
<el-table-column
label="单据日期"
prop="orderTime"
:sort-orders="['ascending', 'descending']"
sortable="custom"
width="150"
show-overflow-tooltip
></el-table-column>
@ -144,6 +149,7 @@ export default {
list: [],
total: 0,
loading: false,
defaultSort: {prop: 'orderTime', order: 'desc'},
};
},
methods: {
@ -173,6 +179,17 @@ export default {
this.invProductDetailQuery.page = val;
this.getList();
},
handleSortChange(column, prop, order) {
if (column.order === 'descending') {
this.invProductDetailQuery.sort = 'desc'
} else {
this.invProductDetailQuery.sort = 'asc'
}
this.invProductDetailQuery.orderBy = column.prop;
this.getList();
},
getList() {
this.loading = true;
this.invProductDetailQuery.relId = this.inputQuery.relId;

Loading…
Cancel
Save