Преглед на файлове

Merge branch 'deploy' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into deploy

lilei преди 4 години
родител
ревизия
dd2e4e38d9
променени са 1 файла, в които са добавени 10 реда и са изтрити 1 реда
  1. 10 1
      src/views/inventoryManagement/inventoryQuery/list.vue

+ 10 - 1
src/views/inventoryManagement/inventoryQuery/list.vue

@@ -146,7 +146,7 @@ export default {
         { title: '原厂编码', dataIndex: 'productOrigCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品品牌', dataIndex: 'brandName', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', scopedSlots: { customRender: 'productTypeName' }, width: 240, align: 'center' },
-        { title: '现有库存数量(个)', scopedSlots: { customRender: 'currentStockQty' }, width: 165, align: 'center', sorter: true },
+        { title: '现有库存数量(个)', dataIndex: 'currentStockQty', scopedSlots: { customRender: 'currentStockQty' }, width: 165, align: 'center', sorter: true },
         { title: '现有库存成本(¥)', dataIndex: 'currentStockCost', width: 165, align: 'center', sorter: true, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
       ],
@@ -156,6 +156,15 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 370
         }
+        // 排序
+        if (parameter.sortField == 'currentStockQty') {
+          parameter.sortField = 'qty'
+          parameter.sortAlias = ''
+        }
+        if (parameter.sortField == 'currentStockCost') {
+          parameter.sortField = 'currentStockCost'
+          parameter.sortAlias = 'stock'
+        }
         return stockList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize