浏览代码

商品列表,增加供应商筛选条件

DELL 3 年之前
父节点
当前提交
f6f4224909
共有 1 个文件被更改,包括 18 次插入3 次删除
  1. 18 3
      src/views/business/goods/index.vue

+ 18 - 3
src/views/business/goods/index.vue

@@ -39,6 +39,7 @@
           <el-option :label="item.name" :value="item.tagId" v-for="(item, index) in goodsTagItemsList" :key="index" />
           <el-option :label="item.name" :value="item.tagId" v-for="(item, index) in goodsTagItemsList" :key="index" />
         </el-select>
         </el-select>
       </el-form-item>
       </el-form-item>
+      <br>
       <el-form-item label="上架状态" prop="status">
       <el-form-item label="上架状态" prop="status">
         <el-select v-model="queryParams.status" placeholder="请选择商品状态" clearable @change="queryParams.pageNum = 1;getList()">
         <el-select v-model="queryParams.status" placeholder="请选择商品状态" clearable @change="queryParams.pageNum = 1;getList()">
           <el-option label="全部" value="" />
           <el-option label="全部" value="" />
@@ -54,6 +55,12 @@
           <el-option label="不支持兑换" value="0" />
           <el-option label="不支持兑换" value="0" />
         </el-select>
         </el-select>
       </el-form-item>
       </el-form-item>
+      <el-form-item label="供应商" prop="supplierId">
+        <el-select v-model="queryParams.supplierId" placeholder="请选择供应商" filterable clearable  @clear="queryParams.pageNum = 1;getList()" @keyup.enter.native="queryParams.pageNum = 1;getList()">
+          <el-option :label="item.name" :value="item.id" v-for="(item, index) in SupplierList" :key="index" />
+        </el-select>
+      </el-form-item>
+      <br>
       <el-form-item label="采购价格" prop="minCost">
       <el-form-item label="采购价格" prop="minCost">
         <el-input v-model="queryParams.minCost" placeholder="最低采购价格" clearable @keyup.enter.native="queryParams.pageNum = 1;getList()" />
         <el-input v-model="queryParams.minCost" placeholder="最低采购价格" clearable @keyup.enter.native="queryParams.pageNum = 1;getList()" />
       </el-form-item>
       </el-form-item>
@@ -143,6 +150,7 @@ import { getGoodsList, delGoods, setGoodsStatus, setTableData} from '@/api/busin
 import { goodsCategoryItems } from '@/api/business/category'
 import { goodsCategoryItems } from '@/api/business/category'
 import { goodsTagItems } from '@/api/business/tag'
 import { goodsTagItems } from '@/api/business/tag'
 import { accMul } from '@/utils/util'
 import { accMul } from '@/utils/util'
+import { getSupplierList } from '@/api/business/supplier'
 export default {
 export default {
   name: 'List',
   name: 'List',
   data() {
   data() {
@@ -155,14 +163,23 @@ export default {
       total: 0,
       total: 0,
       goodsCategoryItemsList: [],
       goodsCategoryItemsList: [],
       goodsTagItemsList: [],
       goodsTagItemsList: [],
+      SupplierList: [],
     }
     }
   },
   },
   created() {
   created() {
     this.getList(true)
     this.getList(true)
     this.getGoodsCategoryItems()
     this.getGoodsCategoryItems()
     this.getGoodsTagItems()
     this.getGoodsTagItems()
+    this.getSupplierItems()
   },
   },
   methods: {
   methods: {
+    //获取供应商
+    getSupplierItems(){
+      getSupplierList({name:""}).then(res => {
+        this.SupplierList = res && res.rows
+      })
+    },
+
     //切换排序
     //切换排序
     sortChannelId(row){
     sortChannelId(row){
       if (row){
       if (row){
@@ -200,8 +217,6 @@ export default {
         return
         return
       }
       }
       this.loading = true
       this.loading = true
-      console.log(this.queryParams.minCost)
-
       // if (reset) {
       // if (reset) {
       //   this.queryParams = { pageNum: 1, pageSize: 20, orderByColumn: '', isAsc: '', }
       //   this.queryParams = { pageNum: 1, pageSize: 20, orderByColumn: '', isAsc: '', }
       // }
       // }
@@ -211,7 +226,7 @@ export default {
         categoryId: this.queryParams.categoryId,
         categoryId: this.queryParams.categoryId,
         tagId: this.queryParams.tagId,
         tagId: this.queryParams.tagId,
         status: this.queryParams.status,
         status: this.queryParams.status,
-        exchangeShow: this.queryParams.exchangeShow,
+        exchangeShow: this.queryParams.exchangeShow, supplierId: this.queryParams.supplierId,
         minCost: this.queryParams.minCost?accMul(this.queryParams.minCost, 100):this.queryParams.minCost,
         minCost: this.queryParams.minCost?accMul(this.queryParams.minCost, 100):this.queryParams.minCost,
         maxCost: this.queryParams.maxCost?accMul(this.queryParams.maxCost, 100):this.queryParams.maxCost,
         maxCost: this.queryParams.maxCost?accMul(this.queryParams.maxCost, 100):this.queryParams.maxCost,
         minValue: this.queryParams.minValue?accMul(this.queryParams.minValue, 100):this.queryParams.minValue,
         minValue: this.queryParams.minValue?accMul(this.queryParams.minValue, 100):this.queryParams.minValue,