瀏覽代碼

change: indent.创建询价.sku选择.商品排序调整为indent Express Stock Other.

peter 3 周之前
父節點
當前提交
3d1347a1ec
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/pages/indent-manage/indent/components/skuSelect.vue

+ 7 - 1
src/pages/indent-manage/indent/components/skuSelect.vue

@@ -217,7 +217,7 @@ const getSku = () => {
     })
     .then((response: any) => {
       const res = response.hits
-      skuList.value = res.map((item: any) => {
+      let temp = res.map((item: any) => {
         const t =
           typeof item.images === 'string'
             ? `${item.images}`.split(',').filter((i: string) => i.length > 0)
@@ -231,6 +231,12 @@ const getSku = () => {
           }),
         }
       })
+      // product_type属性有几种类型 indent Express Stock Other. 把他们按这个顺序排雷, 所有indent要出现在嘴在前面, Other在最后面
+      temp.sort((a: any, b: any) => {
+        const order = ['indent', 'Express', 'Stock', 'Other']
+        return order.indexOf(a.product_type) - order.indexOf(b.product_type)
+      })
+      skuList.value = temp
       total.value = response.nbHits > 1000 ? 1000 : response.nbHits
     })
     .finally(() => {