فهرست منبع

修改筛选问题

chenrui 2 سال پیش
والد
کامیت
feb0c871eb
1فایلهای تغییر یافته به همراه18 افزوده شده و 13 حذف شده
  1. 18 13
      src/views/numsGoodsShelves/vinAnalysis/spList.vue

+ 18 - 13
src/views/numsGoodsShelves/vinAnalysis/spList.vue

@@ -138,29 +138,34 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      order_by:'',
+      order_by: '',
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
         this.disabled = true
-        let newParameter=parameter;
-        if(newParameter.sortField && newParameter.sortField == "inStockCount"){//有货
-          if(newParameter.sortOrder!="ascend"){//降序
+        const newParameter = parameter
+        if (newParameter.sortField && newParameter.sortField == 'inStockCount') { // 有货
+          if (newParameter.sortOrder != 'ascend') { // 降序
             newParameter.orderBy = 'xvfp.in_stock_count desc,xp.code asc'
-          }else{
+          } else {
             newParameter.orderBy = 'xvfp.in_stock_count asc,xp.code asc'
           }
-          this.order_by = newParameter.orderBy;
+          this.order_by = newParameter.orderBy
+        } else {
+          this.order_by = ''
         }
-        if(newParameter.sortField && newParameter.sortField == "notStockCount"){//无货
-          if(newParameter.sortOrder!="ascend"){//降序
+        if (newParameter.sortField && newParameter.sortField == 'notStockCount') { // 无货
+          if (newParameter.sortOrder != 'ascend') { // 降序
             newParameter.orderBy = 'xvfp.not_stock_count desc,xp.code asc'
-          }else{
+          } else {
             newParameter.orderBy = 'xvfp.not_stock_count asc,xp.code asc'
           }
-          this.order_by = newParameter.orderBy;
+          this.order_by = newParameter.orderBy
+        } else {
+          this.order_by = ''
         }
-        const params = Object.assign(newParameter, this.queryParam,{orderBy:this.order_by})
+
+        const params = Object.assign(newParameter, this.queryParam, { orderBy: this.order_by })
 
         delete params.time
         return reportPage(params).then(res => {
@@ -190,7 +195,7 @@ export default {
         { title: '原厂编码', dataIndex: 'origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品品牌', dataIndex: 'brandName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品分类', slots: { title: 'type' }, scopedSlots: { customRender: 'type' }, width: '10%', align: 'center' },
-        { title: '适配有货次数', dataIndex: 'inStockCount', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' }, sorter: (a, b) => a.inStockCount - b.inStockCount},
+        { title: '适配有货次数', dataIndex: 'inStockCount', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' }, sorter: (a, b) => a.inStockCount - b.inStockCount },
         { title: '适配缺货次数', dataIndex: 'notStockCount', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' }, sorter: (a, b) => a.notStockCount - b.notStockCount }
         // { title: '最近VIN扫描时间', dataIndex: 'scanVinDate', width: '7%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true }
       ]
@@ -255,7 +260,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const params = _this.queryParam
-          params.orderBy=this.order_by
+          params.orderBy = this.order_by
           _this.exportLoading = true
           _this.spinning = true
           exportReport(params).then(res => {