Browse Source

库存管理(按类别查询)

chris 2 years ago
parent
commit
1452069168
1 changed files with 36 additions and 14 deletions
  1. 36 14
      src/views/modules/warehouse/stock.vue

+ 36 - 14
src/views/modules/warehouse/stock.vue

@@ -6,6 +6,14 @@
           <el-form-item label="名称">
             <el-input v-model="dataForm.materialName" placeholder="请输入名称" clearable/>
           </el-form-item>
+          <el-form-item label="类别">
+            <el-cascader
+              v-model="dataForm.materialTypeId"
+              placeholder="请输入"
+              :options="optionsCate"
+              :props="{ expandTrigger: 'hover' }">
+            </el-cascader>
+          </el-form-item>
           <el-form-item>
             <el-button @click="getDataList()">查询</el-button>
 <!--            <el-button v-if="isAuth('wh:stockmanagement:exported')" type="primary" @click="exportExcel()">导出Excel</el-button>-->
@@ -38,6 +46,12 @@
             :show-tooltip-when-overflow="true"
             label="编码">
           </el-table-column>
+          <el-table-column
+            prop="categoryName"
+            header-align="center"
+            align="center"
+            label="类别">
+          </el-table-column>
           <el-table-column
             prop="materialName"
             header-align="center"
@@ -47,10 +61,12 @@
             label="名称">
           </el-table-column>
           <el-table-column
-              prop="categoryName"
-              header-align="center"
-              align="center"
-              label="类别">
+            prop="specifications"
+            header-align="center"
+            align="center"
+            width="140"
+            :show-overflow-tooltip="true"
+            label="规格">
           </el-table-column>
           <el-table-column
             prop="isInventory"
@@ -65,14 +81,6 @@
             align="center"
             label="锁库数量">
           </el-table-column>
-          <el-table-column
-            prop="specifications"
-            header-align="center"
-            align="center"
-            min-width="100"
-            :show-overflow-tooltip="true"
-            label="规格">
-          </el-table-column>
           <el-table-column
             prop="unitName"
             header-align="center"
@@ -166,10 +174,12 @@ export default {
         dataListSelections: [],
         detailVisible: false,
         addOrUpdateVisible: false,
-        noticeChangeAttachVisible: false
+        noticeChangeAttachVisible: false,
+        optionsCate: [] // 类别
       }
     },
     activated () {
+      this.getCate()
       this.getDataList()
     },
     methods: {
@@ -178,6 +188,17 @@ export default {
         this.detailVisible = false
         this.noticeChangeAttachVisible = false
       },
+      // 获取类别
+      getCate () {
+        this.$http({
+          url: this.$http.adornUrl('/biz-service/stock-mg-ctl/listCategory'),
+          method: 'get'
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            this.optionsCate = data.data
+          }
+        })
+      },
       // 获取数据列表
       getDataList () {
         this.dataListLoading = true
@@ -187,7 +208,8 @@ export default {
           params: this.$http.adornParams({
             'current': this.pageIndex,
             'size': this.pageSize,
-            'materialName': this.dataForm.materialName
+            'materialName': this.dataForm.materialName,
+            'materialTypeId': this.dataForm.materialTypeId ? this.dataForm.materialTypeId[0] : ''
           })
         }).then(({data}) => {
           if (data && data.code === '200') {