chenrui 2 роки тому
батько
коміт
1c5b22b01d

+ 3 - 3
src/views/numsGoodsShelves/vinAnalysis/detailModal.vue

@@ -34,7 +34,7 @@
           <td>{{ item.productName|| '--' }}</td>
           <td>{{ item.origCode || '--' }}</td>
           <td>{{ item.isShelfProduct|| '--' }}</td>
-          <td>{{ (item.currQty||item.currQty==0) ? item.currQty :'--' }}</td>
+          <td>{{ (item.qty||item.qty==0) ? item.qty :'--' }}</td>
         </tr>
         <!-- 空气滤清器 -->
         <tr v-for="(item,index) in itemData.airFilterFlag" :key="index">
@@ -43,7 +43,7 @@
           <td>{{ item.productName|| '--' }}</td>
           <td>{{ item.origCode || '--' }}</td>
           <td>{{ item.isShelfProduct|| '--' }}</td>
-          <td>{{ (item.currQty||item.currQty==0) ? item.currQty :'--' }}</td>
+          <td>{{ (item.qty||item.qty==0) ? item.qty :'--' }}</td>
         </tr>
         <!-- 机油滤清器 -->
         <tr v-for="(item,index) in itemData.engineOilFilterFlag" :key="index">
@@ -52,7 +52,7 @@
           <td>{{ item.productName|| '--' }}</td>
           <td>{{ item.origCode || '--' }}</td>
           <td>{{ item.isShelfProduct|| '--' }}</td>
-          <td>{{ (item.currQty||item.currQty==0) ? item.currQty : '--' }}</td>
+          <td>{{ (item.qty||item.qty==0) ? item.qty : '--' }}</td>
         </tr>
       </table>
     </div>

+ 22 - 3
src/views/numsGoodsShelves/vinAnalysis/spList.vue

@@ -138,11 +138,29 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
+      order_by:'',
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.spinning = true
         this.disabled = true
-        const params = Object.assign(parameter, this.queryParam)
+        let newParameter=parameter;
+        if(newParameter.sortField && newParameter.sortField == "inStockCount"){//有货
+          if(newParameter.sortOrder!="ascend"){//降序
+            newParameter.orderBy = 'xvfp.in_stock_count desc,xp.code asc'
+          }else{
+            newParameter.orderBy = 'xvfp.in_stock_count asc,xp.code asc'
+          }
+          this.order_by = newParameter.orderBy;
+        }
+        if(newParameter.sortField && newParameter.sortField == "notStockCount"){//无货
+          if(newParameter.sortOrder!="ascend"){//降序
+            newParameter.orderBy = 'xvfp.not_stock_count desc,xp.code asc'
+          }else{
+            newParameter.orderBy = 'xvfp.not_stock_count asc,xp.code asc'
+          }
+          this.order_by = newParameter.orderBy;
+        }
+        const params = Object.assign(newParameter, this.queryParam,{orderBy:this.order_by})
 
         delete params.time
         return reportPage(params).then(res => {
@@ -172,8 +190,8 @@ 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: true },
-        { title: '适配缺货次数', dataIndex: 'notStockCount', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' }, sorter: true }
+        { 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 }
       ]
       return arr
@@ -237,6 +255,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const params = _this.queryParam
+          params.orderBy=this.order_by
           _this.exportLoading = true
           _this.spinning = true
           exportReport(params).then(res => {