Jelajahi Sumber

修改排序

chencc 1 tahun lalu
induk
melakukan
b6ce6818aa
1 mengubah file dengan 14 tambahan dan 1 penghapusan
  1. 14 1
      src/views/material/product/components/index-data.vue

+ 14 - 1
src/views/material/product/components/index-data.vue

@@ -8,7 +8,7 @@
       :need-page="true"
       :need-page="true"
       :selection.sync="selection"
       :selection.sync="selection"
       :current.sync="rowCurrent"
       :current.sync="rowCurrent"
-      
+      @sort-change="onSortChange"
       highlight-current-row
       highlight-current-row
       height="calc(100vh - 412px)"
       height="calc(100vh - 412px)"
       full-height="calc(100vh - 116px)"
       full-height="calc(100vh - 116px)"
@@ -307,6 +307,7 @@ export default {
           label: '编码',
           label: '编码',
           align: 'center',
           align: 'center',
           showOverflowTooltip: true,
           showOverflowTooltip: true,
+          sortable: true,
           minWidth: 110
           minWidth: 110
         },
         },
         {
         {
@@ -469,6 +470,17 @@ export default {
   },
   },
 
 
   methods: {
   methods: {
+
+    onSortChange(e) {
+      console.log(e,'99999999');
+
+      let sort = {
+        orderBy: e.order,
+        sortName: e.prop,
+      };
+      this.sort = sort;
+      this.reload();
+    },
     getDictValueFn(e) {
     getDictValueFn(e) {
       // console.log(e,'3333333333333');
       // console.log(e,'3333333333333');
       if(e.length){
       if(e.length){
@@ -540,6 +552,7 @@ export default {
       let labs= getMaterialList({
       let labs= getMaterialList({
         pageNum: page,
         pageNum: page,
         size: limit,
         size: limit,
+        ...this.sort,
         ...where,
         ...where,
         categoryLevelId: this.currentId
         categoryLevelId: this.currentId
       });
       });